var lt = (e, t, s) => {
  if (!t.has(e))
    throw TypeError("Cannot " + s);
};
var i = (e, t, s) => (lt(e, t, "read from private field"), s ? s.call(e) : t.get(e)), u = (e, t, s) => {
  if (t.has(e))
    throw TypeError("Cannot add the same private member more than once");
  t instanceof WeakSet ? t.add(e) : t.set(e, s);
}, n = (e, t, s, a) => (lt(e, t, "write to private field"), a ? a.call(e, s) : t.set(e, s), s);
var ot = (e, t, s, a) => ({
  set _(r) {
    n(e, t, r, s);
  },
  get _() {
    return i(e, t, a);
  }
}), c = (e, t, s) => (lt(e, t, "access private method"), s);
import { jsx as z, jsxs as dt } from "react/jsx-runtime";
import { i as Et, b as Rt, r as Ut, n as Q, t as Kt, c as Qt, d as g, e as ft, f as Mt, S as St, h as Tt, m as yt, g as pt, j as xt, k as It, l as mt, o as gt, p as kt, q as vt, s as bt, Q as Gt } from "./useQuery-n4ls1rLk.js";
import { TableThead as Ht, TableTbody as jt, TablePagination as Nt } from "./components/Table/components/Basic.js";
import $t from "./components/Table/components/HeaderComponents/QuickSearch.js";
import { TableProvider as Bt } from "./components/Table/context/index.js";
import { cn as wt } from "./utils/functions.js";
var V, Ft, _t = (Ft = class {
  constructor() {
    u(this, V, void 0);
  }
  destroy() {
    this.clearGcTimeout();
  }
  scheduleGc() {
    this.clearGcTimeout(), Et(this.gcTime) && n(this, V, setTimeout(() => {
      this.optionalRemove();
    }, this.gcTime));
  }
  updateGcTime(e) {
    this.gcTime = Math.max(
      this.gcTime || 0,
      e ?? (Rt ? 1 / 0 : 5 * 60 * 1e3)
    );
  }
  clearGcTimeout() {
    i(this, V) && (clearTimeout(i(this, V)), n(this, V, void 0));
  }
}, V = new WeakMap(), Ft), J, X, w, G, P, f, rt, L, Y, ct, M, I, Ot, Vt = (Ot = class extends _t {
  constructor(t) {
    super();
    u(this, Y);
    u(this, M);
    u(this, J, void 0);
    u(this, X, void 0);
    u(this, w, void 0);
    u(this, G, void 0);
    u(this, P, void 0);
    u(this, f, void 0);
    u(this, rt, void 0);
    u(this, L, void 0);
    n(this, L, !1), n(this, rt, t.defaultOptions), c(this, Y, ct).call(this, t.options), n(this, f, []), n(this, w, t.cache), this.queryKey = t.queryKey, this.queryHash = t.queryHash, n(this, J, t.state || Lt(this.options)), this.state = i(this, J), this.scheduleGc();
  }
  get meta() {
    return this.options.meta;
  }
  optionalRemove() {
    !i(this, f).length && this.state.fetchStatus === "idle" && i(this, w).remove(this);
  }
  setData(t, s) {
    const a = Ut(this.state.data, t, this.options);
    return c(this, M, I).call(this, {
      data: a,
      type: "success",
      dataUpdatedAt: s == null ? void 0 : s.updatedAt,
      manual: s == null ? void 0 : s.manual
    }), a;
  }
  setState(t, s) {
    c(this, M, I).call(this, { type: "setState", state: t, setStateOptions: s });
  }
  cancel(t) {
    var a;
    const s = i(this, G);
    return (a = i(this, P)) == null || a.cancel(t), s ? s.then(Q).catch(Q) : Promise.resolve();
  }
  destroy() {
    super.destroy(), this.cancel({ silent: !0 });
  }
  reset() {
    this.destroy(), this.setState(i(this, J));
  }
  isActive() {
    return i(this, f).some(
      (t) => t.options.enabled !== !1
    );
  }
  isDisabled() {
    return this.getObserversCount() > 0 && !this.isActive();
  }
  isStale() {
    return this.state.isInvalidated || !this.state.dataUpdatedAt || i(this, f).some((t) => t.getCurrentResult().isStale);
  }
  isStaleByTime(t = 0) {
    return this.state.isInvalidated || !this.state.dataUpdatedAt || !Kt(this.state.dataUpdatedAt, t);
  }
  onFocus() {
    var s;
    const t = i(this, f).find((a) => a.shouldFetchOnWindowFocus());
    t == null || t.refetch({ cancelRefetch: !1 }), (s = i(this, P)) == null || s.continue();
  }
  onOnline() {
    var s;
    const t = i(this, f).find((a) => a.shouldFetchOnReconnect());
    t == null || t.refetch({ cancelRefetch: !1 }), (s = i(this, P)) == null || s.continue();
  }
  addObserver(t) {
    i(this, f).includes(t) || (i(this, f).push(t), this.clearGcTimeout(), i(this, w).notify({ type: "observerAdded", query: this, observer: t }));
  }
  removeObserver(t) {
    i(this, f).includes(t) && (n(this, f, i(this, f).filter((s) => s !== t)), i(this, f).length || (i(this, P) && (i(this, L) ? i(this, P).cancel({ revert: !0 }) : i(this, P).cancelRetry()), this.scheduleGc()), i(this, w).notify({ type: "observerRemoved", query: this, observer: t }));
  }
  getObserversCount() {
    return i(this, f).length;
  }
  invalidate() {
    this.state.isInvalidated || c(this, M, I).call(this, { type: "invalidate" });
  }
  fetch(t, s) {
    var O, U, K, x;
    if (this.state.fetchStatus !== "idle") {
      if (this.state.dataUpdatedAt && (s != null && s.cancelRefetch))
        this.cancel({ silent: !0 });
      else if (i(this, G))
        return (O = i(this, P)) == null || O.continueRetry(), i(this, G);
    }
    if (t && c(this, Y, ct).call(this, t), !this.options.queryFn) {
      const h = i(this, f).find((m) => m.options.queryFn);
      h && c(this, Y, ct).call(this, h.options);
    }
    process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
      "As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"
    ));
    const a = new AbortController(), r = {
      queryKey: this.queryKey,
      meta: this.meta
    }, o = (h) => {
      Object.defineProperty(h, "signal", {
        enumerable: !0,
        get: () => (n(this, L, !0), a.signal)
      });
    };
    o(r);
    const y = () => this.options.queryFn ? (n(this, L, !1), this.options.persister ? this.options.persister(
      this.options.queryFn,
      r,
      this
    ) : this.options.queryFn(
      r
    )) : Promise.reject(
      new Error(`Missing queryFn: '${this.options.queryHash}'`)
    ), p = {
      fetchOptions: s,
      options: this.options,
      queryKey: this.queryKey,
      state: this.state,
      fetchFn: y
    };
    o(p), (U = this.options.behavior) == null || U.onFetch(
      p,
      this
    ), n(this, X, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((K = p.fetchOptions) == null ? void 0 : K.meta)) && c(this, M, I).call(this, { type: "fetch", meta: (x = p.fetchOptions) == null ? void 0 : x.meta });
    const R = (h) => {
      var m, C, q, A;
      ft(h) && h.silent || c(this, M, I).call(this, {
        type: "error",
        error: h
      }), ft(h) || ((C = (m = i(this, w).config).onError) == null || C.call(
        m,
        h,
        this
      ), (A = (q = i(this, w).config).onSettled) == null || A.call(
        q,
        this.state.data,
        h,
        this
      )), this.isFetchingOptimistic || this.scheduleGc(), this.isFetchingOptimistic = !1;
    };
    return n(this, P, Qt({
      fn: p.fetchFn,
      abort: a.abort.bind(a),
      onSuccess: (h) => {
        var m, C, q, A;
        if (typeof h > "u") {
          process.env.NODE_ENV !== "production" && console.error(
            `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
          ), R(new Error(`${this.queryHash} data is undefined`));
          return;
        }
        this.setData(h), (C = (m = i(this, w).config).onSuccess) == null || C.call(m, h, this), (A = (q = i(this, w).config).onSettled) == null || A.call(
          q,
          h,
          this.state.error,
          this
        ), this.isFetchingOptimistic || this.scheduleGc(), this.isFetchingOptimistic = !1;
      },
      onError: R,
      onFail: (h, m) => {
        c(this, M, I).call(this, { type: "failed", failureCount: h, error: m });
      },
      onPause: () => {
        c(this, M, I).call(this, { type: "pause" });
      },
      onContinue: () => {
        c(this, M, I).call(this, { type: "continue" });
      },
      retry: p.options.retry,
      retryDelay: p.options.retryDelay,
      networkMode: p.options.networkMode
    })), n(this, G, i(this, P).promise), i(this, G);
  }
}, J = new WeakMap(), X = new WeakMap(), w = new WeakMap(), G = new WeakMap(), P = new WeakMap(), f = new WeakMap(), rt = new WeakMap(), L = new WeakMap(), Y = new WeakSet(), ct = function(t) {
  this.options = { ...i(this, rt), ...t }, this.updateGcTime(this.options.gcTime);
}, M = new WeakSet(), I = function(t) {
  const s = (a) => {
    switch (t.type) {
      case "failed":
        return {
          ...a,
          fetchFailureCount: t.failureCount,
          fetchFailureReason: t.error
        };
      case "pause":
        return {
          ...a,
          fetchStatus: "paused"
        };
      case "continue":
        return {
          ...a,
          fetchStatus: "fetching"
        };
      case "fetch":
        return {
          ...a,
          fetchFailureCount: 0,
          fetchFailureReason: null,
          fetchMeta: t.meta ?? null,
          fetchStatus: Mt(this.options.networkMode) ? "fetching" : "paused",
          ...!a.dataUpdatedAt && {
            error: null,
            status: "pending"
          }
        };
      case "success":
        return {
          ...a,
          data: t.data,
          dataUpdateCount: a.dataUpdateCount + 1,
          dataUpdatedAt: t.dataUpdatedAt ?? Date.now(),
          error: null,
          isInvalidated: !1,
          status: "success",
          ...!t.manual && {
            fetchStatus: "idle",
            fetchFailureCount: 0,
            fetchFailureReason: null
          }
        };
      case "error":
        const r = t.error;
        return ft(r) && r.revert && i(this, X) ? { ...i(this, X), fetchStatus: "idle" } : {
          ...a,
          error: r,
          errorUpdateCount: a.errorUpdateCount + 1,
          errorUpdatedAt: Date.now(),
          fetchFailureCount: a.fetchFailureCount + 1,
          fetchFailureReason: r,
          fetchStatus: "idle",
          status: "error"
        };
      case "invalidate":
        return {
          ...a,
          isInvalidated: !0
        };
      case "setState":
        return {
          ...a,
          ...t.state
        };
    }
  };
  this.state = s(this.state), g.batch(() => {
    i(this, f).forEach((a) => {
      a.onQueryUpdate();
    }), i(this, w).notify({ query: this, type: "updated", action: t });
  });
}, Ot);
function Lt(e) {
  const t = typeof e.initialData == "function" ? e.initialData() : e.initialData, s = typeof t < "u", a = s ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0;
  return {
    data: t,
    dataUpdateCount: 0,
    dataUpdatedAt: s ? a ?? Date.now() : 0,
    error: null,
    errorUpdateCount: 0,
    errorUpdatedAt: 0,
    fetchFailureCount: 0,
    fetchFailureReason: null,
    fetchMeta: null,
    isInvalidated: !1,
    status: s ? "success" : "pending",
    fetchStatus: "idle"
  };
}
var T, Ct, Wt = (Ct = class extends St {
  constructor(t = {}) {
    super();
    u(this, T, void 0);
    this.config = t, n(this, T, /* @__PURE__ */ new Map());
  }
  build(t, s, a) {
    const r = s.queryKey, o = s.queryHash ?? Tt(r, s);
    let y = this.get(o);
    return y || (y = new Vt({
      cache: this,
      queryKey: r,
      queryHash: o,
      options: t.defaultQueryOptions(s),
      state: a,
      defaultOptions: t.getQueryDefaults(r)
    }), this.add(y)), y;
  }
  add(t) {
    i(this, T).has(t.queryHash) || (i(this, T).set(t.queryHash, t), this.notify({
      type: "added",
      query: t
    }));
  }
  remove(t) {
    const s = i(this, T).get(t.queryHash);
    s && (t.destroy(), s === t && i(this, T).delete(t.queryHash), this.notify({ type: "removed", query: t }));
  }
  clear() {
    g.batch(() => {
      this.getAll().forEach((t) => {
        this.remove(t);
      });
    });
  }
  get(t) {
    return i(this, T).get(t);
  }
  getAll() {
    return [...i(this, T).values()];
  }
  find(t) {
    const s = { exact: !0, ...t };
    return this.getAll().find(
      (a) => yt(s, a)
    );
  }
  findAll(t = {}) {
    const s = this.getAll();
    return Object.keys(t).length > 0 ? s.filter((a) => yt(t, a)) : s;
  }
  notify(t) {
    g.batch(() => {
      this.listeners.forEach((s) => {
        s(t);
      });
    });
  }
  onFocus() {
    g.batch(() => {
      this.getAll().forEach((t) => {
        t.onFocus();
      });
    });
  }
  onOnline() {
    g.batch(() => {
      this.getAll().forEach((t) => {
        t.onOnline();
      });
    });
  }
}, T = new WeakMap(), Ct), _, nt, b, Z, E, k, qt, zt = (qt = class extends _t {
  constructor(t) {
    super();
    u(this, E);
    u(this, _, void 0);
    u(this, nt, void 0);
    u(this, b, void 0);
    u(this, Z, void 0);
    this.mutationId = t.mutationId, n(this, nt, t.defaultOptions), n(this, b, t.mutationCache), n(this, _, []), this.state = t.state || Jt(), this.setOptions(t.options), this.scheduleGc();
  }
  setOptions(t) {
    this.options = { ...i(this, nt), ...t }, this.updateGcTime(this.options.gcTime);
  }
  get meta() {
    return this.options.meta;
  }
  addObserver(t) {
    i(this, _).includes(t) || (i(this, _).push(t), this.clearGcTimeout(), i(this, b).notify({
      type: "observerAdded",
      mutation: this,
      observer: t
    }));
  }
  removeObserver(t) {
    n(this, _, i(this, _).filter((s) => s !== t)), this.scheduleGc(), i(this, b).notify({
      type: "observerRemoved",
      mutation: this,
      observer: t
    });
  }
  optionalRemove() {
    i(this, _).length || (this.state.status === "pending" ? this.scheduleGc() : i(this, b).remove(this));
  }
  continue() {
    var t;
    return ((t = i(this, Z)) == null ? void 0 : t.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before
    this.execute(this.state.variables);
  }
  async execute(t) {
    var r, o, y, p, R, O, U, K, x, h, m, C, q, A, at, v, D, S, $, ht;
    const s = () => (n(this, Z, Qt({
      fn: () => this.options.mutationFn ? this.options.mutationFn(t) : Promise.reject(new Error("No mutationFn found")),
      onFail: (d, B) => {
        c(this, E, k).call(this, { type: "failed", failureCount: d, error: B });
      },
      onPause: () => {
        c(this, E, k).call(this, { type: "pause" });
      },
      onContinue: () => {
        c(this, E, k).call(this, { type: "continue" });
      },
      retry: this.options.retry ?? 0,
      retryDelay: this.options.retryDelay,
      networkMode: this.options.networkMode
    })), i(this, Z).promise), a = this.state.status === "pending";
    try {
      if (!a) {
        c(this, E, k).call(this, { type: "pending", variables: t }), await ((o = (r = i(this, b).config).onMutate) == null ? void 0 : o.call(
          r,
          t,
          this
        ));
        const B = await ((p = (y = this.options).onMutate) == null ? void 0 : p.call(y, t));
        B !== this.state.context && c(this, E, k).call(this, {
          type: "pending",
          context: B,
          variables: t
        });
      }
      const d = await s();
      return await ((O = (R = i(this, b).config).onSuccess) == null ? void 0 : O.call(
        R,
        d,
        t,
        this.state.context,
        this
      )), await ((K = (U = this.options).onSuccess) == null ? void 0 : K.call(U, d, t, this.state.context)), await ((h = (x = i(this, b).config).onSettled) == null ? void 0 : h.call(
        x,
        d,
        null,
        this.state.variables,
        this.state.context,
        this
      )), await ((C = (m = this.options).onSettled) == null ? void 0 : C.call(m, d, null, t, this.state.context)), c(this, E, k).call(this, { type: "success", data: d }), d;
    } catch (d) {
      try {
        throw await ((A = (q = i(this, b).config).onError) == null ? void 0 : A.call(
          q,
          d,
          t,
          this.state.context,
          this
        )), await ((v = (at = this.options).onError) == null ? void 0 : v.call(
          at,
          d,
          t,
          this.state.context
        )), await ((S = (D = i(this, b).config).onSettled) == null ? void 0 : S.call(
          D,
          void 0,
          d,
          this.state.variables,
          this.state.context,
          this
        )), await ((ht = ($ = this.options).onSettled) == null ? void 0 : ht.call(
          $,
          void 0,
          d,
          t,
          this.state.context
        )), d;
      } finally {
        c(this, E, k).call(this, { type: "error", error: d });
      }
    }
  }
}, _ = new WeakMap(), nt = new WeakMap(), b = new WeakMap(), Z = new WeakMap(), E = new WeakSet(), k = function(t) {
  const s = (a) => {
    switch (t.type) {
      case "failed":
        return {
          ...a,
          failureCount: t.failureCount,
          failureReason: t.error
        };
      case "pause":
        return {
          ...a,
          isPaused: !0
        };
      case "continue":
        return {
          ...a,
          isPaused: !1
        };
      case "pending":
        return {
          ...a,
          context: t.context,
          data: void 0,
          failureCount: 0,
          failureReason: null,
          error: null,
          isPaused: !Mt(this.options.networkMode),
          status: "pending",
          variables: t.variables,
          submittedAt: Date.now()
        };
      case "success":
        return {
          ...a,
          data: t.data,
          failureCount: 0,
          failureReason: null,
          error: null,
          status: "success",
          isPaused: !1
        };
      case "error":
        return {
          ...a,
          data: void 0,
          error: t.error,
          failureCount: a.failureCount + 1,
          failureReason: t.error,
          isPaused: !1,
          status: "error"
        };
    }
  };
  this.state = s(this.state), g.batch(() => {
    i(this, _).forEach((a) => {
      a.onMutationUpdate(t);
    }), i(this, b).notify({
      mutation: this,
      type: "updated",
      action: t
    });
  });
}, qt);
function Jt() {
  return {
    context: void 0,
    data: void 0,
    error: null,
    failureCount: 0,
    failureReason: null,
    isPaused: !1,
    status: "idle",
    variables: void 0,
    submittedAt: 0
  };
}
var F, ut, W, At, Xt = (At = class extends St {
  constructor(t = {}) {
    super();
    u(this, F, void 0);
    u(this, ut, void 0);
    u(this, W, void 0);
    this.config = t, n(this, F, []), n(this, ut, 0);
  }
  build(t, s, a) {
    const r = new zt({
      mutationCache: this,
      mutationId: ++ot(this, ut)._,
      options: t.defaultMutationOptions(s),
      state: a
    });
    return this.add(r), r;
  }
  add(t) {
    i(this, F).push(t), this.notify({ type: "added", mutation: t });
  }
  remove(t) {
    n(this, F, i(this, F).filter((s) => s !== t)), this.notify({ type: "removed", mutation: t });
  }
  clear() {
    g.batch(() => {
      i(this, F).forEach((t) => {
        this.remove(t);
      });
    });
  }
  getAll() {
    return i(this, F);
  }
  find(t) {
    const s = { exact: !0, ...t };
    return i(this, F).find(
      (a) => pt(s, a)
    );
  }
  findAll(t = {}) {
    return i(this, F).filter(
      (s) => pt(t, s)
    );
  }
  notify(t) {
    g.batch(() => {
      this.listeners.forEach((s) => {
        s(t);
      });
    });
  }
  resumePausedMutations() {
    return n(this, W, (i(this, W) ?? Promise.resolve()).then(() => {
      const t = i(this, F).filter((s) => s.state.isPaused);
      return g.batch(
        () => t.reduce(
          (s, a) => s.then(() => a.continue().catch(Q)),
          Promise.resolve()
        )
      );
    }).then(() => {
      n(this, W, void 0);
    })), i(this, W);
  }
}, F = new WeakMap(), ut = new WeakMap(), W = new WeakMap(), At);
function Yt(e) {
  return {
    onFetch: (t, s) => {
      const a = async () => {
        var m, C, q, A, at;
        const r = t.options, o = (q = (C = (m = t.fetchOptions) == null ? void 0 : m.meta) == null ? void 0 : C.fetchMore) == null ? void 0 : q.direction, y = ((A = t.state.data) == null ? void 0 : A.pages) || [], p = ((at = t.state.data) == null ? void 0 : at.pageParams) || [], R = { pages: [], pageParams: [] };
        let O = !1;
        const U = (v) => {
          Object.defineProperty(v, "signal", {
            enumerable: !0,
            get: () => (t.signal.aborted ? O = !0 : t.signal.addEventListener("abort", () => {
              O = !0;
            }), t.signal)
          });
        }, K = t.options.queryFn || (() => Promise.reject(
          new Error(`Missing queryFn: '${t.options.queryHash}'`)
        )), x = async (v, D, S) => {
          if (O)
            return Promise.reject();
          if (D == null && v.pages.length)
            return Promise.resolve(v);
          const $ = {
            queryKey: t.queryKey,
            pageParam: D,
            direction: S ? "backward" : "forward",
            meta: t.options.meta
          };
          U($);
          const ht = await K(
            $
          ), { maxPages: d } = t.options, B = S ? xt : It;
          return {
            pages: B(v.pages, ht, d),
            pageParams: B(v.pageParams, D, d)
          };
        };
        let h;
        if (o && y.length) {
          const v = o === "backward", D = v ? Zt : Pt, S = {
            pages: y,
            pageParams: p
          }, $ = D(r, S);
          h = await x(S, $, v);
        } else {
          h = await x(
            R,
            p[0] ?? r.initialPageParam
          );
          const v = e ?? y.length;
          for (let D = 1; D < v; D++) {
            const S = Pt(r, h);
            h = await x(h, S);
          }
        }
        return h;
      };
      t.options.persister ? t.fetchFn = () => {
        var r, o;
        return (o = (r = t.options).persister) == null ? void 0 : o.call(
          r,
          a,
          {
            queryKey: t.queryKey,
            meta: t.options.meta,
            signal: t.signal
          },
          s
        );
      } : t.fetchFn = a;
    }
  };
}
function Pt(e, { pages: t, pageParams: s }) {
  const a = t.length - 1;
  return e.getNextPageParam(
    t[a],
    t,
    s[a],
    s
  );
}
function Zt(e, { pages: t, pageParams: s }) {
  var a;
  return (a = e.getPreviousPageParam) == null ? void 0 : a.call(
    e,
    t[0],
    t,
    s[0],
    s
  );
}
var l, H, j, tt, et, N, st, it, Dt, te = (Dt = class {
  constructor(e = {}) {
    u(this, l, void 0);
    u(this, H, void 0);
    u(this, j, void 0);
    u(this, tt, void 0);
    u(this, et, void 0);
    u(this, N, void 0);
    u(this, st, void 0);
    u(this, it, void 0);
    n(this, l, e.queryCache || new Wt()), n(this, H, e.mutationCache || new Xt()), n(this, j, e.defaultOptions || {}), n(this, tt, /* @__PURE__ */ new Map()), n(this, et, /* @__PURE__ */ new Map()), n(this, N, 0);
  }
  mount() {
    ot(this, N)._++, i(this, N) === 1 && (n(this, st, mt.subscribe(() => {
      mt.isFocused() && (this.resumePausedMutations(), i(this, l).onFocus());
    })), n(this, it, gt.subscribe(() => {
      gt.isOnline() && (this.resumePausedMutations(), i(this, l).onOnline());
    })));
  }
  unmount() {
    var e, t;
    ot(this, N)._--, i(this, N) === 0 && ((e = i(this, st)) == null || e.call(this), n(this, st, void 0), (t = i(this, it)) == null || t.call(this), n(this, it, void 0));
  }
  isFetching(e) {
    return i(this, l).findAll({ ...e, fetchStatus: "fetching" }).length;
  }
  isMutating(e) {
    return i(this, H).findAll({ ...e, status: "pending" }).length;
  }
  getQueryData(e) {
    var t;
    return (t = i(this, l).find({ queryKey: e })) == null ? void 0 : t.state.data;
  }
  ensureQueryData(e) {
    const t = this.getQueryData(e.queryKey);
    return t !== void 0 ? Promise.resolve(t) : this.fetchQuery(e);
  }
  getQueriesData(e) {
    return this.getQueryCache().findAll(e).map(({ queryKey: t, state: s }) => {
      const a = s.data;
      return [t, a];
    });
  }
  setQueryData(e, t, s) {
    const a = i(this, l).find({ queryKey: e }), r = a == null ? void 0 : a.state.data, o = kt(t, r);
    if (typeof o > "u")
      return;
    const y = this.defaultQueryOptions({ queryKey: e });
    return i(this, l).build(this, y).setData(o, { ...s, manual: !0 });
  }
  setQueriesData(e, t, s) {
    return g.batch(
      () => this.getQueryCache().findAll(e).map(({ queryKey: a }) => [
        a,
        this.setQueryData(a, t, s)
      ])
    );
  }
  getQueryState(e) {
    var t;
    return (t = i(this, l).find({ queryKey: e })) == null ? void 0 : t.state;
  }
  removeQueries(e) {
    const t = i(this, l);
    g.batch(() => {
      t.findAll(e).forEach((s) => {
        t.remove(s);
      });
    });
  }
  resetQueries(e, t) {
    const s = i(this, l), a = {
      type: "active",
      ...e
    };
    return g.batch(() => (s.findAll(e).forEach((r) => {
      r.reset();
    }), this.refetchQueries(a, t)));
  }
  cancelQueries(e = {}, t = {}) {
    const s = { revert: !0, ...t }, a = g.batch(
      () => i(this, l).findAll(e).map((r) => r.cancel(s))
    );
    return Promise.all(a).then(Q).catch(Q);
  }
  invalidateQueries(e = {}, t = {}) {
    return g.batch(() => {
      if (i(this, l).findAll(e).forEach((a) => {
        a.invalidate();
      }), e.refetchType === "none")
        return Promise.resolve();
      const s = {
        ...e,
        type: e.refetchType ?? e.type ?? "active"
      };
      return this.refetchQueries(s, t);
    });
  }
  refetchQueries(e = {}, t) {
    const s = {
      ...t,
      cancelRefetch: (t == null ? void 0 : t.cancelRefetch) ?? !0
    }, a = g.batch(
      () => i(this, l).findAll(e).filter((r) => !r.isDisabled()).map((r) => {
        let o = r.fetch(void 0, s);
        return s.throwOnError || (o = o.catch(Q)), r.state.fetchStatus === "paused" ? Promise.resolve() : o;
      })
    );
    return Promise.all(a).then(Q);
  }
  fetchQuery(e) {
    const t = this.defaultQueryOptions(e);
    typeof t.retry > "u" && (t.retry = !1);
    const s = i(this, l).build(this, t);
    return s.isStaleByTime(t.staleTime) ? s.fetch(t) : Promise.resolve(s.state.data);
  }
  prefetchQuery(e) {
    return this.fetchQuery(e).then(Q).catch(Q);
  }
  fetchInfiniteQuery(e) {
    return e.behavior = Yt(e.pages), this.fetchQuery(e);
  }
  prefetchInfiniteQuery(e) {
    return this.fetchInfiniteQuery(e).then(Q).catch(Q);
  }
  resumePausedMutations() {
    return i(this, H).resumePausedMutations();
  }
  getQueryCache() {
    return i(this, l);
  }
  getMutationCache() {
    return i(this, H);
  }
  getDefaultOptions() {
    return i(this, j);
  }
  setDefaultOptions(e) {
    n(this, j, e);
  }
  setQueryDefaults(e, t) {
    i(this, tt).set(vt(e), {
      queryKey: e,
      defaultOptions: t
    });
  }
  getQueryDefaults(e) {
    const t = [...i(this, tt).values()];
    let s = {};
    return t.forEach((a) => {
      bt(e, a.queryKey) && (s = { ...s, ...a.defaultOptions });
    }), s;
  }
  setMutationDefaults(e, t) {
    i(this, et).set(vt(e), {
      mutationKey: e,
      defaultOptions: t
    });
  }
  getMutationDefaults(e) {
    const t = [...i(this, et).values()];
    let s = {};
    return t.forEach((a) => {
      bt(e, a.mutationKey) && (s = { ...s, ...a.defaultOptions });
    }), s;
  }
  defaultQueryOptions(e) {
    if (e != null && e._defaulted)
      return e;
    const t = {
      ...i(this, j).queries,
      ...(e == null ? void 0 : e.queryKey) && this.getQueryDefaults(e.queryKey),
      ...e,
      _defaulted: !0
    };
    return t.queryHash || (t.queryHash = Tt(
      t.queryKey,
      t
    )), typeof t.refetchOnReconnect > "u" && (t.refetchOnReconnect = t.networkMode !== "always"), typeof t.throwOnError > "u" && (t.throwOnError = !!t.suspense), typeof t.networkMode > "u" && t.persister && (t.networkMode = "offlineFirst"), t;
  }
  defaultMutationOptions(e) {
    return e != null && e._defaulted ? e : {
      ...i(this, j).mutations,
      ...(e == null ? void 0 : e.mutationKey) && this.getMutationDefaults(e.mutationKey),
      ...e,
      _defaulted: !0
    };
  }
  clear() {
    i(this, l).clear(), i(this, H).clear();
  }
}, l = new WeakMap(), H = new WeakMap(), j = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), N = new WeakMap(), st = new WeakMap(), it = new WeakMap(), Dt);
const ee = "_table__wrapper_103jm_5", se = {
  table__wrapper: ee
}, ce = ({
  tableConfig: e,
  data: t,
  url: s,
  headers: a,
  pagination: r,
  tableClassName: o,
  wrapperClassName: y,
  mutateDataConfig: p,
  setterDataConfig: R,
  children: O,
  setItems: U
}) => {
  const K = new te();
  return /* @__PURE__ */ z(Gt, { client: K, children: /* @__PURE__ */ dt(Bt, { defaultValue: { data: t, url: s, dataConfig: e, pagination: r, mutateDataConfig: p, setterDataConfig: R, setItems: U }, children: [
    /* @__PURE__ */ z($t, { type: "select", options: [{ label: "Código", params: "actividad_id" }] }),
    /* @__PURE__ */ dt("div", { className: "_h-full _w-full _flex _flex-col", children: [
      /* @__PURE__ */ z(
        "div",
        {
          className: wt(
            `${se.table__wrapper} _w-full _rounded-xl _shadow-md _overflow-auto _border _border-primary _bg-scroll`,
            y
          ),
          children: /* @__PURE__ */ dt("table", { className: wt("_table-auto _w-full _border-collapse _bg-white", o), children: [
            /* @__PURE__ */ z(Ht, { tableConfig: e }),
            O ?? /* @__PURE__ */ z(jt, { headers: a, url: s, tableConfig: e, data: t })
          ] })
        }
      ),
      /* @__PURE__ */ z(Nt, {})
    ] })
  ] }) });
};
export {
  te as Q,
  ce as T
};
