zudoku 0.56.0 → 0.57.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/dist/app/demo.js +1 -1
  2. package/dist/app/entry.client.js +1 -1
  3. package/dist/app/entry.server.js +1 -1
  4. package/dist/app/main.d.ts +1 -1
  5. package/dist/app/main.js +3 -2
  6. package/dist/app/main.js.map +1 -1
  7. package/dist/app/standalone.js +1 -1
  8. package/dist/config/validators/ProtectedRoutesSchema.d.ts +5 -4
  9. package/dist/config/validators/ProtectedRoutesSchema.js +4 -13
  10. package/dist/config/validators/ProtectedRoutesSchema.js.map +1 -1
  11. package/dist/config/validators/validate.d.ts +1 -13
  12. package/dist/lib/components/MobileTopNavigation.js +2 -2
  13. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  14. package/dist/lib/components/TopNavigation.js +2 -2
  15. package/dist/lib/components/TopNavigation.js.map +1 -1
  16. package/dist/lib/components/index.d.ts +0 -29
  17. package/dist/lib/components/index.js +0 -17
  18. package/dist/lib/components/index.js.map +1 -1
  19. package/dist/lib/components/navigation/NavigationItem.js +2 -2
  20. package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
  21. package/dist/lib/components/navigation/utils.d.ts +1 -1
  22. package/dist/lib/components/navigation/utils.js +1 -1
  23. package/dist/lib/components/navigation/utils.js.map +1 -1
  24. package/dist/lib/core/ZudokuContext.d.ts +2 -1
  25. package/dist/lib/core/ZudokuContext.js +13 -3
  26. package/dist/lib/core/ZudokuContext.js.map +1 -1
  27. package/dist/lib/core/__internal.d.ts +37 -0
  28. package/dist/lib/core/__internal.js +26 -0
  29. package/dist/lib/core/__internal.js.map +1 -0
  30. package/dist/lib/core/router.d.ts +1 -0
  31. package/dist/lib/core/router.js +2 -0
  32. package/dist/lib/core/router.js.map +1 -0
  33. package/dist/vite/mdx/remark-inject-filepath.d.ts +3 -0
  34. package/dist/vite/mdx/remark-inject-filepath.js +6 -0
  35. package/dist/vite/mdx/remark-inject-filepath.js.map +1 -0
  36. package/dist/vite/mdx/remark-link-rewrite.d.ts +2 -0
  37. package/dist/vite/mdx/remark-link-rewrite.js +20 -0
  38. package/dist/vite/mdx/remark-link-rewrite.js.map +1 -0
  39. package/dist/vite/mdx/remark-normalize-image-url.d.ts +2 -0
  40. package/dist/vite/mdx/remark-normalize-image-url.js +12 -0
  41. package/dist/vite/mdx/remark-normalize-image-url.js.map +1 -0
  42. package/dist/vite/{remarkStaticGeneration.d.ts → mdx/remark-static-generation.d.ts} +2 -2
  43. package/dist/vite/{remarkStaticGeneration.js → mdx/remark-static-generation.js} +1 -1
  44. package/dist/vite/mdx/remark-static-generation.js.map +1 -0
  45. package/dist/vite/plugin-mdx.js +6 -23
  46. package/dist/vite/plugin-mdx.js.map +1 -1
  47. package/dist/vite/plugin-navigation.js +33 -34
  48. package/dist/vite/plugin-navigation.js.map +1 -1
  49. package/lib/CategoryHeading-DCpZu3yG.js +17 -0
  50. package/lib/CategoryHeading-DCpZu3yG.js.map +1 -0
  51. package/lib/{Command-CfgGXMfJ.js → Command-CDn17s8X.js} +2 -2
  52. package/lib/{Command-CfgGXMfJ.js.map → Command-CDn17s8X.js.map} +1 -1
  53. package/lib/{Dialog-B7YnrNnG.js → Dialog-BrIjMmUK.js} +3 -3
  54. package/lib/{Dialog-B7YnrNnG.js.map → Dialog-BrIjMmUK.js.map} +1 -1
  55. package/lib/{MdxPage-D49lfheg.js → MdxPage-CsYakgbK.js} +16 -15
  56. package/lib/{MdxPage-D49lfheg.js.map → MdxPage-CsYakgbK.js.map} +1 -1
  57. package/lib/{OAuthErrorPage-COKL9zOi.js → OAuthErrorPage-CW81kc7H.js} +7 -7
  58. package/lib/{OAuthErrorPage-COKL9zOi.js.map → OAuthErrorPage-CW81kc7H.js.map} +1 -1
  59. package/lib/{OasProvider-CCv_-asV.js → OasProvider-DF34c7Tj.js} +3 -3
  60. package/lib/{OasProvider-CCv_-asV.js.map → OasProvider-DF34c7Tj.js.map} +1 -1
  61. package/lib/{OperationList-DkS0B0y1.js → OperationList-BT3T9cyh.js} +17 -16
  62. package/lib/{OperationList-DkS0B0y1.js.map → OperationList-BT3T9cyh.js.map} +1 -1
  63. package/lib/{Pagination-VfR2DCXf.js → Pagination-BvcjSQfr.js} +3 -3
  64. package/lib/{Pagination-VfR2DCXf.js.map → Pagination-BvcjSQfr.js.map} +1 -1
  65. package/lib/RouteGuard-JLH6tCY8.js +56 -0
  66. package/lib/RouteGuard-JLH6tCY8.js.map +1 -0
  67. package/lib/RouterError-DcVonMP1.js +41 -0
  68. package/lib/RouterError-DcVonMP1.js.map +1 -0
  69. package/lib/{SchemaList-B7ezc5Uy.js → SchemaList-BSTuCiI1.js} +15 -14
  70. package/lib/{SchemaList-B7ezc5Uy.js.map → SchemaList-BSTuCiI1.js.map} +1 -1
  71. package/lib/{SchemaView-BuL-ycaR.js → SchemaView-B5oMHFaS.js} +4 -4
  72. package/lib/{SchemaView-BuL-ycaR.js.map → SchemaView-B5oMHFaS.js.map} +1 -1
  73. package/lib/{Select-B9h5k2Pz.js → Select-C3efYI1n.js} +8 -8
  74. package/lib/{Select-B9h5k2Pz.js.map → Select-C3efYI1n.js.map} +1 -1
  75. package/lib/{SignUp-Cn_gZ7UN.js → SignUp-BHw9Ci8d.js} +11 -11
  76. package/lib/{SignUp-Cn_gZ7UN.js.map → SignUp-BHw9Ci8d.js.map} +1 -1
  77. package/lib/{Slot-BFCJzl5J.js → Slot-DOtTvoyj.js} +1678 -1912
  78. package/lib/{Slot-BFCJzl5J.js.map → Slot-DOtTvoyj.js.map} +1 -1
  79. package/lib/{SyntaxHighlight-CSW4eaIJ.js → SyntaxHighlight-GR0eix_L.js} +2 -2
  80. package/lib/{SyntaxHighlight-CSW4eaIJ.js.map → SyntaxHighlight-GR0eix_L.js.map} +1 -1
  81. package/lib/{Toc-B9K7a2FS.js → Toc-BlcGIkXc.js} +2 -2
  82. package/lib/{Toc-B9K7a2FS.js.map → Toc-BlcGIkXc.js.map} +1 -1
  83. package/lib/{ZudokuContext-mDDq1hft.js → ZudokuContext-BuJD7yIX.js} +28 -28
  84. package/lib/{ZudokuContext-mDDq1hft.js.map → ZudokuContext-BuJD7yIX.js.map} +1 -1
  85. package/lib/chunk-QMGIS6GS-DqecZ6nq.js +9204 -0
  86. package/lib/chunk-QMGIS6GS-DqecZ6nq.js.map +1 -0
  87. package/lib/{circular-BMUvC5RK.js → circular-DKJCbMIs.js} +2 -2
  88. package/lib/{circular-BMUvC5RK.js.map → circular-DKJCbMIs.js.map} +1 -1
  89. package/lib/{createServer-I8dX2VSu.js → createServer-DR-J5mEE.js} +4 -4
  90. package/lib/{createServer-I8dX2VSu.js.map → createServer-DR-J5mEE.js.map} +1 -1
  91. package/lib/{errors-D2Qdkul6.js → errors-C1fOoSR8.js} +2 -2
  92. package/lib/{errors-D2Qdkul6.js.map → errors-C1fOoSR8.js.map} +1 -1
  93. package/lib/{hook-CGx8MPrU.js → hook-bv3iuX7X.js} +2 -2
  94. package/lib/{hook-CGx8MPrU.js.map → hook-bv3iuX7X.js.map} +1 -1
  95. package/lib/index-DDHx4NBX.js +1061 -0
  96. package/lib/index-DDHx4NBX.js.map +1 -0
  97. package/lib/{index-DZqSbZzE.js → index-DLcG9mHm.js} +17 -17
  98. package/lib/{index-DZqSbZzE.js.map → index-DLcG9mHm.js.map} +1 -1
  99. package/lib/{index-ChOC1gfC.js → index-HarEI51d.js} +2 -2
  100. package/lib/{index-ChOC1gfC.js.map → index-HarEI51d.js.map} +1 -1
  101. package/lib/{RouteGuard-CSi9-hSR.js → index.esm-BnYHxCYC.js} +226 -281
  102. package/lib/index.esm-BnYHxCYC.js.map +1 -0
  103. package/lib/mutation-Dy_5up8v.js +196 -0
  104. package/lib/mutation-Dy_5up8v.js.map +1 -0
  105. package/lib/ui/Command.js +1 -1
  106. package/lib/ui/SyntaxHighlight.js +2 -2
  107. package/lib/{useExposedProps-DUoV7MCU.js → useExposedProps-BH9aq4MD.js} +32 -32
  108. package/lib/{useExposedProps-DUoV7MCU.js.map → useExposedProps-BH9aq4MD.js.map} +1 -1
  109. package/lib/useLatest-hmRS46UF.js +11 -0
  110. package/lib/useLatest-hmRS46UF.js.map +1 -0
  111. package/lib/zudoku.__internal.js +2965 -0
  112. package/lib/zudoku.__internal.js.map +1 -0
  113. package/lib/zudoku.auth-auth0.js +1 -1
  114. package/lib/zudoku.auth-azureb2c.js +5 -5
  115. package/lib/zudoku.auth-clerk.js +2 -2
  116. package/lib/zudoku.auth-openid.js +5 -5
  117. package/lib/zudoku.auth-supabase.js +2 -2
  118. package/lib/zudoku.components.js +20 -29
  119. package/lib/zudoku.hooks.js +4 -4
  120. package/lib/zudoku.plugin-api-catalog.js +18 -18
  121. package/lib/zudoku.plugin-api-keys.js +27 -26
  122. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  123. package/lib/zudoku.plugin-custom-pages.js +1 -1
  124. package/lib/zudoku.plugin-markdown.js +1 -1
  125. package/lib/zudoku.plugin-openapi.js +4 -4
  126. package/lib/zudoku.plugin-redirect.js +3 -3
  127. package/lib/zudoku.plugin-search-pagefind.js +14 -14
  128. package/lib/zudoku.router.js +123 -0
  129. package/lib/zudoku.router.js.map +1 -0
  130. package/package.json +10 -1
  131. package/src/app/demo.tsx +1 -1
  132. package/src/app/entry.client.tsx +1 -1
  133. package/src/app/entry.server.tsx +1 -1
  134. package/src/app/main.tsx +4 -3
  135. package/src/app/standalone.tsx +1 -1
  136. package/src/lib/components/MobileTopNavigation.tsx +2 -2
  137. package/src/lib/components/TopNavigation.tsx +2 -2
  138. package/src/lib/components/index.ts +0 -20
  139. package/src/lib/components/navigation/NavigationItem.tsx +2 -2
  140. package/src/lib/components/navigation/utils.ts +1 -1
  141. package/src/lib/core/ZudokuContext.ts +22 -5
  142. package/src/lib/core/__internal.tsx +30 -0
  143. package/src/lib/core/router.ts +1 -0
  144. package/dist/vite/remarkStaticGeneration.js.map +0 -1
  145. package/lib/RouteGuard-CSi9-hSR.js.map +0 -1
  146. package/lib/chunk-QMGIS6GS-CdEm9pzB.js +0 -1839
  147. package/lib/chunk-QMGIS6GS-CdEm9pzB.js.map +0 -1
  148. package/lib/index-Cc70HIQT.js +0 -4087
  149. package/lib/index-Cc70HIQT.js.map +0 -1
@@ -1,4087 +0,0 @@
1
- import { B as Rt, a as It, H as Me, R as tn } from "./RouteGuard-CSi9-hSR.js";
2
- import { z as Dt, M as rn, J as nn, u as on } from "./useExposedProps-DUoV7MCU.js";
3
- import { R as sn, S as an, c as we, e as Fe, f as cn, L as qe, O as Mt } from "./chunk-QMGIS6GS-CdEm9pzB.js";
4
- import { a as se, u as un } from "./hook-CGx8MPrU.js";
5
- import { h as ln, E as Ft, a as A, A as dn, i as fn, s as hn, N as Je, j as pn, T as qt, C as mn, H as gn, k as vn, l as yn, m as xn, V as _n, R as bn, M as wn } from "./Slot-BFCJzl5J.js";
6
- import { j as i } from "./jsx-runtime-C5mzlN2N.js";
7
- import { Button as Ut } from "./ui/Button.js";
8
- import { Callout as jn } from "./ui/Callout.js";
9
- import { S as Lt, m as Qt, Q as kn, n as I, o as Xe, p as et, f as L, q as zn, r as $n, v as Pn, w as En, x as tt, y as rt, z as Sn, h as nt, A as ot, B as Zn, D as Tn, e as Bt, E as Kt, i as Cn, c as M, F as Ht, G as Wt, j as te, H as On, b as Nn, N as An, Z as Rn, d as In, C as Dn } from "./ZudokuContext-mDDq1hft.js";
10
- import * as K from "react";
11
- import { createContext as Ue, StrictMode as Vt, useEffect as F, useRef as H, useState as J, useCallback as B, Suspense as Le, Fragment as Mn, memo as Yt, Component as Fn, createElement as st, useMemo as Ee, useContext as qn } from "react";
12
- import * as Un from "react-dom";
13
- import { CircleFadingArrowUpIcon as Ln, LoaderCircleIcon as Qn, ExternalLink as Bn, CircleXIcon as Kn, ChevronRightIcon as Hn, SearchIcon as Wn, SunIcon as Vn, MoonIcon as Yn, MenuIcon as Gn, PanelLeftIcon as Jn } from "lucide-react";
14
- import { C as re } from "./ClientOnly-E7hGysn1.js";
15
- import { c as N } from "./cn-dYga0KKN.js";
16
- import { S as Gt } from "./Spinner-mNLZ6awP.js";
17
- import { isSearchPlugin as Xn, isProfileMenuPlugin as Jt, isNavigationPlugin as it, isAuthenticationPlugin as eo, isEventConsumerPlugin as to, needsInitialization as ro, isApiIdentityPlugin as no, isMdxProviderPlugin as oo, hasHead as so } from "./zudoku.plugins.js";
18
- import { B as Ce } from "./Button-B3o-2Xdf.js";
19
- import { DropdownMenu as io, DropdownMenuTrigger as ao, DropdownMenuContent as co, DropdownMenuLabel as uo, DropdownMenuSeparator as Se, DropdownMenuSub as lo, DropdownMenuSubTrigger as fo, DropdownMenuPortal as ho, DropdownMenuSubContent as po, DropdownMenuItem as mo } from "./ui/DropdownMenu.js";
20
- import { VisuallyHidden as Xt } from "@radix-ui/react-visually-hidden";
21
- import { D as go, a as vo, b as er, c as tr, d as q } from "./Drawer-DJ05s2pH.js";
22
- import { a as yo } from "./index-DI5SPFK9.js";
23
- var xo = class extends Lt {
24
- constructor(e = {}) {
25
- super(), this.config = e, this.#e = /* @__PURE__ */ new Map();
26
- }
27
- #e;
28
- build(e, t, r) {
29
- const n = t.queryKey, o = t.queryHash ?? Qt(n, t);
30
- let s = this.get(o);
31
- return s || (s = new kn({
32
- client: e,
33
- queryKey: n,
34
- queryHash: o,
35
- options: e.defaultQueryOptions(t),
36
- state: r,
37
- defaultOptions: e.getQueryDefaults(n)
38
- }), this.add(s)), s;
39
- }
40
- add(e) {
41
- this.#e.has(e.queryHash) || (this.#e.set(e.queryHash, e), this.notify({
42
- type: "added",
43
- query: e
44
- }));
45
- }
46
- remove(e) {
47
- const t = this.#e.get(e.queryHash);
48
- t && (e.destroy(), t === e && this.#e.delete(e.queryHash), this.notify({ type: "removed", query: e }));
49
- }
50
- clear() {
51
- I.batch(() => {
52
- this.getAll().forEach((e) => {
53
- this.remove(e);
54
- });
55
- });
56
- }
57
- get(e) {
58
- return this.#e.get(e);
59
- }
60
- getAll() {
61
- return [...this.#e.values()];
62
- }
63
- find(e) {
64
- const t = { exact: !0, ...e };
65
- return this.getAll().find(
66
- (r) => Xe(t, r)
67
- );
68
- }
69
- findAll(e = {}) {
70
- const t = this.getAll();
71
- return Object.keys(e).length > 0 ? t.filter((r) => Xe(e, r)) : t;
72
- }
73
- notify(e) {
74
- I.batch(() => {
75
- this.listeners.forEach((t) => {
76
- t(e);
77
- });
78
- });
79
- }
80
- onFocus() {
81
- I.batch(() => {
82
- this.getAll().forEach((e) => {
83
- e.onFocus();
84
- });
85
- });
86
- }
87
- onOnline() {
88
- I.batch(() => {
89
- this.getAll().forEach((e) => {
90
- e.onOnline();
91
- });
92
- });
93
- }
94
- }, _o = class extends Lt {
95
- constructor(e = {}) {
96
- super(), this.config = e, this.#e = /* @__PURE__ */ new Set(), this.#t = /* @__PURE__ */ new Map(), this.#r = 0;
97
- }
98
- #e;
99
- #t;
100
- #r;
101
- build(e, t, r) {
102
- const n = new ln({
103
- mutationCache: this,
104
- mutationId: ++this.#r,
105
- options: e.defaultMutationOptions(t),
106
- state: r
107
- });
108
- return this.add(n), n;
109
- }
110
- add(e) {
111
- this.#e.add(e);
112
- const t = le(e);
113
- if (typeof t == "string") {
114
- const r = this.#t.get(t);
115
- r ? r.push(e) : this.#t.set(t, [e]);
116
- }
117
- this.notify({ type: "added", mutation: e });
118
- }
119
- remove(e) {
120
- if (this.#e.delete(e)) {
121
- const t = le(e);
122
- if (typeof t == "string") {
123
- const r = this.#t.get(t);
124
- if (r)
125
- if (r.length > 1) {
126
- const n = r.indexOf(e);
127
- n !== -1 && r.splice(n, 1);
128
- } else r[0] === e && this.#t.delete(t);
129
- }
130
- }
131
- this.notify({ type: "removed", mutation: e });
132
- }
133
- canRun(e) {
134
- const t = le(e);
135
- if (typeof t == "string") {
136
- const n = this.#t.get(t)?.find(
137
- (o) => o.state.status === "pending"
138
- );
139
- return !n || n === e;
140
- } else
141
- return !0;
142
- }
143
- runNext(e) {
144
- const t = le(e);
145
- return typeof t == "string" ? this.#t.get(t)?.find((n) => n !== e && n.state.isPaused)?.continue() ?? Promise.resolve() : Promise.resolve();
146
- }
147
- clear() {
148
- I.batch(() => {
149
- this.#e.forEach((e) => {
150
- this.notify({ type: "removed", mutation: e });
151
- }), this.#e.clear(), this.#t.clear();
152
- });
153
- }
154
- getAll() {
155
- return Array.from(this.#e);
156
- }
157
- find(e) {
158
- const t = { exact: !0, ...e };
159
- return this.getAll().find(
160
- (r) => et(t, r)
161
- );
162
- }
163
- findAll(e = {}) {
164
- return this.getAll().filter((t) => et(e, t));
165
- }
166
- notify(e) {
167
- I.batch(() => {
168
- this.listeners.forEach((t) => {
169
- t(e);
170
- });
171
- });
172
- }
173
- resumePausedMutations() {
174
- const e = this.getAll().filter((t) => t.state.isPaused);
175
- return I.batch(
176
- () => Promise.all(
177
- e.map((t) => t.continue().catch(L))
178
- )
179
- );
180
- }
181
- };
182
- function le(e) {
183
- return e.options.scope?.id;
184
- }
185
- function at(e) {
186
- return {
187
- onFetch: (t, r) => {
188
- const n = t.options, o = t.fetchOptions?.meta?.fetchMore?.direction, s = t.state.data?.pages || [], a = t.state.data?.pageParams || [];
189
- let c = { pages: [], pageParams: [] }, f = 0;
190
- const l = async () => {
191
- let v = !1;
192
- const m = (g) => {
193
- Object.defineProperty(g, "signal", {
194
- enumerable: !0,
195
- get: () => (t.signal.aborted ? v = !0 : t.signal.addEventListener("abort", () => {
196
- v = !0;
197
- }), t.signal)
198
- });
199
- }, p = zn(t.options, t.fetchOptions), d = async (g, w, E) => {
200
- if (v)
201
- return Promise.reject();
202
- if (w == null && g.pages.length)
203
- return Promise.resolve(g);
204
- const j = (() => {
205
- const k = {
206
- client: t.client,
207
- queryKey: t.queryKey,
208
- pageParam: w,
209
- direction: E ? "backward" : "forward",
210
- meta: t.options.meta
211
- };
212
- return m(k), k;
213
- })(), x = await p(j), { maxPages: b } = t.options, h = E ? $n : Pn;
214
- return {
215
- pages: h(g.pages, x, b),
216
- pageParams: h(g.pageParams, w, b)
217
- };
218
- };
219
- if (o && s.length) {
220
- const g = o === "backward", w = g ? bo : ct, E = {
221
- pages: s,
222
- pageParams: a
223
- }, z = w(n, E);
224
- c = await d(E, z, g);
225
- } else {
226
- const g = e ?? s.length;
227
- do {
228
- const w = f === 0 ? a[0] ?? n.initialPageParam : ct(n, c);
229
- if (f > 0 && w == null)
230
- break;
231
- c = await d(c, w), f++;
232
- } while (f < g);
233
- }
234
- return c;
235
- };
236
- t.options.persister ? t.fetchFn = () => t.options.persister?.(
237
- l,
238
- {
239
- client: t.client,
240
- queryKey: t.queryKey,
241
- meta: t.options.meta,
242
- signal: t.signal
243
- },
244
- r
245
- ) : t.fetchFn = l;
246
- }
247
- };
248
- }
249
- function ct(e, { pages: t, pageParams: r }) {
250
- const n = t.length - 1;
251
- return t.length > 0 ? e.getNextPageParam(
252
- t[n],
253
- t,
254
- r[n],
255
- r
256
- ) : void 0;
257
- }
258
- function bo(e, { pages: t, pageParams: r }) {
259
- return t.length > 0 ? e.getPreviousPageParam?.(t[0], t, r[0], r) : void 0;
260
- }
261
- var wo = class {
262
- #e;
263
- #t;
264
- #r;
265
- #o;
266
- #s;
267
- #n;
268
- #i;
269
- #a;
270
- constructor(e = {}) {
271
- this.#e = e.queryCache || new xo(), this.#t = e.mutationCache || new _o(), this.#r = e.defaultOptions || {}, this.#o = /* @__PURE__ */ new Map(), this.#s = /* @__PURE__ */ new Map(), this.#n = 0;
272
- }
273
- mount() {
274
- this.#n++, this.#n === 1 && (this.#i = En.subscribe(async (e) => {
275
- e && (await this.resumePausedMutations(), this.#e.onFocus());
276
- }), this.#a = tt.subscribe(async (e) => {
277
- e && (await this.resumePausedMutations(), this.#e.onOnline());
278
- }));
279
- }
280
- unmount() {
281
- this.#n--, this.#n === 0 && (this.#i?.(), this.#i = void 0, this.#a?.(), this.#a = void 0);
282
- }
283
- isFetching(e) {
284
- return this.#e.findAll({ ...e, fetchStatus: "fetching" }).length;
285
- }
286
- isMutating(e) {
287
- return this.#t.findAll({ ...e, status: "pending" }).length;
288
- }
289
- /**
290
- * Imperative (non-reactive) way to retrieve data for a QueryKey.
291
- * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.
292
- *
293
- * Hint: Do not use this function inside a component, because it won't receive updates.
294
- * Use `useQuery` to create a `QueryObserver` that subscribes to changes.
295
- */
296
- getQueryData(e) {
297
- const t = this.defaultQueryOptions({ queryKey: e });
298
- return this.#e.get(t.queryHash)?.state.data;
299
- }
300
- ensureQueryData(e) {
301
- const t = this.defaultQueryOptions(e), r = this.#e.build(this, t), n = r.state.data;
302
- return n === void 0 ? this.fetchQuery(e) : (e.revalidateIfStale && r.isStaleByTime(rt(t.staleTime, r)) && this.prefetchQuery(t), Promise.resolve(n));
303
- }
304
- getQueriesData(e) {
305
- return this.#e.findAll(e).map(({ queryKey: t, state: r }) => {
306
- const n = r.data;
307
- return [t, n];
308
- });
309
- }
310
- setQueryData(e, t, r) {
311
- const n = this.defaultQueryOptions({ queryKey: e }), s = this.#e.get(
312
- n.queryHash
313
- )?.state.data, a = Sn(t, s);
314
- if (a !== void 0)
315
- return this.#e.build(this, n).setData(a, { ...r, manual: !0 });
316
- }
317
- setQueriesData(e, t, r) {
318
- return I.batch(
319
- () => this.#e.findAll(e).map(({ queryKey: n }) => [
320
- n,
321
- this.setQueryData(n, t, r)
322
- ])
323
- );
324
- }
325
- getQueryState(e) {
326
- const t = this.defaultQueryOptions({ queryKey: e });
327
- return this.#e.get(
328
- t.queryHash
329
- )?.state;
330
- }
331
- removeQueries(e) {
332
- const t = this.#e;
333
- I.batch(() => {
334
- t.findAll(e).forEach((r) => {
335
- t.remove(r);
336
- });
337
- });
338
- }
339
- resetQueries(e, t) {
340
- const r = this.#e;
341
- return I.batch(() => (r.findAll(e).forEach((n) => {
342
- n.reset();
343
- }), this.refetchQueries(
344
- {
345
- type: "active",
346
- ...e
347
- },
348
- t
349
- )));
350
- }
351
- cancelQueries(e, t = {}) {
352
- const r = { revert: !0, ...t }, n = I.batch(
353
- () => this.#e.findAll(e).map((o) => o.cancel(r))
354
- );
355
- return Promise.all(n).then(L).catch(L);
356
- }
357
- invalidateQueries(e, t = {}) {
358
- return I.batch(() => (this.#e.findAll(e).forEach((r) => {
359
- r.invalidate();
360
- }), e?.refetchType === "none" ? Promise.resolve() : this.refetchQueries(
361
- {
362
- ...e,
363
- type: e?.refetchType ?? e?.type ?? "active"
364
- },
365
- t
366
- )));
367
- }
368
- refetchQueries(e, t = {}) {
369
- const r = {
370
- ...t,
371
- cancelRefetch: t.cancelRefetch ?? !0
372
- }, n = I.batch(
373
- () => this.#e.findAll(e).filter((o) => !o.isDisabled() && !o.isStatic()).map((o) => {
374
- let s = o.fetch(void 0, r);
375
- return r.throwOnError || (s = s.catch(L)), o.state.fetchStatus === "paused" ? Promise.resolve() : s;
376
- })
377
- );
378
- return Promise.all(n).then(L);
379
- }
380
- fetchQuery(e) {
381
- const t = this.defaultQueryOptions(e);
382
- t.retry === void 0 && (t.retry = !1);
383
- const r = this.#e.build(this, t);
384
- return r.isStaleByTime(
385
- rt(t.staleTime, r)
386
- ) ? r.fetch(t) : Promise.resolve(r.state.data);
387
- }
388
- prefetchQuery(e) {
389
- return this.fetchQuery(e).then(L).catch(L);
390
- }
391
- fetchInfiniteQuery(e) {
392
- return e.behavior = at(e.pages), this.fetchQuery(e);
393
- }
394
- prefetchInfiniteQuery(e) {
395
- return this.fetchInfiniteQuery(e).then(L).catch(L);
396
- }
397
- ensureInfiniteQueryData(e) {
398
- return e.behavior = at(e.pages), this.ensureQueryData(e);
399
- }
400
- resumePausedMutations() {
401
- return tt.isOnline() ? this.#t.resumePausedMutations() : Promise.resolve();
402
- }
403
- getQueryCache() {
404
- return this.#e;
405
- }
406
- getMutationCache() {
407
- return this.#t;
408
- }
409
- getDefaultOptions() {
410
- return this.#r;
411
- }
412
- setDefaultOptions(e) {
413
- this.#r = e;
414
- }
415
- setQueryDefaults(e, t) {
416
- this.#o.set(nt(e), {
417
- queryKey: e,
418
- defaultOptions: t
419
- });
420
- }
421
- getQueryDefaults(e) {
422
- const t = [...this.#o.values()], r = {};
423
- return t.forEach((n) => {
424
- ot(e, n.queryKey) && Object.assign(r, n.defaultOptions);
425
- }), r;
426
- }
427
- setMutationDefaults(e, t) {
428
- this.#s.set(nt(e), {
429
- mutationKey: e,
430
- defaultOptions: t
431
- });
432
- }
433
- getMutationDefaults(e) {
434
- const t = [...this.#s.values()], r = {};
435
- return t.forEach((n) => {
436
- ot(e, n.mutationKey) && Object.assign(r, n.defaultOptions);
437
- }), r;
438
- }
439
- defaultQueryOptions(e) {
440
- if (e._defaulted)
441
- return e;
442
- const t = {
443
- ...this.#r.queries,
444
- ...this.getQueryDefaults(e.queryKey),
445
- ...e,
446
- _defaulted: !0
447
- };
448
- return t.queryHash || (t.queryHash = Qt(
449
- t.queryKey,
450
- t
451
- )), t.refetchOnReconnect === void 0 && (t.refetchOnReconnect = t.networkMode !== "always"), t.throwOnError === void 0 && (t.throwOnError = !!t.suspense), !t.networkMode && t.persister && (t.networkMode = "offlineFirst"), t.queryFn === Zn && (t.enabled = !1), t;
452
- }
453
- defaultMutationOptions(e) {
454
- return e?._defaulted ? e : {
455
- ...this.#r.mutations,
456
- ...e?.mutationKey && this.getMutationDefaults(e.mutationKey),
457
- ...e,
458
- _defaulted: !0
459
- };
460
- }
461
- clear() {
462
- this.#e.clear(), this.#t.clear();
463
- }
464
- };
465
- function jo(e) {
466
- return e;
467
- }
468
- function ut(e, t, r) {
469
- if (typeof t != "object" || t === null)
470
- return;
471
- const n = e.getMutationCache(), o = e.getQueryCache(), s = r?.defaultOptions?.deserializeData ?? e.getDefaultOptions().hydrate?.deserializeData ?? jo, a = t.mutations || [], c = t.queries || [];
472
- a.forEach(({ state: f, ...l }) => {
473
- n.build(
474
- e,
475
- {
476
- ...e.getDefaultOptions().hydrate?.mutations,
477
- ...r?.defaultOptions?.mutations,
478
- ...l
479
- },
480
- f
481
- );
482
- }), c.forEach(
483
- ({ queryKey: f, state: l, queryHash: v, meta: m, promise: p, dehydratedAt: d }) => {
484
- const g = p ? Tn(p) : void 0, w = l.data === void 0 ? g?.data : l.data, E = w === void 0 ? w : s(w);
485
- let z = o.get(v);
486
- const j = z?.state.status === "pending", x = z?.state.fetchStatus === "fetching";
487
- if (z) {
488
- const b = g && // We only need this undefined check to handle older dehydration
489
- // payloads that might not have dehydratedAt
490
- d !== void 0 && d > z.state.dataUpdatedAt;
491
- if (l.dataUpdatedAt > z.state.dataUpdatedAt || b) {
492
- const { fetchStatus: h, ...k } = l;
493
- z.setState({
494
- ...k,
495
- data: E
496
- });
497
- }
498
- } else
499
- z = o.build(
500
- e,
501
- {
502
- ...e.getDefaultOptions().hydrate?.queries,
503
- ...r?.defaultOptions?.queries,
504
- queryKey: f,
505
- queryHash: v,
506
- meta: m
507
- },
508
- // Reset fetch status to idle to avoid
509
- // query being stuck in fetching state upon hydration
510
- {
511
- ...l,
512
- data: E,
513
- fetchStatus: "idle",
514
- status: E !== void 0 ? "success" : l.status
515
- }
516
- );
517
- p && !j && !x && // Only hydrate if dehydration is newer than any existing data,
518
- // this is always true for new queries
519
- (d === void 0 || d > z.state.dataUpdatedAt) && z.fetch(void 0, {
520
- // RSC transformed promises are not thenable
521
- initialPromise: Promise.resolve(p).then(s)
522
- });
523
- }
524
- );
525
- }
526
- var ko = ({
527
- children: e,
528
- options: t = {},
529
- state: r,
530
- queryClient: n
531
- }) => {
532
- const o = Bt(n), s = K.useRef(t);
533
- s.current = t;
534
- const a = K.useMemo(() => {
535
- if (r) {
536
- if (typeof r != "object")
537
- return;
538
- const c = o.getQueryCache(), f = r.queries || [], l = [], v = [];
539
- for (const m of f) {
540
- const p = c.get(m.queryHash);
541
- p ? (m.state.dataUpdatedAt > p.state.dataUpdatedAt || m.promise && p.state.status !== "pending" && p.state.fetchStatus !== "fetching" && m.dehydratedAt !== void 0 && m.dehydratedAt > p.state.dataUpdatedAt) && v.push(m) : l.push(m);
542
- }
543
- if (l.length > 0 && ut(o, { queries: l }, s.current), v.length > 0)
544
- return v;
545
- }
546
- }, [o, r]);
547
- return K.useEffect(() => {
548
- a && ut(o, { queries: a }, s.current);
549
- }, [o, a]), e;
550
- };
551
- function zo({ error: e }) {
552
- return /* @__PURE__ */ i.jsx(Ft, { error: e });
553
- }
554
- /**
555
- * react-router v7.6.3
556
- *
557
- * Copyright (c) Remix Software Inc.
558
- *
559
- * This source code is licensed under the MIT license found in the
560
- * LICENSE.md file in the root directory of this source tree.
561
- *
562
- * @license MIT
563
- */
564
- function $o(e) {
565
- return /* @__PURE__ */ K.createElement(sn, { flushSync: Un.flushSync, ...e });
566
- }
567
- const Oe = Ue({ stagger: !1 }), Po = new wo({
568
- defaultOptions: {
569
- queries: {
570
- staleTime: 1e3 * 60 * 5
571
- }
572
- }
573
- }), Eo = ({
574
- router: e,
575
- hydrate: t = !1
576
- }) => /* @__PURE__ */ i.jsx(Vt, { children: /* @__PURE__ */ i.jsx(Kt, { client: Po, children: /* @__PURE__ */ i.jsx(ko, { state: t ? window.DATA : void 0, children: /* @__PURE__ */ i.jsx(Rt, { value: !1, children: /* @__PURE__ */ i.jsx(It, { children: /* @__PURE__ */ i.jsx(Oe.Provider, { value: { stagger: !t }, children: /* @__PURE__ */ i.jsx($o, { router: e }) }) }) }) }) }) }), So = ({
577
- router: e,
578
- context: t,
579
- queryClient: r,
580
- helmetContext: n,
581
- bypassProtection: o = !1
582
- }) => /* @__PURE__ */ i.jsx(Vt, { children: /* @__PURE__ */ i.jsx(Kt, { client: r, children: /* @__PURE__ */ i.jsx(It, { context: n, children: /* @__PURE__ */ i.jsx(Rt, { value: o, children: /* @__PURE__ */ i.jsx(an, { router: e, context: t }) }) }) }) });
583
- function u(e, t, r) {
584
- function n(c, f) {
585
- var l;
586
- Object.defineProperty(c, "_zod", {
587
- value: c._zod ?? {},
588
- enumerable: !1
589
- }), (l = c._zod).traits ?? (l.traits = /* @__PURE__ */ new Set()), c._zod.traits.add(e), t(c, f);
590
- for (const v in a.prototype)
591
- v in c || Object.defineProperty(c, v, { value: a.prototype[v].bind(c) });
592
- c._zod.constr = a, c._zod.def = f;
593
- }
594
- const o = r?.Parent ?? Object;
595
- class s extends o {
596
- }
597
- Object.defineProperty(s, "name", { value: e });
598
- function a(c) {
599
- var f;
600
- const l = r?.Parent ? new s() : this;
601
- n(l, c), (f = l._zod).deferred ?? (f.deferred = []);
602
- for (const v of l._zod.deferred)
603
- v();
604
- return l;
605
- }
606
- return Object.defineProperty(a, "init", { value: n }), Object.defineProperty(a, Symbol.hasInstance, {
607
- value: (c) => r?.Parent && c instanceof r.Parent ? !0 : c?._zod?.traits?.has(e)
608
- }), Object.defineProperty(a, "name", { value: e }), a;
609
- }
610
- class ie extends Error {
611
- constructor() {
612
- super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
613
- }
614
- }
615
- const rr = {};
616
- function W(e) {
617
- return rr;
618
- }
619
- function Zo(e) {
620
- const t = Object.values(e).filter((n) => typeof n == "number");
621
- return Object.entries(e).filter(([n, o]) => t.indexOf(+n) === -1).map(([n, o]) => o);
622
- }
623
- function To(e, t) {
624
- return typeof t == "bigint" ? t.toString() : t;
625
- }
626
- function nr(e) {
627
- return {
628
- get value() {
629
- {
630
- const t = e();
631
- return Object.defineProperty(this, "value", { value: t }), t;
632
- }
633
- }
634
- };
635
- }
636
- function Qe(e) {
637
- return e == null;
638
- }
639
- function Be(e) {
640
- const t = e.startsWith("^") ? 1 : 0, r = e.endsWith("$") ? e.length - 1 : e.length;
641
- return e.slice(t, r);
642
- }
643
- function S(e, t, r) {
644
- Object.defineProperty(e, t, {
645
- get() {
646
- {
647
- const n = r();
648
- return e[t] = n, n;
649
- }
650
- },
651
- set(n) {
652
- Object.defineProperty(e, t, {
653
- value: n
654
- // configurable: true,
655
- });
656
- },
657
- configurable: !0
658
- });
659
- }
660
- function Ke(e, t, r) {
661
- Object.defineProperty(e, t, {
662
- value: r,
663
- writable: !0,
664
- enumerable: !0,
665
- configurable: !0
666
- });
667
- }
668
- function ne(e) {
669
- return JSON.stringify(e);
670
- }
671
- const or = Error.captureStackTrace ? Error.captureStackTrace : (...e) => {
672
- };
673
- function Ne(e) {
674
- return typeof e == "object" && e !== null && !Array.isArray(e);
675
- }
676
- const Co = nr(() => {
677
- if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
678
- return !1;
679
- try {
680
- const e = Function;
681
- return new e(""), !0;
682
- } catch {
683
- return !1;
684
- }
685
- });
686
- function ye(e) {
687
- if (Ne(e) === !1)
688
- return !1;
689
- const t = e.constructor;
690
- if (t === void 0)
691
- return !0;
692
- const r = t.prototype;
693
- return !(Ne(r) === !1 || Object.prototype.hasOwnProperty.call(r, "isPrototypeOf") === !1);
694
- }
695
- const Oo = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
696
- function je(e) {
697
- return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
698
- }
699
- function X(e, t, r) {
700
- const n = new e._zod.constr(t ?? e._zod.def);
701
- return (!t || r?.parent) && (n._zod.parent = e), n;
702
- }
703
- function _(e) {
704
- const t = e;
705
- if (!t)
706
- return {};
707
- if (typeof t == "string")
708
- return { error: () => t };
709
- if (t?.message !== void 0) {
710
- if (t?.error !== void 0)
711
- throw new Error("Cannot specify both `message` and `error` params");
712
- t.error = t.message;
713
- }
714
- return delete t.message, typeof t.error == "string" ? { ...t, error: () => t.error } : t;
715
- }
716
- function No(e) {
717
- return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
718
- }
719
- function Ao(e, t) {
720
- const r = {}, n = e._zod.def;
721
- for (const o in t) {
722
- if (!(o in n.shape))
723
- throw new Error(`Unrecognized key: "${o}"`);
724
- t[o] && (r[o] = n.shape[o]);
725
- }
726
- return X(e, {
727
- ...e._zod.def,
728
- shape: r,
729
- checks: []
730
- });
731
- }
732
- function Ro(e, t) {
733
- const r = { ...e._zod.def.shape }, n = e._zod.def;
734
- for (const o in t) {
735
- if (!(o in n.shape))
736
- throw new Error(`Unrecognized key: "${o}"`);
737
- t[o] && delete r[o];
738
- }
739
- return X(e, {
740
- ...e._zod.def,
741
- shape: r,
742
- checks: []
743
- });
744
- }
745
- function Io(e, t) {
746
- if (!ye(t))
747
- throw new Error("Invalid input to extend: expected a plain object");
748
- const r = {
749
- ...e._zod.def,
750
- get shape() {
751
- const n = { ...e._zod.def.shape, ...t };
752
- return Ke(this, "shape", n), n;
753
- },
754
- checks: []
755
- // delete existing checks
756
- };
757
- return X(e, r);
758
- }
759
- function Do(e, t) {
760
- return X(e, {
761
- ...e._zod.def,
762
- get shape() {
763
- const r = { ...e._zod.def.shape, ...t._zod.def.shape };
764
- return Ke(this, "shape", r), r;
765
- },
766
- catchall: t._zod.def.catchall,
767
- checks: []
768
- // delete existing checks
769
- });
770
- }
771
- function Mo(e, t, r) {
772
- const n = t._zod.def.shape, o = { ...n };
773
- if (r)
774
- for (const s in r) {
775
- if (!(s in n))
776
- throw new Error(`Unrecognized key: "${s}"`);
777
- r[s] && (o[s] = e ? new e({
778
- type: "optional",
779
- innerType: n[s]
780
- }) : n[s]);
781
- }
782
- else
783
- for (const s in n)
784
- o[s] = e ? new e({
785
- type: "optional",
786
- innerType: n[s]
787
- }) : n[s];
788
- return X(t, {
789
- ...t._zod.def,
790
- shape: o,
791
- checks: []
792
- });
793
- }
794
- function Fo(e, t, r) {
795
- const n = t._zod.def.shape, o = { ...n };
796
- if (r)
797
- for (const s in r) {
798
- if (!(s in o))
799
- throw new Error(`Unrecognized key: "${s}"`);
800
- r[s] && (o[s] = new e({
801
- type: "nonoptional",
802
- innerType: n[s]
803
- }));
804
- }
805
- else
806
- for (const s in n)
807
- o[s] = new e({
808
- type: "nonoptional",
809
- innerType: n[s]
810
- });
811
- return X(t, {
812
- ...t._zod.def,
813
- shape: o,
814
- // optional: [],
815
- checks: []
816
- });
817
- }
818
- function oe(e, t = 0) {
819
- for (let r = t; r < e.issues.length; r++)
820
- if (e.issues[r]?.continue !== !0)
821
- return !0;
822
- return !1;
823
- }
824
- function G(e, t) {
825
- return t.map((r) => {
826
- var n;
827
- return (n = r).path ?? (n.path = []), r.path.unshift(e), r;
828
- });
829
- }
830
- function de(e) {
831
- return typeof e == "string" ? e : e?.message;
832
- }
833
- function V(e, t, r) {
834
- const n = { ...e, path: e.path ?? [] };
835
- if (!e.message) {
836
- const o = de(e.inst?._zod.def?.error?.(e)) ?? de(t?.error?.(e)) ?? de(r.customError?.(e)) ?? de(r.localeError?.(e)) ?? "Invalid input";
837
- n.message = o;
838
- }
839
- return delete n.inst, delete n.continue, t?.reportInput || delete n.input, n;
840
- }
841
- function He(e) {
842
- return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
843
- }
844
- function ae(...e) {
845
- const [t, r, n] = e;
846
- return typeof t == "string" ? {
847
- message: t,
848
- code: "custom",
849
- input: r,
850
- inst: n
851
- } : { ...t };
852
- }
853
- const sr = (e, t) => {
854
- e.name = "$ZodError", Object.defineProperty(e, "_zod", {
855
- value: e._zod,
856
- enumerable: !1
857
- }), Object.defineProperty(e, "issues", {
858
- value: t,
859
- enumerable: !1
860
- }), Object.defineProperty(e, "message", {
861
- get() {
862
- return JSON.stringify(t, To, 2);
863
- },
864
- enumerable: !0
865
- // configurable: false,
866
- });
867
- }, ir = u("$ZodError", sr), ar = u("$ZodError", sr, { Parent: Error });
868
- function qo(e, t = (r) => r.message) {
869
- const r = {}, n = [];
870
- for (const o of e.issues)
871
- o.path.length > 0 ? (r[o.path[0]] = r[o.path[0]] || [], r[o.path[0]].push(t(o))) : n.push(t(o));
872
- return { formErrors: n, fieldErrors: r };
873
- }
874
- function Uo(e, t) {
875
- const r = t || function(s) {
876
- return s.message;
877
- }, n = { _errors: [] }, o = (s) => {
878
- for (const a of s.issues)
879
- if (a.code === "invalid_union" && a.errors.length)
880
- a.errors.map((c) => o({ issues: c }));
881
- else if (a.code === "invalid_key")
882
- o({ issues: a.issues });
883
- else if (a.code === "invalid_element")
884
- o({ issues: a.issues });
885
- else if (a.path.length === 0)
886
- n._errors.push(r(a));
887
- else {
888
- let c = n, f = 0;
889
- for (; f < a.path.length; ) {
890
- const l = a.path[f];
891
- f === a.path.length - 1 ? (c[l] = c[l] || { _errors: [] }, c[l]._errors.push(r(a))) : c[l] = c[l] || { _errors: [] }, c = c[l], f++;
892
- }
893
- }
894
- };
895
- return o(e), n;
896
- }
897
- const Lo = (e) => (t, r, n, o) => {
898
- const s = n ? Object.assign(n, { async: !1 }) : { async: !1 }, a = t._zod.run({ value: r, issues: [] }, s);
899
- if (a instanceof Promise)
900
- throw new ie();
901
- if (a.issues.length) {
902
- const c = new (o?.Err ?? e)(a.issues.map((f) => V(f, s, W())));
903
- throw or(c, o?.callee), c;
904
- }
905
- return a.value;
906
- }, Qo = (e) => async (t, r, n, o) => {
907
- const s = n ? Object.assign(n, { async: !0 }) : { async: !0 };
908
- let a = t._zod.run({ value: r, issues: [] }, s);
909
- if (a instanceof Promise && (a = await a), a.issues.length) {
910
- const c = new (o?.Err ?? e)(a.issues.map((f) => V(f, s, W())));
911
- throw or(c, o?.callee), c;
912
- }
913
- return a.value;
914
- }, cr = (e) => (t, r, n) => {
915
- const o = n ? { ...n, async: !1 } : { async: !1 }, s = t._zod.run({ value: r, issues: [] }, o);
916
- if (s instanceof Promise)
917
- throw new ie();
918
- return s.issues.length ? {
919
- success: !1,
920
- error: new (e ?? ir)(s.issues.map((a) => V(a, o, W())))
921
- } : { success: !0, data: s.value };
922
- }, Bo = /* @__PURE__ */ cr(ar), ur = (e) => async (t, r, n) => {
923
- const o = n ? Object.assign(n, { async: !0 }) : { async: !0 };
924
- let s = t._zod.run({ value: r, issues: [] }, o);
925
- return s instanceof Promise && (s = await s), s.issues.length ? {
926
- success: !1,
927
- error: new e(s.issues.map((a) => V(a, o, W())))
928
- } : { success: !0, data: s.value };
929
- }, Ko = /* @__PURE__ */ ur(ar), Ho = /^[cC][^\s-]{8,}$/, Wo = /^[0-9a-z]+$/, Vo = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, Yo = /^[0-9a-vA-V]{20}$/, Go = /^[A-Za-z0-9]{27}$/, Jo = /^[a-zA-Z0-9_-]{21}$/, Xo = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, es = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, lt = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/, ts = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, rs = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
930
- function ns() {
931
- return new RegExp(rs, "u");
932
- }
933
- const os = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ss = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/, is = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, as = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, cs = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, lr = /^[A-Za-z0-9_-]*$/, us = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/, ls = /^\+(?:[0-9]){6,14}[0-9]$/, dr = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", ds = /* @__PURE__ */ new RegExp(`^${dr}$`);
934
- function fr(e) {
935
- const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
936
- return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
937
- }
938
- function fs(e) {
939
- return new RegExp(`^${fr(e)}$`);
940
- }
941
- function hs(e) {
942
- const t = fr({ precision: e.precision }), r = ["Z"];
943
- e.local && r.push(""), e.offset && r.push("([+-]\\d{2}:\\d{2})");
944
- const n = `${t}(?:${r.join("|")})`;
945
- return new RegExp(`^${dr}T(?:${n})$`);
946
- }
947
- const ps = (e) => {
948
- const t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
949
- return new RegExp(`^${t}$`);
950
- }, ms = /^[^A-Z]*$/, gs = /^[^a-z]*$/, U = /* @__PURE__ */ u("$ZodCheck", (e, t) => {
951
- var r;
952
- e._zod ?? (e._zod = {}), e._zod.def = t, (r = e._zod).onattach ?? (r.onattach = []);
953
- }), vs = /* @__PURE__ */ u("$ZodCheckMaxLength", (e, t) => {
954
- U.init(e, t), e._zod.when = (r) => {
955
- const n = r.value;
956
- return !Qe(n) && n.length !== void 0;
957
- }, e._zod.onattach.push((r) => {
958
- const n = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
959
- t.maximum < n && (r._zod.bag.maximum = t.maximum);
960
- }), e._zod.check = (r) => {
961
- const n = r.value;
962
- if (n.length <= t.maximum)
963
- return;
964
- const s = He(n);
965
- r.issues.push({
966
- origin: s,
967
- code: "too_big",
968
- maximum: t.maximum,
969
- inclusive: !0,
970
- input: n,
971
- inst: e,
972
- continue: !t.abort
973
- });
974
- };
975
- }), ys = /* @__PURE__ */ u("$ZodCheckMinLength", (e, t) => {
976
- U.init(e, t), e._zod.when = (r) => {
977
- const n = r.value;
978
- return !Qe(n) && n.length !== void 0;
979
- }, e._zod.onattach.push((r) => {
980
- const n = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
981
- t.minimum > n && (r._zod.bag.minimum = t.minimum);
982
- }), e._zod.check = (r) => {
983
- const n = r.value;
984
- if (n.length >= t.minimum)
985
- return;
986
- const s = He(n);
987
- r.issues.push({
988
- origin: s,
989
- code: "too_small",
990
- minimum: t.minimum,
991
- inclusive: !0,
992
- input: n,
993
- inst: e,
994
- continue: !t.abort
995
- });
996
- };
997
- }), xs = /* @__PURE__ */ u("$ZodCheckLengthEquals", (e, t) => {
998
- U.init(e, t), e._zod.when = (r) => {
999
- const n = r.value;
1000
- return !Qe(n) && n.length !== void 0;
1001
- }, e._zod.onattach.push((r) => {
1002
- const n = r._zod.bag;
1003
- n.minimum = t.length, n.maximum = t.length, n.length = t.length;
1004
- }), e._zod.check = (r) => {
1005
- const n = r.value, o = n.length;
1006
- if (o === t.length)
1007
- return;
1008
- const s = He(n), a = o > t.length;
1009
- r.issues.push({
1010
- origin: s,
1011
- ...a ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
1012
- inclusive: !0,
1013
- exact: !0,
1014
- input: r.value,
1015
- inst: e,
1016
- continue: !t.abort
1017
- });
1018
- };
1019
- }), ke = /* @__PURE__ */ u("$ZodCheckStringFormat", (e, t) => {
1020
- var r, n;
1021
- U.init(e, t), e._zod.onattach.push((o) => {
1022
- const s = o._zod.bag;
1023
- s.format = t.format, t.pattern && (s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(t.pattern));
1024
- }), t.pattern ? (r = e._zod).check ?? (r.check = (o) => {
1025
- t.pattern.lastIndex = 0, !t.pattern.test(o.value) && o.issues.push({
1026
- origin: "string",
1027
- code: "invalid_format",
1028
- format: t.format,
1029
- input: o.value,
1030
- ...t.pattern ? { pattern: t.pattern.toString() } : {},
1031
- inst: e,
1032
- continue: !t.abort
1033
- });
1034
- }) : (n = e._zod).check ?? (n.check = () => {
1035
- });
1036
- }), _s = /* @__PURE__ */ u("$ZodCheckRegex", (e, t) => {
1037
- ke.init(e, t), e._zod.check = (r) => {
1038
- t.pattern.lastIndex = 0, !t.pattern.test(r.value) && r.issues.push({
1039
- origin: "string",
1040
- code: "invalid_format",
1041
- format: "regex",
1042
- input: r.value,
1043
- pattern: t.pattern.toString(),
1044
- inst: e,
1045
- continue: !t.abort
1046
- });
1047
- };
1048
- }), bs = /* @__PURE__ */ u("$ZodCheckLowerCase", (e, t) => {
1049
- t.pattern ?? (t.pattern = ms), ke.init(e, t);
1050
- }), ws = /* @__PURE__ */ u("$ZodCheckUpperCase", (e, t) => {
1051
- t.pattern ?? (t.pattern = gs), ke.init(e, t);
1052
- }), js = /* @__PURE__ */ u("$ZodCheckIncludes", (e, t) => {
1053
- U.init(e, t);
1054
- const r = je(t.includes), n = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${r}` : r);
1055
- t.pattern = n, e._zod.onattach.push((o) => {
1056
- const s = o._zod.bag;
1057
- s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(n);
1058
- }), e._zod.check = (o) => {
1059
- o.value.includes(t.includes, t.position) || o.issues.push({
1060
- origin: "string",
1061
- code: "invalid_format",
1062
- format: "includes",
1063
- includes: t.includes,
1064
- input: o.value,
1065
- inst: e,
1066
- continue: !t.abort
1067
- });
1068
- };
1069
- }), ks = /* @__PURE__ */ u("$ZodCheckStartsWith", (e, t) => {
1070
- U.init(e, t);
1071
- const r = new RegExp(`^${je(t.prefix)}.*`);
1072
- t.pattern ?? (t.pattern = r), e._zod.onattach.push((n) => {
1073
- const o = n._zod.bag;
1074
- o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(r);
1075
- }), e._zod.check = (n) => {
1076
- n.value.startsWith(t.prefix) || n.issues.push({
1077
- origin: "string",
1078
- code: "invalid_format",
1079
- format: "starts_with",
1080
- prefix: t.prefix,
1081
- input: n.value,
1082
- inst: e,
1083
- continue: !t.abort
1084
- });
1085
- };
1086
- }), zs = /* @__PURE__ */ u("$ZodCheckEndsWith", (e, t) => {
1087
- U.init(e, t);
1088
- const r = new RegExp(`.*${je(t.suffix)}$`);
1089
- t.pattern ?? (t.pattern = r), e._zod.onattach.push((n) => {
1090
- const o = n._zod.bag;
1091
- o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(r);
1092
- }), e._zod.check = (n) => {
1093
- n.value.endsWith(t.suffix) || n.issues.push({
1094
- origin: "string",
1095
- code: "invalid_format",
1096
- format: "ends_with",
1097
- suffix: t.suffix,
1098
- input: n.value,
1099
- inst: e,
1100
- continue: !t.abort
1101
- });
1102
- };
1103
- }), $s = /* @__PURE__ */ u("$ZodCheckOverwrite", (e, t) => {
1104
- U.init(e, t), e._zod.check = (r) => {
1105
- r.value = t.tx(r.value);
1106
- };
1107
- });
1108
- class Ps {
1109
- constructor(t = []) {
1110
- this.content = [], this.indent = 0, this && (this.args = t);
1111
- }
1112
- indented(t) {
1113
- this.indent += 1, t(this), this.indent -= 1;
1114
- }
1115
- write(t) {
1116
- if (typeof t == "function") {
1117
- t(this, { execution: "sync" }), t(this, { execution: "async" });
1118
- return;
1119
- }
1120
- const n = t.split(`
1121
- `).filter((a) => a), o = Math.min(...n.map((a) => a.length - a.trimStart().length)), s = n.map((a) => a.slice(o)).map((a) => " ".repeat(this.indent * 2) + a);
1122
- for (const a of s)
1123
- this.content.push(a);
1124
- }
1125
- compile() {
1126
- const t = Function, r = this?.args, o = [...(this?.content ?? [""]).map((s) => ` ${s}`)];
1127
- return new t(...r, o.join(`
1128
- `));
1129
- }
1130
- }
1131
- const Es = {
1132
- major: 4,
1133
- minor: 0,
1134
- patch: 0
1135
- }, C = /* @__PURE__ */ u("$ZodType", (e, t) => {
1136
- var r;
1137
- e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Es;
1138
- const n = [...e._zod.def.checks ?? []];
1139
- e._zod.traits.has("$ZodCheck") && n.unshift(e);
1140
- for (const o of n)
1141
- for (const s of o._zod.onattach)
1142
- s(e);
1143
- if (n.length === 0)
1144
- (r = e._zod).deferred ?? (r.deferred = []), e._zod.deferred?.push(() => {
1145
- e._zod.run = e._zod.parse;
1146
- });
1147
- else {
1148
- const o = (s, a, c) => {
1149
- let f = oe(s), l;
1150
- for (const v of a) {
1151
- if (v._zod.when) {
1152
- if (!v._zod.when(s))
1153
- continue;
1154
- } else if (f)
1155
- continue;
1156
- const m = s.issues.length, p = v._zod.check(s);
1157
- if (p instanceof Promise && c?.async === !1)
1158
- throw new ie();
1159
- if (l || p instanceof Promise)
1160
- l = (l ?? Promise.resolve()).then(async () => {
1161
- await p, s.issues.length !== m && (f || (f = oe(s, m)));
1162
- });
1163
- else {
1164
- if (s.issues.length === m)
1165
- continue;
1166
- f || (f = oe(s, m));
1167
- }
1168
- }
1169
- return l ? l.then(() => s) : s;
1170
- };
1171
- e._zod.run = (s, a) => {
1172
- const c = e._zod.parse(s, a);
1173
- if (c instanceof Promise) {
1174
- if (a.async === !1)
1175
- throw new ie();
1176
- return c.then((f) => o(f, n, a));
1177
- }
1178
- return o(c, n, a);
1179
- };
1180
- }
1181
- e["~standard"] = {
1182
- validate: (o) => {
1183
- try {
1184
- const s = Bo(e, o);
1185
- return s.success ? { value: s.data } : { issues: s.error?.issues };
1186
- } catch {
1187
- return Ko(e, o).then((a) => a.success ? { value: a.data } : { issues: a.error?.issues });
1188
- }
1189
- },
1190
- vendor: "zod",
1191
- version: 1
1192
- };
1193
- }), We = /* @__PURE__ */ u("$ZodString", (e, t) => {
1194
- C.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? ps(e._zod.bag), e._zod.parse = (r, n) => {
1195
- if (t.coerce)
1196
- try {
1197
- r.value = String(r.value);
1198
- } catch {
1199
- }
1200
- return typeof r.value == "string" || r.issues.push({
1201
- expected: "string",
1202
- code: "invalid_type",
1203
- input: r.value,
1204
- inst: e
1205
- }), r;
1206
- };
1207
- }), Z = /* @__PURE__ */ u("$ZodStringFormat", (e, t) => {
1208
- ke.init(e, t), We.init(e, t);
1209
- }), Ss = /* @__PURE__ */ u("$ZodGUID", (e, t) => {
1210
- t.pattern ?? (t.pattern = es), Z.init(e, t);
1211
- }), Zs = /* @__PURE__ */ u("$ZodUUID", (e, t) => {
1212
- if (t.version) {
1213
- const n = {
1214
- v1: 1,
1215
- v2: 2,
1216
- v3: 3,
1217
- v4: 4,
1218
- v5: 5,
1219
- v6: 6,
1220
- v7: 7,
1221
- v8: 8
1222
- }[t.version];
1223
- if (n === void 0)
1224
- throw new Error(`Invalid UUID version: "${t.version}"`);
1225
- t.pattern ?? (t.pattern = lt(n));
1226
- } else
1227
- t.pattern ?? (t.pattern = lt());
1228
- Z.init(e, t);
1229
- }), Ts = /* @__PURE__ */ u("$ZodEmail", (e, t) => {
1230
- t.pattern ?? (t.pattern = ts), Z.init(e, t);
1231
- }), Cs = /* @__PURE__ */ u("$ZodURL", (e, t) => {
1232
- Z.init(e, t), e._zod.check = (r) => {
1233
- try {
1234
- const n = r.value, o = new URL(n), s = o.href;
1235
- t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(o.hostname) || r.issues.push({
1236
- code: "invalid_format",
1237
- format: "url",
1238
- note: "Invalid hostname",
1239
- pattern: us.source,
1240
- input: r.value,
1241
- inst: e,
1242
- continue: !t.abort
1243
- })), t.protocol && (t.protocol.lastIndex = 0, t.protocol.test(o.protocol.endsWith(":") ? o.protocol.slice(0, -1) : o.protocol) || r.issues.push({
1244
- code: "invalid_format",
1245
- format: "url",
1246
- note: "Invalid protocol",
1247
- pattern: t.protocol.source,
1248
- input: r.value,
1249
- inst: e,
1250
- continue: !t.abort
1251
- })), !n.endsWith("/") && s.endsWith("/") ? r.value = s.slice(0, -1) : r.value = s;
1252
- return;
1253
- } catch {
1254
- r.issues.push({
1255
- code: "invalid_format",
1256
- format: "url",
1257
- input: r.value,
1258
- inst: e,
1259
- continue: !t.abort
1260
- });
1261
- }
1262
- };
1263
- }), Os = /* @__PURE__ */ u("$ZodEmoji", (e, t) => {
1264
- t.pattern ?? (t.pattern = ns()), Z.init(e, t);
1265
- }), Ns = /* @__PURE__ */ u("$ZodNanoID", (e, t) => {
1266
- t.pattern ?? (t.pattern = Jo), Z.init(e, t);
1267
- }), As = /* @__PURE__ */ u("$ZodCUID", (e, t) => {
1268
- t.pattern ?? (t.pattern = Ho), Z.init(e, t);
1269
- }), Rs = /* @__PURE__ */ u("$ZodCUID2", (e, t) => {
1270
- t.pattern ?? (t.pattern = Wo), Z.init(e, t);
1271
- }), Is = /* @__PURE__ */ u("$ZodULID", (e, t) => {
1272
- t.pattern ?? (t.pattern = Vo), Z.init(e, t);
1273
- }), Ds = /* @__PURE__ */ u("$ZodXID", (e, t) => {
1274
- t.pattern ?? (t.pattern = Yo), Z.init(e, t);
1275
- }), Ms = /* @__PURE__ */ u("$ZodKSUID", (e, t) => {
1276
- t.pattern ?? (t.pattern = Go), Z.init(e, t);
1277
- }), Fs = /* @__PURE__ */ u("$ZodISODateTime", (e, t) => {
1278
- t.pattern ?? (t.pattern = hs(t)), Z.init(e, t);
1279
- }), qs = /* @__PURE__ */ u("$ZodISODate", (e, t) => {
1280
- t.pattern ?? (t.pattern = ds), Z.init(e, t);
1281
- }), Us = /* @__PURE__ */ u("$ZodISOTime", (e, t) => {
1282
- t.pattern ?? (t.pattern = fs(t)), Z.init(e, t);
1283
- }), Ls = /* @__PURE__ */ u("$ZodISODuration", (e, t) => {
1284
- t.pattern ?? (t.pattern = Xo), Z.init(e, t);
1285
- }), Qs = /* @__PURE__ */ u("$ZodIPv4", (e, t) => {
1286
- t.pattern ?? (t.pattern = os), Z.init(e, t), e._zod.onattach.push((r) => {
1287
- const n = r._zod.bag;
1288
- n.format = "ipv4";
1289
- });
1290
- }), Bs = /* @__PURE__ */ u("$ZodIPv6", (e, t) => {
1291
- t.pattern ?? (t.pattern = ss), Z.init(e, t), e._zod.onattach.push((r) => {
1292
- const n = r._zod.bag;
1293
- n.format = "ipv6";
1294
- }), e._zod.check = (r) => {
1295
- try {
1296
- new URL(`http://[${r.value}]`);
1297
- } catch {
1298
- r.issues.push({
1299
- code: "invalid_format",
1300
- format: "ipv6",
1301
- input: r.value,
1302
- inst: e,
1303
- continue: !t.abort
1304
- });
1305
- }
1306
- };
1307
- }), Ks = /* @__PURE__ */ u("$ZodCIDRv4", (e, t) => {
1308
- t.pattern ?? (t.pattern = is), Z.init(e, t);
1309
- }), Hs = /* @__PURE__ */ u("$ZodCIDRv6", (e, t) => {
1310
- t.pattern ?? (t.pattern = as), Z.init(e, t), e._zod.check = (r) => {
1311
- const [n, o] = r.value.split("/");
1312
- try {
1313
- if (!o)
1314
- throw new Error();
1315
- const s = Number(o);
1316
- if (`${s}` !== o)
1317
- throw new Error();
1318
- if (s < 0 || s > 128)
1319
- throw new Error();
1320
- new URL(`http://[${n}]`);
1321
- } catch {
1322
- r.issues.push({
1323
- code: "invalid_format",
1324
- format: "cidrv6",
1325
- input: r.value,
1326
- inst: e,
1327
- continue: !t.abort
1328
- });
1329
- }
1330
- };
1331
- });
1332
- function hr(e) {
1333
- if (e === "")
1334
- return !0;
1335
- if (e.length % 4 !== 0)
1336
- return !1;
1337
- try {
1338
- return atob(e), !0;
1339
- } catch {
1340
- return !1;
1341
- }
1342
- }
1343
- const Ws = /* @__PURE__ */ u("$ZodBase64", (e, t) => {
1344
- t.pattern ?? (t.pattern = cs), Z.init(e, t), e._zod.onattach.push((r) => {
1345
- r._zod.bag.contentEncoding = "base64";
1346
- }), e._zod.check = (r) => {
1347
- hr(r.value) || r.issues.push({
1348
- code: "invalid_format",
1349
- format: "base64",
1350
- input: r.value,
1351
- inst: e,
1352
- continue: !t.abort
1353
- });
1354
- };
1355
- });
1356
- function Vs(e) {
1357
- if (!lr.test(e))
1358
- return !1;
1359
- const t = e.replace(/[-_]/g, (n) => n === "-" ? "+" : "/"), r = t.padEnd(Math.ceil(t.length / 4) * 4, "=");
1360
- return hr(r);
1361
- }
1362
- const Ys = /* @__PURE__ */ u("$ZodBase64URL", (e, t) => {
1363
- t.pattern ?? (t.pattern = lr), Z.init(e, t), e._zod.onattach.push((r) => {
1364
- r._zod.bag.contentEncoding = "base64url";
1365
- }), e._zod.check = (r) => {
1366
- Vs(r.value) || r.issues.push({
1367
- code: "invalid_format",
1368
- format: "base64url",
1369
- input: r.value,
1370
- inst: e,
1371
- continue: !t.abort
1372
- });
1373
- };
1374
- }), Gs = /* @__PURE__ */ u("$ZodE164", (e, t) => {
1375
- t.pattern ?? (t.pattern = ls), Z.init(e, t);
1376
- });
1377
- function Js(e, t = null) {
1378
- try {
1379
- const r = e.split(".");
1380
- if (r.length !== 3)
1381
- return !1;
1382
- const [n] = r;
1383
- if (!n)
1384
- return !1;
1385
- const o = JSON.parse(atob(n));
1386
- return !("typ" in o && o?.typ !== "JWT" || !o.alg || t && (!("alg" in o) || o.alg !== t));
1387
- } catch {
1388
- return !1;
1389
- }
1390
- }
1391
- const Xs = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
1392
- Z.init(e, t), e._zod.check = (r) => {
1393
- Js(r.value, t.alg) || r.issues.push({
1394
- code: "invalid_format",
1395
- format: "jwt",
1396
- input: r.value,
1397
- inst: e,
1398
- continue: !t.abort
1399
- });
1400
- };
1401
- }), ei = /* @__PURE__ */ u("$ZodUnknown", (e, t) => {
1402
- C.init(e, t), e._zod.parse = (r) => r;
1403
- }), ti = /* @__PURE__ */ u("$ZodNever", (e, t) => {
1404
- C.init(e, t), e._zod.parse = (r, n) => (r.issues.push({
1405
- expected: "never",
1406
- code: "invalid_type",
1407
- input: r.value,
1408
- inst: e
1409
- }), r);
1410
- });
1411
- function dt(e, t, r) {
1412
- e.issues.length && t.issues.push(...G(r, e.issues)), t.value[r] = e.value;
1413
- }
1414
- const ri = /* @__PURE__ */ u("$ZodArray", (e, t) => {
1415
- C.init(e, t), e._zod.parse = (r, n) => {
1416
- const o = r.value;
1417
- if (!Array.isArray(o))
1418
- return r.issues.push({
1419
- expected: "array",
1420
- code: "invalid_type",
1421
- input: o,
1422
- inst: e
1423
- }), r;
1424
- r.value = Array(o.length);
1425
- const s = [];
1426
- for (let a = 0; a < o.length; a++) {
1427
- const c = o[a], f = t.element._zod.run({
1428
- value: c,
1429
- issues: []
1430
- }, n);
1431
- f instanceof Promise ? s.push(f.then((l) => dt(l, r, a))) : dt(f, r, a);
1432
- }
1433
- return s.length ? Promise.all(s).then(() => r) : r;
1434
- };
1435
- });
1436
- function fe(e, t, r) {
1437
- e.issues.length && t.issues.push(...G(r, e.issues)), t.value[r] = e.value;
1438
- }
1439
- function ft(e, t, r, n) {
1440
- e.issues.length ? n[r] === void 0 ? r in n ? t.value[r] = void 0 : t.value[r] = e.value : t.issues.push(...G(r, e.issues)) : e.value === void 0 ? r in n && (t.value[r] = void 0) : t.value[r] = e.value;
1441
- }
1442
- const ni = /* @__PURE__ */ u("$ZodObject", (e, t) => {
1443
- C.init(e, t);
1444
- const r = nr(() => {
1445
- const m = Object.keys(t.shape);
1446
- for (const d of m)
1447
- if (!(t.shape[d] instanceof C))
1448
- throw new Error(`Invalid element at key "${d}": expected a Zod schema`);
1449
- const p = No(t.shape);
1450
- return {
1451
- shape: t.shape,
1452
- keys: m,
1453
- keySet: new Set(m),
1454
- numKeys: m.length,
1455
- optionalKeys: new Set(p)
1456
- };
1457
- });
1458
- S(e._zod, "propValues", () => {
1459
- const m = t.shape, p = {};
1460
- for (const d in m) {
1461
- const g = m[d]._zod;
1462
- if (g.values) {
1463
- p[d] ?? (p[d] = /* @__PURE__ */ new Set());
1464
- for (const w of g.values)
1465
- p[d].add(w);
1466
- }
1467
- }
1468
- return p;
1469
- });
1470
- const n = (m) => {
1471
- const p = new Ps(["shape", "payload", "ctx"]), d = r.value, g = (j) => {
1472
- const x = ne(j);
1473
- return `shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`;
1474
- };
1475
- p.write("const input = payload.value;");
1476
- const w = /* @__PURE__ */ Object.create(null);
1477
- let E = 0;
1478
- for (const j of d.keys)
1479
- w[j] = `key_${E++}`;
1480
- p.write("const newResult = {}");
1481
- for (const j of d.keys)
1482
- if (d.optionalKeys.has(j)) {
1483
- const x = w[j];
1484
- p.write(`const ${x} = ${g(j)};`);
1485
- const b = ne(j);
1486
- p.write(`
1487
- if (${x}.issues.length) {
1488
- if (input[${b}] === undefined) {
1489
- if (${b} in input) {
1490
- newResult[${b}] = undefined;
1491
- }
1492
- } else {
1493
- payload.issues = payload.issues.concat(
1494
- ${x}.issues.map((iss) => ({
1495
- ...iss,
1496
- path: iss.path ? [${b}, ...iss.path] : [${b}],
1497
- }))
1498
- );
1499
- }
1500
- } else if (${x}.value === undefined) {
1501
- if (${b} in input) newResult[${b}] = undefined;
1502
- } else {
1503
- newResult[${b}] = ${x}.value;
1504
- }
1505
- `);
1506
- } else {
1507
- const x = w[j];
1508
- p.write(`const ${x} = ${g(j)};`), p.write(`
1509
- if (${x}.issues.length) payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
1510
- ...iss,
1511
- path: iss.path ? [${ne(j)}, ...iss.path] : [${ne(j)}]
1512
- })));`), p.write(`newResult[${ne(j)}] = ${x}.value`);
1513
- }
1514
- p.write("payload.value = newResult;"), p.write("return payload;");
1515
- const z = p.compile();
1516
- return (j, x) => z(m, j, x);
1517
- };
1518
- let o;
1519
- const s = Ne, a = !rr.jitless, f = a && Co.value, l = t.catchall;
1520
- let v;
1521
- e._zod.parse = (m, p) => {
1522
- v ?? (v = r.value);
1523
- const d = m.value;
1524
- if (!s(d))
1525
- return m.issues.push({
1526
- expected: "object",
1527
- code: "invalid_type",
1528
- input: d,
1529
- inst: e
1530
- }), m;
1531
- const g = [];
1532
- if (a && f && p?.async === !1 && p.jitless !== !0)
1533
- o || (o = n(t.shape)), m = o(m, p);
1534
- else {
1535
- m.value = {};
1536
- const x = v.shape;
1537
- for (const b of v.keys) {
1538
- const h = x[b], k = h._zod.run({ value: d[b], issues: [] }, p), R = h._zod.optin === "optional" && h._zod.optout === "optional";
1539
- k instanceof Promise ? g.push(k.then((D) => R ? ft(D, m, b, d) : fe(D, m, b))) : R ? ft(k, m, b, d) : fe(k, m, b);
1540
- }
1541
- }
1542
- if (!l)
1543
- return g.length ? Promise.all(g).then(() => m) : m;
1544
- const w = [], E = v.keySet, z = l._zod, j = z.def.type;
1545
- for (const x of Object.keys(d)) {
1546
- if (E.has(x))
1547
- continue;
1548
- if (j === "never") {
1549
- w.push(x);
1550
- continue;
1551
- }
1552
- const b = z.run({ value: d[x], issues: [] }, p);
1553
- b instanceof Promise ? g.push(b.then((h) => fe(h, m, x))) : fe(b, m, x);
1554
- }
1555
- return w.length && m.issues.push({
1556
- code: "unrecognized_keys",
1557
- keys: w,
1558
- input: d,
1559
- inst: e
1560
- }), g.length ? Promise.all(g).then(() => m) : m;
1561
- };
1562
- });
1563
- function ht(e, t, r, n) {
1564
- for (const o of e)
1565
- if (o.issues.length === 0)
1566
- return t.value = o.value, t;
1567
- return t.issues.push({
1568
- code: "invalid_union",
1569
- input: t.value,
1570
- inst: r,
1571
- errors: e.map((o) => o.issues.map((s) => V(s, n, W())))
1572
- }), t;
1573
- }
1574
- const oi = /* @__PURE__ */ u("$ZodUnion", (e, t) => {
1575
- C.init(e, t), S(e._zod, "optin", () => t.options.some((r) => r._zod.optin === "optional") ? "optional" : void 0), S(e._zod, "optout", () => t.options.some((r) => r._zod.optout === "optional") ? "optional" : void 0), S(e._zod, "values", () => {
1576
- if (t.options.every((r) => r._zod.values))
1577
- return new Set(t.options.flatMap((r) => Array.from(r._zod.values)));
1578
- }), S(e._zod, "pattern", () => {
1579
- if (t.options.every((r) => r._zod.pattern)) {
1580
- const r = t.options.map((n) => n._zod.pattern);
1581
- return new RegExp(`^(${r.map((n) => Be(n.source)).join("|")})$`);
1582
- }
1583
- }), e._zod.parse = (r, n) => {
1584
- let o = !1;
1585
- const s = [];
1586
- for (const a of t.options) {
1587
- const c = a._zod.run({
1588
- value: r.value,
1589
- issues: []
1590
- }, n);
1591
- if (c instanceof Promise)
1592
- s.push(c), o = !0;
1593
- else {
1594
- if (c.issues.length === 0)
1595
- return c;
1596
- s.push(c);
1597
- }
1598
- }
1599
- return o ? Promise.all(s).then((a) => ht(a, r, e, n)) : ht(s, r, e, n);
1600
- };
1601
- }), si = /* @__PURE__ */ u("$ZodIntersection", (e, t) => {
1602
- C.init(e, t), e._zod.parse = (r, n) => {
1603
- const o = r.value, s = t.left._zod.run({ value: o, issues: [] }, n), a = t.right._zod.run({ value: o, issues: [] }, n);
1604
- return s instanceof Promise || a instanceof Promise ? Promise.all([s, a]).then(([f, l]) => pt(r, f, l)) : pt(r, s, a);
1605
- };
1606
- });
1607
- function Ae(e, t) {
1608
- if (e === t)
1609
- return { valid: !0, data: e };
1610
- if (e instanceof Date && t instanceof Date && +e == +t)
1611
- return { valid: !0, data: e };
1612
- if (ye(e) && ye(t)) {
1613
- const r = Object.keys(t), n = Object.keys(e).filter((s) => r.indexOf(s) !== -1), o = { ...e, ...t };
1614
- for (const s of n) {
1615
- const a = Ae(e[s], t[s]);
1616
- if (!a.valid)
1617
- return {
1618
- valid: !1,
1619
- mergeErrorPath: [s, ...a.mergeErrorPath]
1620
- };
1621
- o[s] = a.data;
1622
- }
1623
- return { valid: !0, data: o };
1624
- }
1625
- if (Array.isArray(e) && Array.isArray(t)) {
1626
- if (e.length !== t.length)
1627
- return { valid: !1, mergeErrorPath: [] };
1628
- const r = [];
1629
- for (let n = 0; n < e.length; n++) {
1630
- const o = e[n], s = t[n], a = Ae(o, s);
1631
- if (!a.valid)
1632
- return {
1633
- valid: !1,
1634
- mergeErrorPath: [n, ...a.mergeErrorPath]
1635
- };
1636
- r.push(a.data);
1637
- }
1638
- return { valid: !0, data: r };
1639
- }
1640
- return { valid: !1, mergeErrorPath: [] };
1641
- }
1642
- function pt(e, t, r) {
1643
- if (t.issues.length && e.issues.push(...t.issues), r.issues.length && e.issues.push(...r.issues), oe(e))
1644
- return e;
1645
- const n = Ae(t.value, r.value);
1646
- if (!n.valid)
1647
- throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);
1648
- return e.value = n.data, e;
1649
- }
1650
- const ii = /* @__PURE__ */ u("$ZodRecord", (e, t) => {
1651
- C.init(e, t), e._zod.parse = (r, n) => {
1652
- const o = r.value;
1653
- if (!ye(o))
1654
- return r.issues.push({
1655
- expected: "record",
1656
- code: "invalid_type",
1657
- input: o,
1658
- inst: e
1659
- }), r;
1660
- const s = [];
1661
- if (t.keyType._zod.values) {
1662
- const a = t.keyType._zod.values;
1663
- r.value = {};
1664
- for (const f of a)
1665
- if (typeof f == "string" || typeof f == "number" || typeof f == "symbol") {
1666
- const l = t.valueType._zod.run({ value: o[f], issues: [] }, n);
1667
- l instanceof Promise ? s.push(l.then((v) => {
1668
- v.issues.length && r.issues.push(...G(f, v.issues)), r.value[f] = v.value;
1669
- })) : (l.issues.length && r.issues.push(...G(f, l.issues)), r.value[f] = l.value);
1670
- }
1671
- let c;
1672
- for (const f in o)
1673
- a.has(f) || (c = c ?? [], c.push(f));
1674
- c && c.length > 0 && r.issues.push({
1675
- code: "unrecognized_keys",
1676
- input: o,
1677
- inst: e,
1678
- keys: c
1679
- });
1680
- } else {
1681
- r.value = {};
1682
- for (const a of Reflect.ownKeys(o)) {
1683
- if (a === "__proto__")
1684
- continue;
1685
- const c = t.keyType._zod.run({ value: a, issues: [] }, n);
1686
- if (c instanceof Promise)
1687
- throw new Error("Async schemas not supported in object keys currently");
1688
- if (c.issues.length) {
1689
- r.issues.push({
1690
- origin: "record",
1691
- code: "invalid_key",
1692
- issues: c.issues.map((l) => V(l, n, W())),
1693
- input: a,
1694
- path: [a],
1695
- inst: e
1696
- }), r.value[c.value] = c.value;
1697
- continue;
1698
- }
1699
- const f = t.valueType._zod.run({ value: o[a], issues: [] }, n);
1700
- f instanceof Promise ? s.push(f.then((l) => {
1701
- l.issues.length && r.issues.push(...G(a, l.issues)), r.value[c.value] = l.value;
1702
- })) : (f.issues.length && r.issues.push(...G(a, f.issues)), r.value[c.value] = f.value);
1703
- }
1704
- }
1705
- return s.length ? Promise.all(s).then(() => r) : r;
1706
- };
1707
- }), ai = /* @__PURE__ */ u("$ZodEnum", (e, t) => {
1708
- C.init(e, t);
1709
- const r = Zo(t.entries);
1710
- e._zod.values = new Set(r), e._zod.pattern = new RegExp(`^(${r.filter((n) => Oo.has(typeof n)).map((n) => typeof n == "string" ? je(n) : n.toString()).join("|")})$`), e._zod.parse = (n, o) => {
1711
- const s = n.value;
1712
- return e._zod.values.has(s) || n.issues.push({
1713
- code: "invalid_value",
1714
- values: r,
1715
- input: s,
1716
- inst: e
1717
- }), n;
1718
- };
1719
- }), ci = /* @__PURE__ */ u("$ZodTransform", (e, t) => {
1720
- C.init(e, t), e._zod.parse = (r, n) => {
1721
- const o = t.transform(r.value, r);
1722
- if (n.async)
1723
- return (o instanceof Promise ? o : Promise.resolve(o)).then((a) => (r.value = a, r));
1724
- if (o instanceof Promise)
1725
- throw new ie();
1726
- return r.value = o, r;
1727
- };
1728
- }), ui = /* @__PURE__ */ u("$ZodOptional", (e, t) => {
1729
- C.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", S(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), S(e._zod, "pattern", () => {
1730
- const r = t.innerType._zod.pattern;
1731
- return r ? new RegExp(`^(${Be(r.source)})?$`) : void 0;
1732
- }), e._zod.parse = (r, n) => t.innerType._zod.optin === "optional" ? t.innerType._zod.run(r, n) : r.value === void 0 ? r : t.innerType._zod.run(r, n);
1733
- }), li = /* @__PURE__ */ u("$ZodNullable", (e, t) => {
1734
- C.init(e, t), S(e._zod, "optin", () => t.innerType._zod.optin), S(e._zod, "optout", () => t.innerType._zod.optout), S(e._zod, "pattern", () => {
1735
- const r = t.innerType._zod.pattern;
1736
- return r ? new RegExp(`^(${Be(r.source)}|null)$`) : void 0;
1737
- }), S(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (r, n) => r.value === null ? r : t.innerType._zod.run(r, n);
1738
- }), di = /* @__PURE__ */ u("$ZodDefault", (e, t) => {
1739
- C.init(e, t), e._zod.optin = "optional", S(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (r, n) => {
1740
- if (r.value === void 0)
1741
- return r.value = t.defaultValue, r;
1742
- const o = t.innerType._zod.run(r, n);
1743
- return o instanceof Promise ? o.then((s) => mt(s, t)) : mt(o, t);
1744
- };
1745
- });
1746
- function mt(e, t) {
1747
- return e.value === void 0 && (e.value = t.defaultValue), e;
1748
- }
1749
- const fi = /* @__PURE__ */ u("$ZodPrefault", (e, t) => {
1750
- C.init(e, t), e._zod.optin = "optional", S(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (r, n) => (r.value === void 0 && (r.value = t.defaultValue), t.innerType._zod.run(r, n));
1751
- }), hi = /* @__PURE__ */ u("$ZodNonOptional", (e, t) => {
1752
- C.init(e, t), S(e._zod, "values", () => {
1753
- const r = t.innerType._zod.values;
1754
- return r ? new Set([...r].filter((n) => n !== void 0)) : void 0;
1755
- }), e._zod.parse = (r, n) => {
1756
- const o = t.innerType._zod.run(r, n);
1757
- return o instanceof Promise ? o.then((s) => gt(s, e)) : gt(o, e);
1758
- };
1759
- });
1760
- function gt(e, t) {
1761
- return !e.issues.length && e.value === void 0 && e.issues.push({
1762
- code: "invalid_type",
1763
- expected: "nonoptional",
1764
- input: e.value,
1765
- inst: t
1766
- }), e;
1767
- }
1768
- const pi = /* @__PURE__ */ u("$ZodCatch", (e, t) => {
1769
- C.init(e, t), e._zod.optin = "optional", S(e._zod, "optout", () => t.innerType._zod.optout), S(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (r, n) => {
1770
- const o = t.innerType._zod.run(r, n);
1771
- return o instanceof Promise ? o.then((s) => (r.value = s.value, s.issues.length && (r.value = t.catchValue({
1772
- ...r,
1773
- error: {
1774
- issues: s.issues.map((a) => V(a, n, W()))
1775
- },
1776
- input: r.value
1777
- }), r.issues = []), r)) : (r.value = o.value, o.issues.length && (r.value = t.catchValue({
1778
- ...r,
1779
- error: {
1780
- issues: o.issues.map((s) => V(s, n, W()))
1781
- },
1782
- input: r.value
1783
- }), r.issues = []), r);
1784
- };
1785
- }), mi = /* @__PURE__ */ u("$ZodPipe", (e, t) => {
1786
- C.init(e, t), S(e._zod, "values", () => t.in._zod.values), S(e._zod, "optin", () => t.in._zod.optin), S(e._zod, "optout", () => t.out._zod.optout), e._zod.parse = (r, n) => {
1787
- const o = t.in._zod.run(r, n);
1788
- return o instanceof Promise ? o.then((s) => vt(s, t, n)) : vt(o, t, n);
1789
- };
1790
- });
1791
- function vt(e, t, r) {
1792
- return oe(e) ? e : t.out._zod.run({ value: e.value, issues: e.issues }, r);
1793
- }
1794
- const gi = /* @__PURE__ */ u("$ZodReadonly", (e, t) => {
1795
- C.init(e, t), S(e._zod, "propValues", () => t.innerType._zod.propValues), S(e._zod, "values", () => t.innerType._zod.values), S(e._zod, "optin", () => t.innerType._zod.optin), S(e._zod, "optout", () => t.innerType._zod.optout), e._zod.parse = (r, n) => {
1796
- const o = t.innerType._zod.run(r, n);
1797
- return o instanceof Promise ? o.then(yt) : yt(o);
1798
- };
1799
- });
1800
- function yt(e) {
1801
- return e.value = Object.freeze(e.value), e;
1802
- }
1803
- const vi = /* @__PURE__ */ u("$ZodCustom", (e, t) => {
1804
- U.init(e, t), C.init(e, t), e._zod.parse = (r, n) => r, e._zod.check = (r) => {
1805
- const n = r.value, o = t.fn(n);
1806
- if (o instanceof Promise)
1807
- return o.then((s) => xt(s, r, n, e));
1808
- xt(o, r, n, e);
1809
- };
1810
- });
1811
- function xt(e, t, r, n) {
1812
- if (!e) {
1813
- const o = {
1814
- code: "custom",
1815
- input: r,
1816
- inst: n,
1817
- // incorporates params.error into issue reporting
1818
- path: [...n._zod.def.path ?? []],
1819
- // incorporates params.error into issue reporting
1820
- continue: !n._zod.def.abort
1821
- // params: inst._zod.def.params,
1822
- };
1823
- n._zod.def.params && (o.params = n._zod.def.params), t.issues.push(ae(o));
1824
- }
1825
- }
1826
- class yi {
1827
- constructor() {
1828
- this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
1829
- }
1830
- add(t, ...r) {
1831
- const n = r[0];
1832
- if (this._map.set(t, n), n && typeof n == "object" && "id" in n) {
1833
- if (this._idmap.has(n.id))
1834
- throw new Error(`ID ${n.id} already exists in the registry`);
1835
- this._idmap.set(n.id, t);
1836
- }
1837
- return this;
1838
- }
1839
- remove(t) {
1840
- return this._map.delete(t), this;
1841
- }
1842
- get(t) {
1843
- const r = t._zod.parent;
1844
- if (r) {
1845
- const n = { ...this.get(r) ?? {} };
1846
- return delete n.id, { ...n, ...this._map.get(t) };
1847
- }
1848
- return this._map.get(t);
1849
- }
1850
- has(t) {
1851
- return this._map.has(t);
1852
- }
1853
- }
1854
- function xi() {
1855
- return new yi();
1856
- }
1857
- const he = /* @__PURE__ */ xi();
1858
- function _i(e, t) {
1859
- return new e({
1860
- type: "string",
1861
- ..._(t)
1862
- });
1863
- }
1864
- function bi(e, t) {
1865
- return new e({
1866
- type: "string",
1867
- format: "email",
1868
- check: "string_format",
1869
- abort: !1,
1870
- ..._(t)
1871
- });
1872
- }
1873
- function _t(e, t) {
1874
- return new e({
1875
- type: "string",
1876
- format: "guid",
1877
- check: "string_format",
1878
- abort: !1,
1879
- ..._(t)
1880
- });
1881
- }
1882
- function wi(e, t) {
1883
- return new e({
1884
- type: "string",
1885
- format: "uuid",
1886
- check: "string_format",
1887
- abort: !1,
1888
- ..._(t)
1889
- });
1890
- }
1891
- function ji(e, t) {
1892
- return new e({
1893
- type: "string",
1894
- format: "uuid",
1895
- check: "string_format",
1896
- abort: !1,
1897
- version: "v4",
1898
- ..._(t)
1899
- });
1900
- }
1901
- function ki(e, t) {
1902
- return new e({
1903
- type: "string",
1904
- format: "uuid",
1905
- check: "string_format",
1906
- abort: !1,
1907
- version: "v6",
1908
- ..._(t)
1909
- });
1910
- }
1911
- function zi(e, t) {
1912
- return new e({
1913
- type: "string",
1914
- format: "uuid",
1915
- check: "string_format",
1916
- abort: !1,
1917
- version: "v7",
1918
- ..._(t)
1919
- });
1920
- }
1921
- function $i(e, t) {
1922
- return new e({
1923
- type: "string",
1924
- format: "url",
1925
- check: "string_format",
1926
- abort: !1,
1927
- ..._(t)
1928
- });
1929
- }
1930
- function Pi(e, t) {
1931
- return new e({
1932
- type: "string",
1933
- format: "emoji",
1934
- check: "string_format",
1935
- abort: !1,
1936
- ..._(t)
1937
- });
1938
- }
1939
- function Ei(e, t) {
1940
- return new e({
1941
- type: "string",
1942
- format: "nanoid",
1943
- check: "string_format",
1944
- abort: !1,
1945
- ..._(t)
1946
- });
1947
- }
1948
- function Si(e, t) {
1949
- return new e({
1950
- type: "string",
1951
- format: "cuid",
1952
- check: "string_format",
1953
- abort: !1,
1954
- ..._(t)
1955
- });
1956
- }
1957
- function Zi(e, t) {
1958
- return new e({
1959
- type: "string",
1960
- format: "cuid2",
1961
- check: "string_format",
1962
- abort: !1,
1963
- ..._(t)
1964
- });
1965
- }
1966
- function Ti(e, t) {
1967
- return new e({
1968
- type: "string",
1969
- format: "ulid",
1970
- check: "string_format",
1971
- abort: !1,
1972
- ..._(t)
1973
- });
1974
- }
1975
- function Ci(e, t) {
1976
- return new e({
1977
- type: "string",
1978
- format: "xid",
1979
- check: "string_format",
1980
- abort: !1,
1981
- ..._(t)
1982
- });
1983
- }
1984
- function Oi(e, t) {
1985
- return new e({
1986
- type: "string",
1987
- format: "ksuid",
1988
- check: "string_format",
1989
- abort: !1,
1990
- ..._(t)
1991
- });
1992
- }
1993
- function Ni(e, t) {
1994
- return new e({
1995
- type: "string",
1996
- format: "ipv4",
1997
- check: "string_format",
1998
- abort: !1,
1999
- ..._(t)
2000
- });
2001
- }
2002
- function Ai(e, t) {
2003
- return new e({
2004
- type: "string",
2005
- format: "ipv6",
2006
- check: "string_format",
2007
- abort: !1,
2008
- ..._(t)
2009
- });
2010
- }
2011
- function Ri(e, t) {
2012
- return new e({
2013
- type: "string",
2014
- format: "cidrv4",
2015
- check: "string_format",
2016
- abort: !1,
2017
- ..._(t)
2018
- });
2019
- }
2020
- function Ii(e, t) {
2021
- return new e({
2022
- type: "string",
2023
- format: "cidrv6",
2024
- check: "string_format",
2025
- abort: !1,
2026
- ..._(t)
2027
- });
2028
- }
2029
- function Di(e, t) {
2030
- return new e({
2031
- type: "string",
2032
- format: "base64",
2033
- check: "string_format",
2034
- abort: !1,
2035
- ..._(t)
2036
- });
2037
- }
2038
- function Mi(e, t) {
2039
- return new e({
2040
- type: "string",
2041
- format: "base64url",
2042
- check: "string_format",
2043
- abort: !1,
2044
- ..._(t)
2045
- });
2046
- }
2047
- function Fi(e, t) {
2048
- return new e({
2049
- type: "string",
2050
- format: "e164",
2051
- check: "string_format",
2052
- abort: !1,
2053
- ..._(t)
2054
- });
2055
- }
2056
- function qi(e, t) {
2057
- return new e({
2058
- type: "string",
2059
- format: "jwt",
2060
- check: "string_format",
2061
- abort: !1,
2062
- ..._(t)
2063
- });
2064
- }
2065
- function Ui(e, t) {
2066
- return new e({
2067
- type: "string",
2068
- format: "datetime",
2069
- check: "string_format",
2070
- offset: !1,
2071
- local: !1,
2072
- precision: null,
2073
- ..._(t)
2074
- });
2075
- }
2076
- function Li(e, t) {
2077
- return new e({
2078
- type: "string",
2079
- format: "date",
2080
- check: "string_format",
2081
- ..._(t)
2082
- });
2083
- }
2084
- function Qi(e, t) {
2085
- return new e({
2086
- type: "string",
2087
- format: "time",
2088
- check: "string_format",
2089
- precision: null,
2090
- ..._(t)
2091
- });
2092
- }
2093
- function Bi(e, t) {
2094
- return new e({
2095
- type: "string",
2096
- format: "duration",
2097
- check: "string_format",
2098
- ..._(t)
2099
- });
2100
- }
2101
- function Ki(e) {
2102
- return new e({
2103
- type: "unknown"
2104
- });
2105
- }
2106
- function Hi(e, t) {
2107
- return new e({
2108
- type: "never",
2109
- ..._(t)
2110
- });
2111
- }
2112
- function pr(e, t) {
2113
- return new vs({
2114
- check: "max_length",
2115
- ..._(t),
2116
- maximum: e
2117
- });
2118
- }
2119
- function xe(e, t) {
2120
- return new ys({
2121
- check: "min_length",
2122
- ..._(t),
2123
- minimum: e
2124
- });
2125
- }
2126
- function mr(e, t) {
2127
- return new xs({
2128
- check: "length_equals",
2129
- ..._(t),
2130
- length: e
2131
- });
2132
- }
2133
- function Wi(e, t) {
2134
- return new _s({
2135
- check: "string_format",
2136
- format: "regex",
2137
- ..._(t),
2138
- pattern: e
2139
- });
2140
- }
2141
- function Vi(e) {
2142
- return new bs({
2143
- check: "string_format",
2144
- format: "lowercase",
2145
- ..._(e)
2146
- });
2147
- }
2148
- function Yi(e) {
2149
- return new ws({
2150
- check: "string_format",
2151
- format: "uppercase",
2152
- ..._(e)
2153
- });
2154
- }
2155
- function Gi(e, t) {
2156
- return new js({
2157
- check: "string_format",
2158
- format: "includes",
2159
- ..._(t),
2160
- includes: e
2161
- });
2162
- }
2163
- function Ji(e, t) {
2164
- return new ks({
2165
- check: "string_format",
2166
- format: "starts_with",
2167
- ..._(t),
2168
- prefix: e
2169
- });
2170
- }
2171
- function Xi(e, t) {
2172
- return new zs({
2173
- check: "string_format",
2174
- format: "ends_with",
2175
- ..._(t),
2176
- suffix: e
2177
- });
2178
- }
2179
- function ce(e) {
2180
- return new $s({
2181
- check: "overwrite",
2182
- tx: e
2183
- });
2184
- }
2185
- function ea(e) {
2186
- return ce((t) => t.normalize(e));
2187
- }
2188
- function ta() {
2189
- return ce((e) => e.trim());
2190
- }
2191
- function ra() {
2192
- return ce((e) => e.toLowerCase());
2193
- }
2194
- function na() {
2195
- return ce((e) => e.toUpperCase());
2196
- }
2197
- function oa(e, t, r) {
2198
- return new e({
2199
- type: "array",
2200
- element: t,
2201
- // get element() {
2202
- // return element;
2203
- // },
2204
- ..._(r)
2205
- });
2206
- }
2207
- function sa(e, t, r) {
2208
- const n = _(r);
2209
- return n.abort ?? (n.abort = !0), new e({
2210
- type: "custom",
2211
- check: "custom",
2212
- fn: t,
2213
- ...n
2214
- });
2215
- }
2216
- function ia(e, t, r) {
2217
- return new e({
2218
- type: "custom",
2219
- check: "custom",
2220
- fn: t,
2221
- ..._(r)
2222
- });
2223
- }
2224
- const aa = /* @__PURE__ */ u("ZodISODateTime", (e, t) => {
2225
- Fs.init(e, t), T.init(e, t);
2226
- });
2227
- function ca(e) {
2228
- return Ui(aa, e);
2229
- }
2230
- const ua = /* @__PURE__ */ u("ZodISODate", (e, t) => {
2231
- qs.init(e, t), T.init(e, t);
2232
- });
2233
- function la(e) {
2234
- return Li(ua, e);
2235
- }
2236
- const da = /* @__PURE__ */ u("ZodISOTime", (e, t) => {
2237
- Us.init(e, t), T.init(e, t);
2238
- });
2239
- function fa(e) {
2240
- return Qi(da, e);
2241
- }
2242
- const ha = /* @__PURE__ */ u("ZodISODuration", (e, t) => {
2243
- Ls.init(e, t), T.init(e, t);
2244
- });
2245
- function pa(e) {
2246
- return Bi(ha, e);
2247
- }
2248
- const ma = (e, t) => {
2249
- ir.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
2250
- format: {
2251
- value: (r) => Uo(e, r)
2252
- // enumerable: false,
2253
- },
2254
- flatten: {
2255
- value: (r) => qo(e, r)
2256
- // enumerable: false,
2257
- },
2258
- addIssue: {
2259
- value: (r) => e.issues.push(r)
2260
- // enumerable: false,
2261
- },
2262
- addIssues: {
2263
- value: (r) => e.issues.push(...r)
2264
- // enumerable: false,
2265
- },
2266
- isEmpty: {
2267
- get() {
2268
- return e.issues.length === 0;
2269
- }
2270
- // enumerable: false,
2271
- }
2272
- });
2273
- }, ze = u("ZodError", ma, {
2274
- Parent: Error
2275
- }), ga = /* @__PURE__ */ Lo(ze), va = /* @__PURE__ */ Qo(ze), ya = /* @__PURE__ */ cr(ze), xa = /* @__PURE__ */ ur(ze), O = /* @__PURE__ */ u("ZodType", (e, t) => (C.init(e, t), e.def = t, Object.defineProperty(e, "_def", { value: t }), e.check = (...r) => e.clone(
2276
- {
2277
- ...t,
2278
- checks: [
2279
- ...t.checks ?? [],
2280
- ...r.map((n) => typeof n == "function" ? { _zod: { check: n, def: { check: "custom" }, onattach: [] } } : n)
2281
- ]
2282
- }
2283
- // { parent: true }
2284
- ), e.clone = (r, n) => X(e, r, n), e.brand = () => e, e.register = (r, n) => (r.add(e, n), e), e.parse = (r, n) => ga(e, r, n, { callee: e.parse }), e.safeParse = (r, n) => ya(e, r, n), e.parseAsync = async (r, n) => va(e, r, n, { callee: e.parseAsync }), e.safeParseAsync = async (r, n) => xa(e, r, n), e.spa = e.safeParseAsync, e.refine = (r, n) => e.check(dc(r, n)), e.superRefine = (r) => e.check(fc(r)), e.overwrite = (r) => e.check(ce(r)), e.optional = () => jt(e), e.nullable = () => kt(e), e.nullish = () => jt(kt(e)), e.nonoptional = (r) => nc(e, r), e.array = () => Ua(e), e.or = (r) => vr([e, r]), e.and = (r) => Ha(e, r), e.transform = (r) => zt(e, Ga(r)), e.default = (r) => ec(e, r), e.prefault = (r) => rc(e, r), e.catch = (r) => sc(e, r), e.pipe = (r) => zt(e, r), e.readonly = () => cc(e), e.describe = (r) => {
2285
- const n = e.clone();
2286
- return he.add(n, { description: r }), n;
2287
- }, Object.defineProperty(e, "description", {
2288
- get() {
2289
- return he.get(e)?.description;
2290
- },
2291
- configurable: !0
2292
- }), e.meta = (...r) => {
2293
- if (r.length === 0)
2294
- return he.get(e);
2295
- const n = e.clone();
2296
- return he.add(n, r[0]), n;
2297
- }, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), gr = /* @__PURE__ */ u("_ZodString", (e, t) => {
2298
- We.init(e, t), O.init(e, t);
2299
- const r = e._zod.bag;
2300
- e.format = r.format ?? null, e.minLength = r.minimum ?? null, e.maxLength = r.maximum ?? null, e.regex = (...n) => e.check(Wi(...n)), e.includes = (...n) => e.check(Gi(...n)), e.startsWith = (...n) => e.check(Ji(...n)), e.endsWith = (...n) => e.check(Xi(...n)), e.min = (...n) => e.check(xe(...n)), e.max = (...n) => e.check(pr(...n)), e.length = (...n) => e.check(mr(...n)), e.nonempty = (...n) => e.check(xe(1, ...n)), e.lowercase = (n) => e.check(Vi(n)), e.uppercase = (n) => e.check(Yi(n)), e.trim = () => e.check(ta()), e.normalize = (...n) => e.check(ea(...n)), e.toLowerCase = () => e.check(ra()), e.toUpperCase = () => e.check(na());
2301
- }), _a = /* @__PURE__ */ u("ZodString", (e, t) => {
2302
- We.init(e, t), gr.init(e, t), e.email = (r) => e.check(bi(ba, r)), e.url = (r) => e.check($i(wa, r)), e.jwt = (r) => e.check(qi(Ia, r)), e.emoji = (r) => e.check(Pi(ja, r)), e.guid = (r) => e.check(_t(bt, r)), e.uuid = (r) => e.check(wi(pe, r)), e.uuidv4 = (r) => e.check(ji(pe, r)), e.uuidv6 = (r) => e.check(ki(pe, r)), e.uuidv7 = (r) => e.check(zi(pe, r)), e.nanoid = (r) => e.check(Ei(ka, r)), e.guid = (r) => e.check(_t(bt, r)), e.cuid = (r) => e.check(Si(za, r)), e.cuid2 = (r) => e.check(Zi($a, r)), e.ulid = (r) => e.check(Ti(Pa, r)), e.base64 = (r) => e.check(Di(Na, r)), e.base64url = (r) => e.check(Mi(Aa, r)), e.xid = (r) => e.check(Ci(Ea, r)), e.ksuid = (r) => e.check(Oi(Sa, r)), e.ipv4 = (r) => e.check(Ni(Za, r)), e.ipv6 = (r) => e.check(Ai(Ta, r)), e.cidrv4 = (r) => e.check(Ri(Ca, r)), e.cidrv6 = (r) => e.check(Ii(Oa, r)), e.e164 = (r) => e.check(Fi(Ra, r)), e.datetime = (r) => e.check(ca(r)), e.date = (r) => e.check(la(r)), e.time = (r) => e.check(fa(r)), e.duration = (r) => e.check(pa(r));
2303
- });
2304
- function _e(e) {
2305
- return _i(_a, e);
2306
- }
2307
- const T = /* @__PURE__ */ u("ZodStringFormat", (e, t) => {
2308
- Z.init(e, t), gr.init(e, t);
2309
- }), ba = /* @__PURE__ */ u("ZodEmail", (e, t) => {
2310
- Ts.init(e, t), T.init(e, t);
2311
- }), bt = /* @__PURE__ */ u("ZodGUID", (e, t) => {
2312
- Ss.init(e, t), T.init(e, t);
2313
- }), pe = /* @__PURE__ */ u("ZodUUID", (e, t) => {
2314
- Zs.init(e, t), T.init(e, t);
2315
- }), wa = /* @__PURE__ */ u("ZodURL", (e, t) => {
2316
- Cs.init(e, t), T.init(e, t);
2317
- }), ja = /* @__PURE__ */ u("ZodEmoji", (e, t) => {
2318
- Os.init(e, t), T.init(e, t);
2319
- }), ka = /* @__PURE__ */ u("ZodNanoID", (e, t) => {
2320
- Ns.init(e, t), T.init(e, t);
2321
- }), za = /* @__PURE__ */ u("ZodCUID", (e, t) => {
2322
- As.init(e, t), T.init(e, t);
2323
- }), $a = /* @__PURE__ */ u("ZodCUID2", (e, t) => {
2324
- Rs.init(e, t), T.init(e, t);
2325
- }), Pa = /* @__PURE__ */ u("ZodULID", (e, t) => {
2326
- Is.init(e, t), T.init(e, t);
2327
- }), Ea = /* @__PURE__ */ u("ZodXID", (e, t) => {
2328
- Ds.init(e, t), T.init(e, t);
2329
- }), Sa = /* @__PURE__ */ u("ZodKSUID", (e, t) => {
2330
- Ms.init(e, t), T.init(e, t);
2331
- }), Za = /* @__PURE__ */ u("ZodIPv4", (e, t) => {
2332
- Qs.init(e, t), T.init(e, t);
2333
- }), Ta = /* @__PURE__ */ u("ZodIPv6", (e, t) => {
2334
- Bs.init(e, t), T.init(e, t);
2335
- }), Ca = /* @__PURE__ */ u("ZodCIDRv4", (e, t) => {
2336
- Ks.init(e, t), T.init(e, t);
2337
- }), Oa = /* @__PURE__ */ u("ZodCIDRv6", (e, t) => {
2338
- Hs.init(e, t), T.init(e, t);
2339
- }), Na = /* @__PURE__ */ u("ZodBase64", (e, t) => {
2340
- Ws.init(e, t), T.init(e, t);
2341
- }), Aa = /* @__PURE__ */ u("ZodBase64URL", (e, t) => {
2342
- Ys.init(e, t), T.init(e, t);
2343
- }), Ra = /* @__PURE__ */ u("ZodE164", (e, t) => {
2344
- Gs.init(e, t), T.init(e, t);
2345
- }), Ia = /* @__PURE__ */ u("ZodJWT", (e, t) => {
2346
- Xs.init(e, t), T.init(e, t);
2347
- }), Da = /* @__PURE__ */ u("ZodUnknown", (e, t) => {
2348
- ei.init(e, t), O.init(e, t);
2349
- });
2350
- function wt() {
2351
- return Ki(Da);
2352
- }
2353
- const Ma = /* @__PURE__ */ u("ZodNever", (e, t) => {
2354
- ti.init(e, t), O.init(e, t);
2355
- });
2356
- function Fa(e) {
2357
- return Hi(Ma, e);
2358
- }
2359
- const qa = /* @__PURE__ */ u("ZodArray", (e, t) => {
2360
- ri.init(e, t), O.init(e, t), e.element = t.element, e.min = (r, n) => e.check(xe(r, n)), e.nonempty = (r) => e.check(xe(1, r)), e.max = (r, n) => e.check(pr(r, n)), e.length = (r, n) => e.check(mr(r, n)), e.unwrap = () => e.element;
2361
- });
2362
- function Ua(e, t) {
2363
- return oa(qa, e, t);
2364
- }
2365
- const La = /* @__PURE__ */ u("ZodObject", (e, t) => {
2366
- ni.init(e, t), O.init(e, t), S(e, "shape", () => t.shape), e.keyof = () => yr(Object.keys(e._zod.def.shape)), e.catchall = (r) => e.clone({ ...e._zod.def, catchall: r }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: wt() }), e.loose = () => e.clone({ ...e._zod.def, catchall: wt() }), e.strict = () => e.clone({ ...e._zod.def, catchall: Fa() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (r) => Io(e, r), e.merge = (r) => Do(e, r), e.pick = (r) => Ao(e, r), e.omit = (r) => Ro(e, r), e.partial = (...r) => Mo(xr, e, r[0]), e.required = (...r) => Fo(_r, e, r[0]);
2367
- });
2368
- function Qa(e, t) {
2369
- const r = {
2370
- type: "object",
2371
- get shape() {
2372
- return Ke(this, "shape", { ...e }), this.shape;
2373
- },
2374
- ..._(t)
2375
- };
2376
- return new La(r);
2377
- }
2378
- const Ba = /* @__PURE__ */ u("ZodUnion", (e, t) => {
2379
- oi.init(e, t), O.init(e, t), e.options = t.options;
2380
- });
2381
- function vr(e, t) {
2382
- return new Ba({
2383
- type: "union",
2384
- options: e,
2385
- ..._(t)
2386
- });
2387
- }
2388
- const Ka = /* @__PURE__ */ u("ZodIntersection", (e, t) => {
2389
- si.init(e, t), O.init(e, t);
2390
- });
2391
- function Ha(e, t) {
2392
- return new Ka({
2393
- type: "intersection",
2394
- left: e,
2395
- right: t
2396
- });
2397
- }
2398
- const Wa = /* @__PURE__ */ u("ZodRecord", (e, t) => {
2399
- ii.init(e, t), O.init(e, t), e.keyType = t.keyType, e.valueType = t.valueType;
2400
- });
2401
- function Va(e, t, r) {
2402
- return new Wa({
2403
- type: "record",
2404
- keyType: e,
2405
- valueType: t,
2406
- ..._(r)
2407
- });
2408
- }
2409
- const Re = /* @__PURE__ */ u("ZodEnum", (e, t) => {
2410
- ai.init(e, t), O.init(e, t), e.enum = t.entries, e.options = Object.values(t.entries);
2411
- const r = new Set(Object.keys(t.entries));
2412
- e.extract = (n, o) => {
2413
- const s = {};
2414
- for (const a of n)
2415
- if (r.has(a))
2416
- s[a] = t.entries[a];
2417
- else
2418
- throw new Error(`Key ${a} not found in enum`);
2419
- return new Re({
2420
- ...t,
2421
- checks: [],
2422
- ..._(o),
2423
- entries: s
2424
- });
2425
- }, e.exclude = (n, o) => {
2426
- const s = { ...t.entries };
2427
- for (const a of n)
2428
- if (r.has(a))
2429
- delete s[a];
2430
- else
2431
- throw new Error(`Key ${a} not found in enum`);
2432
- return new Re({
2433
- ...t,
2434
- checks: [],
2435
- ..._(o),
2436
- entries: s
2437
- });
2438
- };
2439
- });
2440
- function yr(e, t) {
2441
- const r = Array.isArray(e) ? Object.fromEntries(e.map((n) => [n, n])) : e;
2442
- return new Re({
2443
- type: "enum",
2444
- entries: r,
2445
- ..._(t)
2446
- });
2447
- }
2448
- const Ya = /* @__PURE__ */ u("ZodTransform", (e, t) => {
2449
- ci.init(e, t), O.init(e, t), e._zod.parse = (r, n) => {
2450
- r.addIssue = (s) => {
2451
- if (typeof s == "string")
2452
- r.issues.push(ae(s, r.value, t));
2453
- else {
2454
- const a = s;
2455
- a.fatal && (a.continue = !1), a.code ?? (a.code = "custom"), a.input ?? (a.input = r.value), a.inst ?? (a.inst = e), a.continue ?? (a.continue = !0), r.issues.push(ae(a));
2456
- }
2457
- };
2458
- const o = t.transform(r.value, r);
2459
- return o instanceof Promise ? o.then((s) => (r.value = s, r)) : (r.value = o, r);
2460
- };
2461
- });
2462
- function Ga(e) {
2463
- return new Ya({
2464
- type: "transform",
2465
- transform: e
2466
- });
2467
- }
2468
- const xr = /* @__PURE__ */ u("ZodOptional", (e, t) => {
2469
- ui.init(e, t), O.init(e, t), e.unwrap = () => e._zod.def.innerType;
2470
- });
2471
- function jt(e) {
2472
- return new xr({
2473
- type: "optional",
2474
- innerType: e
2475
- });
2476
- }
2477
- const Ja = /* @__PURE__ */ u("ZodNullable", (e, t) => {
2478
- li.init(e, t), O.init(e, t), e.unwrap = () => e._zod.def.innerType;
2479
- });
2480
- function kt(e) {
2481
- return new Ja({
2482
- type: "nullable",
2483
- innerType: e
2484
- });
2485
- }
2486
- const Xa = /* @__PURE__ */ u("ZodDefault", (e, t) => {
2487
- di.init(e, t), O.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
2488
- });
2489
- function ec(e, t) {
2490
- return new Xa({
2491
- type: "default",
2492
- innerType: e,
2493
- get defaultValue() {
2494
- return typeof t == "function" ? t() : t;
2495
- }
2496
- });
2497
- }
2498
- const tc = /* @__PURE__ */ u("ZodPrefault", (e, t) => {
2499
- fi.init(e, t), O.init(e, t), e.unwrap = () => e._zod.def.innerType;
2500
- });
2501
- function rc(e, t) {
2502
- return new tc({
2503
- type: "prefault",
2504
- innerType: e,
2505
- get defaultValue() {
2506
- return typeof t == "function" ? t() : t;
2507
- }
2508
- });
2509
- }
2510
- const _r = /* @__PURE__ */ u("ZodNonOptional", (e, t) => {
2511
- hi.init(e, t), O.init(e, t), e.unwrap = () => e._zod.def.innerType;
2512
- });
2513
- function nc(e, t) {
2514
- return new _r({
2515
- type: "nonoptional",
2516
- innerType: e,
2517
- ..._(t)
2518
- });
2519
- }
2520
- const oc = /* @__PURE__ */ u("ZodCatch", (e, t) => {
2521
- pi.init(e, t), O.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
2522
- });
2523
- function sc(e, t) {
2524
- return new oc({
2525
- type: "catch",
2526
- innerType: e,
2527
- catchValue: typeof t == "function" ? t : () => t
2528
- });
2529
- }
2530
- const ic = /* @__PURE__ */ u("ZodPipe", (e, t) => {
2531
- mi.init(e, t), O.init(e, t), e.in = t.in, e.out = t.out;
2532
- });
2533
- function zt(e, t) {
2534
- return new ic({
2535
- type: "pipe",
2536
- in: e,
2537
- out: t
2538
- // ...util.normalizeParams(params),
2539
- });
2540
- }
2541
- const ac = /* @__PURE__ */ u("ZodReadonly", (e, t) => {
2542
- gi.init(e, t), O.init(e, t);
2543
- });
2544
- function cc(e) {
2545
- return new ac({
2546
- type: "readonly",
2547
- innerType: e
2548
- });
2549
- }
2550
- const br = /* @__PURE__ */ u("ZodCustom", (e, t) => {
2551
- vi.init(e, t), O.init(e, t);
2552
- });
2553
- function uc(e, t) {
2554
- const r = new U({
2555
- check: "custom",
2556
- ..._(t)
2557
- });
2558
- return r._zod.check = e, r;
2559
- }
2560
- function lc(e, t) {
2561
- return sa(br, e ?? (() => !0), t);
2562
- }
2563
- function dc(e, t = {}) {
2564
- return ia(br, e, t);
2565
- }
2566
- function fc(e, t) {
2567
- const r = uc((n) => (n.addIssue = (o) => {
2568
- if (typeof o == "string")
2569
- n.issues.push(ae(o, n.value, r._zod.def));
2570
- else {
2571
- const s = o;
2572
- s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), s.input ?? (s.input = n.value), s.inst ?? (s.inst = r), s.continue ?? (s.continue = !r._zod.def.abort), n.issues.push(ae(s));
2573
- }
2574
- }, e(n.value, n)), t);
2575
- return r;
2576
- }
2577
- const hc = Qa({
2578
- buildId: _e(),
2579
- timestamp: _e(),
2580
- status: yr(["in-progress", "success", "failed"])
2581
- }), pc = ({
2582
- buildId: e,
2583
- environmentType: t,
2584
- endpoint: r = "/__zuplo/docs"
2585
- }) => {
2586
- const n = Cn({
2587
- queryKey: ["zuplo-build-check", e, r],
2588
- refetchInterval: 3e3,
2589
- enabled: e !== void 0 && t === "WORKING_COPY",
2590
- retry: !1,
2591
- queryFn: () => fetch(r, { signal: AbortSignal.timeout(2e3) }).then((s) => {
2592
- if (!s.ok) throw new Error("Failed to fetch build status");
2593
- return s.json();
2594
- }).then((s) => hc.parse(s))
2595
- });
2596
- if (F(() => {
2597
- n.data?.status === "success" && n.data.buildId && (document.cookie = `zuplo-build=${n.data.buildId}; path=/; max-age=300; secure; SameSite=None`);
2598
- }, [n.data]), n.isError || !n.data || n.data.buildId === e)
2599
- return null;
2600
- const o = n.data.status === "success";
2601
- return /* @__PURE__ */ i.jsxs("div", { className: "fixed flex flex-col gap-3 p-4 rounded-xl w-96 border z-20 bg-background left-0 right-0 top-4 mx-auto shadow-lg", children: [
2602
- o ? /* @__PURE__ */ i.jsxs("div", { className: "flex flex-row items-center gap-2", children: [
2603
- /* @__PURE__ */ i.jsx(Ln, { size: 16 }),
2604
- /* @__PURE__ */ i.jsx("span", { className: "text-sm", children: "New version available" })
2605
- ] }) : /* @__PURE__ */ i.jsxs("div", { className: "flex flex-row items-center gap-2", children: [
2606
- /* @__PURE__ */ i.jsx(Qn, { size: 16, className: "animate-spin" }),
2607
- /* @__PURE__ */ i.jsx("span", { className: "text-sm", children: "Building new version..." })
2608
- ] }),
2609
- /* @__PURE__ */ i.jsx("span", { className: "text-xs", children: o ? "To see the new version, reload the page now." : "A new version of the developer portal will be available soon." }),
2610
- /* @__PURE__ */ i.jsx(
2611
- Ut,
2612
- {
2613
- variant: "outline",
2614
- size: "sm",
2615
- className: "w-full",
2616
- onClick: () => {
2617
- window.location.reload();
2618
- },
2619
- children: "Reload"
2620
- }
2621
- )
2622
- ] });
2623
- }, mc = () => {
2624
- const e = we(), t = H(e.pathname);
2625
- F(() => {
2626
- const r = t.current !== e.pathname, n = e.hash !== "";
2627
- r && !n && window.scrollTo(0, 0), t.current = e.pathname;
2628
- }, [e.pathname, e.hash]);
2629
- }, gc = ({
2630
- icon: e
2631
- }) => typeof e == "string" ? /* @__PURE__ */ i.jsx(
2632
- "img",
2633
- {
2634
- src: `https://cdn.simpleicons.org/${e}/000000/ffffff`,
2635
- className: "size-5",
2636
- alt: e
2637
- }
2638
- ) : e, vc = (e) => /^https?:/.test(e), yc = () => {
2639
- const { site: e } = au(), t = e?.footer;
2640
- return t ? /* @__PURE__ */ i.jsx("footer", { className: "border-t bg-background", children: /* @__PURE__ */ i.jsxs("div", { className: "mx-auto max-w-screen-2xl px-4 lg:px-8 py-8 pt-20", children: [
2641
- /* @__PURE__ */ i.jsxs(
2642
- "div",
2643
- {
2644
- className: N("flex flex-row gap-8", {
2645
- "justify-center": !t.position || t.position === "center",
2646
- "justify-start": t.position === "start",
2647
- "justify-end": t.position === "end"
2648
- }),
2649
- children: [
2650
- /* @__PURE__ */ i.jsx(A.Target, { name: "footer-before" }),
2651
- t.columns && /* @__PURE__ */ i.jsx(
2652
- "div",
2653
- {
2654
- className: "w-full md:max-w-screen-md grid grid-cols-[1fr_1fr] gap-8 md:grid-cols-[repeat(var(--columns),minmax(0,1fr))]",
2655
- style: { "--columns": t.columns.length },
2656
- children: t.columns.map((r) => /* @__PURE__ */ i.jsxs(
2657
- "div",
2658
- {
2659
- className: N({
2660
- "justify-self-center": !r.position || r.position === "center",
2661
- "justify-self-start": r.position === "start",
2662
- "justify-self-end": r.position === "end"
2663
- }),
2664
- children: [
2665
- /* @__PURE__ */ i.jsx("span", { className: "text-sm font-semibold", children: r.title }),
2666
- /* @__PURE__ */ i.jsx("ul", { className: "mt-4 space-y-2", children: r.links.map((n) => {
2667
- const o = "flex flex-row gap-1 items-center text-sm text-muted-foreground hover:text-accent-foreground";
2668
- return /* @__PURE__ */ i.jsx("li", { children: vc(n.href) ? /* @__PURE__ */ i.jsxs(
2669
- "a",
2670
- {
2671
- href: n.href,
2672
- target: "_blank",
2673
- rel: "noopener noreferrer",
2674
- className: o,
2675
- children: [
2676
- /* @__PURE__ */ i.jsx("span", { children: n.label }),
2677
- /* @__PURE__ */ i.jsx(Bn, { size: 12 })
2678
- ]
2679
- }
2680
- ) : /* @__PURE__ */ i.jsx(dn, { to: n.href, className: o, children: /* @__PURE__ */ i.jsx("span", { children: n.label }) }) }, n.href + n.label);
2681
- }) })
2682
- ]
2683
- },
2684
- r.title
2685
- ))
2686
- }
2687
- ),
2688
- /* @__PURE__ */ i.jsx(A.Target, { name: "footer-after" })
2689
- ]
2690
- }
2691
- ),
2692
- /* @__PURE__ */ i.jsxs(
2693
- "div",
2694
- {
2695
- className: N(
2696
- "flex items-center justify-between",
2697
- t.columns && "border-t mt-8 pt-8"
2698
- ),
2699
- children: [
2700
- t.logo && /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
2701
- /* @__PURE__ */ i.jsx(
2702
- "img",
2703
- {
2704
- src: t.logo.src.light,
2705
- alt: t.logo.alt,
2706
- className: "w-8 dark:hidden",
2707
- style: { width: t.logo.width }
2708
- }
2709
- ),
2710
- /* @__PURE__ */ i.jsx(
2711
- "img",
2712
- {
2713
- src: t.logo.src.dark,
2714
- alt: t.logo.alt,
2715
- className: "w-8 hidden dark:block",
2716
- style: { width: t.logo.width }
2717
- }
2718
- )
2719
- ] }),
2720
- t.copyright && /* @__PURE__ */ i.jsx("p", { className: "text-sm text-muted-foreground", children: t.copyright }),
2721
- /* @__PURE__ */ i.jsx("div", { className: "flex items-center gap-2", children: t.social?.map((r) => /* @__PURE__ */ i.jsxs(
2722
- "a",
2723
- {
2724
- href: r.href,
2725
- target: "_blank",
2726
- rel: "noopener noreferrer",
2727
- className: "w-auto gap-2 flex text-muted-foreground hover:text-accent-foreground",
2728
- children: [
2729
- /* @__PURE__ */ i.jsx(gc, { icon: r.icon }),
2730
- r.label
2731
- ]
2732
- },
2733
- r.href
2734
- )) })
2735
- ]
2736
- }
2737
- )
2738
- ] }) }) : null;
2739
- };
2740
- function Ie({
2741
- className: e,
2742
- ...t
2743
- }) {
2744
- return /* @__PURE__ */ i.jsx(
2745
- "div",
2746
- {
2747
- className: N("animate-pulse rounded-md bg-muted", e),
2748
- ...t
2749
- }
2750
- );
2751
- }
2752
- const $t = {
2753
- info: "bg-blue-500",
2754
- note: "bg-gray-500",
2755
- tip: "bg-green-600",
2756
- caution: "bg-orange-500",
2757
- danger: "bg-rose-500"
2758
- }, xc = () => {
2759
- const { site: e } = M(), [t, r] = J(!0);
2760
- if (!e?.banner || !t)
2761
- return /* @__PURE__ */ i.jsx("style", { children: ":root { --banner-height: 0px; }" });
2762
- const n = e.banner.color && e.banner.color in $t ? $t[e.banner.color] : e.banner.color ? void 0 : "bg-primary", o = n ? {} : { backgroundColor: e.banner.color };
2763
- return /* @__PURE__ */ i.jsxs(
2764
- "div",
2765
- {
2766
- className: N(
2767
- "relative text-primary-foreground text-sm font-medium px-4 py-2 flex gap-2 items-center lg:h-(--banner-height)",
2768
- n
2769
- ),
2770
- style: o,
2771
- children: [
2772
- /* @__PURE__ */ i.jsx("div", { className: "w-full", children: e.banner.message }),
2773
- e.banner.dismissible && /* @__PURE__ */ i.jsx(
2774
- "button",
2775
- {
2776
- type: "button",
2777
- className: "md:absolute md:end-4 -m-1.5 p-1.5 hover:bg-accent-foreground/10 rounded-md",
2778
- onClick: () => r(!1),
2779
- children: /* @__PURE__ */ i.jsx(Kn, { size: 16 })
2780
- }
2781
- )
2782
- ]
2783
- }
2784
- );
2785
- }, wr = (e) => /* @__PURE__ */ i.jsxs(
2786
- "svg",
2787
- {
2788
- xmlns: "http://www.w3.org/2000/svg",
2789
- viewBox: "0 0 132 100",
2790
- fill: "none",
2791
- ...e,
2792
- children: [
2793
- /* @__PURE__ */ i.jsx(
2794
- "path",
2795
- {
2796
- fill: "currentColor",
2797
- fillRule: "evenodd",
2798
- d: "M80.092 2.963A4.66 4.66 0 0 1 84.449 0h34.049c6.325 0 10.835 6.135 8.948 12.172L116.653 46.71a4.688 4.688 0 0 1-4.474 3.29H75c-5.178 0-7.813 4.687-9.375 9.374-1.288 3.864-11.07 28.963-14.467 37.662A4.66 4.66 0 0 1 46.801 100H12.75c-6.324 0-10.834-6.134-8.947-12.171l10.793-34.54A4.688 4.688 0 0 1 19.071 50H56.25c5.178 0 7.813-4.687 9.375-9.375 1.288-3.864 11.07-28.962 14.467-37.662Z",
2799
- clipRule: "evenodd"
2800
- }
2801
- ),
2802
- /* @__PURE__ */ i.jsx(
2803
- "path",
2804
- {
2805
- fill: "currentColor",
2806
- d: "M83.54 57.813a7.813 7.813 0 0 0-7.316 5.07L63.888 95.777c-.766 2.043.744 4.222 2.926 4.222h36.828c5.211 0 9.875-3.232 11.704-8.11l8.821-23.522c1.915-5.107-1.861-10.555-7.315-10.555H83.539ZM29.17 0a12.5 12.5 0 0 0-11.704 8.111l-8.82 23.521c-1.915 5.107 1.86 10.556 7.315 10.556h33.312a7.813 7.813 0 0 0 7.316-5.07L68.924 4.223C69.691 2.18 68.18 0 65.998 0H29.17Z"
2807
- }
2808
- )
2809
- ]
2810
- }
2811
- );
2812
- wr.displayName = "ZudokuLogo";
2813
- const jr = ({ className: e }) => /* @__PURE__ */ i.jsxs(
2814
- "a",
2815
- {
2816
- href: "https://zudoku.dev",
2817
- target: "_blank",
2818
- rel: "noopener noreferrer",
2819
- className: N(
2820
- "flex justify-between items-center w-full border border-transparent hover:border-border rounded-full hover:shadow-xs h-7 px-3 text-nowrap hover:bg-muted/80 transition-all",
2821
- e
2822
- ),
2823
- children: [
2824
- /* @__PURE__ */ i.jsxs("div", { className: "opacity-70 hover:opacity-100 transition-opacity gap-1.5 text-[11px] font-medium rounded-full h-7 flex items-center text-nowrap", children: [
2825
- /* @__PURE__ */ i.jsx(wr, { className: "w-3.5 h-3.5 dark:fill-white" }),
2826
- "powered by ",
2827
- "Zudoku"
2828
- ] }),
2829
- /* @__PURE__ */ i.jsx("div", { className: "text-xs font-medium opacity-70 hover:text-foreground transition-colors cursor-pointer", children: /* @__PURE__ */ i.jsx(
2830
- Hn,
2831
- {
2832
- size: 12,
2833
- absoluteStrokeWidth: !0,
2834
- strokeWidth: 1.5,
2835
- className: "rtl:rotate-180"
2836
- }
2837
- ) })
2838
- ]
2839
- }
2840
- );
2841
- function be() {
2842
- return be = Object.assign ? Object.assign.bind() : function(e) {
2843
- for (var t = 1; t < arguments.length; t++) {
2844
- var r = arguments[t];
2845
- for (var n in r) ({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
2846
- }
2847
- return e;
2848
- }, be.apply(null, arguments);
2849
- }
2850
- var me = { exports: {} }, $ = {};
2851
- /** @license React v16.13.1
2852
- * react-is.production.min.js
2853
- *
2854
- * Copyright (c) Facebook, Inc. and its affiliates.
2855
- *
2856
- * This source code is licensed under the MIT license found in the
2857
- * LICENSE file in the root directory of this source tree.
2858
- */
2859
- var Pt;
2860
- function _c() {
2861
- if (Pt) return $;
2862
- Pt = 1;
2863
- var e = typeof Symbol == "function" && Symbol.for, t = e ? Symbol.for("react.element") : 60103, r = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, o = e ? Symbol.for("react.strict_mode") : 60108, s = e ? Symbol.for("react.profiler") : 60114, a = e ? Symbol.for("react.provider") : 60109, c = e ? Symbol.for("react.context") : 60110, f = e ? Symbol.for("react.async_mode") : 60111, l = e ? Symbol.for("react.concurrent_mode") : 60111, v = e ? Symbol.for("react.forward_ref") : 60112, m = e ? Symbol.for("react.suspense") : 60113, p = e ? Symbol.for("react.suspense_list") : 60120, d = e ? Symbol.for("react.memo") : 60115, g = e ? Symbol.for("react.lazy") : 60116, w = e ? Symbol.for("react.block") : 60121, E = e ? Symbol.for("react.fundamental") : 60117, z = e ? Symbol.for("react.responder") : 60118, j = e ? Symbol.for("react.scope") : 60119;
2864
- function x(h) {
2865
- if (typeof h == "object" && h !== null) {
2866
- var k = h.$$typeof;
2867
- switch (k) {
2868
- case t:
2869
- switch (h = h.type, h) {
2870
- case f:
2871
- case l:
2872
- case n:
2873
- case s:
2874
- case o:
2875
- case m:
2876
- return h;
2877
- default:
2878
- switch (h = h && h.$$typeof, h) {
2879
- case c:
2880
- case v:
2881
- case g:
2882
- case d:
2883
- case a:
2884
- return h;
2885
- default:
2886
- return k;
2887
- }
2888
- }
2889
- case r:
2890
- return k;
2891
- }
2892
- }
2893
- }
2894
- function b(h) {
2895
- return x(h) === l;
2896
- }
2897
- return $.AsyncMode = f, $.ConcurrentMode = l, $.ContextConsumer = c, $.ContextProvider = a, $.Element = t, $.ForwardRef = v, $.Fragment = n, $.Lazy = g, $.Memo = d, $.Portal = r, $.Profiler = s, $.StrictMode = o, $.Suspense = m, $.isAsyncMode = function(h) {
2898
- return b(h) || x(h) === f;
2899
- }, $.isConcurrentMode = b, $.isContextConsumer = function(h) {
2900
- return x(h) === c;
2901
- }, $.isContextProvider = function(h) {
2902
- return x(h) === a;
2903
- }, $.isElement = function(h) {
2904
- return typeof h == "object" && h !== null && h.$$typeof === t;
2905
- }, $.isForwardRef = function(h) {
2906
- return x(h) === v;
2907
- }, $.isFragment = function(h) {
2908
- return x(h) === n;
2909
- }, $.isLazy = function(h) {
2910
- return x(h) === g;
2911
- }, $.isMemo = function(h) {
2912
- return x(h) === d;
2913
- }, $.isPortal = function(h) {
2914
- return x(h) === r;
2915
- }, $.isProfiler = function(h) {
2916
- return x(h) === s;
2917
- }, $.isStrictMode = function(h) {
2918
- return x(h) === o;
2919
- }, $.isSuspense = function(h) {
2920
- return x(h) === m;
2921
- }, $.isValidElementType = function(h) {
2922
- return typeof h == "string" || typeof h == "function" || h === n || h === l || h === s || h === o || h === m || h === p || typeof h == "object" && h !== null && (h.$$typeof === g || h.$$typeof === d || h.$$typeof === a || h.$$typeof === c || h.$$typeof === v || h.$$typeof === E || h.$$typeof === z || h.$$typeof === j || h.$$typeof === w);
2923
- }, $.typeOf = x, $;
2924
- }
2925
- var P = {};
2926
- /** @license React v16.13.1
2927
- * react-is.development.js
2928
- *
2929
- * Copyright (c) Facebook, Inc. and its affiliates.
2930
- *
2931
- * This source code is licensed under the MIT license found in the
2932
- * LICENSE file in the root directory of this source tree.
2933
- */
2934
- var Et;
2935
- function bc() {
2936
- return Et || (Et = 1, process.env.NODE_ENV !== "production" && function() {
2937
- var e = typeof Symbol == "function" && Symbol.for, t = e ? Symbol.for("react.element") : 60103, r = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, o = e ? Symbol.for("react.strict_mode") : 60108, s = e ? Symbol.for("react.profiler") : 60114, a = e ? Symbol.for("react.provider") : 60109, c = e ? Symbol.for("react.context") : 60110, f = e ? Symbol.for("react.async_mode") : 60111, l = e ? Symbol.for("react.concurrent_mode") : 60111, v = e ? Symbol.for("react.forward_ref") : 60112, m = e ? Symbol.for("react.suspense") : 60113, p = e ? Symbol.for("react.suspense_list") : 60120, d = e ? Symbol.for("react.memo") : 60115, g = e ? Symbol.for("react.lazy") : 60116, w = e ? Symbol.for("react.block") : 60121, E = e ? Symbol.for("react.fundamental") : 60117, z = e ? Symbol.for("react.responder") : 60118, j = e ? Symbol.for("react.scope") : 60119;
2938
- function x(y) {
2939
- return typeof y == "string" || typeof y == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
2940
- y === n || y === l || y === s || y === o || y === m || y === p || typeof y == "object" && y !== null && (y.$$typeof === g || y.$$typeof === d || y.$$typeof === a || y.$$typeof === c || y.$$typeof === v || y.$$typeof === E || y.$$typeof === z || y.$$typeof === j || y.$$typeof === w);
2941
- }
2942
- function b(y) {
2943
- if (typeof y == "object" && y !== null) {
2944
- var Pe = y.$$typeof;
2945
- switch (Pe) {
2946
- case t:
2947
- var ue = y.type;
2948
- switch (ue) {
2949
- case f:
2950
- case l:
2951
- case n:
2952
- case s:
2953
- case o:
2954
- case m:
2955
- return ue;
2956
- default:
2957
- var Ge = ue && ue.$$typeof;
2958
- switch (Ge) {
2959
- case c:
2960
- case v:
2961
- case g:
2962
- case d:
2963
- case a:
2964
- return Ge;
2965
- default:
2966
- return Pe;
2967
- }
2968
- }
2969
- case r:
2970
- return Pe;
2971
- }
2972
- }
2973
- }
2974
- var h = f, k = l, R = c, D = a, ee = t, Q = v, $e = n, Y = g, Dr = d, Mr = r, Fr = s, qr = o, Ur = m, Ve = !1;
2975
- function Lr(y) {
2976
- return Ve || (Ve = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), Ye(y) || b(y) === f;
2977
- }
2978
- function Ye(y) {
2979
- return b(y) === l;
2980
- }
2981
- function Qr(y) {
2982
- return b(y) === c;
2983
- }
2984
- function Br(y) {
2985
- return b(y) === a;
2986
- }
2987
- function Kr(y) {
2988
- return typeof y == "object" && y !== null && y.$$typeof === t;
2989
- }
2990
- function Hr(y) {
2991
- return b(y) === v;
2992
- }
2993
- function Wr(y) {
2994
- return b(y) === n;
2995
- }
2996
- function Vr(y) {
2997
- return b(y) === g;
2998
- }
2999
- function Yr(y) {
3000
- return b(y) === d;
3001
- }
3002
- function Gr(y) {
3003
- return b(y) === r;
3004
- }
3005
- function Jr(y) {
3006
- return b(y) === s;
3007
- }
3008
- function Xr(y) {
3009
- return b(y) === o;
3010
- }
3011
- function en(y) {
3012
- return b(y) === m;
3013
- }
3014
- P.AsyncMode = h, P.ConcurrentMode = k, P.ContextConsumer = R, P.ContextProvider = D, P.Element = ee, P.ForwardRef = Q, P.Fragment = $e, P.Lazy = Y, P.Memo = Dr, P.Portal = Mr, P.Profiler = Fr, P.StrictMode = qr, P.Suspense = Ur, P.isAsyncMode = Lr, P.isConcurrentMode = Ye, P.isContextConsumer = Qr, P.isContextProvider = Br, P.isElement = Kr, P.isForwardRef = Hr, P.isFragment = Wr, P.isLazy = Vr, P.isMemo = Yr, P.isPortal = Gr, P.isProfiler = Jr, P.isStrictMode = Xr, P.isSuspense = en, P.isValidElementType = x, P.typeOf = b;
3015
- }()), P;
3016
- }
3017
- var St;
3018
- function wc() {
3019
- return St || (St = 1, process.env.NODE_ENV === "production" ? me.exports = _c() : me.exports = bc()), me.exports;
3020
- }
3021
- var Ze, Zt;
3022
- function jc() {
3023
- if (Zt) return Ze;
3024
- Zt = 1;
3025
- var e = wc(), t = {
3026
- childContextTypes: !0,
3027
- contextType: !0,
3028
- contextTypes: !0,
3029
- defaultProps: !0,
3030
- displayName: !0,
3031
- getDefaultProps: !0,
3032
- getDerivedStateFromError: !0,
3033
- getDerivedStateFromProps: !0,
3034
- mixins: !0,
3035
- propTypes: !0,
3036
- type: !0
3037
- }, r = {
3038
- name: !0,
3039
- length: !0,
3040
- prototype: !0,
3041
- caller: !0,
3042
- callee: !0,
3043
- arguments: !0,
3044
- arity: !0
3045
- }, n = {
3046
- $$typeof: !0,
3047
- render: !0,
3048
- defaultProps: !0,
3049
- displayName: !0,
3050
- propTypes: !0
3051
- }, o = {
3052
- $$typeof: !0,
3053
- compare: !0,
3054
- defaultProps: !0,
3055
- displayName: !0,
3056
- propTypes: !0,
3057
- type: !0
3058
- }, s = {};
3059
- s[e.ForwardRef] = n, s[e.Memo] = o;
3060
- function a(g) {
3061
- return e.isMemo(g) ? o : s[g.$$typeof] || t;
3062
- }
3063
- var c = Object.defineProperty, f = Object.getOwnPropertyNames, l = Object.getOwnPropertySymbols, v = Object.getOwnPropertyDescriptor, m = Object.getPrototypeOf, p = Object.prototype;
3064
- function d(g, w, E) {
3065
- if (typeof w != "string") {
3066
- if (p) {
3067
- var z = m(w);
3068
- z && z !== p && d(g, z, E);
3069
- }
3070
- var j = f(w);
3071
- l && (j = j.concat(l(w)));
3072
- for (var x = a(g), b = a(w), h = 0; h < j.length; ++h) {
3073
- var k = j[h];
3074
- if (!r[k] && !(E && E[k]) && !(b && b[k]) && !(x && x[k])) {
3075
- var R = v(w, k);
3076
- try {
3077
- c(g, k, R);
3078
- } catch {
3079
- }
3080
- }
3081
- }
3082
- }
3083
- return g;
3084
- }
3085
- return Ze = d, Ze;
3086
- }
3087
- jc();
3088
- var kr = function(t, r, n) {
3089
- return t = t <= n ? t : n, t = t >= r ? t : r, t;
3090
- }, kc = function() {
3091
- var t = !1, r = [], n = function() {
3092
- t = !0;
3093
- var c = r.shift();
3094
- if (c)
3095
- return c(n);
3096
- t = !1;
3097
- }, o = function() {
3098
- t = !1, r = [];
3099
- }, s = function(c) {
3100
- r.push(c), !t && r.length === 1 && n();
3101
- };
3102
- return {
3103
- clear: o,
3104
- enqueue: s
3105
- };
3106
- }, zc = function() {
3107
- var t, r = function() {
3108
- t && window.cancelAnimationFrame(t);
3109
- }, n = function(s, a) {
3110
- var c, f, l = function(m) {
3111
- if (f = f || m, c = m - f, c > a) {
3112
- s();
3113
- return;
3114
- }
3115
- t = window.requestAnimationFrame(l);
3116
- };
3117
- t = window.requestAnimationFrame(l);
3118
- };
3119
- return {
3120
- cancel: r,
3121
- schedule: n
3122
- };
3123
- }, $c = function(t) {
3124
- var r = 0;
3125
- return t >= 0 && t < 0.2 ? r = 0.1 : t >= 0.2 && t < 0.5 ? r = 0.04 : t >= 0.5 && t < 0.8 ? r = 0.02 : t >= 0.8 && t < 0.99 && (r = 5e-3), kr(t + r, 0, 0.994);
3126
- }, Tt = function(t) {
3127
- F(t, []);
3128
- }, Pc = function(t) {
3129
- return ++t % 1e6;
3130
- }, Ec = function() {
3131
- var t = J(0), r = t[1];
3132
- return B(function() {
3133
- return r(Pc);
3134
- }, []);
3135
- }, Sc = function(t) {
3136
- t === void 0 && (t = {});
3137
- var r = Ec(), n = H(be({}, t)), o = B(function() {
3138
- return n.current;
3139
- }, []), s = B(function(a) {
3140
- a && (Object.assign(n.current, a), r());
3141
- }, []);
3142
- return [o, s];
3143
- }, Zc = function() {
3144
- var t = H(!0);
3145
- return t.current ? (t.current = !1, !0) : t.current;
3146
- }, Ct = function(t, r) {
3147
- var n = Zc();
3148
- F(function() {
3149
- if (!n)
3150
- return t();
3151
- }, r);
3152
- }, zr = function() {
3153
- }, Ot = {
3154
- isFinished: !0,
3155
- progress: 0,
3156
- sideEffect: zr
3157
- }, Tc = function(t) {
3158
- var r = t === void 0 ? {} : t, n = r.animationDuration, o = n === void 0 ? 200 : n, s = r.incrementDuration, a = s === void 0 ? 800 : s, c = r.isAnimating, f = c === void 0 ? !1 : c, l = r.minimum, v = l === void 0 ? 0.08 : l, m = Sc(Ot), p = m[0], d = m[1], g = H(null), w = H(null);
3159
- Tt(function() {
3160
- g.current = kc(), w.current = zc();
3161
- });
3162
- var E = B(function() {
3163
- var k, R;
3164
- (k = w.current) == null || k.cancel(), (R = g.current) == null || R.clear();
3165
- }, []), z = B(function(k) {
3166
- var R;
3167
- if (k = kr(k, v, 1), k === 1) {
3168
- var D, ee;
3169
- E(), (D = g.current) == null || D.enqueue(function(Q) {
3170
- d({
3171
- progress: k,
3172
- sideEffect: function() {
3173
- var Y;
3174
- return (Y = w.current) == null ? void 0 : Y.schedule(Q, o);
3175
- }
3176
- });
3177
- }), (ee = g.current) == null || ee.enqueue(function() {
3178
- d({
3179
- isFinished: !0,
3180
- sideEffect: E
3181
- });
3182
- });
3183
- return;
3184
- }
3185
- (R = g.current) == null || R.enqueue(function(Q) {
3186
- d({
3187
- isFinished: !1,
3188
- progress: k,
3189
- sideEffect: function() {
3190
- var Y;
3191
- return (Y = w.current) == null ? void 0 : Y.schedule(Q, o);
3192
- }
3193
- });
3194
- });
3195
- }, [o, E, v, g, d, w]), j = B(function() {
3196
- z($c(p().progress));
3197
- }, [p, z]), x = B(function() {
3198
- var k = function() {
3199
- var D;
3200
- j(), (D = g.current) == null || D.enqueue(function(ee) {
3201
- var Q;
3202
- (Q = w.current) == null || Q.schedule(function() {
3203
- k(), ee();
3204
- }, a);
3205
- });
3206
- };
3207
- k();
3208
- }, [a, g, w, j]), b = H(zr), h = p().sideEffect;
3209
- return F(function() {
3210
- b.current = j;
3211
- }), Tt(function() {
3212
- return f && x(), E;
3213
- }), Ct(function() {
3214
- p().sideEffect();
3215
- }, [p, h]), Ct(function() {
3216
- f ? d(be({}, Ot, {
3217
- sideEffect: x
3218
- })) : z(1);
3219
- }, [f, z, d, x]), {
3220
- animationDuration: o,
3221
- isFinished: p().isFinished,
3222
- progress: p().progress
3223
- };
3224
- };
3225
- const $r = () => {
3226
- const t = Fe().state === "loading", [r, n] = J(!1);
3227
- F(() => {
3228
- const a = setTimeout(() => n(t), 200);
3229
- return () => clearTimeout(a);
3230
- }, [t]);
3231
- const { isFinished: o, progress: s } = Tc({ isAnimating: r });
3232
- return /* @__PURE__ */ i.jsx(
3233
- "div",
3234
- {
3235
- className: "absolute w-0 left-0 right-0 bottom-[-1px] h-[2px] bg-primary transition-all duration-300 ease-in-out",
3236
- style: {
3237
- opacity: o ? 0 : 1,
3238
- width: o ? 0 : `${s * 100}%`
3239
- }
3240
- }
3241
- );
3242
- };
3243
- function Cc() {
3244
- const e = navigator.userAgent.toLowerCase();
3245
- if (e.includes("win")) return "Windows";
3246
- if (e.includes("mac")) return "macOS";
3247
- if (e.includes("linux")) return "Linux";
3248
- }
3249
- const Pr = ({ className: e }) => {
3250
- const t = M(), [r, n] = J(!1), o = B(() => n(!1), []);
3251
- F(() => {
3252
- if (r)
3253
- return;
3254
- function a(c) {
3255
- c.key === "k" && (c.metaKey || c.ctrlKey) && (c.preventDefault(), n(!0));
3256
- }
3257
- return window.addEventListener("keydown", a), () => {
3258
- window.removeEventListener("keydown", a);
3259
- };
3260
- }, [r, n]);
3261
- const s = t.plugins.find(Xn);
3262
- return s ? /* @__PURE__ */ i.jsxs("div", { className: e, children: [
3263
- /* @__PURE__ */ i.jsxs(
3264
- "button",
3265
- {
3266
- type: "button",
3267
- onClick: () => n(!0),
3268
- className: "flex items-center border border-input hover:bg-accent hover:text-accent-foreground p-4 relative h-8 justify-start rounded-lg bg-background text-sm text-muted-foreground shadow-none w-full sm:w-72",
3269
- children: [
3270
- /* @__PURE__ */ i.jsxs("div", { className: "flex items-center gap-2 grow", children: [
3271
- /* @__PURE__ */ i.jsx(Wn, { size: 14 }),
3272
- "Search"
3273
- ] }),
3274
- /* @__PURE__ */ i.jsx(re, { children: /* @__PURE__ */ i.jsx(Oc, {}) })
3275
- ]
3276
- }
3277
- ),
3278
- /* @__PURE__ */ i.jsx(Le, { fallback: null, children: s.renderSearch({
3279
- isOpen: r,
3280
- onClose: o
3281
- }) })
3282
- ] }) : null;
3283
- }, Oc = () => {
3284
- const e = Cc();
3285
- return /* @__PURE__ */ i.jsxs("kbd", { className: "absolute end-1.5 hidden h-5 select-none items-center gap-1 rounded-sm border bg-muted px-1.5 font-mono text-[11px] font-medium opacity-100 sm:flex", children: [
3286
- e === "macOS" ? "⌘" : "Ctrl",
3287
- "+K"
3288
- ] });
3289
- }, Er = () => {
3290
- const { resolvedTheme: e, setTheme: t } = Dt();
3291
- return /* @__PURE__ */ i.jsx(re, { fallback: /* @__PURE__ */ i.jsx(Ce, { variant: "ghost", size: "icon" }), children: /* @__PURE__ */ i.jsxs(
3292
- "button",
3293
- {
3294
- type: "button",
3295
- className: "flex rounded-full border p-0.5 gap-0.5 group",
3296
- onClick: () => t(e === "dark" ? "light" : "dark"),
3297
- "aria-label": e === "dark" ? "Switch to light mode" : "Switch to dark mode",
3298
- children: [
3299
- /* @__PURE__ */ i.jsx(
3300
- "div",
3301
- {
3302
- className: N(
3303
- "border border-transparent rounded-full p-0.5 [&>svg>circle]:transition-colors [&>svg>path]:transition-transform transition-all [&>svg>path]:duration-200 [&>svg>circle]:duration-500 [&>svg>circle]:fill-transparent",
3304
- e === "light" && "border-border bg-muted",
3305
- e === "dark" && "group-hover:[&>svg>path]:scale-110 group-hover:[&>svg>path]:-translate-x-[1px] group-hover:[&>svg>path]:-translate-y-[1px] group-hover:rotate-[15deg] "
3306
- ),
3307
- children: /* @__PURE__ */ i.jsx(Vn, { size: 16 })
3308
- }
3309
- ),
3310
- /* @__PURE__ */ i.jsx(
3311
- "div",
3312
- {
3313
- className: N(
3314
- "border border-transparent rounded-full p-0.5 transition-transform transform-gpu duration-500",
3315
- e === "dark" && "border-border bg-muted [&>svg>path]:fill-white [&>svg>path]:stroke-transparent",
3316
- e === "light" && "group-hover:rotate-[-10deg] [&>svg>path]:stroke-currentColor"
3317
- ),
3318
- children: /* @__PURE__ */ i.jsx(Yn, { size: 16 })
3319
- }
3320
- )
3321
- ]
3322
- }
3323
- ) });
3324
- }, Nc = () => {
3325
- const e = M(), { navigation: t } = e, r = se(), n = t.filter(Ht(r, e));
3326
- return n.length === 0 ? /* @__PURE__ */ i.jsx("style", { children: ":root { --top-nav-height: 0px; }" }) : /* @__PURE__ */ i.jsx(Le, { children: /* @__PURE__ */ i.jsxs("div", { className: "items-center justify-between px-8 h-(--top-nav-height) hidden lg:flex text-sm relative", children: [
3327
- /* @__PURE__ */ i.jsx("nav", { className: "text-sm", children: /* @__PURE__ */ i.jsx("ul", { className: "flex flex-row items-center gap-8", children: n.map((o) => /* @__PURE__ */ i.jsx("li", { children: /* @__PURE__ */ i.jsx(Zr, { ...o }) }, o.label + o.type)) }) }),
3328
- /* @__PURE__ */ i.jsx(A.Target, { name: "top-navigation-side" })
3329
- ] }) });
3330
- }, Sr = (e) => {
3331
- switch (e.type) {
3332
- case "doc":
3333
- return te(e.path);
3334
- case "link":
3335
- return e.to;
3336
- case "category":
3337
- return e.link?.path ? te(e.link.path) : On(e, (t) => {
3338
- if (t.type !== "category")
3339
- return Sr(t);
3340
- }) ?? "";
3341
- case "custom-page":
3342
- return e.path;
3343
- }
3344
- }, De = ({
3345
- isActive: e,
3346
- children: t,
3347
- ...r
3348
- }) => /* @__PURE__ */ i.jsx(
3349
- cn,
3350
- {
3351
- viewTransition: !0,
3352
- className: ({ isActive: n, isPending: o }) => {
3353
- const s = n || e;
3354
- return yo(
3355
- "flex items-center gap-2 lg:py-3.5 font-medium -mb-px transition duration-150 delay-75 relative",
3356
- s || o ? [
3357
- "text-foreground",
3358
- // underline with view transition animation
3359
- "after:content-[''] after:absolute after:bottom-0 after:left-0 after:right-0",
3360
- "after:h-0.5 after:bg-primary",
3361
- s && "after:[view-transition-name:top-nav-underline]",
3362
- o && "after:bg-primary/25"
3363
- ] : "text-foreground/75 hover:text-foreground"
3364
- );
3365
- },
3366
- ...r,
3367
- children: t
3368
- }
3369
- ), Zr = (e) => {
3370
- const t = Wt(), r = fn(t.topNavItem, e), n = Sr(e);
3371
- return (
3372
- // We don't use isActive here because it has to be inside the navigation,
3373
- // the top nav id doesn't necessarily start with the navigation id
3374
- /* @__PURE__ */ i.jsxs(De, { to: n, isActive: r, children: [
3375
- e.icon && /* @__PURE__ */ i.jsx(e.icon, { size: 16, className: "align-[-0.125em]" }),
3376
- e.label
3377
- ] })
3378
- );
3379
- }, Ac = () => {
3380
- const e = M(), t = se(), { navigation: r, options: n, getProfileMenuItems: o } = e, { isAuthenticated: s, profile: a, isAuthEnabled: c } = t, [f, l] = J(!1), v = o(), m = r.filter(Ht(t, e));
3381
- return /* @__PURE__ */ i.jsxs(
3382
- go,
3383
- {
3384
- direction: n.site?.dir === "rtl" ? "left" : "right",
3385
- open: f,
3386
- onOpenChange: (p) => l(p),
3387
- children: [
3388
- /* @__PURE__ */ i.jsxs("div", { className: "flex lg:hidden justify-self-end", children: [
3389
- /* @__PURE__ */ i.jsx(vo, { className: "lg:hidden", children: /* @__PURE__ */ i.jsx(Gn, { size: 22 }) }),
3390
- /* @__PURE__ */ i.jsx($r, {})
3391
- ] }),
3392
- /* @__PURE__ */ i.jsx(
3393
- er,
3394
- {
3395
- className: "lg:hidden h-[100dvh] end-0 start-auto w-[320px] rounded-none",
3396
- "aria-describedby": void 0,
3397
- children: /* @__PURE__ */ i.jsxs("div", { className: "p-4 overflow-y-auto overscroll-none h-full flex flex-col justify-between", children: [
3398
- /* @__PURE__ */ i.jsxs("div", { children: [
3399
- /* @__PURE__ */ i.jsx(Xt, { children: /* @__PURE__ */ i.jsx(tr, { children: "Navigation" }) }),
3400
- /* @__PURE__ */ i.jsx(Pr, { className: "flex p-4" }),
3401
- /* @__PURE__ */ i.jsxs("ul", { className: "flex flex-col items-center gap-4 p-4", children: [
3402
- /* @__PURE__ */ i.jsx("li", { className: "empty:hidden", children: /* @__PURE__ */ i.jsx(A.Target, { name: "top-navigation-side" }) }),
3403
- c && /* @__PURE__ */ i.jsx(
3404
- re,
3405
- {
3406
- fallback: /* @__PURE__ */ i.jsx(Ie, { className: "rounded-sm h-5 w-24 mr-4" }),
3407
- children: s ? Object.values(o()).length > 0 && /* @__PURE__ */ i.jsx(Mn, { children: /* @__PURE__ */ i.jsxs("li", { children: [
3408
- a?.name ? `${a.name}` : "My Account",
3409
- a?.email && /* @__PURE__ */ i.jsx("div", { className: "font-normal text-muted-foreground", children: a.email })
3410
- ] }) }) : /* @__PURE__ */ i.jsx("li", { children: /* @__PURE__ */ i.jsx(
3411
- De,
3412
- {
3413
- to: "/signin",
3414
- onClick: () => l(!1),
3415
- children: "Login"
3416
- }
3417
- ) })
3418
- }
3419
- ),
3420
- m.map((p) => /* @__PURE__ */ i.jsx("li", { children: /* @__PURE__ */ i.jsx("button", { type: "button", onClick: () => l(!1), children: /* @__PURE__ */ i.jsx(Zr, { ...p }) }) }, p.label)),
3421
- c && s && v.length > 0 && /* @__PURE__ */ i.jsx(
3422
- re,
3423
- {
3424
- fallback: /* @__PURE__ */ i.jsx(Ie, { className: "rounded-sm h-5 w-24 mr-4" }),
3425
- children: v.map((p) => /* @__PURE__ */ i.jsx("li", { children: /* @__PURE__ */ i.jsx(
3426
- De,
3427
- {
3428
- to: p.path ?? "",
3429
- onClick: () => l(!1),
3430
- children: p.label
3431
- }
3432
- ) }, p.label))
3433
- }
3434
- ),
3435
- /* @__PURE__ */ i.jsx("li", { children: /* @__PURE__ */ i.jsx(Er, {}) })
3436
- ] })
3437
- ] }),
3438
- n.site?.showPoweredBy !== !1 && /* @__PURE__ */ i.jsx(jr, { className: "grow-0 justify-center gap-1" })
3439
- ] })
3440
- }
3441
- )
3442
- ]
3443
- }
3444
- );
3445
- }, ve = ({ item: e }) => e.children ? /* @__PURE__ */ i.jsxs(lo, { children: [
3446
- /* @__PURE__ */ i.jsx(fo, { children: e.label }),
3447
- /* @__PURE__ */ i.jsx(ho, { children: /* @__PURE__ */ i.jsx(po, { children: e.children.map((t, r) => (
3448
- // eslint-disable-next-line react/no-array-index-key
3449
- /* @__PURE__ */ i.jsx(ve, { item: t }, r)
3450
- )) }) })
3451
- ] }, e.label) : /* @__PURE__ */ i.jsx(qe, { to: e.path ?? "", children: /* @__PURE__ */ i.jsxs(mo, { className: "flex gap-2", children: [
3452
- e.icon && /* @__PURE__ */ i.jsx(e.icon, { size: 16, strokeWidth: 1, absoluteStrokeWidth: !0 }),
3453
- e.label
3454
- ] }, e.label) }), Tr = Yt(function() {
3455
- const t = se(), { isAuthenticated: r, profile: n, isAuthEnabled: o } = se(), s = M(), { site: a, plugins: c, options: f } = s, l = c.filter((d) => Jt(d)).flatMap((d) => d.getProfileMenuItems(s)).sort((d) => d.weight ?? 0), v = a?.logo ? /https?:\/\//.test(a.logo.src.light) ? a.logo.src.light : te(f.basePath, a.logo.src.light) : void 0, m = a?.logo ? /https?:\/\//.test(a.logo.src.dark) ? a.logo.src.dark : te(f.basePath, a.logo.src.dark) : void 0, p = "inset-shadow-[0_-1px_0_0_var(--border)]";
3456
- return /* @__PURE__ */ i.jsxs(
3457
- "header",
3458
- {
3459
- className: "sticky lg:top-0 z-10 bg-background/80 backdrop-blur w-full",
3460
- "data-pagefind-ignore": "all",
3461
- children: [
3462
- /* @__PURE__ */ i.jsx(xc, {}),
3463
- /* @__PURE__ */ i.jsxs("div", { className: N(p, "relative"), children: [
3464
- /* @__PURE__ */ i.jsx($r, {}),
3465
- /* @__PURE__ */ i.jsxs("div", { className: "max-w-screen-2xl mx-auto flex items-center justify-between h-(--top-header-height) px-4 lg:px-8 border-transparent", children: [
3466
- /* @__PURE__ */ i.jsx("div", { className: "flex", children: /* @__PURE__ */ i.jsx(qe, { to: a?.logo?.href ?? "/", children: /* @__PURE__ */ i.jsx("div", { className: "flex items-center gap-3.5", children: a?.logo ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
3467
- /* @__PURE__ */ i.jsx(
3468
- "img",
3469
- {
3470
- src: v,
3471
- alt: a.logo.alt ?? a.title,
3472
- style: { width: a.logo.width },
3473
- className: "max-h-(--top-header-height) dark:hidden",
3474
- loading: "lazy"
3475
- }
3476
- ),
3477
- /* @__PURE__ */ i.jsx(
3478
- "img",
3479
- {
3480
- src: m,
3481
- alt: a.logo.alt ?? a.title,
3482
- style: { width: a.logo.width },
3483
- className: "max-h-(--top-header-height) hidden dark:block",
3484
- loading: "lazy"
3485
- }
3486
- )
3487
- ] }) : /* @__PURE__ */ i.jsx("span", { className: "font-semibold text-2xl", children: a?.title }) }) }) }),
3488
- /* @__PURE__ */ i.jsx("div", { className: "absolute inset-x-0 justify-center items-center hidden lg:flex w-full pointer-events-none", children: /* @__PURE__ */ i.jsx(Pr, { className: "pointer-events-auto" }) }),
3489
- /* @__PURE__ */ i.jsxs("div", { className: "flex items-center gap-8", children: [
3490
- /* @__PURE__ */ i.jsx(Ac, {}),
3491
- /* @__PURE__ */ i.jsxs("div", { className: "hidden lg:flex items-center justify-self-end text-sm gap-2", children: [
3492
- /* @__PURE__ */ i.jsx(A.Target, { name: "head-navigation-start" }),
3493
- o && /* @__PURE__ */ i.jsx(
3494
- re,
3495
- {
3496
- fallback: /* @__PURE__ */ i.jsx(Ie, { className: "rounded-sm h-5 w-24 mr-4" }),
3497
- children: r ? Object.values(l).length > 0 && /* @__PURE__ */ i.jsxs(io, { modal: !1, children: [
3498
- /* @__PURE__ */ i.jsx(ao, { asChild: !0, children: /* @__PURE__ */ i.jsx(Ce, { variant: "ghost", children: n?.name ?? "My Account" }) }),
3499
- /* @__PURE__ */ i.jsxs(co, { className: "w-56", children: [
3500
- /* @__PURE__ */ i.jsxs(uo, { children: [
3501
- n?.name ? `${n.name}` : "My Account",
3502
- n?.email && /* @__PURE__ */ i.jsx("div", { className: "font-normal text-muted-foreground", children: n.email })
3503
- ] }),
3504
- l.filter((d) => d.category === "top").length > 0 && /* @__PURE__ */ i.jsx(Se, {}),
3505
- l.filter((d) => d.category === "top").map((d) => /* @__PURE__ */ i.jsx(ve, { item: d }, d.label)),
3506
- l.filter(
3507
- (d) => !d.category || d.category === "middle"
3508
- ).length > 0 && /* @__PURE__ */ i.jsx(Se, {}),
3509
- l.filter(
3510
- (d) => !d.category || d.category === "middle"
3511
- ).map((d) => /* @__PURE__ */ i.jsx(ve, { item: d }, d.label)),
3512
- l.filter((d) => d.category === "bottom").length > 0 && /* @__PURE__ */ i.jsx(Se, {}),
3513
- l.filter((d) => d.category === "bottom").map((d) => /* @__PURE__ */ i.jsx(ve, { item: d }, d.label))
3514
- ] })
3515
- ] }) : /* @__PURE__ */ i.jsx(Ce, { variant: "ghost", onClick: () => t.login(), children: "Login" })
3516
- }
3517
- ),
3518
- /* @__PURE__ */ i.jsx(A.Target, { name: "head-navigation-end" }),
3519
- /* @__PURE__ */ i.jsx(Er, {})
3520
- ] })
3521
- ] })
3522
- ] })
3523
- ] }),
3524
- /* @__PURE__ */ i.jsx("div", { className: N("hidden lg:block", p), children: /* @__PURE__ */ i.jsxs("div", { className: "max-w-screen-2xl mx-auto border-transparent relative", children: [
3525
- /* @__PURE__ */ i.jsx(A.Target, { name: "top-navigation-before" }),
3526
- /* @__PURE__ */ i.jsx(Nc, {}),
3527
- /* @__PURE__ */ i.jsx(A.Target, { name: "top-navigation-after" })
3528
- ] }) })
3529
- ]
3530
- }
3531
- );
3532
- }), Cr = ({
3533
- shouldScaleBackground: e = !0,
3534
- ...t
3535
- }) => /* @__PURE__ */ i.jsx(
3536
- q.Root,
3537
- {
3538
- shouldScaleBackground: e,
3539
- ...t
3540
- }
3541
- );
3542
- Cr.displayName = "Drawer";
3543
- const Rc = q.Trigger, Ic = q.Portal, Or = K.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ i.jsx(
3544
- q.Overlay,
3545
- {
3546
- ref: r,
3547
- className: N("fixed inset-0 z-50 bg-black/80", e),
3548
- ...t
3549
- }
3550
- ));
3551
- Or.displayName = q.Overlay.displayName;
3552
- const Dc = K.forwardRef(
3553
- ({ className: e, children: t, hideBar: r = !0, ...n }, o) => /* @__PURE__ */ i.jsxs(Ic, { children: [
3554
- /* @__PURE__ */ i.jsx(Or, {}),
3555
- /* @__PURE__ */ i.jsxs(
3556
- q.Content,
3557
- {
3558
- ref: o,
3559
- className: N(
3560
- "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
3561
- e
3562
- ),
3563
- ...n,
3564
- children: [
3565
- !r && /* @__PURE__ */ i.jsx("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" }),
3566
- t
3567
- ]
3568
- }
3569
- )
3570
- ] })
3571
- );
3572
- Dc.displayName = "DrawerContent";
3573
- const Mc = K.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ i.jsx(
3574
- q.Title,
3575
- {
3576
- ref: r,
3577
- className: N(
3578
- "text-lg font-semibold leading-none tracking-tight",
3579
- e
3580
- ),
3581
- ...t
3582
- }
3583
- ));
3584
- Mc.displayName = q.Title.displayName;
3585
- const Fc = K.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ i.jsx(
3586
- q.Description,
3587
- {
3588
- ref: r,
3589
- className: N("text-sm text-muted-foreground", e),
3590
- ...t
3591
- }
3592
- ));
3593
- Fc.displayName = q.Description.displayName;
3594
- const Nr = ({
3595
- children: e,
3596
- className: t
3597
- }) => {
3598
- const { options: r } = M(), n = H(null);
3599
- return F(() => {
3600
- const o = n.current?.querySelector('[aria-current="page"]');
3601
- hn(o ?? null);
3602
- }, []), /* @__PURE__ */ i.jsxs(
3603
- "div",
3604
- {
3605
- className: "grid sticky top-(--header-height) lg:h-[calc(100vh-var(--header-height))] grid-rows-[1fr_min-content] border-r",
3606
- "data-pagefind-ignore": "all",
3607
- children: [
3608
- /* @__PURE__ */ i.jsx(
3609
- "nav",
3610
- {
3611
- ref: n,
3612
- className: N(
3613
- "hidden max-w-[calc(var(--side-nav-width)+var(--padding-nav-item))] lg:flex scrollbar flex-col overflow-y-auto shrink-0 text-sm pe-3 ps-4 lg:ps-8",
3614
- "-mx-(--padding-nav-item) pb-[8vh] pt-(--padding-content-top) scroll-pt-2 gap-1",
3615
- // Revert the padding/margin on the first child
3616
- "-mt-2.5",
3617
- t
3618
- ),
3619
- style: {
3620
- maskImage: "linear-gradient(180deg, transparent 1%, rgba(0, 0, 0, 1) 20px, rgba(0, 0, 0, 1) 90%, transparent 99%)"
3621
- },
3622
- children: e
3623
- }
3624
- ),
3625
- /* @__PURE__ */ i.jsx("div", { className: "bg-background border-t p-2 mx-5 gap-2 items-center mt-2 drop-shadow-[0_-3px_1px_rgba(0,0,0,0.015)] hidden lg:[&:has(>_:nth-child(1):last-child)]:flex", children: r.site?.showPoweredBy !== !1 && /* @__PURE__ */ i.jsx(jr, {}) })
3626
- ]
3627
- }
3628
- );
3629
- };
3630
- Nr.displayName = "NavigationWrapper";
3631
- const qc = ({
3632
- onRequestClose: e,
3633
- navigation: t
3634
- }) => /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
3635
- /* @__PURE__ */ i.jsxs(Nr, { children: [
3636
- /* @__PURE__ */ i.jsx(A.Target, { name: "navigation-before" }),
3637
- t.map((r) => /* @__PURE__ */ i.jsx(
3638
- Je,
3639
- {
3640
- item: r
3641
- },
3642
- r.type + (r.label ?? "") + ("path" in r ? r.path : "") + ("file" in r ? r.file : "") + ("to" in r ? r.to : "")
3643
- )),
3644
- /* @__PURE__ */ i.jsx(A.Target, { name: "navigation-after" })
3645
- ] }),
3646
- /* @__PURE__ */ i.jsx(
3647
- er,
3648
- {
3649
- className: "lg:hidden h-[100dvh] start-0 w-[320px] rounded-none",
3650
- "aria-describedby": void 0,
3651
- children: /* @__PURE__ */ i.jsxs("div", { className: "p-4 overflow-y-auto overscroll-none", children: [
3652
- /* @__PURE__ */ i.jsx(Xt, { children: /* @__PURE__ */ i.jsx(tr, { children: "Navigation" }) }),
3653
- t.map((r) => /* @__PURE__ */ i.jsx(
3654
- Je,
3655
- {
3656
- item: r,
3657
- onRequestClose: e
3658
- },
3659
- r.label
3660
- ))
3661
- ] })
3662
- }
3663
- )
3664
- ] }), Uc = ({ children: e }) => {
3665
- const [t, r] = J(!1), { navigation: n } = Wt(), o = n.length > 0, s = Fe().state === "loading", { options: a } = M();
3666
- return /* @__PURE__ */ i.jsxs(
3667
- Cr,
3668
- {
3669
- direction: a.site?.dir === "rtl" ? "right" : "left",
3670
- open: t,
3671
- onOpenChange: (c) => r(c),
3672
- children: [
3673
- o && /* @__PURE__ */ i.jsx(
3674
- qc,
3675
- {
3676
- onRequestClose: () => r(!1),
3677
- navigation: n
3678
- }
3679
- ),
3680
- o && /* @__PURE__ */ i.jsx("div", { className: "lg:hidden -mx-4 px-4 py-2 sticky bg-background/80 backdrop-blur-xs z-10 top-0 start-0 end-0 border-b", children: /* @__PURE__ */ i.jsxs(Rc, { className: "flex items-center gap-2 px-4", children: [
3681
- /* @__PURE__ */ i.jsx(Jn, { size: 16, strokeWidth: 1.5 }),
3682
- /* @__PURE__ */ i.jsx("span", { className: "text-sm", children: "Menu" })
3683
- ] }) }),
3684
- /* @__PURE__ */ i.jsxs(
3685
- "main",
3686
- {
3687
- "data-pagefind-body": !0,
3688
- className: N(
3689
- "px-4 lg:pe-8 lg:px-8",
3690
- !o && "col-span-full",
3691
- s && "animate-pulse"
3692
- ),
3693
- children: [
3694
- /* @__PURE__ */ i.jsx(A.Target, { name: "content-before" }),
3695
- e,
3696
- /* @__PURE__ */ i.jsx(A.Target, { name: "content-after" })
3697
- ]
3698
- }
3699
- )
3700
- ]
3701
- }
3702
- );
3703
- }, Lc = () => /* @__PURE__ */ i.jsx("main", { className: "col-span-full row-span-full grid place-items-center", children: /* @__PURE__ */ i.jsx(Gt, {}) }), Qc = ({ children: e }) => {
3704
- const { authentication: t } = M();
3705
- return pn(), mc(), F(() => {
3706
- t?.onPageLoad?.();
3707
- }, [t]), /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
3708
- /* @__PURE__ */ i.jsx(A.Target, { name: "layout-before-head" }),
3709
- /* @__PURE__ */ i.jsx(Tr, {}),
3710
- /* @__PURE__ */ i.jsx(A.Target, { name: "layout-after-head" }),
3711
- /* @__PURE__ */ i.jsx(
3712
- "div",
3713
- {
3714
- className: N(
3715
- "grid max-w-screen-2xl w-full lg:mx-auto",
3716
- "[&:has(>:only-child)]:grid-rows-1 grid-rows-[0_min-content_1fr] lg:grid-rows-[min-content_1fr]",
3717
- "grid-cols-1 lg:grid-cols-[var(--side-nav-width)_1fr]"
3718
- ),
3719
- children: /* @__PURE__ */ i.jsx(Le, { fallback: /* @__PURE__ */ i.jsx(Lc, {}), children: /* @__PURE__ */ i.jsx(Uc, { children: e ?? /* @__PURE__ */ i.jsx(Mt, {}) }) })
3720
- }
3721
- ),
3722
- /* @__PURE__ */ i.jsx(yc, {})
3723
- ] });
3724
- }, Bc = ({ children: e }) => {
3725
- const { meta: t, options: r } = M(), n = we();
3726
- return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
3727
- /* @__PURE__ */ i.jsxs(Me, { titleTemplate: t?.title, defaultTitle: t?.defaultTitle, children: [
3728
- r.canonicalUrlOrigin && /* @__PURE__ */ i.jsx(
3729
- "link",
3730
- {
3731
- rel: "canonical",
3732
- href: te(
3733
- r.canonicalUrlOrigin,
3734
- r.basePath,
3735
- n.pathname
3736
- )
3737
- }
3738
- ),
3739
- t?.description && /* @__PURE__ */ i.jsx("meta", { name: "description", content: t.description }),
3740
- t?.favicon && /* @__PURE__ */ i.jsx("link", { rel: "icon", href: t.favicon })
3741
- ] }),
3742
- e
3743
- ] });
3744
- }, Kc = ({
3745
- title: e = "An error occurred",
3746
- message: t,
3747
- category: r
3748
- }) => /* @__PURE__ */ i.jsxs(qt, { className: "h-full pt-(--padding-content-top)", children: [
3749
- r && /* @__PURE__ */ i.jsx(mn, { children: r }),
3750
- e && /* @__PURE__ */ i.jsx(gn, { level: 1, className: "flex gap-3.5 items-center", children: e }),
3751
- /* @__PURE__ */ i.jsx("p", { children: t })
3752
- ] }), Hc = (e) => {
3753
- switch (e) {
3754
- case 400:
3755
- return {
3756
- title: "Bad Request",
3757
- message: "The request could not be understood by the server due to malformed syntax."
3758
- };
3759
- case 403:
3760
- return {
3761
- title: "Forbidden",
3762
- message: "You don't have permission to access this resource."
3763
- };
3764
- case 404:
3765
- return {
3766
- title: "Not Found",
3767
- message: "The requested resource could not be found."
3768
- };
3769
- case 405:
3770
- return {
3771
- title: "Method Not Allowed",
3772
- message: "The request method is not supported for the requested resource."
3773
- };
3774
- case 414:
3775
- return {
3776
- title: "Request URI Too Large",
3777
- message: "The request URI is too large."
3778
- };
3779
- case 416:
3780
- return {
3781
- title: "Range Not Satisfiable",
3782
- message: "The server cannot satisfy the request range."
3783
- };
3784
- case 500:
3785
- return {
3786
- title: "Internal Server Error",
3787
- message: "An unexpected error occurred while processing your request."
3788
- };
3789
- case 501:
3790
- return {
3791
- title: "Not Implemented",
3792
- message: "The server does not support the functionality required to fulfill the request."
3793
- };
3794
- case 502:
3795
- return {
3796
- title: "Bad Gateway",
3797
- message: "The server received an invalid response from the upstream server."
3798
- };
3799
- case 503:
3800
- return {
3801
- title: "Service Unavailable",
3802
- message: "The server is temporarily unable to handle the request."
3803
- };
3804
- case 504:
3805
- return {
3806
- title: "Gateway Timeout",
3807
- message: "The server did not receive a timely response from the upstream server."
3808
- };
3809
- default:
3810
- return {
3811
- title: "An error occurred",
3812
- message: "Something went wrong while processing your request."
3813
- };
3814
- }
3815
- }, Wc = ({ statusCode: e, message: t }) => {
3816
- if (e === 404)
3817
- return /* @__PURE__ */ i.jsx(vn, {});
3818
- const r = Hc(e);
3819
- return /* @__PURE__ */ i.jsx(
3820
- Kc,
3821
- {
3822
- title: r.title,
3823
- message: t ?? r.message,
3824
- category: e
3825
- }
3826
- );
3827
- }, Vc = Ue(null), Te = {
3828
- didCatch: !1,
3829
- error: null
3830
- };
3831
- class Yc extends Fn {
3832
- constructor(t) {
3833
- super(t), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = Te;
3834
- }
3835
- static getDerivedStateFromError(t) {
3836
- return {
3837
- didCatch: !0,
3838
- error: t
3839
- };
3840
- }
3841
- resetErrorBoundary() {
3842
- const {
3843
- error: t
3844
- } = this.state;
3845
- if (t !== null) {
3846
- for (var r, n, o = arguments.length, s = new Array(o), a = 0; a < o; a++)
3847
- s[a] = arguments[a];
3848
- (r = (n = this.props).onReset) === null || r === void 0 || r.call(n, {
3849
- args: s,
3850
- reason: "imperative-api"
3851
- }), this.setState(Te);
3852
- }
3853
- }
3854
- componentDidCatch(t, r) {
3855
- var n, o;
3856
- (n = (o = this.props).onError) === null || n === void 0 || n.call(o, t, r);
3857
- }
3858
- componentDidUpdate(t, r) {
3859
- const {
3860
- didCatch: n
3861
- } = this.state, {
3862
- resetKeys: o
3863
- } = this.props;
3864
- if (n && r.error !== null && Gc(t.resetKeys, o)) {
3865
- var s, a;
3866
- (s = (a = this.props).onReset) === null || s === void 0 || s.call(a, {
3867
- next: o,
3868
- prev: t.resetKeys,
3869
- reason: "keys"
3870
- }), this.setState(Te);
3871
- }
3872
- }
3873
- render() {
3874
- const {
3875
- children: t,
3876
- fallbackRender: r,
3877
- FallbackComponent: n,
3878
- fallback: o
3879
- } = this.props, {
3880
- didCatch: s,
3881
- error: a
3882
- } = this.state;
3883
- let c = t;
3884
- if (s) {
3885
- const f = {
3886
- error: a,
3887
- resetErrorBoundary: this.resetErrorBoundary
3888
- };
3889
- if (typeof r == "function")
3890
- c = r(f);
3891
- else if (n)
3892
- c = st(n, f);
3893
- else if (o !== void 0)
3894
- c = o;
3895
- else
3896
- throw a;
3897
- }
3898
- return st(Vc.Provider, {
3899
- value: {
3900
- didCatch: s,
3901
- error: a,
3902
- resetErrorBoundary: this.resetErrorBoundary
3903
- }
3904
- }, c);
3905
- }
3906
- }
3907
- function Gc() {
3908
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
3909
- return e.length !== t.length || e.some((r, n) => !Object.is(r, t[n]));
3910
- }
3911
- let Jc = () => ({
3912
- emit(e, ...t) {
3913
- for (let r = this.events[e] || [], n = 0, o = r.length; n < o; n++)
3914
- r[n](...t);
3915
- },
3916
- events: {},
3917
- on(e, t) {
3918
- return (this.events[e] ||= []).push(t), () => {
3919
- this.events[e] = this.events[e]?.filter((r) => t !== r);
3920
- };
3921
- }
3922
- });
3923
- const Nt = vr([
3924
- _e().array(),
3925
- Va(
3926
- _e(),
3927
- lc((e) => typeof e == "function")
3928
- )
3929
- ]).optional().transform((e) => {
3930
- if (e)
3931
- return Array.isArray(e) ? Object.fromEntries(
3932
- e.map((t) => [
3933
- t,
3934
- (r) => r.auth.isAuthenticated
3935
- ])
3936
- ) : e;
3937
- }), Xc = (e) => Object.entries(e);
3938
- class eu {
3939
- plugins;
3940
- navigation;
3941
- meta;
3942
- site;
3943
- authentication;
3944
- queryClient;
3945
- options;
3946
- navigationPlugins;
3947
- emitter = Jc();
3948
- constructor(t, r) {
3949
- const o = {
3950
- ...Object.fromEntries(
3951
- (t.plugins ?? []).flatMap((s) => {
3952
- if (!it(s)) return [];
3953
- const a = s.getProtectedRoutes?.();
3954
- return a ? Object.entries(Nt.parse(a) ?? {}) : [];
3955
- })
3956
- ),
3957
- ...Nt.parse(t.protectedRoutes)
3958
- };
3959
- this.queryClient = r, this.options = { ...t, protectedRoutes: o }, this.plugins = t.plugins ?? [], this.navigation = t.navigation ?? [], this.navigationPlugins = this.plugins.filter(it), this.authentication = this.plugins.find(eo), this.meta = t.metadata, this.site = t.site, this.plugins.forEach((s) => {
3960
- to(s) && Xc(s.events).forEach(([a, c]) => {
3961
- this.emitter.on(a, c);
3962
- });
3963
- }), un.subscribe((s, a) => {
3964
- this.emitEvent("auth", {
3965
- prev: a,
3966
- next: s
3967
- });
3968
- });
3969
- }
3970
- initialize = async () => {
3971
- await Promise.all(
3972
- this.plugins.filter(ro).map((t) => t.initialize?.(this))
3973
- );
3974
- };
3975
- getApiIdentities = async () => (await Promise.all(
3976
- this.plugins.filter(no).map((r) => r.getIdentities(this))
3977
- )).flat();
3978
- addEventListener(t, r) {
3979
- return this.emitter.on(t, r);
3980
- }
3981
- emitEvent = (t, ...r) => this.emitter.emit(t, ...r);
3982
- getPluginNavigation = async (t) => (await Promise.all(
3983
- this.navigationPlugins.map(
3984
- (n) => n.getNavigation?.(te(t), this)
3985
- )
3986
- )).flatMap((n) => n ?? []);
3987
- getProfileMenuItems = () => this.plugins.filter((r) => Jt(r)).flatMap((r) => r.getProfileMenuItems(this)).sort(tu(["top", "middle", "bottom"])).sort((r) => r.weight ?? 0);
3988
- signRequest = async (t) => {
3989
- if (!this.authentication)
3990
- throw new Error("No authentication provider configured");
3991
- return await this.authentication.signRequest(t);
3992
- };
3993
- }
3994
- const tu = (e) => (t, r) => {
3995
- const n = e.indexOf(t.category ?? "middle"), o = e.indexOf(r.category ?? "middle");
3996
- return n - o;
3997
- };
3998
- function ru({ error: e, resetErrorBoundary: t }) {
3999
- return /* @__PURE__ */ i.jsx(Ft, { error: e });
4000
- }
4001
- const ge = globalThis;
4002
- (!ge.requestIdleCallback || !ge.cancelIdleCallback) && (ge.requestIdleCallback = (e) => setTimeout(e, 1), ge.cancelIdleCallback = clearTimeout);
4003
- const Ar = {
4004
- Header: Tr
4005
- }, nu = Ue(Ar), ou = nu.Provider, su = () => {
4006
- const e = we(), t = M(), r = H(void 0);
4007
- return F(() => {
4008
- t.emitEvent("location", {
4009
- from: r.current,
4010
- to: e
4011
- }), r.current = e;
4012
- }, [t, e]), null;
4013
- }, iu = ({
4014
- children: e,
4015
- context: t
4016
- }) => (Nn({
4017
- queryFn: async () => (await t.initialize(), !0),
4018
- queryKey: ["zudoku-initialize", An]
4019
- }), /* @__PURE__ */ i.jsx(Rn.Provider, { value: t, children: e }));
4020
- let At;
4021
- const Rr = Yt(
4022
- ({ children: e, ...t }) => {
4023
- const r = Ee(
4024
- () => ({ ...Ar, ...t.overrides }),
4025
- [t.overrides]
4026
- ), n = we(), o = Ee(() => ({
4027
- ...(t.plugins ?? []).filter(oo).flatMap(
4028
- (d) => d.getMdxComponents ? [d.getMdxComponents()] : []
4029
- ).reduce(
4030
- (d, g) => ({ ...d, ...g }),
4031
- {}
4032
- ),
4033
- ...yn,
4034
- ...t.mdx?.components
4035
- }), [t.mdx?.components, t.plugins]), { stagger: s } = qn(Oe), [a, c] = J(!1), f = Ee(
4036
- () => a ? { stagger: !0 } : { stagger: s },
4037
- [s, a]
4038
- ), l = Fe(), v = Bt();
4039
- F(() => {
4040
- a || c(!0);
4041
- }, [a, l.location]), At ??= new eu(t, v);
4042
- const m = t.plugins?.flatMap(
4043
- (p) => so(p) ? p.getHead?.({ location: n }) ?? [] : []
4044
- ).map((p, d) => /* @__PURE__ */ i.jsx(Me, { children: p }, d));
4045
- return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
4046
- m,
4047
- /* @__PURE__ */ i.jsx(Oe.Provider, { value: f, children: /* @__PURE__ */ i.jsxs(iu, { context: At, children: [
4048
- /* @__PURE__ */ i.jsx(su, {}),
4049
- /* @__PURE__ */ i.jsx(xn, { slots: t.slots ?? t.UNSAFE_slotlets, children: /* @__PURE__ */ i.jsx(rn, { components: o, children: /* @__PURE__ */ i.jsx(nn, { attribute: "class", disableTransitionOnChange: !0, children: /* @__PURE__ */ i.jsx(ou, { value: r, children: /* @__PURE__ */ i.jsx(_n, { children: e ?? /* @__PURE__ */ i.jsx(Mt, {}) }) }) }) }) })
4050
- ] }) })
4051
- ] });
4052
- }
4053
- );
4054
- Rr.displayName = "ZudokoInner";
4055
- const Ir = (e) => /* @__PURE__ */ i.jsx(Yc, { FallbackComponent: ru, children: /* @__PURE__ */ i.jsx(Rr, { ...e }) });
4056
- Ir.displayName = "Zudoku";
4057
- const Eu = Qc, Su = bn, Zu = zo, Tu = Eo, Cu = So, Ou = tn, Nu = Me, Au = Wc, Ru = jn, Iu = wn, Du = Gt, Mu = re, Fu = Ut, qu = qe, Uu = pc, Lu = Ir, Qu = qt, Bu = Bc, Ku = on, au = M, Hu = se, Wu = In, Vu = Dn, Yu = Dt;
4058
- export {
4059
- Fu as B,
4060
- Ru as C,
4061
- Yc as E,
4062
- Nu as H,
4063
- qu as L,
4064
- Iu as M,
4065
- Su as R,
4066
- Du as S,
4067
- Qu as T,
4068
- Lu as Z,
4069
- Tc as a,
4070
- Hu as b,
4071
- Eu as c,
4072
- Zu as d,
4073
- Tu as e,
4074
- Cu as f,
4075
- Ou as g,
4076
- Au as h,
4077
- Mu as i,
4078
- Uu as j,
4079
- Bu as k,
4080
- Ku as l,
4081
- Wu as m,
4082
- Vu as n,
4083
- Xc as o,
4084
- Yu as p,
4085
- au as u
4086
- };
4087
- //# sourceMappingURL=index-Cc70HIQT.js.map