import {
  a as d,
  b as y,
  c as E
} from "./chunk-IO47FP3U.js";

// ../node_modules/memoizerific/memoizerific.js
var O = E((M, z) => {
  (function(v) {
    if (typeof M == "object" && typeof z < "u")
      z.exports = v();
    else if (typeof define == "function" && define.amd)
      define([], v);
    else {
      var g;
      typeof window < "u" ? g = window : typeof global < "u" ? g = global : typeof self < "u" ? g = self : g = this, g.memoizerific = v();
    }
  })(function() {
    var v, g, b;
    return (/* @__PURE__ */ d(function I(l, p, u) {
      function t(i, f) {
        if (!p[i]) {
          if (!l[i]) {
            var n = typeof y == "function" && y;
            if (!f && n) return n(i, !0);
            if (e) return e(i, !0);
            var h = new Error("Cannot find module '" + i + "'");
            throw h.code = "MODULE_NOT_FOUND", h;
          }
          var r = p[i] = { exports: {} };
          l[i][0].call(r.exports, function(s) {
            var o = l[i][1][s];
            return t(o || s);
          }, r, r.exports, I, l, p, u);
        }
        return p[i].exports;
      }
      d(t, "s");
      for (var e = typeof y == "function" && y, a = 0; a < u.length; a++) t(u[a]);
      return t;
    }, "e"))({ 1: [function(I, l, p) {
      l.exports = function(u) {
        if (typeof Map != "function" || u) {
          var t = I("./similar");
          return new t();
        } else
          return /* @__PURE__ */ new Map();
      };
    }, { "./similar": 2 }], 2: [function(I, l, p) {
      function u() {
        return this.list = [], this.lastItem = void 0, this.size = 0, this;
      }
      d(u, "Similar"), u.prototype.get = function(t) {
        var e;
        if (this.lastItem && this.isEqual(this.lastItem.key, t))
          return this.lastItem.val;
        if (e = this.indexOf(t), e >= 0)
          return this.lastItem = this.list[e], this.list[e].val;
      }, u.prototype.set = function(t, e) {
        var a;
        return this.lastItem && this.isEqual(this.lastItem.key, t) ? (this.lastItem.val = e, this) : (a = this.indexOf(t), a >= 0 ? (this.lastItem = this.list[a], this.list[a].val = e, this) : (this.lastItem = { key: t, val: e }, this.list.push(this.lastItem), this.size++, this));
      }, u.prototype.delete = function(t) {
        var e;
        if (this.lastItem && this.isEqual(this.lastItem.key, t) && (this.lastItem = void 0), e = this.indexOf(t), e >= 0)
          return this.size--, this.list.splice(e, 1)[0];
      }, u.prototype.has = function(t) {
        var e;
        return this.lastItem && this.isEqual(this.lastItem.key, t) ? !0 : (e = this.indexOf(t), e >= 0 ? (this.lastItem = this.list[e], !0) : !1);
      }, u.prototype.forEach = function(t, e) {
        var a;
        for (a = 0; a < this.size; a++)
          t.call(e || this, this.list[a].val, this.list[a].key, this);
      }, u.prototype.indexOf = function(t) {
        var e;
        for (e = 0; e < this.size; e++)
          if (this.isEqual(this.list[e].key, t))
            return e;
        return -1;
      }, u.prototype.isEqual = function(t, e) {
        return t === e || t !== t && e !== e;
      }, l.exports = u;
    }, {}], 3: [function(I, l, p) {
      var u = I("map-or-similar");
      l.exports = function(i) {
        var f = new u(!1), n = [];
        return function(h) {
          var r = /* @__PURE__ */ d(function() {
            var s = f, o, w, c = arguments.length - 1, q = Array(c + 1), x = !0, m;
            if ((r.numArgs || r.numArgs === 0) && r.numArgs !== c + 1)
              throw new Error("Memoizerific functions should always be called with the same number of arguments");
            for (m = 0; m < c; m++) {
              if (q[m] = {
                cacheItem: s,
                arg: arguments[m]
              }, s.has(arguments[m])) {
                s = s.get(arguments[m]);
                continue;
              }
              x = !1, o = new u(!1), s.set(arguments[m], o), s = o;
            }
            return x && (s.has(arguments[c]) ? w = s.get(arguments[c]) : x = !1), x || (w = h.apply(null, arguments), s.set(arguments[c], w)), i > 0 && (q[c] = {
              cacheItem: s,
              arg: arguments[c]
            }, x ? t(n, q) : n.push(q), n.length > i && e(n.shift())), r.wasMemoized = x, r.numArgs = c + 1, w;
          }, "memoizerific");
          return r.limit = i, r.wasMemoized = !1, r.cache = f, r.lru = n, r;
        };
      };
      function t(i, f) {
        var n = i.length, h = f.length, r, s, o;
        for (s = 0; s < n; s++) {
          for (r = !0, o = 0; o < h; o++)
            if (!a(i[s][o].arg, f[o].arg)) {
              r = !1;
              break;
            }
          if (r)
            break;
        }
        i.push(i.splice(s, 1)[0]);
      }
      d(t, "moveToMostRecentLru");
      function e(i) {
        var f = i.length, n = i[f - 1], h, r;
        for (n.cacheItem.delete(n.arg), r = f - 2; r >= 0 && (n = i[r], h = n.cacheItem.get(n.arg), !h || !h.size); r--)
          n.cacheItem.delete(n.arg);
      }
      d(e, "removeCachedResult");
      function a(i, f) {
        return i === f || i !== i && f !== f;
      }
      d(a, "isEqual");
    }, { "map-or-similar": 1 }] }, {}, [3])(3);
  });
});

export {
  O as a
};
