import C from "./helpers/bind.mjs";
const { toString: E } = Object.prototype, { getPrototypeOf: F } = Object, d = ((e) => (t) => {
  const r = E.call(t);
  return e[r] || (e[r] = r.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null)), l = (e) => (e = e.toLowerCase(), (t) => d(t) === e), m = (e) => (t) => typeof t === e, { isArray: u } = Array, a = m("undefined");
function k(e) {
  return e !== null && !a(e) && e.constructor !== null && !a(e.constructor) && i(e.constructor.isBuffer) && e.constructor.isBuffer(e);
}
const b = l("ArrayBuffer");
function I(e) {
  let t;
  return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && b(e.buffer), t;
}
const N = m("string"), i = m("function"), P = m("number"), w = (e) => e !== null && typeof e == "object", U = (e) => e === !0 || e === !1, y = (e) => {
  if (d(e) !== "object")
    return !1;
  const t = F(e);
  return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
}, H = l("Date"), M = l("File"), V = l("Blob"), _ = l("FileList"), R = (e) => w(e) && i(e.pipe), z = (e) => {
  let t;
  return e && (typeof FormData == "function" && e instanceof FormData || i(e.append) && ((t = d(e)) === "formdata" || // detect form-data instance
  t === "object" && i(e.toString) && e.toString() === "[object FormData]"));
}, G = l("URLSearchParams"), J = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function p(e, t, { allOwnKeys: r = !1 } = {}) {
  if (e === null || typeof e > "u")
    return;
  let n, o;
  if (typeof e != "object" && (e = [e]), u(e))
    for (n = 0, o = e.length; n < o; n++)
      t.call(null, e[n], n, e);
  else {
    const s = r ? Object.getOwnPropertyNames(e) : Object.keys(e), c = s.length;
    let f;
    for (n = 0; n < c; n++)
      f = s[n], t.call(null, e[f], f, e);
  }
}
function L(e, t) {
  t = t.toLowerCase();
  const r = Object.keys(e);
  let n = r.length, o;
  for (; n-- > 0; )
    if (o = r[n], t === o.toLowerCase())
      return o;
  return null;
}
const x = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), B = (e) => !a(e) && e !== x;
function A() {
  const { caseless: e } = B(this) && this || {}, t = {}, r = (n, o) => {
    const s = e && L(t, o) || o;
    y(t[s]) && y(n) ? t[s] = A(t[s], n) : y(n) ? t[s] = A({}, n) : u(n) ? t[s] = n.slice() : t[s] = n;
  };
  for (let n = 0, o = arguments.length; n < o; n++)
    arguments[n] && p(arguments[n], r);
  return t;
}
const K = (e, t, r, { allOwnKeys: n } = {}) => (p(t, (o, s) => {
  r && i(o) ? e[s] = C(o, r) : e[s] = o;
}, { allOwnKeys: n }), e), q = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), W = (e, t, r, n) => {
  e.prototype = Object.create(t.prototype, n), e.prototype.constructor = e, Object.defineProperty(e, "super", {
    value: t.prototype
  }), r && Object.assign(e.prototype, r);
}, $ = (e, t, r, n) => {
  let o, s, c;
  const f = {};
  if (t = t || {}, e == null)
    return t;
  do {
    for (o = Object.getOwnPropertyNames(e), s = o.length; s-- > 0; )
      c = o[s], (!n || n(c, e, t)) && !f[c] && (t[c] = e[c], f[c] = !0);
    e = r !== !1 && F(e);
  } while (e && (!r || r(e, t)) && e !== Object.prototype);
  return t;
}, Q = (e, t, r) => {
  e = String(e), (r === void 0 || r > e.length) && (r = e.length), r -= t.length;
  const n = e.indexOf(t, r);
  return n !== -1 && n === r;
}, X = (e) => {
  if (!e)
    return null;
  if (u(e))
    return e;
  let t = e.length;
  if (!P(t))
    return null;
  const r = new Array(t);
  for (; t-- > 0; )
    r[t] = e[t];
  return r;
}, Y = ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && F(Uint8Array)), Z = (e, t) => {
  const n = (e && e[Symbol.iterator]).call(e);
  let o;
  for (; (o = n.next()) && !o.done; ) {
    const s = o.value;
    t.call(e, s[0], s[1]);
  }
}, j = (e, t) => {
  let r;
  const n = [];
  for (; (r = e.exec(t)) !== null; )
    n.push(r);
  return n;
}, v = l("HTMLFormElement"), ee = (e) => e.toLowerCase().replace(
  /[-_\s]([a-z\d])(\w*)/g,
  function(r, n, o) {
    return n.toUpperCase() + o;
  }
), h = (({ hasOwnProperty: e }) => (t, r) => e.call(t, r))(Object.prototype), te = l("RegExp"), D = (e, t) => {
  const r = Object.getOwnPropertyDescriptors(e), n = {};
  p(r, (o, s) => {
    let c;
    (c = t(o, s, e)) !== !1 && (n[s] = c || o);
  }), Object.defineProperties(e, n);
}, ne = (e) => {
  D(e, (t, r) => {
    if (i(e) && ["arguments", "caller", "callee"].indexOf(r) !== -1)
      return !1;
    const n = e[r];
    if (i(n)) {
      if (t.enumerable = !1, "writable" in t) {
        t.writable = !1;
        return;
      }
      t.set || (t.set = () => {
        throw Error("Can not rewrite read-only method '" + r + "'");
      });
    }
  });
}, re = (e, t) => {
  const r = {}, n = (o) => {
    o.forEach((s) => {
      r[s] = !0;
    });
  };
  return u(e) ? n(e) : n(String(e).split(t)), r;
}, oe = () => {
}, se = (e, t) => (e = +e, Number.isFinite(e) ? e : t), g = "abcdefghijklmnopqrstuvwxyz", S = "0123456789", T = {
  DIGIT: S,
  ALPHA: g,
  ALPHA_DIGIT: g + g.toUpperCase() + S
}, ce = (e = 16, t = T.ALPHA_DIGIT) => {
  let r = "";
  const { length: n } = t;
  for (; e--; )
    r += t[Math.random() * n | 0];
  return r;
};
function ie(e) {
  return !!(e && i(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]);
}
const le = (e) => {
  const t = new Array(10), r = (n, o) => {
    if (w(n)) {
      if (t.indexOf(n) >= 0)
        return;
      if (!("toJSON" in n)) {
        t[o] = n;
        const s = u(n) ? [] : {};
        return p(n, (c, f) => {
          const O = r(c, o + 1);
          !a(O) && (s[f] = O);
        }), t[o] = void 0, s;
      }
    }
    return n;
  };
  return r(e, 0);
}, fe = l("AsyncFunction"), ue = (e) => e && (w(e) || i(e)) && i(e.then) && i(e.catch), pe = {
  isArray: u,
  isArrayBuffer: b,
  isBuffer: k,
  isFormData: z,
  isArrayBufferView: I,
  isString: N,
  isNumber: P,
  isBoolean: U,
  isObject: w,
  isPlainObject: y,
  isUndefined: a,
  isDate: H,
  isFile: M,
  isBlob: V,
  isRegExp: te,
  isFunction: i,
  isStream: R,
  isURLSearchParams: G,
  isTypedArray: Y,
  isFileList: _,
  forEach: p,
  merge: A,
  extend: K,
  trim: J,
  stripBOM: q,
  inherits: W,
  toFlatObject: $,
  kindOf: d,
  kindOfTest: l,
  endsWith: Q,
  toArray: X,
  forEachEntry: Z,
  matchAll: j,
  isHTMLForm: v,
  hasOwnProperty: h,
  hasOwnProp: h,
  // an alias to avoid ESLint no-prototype-builtins detection
  reduceDescriptors: D,
  freezeMethods: ne,
  toObjectSet: re,
  toCamelCase: ee,
  noop: oe,
  toFiniteNumber: se,
  findKey: L,
  global: x,
  isContextDefined: B,
  ALPHABET: T,
  generateString: ce,
  isSpecCompliantForm: ie,
  toJSONObject: le,
  isAsyncFn: fe,
  isThenable: ue
};
export {
  pe as default
};
