zudoku 0.35.5 → 0.36.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.
- package/dist/app/entry.server.js +5 -1
- package/dist/app/entry.server.js.map +1 -1
- package/dist/config/validators/common.d.ts +176 -176
- package/dist/config/validators/common.js +8 -6
- package/dist/config/validators/common.js.map +1 -1
- package/dist/config/validators/validate.d.ts +63 -63
- package/dist/lib/authentication/providers/openid.js +11 -7
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/components/AnchorLink.js +3 -2
- package/dist/lib/components/AnchorLink.js.map +1 -1
- package/dist/lib/components/Layout.js +3 -14
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/Zudoku.js +3 -1
- package/dist/lib/components/Zudoku.js.map +1 -1
- package/dist/lib/components/cache.d.ts +7 -0
- package/dist/lib/components/cache.js +7 -0
- package/dist/lib/components/cache.js.map +1 -1
- package/dist/lib/components/context/ViewportAnchorContext.js +3 -6
- package/dist/lib/components/context/ViewportAnchorContext.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +1 -1
- package/dist/lib/components/context/ZudokuContext.js +4 -3
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.js +3 -2
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/core/ZudokuContext.d.ts +8 -6
- package/dist/lib/core/ZudokuContext.js +4 -2
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +3 -3
- package/dist/lib/hooks/useEvent.test.js +1 -1
- package/dist/lib/hooks/useEvent.test.js.map +1 -1
- package/dist/lib/oas/graphql/index.d.ts +16 -4
- package/dist/lib/oas/graphql/index.js +59 -43
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +19 -5
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +2 -2
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +1 -1
- package/dist/lib/plugins/openapi/client/useCreateQuery.js +2 -1
- package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +4 -4
- package/dist/lib/plugins/openapi/graphql/gql.js +3 -3
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +34 -45
- package/dist/lib/plugins/openapi/graphql/graphql.js +20 -30
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/index.d.ts +5 -10
- package/dist/lib/plugins/openapi/index.js +29 -60
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +3 -1
- package/dist/lib/plugins/openapi/util/createSidebarCategory.js +5 -7
- package/dist/lib/plugins/openapi/util/createSidebarCategory.js.map +1 -1
- package/dist/lib/util/traverse.js +2 -2
- package/dist/lib/util/traverse.js.map +1 -1
- package/dist/lib/util/useScrollToAnchor.js +2 -0
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- package/dist/vite/api/schema-codegen.js +19 -4
- package/dist/vite/api/schema-codegen.js.map +1 -1
- package/dist/vite/api/schema-codegen.test.js +61 -0
- package/dist/vite/api/schema-codegen.test.js.map +1 -1
- package/dist/vite/plugin-api.js +3 -11
- package/dist/vite/plugin-api.js.map +1 -1
- package/lib/{AuthenticationPlugin-4ip08maU.js → AuthenticationPlugin-Cr6xjOJD.js} +2 -2
- package/lib/{AuthenticationPlugin-4ip08maU.js.map → AuthenticationPlugin-Cr6xjOJD.js.map} +1 -1
- package/lib/{Markdown-hBN9vkm5.js → Markdown-BlioIqkZ.js} +313 -311
- package/lib/Markdown-BlioIqkZ.js.map +1 -0
- package/lib/{MdxPage-UCWwxhzC.js → MdxPage-7XnN9J9R.js} +3 -3
- package/lib/{MdxPage-UCWwxhzC.js.map → MdxPage-7XnN9J9R.js.map} +1 -1
- package/lib/{OasProvider-CJ8KOnsH.js → OasProvider-BaRRMSsD.js} +3 -3
- package/lib/{OasProvider-CJ8KOnsH.js.map → OasProvider-BaRRMSsD.js.map} +1 -1
- package/lib/{OperationList-C4rpJdcE.js → OperationList-BjL1hzSx.js} +988 -961
- package/lib/OperationList-BjL1hzSx.js.map +1 -0
- package/lib/{SlotletProvider-D-XPr1Wg.js → SlotletProvider-CXb3wQiR.js} +2 -2
- package/lib/{SlotletProvider-D-XPr1Wg.js.map → SlotletProvider-CXb3wQiR.js.map} +1 -1
- package/lib/{circular-v7K6lDDh.js → circular-ByJI6Mci.js} +4887 -4419
- package/lib/circular-ByJI6Mci.js.map +1 -0
- package/lib/{createServer-BEFAOb-x.js → createServer-DjgKDpGV.js} +3887 -4291
- package/lib/createServer-DjgKDpGV.js.map +1 -0
- package/lib/{hook-CfCFKZ-2.js → hook-Bo80UX00.js} +75 -74
- package/lib/hook-Bo80UX00.js.map +1 -0
- package/lib/{index-Dowg8c_k.js → index-D5m8_oyY.js} +612 -650
- package/lib/index-D5m8_oyY.js.map +1 -0
- package/lib/post-processors/traverse.js +2 -2
- package/lib/post-processors/traverse.js.map +1 -1
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-openid.js +283 -282
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +395 -397
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.hooks.js +1 -1
- package/lib/zudoku.plugin-api-catalog.js +2 -2
- package/lib/zudoku.plugin-api-keys.js +2 -2
- package/lib/zudoku.plugin-custom-pages.js +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +4 -5
- package/lib/zudoku.plugin-openapi.js.map +1 -1
- package/lib/zudoku.plugins.js.map +1 -1
- package/package.json +5 -5
- package/src/app/entry.server.tsx +7 -1
- package/src/lib/authentication/providers/openid.tsx +12 -9
- package/src/lib/components/AnchorLink.tsx +4 -2
- package/src/lib/components/Layout.tsx +3 -16
- package/src/lib/components/Zudoku.tsx +5 -1
- package/src/lib/components/cache.ts +8 -0
- package/src/lib/components/context/ViewportAnchorContext.tsx +3 -6
- package/src/lib/components/context/ZudokuContext.ts +5 -4
- package/src/lib/components/navigation/SidebarItem.tsx +3 -2
- package/src/lib/core/ZudokuContext.ts +11 -8
- package/src/lib/core/plugins.ts +4 -4
- package/src/lib/hooks/useEvent.test.tsx +1 -1
- package/src/lib/oas/graphql/index.ts +116 -76
- package/src/lib/plugins/openapi/OperationList.tsx +31 -37
- package/src/lib/plugins/openapi/OperationListItem.tsx +1 -1
- package/src/lib/plugins/openapi/Sidecar.tsx +2 -2
- package/src/lib/plugins/openapi/client/useCreateQuery.ts +2 -1
- package/src/lib/plugins/openapi/graphql/gql.ts +17 -17
- package/src/lib/plugins/openapi/graphql/graphql.ts +62 -79
- package/src/lib/plugins/openapi/index.tsx +40 -84
- package/src/lib/plugins/openapi/interfaces.ts +4 -1
- package/src/lib/plugins/openapi/util/createSidebarCategory.tsx +5 -7
- package/src/lib/util/traverse.ts +2 -2
- package/src/lib/util/useScrollToAnchor.ts +2 -0
- package/lib/Markdown-hBN9vkm5.js.map +0 -1
- package/lib/OperationList-C4rpJdcE.js.map +0 -1
- package/lib/circular-v7K6lDDh.js.map +0 -1
- package/lib/createServer-BEFAOb-x.js.map +0 -1
- package/lib/hook-CfCFKZ-2.js.map +0 -1
- package/lib/index-Dowg8c_k.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { e as
|
|
2
|
-
import
|
|
3
|
-
import { u as b, m as
|
|
1
|
+
import { e as Q, f as q, Q as L, g as F, u as Z, d as K } from "./useQuery-CQUwWR9i.js";
|
|
2
|
+
import A, { createContext as $, useContext as B, useMemo as J } from "react";
|
|
3
|
+
import { u as b, m as C } from "./chunk-HA7DTUK3-ZGg2W6yV.js";
|
|
4
4
|
function M(e, n) {
|
|
5
|
-
return process.env.NODE_ENV !== "production" && e.queryFn ===
|
|
5
|
+
return process.env.NODE_ENV !== "production" && e.queryFn === Q && console.error("skipToken is not allowed for useSuspenseQuery"), q(
|
|
6
6
|
{
|
|
7
7
|
...e,
|
|
8
8
|
enabled: !0,
|
|
@@ -14,19 +14,19 @@ function M(e, n) {
|
|
|
14
14
|
n
|
|
15
15
|
);
|
|
16
16
|
}
|
|
17
|
-
const
|
|
17
|
+
const S = (...e) => {
|
|
18
18
|
const n = e.filter((t) => !!t).map((t) => t.replace(/(^\/+|\/+$)/g, "")).join("/").replace(/(^\/+|\/+$)/g, "");
|
|
19
19
|
return n ? `/${n}` : "/";
|
|
20
20
|
}, N = Object.freeze({
|
|
21
21
|
API_IDENTITIES: ["api-identities"]
|
|
22
|
-
}),
|
|
22
|
+
}), ae = () => {
|
|
23
23
|
const e = Z();
|
|
24
24
|
return {
|
|
25
25
|
invalidateCache: async (n) => {
|
|
26
26
|
await e.invalidateQueries({ queryKey: N[n] });
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
|
-
}, k = (e, n) => {
|
|
29
|
+
}, U = "no-dehydrate", k = (e, n) => {
|
|
30
30
|
for (const t of e) {
|
|
31
31
|
const r = P(t, n);
|
|
32
32
|
if (r !== void 0) return r;
|
|
@@ -42,52 +42,53 @@ const g = (...e) => {
|
|
|
42
42
|
]);
|
|
43
43
|
if (o !== void 0) return o;
|
|
44
44
|
}
|
|
45
|
-
},
|
|
46
|
-
const e = b(), t =
|
|
45
|
+
}, ie = () => {
|
|
46
|
+
const e = b(), t = T().sidebar;
|
|
47
47
|
return k(t, (r) => {
|
|
48
|
-
if (r.type === "doc" &&
|
|
48
|
+
if (r.type === "doc" && S(r.id) === e.pathname)
|
|
49
49
|
return r;
|
|
50
50
|
});
|
|
51
|
-
},
|
|
51
|
+
}, ce = (e) => {
|
|
52
52
|
const n = b();
|
|
53
53
|
return P(e, (t) => {
|
|
54
|
-
if (t.type === "category" && t.link &&
|
|
54
|
+
if (t.type === "category" && t.link && S(t.link.id) === n.pathname || t.type === "doc" && S(t.id) === n.pathname)
|
|
55
55
|
return !0;
|
|
56
56
|
});
|
|
57
|
-
},
|
|
58
|
-
const e = b().pathname, t =
|
|
57
|
+
}, ue = () => {
|
|
58
|
+
const e = b().pathname, t = T().sidebar;
|
|
59
59
|
let r, s, o = !1;
|
|
60
60
|
return k(t, (c) => {
|
|
61
|
-
const i = c.type === "doc" ?
|
|
61
|
+
const i = c.type === "doc" ? S(c.id) : c.type === "category" && c.link ? S(c.link.id) : void 0;
|
|
62
62
|
if (i) {
|
|
63
63
|
if (o)
|
|
64
64
|
return s = { label: c.label, id: i }, !0;
|
|
65
65
|
e === i ? o = !0 : r = { label: c.label, id: i };
|
|
66
66
|
}
|
|
67
67
|
}), { prev: r, next: s };
|
|
68
|
-
},
|
|
68
|
+
}, Y = $(
|
|
69
69
|
void 0
|
|
70
70
|
), O = () => {
|
|
71
|
-
const e = B(
|
|
71
|
+
const e = B(Y);
|
|
72
72
|
if (!e)
|
|
73
73
|
throw new Error("useZudoku must be used within a ZudokuProvider.");
|
|
74
74
|
return e;
|
|
75
|
-
},
|
|
75
|
+
}, de = () => {
|
|
76
76
|
const { getApiIdentities: e } = O();
|
|
77
77
|
return K({
|
|
78
78
|
queryFn: e,
|
|
79
|
-
queryKey:
|
|
79
|
+
queryKey: N.API_IDENTITIES
|
|
80
80
|
});
|
|
81
|
-
},
|
|
81
|
+
}, T = () => {
|
|
82
82
|
var v;
|
|
83
|
-
const { getPluginSidebar: e, sidebars: n, topNavigation: t, options: r } = O(), s = b(), o =
|
|
84
|
-
(d) =>
|
|
83
|
+
const { getPluginSidebar: e, sidebars: n, topNavigation: t, options: r } = O(), s = b(), o = ne(), c = (v = r.protectedRoutes) == null ? void 0 : v.some(
|
|
84
|
+
(d) => C(d, s.pathname)
|
|
85
85
|
), i = Object.entries(n).find(([, d]) => k(d, (l) => {
|
|
86
|
-
if ((l.type === "doc" ?
|
|
86
|
+
if ((l.type === "doc" ? S(l.id) : l.type === "category" && l.link ? S(l.link.id) : void 0) === s.pathname)
|
|
87
87
|
return l;
|
|
88
|
-
})), h = t.find((d) => d.id === (i == null ? void 0 : i[0])) ?? t.find((d) =>
|
|
88
|
+
})), h = t.find((d) => d.id === (i == null ? void 0 : i[0])) ?? t.find((d) => C(d.id, s.pathname)), { data: u } = M({
|
|
89
89
|
queryFn: () => e(s.pathname),
|
|
90
|
-
|
|
90
|
+
// We just want to suspend here and don't store in SSR dehydrated state
|
|
91
|
+
queryKey: ["plugin-sidebar", U, s.pathname]
|
|
91
92
|
});
|
|
92
93
|
return {
|
|
93
94
|
sidebar: o.isAuthEnabled && !o.isAuthenticated && c ? [] : [...i ? i[1] : [], ...u],
|
|
@@ -95,28 +96,28 @@ const g = (...e) => {
|
|
|
95
96
|
};
|
|
96
97
|
}, _ = (e) => {
|
|
97
98
|
let n;
|
|
98
|
-
const t = /* @__PURE__ */ new Set(), r = (u,
|
|
99
|
+
const t = /* @__PURE__ */ new Set(), r = (u, y) => {
|
|
99
100
|
const v = typeof u == "function" ? u(n) : u;
|
|
100
101
|
if (!Object.is(v, n)) {
|
|
101
102
|
const d = n;
|
|
102
|
-
n =
|
|
103
|
+
n = y ?? (typeof v != "object" || v === null) ? v : Object.assign({}, n, v), t.forEach((l) => l(n, d));
|
|
103
104
|
}
|
|
104
105
|
}, s = () => n, i = { setState: r, getState: s, getInitialState: () => h, subscribe: (u) => (t.add(u), () => t.delete(u)) }, h = n = e(r, s, i);
|
|
105
106
|
return i;
|
|
106
|
-
},
|
|
107
|
-
function
|
|
108
|
-
const t =
|
|
107
|
+
}, z = (e) => e ? _(e) : _, G = (e) => e;
|
|
108
|
+
function W(e, n = G) {
|
|
109
|
+
const t = A.useSyncExternalStore(
|
|
109
110
|
e.subscribe,
|
|
110
111
|
() => n(e.getState()),
|
|
111
112
|
() => n(e.getInitialState())
|
|
112
113
|
);
|
|
113
|
-
return
|
|
114
|
+
return A.useDebugValue(t), t;
|
|
114
115
|
}
|
|
115
|
-
const
|
|
116
|
-
const n =
|
|
116
|
+
const X = (e) => {
|
|
117
|
+
const n = z(e), t = (r) => W(n, r);
|
|
117
118
|
return Object.assign(t, n), t;
|
|
118
|
-
},
|
|
119
|
-
function
|
|
119
|
+
}, j = (e) => X;
|
|
120
|
+
function R(e, n) {
|
|
120
121
|
let t;
|
|
121
122
|
try {
|
|
122
123
|
t = e();
|
|
@@ -157,13 +158,13 @@ const E = (e) => (n) => {
|
|
|
157
158
|
}
|
|
158
159
|
};
|
|
159
160
|
}
|
|
160
|
-
},
|
|
161
|
+
}, V = (e, n) => (t, r, s) => {
|
|
161
162
|
let o = {
|
|
162
|
-
storage:
|
|
163
|
+
storage: R(() => localStorage),
|
|
163
164
|
partialize: (a) => a,
|
|
164
165
|
version: 0,
|
|
165
|
-
merge: (a,
|
|
166
|
-
...
|
|
166
|
+
merge: (a, g) => ({
|
|
167
|
+
...g,
|
|
167
168
|
...a
|
|
168
169
|
}),
|
|
169
170
|
...n
|
|
@@ -180,19 +181,19 @@ const E = (e) => (n) => {
|
|
|
180
181
|
r,
|
|
181
182
|
s
|
|
182
183
|
);
|
|
183
|
-
const
|
|
184
|
+
const y = () => {
|
|
184
185
|
const a = o.partialize({ ...r() });
|
|
185
186
|
return u.setItem(o.name, {
|
|
186
187
|
state: a,
|
|
187
188
|
version: o.version
|
|
188
189
|
});
|
|
189
190
|
}, v = s.setState;
|
|
190
|
-
s.setState = (a,
|
|
191
|
-
v(a,
|
|
191
|
+
s.setState = (a, g) => {
|
|
192
|
+
v(a, g), y();
|
|
192
193
|
};
|
|
193
194
|
const d = e(
|
|
194
195
|
(...a) => {
|
|
195
|
-
t(...a),
|
|
196
|
+
t(...a), y();
|
|
196
197
|
},
|
|
197
198
|
r,
|
|
198
199
|
s
|
|
@@ -200,13 +201,13 @@ const E = (e) => (n) => {
|
|
|
200
201
|
s.getInitialState = () => d;
|
|
201
202
|
let l;
|
|
202
203
|
const I = () => {
|
|
203
|
-
var a,
|
|
204
|
+
var a, g;
|
|
204
205
|
if (!u) return;
|
|
205
206
|
c = !1, i.forEach((f) => {
|
|
206
207
|
var p;
|
|
207
208
|
return f((p = r()) != null ? p : d);
|
|
208
209
|
});
|
|
209
|
-
const m = ((
|
|
210
|
+
const m = ((g = o.onRehydrateStorage) == null ? void 0 : g.call(o, (a = r()) != null ? a : d)) || void 0;
|
|
210
211
|
return E(u.getItem.bind(u))(o.name).then((f) => {
|
|
211
212
|
if (f)
|
|
212
213
|
if (typeof f.version == "number" && f.version !== o.version) {
|
|
@@ -225,12 +226,12 @@ const E = (e) => (n) => {
|
|
|
225
226
|
return [!1, void 0];
|
|
226
227
|
}).then((f) => {
|
|
227
228
|
var p;
|
|
228
|
-
const [w,
|
|
229
|
+
const [w, H] = f;
|
|
229
230
|
if (l = o.merge(
|
|
230
|
-
|
|
231
|
+
H,
|
|
231
232
|
(p = r()) != null ? p : d
|
|
232
233
|
), t(l, !0), w)
|
|
233
|
-
return
|
|
234
|
+
return y();
|
|
234
235
|
}).then(() => {
|
|
235
236
|
m == null || m(l, void 0), l = r(), c = !0, h.forEach((f) => f(l));
|
|
236
237
|
}).catch((f) => {
|
|
@@ -257,15 +258,15 @@ const E = (e) => (n) => {
|
|
|
257
258
|
h.delete(a);
|
|
258
259
|
})
|
|
259
260
|
}, o.skipHydration || I(), l || d;
|
|
260
|
-
},
|
|
261
|
+
}, x = V, ee = (e) => {
|
|
261
262
|
const n = (t) => {
|
|
262
263
|
t.key === e.persist.getOptions().name && t.newValue && e.persist.rehydrate();
|
|
263
264
|
};
|
|
264
265
|
return window.addEventListener("storage", n), () => {
|
|
265
266
|
window.removeEventListener("storage", n);
|
|
266
267
|
};
|
|
267
|
-
},
|
|
268
|
-
|
|
268
|
+
}, D = j()(
|
|
269
|
+
x(
|
|
269
270
|
(e) => ({
|
|
270
271
|
isAuthenticated: !1,
|
|
271
272
|
isPending: !0,
|
|
@@ -279,21 +280,21 @@ const E = (e) => (n) => {
|
|
|
279
280
|
...typeof e == "object" ? e : {}
|
|
280
281
|
}),
|
|
281
282
|
name: "auth-state",
|
|
282
|
-
storage:
|
|
283
|
+
storage: R(() => localStorage)
|
|
283
284
|
}
|
|
284
285
|
)
|
|
285
286
|
);
|
|
286
|
-
typeof window < "u" &&
|
|
287
|
-
const
|
|
288
|
-
|
|
287
|
+
typeof window < "u" && ee(D);
|
|
288
|
+
const te = j()(
|
|
289
|
+
x(
|
|
289
290
|
(e) => ({
|
|
290
291
|
selectedServer: void 0,
|
|
291
292
|
setSelectedServer: (n) => e({ selectedServer: n })
|
|
292
293
|
}),
|
|
293
294
|
{ name: "zudoku-selected-server" }
|
|
294
295
|
)
|
|
295
|
-
),
|
|
296
|
-
const { selectedServer: n, setSelectedServer: t } =
|
|
296
|
+
), le = (e) => {
|
|
297
|
+
const { selectedServer: n, setSelectedServer: t } = te();
|
|
297
298
|
return { selectedServer: J(
|
|
298
299
|
() => {
|
|
299
300
|
var s;
|
|
@@ -301,8 +302,8 @@ const ee = T()(
|
|
|
301
302
|
},
|
|
302
303
|
[n, e]
|
|
303
304
|
), setSelectedServer: t };
|
|
304
|
-
},
|
|
305
|
-
const { authentication: e } = O(), n =
|
|
305
|
+
}, ne = () => {
|
|
306
|
+
const { authentication: e } = O(), n = D(), t = typeof e < "u";
|
|
306
307
|
return {
|
|
307
308
|
isAuthEnabled: t,
|
|
308
309
|
...n,
|
|
@@ -329,22 +330,22 @@ const ee = T()(
|
|
|
329
330
|
};
|
|
330
331
|
export {
|
|
331
332
|
N as C,
|
|
332
|
-
|
|
333
|
+
Y as Z,
|
|
333
334
|
O as a,
|
|
334
335
|
M as b,
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
336
|
+
ie as c,
|
|
337
|
+
ue as d,
|
|
338
|
+
ne as e,
|
|
339
|
+
T as f,
|
|
340
|
+
ae as g,
|
|
341
|
+
j as h,
|
|
342
|
+
R as i,
|
|
343
|
+
S as j,
|
|
344
|
+
le as k,
|
|
345
|
+
de as l,
|
|
346
|
+
ce as m,
|
|
347
|
+
x as p,
|
|
347
348
|
k as t,
|
|
348
|
-
|
|
349
|
+
D as u
|
|
349
350
|
};
|
|
350
|
-
//# sourceMappingURL=hook-
|
|
351
|
+
//# sourceMappingURL=hook-Bo80UX00.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook-Bo80UX00.js","sources":["../../../node_modules/.pnpm/@tanstack+react-query@5.66.6_react@19.0.0/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js","../src/lib/util/joinPath.tsx","../src/lib/components/cache.ts","../src/lib/components/navigation/utils.ts","../src/lib/components/context/ZudokuContext.ts","../../../node_modules/.pnpm/zustand@5.0.3_@types+react@19.0.10_react@19.0.0_use-sync-external-store@1.4.0_react@19.0.0_/node_modules/zustand/esm/vanilla.mjs","../../../node_modules/.pnpm/zustand@5.0.3_@types+react@19.0.10_react@19.0.0_use-sync-external-store@1.4.0_react@19.0.0_/node_modules/zustand/esm/react.mjs","../../../node_modules/.pnpm/zustand@5.0.3_@types+react@19.0.10_react@19.0.0_use-sync-external-store@1.4.0_react@19.0.0_/node_modules/zustand/esm/middleware.mjs","../src/lib/authentication/state.ts","../src/lib/authentication/hook.ts"],"sourcesContent":["\"use client\";\n\n// src/useSuspenseQuery.ts\nimport { QueryObserver, skipToken } from \"@tanstack/query-core\";\nimport { useBaseQuery } from \"./useBaseQuery.js\";\nimport { defaultThrowOnError } from \"./suspense.js\";\nfunction useSuspenseQuery(options, queryClient) {\n if (process.env.NODE_ENV !== \"production\") {\n if (options.queryFn === skipToken) {\n console.error(\"skipToken is not allowed for useSuspenseQuery\");\n }\n }\n return useBaseQuery(\n {\n ...options,\n enabled: true,\n suspense: true,\n throwOnError: defaultThrowOnError,\n placeholderData: void 0\n },\n QueryObserver,\n queryClient\n );\n}\nexport {\n useSuspenseQuery\n};\n//# sourceMappingURL=useSuspenseQuery.js.map","export const joinPath = (\n ...parts: Array<string | null | undefined | boolean>\n) => {\n const cleanPath = parts\n .filter((part): part is string => Boolean(part))\n .map((part) => part.replace(/(^\\/+|\\/+$)/g, \"\")) // Strip leading and trailing slashes\n .join(\"/\")\n .replace(/(^\\/+|\\/+$)/g, \"\");\n\n return cleanPath ? `/${cleanPath}` : \"/\";\n};\n","import { useQueryClient } from \"@tanstack/react-query\";\n\nexport const CACHE_KEYS = Object.freeze({\n API_IDENTITIES: [\"api-identities\"],\n});\n\nexport const useCache = () => {\n const queryClient = useQueryClient();\n\n return {\n invalidateCache: async (key: keyof typeof CACHE_KEYS) => {\n await queryClient.invalidateQueries({ queryKey: CACHE_KEYS[key] });\n },\n };\n};\n\n/**\n * If a query has this key in its queryKey, it will not put its result in the dehydrated state in the SSR.\n *\n * This is useful if the query should only be suspended and not included in the initial HTML response.\n * (e.g. too large in size, or not needed for the initial page load)\n */\nexport const NO_DEHYDRATE = \"no-dehydrate\";\n","import { useLocation } from \"react-router\";\nimport type {\n SidebarItem,\n SidebarItemCategory,\n} from \"../../../config/validators/SidebarSchema.js\";\nimport { joinPath } from \"../../util/joinPath.js\";\nimport { useCurrentNavigation } from \"../context/ZudokuContext.js\";\n\nexport type TraverseCallback<T> = (\n item: SidebarItem,\n parentCategories: SidebarItem[],\n) => T | void;\n\nexport const traverseSidebar = <T>(\n sidebar: SidebarItem[],\n callback: TraverseCallback<T>,\n): T | undefined => {\n for (const item of sidebar) {\n const result = traverseSidebarItem(item, callback);\n if (result !== undefined) return result;\n }\n};\n\nexport const traverseSidebarItem = <T>(\n item: SidebarItem,\n callback: TraverseCallback<T>,\n parentCategories: SidebarItem[] = [],\n): T | undefined => {\n const result = callback(item, parentCategories);\n if (result !== undefined) return result;\n\n if (item.type === \"category\") {\n for (const child of item.items) {\n const childResult = traverseSidebarItem(child, callback, [\n ...parentCategories,\n item,\n ]);\n if (childResult !== undefined) return childResult;\n }\n }\n};\n\nexport const useCurrentItem = () => {\n const location = useLocation();\n const nav = useCurrentNavigation();\n\n const currentSidebar = nav.sidebar;\n\n return traverseSidebar(currentSidebar, (item) => {\n if (item.type === \"doc\" && joinPath(item.id) === location.pathname) {\n return item;\n }\n });\n};\n\nexport const useIsCategoryOpen = (category: SidebarItemCategory) => {\n const location = useLocation();\n\n return traverseSidebarItem(category, (item) => {\n if (item.type === \"category\" && item.link) {\n const categoryLinkPath = joinPath(item.link.id);\n if (categoryLinkPath === location.pathname) {\n return true;\n }\n }\n\n if (item.type === \"doc\") {\n const docPath = joinPath(item.id);\n if (docPath === location.pathname) {\n return true;\n }\n }\n });\n};\n\nexport const usePrevNext = (): {\n prev?: { label: string; id: string };\n next?: { label: string; id: string };\n} => {\n const currentId = useLocation().pathname;\n const nav = useCurrentNavigation();\n const currentSidebar = nav.sidebar;\n\n let prev;\n let next;\n\n let foundCurrent = false;\n\n traverseSidebar(currentSidebar, (item) => {\n const itemId =\n item.type === \"doc\"\n ? joinPath(item.id)\n : item.type === \"category\" && item.link\n ? joinPath(item.link.id)\n : undefined;\n\n if (!itemId) return;\n\n if (foundCurrent) {\n next = { label: item.label, id: itemId };\n return true;\n }\n\n if (currentId === itemId) {\n foundCurrent = true;\n } else {\n prev = { label: item.label, id: itemId };\n }\n });\n\n return { prev, next };\n};\n","import { useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport { createContext, useContext } from \"react\";\nimport { matchPath, useLocation } from \"react-router\";\nimport { useAuth } from \"../../authentication/hook.js\";\nimport type { ZudokuContext } from \"../../core/ZudokuContext.js\";\nimport { joinPath } from \"../../util/joinPath.js\";\nimport { CACHE_KEYS, NO_DEHYDRATE } from \"../cache.js\";\nimport { traverseSidebar } from \"../navigation/utils.js\";\n\nexport const ZudokuReactContext = createContext<ZudokuContext | undefined>(\n undefined,\n);\n\nexport const useZudoku = () => {\n const context = useContext(ZudokuReactContext);\n\n if (!context) {\n throw new Error(\"useZudoku must be used within a ZudokuProvider.\");\n }\n\n return context;\n};\n\nexport const useApiIdentities = () => {\n const { getApiIdentities } = useZudoku();\n\n return useQuery({\n queryFn: getApiIdentities,\n queryKey: CACHE_KEYS.API_IDENTITIES,\n });\n};\n\nexport const useCurrentNavigation = () => {\n const { getPluginSidebar, sidebars, topNavigation, options } = useZudoku();\n const location = useLocation();\n const auth = useAuth();\n\n const isProtectedRoute = options.protectedRoutes?.some((route) =>\n matchPath(route, location.pathname),\n );\n\n const currentSidebarItem = Object.entries(sidebars).find(([, sidebar]) => {\n return traverseSidebar(sidebar, (item) => {\n const itemId =\n item.type === \"doc\"\n ? joinPath(item.id)\n : item.type === \"category\" && item.link\n ? joinPath(item.link.id)\n : undefined;\n\n if (itemId === location.pathname) {\n return item;\n }\n });\n });\n const currentTopNavItem =\n topNavigation.find((t) => t.id === currentSidebarItem?.[0]) ??\n topNavigation.find((item) => matchPath(item.id, location.pathname));\n\n const { data } = useSuspenseQuery({\n queryFn: () => getPluginSidebar(location.pathname),\n // We just want to suspend here and don't store in SSR dehydrated state\n queryKey: [\"plugin-sidebar\", NO_DEHYDRATE, location.pathname],\n });\n\n const hideSidebar =\n auth.isAuthEnabled && !auth.isAuthenticated && isProtectedRoute;\n\n return {\n sidebar: hideSidebar\n ? []\n : [...(currentSidebarItem ? currentSidebarItem[1] : []), ...data],\n topNavItem: currentTopNavItem,\n };\n};\n","const createStoreImpl = (createState) => {\n let state;\n const listeners = /* @__PURE__ */ new Set();\n const setState = (partial, replace) => {\n const nextState = typeof partial === \"function\" ? partial(state) : partial;\n if (!Object.is(nextState, state)) {\n const previousState = state;\n state = (replace != null ? replace : typeof nextState !== \"object\" || nextState === null) ? nextState : Object.assign({}, state, nextState);\n listeners.forEach((listener) => listener(state, previousState));\n }\n };\n const getState = () => state;\n const getInitialState = () => initialState;\n const subscribe = (listener) => {\n listeners.add(listener);\n return () => listeners.delete(listener);\n };\n const api = { setState, getState, getInitialState, subscribe };\n const initialState = state = createState(setState, getState, api);\n return api;\n};\nconst createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;\n\nexport { createStore };\n","import React from 'react';\nimport { createStore } from 'zustand/vanilla';\n\nconst identity = (arg) => arg;\nfunction useStore(api, selector = identity) {\n const slice = React.useSyncExternalStore(\n api.subscribe,\n () => selector(api.getState()),\n () => selector(api.getInitialState())\n );\n React.useDebugValue(slice);\n return slice;\n}\nconst createImpl = (createState) => {\n const api = createStore(createState);\n const useBoundStore = (selector) => useStore(api, selector);\n Object.assign(useBoundStore, api);\n return useBoundStore;\n};\nconst create = (createState) => createState ? createImpl(createState) : createImpl;\n\nexport { create, useStore };\n","const reduxImpl = (reducer, initial) => (set, _get, api) => {\n api.dispatch = (action) => {\n set((state) => reducer(state, action), false, action);\n return action;\n };\n api.dispatchFromDevtools = true;\n return { dispatch: (...a) => api.dispatch(...a), ...initial };\n};\nconst redux = reduxImpl;\n\nconst trackedConnections = /* @__PURE__ */ new Map();\nconst getTrackedConnectionState = (name) => {\n const api = trackedConnections.get(name);\n if (!api) return {};\n return Object.fromEntries(\n Object.entries(api.stores).map(([key, api2]) => [key, api2.getState()])\n );\n};\nconst extractConnectionInformation = (store, extensionConnector, options) => {\n if (store === undefined) {\n return {\n type: \"untracked\",\n connection: extensionConnector.connect(options)\n };\n }\n const existingConnection = trackedConnections.get(options.name);\n if (existingConnection) {\n return { type: \"tracked\", store, ...existingConnection };\n }\n const newConnection = {\n connection: extensionConnector.connect(options),\n stores: {}\n };\n trackedConnections.set(options.name, newConnection);\n return { type: \"tracked\", store, ...newConnection };\n};\nconst devtoolsImpl = (fn, devtoolsOptions = {}) => (set, get, api) => {\n const { enabled, anonymousActionType, store, ...options } = devtoolsOptions;\n let extensionConnector;\n try {\n extensionConnector = (enabled != null ? enabled : (import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") && window.__REDUX_DEVTOOLS_EXTENSION__;\n } catch (e) {\n }\n if (!extensionConnector) {\n return fn(set, get, api);\n }\n const { connection, ...connectionInformation } = extractConnectionInformation(store, extensionConnector, options);\n let isRecording = true;\n api.setState = (state, replace, nameOrAction) => {\n const r = set(state, replace);\n if (!isRecording) return r;\n const action = nameOrAction === undefined ? { type: anonymousActionType || \"anonymous\" } : typeof nameOrAction === \"string\" ? { type: nameOrAction } : nameOrAction;\n if (store === undefined) {\n connection == null ? undefined : connection.send(action, get());\n return r;\n }\n connection == null ? undefined : connection.send(\n {\n ...action,\n type: `${store}/${action.type}`\n },\n {\n ...getTrackedConnectionState(options.name),\n [store]: api.getState()\n }\n );\n return r;\n };\n const setStateFromDevtools = (...a) => {\n const originalIsRecording = isRecording;\n isRecording = false;\n set(...a);\n isRecording = originalIsRecording;\n };\n const initialState = fn(api.setState, get, api);\n if (connectionInformation.type === \"untracked\") {\n connection == null ? undefined : connection.init(initialState);\n } else {\n connectionInformation.stores[connectionInformation.store] = api;\n connection == null ? undefined : connection.init(\n Object.fromEntries(\n Object.entries(connectionInformation.stores).map(([key, store2]) => [\n key,\n key === connectionInformation.store ? initialState : store2.getState()\n ])\n )\n );\n }\n if (api.dispatchFromDevtools && typeof api.dispatch === \"function\") {\n let didWarnAboutReservedActionType = false;\n const originalDispatch = api.dispatch;\n api.dispatch = (...a) => {\n if ((import.meta.env ? import.meta.env.MODE : undefined) !== \"production\" && a[0].type === \"__setState\" && !didWarnAboutReservedActionType) {\n console.warn(\n '[zustand devtools middleware] \"__setState\" action type is reserved to set state from the devtools. Avoid using it.'\n );\n didWarnAboutReservedActionType = true;\n }\n originalDispatch(...a);\n };\n }\n connection.subscribe((message) => {\n var _a;\n switch (message.type) {\n case \"ACTION\":\n if (typeof message.payload !== \"string\") {\n console.error(\n \"[zustand devtools middleware] Unsupported action format\"\n );\n return;\n }\n return parseJsonThen(\n message.payload,\n (action) => {\n if (action.type === \"__setState\") {\n if (store === undefined) {\n setStateFromDevtools(action.state);\n return;\n }\n if (Object.keys(action.state).length !== 1) {\n console.error(\n `\n [zustand devtools middleware] Unsupported __setState action format.\n When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),\n and value of this only key should be a state object. Example: { \"type\": \"__setState\", \"state\": { \"abc123Store\": { \"foo\": \"bar\" } } }\n `\n );\n }\n const stateFromDevtools = action.state[store];\n if (stateFromDevtools === undefined || stateFromDevtools === null) {\n return;\n }\n if (JSON.stringify(api.getState()) !== JSON.stringify(stateFromDevtools)) {\n setStateFromDevtools(stateFromDevtools);\n }\n return;\n }\n if (!api.dispatchFromDevtools) return;\n if (typeof api.dispatch !== \"function\") return;\n api.dispatch(action);\n }\n );\n case \"DISPATCH\":\n switch (message.payload.type) {\n case \"RESET\":\n setStateFromDevtools(initialState);\n if (store === undefined) {\n return connection == null ? undefined : connection.init(api.getState());\n }\n return connection == null ? undefined : connection.init(getTrackedConnectionState(options.name));\n case \"COMMIT\":\n if (store === undefined) {\n connection == null ? undefined : connection.init(api.getState());\n return;\n }\n return connection == null ? undefined : connection.init(getTrackedConnectionState(options.name));\n case \"ROLLBACK\":\n return parseJsonThen(message.state, (state) => {\n if (store === undefined) {\n setStateFromDevtools(state);\n connection == null ? undefined : connection.init(api.getState());\n return;\n }\n setStateFromDevtools(state[store]);\n connection == null ? undefined : connection.init(getTrackedConnectionState(options.name));\n });\n case \"JUMP_TO_STATE\":\n case \"JUMP_TO_ACTION\":\n return parseJsonThen(message.state, (state) => {\n if (store === undefined) {\n setStateFromDevtools(state);\n return;\n }\n if (JSON.stringify(api.getState()) !== JSON.stringify(state[store])) {\n setStateFromDevtools(state[store]);\n }\n });\n case \"IMPORT_STATE\": {\n const { nextLiftedState } = message.payload;\n const lastComputedState = (_a = nextLiftedState.computedStates.slice(-1)[0]) == null ? undefined : _a.state;\n if (!lastComputedState) return;\n if (store === undefined) {\n setStateFromDevtools(lastComputedState);\n } else {\n setStateFromDevtools(lastComputedState[store]);\n }\n connection == null ? undefined : connection.send(\n null,\n // FIXME no-any\n nextLiftedState\n );\n return;\n }\n case \"PAUSE_RECORDING\":\n return isRecording = !isRecording;\n }\n return;\n }\n });\n return initialState;\n};\nconst devtools = devtoolsImpl;\nconst parseJsonThen = (stringified, f) => {\n let parsed;\n try {\n parsed = JSON.parse(stringified);\n } catch (e) {\n console.error(\n \"[zustand devtools middleware] Could not parse the received json\",\n e\n );\n }\n if (parsed !== undefined) f(parsed);\n};\n\nconst subscribeWithSelectorImpl = (fn) => (set, get, api) => {\n const origSubscribe = api.subscribe;\n api.subscribe = (selector, optListener, options) => {\n let listener = selector;\n if (optListener) {\n const equalityFn = (options == null ? undefined : options.equalityFn) || Object.is;\n let currentSlice = selector(api.getState());\n listener = (state) => {\n const nextSlice = selector(state);\n if (!equalityFn(currentSlice, nextSlice)) {\n const previousSlice = currentSlice;\n optListener(currentSlice = nextSlice, previousSlice);\n }\n };\n if (options == null ? undefined : options.fireImmediately) {\n optListener(currentSlice, currentSlice);\n }\n }\n return origSubscribe(listener);\n };\n const initialState = fn(set, get, api);\n return initialState;\n};\nconst subscribeWithSelector = subscribeWithSelectorImpl;\n\nconst combine = (initialState, create) => (...a) => Object.assign({}, initialState, create(...a));\n\nfunction createJSONStorage(getStorage, options) {\n let storage;\n try {\n storage = getStorage();\n } catch (e) {\n return;\n }\n const persistStorage = {\n getItem: (name) => {\n var _a;\n const parse = (str2) => {\n if (str2 === null) {\n return null;\n }\n return JSON.parse(str2, options == null ? undefined : options.reviver);\n };\n const str = (_a = storage.getItem(name)) != null ? _a : null;\n if (str instanceof Promise) {\n return str.then(parse);\n }\n return parse(str);\n },\n setItem: (name, newValue) => storage.setItem(\n name,\n JSON.stringify(newValue, options == null ? undefined : options.replacer)\n ),\n removeItem: (name) => storage.removeItem(name)\n };\n return persistStorage;\n}\nconst toThenable = (fn) => (input) => {\n try {\n const result = fn(input);\n if (result instanceof Promise) {\n return result;\n }\n return {\n then(onFulfilled) {\n return toThenable(onFulfilled)(result);\n },\n catch(_onRejected) {\n return this;\n }\n };\n } catch (e) {\n return {\n then(_onFulfilled) {\n return this;\n },\n catch(onRejected) {\n return toThenable(onRejected)(e);\n }\n };\n }\n};\nconst persistImpl = (config, baseOptions) => (set, get, api) => {\n let options = {\n storage: createJSONStorage(() => localStorage),\n partialize: (state) => state,\n version: 0,\n merge: (persistedState, currentState) => ({\n ...currentState,\n ...persistedState\n }),\n ...baseOptions\n };\n let hasHydrated = false;\n const hydrationListeners = /* @__PURE__ */ new Set();\n const finishHydrationListeners = /* @__PURE__ */ new Set();\n let storage = options.storage;\n if (!storage) {\n return config(\n (...args) => {\n console.warn(\n `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.`\n );\n set(...args);\n },\n get,\n api\n );\n }\n const setItem = () => {\n const state = options.partialize({ ...get() });\n return storage.setItem(options.name, {\n state,\n version: options.version\n });\n };\n const savedSetState = api.setState;\n api.setState = (state, replace) => {\n savedSetState(state, replace);\n void setItem();\n };\n const configResult = config(\n (...args) => {\n set(...args);\n void setItem();\n },\n get,\n api\n );\n api.getInitialState = () => configResult;\n let stateFromStorage;\n const hydrate = () => {\n var _a, _b;\n if (!storage) return;\n hasHydrated = false;\n hydrationListeners.forEach((cb) => {\n var _a2;\n return cb((_a2 = get()) != null ? _a2 : configResult);\n });\n const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? undefined : _b.call(options, (_a = get()) != null ? _a : configResult)) || undefined;\n return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => {\n if (deserializedStorageValue) {\n if (typeof deserializedStorageValue.version === \"number\" && deserializedStorageValue.version !== options.version) {\n if (options.migrate) {\n const migration = options.migrate(\n deserializedStorageValue.state,\n deserializedStorageValue.version\n );\n if (migration instanceof Promise) {\n return migration.then((result) => [true, result]);\n }\n return [true, migration];\n }\n console.error(\n `State loaded from storage couldn't be migrated since no migrate function was provided`\n );\n } else {\n return [false, deserializedStorageValue.state];\n }\n }\n return [false, undefined];\n }).then((migrationResult) => {\n var _a2;\n const [migrated, migratedState] = migrationResult;\n stateFromStorage = options.merge(\n migratedState,\n (_a2 = get()) != null ? _a2 : configResult\n );\n set(stateFromStorage, true);\n if (migrated) {\n return setItem();\n }\n }).then(() => {\n postRehydrationCallback == null ? undefined : postRehydrationCallback(stateFromStorage, undefined);\n stateFromStorage = get();\n hasHydrated = true;\n finishHydrationListeners.forEach((cb) => cb(stateFromStorage));\n }).catch((e) => {\n postRehydrationCallback == null ? undefined : postRehydrationCallback(undefined, e);\n });\n };\n api.persist = {\n setOptions: (newOptions) => {\n options = {\n ...options,\n ...newOptions\n };\n if (newOptions.storage) {\n storage = newOptions.storage;\n }\n },\n clearStorage: () => {\n storage == null ? undefined : storage.removeItem(options.name);\n },\n getOptions: () => options,\n rehydrate: () => hydrate(),\n hasHydrated: () => hasHydrated,\n onHydrate: (cb) => {\n hydrationListeners.add(cb);\n return () => {\n hydrationListeners.delete(cb);\n };\n },\n onFinishHydration: (cb) => {\n finishHydrationListeners.add(cb);\n return () => {\n finishHydrationListeners.delete(cb);\n };\n }\n };\n if (!options.skipHydration) {\n hydrate();\n }\n return stateFromStorage || configResult;\n};\nconst persist = persistImpl;\n\nexport { combine, createJSONStorage, devtools, persist, redux, subscribeWithSelector };\n","import { useMemo } from \"react\";\nimport { create, type Mutate, type StoreApi } from \"zustand\";\nimport { createJSONStorage, persist } from \"zustand/middleware\";\n\nexport interface AuthState<ProviderData = unknown> {\n isAuthenticated: boolean;\n isPending: boolean;\n profile: UserProfile | null;\n providerData: ProviderData | null;\n}\n\nexport class Authentication {\n async setLoggedIn(isLoggedIn: boolean) {}\n async setProfile() {}\n async setPersistentProviderData() {}\n}\n\nexport type StoreWithPersist<T> = Mutate<\n StoreApi<T>,\n [[\"zustand/persist\", unknown]]\n>;\n\nexport const withStorageDOMEvents = <T>(store: StoreWithPersist<T>) => {\n const storageEventCallback = (e: StorageEvent) => {\n if (e.key === store.persist.getOptions().name && e.newValue) {\n void store.persist.rehydrate();\n }\n };\n\n window.addEventListener(\"storage\", storageEventCallback);\n\n return () => {\n window.removeEventListener(\"storage\", storageEventCallback);\n };\n};\n\nexport const useAuthState = create<AuthState>()(\n persist(\n (state) => ({\n isAuthenticated: false,\n isPending: true,\n profile: null,\n providerData: null,\n }),\n {\n merge: (persistedState, currentState) => {\n return {\n ...currentState,\n isPending: false,\n ...(typeof persistedState === \"object\" ? persistedState : {}),\n };\n },\n name: \"auth-state\",\n storage: createJSONStorage(() => localStorage),\n },\n ),\n);\n\nif (typeof window !== \"undefined\") {\n withStorageDOMEvents(useAuthState);\n}\n\nexport interface UserProfile {\n sub: string;\n email: string | undefined;\n emailVerified: boolean;\n name: string | undefined;\n pictureUrl: string | undefined;\n [key: string]: string | boolean | undefined;\n}\n\ninterface SelectedServerState {\n selectedServer?: string;\n setSelectedServer: (newServer: string) => void;\n}\n\nexport const useSelectedServerStore = create<SelectedServerState>()(\n persist(\n (set) => ({\n selectedServer: undefined,\n setSelectedServer: (newServer: string) =>\n set({ selectedServer: newServer }),\n }),\n { name: \"zudoku-selected-server\" },\n ),\n);\n\n/**\n * Simple wrapper for `useSelectedServerStore` to fall back to first of the provided servers\n */\nexport const useSelectedServer = (servers: Array<{ url: string }>) => {\n const { selectedServer, setSelectedServer } = useSelectedServerStore();\n\n const finalSelectedServer = useMemo(\n () =>\n selectedServer && servers.some((s) => s.url === selectedServer)\n ? selectedServer\n : (servers.at(0)?.url ?? \"\"),\n [selectedServer, servers],\n );\n\n return { selectedServer: finalSelectedServer, setSelectedServer };\n};\n","import { useZudoku } from \"../components/context/ZudokuContext.js\";\nimport { useAuthState } from \"./state.js\";\n\nexport const useAuth = () => {\n const { authentication } = useZudoku();\n const authState = useAuthState();\n const isAuthEnabled = typeof authentication !== \"undefined\";\n\n return {\n isAuthEnabled,\n ...authState,\n\n login: async () => {\n if (!isAuthEnabled) {\n throw new Error(\"Authentication is not enabled.\");\n }\n // TODO: Should handle errors/state\n await authentication.signIn({\n redirectTo: window.location.href,\n });\n },\n\n logout: async () => {\n if (!isAuthEnabled) {\n throw new Error(\"Authentication is not enabled.\");\n }\n // TODO: Should handle errors/state\n await authentication.signOut();\n\n // Redirect to home\n window.location.href = \"/\";\n },\n\n signup: async () => {\n if (!isAuthEnabled) {\n throw new Error(\"Authentication is not enabled.\");\n }\n await authentication.signUp({\n redirectTo: window.location.href,\n });\n },\n };\n};\n"],"names":["useSuspenseQuery","options","queryClient","skipToken","useBaseQuery","defaultThrowOnError","QueryObserver","joinPath","parts","cleanPath","part","CACHE_KEYS","useCache","useQueryClient","key","NO_DEHYDRATE","traverseSidebar","sidebar","callback","item","result","traverseSidebarItem","parentCategories","child","childResult","useCurrentItem","location","useLocation","currentSidebar","useCurrentNavigation","useIsCategoryOpen","category","usePrevNext","currentId","prev","next","foundCurrent","itemId","ZudokuReactContext","createContext","useZudoku","context","useContext","useApiIdentities","getApiIdentities","useQuery","getPluginSidebar","sidebars","topNavigation","auth","useAuth","isProtectedRoute","_a","route","matchPath","currentSidebarItem","currentTopNavItem","t","data","createStoreImpl","createState","state","listeners","setState","partial","replace","nextState","previousState","listener","getState","api","initialState","createStore","identity","arg","useStore","selector","slice","React","createImpl","useBoundStore","create","createJSONStorage","getStorage","storage","name","parse","str2","str","newValue","toThenable","fn","input","onFulfilled","_onRejected","e","_onFulfilled","onRejected","persistImpl","config","baseOptions","set","get","persistedState","currentState","hasHydrated","hydrationListeners","finishHydrationListeners","args","setItem","savedSetState","configResult","stateFromStorage","hydrate","_b","cb","_a2","postRehydrationCallback","deserializedStorageValue","migration","migrationResult","migrated","migratedState","newOptions","persist","withStorageDOMEvents","store","storageEventCallback","useAuthState","useSelectedServerStore","newServer","useSelectedServer","servers","selectedServer","setSelectedServer","useMemo","s","authentication","authState","isAuthEnabled"],"mappings":";;;AAMA,SAASA,EAAiBC,GAASC,GAAa;AAC9C,SAAI,QAAQ,IAAI,aAAa,gBACvBD,EAAQ,YAAYE,KACtB,QAA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