"use client";
import { E as rs, m as _t, n as a } from "./index.package-D5wfGMJr.js";
import { a as ls } from "./index-D9nY2fQm.js";
import { p as zs, h as ks } from "./hooks.module-Bf2_FYt4.js";
const ws = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  EventEmitter: rs,
  default: rs
}, Symbol.toStringTag, { value: "Module" })), Ls = /* @__PURE__ */ _t(ws), { Transform: bs } = ls;
var Ss = (t) => class us extends bs {
  constructor(s, e, n, h, r) {
    super(r), this._rate = s, this._capacity = e, this._delimitedSuffix = n, this._hashBitLength = h, this._options = r, this._state = new t(), this._state.initialize(s, e), this._finalized = !1;
  }
  _transform(s, e, n) {
    let h = null;
    try {
      this.update(s, e);
    } catch (r) {
      h = r;
    }
    n(h);
  }
  _flush(s) {
    let e = null;
    try {
      this.push(this.digest());
    } catch (n) {
      e = n;
    }
    s(e);
  }
  update(s, e) {
    if (!a.isBuffer(s) && typeof s != "string") throw new TypeError("Data must be a string or a buffer");
    if (this._finalized) throw new Error("Digest already called");
    return a.isBuffer(s) || (s = a.from(s, e)), this._state.absorb(s), this;
  }
  digest(s) {
    if (this._finalized) throw new Error("Digest already called");
    this._finalized = !0, this._delimitedSuffix && this._state.absorbLastFewBits(this._delimitedSuffix);
    let e = this._state.squeeze(this._hashBitLength / 8);
    return s !== void 0 && (e = e.toString(s)), this._resetState(), e;
  }
  // remove result from memory
  _resetState() {
    return this._state.initialize(this._rate, this._capacity), this;
  }
  // because sometimes we need hash right now and little later
  _clone() {
    const s = new us(this._rate, this._capacity, this._delimitedSuffix, this._hashBitLength, this._options);
    return this._state.copy(s._state), s._finalized = this._finalized, s;
  }
};
const { Transform: ms } = ls;
var ys = (t) => class fs extends ms {
  constructor(s, e, n, h) {
    super(h), this._rate = s, this._capacity = e, this._delimitedSuffix = n, this._options = h, this._state = new t(), this._state.initialize(s, e), this._finalized = !1;
  }
  _transform(s, e, n) {
    let h = null;
    try {
      this.update(s, e);
    } catch (r) {
      h = r;
    }
    n(h);
  }
  _flush() {
  }
  _read(s) {
    this.push(this.squeeze(s));
  }
  update(s, e) {
    if (!a.isBuffer(s) && typeof s != "string") throw new TypeError("Data must be a string or a buffer");
    if (this._finalized) throw new Error("Squeeze already called");
    return a.isBuffer(s) || (s = a.from(s, e)), this._state.absorb(s), this;
  }
  squeeze(s, e) {
    this._finalized || (this._finalized = !0, this._state.absorbLastFewBits(this._delimitedSuffix));
    let n = this._state.squeeze(s);
    return e !== void 0 && (n = n.toString(e)), n;
  }
  _resetState() {
    return this._state.initialize(this._rate, this._capacity), this;
  }
  _clone() {
    const s = new fs(this._rate, this._capacity, this._delimitedSuffix, this._options);
    return this._state.copy(s._state), s._finalized = this._finalized, s;
  }
};
const gs = Ss, xs = ys;
var qs = function(t) {
  const c = gs(t), s = xs(t);
  return function(e, n) {
    switch (typeof e == "string" ? e.toLowerCase() : e) {
      case "keccak224":
        return new c(1152, 448, null, 224, n);
      case "keccak256":
        return new c(1088, 512, null, 256, n);
      case "keccak384":
        return new c(832, 768, null, 384, n);
      case "keccak512":
        return new c(576, 1024, null, 512, n);
      case "sha3-224":
        return new c(1152, 448, 6, 224, n);
      case "sha3-256":
        return new c(1088, 512, 6, 256, n);
      case "sha3-384":
        return new c(832, 768, 6, 384, n);
      case "sha3-512":
        return new c(576, 1024, 6, 512, n);
      case "shake128":
        return new s(1344, 256, 31, n);
      case "shake256":
        return new s(1088, 512, 31, n);
      default:
        throw new Error("Invald algorithm: " + e);
    }
  };
}, _s = {};
const as = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649, 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0, 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771, 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648, 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648];
_s.p1600 = function(t) {
  for (let c = 0; c < 24; ++c) {
    const s = t[0] ^ t[10] ^ t[20] ^ t[30] ^ t[40], e = t[1] ^ t[11] ^ t[21] ^ t[31] ^ t[41], n = t[2] ^ t[12] ^ t[22] ^ t[32] ^ t[42], h = t[3] ^ t[13] ^ t[23] ^ t[33] ^ t[43], r = t[4] ^ t[14] ^ t[24] ^ t[34] ^ t[44], f = t[5] ^ t[15] ^ t[25] ^ t[35] ^ t[45], _ = t[6] ^ t[16] ^ t[26] ^ t[36] ^ t[46], d = t[7] ^ t[17] ^ t[27] ^ t[37] ^ t[47], p = t[8] ^ t[18] ^ t[28] ^ t[38] ^ t[48], z = t[9] ^ t[19] ^ t[29] ^ t[39] ^ t[49];
    let i = p ^ (n << 1 | h >>> 31), o = z ^ (h << 1 | n >>> 31);
    const ds = t[0] ^ i, ps = t[1] ^ o, dt = t[10] ^ i, pt = t[11] ^ o, zt = t[20] ^ i, kt = t[21] ^ o, wt = t[30] ^ i, bt = t[31] ^ o, St = t[40] ^ i, mt = t[41] ^ o;
    i = s ^ (r << 1 | f >>> 31), o = e ^ (f << 1 | r >>> 31);
    const yt = t[2] ^ i, gt = t[3] ^ o, xt = t[12] ^ i, qt = t[13] ^ o, Bt = t[22] ^ i, vt = t[23] ^ o, Et = t[32] ^ i, $t = t[33] ^ o, Lt = t[42] ^ i, Tt = t[43] ^ o;
    i = n ^ (_ << 1 | d >>> 31), o = h ^ (d << 1 | _ >>> 31);
    const Dt = t[4] ^ i, jt = t[5] ^ o, Ft = t[14] ^ i, Nt = t[15] ^ o, Ot = t[24] ^ i, Kt = t[25] ^ o, At = t[34] ^ i, Ct = t[35] ^ o, Pt = t[44] ^ i, Ut = t[45] ^ o;
    i = r ^ (p << 1 | z >>> 31), o = f ^ (z << 1 | p >>> 31);
    const It = t[6] ^ i, Mt = t[7] ^ o, Rt = t[16] ^ i, Gt = t[17] ^ o, Ht = t[26] ^ i, Jt = t[27] ^ o, Qt = t[36] ^ i, Vt = t[37] ^ o, Wt = t[46] ^ i, Xt = t[47] ^ o;
    i = _ ^ (s << 1 | e >>> 31), o = d ^ (e << 1 | s >>> 31);
    const Yt = t[8] ^ i, Zt = t[9] ^ o, ts = t[18] ^ i, ss = t[19] ^ o, es = t[28] ^ i, is = t[29] ^ o, os = t[38] ^ i, ns = t[39] ^ o, cs = t[48] ^ i, hs = t[49] ^ o, k = ds, w = ps, b = pt << 4 | dt >>> 28, S = dt << 4 | pt >>> 28, m = zt << 3 | kt >>> 29, y = kt << 3 | zt >>> 29, g = bt << 9 | wt >>> 23, x = wt << 9 | bt >>> 23, q = St << 18 | mt >>> 14, B = mt << 18 | St >>> 14, v = yt << 1 | gt >>> 31, E = gt << 1 | yt >>> 31, $ = qt << 12 | xt >>> 20, L = xt << 12 | qt >>> 20, T = Bt << 10 | vt >>> 22, D = vt << 10 | Bt >>> 22, j = $t << 13 | Et >>> 19, F = Et << 13 | $t >>> 19, N = Lt << 2 | Tt >>> 30, O = Tt << 2 | Lt >>> 30, K = jt << 30 | Dt >>> 2, A = Dt << 30 | jt >>> 2, C = Ft << 6 | Nt >>> 26, P = Nt << 6 | Ft >>> 26, U = Kt << 11 | Ot >>> 21, I = Ot << 11 | Kt >>> 21, M = At << 15 | Ct >>> 17, R = Ct << 15 | At >>> 17, G = Ut << 29 | Pt >>> 3, H = Pt << 29 | Ut >>> 3, J = It << 28 | Mt >>> 4, Q = Mt << 28 | It >>> 4, V = Gt << 23 | Rt >>> 9, W = Rt << 23 | Gt >>> 9, X = Ht << 25 | Jt >>> 7, Y = Jt << 25 | Ht >>> 7, Z = Qt << 21 | Vt >>> 11, tt = Vt << 21 | Qt >>> 11, st = Xt << 24 | Wt >>> 8, et = Wt << 24 | Xt >>> 8, it = Yt << 27 | Zt >>> 5, ot = Zt << 27 | Yt >>> 5, nt = ts << 20 | ss >>> 12, ct = ss << 20 | ts >>> 12, ht = is << 7 | es >>> 25, rt = es << 7 | is >>> 25, at = os << 8 | ns >>> 24, lt = ns << 8 | os >>> 24, ut = cs << 14 | hs >>> 18, ft = hs << 14 | cs >>> 18;
    t[0] = k ^ ~$ & U, t[1] = w ^ ~L & I, t[10] = J ^ ~nt & m, t[11] = Q ^ ~ct & y, t[20] = v ^ ~C & X, t[21] = E ^ ~P & Y, t[30] = it ^ ~b & T, t[31] = ot ^ ~S & D, t[40] = K ^ ~V & ht, t[41] = A ^ ~W & rt, t[2] = $ ^ ~U & Z, t[3] = L ^ ~I & tt, t[12] = nt ^ ~m & j, t[13] = ct ^ ~y & F, t[22] = C ^ ~X & at, t[23] = P ^ ~Y & lt, t[32] = b ^ ~T & M, t[33] = S ^ ~D & R, t[42] = V ^ ~ht & g, t[43] = W ^ ~rt & x, t[4] = U ^ ~Z & ut, t[5] = I ^ ~tt & ft, t[14] = m ^ ~j & G, t[15] = y ^ ~F & H, t[24] = X ^ ~at & q, t[25] = Y ^ ~lt & B, t[34] = T ^ ~M & st, t[35] = D ^ ~R & et, t[44] = ht ^ ~g & N, t[45] = rt ^ ~x & O, t[6] = Z ^ ~ut & k, t[7] = tt ^ ~ft & w, t[16] = j ^ ~G & J, t[17] = F ^ ~H & Q, t[26] = at ^ ~q & v, t[27] = lt ^ ~B & E, t[36] = M ^ ~st & it, t[37] = R ^ ~et & ot, t[46] = g ^ ~N & K, t[47] = x ^ ~O & A, t[8] = ut ^ ~k & $, t[9] = ft ^ ~w & L, t[18] = G ^ ~J & nt, t[19] = H ^ ~Q & ct, t[28] = q ^ ~v & C, t[29] = B ^ ~E & P, t[38] = st ^ ~it & b, t[39] = et ^ ~ot & S, t[48] = N ^ ~K & V, t[49] = O ^ ~A & W, t[0] ^= as[c * 2], t[1] ^= as[c * 2 + 1];
  }
};
const u = _s;
function l() {
  this.state = [
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0
  ], this.blockSize = null, this.count = 0, this.squeezing = !1;
}
l.prototype.initialize = function(t, c) {
  for (let s = 0; s < 50; ++s) this.state[s] = 0;
  this.blockSize = t / 8, this.count = 0, this.squeezing = !1;
};
l.prototype.absorb = function(t) {
  for (let c = 0; c < t.length; ++c)
    this.state[~~(this.count / 4)] ^= t[c] << 8 * (this.count % 4), this.count += 1, this.count === this.blockSize && (u.p1600(this.state), this.count = 0);
};
l.prototype.absorbLastFewBits = function(t) {
  this.state[~~(this.count / 4)] ^= t << 8 * (this.count % 4), t & 128 && this.count === this.blockSize - 1 && u.p1600(this.state), this.state[~~((this.blockSize - 1) / 4)] ^= 128 << 8 * ((this.blockSize - 1) % 4), u.p1600(this.state), this.count = 0, this.squeezing = !0;
};
l.prototype.squeeze = function(t) {
  this.squeezing || this.absorbLastFewBits(1);
  const c = a.alloc(t);
  for (let s = 0; s < t; ++s)
    c[s] = this.state[~~(this.count / 4)] >>> 8 * (this.count % 4) & 255, this.count += 1, this.count === this.blockSize && (u.p1600(this.state), this.count = 0);
  return c;
};
l.prototype.copy = function(t) {
  for (let c = 0; c < 50; ++c) t.state[c] = this.state[c];
  t.blockSize = this.blockSize, t.count = this.count, t.squeezing = this.squeezing;
};
var Bs = l, Ts = qs(Bs);
const Ds = /* @__PURE__ */ _t(zs), js = /* @__PURE__ */ _t(ks);
export {
  js as a,
  Ls as b,
  Ts as j,
  Ds as r
};
//# sourceMappingURL=hooks.module-xuQfYiF-.js.map
