import a from "./index.es227.js";
import h from "./index.es312.js";
import m from "./index.es313.js";
import b from "./index.es314.js";
import c from "./index.es238.js";
const s = {
  http: h,
  xhr: m,
  fetch: b
};
a.forEach(s, (e, o) => {
  if (e) {
    try {
      Object.defineProperty(e, "name", { value: o });
    } catch {
    }
    Object.defineProperty(e, "adapterName", { value: o });
  }
});
const d = (e) => `- ${e}`, u = (e) => a.isFunction(e) || e === null || e === !1, y = {
  getAdapter: (e) => {
    e = a.isArray(e) ? e : [e];
    const { length: o } = e;
    let n, r;
    const p = {};
    for (let t = 0; t < o; t++) {
      n = e[t];
      let i;
      if (r = n, !u(n) && (r = s[(i = String(n)).toLowerCase()], r === void 0))
        throw new c(`Unknown adapter '${i}'`);
      if (r)
        break;
      p[i || "#" + t] = r;
    }
    if (!r) {
      const t = Object.entries(p).map(
        ([f, l]) => `adapter ${f} ` + (l === !1 ? "is not supported by the environment" : "is not available in the build")
      );
      let i = o ? t.length > 1 ? `since :
` + t.map(d).join(`
`) : " " + d(t[0]) : "as no adapter specified";
      throw new c(
        "There is no suitable adapter to dispatch the request " + i,
        "ERR_NOT_SUPPORT"
      );
    }
    return r;
  },
  adapters: s
};
export {
  y as default
};
//# sourceMappingURL=index.es242.js.map
