import { u as b } from "./index.es119.js";
import { b as C } from "./index.es252.js";
import { I as E } from "./index.es253.js";
import { d as R } from "./index.es254.js";
import { m as $ } from "./index.es122.js";
import { v as A } from "./index.es255.js";
var c = b, L = C, v = E, y = R, f = $, q = A, n = q.validators;
function p(u) {
  this.defaults = u, this.interceptors = {
    request: new v(),
    response: new v()
  };
}
p.prototype.request = function(e, t) {
  typeof e == "string" ? (t = t || {}, t.url = e) : t = e || {}, t = f(this.defaults, t), t.method ? t.method = t.method.toLowerCase() : this.defaults.method ? t.method = this.defaults.method.toLowerCase() : t.method = "get";
  var a = t.transitional;
  a !== void 0 && q.assertOptions(a, {
    silentJSONParsing: n.transitional(n.boolean),
    forcedJSONParsing: n.transitional(n.boolean),
    clarifyTimeoutError: n.transitional(n.boolean)
  }, !1);
  var o = [], d = !0;
  this.interceptors.request.forEach(function(s) {
    typeof s.runWhen == "function" && s.runWhen(t) === !1 || (d = d && s.synchronous, o.unshift(s.fulfilled, s.rejected));
  });
  var h = [];
  this.interceptors.response.forEach(function(s) {
    h.push(s.fulfilled, s.rejected);
  });
  var r;
  if (!d) {
    var i = [y, void 0];
    for (Array.prototype.unshift.apply(i, o), i = i.concat(h), r = Promise.resolve(t); i.length; )
      r = r.then(i.shift(), i.shift());
    return r;
  }
  for (var m = t; o.length; ) {
    var w = o.shift(), I = o.shift();
    try {
      m = w(m);
    } catch (l) {
      I(l);
      break;
    }
  }
  try {
    r = y(m);
  } catch (l) {
    return Promise.reject(l);
  }
  for (; h.length; )
    r = r.then(h.shift(), h.shift());
  return r;
};
p.prototype.getUri = function(e) {
  return e = f(this.defaults, e), L(e.url, e.params, e.paramsSerializer).replace(/^\?/, "");
};
c.forEach(["delete", "get", "head", "options"], function(e) {
  p.prototype[e] = function(t, a) {
    return this.request(f(a || {}, {
      method: e,
      url: t,
      data: (a || {}).data
    }));
  };
});
c.forEach(["post", "put", "patch"], function(e) {
  p.prototype[e] = function(t, a, o) {
    return this.request(f(o || {}, {
      method: e,
      url: t,
      data: a
    }));
  };
});
var W = p;
export {
  W as A
};
//# sourceMappingURL=index.es121.js.map
