import utils from "./utils.mjs";
import bind from "./helpers/bind.mjs";
import Axios from "./core/Axios.mjs";
import mergeConfig from "./core/mergeConfig.mjs";
import defaults from "./defaults/index.mjs";
import formDataToJSON from "./helpers/formDataToJSON.mjs";
import CanceledError from "./cancel/CanceledError.mjs";
import CancelToken from "./cancel/CancelToken.mjs";
import isCancel from "./cancel/isCancel.mjs";
import { VERSION } from "./env/data.mjs";
import toFormData from "./helpers/toFormData.mjs";
import AxiosError from "./core/AxiosError.mjs";
import spread from "./helpers/spread.mjs";
import isAxiosError from "./helpers/isAxiosError.mjs";
import AxiosHeaders from "./core/AxiosHeaders.mjs";
import adapters from "./adapters/adapters.mjs";
import HttpStatusCode from "./helpers/HttpStatusCode.mjs";
function createInstance(defaultConfig) {
  const context = new Axios(defaultConfig);
  const instance = bind(Axios.prototype.request, context);
  utils.extend(instance, Axios.prototype, context, { allOwnKeys: true });
  utils.extend(instance, context, null, { allOwnKeys: true });
  instance.create = function create(instanceConfig) {
    return createInstance(mergeConfig(defaultConfig, instanceConfig));
  };
  return instance;
}
const axios = createInstance(defaults);
axios.Axios = Axios;
axios.CanceledError = CanceledError;
axios.CancelToken = CancelToken;
axios.isCancel = isCancel;
axios.VERSION = VERSION;
axios.toFormData = toFormData;
axios.AxiosError = AxiosError;
axios.Cancel = axios.CanceledError;
axios.all = function all(promises) {
  return Promise.all(promises);
};
axios.spread = spread;
axios.isAxiosError = isAxiosError;
axios.mergeConfig = mergeConfig;
axios.AxiosHeaders = AxiosHeaders;
axios.formToJSON = (thing) => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
axios.getAdapter = adapters.getAdapter;
axios.HttpStatusCode = HttpStatusCode;
axios.default = axios;
export {
  axios as default
};
