zudoku 0.12.2 → 0.13.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 (197) hide show
  1. package/dist/app/main.js +3 -3
  2. package/dist/app/main.js.map +1 -1
  3. package/dist/cli/dev/handler.js +2 -2
  4. package/dist/cli/dev/handler.js.map +1 -1
  5. package/dist/config/validators/validate.d.ts +42 -23
  6. package/dist/config/validators/validate.js +6 -2
  7. package/dist/config/validators/validate.js.map +1 -1
  8. package/dist/index.d.ts +1 -0
  9. package/dist/lib/components/Banner.js +7 -1
  10. package/dist/lib/components/Banner.js.map +1 -1
  11. package/dist/lib/components/Header.js +1 -1
  12. package/dist/lib/components/Header.js.map +1 -1
  13. package/dist/lib/components/Layout.js +1 -1
  14. package/dist/lib/components/Layout.js.map +1 -1
  15. package/dist/lib/components/MobileTopNavigation.js +2 -1
  16. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  17. package/dist/lib/components/Search.js +1 -1
  18. package/dist/lib/components/Search.js.map +1 -1
  19. package/dist/lib/components/SlotletProvider.d.ts +9 -2
  20. package/dist/lib/components/SlotletProvider.js +4 -2
  21. package/dist/lib/components/SlotletProvider.js.map +1 -1
  22. package/dist/lib/components/index.d.ts +2 -1
  23. package/dist/lib/components/index.js.map +1 -1
  24. package/dist/lib/core/DevPortalContext.d.ts +1 -1
  25. package/dist/lib/oas/graphql/index.js +2 -6
  26. package/dist/lib/oas/graphql/index.js.map +1 -1
  27. package/dist/lib/plugins/custom-pages/CustomPage.d.ts +2 -0
  28. package/dist/lib/plugins/custom-pages/CustomPage.js +10 -0
  29. package/dist/lib/plugins/custom-pages/CustomPage.js.map +1 -0
  30. package/dist/lib/plugins/custom-pages/index.d.ts +10 -0
  31. package/dist/lib/plugins/custom-pages/index.js +11 -0
  32. package/dist/lib/plugins/custom-pages/index.js.map +1 -0
  33. package/dist/lib/plugins/openapi/Endpoint.js +1 -1
  34. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  35. package/dist/lib/plugins/openapi/OperationList.js +1 -1
  36. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  37. package/dist/lib/plugins/openapi/Route.d.ts +1 -1
  38. package/dist/lib/plugins/openapi/Route.js +1 -1
  39. package/dist/lib/plugins/openapi/Route.js.map +1 -1
  40. package/dist/lib/plugins/openapi/Sidecar.js +1 -1
  41. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  42. package/dist/lib/plugins/openapi/client/createMemoryClient.js +1 -1
  43. package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +1 -1
  44. package/dist/lib/plugins/openapi/client/createWorkerClient.js +1 -1
  45. package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -1
  46. package/dist/lib/plugins/openapi/index.js +1 -1
  47. package/dist/lib/plugins/openapi/index.js.map +1 -1
  48. package/dist/lib/ui/Callout.d.ts +36 -35
  49. package/dist/lib/ui/Callout.js.map +1 -1
  50. package/dist/lib/ui/Drawer.d.ts +8 -10
  51. package/dist/lib/ui/Drawer.js.map +1 -1
  52. package/dist/lib/util/useExposedProps.d.ts +2 -0
  53. package/dist/lib/util/useExposedProps.js +8 -0
  54. package/dist/lib/util/useExposedProps.js.map +1 -0
  55. package/dist/vite/config.js +2 -0
  56. package/dist/vite/config.js.map +1 -1
  57. package/dist/vite/dev-server.d.ts +6 -1
  58. package/dist/vite/dev-server.js +13 -3
  59. package/dist/vite/dev-server.js.map +1 -1
  60. package/dist/vite/plugin-component.js +0 -1
  61. package/dist/vite/plugin-component.js.map +1 -1
  62. package/dist/vite/plugin-custom-pages.d.ts +4 -0
  63. package/dist/vite/plugin-custom-pages.js +30 -0
  64. package/dist/vite/plugin-custom-pages.js.map +1 -0
  65. package/dist/vite/plugin.js +2 -0
  66. package/dist/vite/plugin.js.map +1 -1
  67. package/lib/{AuthenticationPlugin-Bx9FK124.js → AuthenticationPlugin-CbgJ5SAh.js} +3 -3
  68. package/lib/{AuthenticationPlugin-Bx9FK124.js.map → AuthenticationPlugin-CbgJ5SAh.js.map} +1 -1
  69. package/lib/{DeveloperHint-YeWHKvyr.js → DeveloperHint-CiXPc9Xm.js} +2 -2
  70. package/lib/{DeveloperHint-YeWHKvyr.js.map → DeveloperHint-CiXPc9Xm.js.map} +1 -1
  71. package/lib/ErrorPage-B-zoPPVx.js +15 -0
  72. package/lib/{ErrorPage-CsZAN_za.js.map → ErrorPage-B-zoPPVx.js.map} +1 -1
  73. package/lib/Input-QMLhK7Rb.js +2229 -0
  74. package/lib/Input-QMLhK7Rb.js.map +1 -0
  75. package/lib/{Markdown-DapSf3wG.js → Markdown-D6Nze6qq.js} +3281 -5392
  76. package/lib/Markdown-D6Nze6qq.js.map +1 -0
  77. package/lib/{MdxPage-BqBWsXZ1.js → MdxPage-DBhq6-5F.js} +15 -15
  78. package/lib/{MdxPage-BqBWsXZ1.js.map → MdxPage-DBhq6-5F.js.map} +1 -1
  79. package/lib/{OperationList-CYrmxPa8.js → OperationList-Ba24gUd2.js} +50 -51
  80. package/lib/OperationList-Ba24gUd2.js.map +1 -0
  81. package/lib/{Route-Q5mqNQrv.js → Route-DI38nxYt.js} +3 -4
  82. package/lib/Route-DI38nxYt.js.map +1 -0
  83. package/lib/SidebarBadge-B9-VJSQr.js +503 -0
  84. package/lib/SidebarBadge-B9-VJSQr.js.map +1 -0
  85. package/lib/{SlotletProvider-D3UD5Go3.js → SlotletProvider-Cb8mGpBO.js} +46 -46
  86. package/lib/{SlotletProvider-D3UD5Go3.js.map → SlotletProvider-Cb8mGpBO.js.map} +1 -1
  87. package/lib/ZudokuContext-BEmsYQoq.js +1173 -0
  88. package/lib/ZudokuContext-BEmsYQoq.js.map +1 -0
  89. package/lib/assets/{index-B9EWVYfo.js → index-B_Jk_Yzp.js} +968 -938
  90. package/lib/assets/index-B_Jk_Yzp.js.map +1 -0
  91. package/lib/assets/{worker-Bcj4NA2p.js → worker-Bf8vjASY.js} +4582 -4303
  92. package/lib/assets/worker-Bf8vjASY.js.map +1 -0
  93. package/lib/cn-BmFQLtkS.js +2279 -0
  94. package/lib/cn-BmFQLtkS.js.map +1 -0
  95. package/lib/{index-BG0g4WW0.js → index-BRCiYFaL.js} +747 -737
  96. package/lib/index-BRCiYFaL.js.map +1 -0
  97. package/lib/{index-CLd8ycZz.js → index-CkwDvuPt.js} +947 -917
  98. package/lib/index-CkwDvuPt.js.map +1 -0
  99. package/lib/{index-LNp6rxyU.js → index-D06ATMgg.js} +2 -2
  100. package/lib/{index-LNp6rxyU.js.map → index-D06ATMgg.js.map} +1 -1
  101. package/lib/{index-BlJ2rj99.js → index-DA74gNq3.js} +1124 -974
  102. package/lib/index-DA74gNq3.js.map +1 -0
  103. package/lib/index-DJqnphbT.js +35 -0
  104. package/lib/{index-Bn6Lc9tq.js.map → index-DJqnphbT.js.map} +1 -1
  105. package/lib/{index-BngPzhKn.js → index-dgcPryXi.js} +3 -3
  106. package/lib/{index-BngPzhKn.js.map → index-dgcPryXi.js.map} +1 -1
  107. package/lib/{index-Dolisrci.js → index-g_JJcuFg.js} +603 -549
  108. package/lib/index-g_JJcuFg.js.map +1 -0
  109. package/lib/router-Oe6YmY6B.js +3024 -0
  110. package/lib/router-Oe6YmY6B.js.map +1 -0
  111. package/lib/state-CsuHT8ZO.js +183 -0
  112. package/lib/state-CsuHT8ZO.js.map +1 -0
  113. package/lib/urql-core-KJnLL26g.js +1455 -0
  114. package/lib/urql-core-KJnLL26g.js.map +1 -0
  115. package/lib/useExposedProps-Csw8oAlt.js +9 -0
  116. package/lib/useExposedProps-Csw8oAlt.js.map +1 -0
  117. package/lib/{utils-ByIc_KIM.js → utils-Chi3p5nE.js} +4 -4
  118. package/lib/utils-Chi3p5nE.js.map +1 -0
  119. package/lib/zudoku.auth-auth0.js +1 -1
  120. package/lib/zudoku.auth-clerk.js +2 -2
  121. package/lib/zudoku.auth-openid.js +363 -350
  122. package/lib/zudoku.auth-openid.js.map +1 -1
  123. package/lib/zudoku.components.js +1697 -1623
  124. package/lib/zudoku.components.js.map +1 -1
  125. package/lib/zudoku.openapi-worker.js +4599 -4319
  126. package/lib/zudoku.openapi-worker.js.map +1 -1
  127. package/lib/zudoku.plugin-api-keys.js +7 -7
  128. package/lib/zudoku.plugin-custom-pages.js +21 -0
  129. package/lib/zudoku.plugin-custom-pages.js.map +1 -0
  130. package/lib/zudoku.plugin-markdown.js +1 -1
  131. package/lib/zudoku.plugin-openapi.js +8 -8
  132. package/lib/zudoku.plugin-redirect.js +1 -1
  133. package/package.json +61 -68
  134. package/src/app/main.tsx +3 -3
  135. package/src/lib/components/Banner.tsx +12 -2
  136. package/src/lib/components/Header.tsx +4 -2
  137. package/src/lib/components/Layout.tsx +1 -0
  138. package/src/lib/components/MobileTopNavigation.tsx +4 -0
  139. package/src/lib/components/Search.tsx +1 -1
  140. package/src/lib/components/SlotletProvider.tsx +27 -4
  141. package/src/lib/components/index.ts +1 -1
  142. package/src/lib/core/DevPortalContext.ts +1 -1
  143. package/src/lib/oas/graphql/index.ts +3 -11
  144. package/src/lib/plugins/custom-pages/CustomPage.tsx +15 -0
  145. package/src/lib/plugins/custom-pages/index.tsx +24 -0
  146. package/src/lib/plugins/openapi/Endpoint.tsx +1 -1
  147. package/src/lib/plugins/openapi/OperationList.tsx +1 -1
  148. package/src/lib/plugins/openapi/Route.tsx +1 -2
  149. package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
  150. package/src/lib/plugins/openapi/client/createMemoryClient.ts +1 -6
  151. package/src/lib/plugins/openapi/client/createWorkerClient.ts +1 -6
  152. package/src/lib/plugins/openapi/index.tsx +1 -5
  153. package/src/lib/ui/Callout.tsx +7 -6
  154. package/src/lib/ui/Drawer.tsx +38 -36
  155. package/src/lib/util/useExposedProps.tsx +10 -0
  156. package/dist/lib/plugins/custom-page/index.d.ts +0 -8
  157. package/dist/lib/plugins/custom-page/index.js +0 -12
  158. package/dist/lib/plugins/custom-page/index.js.map +0 -1
  159. package/dist/lib/plugins/openapi/playground/Editor.d.ts +0 -1
  160. package/dist/lib/plugins/openapi/playground/Editor.js +0 -5
  161. package/dist/lib/plugins/openapi/playground/Editor.js.map +0 -1
  162. package/dist/lib/plugins/openapi/util/urql.d.ts +0 -7
  163. package/dist/lib/plugins/openapi/util/urql.js +0 -8
  164. package/dist/lib/plugins/openapi/util/urql.js.map +0 -1
  165. package/lib/CategoryHeading-ovR-zHRq.js +0 -10
  166. package/lib/CategoryHeading-ovR-zHRq.js.map +0 -1
  167. package/lib/ErrorPage-CsZAN_za.js +0 -16
  168. package/lib/Input-CtVUl3eT.js +0 -2198
  169. package/lib/Input-CtVUl3eT.js.map +0 -1
  170. package/lib/Markdown-DapSf3wG.js.map +0 -1
  171. package/lib/OperationList-CYrmxPa8.js.map +0 -1
  172. package/lib/Route-Q5mqNQrv.js.map +0 -1
  173. package/lib/SidebarBadge-Dx7jtnoA.js +0 -498
  174. package/lib/SidebarBadge-Dx7jtnoA.js.map +0 -1
  175. package/lib/ZudokuContext-cr-pTRY1.js +0 -1084
  176. package/lib/ZudokuContext-cr-pTRY1.js.map +0 -1
  177. package/lib/_commonjsHelpers-BkfeUUK-.js +0 -29
  178. package/lib/_commonjsHelpers-BkfeUUK-.js.map +0 -1
  179. package/lib/assets/index-B9EWVYfo.js.map +0 -1
  180. package/lib/assets/worker-Bcj4NA2p.js.map +0 -1
  181. package/lib/index-BG0g4WW0.js.map +0 -1
  182. package/lib/index-BlJ2rj99.js.map +0 -1
  183. package/lib/index-Bn6Lc9tq.js +0 -9
  184. package/lib/index-CLd8ycZz.js.map +0 -1
  185. package/lib/index-Dolisrci.js.map +0 -1
  186. package/lib/router-D2p7Olpn.js +0 -2971
  187. package/lib/router-D2p7Olpn.js.map +0 -1
  188. package/lib/state-hNe1dw4B.js +0 -548
  189. package/lib/state-hNe1dw4B.js.map +0 -1
  190. package/lib/urql-YhcsXYy8.js +0 -1591
  191. package/lib/urql-YhcsXYy8.js.map +0 -1
  192. package/lib/utils-ByIc_KIM.js.map +0 -1
  193. package/lib/zudoku.plugin-custom-page.js +0 -13
  194. package/lib/zudoku.plugin-custom-page.js.map +0 -1
  195. package/src/lib/plugins/custom-page/index.tsx +0 -22
  196. package/src/lib/plugins/openapi/playground/Editor.tsx +0 -4
  197. package/src/lib/plugins/openapi/util/urql.ts +0 -8
@@ -0,0 +1,1173 @@
1
+ var Le = (t) => {
2
+ throw TypeError(t);
3
+ };
4
+ var pe = (t, e, s) => e.has(t) || Le("Cannot " + s);
5
+ var i = (t, e, s) => (pe(t, e, "read from private field"), s ? s.call(t) : e.get(t)), y = (t, e, s) => e.has(t) ? Le("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), c = (t, e, s, r) => (pe(t, e, "write to private field"), r ? r.call(t, s) : e.set(t, s), s), b = (t, e, s) => (pe(t, e, "access private method"), s);
6
+ import * as P from "react";
7
+ import { createContext as ut, useContext as ht } from "react";
8
+ import { j as ct } from "./jsx-runtime-B6kdoens.js";
9
+ import { u as Je } from "./index-BRCiYFaL.js";
10
+ var xe = class {
11
+ constructor() {
12
+ this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
13
+ }
14
+ subscribe(t) {
15
+ return this.listeners.add(t), this.onSubscribe(), () => {
16
+ this.listeners.delete(t), this.onUnsubscribe();
17
+ };
18
+ }
19
+ hasListeners() {
20
+ return this.listeners.size > 0;
21
+ }
22
+ onSubscribe() {
23
+ }
24
+ onUnsubscribe() {
25
+ }
26
+ }, V = typeof window > "u" || "Deno" in globalThis;
27
+ function be() {
28
+ }
29
+ function Gt(t, e) {
30
+ return typeof t == "function" ? t(e) : t;
31
+ }
32
+ function me(t) {
33
+ return typeof t == "number" && t >= 0 && t !== 1 / 0;
34
+ }
35
+ function Ze(t, e) {
36
+ return Math.max(t + (e || 0) - Date.now(), 0);
37
+ }
38
+ function de(t, e) {
39
+ return typeof t == "function" ? t(e) : t;
40
+ }
41
+ function I(t, e) {
42
+ return typeof t == "function" ? t(e) : t;
43
+ }
44
+ function zt(t, e) {
45
+ const {
46
+ type: s = "all",
47
+ exact: r,
48
+ fetchStatus: n,
49
+ predicate: o,
50
+ queryKey: a,
51
+ stale: h
52
+ } = t;
53
+ if (a) {
54
+ if (r) {
55
+ if (e.queryHash !== lt(a, e.options))
56
+ return !1;
57
+ } else if (!Qe(e.queryKey, a))
58
+ return !1;
59
+ }
60
+ if (s !== "all") {
61
+ const l = e.isActive();
62
+ if (s === "active" && !l || s === "inactive" && l)
63
+ return !1;
64
+ }
65
+ return !(typeof h == "boolean" && e.isStale() !== h || n && n !== e.state.fetchStatus || o && !o(e));
66
+ }
67
+ function Vt(t, e) {
68
+ const { exact: s, status: r, predicate: n, mutationKey: o } = t;
69
+ if (o) {
70
+ if (!e.options.mutationKey)
71
+ return !1;
72
+ if (s) {
73
+ if (ge(e.options.mutationKey) !== ge(o))
74
+ return !1;
75
+ } else if (!Qe(e.options.mutationKey, o))
76
+ return !1;
77
+ }
78
+ return !(r && e.state.status !== r || n && !n(e));
79
+ }
80
+ function lt(t, e) {
81
+ return ((e == null ? void 0 : e.queryKeyHashFn) || ge)(t);
82
+ }
83
+ function ge(t) {
84
+ return JSON.stringify(
85
+ t,
86
+ (e, s) => Ce(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
87
+ );
88
+ }
89
+ function Qe(t, e) {
90
+ return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? !Object.keys(e).some((s) => !Qe(t[s], e[s])) : !1;
91
+ }
92
+ function Re(t, e) {
93
+ if (t === e)
94
+ return t;
95
+ const s = Ne(t) && Ne(e);
96
+ if (s || Ce(t) && Ce(e)) {
97
+ const r = s ? t : Object.keys(t), n = r.length, o = s ? e : Object.keys(e), a = o.length, h = s ? [] : {};
98
+ let l = 0;
99
+ for (let R = 0; R < a; R++) {
100
+ const v = s ? R : o[R];
101
+ (!s && r.includes(v) || s) && t[v] === void 0 && e[v] === void 0 ? (h[v] = void 0, l++) : (h[v] = Re(t[v], e[v]), h[v] === t[v] && t[v] !== void 0 && l++);
102
+ }
103
+ return n === a && l === n ? t : h;
104
+ }
105
+ return e;
106
+ }
107
+ function Se(t, e) {
108
+ if (!e || Object.keys(t).length !== Object.keys(e).length)
109
+ return !1;
110
+ for (const s in t)
111
+ if (t[s] !== e[s])
112
+ return !1;
113
+ return !0;
114
+ }
115
+ function Ne(t) {
116
+ return Array.isArray(t) && t.length === Object.keys(t).length;
117
+ }
118
+ function Ce(t) {
119
+ if (!Ke(t))
120
+ return !1;
121
+ const e = t.constructor;
122
+ if (e === void 0)
123
+ return !0;
124
+ const s = e.prototype;
125
+ return !(!Ke(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(t) !== Object.prototype);
126
+ }
127
+ function Ke(t) {
128
+ return Object.prototype.toString.call(t) === "[object Object]";
129
+ }
130
+ function dt(t) {
131
+ return new Promise((e) => {
132
+ setTimeout(e, t);
133
+ });
134
+ }
135
+ function we(t, e, s) {
136
+ if (typeof s.structuralSharing == "function")
137
+ return s.structuralSharing(t, e);
138
+ if (s.structuralSharing !== !1) {
139
+ if (process.env.NODE_ENV !== "production")
140
+ try {
141
+ return Re(t, e);
142
+ } catch (r) {
143
+ console.error(
144
+ `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${r}`
145
+ );
146
+ }
147
+ return Re(t, e);
148
+ }
149
+ return e;
150
+ }
151
+ function $t(t, e, s = 0) {
152
+ const r = [...t, e];
153
+ return s && r.length > s ? r.slice(1) : r;
154
+ }
155
+ function Wt(t, e, s = 0) {
156
+ const r = [e, ...t];
157
+ return s && r.length > s ? r.slice(0, -1) : r;
158
+ }
159
+ var fe = Symbol();
160
+ function ft(t, e) {
161
+ return process.env.NODE_ENV !== "production" && t.queryFn === fe && console.error(
162
+ `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${t.queryHash}'`
163
+ ), !t.queryFn && (e != null && e.initialPromise) ? () => e.initialPromise : !t.queryFn || t.queryFn === fe ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn;
164
+ }
165
+ var K, A, J, Ge, yt = (Ge = class extends xe {
166
+ constructor() {
167
+ super();
168
+ y(this, K);
169
+ y(this, A);
170
+ y(this, J);
171
+ c(this, J, (e) => {
172
+ if (!V && window.addEventListener) {
173
+ const s = () => e();
174
+ return window.addEventListener("visibilitychange", s, !1), () => {
175
+ window.removeEventListener("visibilitychange", s);
176
+ };
177
+ }
178
+ });
179
+ }
180
+ onSubscribe() {
181
+ i(this, A) || this.setEventListener(i(this, J));
182
+ }
183
+ onUnsubscribe() {
184
+ var e;
185
+ this.hasListeners() || ((e = i(this, A)) == null || e.call(this), c(this, A, void 0));
186
+ }
187
+ setEventListener(e) {
188
+ var s;
189
+ c(this, J, e), (s = i(this, A)) == null || s.call(this), c(this, A, e((r) => {
190
+ typeof r == "boolean" ? this.setFocused(r) : this.onFocus();
191
+ }));
192
+ }
193
+ setFocused(e) {
194
+ i(this, K) !== e && (c(this, K, e), this.onFocus());
195
+ }
196
+ onFocus() {
197
+ const e = this.isFocused();
198
+ this.listeners.forEach((s) => {
199
+ s(e);
200
+ });
201
+ }
202
+ isFocused() {
203
+ var e;
204
+ return typeof i(this, K) == "boolean" ? i(this, K) : ((e = globalThis.document) == null ? void 0 : e.visibilityState) !== "hidden";
205
+ }
206
+ }, K = new WeakMap(), A = new WeakMap(), J = new WeakMap(), Ge), Xe = new yt(), Z, k, X, ze, pt = (ze = class extends xe {
207
+ constructor() {
208
+ super();
209
+ y(this, Z, !0);
210
+ y(this, k);
211
+ y(this, X);
212
+ c(this, X, (e) => {
213
+ if (!V && window.addEventListener) {
214
+ const s = () => e(!0), r = () => e(!1);
215
+ return window.addEventListener("online", s, !1), window.addEventListener("offline", r, !1), () => {
216
+ window.removeEventListener("online", s), window.removeEventListener("offline", r);
217
+ };
218
+ }
219
+ });
220
+ }
221
+ onSubscribe() {
222
+ i(this, k) || this.setEventListener(i(this, X));
223
+ }
224
+ onUnsubscribe() {
225
+ var e;
226
+ this.hasListeners() || ((e = i(this, k)) == null || e.call(this), c(this, k, void 0));
227
+ }
228
+ setEventListener(e) {
229
+ var s;
230
+ c(this, X, e), (s = i(this, k)) == null || s.call(this), c(this, k, e(this.setOnline.bind(this)));
231
+ }
232
+ setOnline(e) {
233
+ i(this, Z) !== e && (c(this, Z, e), this.listeners.forEach((r) => {
234
+ r(e);
235
+ }));
236
+ }
237
+ isOnline() {
238
+ return i(this, Z);
239
+ }
240
+ }, Z = new WeakMap(), k = new WeakMap(), X = new WeakMap(), ze), Ye = new pt();
241
+ function Ee() {
242
+ let t, e;
243
+ const s = new Promise((n, o) => {
244
+ t = n, e = o;
245
+ });
246
+ s.status = "pending", s.catch(() => {
247
+ });
248
+ function r(n) {
249
+ Object.assign(s, n), delete s.resolve, delete s.reject;
250
+ }
251
+ return s.resolve = (n) => {
252
+ r({
253
+ status: "fulfilled",
254
+ value: n
255
+ }), t(n);
256
+ }, s.reject = (n) => {
257
+ r({
258
+ status: "rejected",
259
+ reason: n
260
+ }), e(n);
261
+ }, s;
262
+ }
263
+ function vt(t) {
264
+ return Math.min(1e3 * 2 ** t, 3e4);
265
+ }
266
+ function et(t) {
267
+ return (t ?? "online") === "online" ? Ye.isOnline() : !0;
268
+ }
269
+ var tt = class extends Error {
270
+ constructor(t) {
271
+ super("CancelledError"), this.revert = t == null ? void 0 : t.revert, this.silent = t == null ? void 0 : t.silent;
272
+ }
273
+ };
274
+ function ve(t) {
275
+ return t instanceof tt;
276
+ }
277
+ function bt(t) {
278
+ let e = !1, s = 0, r = !1, n;
279
+ const o = Ee(), a = (f) => {
280
+ var g;
281
+ r || (m(new tt(f)), (g = t.abort) == null || g.call(t));
282
+ }, h = () => {
283
+ e = !0;
284
+ }, l = () => {
285
+ e = !1;
286
+ }, R = () => Xe.isFocused() && (t.networkMode === "always" || Ye.isOnline()) && t.canRun(), v = () => et(t.networkMode) && t.canRun(), u = (f) => {
287
+ var g;
288
+ r || (r = !0, (g = t.onSuccess) == null || g.call(t, f), n == null || n(), o.resolve(f));
289
+ }, m = (f) => {
290
+ var g;
291
+ r || (r = !0, (g = t.onError) == null || g.call(t, f), n == null || n(), o.reject(f));
292
+ }, S = () => new Promise((f) => {
293
+ var g;
294
+ n = (T) => {
295
+ (r || R()) && f(T);
296
+ }, (g = t.onPause) == null || g.call(t);
297
+ }).then(() => {
298
+ var f;
299
+ n = void 0, r || (f = t.onContinue) == null || f.call(t);
300
+ }), w = () => {
301
+ if (r)
302
+ return;
303
+ let f;
304
+ const g = s === 0 ? t.initialPromise : void 0;
305
+ try {
306
+ f = g ?? t.fn();
307
+ } catch (T) {
308
+ f = Promise.reject(T);
309
+ }
310
+ Promise.resolve(f).then(u).catch((T) => {
311
+ var ye;
312
+ if (r)
313
+ return;
314
+ const Q = t.retry ?? (V ? 0 : 3), N = t.retryDelay ?? vt, he = typeof N == "function" ? N(s, T) : N, ce = Q === !0 || typeof Q == "number" && s < Q || typeof Q == "function" && Q(s, T);
315
+ if (e || !ce) {
316
+ m(T);
317
+ return;
318
+ }
319
+ s++, (ye = t.onFail) == null || ye.call(t, s, T), dt(he).then(() => R() ? void 0 : S()).then(() => {
320
+ e ? m(T) : w();
321
+ });
322
+ });
323
+ };
324
+ return {
325
+ promise: o,
326
+ cancel: a,
327
+ continue: () => (n == null || n(), o),
328
+ cancelRetry: h,
329
+ continueRetry: l,
330
+ canStart: v,
331
+ start: () => (v() ? w() : S().then(w), o)
332
+ };
333
+ }
334
+ function mt() {
335
+ let t = [], e = 0, s = (h) => {
336
+ h();
337
+ }, r = (h) => {
338
+ h();
339
+ }, n = (h) => setTimeout(h, 0);
340
+ const o = (h) => {
341
+ e ? t.push(h) : n(() => {
342
+ s(h);
343
+ });
344
+ }, a = () => {
345
+ const h = t;
346
+ t = [], h.length && n(() => {
347
+ r(() => {
348
+ h.forEach((l) => {
349
+ s(l);
350
+ });
351
+ });
352
+ });
353
+ };
354
+ return {
355
+ batch: (h) => {
356
+ let l;
357
+ e++;
358
+ try {
359
+ l = h();
360
+ } finally {
361
+ e--, e || a();
362
+ }
363
+ return l;
364
+ },
365
+ /**
366
+ * All calls to the wrapped function will be batched.
367
+ */
368
+ batchCalls: (h) => (...l) => {
369
+ o(() => {
370
+ h(...l);
371
+ });
372
+ },
373
+ schedule: o,
374
+ /**
375
+ * Use this method to set a custom notify function.
376
+ * This can be used to for example wrap notifications with `React.act` while running tests.
377
+ */
378
+ setNotifyFunction: (h) => {
379
+ s = h;
380
+ },
381
+ /**
382
+ * Use this method to set a custom function to batch notifications together into a single tick.
383
+ * By default React Query will use the batch function provided by ReactDOM or React Native.
384
+ */
385
+ setBatchNotifyFunction: (h) => {
386
+ r = h;
387
+ },
388
+ setScheduler: (h) => {
389
+ n = h;
390
+ }
391
+ };
392
+ }
393
+ var je = mt(), _, Ve, gt = (Ve = class {
394
+ constructor() {
395
+ y(this, _);
396
+ }
397
+ destroy() {
398
+ this.clearGcTimeout();
399
+ }
400
+ scheduleGc() {
401
+ this.clearGcTimeout(), me(this.gcTime) && c(this, _, setTimeout(() => {
402
+ this.optionalRemove();
403
+ }, this.gcTime));
404
+ }
405
+ updateGcTime(t) {
406
+ this.gcTime = Math.max(
407
+ this.gcTime || 0,
408
+ t ?? (V ? 1 / 0 : 5 * 60 * 1e3)
409
+ );
410
+ }
411
+ clearGcTimeout() {
412
+ i(this, _) && (clearTimeout(i(this, _)), c(this, _, void 0));
413
+ }
414
+ }, _ = new WeakMap(), Ve), Y, ee, D, C, ae, H, q, j, $e, Jt = ($e = class extends gt {
415
+ constructor(e) {
416
+ super();
417
+ y(this, q);
418
+ y(this, Y);
419
+ y(this, ee);
420
+ y(this, D);
421
+ y(this, C);
422
+ y(this, ae);
423
+ y(this, H);
424
+ c(this, H, !1), c(this, ae, e.defaultOptions), this.setOptions(e.options), this.observers = [], c(this, D, e.cache), this.queryKey = e.queryKey, this.queryHash = e.queryHash, c(this, Y, Rt(this.options)), this.state = e.state ?? i(this, Y), this.scheduleGc();
425
+ }
426
+ get meta() {
427
+ return this.options.meta;
428
+ }
429
+ get promise() {
430
+ var e;
431
+ return (e = i(this, C)) == null ? void 0 : e.promise;
432
+ }
433
+ setOptions(e) {
434
+ this.options = { ...i(this, ae), ...e }, this.updateGcTime(this.options.gcTime);
435
+ }
436
+ optionalRemove() {
437
+ !this.observers.length && this.state.fetchStatus === "idle" && i(this, D).remove(this);
438
+ }
439
+ setData(e, s) {
440
+ const r = we(this.state.data, e, this.options);
441
+ return b(this, q, j).call(this, {
442
+ data: r,
443
+ type: "success",
444
+ dataUpdatedAt: s == null ? void 0 : s.updatedAt,
445
+ manual: s == null ? void 0 : s.manual
446
+ }), r;
447
+ }
448
+ setState(e, s) {
449
+ b(this, q, j).call(this, { type: "setState", state: e, setStateOptions: s });
450
+ }
451
+ cancel(e) {
452
+ var r, n;
453
+ const s = (r = i(this, C)) == null ? void 0 : r.promise;
454
+ return (n = i(this, C)) == null || n.cancel(e), s ? s.then(be).catch(be) : Promise.resolve();
455
+ }
456
+ destroy() {
457
+ super.destroy(), this.cancel({ silent: !0 });
458
+ }
459
+ reset() {
460
+ this.destroy(), this.setState(i(this, Y));
461
+ }
462
+ isActive() {
463
+ return this.observers.some(
464
+ (e) => I(e.options.enabled, this) !== !1
465
+ );
466
+ }
467
+ isDisabled() {
468
+ return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === fe || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
469
+ }
470
+ isStale() {
471
+ return this.state.isInvalidated ? !0 : this.getObserversCount() > 0 ? this.observers.some(
472
+ (e) => e.getCurrentResult().isStale
473
+ ) : this.state.data === void 0;
474
+ }
475
+ isStaleByTime(e = 0) {
476
+ return this.state.isInvalidated || this.state.data === void 0 || !Ze(this.state.dataUpdatedAt, e);
477
+ }
478
+ onFocus() {
479
+ var s;
480
+ const e = this.observers.find((r) => r.shouldFetchOnWindowFocus());
481
+ e == null || e.refetch({ cancelRefetch: !1 }), (s = i(this, C)) == null || s.continue();
482
+ }
483
+ onOnline() {
484
+ var s;
485
+ const e = this.observers.find((r) => r.shouldFetchOnReconnect());
486
+ e == null || e.refetch({ cancelRefetch: !1 }), (s = i(this, C)) == null || s.continue();
487
+ }
488
+ addObserver(e) {
489
+ this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(), i(this, D).notify({ type: "observerAdded", query: this, observer: e }));
490
+ }
491
+ removeObserver(e) {
492
+ this.observers.includes(e) && (this.observers = this.observers.filter((s) => s !== e), this.observers.length || (i(this, C) && (i(this, H) ? i(this, C).cancel({ revert: !0 }) : i(this, C).cancelRetry()), this.scheduleGc()), i(this, D).notify({ type: "observerRemoved", query: this, observer: e }));
493
+ }
494
+ getObserversCount() {
495
+ return this.observers.length;
496
+ }
497
+ invalidate() {
498
+ this.state.isInvalidated || b(this, q, j).call(this, { type: "invalidate" });
499
+ }
500
+ fetch(e, s) {
501
+ var l, R, v;
502
+ if (this.state.fetchStatus !== "idle") {
503
+ if (this.state.data !== void 0 && (s != null && s.cancelRefetch))
504
+ this.cancel({ silent: !0 });
505
+ else if (i(this, C))
506
+ return i(this, C).continueRetry(), i(this, C).promise;
507
+ }
508
+ if (e && this.setOptions(e), !this.options.queryFn) {
509
+ const u = this.observers.find((m) => m.options.queryFn);
510
+ u && this.setOptions(u.options);
511
+ }
512
+ process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
513
+ "As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"
514
+ ));
515
+ const r = new AbortController(), n = (u) => {
516
+ Object.defineProperty(u, "signal", {
517
+ enumerable: !0,
518
+ get: () => (c(this, H, !0), r.signal)
519
+ });
520
+ }, o = () => {
521
+ const u = ft(this.options, s), m = {
522
+ queryKey: this.queryKey,
523
+ meta: this.meta
524
+ };
525
+ return n(m), c(this, H, !1), this.options.persister ? this.options.persister(
526
+ u,
527
+ m,
528
+ this
529
+ ) : u(m);
530
+ }, a = {
531
+ fetchOptions: s,
532
+ options: this.options,
533
+ queryKey: this.queryKey,
534
+ state: this.state,
535
+ fetchFn: o
536
+ };
537
+ n(a), (l = this.options.behavior) == null || l.onFetch(
538
+ a,
539
+ this
540
+ ), c(this, ee, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((R = a.fetchOptions) == null ? void 0 : R.meta)) && b(this, q, j).call(this, { type: "fetch", meta: (v = a.fetchOptions) == null ? void 0 : v.meta });
541
+ const h = (u) => {
542
+ var m, S, w, f;
543
+ ve(u) && u.silent || b(this, q, j).call(this, {
544
+ type: "error",
545
+ error: u
546
+ }), ve(u) || ((S = (m = i(this, D).config).onError) == null || S.call(
547
+ m,
548
+ u,
549
+ this
550
+ ), (f = (w = i(this, D).config).onSettled) == null || f.call(
551
+ w,
552
+ this.state.data,
553
+ u,
554
+ this
555
+ )), this.scheduleGc();
556
+ };
557
+ return c(this, C, bt({
558
+ initialPromise: s == null ? void 0 : s.initialPromise,
559
+ fn: a.fetchFn,
560
+ abort: r.abort.bind(r),
561
+ onSuccess: (u) => {
562
+ var m, S, w, f;
563
+ if (u === void 0) {
564
+ process.env.NODE_ENV !== "production" && console.error(
565
+ `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
566
+ ), h(new Error(`${this.queryHash} data is undefined`));
567
+ return;
568
+ }
569
+ try {
570
+ this.setData(u);
571
+ } catch (g) {
572
+ h(g);
573
+ return;
574
+ }
575
+ (S = (m = i(this, D).config).onSuccess) == null || S.call(m, u, this), (f = (w = i(this, D).config).onSettled) == null || f.call(
576
+ w,
577
+ u,
578
+ this.state.error,
579
+ this
580
+ ), this.scheduleGc();
581
+ },
582
+ onError: h,
583
+ onFail: (u, m) => {
584
+ b(this, q, j).call(this, { type: "failed", failureCount: u, error: m });
585
+ },
586
+ onPause: () => {
587
+ b(this, q, j).call(this, { type: "pause" });
588
+ },
589
+ onContinue: () => {
590
+ b(this, q, j).call(this, { type: "continue" });
591
+ },
592
+ retry: a.options.retry,
593
+ retryDelay: a.options.retryDelay,
594
+ networkMode: a.options.networkMode,
595
+ canRun: () => !0
596
+ })), i(this, C).start();
597
+ }
598
+ }, Y = new WeakMap(), ee = new WeakMap(), D = new WeakMap(), C = new WeakMap(), ae = new WeakMap(), H = new WeakMap(), q = new WeakSet(), j = function(e) {
599
+ const s = (r) => {
600
+ switch (e.type) {
601
+ case "failed":
602
+ return {
603
+ ...r,
604
+ fetchFailureCount: e.failureCount,
605
+ fetchFailureReason: e.error
606
+ };
607
+ case "pause":
608
+ return {
609
+ ...r,
610
+ fetchStatus: "paused"
611
+ };
612
+ case "continue":
613
+ return {
614
+ ...r,
615
+ fetchStatus: "fetching"
616
+ };
617
+ case "fetch":
618
+ return {
619
+ ...r,
620
+ ...st(r.data, this.options),
621
+ fetchMeta: e.meta ?? null
622
+ };
623
+ case "success":
624
+ return {
625
+ ...r,
626
+ data: e.data,
627
+ dataUpdateCount: r.dataUpdateCount + 1,
628
+ dataUpdatedAt: e.dataUpdatedAt ?? Date.now(),
629
+ error: null,
630
+ isInvalidated: !1,
631
+ status: "success",
632
+ ...!e.manual && {
633
+ fetchStatus: "idle",
634
+ fetchFailureCount: 0,
635
+ fetchFailureReason: null
636
+ }
637
+ };
638
+ case "error":
639
+ const n = e.error;
640
+ return ve(n) && n.revert && i(this, ee) ? { ...i(this, ee), fetchStatus: "idle" } : {
641
+ ...r,
642
+ error: n,
643
+ errorUpdateCount: r.errorUpdateCount + 1,
644
+ errorUpdatedAt: Date.now(),
645
+ fetchFailureCount: r.fetchFailureCount + 1,
646
+ fetchFailureReason: n,
647
+ fetchStatus: "idle",
648
+ status: "error"
649
+ };
650
+ case "invalidate":
651
+ return {
652
+ ...r,
653
+ isInvalidated: !0
654
+ };
655
+ case "setState":
656
+ return {
657
+ ...r,
658
+ ...e.state
659
+ };
660
+ }
661
+ };
662
+ this.state = s(this.state), je.batch(() => {
663
+ this.observers.forEach((r) => {
664
+ r.onQueryUpdate();
665
+ }), i(this, D).notify({ query: this, type: "updated", action: e });
666
+ });
667
+ }, $e);
668
+ function st(t, e) {
669
+ return {
670
+ fetchFailureCount: 0,
671
+ fetchFailureReason: null,
672
+ fetchStatus: et(e.networkMode) ? "fetching" : "paused",
673
+ ...t === void 0 && {
674
+ error: null,
675
+ status: "pending"
676
+ }
677
+ };
678
+ }
679
+ function Rt(t) {
680
+ const e = typeof t.initialData == "function" ? t.initialData() : t.initialData, s = e !== void 0, r = s ? typeof t.initialDataUpdatedAt == "function" ? t.initialDataUpdatedAt() : t.initialDataUpdatedAt : 0;
681
+ return {
682
+ data: e,
683
+ dataUpdateCount: 0,
684
+ dataUpdatedAt: s ? r ?? Date.now() : 0,
685
+ error: null,
686
+ errorUpdateCount: 0,
687
+ errorUpdatedAt: 0,
688
+ fetchFailureCount: 0,
689
+ fetchFailureReason: null,
690
+ fetchMeta: null,
691
+ isInvalidated: !1,
692
+ status: s ? "success" : "pending",
693
+ fetchStatus: "idle"
694
+ };
695
+ }
696
+ var O, d, oe, F, B, te, M, x, ue, se, re, G, z, L, ie, p, ne, Fe, Oe, Te, De, Pe, qe, Ie, it, We, rt = (We = class extends xe {
697
+ constructor(e, s) {
698
+ super();
699
+ y(this, p);
700
+ y(this, O);
701
+ y(this, d);
702
+ y(this, oe);
703
+ y(this, F);
704
+ y(this, B);
705
+ y(this, te);
706
+ y(this, M);
707
+ y(this, x);
708
+ y(this, ue);
709
+ y(this, se);
710
+ // This property keeps track of the last query with defined data.
711
+ // It will be used to pass the previous data and query to the placeholder function between renders.
712
+ y(this, re);
713
+ y(this, G);
714
+ y(this, z);
715
+ y(this, L);
716
+ y(this, ie, /* @__PURE__ */ new Set());
717
+ this.options = s, c(this, O, e), c(this, x, null), c(this, M, Ee()), this.options.experimental_prefetchInRender || i(this, M).reject(
718
+ new Error("experimental_prefetchInRender feature flag is not enabled")
719
+ ), this.bindMethods(), this.setOptions(s);
720
+ }
721
+ bindMethods() {
722
+ this.refetch = this.refetch.bind(this);
723
+ }
724
+ onSubscribe() {
725
+ this.listeners.size === 1 && (i(this, d).addObserver(this), _e(i(this, d), this.options) ? b(this, p, ne).call(this) : this.updateResult(), b(this, p, De).call(this));
726
+ }
727
+ onUnsubscribe() {
728
+ this.hasListeners() || this.destroy();
729
+ }
730
+ shouldFetchOnReconnect() {
731
+ return Ue(
732
+ i(this, d),
733
+ this.options,
734
+ this.options.refetchOnReconnect
735
+ );
736
+ }
737
+ shouldFetchOnWindowFocus() {
738
+ return Ue(
739
+ i(this, d),
740
+ this.options,
741
+ this.options.refetchOnWindowFocus
742
+ );
743
+ }
744
+ destroy() {
745
+ this.listeners = /* @__PURE__ */ new Set(), b(this, p, Pe).call(this), b(this, p, qe).call(this), i(this, d).removeObserver(this);
746
+ }
747
+ setOptions(e, s) {
748
+ const r = this.options, n = i(this, d);
749
+ if (this.options = i(this, O).defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof I(this.options.enabled, i(this, d)) != "boolean")
750
+ throw new Error(
751
+ "Expected enabled to be a boolean or a callback that returns a boolean"
752
+ );
753
+ b(this, p, Ie).call(this), i(this, d).setOptions(this.options), r._defaulted && !Se(this.options, r) && i(this, O).getQueryCache().notify({
754
+ type: "observerOptionsUpdated",
755
+ query: i(this, d),
756
+ observer: this
757
+ });
758
+ const o = this.hasListeners();
759
+ o && He(
760
+ i(this, d),
761
+ n,
762
+ this.options,
763
+ r
764
+ ) && b(this, p, ne).call(this), this.updateResult(s), o && (i(this, d) !== n || I(this.options.enabled, i(this, d)) !== I(r.enabled, i(this, d)) || de(this.options.staleTime, i(this, d)) !== de(r.staleTime, i(this, d))) && b(this, p, Fe).call(this);
765
+ const a = b(this, p, Oe).call(this);
766
+ o && (i(this, d) !== n || I(this.options.enabled, i(this, d)) !== I(r.enabled, i(this, d)) || a !== i(this, L)) && b(this, p, Te).call(this, a);
767
+ }
768
+ getOptimisticResult(e) {
769
+ const s = i(this, O).getQueryCache().build(i(this, O), e), r = this.createResult(s, e);
770
+ return Ct(this, r) && (c(this, F, r), c(this, te, this.options), c(this, B, i(this, d).state)), r;
771
+ }
772
+ getCurrentResult() {
773
+ return i(this, F);
774
+ }
775
+ trackResult(e, s) {
776
+ const r = {};
777
+ return Object.keys(e).forEach((n) => {
778
+ Object.defineProperty(r, n, {
779
+ configurable: !1,
780
+ enumerable: !0,
781
+ get: () => (this.trackProp(n), s == null || s(n), e[n])
782
+ });
783
+ }), r;
784
+ }
785
+ trackProp(e) {
786
+ i(this, ie).add(e);
787
+ }
788
+ getCurrentQuery() {
789
+ return i(this, d);
790
+ }
791
+ refetch({ ...e } = {}) {
792
+ return this.fetch({
793
+ ...e
794
+ });
795
+ }
796
+ fetchOptimistic(e) {
797
+ const s = i(this, O).defaultQueryOptions(e), r = i(this, O).getQueryCache().build(i(this, O), s);
798
+ return r.fetch().then(() => this.createResult(r, s));
799
+ }
800
+ fetch(e) {
801
+ return b(this, p, ne).call(this, {
802
+ ...e,
803
+ cancelRefetch: e.cancelRefetch ?? !0
804
+ }).then(() => (this.updateResult(), i(this, F)));
805
+ }
806
+ createResult(e, s) {
807
+ var Me;
808
+ const r = i(this, d), n = this.options, o = i(this, F), a = i(this, B), h = i(this, te), R = e !== r ? e.state : i(this, oe), { state: v } = e;
809
+ let u = { ...v }, m = !1, S;
810
+ if (s._optimisticResults) {
811
+ const E = this.hasListeners(), $ = !E && _e(e, s), W = E && He(e, r, s, n);
812
+ ($ || W) && (u = {
813
+ ...u,
814
+ ...st(v.data, e.options)
815
+ }), s._optimisticResults === "isRestoring" && (u.fetchStatus = "idle");
816
+ }
817
+ let { error: w, errorUpdatedAt: f, status: g } = u;
818
+ if (s.select && u.data !== void 0)
819
+ if (o && u.data === (a == null ? void 0 : a.data) && s.select === i(this, ue))
820
+ S = i(this, se);
821
+ else
822
+ try {
823
+ c(this, ue, s.select), S = s.select(u.data), S = we(o == null ? void 0 : o.data, S, s), c(this, se, S), c(this, x, null);
824
+ } catch (E) {
825
+ c(this, x, E);
826
+ }
827
+ else
828
+ S = u.data;
829
+ if (s.placeholderData !== void 0 && S === void 0 && g === "pending") {
830
+ let E;
831
+ if (o != null && o.isPlaceholderData && s.placeholderData === (h == null ? void 0 : h.placeholderData))
832
+ E = o.data;
833
+ else if (E = typeof s.placeholderData == "function" ? s.placeholderData(
834
+ (Me = i(this, re)) == null ? void 0 : Me.state.data,
835
+ i(this, re)
836
+ ) : s.placeholderData, s.select && E !== void 0)
837
+ try {
838
+ E = s.select(E), c(this, x, null);
839
+ } catch ($) {
840
+ c(this, x, $);
841
+ }
842
+ E !== void 0 && (g = "success", S = we(
843
+ o == null ? void 0 : o.data,
844
+ E,
845
+ s
846
+ ), m = !0);
847
+ }
848
+ i(this, x) && (w = i(this, x), S = i(this, se), f = Date.now(), g = "error");
849
+ const T = u.fetchStatus === "fetching", Q = g === "pending", N = g === "error", he = Q && T, ce = S !== void 0, U = {
850
+ status: g,
851
+ fetchStatus: u.fetchStatus,
852
+ isPending: Q,
853
+ isSuccess: g === "success",
854
+ isError: N,
855
+ isInitialLoading: he,
856
+ isLoading: he,
857
+ data: S,
858
+ dataUpdatedAt: u.dataUpdatedAt,
859
+ error: w,
860
+ errorUpdatedAt: f,
861
+ failureCount: u.fetchFailureCount,
862
+ failureReason: u.fetchFailureReason,
863
+ errorUpdateCount: u.errorUpdateCount,
864
+ isFetched: u.dataUpdateCount > 0 || u.errorUpdateCount > 0,
865
+ isFetchedAfterMount: u.dataUpdateCount > R.dataUpdateCount || u.errorUpdateCount > R.errorUpdateCount,
866
+ isFetching: T,
867
+ isRefetching: T && !Q,
868
+ isLoadingError: N && !ce,
869
+ isPaused: u.fetchStatus === "paused",
870
+ isPlaceholderData: m,
871
+ isRefetchError: N && ce,
872
+ isStale: Ae(e, s),
873
+ refetch: this.refetch,
874
+ promise: i(this, M)
875
+ };
876
+ if (this.options.experimental_prefetchInRender) {
877
+ const E = (le) => {
878
+ U.status === "error" ? le.reject(U.error) : U.data !== void 0 && le.resolve(U.data);
879
+ }, $ = () => {
880
+ const le = c(this, M, U.promise = Ee());
881
+ E(le);
882
+ }, W = i(this, M);
883
+ switch (W.status) {
884
+ case "pending":
885
+ e.queryHash === r.queryHash && E(W);
886
+ break;
887
+ case "fulfilled":
888
+ (U.status === "error" || U.data !== W.value) && $();
889
+ break;
890
+ case "rejected":
891
+ (U.status !== "error" || U.error !== W.reason) && $();
892
+ break;
893
+ }
894
+ }
895
+ return U;
896
+ }
897
+ updateResult(e) {
898
+ const s = i(this, F), r = this.createResult(i(this, d), this.options);
899
+ if (c(this, B, i(this, d).state), c(this, te, this.options), i(this, B).data !== void 0 && c(this, re, i(this, d)), Se(r, s))
900
+ return;
901
+ c(this, F, r);
902
+ const n = {}, o = () => {
903
+ if (!s)
904
+ return !0;
905
+ const { notifyOnChangeProps: a } = this.options, h = typeof a == "function" ? a() : a;
906
+ if (h === "all" || !h && !i(this, ie).size)
907
+ return !0;
908
+ const l = new Set(
909
+ h ?? i(this, ie)
910
+ );
911
+ return this.options.throwOnError && l.add("error"), Object.keys(i(this, F)).some((R) => {
912
+ const v = R;
913
+ return i(this, F)[v] !== s[v] && l.has(v);
914
+ });
915
+ };
916
+ (e == null ? void 0 : e.listeners) !== !1 && o() && (n.listeners = !0), b(this, p, it).call(this, { ...n, ...e });
917
+ }
918
+ onQueryUpdate() {
919
+ this.updateResult(), this.hasListeners() && b(this, p, De).call(this);
920
+ }
921
+ }, O = new WeakMap(), d = new WeakMap(), oe = new WeakMap(), F = new WeakMap(), B = new WeakMap(), te = new WeakMap(), M = new WeakMap(), x = new WeakMap(), ue = new WeakMap(), se = new WeakMap(), re = new WeakMap(), G = new WeakMap(), z = new WeakMap(), L = new WeakMap(), ie = new WeakMap(), p = new WeakSet(), ne = function(e) {
922
+ b(this, p, Ie).call(this);
923
+ let s = i(this, d).fetch(
924
+ this.options,
925
+ e
926
+ );
927
+ return e != null && e.throwOnError || (s = s.catch(be)), s;
928
+ }, Fe = function() {
929
+ b(this, p, Pe).call(this);
930
+ const e = de(
931
+ this.options.staleTime,
932
+ i(this, d)
933
+ );
934
+ if (V || i(this, F).isStale || !me(e))
935
+ return;
936
+ const r = Ze(i(this, F).dataUpdatedAt, e) + 1;
937
+ c(this, G, setTimeout(() => {
938
+ i(this, F).isStale || this.updateResult();
939
+ }, r));
940
+ }, Oe = function() {
941
+ return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(i(this, d)) : this.options.refetchInterval) ?? !1;
942
+ }, Te = function(e) {
943
+ b(this, p, qe).call(this), c(this, L, e), !(V || I(this.options.enabled, i(this, d)) === !1 || !me(i(this, L)) || i(this, L) === 0) && c(this, z, setInterval(() => {
944
+ (this.options.refetchIntervalInBackground || Xe.isFocused()) && b(this, p, ne).call(this);
945
+ }, i(this, L)));
946
+ }, De = function() {
947
+ b(this, p, Fe).call(this), b(this, p, Te).call(this, b(this, p, Oe).call(this));
948
+ }, Pe = function() {
949
+ i(this, G) && (clearTimeout(i(this, G)), c(this, G, void 0));
950
+ }, qe = function() {
951
+ i(this, z) && (clearInterval(i(this, z)), c(this, z, void 0));
952
+ }, Ie = function() {
953
+ const e = i(this, O).getQueryCache().build(i(this, O), this.options);
954
+ if (e === i(this, d))
955
+ return;
956
+ const s = i(this, d);
957
+ c(this, d, e), c(this, oe, e.state), this.hasListeners() && (s == null || s.removeObserver(this), e.addObserver(this));
958
+ }, it = function(e) {
959
+ je.batch(() => {
960
+ e.listeners && this.listeners.forEach((s) => {
961
+ s(i(this, F));
962
+ }), i(this, O).getQueryCache().notify({
963
+ query: i(this, d),
964
+ type: "observerResultsUpdated"
965
+ });
966
+ });
967
+ }, We);
968
+ function St(t, e) {
969
+ return I(e.enabled, t) !== !1 && t.state.data === void 0 && !(t.state.status === "error" && e.retryOnMount === !1);
970
+ }
971
+ function _e(t, e) {
972
+ return St(t, e) || t.state.data !== void 0 && Ue(t, e, e.refetchOnMount);
973
+ }
974
+ function Ue(t, e, s) {
975
+ if (I(e.enabled, t) !== !1) {
976
+ const r = typeof s == "function" ? s(t) : s;
977
+ return r === "always" || r !== !1 && Ae(t, e);
978
+ }
979
+ return !1;
980
+ }
981
+ function He(t, e, s, r) {
982
+ return (t !== e || I(r.enabled, t) === !1) && (!s.suspense || t.state.status !== "error") && Ae(t, s);
983
+ }
984
+ function Ae(t, e) {
985
+ return I(e.enabled, t) !== !1 && t.isStaleByTime(de(e.staleTime, t));
986
+ }
987
+ function Ct(t, e) {
988
+ return !Se(t.getCurrentResult(), e);
989
+ }
990
+ var nt = P.createContext(
991
+ void 0
992
+ ), wt = (t) => {
993
+ const e = P.useContext(nt);
994
+ if (!e)
995
+ throw new Error("No QueryClient set, use QueryClientProvider to set one");
996
+ return e;
997
+ }, Zt = ({
998
+ client: t,
999
+ children: e
1000
+ }) => (P.useEffect(() => (t.mount(), () => {
1001
+ t.unmount();
1002
+ }), [t]), /* @__PURE__ */ ct.jsx(nt.Provider, { value: t, children: e })), at = P.createContext(!1), Et = () => P.useContext(at);
1003
+ at.Provider;
1004
+ function Ft() {
1005
+ let t = !1;
1006
+ return {
1007
+ clearReset: () => {
1008
+ t = !1;
1009
+ },
1010
+ reset: () => {
1011
+ t = !0;
1012
+ },
1013
+ isReset: () => t
1014
+ };
1015
+ }
1016
+ var Ot = P.createContext(Ft()), Tt = () => P.useContext(Ot);
1017
+ function Dt(t, e) {
1018
+ return typeof t == "function" ? t(...e) : !!t;
1019
+ }
1020
+ function Pt() {
1021
+ }
1022
+ var qt = (t, e) => {
1023
+ (t.suspense || t.throwOnError) && (e.isReset() || (t.retryOnMount = !1));
1024
+ }, It = (t) => {
1025
+ P.useEffect(() => {
1026
+ t.clearReset();
1027
+ }, [t]);
1028
+ }, Ut = ({
1029
+ result: t,
1030
+ errorResetBoundary: e,
1031
+ throwOnError: s,
1032
+ query: r
1033
+ }) => t.isError && !e.isReset() && !t.isFetching && r && Dt(s, [t.error, r]), xt = (t, e) => e.state.data === void 0, Qt = (t) => {
1034
+ t.suspense && (typeof t.staleTime != "number" && (t.staleTime = 1e3), typeof t.gcTime == "number" && (t.gcTime = Math.max(t.gcTime, 1e3)));
1035
+ }, jt = (t, e) => t.isLoading && t.isFetching && !e, At = (t, e) => (t == null ? void 0 : t.suspense) && e.isPending, Be = (t, e, s) => e.fetchOptimistic(t).catch(() => {
1036
+ s.clearReset();
1037
+ });
1038
+ function ot(t, e, s) {
1039
+ var v, u, m, S, w;
1040
+ if (process.env.NODE_ENV !== "production" && (typeof t != "object" || Array.isArray(t)))
1041
+ throw new Error(
1042
+ 'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'
1043
+ );
1044
+ const r = wt(), n = Et(), o = Tt(), a = r.defaultQueryOptions(t);
1045
+ (u = (v = r.getDefaultOptions().queries) == null ? void 0 : v._experimental_beforeQuery) == null || u.call(
1046
+ v,
1047
+ a
1048
+ ), a._optimisticResults = n ? "isRestoring" : "optimistic", Qt(a), qt(a, o), It(o);
1049
+ const h = !r.getQueryCache().get(a.queryHash), [l] = P.useState(
1050
+ () => new e(
1051
+ r,
1052
+ a
1053
+ )
1054
+ ), R = l.getOptimisticResult(a);
1055
+ if (P.useSyncExternalStore(
1056
+ P.useCallback(
1057
+ (f) => {
1058
+ const g = n ? () => {
1059
+ } : l.subscribe(je.batchCalls(f));
1060
+ return l.updateResult(), g;
1061
+ },
1062
+ [l, n]
1063
+ ),
1064
+ () => l.getCurrentResult(),
1065
+ () => l.getCurrentResult()
1066
+ ), P.useEffect(() => {
1067
+ l.setOptions(a, { listeners: !1 });
1068
+ }, [a, l]), At(a, R))
1069
+ throw Be(a, l, o);
1070
+ if (Ut({
1071
+ result: R,
1072
+ errorResetBoundary: o,
1073
+ throwOnError: a.throwOnError,
1074
+ query: r.getQueryCache().get(a.queryHash)
1075
+ }))
1076
+ throw R.error;
1077
+ if ((S = (m = r.getDefaultOptions().queries) == null ? void 0 : m._experimental_afterQuery) == null || S.call(
1078
+ m,
1079
+ a,
1080
+ R
1081
+ ), a.experimental_prefetchInRender && !V && jt(R, n)) {
1082
+ const f = h ? (
1083
+ // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
1084
+ Be(a, l, o)
1085
+ ) : (
1086
+ // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
1087
+ (w = r.getQueryCache().get(a.queryHash)) == null ? void 0 : w.promise
1088
+ );
1089
+ f == null || f.catch(Pt).finally(() => {
1090
+ l.hasListeners() || l.updateResult();
1091
+ });
1092
+ }
1093
+ return a.notifyOnChangeProps ? R : l.trackResult(R);
1094
+ }
1095
+ function kt(t, e) {
1096
+ return ot(t, rt);
1097
+ }
1098
+ function Mt(t, e) {
1099
+ return process.env.NODE_ENV !== "production" && t.queryFn === fe && console.error("skipToken is not allowed for useSuspenseQuery"), ot(
1100
+ {
1101
+ ...t,
1102
+ enabled: !0,
1103
+ suspense: !0,
1104
+ throwOnError: xt,
1105
+ placeholderData: void 0
1106
+ },
1107
+ rt
1108
+ );
1109
+ }
1110
+ const Lt = ut(
1111
+ void 0
1112
+ ), ke = () => {
1113
+ const t = ht(Lt);
1114
+ if (!t)
1115
+ throw new Error("useDevPortal must be used within a DevPortalProvider.");
1116
+ return t;
1117
+ }, Xt = () => {
1118
+ const { getApiIdentities: t } = ke();
1119
+ return kt({
1120
+ queryFn: t,
1121
+ queryKey: ["api-identities"]
1122
+ });
1123
+ }, Nt = () => {
1124
+ const { topNavigation: t } = ke(), s = Je().pathname.split("/").at(1);
1125
+ if (s)
1126
+ return t.find((r) => r.id === s);
1127
+ }, Yt = () => {
1128
+ const { getPluginSidebar: t, sidebars: e } = ke(), s = Nt(), r = s == null ? void 0 : s.id, n = r ? e[r] ?? [] : [], o = Je();
1129
+ return Mt({
1130
+ queryFn: async () => {
1131
+ const a = r ? await t(r) : await t(o.pathname);
1132
+ return {
1133
+ items: [...n, ...a],
1134
+ currentTopNavItem: s
1135
+ };
1136
+ },
1137
+ queryKey: ["navigation", r]
1138
+ });
1139
+ };
1140
+ export {
1141
+ kt as A,
1142
+ Jt as Q,
1143
+ gt as R,
1144
+ xe as S,
1145
+ Lt as Z,
1146
+ wt as a,
1147
+ Mt as b,
1148
+ Nt as c,
1149
+ Pt as d,
1150
+ Dt as e,
1151
+ lt as f,
1152
+ Vt as g,
1153
+ ge as h,
1154
+ be as i,
1155
+ ft as j,
1156
+ Wt as k,
1157
+ $t as l,
1158
+ zt as m,
1159
+ je as n,
1160
+ Xe as o,
1161
+ Ye as p,
1162
+ Gt as q,
1163
+ de as r,
1164
+ Se as s,
1165
+ Qe as t,
1166
+ ke as u,
1167
+ fe as v,
1168
+ Zt as w,
1169
+ Yt as x,
1170
+ bt as y,
1171
+ Xt as z
1172
+ };
1173
+ //# sourceMappingURL=ZudokuContext-BEmsYQoq.js.map