@ahoo-wang/fetcher-react 3.5.6 → 3.6.0

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.
Files changed (82) hide show
  1. package/README.md +869 -483
  2. package/README.zh-CN.md +2139 -605
  3. package/dist/core/debounced/index.d.ts +4 -0
  4. package/dist/core/debounced/index.d.ts.map +1 -0
  5. package/dist/core/debounced/useDebouncedCallback.d.ts.map +1 -0
  6. package/dist/core/{useDebouncedExecutePromise.d.ts → debounced/useDebouncedExecutePromise.d.ts} +1 -1
  7. package/dist/core/debounced/useDebouncedExecutePromise.d.ts.map +1 -0
  8. package/dist/{wow/debounce → core/debounced}/useDebouncedQuery.d.ts +1 -2
  9. package/dist/core/debounced/useDebouncedQuery.d.ts.map +1 -0
  10. package/dist/core/index.d.ts +3 -2
  11. package/dist/core/index.d.ts.map +1 -1
  12. package/dist/{wow → core}/useQuery.d.ts +2 -2
  13. package/dist/core/useQuery.d.ts.map +1 -0
  14. package/dist/{wow → core}/useQueryState.d.ts +1 -1
  15. package/dist/core/useQueryState.d.ts.map +1 -0
  16. package/dist/cosec/RouteGuard.d.ts +49 -0
  17. package/dist/cosec/RouteGuard.d.ts.map +1 -0
  18. package/dist/cosec/SecurityContext.d.ts +47 -14
  19. package/dist/cosec/SecurityContext.d.ts.map +1 -1
  20. package/dist/cosec/index.d.ts +1 -0
  21. package/dist/cosec/index.d.ts.map +1 -1
  22. package/dist/cosec/useSecurity.d.ts +60 -8
  23. package/dist/cosec/useSecurity.d.ts.map +1 -1
  24. package/dist/fetcher/debounced/index.d.ts +3 -0
  25. package/dist/fetcher/debounced/index.d.ts.map +1 -0
  26. package/dist/fetcher/{useDebouncedFetcher.d.ts → debounced/useDebouncedFetcher.d.ts} +2 -2
  27. package/dist/fetcher/debounced/useDebouncedFetcher.d.ts.map +1 -0
  28. package/dist/{wow/debounce → fetcher/debounced}/useDebouncedFetcherQuery.d.ts +1 -1
  29. package/dist/fetcher/debounced/useDebouncedFetcherQuery.d.ts.map +1 -0
  30. package/dist/fetcher/index.d.ts +2 -1
  31. package/dist/fetcher/index.d.ts.map +1 -1
  32. package/dist/{wow → fetcher}/useFetcherQuery.d.ts +3 -3
  33. package/dist/fetcher/useFetcherQuery.d.ts.map +1 -0
  34. package/dist/index.es.js +567 -538
  35. package/dist/index.es.js.map +1 -1
  36. package/dist/index.umd.js +1 -1
  37. package/dist/index.umd.js.map +1 -1
  38. package/dist/types.d.ts +6 -0
  39. package/dist/types.d.ts.map +1 -1
  40. package/dist/wow/fetcher/index.d.ts +6 -0
  41. package/dist/wow/fetcher/index.d.ts.map +1 -0
  42. package/dist/wow/{useFetcherCountQuery.d.ts → fetcher/useFetcherCountQuery.d.ts} +2 -2
  43. package/dist/wow/fetcher/useFetcherCountQuery.d.ts.map +1 -0
  44. package/dist/wow/{useFetcherListQuery.d.ts → fetcher/useFetcherListQuery.d.ts} +2 -2
  45. package/dist/wow/fetcher/useFetcherListQuery.d.ts.map +1 -0
  46. package/dist/wow/{useFetcherListStreamQuery.d.ts → fetcher/useFetcherListStreamQuery.d.ts} +2 -2
  47. package/dist/wow/fetcher/useFetcherListStreamQuery.d.ts.map +1 -0
  48. package/dist/wow/{useFetcherPagedQuery.d.ts → fetcher/useFetcherPagedQuery.d.ts} +2 -2
  49. package/dist/wow/fetcher/useFetcherPagedQuery.d.ts.map +1 -0
  50. package/dist/wow/{useFetcherSingleQuery.d.ts → fetcher/useFetcherSingleQuery.d.ts} +2 -2
  51. package/dist/wow/fetcher/useFetcherSingleQuery.d.ts.map +1 -0
  52. package/dist/wow/index.d.ts +1 -10
  53. package/dist/wow/index.d.ts.map +1 -1
  54. package/dist/wow/useCountQuery.d.ts +1 -1
  55. package/dist/wow/useCountQuery.d.ts.map +1 -1
  56. package/dist/wow/useListQuery.d.ts +1 -1
  57. package/dist/wow/useListQuery.d.ts.map +1 -1
  58. package/dist/wow/useListStreamQuery.d.ts +1 -1
  59. package/dist/wow/useListStreamQuery.d.ts.map +1 -1
  60. package/dist/wow/usePagedQuery.d.ts +1 -1
  61. package/dist/wow/usePagedQuery.d.ts.map +1 -1
  62. package/dist/wow/useSingleQuery.d.ts +1 -1
  63. package/dist/wow/useSingleQuery.d.ts.map +1 -1
  64. package/package.json +1 -1
  65. package/dist/core/useDebouncedCallback.d.ts.map +0 -1
  66. package/dist/core/useDebouncedExecutePromise.d.ts.map +0 -1
  67. package/dist/fetcher/useDebouncedFetcher.d.ts.map +0 -1
  68. package/dist/wow/debounce/index.d.ts +0 -3
  69. package/dist/wow/debounce/index.d.ts.map +0 -1
  70. package/dist/wow/debounce/useDebouncedFetcherQuery.d.ts.map +0 -1
  71. package/dist/wow/debounce/useDebouncedQuery.d.ts.map +0 -1
  72. package/dist/wow/types.d.ts +0 -7
  73. package/dist/wow/types.d.ts.map +0 -1
  74. package/dist/wow/useFetcherCountQuery.d.ts.map +0 -1
  75. package/dist/wow/useFetcherListQuery.d.ts.map +0 -1
  76. package/dist/wow/useFetcherListStreamQuery.d.ts.map +0 -1
  77. package/dist/wow/useFetcherPagedQuery.d.ts.map +0 -1
  78. package/dist/wow/useFetcherQuery.d.ts.map +0 -1
  79. package/dist/wow/useFetcherSingleQuery.d.ts.map +0 -1
  80. package/dist/wow/useQuery.d.ts.map +0 -1
  81. package/dist/wow/useQueryState.d.ts.map +0 -1
  82. /package/dist/core/{useDebouncedCallback.d.ts → debounced/useDebouncedCallback.d.ts} +0 -0
package/dist/index.es.js CHANGED
@@ -1,542 +1,660 @@
1
- var Y = Object.defineProperty;
2
- var l = (r, e) => Y(r, "name", { value: e, configurable: !0 });
3
- import { useRef as I, useEffect as O, useState as D, useCallback as _, useMemo as M, useReducer as B, useSyncExternalStore as H, createContext as X, useContext as Z } from "react";
1
+ var B = Object.defineProperty;
2
+ var l = (r, e) => B(r, "name", { value: e, configurable: !0 });
4
3
  import { c as w } from "react/compiler-runtime";
5
- import { jsx as ee } from "react/jsx-runtime";
6
- import { nameGenerator as te } from "@ahoo-wang/fetcher-eventbus";
7
- import { produce as re } from "immer";
8
- import { fetcherRegistrar as ne, getFetcher as ce, JsonResultExtractor as se } from "@ahoo-wang/fetcher";
9
- import { JsonEventStreamResultExtractor as oe } from "@ahoo-wang/fetcher-eventstream";
10
- function j() {
4
+ import { useRef as I, useEffect as $, useState as D, useCallback as _, useMemo as M, useReducer as H, useSyncExternalStore as X, createContext as Z, useContext as ee } from "react";
5
+ import { jsx as N, Fragment as te } from "react/jsx-runtime";
6
+ import { nameGenerator as re } from "@ahoo-wang/fetcher-eventbus";
7
+ import { produce as ne } from "immer";
8
+ import { fetcherRegistrar as ce, getFetcher as se, JsonResultExtractor as oe } from "@ahoo-wang/fetcher";
9
+ import { JsonEventStreamResultExtractor as ue } from "@ahoo-wang/fetcher-eventstream";
10
+ function L(r) {
11
+ const e = I(r);
12
+ return e.current = r, e;
13
+ }
14
+ l(L, "useLatest");
15
+ function T(r, e) {
16
+ const t = w(19);
17
+ if (e.leading === !1 && e.trailing === !1)
18
+ throw new Error("useDebouncedCallback: at least one of leading or trailing must be true");
19
+ const n = I(void 0), o = I(null), c = I(null), s = L(r), u = L(e);
20
+ let i;
21
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ l(() => {
22
+ n.current !== void 0 && (clearTimeout(n.current), n.current = void 0);
23
+ }, "t0"), t[0] = i) : i = t[0];
24
+ const m = i;
25
+ let a;
26
+ t[1] !== u ? (a = /* @__PURE__ */ l((F) => c.current ? F - c.current >= u.current.delay : !0, "t1"), t[1] = u, t[2] = a) : a = t[2];
27
+ const f = a;
28
+ let d;
29
+ t[3] !== s ? (d = /* @__PURE__ */ l((F, C) => {
30
+ c.current = F, s.current(...C);
31
+ }, "t2"), t[3] = s, t[4] = d) : d = t[4];
32
+ const b = d;
33
+ let y;
34
+ t[5] !== b || t[6] !== u ? (y = /* @__PURE__ */ l(() => {
35
+ n.current = setTimeout(() => {
36
+ if (o.current) {
37
+ const F = Date.now();
38
+ b(F, o.current);
39
+ }
40
+ n.current = void 0;
41
+ }, u.current.delay);
42
+ }, "t3"), t[5] = b, t[6] = u, t[7] = y) : y = t[7];
43
+ const h = y;
44
+ let g;
45
+ t[8] !== b || t[9] !== u || t[10] !== h || t[11] !== f ? (g = /* @__PURE__ */ l((...F) => {
46
+ const C = F;
47
+ m();
48
+ const {
49
+ leading: q,
50
+ trailing: k
51
+ } = u.current, z = q === void 0 ? !1 : q, G = k === void 0 ? !0 : k;
52
+ if (o.current = C, G && !z) {
53
+ h();
54
+ return;
55
+ }
56
+ const K = Date.now();
57
+ if (z && f(K)) {
58
+ b(K, C);
59
+ return;
60
+ }
61
+ G && h();
62
+ }, "t4"), t[8] = b, t[9] = u, t[10] = h, t[11] = f, t[12] = g) : g = t[12];
63
+ const x = g;
64
+ let S;
65
+ t[13] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ l(() => {
66
+ m(), o.current = null;
67
+ }, "t5"), t[13] = S) : S = t[13];
68
+ const E = S;
69
+ let Q;
70
+ t[14] === Symbol.for("react.memo_cache_sentinel") ? (Q = /* @__PURE__ */ l(() => n.current !== void 0, "t6"), t[14] = Q) : Q = t[14];
71
+ const v = Q;
72
+ let R, O;
73
+ t[15] === Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ l(() => () => {
74
+ E();
75
+ }, "t7"), O = [E], t[15] = R, t[16] = O) : (R = t[15], O = t[16]), $(R, O);
76
+ let p;
77
+ return t[17] !== x ? (p = {
78
+ run: x,
79
+ cancel: E,
80
+ isPending: v
81
+ }, t[17] = x, t[18] = p) : p = t[18], p;
82
+ }
83
+ l(T, "useDebouncedCallback");
84
+ function V() {
11
85
  const r = w(3), e = I(!1);
12
86
  let t;
13
87
  r[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ l(() => e.current, "t0"), r[0] = t) : t = r[0];
14
88
  const n = t;
15
- let s, c;
16
- return r[1] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ l(() => (e.current = !0, () => {
89
+ let o, c;
90
+ return r[1] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ l(() => (e.current = !0, () => {
17
91
  e.current = !1;
18
- }), "t1"), c = [], r[1] = s, r[2] = c) : (s = r[1], c = r[2]), O(s, c), n;
92
+ }), "t1"), c = [], r[1] = o, r[2] = c) : (o = r[1], c = r[2]), $(o, c), n;
19
93
  }
20
- l(j, "useMounted");
21
- function p(r) {
22
- const e = I(r);
23
- return e.current = r, e;
24
- }
25
- l(p, "useLatest");
26
- var ue = /* @__PURE__ */ ((r) => (r.IDLE = "idle", r.LOADING = "loading", r.SUCCESS = "success", r.ERROR = "error", r))(ue || {});
27
- function le(r) {
94
+ l(V, "useMounted");
95
+ var le = /* @__PURE__ */ ((r) => (r.IDLE = "idle", r.LOADING = "loading", r.SUCCESS = "success", r.ERROR = "error", r))(le || {});
96
+ function ie(r) {
28
97
  const [e, t] = D(
29
98
  r?.initialStatus ?? "idle"
30
99
  /* IDLE */
31
- ), [n, s] = D(void 0), [c, i] = D(void 0), o = j(), u = p(r), d = _(() => {
32
- o() && (t(
100
+ ), [n, o] = D(void 0), [c, s] = D(void 0), u = V(), i = L(r), m = _(() => {
101
+ u() && (t(
33
102
  "loading"
34
103
  /* LOADING */
35
- ), i(void 0));
36
- }, [o]), a = _(async (b) => {
37
- if (o()) {
38
- s(b), t(
104
+ ), s(void 0));
105
+ }, [u]), a = _(async (b) => {
106
+ if (u()) {
107
+ o(b), t(
39
108
  "success"
40
109
  /* SUCCESS */
41
- ), i(void 0);
110
+ ), s(void 0);
42
111
  try {
43
- await u.current?.onSuccess?.(b);
112
+ await i.current?.onSuccess?.(b);
44
113
  } catch (y) {
45
114
  console.warn("PromiseState onSuccess callback error:", y);
46
115
  }
47
116
  }
48
- }, [o, u]), f = _(async (b) => {
49
- if (o()) {
50
- i(b), t(
117
+ }, [u, i]), f = _(async (b) => {
118
+ if (u()) {
119
+ s(b), t(
51
120
  "error"
52
121
  /* ERROR */
53
- ), s(void 0);
122
+ ), o(void 0);
54
123
  try {
55
- await u.current?.onError?.(b);
124
+ await i.current?.onError?.(b);
56
125
  } catch (y) {
57
126
  console.warn("PromiseState onError callback error:", y);
58
127
  }
59
128
  }
60
- }, [o, u]), m = _(() => {
61
- o() && (t(
129
+ }, [u, i]), d = _(() => {
130
+ u() && (t(
62
131
  "idle"
63
132
  /* IDLE */
64
- ), i(void 0), s(void 0));
65
- }, [o]);
133
+ ), s(void 0), o(void 0));
134
+ }, [u]);
66
135
  return M(() => ({
67
136
  status: e,
68
137
  loading: e === "loading",
69
138
  result: n,
70
139
  error: c,
71
- setLoading: d,
140
+ setLoading: m,
72
141
  setSuccess: a,
73
142
  setError: f,
74
- setIdle: m
75
- }), [e, n, c, d, a, f, m]);
143
+ setIdle: d
144
+ }), [e, n, c, m, a, f, d]);
76
145
  }
77
- l(le, "usePromiseState");
78
- function ie() {
146
+ l(ie, "usePromiseState");
147
+ function ae() {
79
148
  const r = w(6), e = I(0);
80
149
  let t;
81
150
  r[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ l(() => e.current = e.current + 1, "t0"), r[0] = t) : t = r[0];
82
151
  const n = t;
152
+ let o;
153
+ r[1] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ l(() => e.current, "t1"), r[1] = o) : o = r[1];
154
+ const c = o;
83
155
  let s;
84
- r[1] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ l(() => e.current, "t1"), r[1] = s) : s = r[1];
85
- const c = s;
156
+ r[2] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ l((b) => b === e.current, "t2"), r[2] = s) : s = r[2];
157
+ const u = s;
86
158
  let i;
87
- r[2] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ l((b) => b === e.current, "t2"), r[2] = i) : i = r[2];
88
- const o = i;
89
- let u;
90
- r[3] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ l(() => {
159
+ r[3] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ l(() => {
91
160
  e.current = e.current + 1;
92
- }, "t3"), r[3] = u) : u = r[3];
93
- const d = u;
161
+ }, "t3"), r[3] = i) : i = r[3];
162
+ const m = i;
94
163
  let a;
95
164
  r[4] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ l(() => {
96
165
  e.current = 0;
97
166
  }, "t4"), r[4] = a) : a = r[4];
98
167
  const f = a;
99
- let m;
100
- return r[5] === Symbol.for("react.memo_cache_sentinel") ? (m = {
168
+ let d;
169
+ return r[5] === Symbol.for("react.memo_cache_sentinel") ? (d = {
101
170
  generate: n,
102
171
  current: c,
103
- isLatest: o,
104
- invalidate: d,
172
+ isLatest: u,
173
+ invalidate: m,
105
174
  reset: f
106
- }, r[5] = m) : m = r[5], m;
175
+ }, r[5] = d) : d = r[5], d;
107
176
  }
108
- l(ie, "useRequestId");
109
- function q(r) {
177
+ l(ae, "useRequestId");
178
+ function U(r) {
110
179
  const {
111
180
  loading: e,
112
181
  result: t,
113
182
  error: n,
114
- status: s,
183
+ status: o,
115
184
  setLoading: c,
116
- setSuccess: i,
117
- setError: o,
118
- setIdle: u
119
- } = le(r), d = j(), a = ie(), f = I(void 0), m = r?.propagateError, b = p(r?.onAbort), y = _(async () => {
185
+ setSuccess: s,
186
+ setError: u,
187
+ setIdle: i
188
+ } = ie(r), m = V(), a = ae(), f = I(void 0), d = r?.propagateError, b = L(r?.onAbort), y = _(async () => {
120
189
  try {
121
190
  await b.current?.();
122
- } catch (Q) {
123
- console.warn("useExecutePromise onAbort callback error:", Q);
191
+ } catch (S) {
192
+ console.warn("useExecutePromise onAbort callback error:", S);
124
193
  }
125
- }, [b]), x = _(async (Q) => {
194
+ }, [b]), h = _(async (S) => {
126
195
  f.current && (f.current.abort(), await y());
127
- const g = new AbortController();
128
- f.current = g;
129
- const S = a.generate();
196
+ const E = new AbortController();
197
+ f.current = E;
198
+ const Q = a.generate();
130
199
  c();
131
200
  try {
132
- const v = await Q(g);
133
- d() && a.isLatest(S) && await i(v);
201
+ const v = await S(E);
202
+ m() && a.isLatest(Q) && await s(v);
134
203
  } catch (v) {
135
204
  if (v instanceof Error && v.name === "AbortError") {
136
- d() && u();
205
+ m() && i();
137
206
  return;
138
207
  }
139
- if (d() && a.isLatest(S) && await o(v), m)
208
+ if (m() && a.isLatest(Q) && await u(v), d)
140
209
  throw v;
141
210
  } finally {
142
- f.current === g && (f.current = void 0);
211
+ f.current === E && (f.current = void 0);
143
212
  }
144
- }, [c, i, o, u, d, a, m, y]), E = _(() => {
145
- d() && u();
146
- }, [u, d]), h = _(async () => {
147
- E(), f.current && (f.current.abort(), f.current = void 0, await y());
148
- }, [E, y]);
149
- return O(() => () => {
150
- h();
151
- }, [h]), M(() => ({
213
+ }, [c, s, u, i, m, a, d, y]), g = _(() => {
214
+ m() && i();
215
+ }, [i, m]), x = _(async () => {
216
+ g(), f.current && (f.current.abort(), f.current = void 0, await y());
217
+ }, [g, y]);
218
+ return $(() => () => {
219
+ x();
220
+ }, [x]), M(() => ({
152
221
  loading: e,
153
222
  result: t,
154
223
  error: n,
155
- status: s,
156
- execute: x,
157
- reset: E,
158
- abort: h
159
- }), [e, t, n, s, x, E, h]);
160
- }
161
- l(q, "useExecutePromise");
162
- function Se() {
163
- const r = I(/* @__PURE__ */ new Map()), e = _((f) => r.current.get(f), []), t = _((f, m) => r.current.set(f, m), []), n = _((f) => r.current.has(f), []), s = _((f) => r.current.delete(f), []), c = _(() => r.current.clear(), []), i = _(() => r.current.keys(), []), o = _(() => r.current.values(), []), u = _(() => r.current.entries(), []), d = _(() => r.current[Symbol.iterator](), []), a = _((f) => (m) => {
164
- m ? r.current.set(f, m) : r.current.delete(f);
224
+ status: o,
225
+ execute: h,
226
+ reset: g,
227
+ abort: x
228
+ }), [e, t, n, o, h, g, x]);
229
+ }
230
+ l(U, "useExecutePromise");
231
+ function we(r) {
232
+ const e = w(10), {
233
+ loading: t,
234
+ result: n,
235
+ error: o,
236
+ execute: c,
237
+ reset: s,
238
+ abort: u,
239
+ status: i
240
+ } = U(r), {
241
+ run: m,
242
+ cancel: a,
243
+ isPending: f
244
+ } = T(c, r.debounce);
245
+ let d;
246
+ return e[0] !== u || e[1] !== a || e[2] !== o || e[3] !== f || e[4] !== t || e[5] !== s || e[6] !== n || e[7] !== m || e[8] !== i ? (d = {
247
+ loading: t,
248
+ result: n,
249
+ error: o,
250
+ status: i,
251
+ reset: s,
252
+ abort: u,
253
+ run: m,
254
+ cancel: a,
255
+ isPending: f
256
+ }, e[0] = u, e[1] = a, e[2] = o, e[3] = f, e[4] = t, e[5] = s, e[6] = n, e[7] = m, e[8] = i, e[9] = d) : d = e[9], d;
257
+ }
258
+ l(we, "useDebouncedExecutePromise");
259
+ function Re(r) {
260
+ const e = w(22), t = r.autoExecute;
261
+ let n;
262
+ e[0] !== r ? (n = {
263
+ ...r,
264
+ autoExecute: !1
265
+ }, e[0] = r, e[1] = n) : n = e[1];
266
+ const o = n, {
267
+ loading: c,
268
+ result: s,
269
+ error: u,
270
+ status: i,
271
+ execute: m,
272
+ reset: a,
273
+ abort: f,
274
+ getQuery: d,
275
+ setQuery: b
276
+ } = P(o), {
277
+ run: y,
278
+ cancel: h,
279
+ isPending: g
280
+ } = T(m, r.debounce);
281
+ let x;
282
+ e[2] !== t || e[3] !== y || e[4] !== b ? (x = /* @__PURE__ */ l((R) => {
283
+ b(R), t && y();
284
+ }, "t1"), e[2] = t, e[3] = y, e[4] = b, e[5] = x) : x = e[5];
285
+ const S = x;
286
+ let E, Q;
287
+ e[6] !== t || e[7] !== y ? (E = /* @__PURE__ */ l(() => {
288
+ t && y();
289
+ }, "t2"), Q = [y, t], e[6] = t, e[7] = y, e[8] = E, e[9] = Q) : (E = e[8], Q = e[9]), $(E, Q);
290
+ let v;
291
+ return e[10] !== f || e[11] !== h || e[12] !== u || e[13] !== d || e[14] !== g || e[15] !== c || e[16] !== a || e[17] !== s || e[18] !== y || e[19] !== S || e[20] !== i ? (v = {
292
+ loading: c,
293
+ result: s,
294
+ error: u,
295
+ status: i,
296
+ reset: a,
297
+ abort: f,
298
+ getQuery: d,
299
+ setQuery: S,
300
+ run: y,
301
+ cancel: h,
302
+ isPending: g
303
+ }, e[10] = f, e[11] = h, e[12] = u, e[13] = d, e[14] = g, e[15] = c, e[16] = a, e[17] = s, e[18] = y, e[19] = S, e[20] = i, e[21] = v) : v = e[21], v;
304
+ }
305
+ l(Re, "useDebouncedQuery");
306
+ function Fe() {
307
+ const r = I(/* @__PURE__ */ new Map()), e = _((f) => r.current.get(f), []), t = _((f, d) => r.current.set(f, d), []), n = _((f) => r.current.has(f), []), o = _((f) => r.current.delete(f), []), c = _(() => r.current.clear(), []), s = _(() => r.current.keys(), []), u = _(() => r.current.values(), []), i = _(() => r.current.entries(), []), m = _(() => r.current[Symbol.iterator](), []), a = _((f) => (d) => {
308
+ d ? r.current.set(f, d) : r.current.delete(f);
165
309
  }, []);
166
- return O(() => () => {
310
+ return $(() => () => {
167
311
  r.current.clear();
168
312
  }, []), M(() => ({
169
313
  register: a,
170
314
  get: e,
171
315
  set: t,
172
316
  has: n,
173
- delete: s,
317
+ delete: o,
174
318
  clear: c,
175
- keys: i,
176
- values: o,
177
- entries: u,
319
+ keys: s,
320
+ values: u,
321
+ entries: i,
178
322
  get size() {
179
323
  return r.current.size;
180
324
  },
181
- [Symbol.iterator]: d
182
- }), [a, e, t, n, s, c, i, o, u, d]);
325
+ [Symbol.iterator]: m
326
+ }), [a, e, t, n, o, c, s, u, i, m]);
183
327
  }
184
- l(Se, "useRefs");
185
- function T(r, e) {
186
- const t = w(19);
187
- if (e.leading === !1 && e.trailing === !1)
188
- throw new Error("useDebouncedCallback: at least one of leading or trailing must be true");
189
- const n = I(void 0), s = I(null), c = I(null), i = p(r), o = p(e);
328
+ l(Fe, "useRefs");
329
+ function Ce() {
330
+ const [, r] = H(fe, 0);
331
+ return r;
332
+ }
333
+ l(Ce, "useForceUpdate");
334
+ function fe(r) {
335
+ return r + 1;
336
+ }
337
+ l(fe, "_temp");
338
+ function j(r) {
339
+ const e = w(10), {
340
+ initialQuery: t,
341
+ autoExecute: n,
342
+ execute: o
343
+ } = r, c = n ?? !0, s = I(t);
190
344
  let u;
191
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ l(() => {
192
- n.current !== void 0 && (clearTimeout(n.current), n.current = void 0);
193
- }, "t0"), t[0] = u) : u = t[0];
194
- const d = u;
195
- let a;
196
- t[1] !== o ? (a = /* @__PURE__ */ l((R) => c.current ? R - c.current >= o.current.delay : !0, "t1"), t[1] = o, t[2] = a) : a = t[2];
197
- const f = a;
345
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ l(() => s.current, "t0"), e[0] = u) : u = e[0];
346
+ const i = u;
198
347
  let m;
199
- t[3] !== i ? (m = /* @__PURE__ */ l((R, C) => {
200
- c.current = R, i.current(...C);
201
- }, "t2"), t[3] = i, t[4] = m) : m = t[4];
202
- const b = m;
203
- let y;
204
- t[5] !== b || t[6] !== o ? (y = /* @__PURE__ */ l(() => {
205
- n.current = setTimeout(() => {
206
- if (s.current) {
207
- const R = Date.now();
208
- b(R, s.current);
209
- }
210
- n.current = void 0;
211
- }, o.current.delay);
212
- }, "t3"), t[5] = b, t[6] = o, t[7] = y) : y = t[7];
213
- const x = y;
214
- let E;
215
- t[8] !== b || t[9] !== o || t[10] !== x || t[11] !== f ? (E = /* @__PURE__ */ l((...R) => {
216
- const C = R;
217
- d();
218
- const {
219
- leading: U,
220
- trailing: k
221
- } = o.current, K = U === void 0 ? !1 : U, N = k === void 0 ? !0 : k;
222
- if (s.current = C, N && !K) {
223
- x();
224
- return;
225
- }
226
- const V = Date.now();
227
- if (K && f(V)) {
228
- b(V, C);
229
- return;
230
- }
231
- N && x();
232
- }, "t4"), t[8] = b, t[9] = o, t[10] = x, t[11] = f, t[12] = E) : E = t[12];
233
- const h = E;
234
- let Q;
235
- t[13] === Symbol.for("react.memo_cache_sentinel") ? (Q = /* @__PURE__ */ l(() => {
236
- d(), s.current = null;
237
- }, "t5"), t[13] = Q) : Q = t[13];
238
- const g = Q;
239
- let S;
240
- t[14] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ l(() => n.current !== void 0, "t6"), t[14] = S) : S = t[14];
241
- const v = S;
242
- let F, L;
243
- t[15] === Symbol.for("react.memo_cache_sentinel") ? (F = /* @__PURE__ */ l(() => () => {
244
- g();
245
- }, "t7"), L = [g], t[15] = F, t[16] = L) : (F = t[15], L = t[16]), O(F, L);
246
- let $;
247
- return t[17] !== h ? ($ = {
248
- run: h,
249
- cancel: g,
250
- isPending: v
251
- }, t[17] = h, t[18] = $) : $ = t[18], $;
348
+ e[1] !== c || e[2] !== o ? (m = /* @__PURE__ */ l((y) => {
349
+ s.current = y, c && o(y);
350
+ }, "t1"), e[1] = c, e[2] = o, e[3] = m) : m = e[3];
351
+ const a = m;
352
+ let f, d;
353
+ e[4] !== c || e[5] !== o ? (f = /* @__PURE__ */ l(() => {
354
+ c && o(s.current);
355
+ }, "t2"), d = [c, o], e[4] = c, e[5] = o, e[6] = f, e[7] = d) : (f = e[6], d = e[7]), $(f, d);
356
+ let b;
357
+ return e[8] !== a ? (b = {
358
+ getQuery: i,
359
+ setQuery: a
360
+ }, e[8] = a, e[9] = b) : b = e[9], b;
252
361
  }
253
- l(T, "useDebouncedCallback");
254
- function _e(r) {
255
- const e = w(10), {
362
+ l(j, "useQueryState");
363
+ function P(r) {
364
+ const e = L(r), {
256
365
  loading: t,
257
366
  result: n,
258
- error: s,
259
- execute: c,
260
- reset: i,
261
- abort: o,
262
- status: u
263
- } = q(r), {
264
- run: d,
265
- cancel: a,
266
- isPending: f
267
- } = T(c, r.debounce);
268
- let m;
269
- return e[0] !== o || e[1] !== a || e[2] !== s || e[3] !== f || e[4] !== t || e[5] !== i || e[6] !== n || e[7] !== d || e[8] !== u ? (m = {
367
+ error: o,
368
+ status: c,
369
+ execute: s,
370
+ reset: u,
371
+ abort: i
372
+ } = U(e.current), m = _((b) => s(/* @__PURE__ */ l(async (h) => e.current.execute(b, e.current.attributes, h), "queryExecutor")), [s, e]), {
373
+ getQuery: a,
374
+ setQuery: f
375
+ } = j({
376
+ initialQuery: r.initialQuery,
377
+ autoExecute: e.current.autoExecute,
378
+ execute: m
379
+ }), d = _(() => m(a()), [m, a]);
380
+ return M(() => ({
270
381
  loading: t,
271
382
  result: n,
272
- error: s,
273
- status: u,
274
- reset: i,
275
- abort: o,
276
- run: d,
277
- cancel: a,
278
- isPending: f
279
- }, e[0] = o, e[1] = a, e[2] = s, e[3] = f, e[4] = t, e[5] = i, e[6] = n, e[7] = d, e[8] = u, e[9] = m) : m = e[9], m;
280
- }
281
- l(_e, "useDebouncedExecutePromise");
282
- function we() {
283
- const [, r] = B(ae, 0);
284
- return r;
285
- }
286
- l(we, "useForceUpdate");
287
- function ae(r) {
288
- return r + 1;
383
+ error: o,
384
+ status: c,
385
+ execute: d,
386
+ reset: u,
387
+ abort: i,
388
+ getQuery: a,
389
+ setQuery: f
390
+ }), [t, n, o, c, d, u, i, a, f]);
289
391
  }
290
- l(ae, "_temp");
291
- function z(r, e) {
392
+ l(P, "useQuery");
393
+ function J(r, e) {
292
394
  const t = w(13);
293
395
  let n;
294
396
  t[0] !== r ? (n = /* @__PURE__ */ l((b) => r.addListener({
295
- name: te.generate("useKeyStorage"),
397
+ name: re.generate("useKeyStorage"),
296
398
  handle: b
297
399
  }), "t0"), t[0] = r, t[1] = n) : n = t[1];
298
- const s = n;
400
+ const o = n;
299
401
  let c;
300
402
  t[2] !== e || t[3] !== r ? (c = /* @__PURE__ */ l(() => {
301
403
  const b = r.get();
302
404
  return b !== null ? b : e ?? null;
303
405
  }, "t1"), t[2] = e, t[3] = r, t[4] = c) : c = t[4];
304
- const i = c, o = H(s, i, i);
305
- let u;
306
- t[5] !== r ? (u = /* @__PURE__ */ l((b) => r.set(b), "t2"), t[5] = r, t[6] = u) : u = t[6];
307
- const d = u;
406
+ const s = c, u = X(o, s, s);
407
+ let i;
408
+ t[5] !== r ? (i = /* @__PURE__ */ l((b) => r.set(b), "t2"), t[5] = r, t[6] = i) : i = t[6];
409
+ const m = i;
308
410
  let a;
309
411
  t[7] !== r ? (a = /* @__PURE__ */ l(() => r.remove(), "t3"), t[7] = r, t[8] = a) : a = t[8];
310
412
  const f = a;
311
- let m;
312
- return t[9] !== f || t[10] !== d || t[11] !== o ? (m = [o, d, f], t[9] = f, t[10] = d, t[11] = o, t[12] = m) : m = t[12], m;
413
+ let d;
414
+ return t[9] !== f || t[10] !== m || t[11] !== u ? (d = [u, m, f], t[9] = f, t[10] = m, t[11] = u, t[12] = d) : d = t[12], d;
313
415
  }
314
- l(z, "useKeyStorage");
315
- function Fe(r, e) {
316
- const t = w(8), [n, s, c] = z(r, e);
317
- let i;
318
- t[0] !== c || t[1] !== s || t[2] !== n ? (i = /* @__PURE__ */ l((d) => {
319
- const a = re(n, d);
416
+ l(J, "useKeyStorage");
417
+ function Oe(r, e) {
418
+ const t = w(8), [n, o, c] = J(r, e);
419
+ let s;
420
+ t[0] !== c || t[1] !== o || t[2] !== n ? (s = /* @__PURE__ */ l((m) => {
421
+ const a = ne(n, m);
320
422
  if (a === null) {
321
423
  c();
322
424
  return;
323
425
  }
324
- return s(a);
325
- }, "t0"), t[0] = c, t[1] = s, t[2] = n, t[3] = i) : i = t[3];
326
- const o = i;
327
- let u;
328
- return t[4] !== c || t[5] !== o || t[6] !== n ? (u = [n, o, c], t[4] = c, t[5] = o, t[6] = n, t[7] = u) : u = t[7], u;
426
+ return o(a);
427
+ }, "t0"), t[0] = c, t[1] = o, t[2] = n, t[3] = s) : s = t[3];
428
+ const u = s;
429
+ let i;
430
+ return t[4] !== c || t[5] !== u || t[6] !== n ? (i = [n, u, c], t[4] = c, t[5] = u, t[6] = n, t[7] = i) : i = t[7], i;
329
431
  }
330
- l(Fe, "useImmerKeyStorage");
331
- const fe = {
432
+ l(Oe, "useImmerKeyStorage");
433
+ const de = {
332
434
  jti: "",
333
435
  sub: "anonymous",
334
436
  iat: 0,
335
437
  exp: 0
336
438
  };
337
- function de(r) {
338
- const e = w(7), [t, , n] = z(r);
439
+ function me(r, e) {
440
+ const t = w(13);
441
+ let n;
442
+ t[0] !== e ? (n = e === void 0 ? {} : e, t[0] = e, t[1] = n) : n = t[1];
443
+ const o = n, [c, , s] = J(r), u = L(o);
444
+ let i;
445
+ t[2] !== u || t[3] !== r ? (i = /* @__PURE__ */ l(async (h) => {
446
+ const g = typeof h == "function" ? await h() : h;
447
+ r.signIn(g), u.current.onSignIn?.();
448
+ }, "t2"), t[2] = u, t[3] = r, t[4] = i) : i = t[4];
449
+ const m = i;
450
+ let a;
451
+ t[5] !== u || t[6] !== s ? (a = /* @__PURE__ */ l(() => {
452
+ s(), u.current.onSignOut?.();
453
+ }, "t3"), t[5] = u, t[6] = s, t[7] = a) : a = t[7];
454
+ const f = a, d = c?.access?.payload ?? de, b = c?.authenticated ?? !1;
455
+ let y;
456
+ return t[8] !== m || t[9] !== f || t[10] !== d || t[11] !== b ? (y = {
457
+ currentUser: d,
458
+ authenticated: b,
459
+ signIn: m,
460
+ signOut: f
461
+ }, t[8] = m, t[9] = f, t[10] = d, t[11] = b, t[12] = y) : y = t[12], y;
462
+ }
463
+ l(me, "useSecurity");
464
+ const W = Z(void 0);
465
+ function Ie(r) {
466
+ const e = w(7);
467
+ let t, n, o;
468
+ e[0] !== r ? ({
469
+ tokenStorage: n,
470
+ children: t,
471
+ ...o
472
+ } = r, e[0] = r, e[1] = t, e[2] = n, e[3] = o) : (t = e[1], n = e[2], o = e[3]);
473
+ const c = me(n, o);
339
474
  let s;
340
- e[0] !== r ? (s = /* @__PURE__ */ l((d) => {
341
- r.signIn(d);
342
- }, "t0"), e[0] = r, e[1] = s) : s = e[1];
343
- const c = s, i = t?.access?.payload ?? fe, o = t?.authenticated ?? !1;
344
- let u;
345
- return e[2] !== n || e[3] !== c || e[4] !== i || e[5] !== o ? (u = {
346
- currentUser: i,
347
- authenticated: o,
348
- signIn: c,
349
- signOut: n
350
- }, e[2] = n, e[3] = c, e[4] = i, e[5] = o, e[6] = u) : u = e[6], u;
351
- }
352
- l(de, "useSecurity");
353
- const G = X(void 0);
354
- function Re(r) {
355
- const e = w(3), {
356
- tokenStorage: t,
357
- children: n
358
- } = r, s = de(t);
359
- let c;
360
- return e[0] !== n || e[1] !== s ? (c = /* @__PURE__ */ ee(G.Provider, { value: s, children: n }), e[0] = n, e[1] = s, e[2] = c) : c = e[2], c;
475
+ return e[4] !== t || e[5] !== c ? (s = /* @__PURE__ */ N(W.Provider, { value: c, children: t }), e[4] = t, e[5] = c, e[6] = s) : s = e[6], s;
361
476
  }
362
- l(Re, "SecurityProvider");
363
- function Ce() {
364
- const r = Z(G);
477
+ l(Ie, "SecurityProvider");
478
+ function be() {
479
+ const r = ee(W);
365
480
  if (!r)
366
481
  throw new Error("useSecurityContext must be used within a SecurityProvider");
367
482
  return r;
368
483
  }
369
- l(Ce, "useSecurityContext");
370
- function J(r) {
484
+ l(be, "useSecurityContext");
485
+ function Le(r) {
486
+ const e = w(2), {
487
+ children: t,
488
+ fallback: n,
489
+ onUnauthorized: o
490
+ } = r, {
491
+ authenticated: c
492
+ } = be();
493
+ if (c) {
494
+ let s;
495
+ return e[0] !== t ? (s = /* @__PURE__ */ N(te, { children: t }), e[0] = t, e[1] = s) : s = e[1], s;
496
+ }
497
+ return o && o(), n;
498
+ }
499
+ l(Le, "RouteGuard");
500
+ function Y(r) {
371
501
  const e = w(21);
372
502
  let t;
373
503
  e[0] !== r ? (t = r || {}, e[0] = r, e[1] = t) : t = e[1];
374
504
  const {
375
505
  fetcher: n
376
- } = t, s = n === void 0 ? ne.default : n, {
506
+ } = t, o = n === void 0 ? ce.default : n, {
377
507
  loading: c,
378
- result: i,
379
- error: o,
380
- status: u,
381
- execute: d,
508
+ result: s,
509
+ error: u,
510
+ status: i,
511
+ execute: m,
382
512
  reset: a,
383
513
  abort: f
384
- } = q(r), [m, b] = D(void 0), y = p(r);
385
- let x;
386
- e[2] !== s ? (x = ce(s), e[2] = s, e[3] = x) : x = e[3];
387
- const E = x;
514
+ } = U(r), [d, b] = D(void 0), y = L(r);
388
515
  let h;
389
- e[4] !== E || e[5] !== y || e[6] !== d ? (h = /* @__PURE__ */ l(async ($) => {
516
+ e[2] !== o ? (h = se(o), e[2] = o, e[3] = h) : h = e[3];
517
+ const g = h;
518
+ let x;
519
+ e[4] !== g || e[5] !== y || e[6] !== m ? (x = /* @__PURE__ */ l(async (p) => {
390
520
  try {
391
- await d(async (R) => {
392
- $.abortController = R;
393
- const C = await E.exchange($, y.current);
521
+ await m(async (F) => {
522
+ p.abortController = F;
523
+ const C = await g.exchange(p, y.current);
394
524
  return b(C), await C.extractResult();
395
525
  });
396
- } catch (R) {
397
- const C = R;
526
+ } catch (F) {
527
+ const C = F;
398
528
  throw b(void 0), C;
399
529
  }
400
- }, "t3"), e[4] = E, e[5] = y, e[6] = d, e[7] = h) : h = e[7];
401
- const Q = h;
402
- let g;
403
- e[8] !== a ? (g = /* @__PURE__ */ l(() => {
530
+ }, "t3"), e[4] = g, e[5] = y, e[6] = m, e[7] = x) : x = e[7];
531
+ const S = x;
532
+ let E;
533
+ e[8] !== a ? (E = /* @__PURE__ */ l(() => {
404
534
  a(), b(void 0);
405
- }, "t4"), e[8] = a, e[9] = g) : g = e[9];
406
- const S = g;
535
+ }, "t4"), e[8] = a, e[9] = E) : E = e[9];
536
+ const Q = E;
407
537
  let v;
408
538
  e[10] !== f ? (v = /* @__PURE__ */ l(() => {
409
539
  f(), b(void 0);
410
540
  }, "t5"), e[10] = f, e[11] = v) : v = e[11];
411
- const F = v;
412
- let L;
413
- return e[12] !== F || e[13] !== o || e[14] !== m || e[15] !== Q || e[16] !== c || e[17] !== S || e[18] !== i || e[19] !== u ? (L = {
541
+ const R = v;
542
+ let O;
543
+ return e[12] !== R || e[13] !== u || e[14] !== d || e[15] !== S || e[16] !== c || e[17] !== Q || e[18] !== s || e[19] !== i ? (O = {
414
544
  loading: c,
415
- result: i,
416
- error: o,
417
- status: u,
418
- exchange: m,
419
- execute: Q,
420
- reset: S,
421
- abort: F
422
- }, e[12] = F, e[13] = o, e[14] = m, e[15] = Q, e[16] = c, e[17] = S, e[18] = i, e[19] = u, e[20] = L) : L = e[20], L;
423
- }
424
- l(J, "useFetcher");
425
- function Le(r) {
545
+ result: s,
546
+ error: u,
547
+ status: i,
548
+ exchange: d,
549
+ execute: S,
550
+ reset: Q,
551
+ abort: R
552
+ }, e[12] = R, e[13] = u, e[14] = d, e[15] = S, e[16] = c, e[17] = Q, e[18] = s, e[19] = i, e[20] = O) : O = e[20], O;
553
+ }
554
+ l(Y, "useFetcher");
555
+ function $e(r) {
426
556
  const e = w(11), {
427
557
  loading: t,
428
558
  result: n,
429
- error: s,
559
+ error: o,
430
560
  status: c,
431
- exchange: i,
432
- execute: o,
433
- reset: u,
434
- abort: d
435
- } = J(r), {
561
+ exchange: s,
562
+ execute: u,
563
+ reset: i,
564
+ abort: m
565
+ } = Y(r), {
436
566
  run: a,
437
567
  cancel: f,
438
- isPending: m
439
- } = T(o, r.debounce);
568
+ isPending: d
569
+ } = T(u, r.debounce);
440
570
  let b;
441
- return e[0] !== d || e[1] !== f || e[2] !== s || e[3] !== i || e[4] !== m || e[5] !== t || e[6] !== u || e[7] !== n || e[8] !== a || e[9] !== c ? (b = {
571
+ return e[0] !== m || e[1] !== f || e[2] !== o || e[3] !== s || e[4] !== d || e[5] !== t || e[6] !== i || e[7] !== n || e[8] !== a || e[9] !== c ? (b = {
442
572
  loading: t,
443
573
  result: n,
444
- error: s,
574
+ error: o,
445
575
  status: c,
446
- exchange: i,
447
- reset: u,
448
- abort: d,
576
+ exchange: s,
577
+ reset: i,
578
+ abort: m,
449
579
  run: a,
450
580
  cancel: f,
451
- isPending: m
452
- }, e[0] = d, e[1] = f, e[2] = s, e[3] = i, e[4] = m, e[5] = t, e[6] = u, e[7] = n, e[8] = a, e[9] = c, e[10] = b) : b = e[10], b;
453
- }
454
- l(Le, "useDebouncedFetcher");
455
- function W(r) {
456
- const e = w(10), {
457
- initialQuery: t,
458
- autoExecute: n,
459
- execute: s
460
- } = r, c = n ?? !1, i = I(t);
461
- let o;
462
- e[0] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ l(() => i.current, "t0"), e[0] = o) : o = e[0];
463
- const u = o;
464
- let d;
465
- e[1] !== c || e[2] !== s ? (d = /* @__PURE__ */ l((y) => {
466
- i.current = y, c && s(y);
467
- }, "t1"), e[1] = c, e[2] = s, e[3] = d) : d = e[3];
468
- const a = d;
469
- let f, m;
470
- e[4] !== c || e[5] !== s ? (f = /* @__PURE__ */ l(() => {
471
- c && s(i.current);
472
- }, "t2"), m = [c, s], e[4] = c, e[5] = s, e[6] = f, e[7] = m) : (f = e[6], m = e[7]), O(f, m);
473
- let b;
474
- return e[8] !== a ? (b = {
475
- getQuery: u,
476
- setQuery: a
477
- }, e[8] = a, e[9] = b) : b = e[9], b;
581
+ isPending: d
582
+ }, e[0] = m, e[1] = f, e[2] = o, e[3] = s, e[4] = d, e[5] = t, e[6] = i, e[7] = n, e[8] = a, e[9] = c, e[10] = b) : b = e[10], b;
478
583
  }
479
- l(W, "useQueryState");
480
- function P(r) {
481
- const e = p(r), {
482
- loading: t,
483
- result: n,
484
- error: s,
485
- status: c,
486
- execute: i,
487
- reset: o,
488
- abort: u
489
- } = q(e.current), d = _((b) => i(/* @__PURE__ */ l(async (x) => e.current.execute(b, e.current.attributes, x), "queryExecutor")), [i, e]), {
490
- getQuery: a,
491
- setQuery: f
492
- } = W({
493
- initialQuery: r.initialQuery,
494
- autoExecute: e.current.autoExecute,
495
- execute: d
496
- }), m = _(() => d(a()), [d, a]);
497
- return M(() => ({
498
- loading: t,
499
- result: n,
500
- error: s,
501
- status: c,
584
+ l($e, "useDebouncedFetcher");
585
+ function pe(r) {
586
+ const e = w(22), t = r.autoExecute;
587
+ let n;
588
+ e[0] !== r ? (n = {
589
+ ...r,
590
+ autoExecute: !1
591
+ }, e[0] = r, e[1] = n) : n = e[1];
592
+ const o = n, {
593
+ loading: c,
594
+ result: s,
595
+ error: u,
596
+ status: i,
502
597
  execute: m,
503
- reset: o,
504
- abort: u,
505
- getQuery: a,
506
- setQuery: f
507
- }), [t, n, s, c, m, o, u, a, f]);
508
- }
509
- l(P, "useQuery");
510
- function Ie(r) {
511
- return P(r);
598
+ reset: a,
599
+ abort: f,
600
+ getQuery: d,
601
+ setQuery: b
602
+ } = A(o), {
603
+ run: y,
604
+ cancel: h,
605
+ isPending: g
606
+ } = T(m, r.debounce);
607
+ let x;
608
+ e[2] !== t || e[3] !== y || e[4] !== b ? (x = /* @__PURE__ */ l((R) => {
609
+ b(R), t && y();
610
+ }, "t1"), e[2] = t, e[3] = y, e[4] = b, e[5] = x) : x = e[5];
611
+ const S = x;
612
+ let E, Q;
613
+ e[6] !== t || e[7] !== y ? (E = /* @__PURE__ */ l(() => {
614
+ t && y();
615
+ }, "t2"), Q = [y, t], e[6] = t, e[7] = y, e[8] = E, e[9] = Q) : (E = e[8], Q = e[9]), $(E, Q);
616
+ let v;
617
+ return e[10] !== f || e[11] !== h || e[12] !== u || e[13] !== d || e[14] !== g || e[15] !== c || e[16] !== a || e[17] !== s || e[18] !== y || e[19] !== S || e[20] !== i ? (v = {
618
+ loading: c,
619
+ result: s,
620
+ error: u,
621
+ status: i,
622
+ reset: a,
623
+ abort: f,
624
+ getQuery: d,
625
+ setQuery: S,
626
+ run: y,
627
+ cancel: h,
628
+ isPending: g
629
+ }, e[10] = f, e[11] = h, e[12] = u, e[13] = d, e[14] = g, e[15] = c, e[16] = a, e[17] = s, e[18] = y, e[19] = S, e[20] = i, e[21] = v) : v = e[21], v;
512
630
  }
513
- l(Ie, "useCountQuery");
631
+ l(pe, "useDebouncedFetcherQuery");
514
632
  function A(r) {
515
633
  const e = w(22);
516
634
  let t;
517
635
  e[0] !== r ? (t = {
518
- resultExtractor: se,
636
+ resultExtractor: oe,
519
637
  ...r
520
638
  }, e[0] = r, e[1] = t) : t = e[1];
521
- const n = t, s = p(n), {
639
+ const n = t, o = L(n), {
522
640
  loading: c,
523
- result: i,
524
- error: o,
525
- status: u,
526
- execute: d,
641
+ result: s,
642
+ error: u,
643
+ status: i,
644
+ execute: m,
527
645
  reset: a,
528
646
  abort: f
529
- } = J(n);
530
- let m;
531
- e[2] !== d || e[3] !== s ? (m = /* @__PURE__ */ l((S) => {
647
+ } = Y(n);
648
+ let d;
649
+ e[2] !== m || e[3] !== o ? (d = /* @__PURE__ */ l((Q) => {
532
650
  const v = {
533
- url: s.current.url,
651
+ url: o.current.url,
534
652
  method: "POST",
535
- body: S
653
+ body: Q
536
654
  };
537
- return d(v);
538
- }, "t1"), e[2] = d, e[3] = s, e[4] = m) : m = e[4];
539
- const b = m;
655
+ return m(v);
656
+ }, "t1"), e[2] = m, e[3] = o, e[4] = d) : d = e[4];
657
+ const b = d;
540
658
  let y;
541
659
  e[5] !== b || e[6] !== n.autoExecute || e[7] !== n.initialQuery ? (y = {
542
660
  initialQuery: n.initialQuery,
@@ -544,218 +662,129 @@ function A(r) {
544
662
  execute: b
545
663
  }, e[5] = b, e[6] = n.autoExecute, e[7] = n.initialQuery, e[8] = y) : y = e[8];
546
664
  const {
547
- getQuery: x,
548
- setQuery: E
549
- } = W(y);
550
- let h;
551
- e[9] !== b || e[10] !== x ? (h = /* @__PURE__ */ l(() => b(x()), "t3"), e[9] = b, e[10] = x, e[11] = h) : h = e[11];
552
- const Q = h;
553
- let g;
554
- return e[12] !== f || e[13] !== o || e[14] !== Q || e[15] !== x || e[16] !== c || e[17] !== a || e[18] !== i || e[19] !== E || e[20] !== u ? (g = {
665
+ getQuery: h,
666
+ setQuery: g
667
+ } = j(y);
668
+ let x;
669
+ e[9] !== b || e[10] !== h ? (x = /* @__PURE__ */ l(() => b(h()), "t3"), e[9] = b, e[10] = h, e[11] = x) : x = e[11];
670
+ const S = x;
671
+ let E;
672
+ return e[12] !== f || e[13] !== u || e[14] !== S || e[15] !== h || e[16] !== c || e[17] !== a || e[18] !== s || e[19] !== g || e[20] !== i ? (E = {
555
673
  loading: c,
556
- result: i,
557
- error: o,
558
- status: u,
559
- execute: Q,
674
+ result: s,
675
+ error: u,
676
+ status: i,
677
+ execute: S,
560
678
  reset: a,
561
679
  abort: f,
562
- getQuery: x,
563
- setQuery: E
564
- }, e[12] = f, e[13] = o, e[14] = Q, e[15] = x, e[16] = c, e[17] = a, e[18] = i, e[19] = E, e[20] = u, e[21] = g) : g = e[21], g;
680
+ getQuery: h,
681
+ setQuery: g
682
+ }, e[12] = f, e[13] = u, e[14] = S, e[15] = h, e[16] = c, e[17] = a, e[18] = s, e[19] = g, e[20] = i, e[21] = E) : E = e[21], E;
565
683
  }
566
684
  l(A, "useFetcherQuery");
567
- function Oe(r) {
685
+ function Pe(r) {
568
686
  return A(r);
569
687
  }
570
- l(Oe, "useFetcherCountQuery");
571
- function $e(r) {
688
+ l(Pe, "useFetcherCountQuery");
689
+ function Ae(r) {
572
690
  return A(r);
573
691
  }
574
- l($e, "useFetcherListQuery");
575
- function pe(r) {
692
+ l(Ae, "useFetcherListQuery");
693
+ function De(r) {
576
694
  const e = w(2);
577
695
  let t;
578
696
  return e[0] !== r ? (t = {
579
697
  ...r,
580
- resultExtractor: oe
698
+ resultExtractor: ue
581
699
  }, e[0] = r, e[1] = t) : t = e[1], A(t);
582
700
  }
583
- l(pe, "useFetcherListStreamQuery");
584
- function Pe(r) {
701
+ l(De, "useFetcherListStreamQuery");
702
+ function Me(r) {
585
703
  return A(r);
586
704
  }
587
- l(Pe, "useFetcherPagedQuery");
588
- function Ae(r) {
705
+ l(Me, "useFetcherPagedQuery");
706
+ function Te(r) {
589
707
  return A(r);
590
708
  }
591
- l(Ae, "useFetcherSingleQuery");
592
- function De(r) {
709
+ l(Te, "useFetcherSingleQuery");
710
+ function Ue(r) {
593
711
  return P(r);
594
712
  }
595
- l(De, "useListQuery");
596
- function Me(r) {
713
+ l(Ue, "useCountQuery");
714
+ function qe(r) {
597
715
  return P(r);
598
716
  }
599
- l(Me, "useListStreamQuery");
600
- function Te(r) {
717
+ l(qe, "useListQuery");
718
+ function ke(r) {
601
719
  return P(r);
602
720
  }
603
- l(Te, "usePagedQuery");
604
- function qe(r) {
721
+ l(ke, "useListStreamQuery");
722
+ function ze(r) {
605
723
  return P(r);
606
724
  }
607
- l(qe, "useSingleQuery");
608
- function Ue(r) {
609
- const e = w(22), t = r.autoExecute;
610
- let n;
611
- e[0] !== r ? (n = {
612
- ...r,
613
- autoExecute: !1
614
- }, e[0] = r, e[1] = n) : n = e[1];
615
- const s = n, {
616
- loading: c,
617
- result: i,
618
- error: o,
619
- status: u,
620
- execute: d,
621
- reset: a,
622
- abort: f,
623
- getQuery: m,
624
- setQuery: b
625
- } = A(s), {
626
- run: y,
627
- cancel: x,
628
- isPending: E
629
- } = T(d, r.debounce);
630
- let h;
631
- e[2] !== t || e[3] !== y || e[4] !== b ? (h = /* @__PURE__ */ l((F) => {
632
- b(F), t && y();
633
- }, "t1"), e[2] = t, e[3] = y, e[4] = b, e[5] = h) : h = e[5];
634
- const Q = h;
635
- let g, S;
636
- e[6] !== t || e[7] !== y ? (g = /* @__PURE__ */ l(() => {
637
- t && y();
638
- }, "t2"), S = [y, t], e[6] = t, e[7] = y, e[8] = g, e[9] = S) : (g = e[8], S = e[9]), O(g, S);
639
- let v;
640
- return e[10] !== f || e[11] !== x || e[12] !== o || e[13] !== m || e[14] !== E || e[15] !== c || e[16] !== a || e[17] !== i || e[18] !== y || e[19] !== Q || e[20] !== u ? (v = {
641
- loading: c,
642
- result: i,
643
- error: o,
644
- status: u,
645
- reset: a,
646
- abort: f,
647
- getQuery: m,
648
- setQuery: Q,
649
- run: y,
650
- cancel: x,
651
- isPending: E
652
- }, e[10] = f, e[11] = x, e[12] = o, e[13] = m, e[14] = E, e[15] = c, e[16] = a, e[17] = i, e[18] = y, e[19] = Q, e[20] = u, e[21] = v) : v = e[21], v;
653
- }
654
- l(Ue, "useDebouncedFetcherQuery");
655
- function ke(r) {
656
- const e = w(22), t = r.autoExecute;
657
- let n;
658
- e[0] !== r ? (n = {
659
- ...r,
660
- autoExecute: !1
661
- }, e[0] = r, e[1] = n) : n = e[1];
662
- const s = n, {
663
- loading: c,
664
- result: i,
665
- error: o,
666
- status: u,
667
- execute: d,
668
- reset: a,
669
- abort: f,
670
- getQuery: m,
671
- setQuery: b
672
- } = P(s), {
673
- run: y,
674
- cancel: x,
675
- isPending: E
676
- } = T(d, r.debounce);
677
- let h;
678
- e[2] !== t || e[3] !== y || e[4] !== b ? (h = /* @__PURE__ */ l((F) => {
679
- b(F), t && y();
680
- }, "t1"), e[2] = t, e[3] = y, e[4] = b, e[5] = h) : h = e[5];
681
- const Q = h;
682
- let g, S;
683
- e[6] !== t || e[7] !== y ? (g = /* @__PURE__ */ l(() => {
684
- t && y();
685
- }, "t2"), S = [y, t], e[6] = t, e[7] = y, e[8] = g, e[9] = S) : (g = e[8], S = e[9]), O(g, S);
686
- let v;
687
- return e[10] !== f || e[11] !== x || e[12] !== o || e[13] !== m || e[14] !== E || e[15] !== c || e[16] !== a || e[17] !== i || e[18] !== y || e[19] !== Q || e[20] !== u ? (v = {
688
- loading: c,
689
- result: i,
690
- error: o,
691
- status: u,
692
- reset: a,
693
- abort: f,
694
- getQuery: m,
695
- setQuery: Q,
696
- run: y,
697
- cancel: x,
698
- isPending: E
699
- }, e[10] = f, e[11] = x, e[12] = o, e[13] = m, e[14] = E, e[15] = c, e[16] = a, e[17] = i, e[18] = y, e[19] = Q, e[20] = u, e[21] = v) : v = e[21], v;
725
+ l(ze, "usePagedQuery");
726
+ function Ge(r) {
727
+ return P(r);
700
728
  }
701
- l(ke, "useDebouncedQuery");
729
+ l(Ge, "useSingleQuery");
702
730
  function Ke(r) {
703
731
  const e = w(13), {
704
732
  bus: t,
705
733
  handler: n
706
734
  } = r;
735
+ let o;
736
+ e[0] !== t || e[1] !== n ? (o = /* @__PURE__ */ l(() => t.on(n), "t0"), e[0] = t, e[1] = n, e[2] = o) : o = e[2];
737
+ const c = o;
707
738
  let s;
708
- e[0] !== t || e[1] !== n ? (s = /* @__PURE__ */ l(() => t.on(n), "t0"), e[0] = t, e[1] = n, e[2] = s) : s = e[2];
709
- const c = s;
710
- let i;
711
- e[3] !== t || e[4] !== n.name ? (i = /* @__PURE__ */ l(() => t.off(n.name), "t1"), e[3] = t, e[4] = n.name, e[5] = i) : i = e[5];
712
- const o = i;
713
- let u, d;
714
- e[6] !== t || e[7] !== n ? (u = /* @__PURE__ */ l(() => (t.on(n) || console.warn(`Failed to subscribe to event bus with handler: ${n.name}`), () => {
739
+ e[3] !== t || e[4] !== n.name ? (s = /* @__PURE__ */ l(() => t.off(n.name), "t1"), e[3] = t, e[4] = n.name, e[5] = s) : s = e[5];
740
+ const u = s;
741
+ let i, m;
742
+ e[6] !== t || e[7] !== n ? (i = /* @__PURE__ */ l(() => (t.on(n) || console.warn(`Failed to subscribe to event bus with handler: ${n.name}`), () => {
715
743
  t.off(n.name);
716
- }), "t2"), d = [t, n], e[6] = t, e[7] = n, e[8] = u, e[9] = d) : (u = e[8], d = e[9]), O(u, d);
744
+ }), "t2"), m = [t, n], e[6] = t, e[7] = n, e[8] = i, e[9] = m) : (i = e[8], m = e[9]), $(i, m);
717
745
  let a;
718
- return e[10] !== c || e[11] !== o ? (a = {
746
+ return e[10] !== c || e[11] !== u ? (a = {
719
747
  subscribe: c,
720
- unsubscribe: o
721
- }, e[10] = c, e[11] = o, e[12] = a) : a = e[12], a;
748
+ unsubscribe: u
749
+ }, e[10] = c, e[11] = u, e[12] = a) : a = e[12], a;
722
750
  }
723
751
  l(Ke, "useEventSubscription");
724
752
  export {
725
- fe as ANONYMOUS_USER,
726
- ue as PromiseStatus,
727
- G as SecurityContext,
728
- Re as SecurityProvider,
729
- Ie as useCountQuery,
753
+ de as ANONYMOUS_USER,
754
+ le as PromiseStatus,
755
+ Le as RouteGuard,
756
+ W as SecurityContext,
757
+ Ie as SecurityProvider,
758
+ Ue as useCountQuery,
730
759
  T as useDebouncedCallback,
731
- _e as useDebouncedExecutePromise,
732
- Le as useDebouncedFetcher,
733
- Ue as useDebouncedFetcherQuery,
734
- ke as useDebouncedQuery,
760
+ we as useDebouncedExecutePromise,
761
+ $e as useDebouncedFetcher,
762
+ pe as useDebouncedFetcherQuery,
763
+ Re as useDebouncedQuery,
735
764
  Ke as useEventSubscription,
736
- q as useExecutePromise,
737
- J as useFetcher,
738
- Oe as useFetcherCountQuery,
739
- $e as useFetcherListQuery,
740
- pe as useFetcherListStreamQuery,
741
- Pe as useFetcherPagedQuery,
765
+ U as useExecutePromise,
766
+ Y as useFetcher,
767
+ Pe as useFetcherCountQuery,
768
+ Ae as useFetcherListQuery,
769
+ De as useFetcherListStreamQuery,
770
+ Me as useFetcherPagedQuery,
742
771
  A as useFetcherQuery,
743
- Ae as useFetcherSingleQuery,
744
- we as useForceUpdate,
745
- Fe as useImmerKeyStorage,
746
- z as useKeyStorage,
747
- p as useLatest,
748
- De as useListQuery,
749
- Me as useListStreamQuery,
750
- j as useMounted,
751
- Te as usePagedQuery,
752
- le as usePromiseState,
772
+ Te as useFetcherSingleQuery,
773
+ Ce as useForceUpdate,
774
+ Oe as useImmerKeyStorage,
775
+ J as useKeyStorage,
776
+ L as useLatest,
777
+ qe as useListQuery,
778
+ ke as useListStreamQuery,
779
+ V as useMounted,
780
+ ze as usePagedQuery,
781
+ ie as usePromiseState,
753
782
  P as useQuery,
754
- W as useQueryState,
755
- Se as useRefs,
756
- ie as useRequestId,
757
- de as useSecurity,
758
- Ce as useSecurityContext,
759
- qe as useSingleQuery
783
+ j as useQueryState,
784
+ Fe as useRefs,
785
+ ae as useRequestId,
786
+ me as useSecurity,
787
+ be as useSecurityContext,
788
+ Ge as useSingleQuery
760
789
  };
761
790
  //# sourceMappingURL=index.es.js.map