import { commonjsGlobal as d } from "../../../../../../../_virtual/_commonjsHelpers.js";
import { __exports as e } from "../../../../../../../_virtual/index6.js";
import { __require as L } from "../../../../../@noble_hashes@1.7.1/node_modules/@noble/hashes/sha3.js";
var b;
function j() {
  if (b) return e;
  b = 1;
  const { sha3_512: m } = /* @__PURE__ */ L(), a = 24, s = 32, c = (t = 4, r = Math.random) => {
    let n = "";
    for (; n.length < t; )
      n = n + Math.floor(r() * 36).toString(36);
    return n;
  };
  function u(t) {
    let r = 8n, n = 0n;
    for (const o of t.values()) {
      const i = BigInt(o);
      n = (n << r) + i;
    }
    return n;
  }
  const f = (t = "") => u(m(t)).toString(36).slice(1), g = Array.from(
    { length: 26 },
    (t, r) => String.fromCharCode(r + 97)
  ), S = (t) => g[Math.floor(t() * g.length)], l = ({
    globalObj: t = typeof d < "u" ? d : typeof window < "u" ? window : {},
    random: r = Math.random
  } = {}) => {
    const n = Object.keys(t).toString(), o = n.length ? n + c(s, r) : c(s, r);
    return f(o).substring(0, s);
  }, h = (t) => () => t++, y = 476782367, p = ({
    // Fallback if the user does not pass in a CSPRNG. This should be OK
    // because we don't rely solely on the random number generator for entropy.
    // We also use the host fingerprint, current time, and a session counter.
    random: t = Math.random,
    counter: r = h(Math.floor(t() * y)),
    length: n = a,
    fingerprint: o = l({ random: t })
  } = {}) => function() {
    const _ = S(t), w = Date.now().toString(36), I = r().toString(36), q = c(n, t), x = `${w + q + I + o}`;
    return `${_ + f(x).substring(1, n)}`;
  }, C = p(), M = (t, { minLength: r = 2, maxLength: n = s } = {}) => {
    const o = t.length, i = /^[0-9a-z]+$/;
    try {
      if (typeof t == "string" && o >= r && o <= n && i.test(t))
        return !0;
    } finally {
    }
    return !1;
  };
  return e.getConstants = () => ({ defaultLength: a, bigLength: s }), e.init = p, e.createId = C, e.bufToBigInt = u, e.createCounter = h, e.createFingerprint = l, e.isCuid = M, e;
}
export {
  j as __require
};
//# sourceMappingURL=index.js.map
