zudoku 0.53.2 → 0.53.4
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.
- package/dist/app/main.js +3 -9
- package/dist/app/main.js.map +1 -1
- package/dist/lib/components/Banner.js +1 -1
- package/dist/lib/components/Banner.js.map +1 -1
- package/dist/lib/components/CategoryHeading.js +1 -1
- package/dist/lib/components/CategoryHeading.js.map +1 -1
- package/dist/lib/components/Header.js +1 -1
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Pagination.js +1 -1
- package/dist/lib/components/Pagination.js.map +1 -1
- package/dist/lib/components/StatusPage.js +4 -0
- package/dist/lib/components/StatusPage.js.map +1 -1
- package/dist/lib/components/navigation/NavigationWrapper.js +1 -1
- package/dist/lib/components/navigation/NavigationWrapper.js.map +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +2 -1
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/search-inkeep/index.d.ts +5 -22
- package/dist/lib/plugins/search-inkeep/index.js +35 -29
- package/dist/lib/plugins/search-inkeep/index.js.map +1 -1
- package/dist/lib/plugins/search-inkeep/inkeep.d.ts +5 -21
- package/dist/lib/plugins/search-inkeep/inkeep.js +10 -19
- package/dist/lib/plugins/search-inkeep/inkeep.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js +1 -1
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/ResultList.d.ts +1 -1
- package/dist/lib/plugins/search-pagefind/ResultList.js +12 -5
- package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -1
- package/dist/lib/ui/Alert.d.ts +1 -1
- package/dist/vite/build.js +7 -1
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/plugin-mdx.js +2 -3
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/lib/{Alert-CT_ViLrJ.js → Alert-SijAp9LN.js} +3 -3
- package/lib/Alert-SijAp9LN.js.map +1 -0
- package/lib/{MdxPage-8UuEK446.js → MdxPage-BFKqQsmK.js} +19 -19
- package/lib/{MdxPage-8UuEK446.js.map → MdxPage-BFKqQsmK.js.map} +1 -1
- package/lib/{OasProvider-BsWpguVO.js → OasProvider-Bdyvd6Ic.js} +2 -2
- package/lib/{OasProvider-BsWpguVO.js.map → OasProvider-Bdyvd6Ic.js.map} +1 -1
- package/lib/{OperationList-PnZbf3b2.js → OperationList-YZ7k-Rkt.js} +172 -172
- package/lib/{OperationList-PnZbf3b2.js.map → OperationList-YZ7k-Rkt.js.map} +1 -1
- package/lib/{Pagination-DY7gCrm4.js → Pagination-EViy7EHt.js} +9 -8
- package/lib/Pagination-EViy7EHt.js.map +1 -0
- package/lib/{RouteGuard-CbKd7_9h.js → RouteGuard-CX6A77iy.js} +2 -2
- package/lib/{RouteGuard-CbKd7_9h.js.map → RouteGuard-CX6A77iy.js.map} +1 -1
- package/lib/{SchemaList-D6k4DKWH.js → SchemaList--_f8Azv0.js} +8 -8
- package/lib/{SchemaList-D6k4DKWH.js.map → SchemaList--_f8Azv0.js.map} +1 -1
- package/lib/{SchemaView-BhgJ9WB8.js → SchemaView-7XWvSrbX.js} +4 -4
- package/lib/{SchemaView-BhgJ9WB8.js.map → SchemaView-7XWvSrbX.js.map} +1 -1
- package/lib/{SignUp-CpUD6DUM.js → SignUp-CXCezG-m.js} +3 -3
- package/lib/{SignUp-CpUD6DUM.js.map → SignUp-CXCezG-m.js.map} +1 -1
- package/lib/{Slot-DwZlQ-vX.js → Slot-tFjhrd8V.js} +14 -6
- package/lib/Slot-tFjhrd8V.js.map +1 -0
- package/lib/{SyntaxHighlight-CrjhGEwT.js → SyntaxHighlight-Bp_UsIXG.js} +754 -754
- package/lib/SyntaxHighlight-Bp_UsIXG.js.map +1 -0
- package/lib/{Toc-WCmwFkX-.js → Toc-Ck0YQtmd.js} +2 -2
- package/lib/{Toc-WCmwFkX-.js.map → Toc-Ck0YQtmd.js.map} +1 -1
- package/lib/{circular-BUMjK3JF.js → circular-BtKlhs07.js} +2 -2
- package/lib/{circular-BUMjK3JF.js.map → circular-BtKlhs07.js.map} +1 -1
- package/lib/{createServer-BPz8ZCrd.js → createServer-Di2U1Dg0.js} +4 -4
- package/lib/{createServer-BPz8ZCrd.js.map → createServer-Di2U1Dg0.js.map} +1 -1
- package/lib/{errors-DY-qOx9n.js → errors-Dv_yAK6M.js} +4 -4
- package/lib/{errors-DY-qOx9n.js.map → errors-Dv_yAK6M.js.map} +1 -1
- package/lib/{hook-Bd0yS8M0.js → hook-CZjW2buS.js} +420 -413
- package/lib/hook-CZjW2buS.js.map +1 -0
- package/lib/{index-dVBKCNMa.js → index-BTqwnlI5.js} +13 -13
- package/lib/{index-dVBKCNMa.js.map → index-BTqwnlI5.js.map} +1 -1
- package/lib/index-Bm35Tkgf.js +107 -0
- package/lib/index-Bm35Tkgf.js.map +1 -0
- package/lib/{index-CcV90rin.js → index-CeQqiMIG.js} +2 -2
- package/lib/{index-CcV90rin.js.map → index-CeQqiMIG.js.map} +1 -1
- package/lib/{index-C_xVKbf9.js → index-DKCEJ4Kd.js} +1056 -1040
- package/lib/index-DKCEJ4Kd.js.map +1 -0
- package/lib/ui/Alert.js.map +1 -1
- package/lib/ui/SyntaxHighlight.js +2 -2
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-azureb2c.js +1553 -1556
- package/lib/zudoku.auth-azureb2c.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-openid.js +2 -2
- package/lib/zudoku.components.js +5 -5
- package/lib/zudoku.hooks.js +3 -3
- package/lib/zudoku.plugin-api-catalog.js +5 -5
- package/lib/zudoku.plugin-api-keys.js +3 -3
- package/lib/zudoku.plugin-custom-pages.js +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +2 -2
- package/lib/zudoku.plugin-search-inkeep.js +54 -57
- package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +107 -103
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
- package/package.json +13 -12
- package/src/app/main.tsx +6 -14
- package/src/lib/components/Banner.tsx +0 -1
- package/src/lib/components/CategoryHeading.tsx +4 -1
- package/src/lib/components/Header.tsx +4 -1
- package/src/lib/components/Pagination.tsx +1 -0
- package/src/lib/components/StatusPage.tsx +5 -0
- package/src/lib/components/navigation/NavigationWrapper.tsx +4 -1
- package/src/lib/plugins/markdown/MdxPage.tsx +1 -1
- package/src/lib/plugins/openapi/OperationList.tsx +3 -1
- package/src/lib/plugins/search-inkeep/index.tsx +54 -58
- package/src/lib/plugins/search-inkeep/inkeep.ts +19 -21
- package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +1 -0
- package/src/lib/plugins/search-pagefind/ResultList.tsx +13 -4
- package/src/lib/ui/Alert.tsx +1 -1
- package/lib/Alert-CT_ViLrJ.js.map +0 -1
- package/lib/Pagination-DY7gCrm4.js.map +0 -1
- package/lib/Slot-DwZlQ-vX.js.map +0 -1
- package/lib/SyntaxHighlight-CrjhGEwT.js.map +0 -1
- package/lib/hook-Bd0yS8M0.js.map +0 -1
- package/lib/index-C_xVKbf9.js.map +0 -1
- package/lib/index-ClhS5TxS.js +0 -107
- package/lib/index-ClhS5TxS.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as S from "react";
|
|
2
|
-
import tt, { createContext as Rt, useContext as
|
|
2
|
+
import tt, { createContext as Rt, useContext as Ot } from "react";
|
|
3
3
|
import { j as Ct } from "./jsx-runtime-C5mzlN2N.js";
|
|
4
|
-
import { u as
|
|
5
|
-
import { c as
|
|
6
|
-
var
|
|
4
|
+
import { u as q, m as j } from "./chunk-DQRVZFIR-DHK7_Ilc.js";
|
|
5
|
+
import { c as Et } from "./index-DI5SPFK9.js";
|
|
6
|
+
var V = class {
|
|
7
7
|
constructor() {
|
|
8
8
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
9
9
|
}
|
|
@@ -19,48 +19,48 @@ var $ = class {
|
|
|
19
19
|
}
|
|
20
20
|
onUnsubscribe() {
|
|
21
21
|
}
|
|
22
|
-
},
|
|
23
|
-
function
|
|
22
|
+
}, E = typeof window > "u" || "Deno" in globalThis;
|
|
23
|
+
function F() {
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function me(t, e) {
|
|
26
26
|
return typeof t == "function" ? t(e) : t;
|
|
27
27
|
}
|
|
28
28
|
function N(t) {
|
|
29
29
|
return typeof t == "number" && t >= 0 && t !== 1 / 0;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function ot(t, e) {
|
|
32
32
|
return Math.max(t + (e || 0) - Date.now(), 0);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function x(t, e) {
|
|
35
35
|
return typeof t == "function" ? t(e) : t;
|
|
36
36
|
}
|
|
37
37
|
function w(t, e) {
|
|
38
38
|
return typeof t == "function" ? t(e) : t;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function be(t, e) {
|
|
41
41
|
const {
|
|
42
42
|
type: s = "all",
|
|
43
43
|
exact: r,
|
|
44
44
|
fetchStatus: n,
|
|
45
45
|
predicate: i,
|
|
46
46
|
queryKey: o,
|
|
47
|
-
stale:
|
|
47
|
+
stale: u
|
|
48
48
|
} = t;
|
|
49
49
|
if (o) {
|
|
50
50
|
if (r) {
|
|
51
|
-
if (e.queryHash !==
|
|
51
|
+
if (e.queryHash !== Ft(o, e.options))
|
|
52
52
|
return !1;
|
|
53
|
-
} else if (
|
|
53
|
+
} else if (!$(e.queryKey, o))
|
|
54
54
|
return !1;
|
|
55
55
|
}
|
|
56
56
|
if (s !== "all") {
|
|
57
|
-
const
|
|
58
|
-
if (s === "active" && !
|
|
57
|
+
const a = e.isActive();
|
|
58
|
+
if (s === "active" && !a || s === "inactive" && a)
|
|
59
59
|
return !1;
|
|
60
60
|
}
|
|
61
|
-
return !(typeof
|
|
61
|
+
return !(typeof u == "boolean" && e.isStale() !== u || n && n !== e.state.fetchStatus || i && !i(e));
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function Se(t, e) {
|
|
64
64
|
const { exact: s, status: r, predicate: n, mutationKey: i } = t;
|
|
65
65
|
if (i) {
|
|
66
66
|
if (!e.options.mutationKey)
|
|
@@ -68,12 +68,12 @@ function we(t, e) {
|
|
|
68
68
|
if (s) {
|
|
69
69
|
if (L(e.options.mutationKey) !== L(i))
|
|
70
70
|
return !1;
|
|
71
|
-
} else if (
|
|
71
|
+
} else if (!$(e.options.mutationKey, i))
|
|
72
72
|
return !1;
|
|
73
73
|
}
|
|
74
74
|
return !(r && e.state.status !== r || n && !n(e));
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function Ft(t, e) {
|
|
77
77
|
return (e?.queryKeyHashFn || L)(t);
|
|
78
78
|
}
|
|
79
79
|
function L(t) {
|
|
@@ -82,21 +82,21 @@ function L(t) {
|
|
|
82
82
|
(e, s) => H(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
|
|
83
83
|
);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? Object.keys(e).every((s) =>
|
|
85
|
+
function $(t, e) {
|
|
86
|
+
return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? Object.keys(e).every((s) => $(t[s], e[s])) : !1;
|
|
87
87
|
}
|
|
88
88
|
function M(t, e) {
|
|
89
89
|
if (t === e)
|
|
90
90
|
return t;
|
|
91
91
|
const s = et(t) && et(e);
|
|
92
92
|
if (s || H(t) && H(e)) {
|
|
93
|
-
const r = s ? t : Object.keys(t), n = r.length, i = s ? e : Object.keys(e), o = i.length,
|
|
94
|
-
let
|
|
95
|
-
for (let
|
|
96
|
-
const
|
|
97
|
-
(!s &&
|
|
93
|
+
const r = s ? t : Object.keys(t), n = r.length, i = s ? e : Object.keys(e), o = i.length, u = s ? [] : {}, a = new Set(r);
|
|
94
|
+
let l = 0;
|
|
95
|
+
for (let h = 0; h < o; h++) {
|
|
96
|
+
const f = s ? h : i[h];
|
|
97
|
+
(!s && a.has(f) || s) && t[f] === void 0 && e[f] === void 0 ? (u[f] = void 0, l++) : (u[f] = M(t[f], e[f]), u[f] === t[f] && t[f] !== void 0 && l++);
|
|
98
98
|
}
|
|
99
|
-
return n === o &&
|
|
99
|
+
return n === o && l === n ? t : u;
|
|
100
100
|
}
|
|
101
101
|
return e;
|
|
102
102
|
}
|
|
@@ -123,7 +123,7 @@ function H(t) {
|
|
|
123
123
|
function st(t) {
|
|
124
124
|
return Object.prototype.toString.call(t) === "[object Object]";
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function It(t) {
|
|
127
127
|
return new Promise((e) => {
|
|
128
128
|
setTimeout(e, t);
|
|
129
129
|
});
|
|
@@ -144,30 +144,33 @@ function K(t, e, s) {
|
|
|
144
144
|
}
|
|
145
145
|
return e;
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function we(t) {
|
|
148
148
|
return t;
|
|
149
149
|
}
|
|
150
150
|
function Re(t, e, s = 0) {
|
|
151
151
|
const r = [...t, e];
|
|
152
152
|
return s && r.length > s ? r.slice(1) : r;
|
|
153
153
|
}
|
|
154
|
-
function
|
|
154
|
+
function Oe(t, e, s = 0) {
|
|
155
155
|
const r = [e, ...t];
|
|
156
156
|
return s && r.length > s ? r.slice(0, -1) : r;
|
|
157
157
|
}
|
|
158
158
|
var k = Symbol();
|
|
159
|
-
function
|
|
159
|
+
function Pt(t, e) {
|
|
160
160
|
return process.env.NODE_ENV !== "production" && t.queryFn === k && console.error(
|
|
161
161
|
`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${t.queryHash}'`
|
|
162
162
|
), !t.queryFn && e?.initialPromise ? () => e.initialPromise : !t.queryFn || t.queryFn === k ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn;
|
|
163
163
|
}
|
|
164
|
-
|
|
164
|
+
function Tt(t, e) {
|
|
165
|
+
return typeof t == "function" ? t(...e) : !!t;
|
|
166
|
+
}
|
|
167
|
+
var xt = class extends V {
|
|
165
168
|
#e;
|
|
166
169
|
#t;
|
|
167
170
|
#s;
|
|
168
171
|
constructor() {
|
|
169
172
|
super(), this.#s = (t) => {
|
|
170
|
-
if (!
|
|
173
|
+
if (!E && window.addEventListener) {
|
|
171
174
|
const e = () => t();
|
|
172
175
|
return window.addEventListener("visibilitychange", e, !1), () => {
|
|
173
176
|
window.removeEventListener("visibilitychange", e);
|
|
@@ -198,13 +201,13 @@ var Dt = class extends $ {
|
|
|
198
201
|
isFocused() {
|
|
199
202
|
return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
|
|
200
203
|
}
|
|
201
|
-
},
|
|
204
|
+
}, ut = new xt(), Dt = class extends V {
|
|
202
205
|
#e = !0;
|
|
203
206
|
#t;
|
|
204
207
|
#s;
|
|
205
208
|
constructor() {
|
|
206
209
|
super(), this.#s = (t) => {
|
|
207
|
-
if (!
|
|
210
|
+
if (!E && window.addEventListener) {
|
|
208
211
|
const e = () => t(!0), s = () => t(!1);
|
|
209
212
|
return window.addEventListener("online", e, !1), window.addEventListener("offline", s, !1), () => {
|
|
210
213
|
window.removeEventListener("online", e), window.removeEventListener("offline", s);
|
|
@@ -229,7 +232,7 @@ var Dt = class extends $ {
|
|
|
229
232
|
isOnline() {
|
|
230
233
|
return this.#e;
|
|
231
234
|
}
|
|
232
|
-
},
|
|
235
|
+
}, ct = new Dt();
|
|
233
236
|
function B() {
|
|
234
237
|
let t, e;
|
|
235
238
|
const s = new Promise((n, i) => {
|
|
@@ -252,58 +255,63 @@ function B() {
|
|
|
252
255
|
}), e(n);
|
|
253
256
|
}, s;
|
|
254
257
|
}
|
|
255
|
-
function
|
|
258
|
+
function Ce(t) {
|
|
259
|
+
let e;
|
|
260
|
+
if (t.then((s) => (e = s, s), F)?.catch(F), e !== void 0)
|
|
261
|
+
return { data: e };
|
|
262
|
+
}
|
|
263
|
+
function At(t) {
|
|
256
264
|
return Math.min(1e3 * 2 ** t, 3e4);
|
|
257
265
|
}
|
|
258
|
-
function
|
|
259
|
-
return (t ?? "online") === "online" ?
|
|
266
|
+
function ht(t) {
|
|
267
|
+
return (t ?? "online") === "online" ? ct.isOnline() : !0;
|
|
260
268
|
}
|
|
261
|
-
var
|
|
269
|
+
var lt = class extends Error {
|
|
262
270
|
constructor(t) {
|
|
263
271
|
super("CancelledError"), this.revert = t?.revert, this.silent = t?.silent;
|
|
264
272
|
}
|
|
265
273
|
};
|
|
266
|
-
function
|
|
267
|
-
return t instanceof
|
|
274
|
+
function U(t) {
|
|
275
|
+
return t instanceof lt;
|
|
268
276
|
}
|
|
269
|
-
function
|
|
277
|
+
function kt(t) {
|
|
270
278
|
let e = !1, s = 0, r = !1, n;
|
|
271
|
-
const i = B(), o = (
|
|
272
|
-
r || (
|
|
273
|
-
}, a = () => {
|
|
274
|
-
e = !0;
|
|
279
|
+
const i = B(), o = (c) => {
|
|
280
|
+
r || (d(new lt(c)), t.abort?.());
|
|
275
281
|
}, u = () => {
|
|
282
|
+
e = !0;
|
|
283
|
+
}, a = () => {
|
|
276
284
|
e = !1;
|
|
277
|
-
},
|
|
278
|
-
r || (r = !0, t.onSuccess?.(
|
|
279
|
-
},
|
|
280
|
-
r || (r = !0, t.onError?.(
|
|
281
|
-
}, g = () => new Promise((
|
|
285
|
+
}, l = () => ut.isFocused() && (t.networkMode === "always" || ct.isOnline()) && t.canRun(), h = () => ht(t.networkMode) && t.canRun(), f = (c) => {
|
|
286
|
+
r || (r = !0, t.onSuccess?.(c), n?.(), i.resolve(c));
|
|
287
|
+
}, d = (c) => {
|
|
288
|
+
r || (r = !0, t.onError?.(c), n?.(), i.reject(c));
|
|
289
|
+
}, g = () => new Promise((c) => {
|
|
282
290
|
n = (m) => {
|
|
283
|
-
(r ||
|
|
291
|
+
(r || l()) && c(m);
|
|
284
292
|
}, t.onPause?.();
|
|
285
293
|
}).then(() => {
|
|
286
294
|
n = void 0, r || t.onContinue?.();
|
|
287
|
-
}),
|
|
295
|
+
}), O = () => {
|
|
288
296
|
if (r)
|
|
289
297
|
return;
|
|
290
|
-
let
|
|
298
|
+
let c;
|
|
291
299
|
const m = s === 0 ? t.initialPromise : void 0;
|
|
292
300
|
try {
|
|
293
|
-
|
|
301
|
+
c = m ?? t.fn();
|
|
294
302
|
} catch (v) {
|
|
295
|
-
|
|
303
|
+
c = Promise.reject(v);
|
|
296
304
|
}
|
|
297
|
-
Promise.resolve(
|
|
305
|
+
Promise.resolve(c).then(f).catch((v) => {
|
|
298
306
|
if (r)
|
|
299
307
|
return;
|
|
300
|
-
const p = t.retry ?? (
|
|
301
|
-
if (e || !
|
|
302
|
-
|
|
308
|
+
const p = t.retry ?? (E ? 0 : 3), y = t.retryDelay ?? At, C = typeof y == "function" ? y(s, v) : y, P = p === !0 || typeof p == "number" && s < p || typeof p == "function" && p(s, v);
|
|
309
|
+
if (e || !P) {
|
|
310
|
+
d(v);
|
|
303
311
|
return;
|
|
304
312
|
}
|
|
305
|
-
s++, t.onFail?.(s, v),
|
|
306
|
-
e ?
|
|
313
|
+
s++, t.onFail?.(s, v), It(C).then(() => l() ? void 0 : g()).then(() => {
|
|
314
|
+
e ? d(v) : O();
|
|
307
315
|
});
|
|
308
316
|
});
|
|
309
317
|
};
|
|
@@ -311,50 +319,50 @@ function xt(t) {
|
|
|
311
319
|
promise: i,
|
|
312
320
|
cancel: o,
|
|
313
321
|
continue: () => (n?.(), i),
|
|
314
|
-
cancelRetry:
|
|
315
|
-
continueRetry:
|
|
316
|
-
canStart:
|
|
317
|
-
start: () => (
|
|
322
|
+
cancelRetry: u,
|
|
323
|
+
continueRetry: a,
|
|
324
|
+
canStart: h,
|
|
325
|
+
start: () => (h() ? O() : g().then(O), i)
|
|
318
326
|
};
|
|
319
327
|
}
|
|
320
|
-
var
|
|
321
|
-
function
|
|
322
|
-
let t = [], e = 0, s = (
|
|
323
|
-
|
|
324
|
-
}, r = (
|
|
325
|
-
|
|
326
|
-
}, n =
|
|
327
|
-
const i = (
|
|
328
|
-
e ? t.push(
|
|
329
|
-
s(
|
|
328
|
+
var qt = (t) => setTimeout(t, 0);
|
|
329
|
+
function jt() {
|
|
330
|
+
let t = [], e = 0, s = (u) => {
|
|
331
|
+
u();
|
|
332
|
+
}, r = (u) => {
|
|
333
|
+
u();
|
|
334
|
+
}, n = qt;
|
|
335
|
+
const i = (u) => {
|
|
336
|
+
e ? t.push(u) : n(() => {
|
|
337
|
+
s(u);
|
|
330
338
|
});
|
|
331
339
|
}, o = () => {
|
|
332
|
-
const
|
|
333
|
-
t = [],
|
|
340
|
+
const u = t;
|
|
341
|
+
t = [], u.length && n(() => {
|
|
334
342
|
r(() => {
|
|
335
|
-
|
|
336
|
-
s(
|
|
343
|
+
u.forEach((a) => {
|
|
344
|
+
s(a);
|
|
337
345
|
});
|
|
338
346
|
});
|
|
339
347
|
});
|
|
340
348
|
};
|
|
341
349
|
return {
|
|
342
|
-
batch: (
|
|
343
|
-
let
|
|
350
|
+
batch: (u) => {
|
|
351
|
+
let a;
|
|
344
352
|
e++;
|
|
345
353
|
try {
|
|
346
|
-
|
|
354
|
+
a = u();
|
|
347
355
|
} finally {
|
|
348
356
|
e--, e || o();
|
|
349
357
|
}
|
|
350
|
-
return
|
|
358
|
+
return a;
|
|
351
359
|
},
|
|
352
360
|
/**
|
|
353
361
|
* All calls to the wrapped function will be batched.
|
|
354
362
|
*/
|
|
355
|
-
batchCalls: (
|
|
363
|
+
batchCalls: (u) => (...a) => {
|
|
356
364
|
i(() => {
|
|
357
|
-
|
|
365
|
+
u(...a);
|
|
358
366
|
});
|
|
359
367
|
},
|
|
360
368
|
schedule: i,
|
|
@@ -362,22 +370,22 @@ function qt() {
|
|
|
362
370
|
* Use this method to set a custom notify function.
|
|
363
371
|
* This can be used to for example wrap notifications with `React.act` while running tests.
|
|
364
372
|
*/
|
|
365
|
-
setNotifyFunction: (
|
|
366
|
-
s =
|
|
373
|
+
setNotifyFunction: (u) => {
|
|
374
|
+
s = u;
|
|
367
375
|
},
|
|
368
376
|
/**
|
|
369
377
|
* Use this method to set a custom function to batch notifications together into a single tick.
|
|
370
378
|
* By default React Query will use the batch function provided by ReactDOM or React Native.
|
|
371
379
|
*/
|
|
372
|
-
setBatchNotifyFunction: (
|
|
373
|
-
r =
|
|
380
|
+
setBatchNotifyFunction: (u) => {
|
|
381
|
+
r = u;
|
|
374
382
|
},
|
|
375
|
-
setScheduler: (
|
|
376
|
-
n =
|
|
383
|
+
setScheduler: (u) => {
|
|
384
|
+
n = u;
|
|
377
385
|
}
|
|
378
386
|
};
|
|
379
387
|
}
|
|
380
|
-
var J =
|
|
388
|
+
var J = jt(), Ut = class {
|
|
381
389
|
#e;
|
|
382
390
|
destroy() {
|
|
383
391
|
this.clearGcTimeout();
|
|
@@ -390,13 +398,13 @@ var J = qt(), Ut = class {
|
|
|
390
398
|
updateGcTime(t) {
|
|
391
399
|
this.gcTime = Math.max(
|
|
392
400
|
this.gcTime || 0,
|
|
393
|
-
t ?? (
|
|
401
|
+
t ?? (E ? 1 / 0 : 5 * 60 * 1e3)
|
|
394
402
|
);
|
|
395
403
|
}
|
|
396
404
|
clearGcTimeout() {
|
|
397
405
|
this.#e && (clearTimeout(this.#e), this.#e = void 0);
|
|
398
406
|
}
|
|
399
|
-
},
|
|
407
|
+
}, Ee = class extends Ut {
|
|
400
408
|
#e;
|
|
401
409
|
#t;
|
|
402
410
|
#s;
|
|
@@ -433,7 +441,7 @@ var J = qt(), Ut = class {
|
|
|
433
441
|
}
|
|
434
442
|
cancel(t) {
|
|
435
443
|
const e = this.#r?.promise;
|
|
436
|
-
return this.#r?.cancel(t), e ? e.then(
|
|
444
|
+
return this.#r?.cancel(t), e ? e.then(F).catch(F) : Promise.resolve();
|
|
437
445
|
}
|
|
438
446
|
destroy() {
|
|
439
447
|
super.destroy(), this.cancel({ silent: !0 });
|
|
@@ -449,13 +457,18 @@ var J = qt(), Ut = class {
|
|
|
449
457
|
isDisabled() {
|
|
450
458
|
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === k || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
|
|
451
459
|
}
|
|
460
|
+
isStatic() {
|
|
461
|
+
return this.getObserversCount() > 0 ? this.observers.some(
|
|
462
|
+
(t) => x(t.options.staleTime, this) === "static"
|
|
463
|
+
) : !1;
|
|
464
|
+
}
|
|
452
465
|
isStale() {
|
|
453
|
-
return this.
|
|
466
|
+
return this.getObserversCount() > 0 ? this.observers.some(
|
|
454
467
|
(t) => t.getCurrentResult().isStale
|
|
455
|
-
) : this.state.data === void 0;
|
|
468
|
+
) : this.state.data === void 0 || this.state.isInvalidated;
|
|
456
469
|
}
|
|
457
470
|
isStaleByTime(t = 0) {
|
|
458
|
-
return this.state.
|
|
471
|
+
return this.state.data === void 0 ? !0 : t === "static" ? !1 : this.state.isInvalidated ? !0 : !ot(this.state.dataUpdatedAt, t);
|
|
459
472
|
}
|
|
460
473
|
onFocus() {
|
|
461
474
|
this.observers.find((e) => e.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: !1 }), this.#r?.continue();
|
|
@@ -483,7 +496,7 @@ var J = qt(), Ut = class {
|
|
|
483
496
|
return this.#r.continueRetry(), this.#r.promise;
|
|
484
497
|
}
|
|
485
498
|
if (t && this.setOptions(t), !this.options.queryFn) {
|
|
486
|
-
const a = this.observers.find((
|
|
499
|
+
const a = this.observers.find((l) => l.options.queryFn);
|
|
487
500
|
a && this.setOptions(a.options);
|
|
488
501
|
}
|
|
489
502
|
process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
|
|
@@ -495,33 +508,36 @@ var J = qt(), Ut = class {
|
|
|
495
508
|
get: () => (this.#a = !0, s.signal)
|
|
496
509
|
});
|
|
497
510
|
}, n = () => {
|
|
498
|
-
const a =
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
511
|
+
const a = Pt(this.options, e), h = (() => {
|
|
512
|
+
const f = {
|
|
513
|
+
client: this.#n,
|
|
514
|
+
queryKey: this.queryKey,
|
|
515
|
+
meta: this.meta
|
|
516
|
+
};
|
|
517
|
+
return r(f), f;
|
|
518
|
+
})();
|
|
519
|
+
return this.#a = !1, this.options.persister ? this.options.persister(
|
|
504
520
|
a,
|
|
505
|
-
|
|
521
|
+
h,
|
|
506
522
|
this
|
|
507
|
-
) : a(
|
|
508
|
-
},
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
), this.#t = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !==
|
|
520
|
-
const
|
|
521
|
-
|
|
523
|
+
) : a(h);
|
|
524
|
+
}, o = (() => {
|
|
525
|
+
const a = {
|
|
526
|
+
fetchOptions: e,
|
|
527
|
+
options: this.options,
|
|
528
|
+
queryKey: this.queryKey,
|
|
529
|
+
client: this.#n,
|
|
530
|
+
state: this.state,
|
|
531
|
+
fetchFn: n
|
|
532
|
+
};
|
|
533
|
+
return r(a), a;
|
|
534
|
+
})();
|
|
535
|
+
this.options.behavior?.onFetch(o, this), this.#t = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== o.fetchOptions?.meta) && this.#i({ type: "fetch", meta: o.fetchOptions?.meta });
|
|
536
|
+
const u = (a) => {
|
|
537
|
+
U(a) && a.silent || this.#i({
|
|
522
538
|
type: "error",
|
|
523
539
|
error: a
|
|
524
|
-
}),
|
|
540
|
+
}), U(a) || (this.#s.config.onError?.(
|
|
525
541
|
a,
|
|
526
542
|
this
|
|
527
543
|
), this.#s.config.onSettled?.(
|
|
@@ -530,21 +546,21 @@ var J = qt(), Ut = class {
|
|
|
530
546
|
this
|
|
531
547
|
)), this.scheduleGc();
|
|
532
548
|
};
|
|
533
|
-
return this.#r =
|
|
549
|
+
return this.#r = kt({
|
|
534
550
|
initialPromise: e?.initialPromise,
|
|
535
|
-
fn:
|
|
551
|
+
fn: o.fetchFn,
|
|
536
552
|
abort: s.abort.bind(s),
|
|
537
553
|
onSuccess: (a) => {
|
|
538
554
|
if (a === void 0) {
|
|
539
555
|
process.env.NODE_ENV !== "production" && console.error(
|
|
540
556
|
`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
|
|
541
|
-
),
|
|
557
|
+
), u(new Error(`${this.queryHash} data is undefined`));
|
|
542
558
|
return;
|
|
543
559
|
}
|
|
544
560
|
try {
|
|
545
561
|
this.setData(a);
|
|
546
|
-
} catch (
|
|
547
|
-
|
|
562
|
+
} catch (l) {
|
|
563
|
+
u(l);
|
|
548
564
|
return;
|
|
549
565
|
}
|
|
550
566
|
this.#s.config.onSuccess?.(a, this), this.#s.config.onSettled?.(
|
|
@@ -553,9 +569,9 @@ var J = qt(), Ut = class {
|
|
|
553
569
|
this
|
|
554
570
|
), this.scheduleGc();
|
|
555
571
|
},
|
|
556
|
-
onError:
|
|
557
|
-
onFail: (a,
|
|
558
|
-
this.#i({ type: "failed", failureCount: a, error:
|
|
572
|
+
onError: u,
|
|
573
|
+
onFail: (a, l) => {
|
|
574
|
+
this.#i({ type: "failed", failureCount: a, error: l });
|
|
559
575
|
},
|
|
560
576
|
onPause: () => {
|
|
561
577
|
this.#i({ type: "pause" });
|
|
@@ -563,9 +579,9 @@ var J = qt(), Ut = class {
|
|
|
563
579
|
onContinue: () => {
|
|
564
580
|
this.#i({ type: "continue" });
|
|
565
581
|
},
|
|
566
|
-
retry:
|
|
567
|
-
retryDelay:
|
|
568
|
-
networkMode:
|
|
582
|
+
retry: o.options.retry,
|
|
583
|
+
retryDelay: o.options.retryDelay,
|
|
584
|
+
networkMode: o.options.networkMode,
|
|
569
585
|
canRun: () => !0
|
|
570
586
|
}), this.#r.start();
|
|
571
587
|
}
|
|
@@ -591,11 +607,11 @@ var J = qt(), Ut = class {
|
|
|
591
607
|
case "fetch":
|
|
592
608
|
return {
|
|
593
609
|
...s,
|
|
594
|
-
...
|
|
610
|
+
...ft(s.data, this.options),
|
|
595
611
|
fetchMeta: t.meta ?? null
|
|
596
612
|
};
|
|
597
613
|
case "success":
|
|
598
|
-
return {
|
|
614
|
+
return this.#t = void 0, {
|
|
599
615
|
...s,
|
|
600
616
|
data: t.data,
|
|
601
617
|
dataUpdateCount: s.dataUpdateCount + 1,
|
|
@@ -611,7 +627,7 @@ var J = qt(), Ut = class {
|
|
|
611
627
|
};
|
|
612
628
|
case "error":
|
|
613
629
|
const r = t.error;
|
|
614
|
-
return
|
|
630
|
+
return U(r) && r.revert && this.#t ? { ...this.#t, fetchStatus: "idle" } : {
|
|
615
631
|
...s,
|
|
616
632
|
error: r,
|
|
617
633
|
errorUpdateCount: s.errorUpdateCount + 1,
|
|
@@ -640,11 +656,11 @@ var J = qt(), Ut = class {
|
|
|
640
656
|
});
|
|
641
657
|
}
|
|
642
658
|
};
|
|
643
|
-
function
|
|
659
|
+
function ft(t, e) {
|
|
644
660
|
return {
|
|
645
661
|
fetchFailureCount: 0,
|
|
646
662
|
fetchFailureReason: null,
|
|
647
|
-
fetchStatus:
|
|
663
|
+
fetchStatus: ht(e.networkMode) ? "fetching" : "paused",
|
|
648
664
|
...t === void 0 && {
|
|
649
665
|
error: null,
|
|
650
666
|
status: "pending"
|
|
@@ -668,7 +684,7 @@ function Qt(t) {
|
|
|
668
684
|
fetchStatus: "idle"
|
|
669
685
|
};
|
|
670
686
|
}
|
|
671
|
-
var
|
|
687
|
+
var dt = class extends V {
|
|
672
688
|
constructor(t, e) {
|
|
673
689
|
super(), this.options = e, this.#e = t, this.#i = null, this.#a = B(), this.options.experimental_prefetchInRender || this.#a.reject(
|
|
674
690
|
new Error("experimental_prefetchInRender feature flag is not enabled")
|
|
@@ -723,7 +739,7 @@ var pt = class extends $ {
|
|
|
723
739
|
throw new Error(
|
|
724
740
|
"Expected enabled to be a boolean or a callback that returns a boolean"
|
|
725
741
|
);
|
|
726
|
-
this.#
|
|
742
|
+
this.#R(), this.#t.setOptions(this.options), e._defaulted && !_(this.options, e) && this.#e.getQueryCache().notify({
|
|
727
743
|
type: "observerOptionsUpdated",
|
|
728
744
|
query: this.#t,
|
|
729
745
|
observer: this
|
|
@@ -734,7 +750,7 @@ var pt = class extends $ {
|
|
|
734
750
|
s,
|
|
735
751
|
this.options,
|
|
736
752
|
e
|
|
737
|
-
) && this.#l(), this.updateResult(), r && (this.#t !== s || w(this.options.enabled, this.#t) !== w(e.enabled, this.#t) ||
|
|
753
|
+
) && this.#l(), this.updateResult(), r && (this.#t !== s || w(this.options.enabled, this.#t) !== w(e.enabled, this.#t) || x(this.options.staleTime, this.#t) !== x(e.staleTime, this.#t)) && this.#v();
|
|
738
754
|
const n = this.#g();
|
|
739
755
|
r && (this.#t !== s || w(this.options.enabled, this.#t) !== w(e.enabled, this.#t) || n !== this.#u) && this.#m(n);
|
|
740
756
|
}
|
|
@@ -746,14 +762,9 @@ var pt = class extends $ {
|
|
|
746
762
|
return this.#n;
|
|
747
763
|
}
|
|
748
764
|
trackResult(t, e) {
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
configurable: !1,
|
|
753
|
-
enumerable: !0,
|
|
754
|
-
get: () => (this.trackProp(r), e?.(r), t[r])
|
|
755
|
-
});
|
|
756
|
-
}), s;
|
|
765
|
+
return new Proxy(t, {
|
|
766
|
+
get: (s, r) => (this.trackProp(r), e?.(r), Reflect.get(s, r))
|
|
767
|
+
});
|
|
757
768
|
}
|
|
758
769
|
trackProp(t) {
|
|
759
770
|
this.#p.add(t);
|
|
@@ -777,22 +788,22 @@ var pt = class extends $ {
|
|
|
777
788
|
}).then(() => (this.updateResult(), this.#n));
|
|
778
789
|
}
|
|
779
790
|
#l(t) {
|
|
780
|
-
this.#
|
|
791
|
+
this.#R();
|
|
781
792
|
let e = this.#t.fetch(
|
|
782
793
|
this.options,
|
|
783
794
|
t
|
|
784
795
|
);
|
|
785
|
-
return t?.throwOnError || (e = e.catch(
|
|
796
|
+
return t?.throwOnError || (e = e.catch(F)), e;
|
|
786
797
|
}
|
|
787
798
|
#v() {
|
|
788
799
|
this.#S();
|
|
789
|
-
const t =
|
|
800
|
+
const t = x(
|
|
790
801
|
this.options.staleTime,
|
|
791
802
|
this.#t
|
|
792
803
|
);
|
|
793
|
-
if (
|
|
804
|
+
if (E || this.#n.isStale || !N(t))
|
|
794
805
|
return;
|
|
795
|
-
const s =
|
|
806
|
+
const s = ot(this.#n.dataUpdatedAt, t) + 1;
|
|
796
807
|
this.#c = setTimeout(() => {
|
|
797
808
|
this.#n.isStale || this.updateResult();
|
|
798
809
|
}, s);
|
|
@@ -801,8 +812,8 @@ var pt = class extends $ {
|
|
|
801
812
|
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#t) : this.options.refetchInterval) ?? !1;
|
|
802
813
|
}
|
|
803
814
|
#m(t) {
|
|
804
|
-
this.#w(), this.#u = t, !(
|
|
805
|
-
(this.options.refetchIntervalInBackground ||
|
|
815
|
+
this.#w(), this.#u = t, !(E || w(this.options.enabled, this.#t) === !1 || !N(this.#u) || this.#u === 0) && (this.#h = setInterval(() => {
|
|
816
|
+
(this.options.refetchIntervalInBackground || ut.isFocused()) && this.#l();
|
|
806
817
|
}, this.#u));
|
|
807
818
|
}
|
|
808
819
|
#b() {
|
|
@@ -815,86 +826,86 @@ var pt = class extends $ {
|
|
|
815
826
|
this.#h && (clearInterval(this.#h), this.#h = void 0);
|
|
816
827
|
}
|
|
817
828
|
createResult(t, e) {
|
|
818
|
-
const s = this.#t, r = this.options, n = this.#n, i = this.#r, o = this.#o,
|
|
819
|
-
let
|
|
829
|
+
const s = this.#t, r = this.options, n = this.#n, i = this.#r, o = this.#o, a = t !== s ? t.state : this.#s, { state: l } = t;
|
|
830
|
+
let h = { ...l }, f = !1, d;
|
|
820
831
|
if (e._optimisticResults) {
|
|
821
|
-
const b = this.hasListeners(),
|
|
822
|
-
(
|
|
823
|
-
...
|
|
824
|
-
...
|
|
825
|
-
}), e._optimisticResults === "isRestoring" && (
|
|
832
|
+
const b = this.hasListeners(), D = !b && rt(t, e), T = b && nt(t, s, e, r);
|
|
833
|
+
(D || T) && (h = {
|
|
834
|
+
...h,
|
|
835
|
+
...ft(l.data, t.options)
|
|
836
|
+
}), e._optimisticResults === "isRestoring" && (h.fetchStatus = "idle");
|
|
826
837
|
}
|
|
827
|
-
let { error: g, errorUpdatedAt:
|
|
828
|
-
|
|
838
|
+
let { error: g, errorUpdatedAt: O, status: c } = h;
|
|
839
|
+
d = h.data;
|
|
829
840
|
let m = !1;
|
|
830
|
-
if (e.placeholderData !== void 0 &&
|
|
841
|
+
if (e.placeholderData !== void 0 && d === void 0 && c === "pending") {
|
|
831
842
|
let b;
|
|
832
843
|
n?.isPlaceholderData && e.placeholderData === o?.placeholderData ? (b = n.data, m = !0) : b = typeof e.placeholderData == "function" ? e.placeholderData(
|
|
833
844
|
this.#d?.state.data,
|
|
834
845
|
this.#d
|
|
835
|
-
) : e.placeholderData, b !== void 0 && (
|
|
846
|
+
) : e.placeholderData, b !== void 0 && (c = "success", d = K(
|
|
836
847
|
n?.data,
|
|
837
848
|
b,
|
|
838
849
|
e
|
|
839
|
-
),
|
|
850
|
+
), f = !0);
|
|
840
851
|
}
|
|
841
|
-
if (e.select &&
|
|
842
|
-
if (n &&
|
|
843
|
-
|
|
852
|
+
if (e.select && d !== void 0 && !m)
|
|
853
|
+
if (n && d === i?.data && e.select === this.#y)
|
|
854
|
+
d = this.#f;
|
|
844
855
|
else
|
|
845
856
|
try {
|
|
846
|
-
this.#y = e.select,
|
|
857
|
+
this.#y = e.select, d = e.select(d), d = K(n?.data, d, e), this.#f = d, this.#i = null;
|
|
847
858
|
} catch (b) {
|
|
848
859
|
this.#i = b;
|
|
849
860
|
}
|
|
850
|
-
this.#i && (g = this.#i,
|
|
851
|
-
const v =
|
|
852
|
-
status:
|
|
853
|
-
fetchStatus:
|
|
861
|
+
this.#i && (g = this.#i, d = this.#f, O = Date.now(), c = "error");
|
|
862
|
+
const v = h.fetchStatus === "fetching", p = c === "pending", y = c === "error", C = p && v, P = d !== void 0, R = {
|
|
863
|
+
status: c,
|
|
864
|
+
fetchStatus: h.fetchStatus,
|
|
854
865
|
isPending: p,
|
|
855
|
-
isSuccess:
|
|
866
|
+
isSuccess: c === "success",
|
|
856
867
|
isError: y,
|
|
857
|
-
isInitialLoading:
|
|
858
|
-
isLoading:
|
|
859
|
-
data:
|
|
860
|
-
dataUpdatedAt:
|
|
868
|
+
isInitialLoading: C,
|
|
869
|
+
isLoading: C,
|
|
870
|
+
data: d,
|
|
871
|
+
dataUpdatedAt: h.dataUpdatedAt,
|
|
861
872
|
error: g,
|
|
862
|
-
errorUpdatedAt:
|
|
863
|
-
failureCount:
|
|
864
|
-
failureReason:
|
|
865
|
-
errorUpdateCount:
|
|
866
|
-
isFetched:
|
|
867
|
-
isFetchedAfterMount:
|
|
873
|
+
errorUpdatedAt: O,
|
|
874
|
+
failureCount: h.fetchFailureCount,
|
|
875
|
+
failureReason: h.fetchFailureReason,
|
|
876
|
+
errorUpdateCount: h.errorUpdateCount,
|
|
877
|
+
isFetched: h.dataUpdateCount > 0 || h.errorUpdateCount > 0,
|
|
878
|
+
isFetchedAfterMount: h.dataUpdateCount > a.dataUpdateCount || h.errorUpdateCount > a.errorUpdateCount,
|
|
868
879
|
isFetching: v,
|
|
869
880
|
isRefetching: v && !p,
|
|
870
|
-
isLoadingError: y && !
|
|
871
|
-
isPaused:
|
|
872
|
-
isPlaceholderData:
|
|
873
|
-
isRefetchError: y &&
|
|
881
|
+
isLoadingError: y && !P,
|
|
882
|
+
isPaused: h.fetchStatus === "paused",
|
|
883
|
+
isPlaceholderData: f,
|
|
884
|
+
isRefetchError: y && P,
|
|
874
885
|
isStale: Z(t, e),
|
|
875
886
|
refetch: this.refetch,
|
|
876
887
|
promise: this.#a
|
|
877
888
|
};
|
|
878
889
|
if (this.options.experimental_prefetchInRender) {
|
|
879
|
-
const b = (
|
|
880
|
-
|
|
881
|
-
},
|
|
882
|
-
const
|
|
883
|
-
b(
|
|
884
|
-
},
|
|
885
|
-
switch (
|
|
890
|
+
const b = (A) => {
|
|
891
|
+
R.status === "error" ? A.reject(R.error) : R.data !== void 0 && A.resolve(R.data);
|
|
892
|
+
}, D = () => {
|
|
893
|
+
const A = this.#a = R.promise = B();
|
|
894
|
+
b(A);
|
|
895
|
+
}, T = this.#a;
|
|
896
|
+
switch (T.status) {
|
|
886
897
|
case "pending":
|
|
887
|
-
t.queryHash === s.queryHash && b(
|
|
898
|
+
t.queryHash === s.queryHash && b(T);
|
|
888
899
|
break;
|
|
889
900
|
case "fulfilled":
|
|
890
|
-
(
|
|
901
|
+
(R.status === "error" || R.data !== T.value) && D();
|
|
891
902
|
break;
|
|
892
903
|
case "rejected":
|
|
893
|
-
(
|
|
904
|
+
(R.status !== "error" || R.error !== T.reason) && D();
|
|
894
905
|
break;
|
|
895
906
|
}
|
|
896
907
|
}
|
|
897
|
-
return
|
|
908
|
+
return R;
|
|
898
909
|
}
|
|
899
910
|
updateResult() {
|
|
900
911
|
const t = this.#n, e = this.createResult(this.#t, this.options);
|
|
@@ -911,13 +922,13 @@ var pt = class extends $ {
|
|
|
911
922
|
n ?? this.#p
|
|
912
923
|
);
|
|
913
924
|
return this.options.throwOnError && i.add("error"), Object.keys(this.#n).some((o) => {
|
|
914
|
-
const
|
|
915
|
-
return this.#n[
|
|
925
|
+
const u = o;
|
|
926
|
+
return this.#n[u] !== t[u] && i.has(u);
|
|
916
927
|
});
|
|
917
928
|
};
|
|
918
|
-
this.#
|
|
929
|
+
this.#O({ listeners: s() });
|
|
919
930
|
}
|
|
920
|
-
#
|
|
931
|
+
#R() {
|
|
921
932
|
const t = this.#e.getQueryCache().build(this.#e, this.options);
|
|
922
933
|
if (t === this.#t)
|
|
923
934
|
return;
|
|
@@ -927,7 +938,7 @@ var pt = class extends $ {
|
|
|
927
938
|
onQueryUpdate() {
|
|
928
939
|
this.updateResult(), this.hasListeners() && this.#b();
|
|
929
940
|
}
|
|
930
|
-
#
|
|
941
|
+
#O(t) {
|
|
931
942
|
J.batch(() => {
|
|
932
943
|
t.listeners && this.listeners.forEach((e) => {
|
|
933
944
|
e(this.#n);
|
|
@@ -945,7 +956,7 @@ function rt(t, e) {
|
|
|
945
956
|
return Nt(t, e) || t.state.data !== void 0 && G(t, e, e.refetchOnMount);
|
|
946
957
|
}
|
|
947
958
|
function G(t, e, s) {
|
|
948
|
-
if (w(e.enabled, t) !== !1) {
|
|
959
|
+
if (w(e.enabled, t) !== !1 && x(e.staleTime, t) !== "static") {
|
|
949
960
|
const r = typeof s == "function" ? s(t) : s;
|
|
950
961
|
return r === "always" || r !== !1 && Z(t, e);
|
|
951
962
|
}
|
|
@@ -955,15 +966,15 @@ function nt(t, e, s, r) {
|
|
|
955
966
|
return (t !== e || w(r.enabled, t) === !1) && (!s.suspense || t.state.status !== "error") && Z(t, s);
|
|
956
967
|
}
|
|
957
968
|
function Z(t, e) {
|
|
958
|
-
return w(e.enabled, t) !== !1 && t.isStaleByTime(
|
|
969
|
+
return w(e.enabled, t) !== !1 && t.isStaleByTime(x(e.staleTime, t));
|
|
959
970
|
}
|
|
960
971
|
function Lt(t, e) {
|
|
961
972
|
return !_(t.getCurrentResult(), e);
|
|
962
973
|
}
|
|
963
|
-
var
|
|
974
|
+
var pt = S.createContext(
|
|
964
975
|
void 0
|
|
965
|
-
),
|
|
966
|
-
const e = S.useContext(
|
|
976
|
+
), yt = (t) => {
|
|
977
|
+
const e = S.useContext(pt);
|
|
967
978
|
if (t)
|
|
968
979
|
return t;
|
|
969
980
|
if (!e)
|
|
@@ -974,8 +985,8 @@ var yt = S.createContext(
|
|
|
974
985
|
children: e
|
|
975
986
|
}) => (S.useEffect(() => (t.mount(), () => {
|
|
976
987
|
t.unmount();
|
|
977
|
-
}), [t]), /* @__PURE__ */ Ct.jsx(
|
|
978
|
-
|
|
988
|
+
}), [t]), /* @__PURE__ */ Ct.jsx(pt.Provider, { value: t, children: e })), vt = S.createContext(!1), Mt = () => S.useContext(vt);
|
|
989
|
+
vt.Provider;
|
|
979
990
|
function _t() {
|
|
980
991
|
let t = !1;
|
|
981
992
|
return {
|
|
@@ -988,87 +999,83 @@ function _t() {
|
|
|
988
999
|
isReset: () => t
|
|
989
1000
|
};
|
|
990
1001
|
}
|
|
991
|
-
var Ht = S.createContext(_t()), Kt = () => S.useContext(Ht)
|
|
992
|
-
function Bt(t, e) {
|
|
993
|
-
return typeof t == "function" ? t(...e) : !!t;
|
|
994
|
-
}
|
|
995
|
-
function it() {
|
|
996
|
-
}
|
|
997
|
-
var Gt = (t, e) => {
|
|
1002
|
+
var Ht = S.createContext(_t()), Kt = () => S.useContext(Ht), Bt = (t, e) => {
|
|
998
1003
|
(t.suspense || t.throwOnError || t.experimental_prefetchInRender) && (e.isReset() || (t.retryOnMount = !1));
|
|
999
|
-
},
|
|
1004
|
+
}, Gt = (t) => {
|
|
1000
1005
|
S.useEffect(() => {
|
|
1001
1006
|
t.clearReset();
|
|
1002
1007
|
}, [t]);
|
|
1003
|
-
},
|
|
1008
|
+
}, zt = ({
|
|
1004
1009
|
result: t,
|
|
1005
1010
|
errorResetBoundary: e,
|
|
1006
1011
|
throwOnError: s,
|
|
1007
1012
|
query: r,
|
|
1008
1013
|
suspense: n
|
|
1009
|
-
}) => t.isError && !e.isReset() && !t.isFetching && r && (n && t.data === void 0 ||
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1014
|
+
}) => t.isError && !e.isReset() && !t.isFetching && r && (n && t.data === void 0 || Tt(s, [t.error, r])), Vt = (t, e) => e.state.data === void 0, $t = (t) => {
|
|
1015
|
+
if (t.suspense) {
|
|
1016
|
+
const e = (r) => r === "static" ? r : Math.max(r ?? 1e3, 1e3), s = t.staleTime;
|
|
1017
|
+
t.staleTime = typeof s == "function" ? (...r) => e(s(...r)) : e(s), typeof t.gcTime == "number" && (t.gcTime = Math.max(t.gcTime, 1e3));
|
|
1018
|
+
}
|
|
1019
|
+
}, Jt = (t, e) => t.isLoading && t.isFetching && !e, Zt = (t, e) => t?.suspense && e.isPending, it = (t, e, s) => e.fetchOptimistic(t).catch(() => {
|
|
1013
1020
|
s.clearReset();
|
|
1014
1021
|
});
|
|
1015
|
-
function
|
|
1022
|
+
function gt(t, e, s) {
|
|
1016
1023
|
if (process.env.NODE_ENV !== "production" && (typeof t != "object" || Array.isArray(t)))
|
|
1017
1024
|
throw new Error(
|
|
1018
1025
|
'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'
|
|
1019
1026
|
);
|
|
1020
|
-
const r =
|
|
1021
|
-
|
|
1027
|
+
const r = Mt(), n = Kt(), i = yt(s), o = i.defaultQueryOptions(t);
|
|
1028
|
+
i.getDefaultOptions().queries?._experimental_beforeQuery?.(
|
|
1022
1029
|
o
|
|
1023
1030
|
), process.env.NODE_ENV !== "production" && (o.queryFn || console.error(
|
|
1024
1031
|
`[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`
|
|
1025
|
-
)), o._optimisticResults =
|
|
1026
|
-
const
|
|
1032
|
+
)), o._optimisticResults = r ? "isRestoring" : "optimistic", $t(o), Bt(o, n), Gt(n);
|
|
1033
|
+
const u = !i.getQueryCache().get(o.queryHash), [a] = S.useState(
|
|
1027
1034
|
() => new e(
|
|
1028
|
-
|
|
1035
|
+
i,
|
|
1029
1036
|
o
|
|
1030
1037
|
)
|
|
1031
|
-
),
|
|
1038
|
+
), l = a.getOptimisticResult(o), h = !r && t.subscribed !== !1;
|
|
1032
1039
|
if (S.useSyncExternalStore(
|
|
1033
1040
|
S.useCallback(
|
|
1034
|
-
(
|
|
1035
|
-
const
|
|
1036
|
-
return
|
|
1041
|
+
(f) => {
|
|
1042
|
+
const d = h ? a.subscribe(J.batchCalls(f)) : F;
|
|
1043
|
+
return a.updateResult(), d;
|
|
1037
1044
|
},
|
|
1038
|
-
[
|
|
1045
|
+
[a, h]
|
|
1039
1046
|
),
|
|
1040
|
-
() =>
|
|
1041
|
-
() =>
|
|
1047
|
+
() => a.getCurrentResult(),
|
|
1048
|
+
() => a.getCurrentResult()
|
|
1042
1049
|
), S.useEffect(() => {
|
|
1043
|
-
|
|
1044
|
-
}, [o,
|
|
1045
|
-
throw
|
|
1046
|
-
if (
|
|
1047
|
-
result:
|
|
1048
|
-
errorResetBoundary:
|
|
1050
|
+
a.setOptions(o);
|
|
1051
|
+
}, [o, a]), Zt(o, l))
|
|
1052
|
+
throw it(o, a, n);
|
|
1053
|
+
if (zt({
|
|
1054
|
+
result: l,
|
|
1055
|
+
errorResetBoundary: n,
|
|
1049
1056
|
throwOnError: o.throwOnError,
|
|
1050
|
-
query:
|
|
1057
|
+
query: i.getQueryCache().get(o.queryHash),
|
|
1051
1058
|
suspense: o.suspense
|
|
1052
1059
|
}))
|
|
1053
|
-
throw
|
|
1054
|
-
return
|
|
1060
|
+
throw l.error;
|
|
1061
|
+
return i.getDefaultOptions().queries?._experimental_afterQuery?.(
|
|
1055
1062
|
o,
|
|
1056
|
-
|
|
1057
|
-
), o.experimental_prefetchInRender && !
|
|
1063
|
+
l
|
|
1064
|
+
), o.experimental_prefetchInRender && !E && Jt(l, r) && (u ? (
|
|
1058
1065
|
// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
|
|
1059
|
-
|
|
1066
|
+
it(o, a, n)
|
|
1060
1067
|
) : (
|
|
1061
1068
|
// subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
|
|
1062
|
-
|
|
1063
|
-
))?.catch(
|
|
1064
|
-
|
|
1065
|
-
}), o.notifyOnChangeProps ?
|
|
1069
|
+
i.getQueryCache().get(o.queryHash)?.promise
|
|
1070
|
+
))?.catch(F).finally(() => {
|
|
1071
|
+
a.updateResult();
|
|
1072
|
+
}), o.notifyOnChangeProps ? l : a.trackResult(l);
|
|
1066
1073
|
}
|
|
1067
|
-
function
|
|
1068
|
-
return
|
|
1074
|
+
function Wt(t, e) {
|
|
1075
|
+
return gt(t, dt, e);
|
|
1069
1076
|
}
|
|
1070
|
-
function
|
|
1071
|
-
return process.env.NODE_ENV !== "production" && t.queryFn === k && console.error("skipToken is not allowed for useSuspenseQuery"),
|
|
1077
|
+
function Yt(t, e) {
|
|
1078
|
+
return process.env.NODE_ENV !== "production" && t.queryFn === k && console.error("skipToken is not allowed for useSuspenseQuery"), gt(
|
|
1072
1079
|
{
|
|
1073
1080
|
...t,
|
|
1074
1081
|
enabled: !0,
|
|
@@ -1076,32 +1083,32 @@ function Xt(t, e) {
|
|
|
1076
1083
|
throwOnError: Vt,
|
|
1077
1084
|
placeholderData: void 0
|
|
1078
1085
|
},
|
|
1079
|
-
|
|
1086
|
+
dt,
|
|
1080
1087
|
e
|
|
1081
1088
|
);
|
|
1082
1089
|
}
|
|
1083
|
-
const
|
|
1090
|
+
const Xt = /^(\w+:\/\/[^/?]+)?([^?]*)(\?.*)?$/, te = (t) => t.filter(
|
|
1084
1091
|
(e) => e != null && e !== !1 && (typeof e == "string" || typeof e == "number")
|
|
1085
|
-
).map((e) => `${e}`).filter((e) => e),
|
|
1086
|
-
const e = t.join("/"), [, s = "", r = ""] = e.match(
|
|
1092
|
+
).map((e) => `${e}`).filter((e) => e), ee = (t) => {
|
|
1093
|
+
const e = t.join("/"), [, s = "", r = ""] = e.match(Xt) ?? [];
|
|
1087
1094
|
return {
|
|
1088
1095
|
prefix: s,
|
|
1089
1096
|
pathname: r.split("/").filter((n) => n !== "")
|
|
1090
1097
|
};
|
|
1091
|
-
},
|
|
1098
|
+
}, se = (t) => {
|
|
1092
1099
|
const { prefix: e, pathname: s } = t;
|
|
1093
1100
|
let r = e;
|
|
1094
1101
|
return s.length > 0 ? (r ? r += "/" : r = "/", r += s.join("/")) : r || (r = "/"), r;
|
|
1095
|
-
},
|
|
1096
|
-
const e =
|
|
1097
|
-
return
|
|
1098
|
-
},
|
|
1102
|
+
}, I = (...t) => {
|
|
1103
|
+
const e = te(t), s = ee(e);
|
|
1104
|
+
return se(s);
|
|
1105
|
+
}, mt = Object.freeze({
|
|
1099
1106
|
API_IDENTITIES: ["api-identities"]
|
|
1100
1107
|
}), Ie = () => {
|
|
1101
|
-
const t =
|
|
1108
|
+
const t = yt();
|
|
1102
1109
|
return {
|
|
1103
1110
|
invalidateCache: async (e) => {
|
|
1104
|
-
await t.invalidateQueries({ queryKey:
|
|
1111
|
+
await t.invalidateQueries({ queryKey: mt[e] });
|
|
1105
1112
|
}
|
|
1106
1113
|
};
|
|
1107
1114
|
}, Pe = "no-dehydrate", W = (t, e) => {
|
|
@@ -1121,29 +1128,29 @@ const te = /^(\w+:\/\/[^/?]+)?([^?]*)(\?.*)?$/, ee = (t) => t.filter(
|
|
|
1121
1128
|
if (i !== void 0) return i;
|
|
1122
1129
|
}
|
|
1123
1130
|
}, Te = () => {
|
|
1124
|
-
const t =
|
|
1131
|
+
const t = q(), { navigation: e } = bt();
|
|
1125
1132
|
return W(e, (s) => {
|
|
1126
|
-
if (s.type === "doc" &&
|
|
1133
|
+
if (s.type === "doc" && I(s.path) === t.pathname)
|
|
1127
1134
|
return s;
|
|
1128
1135
|
});
|
|
1129
|
-
},
|
|
1130
|
-
const e =
|
|
1136
|
+
}, xe = (t) => {
|
|
1137
|
+
const e = q();
|
|
1131
1138
|
return Y(t, (s) => {
|
|
1132
|
-
if (s.type === "category" && s.link &&
|
|
1139
|
+
if (s.type === "category" && s.link && I(s.link.path) === e.pathname || s.type === "doc" && I(s.path) === e.pathname)
|
|
1133
1140
|
return !0;
|
|
1134
1141
|
});
|
|
1135
|
-
},
|
|
1136
|
-
const t =
|
|
1142
|
+
}, De = () => {
|
|
1143
|
+
const t = q().pathname, { navigation: e } = bt();
|
|
1137
1144
|
let s, r, n = !1;
|
|
1138
1145
|
return W(e, (i) => {
|
|
1139
|
-
const o = i.type === "doc" ?
|
|
1146
|
+
const o = i.type === "doc" ? I(i.path) : i.type === "category" && i.link ? I(i.link.path) : void 0;
|
|
1140
1147
|
if (o) {
|
|
1141
1148
|
if (n)
|
|
1142
1149
|
return r = { label: i.label, id: o }, !0;
|
|
1143
1150
|
t === o ? n = !0 : s = { label: i.label, id: o };
|
|
1144
1151
|
}
|
|
1145
1152
|
}), { prev: s, next: r };
|
|
1146
|
-
},
|
|
1153
|
+
}, Ae = Et(
|
|
1147
1154
|
"relative flex items-center gap-2 px-(--padding-nav-item) my-0.5 py-1.5 rounded-lg hover:bg-accent tabular-nums",
|
|
1148
1155
|
{
|
|
1149
1156
|
variants: {
|
|
@@ -1164,25 +1171,25 @@ const te = /^(\w+:\/\/[^/?]+)?([^?]*)(\?.*)?$/, ee = (t) => t.filter(
|
|
|
1164
1171
|
isActive: !1
|
|
1165
1172
|
}
|
|
1166
1173
|
}
|
|
1167
|
-
),
|
|
1174
|
+
), ke = (t) => (e) => e.display === "hide" || !e.label ? !1 : e.display === "auth" && t || e.display === "anon" && !t || !e.display || e.display === "always", re = Rt(
|
|
1168
1175
|
void 0
|
|
1169
1176
|
), X = () => {
|
|
1170
|
-
const t =
|
|
1177
|
+
const t = Ot(re);
|
|
1171
1178
|
if (!t)
|
|
1172
1179
|
throw new Error("useZudoku must be used within a ZudokuProvider.");
|
|
1173
1180
|
return t;
|
|
1174
|
-
},
|
|
1181
|
+
}, qe = () => {
|
|
1175
1182
|
const { getApiIdentities: t } = X();
|
|
1176
|
-
return
|
|
1183
|
+
return Wt({
|
|
1177
1184
|
queryFn: t,
|
|
1178
|
-
queryKey:
|
|
1185
|
+
queryKey: mt.API_IDENTITIES
|
|
1179
1186
|
});
|
|
1180
|
-
},
|
|
1187
|
+
}, Q = (t) => {
|
|
1181
1188
|
switch (t.type) {
|
|
1182
1189
|
case "doc":
|
|
1183
|
-
return
|
|
1190
|
+
return I(t.path);
|
|
1184
1191
|
case "category":
|
|
1185
|
-
return t.link ?
|
|
1192
|
+
return t.link ? I(t.link.path) : void 0;
|
|
1186
1193
|
case "link":
|
|
1187
1194
|
return t.to;
|
|
1188
1195
|
case "custom-page":
|
|
@@ -1190,42 +1197,42 @@ const te = /^(\w+:\/\/[^/?]+)?([^?]*)(\?.*)?$/, ee = (t) => t.filter(
|
|
|
1190
1197
|
default:
|
|
1191
1198
|
return;
|
|
1192
1199
|
}
|
|
1193
|
-
},
|
|
1194
|
-
const { getPluginNavigation: t, navigation: e, options: s } = X(), r =
|
|
1195
|
-
(
|
|
1196
|
-
), o = W(e, (
|
|
1197
|
-
if (
|
|
1198
|
-
return
|
|
1199
|
-
}), { data:
|
|
1200
|
+
}, bt = () => {
|
|
1201
|
+
const { getPluginNavigation: t, navigation: e, options: s } = X(), r = q(), n = fe(), i = s.protectedRoutes?.some(
|
|
1202
|
+
(h) => j(h, r.pathname)
|
|
1203
|
+
), o = W(e, (h, f) => {
|
|
1204
|
+
if (Q(h) === r.pathname)
|
|
1205
|
+
return f.at(0) ?? h;
|
|
1206
|
+
}), { data: u } = Yt({
|
|
1200
1207
|
queryFn: () => t(r.pathname),
|
|
1201
1208
|
queryKey: ["plugin-navigation", r.pathname]
|
|
1202
1209
|
});
|
|
1203
|
-
let
|
|
1204
|
-
if (!o &&
|
|
1205
|
-
const
|
|
1206
|
-
|
|
1207
|
-
const
|
|
1208
|
-
return
|
|
1209
|
-
}).sort((
|
|
1210
|
-
(
|
|
1210
|
+
let a = o;
|
|
1211
|
+
if (!o && u.length > 0) {
|
|
1212
|
+
const h = u.flatMap((f) => Q(f)?.split("?").at(0)?.split("#").at(0) ?? []);
|
|
1213
|
+
a = e.flatMap((f) => {
|
|
1214
|
+
const d = Q(f);
|
|
1215
|
+
return d ? [{ item: f, path: d }] : [];
|
|
1216
|
+
}).sort((f, d) => d.path.length - f.path.length).find(({ path: f }) => h.some(
|
|
1217
|
+
(d) => j({ path: f, end: !1 }, d) ?? j({ path: d, end: !1 }, f)
|
|
1211
1218
|
))?.item;
|
|
1212
1219
|
}
|
|
1213
1220
|
return {
|
|
1214
|
-
navigation: n.isAuthEnabled && !n.isAuthenticated && i ? [] : [...o?.type === "category" ? o.items : [], ...
|
|
1215
|
-
topNavItem:
|
|
1221
|
+
navigation: n.isAuthEnabled && !n.isAuthenticated && i ? [] : [...o?.type === "category" ? o.items : [], ...u],
|
|
1222
|
+
topNavItem: a
|
|
1216
1223
|
};
|
|
1217
|
-
},
|
|
1224
|
+
}, at = (t) => {
|
|
1218
1225
|
let e;
|
|
1219
|
-
const s = /* @__PURE__ */ new Set(), r = (
|
|
1220
|
-
const
|
|
1221
|
-
if (!Object.is(
|
|
1222
|
-
const
|
|
1223
|
-
e =
|
|
1226
|
+
const s = /* @__PURE__ */ new Set(), r = (l, h) => {
|
|
1227
|
+
const f = typeof l == "function" ? l(e) : l;
|
|
1228
|
+
if (!Object.is(f, e)) {
|
|
1229
|
+
const d = e;
|
|
1230
|
+
e = h ?? (typeof f != "object" || f === null) ? f : Object.assign({}, e, f), s.forEach((g) => g(e, d));
|
|
1224
1231
|
}
|
|
1225
|
-
}, n = () => e,
|
|
1226
|
-
return
|
|
1227
|
-
},
|
|
1228
|
-
function
|
|
1232
|
+
}, n = () => e, u = { setState: r, getState: n, getInitialState: () => a, subscribe: (l) => (s.add(l), () => s.delete(l)) }, a = e = t(r, n, u);
|
|
1233
|
+
return u;
|
|
1234
|
+
}, ne = (t) => t ? at(t) : at, ie = (t) => t;
|
|
1235
|
+
function ae(t, e = ie) {
|
|
1229
1236
|
const s = tt.useSyncExternalStore(
|
|
1230
1237
|
t.subscribe,
|
|
1231
1238
|
() => e(t.getState()),
|
|
@@ -1233,11 +1240,11 @@ function oe(t, e = ae) {
|
|
|
1233
1240
|
);
|
|
1234
1241
|
return tt.useDebugValue(s), s;
|
|
1235
1242
|
}
|
|
1236
|
-
const
|
|
1237
|
-
const e =
|
|
1243
|
+
const oe = (t) => {
|
|
1244
|
+
const e = ne(t), s = (r) => ae(e, r);
|
|
1238
1245
|
return Object.assign(s, e), s;
|
|
1239
|
-
},
|
|
1240
|
-
function
|
|
1246
|
+
}, ue = (t) => oe;
|
|
1247
|
+
function St(t, e) {
|
|
1241
1248
|
let s;
|
|
1242
1249
|
try {
|
|
1243
1250
|
s = t();
|
|
@@ -1247,8 +1254,8 @@ function wt(t, e) {
|
|
|
1247
1254
|
return {
|
|
1248
1255
|
getItem: (n) => {
|
|
1249
1256
|
var i;
|
|
1250
|
-
const o = (
|
|
1251
|
-
return
|
|
1257
|
+
const o = (a) => a === null ? null : JSON.parse(a, void 0), u = (i = s.getItem(n)) != null ? i : null;
|
|
1258
|
+
return u instanceof Promise ? u.then(o) : o(u);
|
|
1252
1259
|
},
|
|
1253
1260
|
setItem: (n, i) => s.setItem(n, JSON.stringify(i, void 0)),
|
|
1254
1261
|
removeItem: (n) => s.removeItem(n)
|
|
@@ -1275,57 +1282,57 @@ const z = (t) => (e) => {
|
|
|
1275
1282
|
}
|
|
1276
1283
|
};
|
|
1277
1284
|
}
|
|
1278
|
-
},
|
|
1285
|
+
}, ce = (t, e) => (s, r, n) => {
|
|
1279
1286
|
let i = {
|
|
1280
|
-
storage:
|
|
1281
|
-
partialize: (
|
|
1287
|
+
storage: St(() => localStorage),
|
|
1288
|
+
partialize: (c) => c,
|
|
1282
1289
|
version: 0,
|
|
1283
|
-
merge: (
|
|
1290
|
+
merge: (c, m) => ({
|
|
1284
1291
|
...m,
|
|
1285
|
-
...
|
|
1292
|
+
...c
|
|
1286
1293
|
}),
|
|
1287
1294
|
...e
|
|
1288
1295
|
}, o = !1;
|
|
1289
|
-
const
|
|
1290
|
-
let
|
|
1291
|
-
if (!
|
|
1296
|
+
const u = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
|
|
1297
|
+
let l = i.storage;
|
|
1298
|
+
if (!l)
|
|
1292
1299
|
return t(
|
|
1293
|
-
(...
|
|
1300
|
+
(...c) => {
|
|
1294
1301
|
console.warn(
|
|
1295
1302
|
`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`
|
|
1296
|
-
), s(...
|
|
1303
|
+
), s(...c);
|
|
1297
1304
|
},
|
|
1298
1305
|
r,
|
|
1299
1306
|
n
|
|
1300
1307
|
);
|
|
1301
|
-
const
|
|
1302
|
-
const
|
|
1303
|
-
return
|
|
1304
|
-
state:
|
|
1308
|
+
const h = () => {
|
|
1309
|
+
const c = i.partialize({ ...r() });
|
|
1310
|
+
return l.setItem(i.name, {
|
|
1311
|
+
state: c,
|
|
1305
1312
|
version: i.version
|
|
1306
1313
|
});
|
|
1307
|
-
},
|
|
1308
|
-
n.setState = (
|
|
1309
|
-
|
|
1314
|
+
}, f = n.setState;
|
|
1315
|
+
n.setState = (c, m) => {
|
|
1316
|
+
f(c, m), h();
|
|
1310
1317
|
};
|
|
1311
|
-
const
|
|
1312
|
-
(...
|
|
1313
|
-
s(...
|
|
1318
|
+
const d = t(
|
|
1319
|
+
(...c) => {
|
|
1320
|
+
s(...c), h();
|
|
1314
1321
|
},
|
|
1315
1322
|
r,
|
|
1316
1323
|
n
|
|
1317
1324
|
);
|
|
1318
|
-
n.getInitialState = () =>
|
|
1325
|
+
n.getInitialState = () => d;
|
|
1319
1326
|
let g;
|
|
1320
|
-
const
|
|
1321
|
-
var
|
|
1322
|
-
if (!
|
|
1323
|
-
o = !1,
|
|
1327
|
+
const O = () => {
|
|
1328
|
+
var c, m;
|
|
1329
|
+
if (!l) return;
|
|
1330
|
+
o = !1, u.forEach((p) => {
|
|
1324
1331
|
var y;
|
|
1325
|
-
return p((y = r()) != null ? y :
|
|
1332
|
+
return p((y = r()) != null ? y : d);
|
|
1326
1333
|
});
|
|
1327
|
-
const v = ((m = i.onRehydrateStorage) == null ? void 0 : m.call(i, (
|
|
1328
|
-
return z(
|
|
1334
|
+
const v = ((m = i.onRehydrateStorage) == null ? void 0 : m.call(i, (c = r()) != null ? c : d)) || void 0;
|
|
1335
|
+
return z(l.getItem.bind(l))(i.name).then((p) => {
|
|
1329
1336
|
if (p)
|
|
1330
1337
|
if (typeof p.version == "number" && p.version !== i.version) {
|
|
1331
1338
|
if (i.migrate) {
|
|
@@ -1333,7 +1340,7 @@ const z = (t) => (e) => {
|
|
|
1333
1340
|
p.state,
|
|
1334
1341
|
p.version
|
|
1335
1342
|
);
|
|
1336
|
-
return y instanceof Promise ? y.then((
|
|
1343
|
+
return y instanceof Promise ? y.then((C) => [!0, C]) : [!0, y];
|
|
1337
1344
|
}
|
|
1338
1345
|
console.error(
|
|
1339
1346
|
"State loaded from storage couldn't be migrated since no migrate function was provided"
|
|
@@ -1343,47 +1350,47 @@ const z = (t) => (e) => {
|
|
|
1343
1350
|
return [!1, void 0];
|
|
1344
1351
|
}).then((p) => {
|
|
1345
1352
|
var y;
|
|
1346
|
-
const [
|
|
1353
|
+
const [C, P] = p;
|
|
1347
1354
|
if (g = i.merge(
|
|
1348
|
-
|
|
1349
|
-
(y = r()) != null ? y :
|
|
1350
|
-
), s(g, !0),
|
|
1351
|
-
return
|
|
1355
|
+
P,
|
|
1356
|
+
(y = r()) != null ? y : d
|
|
1357
|
+
), s(g, !0), C)
|
|
1358
|
+
return h();
|
|
1352
1359
|
}).then(() => {
|
|
1353
|
-
v?.(g, void 0), g = r(), o = !0,
|
|
1360
|
+
v?.(g, void 0), g = r(), o = !0, a.forEach((p) => p(g));
|
|
1354
1361
|
}).catch((p) => {
|
|
1355
1362
|
v?.(void 0, p);
|
|
1356
1363
|
});
|
|
1357
1364
|
};
|
|
1358
1365
|
return n.persist = {
|
|
1359
|
-
setOptions: (
|
|
1366
|
+
setOptions: (c) => {
|
|
1360
1367
|
i = {
|
|
1361
1368
|
...i,
|
|
1362
|
-
...
|
|
1363
|
-
},
|
|
1369
|
+
...c
|
|
1370
|
+
}, c.storage && (l = c.storage);
|
|
1364
1371
|
},
|
|
1365
1372
|
clearStorage: () => {
|
|
1366
|
-
|
|
1373
|
+
l?.removeItem(i.name);
|
|
1367
1374
|
},
|
|
1368
1375
|
getOptions: () => i,
|
|
1369
|
-
rehydrate: () =>
|
|
1376
|
+
rehydrate: () => O(),
|
|
1370
1377
|
hasHydrated: () => o,
|
|
1371
|
-
onHydrate: (
|
|
1372
|
-
|
|
1378
|
+
onHydrate: (c) => (u.add(c), () => {
|
|
1379
|
+
u.delete(c);
|
|
1373
1380
|
}),
|
|
1374
|
-
onFinishHydration: (
|
|
1375
|
-
|
|
1381
|
+
onFinishHydration: (c) => (a.add(c), () => {
|
|
1382
|
+
a.delete(c);
|
|
1376
1383
|
})
|
|
1377
|
-
}, i.skipHydration ||
|
|
1378
|
-
},
|
|
1384
|
+
}, i.skipHydration || O(), g || d;
|
|
1385
|
+
}, he = ce, le = (t) => {
|
|
1379
1386
|
const e = (s) => {
|
|
1380
1387
|
s.key === t.persist.getOptions().name && s.newValue && t.persist.rehydrate();
|
|
1381
1388
|
};
|
|
1382
1389
|
return window.addEventListener("storage", e), () => {
|
|
1383
1390
|
window.removeEventListener("storage", e);
|
|
1384
1391
|
};
|
|
1385
|
-
},
|
|
1386
|
-
|
|
1392
|
+
}, wt = ue()(
|
|
1393
|
+
he(
|
|
1387
1394
|
(t) => ({
|
|
1388
1395
|
isAuthenticated: !1,
|
|
1389
1396
|
isPending: !0,
|
|
@@ -1418,13 +1425,13 @@ const z = (t) => (e) => {
|
|
|
1418
1425
|
...typeof t == "object" ? t : {}
|
|
1419
1426
|
}),
|
|
1420
1427
|
name: "auth-state",
|
|
1421
|
-
storage:
|
|
1428
|
+
storage: St(() => localStorage)
|
|
1422
1429
|
}
|
|
1423
1430
|
)
|
|
1424
1431
|
);
|
|
1425
|
-
typeof window < "u" &&
|
|
1426
|
-
const
|
|
1427
|
-
const { authentication: t } = X(), e =
|
|
1432
|
+
typeof window < "u" && le(wt);
|
|
1433
|
+
const fe = () => {
|
|
1434
|
+
const { authentication: t } = X(), e = wt(), s = typeof t < "u";
|
|
1428
1435
|
return {
|
|
1429
1436
|
isAuthEnabled: s,
|
|
1430
1437
|
...e,
|
|
@@ -1450,54 +1457,54 @@ const de = () => {
|
|
|
1450
1457
|
};
|
|
1451
1458
|
};
|
|
1452
1459
|
export {
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1460
|
+
Re as A,
|
|
1461
|
+
ut as B,
|
|
1462
|
+
mt as C,
|
|
1456
1463
|
ct as D,
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1464
|
+
x as E,
|
|
1465
|
+
me as F,
|
|
1466
|
+
$ as G,
|
|
1467
|
+
k as H,
|
|
1468
|
+
Ce as I,
|
|
1462
1469
|
Fe as J,
|
|
1463
|
-
|
|
1464
|
-
|
|
1470
|
+
ke as K,
|
|
1471
|
+
bt as L,
|
|
1465
1472
|
Y as M,
|
|
1466
1473
|
Pe as N,
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1474
|
+
kt as O,
|
|
1475
|
+
xe as P,
|
|
1476
|
+
Ee as Q,
|
|
1470
1477
|
Ut as R,
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1478
|
+
V as S,
|
|
1479
|
+
Ae as T,
|
|
1480
|
+
ne as U,
|
|
1481
|
+
ae as V,
|
|
1482
|
+
re as Z,
|
|
1476
1483
|
Te as a,
|
|
1477
|
-
|
|
1478
|
-
|
|
1484
|
+
De as b,
|
|
1485
|
+
Yt as c,
|
|
1479
1486
|
X as d,
|
|
1480
|
-
|
|
1487
|
+
fe as e,
|
|
1481
1488
|
Ie as f,
|
|
1482
|
-
|
|
1489
|
+
yt as g,
|
|
1483
1490
|
L as h,
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1491
|
+
F as i,
|
|
1492
|
+
I as j,
|
|
1493
|
+
Tt as k,
|
|
1494
|
+
Wt as l,
|
|
1495
|
+
we as m,
|
|
1489
1496
|
J as n,
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1497
|
+
ue as o,
|
|
1498
|
+
he as p,
|
|
1499
|
+
St as q,
|
|
1500
|
+
qe as r,
|
|
1494
1501
|
_ as s,
|
|
1495
1502
|
W as t,
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1503
|
+
wt as u,
|
|
1504
|
+
Ft as v,
|
|
1505
|
+
be as w,
|
|
1506
|
+
Se as x,
|
|
1507
|
+
Pt as y,
|
|
1508
|
+
Oe as z
|
|
1502
1509
|
};
|
|
1503
|
-
//# sourceMappingURL=hook-
|
|
1510
|
+
//# sourceMappingURL=hook-CZjW2buS.js.map
|