zudoku 0.13.7 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/cli.js +2 -2
  2. package/dist/app/entry.client.js +2 -2
  3. package/dist/app/entry.client.js.map +1 -1
  4. package/dist/app/entry.server.js +3 -0
  5. package/dist/app/entry.server.js.map +1 -1
  6. package/dist/app/main.d.ts +1 -0
  7. package/dist/app/main.js +6 -21
  8. package/dist/app/main.js.map +1 -1
  9. package/dist/app/standalone.js.map +1 -1
  10. package/dist/cli/common/machine-id/lib.js.map +1 -1
  11. package/dist/cli/common/outdated.js.map +1 -1
  12. package/dist/cli/common/utils/box.js.map +1 -1
  13. package/dist/config/validators/InputSidebarSchema.d.ts +2 -2
  14. package/dist/config/validators/SidebarSchema.d.ts +24 -1
  15. package/dist/config/validators/SidebarSchema.js +76 -39
  16. package/dist/config/validators/SidebarSchema.js.map +1 -1
  17. package/dist/config/validators/validate.d.ts +329 -264
  18. package/dist/config/validators/validate.js +11 -10
  19. package/dist/config/validators/validate.js.map +1 -1
  20. package/dist/index.d.ts +4 -1
  21. package/dist/index.js +1 -1
  22. package/dist/index.js.map +1 -1
  23. package/dist/lib/components/Header.js +5 -1
  24. package/dist/lib/components/Header.js.map +1 -1
  25. package/dist/lib/components/Heading.d.ts +1 -1
  26. package/dist/lib/components/SyntaxHighlight.js +4 -1
  27. package/dist/lib/components/SyntaxHighlight.js.map +1 -1
  28. package/dist/lib/components/TopNavigation.js +30 -5
  29. package/dist/lib/components/TopNavigation.js.map +1 -1
  30. package/dist/lib/components/context/ZudokuContext.d.ts +6 -12
  31. package/dist/lib/components/context/ZudokuContext.js +26 -20
  32. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  33. package/dist/lib/components/navigation/Sidebar.js +3 -3
  34. package/dist/lib/components/navigation/Sidebar.js.map +1 -1
  35. package/dist/lib/components/navigation/SidebarCategory.js +2 -4
  36. package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
  37. package/dist/lib/components/navigation/SidebarItem.js +1 -3
  38. package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
  39. package/dist/lib/components/navigation/utils.js +10 -14
  40. package/dist/lib/components/navigation/utils.js.map +1 -1
  41. package/dist/lib/core/DevPortalContext.d.ts +3 -7
  42. package/dist/lib/core/DevPortalContext.js.map +1 -1
  43. package/dist/lib/core/plugins.d.ts +1 -0
  44. package/dist/lib/core/plugins.js.map +1 -1
  45. package/dist/lib/plugins/markdown/index.d.ts +5 -6
  46. package/dist/lib/plugins/markdown/index.js +31 -3
  47. package/dist/lib/plugins/markdown/index.js.map +1 -1
  48. package/dist/lib/plugins/markdown/resolver.d.ts +38 -0
  49. package/dist/lib/plugins/markdown/resolver.js +75 -0
  50. package/dist/lib/plugins/markdown/resolver.js.map +1 -0
  51. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  52. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  53. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  54. package/dist/lib/plugins/openapi/client/worker.js.map +1 -1
  55. package/dist/lib/plugins/openapi/index.js.map +1 -1
  56. package/dist/lib/ui/Badge.d.ts +1 -1
  57. package/dist/lib/ui/Button.d.ts +1 -1
  58. package/dist/lib/util/MdxComponents.js.map +1 -1
  59. package/dist/lib/util/useScrollToAnchor.js.map +1 -1
  60. package/dist/vite/build.js +7 -2
  61. package/dist/vite/build.js.map +1 -1
  62. package/dist/vite/config.js +11 -6
  63. package/dist/vite/config.js.map +1 -1
  64. package/dist/vite/debug.d.ts +1 -0
  65. package/dist/vite/debug.js +10 -0
  66. package/dist/vite/debug.js.map +1 -0
  67. package/dist/vite/plugin-config-reload.js +0 -2
  68. package/dist/vite/plugin-config-reload.js.map +1 -1
  69. package/dist/vite/plugin-docs.js +37 -26
  70. package/dist/vite/plugin-docs.js.map +1 -1
  71. package/dist/vite/plugin-frontmatter.d.ts +2 -1
  72. package/dist/vite/plugin-frontmatter.js +27 -24
  73. package/dist/vite/plugin-frontmatter.js.map +1 -1
  74. package/dist/vite/plugin-sidebar.js +7 -6
  75. package/dist/vite/plugin-sidebar.js.map +1 -1
  76. package/dist/vite/plugin.js +1 -1
  77. package/dist/vite/plugin.js.map +1 -1
  78. package/dist/vite/prerender.d.ts +5 -1
  79. package/dist/vite/prerender.js +6 -5
  80. package/dist/vite/prerender.js.map +1 -1
  81. package/lib/{utils-B2yoT99j.js → AnchorLink-BbB2q-jx.js} +214 -258
  82. package/lib/AnchorLink-BbB2q-jx.js.map +1 -0
  83. package/lib/{AuthenticationPlugin-Bpdes0cJ.js → AuthenticationPlugin-C9BHGXlE.js} +2 -2
  84. package/lib/{AuthenticationPlugin-Bpdes0cJ.js.map → AuthenticationPlugin-C9BHGXlE.js.map} +1 -1
  85. package/lib/{Markdown-1BO9EA_X.js → Markdown-BDcCAWwm.js} +18 -16
  86. package/lib/{Markdown-1BO9EA_X.js.map → Markdown-BDcCAWwm.js.map} +1 -1
  87. package/lib/{MdxPage-BEOcOICU.js → MdxPage-DKMH_t0f.js} +14 -13
  88. package/lib/{MdxPage-BEOcOICU.js.map → MdxPage-DKMH_t0f.js.map} +1 -1
  89. package/lib/{OperationList-Cea2Yt8e.js → OperationList-DnaAtLxP.js} +3 -3
  90. package/lib/OperationList-DnaAtLxP.js.map +1 -0
  91. package/lib/{Route-BHT-onwf.js → Route-DSbLrlig.js} +2 -2
  92. package/lib/{Route-BHT-onwf.js.map → Route-DSbLrlig.js.map} +1 -1
  93. package/lib/{Select-m1aXZGAP.js → Select-Bagt3Bme.js} +3 -3
  94. package/lib/{Select-m1aXZGAP.js.map → Select-Bagt3Bme.js.map} +1 -1
  95. package/lib/{SlotletProvider-CPfsBw39.js → SlotletProvider-4Naek_5M.js} +2 -2
  96. package/lib/{SlotletProvider-CPfsBw39.js.map → SlotletProvider-4Naek_5M.js.map} +1 -1
  97. package/lib/{ZudokuContext-D1D8Anlj.js → ZudokuContext-BKXGJTmu.js} +459 -410
  98. package/lib/ZudokuContext-BKXGJTmu.js.map +1 -0
  99. package/lib/__vite-browser-external-BYRIRx8p.js +9 -0
  100. package/lib/__vite-browser-external-BYRIRx8p.js.map +1 -0
  101. package/lib/assets/worker-Bf8vjASY.js.map +1 -1
  102. package/lib/{hook-JSRuxV1P.js → hook-sn0zMTkE.js} +2 -2
  103. package/lib/{hook-JSRuxV1P.js.map → hook-sn0zMTkE.js.map} +1 -1
  104. package/lib/{index-Cj-F-4ME.js → index-B3F9d8oi.js} +430 -433
  105. package/lib/index-B3F9d8oi.js.map +1 -0
  106. package/lib/{urql-core-KJnLL26g.js → urql-core-CqTI9H6N.js} +289 -261
  107. package/lib/urql-core-CqTI9H6N.js.map +1 -0
  108. package/lib/zudoku.auth-clerk.js +1 -1
  109. package/lib/zudoku.auth-openid.js +2 -2
  110. package/lib/zudoku.components.js +454 -444
  111. package/lib/zudoku.components.js.map +1 -1
  112. package/lib/zudoku.openapi-worker.js +1 -1
  113. package/lib/zudoku.plugin-api-keys.js +6 -6
  114. package/lib/zudoku.plugin-custom-pages.js +1 -1
  115. package/lib/zudoku.plugin-markdown.js +93 -27
  116. package/lib/zudoku.plugin-markdown.js.map +1 -1
  117. package/lib/zudoku.plugin-openapi.js +6 -7
  118. package/lib/zudoku.plugin-openapi.js.map +1 -1
  119. package/package.json +3 -3
  120. package/src/app/entry.client.tsx +4 -2
  121. package/src/app/entry.server.tsx +4 -0
  122. package/src/app/main.css +4 -0
  123. package/src/app/main.tsx +9 -25
  124. package/src/app/standalone.tsx +1 -1
  125. package/src/lib/components/Header.tsx +10 -2
  126. package/src/lib/components/SyntaxHighlight.tsx +5 -1
  127. package/src/lib/components/TopNavigation.tsx +58 -24
  128. package/src/lib/components/context/ZudokuContext.ts +28 -20
  129. package/src/lib/components/navigation/Sidebar.tsx +5 -5
  130. package/src/lib/components/navigation/SidebarCategory.tsx +2 -4
  131. package/src/lib/components/navigation/SidebarItem.tsx +1 -3
  132. package/src/lib/components/navigation/utils.ts +11 -16
  133. package/src/lib/core/DevPortalContext.ts +3 -7
  134. package/src/lib/core/plugins.ts +2 -0
  135. package/src/lib/plugins/markdown/index.tsx +49 -12
  136. package/src/lib/plugins/markdown/resolver.ts +92 -0
  137. package/src/lib/plugins/openapi/Endpoint.tsx +2 -2
  138. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +1 -1
  139. package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
  140. package/src/lib/plugins/openapi/client/worker.ts +2 -2
  141. package/src/lib/plugins/openapi/index.tsx +1 -1
  142. package/src/lib/util/MdxComponents.tsx +0 -1
  143. package/src/lib/util/useScrollToAnchor.ts +1 -1
  144. package/dist/lib/plugins/markdown/generateRoutes.d.ts +0 -3
  145. package/dist/lib/plugins/markdown/generateRoutes.js +0 -21
  146. package/dist/lib/plugins/markdown/generateRoutes.js.map +0 -1
  147. package/dist/lib/ui/Note.d.ts +0 -8
  148. package/dist/lib/ui/Note.js +0 -23
  149. package/dist/lib/ui/Note.js.map +0 -1
  150. package/lib/OperationList-Cea2Yt8e.js.map +0 -1
  151. package/lib/ZudokuContext-D1D8Anlj.js.map +0 -1
  152. package/lib/index-Cj-F-4ME.js.map +0 -1
  153. package/lib/joinPath-B7kNnUX4.js +0 -8
  154. package/lib/joinPath-B7kNnUX4.js.map +0 -1
  155. package/lib/ui/Note.js +0 -51
  156. package/lib/ui/Note.js.map +0 -1
  157. package/lib/urql-core-KJnLL26g.js.map +0 -1
  158. package/lib/utils-B2yoT99j.js.map +0 -1
  159. package/src/lib/plugins/markdown/generateRoutes.tsx +0 -38
  160. package/src/lib/ui/Note.tsx +0 -58
@@ -1,13 +1,14 @@
1
- var Le = (t) => {
1
+ var _e = (t) => {
2
2
  throw TypeError(t);
3
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-CRo94sKK.js";
10
- var xe = class {
4
+ var be = (t, e, s) => e.has(t) || _e("Cannot " + s);
5
+ var i = (t, e, s) => (be(t, e, "read from private field"), s ? s.call(t) : e.get(t)), y = (t, e, s) => e.has(t) ? _e("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), c = (t, e, s, r) => (be(t, e, "write to private field"), r ? r.call(t, s) : e.set(t, s), s), b = (t, e, s) => (be(t, e, "access private method"), s);
6
+ import * as I from "react";
7
+ import { createContext as dt, useContext as ft } from "react";
8
+ import { j as yt } from "./jsx-runtime-B6kdoens.js";
9
+ import { u as pe } from "./index-CRo94sKK.js";
10
+ import { b as pt } from "./router-BsfSoK2j.js";
11
+ var ke = class {
11
12
  constructor() {
12
13
  this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
13
14
  }
@@ -24,35 +25,35 @@ var xe = class {
24
25
  onUnsubscribe() {
25
26
  }
26
27
  }, V = typeof window > "u" || "Deno" in globalThis;
27
- function be() {
28
+ function ge() {
28
29
  }
29
- function Gt(t, e) {
30
+ function Jt(t, e) {
30
31
  return typeof t == "function" ? t(e) : t;
31
32
  }
32
- function me(t) {
33
+ function Ce(t) {
33
34
  return typeof t == "number" && t >= 0 && t !== 1 / 0;
34
35
  }
35
- function Ze(t, e) {
36
+ function Ye(t, e) {
36
37
  return Math.max(t + (e || 0) - Date.now(), 0);
37
38
  }
38
- function de(t, e) {
39
+ function fe(t, e) {
39
40
  return typeof t == "function" ? t(e) : t;
40
41
  }
41
- function I(t, e) {
42
+ function q(t, e) {
42
43
  return typeof t == "function" ? t(e) : t;
43
44
  }
44
- function zt(t, e) {
45
+ function Zt(t, e) {
45
46
  const {
46
47
  type: s = "all",
47
48
  exact: r,
48
49
  fetchStatus: n,
49
- predicate: o,
50
+ predicate: u,
50
51
  queryKey: a,
51
- stale: h
52
+ stale: o
52
53
  } = t;
53
54
  if (a) {
54
55
  if (r) {
55
- if (e.queryHash !== lt(a, e.options))
56
+ if (e.queryHash !== vt(a, e.options))
56
57
  return !1;
57
58
  } else if (!Qe(e.queryKey, a))
58
59
  return !1;
@@ -62,28 +63,28 @@ function zt(t, e) {
62
63
  if (s === "active" && !l || s === "inactive" && l)
63
64
  return !1;
64
65
  }
65
- return !(typeof h == "boolean" && e.isStale() !== h || n && n !== e.state.fetchStatus || o && !o(e));
66
+ return !(typeof o == "boolean" && e.isStale() !== o || n && n !== e.state.fetchStatus || u && !u(e));
66
67
  }
67
- function Vt(t, e) {
68
- const { exact: s, status: r, predicate: n, mutationKey: o } = t;
69
- if (o) {
68
+ function Xt(t, e) {
69
+ const { exact: s, status: r, predicate: n, mutationKey: u } = t;
70
+ if (u) {
70
71
  if (!e.options.mutationKey)
71
72
  return !1;
72
73
  if (s) {
73
- if (ge(e.options.mutationKey) !== ge(o))
74
+ if (Se(e.options.mutationKey) !== Se(u))
74
75
  return !1;
75
- } else if (!Qe(e.options.mutationKey, o))
76
+ } else if (!Qe(e.options.mutationKey, u))
76
77
  return !1;
77
78
  }
78
79
  return !(r && e.state.status !== r || n && !n(e));
79
80
  }
80
- function lt(t, e) {
81
- return ((e == null ? void 0 : e.queryKeyHashFn) || ge)(t);
81
+ function vt(t, e) {
82
+ return ((e == null ? void 0 : e.queryKeyHashFn) || Se)(t);
82
83
  }
83
- function ge(t) {
84
+ function Se(t) {
84
85
  return JSON.stringify(
85
86
  t,
86
- (e, s) => Ce(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
87
+ (e, s) => Ee(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
87
88
  );
88
89
  }
89
90
  function Qe(t, e) {
@@ -92,19 +93,19 @@ function Qe(t, e) {
92
93
  function Re(t, e) {
93
94
  if (t === e)
94
95
  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 ? [] : {};
96
+ const s = He(t) && He(e);
97
+ if (s || Ee(t) && Ee(e)) {
98
+ const r = s ? t : Object.keys(t), n = r.length, u = s ? e : Object.keys(e), a = u.length, o = s ? [] : {};
98
99
  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++);
100
+ for (let C = 0; C < a; C++) {
101
+ const v = s ? C : u[C];
102
+ (!s && r.includes(v) || s) && t[v] === void 0 && e[v] === void 0 ? (o[v] = void 0, l++) : (o[v] = Re(t[v], e[v]), o[v] === t[v] && t[v] !== void 0 && l++);
102
103
  }
103
- return n === a && l === n ? t : h;
104
+ return n === a && l === n ? t : o;
104
105
  }
105
106
  return e;
106
107
  }
107
- function Se(t, e) {
108
+ function we(t, e) {
108
109
  if (!e || Object.keys(t).length !== Object.keys(e).length)
109
110
  return !1;
110
111
  for (const s in t)
@@ -112,27 +113,27 @@ function Se(t, e) {
112
113
  return !1;
113
114
  return !0;
114
115
  }
115
- function Ne(t) {
116
+ function He(t) {
116
117
  return Array.isArray(t) && t.length === Object.keys(t).length;
117
118
  }
118
- function Ce(t) {
119
- if (!Ke(t))
119
+ function Ee(t) {
120
+ if (!Be(t))
120
121
  return !1;
121
122
  const e = t.constructor;
122
123
  if (e === void 0)
123
124
  return !0;
124
125
  const s = e.prototype;
125
- return !(!Ke(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(t) !== Object.prototype);
126
+ return !(!Be(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(t) !== Object.prototype);
126
127
  }
127
- function Ke(t) {
128
+ function Be(t) {
128
129
  return Object.prototype.toString.call(t) === "[object Object]";
129
130
  }
130
- function dt(t) {
131
+ function bt(t) {
131
132
  return new Promise((e) => {
132
133
  setTimeout(e, t);
133
134
  });
134
135
  }
135
- function we(t, e, s) {
136
+ function Oe(t, e, s) {
136
137
  if (typeof s.structuralSharing == "function")
137
138
  return s.structuralSharing(t, e);
138
139
  if (s.structuralSharing !== !1) {
@@ -148,27 +149,27 @@ function we(t, e, s) {
148
149
  }
149
150
  return e;
150
151
  }
151
- function $t(t, e, s = 0) {
152
+ function Yt(t, e, s = 0) {
152
153
  const r = [...t, e];
153
154
  return s && r.length > s ? r.slice(1) : r;
154
155
  }
155
- function Wt(t, e, s = 0) {
156
+ function es(t, e, s = 0) {
156
157
  const r = [e, ...t];
157
158
  return s && r.length > s ? r.slice(0, -1) : r;
158
159
  }
159
- var fe = Symbol();
160
- function ft(t, e) {
161
- return process.env.NODE_ENV !== "production" && t.queryFn === fe && console.error(
160
+ var ye = Symbol();
161
+ function mt(t, e) {
162
+ return process.env.NODE_ENV !== "production" && t.queryFn === ye && console.error(
162
163
  `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
+ ), !t.queryFn && (e != null && e.initialPromise) ? () => e.initialPromise : !t.queryFn || t.queryFn === ye ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn;
164
165
  }
165
- var K, A, J, Ge, yt = (Ge = class extends xe {
166
+ var K, Q, Z, $e, gt = ($e = class extends ke {
166
167
  constructor() {
167
168
  super();
168
169
  y(this, K);
169
- y(this, A);
170
- y(this, J);
171
- c(this, J, (e) => {
170
+ y(this, Q);
171
+ y(this, Z);
172
+ c(this, Z, (e) => {
172
173
  if (!V && window.addEventListener) {
173
174
  const s = () => e();
174
175
  return window.addEventListener("visibilitychange", s, !1), () => {
@@ -178,15 +179,15 @@ var K, A, J, Ge, yt = (Ge = class extends xe {
178
179
  });
179
180
  }
180
181
  onSubscribe() {
181
- i(this, A) || this.setEventListener(i(this, J));
182
+ i(this, Q) || this.setEventListener(i(this, Z));
182
183
  }
183
184
  onUnsubscribe() {
184
185
  var e;
185
- this.hasListeners() || ((e = i(this, A)) == null || e.call(this), c(this, A, void 0));
186
+ this.hasListeners() || ((e = i(this, Q)) == null || e.call(this), c(this, Q, void 0));
186
187
  }
187
188
  setEventListener(e) {
188
189
  var s;
189
- c(this, J, e), (s = i(this, A)) == null || s.call(this), c(this, A, e((r) => {
190
+ c(this, Z, e), (s = i(this, Q)) == null || s.call(this), c(this, Q, e((r) => {
190
191
  typeof r == "boolean" ? this.setFocused(r) : this.onFocus();
191
192
  }));
192
193
  }
@@ -203,13 +204,13 @@ var K, A, J, Ge, yt = (Ge = class extends xe {
203
204
  var e;
204
205
  return typeof i(this, K) == "boolean" ? i(this, K) : ((e = globalThis.document) == null ? void 0 : e.visibilityState) !== "hidden";
205
206
  }
206
- }, K = new WeakMap(), A = new WeakMap(), J = new WeakMap(), Ge), Xe = new yt(), Z, k, X, ze, pt = (ze = class extends xe {
207
+ }, K = new WeakMap(), Q = new WeakMap(), Z = new WeakMap(), $e), et = new gt(), X, A, Y, We, Ct = (We = class extends ke {
207
208
  constructor() {
208
209
  super();
209
- y(this, Z, !0);
210
- y(this, k);
211
- y(this, X);
212
- c(this, X, (e) => {
210
+ y(this, X, !0);
211
+ y(this, A);
212
+ y(this, Y);
213
+ c(this, Y, (e) => {
213
214
  if (!V && window.addEventListener) {
214
215
  const s = () => e(!0), r = () => e(!1);
215
216
  return window.addEventListener("online", s, !1), window.addEventListener("offline", r, !1), () => {
@@ -219,29 +220,29 @@ var K, A, J, Ge, yt = (Ge = class extends xe {
219
220
  });
220
221
  }
221
222
  onSubscribe() {
222
- i(this, k) || this.setEventListener(i(this, X));
223
+ i(this, A) || this.setEventListener(i(this, Y));
223
224
  }
224
225
  onUnsubscribe() {
225
226
  var e;
226
- this.hasListeners() || ((e = i(this, k)) == null || e.call(this), c(this, k, void 0));
227
+ this.hasListeners() || ((e = i(this, A)) == null || e.call(this), c(this, A, void 0));
227
228
  }
228
229
  setEventListener(e) {
229
230
  var s;
230
- c(this, X, e), (s = i(this, k)) == null || s.call(this), c(this, k, e(this.setOnline.bind(this)));
231
+ c(this, Y, e), (s = i(this, A)) == null || s.call(this), c(this, A, e(this.setOnline.bind(this)));
231
232
  }
232
233
  setOnline(e) {
233
- i(this, Z) !== e && (c(this, Z, e), this.listeners.forEach((r) => {
234
+ i(this, X) !== e && (c(this, X, e), this.listeners.forEach((r) => {
234
235
  r(e);
235
236
  }));
236
237
  }
237
238
  isOnline() {
238
- return i(this, Z);
239
+ return i(this, X);
239
240
  }
240
- }, Z = new WeakMap(), k = new WeakMap(), X = new WeakMap(), ze), Ye = new pt();
241
- function Ee() {
241
+ }, X = new WeakMap(), A = new WeakMap(), Y = new WeakMap(), We), tt = new Ct();
242
+ function Fe() {
242
243
  let t, e;
243
- const s = new Promise((n, o) => {
244
- t = n, e = o;
244
+ const s = new Promise((n, u) => {
245
+ t = n, e = u;
245
246
  });
246
247
  s.status = "pending", s.catch(() => {
247
248
  });
@@ -260,39 +261,39 @@ function Ee() {
260
261
  }), e(n);
261
262
  }, s;
262
263
  }
263
- function vt(t) {
264
+ function St(t) {
264
265
  return Math.min(1e3 * 2 ** t, 3e4);
265
266
  }
266
- function et(t) {
267
- return (t ?? "online") === "online" ? Ye.isOnline() : !0;
267
+ function st(t) {
268
+ return (t ?? "online") === "online" ? tt.isOnline() : !0;
268
269
  }
269
- var tt = class extends Error {
270
+ var rt = class extends Error {
270
271
  constructor(t) {
271
272
  super("CancelledError"), this.revert = t == null ? void 0 : t.revert, this.silent = t == null ? void 0 : t.silent;
272
273
  }
273
274
  };
274
- function ve(t) {
275
- return t instanceof tt;
275
+ function me(t) {
276
+ return t instanceof rt;
276
277
  }
277
- function bt(t) {
278
+ function Rt(t) {
278
279
  let e = !1, s = 0, r = !1, n;
279
- const o = Ee(), a = (f) => {
280
+ const u = Fe(), a = (f) => {
280
281
  var g;
281
- r || (m(new tt(f)), (g = t.abort) == null || g.call(t));
282
- }, h = () => {
282
+ r || (m(new rt(f)), (g = t.abort) == null || g.call(t));
283
+ }, o = () => {
283
284
  e = !0;
284
285
  }, l = () => {
285
286
  e = !1;
286
- }, R = () => Xe.isFocused() && (t.networkMode === "always" || Ye.isOnline()) && t.canRun(), v = () => et(t.networkMode) && t.canRun(), u = (f) => {
287
+ }, C = () => et.isFocused() && (t.networkMode === "always" || tt.isOnline()) && t.canRun(), v = () => st(t.networkMode) && t.canRun(), h = (f) => {
287
288
  var g;
288
- r || (r = !0, (g = t.onSuccess) == null || g.call(t, f), n == null || n(), o.resolve(f));
289
+ r || (r = !0, (g = t.onSuccess) == null || g.call(t, f), n == null || n(), u.resolve(f));
289
290
  }, m = (f) => {
290
291
  var g;
291
- r || (r = !0, (g = t.onError) == null || g.call(t, f), n == null || n(), o.reject(f));
292
+ r || (r = !0, (g = t.onError) == null || g.call(t, f), n == null || n(), u.reject(f));
292
293
  }, S = () => new Promise((f) => {
293
294
  var g;
294
- n = (T) => {
295
- (r || R()) && f(T);
295
+ n = (P) => {
296
+ (r || C()) && f(P);
296
297
  }, (g = t.onPause) == null || g.call(t);
297
298
  }).then(() => {
298
299
  var f;
@@ -304,59 +305,59 @@ function bt(t) {
304
305
  const g = s === 0 ? t.initialPromise : void 0;
305
306
  try {
306
307
  f = g ?? t.fn();
307
- } catch (T) {
308
- f = Promise.reject(T);
308
+ } catch (P) {
309
+ f = Promise.reject(P);
309
310
  }
310
- Promise.resolve(f).then(u).catch((T) => {
311
- var ye;
311
+ Promise.resolve(f).then(h).catch((P) => {
312
+ var ve;
312
313
  if (r)
313
314
  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);
315
+ const U = t.retry ?? (V ? 0 : 3), N = t.retryDelay ?? St, ce = typeof N == "function" ? N(s, P) : N, le = U === !0 || typeof U == "number" && s < U || typeof U == "function" && U(s, P);
316
+ if (e || !le) {
317
+ m(P);
317
318
  return;
318
319
  }
319
- s++, (ye = t.onFail) == null || ye.call(t, s, T), dt(he).then(() => R() ? void 0 : S()).then(() => {
320
- e ? m(T) : w();
320
+ s++, (ve = t.onFail) == null || ve.call(t, s, P), bt(ce).then(() => C() ? void 0 : S()).then(() => {
321
+ e ? m(P) : w();
321
322
  });
322
323
  });
323
324
  };
324
325
  return {
325
- promise: o,
326
+ promise: u,
326
327
  cancel: a,
327
- continue: () => (n == null || n(), o),
328
- cancelRetry: h,
328
+ continue: () => (n == null || n(), u),
329
+ cancelRetry: o,
329
330
  continueRetry: l,
330
331
  canStart: v,
331
- start: () => (v() ? w() : S().then(w), o)
332
+ start: () => (v() ? w() : S().then(w), u)
332
333
  };
333
334
  }
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);
335
+ function wt() {
336
+ let t = [], e = 0, s = (o) => {
337
+ o();
338
+ }, r = (o) => {
339
+ o();
340
+ }, n = (o) => setTimeout(o, 0);
341
+ const u = (o) => {
342
+ e ? t.push(o) : n(() => {
343
+ s(o);
343
344
  });
344
345
  }, a = () => {
345
- const h = t;
346
- t = [], h.length && n(() => {
346
+ const o = t;
347
+ t = [], o.length && n(() => {
347
348
  r(() => {
348
- h.forEach((l) => {
349
+ o.forEach((l) => {
349
350
  s(l);
350
351
  });
351
352
  });
352
353
  });
353
354
  };
354
355
  return {
355
- batch: (h) => {
356
+ batch: (o) => {
356
357
  let l;
357
358
  e++;
358
359
  try {
359
- l = h();
360
+ l = o();
360
361
  } finally {
361
362
  e--, e || a();
362
363
  }
@@ -365,32 +366,32 @@ function mt() {
365
366
  /**
366
367
  * All calls to the wrapped function will be batched.
367
368
  */
368
- batchCalls: (h) => (...l) => {
369
- o(() => {
370
- h(...l);
369
+ batchCalls: (o) => (...l) => {
370
+ u(() => {
371
+ o(...l);
371
372
  });
372
373
  },
373
- schedule: o,
374
+ schedule: u,
374
375
  /**
375
376
  * Use this method to set a custom notify function.
376
377
  * This can be used to for example wrap notifications with `React.act` while running tests.
377
378
  */
378
- setNotifyFunction: (h) => {
379
- s = h;
379
+ setNotifyFunction: (o) => {
380
+ s = o;
380
381
  },
381
382
  /**
382
383
  * Use this method to set a custom function to batch notifications together into a single tick.
383
384
  * By default React Query will use the batch function provided by ReactDOM or React Native.
384
385
  */
385
- setBatchNotifyFunction: (h) => {
386
- r = h;
386
+ setBatchNotifyFunction: (o) => {
387
+ r = o;
387
388
  },
388
- setScheduler: (h) => {
389
- n = h;
389
+ setScheduler: (o) => {
390
+ n = o;
390
391
  }
391
392
  };
392
393
  }
393
- var je = mt(), _, Ve, gt = (Ve = class {
394
+ var Ae = wt(), _, Je, Et = (Je = class {
394
395
  constructor() {
395
396
  y(this, _);
396
397
  }
@@ -398,7 +399,7 @@ var je = mt(), _, Ve, gt = (Ve = class {
398
399
  this.clearGcTimeout();
399
400
  }
400
401
  scheduleGc() {
401
- this.clearGcTimeout(), me(this.gcTime) && c(this, _, setTimeout(() => {
402
+ this.clearGcTimeout(), Ce(this.gcTime) && c(this, _, setTimeout(() => {
402
403
  this.optionalRemove();
403
404
  }, this.gcTime));
404
405
  }
@@ -411,34 +412,34 @@ var je = mt(), _, Ve, gt = (Ve = class {
411
412
  clearGcTimeout() {
412
413
  i(this, _) && (clearTimeout(i(this, _)), c(this, _, void 0));
413
414
  }
414
- }, _ = new WeakMap(), Ve), Y, ee, D, C, ae, H, q, j, $e, Jt = ($e = class extends gt {
415
+ }, _ = new WeakMap(), Je), ee, te, D, R, oe, H, T, k, Ze, ts = (Ze = class extends Et {
415
416
  constructor(e) {
416
417
  super();
417
- y(this, q);
418
- y(this, Y);
418
+ y(this, T);
419
419
  y(this, ee);
420
+ y(this, te);
420
421
  y(this, D);
421
- y(this, C);
422
- y(this, ae);
422
+ y(this, R);
423
+ y(this, oe);
423
424
  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
+ c(this, H, !1), c(this, oe, e.defaultOptions), this.setOptions(e.options), this.observers = [], c(this, D, e.cache), this.queryKey = e.queryKey, this.queryHash = e.queryHash, c(this, ee, Ot(this.options)), this.state = e.state ?? i(this, ee), this.scheduleGc();
425
426
  }
426
427
  get meta() {
427
428
  return this.options.meta;
428
429
  }
429
430
  get promise() {
430
431
  var e;
431
- return (e = i(this, C)) == null ? void 0 : e.promise;
432
+ return (e = i(this, R)) == null ? void 0 : e.promise;
432
433
  }
433
434
  setOptions(e) {
434
- this.options = { ...i(this, ae), ...e }, this.updateGcTime(this.options.gcTime);
435
+ this.options = { ...i(this, oe), ...e }, this.updateGcTime(this.options.gcTime);
435
436
  }
436
437
  optionalRemove() {
437
438
  !this.observers.length && this.state.fetchStatus === "idle" && i(this, D).remove(this);
438
439
  }
439
440
  setData(e, s) {
440
- const r = we(this.state.data, e, this.options);
441
- return b(this, q, j).call(this, {
441
+ const r = Oe(this.state.data, e, this.options);
442
+ return b(this, T, k).call(this, {
442
443
  data: r,
443
444
  type: "success",
444
445
  dataUpdatedAt: s == null ? void 0 : s.updatedAt,
@@ -446,26 +447,26 @@ var je = mt(), _, Ve, gt = (Ve = class {
446
447
  }), r;
447
448
  }
448
449
  setState(e, s) {
449
- b(this, q, j).call(this, { type: "setState", state: e, setStateOptions: s });
450
+ b(this, T, k).call(this, { type: "setState", state: e, setStateOptions: s });
450
451
  }
451
452
  cancel(e) {
452
453
  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();
454
+ const s = (r = i(this, R)) == null ? void 0 : r.promise;
455
+ return (n = i(this, R)) == null || n.cancel(e), s ? s.then(ge).catch(ge) : Promise.resolve();
455
456
  }
456
457
  destroy() {
457
458
  super.destroy(), this.cancel({ silent: !0 });
458
459
  }
459
460
  reset() {
460
- this.destroy(), this.setState(i(this, Y));
461
+ this.destroy(), this.setState(i(this, ee));
461
462
  }
462
463
  isActive() {
463
464
  return this.observers.some(
464
- (e) => I(e.options.enabled, this) !== !1
465
+ (e) => q(e.options.enabled, this) !== !1
465
466
  );
466
467
  }
467
468
  isDisabled() {
468
- return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === fe || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
469
+ return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === ye || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
469
470
  }
470
471
  isStale() {
471
472
  return this.state.isInvalidated ? !0 : this.getObserversCount() > 0 ? this.observers.some(
@@ -473,129 +474,129 @@ var je = mt(), _, Ve, gt = (Ve = class {
473
474
  ) : this.state.data === void 0;
474
475
  }
475
476
  isStaleByTime(e = 0) {
476
- return this.state.isInvalidated || this.state.data === void 0 || !Ze(this.state.dataUpdatedAt, e);
477
+ return this.state.isInvalidated || this.state.data === void 0 || !Ye(this.state.dataUpdatedAt, e);
477
478
  }
478
479
  onFocus() {
479
480
  var s;
480
481
  const e = this.observers.find((r) => r.shouldFetchOnWindowFocus());
481
- e == null || e.refetch({ cancelRefetch: !1 }), (s = i(this, C)) == null || s.continue();
482
+ e == null || e.refetch({ cancelRefetch: !1 }), (s = i(this, R)) == null || s.continue();
482
483
  }
483
484
  onOnline() {
484
485
  var s;
485
486
  const e = this.observers.find((r) => r.shouldFetchOnReconnect());
486
- e == null || e.refetch({ cancelRefetch: !1 }), (s = i(this, C)) == null || s.continue();
487
+ e == null || e.refetch({ cancelRefetch: !1 }), (s = i(this, R)) == null || s.continue();
487
488
  }
488
489
  addObserver(e) {
489
490
  this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(), i(this, D).notify({ type: "observerAdded", query: this, observer: e }));
490
491
  }
491
492
  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
+ this.observers.includes(e) && (this.observers = this.observers.filter((s) => s !== e), this.observers.length || (i(this, R) && (i(this, H) ? i(this, R).cancel({ revert: !0 }) : i(this, R).cancelRetry()), this.scheduleGc()), i(this, D).notify({ type: "observerRemoved", query: this, observer: e }));
493
494
  }
494
495
  getObserversCount() {
495
496
  return this.observers.length;
496
497
  }
497
498
  invalidate() {
498
- this.state.isInvalidated || b(this, q, j).call(this, { type: "invalidate" });
499
+ this.state.isInvalidated || b(this, T, k).call(this, { type: "invalidate" });
499
500
  }
500
501
  fetch(e, s) {
501
- var l, R, v;
502
+ var l, C, v;
502
503
  if (this.state.fetchStatus !== "idle") {
503
504
  if (this.state.data !== void 0 && (s != null && s.cancelRefetch))
504
505
  this.cancel({ silent: !0 });
505
- else if (i(this, C))
506
- return i(this, C).continueRetry(), i(this, C).promise;
506
+ else if (i(this, R))
507
+ return i(this, R).continueRetry(), i(this, R).promise;
507
508
  }
508
509
  if (e && this.setOptions(e), !this.options.queryFn) {
509
- const u = this.observers.find((m) => m.options.queryFn);
510
- u && this.setOptions(u.options);
510
+ const h = this.observers.find((m) => m.options.queryFn);
511
+ h && this.setOptions(h.options);
511
512
  }
512
513
  process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
513
514
  "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
  ));
515
- const r = new AbortController(), n = (u) => {
516
- Object.defineProperty(u, "signal", {
516
+ const r = new AbortController(), n = (h) => {
517
+ Object.defineProperty(h, "signal", {
517
518
  enumerable: !0,
518
519
  get: () => (c(this, H, !0), r.signal)
519
520
  });
520
- }, o = () => {
521
- const u = ft(this.options, s), m = {
521
+ }, u = () => {
522
+ const h = mt(this.options, s), m = {
522
523
  queryKey: this.queryKey,
523
524
  meta: this.meta
524
525
  };
525
526
  return n(m), c(this, H, !1), this.options.persister ? this.options.persister(
526
- u,
527
+ h,
527
528
  m,
528
529
  this
529
- ) : u(m);
530
+ ) : h(m);
530
531
  }, a = {
531
532
  fetchOptions: s,
532
533
  options: this.options,
533
534
  queryKey: this.queryKey,
534
535
  state: this.state,
535
- fetchFn: o
536
+ fetchFn: u
536
537
  };
537
538
  n(a), (l = this.options.behavior) == null || l.onFetch(
538
539
  a,
539
540
  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) => {
541
+ ), c(this, te, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((C = a.fetchOptions) == null ? void 0 : C.meta)) && b(this, T, k).call(this, { type: "fetch", meta: (v = a.fetchOptions) == null ? void 0 : v.meta });
542
+ const o = (h) => {
542
543
  var m, S, w, f;
543
- ve(u) && u.silent || b(this, q, j).call(this, {
544
+ me(h) && h.silent || b(this, T, k).call(this, {
544
545
  type: "error",
545
- error: u
546
- }), ve(u) || ((S = (m = i(this, D).config).onError) == null || S.call(
546
+ error: h
547
+ }), me(h) || ((S = (m = i(this, D).config).onError) == null || S.call(
547
548
  m,
548
- u,
549
+ h,
549
550
  this
550
551
  ), (f = (w = i(this, D).config).onSettled) == null || f.call(
551
552
  w,
552
553
  this.state.data,
553
- u,
554
+ h,
554
555
  this
555
556
  )), this.scheduleGc();
556
557
  };
557
- return c(this, C, bt({
558
+ return c(this, R, Rt({
558
559
  initialPromise: s == null ? void 0 : s.initialPromise,
559
560
  fn: a.fetchFn,
560
561
  abort: r.abort.bind(r),
561
- onSuccess: (u) => {
562
+ onSuccess: (h) => {
562
563
  var m, S, w, f;
563
- if (u === void 0) {
564
+ if (h === void 0) {
564
565
  process.env.NODE_ENV !== "production" && console.error(
565
566
  `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
+ ), o(new Error(`${this.queryHash} data is undefined`));
567
568
  return;
568
569
  }
569
570
  try {
570
- this.setData(u);
571
+ this.setData(h);
571
572
  } catch (g) {
572
- h(g);
573
+ o(g);
573
574
  return;
574
575
  }
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
+ (S = (m = i(this, D).config).onSuccess) == null || S.call(m, h, this), (f = (w = i(this, D).config).onSettled) == null || f.call(
576
577
  w,
577
- u,
578
+ h,
578
579
  this.state.error,
579
580
  this
580
581
  ), this.scheduleGc();
581
582
  },
582
- onError: h,
583
- onFail: (u, m) => {
584
- b(this, q, j).call(this, { type: "failed", failureCount: u, error: m });
583
+ onError: o,
584
+ onFail: (h, m) => {
585
+ b(this, T, k).call(this, { type: "failed", failureCount: h, error: m });
585
586
  },
586
587
  onPause: () => {
587
- b(this, q, j).call(this, { type: "pause" });
588
+ b(this, T, k).call(this, { type: "pause" });
588
589
  },
589
590
  onContinue: () => {
590
- b(this, q, j).call(this, { type: "continue" });
591
+ b(this, T, k).call(this, { type: "continue" });
591
592
  },
592
593
  retry: a.options.retry,
593
594
  retryDelay: a.options.retryDelay,
594
595
  networkMode: a.options.networkMode,
595
596
  canRun: () => !0
596
- })), i(this, C).start();
597
+ })), i(this, R).start();
597
598
  }
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
+ }, ee = new WeakMap(), te = new WeakMap(), D = new WeakMap(), R = new WeakMap(), oe = new WeakMap(), H = new WeakMap(), T = new WeakSet(), k = function(e) {
599
600
  const s = (r) => {
600
601
  switch (e.type) {
601
602
  case "failed":
@@ -617,7 +618,7 @@ var je = mt(), _, Ve, gt = (Ve = class {
617
618
  case "fetch":
618
619
  return {
619
620
  ...r,
620
- ...st(r.data, this.options),
621
+ ...it(r.data, this.options),
621
622
  fetchMeta: e.meta ?? null
622
623
  };
623
624
  case "success":
@@ -637,7 +638,7 @@ var je = mt(), _, Ve, gt = (Ve = class {
637
638
  };
638
639
  case "error":
639
640
  const n = e.error;
640
- return ve(n) && n.revert && i(this, ee) ? { ...i(this, ee), fetchStatus: "idle" } : {
641
+ return me(n) && n.revert && i(this, te) ? { ...i(this, te), fetchStatus: "idle" } : {
641
642
  ...r,
642
643
  error: n,
643
644
  errorUpdateCount: r.errorUpdateCount + 1,
@@ -659,24 +660,24 @@ var je = mt(), _, Ve, gt = (Ve = class {
659
660
  };
660
661
  }
661
662
  };
662
- this.state = s(this.state), je.batch(() => {
663
+ this.state = s(this.state), Ae.batch(() => {
663
664
  this.observers.forEach((r) => {
664
665
  r.onQueryUpdate();
665
666
  }), i(this, D).notify({ query: this, type: "updated", action: e });
666
667
  });
667
- }, $e);
668
- function st(t, e) {
668
+ }, Ze);
669
+ function it(t, e) {
669
670
  return {
670
671
  fetchFailureCount: 0,
671
672
  fetchFailureReason: null,
672
- fetchStatus: et(e.networkMode) ? "fetching" : "paused",
673
+ fetchStatus: st(e.networkMode) ? "fetching" : "paused",
673
674
  ...t === void 0 && {
674
675
  error: null,
675
676
  status: "pending"
676
677
  }
677
678
  };
678
679
  }
679
- function Rt(t) {
680
+ function Ot(t) {
680
681
  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
682
  return {
682
683
  data: e,
@@ -693,28 +694,28 @@ function Rt(t) {
693
694
  fetchStatus: "idle"
694
695
  };
695
696
  }
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
+ var F, d, ue, O, B, se, L, x, he, re, ie, G, z, M, ne, p, ae, Pe, De, Ie, Te, qe, je, xe, at, Xe, nt = (Xe = class extends ke {
697
698
  constructor(e, s) {
698
699
  super();
699
700
  y(this, p);
700
- y(this, O);
701
- y(this, d);
702
- y(this, oe);
703
701
  y(this, F);
704
- y(this, B);
705
- y(this, te);
706
- y(this, M);
707
- y(this, x);
702
+ y(this, d);
708
703
  y(this, ue);
704
+ y(this, O);
705
+ y(this, B);
709
706
  y(this, se);
707
+ y(this, L);
708
+ y(this, x);
709
+ y(this, he);
710
+ y(this, re);
710
711
  // This property keeps track of the last query with defined data.
711
712
  // It will be used to pass the previous data and query to the placeholder function between renders.
712
- y(this, re);
713
+ y(this, ie);
713
714
  y(this, G);
714
715
  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(
716
+ y(this, M);
717
+ y(this, ne, /* @__PURE__ */ new Set());
718
+ this.options = s, c(this, F, e), c(this, x, null), c(this, L, Fe()), this.options.experimental_prefetchInRender || i(this, L).reject(
718
719
  new Error("experimental_prefetchInRender feature flag is not enabled")
719
720
  ), this.bindMethods(), this.setOptions(s);
720
721
  }
@@ -722,7 +723,7 @@ var O, d, oe, F, B, te, M, x, ue, se, re, G, z, L, ie, p, ne, Fe, Oe, Te, De, Pe
722
723
  this.refetch = this.refetch.bind(this);
723
724
  }
724
725
  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
+ this.listeners.size === 1 && (i(this, d).addObserver(this), Ge(i(this, d), this.options) ? b(this, p, ae).call(this) : this.updateResult(), b(this, p, Te).call(this));
726
727
  }
727
728
  onUnsubscribe() {
728
729
  this.hasListeners() || this.destroy();
@@ -742,35 +743,35 @@ var O, d, oe, F, B, te, M, x, ue, se, re, G, z, L, ie, p, ne, Fe, Oe, Te, De, Pe
742
743
  );
743
744
  }
744
745
  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
+ this.listeners = /* @__PURE__ */ new Set(), b(this, p, qe).call(this), b(this, p, je).call(this), i(this, d).removeObserver(this);
746
747
  }
747
748
  setOptions(e, s) {
748
749
  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
+ if (this.options = i(this, F).defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof q(this.options.enabled, i(this, d)) != "boolean")
750
751
  throw new Error(
751
752
  "Expected enabled to be a boolean or a callback that returns a boolean"
752
753
  );
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
+ b(this, p, xe).call(this), i(this, d).setOptions(this.options), r._defaulted && !we(this.options, r) && i(this, F).getQueryCache().notify({
754
755
  type: "observerOptionsUpdated",
755
756
  query: i(this, d),
756
757
  observer: this
757
758
  });
758
- const o = this.hasListeners();
759
- o && He(
759
+ const u = this.hasListeners();
760
+ u && ze(
760
761
  i(this, d),
761
762
  n,
762
763
  this.options,
763
764
  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);
765
+ ) && b(this, p, ae).call(this), this.updateResult(s), u && (i(this, d) !== n || q(this.options.enabled, i(this, d)) !== q(r.enabled, i(this, d)) || fe(this.options.staleTime, i(this, d)) !== fe(r.staleTime, i(this, d))) && b(this, p, Pe).call(this);
766
+ const a = b(this, p, De).call(this);
767
+ u && (i(this, d) !== n || q(this.options.enabled, i(this, d)) !== q(r.enabled, i(this, d)) || a !== i(this, M)) && b(this, p, Ie).call(this, a);
767
768
  }
768
769
  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;
770
+ const s = i(this, F).getQueryCache().build(i(this, F), e), r = this.createResult(s, e);
771
+ return Pt(this, r) && (c(this, O, r), c(this, se, this.options), c(this, B, i(this, d).state)), r;
771
772
  }
772
773
  getCurrentResult() {
773
- return i(this, F);
774
+ return i(this, O);
774
775
  }
775
776
  trackResult(e, s) {
776
777
  const r = {};
@@ -783,7 +784,7 @@ var O, d, oe, F, B, te, M, x, ue, se, re, G, z, L, ie, p, ne, Fe, Oe, Te, De, Pe
783
784
  }), r;
784
785
  }
785
786
  trackProp(e) {
786
- i(this, ie).add(e);
787
+ i(this, ne).add(e);
787
788
  }
788
789
  getCurrentQuery() {
789
790
  return i(this, d);
@@ -794,214 +795,214 @@ var O, d, oe, F, B, te, M, x, ue, se, re, G, z, L, ie, p, ne, Fe, Oe, Te, De, Pe
794
795
  });
795
796
  }
796
797
  fetchOptimistic(e) {
797
- const s = i(this, O).defaultQueryOptions(e), r = i(this, O).getQueryCache().build(i(this, O), s);
798
+ const s = i(this, F).defaultQueryOptions(e), r = i(this, F).getQueryCache().build(i(this, F), s);
798
799
  return r.fetch().then(() => this.createResult(r, s));
799
800
  }
800
801
  fetch(e) {
801
- return b(this, p, ne).call(this, {
802
+ return b(this, p, ae).call(this, {
802
803
  ...e,
803
804
  cancelRefetch: e.cancelRefetch ?? !0
804
- }).then(() => (this.updateResult(), i(this, F)));
805
+ }).then(() => (this.updateResult(), i(this, O)));
805
806
  }
806
807
  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;
808
+ var Ke;
809
+ const r = i(this, d), n = this.options, u = i(this, O), a = i(this, B), o = i(this, se), C = e !== r ? e.state : i(this, ue), { state: v } = e;
810
+ let h = { ...v }, m = !1, S;
810
811
  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");
812
+ const E = this.hasListeners(), W = !E && Ge(e, s), J = E && ze(e, r, s, n);
813
+ (W || J) && (h = {
814
+ ...h,
815
+ ...it(v.data, e.options)
816
+ }), s._optimisticResults === "isRestoring" && (h.fetchStatus = "idle");
816
817
  }
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);
818
+ let { error: w, errorUpdatedAt: f, status: g } = h;
819
+ if (s.select && h.data !== void 0)
820
+ if (u && h.data === (a == null ? void 0 : a.data) && s.select === i(this, he))
821
+ S = i(this, re);
821
822
  else
822
823
  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
+ c(this, he, s.select), S = s.select(h.data), S = Oe(u == null ? void 0 : u.data, S, s), c(this, re, S), c(this, x, null);
824
825
  } catch (E) {
825
826
  c(this, x, E);
826
827
  }
827
828
  else
828
- S = u.data;
829
+ S = h.data;
829
830
  if (s.placeholderData !== void 0 && S === void 0 && g === "pending") {
830
831
  let E;
831
- if (o != null && o.isPlaceholderData && s.placeholderData === (h == null ? void 0 : h.placeholderData))
832
- E = o.data;
832
+ if (u != null && u.isPlaceholderData && s.placeholderData === (o == null ? void 0 : o.placeholderData))
833
+ E = u.data;
833
834
  else if (E = typeof s.placeholderData == "function" ? s.placeholderData(
834
- (Me = i(this, re)) == null ? void 0 : Me.state.data,
835
- i(this, re)
835
+ (Ke = i(this, ie)) == null ? void 0 : Ke.state.data,
836
+ i(this, ie)
836
837
  ) : s.placeholderData, s.select && E !== void 0)
837
838
  try {
838
839
  E = s.select(E), c(this, x, null);
839
- } catch ($) {
840
- c(this, x, $);
840
+ } catch (W) {
841
+ c(this, x, W);
841
842
  }
842
- E !== void 0 && (g = "success", S = we(
843
- o == null ? void 0 : o.data,
843
+ E !== void 0 && (g = "success", S = Oe(
844
+ u == null ? void 0 : u.data,
844
845
  E,
845
846
  s
846
847
  ), m = !0);
847
848
  }
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 = {
849
+ i(this, x) && (w = i(this, x), S = i(this, re), f = Date.now(), g = "error");
850
+ const P = h.fetchStatus === "fetching", U = g === "pending", N = g === "error", ce = U && P, le = S !== void 0, j = {
850
851
  status: g,
851
- fetchStatus: u.fetchStatus,
852
- isPending: Q,
852
+ fetchStatus: h.fetchStatus,
853
+ isPending: U,
853
854
  isSuccess: g === "success",
854
855
  isError: N,
855
- isInitialLoading: he,
856
- isLoading: he,
856
+ isInitialLoading: ce,
857
+ isLoading: ce,
857
858
  data: S,
858
- dataUpdatedAt: u.dataUpdatedAt,
859
+ dataUpdatedAt: h.dataUpdatedAt,
859
860
  error: w,
860
861
  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",
862
+ failureCount: h.fetchFailureCount,
863
+ failureReason: h.fetchFailureReason,
864
+ errorUpdateCount: h.errorUpdateCount,
865
+ isFetched: h.dataUpdateCount > 0 || h.errorUpdateCount > 0,
866
+ isFetchedAfterMount: h.dataUpdateCount > C.dataUpdateCount || h.errorUpdateCount > C.errorUpdateCount,
867
+ isFetching: P,
868
+ isRefetching: P && !U,
869
+ isLoadingError: N && !le,
870
+ isPaused: h.fetchStatus === "paused",
870
871
  isPlaceholderData: m,
871
- isRefetchError: N && ce,
872
- isStale: Ae(e, s),
872
+ isRefetchError: N && le,
873
+ isStale: Le(e, s),
873
874
  refetch: this.refetch,
874
- promise: i(this, M)
875
+ promise: i(this, L)
875
876
  };
876
877
  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) {
878
+ const E = (de) => {
879
+ j.status === "error" ? de.reject(j.error) : j.data !== void 0 && de.resolve(j.data);
880
+ }, W = () => {
881
+ const de = c(this, L, j.promise = Fe());
882
+ E(de);
883
+ }, J = i(this, L);
884
+ switch (J.status) {
884
885
  case "pending":
885
- e.queryHash === r.queryHash && E(W);
886
+ e.queryHash === r.queryHash && E(J);
886
887
  break;
887
888
  case "fulfilled":
888
- (U.status === "error" || U.data !== W.value) && $();
889
+ (j.status === "error" || j.data !== J.value) && W();
889
890
  break;
890
891
  case "rejected":
891
- (U.status !== "error" || U.error !== W.reason) && $();
892
+ (j.status !== "error" || j.error !== J.reason) && W();
892
893
  break;
893
894
  }
894
895
  }
895
- return U;
896
+ return j;
896
897
  }
897
898
  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))
899
+ const s = i(this, O), r = this.createResult(i(this, d), this.options);
900
+ if (c(this, B, i(this, d).state), c(this, se, this.options), i(this, B).data !== void 0 && c(this, ie, i(this, d)), we(r, s))
900
901
  return;
901
- c(this, F, r);
902
- const n = {}, o = () => {
902
+ c(this, O, r);
903
+ const n = {}, u = () => {
903
904
  if (!s)
904
905
  return !0;
905
- const { notifyOnChangeProps: a } = this.options, h = typeof a == "function" ? a() : a;
906
- if (h === "all" || !h && !i(this, ie).size)
906
+ const { notifyOnChangeProps: a } = this.options, o = typeof a == "function" ? a() : a;
907
+ if (o === "all" || !o && !i(this, ne).size)
907
908
  return !0;
908
909
  const l = new Set(
909
- h ?? i(this, ie)
910
+ o ?? i(this, ne)
910
911
  );
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);
912
+ return this.options.throwOnError && l.add("error"), Object.keys(i(this, O)).some((C) => {
913
+ const v = C;
914
+ return i(this, O)[v] !== s[v] && l.has(v);
914
915
  });
915
916
  };
916
- (e == null ? void 0 : e.listeners) !== !1 && o() && (n.listeners = !0), b(this, p, it).call(this, { ...n, ...e });
917
+ (e == null ? void 0 : e.listeners) !== !1 && u() && (n.listeners = !0), b(this, p, at).call(this, { ...n, ...e });
917
918
  }
918
919
  onQueryUpdate() {
919
- this.updateResult(), this.hasListeners() && b(this, p, De).call(this);
920
+ this.updateResult(), this.hasListeners() && b(this, p, Te).call(this);
920
921
  }
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);
922
+ }, F = new WeakMap(), d = new WeakMap(), ue = new WeakMap(), O = new WeakMap(), B = new WeakMap(), se = new WeakMap(), L = new WeakMap(), x = new WeakMap(), he = new WeakMap(), re = new WeakMap(), ie = new WeakMap(), G = new WeakMap(), z = new WeakMap(), M = new WeakMap(), ne = new WeakMap(), p = new WeakSet(), ae = function(e) {
923
+ b(this, p, xe).call(this);
923
924
  let s = i(this, d).fetch(
924
925
  this.options,
925
926
  e
926
927
  );
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(
928
+ return e != null && e.throwOnError || (s = s.catch(ge)), s;
929
+ }, Pe = function() {
930
+ b(this, p, qe).call(this);
931
+ const e = fe(
931
932
  this.options.staleTime,
932
933
  i(this, d)
933
934
  );
934
- if (V || i(this, F).isStale || !me(e))
935
+ if (V || i(this, O).isStale || !Ce(e))
935
936
  return;
936
- const r = Ze(i(this, F).dataUpdatedAt, e) + 1;
937
+ const r = Ye(i(this, O).dataUpdatedAt, e) + 1;
937
938
  c(this, G, setTimeout(() => {
938
- i(this, F).isStale || this.updateResult();
939
+ i(this, O).isStale || this.updateResult();
939
940
  }, 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
941
  }, 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));
942
+ return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(i(this, d)) : this.options.refetchInterval) ?? !1;
943
+ }, Ie = function(e) {
944
+ b(this, p, je).call(this), c(this, M, e), !(V || q(this.options.enabled, i(this, d)) === !1 || !Ce(i(this, M)) || i(this, M) === 0) && c(this, z, setInterval(() => {
945
+ (this.options.refetchIntervalInBackground || et.isFocused()) && b(this, p, ae).call(this);
946
+ }, i(this, M)));
947
+ }, Te = function() {
948
+ b(this, p, Pe).call(this), b(this, p, Ie).call(this, b(this, p, De).call(this));
950
949
  }, qe = function() {
950
+ i(this, G) && (clearTimeout(i(this, G)), c(this, G, void 0));
951
+ }, je = function() {
951
952
  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);
953
+ }, xe = function() {
954
+ const e = i(this, F).getQueryCache().build(i(this, F), this.options);
954
955
  if (e === i(this, d))
955
956
  return;
956
957
  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(() => {
958
+ c(this, d, e), c(this, ue, e.state), this.hasListeners() && (s == null || s.removeObserver(this), e.addObserver(this));
959
+ }, at = function(e) {
960
+ Ae.batch(() => {
960
961
  e.listeners && this.listeners.forEach((s) => {
961
- s(i(this, F));
962
- }), i(this, O).getQueryCache().notify({
962
+ s(i(this, O));
963
+ }), i(this, F).getQueryCache().notify({
963
964
  query: i(this, d),
964
965
  type: "observerResultsUpdated"
965
966
  });
966
967
  });
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);
968
+ }, Xe);
969
+ function Ft(t, e) {
970
+ return q(e.enabled, t) !== !1 && t.state.data === void 0 && !(t.state.status === "error" && e.retryOnMount === !1);
970
971
  }
971
- function _e(t, e) {
972
- return St(t, e) || t.state.data !== void 0 && Ue(t, e, e.refetchOnMount);
972
+ function Ge(t, e) {
973
+ return Ft(t, e) || t.state.data !== void 0 && Ue(t, e, e.refetchOnMount);
973
974
  }
974
975
  function Ue(t, e, s) {
975
- if (I(e.enabled, t) !== !1) {
976
+ if (q(e.enabled, t) !== !1) {
976
977
  const r = typeof s == "function" ? s(t) : s;
977
- return r === "always" || r !== !1 && Ae(t, e);
978
+ return r === "always" || r !== !1 && Le(t, e);
978
979
  }
979
980
  return !1;
980
981
  }
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);
982
+ function ze(t, e, s, r) {
983
+ return (t !== e || q(r.enabled, t) === !1) && (!s.suspense || t.state.status !== "error") && Le(t, s);
983
984
  }
984
- function Ae(t, e) {
985
- return I(e.enabled, t) !== !1 && t.isStaleByTime(de(e.staleTime, t));
985
+ function Le(t, e) {
986
+ return q(e.enabled, t) !== !1 && t.isStaleByTime(fe(e.staleTime, t));
986
987
  }
987
- function Ct(t, e) {
988
- return !Se(t.getCurrentResult(), e);
988
+ function Pt(t, e) {
989
+ return !we(t.getCurrentResult(), e);
989
990
  }
990
- var nt = P.createContext(
991
+ var ot = I.createContext(
991
992
  void 0
992
- ), wt = (t) => {
993
- const e = P.useContext(nt);
993
+ ), Dt = (t) => {
994
+ const e = I.useContext(ot);
994
995
  if (!e)
995
996
  throw new Error("No QueryClient set, use QueryClientProvider to set one");
996
997
  return e;
997
- }, Zt = ({
998
+ }, ss = ({
998
999
  client: t,
999
1000
  children: e
1000
- }) => (P.useEffect(() => (t.mount(), () => {
1001
+ }) => (I.useEffect(() => (t.mount(), () => {
1001
1002
  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() {
1003
+ }), [t]), /* @__PURE__ */ yt.jsx(ot.Provider, { value: t, children: e })), ut = I.createContext(!1), It = () => I.useContext(ut);
1004
+ ut.Provider;
1005
+ function Tt() {
1005
1006
  let t = !1;
1006
1007
  return {
1007
1008
  clearReset: () => {
@@ -1013,161 +1014,209 @@ function Ft() {
1013
1014
  isReset: () => t
1014
1015
  };
1015
1016
  }
1016
- var Ot = P.createContext(Ft()), Tt = () => P.useContext(Ot);
1017
- function Dt(t, e) {
1017
+ var qt = I.createContext(Tt()), jt = () => I.useContext(qt);
1018
+ function xt(t, e) {
1018
1019
  return typeof t == "function" ? t(...e) : !!t;
1019
1020
  }
1020
- function Pt() {
1021
+ function Ut() {
1021
1022
  }
1022
- var qt = (t, e) => {
1023
+ var kt = (t, e) => {
1023
1024
  (t.suspense || t.throwOnError) && (e.isReset() || (t.retryOnMount = !1));
1024
- }, It = (t) => {
1025
- P.useEffect(() => {
1025
+ }, Qt = (t) => {
1026
+ I.useEffect(() => {
1026
1027
  t.clearReset();
1027
1028
  }, [t]);
1028
- }, Ut = ({
1029
+ }, At = ({
1029
1030
  result: t,
1030
1031
  errorResetBoundary: e,
1031
1032
  throwOnError: s,
1032
1033
  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.isError && !e.isReset() && !t.isFetching && r && xt(s, [t.error, r]), Lt = (t, e) => e.state.data === void 0, Mt = (t) => {
1034
1035
  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
+ }, Nt = (t, e) => t.isLoading && t.isFetching && !e, Kt = (t, e) => (t == null ? void 0 : t.suspense) && e.isPending, Ve = (t, e, s) => e.fetchOptimistic(t).catch(() => {
1036
1037
  s.clearReset();
1037
1038
  });
1038
- function ot(t, e, s) {
1039
- var v, u, m, S, w;
1039
+ function ht(t, e, s) {
1040
+ var v, h, m, S, w;
1040
1041
  if (process.env.NODE_ENV !== "production" && (typeof t != "object" || Array.isArray(t)))
1041
1042
  throw new Error(
1042
1043
  '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
  );
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(
1045
+ const r = Dt(), n = It(), u = jt(), a = r.defaultQueryOptions(t);
1046
+ (h = (v = r.getDefaultOptions().queries) == null ? void 0 : v._experimental_beforeQuery) == null || h.call(
1046
1047
  v,
1047
1048
  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(
1049
+ ), a._optimisticResults = n ? "isRestoring" : "optimistic", Mt(a), kt(a, u), Qt(u);
1050
+ const o = !r.getQueryCache().get(a.queryHash), [l] = I.useState(
1050
1051
  () => new e(
1051
1052
  r,
1052
1053
  a
1053
1054
  )
1054
- ), R = l.getOptimisticResult(a);
1055
- if (P.useSyncExternalStore(
1056
- P.useCallback(
1055
+ ), C = l.getOptimisticResult(a);
1056
+ if (I.useSyncExternalStore(
1057
+ I.useCallback(
1057
1058
  (f) => {
1058
1059
  const g = n ? () => {
1059
- } : l.subscribe(je.batchCalls(f));
1060
+ } : l.subscribe(Ae.batchCalls(f));
1060
1061
  return l.updateResult(), g;
1061
1062
  },
1062
1063
  [l, n]
1063
1064
  ),
1064
1065
  () => l.getCurrentResult(),
1065
1066
  () => l.getCurrentResult()
1066
- ), P.useEffect(() => {
1067
+ ), I.useEffect(() => {
1067
1068
  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,
1069
+ }, [a, l]), Kt(a, C))
1070
+ throw Ve(a, l, u);
1071
+ if (At({
1072
+ result: C,
1073
+ errorResetBoundary: u,
1073
1074
  throwOnError: a.throwOnError,
1074
1075
  query: r.getQueryCache().get(a.queryHash)
1075
1076
  }))
1076
- throw R.error;
1077
+ throw C.error;
1077
1078
  if ((S = (m = r.getDefaultOptions().queries) == null ? void 0 : m._experimental_afterQuery) == null || S.call(
1078
1079
  m,
1079
1080
  a,
1080
- R
1081
- ), a.experimental_prefetchInRender && !V && jt(R, n)) {
1082
- const f = h ? (
1081
+ C
1082
+ ), a.experimental_prefetchInRender && !V && Nt(C, n)) {
1083
+ const f = o ? (
1083
1084
  // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
1084
- Be(a, l, o)
1085
+ Ve(a, l, u)
1085
1086
  ) : (
1086
1087
  // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
1087
1088
  (w = r.getQueryCache().get(a.queryHash)) == null ? void 0 : w.promise
1088
1089
  );
1089
- f == null || f.catch(Pt).finally(() => {
1090
+ f == null || f.catch(Ut).finally(() => {
1090
1091
  l.hasListeners() || l.updateResult();
1091
1092
  });
1092
1093
  }
1093
- return a.notifyOnChangeProps ? R : l.trackResult(R);
1094
+ return a.notifyOnChangeProps ? C : l.trackResult(C);
1094
1095
  }
1095
- function kt(t, e) {
1096
- return ot(t, rt);
1096
+ function _t(t, e) {
1097
+ return ht(t, nt);
1097
1098
  }
1098
- function Mt(t, e) {
1099
- return process.env.NODE_ENV !== "production" && t.queryFn === fe && console.error("skipToken is not allowed for useSuspenseQuery"), ot(
1099
+ function Ht(t, e) {
1100
+ return process.env.NODE_ENV !== "production" && t.queryFn === ye && console.error("skipToken is not allowed for useSuspenseQuery"), ht(
1100
1101
  {
1101
1102
  ...t,
1102
1103
  enabled: !0,
1103
1104
  suspense: !0,
1104
- throwOnError: xt,
1105
+ throwOnError: Lt,
1105
1106
  placeholderData: void 0
1106
1107
  },
1107
- rt
1108
+ nt
1108
1109
  );
1109
1110
  }
1110
- const Lt = ut(
1111
+ const $ = (...t) => {
1112
+ const e = t.filter((s) => !!s).map((s) => s.replace(/(^\/+|\/+$)/g, "")).join("/").replace(/(^\/+|\/+$)/g, "");
1113
+ return e ? `/${e}` : "/";
1114
+ }, Me = (t, e) => {
1115
+ for (const s of t) {
1116
+ const r = Ne(s, e);
1117
+ if (r !== void 0) return r;
1118
+ }
1119
+ }, Ne = (t, e, s = []) => {
1120
+ const r = e(t, s);
1121
+ if (r !== void 0) return r;
1122
+ if (t.type === "category")
1123
+ for (const n of t.items) {
1124
+ const u = Ne(n, e, [
1125
+ ...s,
1126
+ t
1127
+ ]);
1128
+ if (u !== void 0) return u;
1129
+ }
1130
+ }, rs = () => {
1131
+ const t = pe(), s = lt().data.sidebar;
1132
+ return Me(s, (r) => {
1133
+ if (r.type === "doc" && $(r.id) === t.pathname)
1134
+ return r;
1135
+ });
1136
+ }, is = (t) => {
1137
+ const e = pe();
1138
+ return Ne(t, (s) => {
1139
+ if (s.type === "category" && s.link && $(s.link.id) === e.pathname || s.type === "doc" && $(s.id) === e.pathname)
1140
+ return !0;
1141
+ });
1142
+ }, ns = () => {
1143
+ const t = pe().pathname, s = lt().data.sidebar;
1144
+ let r, n, u = !1;
1145
+ return Me(s, (a) => {
1146
+ const o = a.type === "doc" ? $(a.id) : a.type === "category" && a.link ? $(a.link.id) : void 0;
1147
+ if (o) {
1148
+ if (u)
1149
+ return n = { label: a.label, id: o }, !0;
1150
+ t === o ? u = !0 : r = { label: a.label, id: o };
1151
+ }
1152
+ }), { prev: r, next: n };
1153
+ }, Bt = dt(
1111
1154
  void 0
1112
- ), ke = () => {
1113
- const t = ht(Lt);
1155
+ ), ct = () => {
1156
+ const t = ft(Bt);
1114
1157
  if (!t)
1115
1158
  throw new Error("useDevPortal must be used within a DevPortalProvider.");
1116
1159
  return t;
1117
- }, Xt = () => {
1118
- const { getApiIdentities: t } = ke();
1119
- return kt({
1160
+ }, as = () => {
1161
+ const { getApiIdentities: t } = ct();
1162
+ return _t({
1120
1163
  queryFn: t,
1121
1164
  queryKey: ["api-identities"]
1122
1165
  });
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({
1166
+ }, lt = () => {
1167
+ const { getPluginSidebar: t, sidebars: e, topNavigation: s } = ct(), r = pe(), n = Object.entries(e).find(([, a]) => Me(a, (o) => {
1168
+ if ((o.type === "doc" ? $(o.id) : o.type === "category" && o.link ? $(o.link.id) : void 0) === r.pathname)
1169
+ return o;
1170
+ })), u = s.find((a) => a.id === (n == null ? void 0 : n[0])) ?? s.find((a) => pt(a.id, r.pathname));
1171
+ return Ht({
1130
1172
  queryFn: async () => {
1131
- const a = r ? await t(r) : await t(o.pathname);
1173
+ const a = await t(r.pathname);
1132
1174
  return {
1133
- items: [...n, ...a],
1134
- currentTopNavItem: s
1175
+ sidebar: [
1176
+ ...n ? n[1] : [],
1177
+ ...a
1178
+ ],
1179
+ topNavItem: u
1135
1180
  };
1136
1181
  },
1137
- queryKey: ["navigation", r]
1182
+ queryKey: ["navigation", r.pathname]
1138
1183
  });
1139
1184
  };
1140
1185
  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
- Pt as b,
1148
- bt as c,
1186
+ Me as A,
1187
+ ss as B,
1188
+ is as C,
1189
+ as as D,
1190
+ _t as E,
1191
+ ts as Q,
1192
+ Et as R,
1193
+ ke as S,
1194
+ Bt as Z,
1195
+ rs as a,
1196
+ ns as b,
1197
+ Rt as c,
1149
1198
  Dt as d,
1150
- Mt as e,
1151
- Nt as f,
1152
- lt as g,
1153
- ge as h,
1154
- Vt as i,
1155
- be as j,
1156
- ft as k,
1157
- Wt as l,
1158
- zt as m,
1159
- je as n,
1160
- $t as o,
1161
- Xe as p,
1162
- Ye as q,
1163
- de as r,
1164
- Se as s,
1165
- Gt as t,
1166
- ke as u,
1167
- Qe as v,
1168
- fe as w,
1169
- Zt as x,
1170
- Yt as y,
1171
- Xt as z
1199
+ Ut as e,
1200
+ xt as f,
1201
+ Ht as g,
1202
+ Se as h,
1203
+ vt as i,
1204
+ Xt as j,
1205
+ ge as k,
1206
+ mt as l,
1207
+ Zt as m,
1208
+ Ae as n,
1209
+ es as o,
1210
+ Yt as p,
1211
+ et as q,
1212
+ tt as r,
1213
+ we as s,
1214
+ fe as t,
1215
+ ct as u,
1216
+ Jt as v,
1217
+ Qe as w,
1218
+ ye as x,
1219
+ $ as y,
1220
+ lt as z
1172
1221
  };
1173
- //# sourceMappingURL=ZudokuContext-D1D8Anlj.js.map
1222
+ //# sourceMappingURL=ZudokuContext-BKXGJTmu.js.map