zudoku 0.66.3 → 0.66.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/authentication/components/CallbackHandler.js +1 -1
- package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
- package/dist/lib/authentication/components/SignIn.js +4 -2
- package/dist/lib/authentication/components/SignIn.js.map +1 -1
- package/dist/lib/authentication/components/SignUp.js +4 -2
- package/dist/lib/authentication/components/SignUp.js.map +1 -1
- package/dist/lib/core/RouteGuard.js +12 -7
- package/dist/lib/core/RouteGuard.js.map +1 -1
- package/dist/lib/oas/graphql/index.js +7 -3
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/plugins/api-keys/index.d.ts +9 -5
- package/dist/lib/plugins/api-keys/index.js +20 -11
- package/dist/lib/plugins/api-keys/index.js.map +1 -1
- package/dist/lib/plugins/api-keys/settings/ApiKeyList.js +3 -0
- package/dist/lib/plugins/api-keys/settings/ApiKeyList.js.map +1 -1
- package/dist/lib/plugins/openapi/ParamInfos.js +1 -0
- package/dist/lib/plugins/openapi/ParamInfos.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +3 -2
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/plugins/openapi/util/createHttpSnippet.js +24 -1
- package/dist/lib/plugins/openapi/util/createHttpSnippet.js.map +1 -1
- package/dist/lib/ui/Button.js +1 -1
- package/dist/lib/ui/Button.js.map +1 -1
- package/dist/lib/util/invariant.d.ts +1 -1
- package/dist/lib/util/invariant.js +2 -2
- package/dist/lib/util/invariant.js.map +1 -1
- package/dist/vite/mdx/remark-link-rewrite.js +1 -1
- package/dist/vite/plugin-api-keys.js +1 -0
- package/dist/vite/plugin-api-keys.js.map +1 -1
- package/dist/vite/plugin-markdown-export.js +1 -1
- package/dist/vite/plugin-markdown-export.js.map +1 -1
- package/dist/vite/prerender/worker.js +3 -0
- package/dist/vite/prerender/worker.js.map +1 -1
- package/lib/{ActionButton-DUgvSylL.js → ActionButton-B0CXL1Lq.js} +3 -3
- package/lib/{ActionButton-DUgvSylL.js.map → ActionButton-B0CXL1Lq.js.map} +1 -1
- package/lib/{Button-CynVW1JV.js → Button-GUVe7pmt.js} +8 -7
- package/lib/{Button-CynVW1JV.js.map → Button-GUVe7pmt.js.map} +1 -1
- package/lib/{Card-KFniaZn5.js → Card-DCdq37aA.js} +2 -2
- package/lib/{Card-KFniaZn5.js.map → Card-DCdq37aA.js.map} +1 -1
- package/lib/{ClaudeLogo-BZslN9XF.js → ClaudeLogo-ByzA8TYR.js} +3 -3
- package/lib/{ClaudeLogo-BZslN9XF.js.map → ClaudeLogo-ByzA8TYR.js.map} +1 -1
- package/lib/{Command-BpT1iBE6.js → Command-N6VujV30.js} +3 -3
- package/lib/{Command-BpT1iBE6.js.map → Command-N6VujV30.js.map} +1 -1
- package/lib/{Dialog-BQciPiHN.js → Dialog-hlvmmQ_c.js} +2 -2
- package/lib/{Dialog-BQciPiHN.js.map → Dialog-hlvmmQ_c.js.map} +1 -1
- package/lib/{Drawer-BRMcpfuF.js → Drawer-Ch7927PF.js} +2 -2
- package/lib/{Drawer-BRMcpfuF.js.map → Drawer-Ch7927PF.js.map} +1 -1
- package/lib/{DropdownMenu-C8SX_-S_.js → DropdownMenu-DN0jNrjj.js} +2 -2
- package/lib/{DropdownMenu-C8SX_-S_.js.map → DropdownMenu-DN0jNrjj.js.map} +1 -1
- package/lib/{Frame-DxlznfVd.js → Frame-DKlOmSkU.js} +2 -2
- package/lib/{Frame-DxlznfVd.js.map → Frame-DKlOmSkU.js.map} +1 -1
- package/lib/{IndexingDialog-B5zCiUKr.js → IndexingDialog-D0YdGfbn.js} +3 -3
- package/lib/{IndexingDialog-B5zCiUKr.js.map → IndexingDialog-D0YdGfbn.js.map} +1 -1
- package/lib/{Input-D-kqEQ5M.js → Input-nskrp_mj.js} +39 -18
- package/lib/Input-nskrp_mj.js.map +1 -0
- package/lib/{MdxPage-B4zZq5aR.js → MdxPage-Bh5YNRV9.js} +10 -10
- package/lib/{MdxPage-B4zZq5aR.js.map → MdxPage-Bh5YNRV9.js.map} +1 -1
- package/lib/{Mermaid-BjSczjLW.js → Mermaid-CGRoylZf.js} +4 -4
- package/lib/{Mermaid-BjSczjLW.js.map → Mermaid-CGRoylZf.js.map} +1 -1
- package/lib/{OAuthErrorPage-DRY2hlga.js → OAuthErrorPage-CsTKz5hX.js} +8 -8
- package/lib/OAuthErrorPage-CsTKz5hX.js.map +1 -0
- package/lib/{OasProvider-lMwTD76Y.js → OasProvider-BBAbJiYa.js} +3 -3
- package/lib/{OasProvider-lMwTD76Y.js.map → OasProvider-BBAbJiYa.js.map} +1 -1
- package/lib/{OperationList-Bm76b4vl.js → OperationList-DUxrNisd.js} +1104 -1089
- package/lib/{OperationList-Bm76b4vl.js.map → OperationList-DUxrNisd.js.map} +1 -1
- package/lib/RouteGuard-CIN9Ou-r.js +77 -0
- package/lib/RouteGuard-CIN9Ou-r.js.map +1 -0
- package/lib/{SchemaList-DX4FPogg.js → SchemaList-BbnkfjIe.js} +9 -9
- package/lib/{SchemaList-DX4FPogg.js.map → SchemaList-BbnkfjIe.js.map} +1 -1
- package/lib/{SchemaView-CjXvSRxy.js → SchemaView-BrUf6_nP.js} +112 -111
- package/lib/SchemaView-BrUf6_nP.js.map +1 -0
- package/lib/{Secret-BxGpIhDP.js → Secret-BDBqq4p3.js} +2 -2
- package/lib/{Secret-BxGpIhDP.js.map → Secret-BDBqq4p3.js.map} +1 -1
- package/lib/{Separator-CTPSeW1S.js → Separator-BXt1LYnm.js} +2 -2
- package/lib/{Separator-CTPSeW1S.js.map → Separator-BXt1LYnm.js.map} +1 -1
- package/lib/SignUp-AlaaduyY.js +50 -0
- package/lib/SignUp-AlaaduyY.js.map +1 -0
- package/lib/{SyntaxHighlight-Dgd0AaaX.js → SyntaxHighlight-DveJcTOQ.js} +4 -4
- package/lib/{SyntaxHighlight-Dgd0AaaX.js.map → SyntaxHighlight-DveJcTOQ.js.map} +1 -1
- package/lib/{Toc-L1vGGHA1.js → Toc-B4ShtN-I.js} +3 -3
- package/lib/{Toc-L1vGGHA1.js.map → Toc-B4ShtN-I.js.map} +1 -1
- package/lib/{ZudokuContext-DNHMZfcP.js → ZudokuContext-CDJYKqMY.js} +542 -469
- package/lib/ZudokuContext-CDJYKqMY.js.map +1 -0
- package/lib/{___vite-browser-external_commonjs-proxy-Cga3HsWk.js → ___vite-browser-external_commonjs-proxy-BttVsNON.js} +2 -2
- package/lib/___vite-browser-external_commonjs-proxy-BttVsNON.js.map +1 -0
- package/lib/chunk-PVWAREVJ-ClM0m2aJ.js.map +1 -1
- package/lib/{circular-BIN_WQ0c.js → circular-CuSWVYOZ.js} +2 -2
- package/lib/{circular-BIN_WQ0c.js.map → circular-CuSWVYOZ.js.map} +1 -1
- package/lib/{cn-dYga0KKN.js → cn-5-Gd1Dss.js} +531 -498
- package/lib/cn-5-Gd1Dss.js.map +1 -0
- package/lib/{createServer-BEl12QFw.js → createServer-B1_RUTJP.js} +12 -12
- package/lib/{createServer-BEl12QFw.js.map → createServer-B1_RUTJP.js.map} +1 -1
- package/lib/{createVariantComponent-CQVt-H3r.js → createVariantComponent-Dc0vtOvr.js} +2 -2
- package/lib/{createVariantComponent-CQVt-H3r.js.map → createVariantComponent-Dc0vtOvr.js.map} +1 -1
- package/lib/{errors-CtBbD47A.js → errors-iDfQAr_v.js} +3 -3
- package/lib/{errors-CtBbD47A.js.map → errors-iDfQAr_v.js.map} +1 -1
- package/lib/{firebase-CT38ugg4.js → firebase-I54w2ZsH.js} +20 -20
- package/lib/{firebase-CT38ugg4.js.map → firebase-I54w2ZsH.js.map} +1 -1
- package/lib/{hook-CHw_R_xu.js → hook-BxWvqzB0.js} +2 -2
- package/lib/{hook-CHw_R_xu.js.map → hook-BxWvqzB0.js.map} +1 -1
- package/lib/{index-CG2v-T7-.js → index-A5Cre871.js} +11 -11
- package/lib/{index-CG2v-T7-.js.map → index-A5Cre871.js.map} +1 -1
- package/lib/{index-jI2Fjpy-.js → index-B4puReRo.js} +20 -20
- package/lib/{index-jI2Fjpy-.js.map → index-B4puReRo.js.map} +1 -1
- package/lib/{index-DXXZDuSJ.js → index-CjTisMeX.js} +3 -3
- package/lib/{index-DXXZDuSJ.js.map → index-CjTisMeX.js.map} +1 -1
- package/lib/index-CrcNWbel.js.map +1 -1
- package/lib/{index-CISwSpdT.js → index-Dbrv6d94.js} +2 -2
- package/lib/{index-CISwSpdT.js.map → index-Dbrv6d94.js.map} +1 -1
- package/lib/index.esm-BYObtETB.js.map +1 -1
- package/lib/{index.esm-DtzT_KoE.js → index.esm-B_0dvNjB.js} +2 -2
- package/lib/{index.esm-DtzT_KoE.js.map → index.esm-B_0dvNjB.js.map} +1 -1
- package/lib/{index.esm-Bu35TNgg.js → index.esm-BxIXRKtj.js} +2 -2
- package/lib/index.esm-BxIXRKtj.js.map +1 -0
- package/lib/{invariant-CGOLuIIz.js → invariant-BJAl77rw.js} +4 -4
- package/lib/invariant-BJAl77rw.js.map +1 -0
- package/lib/jsx-runtime-BzflLqGi.js.map +1 -1
- package/lib/{mutation-DMHWqmFp.js → mutation-Cq0wKBqW.js} +70 -44
- package/lib/mutation-Cq0wKBqW.js.map +1 -0
- package/lib/ui/Accordion.js +1 -1
- package/lib/ui/ActionButton.js +2 -2
- package/lib/ui/Alert.js +1 -1
- package/lib/ui/AlertDialog.js +1 -1
- package/lib/ui/Badge.js +1 -1
- package/lib/ui/Breadcrumb.js +1 -1
- package/lib/ui/Button.js +7 -6
- package/lib/ui/Button.js.map +1 -1
- package/lib/ui/ButtonGroup.js +1 -1
- package/lib/ui/Callout.js +1 -1
- package/lib/ui/Card.js +1 -1
- package/lib/ui/Carousel.js +1 -1
- package/lib/ui/Carousel.js.map +1 -1
- package/lib/ui/Checkbox.js +1 -1
- package/lib/ui/CodeBlock.js +1 -1
- package/lib/ui/Command.js +2 -2
- package/lib/ui/Dialog.js +1 -1
- package/lib/ui/Drawer.js +2 -2
- package/lib/ui/DropdownMenu.js +1 -1
- package/lib/ui/EmbeddedCodeBlock.js +1 -1
- package/lib/ui/Form.js +1 -1
- package/lib/ui/Frame.js +1 -1
- package/lib/ui/HoverCard.js +1 -1
- package/lib/ui/Input.js +1 -1
- package/lib/ui/Item.js +1 -1
- package/lib/ui/Label.js +1 -1
- package/lib/ui/NativeSelect.js +1 -1
- package/lib/ui/Pagination.js +1 -1
- package/lib/ui/Popover.js +1 -1
- package/lib/ui/Progress.js +1 -1
- package/lib/ui/RadioGroup.js +1 -1
- package/lib/ui/ScrollArea.js +1 -1
- package/lib/ui/Secret.js +1 -1
- package/lib/ui/Separator.js +1 -1
- package/lib/ui/Skeleton.js +1 -1
- package/lib/ui/Slider.js +1 -1
- package/lib/ui/Switch.js +1 -1
- package/lib/ui/SyntaxHighlight.js +3 -3
- package/lib/ui/Tabs.js +1 -1
- package/lib/ui/Textarea.js +1 -1
- package/lib/ui/Toggle.js +1 -1
- package/lib/ui/ToggleGroup.js +1 -1
- package/lib/ui/Value.js +1 -1
- package/lib/ui/util.js +1 -1
- package/lib/zudoku.__internal.js +576 -574
- package/lib/zudoku.__internal.js.map +1 -1
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-azureb2c.js +4 -4
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-firebase.js +5 -5
- package/lib/zudoku.auth-openid.js +5 -5
- package/lib/zudoku.auth-supabase.js +4 -4
- package/lib/zudoku.components.js +5 -5
- package/lib/zudoku.hooks.js +3 -3
- package/lib/zudoku.mermaid.js +3 -3
- package/lib/zudoku.plugin-api-catalog.js +4 -4
- package/lib/zudoku.plugin-api-keys.js +258 -242
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +2 -2
- package/lib/zudoku.plugin-search-pagefind.js +6 -6
- package/lib/zudoku.router.js.map +1 -1
- package/package.json +6 -6
- package/src/lib/authentication/components/CallbackHandler.tsx +1 -1
- package/src/lib/authentication/components/SignIn.tsx +5 -2
- package/src/lib/authentication/components/SignUp.tsx +5 -2
- package/src/lib/core/RouteGuard.tsx +30 -24
- package/src/lib/oas/graphql/index.ts +7 -3
- package/src/lib/plugins/api-keys/index.tsx +48 -19
- package/src/lib/plugins/api-keys/settings/ApiKeyList.tsx +3 -0
- package/src/lib/plugins/openapi/ParamInfos.tsx +1 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +3 -2
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +6 -4
- package/src/lib/plugins/openapi/util/createHttpSnippet.ts +29 -1
- package/src/lib/ui/Button.tsx +1 -0
- package/src/lib/util/invariant.ts +2 -1
- package/lib/Input-D-kqEQ5M.js.map +0 -1
- package/lib/OAuthErrorPage-DRY2hlga.js.map +0 -1
- package/lib/RouteGuard-DGc32XJV.js +0 -77
- package/lib/RouteGuard-DGc32XJV.js.map +0 -1
- package/lib/SchemaView-CjXvSRxy.js.map +0 -1
- package/lib/SignUp-CntxjFGS.js +0 -50
- package/lib/SignUp-CntxjFGS.js.map +0 -1
- package/lib/ZudokuContext-DNHMZfcP.js.map +0 -1
- package/lib/___vite-browser-external_commonjs-proxy-Cga3HsWk.js.map +0 -1
- package/lib/cn-dYga0KKN.js.map +0 -1
- package/lib/index.esm-Bu35TNgg.js.map +0 -1
- package/lib/invariant-CGOLuIIz.js.map +0 -1
- package/lib/mutation-DMHWqmFp.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as w from "react";
|
|
2
|
-
import
|
|
3
|
-
import { j as
|
|
4
|
-
import { a as
|
|
5
|
-
import { c as
|
|
6
|
-
var
|
|
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-PVWAREVJ-ClM0m2aJ.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
|
-
},
|
|
23
|
-
function
|
|
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
|
-
|
|
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
|
|
74
|
+
function _(t) {
|
|
29
75
|
return typeof t == "number" && t >= 0 && t !== 1 / 0;
|
|
30
76
|
}
|
|
31
|
-
function
|
|
77
|
+
function ct(t, e) {
|
|
32
78
|
return Math.max(t + (e || 0) - Date.now(), 0);
|
|
33
79
|
}
|
|
34
|
-
function
|
|
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
|
|
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 !==
|
|
97
|
+
if (e.queryHash !== kt(o, e.options))
|
|
52
98
|
return !1;
|
|
53
|
-
} else if (!
|
|
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
|
|
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 (
|
|
115
|
+
if (M(e.options.mutationKey) !== M(a))
|
|
70
116
|
return !1;
|
|
71
|
-
} else if (!
|
|
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
|
|
77
|
-
return (e?.queryKeyHashFn ||
|
|
122
|
+
function kt(t, e) {
|
|
123
|
+
return (e?.queryKeyHashFn || M)(t);
|
|
78
124
|
}
|
|
79
|
-
function
|
|
125
|
+
function M(t) {
|
|
80
126
|
return JSON.stringify(
|
|
81
127
|
t,
|
|
82
|
-
(e, 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
|
|
86
|
-
return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? Object.keys(e).every((s) =>
|
|
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
|
-
|
|
134
|
+
var Nt = Object.prototype.hasOwnProperty;
|
|
135
|
+
function q(t, e) {
|
|
89
136
|
if (t === e)
|
|
90
137
|
return t;
|
|
91
|
-
const s =
|
|
92
|
-
if (s
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
-
|
|
152
|
+
const y = q(p, f);
|
|
153
|
+
i[l] = y, y === p && u++;
|
|
100
154
|
}
|
|
101
|
-
return
|
|
155
|
+
return n === o && u === n ? t : i;
|
|
102
156
|
}
|
|
103
|
-
function
|
|
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
|
|
165
|
+
function et(t) {
|
|
112
166
|
return Array.isArray(t) && t.length === Object.keys(t).length;
|
|
113
167
|
}
|
|
114
|
-
function
|
|
115
|
-
if (!
|
|
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 !(!
|
|
175
|
+
return !(!st(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(t) !== Object.prototype);
|
|
122
176
|
}
|
|
123
|
-
function
|
|
177
|
+
function st(t) {
|
|
124
178
|
return Object.prototype.toString.call(t) === "[object Object]";
|
|
125
179
|
}
|
|
126
|
-
function
|
|
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
|
|
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
|
|
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
|
|
197
|
+
return q(t, e);
|
|
144
198
|
}
|
|
145
199
|
return e;
|
|
146
200
|
}
|
|
147
|
-
function
|
|
201
|
+
function Te(t) {
|
|
148
202
|
return t;
|
|
149
203
|
}
|
|
150
|
-
function
|
|
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
|
|
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
|
|
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
|
|
218
|
+
function _t(t, e) {
|
|
165
219
|
return typeof t == "function" ? t(...e) : !!t;
|
|
166
220
|
}
|
|
167
|
-
var
|
|
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
|
-
},
|
|
205
|
-
|
|
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
|
|
281
|
+
function Ae(t) {
|
|
259
282
|
let e;
|
|
260
|
-
if (t.then((s) => (e = s, s),
|
|
283
|
+
if (t.then((s) => (e = s, s), P)?.catch(P), e !== void 0)
|
|
261
284
|
return { data: e };
|
|
262
285
|
}
|
|
263
|
-
|
|
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
|
|
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(),
|
|
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
|
-
},
|
|
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 =
|
|
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 =
|
|
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(
|
|
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) =>
|
|
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 : !
|
|
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 =
|
|
513
|
-
const
|
|
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(
|
|
581
|
+
return r(l), l;
|
|
519
582
|
})();
|
|
520
583
|
return this.#a = !1, this.options.persister ? this.options.persister(
|
|
521
584
|
i,
|
|
522
|
-
|
|
585
|
+
h,
|
|
523
586
|
this
|
|
524
|
-
) : i(
|
|
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 =
|
|
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
|
-
|
|
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
|
|
634
|
+
if (i instanceof B) {
|
|
567
635
|
if (i.silent)
|
|
568
636
|
return this.#r.promise;
|
|
569
637
|
if (i.revert) {
|
|
570
|
-
if (this.
|
|
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
|
-
...
|
|
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
|
|
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),
|
|
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
|
|
726
|
+
function dt(t, e) {
|
|
666
727
|
return {
|
|
667
728
|
fetchFailureCount: 0,
|
|
668
729
|
fetchFailureReason: null,
|
|
669
|
-
fetchStatus:
|
|
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
|
|
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
|
|
763
|
+
var pt = class extends $ {
|
|
694
764
|
constructor(t, e) {
|
|
695
|
-
super(), this.options = e, this.#e = t, this.#i = null, this.#a =
|
|
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
|
-
#
|
|
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),
|
|
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
|
|
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
|
|
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.#
|
|
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 &&
|
|
822
|
+
r && at(
|
|
753
823
|
this.#t,
|
|
754
824
|
s,
|
|
755
825
|
this.options,
|
|
756
826
|
e
|
|
757
|
-
) && this.#
|
|
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
|
|
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.#
|
|
863
|
+
return this.#h({
|
|
794
864
|
...t,
|
|
795
865
|
cancelRefetch: t.cancelRefetch ?? !0
|
|
796
866
|
}).then(() => (this.updateResult(), this.#n));
|
|
797
867
|
}
|
|
798
|
-
#
|
|
799
|
-
this.#
|
|
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(
|
|
874
|
+
return t?.throwOnError || (e = e.catch(P)), e;
|
|
805
875
|
}
|
|
806
876
|
#v() {
|
|
807
877
|
this.#S();
|
|
808
|
-
const t =
|
|
878
|
+
const t = D(
|
|
809
879
|
this.options.staleTime,
|
|
810
880
|
this.#t
|
|
811
881
|
);
|
|
812
|
-
if (F || this.#n.isStale || !
|
|
882
|
+
if (F || this.#n.isStale || !_(t))
|
|
813
883
|
return;
|
|
814
|
-
const s =
|
|
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 || !
|
|
824
|
-
(this.options.refetchIntervalInBackground ||
|
|
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.#
|
|
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:
|
|
838
|
-
let
|
|
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(),
|
|
841
|
-
(
|
|
842
|
-
...
|
|
843
|
-
...
|
|
844
|
-
}), e._optimisticResults === "isRestoring" && (
|
|
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:
|
|
847
|
-
f =
|
|
848
|
-
let
|
|
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,
|
|
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
|
-
),
|
|
928
|
+
), p = !0);
|
|
859
929
|
}
|
|
860
|
-
if (e.select && f !== void 0 && !
|
|
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 =
|
|
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 && (
|
|
870
|
-
const
|
|
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:
|
|
873
|
-
isPending:
|
|
942
|
+
fetchStatus: l.fetchStatus,
|
|
943
|
+
isPending: d,
|
|
874
944
|
isSuccess: c === "success",
|
|
875
|
-
isError:
|
|
876
|
-
isInitialLoading:
|
|
877
|
-
isLoading:
|
|
945
|
+
isError: v,
|
|
946
|
+
isInitialLoading: R,
|
|
947
|
+
isLoading: R,
|
|
878
948
|
data: f,
|
|
879
|
-
dataUpdatedAt:
|
|
880
|
-
error:
|
|
949
|
+
dataUpdatedAt: l.dataUpdatedAt,
|
|
950
|
+
error: y,
|
|
881
951
|
errorUpdatedAt: O,
|
|
882
|
-
failureCount:
|
|
883
|
-
failureReason:
|
|
884
|
-
errorUpdateCount:
|
|
885
|
-
isFetched:
|
|
886
|
-
isFetchedAfterMount:
|
|
887
|
-
isFetching:
|
|
888
|
-
isRefetching:
|
|
889
|
-
isLoadingError:
|
|
890
|
-
isPaused:
|
|
891
|
-
isPlaceholderData:
|
|
892
|
-
isRefetchError:
|
|
893
|
-
isStale:
|
|
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 = (
|
|
900
|
-
|
|
901
|
-
},
|
|
902
|
-
const
|
|
903
|
-
b(
|
|
904
|
-
},
|
|
905
|
-
switch (
|
|
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(
|
|
977
|
+
t.queryHash === s.queryHash && b(x);
|
|
908
978
|
break;
|
|
909
979
|
case "fulfilled":
|
|
910
|
-
(
|
|
980
|
+
(E.status === "error" || E.data !== x.value) && A();
|
|
911
981
|
break;
|
|
912
982
|
case "rejected":
|
|
913
|
-
(
|
|
983
|
+
(E.status !== "error" || E.error !== x.reason) && A();
|
|
914
984
|
break;
|
|
915
985
|
}
|
|
916
986
|
}
|
|
917
|
-
return
|
|
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),
|
|
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
|
-
#
|
|
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
|
-
|
|
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
|
|
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
|
|
965
|
-
return
|
|
1034
|
+
function it(t, e) {
|
|
1035
|
+
return Vt(t, e) || t.state.data !== void 0 && V(t, e, e.refetchOnMount);
|
|
966
1036
|
}
|
|
967
|
-
function
|
|
968
|
-
if (S(e.enabled, t) !== !1 &&
|
|
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 &&
|
|
1040
|
+
return r === "always" || r !== !1 && W(t, e);
|
|
971
1041
|
}
|
|
972
1042
|
return !1;
|
|
973
1043
|
}
|
|
974
|
-
function
|
|
975
|
-
return (t !== e || S(r.enabled, t) === !1) && (!s.suspense || t.state.status !== "error") &&
|
|
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
|
|
978
|
-
return S(e.enabled, t) !== !1 && t.isStaleByTime(
|
|
1047
|
+
function W(t, e) {
|
|
1048
|
+
return S(e.enabled, t) !== !1 && t.isStaleByTime(D(e.staleTime, t));
|
|
979
1049
|
}
|
|
980
|
-
function
|
|
981
|
-
return !
|
|
1050
|
+
function zt(t, e) {
|
|
1051
|
+
return !Q(t.getCurrentResult(), e);
|
|
982
1052
|
}
|
|
983
|
-
var
|
|
1053
|
+
var yt = w.createContext(
|
|
984
1054
|
void 0
|
|
985
|
-
),
|
|
986
|
-
const e = w.useContext(
|
|
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
|
-
},
|
|
1062
|
+
}, Ne = ({
|
|
993
1063
|
client: t,
|
|
994
1064
|
children: e
|
|
995
1065
|
}) => (w.useEffect(() => (t.mount(), () => {
|
|
996
1066
|
t.unmount();
|
|
997
|
-
}), [t]), /* @__PURE__ */
|
|
998
|
-
|
|
999
|
-
function
|
|
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
|
|
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
|
-
},
|
|
1083
|
+
}, Yt = (t) => {
|
|
1014
1084
|
w.useEffect(() => {
|
|
1015
1085
|
t.clearReset();
|
|
1016
1086
|
}, [t]);
|
|
1017
|
-
},
|
|
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 ||
|
|
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
|
|
1026
|
-
t.staleTime = typeof
|
|
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
|
-
},
|
|
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
|
|
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 =
|
|
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",
|
|
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
|
-
),
|
|
1120
|
+
), h = u.getOptimisticResult(o), l = !r && t.subscribed !== !1;
|
|
1048
1121
|
if (w.useSyncExternalStore(
|
|
1049
1122
|
w.useCallback(
|
|
1050
|
-
(
|
|
1051
|
-
const f =
|
|
1123
|
+
(p) => {
|
|
1124
|
+
const f = l ? u.subscribe(Z.batchCalls(p)) : P;
|
|
1052
1125
|
return u.updateResult(), f;
|
|
1053
1126
|
},
|
|
1054
|
-
[u,
|
|
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]),
|
|
1061
|
-
throw
|
|
1062
|
-
if (
|
|
1063
|
-
result:
|
|
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
|
|
1142
|
+
throw h.error;
|
|
1070
1143
|
return a.getDefaultOptions().queries?._experimental_afterQuery?.(
|
|
1071
1144
|
o,
|
|
1072
|
-
|
|
1073
|
-
), o.experimental_prefetchInRender && !F &&
|
|
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
|
-
|
|
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(
|
|
1152
|
+
))?.catch(P).finally(() => {
|
|
1080
1153
|
u.updateResult();
|
|
1081
|
-
}), o.notifyOnChangeProps ?
|
|
1154
|
+
}), o.notifyOnChangeProps ? h : u.trackResult(h);
|
|
1082
1155
|
}
|
|
1083
|
-
function
|
|
1084
|
-
return
|
|
1156
|
+
function ne(t, e) {
|
|
1157
|
+
return gt(t, pt, e);
|
|
1085
1158
|
}
|
|
1086
|
-
function
|
|
1087
|
-
return process.env.NODE_ENV !== "production" && t.queryFn === j && console.error("skipToken is not allowed for useSuspenseQuery"),
|
|
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:
|
|
1165
|
+
throwOnError: te,
|
|
1093
1166
|
placeholderData: void 0
|
|
1094
1167
|
},
|
|
1095
|
-
|
|
1168
|
+
pt,
|
|
1096
1169
|
e
|
|
1097
1170
|
);
|
|
1098
1171
|
}
|
|
1099
|
-
const
|
|
1172
|
+
const ut = (t) => {
|
|
1100
1173
|
let e;
|
|
1101
|
-
const s = /* @__PURE__ */ new Set(), r = (
|
|
1102
|
-
const
|
|
1103
|
-
if (!Object.is(
|
|
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 =
|
|
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: (
|
|
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
|
-
},
|
|
1110
|
-
function
|
|
1111
|
-
const s =
|
|
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
|
-
|
|
1114
|
-
|
|
1186
|
+
N.useCallback(() => e(t.getState()), [t, e]),
|
|
1187
|
+
N.useCallback(() => e(t.getInitialState()), [t, e])
|
|
1115
1188
|
);
|
|
1116
|
-
return
|
|
1189
|
+
return N.useDebugValue(s), s;
|
|
1117
1190
|
}
|
|
1118
|
-
const
|
|
1119
|
-
const e =
|
|
1191
|
+
const ce = (t) => {
|
|
1192
|
+
const e = ae(t), s = (r) => ue(e, r);
|
|
1120
1193
|
return Object.assign(s, e), s;
|
|
1121
|
-
},
|
|
1122
|
-
function
|
|
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
|
|
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
|
|
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
|
|
1229
|
+
return z(r)(s);
|
|
1157
1230
|
}
|
|
1158
1231
|
};
|
|
1159
1232
|
}
|
|
1160
|
-
},
|
|
1233
|
+
}, he = (t, e) => (s, r, n) => {
|
|
1161
1234
|
let a = {
|
|
1162
|
-
storage:
|
|
1235
|
+
storage: bt(() => localStorage),
|
|
1163
1236
|
partialize: (c) => c,
|
|
1164
1237
|
version: 0,
|
|
1165
|
-
merge: (c,
|
|
1166
|
-
...
|
|
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
|
|
1173
|
-
if (!
|
|
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
|
|
1256
|
+
const l = () => {
|
|
1184
1257
|
const c = a.partialize({ ...r() });
|
|
1185
|
-
return
|
|
1258
|
+
return h.setItem(a.name, {
|
|
1186
1259
|
state: c,
|
|
1187
1260
|
version: a.version
|
|
1188
1261
|
});
|
|
1189
|
-
},
|
|
1190
|
-
n.setState = (c,
|
|
1262
|
+
}, p = n.setState;
|
|
1263
|
+
n.setState = (c, m) => (p(c, m), l());
|
|
1191
1264
|
const f = t(
|
|
1192
|
-
(...c) => (s(...c),
|
|
1265
|
+
(...c) => (s(...c), l()),
|
|
1193
1266
|
r,
|
|
1194
1267
|
n
|
|
1195
1268
|
);
|
|
1196
1269
|
n.getInitialState = () => f;
|
|
1197
|
-
let
|
|
1270
|
+
let y;
|
|
1198
1271
|
const O = () => {
|
|
1199
|
-
var c,
|
|
1200
|
-
if (!
|
|
1201
|
-
o = !1, i.forEach((
|
|
1202
|
-
var
|
|
1203
|
-
return
|
|
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
|
|
1206
|
-
return
|
|
1207
|
-
if (
|
|
1208
|
-
if (typeof
|
|
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
|
|
1211
|
-
|
|
1212
|
-
|
|
1283
|
+
const v = a.migrate(
|
|
1284
|
+
d.state,
|
|
1285
|
+
d.version
|
|
1213
1286
|
);
|
|
1214
|
-
return
|
|
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,
|
|
1293
|
+
return [!1, d.state];
|
|
1221
1294
|
return [!1, void 0];
|
|
1222
|
-
}).then((
|
|
1223
|
-
var
|
|
1224
|
-
const [
|
|
1225
|
-
if (
|
|
1226
|
-
|
|
1227
|
-
(
|
|
1228
|
-
), s(
|
|
1229
|
-
return
|
|
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
|
-
|
|
1232
|
-
}).catch((
|
|
1233
|
-
|
|
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 && (
|
|
1314
|
+
}, c.storage && (h = c.storage);
|
|
1242
1315
|
},
|
|
1243
1316
|
clearStorage: () => {
|
|
1244
|
-
|
|
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(),
|
|
1256
|
-
},
|
|
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
|
-
},
|
|
1265
|
-
|
|
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:
|
|
1373
|
+
storage: bt(() => localStorage)
|
|
1301
1374
|
}
|
|
1302
1375
|
)
|
|
1303
1376
|
);
|
|
1304
|
-
|
|
1305
|
-
const
|
|
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),
|
|
1308
|
-
const e = t.join("/"), [, s = "", r = ""] = e.match(
|
|
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
|
-
},
|
|
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
|
-
},
|
|
1318
|
-
const e =
|
|
1319
|
-
return
|
|
1320
|
-
},
|
|
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
|
-
}),
|
|
1323
|
-
const t =
|
|
1324
|
-
return { invalidateCache:
|
|
1325
|
-
(s) => t.invalidateQueries({ queryKey:
|
|
1395
|
+
}), ge = () => {
|
|
1396
|
+
const t = vt();
|
|
1397
|
+
return { invalidateCache: Rt(
|
|
1398
|
+
(s) => t.invalidateQueries({ queryKey: wt[s] }),
|
|
1326
1399
|
[t]
|
|
1327
1400
|
) };
|
|
1328
|
-
},
|
|
1401
|
+
}, je = "no-dehydrate", Y = (t, e) => {
|
|
1329
1402
|
for (const s of t) {
|
|
1330
|
-
const r =
|
|
1403
|
+
const r = X(s, e);
|
|
1331
1404
|
if (r !== void 0) return r;
|
|
1332
1405
|
}
|
|
1333
|
-
},
|
|
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 =
|
|
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
|
-
},
|
|
1345
|
-
const t =
|
|
1346
|
-
return
|
|
1347
|
-
if (s.type === "doc" &&
|
|
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
|
-
},
|
|
1351
|
-
const e =
|
|
1352
|
-
return
|
|
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 &&
|
|
1428
|
+
return s.link && C(s.link.path) === e.pathname ? !0 : void 0;
|
|
1356
1429
|
case "custom-page":
|
|
1357
1430
|
case "doc":
|
|
1358
|
-
return
|
|
1431
|
+
return C(s.path) === e.pathname ? !0 : void 0;
|
|
1359
1432
|
default:
|
|
1360
1433
|
return;
|
|
1361
1434
|
}
|
|
1362
1435
|
});
|
|
1363
|
-
},
|
|
1364
|
-
const t =
|
|
1436
|
+
}, Me = () => {
|
|
1437
|
+
const t = U().pathname, { navigation: e } = Ot();
|
|
1365
1438
|
let s, r, n = !1;
|
|
1366
|
-
return
|
|
1367
|
-
const o = a.type === "doc" ?
|
|
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
|
-
},
|
|
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
|
-
),
|
|
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
|
-
),
|
|
1398
|
-
const t =
|
|
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
|
-
},
|
|
1403
|
-
const { getApiIdentities: t } =
|
|
1404
|
-
return
|
|
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]),
|
|
1479
|
+
}, [e, s]), ne({
|
|
1407
1480
|
queryFn: t,
|
|
1408
|
-
queryKey:
|
|
1481
|
+
queryKey: wt.API_IDENTITIES
|
|
1409
1482
|
});
|
|
1410
|
-
},
|
|
1483
|
+
}, G = (t) => {
|
|
1411
1484
|
switch (t.type) {
|
|
1412
1485
|
case "doc":
|
|
1413
|
-
return
|
|
1486
|
+
return C(t.path);
|
|
1414
1487
|
case "category":
|
|
1415
|
-
return t.link ?
|
|
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
|
|
1492
|
+
return C(t.path);
|
|
1420
1493
|
default:
|
|
1421
1494
|
return;
|
|
1422
1495
|
}
|
|
1423
|
-
},
|
|
1496
|
+
}, Se = (t) => {
|
|
1424
1497
|
const e = /* @__PURE__ */ new Set(), s = (r) => {
|
|
1425
1498
|
for (const n of r) {
|
|
1426
|
-
const a =
|
|
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
|
-
},
|
|
1432
|
-
const { getPluginNavigation: t, navigation: e } =
|
|
1433
|
-
if (
|
|
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 } =
|
|
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 =
|
|
1514
|
+
const o = Se(n);
|
|
1442
1515
|
a = e.flatMap((i) => {
|
|
1443
|
-
const u =
|
|
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) =>
|
|
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
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
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-
|
|
1581
|
+
//# sourceMappingURL=ZudokuContext-CDJYKqMY.js.map
|