mhz-helpers 1.3.22 → 1.3.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- import { isRef as Ee, unref as ze, hasInjectionContext as Ye, inject as Je, ref as Xe, nextTick as Ze, getCurrentScope as Qe, computed as Ae, shallowReactive as Pe, reactive as Re, watch as k, onScopeDispose as Ie, shallowReadonly as Te, readonly as De, toRefs as Fe } from "vue";
2
- import { logout as et } from "../useAuth/index.js";
3
- import { handleError as ce, deleteAuthHeader as tt } from "../api/index.js";
4
- var j = class {
1
+ import { isRef as Ae, unref as Je, hasInjectionContext as Xe, inject as Ze, ref as et, nextTick as tt, getCurrentScope as Pe, computed as Re, shallowReactive as Ie, reactive as De, watch as _, onScopeDispose as Te, shallowReadonly as Fe, readonly as Me, toRefs as Ue } from "vue";
2
+ import { logout as st } from "../useAuth/index.js";
3
+ import { handleError as le, deleteAuthHeader as rt } from "../api/index.js";
4
+ var x = class {
5
5
  constructor() {
6
6
  this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
7
7
  }
@@ -17,7 +17,7 @@ var j = class {
17
17
  }
18
18
  onUnsubscribe() {
19
19
  }
20
- }, st = {
20
+ }, it = {
21
21
  // We need the wrapper function syntax below instead of direct references to
22
22
  // global setTimeout etc.
23
23
  //
@@ -32,14 +32,14 @@ var j = class {
32
32
  clearTimeout: (e) => clearTimeout(e),
33
33
  setInterval: (e, t) => setInterval(e, t),
34
34
  clearInterval: (e) => clearInterval(e)
35
- }, rt = class {
35
+ }, nt = class {
36
36
  // We cannot have TimeoutManager<T> as we must instantiate it with a concrete
37
37
  // type at app boot; and if we leave that type, then any new timer provider
38
38
  // would need to support ReturnType<typeof setTimeout>, which is infeasible.
39
39
  //
40
40
  // We settle for type safety for the TimeoutProvider type, and accept that
41
41
  // this class is unsafe internally to allow for extension.
42
- #e = st;
42
+ #e = it;
43
43
  #t = !1;
44
44
  setTimeoutProvider(e) {
45
45
  process.env.NODE_ENV !== "production" && this.#t && e !== this.#e && console.error(
@@ -59,20 +59,20 @@ var j = class {
59
59
  clearInterval(e) {
60
60
  this.#e.clearInterval(e);
61
61
  }
62
- }, D = new rt();
63
- function it(e) {
62
+ }, T = new nt();
63
+ function ot(e) {
64
64
  setTimeout(e, 0);
65
65
  }
66
66
  var M = typeof window > "u" || "Deno" in globalThis;
67
67
  function w() {
68
68
  }
69
- function nt(e, t) {
69
+ function at(e, t) {
70
70
  return typeof e == "function" ? e(t) : e;
71
71
  }
72
- function z(e) {
72
+ function Y(e) {
73
73
  return typeof e == "number" && e >= 0 && e !== 1 / 0;
74
74
  }
75
- function Me(e, t) {
75
+ function qe(e, t) {
76
76
  return Math.max(e + (t || 0) - Date.now(), 0);
77
77
  }
78
78
  function R(e, t) {
@@ -81,7 +81,7 @@ function R(e, t) {
81
81
  function E(e, t) {
82
82
  return typeof e == "function" ? e(t) : e;
83
83
  }
84
- function he(e, t) {
84
+ function fe(e, t) {
85
85
  const {
86
86
  type: s = "all",
87
87
  exact: r,
@@ -92,7 +92,7 @@ function he(e, t) {
92
92
  } = e;
93
93
  if (o) {
94
94
  if (r) {
95
- if (t.queryHash !== oe(o, t.options))
95
+ if (t.queryHash !== ae(o, t.options))
96
96
  return !1;
97
97
  } else if (!N(t.queryKey, o))
98
98
  return !1;
@@ -104,7 +104,7 @@ function he(e, t) {
104
104
  }
105
105
  return !(typeof a == "boolean" && t.isStale() !== a || i && i !== t.state.fetchStatus || n && !n(t));
106
106
  }
107
- function le(e, t) {
107
+ function de(e, t) {
108
108
  const { exact: s, status: r, predicate: i, mutationKey: n } = e;
109
109
  if (n) {
110
110
  if (!t.options.mutationKey)
@@ -117,43 +117,43 @@ function le(e, t) {
117
117
  }
118
118
  return !(r && t.state.status !== r || i && !i(t));
119
119
  }
120
- function oe(e, t) {
120
+ function ae(e, t) {
121
121
  return (t?.queryKeyHashFn || U)(e);
122
122
  }
123
123
  function U(e) {
124
124
  return JSON.stringify(
125
125
  e,
126
- (t, s) => J(s) ? Object.keys(s).sort().reduce((r, i) => (r[i] = s[i], r), {}) : s
126
+ (t, s) => X(s) ? Object.keys(s).sort().reduce((r, i) => (r[i] = s[i], r), {}) : s
127
127
  );
128
128
  }
129
129
  function N(e, t) {
130
130
  return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? Object.keys(t).every((s) => N(e[s], t[s])) : !1;
131
131
  }
132
- var ot = Object.prototype.hasOwnProperty;
133
- function Y(e, t, s = 0) {
132
+ var ut = Object.prototype.hasOwnProperty;
133
+ function J(e, t, s = 0) {
134
134
  if (e === t)
135
135
  return e;
136
136
  if (s > 500) return t;
137
- const r = fe(e) && fe(t);
138
- if (!r && !(J(e) && J(t))) return t;
137
+ const r = pe(e) && pe(t);
138
+ if (!r && !(X(e) && X(t))) return t;
139
139
  const n = (r ? e : Object.keys(e)).length, o = r ? t : Object.keys(t), a = o.length, u = r ? new Array(a) : {};
140
140
  let y = 0;
141
141
  for (let c = 0; c < a; c++) {
142
142
  const l = r ? c : o[c], f = e[l], d = t[l];
143
143
  if (f === d) {
144
- u[l] = f, (r ? c < n : ot.call(e, l)) && y++;
144
+ u[l] = f, (r ? c < n : ut.call(e, l)) && y++;
145
145
  continue;
146
146
  }
147
147
  if (f === null || d === null || typeof f != "object" || typeof d != "object") {
148
148
  u[l] = d;
149
149
  continue;
150
150
  }
151
- const g = Y(f, d, s + 1);
151
+ const g = J(f, d, s + 1);
152
152
  u[l] = g, g === f && y++;
153
153
  }
154
154
  return n === a && y === n ? e : u;
155
155
  }
156
- function K(e, t) {
156
+ function G(e, t) {
157
157
  if (!t || Object.keys(e).length !== Object.keys(t).length)
158
158
  return !1;
159
159
  for (const s in e)
@@ -161,67 +161,67 @@ function K(e, t) {
161
161
  return !1;
162
162
  return !0;
163
163
  }
164
- function fe(e) {
164
+ function pe(e) {
165
165
  return Array.isArray(e) && e.length === Object.keys(e).length;
166
166
  }
167
- function J(e) {
168
- if (!de(e))
167
+ function X(e) {
168
+ if (!ye(e))
169
169
  return !1;
170
170
  const t = e.constructor;
171
171
  if (t === void 0)
172
172
  return !0;
173
173
  const s = t.prototype;
174
- return !(!de(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
174
+ return !(!ye(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
175
175
  }
176
- function de(e) {
176
+ function ye(e) {
177
177
  return Object.prototype.toString.call(e) === "[object Object]";
178
178
  }
179
- function at(e) {
179
+ function ct(e) {
180
180
  return new Promise((t) => {
181
- D.setTimeout(t, e);
181
+ T.setTimeout(t, e);
182
182
  });
183
183
  }
184
- function X(e, t, s) {
184
+ function Z(e, t, s) {
185
185
  if (typeof s.structuralSharing == "function")
186
186
  return s.structuralSharing(e, t);
187
187
  if (s.structuralSharing !== !1) {
188
188
  if (process.env.NODE_ENV !== "production")
189
189
  try {
190
- return Y(e, t);
190
+ return J(e, t);
191
191
  } catch (r) {
192
192
  throw console.error(
193
193
  `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${r}`
194
194
  ), r;
195
195
  }
196
- return Y(e, t);
196
+ return J(e, t);
197
197
  }
198
198
  return t;
199
199
  }
200
- function ut(e, t, s = 0) {
200
+ function ht(e, t, s = 0) {
201
201
  const r = [...e, t];
202
202
  return s && r.length > s ? r.slice(1) : r;
203
203
  }
204
- function ct(e, t, s = 0) {
204
+ function lt(e, t, s = 0) {
205
205
  const r = [t, ...e];
206
206
  return s && r.length > s ? r.slice(0, -1) : r;
207
207
  }
208
- var G = /* @__PURE__ */ Symbol();
209
- function Ue(e, t) {
210
- return process.env.NODE_ENV !== "production" && e.queryFn === G && console.error(
208
+ var W = /* @__PURE__ */ Symbol();
209
+ function _e(e, t) {
210
+ return process.env.NODE_ENV !== "production" && e.queryFn === W && console.error(
211
211
  `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`
212
- ), !e.queryFn && t?.initialPromise ? () => t.initialPromise : !e.queryFn || e.queryFn === G ? () => Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
212
+ ), !e.queryFn && t?.initialPromise ? () => t.initialPromise : !e.queryFn || e.queryFn === W ? () => Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
213
213
  }
214
- function Z(e, t) {
214
+ function ee(e, t) {
215
215
  return typeof e == "function" ? e(...t) : !!e;
216
216
  }
217
- function ht(e, t, s) {
217
+ function ft(e, t, s) {
218
218
  let r = !1, i;
219
219
  return Object.defineProperty(e, "signal", {
220
220
  enumerable: !0,
221
221
  get: () => (i ??= t(), r || (r = !0, i.aborted ? s() : i.addEventListener("abort", s, { once: !0 })), i)
222
222
  }), e;
223
223
  }
224
- var lt = class extends j {
224
+ var dt = class extends x {
225
225
  #e;
226
226
  #t;
227
227
  #s;
@@ -258,8 +258,8 @@ var lt = class extends j {
258
258
  isFocused() {
259
259
  return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
260
260
  }
261
- }, ae = new lt();
262
- function ee() {
261
+ }, ue = new dt();
262
+ function te() {
263
263
  let e, t;
264
264
  const s = new Promise((i, n) => {
265
265
  e = i, t = n;
@@ -281,13 +281,13 @@ function ee() {
281
281
  }), t(i);
282
282
  }, s;
283
283
  }
284
- var ft = it;
285
- function dt() {
284
+ var pt = ot;
285
+ function yt() {
286
286
  let e = [], t = 0, s = (a) => {
287
287
  a();
288
288
  }, r = (a) => {
289
289
  a();
290
- }, i = ft;
290
+ }, i = pt;
291
291
  const n = (a) => {
292
292
  t ? e.push(a) : i(() => {
293
293
  s(a);
@@ -341,7 +341,7 @@ function dt() {
341
341
  }
342
342
  };
343
343
  }
344
- var b = dt(), pt = class extends j {
344
+ var b = yt(), gt = class extends x {
345
345
  #e = !0;
346
346
  #t;
347
347
  #s;
@@ -372,30 +372,30 @@ var b = dt(), pt = class extends j {
372
372
  isOnline() {
373
373
  return this.#e;
374
374
  }
375
- }, x = new pt();
376
- function yt(e) {
375
+ }, k = new gt();
376
+ function mt(e) {
377
377
  return Math.min(1e3 * 2 ** e, 3e4);
378
378
  }
379
- function qe(e) {
380
- return (e ?? "online") === "online" ? x.isOnline() : !0;
379
+ function ke(e) {
380
+ return (e ?? "online") === "online" ? k.isOnline() : !0;
381
381
  }
382
- var te = class extends Error {
382
+ var se = class extends Error {
383
383
  constructor(e) {
384
384
  super("CancelledError"), this.revert = e?.revert, this.silent = e?.silent;
385
385
  }
386
386
  };
387
- function _e(e) {
387
+ function xe(e) {
388
388
  let t = !1, s = 0, r;
389
- const i = ee(), n = () => i.status !== "pending", o = (p) => {
389
+ const i = te(), n = () => i.status !== "pending", o = (p) => {
390
390
  if (!n()) {
391
- const m = new te(p);
391
+ const m = new se(p);
392
392
  f(m), e.onCancel?.(m);
393
393
  }
394
394
  }, a = () => {
395
395
  t = !0;
396
396
  }, u = () => {
397
397
  t = !1;
398
- }, y = () => ae.isFocused() && (e.networkMode === "always" || x.isOnline()) && e.canRun(), c = () => qe(e.networkMode) && e.canRun(), l = (p) => {
398
+ }, y = () => ue.isFocused() && (e.networkMode === "always" || k.isOnline()) && e.canRun(), c = () => ke(e.networkMode) && e.canRun(), l = (p) => {
399
399
  n() || (r?.(), i.resolve(p));
400
400
  }, f = (p) => {
401
401
  n() || (r?.(), i.reject(p));
@@ -418,12 +418,12 @@ function _e(e) {
418
418
  Promise.resolve(p).then(l).catch((v) => {
419
419
  if (n())
420
420
  return;
421
- const O = e.retry ?? (M ? 0 : 3), A = e.retryDelay ?? yt, I = typeof A == "function" ? A(s, v) : A, T = O === !0 || typeof O == "number" && s < O || typeof O == "function" && O(s, v);
422
- if (t || !T) {
421
+ const O = e.retry ?? (M ? 0 : 3), Q = e.retryDelay ?? mt, I = typeof Q == "function" ? Q(s, v) : Q, D = O === !0 || typeof O == "number" && s < O || typeof O == "function" && O(s, v);
422
+ if (t || !D) {
423
423
  f(v);
424
424
  return;
425
425
  }
426
- s++, e.onFail?.(s, v), at(I).then(() => y() ? void 0 : d()).then(() => {
426
+ s++, e.onFail?.(s, v), ct(I).then(() => y() ? void 0 : d()).then(() => {
427
427
  t ? f(v) : g();
428
428
  });
429
429
  });
@@ -439,13 +439,13 @@ function _e(e) {
439
439
  start: () => (c() ? g() : d().then(g), i)
440
440
  };
441
441
  }
442
- var ke = class {
442
+ var je = class {
443
443
  #e;
444
444
  destroy() {
445
445
  this.clearGcTimeout();
446
446
  }
447
447
  scheduleGc() {
448
- this.clearGcTimeout(), z(this.gcTime) && (this.#e = D.setTimeout(() => {
448
+ this.clearGcTimeout(), Y(this.gcTime) && (this.#e = T.setTimeout(() => {
449
449
  this.optionalRemove();
450
450
  }, this.gcTime));
451
451
  }
@@ -456,9 +456,9 @@ var ke = class {
456
456
  );
457
457
  }
458
458
  clearGcTimeout() {
459
- this.#e && (D.clearTimeout(this.#e), this.#e = void 0);
459
+ this.#e && (T.clearTimeout(this.#e), this.#e = void 0);
460
460
  }
461
- }, gt = class extends ke {
461
+ }, vt = class extends je {
462
462
  #e;
463
463
  #t;
464
464
  #s;
@@ -467,7 +467,7 @@ var ke = class {
467
467
  #o;
468
468
  #a;
469
469
  constructor(e) {
470
- super(), this.#a = !1, this.#o = e.defaultOptions, this.setOptions(e.options), this.observers = [], this.#i = e.client, this.#s = this.#i.getQueryCache(), this.queryKey = e.queryKey, this.queryHash = e.queryHash, this.#e = ye(this.options), this.state = e.state ?? this.#e, this.scheduleGc();
470
+ super(), this.#a = !1, this.#o = e.defaultOptions, this.setOptions(e.options), this.observers = [], this.#i = e.client, this.#s = this.#i.getQueryCache(), this.queryKey = e.queryKey, this.queryHash = e.queryHash, this.#e = me(this.options), this.state = e.state ?? this.#e, this.scheduleGc();
471
471
  }
472
472
  get meta() {
473
473
  return this.options.meta;
@@ -477,9 +477,9 @@ var ke = class {
477
477
  }
478
478
  setOptions(e) {
479
479
  if (this.options = { ...this.#o, ...e }, this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
480
- const t = ye(this.options);
480
+ const t = me(this.options);
481
481
  t.data !== void 0 && (this.setState(
482
- pe(t.data, t.dataUpdatedAt)
482
+ ge(t.data, t.dataUpdatedAt)
483
483
  ), this.#e = t);
484
484
  }
485
485
  }
@@ -487,7 +487,7 @@ var ke = class {
487
487
  !this.observers.length && this.state.fetchStatus === "idle" && this.#s.remove(this);
488
488
  }
489
489
  setData(e, t) {
490
- const s = X(this.state.data, e, this.options);
490
+ const s = Z(this.state.data, e, this.options);
491
491
  return this.#n({
492
492
  data: s,
493
493
  type: "success",
@@ -514,7 +514,7 @@ var ke = class {
514
514
  );
515
515
  }
516
516
  isDisabled() {
517
- return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === G || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
517
+ return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === W || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
518
518
  }
519
519
  isStatic() {
520
520
  return this.getObserversCount() > 0 ? this.observers.some(
@@ -527,7 +527,7 @@ var ke = class {
527
527
  ) : this.state.data === void 0 || this.state.isInvalidated;
528
528
  }
529
529
  isStaleByTime(e = 0) {
530
- return this.state.data === void 0 ? !0 : e === "static" ? !1 : this.state.isInvalidated ? !0 : !Me(this.state.dataUpdatedAt, e);
530
+ return this.state.data === void 0 ? !0 : e === "static" ? !1 : this.state.isInvalidated ? !0 : !qe(this.state.dataUpdatedAt, e);
531
531
  }
532
532
  onFocus() {
533
533
  this.observers.find((t) => t.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: !1 }), this.#r?.continue();
@@ -548,7 +548,7 @@ var ke = class {
548
548
  this.state.isInvalidated || this.#n({ type: "invalidate" });
549
549
  }
550
550
  async fetch(e, t) {
551
- if (this.state.fetchStatus !== "idle" && // If the promise in the retyer is already rejected, we have to definitely
551
+ if (this.state.fetchStatus !== "idle" && // If the promise in the retryer is already rejected, we have to definitely
552
552
  // re-start the fetch; there is a chance that the query is still in a
553
553
  // pending state when that happens
554
554
  this.#r?.status() !== "rejected") {
@@ -570,7 +570,7 @@ var ke = class {
570
570
  get: () => (this.#a = !0, s.signal)
571
571
  });
572
572
  }, i = () => {
573
- const a = Ue(this.options, t), y = (() => {
573
+ const a = _e(this.options, t), y = (() => {
574
574
  const c = {
575
575
  client: this.#i,
576
576
  queryKey: this.queryKey,
@@ -594,11 +594,11 @@ var ke = class {
594
594
  };
595
595
  return r(a), a;
596
596
  })();
597
- this.options.behavior?.onFetch(o, this), this.#t = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== o.fetchOptions?.meta) && this.#n({ type: "fetch", meta: o.fetchOptions?.meta }), this.#r = _e({
597
+ this.options.behavior?.onFetch(o, this), this.#t = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== o.fetchOptions?.meta) && this.#n({ type: "fetch", meta: o.fetchOptions?.meta }), this.#r = xe({
598
598
  initialPromise: t?.initialPromise,
599
599
  fn: o.fetchFn,
600
600
  onCancel: (a) => {
601
- a instanceof te && a.revert && this.setState({
601
+ a instanceof se && a.revert && this.setState({
602
602
  ...this.#t,
603
603
  fetchStatus: "idle"
604
604
  }), s.abort();
@@ -629,7 +629,7 @@ var ke = class {
629
629
  this
630
630
  ), a;
631
631
  } catch (a) {
632
- if (a instanceof te) {
632
+ if (a instanceof se) {
633
633
  if (a.silent)
634
634
  return this.#r.promise;
635
635
  if (a.revert) {
@@ -675,13 +675,13 @@ var ke = class {
675
675
  case "fetch":
676
676
  return {
677
677
  ...s,
678
- ...xe(s.data, this.options),
678
+ ...Ne(s.data, this.options),
679
679
  fetchMeta: e.meta ?? null
680
680
  };
681
681
  case "success":
682
682
  const r = {
683
683
  ...s,
684
- ...pe(e.data, e.dataUpdatedAt),
684
+ ...ge(e.data, e.dataUpdatedAt),
685
685
  dataUpdateCount: s.dataUpdateCount + 1,
686
686
  ...!e.manual && {
687
687
  fetchStatus: "idle",
@@ -724,18 +724,18 @@ var ke = class {
724
724
  });
725
725
  }
726
726
  };
727
- function xe(e, t) {
727
+ function Ne(e, t) {
728
728
  return {
729
729
  fetchFailureCount: 0,
730
730
  fetchFailureReason: null,
731
- fetchStatus: qe(t.networkMode) ? "fetching" : "paused",
731
+ fetchStatus: ke(t.networkMode) ? "fetching" : "paused",
732
732
  ...e === void 0 && {
733
733
  error: null,
734
734
  status: "pending"
735
735
  }
736
736
  };
737
737
  }
738
- function pe(e, t) {
738
+ function ge(e, t) {
739
739
  return {
740
740
  data: e,
741
741
  dataUpdatedAt: t ?? Date.now(),
@@ -744,7 +744,7 @@ function pe(e, t) {
744
744
  status: "success"
745
745
  };
746
746
  }
747
- function ye(e) {
747
+ function me(e) {
748
748
  const t = typeof e.initialData == "function" ? e.initialData() : e.initialData, s = t !== void 0, r = s ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0;
749
749
  return {
750
750
  data: t,
@@ -761,9 +761,9 @@ function ye(e) {
761
761
  fetchStatus: "idle"
762
762
  };
763
763
  }
764
- var mt = class extends j {
764
+ var bt = class extends x {
765
765
  constructor(e, t) {
766
- super(), this.options = t, this.#e = e, this.#n = null, this.#a = ee(), this.bindMethods(), this.setOptions(t);
766
+ super(), this.options = t, this.#e = e, this.#n = null, this.#a = te(), this.bindMethods(), this.setOptions(t);
767
767
  }
768
768
  #e;
769
769
  #t = void 0;
@@ -786,20 +786,20 @@ var mt = class extends j {
786
786
  this.refetch = this.refetch.bind(this);
787
787
  }
788
788
  onSubscribe() {
789
- this.listeners.size === 1 && (this.#t.addObserver(this), ge(this.#t, this.options) ? this.#l() : this.updateResult(), this.#b());
789
+ this.listeners.size === 1 && (this.#t.addObserver(this), ve(this.#t, this.options) ? this.#l() : this.updateResult(), this.#b());
790
790
  }
791
791
  onUnsubscribe() {
792
792
  this.hasListeners() || this.destroy();
793
793
  }
794
794
  shouldFetchOnReconnect() {
795
- return se(
795
+ return re(
796
796
  this.#t,
797
797
  this.options,
798
798
  this.options.refetchOnReconnect
799
799
  );
800
800
  }
801
801
  shouldFetchOnWindowFocus() {
802
- return se(
802
+ return re(
803
803
  this.#t,
804
804
  this.options,
805
805
  this.options.refetchOnWindowFocus
@@ -814,13 +814,13 @@ var mt = class extends j {
814
814
  throw new Error(
815
815
  "Expected enabled to be a boolean or a callback that returns a boolean"
816
816
  );
817
- this.#C(), this.#t.setOptions(this.options), t._defaulted && !K(this.options, t) && this.#e.getQueryCache().notify({
817
+ this.#C(), this.#t.setOptions(this.options), t._defaulted && !G(this.options, t) && this.#e.getQueryCache().notify({
818
818
  type: "observerOptionsUpdated",
819
819
  query: this.#t,
820
820
  observer: this
821
821
  });
822
822
  const r = this.hasListeners();
823
- r && me(
823
+ r && be(
824
824
  this.#t,
825
825
  s,
826
826
  this.options,
@@ -831,7 +831,7 @@ var mt = class extends j {
831
831
  }
832
832
  getOptimisticResult(e) {
833
833
  const t = this.#e.getQueryCache().build(this.#e, e), s = this.createResult(t, e);
834
- return bt(this, s) && (this.#i = s, this.#o = this.options, this.#r = this.#t.state), s;
834
+ return St(this, s) && (this.#i = s, this.#o = this.options, this.#r = this.#t.state), s;
835
835
  }
836
836
  getCurrentResult() {
837
837
  return this.#i;
@@ -880,10 +880,10 @@ var mt = class extends j {
880
880
  this.options.staleTime,
881
881
  this.#t
882
882
  );
883
- if (M || this.#i.isStale || !z(e))
883
+ if (M || this.#i.isStale || !Y(e))
884
884
  return;
885
- const s = Me(this.#i.dataUpdatedAt, e) + 1;
886
- this.#c = D.setTimeout(() => {
885
+ const s = qe(this.#i.dataUpdatedAt, e) + 1;
886
+ this.#c = T.setTimeout(() => {
887
887
  this.#i.isStale || this.updateResult();
888
888
  }, s);
889
889
  }
@@ -891,27 +891,27 @@ var mt = class extends j {
891
891
  return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#t) : this.options.refetchInterval) ?? !1;
892
892
  }
893
893
  #v(e) {
894
- this.#S(), this.#u = e, !(M || E(this.options.enabled, this.#t) === !1 || !z(this.#u) || this.#u === 0) && (this.#h = D.setInterval(() => {
895
- (this.options.refetchIntervalInBackground || ae.isFocused()) && this.#l();
894
+ this.#S(), this.#u = e, !(M || E(this.options.enabled, this.#t) === !1 || !Y(this.#u) || this.#u === 0) && (this.#h = T.setInterval(() => {
895
+ (this.options.refetchIntervalInBackground || ue.isFocused()) && this.#l();
896
896
  }, this.#u));
897
897
  }
898
898
  #b() {
899
899
  this.#g(), this.#v(this.#m());
900
900
  }
901
901
  #O() {
902
- this.#c && (D.clearTimeout(this.#c), this.#c = void 0);
902
+ this.#c && (T.clearTimeout(this.#c), this.#c = void 0);
903
903
  }
904
904
  #S() {
905
- this.#h && (D.clearInterval(this.#h), this.#h = void 0);
905
+ this.#h && (T.clearInterval(this.#h), this.#h = void 0);
906
906
  }
907
907
  createResult(e, t) {
908
908
  const s = this.#t, r = this.options, i = this.#i, n = this.#r, o = this.#o, u = e !== s ? e.state : this.#s, { state: y } = e;
909
909
  let c = { ...y }, l = !1, f;
910
910
  if (t._optimisticResults) {
911
- const C = this.hasListeners(), H = !C && ge(e, t), q = C && me(e, s, t, r);
912
- (H || q) && (c = {
911
+ const C = this.hasListeners(), j = !C && ve(e, t), H = C && be(e, s, t, r);
912
+ (j || H) && (c = {
913
913
  ...c,
914
- ...xe(y.data, e.options)
914
+ ...Ne(y.data, e.options)
915
915
  }), t._optimisticResults === "isRestoring" && (c.fetchStatus = "idle");
916
916
  }
917
917
  let { error: d, errorUpdatedAt: g, status: p } = c;
@@ -922,7 +922,7 @@ var mt = class extends j {
922
922
  i?.isPlaceholderData && t.placeholderData === o?.placeholderData ? (C = i.data, m = !0) : C = typeof t.placeholderData == "function" ? t.placeholderData(
923
923
  this.#d?.state.data,
924
924
  this.#d
925
- ) : t.placeholderData, C !== void 0 && (p = "success", f = X(
925
+ ) : t.placeholderData, C !== void 0 && (p = "success", f = Z(
926
926
  i?.data,
927
927
  C,
928
928
  t
@@ -933,17 +933,17 @@ var mt = class extends j {
933
933
  f = this.#f;
934
934
  else
935
935
  try {
936
- this.#y = t.select, f = t.select(f), f = X(i?.data, f, t), this.#f = f, this.#n = null;
936
+ this.#y = t.select, f = t.select(f), f = Z(i?.data, f, t), this.#f = f, this.#n = null;
937
937
  } catch (C) {
938
938
  this.#n = C;
939
939
  }
940
940
  this.#n && (d = this.#n, f = this.#f, g = Date.now(), p = "error");
941
- const v = c.fetchStatus === "fetching", O = p === "pending", A = p === "error", I = O && v, T = f !== void 0, Q = {
941
+ const v = c.fetchStatus === "fetching", O = p === "pending", Q = p === "error", I = O && v, D = f !== void 0, A = {
942
942
  status: p,
943
943
  fetchStatus: c.fetchStatus,
944
944
  isPending: O,
945
945
  isSuccess: p === "success",
946
- isError: A,
946
+ isError: Q,
947
947
  isInitialLoading: I,
948
948
  isLoading: I,
949
949
  data: f,
@@ -957,39 +957,39 @@ var mt = class extends j {
957
957
  isFetchedAfterMount: c.dataUpdateCount > u.dataUpdateCount || c.errorUpdateCount > u.errorUpdateCount,
958
958
  isFetching: v,
959
959
  isRefetching: v && !O,
960
- isLoadingError: A && !T,
960
+ isLoadingError: Q && !D,
961
961
  isPaused: c.fetchStatus === "paused",
962
962
  isPlaceholderData: l,
963
- isRefetchError: A && T,
964
- isStale: ue(e, t),
963
+ isRefetchError: Q && D,
964
+ isStale: ce(e, t),
965
965
  refetch: this.refetch,
966
966
  promise: this.#a,
967
967
  isEnabled: E(t.enabled, e) !== !1
968
968
  };
969
969
  if (this.options.experimental_prefetchInRender) {
970
- const C = (L) => {
971
- Q.status === "error" ? L.reject(Q.error) : Q.data !== void 0 && L.resolve(Q.data);
972
- }, H = () => {
973
- const L = this.#a = Q.promise = ee();
974
- C(L);
975
- }, q = this.#a;
976
- switch (q.status) {
970
+ const C = A.data !== void 0, j = A.status === "error" && !C, H = (V) => {
971
+ j ? V.reject(A.error) : C && V.resolve(A.data);
972
+ }, he = () => {
973
+ const V = this.#a = A.promise = te();
974
+ H(V);
975
+ }, L = this.#a;
976
+ switch (L.status) {
977
977
  case "pending":
978
- e.queryHash === s.queryHash && C(q);
978
+ e.queryHash === s.queryHash && H(L);
979
979
  break;
980
980
  case "fulfilled":
981
- (Q.status === "error" || Q.data !== q.value) && H();
981
+ (j || A.data !== L.value) && he();
982
982
  break;
983
983
  case "rejected":
984
- (Q.status !== "error" || Q.error !== q.reason) && H();
984
+ (!j || A.error !== L.reason) && he();
985
985
  break;
986
986
  }
987
987
  }
988
- return Q;
988
+ return A;
989
989
  }
990
990
  updateResult() {
991
991
  const e = this.#i, t = this.createResult(this.#t, this.options);
992
- if (this.#r = this.#t.state, this.#o = this.options, this.#r.data !== void 0 && (this.#d = this.#t), K(t, e))
992
+ if (this.#r = this.#t.state, this.#o = this.options, this.#r.data !== void 0 && (this.#d = this.#t), G(t, e))
993
993
  return;
994
994
  this.#i = t;
995
995
  const s = () => {
@@ -1029,29 +1029,29 @@ var mt = class extends j {
1029
1029
  });
1030
1030
  }
1031
1031
  };
1032
- function vt(e, t) {
1032
+ function Ot(e, t) {
1033
1033
  return E(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && t.retryOnMount === !1);
1034
1034
  }
1035
- function ge(e, t) {
1036
- return vt(e, t) || e.state.data !== void 0 && se(e, t, t.refetchOnMount);
1035
+ function ve(e, t) {
1036
+ return Ot(e, t) || e.state.data !== void 0 && re(e, t, t.refetchOnMount);
1037
1037
  }
1038
- function se(e, t, s) {
1038
+ function re(e, t, s) {
1039
1039
  if (E(t.enabled, e) !== !1 && R(t.staleTime, e) !== "static") {
1040
1040
  const r = typeof s == "function" ? s(e) : s;
1041
- return r === "always" || r !== !1 && ue(e, t);
1041
+ return r === "always" || r !== !1 && ce(e, t);
1042
1042
  }
1043
1043
  return !1;
1044
1044
  }
1045
- function me(e, t, s, r) {
1046
- return (e !== t || E(r.enabled, e) === !1) && (!s.suspense || e.state.status !== "error") && ue(e, s);
1045
+ function be(e, t, s, r) {
1046
+ return (e !== t || E(r.enabled, e) === !1) && (!s.suspense || e.state.status !== "error") && ce(e, s);
1047
1047
  }
1048
- function ue(e, t) {
1048
+ function ce(e, t) {
1049
1049
  return E(t.enabled, e) !== !1 && e.isStaleByTime(R(t.staleTime, e));
1050
1050
  }
1051
- function bt(e, t) {
1052
- return !K(e.getCurrentResult(), t);
1051
+ function St(e, t) {
1052
+ return !G(e.getCurrentResult(), t);
1053
1053
  }
1054
- function ve(e) {
1054
+ function Oe(e) {
1055
1055
  return {
1056
1056
  onFetch: (t, s) => {
1057
1057
  const r = t.options, i = t.fetchOptions?.meta?.fetchMore?.direction, n = t.state.data?.pages || [], o = t.state.data?.pageParams || [];
@@ -1059,33 +1059,33 @@ function ve(e) {
1059
1059
  const y = async () => {
1060
1060
  let c = !1;
1061
1061
  const l = (g) => {
1062
- ht(
1062
+ ft(
1063
1063
  g,
1064
1064
  () => t.signal,
1065
1065
  () => c = !0
1066
1066
  );
1067
- }, f = Ue(t.options, t.fetchOptions), d = async (g, p, m) => {
1067
+ }, f = _e(t.options, t.fetchOptions), d = async (g, p, m) => {
1068
1068
  if (c)
1069
1069
  return Promise.reject();
1070
1070
  if (p == null && g.pages.length)
1071
1071
  return Promise.resolve(g);
1072
1072
  const O = (() => {
1073
- const W = {
1073
+ const B = {
1074
1074
  client: t.client,
1075
1075
  queryKey: t.queryKey,
1076
1076
  pageParam: p,
1077
1077
  direction: m ? "backward" : "forward",
1078
1078
  meta: t.options.meta
1079
1079
  };
1080
- return l(W), W;
1081
- })(), A = await f(O), { maxPages: I } = t.options, T = m ? ct : ut;
1080
+ return l(B), B;
1081
+ })(), Q = await f(O), { maxPages: I } = t.options, D = m ? lt : ht;
1082
1082
  return {
1083
- pages: T(g.pages, A, I),
1084
- pageParams: T(g.pageParams, p, I)
1083
+ pages: D(g.pages, Q, I),
1084
+ pageParams: D(g.pageParams, p, I)
1085
1085
  };
1086
1086
  };
1087
1087
  if (i && n.length) {
1088
- const g = i === "backward", p = g ? Ot : be, m = {
1088
+ const g = i === "backward", p = g ? Ct : Se, m = {
1089
1089
  pages: n,
1090
1090
  pageParams: o
1091
1091
  }, v = p(r, m);
@@ -1093,7 +1093,7 @@ function ve(e) {
1093
1093
  } else {
1094
1094
  const g = e ?? n.length;
1095
1095
  do {
1096
- const p = u === 0 ? o[0] ?? r.initialPageParam : be(r, a);
1096
+ const p = u === 0 ? o[0] ?? r.initialPageParam : Se(r, a);
1097
1097
  if (u > 0 && p == null)
1098
1098
  break;
1099
1099
  a = await d(a, p), u++;
@@ -1114,7 +1114,7 @@ function ve(e) {
1114
1114
  }
1115
1115
  };
1116
1116
  }
1117
- function be(e, { pages: t, pageParams: s }) {
1117
+ function Se(e, { pages: t, pageParams: s }) {
1118
1118
  const r = t.length - 1;
1119
1119
  return t.length > 0 ? e.getNextPageParam(
1120
1120
  t[r],
@@ -1123,16 +1123,16 @@ function be(e, { pages: t, pageParams: s }) {
1123
1123
  s
1124
1124
  ) : void 0;
1125
1125
  }
1126
- function Ot(e, { pages: t, pageParams: s }) {
1126
+ function Ct(e, { pages: t, pageParams: s }) {
1127
1127
  return t.length > 0 ? e.getPreviousPageParam?.(t[0], t, s[0], s) : void 0;
1128
1128
  }
1129
- var St = class extends ke {
1129
+ var wt = class extends je {
1130
1130
  #e;
1131
1131
  #t;
1132
1132
  #s;
1133
1133
  #i;
1134
1134
  constructor(e) {
1135
- super(), this.#e = e.client, this.mutationId = e.mutationId, this.#s = e.mutationCache, this.#t = [], this.state = e.state || je(), this.setOptions(e.options), this.scheduleGc();
1135
+ super(), this.#e = e.client, this.mutationId = e.mutationId, this.#s = e.mutationCache, this.#t = [], this.state = e.state || He(), this.setOptions(e.options), this.scheduleGc();
1136
1136
  }
1137
1137
  setOptions(e) {
1138
1138
  this.options = e, this.updateGcTime(this.options.gcTime);
@@ -1169,7 +1169,7 @@ var St = class extends ke {
1169
1169
  meta: this.options.meta,
1170
1170
  mutationKey: this.options.mutationKey
1171
1171
  };
1172
- this.#i = _e({
1172
+ this.#i = xe({
1173
1173
  fn: () => this.options.mutationFn ? this.options.mutationFn(e, s) : Promise.reject(new Error("No mutationFn found")),
1174
1174
  onFail: (n, o) => {
1175
1175
  this.#r({ type: "failed", failureCount: n, error: o });
@@ -1188,7 +1188,7 @@ var St = class extends ke {
1188
1188
  if (r)
1189
1189
  t();
1190
1190
  else {
1191
- this.#r({ type: "pending", variables: e, isPaused: i }), await this.#s.config.onMutate?.(
1191
+ this.#r({ type: "pending", variables: e, isPaused: i }), this.#s.config.onMutate && await this.#s.config.onMutate(
1192
1192
  e,
1193
1193
  this,
1194
1194
  s
@@ -1345,7 +1345,7 @@ var St = class extends ke {
1345
1345
  });
1346
1346
  }
1347
1347
  };
1348
- function je() {
1348
+ function He() {
1349
1349
  return {
1350
1350
  context: void 0,
1351
1351
  data: void 0,
@@ -1358,7 +1358,7 @@ function je() {
1358
1358
  submittedAt: 0
1359
1359
  };
1360
1360
  }
1361
- var Ne = class extends j {
1361
+ var Le = class extends x {
1362
1362
  constructor(t = {}) {
1363
1363
  super(), this.config = t, this.#e = /* @__PURE__ */ new Set(), this.#t = /* @__PURE__ */ new Map(), this.#s = 0;
1364
1364
  }
@@ -1366,7 +1366,7 @@ var Ne = class extends j {
1366
1366
  #t;
1367
1367
  #s;
1368
1368
  build(t, s, r) {
1369
- const i = new St({
1369
+ const i = new wt({
1370
1370
  client: t,
1371
1371
  mutationCache: this,
1372
1372
  mutationId: ++this.#s,
@@ -1377,7 +1377,7 @@ var Ne = class extends j {
1377
1377
  }
1378
1378
  add(t) {
1379
1379
  this.#e.add(t);
1380
- const s = V(t);
1380
+ const s = K(t);
1381
1381
  if (typeof s == "string") {
1382
1382
  const r = this.#t.get(s);
1383
1383
  r ? r.push(t) : this.#t.set(s, [t]);
@@ -1386,7 +1386,7 @@ var Ne = class extends j {
1386
1386
  }
1387
1387
  remove(t) {
1388
1388
  if (this.#e.delete(t)) {
1389
- const s = V(t);
1389
+ const s = K(t);
1390
1390
  if (typeof s == "string") {
1391
1391
  const r = this.#t.get(s);
1392
1392
  if (r)
@@ -1399,7 +1399,7 @@ var Ne = class extends j {
1399
1399
  this.notify({ type: "removed", mutation: t });
1400
1400
  }
1401
1401
  canRun(t) {
1402
- const s = V(t);
1402
+ const s = K(t);
1403
1403
  if (typeof s == "string") {
1404
1404
  const i = this.#t.get(s)?.find(
1405
1405
  (n) => n.state.status === "pending"
@@ -1409,7 +1409,7 @@ var Ne = class extends j {
1409
1409
  return !0;
1410
1410
  }
1411
1411
  runNext(t) {
1412
- const s = V(t);
1412
+ const s = K(t);
1413
1413
  return typeof s == "string" ? this.#t.get(s)?.find((i) => i !== t && i.state.isPaused)?.continue() ?? Promise.resolve() : Promise.resolve();
1414
1414
  }
1415
1415
  clear() {
@@ -1425,11 +1425,11 @@ var Ne = class extends j {
1425
1425
  find(t) {
1426
1426
  const s = { exact: !0, ...t };
1427
1427
  return this.getAll().find(
1428
- (r) => le(s, r)
1428
+ (r) => de(s, r)
1429
1429
  );
1430
1430
  }
1431
1431
  findAll(t = {}) {
1432
- return this.getAll().filter((s) => le(t, s));
1432
+ return this.getAll().filter((s) => de(t, s));
1433
1433
  }
1434
1434
  notify(t) {
1435
1435
  b.batch(() => {
@@ -1447,10 +1447,10 @@ var Ne = class extends j {
1447
1447
  );
1448
1448
  }
1449
1449
  };
1450
- function V(e) {
1450
+ function K(e) {
1451
1451
  return e.options.scope?.id;
1452
1452
  }
1453
- var Ct = class extends j {
1453
+ var Et = class extends x {
1454
1454
  #e;
1455
1455
  #t = void 0;
1456
1456
  #s;
@@ -1463,7 +1463,7 @@ var Ct = class extends j {
1463
1463
  }
1464
1464
  setOptions(e) {
1465
1465
  const t = this.options;
1466
- this.options = this.#e.defaultMutationOptions(e), K(this.options, t) || this.#e.getMutationCache().notify({
1466
+ this.options = this.#e.defaultMutationOptions(e), G(this.options, t) || this.#e.getMutationCache().notify({
1467
1467
  type: "observerOptionsUpdated",
1468
1468
  mutation: this.#s,
1469
1469
  observer: this
@@ -1485,7 +1485,7 @@ var Ct = class extends j {
1485
1485
  return this.#i = t, this.#s?.removeObserver(this), this.#s = this.#e.getMutationCache().build(this.#e, this.options), this.#s.addObserver(this), this.#s.execute(e);
1486
1486
  }
1487
1487
  #r() {
1488
- const e = this.#s?.state ?? je();
1488
+ const e = this.#s?.state ?? He();
1489
1489
  this.#t = {
1490
1490
  ...e,
1491
1491
  isPending: e.status === "pending",
@@ -1555,15 +1555,15 @@ var Ct = class extends j {
1555
1555
  });
1556
1556
  });
1557
1557
  }
1558
- }, He = class extends j {
1558
+ }, Ve = class extends x {
1559
1559
  constructor(t = {}) {
1560
1560
  super(), this.config = t, this.#e = /* @__PURE__ */ new Map();
1561
1561
  }
1562
1562
  #e;
1563
1563
  build(t, s, r) {
1564
- const i = s.queryKey, n = s.queryHash ?? oe(i, s);
1564
+ const i = s.queryKey, n = s.queryHash ?? ae(i, s);
1565
1565
  let o = this.get(n);
1566
- return o || (o = new gt({
1566
+ return o || (o = new vt({
1567
1567
  client: t,
1568
1568
  queryKey: i,
1569
1569
  queryHash: n,
@@ -1598,12 +1598,12 @@ var Ct = class extends j {
1598
1598
  find(t) {
1599
1599
  const s = { exact: !0, ...t };
1600
1600
  return this.getAll().find(
1601
- (r) => he(s, r)
1601
+ (r) => fe(s, r)
1602
1602
  );
1603
1603
  }
1604
1604
  findAll(t = {}) {
1605
1605
  const s = this.getAll();
1606
- return Object.keys(t).length > 0 ? s.filter((r) => he(t, r)) : s;
1606
+ return Object.keys(t).length > 0 ? s.filter((r) => fe(t, r)) : s;
1607
1607
  }
1608
1608
  notify(t) {
1609
1609
  b.batch(() => {
@@ -1626,7 +1626,7 @@ var Ct = class extends j {
1626
1626
  });
1627
1627
  });
1628
1628
  }
1629
- }, wt = class {
1629
+ }, Qt = class {
1630
1630
  #e;
1631
1631
  #t;
1632
1632
  #s;
@@ -1636,12 +1636,12 @@ var Ct = class extends j {
1636
1636
  #a;
1637
1637
  #n;
1638
1638
  constructor(t = {}) {
1639
- this.#e = t.queryCache || new He(), this.#t = t.mutationCache || new Ne(), this.#s = t.defaultOptions || {}, this.#i = /* @__PURE__ */ new Map(), this.#r = /* @__PURE__ */ new Map(), this.#o = 0;
1639
+ this.#e = t.queryCache || new Ve(), this.#t = t.mutationCache || new Le(), this.#s = t.defaultOptions || {}, this.#i = /* @__PURE__ */ new Map(), this.#r = /* @__PURE__ */ new Map(), this.#o = 0;
1640
1640
  }
1641
1641
  mount() {
1642
- this.#o++, this.#o === 1 && (this.#a = ae.subscribe(async (t) => {
1642
+ this.#o++, this.#o === 1 && (this.#a = ue.subscribe(async (t) => {
1643
1643
  t && (await this.resumePausedMutations(), this.#e.onFocus());
1644
- }), this.#n = x.subscribe(async (t) => {
1644
+ }), this.#n = k.subscribe(async (t) => {
1645
1645
  t && (await this.resumePausedMutations(), this.#e.onOnline());
1646
1646
  }));
1647
1647
  }
@@ -1678,7 +1678,7 @@ var Ct = class extends j {
1678
1678
  setQueryData(t, s, r) {
1679
1679
  const i = this.defaultQueryOptions({ queryKey: t }), o = this.#e.get(
1680
1680
  i.queryHash
1681
- )?.state.data, a = nt(s, o);
1681
+ )?.state.data, a = at(s, o);
1682
1682
  if (a !== void 0)
1683
1683
  return this.#e.build(this, i).setData(a, { ...r, manual: !0 });
1684
1684
  }
@@ -1757,16 +1757,16 @@ var Ct = class extends j {
1757
1757
  return this.fetchQuery(t).then(w).catch(w);
1758
1758
  }
1759
1759
  fetchInfiniteQuery(t) {
1760
- return t.behavior = ve(t.pages), this.fetchQuery(t);
1760
+ return t.behavior = Oe(t.pages), this.fetchQuery(t);
1761
1761
  }
1762
1762
  prefetchInfiniteQuery(t) {
1763
1763
  return this.fetchInfiniteQuery(t).then(w).catch(w);
1764
1764
  }
1765
1765
  ensureInfiniteQueryData(t) {
1766
- return t.behavior = ve(t.pages), this.ensureQueryData(t);
1766
+ return t.behavior = Oe(t.pages), this.ensureQueryData(t);
1767
1767
  }
1768
1768
  resumePausedMutations() {
1769
- return x.isOnline() ? this.#t.resumePausedMutations() : Promise.resolve();
1769
+ return k.isOnline() ? this.#t.resumePausedMutations() : Promise.resolve();
1770
1770
  }
1771
1771
  getQueryCache() {
1772
1772
  return this.#e;
@@ -1813,10 +1813,10 @@ var Ct = class extends j {
1813
1813
  ...t,
1814
1814
  _defaulted: !0
1815
1815
  };
1816
- return s.queryHash || (s.queryHash = oe(
1816
+ return s.queryHash || (s.queryHash = ae(
1817
1817
  s.queryKey,
1818
1818
  s
1819
- )), s.refetchOnReconnect === void 0 && (s.refetchOnReconnect = s.networkMode !== "always"), s.throwOnError === void 0 && (s.throwOnError = !!s.suspense), !s.networkMode && s.persister && (s.networkMode = "offlineFirst"), s.queryFn === G && (s.enabled = !1), s;
1819
+ )), s.refetchOnReconnect === void 0 && (s.refetchOnReconnect = s.networkMode !== "always"), s.throwOnError === void 0 && (s.throwOnError = !!s.suspense), !s.networkMode && s.persister && (s.networkMode = "offlineFirst"), s.queryFn === W && (s.enabled = !1), s;
1820
1820
  }
1821
1821
  defaultMutationOptions(t) {
1822
1822
  return t?._defaulted ? t : {
@@ -1829,91 +1829,91 @@ var Ct = class extends j {
1829
1829
  clear() {
1830
1830
  this.#e.clear(), this.#t.clear();
1831
1831
  }
1832
- }, Et = "VUE_QUERY_CLIENT";
1833
- function Le(e) {
1832
+ }, At = "VUE_QUERY_CLIENT";
1833
+ function Ke(e) {
1834
1834
  const t = e ? `:${e}` : "";
1835
- return `${Et}${t}`;
1835
+ return `${At}${t}`;
1836
1836
  }
1837
- function re(e, t) {
1837
+ function ie(e, t) {
1838
1838
  Object.keys(e).forEach((s) => {
1839
1839
  e[s] = t[s];
1840
1840
  });
1841
1841
  }
1842
- function ie(e, t, s = "", r = 0) {
1842
+ function ne(e, t, s = "", r = 0) {
1843
1843
  if (t) {
1844
1844
  const i = t(e, s, r);
1845
- if (i === void 0 && Ee(e) || i !== void 0)
1845
+ if (i === void 0 && Ae(e) || i !== void 0)
1846
1846
  return i;
1847
1847
  }
1848
1848
  if (Array.isArray(e))
1849
1849
  return e.map(
1850
- (i, n) => ie(i, t, String(n), r + 1)
1850
+ (i, n) => ne(i, t, String(n), r + 1)
1851
1851
  );
1852
- if (typeof e == "object" && At(e)) {
1852
+ if (typeof e == "object" && Rt(e)) {
1853
1853
  const i = Object.entries(e).map(([n, o]) => [
1854
1854
  n,
1855
- ie(o, t, n, r + 1)
1855
+ ne(o, t, n, r + 1)
1856
1856
  ]);
1857
1857
  return Object.fromEntries(i);
1858
1858
  }
1859
1859
  return e;
1860
1860
  }
1861
- function Qt(e, t) {
1862
- return ie(e, t);
1861
+ function Pt(e, t) {
1862
+ return ne(e, t);
1863
1863
  }
1864
1864
  function h(e, t = !1) {
1865
- return Qt(e, (s, r, i) => {
1865
+ return Pt(e, (s, r, i) => {
1866
1866
  if (i === 1 && r === "queryKey")
1867
1867
  return h(s, !0);
1868
- if (t && Pt(s))
1868
+ if (t && It(s))
1869
1869
  return h(s(), t);
1870
- if (Ee(s))
1871
- return h(ze(s), t);
1870
+ if (Ae(s))
1871
+ return h(Je(s), t);
1872
1872
  });
1873
1873
  }
1874
- function At(e) {
1874
+ function Rt(e) {
1875
1875
  if (Object.prototype.toString.call(e) !== "[object Object]")
1876
1876
  return !1;
1877
1877
  const t = Object.getPrototypeOf(e);
1878
1878
  return t === null || t === Object.prototype;
1879
1879
  }
1880
- function Pt(e) {
1880
+ function It(e) {
1881
1881
  return typeof e == "function";
1882
1882
  }
1883
- function Ve(e = "") {
1884
- if (!Ye())
1883
+ function Ge(e = "") {
1884
+ if (!Xe())
1885
1885
  throw new Error(
1886
1886
  "vue-query hooks can only be used inside setup() function or functions that support injection context."
1887
1887
  );
1888
- const t = Le(e), s = Je(t);
1888
+ const t = Ke(e), s = Ze(t);
1889
1889
  if (!s)
1890
1890
  throw new Error(
1891
1891
  "No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library."
1892
1892
  );
1893
1893
  return s;
1894
1894
  }
1895
- var Ke = class extends He {
1895
+ var We = class extends Ve {
1896
1896
  find(e) {
1897
1897
  return super.find(h(e));
1898
1898
  }
1899
1899
  findAll(e = {}) {
1900
1900
  return super.findAll(h(e));
1901
1901
  }
1902
- }, Rt = class extends Ne {
1902
+ }, Dt = class extends Le {
1903
1903
  find(e) {
1904
1904
  return super.find(h(e));
1905
1905
  }
1906
1906
  findAll(e = {}) {
1907
1907
  return super.findAll(h(e));
1908
1908
  }
1909
- }, Ge = class extends wt {
1909
+ }, Be = class extends Qt {
1910
1910
  constructor(e = {}) {
1911
1911
  const t = {
1912
1912
  defaultOptions: e.defaultOptions,
1913
- queryCache: e.queryCache || new Ke(),
1914
- mutationCache: e.mutationCache || new Rt()
1913
+ queryCache: e.queryCache || new We(),
1914
+ mutationCache: e.mutationCache || new Dt()
1915
1915
  };
1916
- super(t), this.isRestoring = Xe(!1);
1916
+ super(t), this.isRestoring = et(!1);
1917
1917
  }
1918
1918
  isFetching(e = {}) {
1919
1919
  return super.isFetching(h(e));
@@ -1967,7 +1967,7 @@ var Ke = class extends He {
1967
1967
  ...s,
1968
1968
  type: s.refetchType ?? s.type ?? "active"
1969
1969
  };
1970
- return Ze().then(() => super.refetchQueries(i, r));
1970
+ return tt().then(() => super.refetchQueries(i, r));
1971
1971
  }
1972
1972
  refetchQueries(e = {}, t = {}) {
1973
1973
  return super.refetchQueries(
@@ -2006,22 +2006,22 @@ var Ke = class extends He {
2006
2006
  return super.getMutationDefaults(h(e));
2007
2007
  }
2008
2008
  };
2009
- function It() {
2010
- return We().__VUE_DEVTOOLS_GLOBAL_HOOK__;
2009
+ function Tt() {
2010
+ return $e().__VUE_DEVTOOLS_GLOBAL_HOOK__;
2011
2011
  }
2012
- function We() {
2012
+ function $e() {
2013
2013
  return typeof navigator < "u" && typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : {};
2014
2014
  }
2015
- const Tt = typeof Proxy == "function", Dt = "devtools-plugin:setup", Ft = "plugin:settings:set";
2016
- let _, ne;
2017
- function Mt() {
2015
+ const Ft = typeof Proxy == "function", Mt = "devtools-plugin:setup", Ut = "plugin:settings:set";
2016
+ let q, oe;
2017
+ function qt() {
2018
2018
  var e;
2019
- return _ !== void 0 || (typeof window < "u" && window.performance ? (_ = !0, ne = window.performance) : typeof globalThis < "u" && (!((e = globalThis.perf_hooks) === null || e === void 0) && e.performance) ? (_ = !0, ne = globalThis.perf_hooks.performance) : _ = !1), _;
2019
+ return q !== void 0 || (typeof window < "u" && window.performance ? (q = !0, oe = window.performance) : typeof globalThis < "u" && (!((e = globalThis.perf_hooks) === null || e === void 0) && e.performance) ? (q = !0, oe = globalThis.perf_hooks.performance) : q = !1), q;
2020
2020
  }
2021
- function Ut() {
2022
- return Mt() ? ne.now() : Date.now();
2021
+ function _t() {
2022
+ return qt() ? oe.now() : Date.now();
2023
2023
  }
2024
- class qt {
2024
+ class kt {
2025
2025
  constructor(t, s) {
2026
2026
  this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = t, this.hook = s;
2027
2027
  const r = {};
@@ -2049,9 +2049,9 @@ class qt {
2049
2049
  n = o;
2050
2050
  },
2051
2051
  now() {
2052
- return Ut();
2052
+ return _t();
2053
2053
  }
2054
- }, s && s.on(Ft, (o, a) => {
2054
+ }, s && s.on(Ut, (o, a) => {
2055
2055
  o === this.plugin.id && this.fallbacks.setSettings(a);
2056
2056
  }), this.proxiedOn = new Proxy({}, {
2057
2057
  get: (o, a) => this.target ? this.target.on[a] : (...u) => {
@@ -2083,12 +2083,12 @@ class qt {
2083
2083
  s.resolve(await this.target[s.method](...s.args));
2084
2084
  }
2085
2085
  }
2086
- function _t(e, t) {
2087
- const s = e, r = We(), i = It(), n = Tt && s.enableEarlyProxy;
2086
+ function xt(e, t) {
2087
+ const s = e, r = $e(), i = Tt(), n = Ft && s.enableEarlyProxy;
2088
2088
  if (i && (r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !n))
2089
- i.emit(Dt, e, t);
2089
+ i.emit(Mt, e, t);
2090
2090
  else {
2091
- const o = n ? new qt(s, i) : null;
2091
+ const o = n ? new kt(s, i) : null;
2092
2092
  (r.__VUE_DEVTOOLS_PLUGINS__ = r.__VUE_DEVTOOLS_PLUGINS__ || []).push({
2093
2093
  pluginDescriptor: s,
2094
2094
  setupFn: t,
@@ -2096,7 +2096,7 @@ function _t(e, t) {
2096
2096
  }), o && t(o.proxiedTarget);
2097
2097
  }
2098
2098
  }
2099
- const Be = {
2099
+ const ze = {
2100
2100
  À: "A",
2101
2101
  Á: "A",
2102
2102
  Â: "A",
@@ -2496,9 +2496,9 @@ const Be = {
2496
2496
  x̧: "x",
2497
2497
  Z̧: "Z",
2498
2498
  z̧: "z"
2499
- }, kt = Object.keys(Be).join("|"), xt = new RegExp(kt, "g");
2500
- function jt(e) {
2501
- return e.replace(xt, (t) => Be[t]);
2499
+ }, jt = Object.keys(ze).join("|"), Nt = new RegExp(jt, "g");
2500
+ function Ht(e) {
2501
+ return e.replace(Nt, (t) => ze[t]);
2502
2502
  }
2503
2503
  const S = {
2504
2504
  CASE_SENSITIVE_EQUAL: 7,
@@ -2510,10 +2510,10 @@ const S = {
2510
2510
  MATCHES: 1,
2511
2511
  NO_MATCH: 0
2512
2512
  };
2513
- function Nt(e, t, s) {
2513
+ function Lt(e, t, s) {
2514
2514
  var r;
2515
2515
  if (s = s || {}, s.threshold = (r = s.threshold) != null ? r : S.MATCHES, !s.accessors) {
2516
- const o = Oe(e, t, s);
2516
+ const o = Ce(e, t, s);
2517
2517
  return {
2518
2518
  // ends up being duplicate of 'item' in matches but consistent
2519
2519
  rankedValue: e,
@@ -2523,7 +2523,7 @@ function Nt(e, t, s) {
2523
2523
  passed: o >= s.threshold
2524
2524
  };
2525
2525
  }
2526
- const i = Kt(e, s.accessors), n = {
2526
+ const i = Wt(e, s.accessors), n = {
2527
2527
  rankedValue: e,
2528
2528
  rank: S.NO_MATCH,
2529
2529
  accessorIndex: -1,
@@ -2532,7 +2532,7 @@ function Nt(e, t, s) {
2532
2532
  };
2533
2533
  for (let o = 0; o < i.length; o++) {
2534
2534
  const a = i[o];
2535
- let u = Oe(a.itemValue, t, s);
2535
+ let u = Ce(a.itemValue, t, s);
2536
2536
  const {
2537
2537
  minRanking: y,
2538
2538
  maxRanking: c,
@@ -2542,10 +2542,10 @@ function Nt(e, t, s) {
2542
2542
  }
2543
2543
  return n;
2544
2544
  }
2545
- function Oe(e, t, s) {
2546
- return e = Se(e, s), t = Se(t, s), t.length > e.length ? S.NO_MATCH : e === t ? S.CASE_SENSITIVE_EQUAL : (e = e.toLowerCase(), t = t.toLowerCase(), e === t ? S.EQUAL : e.startsWith(t) ? S.STARTS_WITH : e.includes(` ${t}`) ? S.WORD_STARTS_WITH : e.includes(t) ? S.CONTAINS : t.length === 1 ? S.NO_MATCH : Ht(e).includes(t) ? S.ACRONYM : Lt(e, t));
2545
+ function Ce(e, t, s) {
2546
+ return e = we(e, s), t = we(t, s), t.length > e.length ? S.NO_MATCH : e === t ? S.CASE_SENSITIVE_EQUAL : (e = e.toLowerCase(), t = t.toLowerCase(), e === t ? S.EQUAL : e.startsWith(t) ? S.STARTS_WITH : e.includes(` ${t}`) ? S.WORD_STARTS_WITH : e.includes(t) ? S.CONTAINS : t.length === 1 ? S.NO_MATCH : Vt(e).includes(t) ? S.ACRONYM : Kt(e, t));
2547
2547
  }
2548
- function Ht(e) {
2548
+ function Vt(e) {
2549
2549
  let t = "";
2550
2550
  return e.split(" ").forEach((r) => {
2551
2551
  r.split("-").forEach((n) => {
@@ -2553,7 +2553,7 @@ function Ht(e) {
2553
2553
  });
2554
2554
  }), t;
2555
2555
  }
2556
- function Lt(e, t) {
2556
+ function Kt(e, t) {
2557
2557
  let s = 0, r = 0;
2558
2558
  function i(u, y, c) {
2559
2559
  for (let l = c, f = y.length; l < f; l++)
@@ -2577,22 +2577,22 @@ function Lt(e, t) {
2577
2577
  const a = r - o;
2578
2578
  return n(a);
2579
2579
  }
2580
- function Se(e, t) {
2580
+ function we(e, t) {
2581
2581
  let {
2582
2582
  keepDiacritics: s
2583
2583
  } = t;
2584
- return e = `${e}`, s || (e = jt(e)), e;
2584
+ return e = `${e}`, s || (e = Ht(e)), e;
2585
2585
  }
2586
- function Vt(e, t) {
2586
+ function Gt(e, t) {
2587
2587
  let s = t;
2588
2588
  typeof t == "object" && (s = t.accessor);
2589
2589
  const r = s(e);
2590
2590
  return r == null ? [] : Array.isArray(r) ? r : [String(r)];
2591
2591
  }
2592
- function Kt(e, t) {
2592
+ function Wt(e, t) {
2593
2593
  const s = [];
2594
2594
  for (let r = 0, i = t.length; r < i; r++) {
2595
- const n = t[r], o = Gt(n), a = Vt(e, n);
2595
+ const n = t[r], o = Bt(n), a = Gt(e, n);
2596
2596
  for (let u = 0, y = a.length; u < y; u++)
2597
2597
  s.push({
2598
2598
  itemValue: a[u],
@@ -2601,40 +2601,40 @@ function Kt(e, t) {
2601
2601
  }
2602
2602
  return s;
2603
2603
  }
2604
- const Ce = {
2604
+ const Ee = {
2605
2605
  maxRanking: 1 / 0,
2606
2606
  minRanking: -1 / 0
2607
2607
  };
2608
- function Gt(e) {
2609
- return typeof e == "function" ? Ce : {
2610
- ...Ce,
2608
+ function Bt(e) {
2609
+ return typeof e == "function" ? Ee : {
2610
+ ...Ee,
2611
2611
  ...e
2612
2612
  };
2613
2613
  }
2614
2614
  function F(e) {
2615
2615
  return e.state.fetchStatus === "fetching" ? 0 : e.state.fetchStatus === "paused" ? 4 : e.getObserversCount() ? e.isStale() ? 2 : 1 : 3;
2616
2616
  }
2617
- function we(e) {
2617
+ function Qe(e) {
2618
2618
  const t = F(e);
2619
2619
  return t === 0 ? "fetching" : t === 4 ? "paused" : t === 2 ? "stale" : t === 3 ? "inactive" : "fresh";
2620
2620
  }
2621
- function Wt(e) {
2621
+ function $t(e) {
2622
2622
  return F(e) === 2 ? 0 : 16777215;
2623
2623
  }
2624
- function Bt(e) {
2624
+ function zt(e) {
2625
2625
  const t = F(e);
2626
2626
  return t === 0 ? 27647 : t === 4 ? 9193963 : t === 2 ? 16757248 : t === 3 ? 4148832 : 33575;
2627
2627
  }
2628
- var $t = (e, t) => e.queryHash.localeCompare(t.queryHash), $e = (e, t) => e.state.dataUpdatedAt < t.state.dataUpdatedAt ? 1 : -1, zt = (e, t) => F(e) === F(t) ? $e(e, t) : F(e) > F(t) ? 1 : -1, B = {
2629
- "Status > Last Updated": zt,
2630
- "Query Hash": $t,
2631
- "Last Updated": $e
2632
- }, P = "vue-query", $ = "Vue Query";
2633
- function Yt(e, t) {
2634
- _t(
2628
+ var Yt = (e, t) => e.queryHash.localeCompare(t.queryHash), Ye = (e, t) => e.state.dataUpdatedAt < t.state.dataUpdatedAt ? 1 : -1, Jt = (e, t) => F(e) === F(t) ? Ye(e, t) : F(e) > F(t) ? 1 : -1, $ = {
2629
+ "Status > Last Updated": Jt,
2630
+ "Query Hash": Yt,
2631
+ "Last Updated": Ye
2632
+ }, P = "vue-query", z = "Vue Query";
2633
+ function Xt(e, t) {
2634
+ xt(
2635
2635
  {
2636
2636
  id: P,
2637
- label: $,
2637
+ label: z,
2638
2638
  packageName: "vue-query",
2639
2639
  homepage: "https://tanstack.com/query/latest",
2640
2640
  logo: "https://raw.githubusercontent.com/TanStack/query/main/packages/vue-query/media/vue-query.svg",
@@ -2659,11 +2659,11 @@ function Yt(e, t) {
2659
2659
  sortFn: {
2660
2660
  type: "choice",
2661
2661
  label: "Sort Function",
2662
- options: Object.keys(B).map((s) => ({
2662
+ options: Object.keys($).map((s) => ({
2663
2663
  label: s,
2664
2664
  value: s
2665
2665
  })),
2666
- defaultValue: Object.keys(B)[0]
2666
+ defaultValue: Object.keys($)[0]
2667
2667
  },
2668
2668
  onlineMode: {
2669
2669
  type: "choice",
@@ -2685,11 +2685,11 @@ function Yt(e, t) {
2685
2685
  },
2686
2686
  (s) => {
2687
2687
  const r = s.getSettings();
2688
- x.setOnline(!!r.onlineMode.valueOf());
2688
+ k.setOnline(!!r.onlineMode.valueOf());
2689
2689
  const i = t.getQueryCache();
2690
2690
  s.addInspector({
2691
2691
  id: P,
2692
- label: $,
2692
+ label: z,
2693
2693
  icon: "api",
2694
2694
  nodeActions: [
2695
2695
  {
@@ -2746,7 +2746,7 @@ function Yt(e, t) {
2746
2746
  ]
2747
2747
  }), s.addTimelineLayer({
2748
2748
  id: P,
2749
- label: $,
2749
+ label: z,
2750
2750
  color: 16767308
2751
2751
  }), i.subscribe((n) => {
2752
2752
  s.sendInspectorTree(P), s.sendInspectorState(P), [
@@ -2766,23 +2766,23 @@ function Yt(e, t) {
2766
2766
  }
2767
2767
  });
2768
2768
  }), s.on.setPluginSettings((n) => {
2769
- n.key === "onlineMode" && x.setOnline(!!n.newValue);
2769
+ n.key === "onlineMode" && k.setOnline(!!n.newValue);
2770
2770
  }), s.on.getInspectorTree((n) => {
2771
2771
  if (n.inspectorId === P) {
2772
2772
  const o = i.getAll(), a = s.getSettings(), c = (n.filter ? o.filter(
2773
- (l) => Nt(l.queryHash, n.filter).passed
2773
+ (l) => Lt(l.queryHash, n.filter).passed
2774
2774
  ) : [...o]).sort(
2775
- (l, f) => B[a.sortFn](l, f) * a.baseSort
2775
+ (l, f) => $[a.sortFn](l, f) * a.baseSort
2776
2776
  ).map((l) => {
2777
- const f = we(l);
2777
+ const f = Qe(l);
2778
2778
  return {
2779
2779
  id: l.queryHash,
2780
2780
  label: l.queryHash,
2781
2781
  tags: [
2782
2782
  {
2783
2783
  label: `${f} [${l.getObserversCount()}]`,
2784
- textColor: Wt(l),
2785
- backgroundColor: Bt(l)
2784
+ textColor: $t(l),
2785
+ backgroundColor: zt(l)
2786
2786
  }
2787
2787
  ]
2788
2788
  };
@@ -2802,7 +2802,7 @@ function Yt(e, t) {
2802
2802
  },
2803
2803
  {
2804
2804
  key: "Query status",
2805
- value: we(o)
2805
+ value: Qe(o)
2806
2806
  },
2807
2807
  {
2808
2808
  key: "Observers",
@@ -2831,15 +2831,15 @@ function Yt(e, t) {
2831
2831
  }
2832
2832
  );
2833
2833
  }
2834
- var is = {
2834
+ var os = {
2835
2835
  install: (e, t = {}) => {
2836
- const s = Le(t.queryClientKey);
2836
+ const s = Ke(t.queryClientKey);
2837
2837
  let r;
2838
2838
  if ("queryClient" in t && t.queryClient)
2839
2839
  r = t.queryClient;
2840
2840
  else {
2841
2841
  const o = "queryClientConfig" in t ? t.queryClientConfig : void 0;
2842
- r = new Ge(o);
2842
+ r = new Be(o);
2843
2843
  }
2844
2844
  M || r.mount();
2845
2845
  let i = () => {
@@ -2862,36 +2862,36 @@ var is = {
2862
2862
  n(), o();
2863
2863
  };
2864
2864
  }
2865
- e.provide(s, r), process.env.NODE_ENV === "development" && t.enableDevtoolsV6Plugin && Yt(e, r);
2865
+ e.provide(s, r), process.env.NODE_ENV === "development" && t.enableDevtoolsV6Plugin && Xt(e, r);
2866
2866
  }
2867
2867
  };
2868
- function Jt(e, t, s) {
2869
- process.env.NODE_ENV === "development" && (Qe() || console.warn(
2868
+ function Zt(e, t, s) {
2869
+ process.env.NODE_ENV === "development" && (Pe() || console.warn(
2870
2870
  'vue-query composable like "useQuery()" should only be used inside a "setup()" function or a running effect scope. They might otherwise lead to memory leaks.'
2871
2871
  ));
2872
- const r = s || Ve(), i = Ae(() => {
2872
+ const r = s || Ge(), i = Re(() => {
2873
2873
  let d = t;
2874
2874
  typeof d == "function" && (d = d());
2875
2875
  const g = h(d);
2876
2876
  typeof g.enabled == "function" && (g.enabled = g.enabled());
2877
2877
  const p = r.defaultQueryOptions(g);
2878
2878
  return p._optimisticResults = r.isRestoring?.value ? "isRestoring" : "optimistic", p;
2879
- }), n = new e(r, i.value), o = i.value.shallow ? Pe(n.getCurrentResult()) : Re(n.getCurrentResult());
2879
+ }), n = new e(r, i.value), o = i.value.shallow ? Ie(n.getCurrentResult()) : De(n.getCurrentResult());
2880
2880
  let a = () => {
2881
2881
  };
2882
- r.isRestoring && k(
2882
+ r.isRestoring && _(
2883
2883
  r.isRestoring,
2884
2884
  (d) => {
2885
2885
  d || (a(), a = n.subscribe((g) => {
2886
- re(o, g);
2886
+ ie(o, g);
2887
2887
  }));
2888
2888
  },
2889
2889
  { immediate: !0 }
2890
2890
  );
2891
2891
  const u = () => {
2892
- n.setOptions(i.value), re(o, n.getCurrentResult());
2892
+ n.setOptions(i.value), ie(o, n.getCurrentResult());
2893
2893
  };
2894
- k(i, u), Ie(() => {
2894
+ _(i, u), Te(() => {
2895
2895
  a();
2896
2896
  });
2897
2897
  const y = (...d) => (u(), o.refetch(...d)), c = () => new Promise(
@@ -2905,57 +2905,57 @@ function Jt(e, t, s) {
2905
2905
  i.value
2906
2906
  );
2907
2907
  v.isStale ? (p(), n.fetchOptimistic(i.value).then(d, (O) => {
2908
- Z(i.value.throwOnError, [
2908
+ ee(i.value.throwOnError, [
2909
2909
  O,
2910
2910
  n.getCurrentQuery()
2911
2911
  ]) ? g(O) : d(n.getCurrentResult());
2912
2912
  })) : (p(), d(v));
2913
2913
  }
2914
2914
  };
2915
- m(), p = k(i, m);
2915
+ m(), p = _(i, m);
2916
2916
  }
2917
2917
  );
2918
- k(
2918
+ _(
2919
2919
  () => o.error,
2920
2920
  (d) => {
2921
- if (o.isError && !o.isFetching && Z(i.value.throwOnError, [
2921
+ if (o.isError && !o.isFetching && ee(i.value.throwOnError, [
2922
2922
  d,
2923
2923
  n.getCurrentQuery()
2924
2924
  ]))
2925
2925
  throw d;
2926
2926
  }
2927
2927
  );
2928
- const l = i.value.shallow ? Te(o) : De(o), f = Fe(l);
2928
+ const l = i.value.shallow ? Fe(o) : Me(o), f = Ue(l);
2929
2929
  for (const d in o)
2930
2930
  typeof o[d] == "function" && (f[d] = o[d]);
2931
2931
  return f.suspense = c, f.refetch = y, f;
2932
2932
  }
2933
- function ns(e, t) {
2934
- return Jt(mt, e, t);
2933
+ function as(e, t) {
2934
+ return Zt(bt, e, t);
2935
2935
  }
2936
- function os(e, t) {
2937
- process.env.NODE_ENV === "development" && (Qe() || console.warn(
2936
+ function us(e, t) {
2937
+ process.env.NODE_ENV === "development" && (Pe() || console.warn(
2938
2938
  'vue-query composable like "useQuery()" should only be used inside a "setup()" function or a running effect scope. They might otherwise lead to memory leaks.'
2939
2939
  ));
2940
- const s = t || Ve(), r = Ae(() => {
2940
+ const s = t || Ge(), r = Re(() => {
2941
2941
  const c = typeof e == "function" ? e() : e;
2942
2942
  return s.defaultMutationOptions(h(c));
2943
- }), i = new Ct(s, r.value), n = r.value.shallow ? Pe(i.getCurrentResult()) : Re(i.getCurrentResult()), o = i.subscribe((c) => {
2944
- re(n, c);
2943
+ }), i = new Et(s, r.value), n = r.value.shallow ? Ie(i.getCurrentResult()) : De(i.getCurrentResult()), o = i.subscribe((c) => {
2944
+ ie(n, c);
2945
2945
  }), a = (c, l) => {
2946
2946
  i.mutate(c, l).catch(() => {
2947
2947
  });
2948
2948
  };
2949
- k(r, () => {
2949
+ _(r, () => {
2950
2950
  i.setOptions(r.value);
2951
- }), Ie(() => {
2951
+ }), Te(() => {
2952
2952
  o();
2953
2953
  });
2954
- const u = r.value.shallow ? Te(n) : De(n), y = Fe(u);
2955
- return k(
2954
+ const u = r.value.shallow ? Fe(n) : Me(n), y = Ue(u);
2955
+ return _(
2956
2956
  () => n.error,
2957
2957
  (c) => {
2958
- if (c && Z(r.value.throwOnError, [c]))
2958
+ if (c && ee(r.value.throwOnError, [c]))
2959
2959
  throw c;
2960
2960
  }
2961
2961
  ), {
@@ -2965,21 +2965,21 @@ function os(e, t) {
2965
2965
  reset: n.reset
2966
2966
  };
2967
2967
  }
2968
- const as = new Ge();
2969
- function us(e, t, s) {
2968
+ const cs = new Be();
2969
+ function hs(e, t, s) {
2970
2970
  return {
2971
2971
  queryClientConfig: {
2972
- queryCache: new Ke({
2972
+ queryCache: new We({
2973
2973
  onError: (r) => {
2974
2974
  const i = r.code === "ERR_NETWORK", n = [403, 401].includes(r.response?.status);
2975
- i ? e.error("Ошибка подключения к сети") : n ? et(t, tt, s) : e.error(ce(r));
2975
+ i ? e.error("Ошибка подключения к сети") : n ? st(t, rt, s) : e.error(le(r));
2976
2976
  }
2977
2977
  }),
2978
2978
  defaultOptions: {
2979
2979
  queries: { refetchOnMount: !1, refetchOnWindowFocus: !1, retry: !1 },
2980
2980
  mutations: {
2981
2981
  onError: (r) => {
2982
- e.error(ce(r));
2982
+ e.error(le(r));
2983
2983
  }
2984
2984
  }
2985
2985
  }
@@ -2987,10 +2987,10 @@ function us(e, t, s) {
2987
2987
  };
2988
2988
  }
2989
2989
  export {
2990
- is as VueQueryPlugin,
2991
- as as queryClient,
2992
- os as useMutation,
2993
- ns as useQuery,
2994
- Ve as useQueryClient,
2995
- us as vueQueryOptions
2990
+ os as VueQueryPlugin,
2991
+ cs as queryClient,
2992
+ us as useMutation,
2993
+ as as useQuery,
2994
+ Ge as useQueryClient,
2995
+ hs as vueQueryOptions
2996
2996
  };