const h = (a, c, t = !1) => new Promise((o, i) => {
  fetch(a, {
    headers: {
      Accept: "application/json",
      "Content-Type": "application/json"
    },
    method: "POST",
    body: JSON.stringify(c)
  }).then(
    function(n) {
      n.status !== 200 && i(n), t && o(n.blob()), n.json().then(function(s) {
        o(s);
      }).catch(() => o(n.status));
    }
  ).catch(function(n) {
    i(n);
  });
}), p = async (a, c = {}) => {
  try {
    const t = await fetch(a, {
      headers: {
        Accept: "application/json",
        "Content-Type": "application/json"
      }
    });
    if (!t.ok)
      throw t;
    return await t.json();
  } catch (t) {
    throw t;
  }
};
export {
  p as get,
  h as post
};
