zudoku 0.66.4 → 0.66.6

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 (216) hide show
  1. package/dist/app/main.d.ts +6 -6
  2. package/dist/config/validators/InputNavigationSchema.d.ts +2 -0
  3. package/dist/config/validators/InputNavigationSchema.js +1 -0
  4. package/dist/config/validators/InputNavigationSchema.js.map +1 -1
  5. package/dist/config/validators/NavigationSchema.js +6 -1
  6. package/dist/config/validators/NavigationSchema.js.map +1 -1
  7. package/dist/flat-config.d.ts +1 -0
  8. package/dist/lib/authentication/components/CallbackHandler.js +1 -1
  9. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  10. package/dist/lib/authentication/providers/auth0.js +11 -7
  11. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  12. package/dist/lib/authentication/providers/clerk.js +0 -22
  13. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  14. package/dist/lib/authentication/providers/supabase.js +6 -15
  15. package/dist/lib/authentication/providers/supabase.js.map +1 -1
  16. package/dist/lib/core/RouteGuard.js +12 -7
  17. package/dist/lib/core/RouteGuard.js.map +1 -1
  18. package/dist/lib/oas/graphql/circular.d.ts +1 -0
  19. package/dist/lib/oas/graphql/circular.js +20 -5
  20. package/dist/lib/oas/graphql/circular.js.map +1 -1
  21. package/dist/lib/plugins/api-keys/index.d.ts +9 -5
  22. package/dist/lib/plugins/api-keys/index.js +18 -8
  23. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  24. package/dist/lib/plugins/api-keys/settings/ApiKeyList.js +3 -0
  25. package/dist/lib/plugins/api-keys/settings/ApiKeyList.js.map +1 -1
  26. package/dist/lib/plugins/openapi/OperationList.js +5 -1
  27. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  28. package/dist/lib/plugins/openapi/schema/utils.js +11 -3
  29. package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
  30. package/dist/lib/util/invariant.d.ts +1 -1
  31. package/dist/lib/util/invariant.js +2 -2
  32. package/dist/lib/util/invariant.js.map +1 -1
  33. package/dist/vite/api/SchemaManager.d.ts +1 -0
  34. package/dist/vite/api/SchemaManager.js +9 -3
  35. package/dist/vite/api/SchemaManager.js.map +1 -1
  36. package/dist/vite/mdx/remark-link-rewrite.js +1 -1
  37. package/dist/vite/plugin-api-keys.js +1 -0
  38. package/dist/vite/plugin-api-keys.js.map +1 -1
  39. package/dist/vite/prerender/utils.js +9 -3
  40. package/dist/vite/prerender/utils.js.map +1 -1
  41. package/lib/{ActionButton-BSM2oNHF.js → ActionButton-B0CXL1Lq.js} +3 -3
  42. package/lib/{ActionButton-BSM2oNHF.js.map → ActionButton-B0CXL1Lq.js.map} +1 -1
  43. package/lib/{Button-IOAeVaIH.js → Button-GUVe7pmt.js} +2 -2
  44. package/lib/{Button-IOAeVaIH.js.map → Button-GUVe7pmt.js.map} +1 -1
  45. package/lib/{Card-KFniaZn5.js → Card-DCdq37aA.js} +2 -2
  46. package/lib/{Card-KFniaZn5.js.map → Card-DCdq37aA.js.map} +1 -1
  47. package/lib/{ClaudeLogo-DgjivS8A.js → ClaudeLogo-BpqHBMS8.js} +4 -4
  48. package/lib/{ClaudeLogo-DgjivS8A.js.map → ClaudeLogo-BpqHBMS8.js.map} +1 -1
  49. package/lib/{Command-BpT1iBE6.js → Command-N6VujV30.js} +3 -3
  50. package/lib/{Command-BpT1iBE6.js.map → Command-N6VujV30.js.map} +1 -1
  51. package/lib/{Dialog-BQciPiHN.js → Dialog-hlvmmQ_c.js} +2 -2
  52. package/lib/{Dialog-BQciPiHN.js.map → Dialog-hlvmmQ_c.js.map} +1 -1
  53. package/lib/{Drawer-BRMcpfuF.js → Drawer-Ch7927PF.js} +2 -2
  54. package/lib/{Drawer-BRMcpfuF.js.map → Drawer-Ch7927PF.js.map} +1 -1
  55. package/lib/{DropdownMenu-C8SX_-S_.js → DropdownMenu-DN0jNrjj.js} +2 -2
  56. package/lib/{DropdownMenu-C8SX_-S_.js.map → DropdownMenu-DN0jNrjj.js.map} +1 -1
  57. package/lib/{Frame-DxlznfVd.js → Frame-DKlOmSkU.js} +2 -2
  58. package/lib/{Frame-DxlznfVd.js.map → Frame-DKlOmSkU.js.map} +1 -1
  59. package/lib/{IndexingDialog-DZWj_3cU.js → IndexingDialog-D0YdGfbn.js} +3 -3
  60. package/lib/{IndexingDialog-DZWj_3cU.js.map → IndexingDialog-D0YdGfbn.js.map} +1 -1
  61. package/lib/{Input-D-kqEQ5M.js → Input-B6YcAPv-.js} +39 -18
  62. package/lib/Input-B6YcAPv-.js.map +1 -0
  63. package/lib/{MdxPage-BL-HbZrv.js → MdxPage-CeFSxGb_.js} +11 -11
  64. package/lib/{MdxPage-BL-HbZrv.js.map → MdxPage-CeFSxGb_.js.map} +1 -1
  65. package/lib/{Mermaid-BjSczjLW.js → Mermaid-COVtAqcZ.js} +4 -4
  66. package/lib/{Mermaid-BjSczjLW.js.map → Mermaid-COVtAqcZ.js.map} +1 -1
  67. package/lib/{OAuthErrorPage-DQtg28Go.js → OAuthErrorPage-XTPBOMN8.js} +9 -9
  68. package/lib/OAuthErrorPage-XTPBOMN8.js.map +1 -0
  69. package/lib/{OasProvider--qcZwrKS.js → OasProvider-BS4rdzZC.js} +4 -4
  70. package/lib/{OasProvider--qcZwrKS.js.map → OasProvider-BS4rdzZC.js.map} +1 -1
  71. package/lib/{OperationList-CSJYzxQY.js → OperationList-Dg0Nm1tg.js} +136 -133
  72. package/lib/{OperationList-CSJYzxQY.js.map → OperationList-Dg0Nm1tg.js.map} +1 -1
  73. package/lib/RouteGuard-kCicqF3x.js +77 -0
  74. package/lib/RouteGuard-kCicqF3x.js.map +1 -0
  75. package/lib/{SchemaList-DtyuDrQA.js → SchemaList-DZKBH2WC.js} +9 -9
  76. package/lib/{SchemaList-DtyuDrQA.js.map → SchemaList-DZKBH2WC.js.map} +1 -1
  77. package/lib/{SchemaView-G-SVXxAG.js → SchemaView-DBaqV2yU.js} +95 -92
  78. package/lib/SchemaView-DBaqV2yU.js.map +1 -0
  79. package/lib/{Secret-BxGpIhDP.js → Secret-BDBqq4p3.js} +2 -2
  80. package/lib/{Secret-BxGpIhDP.js.map → Secret-BDBqq4p3.js.map} +1 -1
  81. package/lib/{Separator-CTPSeW1S.js → Separator-BXt1LYnm.js} +2 -2
  82. package/lib/{Separator-CTPSeW1S.js.map → Separator-BXt1LYnm.js.map} +1 -1
  83. package/lib/{SignUp-CDl7bQj3.js → SignUp-DNmOFbLD.js} +5 -5
  84. package/lib/{SignUp-CDl7bQj3.js.map → SignUp-DNmOFbLD.js.map} +1 -1
  85. package/lib/{SyntaxHighlight-Dgd0AaaX.js → SyntaxHighlight-C75W8uCn.js} +374 -365
  86. package/lib/SyntaxHighlight-C75W8uCn.js.map +1 -0
  87. package/lib/{Toc-D_Rj4jVx.js → Toc-ICilS65g.js} +3 -3
  88. package/lib/{Toc-D_Rj4jVx.js.map → Toc-ICilS65g.js.map} +1 -1
  89. package/lib/{ZudokuContext-DNHMZfcP.js → ZudokuContext-Ea7gxmGq.js} +542 -469
  90. package/lib/ZudokuContext-Ea7gxmGq.js.map +1 -0
  91. package/lib/{___vite-browser-external_commonjs-proxy-Cga3HsWk.js → ___vite-browser-external_commonjs-proxy-BttVsNON.js} +2 -2
  92. package/lib/___vite-browser-external_commonjs-proxy-BttVsNON.js.map +1 -0
  93. package/lib/chunk-EPOLDU6W-C6C8jAwd.js +8558 -0
  94. package/lib/chunk-EPOLDU6W-C6C8jAwd.js.map +1 -0
  95. package/lib/{circular-BxODTa7z.js → circular-DleWPaPP.js} +767 -747
  96. package/lib/{circular-BxODTa7z.js.map → circular-DleWPaPP.js.map} +1 -1
  97. package/lib/{cn-dYga0KKN.js → cn-5-Gd1Dss.js} +531 -498
  98. package/lib/cn-5-Gd1Dss.js.map +1 -0
  99. package/lib/{createServer-BpreIXp6.js → createServer-nqMW9kro.js} +6 -6
  100. package/lib/{createServer-BpreIXp6.js.map → createServer-nqMW9kro.js.map} +1 -1
  101. package/lib/{createVariantComponent-CQVt-H3r.js → createVariantComponent-Dc0vtOvr.js} +2 -2
  102. package/lib/{createVariantComponent-CQVt-H3r.js.map → createVariantComponent-Dc0vtOvr.js.map} +1 -1
  103. package/lib/{errors-DliW1dED.js → errors-D2FbERKl.js} +3 -3
  104. package/lib/{errors-DliW1dED.js.map → errors-D2FbERKl.js.map} +1 -1
  105. package/lib/{firebase-D4tbaCYB.js → firebase-Cn9CmB6h.js} +21 -21
  106. package/lib/{firebase-D4tbaCYB.js.map → firebase-Cn9CmB6h.js.map} +1 -1
  107. package/lib/{hook-CHw_R_xu.js → hook-B2nmfmYN.js} +3 -3
  108. package/lib/{hook-CHw_R_xu.js.map → hook-B2nmfmYN.js.map} +1 -1
  109. package/lib/{index-DXXZDuSJ.js → index-CC4L3gtM.js} +4 -4
  110. package/lib/{index-DXXZDuSJ.js.map → index-CC4L3gtM.js.map} +1 -1
  111. package/lib/{index-9MxNUgg4.js → index-CSDW7CHl.js} +21 -21
  112. package/lib/{index-9MxNUgg4.js.map → index-CSDW7CHl.js.map} +1 -1
  113. package/lib/{index-CboxZOVW.js → index-D5NeW2z6.js} +12 -12
  114. package/lib/{index-CboxZOVW.js.map → index-D5NeW2z6.js.map} +1 -1
  115. package/lib/{index-1TbL0HXQ.js → index-DSKBOdpT.js} +2 -2
  116. package/lib/{index-1TbL0HXQ.js.map → index-DSKBOdpT.js.map} +1 -1
  117. package/lib/{index.esm-ti5zvZS_.js → index.esm-B35e7P83.js} +2 -2
  118. package/lib/index.esm-B35e7P83.js.map +1 -0
  119. package/lib/{index.esm-DtzT_KoE.js → index.esm-B_0dvNjB.js} +2 -2
  120. package/lib/{index.esm-DtzT_KoE.js.map → index.esm-B_0dvNjB.js.map} +1 -1
  121. package/lib/{invariant-CGOLuIIz.js → invariant-BJAl77rw.js} +4 -4
  122. package/lib/invariant-BJAl77rw.js.map +1 -0
  123. package/lib/{mutation-DMHWqmFp.js → mutation-BOYnEDf6.js} +70 -44
  124. package/lib/mutation-BOYnEDf6.js.map +1 -0
  125. package/lib/ui/Accordion.js +1 -1
  126. package/lib/ui/ActionButton.js +2 -2
  127. package/lib/ui/Alert.js +1 -1
  128. package/lib/ui/AlertDialog.js +1 -1
  129. package/lib/ui/Badge.js +1 -1
  130. package/lib/ui/Breadcrumb.js +1 -1
  131. package/lib/ui/Button.js +1 -1
  132. package/lib/ui/ButtonGroup.js +1 -1
  133. package/lib/ui/Callout.js +1 -1
  134. package/lib/ui/Card.js +1 -1
  135. package/lib/ui/Carousel.js +1 -1
  136. package/lib/ui/Checkbox.js +1 -1
  137. package/lib/ui/CodeBlock.js +1 -1
  138. package/lib/ui/Command.js +2 -2
  139. package/lib/ui/Dialog.js +1 -1
  140. package/lib/ui/Drawer.js +2 -2
  141. package/lib/ui/DropdownMenu.js +1 -1
  142. package/lib/ui/EmbeddedCodeBlock.js +1 -1
  143. package/lib/ui/Form.js +1 -1
  144. package/lib/ui/Frame.js +1 -1
  145. package/lib/ui/HoverCard.js +1 -1
  146. package/lib/ui/Input.js +1 -1
  147. package/lib/ui/Item.js +1 -1
  148. package/lib/ui/Label.js +1 -1
  149. package/lib/ui/NativeSelect.js +1 -1
  150. package/lib/ui/Pagination.js +1 -1
  151. package/lib/ui/Popover.js +1 -1
  152. package/lib/ui/Progress.js +1 -1
  153. package/lib/ui/RadioGroup.js +1 -1
  154. package/lib/ui/ScrollArea.js +1 -1
  155. package/lib/ui/Secret.js +1 -1
  156. package/lib/ui/Separator.js +1 -1
  157. package/lib/ui/Skeleton.js +1 -1
  158. package/lib/ui/Slider.js +1 -1
  159. package/lib/ui/Switch.js +1 -1
  160. package/lib/ui/SyntaxHighlight.js +3 -3
  161. package/lib/ui/Tabs.js +1 -1
  162. package/lib/ui/Textarea.js +1 -1
  163. package/lib/ui/Toggle.js +1 -1
  164. package/lib/ui/ToggleGroup.js +1 -1
  165. package/lib/ui/Value.js +1 -1
  166. package/lib/ui/util.js +1 -1
  167. package/lib/zudoku.__internal.js +604 -602
  168. package/lib/zudoku.__internal.js.map +1 -1
  169. package/lib/zudoku.auth-auth0.js +16 -16
  170. package/lib/zudoku.auth-auth0.js.map +1 -1
  171. package/lib/zudoku.auth-azureb2c.js +4 -4
  172. package/lib/zudoku.auth-clerk.js +52 -75
  173. package/lib/zudoku.auth-clerk.js.map +1 -1
  174. package/lib/zudoku.auth-firebase.js +5 -5
  175. package/lib/zudoku.auth-openid.js +5 -5
  176. package/lib/zudoku.auth-supabase.js +31 -40
  177. package/lib/zudoku.auth-supabase.js.map +1 -1
  178. package/lib/zudoku.components.js +6 -6
  179. package/lib/zudoku.hooks.js +3 -3
  180. package/lib/zudoku.mermaid.js +3 -3
  181. package/lib/zudoku.plugin-api-catalog.js +5 -5
  182. package/lib/zudoku.plugin-api-keys.js +258 -240
  183. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  184. package/lib/zudoku.plugin-custom-pages.js +1 -1
  185. package/lib/zudoku.plugin-markdown.js +1 -1
  186. package/lib/zudoku.plugin-openapi.js +3 -3
  187. package/lib/zudoku.plugin-redirect.js +1 -1
  188. package/lib/zudoku.plugin-search-pagefind.js +7 -7
  189. package/lib/zudoku.router.js +1130 -1404
  190. package/lib/zudoku.router.js.map +1 -1
  191. package/package.json +12 -12
  192. package/src/lib/authentication/components/CallbackHandler.tsx +1 -1
  193. package/src/lib/authentication/providers/auth0.tsx +15 -9
  194. package/src/lib/authentication/providers/clerk.tsx +0 -26
  195. package/src/lib/authentication/providers/supabase.tsx +6 -15
  196. package/src/lib/core/RouteGuard.tsx +30 -24
  197. package/src/lib/oas/graphql/circular.ts +36 -3
  198. package/src/lib/plugins/api-keys/index.tsx +46 -16
  199. package/src/lib/plugins/api-keys/settings/ApiKeyList.tsx +3 -0
  200. package/src/lib/plugins/openapi/OperationList.tsx +6 -1
  201. package/src/lib/plugins/openapi/schema/utils.ts +15 -4
  202. package/src/lib/util/invariant.ts +2 -1
  203. package/lib/Input-D-kqEQ5M.js.map +0 -1
  204. package/lib/OAuthErrorPage-DQtg28Go.js.map +0 -1
  205. package/lib/RouteGuard-D0f743SM.js +0 -77
  206. package/lib/RouteGuard-D0f743SM.js.map +0 -1
  207. package/lib/SchemaView-G-SVXxAG.js.map +0 -1
  208. package/lib/SyntaxHighlight-Dgd0AaaX.js.map +0 -1
  209. package/lib/ZudokuContext-DNHMZfcP.js.map +0 -1
  210. package/lib/___vite-browser-external_commonjs-proxy-Cga3HsWk.js.map +0 -1
  211. package/lib/chunk-PVWAREVJ-ClM0m2aJ.js +0 -7965
  212. package/lib/chunk-PVWAREVJ-ClM0m2aJ.js.map +0 -1
  213. package/lib/cn-dYga0KKN.js.map +0 -1
  214. package/lib/index.esm-ti5zvZS_.js.map +0 -1
  215. package/lib/invariant-CGOLuIIz.js.map +0 -1
  216. package/lib/mutation-DMHWqmFp.js.map +0 -1
@@ -1,9 +1,9 @@
1
1
  import * as w from "react";
2
- import k, { useCallback as wt, createContext as Rt, useContext as Ot, useEffect as Ct } from "react";
3
- import { j as Et } from "./jsx-runtime-BzflLqGi.js";
4
- import { a as q, m as Y } from "./chunk-PVWAREVJ-ClM0m2aJ.js";
5
- import { c as Ft } from "./index-DI5SPFK9.js";
6
- var G = class {
2
+ import N, { useCallback as Rt, createContext as Ct, useContext as It, useEffect as Ft } from "react";
3
+ import { j as Pt } from "./jsx-runtime-BzflLqGi.js";
4
+ import { a as U, m as tt } from "./chunk-EPOLDU6W-C6C8jAwd.js";
5
+ import { c as Tt } from "./index-DI5SPFK9.js";
6
+ var $ = class {
7
7
  constructor() {
8
8
  this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
9
9
  }
@@ -19,25 +19,71 @@ var G = class {
19
19
  }
20
20
  onUnsubscribe() {
21
21
  }
22
- }, F = typeof window > "u" || "Deno" in globalThis;
23
- function I() {
22
+ }, xt = {
23
+ // We need the wrapper function syntax below instead of direct references to
24
+ // global setTimeout etc.
25
+ //
26
+ // BAD: `setTimeout: setTimeout`
27
+ // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`
28
+ //
29
+ // If we use direct references here, then anything that wants to spy on or
30
+ // replace the global setTimeout (like tests) won't work since we'll already
31
+ // have a hard reference to the original implementation at the time when this
32
+ // file was imported.
33
+ setTimeout: (t, e) => setTimeout(t, e),
34
+ clearTimeout: (t) => clearTimeout(t),
35
+ setInterval: (t, e) => setInterval(t, e),
36
+ clearInterval: (t) => clearInterval(t)
37
+ }, Dt = class {
38
+ // We cannot have TimeoutManager<T> as we must instantiate it with a concrete
39
+ // type at app boot; and if we leave that type, then any new timer provider
40
+ // would need to support ReturnType<typeof setTimeout>, which is infeasible.
41
+ //
42
+ // We settle for type safety for the TimeoutProvider type, and accept that
43
+ // this class is unsafe internally to allow for extension.
44
+ #e = xt;
45
+ #t = !1;
46
+ setTimeoutProvider(t) {
47
+ process.env.NODE_ENV !== "production" && this.#t && t !== this.#e && console.error(
48
+ "[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",
49
+ { previous: this.#e, provider: t }
50
+ ), this.#e = t, process.env.NODE_ENV !== "production" && (this.#t = !1);
51
+ }
52
+ setTimeout(t, e) {
53
+ return process.env.NODE_ENV !== "production" && (this.#t = !0), this.#e.setTimeout(t, e);
54
+ }
55
+ clearTimeout(t) {
56
+ this.#e.clearTimeout(t);
57
+ }
58
+ setInterval(t, e) {
59
+ return process.env.NODE_ENV !== "production" && (this.#t = !0), this.#e.setInterval(t, e);
60
+ }
61
+ clearInterval(t) {
62
+ this.#e.clearInterval(t);
63
+ }
64
+ }, I = new Dt();
65
+ function At(t) {
66
+ setTimeout(t, 0);
24
67
  }
25
- function Se(t, e) {
68
+ var F = typeof window > "u" || "Deno" in globalThis;
69
+ function P() {
70
+ }
71
+ function Ie(t, e) {
26
72
  return typeof t == "function" ? t(e) : t;
27
73
  }
28
- function Q(t) {
74
+ function _(t) {
29
75
  return typeof t == "number" && t >= 0 && t !== 1 / 0;
30
76
  }
31
- function it(t, e) {
77
+ function ct(t, e) {
32
78
  return Math.max(t + (e || 0) - Date.now(), 0);
33
79
  }
34
- function x(t, e) {
80
+ function D(t, e) {
35
81
  return typeof t == "function" ? t(e) : t;
36
82
  }
37
83
  function S(t, e) {
38
84
  return typeof t == "function" ? t(e) : t;
39
85
  }
40
- function we(t, e) {
86
+ function Fe(t, e) {
41
87
  const {
42
88
  type: s = "all",
43
89
  exact: r,
@@ -48,9 +94,9 @@ function we(t, e) {
48
94
  } = t;
49
95
  if (o) {
50
96
  if (r) {
51
- if (e.queryHash !== It(o, e.options))
97
+ if (e.queryHash !== kt(o, e.options))
52
98
  return !1;
53
- } else if (!V(e.queryKey, o))
99
+ } else if (!J(e.queryKey, o))
54
100
  return !1;
55
101
  }
56
102
  if (s !== "all") {
@@ -60,47 +106,55 @@ function we(t, e) {
60
106
  }
61
107
  return !(typeof i == "boolean" && e.isStale() !== i || n && n !== e.state.fetchStatus || a && !a(e));
62
108
  }
63
- function Re(t, e) {
109
+ function Pe(t, e) {
64
110
  const { exact: s, status: r, predicate: n, mutationKey: a } = t;
65
111
  if (a) {
66
112
  if (!e.options.mutationKey)
67
113
  return !1;
68
114
  if (s) {
69
- if (U(e.options.mutationKey) !== U(a))
115
+ if (M(e.options.mutationKey) !== M(a))
70
116
  return !1;
71
- } else if (!V(e.options.mutationKey, a))
117
+ } else if (!J(e.options.mutationKey, a))
72
118
  return !1;
73
119
  }
74
120
  return !(r && e.state.status !== r || n && !n(e));
75
121
  }
76
- function It(t, e) {
77
- return (e?.queryKeyHashFn || U)(t);
122
+ function kt(t, e) {
123
+ return (e?.queryKeyHashFn || M)(t);
78
124
  }
79
- function U(t) {
125
+ function M(t) {
80
126
  return JSON.stringify(
81
127
  t,
82
- (e, s) => M(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
128
+ (e, s) => L(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
83
129
  );
84
130
  }
85
- function V(t, e) {
86
- return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? Object.keys(e).every((s) => V(t[s], e[s])) : !1;
131
+ function J(t, e) {
132
+ return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? Object.keys(e).every((s) => J(t[s], e[s])) : !1;
87
133
  }
88
- function N(t, e) {
134
+ var Nt = Object.prototype.hasOwnProperty;
135
+ function q(t, e) {
89
136
  if (t === e)
90
137
  return t;
91
- const s = X(t) && X(e);
92
- if (s || M(t) && M(e)) {
93
- const r = s ? t : Object.keys(t), n = r.length, a = s ? e : Object.keys(e), o = a.length, i = s ? [] : {}, u = new Set(r);
94
- let l = 0;
95
- for (let h = 0; h < o; h++) {
96
- const d = s ? h : a[h];
97
- (!s && u.has(d) || s) && t[d] === void 0 && e[d] === void 0 ? (i[d] = void 0, l++) : (i[d] = N(t[d], e[d]), i[d] === t[d] && t[d] !== void 0 && l++);
138
+ const s = et(t) && et(e);
139
+ if (!s && !(L(t) && L(e))) return e;
140
+ const n = (s ? t : Object.keys(t)).length, a = s ? e : Object.keys(e), o = a.length, i = s ? new Array(o) : {};
141
+ let u = 0;
142
+ for (let h = 0; h < o; h++) {
143
+ const l = s ? h : a[h], p = t[l], f = e[l];
144
+ if (p === f) {
145
+ i[l] = p, (s ? h < n : Nt.call(t, l)) && u++;
146
+ continue;
147
+ }
148
+ if (p === null || f === null || typeof p != "object" || typeof f != "object") {
149
+ i[l] = f;
150
+ continue;
98
151
  }
99
- return n === o && l === n ? t : i;
152
+ const y = q(p, f);
153
+ i[l] = y, y === p && u++;
100
154
  }
101
- return e;
155
+ return n === o && u === n ? t : i;
102
156
  }
103
- function L(t, e) {
157
+ function Q(t, e) {
104
158
  if (!e || Object.keys(t).length !== Object.keys(e).length)
105
159
  return !1;
106
160
  for (const s in t)
@@ -108,63 +162,63 @@ function L(t, e) {
108
162
  return !1;
109
163
  return !0;
110
164
  }
111
- function X(t) {
165
+ function et(t) {
112
166
  return Array.isArray(t) && t.length === Object.keys(t).length;
113
167
  }
114
- function M(t) {
115
- if (!tt(t))
168
+ function L(t) {
169
+ if (!st(t))
116
170
  return !1;
117
171
  const e = t.constructor;
118
172
  if (e === void 0)
119
173
  return !0;
120
174
  const s = e.prototype;
121
- return !(!tt(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(t) !== Object.prototype);
175
+ return !(!st(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(t) !== Object.prototype);
122
176
  }
123
- function tt(t) {
177
+ function st(t) {
124
178
  return Object.prototype.toString.call(t) === "[object Object]";
125
179
  }
126
- function Pt(t) {
180
+ function jt(t) {
127
181
  return new Promise((e) => {
128
- setTimeout(e, t);
182
+ I.setTimeout(e, t);
129
183
  });
130
184
  }
131
- function _(t, e, s) {
185
+ function H(t, e, s) {
132
186
  if (typeof s.structuralSharing == "function")
133
187
  return s.structuralSharing(t, e);
134
188
  if (s.structuralSharing !== !1) {
135
189
  if (process.env.NODE_ENV !== "production")
136
190
  try {
137
- return N(t, e);
191
+ return q(t, e);
138
192
  } catch (r) {
139
193
  throw console.error(
140
194
  `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}`
141
195
  ), r;
142
196
  }
143
- return N(t, e);
197
+ return q(t, e);
144
198
  }
145
199
  return e;
146
200
  }
147
- function Oe(t) {
201
+ function Te(t) {
148
202
  return t;
149
203
  }
150
- function Ce(t, e, s = 0) {
204
+ function xe(t, e, s = 0) {
151
205
  const r = [...t, e];
152
206
  return s && r.length > s ? r.slice(1) : r;
153
207
  }
154
- function Ee(t, e, s = 0) {
208
+ function De(t, e, s = 0) {
155
209
  const r = [e, ...t];
156
210
  return s && r.length > s ? r.slice(0, -1) : r;
157
211
  }
158
212
  var j = Symbol();
159
- function Tt(t, e) {
213
+ function Ut(t, e) {
160
214
  return process.env.NODE_ENV !== "production" && t.queryFn === j && console.error(
161
215
  `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${t.queryHash}'`
162
216
  ), !t.queryFn && e?.initialPromise ? () => e.initialPromise : !t.queryFn || t.queryFn === j ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn;
163
217
  }
164
- function xt(t, e) {
218
+ function _t(t, e) {
165
219
  return typeof t == "function" ? t(...e) : !!t;
166
220
  }
167
- var Dt = class extends G {
221
+ var Mt = class extends $ {
168
222
  #e;
169
223
  #t;
170
224
  #s;
@@ -201,39 +255,8 @@ var Dt = class extends G {
201
255
  isFocused() {
202
256
  return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
203
257
  }
204
- }, at = new Dt(), At = class extends G {
205
- #e = !0;
206
- #t;
207
- #s;
208
- constructor() {
209
- super(), this.#s = (t) => {
210
- if (!F && window.addEventListener) {
211
- const e = () => t(!0), s = () => t(!1);
212
- return window.addEventListener("online", e, !1), window.addEventListener("offline", s, !1), () => {
213
- window.removeEventListener("online", e), window.removeEventListener("offline", s);
214
- };
215
- }
216
- };
217
- }
218
- onSubscribe() {
219
- this.#t || this.setEventListener(this.#s);
220
- }
221
- onUnsubscribe() {
222
- this.hasListeners() || (this.#t?.(), this.#t = void 0);
223
- }
224
- setEventListener(t) {
225
- this.#s = t, this.#t?.(), this.#t = t(this.setOnline.bind(this));
226
- }
227
- setOnline(t) {
228
- this.#e !== t && (this.#e = t, this.listeners.forEach((s) => {
229
- s(t);
230
- }));
231
- }
232
- isOnline() {
233
- return this.#e;
234
- }
235
- }, ot = new At();
236
- function H() {
258
+ }, lt = new Mt();
259
+ function K() {
237
260
  let t, e;
238
261
  const s = new Promise((n, a) => {
239
262
  t = n, e = a;
@@ -255,75 +278,12 @@ function H() {
255
278
  }), e(n);
256
279
  }, s;
257
280
  }
258
- function Fe(t) {
281
+ function Ae(t) {
259
282
  let e;
260
- if (t.then((s) => (e = s, s), I)?.catch(I), e !== void 0)
283
+ if (t.then((s) => (e = s, s), P)?.catch(P), e !== void 0)
261
284
  return { data: e };
262
285
  }
263
- function kt(t) {
264
- return Math.min(1e3 * 2 ** t, 3e4);
265
- }
266
- function ut(t) {
267
- return (t ?? "online") === "online" ? ot.isOnline() : !0;
268
- }
269
- var ct = class extends Error {
270
- constructor(t) {
271
- super("CancelledError"), this.revert = t?.revert, this.silent = t?.silent;
272
- }
273
- };
274
- function jt(t) {
275
- let e = !1, s = 0, r;
276
- const n = H(), a = () => n.status !== "pending", o = (c) => {
277
- a() || (f(new ct(c)), t.abort?.());
278
- }, i = () => {
279
- e = !0;
280
- }, u = () => {
281
- e = !1;
282
- }, l = () => at.isFocused() && (t.networkMode === "always" || ot.isOnline()) && t.canRun(), h = () => ut(t.networkMode) && t.canRun(), d = (c) => {
283
- a() || (r?.(), n.resolve(c));
284
- }, f = (c) => {
285
- a() || (r?.(), n.reject(c));
286
- }, m = () => new Promise((c) => {
287
- r = (g) => {
288
- (a() || l()) && c(g);
289
- }, t.onPause?.();
290
- }).then(() => {
291
- r = void 0, a() || t.onContinue?.();
292
- }), O = () => {
293
- if (a())
294
- return;
295
- let c;
296
- const g = s === 0 ? t.initialPromise : void 0;
297
- try {
298
- c = g ?? t.fn();
299
- } catch (v) {
300
- c = Promise.reject(v);
301
- }
302
- Promise.resolve(c).then(d).catch((v) => {
303
- if (a())
304
- return;
305
- const p = t.retry ?? (F ? 0 : 3), y = t.retryDelay ?? kt, C = typeof y == "function" ? y(s, v) : y, P = p === !0 || typeof p == "number" && s < p || typeof p == "function" && p(s, v);
306
- if (e || !P) {
307
- f(v);
308
- return;
309
- }
310
- s++, t.onFail?.(s, v), Pt(C).then(() => l() ? void 0 : m()).then(() => {
311
- e ? f(v) : O();
312
- });
313
- });
314
- };
315
- return {
316
- promise: n,
317
- status: () => n.status,
318
- cancel: o,
319
- continue: () => (r?.(), n),
320
- cancelRetry: i,
321
- continueRetry: u,
322
- canStart: h,
323
- start: () => (h() ? O() : m().then(O), n)
324
- };
325
- }
326
- var qt = (t) => setTimeout(t, 0);
286
+ var qt = At;
327
287
  function Qt() {
328
288
  let t = [], e = 0, s = (i) => {
329
289
  i();
@@ -383,13 +343,111 @@ function Qt() {
383
343
  }
384
344
  };
385
345
  }
386
- var $ = Qt(), Ut = class {
346
+ var Z = Qt(), Lt = class extends $ {
347
+ #e = !0;
348
+ #t;
349
+ #s;
350
+ constructor() {
351
+ super(), this.#s = (t) => {
352
+ if (!F && window.addEventListener) {
353
+ const e = () => t(!0), s = () => t(!1);
354
+ return window.addEventListener("online", e, !1), window.addEventListener("offline", s, !1), () => {
355
+ window.removeEventListener("online", e), window.removeEventListener("offline", s);
356
+ };
357
+ }
358
+ };
359
+ }
360
+ onSubscribe() {
361
+ this.#t || this.setEventListener(this.#s);
362
+ }
363
+ onUnsubscribe() {
364
+ this.hasListeners() || (this.#t?.(), this.#t = void 0);
365
+ }
366
+ setEventListener(t) {
367
+ this.#s = t, this.#t?.(), this.#t = t(this.setOnline.bind(this));
368
+ }
369
+ setOnline(t) {
370
+ this.#e !== t && (this.#e = t, this.listeners.forEach((s) => {
371
+ s(t);
372
+ }));
373
+ }
374
+ isOnline() {
375
+ return this.#e;
376
+ }
377
+ }, ht = new Lt();
378
+ function Ht(t) {
379
+ return Math.min(1e3 * 2 ** t, 3e4);
380
+ }
381
+ function ft(t) {
382
+ return (t ?? "online") === "online" ? ht.isOnline() : !0;
383
+ }
384
+ var B = class extends Error {
385
+ constructor(t) {
386
+ super("CancelledError"), this.revert = t?.revert, this.silent = t?.silent;
387
+ }
388
+ };
389
+ function Kt(t) {
390
+ let e = !1, s = 0, r;
391
+ const n = K(), a = () => n.status !== "pending", o = (c) => {
392
+ if (!a()) {
393
+ const m = new B(c);
394
+ f(m), t.onCancel?.(m);
395
+ }
396
+ }, i = () => {
397
+ e = !0;
398
+ }, u = () => {
399
+ e = !1;
400
+ }, h = () => lt.isFocused() && (t.networkMode === "always" || ht.isOnline()) && t.canRun(), l = () => ft(t.networkMode) && t.canRun(), p = (c) => {
401
+ a() || (r?.(), n.resolve(c));
402
+ }, f = (c) => {
403
+ a() || (r?.(), n.reject(c));
404
+ }, y = () => new Promise((c) => {
405
+ r = (m) => {
406
+ (a() || h()) && c(m);
407
+ }, t.onPause?.();
408
+ }).then(() => {
409
+ r = void 0, a() || t.onContinue?.();
410
+ }), O = () => {
411
+ if (a())
412
+ return;
413
+ let c;
414
+ const m = s === 0 ? t.initialPromise : void 0;
415
+ try {
416
+ c = m ?? t.fn();
417
+ } catch (g) {
418
+ c = Promise.reject(g);
419
+ }
420
+ Promise.resolve(c).then(p).catch((g) => {
421
+ if (a())
422
+ return;
423
+ const d = t.retry ?? (F ? 0 : 3), v = t.retryDelay ?? Ht, R = typeof v == "function" ? v(s, g) : v, T = d === !0 || typeof d == "number" && s < d || typeof d == "function" && d(s, g);
424
+ if (e || !T) {
425
+ f(g);
426
+ return;
427
+ }
428
+ s++, t.onFail?.(s, g), jt(R).then(() => h() ? void 0 : y()).then(() => {
429
+ e ? f(g) : O();
430
+ });
431
+ });
432
+ };
433
+ return {
434
+ promise: n,
435
+ status: () => n.status,
436
+ cancel: o,
437
+ continue: () => (r?.(), n),
438
+ cancelRetry: i,
439
+ continueRetry: u,
440
+ canStart: l,
441
+ start: () => (l() ? O() : y().then(O), n)
442
+ };
443
+ }
444
+ var Bt = class {
387
445
  #e;
388
446
  destroy() {
389
447
  this.clearGcTimeout();
390
448
  }
391
449
  scheduleGc() {
392
- this.clearGcTimeout(), Q(this.gcTime) && (this.#e = setTimeout(() => {
450
+ this.clearGcTimeout(), _(this.gcTime) && (this.#e = I.setTimeout(() => {
393
451
  this.optionalRemove();
394
452
  }, this.gcTime));
395
453
  }
@@ -400,9 +458,9 @@ var $ = Qt(), Ut = class {
400
458
  );
401
459
  }
402
460
  clearGcTimeout() {
403
- this.#e && (clearTimeout(this.#e), this.#e = void 0);
461
+ this.#e && (I.clearTimeout(this.#e), this.#e = void 0);
404
462
  }
405
- }, Ie = class extends Ut {
463
+ }, ke = class extends Bt {
406
464
  #e;
407
465
  #t;
408
466
  #s;
@@ -411,7 +469,7 @@ var $ = Qt(), Ut = class {
411
469
  #o;
412
470
  #a;
413
471
  constructor(t) {
414
- super(), this.#a = !1, this.#o = t.defaultOptions, this.setOptions(t.options), this.observers = [], this.#n = t.client, this.#s = this.#n.getQueryCache(), this.queryKey = t.queryKey, this.queryHash = t.queryHash, this.#e = Nt(this.options), this.state = t.state ?? this.#e, this.scheduleGc();
472
+ super(), this.#a = !1, this.#o = t.defaultOptions, this.setOptions(t.options), this.observers = [], this.#n = t.client, this.#s = this.#n.getQueryCache(), this.queryKey = t.queryKey, this.queryHash = t.queryHash, this.#e = nt(this.options), this.state = t.state ?? this.#e, this.scheduleGc();
415
473
  }
416
474
  get meta() {
417
475
  return this.options.meta;
@@ -420,13 +478,18 @@ var $ = Qt(), Ut = class {
420
478
  return this.#r?.promise;
421
479
  }
422
480
  setOptions(t) {
423
- this.options = { ...this.#o, ...t }, this.updateGcTime(this.options.gcTime);
481
+ if (this.options = { ...this.#o, ...t }, this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
482
+ const e = nt(this.options);
483
+ e.data !== void 0 && (this.setState(
484
+ rt(e.data, e.dataUpdatedAt)
485
+ ), this.#e = e);
486
+ }
424
487
  }
425
488
  optionalRemove() {
426
489
  !this.observers.length && this.state.fetchStatus === "idle" && this.#s.remove(this);
427
490
  }
428
491
  setData(t, e) {
429
- const s = _(this.state.data, t, this.options);
492
+ const s = H(this.state.data, t, this.options);
430
493
  return this.#i({
431
494
  data: s,
432
495
  type: "success",
@@ -439,7 +502,7 @@ var $ = Qt(), Ut = class {
439
502
  }
440
503
  cancel(t) {
441
504
  const e = this.#r?.promise;
442
- return this.#r?.cancel(t), e ? e.then(I).catch(I) : Promise.resolve();
505
+ return this.#r?.cancel(t), e ? e.then(P).catch(P) : Promise.resolve();
443
506
  }
444
507
  destroy() {
445
508
  super.destroy(), this.cancel({ silent: !0 });
@@ -457,7 +520,7 @@ var $ = Qt(), Ut = class {
457
520
  }
458
521
  isStatic() {
459
522
  return this.getObserversCount() > 0 ? this.observers.some(
460
- (t) => x(t.options.staleTime, this) === "static"
523
+ (t) => D(t.options.staleTime, this) === "static"
461
524
  ) : !1;
462
525
  }
463
526
  isStale() {
@@ -466,7 +529,7 @@ var $ = Qt(), Ut = class {
466
529
  ) : this.state.data === void 0 || this.state.isInvalidated;
467
530
  }
468
531
  isStaleByTime(t = 0) {
469
- return this.state.data === void 0 ? !0 : t === "static" ? !1 : this.state.isInvalidated ? !0 : !it(this.state.dataUpdatedAt, t);
532
+ return this.state.data === void 0 ? !0 : t === "static" ? !1 : this.state.isInvalidated ? !0 : !ct(this.state.dataUpdatedAt, t);
470
533
  }
471
534
  onFocus() {
472
535
  this.observers.find((e) => e.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: !1 }), this.#r?.continue();
@@ -509,19 +572,19 @@ var $ = Qt(), Ut = class {
509
572
  get: () => (this.#a = !0, s.signal)
510
573
  });
511
574
  }, n = () => {
512
- const i = Tt(this.options, e), l = (() => {
513
- const h = {
575
+ const i = Ut(this.options, e), h = (() => {
576
+ const l = {
514
577
  client: this.#n,
515
578
  queryKey: this.queryKey,
516
579
  meta: this.meta
517
580
  };
518
- return r(h), h;
581
+ return r(l), l;
519
582
  })();
520
583
  return this.#a = !1, this.options.persister ? this.options.persister(
521
584
  i,
522
- l,
585
+ h,
523
586
  this
524
- ) : i(l);
587
+ ) : i(h);
525
588
  }, o = (() => {
526
589
  const i = {
527
590
  fetchOptions: e,
@@ -533,10 +596,15 @@ var $ = Qt(), Ut = class {
533
596
  };
534
597
  return r(i), i;
535
598
  })();
536
- this.options.behavior?.onFetch(o, this), this.#t = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== o.fetchOptions?.meta) && this.#i({ type: "fetch", meta: o.fetchOptions?.meta }), this.#r = jt({
599
+ this.options.behavior?.onFetch(o, this), this.#t = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== o.fetchOptions?.meta) && this.#i({ type: "fetch", meta: o.fetchOptions?.meta }), this.#r = Kt({
537
600
  initialPromise: e?.initialPromise,
538
601
  fn: o.fetchFn,
539
- abort: s.abort.bind(s),
602
+ onCancel: (i) => {
603
+ i instanceof B && i.revert && this.setState({
604
+ ...this.#t,
605
+ fetchStatus: "idle"
606
+ }), s.abort();
607
+ },
540
608
  onFail: (i, u) => {
541
609
  this.#i({ type: "failed", failureCount: i, error: u });
542
610
  },
@@ -563,14 +631,11 @@ var $ = Qt(), Ut = class {
563
631
  this
564
632
  ), i;
565
633
  } catch (i) {
566
- if (i instanceof ct) {
634
+ if (i instanceof B) {
567
635
  if (i.silent)
568
636
  return this.#r.promise;
569
637
  if (i.revert) {
570
- if (this.setState({
571
- ...this.#t,
572
- fetchStatus: "idle"
573
- }), this.state.data === void 0)
638
+ if (this.state.data === void 0)
574
639
  throw i;
575
640
  return this.state.data;
576
641
  }
@@ -612,18 +677,14 @@ var $ = Qt(), Ut = class {
612
677
  case "fetch":
613
678
  return {
614
679
  ...s,
615
- ...ht(s.data, this.options),
680
+ ...dt(s.data, this.options),
616
681
  fetchMeta: t.meta ?? null
617
682
  };
618
683
  case "success":
619
684
  const r = {
620
685
  ...s,
621
- data: t.data,
686
+ ...rt(t.data, t.dataUpdatedAt),
622
687
  dataUpdateCount: s.dataUpdateCount + 1,
623
- dataUpdatedAt: t.dataUpdatedAt ?? Date.now(),
624
- error: null,
625
- isInvalidated: !1,
626
- status: "success",
627
688
  ...!t.manual && {
628
689
  fetchStatus: "idle",
629
690
  fetchFailureCount: 0,
@@ -655,25 +716,34 @@ var $ = Qt(), Ut = class {
655
716
  };
656
717
  }
657
718
  };
658
- this.state = e(this.state), $.batch(() => {
719
+ this.state = e(this.state), Z.batch(() => {
659
720
  this.observers.forEach((s) => {
660
721
  s.onQueryUpdate();
661
722
  }), this.#s.notify({ query: this, type: "updated", action: t });
662
723
  });
663
724
  }
664
725
  };
665
- function ht(t, e) {
726
+ function dt(t, e) {
666
727
  return {
667
728
  fetchFailureCount: 0,
668
729
  fetchFailureReason: null,
669
- fetchStatus: ut(e.networkMode) ? "fetching" : "paused",
730
+ fetchStatus: ft(e.networkMode) ? "fetching" : "paused",
670
731
  ...t === void 0 && {
671
732
  error: null,
672
733
  status: "pending"
673
734
  }
674
735
  };
675
736
  }
676
- function Nt(t) {
737
+ function rt(t, e) {
738
+ return {
739
+ data: t,
740
+ dataUpdatedAt: e ?? Date.now(),
741
+ error: null,
742
+ isInvalidated: !1,
743
+ status: "success"
744
+ };
745
+ }
746
+ function nt(t) {
677
747
  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;
678
748
  return {
679
749
  data: e,
@@ -690,9 +760,9 @@ function Nt(t) {
690
760
  fetchStatus: "idle"
691
761
  };
692
762
  }
693
- var lt = class extends G {
763
+ var pt = class extends $ {
694
764
  constructor(t, e) {
695
- super(), this.options = e, this.#e = t, this.#i = null, this.#a = H(), this.bindMethods(), this.setOptions(e);
765
+ super(), this.options = e, this.#e = t, this.#i = null, this.#a = K(), this.bindMethods(), this.setOptions(e);
696
766
  }
697
767
  #e;
698
768
  #t = void 0;
@@ -708,27 +778,27 @@ var lt = class extends G {
708
778
  // It will be used to pass the previous data and query to the placeholder function between renders.
709
779
  #d;
710
780
  #c;
711
- #h;
781
+ #l;
712
782
  #u;
713
783
  #p = /* @__PURE__ */ new Set();
714
784
  bindMethods() {
715
785
  this.refetch = this.refetch.bind(this);
716
786
  }
717
787
  onSubscribe() {
718
- this.listeners.size === 1 && (this.#t.addObserver(this), et(this.#t, this.options) ? this.#l() : this.updateResult(), this.#b());
788
+ this.listeners.size === 1 && (this.#t.addObserver(this), it(this.#t, this.options) ? this.#h() : this.updateResult(), this.#b());
719
789
  }
720
790
  onUnsubscribe() {
721
791
  this.hasListeners() || this.destroy();
722
792
  }
723
793
  shouldFetchOnReconnect() {
724
- return K(
794
+ return V(
725
795
  this.#t,
726
796
  this.options,
727
797
  this.options.refetchOnReconnect
728
798
  );
729
799
  }
730
800
  shouldFetchOnWindowFocus() {
731
- return K(
801
+ return V(
732
802
  this.#t,
733
803
  this.options,
734
804
  this.options.refetchOnWindowFocus
@@ -743,35 +813,35 @@ var lt = class extends G {
743
813
  throw new Error(
744
814
  "Expected enabled to be a boolean or a callback that returns a boolean"
745
815
  );
746
- this.#R(), this.#t.setOptions(this.options), e._defaulted && !L(this.options, e) && this.#e.getQueryCache().notify({
816
+ this.#E(), this.#t.setOptions(this.options), e._defaulted && !Q(this.options, e) && this.#e.getQueryCache().notify({
747
817
  type: "observerOptionsUpdated",
748
818
  query: this.#t,
749
819
  observer: this
750
820
  });
751
821
  const r = this.hasListeners();
752
- r && st(
822
+ r && at(
753
823
  this.#t,
754
824
  s,
755
825
  this.options,
756
826
  e
757
- ) && this.#l(), this.updateResult(), r && (this.#t !== s || S(this.options.enabled, this.#t) !== S(e.enabled, this.#t) || x(this.options.staleTime, this.#t) !== x(e.staleTime, this.#t)) && this.#v();
827
+ ) && this.#h(), this.updateResult(), r && (this.#t !== s || S(this.options.enabled, this.#t) !== S(e.enabled, this.#t) || D(this.options.staleTime, this.#t) !== D(e.staleTime, this.#t)) && this.#v();
758
828
  const n = this.#m();
759
829
  r && (this.#t !== s || S(this.options.enabled, this.#t) !== S(e.enabled, this.#t) || n !== this.#u) && this.#g(n);
760
830
  }
761
831
  getOptimisticResult(t) {
762
832
  const e = this.#e.getQueryCache().build(this.#e, t), s = this.createResult(e, t);
763
- return Mt(this, s) && (this.#n = s, this.#o = this.options, this.#r = this.#t.state), s;
833
+ return zt(this, s) && (this.#n = s, this.#o = this.options, this.#r = this.#t.state), s;
764
834
  }
765
835
  getCurrentResult() {
766
836
  return this.#n;
767
837
  }
768
838
  trackResult(t, e) {
769
839
  return new Proxy(t, {
770
- get: (s, r) => (this.trackProp(r), e?.(r), r === "promise" && !this.options.experimental_prefetchInRender && this.#a.status === "pending" && this.#a.reject(
840
+ get: (s, r) => (this.trackProp(r), e?.(r), r === "promise" && (this.trackProp("data"), !this.options.experimental_prefetchInRender && this.#a.status === "pending" && this.#a.reject(
771
841
  new Error(
772
842
  "experimental_prefetchInRender feature flag is not enabled"
773
843
  )
774
- ), Reflect.get(s, r))
844
+ )), Reflect.get(s, r))
775
845
  });
776
846
  }
777
847
  trackProp(t) {
@@ -790,29 +860,29 @@ var lt = class extends G {
790
860
  return s.fetch().then(() => this.createResult(s, e));
791
861
  }
792
862
  fetch(t) {
793
- return this.#l({
863
+ return this.#h({
794
864
  ...t,
795
865
  cancelRefetch: t.cancelRefetch ?? !0
796
866
  }).then(() => (this.updateResult(), this.#n));
797
867
  }
798
- #l(t) {
799
- this.#R();
868
+ #h(t) {
869
+ this.#E();
800
870
  let e = this.#t.fetch(
801
871
  this.options,
802
872
  t
803
873
  );
804
- return t?.throwOnError || (e = e.catch(I)), e;
874
+ return t?.throwOnError || (e = e.catch(P)), e;
805
875
  }
806
876
  #v() {
807
877
  this.#S();
808
- const t = x(
878
+ const t = D(
809
879
  this.options.staleTime,
810
880
  this.#t
811
881
  );
812
- if (F || this.#n.isStale || !Q(t))
882
+ if (F || this.#n.isStale || !_(t))
813
883
  return;
814
- const s = it(this.#n.dataUpdatedAt, t) + 1;
815
- this.#c = setTimeout(() => {
884
+ const s = ct(this.#n.dataUpdatedAt, t) + 1;
885
+ this.#c = I.setTimeout(() => {
816
886
  this.#n.isStale || this.updateResult();
817
887
  }, s);
818
888
  }
@@ -820,105 +890,105 @@ var lt = class extends G {
820
890
  return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#t) : this.options.refetchInterval) ?? !1;
821
891
  }
822
892
  #g(t) {
823
- this.#w(), this.#u = t, !(F || S(this.options.enabled, this.#t) === !1 || !Q(this.#u) || this.#u === 0) && (this.#h = setInterval(() => {
824
- (this.options.refetchIntervalInBackground || at.isFocused()) && this.#l();
893
+ this.#w(), this.#u = t, !(F || S(this.options.enabled, this.#t) === !1 || !_(this.#u) || this.#u === 0) && (this.#l = I.setInterval(() => {
894
+ (this.options.refetchIntervalInBackground || lt.isFocused()) && this.#h();
825
895
  }, this.#u));
826
896
  }
827
897
  #b() {
828
898
  this.#v(), this.#g(this.#m());
829
899
  }
830
900
  #S() {
831
- this.#c && (clearTimeout(this.#c), this.#c = void 0);
901
+ this.#c && (I.clearTimeout(this.#c), this.#c = void 0);
832
902
  }
833
903
  #w() {
834
- this.#h && (clearInterval(this.#h), this.#h = void 0);
904
+ this.#l && (I.clearInterval(this.#l), this.#l = void 0);
835
905
  }
836
906
  createResult(t, e) {
837
- const s = this.#t, r = this.options, n = this.#n, a = this.#r, o = this.#o, u = t !== s ? t.state : this.#s, { state: l } = t;
838
- let h = { ...l }, d = !1, f;
907
+ const s = this.#t, r = this.options, n = this.#n, a = this.#r, o = this.#o, u = t !== s ? t.state : this.#s, { state: h } = t;
908
+ let l = { ...h }, p = !1, f;
839
909
  if (e._optimisticResults) {
840
- const b = this.hasListeners(), D = !b && et(t, e), T = b && st(t, s, e, r);
841
- (D || T) && (h = {
842
- ...h,
843
- ...ht(l.data, t.options)
844
- }), e._optimisticResults === "isRestoring" && (h.fetchStatus = "idle");
910
+ const b = this.hasListeners(), A = !b && it(t, e), x = b && at(t, s, e, r);
911
+ (A || x) && (l = {
912
+ ...l,
913
+ ...dt(h.data, t.options)
914
+ }), e._optimisticResults === "isRestoring" && (l.fetchStatus = "idle");
845
915
  }
846
- let { error: m, errorUpdatedAt: O, status: c } = h;
847
- f = h.data;
848
- let g = !1;
916
+ let { error: y, errorUpdatedAt: O, status: c } = l;
917
+ f = l.data;
918
+ let m = !1;
849
919
  if (e.placeholderData !== void 0 && f === void 0 && c === "pending") {
850
920
  let b;
851
- n?.isPlaceholderData && e.placeholderData === o?.placeholderData ? (b = n.data, g = !0) : b = typeof e.placeholderData == "function" ? e.placeholderData(
921
+ n?.isPlaceholderData && e.placeholderData === o?.placeholderData ? (b = n.data, m = !0) : b = typeof e.placeholderData == "function" ? e.placeholderData(
852
922
  this.#d?.state.data,
853
923
  this.#d
854
- ) : e.placeholderData, b !== void 0 && (c = "success", f = _(
924
+ ) : e.placeholderData, b !== void 0 && (c = "success", f = H(
855
925
  n?.data,
856
926
  b,
857
927
  e
858
- ), d = !0);
928
+ ), p = !0);
859
929
  }
860
- if (e.select && f !== void 0 && !g)
930
+ if (e.select && f !== void 0 && !m)
861
931
  if (n && f === a?.data && e.select === this.#y)
862
932
  f = this.#f;
863
933
  else
864
934
  try {
865
- this.#y = e.select, f = e.select(f), f = _(n?.data, f, e), this.#f = f, this.#i = null;
935
+ this.#y = e.select, f = e.select(f), f = H(n?.data, f, e), this.#f = f, this.#i = null;
866
936
  } catch (b) {
867
937
  this.#i = b;
868
938
  }
869
- this.#i && (m = this.#i, f = this.#f, O = Date.now(), c = "error");
870
- const v = h.fetchStatus === "fetching", p = c === "pending", y = c === "error", C = p && v, P = f !== void 0, R = {
939
+ this.#i && (y = this.#i, f = this.#f, O = Date.now(), c = "error");
940
+ const g = l.fetchStatus === "fetching", d = c === "pending", v = c === "error", R = d && g, T = f !== void 0, E = {
871
941
  status: c,
872
- fetchStatus: h.fetchStatus,
873
- isPending: p,
942
+ fetchStatus: l.fetchStatus,
943
+ isPending: d,
874
944
  isSuccess: c === "success",
875
- isError: y,
876
- isInitialLoading: C,
877
- isLoading: C,
945
+ isError: v,
946
+ isInitialLoading: R,
947
+ isLoading: R,
878
948
  data: f,
879
- dataUpdatedAt: h.dataUpdatedAt,
880
- error: m,
949
+ dataUpdatedAt: l.dataUpdatedAt,
950
+ error: y,
881
951
  errorUpdatedAt: O,
882
- failureCount: h.fetchFailureCount,
883
- failureReason: h.fetchFailureReason,
884
- errorUpdateCount: h.errorUpdateCount,
885
- isFetched: h.dataUpdateCount > 0 || h.errorUpdateCount > 0,
886
- isFetchedAfterMount: h.dataUpdateCount > u.dataUpdateCount || h.errorUpdateCount > u.errorUpdateCount,
887
- isFetching: v,
888
- isRefetching: v && !p,
889
- isLoadingError: y && !P,
890
- isPaused: h.fetchStatus === "paused",
891
- isPlaceholderData: d,
892
- isRefetchError: y && P,
893
- isStale: J(t, e),
952
+ failureCount: l.fetchFailureCount,
953
+ failureReason: l.fetchFailureReason,
954
+ errorUpdateCount: l.errorUpdateCount,
955
+ isFetched: l.dataUpdateCount > 0 || l.errorUpdateCount > 0,
956
+ isFetchedAfterMount: l.dataUpdateCount > u.dataUpdateCount || l.errorUpdateCount > u.errorUpdateCount,
957
+ isFetching: g,
958
+ isRefetching: g && !d,
959
+ isLoadingError: v && !T,
960
+ isPaused: l.fetchStatus === "paused",
961
+ isPlaceholderData: p,
962
+ isRefetchError: v && T,
963
+ isStale: W(t, e),
894
964
  refetch: this.refetch,
895
965
  promise: this.#a,
896
966
  isEnabled: S(e.enabled, t) !== !1
897
967
  };
898
968
  if (this.options.experimental_prefetchInRender) {
899
- const b = (A) => {
900
- R.status === "error" ? A.reject(R.error) : R.data !== void 0 && A.resolve(R.data);
901
- }, D = () => {
902
- const A = this.#a = R.promise = H();
903
- b(A);
904
- }, T = this.#a;
905
- switch (T.status) {
969
+ const b = (k) => {
970
+ E.status === "error" ? k.reject(E.error) : E.data !== void 0 && k.resolve(E.data);
971
+ }, A = () => {
972
+ const k = this.#a = E.promise = K();
973
+ b(k);
974
+ }, x = this.#a;
975
+ switch (x.status) {
906
976
  case "pending":
907
- t.queryHash === s.queryHash && b(T);
977
+ t.queryHash === s.queryHash && b(x);
908
978
  break;
909
979
  case "fulfilled":
910
- (R.status === "error" || R.data !== T.value) && D();
980
+ (E.status === "error" || E.data !== x.value) && A();
911
981
  break;
912
982
  case "rejected":
913
- (R.status !== "error" || R.error !== T.reason) && D();
983
+ (E.status !== "error" || E.error !== x.reason) && A();
914
984
  break;
915
985
  }
916
986
  }
917
- return R;
987
+ return E;
918
988
  }
919
989
  updateResult() {
920
990
  const t = this.#n, e = this.createResult(this.#t, this.options);
921
- if (this.#r = this.#t.state, this.#o = this.options, this.#r.data !== void 0 && (this.#d = this.#t), L(e, t))
991
+ if (this.#r = this.#t.state, this.#o = this.options, this.#r.data !== void 0 && (this.#d = this.#t), Q(e, t))
922
992
  return;
923
993
  this.#n = e;
924
994
  const s = () => {
@@ -937,7 +1007,7 @@ var lt = class extends G {
937
1007
  };
938
1008
  this.#O({ listeners: s() });
939
1009
  }
940
- #R() {
1010
+ #E() {
941
1011
  const t = this.#e.getQueryCache().build(this.#e, this.options);
942
1012
  if (t === this.#t)
943
1013
  return;
@@ -948,7 +1018,7 @@ var lt = class extends G {
948
1018
  this.updateResult(), this.hasListeners() && this.#b();
949
1019
  }
950
1020
  #O(t) {
951
- $.batch(() => {
1021
+ Z.batch(() => {
952
1022
  t.listeners && this.listeners.forEach((e) => {
953
1023
  e(this.#n);
954
1024
  }), this.#e.getQueryCache().notify({
@@ -958,45 +1028,45 @@ var lt = class extends G {
958
1028
  });
959
1029
  }
960
1030
  };
961
- function Lt(t, e) {
1031
+ function Vt(t, e) {
962
1032
  return S(e.enabled, t) !== !1 && t.state.data === void 0 && !(t.state.status === "error" && e.retryOnMount === !1);
963
1033
  }
964
- function et(t, e) {
965
- return Lt(t, e) || t.state.data !== void 0 && K(t, e, e.refetchOnMount);
1034
+ function it(t, e) {
1035
+ return Vt(t, e) || t.state.data !== void 0 && V(t, e, e.refetchOnMount);
966
1036
  }
967
- function K(t, e, s) {
968
- if (S(e.enabled, t) !== !1 && x(e.staleTime, t) !== "static") {
1037
+ function V(t, e, s) {
1038
+ if (S(e.enabled, t) !== !1 && D(e.staleTime, t) !== "static") {
969
1039
  const r = typeof s == "function" ? s(t) : s;
970
- return r === "always" || r !== !1 && J(t, e);
1040
+ return r === "always" || r !== !1 && W(t, e);
971
1041
  }
972
1042
  return !1;
973
1043
  }
974
- function st(t, e, s, r) {
975
- return (t !== e || S(r.enabled, t) === !1) && (!s.suspense || t.state.status !== "error") && J(t, s);
1044
+ function at(t, e, s, r) {
1045
+ return (t !== e || S(r.enabled, t) === !1) && (!s.suspense || t.state.status !== "error") && W(t, s);
976
1046
  }
977
- function J(t, e) {
978
- return S(e.enabled, t) !== !1 && t.isStaleByTime(x(e.staleTime, t));
1047
+ function W(t, e) {
1048
+ return S(e.enabled, t) !== !1 && t.isStaleByTime(D(e.staleTime, t));
979
1049
  }
980
- function Mt(t, e) {
981
- return !L(t.getCurrentResult(), e);
1050
+ function zt(t, e) {
1051
+ return !Q(t.getCurrentResult(), e);
982
1052
  }
983
- var ft = w.createContext(
1053
+ var yt = w.createContext(
984
1054
  void 0
985
- ), dt = (t) => {
986
- const e = w.useContext(ft);
1055
+ ), vt = (t) => {
1056
+ const e = w.useContext(yt);
987
1057
  if (t)
988
1058
  return t;
989
1059
  if (!e)
990
1060
  throw new Error("No QueryClient set, use QueryClientProvider to set one");
991
1061
  return e;
992
- }, Pe = ({
1062
+ }, Ne = ({
993
1063
  client: t,
994
1064
  children: e
995
1065
  }) => (w.useEffect(() => (t.mount(), () => {
996
1066
  t.unmount();
997
- }), [t]), /* @__PURE__ */ Et.jsx(ft.Provider, { value: t, children: e })), pt = w.createContext(!1), _t = () => w.useContext(pt);
998
- pt.Provider;
999
- function Ht() {
1067
+ }), [t]), /* @__PURE__ */ Pt.jsx(yt.Provider, { value: t, children: e })), mt = w.createContext(!1), Gt = () => w.useContext(mt);
1068
+ mt.Provider;
1069
+ function $t() {
1000
1070
  let t = !1;
1001
1071
  return {
1002
1072
  clearReset: () => {
@@ -1008,118 +1078,121 @@ function Ht() {
1008
1078
  isReset: () => t
1009
1079
  };
1010
1080
  }
1011
- var Kt = w.createContext(Ht()), Bt = () => w.useContext(Kt), zt = (t, e) => {
1081
+ var Jt = w.createContext($t()), Zt = () => w.useContext(Jt), Wt = (t, e) => {
1012
1082
  (t.suspense || t.throwOnError || t.experimental_prefetchInRender) && (e.isReset() || (t.retryOnMount = !1));
1013
- }, Gt = (t) => {
1083
+ }, Yt = (t) => {
1014
1084
  w.useEffect(() => {
1015
1085
  t.clearReset();
1016
1086
  }, [t]);
1017
- }, Vt = ({
1087
+ }, Xt = ({
1018
1088
  result: t,
1019
1089
  errorResetBoundary: e,
1020
1090
  throwOnError: s,
1021
1091
  query: r,
1022
1092
  suspense: n
1023
- }) => t.isError && !e.isReset() && !t.isFetching && r && (n && t.data === void 0 || xt(s, [t.error, r])), $t = (t, e) => e.state.data === void 0, Jt = (t) => {
1093
+ }) => t.isError && !e.isReset() && !t.isFetching && r && (n && t.data === void 0 || _t(s, [t.error, r])), te = (t, e) => e.state.data === void 0, ee = (t) => {
1024
1094
  if (t.suspense) {
1025
- const e = (r) => r === "static" ? r : Math.max(r ?? 1e3, 1e3), s = t.staleTime;
1026
- t.staleTime = typeof s == "function" ? (...r) => e(s(...r)) : e(s), typeof t.gcTime == "number" && (t.gcTime = Math.max(t.gcTime, 1e3));
1095
+ const s = (n) => n === "static" ? n : Math.max(n ?? 1e3, 1e3), r = t.staleTime;
1096
+ t.staleTime = typeof r == "function" ? (...n) => s(r(...n)) : s(r), typeof t.gcTime == "number" && (t.gcTime = Math.max(
1097
+ t.gcTime,
1098
+ 1e3
1099
+ ));
1027
1100
  }
1028
- }, Zt = (t, e) => t.isLoading && t.isFetching && !e, Wt = (t, e) => t?.suspense && e.isPending, rt = (t, e, s) => e.fetchOptimistic(t).catch(() => {
1101
+ }, se = (t, e) => t.isLoading && t.isFetching && !e, re = (t, e) => t?.suspense && e.isPending, ot = (t, e, s) => e.fetchOptimistic(t).catch(() => {
1029
1102
  s.clearReset();
1030
1103
  });
1031
- function yt(t, e, s) {
1104
+ function gt(t, e, s) {
1032
1105
  if (process.env.NODE_ENV !== "production" && (typeof t != "object" || Array.isArray(t)))
1033
1106
  throw new Error(
1034
1107
  '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'
1035
1108
  );
1036
- const r = _t(), n = Bt(), a = dt(s), o = a.defaultQueryOptions(t);
1109
+ const r = Gt(), n = Zt(), a = vt(s), o = a.defaultQueryOptions(t);
1037
1110
  a.getDefaultOptions().queries?._experimental_beforeQuery?.(
1038
1111
  o
1039
1112
  ), process.env.NODE_ENV !== "production" && (o.queryFn || console.error(
1040
1113
  `[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`
1041
- )), o._optimisticResults = r ? "isRestoring" : "optimistic", Jt(o), zt(o, n), Gt(n);
1114
+ )), o._optimisticResults = r ? "isRestoring" : "optimistic", ee(o), Wt(o, n), Yt(n);
1042
1115
  const i = !a.getQueryCache().get(o.queryHash), [u] = w.useState(
1043
1116
  () => new e(
1044
1117
  a,
1045
1118
  o
1046
1119
  )
1047
- ), l = u.getOptimisticResult(o), h = !r && t.subscribed !== !1;
1120
+ ), h = u.getOptimisticResult(o), l = !r && t.subscribed !== !1;
1048
1121
  if (w.useSyncExternalStore(
1049
1122
  w.useCallback(
1050
- (d) => {
1051
- const f = h ? u.subscribe($.batchCalls(d)) : I;
1123
+ (p) => {
1124
+ const f = l ? u.subscribe(Z.batchCalls(p)) : P;
1052
1125
  return u.updateResult(), f;
1053
1126
  },
1054
- [u, h]
1127
+ [u, l]
1055
1128
  ),
1056
1129
  () => u.getCurrentResult(),
1057
1130
  () => u.getCurrentResult()
1058
1131
  ), w.useEffect(() => {
1059
1132
  u.setOptions(o);
1060
- }, [o, u]), Wt(o, l))
1061
- throw rt(o, u, n);
1062
- if (Vt({
1063
- result: l,
1133
+ }, [o, u]), re(o, h))
1134
+ throw ot(o, u, n);
1135
+ if (Xt({
1136
+ result: h,
1064
1137
  errorResetBoundary: n,
1065
1138
  throwOnError: o.throwOnError,
1066
1139
  query: a.getQueryCache().get(o.queryHash),
1067
1140
  suspense: o.suspense
1068
1141
  }))
1069
- throw l.error;
1142
+ throw h.error;
1070
1143
  return a.getDefaultOptions().queries?._experimental_afterQuery?.(
1071
1144
  o,
1072
- l
1073
- ), o.experimental_prefetchInRender && !F && Zt(l, r) && (i ? (
1145
+ h
1146
+ ), o.experimental_prefetchInRender && !F && se(h, r) && (i ? (
1074
1147
  // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
1075
- rt(o, u, n)
1148
+ ot(o, u, n)
1076
1149
  ) : (
1077
1150
  // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
1078
1151
  a.getQueryCache().get(o.queryHash)?.promise
1079
- ))?.catch(I).finally(() => {
1152
+ ))?.catch(P).finally(() => {
1080
1153
  u.updateResult();
1081
- }), o.notifyOnChangeProps ? l : u.trackResult(l);
1154
+ }), o.notifyOnChangeProps ? h : u.trackResult(h);
1082
1155
  }
1083
- function Yt(t, e) {
1084
- return yt(t, lt, e);
1156
+ function ne(t, e) {
1157
+ return gt(t, pt, e);
1085
1158
  }
1086
- function Xt(t, e) {
1087
- return process.env.NODE_ENV !== "production" && t.queryFn === j && console.error("skipToken is not allowed for useSuspenseQuery"), yt(
1159
+ function ie(t, e) {
1160
+ return process.env.NODE_ENV !== "production" && t.queryFn === j && console.error("skipToken is not allowed for useSuspenseQuery"), gt(
1088
1161
  {
1089
1162
  ...t,
1090
1163
  enabled: !0,
1091
1164
  suspense: !0,
1092
- throwOnError: $t,
1165
+ throwOnError: te,
1093
1166
  placeholderData: void 0
1094
1167
  },
1095
- lt,
1168
+ pt,
1096
1169
  e
1097
1170
  );
1098
1171
  }
1099
- const nt = (t) => {
1172
+ const ut = (t) => {
1100
1173
  let e;
1101
- const s = /* @__PURE__ */ new Set(), r = (l, h) => {
1102
- const d = typeof l == "function" ? l(e) : l;
1103
- if (!Object.is(d, e)) {
1174
+ const s = /* @__PURE__ */ new Set(), r = (h, l) => {
1175
+ const p = typeof h == "function" ? h(e) : h;
1176
+ if (!Object.is(p, e)) {
1104
1177
  const f = e;
1105
- e = h ?? (typeof d != "object" || d === null) ? d : Object.assign({}, e, d), s.forEach((m) => m(e, f));
1178
+ e = l ?? (typeof p != "object" || p === null) ? p : Object.assign({}, e, p), s.forEach((y) => y(e, f));
1106
1179
  }
1107
- }, n = () => e, i = { setState: r, getState: n, getInitialState: () => u, subscribe: (l) => (s.add(l), () => s.delete(l)) }, u = e = t(r, n, i);
1180
+ }, n = () => e, i = { setState: r, getState: n, getInitialState: () => u, subscribe: (h) => (s.add(h), () => s.delete(h)) }, u = e = t(r, n, i);
1108
1181
  return i;
1109
- }, te = ((t) => t ? nt(t) : nt), ee = (t) => t;
1110
- function se(t, e = ee) {
1111
- const s = k.useSyncExternalStore(
1182
+ }, ae = ((t) => t ? ut(t) : ut), oe = (t) => t;
1183
+ function ue(t, e = oe) {
1184
+ const s = N.useSyncExternalStore(
1112
1185
  t.subscribe,
1113
- k.useCallback(() => e(t.getState()), [t, e]),
1114
- k.useCallback(() => e(t.getInitialState()), [t, e])
1186
+ N.useCallback(() => e(t.getState()), [t, e]),
1187
+ N.useCallback(() => e(t.getInitialState()), [t, e])
1115
1188
  );
1116
- return k.useDebugValue(s), s;
1189
+ return N.useDebugValue(s), s;
1117
1190
  }
1118
- const re = (t) => {
1119
- const e = te(t), s = (r) => se(e, r);
1191
+ const ce = (t) => {
1192
+ const e = ae(t), s = (r) => ue(e, r);
1120
1193
  return Object.assign(s, e), s;
1121
- }, ne = ((t) => re);
1122
- function vt(t, e) {
1194
+ }, le = ((t) => ce);
1195
+ function bt(t, e) {
1123
1196
  let s;
1124
1197
  try {
1125
1198
  s = t();
@@ -1136,12 +1209,12 @@ function vt(t, e) {
1136
1209
  removeItem: (n) => s.removeItem(n)
1137
1210
  };
1138
1211
  }
1139
- const B = (t) => (e) => {
1212
+ const z = (t) => (e) => {
1140
1213
  try {
1141
1214
  const s = t(e);
1142
1215
  return s instanceof Promise ? s : {
1143
1216
  then(r) {
1144
- return B(r)(s);
1217
+ return z(r)(s);
1145
1218
  },
1146
1219
  catch(r) {
1147
1220
  return this;
@@ -1153,24 +1226,24 @@ const B = (t) => (e) => {
1153
1226
  return this;
1154
1227
  },
1155
1228
  catch(r) {
1156
- return B(r)(s);
1229
+ return z(r)(s);
1157
1230
  }
1158
1231
  };
1159
1232
  }
1160
- }, ie = (t, e) => (s, r, n) => {
1233
+ }, he = (t, e) => (s, r, n) => {
1161
1234
  let a = {
1162
- storage: vt(() => localStorage),
1235
+ storage: bt(() => localStorage),
1163
1236
  partialize: (c) => c,
1164
1237
  version: 0,
1165
- merge: (c, g) => ({
1166
- ...g,
1238
+ merge: (c, m) => ({
1239
+ ...m,
1167
1240
  ...c
1168
1241
  }),
1169
1242
  ...e
1170
1243
  }, o = !1;
1171
1244
  const i = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
1172
- let l = a.storage;
1173
- if (!l)
1245
+ let h = a.storage;
1246
+ if (!h)
1174
1247
  return t(
1175
1248
  (...c) => {
1176
1249
  console.warn(
@@ -1180,57 +1253,57 @@ const B = (t) => (e) => {
1180
1253
  r,
1181
1254
  n
1182
1255
  );
1183
- const h = () => {
1256
+ const l = () => {
1184
1257
  const c = a.partialize({ ...r() });
1185
- return l.setItem(a.name, {
1258
+ return h.setItem(a.name, {
1186
1259
  state: c,
1187
1260
  version: a.version
1188
1261
  });
1189
- }, d = n.setState;
1190
- n.setState = (c, g) => (d(c, g), h());
1262
+ }, p = n.setState;
1263
+ n.setState = (c, m) => (p(c, m), l());
1191
1264
  const f = t(
1192
- (...c) => (s(...c), h()),
1265
+ (...c) => (s(...c), l()),
1193
1266
  r,
1194
1267
  n
1195
1268
  );
1196
1269
  n.getInitialState = () => f;
1197
- let m;
1270
+ let y;
1198
1271
  const O = () => {
1199
- var c, g;
1200
- if (!l) return;
1201
- o = !1, i.forEach((p) => {
1202
- var y;
1203
- return p((y = r()) != null ? y : f);
1272
+ var c, m;
1273
+ if (!h) return;
1274
+ o = !1, i.forEach((d) => {
1275
+ var v;
1276
+ return d((v = r()) != null ? v : f);
1204
1277
  });
1205
- const v = ((g = a.onRehydrateStorage) == null ? void 0 : g.call(a, (c = r()) != null ? c : f)) || void 0;
1206
- return B(l.getItem.bind(l))(a.name).then((p) => {
1207
- if (p)
1208
- if (typeof p.version == "number" && p.version !== a.version) {
1278
+ const g = ((m = a.onRehydrateStorage) == null ? void 0 : m.call(a, (c = r()) != null ? c : f)) || void 0;
1279
+ return z(h.getItem.bind(h))(a.name).then((d) => {
1280
+ if (d)
1281
+ if (typeof d.version == "number" && d.version !== a.version) {
1209
1282
  if (a.migrate) {
1210
- const y = a.migrate(
1211
- p.state,
1212
- p.version
1283
+ const v = a.migrate(
1284
+ d.state,
1285
+ d.version
1213
1286
  );
1214
- return y instanceof Promise ? y.then((C) => [!0, C]) : [!0, y];
1287
+ return v instanceof Promise ? v.then((R) => [!0, R]) : [!0, v];
1215
1288
  }
1216
1289
  console.error(
1217
1290
  "State loaded from storage couldn't be migrated since no migrate function was provided"
1218
1291
  );
1219
1292
  } else
1220
- return [!1, p.state];
1293
+ return [!1, d.state];
1221
1294
  return [!1, void 0];
1222
- }).then((p) => {
1223
- var y;
1224
- const [C, P] = p;
1225
- if (m = a.merge(
1226
- P,
1227
- (y = r()) != null ? y : f
1228
- ), s(m, !0), C)
1229
- return h();
1295
+ }).then((d) => {
1296
+ var v;
1297
+ const [R, T] = d;
1298
+ if (y = a.merge(
1299
+ T,
1300
+ (v = r()) != null ? v : f
1301
+ ), s(y, !0), R)
1302
+ return l();
1230
1303
  }).then(() => {
1231
- v?.(m, void 0), m = r(), o = !0, u.forEach((p) => p(m));
1232
- }).catch((p) => {
1233
- v?.(void 0, p);
1304
+ g?.(y, void 0), y = r(), o = !0, u.forEach((d) => d(y));
1305
+ }).catch((d) => {
1306
+ g?.(void 0, d);
1234
1307
  });
1235
1308
  };
1236
1309
  return n.persist = {
@@ -1238,10 +1311,10 @@ const B = (t) => (e) => {
1238
1311
  a = {
1239
1312
  ...a,
1240
1313
  ...c
1241
- }, c.storage && (l = c.storage);
1314
+ }, c.storage && (h = c.storage);
1242
1315
  },
1243
1316
  clearStorage: () => {
1244
- l?.removeItem(a.name);
1317
+ h?.removeItem(a.name);
1245
1318
  },
1246
1319
  getOptions: () => a,
1247
1320
  rehydrate: () => O(),
@@ -1252,8 +1325,8 @@ const B = (t) => (e) => {
1252
1325
  onFinishHydration: (c) => (u.add(c), () => {
1253
1326
  u.delete(c);
1254
1327
  })
1255
- }, a.skipHydration || O(), m || f;
1256
- }, ae = ie, oe = (t) => {
1328
+ }, a.skipHydration || O(), y || f;
1329
+ }, fe = he, de = (t) => {
1257
1330
  const e = (s) => {
1258
1331
  s.key === t.persist.getOptions().name && s.newValue && t.persist.rehydrate();
1259
1332
  };
@@ -1261,8 +1334,8 @@ const B = (t) => (e) => {
1261
1334
  return window.addEventListener("storage", e), () => {
1262
1335
  window.removeEventListener("storage", e);
1263
1336
  };
1264
- }, mt = ne()(
1265
- ae(
1337
+ }, St = le()(
1338
+ fe(
1266
1339
  (t) => ({
1267
1340
  isAuthenticated: !1,
1268
1341
  isPending: !0,
@@ -1297,81 +1370,81 @@ const B = (t) => (e) => {
1297
1370
  ...typeof t == "object" ? t : {}
1298
1371
  }),
1299
1372
  name: "auth-state",
1300
- storage: vt(() => localStorage)
1373
+ storage: bt(() => localStorage)
1301
1374
  }
1302
1375
  )
1303
1376
  );
1304
- oe(mt);
1305
- const ue = /^(\w+:\/\/[^/?]+)?([^?]*)(\?.*)?$/, ce = (t) => t.filter(
1377
+ de(St);
1378
+ const pe = /^(\w+:\/\/[^/?]+)?([^?]*)(\?.*)?$/, ye = (t) => t.filter(
1306
1379
  (e) => e != null && e !== !1 && (typeof e == "string" || typeof e == "number")
1307
- ).map((e) => `${e}`).filter((e) => e), he = (t) => {
1308
- const e = t.join("/"), [, s = "", r = ""] = e.match(ue) ?? [];
1380
+ ).map((e) => `${e}`).filter((e) => e), ve = (t) => {
1381
+ const e = t.join("/"), [, s = "", r = ""] = e.match(pe) ?? [];
1309
1382
  return {
1310
1383
  prefix: s,
1311
1384
  pathname: r.split("/").filter((n) => n !== "")
1312
1385
  };
1313
- }, le = (t) => {
1386
+ }, me = (t) => {
1314
1387
  const { prefix: e, pathname: s } = t;
1315
1388
  let r = e;
1316
1389
  return s.length > 0 ? (r ? r += "/" : r = "/", r += s.join("/")) : r || (r = "/"), r;
1317
- }, E = (...t) => {
1318
- const e = ce(t), s = he(e);
1319
- return le(s);
1320
- }, gt = Object.freeze({
1390
+ }, C = (...t) => {
1391
+ const e = ye(t), s = ve(e);
1392
+ return me(s);
1393
+ }, wt = Object.freeze({
1321
1394
  API_IDENTITIES: ["api-identities"]
1322
- }), fe = () => {
1323
- const t = dt();
1324
- return { invalidateCache: wt(
1325
- (s) => t.invalidateQueries({ queryKey: gt[s] }),
1395
+ }), ge = () => {
1396
+ const t = vt();
1397
+ return { invalidateCache: Rt(
1398
+ (s) => t.invalidateQueries({ queryKey: wt[s] }),
1326
1399
  [t]
1327
1400
  ) };
1328
- }, Te = "no-dehydrate", Z = (t, e) => {
1401
+ }, je = "no-dehydrate", Y = (t, e) => {
1329
1402
  for (const s of t) {
1330
- const r = W(s, e);
1403
+ const r = X(s, e);
1331
1404
  if (r !== void 0) return r;
1332
1405
  }
1333
- }, W = (t, e, s = []) => {
1406
+ }, X = (t, e, s = []) => {
1334
1407
  const r = e(t, s);
1335
1408
  if (r !== void 0) return r;
1336
1409
  if (t.type === "category")
1337
1410
  for (const n of t.items) {
1338
- const a = W(n, e, [
1411
+ const a = X(n, e, [
1339
1412
  ...s,
1340
1413
  t
1341
1414
  ]);
1342
1415
  if (a !== void 0) return a;
1343
1416
  }
1344
- }, xe = () => {
1345
- const t = q(), { navigation: e } = St();
1346
- return Z(e, (s) => {
1347
- if (s.type === "doc" && E(s.path) === t.pathname)
1417
+ }, Ue = () => {
1418
+ const t = U(), { navigation: e } = Ot();
1419
+ return Y(e, (s) => {
1420
+ if (s.type === "doc" && C(s.path) === t.pathname)
1348
1421
  return s;
1349
1422
  });
1350
- }, De = (t) => {
1351
- const e = q();
1352
- return W(t, (s) => {
1423
+ }, _e = (t) => {
1424
+ const e = U();
1425
+ return X(t, (s) => {
1353
1426
  switch (s.type) {
1354
1427
  case "category":
1355
- return s.link && E(s.link.path) === e.pathname ? !0 : void 0;
1428
+ return s.link && C(s.link.path) === e.pathname ? !0 : void 0;
1356
1429
  case "custom-page":
1357
1430
  case "doc":
1358
- return E(s.path) === e.pathname ? !0 : void 0;
1431
+ return C(s.path) === e.pathname ? !0 : void 0;
1359
1432
  default:
1360
1433
  return;
1361
1434
  }
1362
1435
  });
1363
- }, Ae = () => {
1364
- const t = q().pathname, { navigation: e } = St();
1436
+ }, Me = () => {
1437
+ const t = U().pathname, { navigation: e } = Ot();
1365
1438
  let s, r, n = !1;
1366
- return Z(e, (a) => {
1367
- const o = a.type === "doc" ? E(a.path) : a.type === "category" && a.link ? E(a.link.path) : void 0;
1439
+ return Y(e, (a) => {
1440
+ const o = a.type === "doc" ? C(a.path) : a.type === "category" && a.link ? C(a.link.path) : void 0;
1368
1441
  if (o) {
1369
1442
  if (n)
1370
1443
  return r = { label: a.label, id: o }, !0;
1371
1444
  t === o ? n = !0 : s = { label: a.label, id: o };
1372
1445
  }
1373
1446
  }), { prev: s, next: r };
1374
- }, ke = Ft(
1447
+ }, qe = Tt(
1375
1448
  "relative flex items-center gap-2 px-(--padding-nav-item) my-0.5 py-1.5 rounded-lg hover:bg-accent tabular-nums",
1376
1449
  {
1377
1450
  variants: {
@@ -1392,58 +1465,58 @@ const ue = /^(\w+:\/\/[^/?]+)?([^?]*)(\?.*)?$/, ce = (t) => t.filter(
1392
1465
  isActive: !1
1393
1466
  }
1394
1467
  }
1395
- ), je = (t, e) => (s) => typeof s.display == "function" ? s.display({ context: e, auth: t }) : s.display === "hide" || !s.label ? !1 : s.display === "auth" && t.isAuthenticated || s.display === "anon" && !t.isAuthenticated || !s.display || s.display === "always", de = Rt(
1468
+ ), Qe = (t, e) => (s) => typeof s.display == "function" ? s.display({ context: e, auth: t }) : s.display === "hide" || !s.label ? !1 : s.display === "auth" && t.isAuthenticated || s.display === "anon" && !t.isAuthenticated || !s.display || s.display === "always", be = Ct(
1396
1469
  void 0
1397
- ), bt = () => {
1398
- const t = Ot(de);
1470
+ ), Et = () => {
1471
+ const t = It(be);
1399
1472
  if (!t)
1400
1473
  throw new Error("useZudoku must be used within a ZudokuProvider.");
1401
1474
  return t;
1402
- }, qe = () => {
1403
- const { getApiIdentities: t } = bt(), { isAuthenticated: e } = mt(), { invalidateCache: s } = fe();
1404
- return Ct(() => {
1475
+ }, Le = () => {
1476
+ const { getApiIdentities: t } = Et(), { isAuthenticated: e } = St(), { invalidateCache: s } = ge();
1477
+ return Ft(() => {
1405
1478
  e || s("API_IDENTITIES");
1406
- }, [e, s]), Yt({
1479
+ }, [e, s]), ne({
1407
1480
  queryFn: t,
1408
- queryKey: gt.API_IDENTITIES
1481
+ queryKey: wt.API_IDENTITIES
1409
1482
  });
1410
- }, z = (t) => {
1483
+ }, G = (t) => {
1411
1484
  switch (t.type) {
1412
1485
  case "doc":
1413
- return E(t.path);
1486
+ return C(t.path);
1414
1487
  case "category":
1415
- return t.link ? E(t.link.path) : void 0;
1488
+ return t.link ? C(t.link.path) : void 0;
1416
1489
  case "link":
1417
1490
  return t.to;
1418
1491
  case "custom-page":
1419
- return E(t.path);
1492
+ return C(t.path);
1420
1493
  default:
1421
1494
  return;
1422
1495
  }
1423
- }, pe = (t) => {
1496
+ }, Se = (t) => {
1424
1497
  const e = /* @__PURE__ */ new Set(), s = (r) => {
1425
1498
  for (const n of r) {
1426
- const a = z(n)?.split("?").at(0)?.split("#").at(0);
1499
+ const a = G(n)?.split("?").at(0)?.split("#").at(0);
1427
1500
  a && e.add(a), n.type === "category" && s(n.items);
1428
1501
  }
1429
1502
  };
1430
1503
  return s(t), [...e];
1431
- }, St = () => {
1432
- const { getPluginNavigation: t, navigation: e } = bt(), s = q(), r = Z(e, (o, i) => {
1433
- if (z(o) === s.pathname)
1504
+ }, Ot = () => {
1505
+ const { getPluginNavigation: t, navigation: e } = Et(), s = U(), r = Y(e, (o, i) => {
1506
+ if (G(o) === s.pathname)
1434
1507
  return i.at(0) ?? o;
1435
- }), { data: n } = Xt({
1508
+ }), { data: n } = ie({
1436
1509
  queryFn: () => t(s.pathname),
1437
1510
  queryKey: ["plugin-navigation", s.pathname]
1438
1511
  });
1439
1512
  let a = r;
1440
1513
  if (!r && n.length > 0) {
1441
- const o = pe(n);
1514
+ const o = Se(n);
1442
1515
  a = e.flatMap((i) => {
1443
- const u = z(i);
1516
+ const u = G(i);
1444
1517
  return u ? [{ item: i, path: u }] : [];
1445
1518
  }).sort((i, u) => u.path.length - i.path.length).find(({ path: i }) => o.some(
1446
- (u) => Y({ path: i, end: !1 }, u) ?? Y({ path: u, end: !1 }, i)
1519
+ (u) => tt({ path: i, end: !1 }, u) ?? tt({ path: u, end: !1 }, i)
1447
1520
  ))?.item;
1448
1521
  }
1449
1522
  return {
@@ -1455,54 +1528,54 @@ const ue = /^(\w+:\/\/[^/?]+)?([^?]*)(\?.*)?$/, ce = (t) => t.filter(
1455
1528
  };
1456
1529
  };
1457
1530
  export {
1458
- Se as A,
1459
- V as B,
1460
- gt as C,
1461
- j as D,
1462
- Fe as E,
1463
- Pe as F,
1464
- St as G,
1465
- ne as H,
1466
- ae as I,
1467
- vt as J,
1468
- oe as K,
1469
- qe as L,
1470
- De as M,
1471
- ke as N,
1472
- je as O,
1473
- te as P,
1474
- Ie as Q,
1475
- Ut as R,
1476
- G as S,
1477
- se as T,
1478
- W as U,
1479
- Te as V,
1480
- de as Z,
1481
- bt as a,
1482
- xe as b,
1483
- jt as c,
1484
- Ae as d,
1485
- Xt as e,
1486
- Yt as f,
1487
- dt as g,
1488
- U as h,
1489
- I as i,
1490
- E as j,
1491
- xt as k,
1492
- Oe as l,
1493
- fe as m,
1494
- $ as n,
1495
- It as o,
1496
- we as p,
1497
- Re as q,
1498
- Tt as r,
1499
- L as s,
1500
- Z as t,
1501
- mt as u,
1502
- Ee as v,
1503
- Ce as w,
1504
- at as x,
1505
- ot as y,
1506
- x as z
1531
+ D as A,
1532
+ Ie as B,
1533
+ wt as C,
1534
+ J as D,
1535
+ j as E,
1536
+ Ne as F,
1537
+ Ot as G,
1538
+ le as H,
1539
+ fe as I,
1540
+ bt as J,
1541
+ de as K,
1542
+ Le as L,
1543
+ _e as M,
1544
+ qe as N,
1545
+ Qe as O,
1546
+ ae as P,
1547
+ ke as Q,
1548
+ Bt as R,
1549
+ $ as S,
1550
+ ue as T,
1551
+ X as U,
1552
+ je as V,
1553
+ be as Z,
1554
+ Et as a,
1555
+ Ue as b,
1556
+ Kt as c,
1557
+ Me as d,
1558
+ ie as e,
1559
+ ne as f,
1560
+ vt as g,
1561
+ M as h,
1562
+ P as i,
1563
+ C as j,
1564
+ _t as k,
1565
+ Te as l,
1566
+ ge as m,
1567
+ Z as n,
1568
+ Ae as o,
1569
+ Ut as p,
1570
+ De as q,
1571
+ xe as r,
1572
+ Q as s,
1573
+ Y as t,
1574
+ St as u,
1575
+ Pe as v,
1576
+ kt as w,
1577
+ Fe as x,
1578
+ lt as y,
1579
+ ht as z
1507
1580
  };
1508
- //# sourceMappingURL=ZudokuContext-DNHMZfcP.js.map
1581
+ //# sourceMappingURL=ZudokuContext-Ea7gxmGq.js.map