zudoku 0.25.3 → 0.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/dev/handler.js +2 -2
- package/dist/cli/dev/handler.js.map +1 -1
- package/dist/config/config.d.ts +1 -0
- package/dist/config/loader.js +1 -1
- package/dist/config/loader.js.map +1 -1
- package/dist/config/validators/common.d.ts +39 -28
- package/dist/config/validators/common.js +1 -0
- package/dist/config/validators/common.js.map +1 -1
- package/dist/config/validators/icon-types.d.ts +1 -1
- package/dist/config/validators/validate.d.ts +17 -12
- package/dist/lib/authentication/providers/auth0.js +1 -1
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +1 -1
- package/dist/lib/authentication/providers/openid.js +10 -6
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/components/Autocomplete.d.ts +12 -0
- package/dist/lib/components/Autocomplete.js +47 -0
- package/dist/lib/components/Autocomplete.js.map +1 -0
- package/dist/lib/components/Header.js +3 -3
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/index.js +2 -2
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.js +1 -1
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js +8 -2
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +3 -0
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.d.ts +3 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +3 -2
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.d.ts +2 -1
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +2 -2
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +9 -6
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/SidecarBox.js +1 -1
- package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/SidecarExamples.d.ts +2 -1
- package/dist/lib/plugins/openapi/SidecarExamples.js +7 -4
- package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.d.ts +6 -0
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +12 -0
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/Headers.js +66 -4
- package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +5 -1
- package/dist/lib/plugins/openapi/playground/Playground.js +36 -11
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.js +20 -30
- package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.d.ts +2 -1
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.js +5 -3
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.js.map +1 -1
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js +49 -0
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js.map +1 -1
- package/dist/lib/plugins/openapi/post-processors/removeParameters.d.ts +10 -0
- package/dist/lib/plugins/openapi/post-processors/removeParameters.js +66 -0
- package/dist/lib/plugins/openapi/post-processors/removeParameters.js.map +1 -0
- package/dist/lib/plugins/openapi/post-processors/removeParameters.test.d.ts +1 -0
- package/dist/lib/plugins/openapi/post-processors/removeParameters.test.js +131 -0
- package/dist/lib/plugins/openapi/post-processors/removeParameters.test.js.map +1 -0
- package/dist/lib/plugins/openapi/schema/SchemaComponents.js +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaComponents.js.map +1 -1
- package/dist/lib/ui/Badge.d.ts +1 -1
- package/dist/lib/ui/Badge.js +1 -0
- package/dist/lib/ui/Badge.js.map +1 -1
- package/dist/lib/ui/Command.d.ts +9 -1
- package/dist/lib/ui/Command.js +5 -1
- package/dist/lib/ui/Command.js.map +1 -1
- package/dist/lib/util/joinUrl.d.ts +1 -0
- package/dist/lib/util/joinUrl.js +40 -0
- package/dist/lib/util/joinUrl.js.map +1 -0
- package/dist/vite/build.js +10 -10
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.js +4 -1
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/config.test.js +5 -1
- package/dist/vite/config.test.js.map +1 -1
- package/dist/vite/dev-server.js +4 -1
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/plugin-api.d.ts +1 -1
- package/dist/vite/plugin-api.js +23 -5
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-auth.js +4 -1
- package/dist/vite/plugin-auth.js.map +1 -1
- package/dist/vite/plugin-mdx.js +9 -4
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/prerender.d.ts +2 -2
- package/dist/vite/prerender.js +4 -4
- package/dist/vite/prerender.js.map +1 -1
- package/dist/zuplo/enrich-with-zuplo.d.ts +5 -0
- package/dist/zuplo/enrich-with-zuplo.js +184 -0
- package/dist/zuplo/enrich-with-zuplo.js.map +1 -0
- package/dist/zuplo/env.d.ts +1 -0
- package/dist/zuplo/env.js +3 -0
- package/dist/zuplo/env.js.map +1 -1
- package/dist/zuplo/policy-types.d.ts +33 -0
- package/dist/zuplo/policy-types.js +8 -0
- package/dist/zuplo/policy-types.js.map +1 -0
- package/dist/zuplo/with-zuplo-processors.d.ts +3 -0
- package/dist/zuplo/with-zuplo-processors.js +26 -0
- package/dist/zuplo/with-zuplo-processors.js.map +1 -0
- package/dist/zuplo/with-zuplo.d.ts +1 -2
- package/dist/zuplo/with-zuplo.js +6 -27
- package/dist/zuplo/with-zuplo.js.map +1 -1
- package/lib/{AnchorLink-DFZZbmvr.js → AnchorLink-bObQitZv.js} +3 -3
- package/lib/{AnchorLink-DFZZbmvr.js.map → AnchorLink-bObQitZv.js.map} +1 -1
- package/lib/{AuthenticationPlugin-D7G3me8L.js → AuthenticationPlugin-C9SwOxkc.js} +4 -4
- package/lib/{AuthenticationPlugin-D7G3me8L.js.map → AuthenticationPlugin-C9SwOxkc.js.map} +1 -1
- package/lib/{CategoryHeading-CBconmtI.js → CategoryHeading-MYL1u_6K.js} +3 -3
- package/lib/{CategoryHeading-CBconmtI.js.map → CategoryHeading-MYL1u_6K.js.map} +1 -1
- package/lib/{Markdown-CZDLNOFc.js → Markdown-DFN6p0J-.js} +1041 -1041
- package/lib/{Markdown-CZDLNOFc.js.map → Markdown-DFN6p0J-.js.map} +1 -1
- package/lib/{MdxPage-DKMbBROv.js → MdxPage-D9c4z09Q.js} +61 -56
- package/lib/MdxPage-D9c4z09Q.js.map +1 -0
- package/lib/{OperationList-B8bHMKme.js → OperationList-DGJWDx1G.js} +1264 -1244
- package/lib/OperationList-DGJWDx1G.js.map +1 -0
- package/lib/{Route-DYwKZ_c_.js → Route-VdmEyOD0.js} +5 -5
- package/lib/{Route-DYwKZ_c_.js.map → Route-VdmEyOD0.js.map} +1 -1
- package/lib/{Select-B_IxRUUC.js → Select-D3O7wISy.js} +36 -36
- package/lib/{Select-B_IxRUUC.js.map → Select-D3O7wISy.js.map} +1 -1
- package/lib/{SlotletProvider-pfc9oejW.js → SlotletProvider-_3zzX_g_.js} +53 -53
- package/lib/{SlotletProvider-pfc9oejW.js.map → SlotletProvider-_3zzX_g_.js.map} +1 -1
- package/lib/{Button-DeAoTouo.js → Spinner-BlzrEEk1.js} +16 -13
- package/lib/Spinner-BlzrEEk1.js.map +1 -0
- package/lib/{SyntaxHighlight-Bz-lOJtH.js → SyntaxHighlight-CJCSPG1F.js} +297 -301
- package/lib/{SyntaxHighlight-Bz-lOJtH.js.map → SyntaxHighlight-CJCSPG1F.js.map} +1 -1
- package/lib/{ZudokuContext-hmLMUdf2.js → ZudokuContext-DeQZEp-x.js} +357 -356
- package/lib/ZudokuContext-DeQZEp-x.js.map +1 -0
- package/lib/{chunk-D52XG6IA-Dl7HLe6j.js → chunk-SYFQ2XB5-BF5IDYrB.js} +410 -412
- package/lib/chunk-SYFQ2XB5-BF5IDYrB.js.map +1 -0
- package/lib/context-rwLGh-6_.js +22 -0
- package/lib/{context-h_UkBLvr.js.map → context-rwLGh-6_.js.map} +1 -1
- package/lib/{createServer-BznDkeSA.js → createServer-BcaswoFO.js} +1274 -1286
- package/lib/createServer-BcaswoFO.js.map +1 -0
- package/lib/{hook-CHq7pFyz.js → hook-BRQEDRbn.js} +17 -17
- package/lib/{hook-CHq7pFyz.js.map → hook-BRQEDRbn.js.map} +1 -1
- package/lib/index-B7mqiOei.js +509 -0
- package/lib/index-B7mqiOei.js.map +1 -0
- package/lib/index-CXRrqOIl.js +1750 -0
- package/lib/index-CXRrqOIl.js.map +1 -0
- package/lib/index-Djenk2Hj.js +36 -0
- package/lib/{index-CPNSgwSb.js.map → index-Djenk2Hj.js.map} +1 -1
- package/lib/{index-CBXSgjaE.js → index-Dl3Yl0yb.js} +65 -69
- package/lib/index-Dl3Yl0yb.js.map +1 -0
- package/lib/{index.esm-BSV1C092.js → index.esm-9-TF9KQB.js} +52 -52
- package/lib/{index.esm-BSV1C092.js.map → index.esm-9-TF9KQB.js.map} +1 -1
- package/lib/index.esm-CrSoEshU.js +1207 -0
- package/lib/index.esm-CrSoEshU.js.map +1 -0
- package/lib/joinUrl-BTy9bvoK.js +20 -0
- package/lib/joinUrl-BTy9bvoK.js.map +1 -0
- package/lib/{jsx-runtime-Dx-03ztt.js → jsx-runtime-Bdg6XQ1m.js} +135 -135
- package/lib/{jsx-runtime-Dx-03ztt.js.map → jsx-runtime-Bdg6XQ1m.js.map} +1 -1
- package/lib/post-processors/removeExtensions.js +7 -7
- package/lib/post-processors/removeExtensions.js.map +1 -1
- package/lib/post-processors/removeParameters.js +48 -0
- package/lib/post-processors/removeParameters.js.map +1 -0
- package/lib/{prism-bash.min-DadFsM4Z.js → prism-bash.min-HHIMdNJ_.js} +4 -4
- package/lib/{prism-bash.min-DadFsM4Z.js.map → prism-bash.min-HHIMdNJ_.js.map} +1 -1
- package/lib/{prism-csharp.min-DUwvItt4.js → prism-csharp.min-bQAo2pmx.js} +33 -33
- package/lib/{prism-csharp.min-DUwvItt4.js.map → prism-csharp.min-bQAo2pmx.js.map} +1 -1
- package/lib/{prism-java.min-BtgBR4yd.js → prism-java.min-BpvsOuIa.js} +12 -12
- package/lib/{prism-java.min-BtgBR4yd.js.map → prism-java.min-BpvsOuIa.js.map} +1 -1
- package/lib/{prism-markdown.min-F3U-vPBi.js → prism-markdown.min-C0Qn0m-5.js} +30 -30
- package/lib/{prism-markdown.min-F3U-vPBi.js.map → prism-markdown.min-C0Qn0m-5.js.map} +1 -1
- package/lib/{prism-ruby.min-DeDXCp1r.js → prism-ruby.min-Dx9KO9ds.js} +16 -16
- package/lib/{prism-ruby.min-DeDXCp1r.js.map → prism-ruby.min-Dx9KO9ds.js.map} +1 -1
- package/lib/prism-typescript.min-CD7H2IYQ.js.map +1 -1
- package/lib/state-mM7uaXTW.js +202 -0
- package/lib/state-mM7uaXTW.js.map +1 -0
- package/lib/ui/Accordion.js +1 -1
- package/lib/ui/ActionButton.js +10 -11
- package/lib/ui/ActionButton.js.map +1 -1
- package/lib/ui/Alert.js +2 -2
- package/lib/ui/AlertDialog.js +1 -1
- package/lib/ui/Badge.js +3 -2
- package/lib/ui/Badge.js.map +1 -1
- package/lib/ui/Breadcrumb.js +1 -1
- package/lib/ui/Button.js +2 -2
- package/lib/ui/Callout.js +1 -1
- package/lib/ui/Card.js +1 -1
- package/lib/ui/Carousel.js +3 -3
- package/lib/ui/Carousel.js.map +1 -1
- package/lib/ui/Checkbox.js +2 -2
- package/lib/ui/Command.js +125 -13
- package/lib/ui/Command.js.map +1 -1
- package/lib/ui/Dialog.js +1 -1
- package/lib/ui/Drawer.js +520 -519
- package/lib/ui/Drawer.js.map +1 -1
- package/lib/ui/DropdownMenu.js +1 -1
- package/lib/ui/Form.js +2 -2
- package/lib/ui/HoverCard.js +1 -1
- package/lib/ui/Input.js +1 -1
- package/lib/ui/Label.js +2 -2
- package/lib/ui/Pagination.js +7 -7
- 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/Select.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/Tabs.js +1 -1
- package/lib/ui/Textarea.js +1 -1
- package/lib/ui/Toggle.js +2 -2
- package/lib/ui/ToggleGroup.js +1 -1
- package/lib/ui/Tooltip.js +1 -1
- package/lib/{useExposedProps-DE9lR6MF.js → useExposedProps-CetwhZpP.js} +2 -2
- package/lib/{useExposedProps-DE9lR6MF.js.map → useExposedProps-CetwhZpP.js.map} +1 -1
- package/lib/zudoku.auth-auth0.js +8 -10
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +18 -18
- package/lib/zudoku.auth-openid.js +225 -221
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +476 -461
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.plugin-api-catalog.js +5 -5
- package/lib/zudoku.plugin-api-keys.js +7 -7
- package/lib/zudoku.plugin-custom-pages.js +3 -3
- package/lib/zudoku.plugin-markdown.js +2 -2
- package/lib/zudoku.plugin-openapi.js +5 -5
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/lib/zudoku.plugin-search-inkeep.js +9 -9
- package/package.json +48 -48
- package/src/app/main.css +50 -50
- package/src/lib/authentication/providers/auth0.tsx +1 -4
- package/src/lib/authentication/providers/openid.tsx +12 -5
- package/src/lib/components/Autocomplete.tsx +111 -0
- package/src/lib/components/Header.tsx +3 -3
- package/src/lib/components/index.ts +2 -2
- package/src/lib/components/navigation/SidebarCategory.tsx +2 -2
- package/src/lib/plugins/markdown/MdxPage.tsx +9 -1
- package/src/lib/plugins/openapi/OperationList.tsx +4 -0
- package/src/lib/plugins/openapi/ParameterListItem.tsx +1 -5
- package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +5 -0
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +8 -2
- package/src/lib/plugins/openapi/Sidecar.tsx +15 -7
- package/src/lib/plugins/openapi/SidecarBox.tsx +1 -1
- package/src/lib/plugins/openapi/SidecarExamples.tsx +14 -6
- package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +51 -0
- package/src/lib/plugins/openapi/playground/Headers.tsx +138 -41
- package/src/lib/plugins/openapi/playground/Playground.tsx +156 -62
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +89 -122
- package/src/lib/plugins/openapi/post-processors/removeExtensions.test.ts +58 -0
- package/src/lib/plugins/openapi/post-processors/removeExtensions.ts +7 -4
- package/src/lib/plugins/openapi/post-processors/removeParameters.test.ts +148 -0
- package/src/lib/plugins/openapi/post-processors/removeParameters.ts +101 -0
- package/src/lib/plugins/openapi/schema/SchemaComponents.tsx +1 -1
- package/src/lib/ui/Badge.tsx +1 -0
- package/src/lib/ui/Command.tsx +20 -0
- package/src/lib/util/joinUrl.ts +57 -0
- package/dist/lib/plugins/openapi/playground/EnumSelector.d.ts +0 -8
- package/dist/lib/plugins/openapi/playground/EnumSelector.js +0 -21
- package/dist/lib/plugins/openapi/playground/EnumSelector.js.map +0 -1
- package/lib/Button-DeAoTouo.js.map +0 -1
- package/lib/Command-9x_kZHr4.js +0 -611
- package/lib/Command-9x_kZHr4.js.map +0 -1
- package/lib/MdxPage-DKMbBROv.js.map +0 -1
- package/lib/OperationList-B8bHMKme.js.map +0 -1
- package/lib/Spinner-DuxJLLNE.js +0 -7
- package/lib/Spinner-DuxJLLNE.js.map +0 -1
- package/lib/ZudokuContext-hmLMUdf2.js.map +0 -1
- package/lib/chunk-D52XG6IA-Dl7HLe6j.js.map +0 -1
- package/lib/context-h_UkBLvr.js +0 -22
- package/lib/createServer-BznDkeSA.js.map +0 -1
- package/lib/index-CBXSgjaE.js.map +0 -1
- package/lib/index-CPNSgwSb.js +0 -36
- package/lib/index-sD8L1_Dl.js +0 -1292
- package/lib/index-sD8L1_Dl.js.map +0 -1
- package/lib/index.esm-BnnBRKJX.js +0 -1214
- package/lib/index.esm-BnnBRKJX.js.map +0 -1
- package/lib/state-CFQsUZUP.js +0 -202
- package/lib/state-CFQsUZUP.js.map +0 -1
- package/src/lib/plugins/openapi/playground/EnumSelector.tsx +0 -86
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var _e = (t) => {
|
|
2
2
|
throw TypeError(t);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var me = (t, e, s) => e.has(t) || _e("Cannot " + s);
|
|
5
|
+
var n = (t, e, s) => (me(t, e, "read from private field"), s ? s.call(t) : e.get(t)), f = (t, e, s) => e.has(t) ? _e("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), c = (t, e, s, r) => (me(t, e, "write to private field"), r ? r.call(t, s) : e.set(t, s), s), m = (t, e, s) => (me(t, e, "access private method"), s);
|
|
6
6
|
import * as T from "react";
|
|
7
7
|
import { createContext as ft, useContext as yt } from "react";
|
|
8
|
-
import { j as pt } from "./jsx-runtime-
|
|
9
|
-
import { u as pe, m as
|
|
8
|
+
import { j as pt } from "./jsx-runtime-Bdg6XQ1m.js";
|
|
9
|
+
import { u as pe, m as bt } from "./chunk-SYFQ2XB5-BF5IDYrB.js";
|
|
10
10
|
var Qe = class {
|
|
11
11
|
constructor() {
|
|
12
12
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
@@ -29,7 +29,7 @@ function ge() {
|
|
|
29
29
|
function Zt(t, e) {
|
|
30
30
|
return typeof t == "function" ? t(e) : t;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function Se(t) {
|
|
33
33
|
return typeof t == "number" && t >= 0 && t !== 1 / 0;
|
|
34
34
|
}
|
|
35
35
|
function et(t, e) {
|
|
@@ -45,14 +45,14 @@ function Wt(t, e) {
|
|
|
45
45
|
const {
|
|
46
46
|
type: s = "all",
|
|
47
47
|
exact: r,
|
|
48
|
-
fetchStatus:
|
|
49
|
-
predicate:
|
|
48
|
+
fetchStatus: i,
|
|
49
|
+
predicate: o,
|
|
50
50
|
queryKey: a,
|
|
51
|
-
stale:
|
|
51
|
+
stale: u
|
|
52
52
|
} = t;
|
|
53
53
|
if (a) {
|
|
54
54
|
if (r) {
|
|
55
|
-
if (e.queryHash !==
|
|
55
|
+
if (e.queryHash !== mt(a, e.options))
|
|
56
56
|
return !1;
|
|
57
57
|
} else if (!qe(e.queryKey, a))
|
|
58
58
|
return !1;
|
|
@@ -62,28 +62,28 @@ function Wt(t, e) {
|
|
|
62
62
|
if (s === "active" && !l || s === "inactive" && l)
|
|
63
63
|
return !1;
|
|
64
64
|
}
|
|
65
|
-
return !(typeof
|
|
65
|
+
return !(typeof u == "boolean" && e.isStale() !== u || i && i !== e.state.fetchStatus || o && !o(e));
|
|
66
66
|
}
|
|
67
67
|
function Jt(t, e) {
|
|
68
|
-
const { exact: s, status: r, predicate:
|
|
69
|
-
if (
|
|
68
|
+
const { exact: s, status: r, predicate: i, mutationKey: o } = t;
|
|
69
|
+
if (o) {
|
|
70
70
|
if (!e.options.mutationKey)
|
|
71
71
|
return !1;
|
|
72
72
|
if (s) {
|
|
73
|
-
if (
|
|
73
|
+
if (Re(e.options.mutationKey) !== Re(o))
|
|
74
74
|
return !1;
|
|
75
|
-
} else if (!qe(e.options.mutationKey,
|
|
75
|
+
} else if (!qe(e.options.mutationKey, o))
|
|
76
76
|
return !1;
|
|
77
77
|
}
|
|
78
|
-
return !(r && e.state.status !== r ||
|
|
78
|
+
return !(r && e.state.status !== r || i && !i(e));
|
|
79
79
|
}
|
|
80
|
-
function
|
|
81
|
-
return ((e == null ? void 0 : e.queryKeyHashFn) ||
|
|
80
|
+
function mt(t, e) {
|
|
81
|
+
return ((e == null ? void 0 : e.queryKeyHashFn) || Re)(t);
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function Re(t) {
|
|
84
84
|
return JSON.stringify(
|
|
85
85
|
t,
|
|
86
|
-
(e, s) => Ee(s) ? Object.keys(s).sort().reduce((r,
|
|
86
|
+
(e, s) => Ee(s) ? Object.keys(s).sort().reduce((r, i) => (r[i] = s[i], r), {}) : s
|
|
87
87
|
);
|
|
88
88
|
}
|
|
89
89
|
function qe(t, e) {
|
|
@@ -94,13 +94,13 @@ function Ce(t, e) {
|
|
|
94
94
|
return t;
|
|
95
95
|
const s = He(t) && He(e);
|
|
96
96
|
if (s || Ee(t) && Ee(e)) {
|
|
97
|
-
const r = s ? t : Object.keys(t),
|
|
97
|
+
const r = s ? t : Object.keys(t), i = r.length, o = s ? e : Object.keys(e), a = o.length, u = s ? [] : {};
|
|
98
98
|
let l = 0;
|
|
99
|
-
for (let
|
|
100
|
-
const v = s ?
|
|
101
|
-
(!s && r.includes(v) || s) && t[v] === void 0 && e[v] === void 0 ? (
|
|
99
|
+
for (let S = 0; S < a; S++) {
|
|
100
|
+
const v = s ? S : o[S];
|
|
101
|
+
(!s && r.includes(v) || s) && t[v] === void 0 && e[v] === void 0 ? (u[v] = void 0, l++) : (u[v] = Ce(t[v], e[v]), u[v] === t[v] && t[v] !== void 0 && l++);
|
|
102
102
|
}
|
|
103
|
-
return
|
|
103
|
+
return i === a && l === i ? t : u;
|
|
104
104
|
}
|
|
105
105
|
return e;
|
|
106
106
|
}
|
|
@@ -127,7 +127,7 @@ function Ee(t) {
|
|
|
127
127
|
function Be(t) {
|
|
128
128
|
return Object.prototype.toString.call(t) === "[object Object]";
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function vt(t) {
|
|
131
131
|
return new Promise((e) => {
|
|
132
132
|
setTimeout(e, t);
|
|
133
133
|
});
|
|
@@ -162,12 +162,12 @@ function gt(t, e) {
|
|
|
162
162
|
`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${t.queryHash}'`
|
|
163
163
|
), !t.queryFn && (e != null && e.initialPromise) ? () => e.initialPromise : !t.queryFn || t.queryFn === ye ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn;
|
|
164
164
|
}
|
|
165
|
-
var K, q, J, Ze,
|
|
165
|
+
var K, q, J, Ze, St = (Ze = class extends Qe {
|
|
166
166
|
constructor() {
|
|
167
167
|
super();
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
168
|
+
f(this, K);
|
|
169
|
+
f(this, q);
|
|
170
|
+
f(this, J);
|
|
171
171
|
c(this, J, (e) => {
|
|
172
172
|
if (!V && window.addEventListener) {
|
|
173
173
|
const s = () => e();
|
|
@@ -178,20 +178,20 @@ var K, q, J, Ze, Rt = (Ze = class extends Qe {
|
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
180
|
onSubscribe() {
|
|
181
|
-
|
|
181
|
+
n(this, q) || this.setEventListener(n(this, J));
|
|
182
182
|
}
|
|
183
183
|
onUnsubscribe() {
|
|
184
184
|
var e;
|
|
185
|
-
this.hasListeners() || ((e =
|
|
185
|
+
this.hasListeners() || ((e = n(this, q)) == null || e.call(this), c(this, q, void 0));
|
|
186
186
|
}
|
|
187
187
|
setEventListener(e) {
|
|
188
188
|
var s;
|
|
189
|
-
c(this, J, e), (s =
|
|
189
|
+
c(this, J, e), (s = n(this, q)) == null || s.call(this), c(this, q, e((r) => {
|
|
190
190
|
typeof r == "boolean" ? this.setFocused(r) : this.onFocus();
|
|
191
191
|
}));
|
|
192
192
|
}
|
|
193
193
|
setFocused(e) {
|
|
194
|
-
|
|
194
|
+
n(this, K) !== e && (c(this, K, e), this.onFocus());
|
|
195
195
|
}
|
|
196
196
|
onFocus() {
|
|
197
197
|
const e = this.isFocused();
|
|
@@ -201,14 +201,14 @@ var K, q, J, Ze, Rt = (Ze = class extends Qe {
|
|
|
201
201
|
}
|
|
202
202
|
isFocused() {
|
|
203
203
|
var e;
|
|
204
|
-
return typeof
|
|
204
|
+
return typeof n(this, K) == "boolean" ? n(this, K) : ((e = globalThis.document) == null ? void 0 : e.visibilityState) !== "hidden";
|
|
205
205
|
}
|
|
206
|
-
}, K = new WeakMap(), q = new WeakMap(), J = new WeakMap(), Ze), tt = new
|
|
206
|
+
}, K = new WeakMap(), q = new WeakMap(), J = new WeakMap(), Ze), tt = new St(), X, A, Y, We, Rt = (We = class extends Qe {
|
|
207
207
|
constructor() {
|
|
208
208
|
super();
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
209
|
+
f(this, X, !0);
|
|
210
|
+
f(this, A);
|
|
211
|
+
f(this, Y);
|
|
212
212
|
c(this, Y, (e) => {
|
|
213
213
|
if (!V && window.addEventListener) {
|
|
214
214
|
const s = () => e(!0), r = () => e(!1);
|
|
@@ -219,45 +219,45 @@ var K, q, J, Ze, Rt = (Ze = class extends Qe {
|
|
|
219
219
|
});
|
|
220
220
|
}
|
|
221
221
|
onSubscribe() {
|
|
222
|
-
|
|
222
|
+
n(this, A) || this.setEventListener(n(this, Y));
|
|
223
223
|
}
|
|
224
224
|
onUnsubscribe() {
|
|
225
225
|
var e;
|
|
226
|
-
this.hasListeners() || ((e =
|
|
226
|
+
this.hasListeners() || ((e = n(this, A)) == null || e.call(this), c(this, A, void 0));
|
|
227
227
|
}
|
|
228
228
|
setEventListener(e) {
|
|
229
229
|
var s;
|
|
230
|
-
c(this, Y, e), (s =
|
|
230
|
+
c(this, Y, e), (s = n(this, A)) == null || s.call(this), c(this, A, e(this.setOnline.bind(this)));
|
|
231
231
|
}
|
|
232
232
|
setOnline(e) {
|
|
233
|
-
|
|
233
|
+
n(this, X) !== e && (c(this, X, e), this.listeners.forEach((r) => {
|
|
234
234
|
r(e);
|
|
235
235
|
}));
|
|
236
236
|
}
|
|
237
237
|
isOnline() {
|
|
238
|
-
return
|
|
238
|
+
return n(this, X);
|
|
239
239
|
}
|
|
240
|
-
}, X = new WeakMap(), A = new WeakMap(), Y = new WeakMap(), We), st = new
|
|
240
|
+
}, X = new WeakMap(), A = new WeakMap(), Y = new WeakMap(), We), st = new Rt();
|
|
241
241
|
function Fe() {
|
|
242
242
|
let t, e;
|
|
243
|
-
const s = new Promise((
|
|
244
|
-
t =
|
|
243
|
+
const s = new Promise((i, o) => {
|
|
244
|
+
t = i, e = o;
|
|
245
245
|
});
|
|
246
246
|
s.status = "pending", s.catch(() => {
|
|
247
247
|
});
|
|
248
|
-
function r(
|
|
249
|
-
Object.assign(s,
|
|
248
|
+
function r(i) {
|
|
249
|
+
Object.assign(s, i), delete s.resolve, delete s.reject;
|
|
250
250
|
}
|
|
251
|
-
return s.resolve = (
|
|
251
|
+
return s.resolve = (i) => {
|
|
252
252
|
r({
|
|
253
253
|
status: "fulfilled",
|
|
254
|
-
value:
|
|
255
|
-
}), t(
|
|
256
|
-
}, s.reject = (
|
|
254
|
+
value: i
|
|
255
|
+
}), t(i);
|
|
256
|
+
}, s.reject = (i) => {
|
|
257
257
|
r({
|
|
258
258
|
status: "rejected",
|
|
259
|
-
reason:
|
|
260
|
-
}), e(
|
|
259
|
+
reason: i
|
|
260
|
+
}), e(i);
|
|
261
261
|
}, s;
|
|
262
262
|
}
|
|
263
263
|
function Ct(t) {
|
|
@@ -266,97 +266,97 @@ function Ct(t) {
|
|
|
266
266
|
function rt(t) {
|
|
267
267
|
return (t ?? "online") === "online" ? st.isOnline() : !0;
|
|
268
268
|
}
|
|
269
|
-
var
|
|
269
|
+
var nt = class extends Error {
|
|
270
270
|
constructor(t) {
|
|
271
271
|
super("CancelledError"), this.revert = t == null ? void 0 : t.revert, this.silent = t == null ? void 0 : t.silent;
|
|
272
272
|
}
|
|
273
273
|
};
|
|
274
|
-
function
|
|
275
|
-
return t instanceof
|
|
274
|
+
function ve(t) {
|
|
275
|
+
return t instanceof nt;
|
|
276
276
|
}
|
|
277
277
|
function wt(t) {
|
|
278
|
-
let e = !1, s = 0, r = !1,
|
|
279
|
-
const
|
|
280
|
-
var
|
|
281
|
-
r || (
|
|
282
|
-
},
|
|
278
|
+
let e = !1, s = 0, r = !1, i;
|
|
279
|
+
const o = Fe(), a = (b) => {
|
|
280
|
+
var p;
|
|
281
|
+
r || (R(new nt(b)), (p = t.abort) == null || p.call(t));
|
|
282
|
+
}, u = () => {
|
|
283
283
|
e = !0;
|
|
284
284
|
}, l = () => {
|
|
285
285
|
e = !1;
|
|
286
|
-
},
|
|
287
|
-
var
|
|
288
|
-
r || (r = !0, (
|
|
289
|
-
},
|
|
290
|
-
var
|
|
291
|
-
r || (r = !0, (
|
|
292
|
-
},
|
|
293
|
-
var
|
|
294
|
-
|
|
295
|
-
(r ||
|
|
296
|
-
}, (
|
|
286
|
+
}, S = () => tt.isFocused() && (t.networkMode === "always" || st.isOnline()) && t.canRun(), v = () => rt(t.networkMode) && t.canRun(), h = (b) => {
|
|
287
|
+
var p;
|
|
288
|
+
r || (r = !0, (p = t.onSuccess) == null || p.call(t, b), i == null || i(), o.resolve(b));
|
|
289
|
+
}, R = (b) => {
|
|
290
|
+
var p;
|
|
291
|
+
r || (r = !0, (p = t.onError) == null || p.call(t, b), i == null || i(), o.reject(b));
|
|
292
|
+
}, g = () => new Promise((b) => {
|
|
293
|
+
var p;
|
|
294
|
+
i = (E) => {
|
|
295
|
+
(r || S()) && b(E);
|
|
296
|
+
}, (p = t.onPause) == null || p.call(t);
|
|
297
297
|
}).then(() => {
|
|
298
|
-
var
|
|
299
|
-
|
|
298
|
+
var b;
|
|
299
|
+
i = void 0, r || (b = t.onContinue) == null || b.call(t);
|
|
300
300
|
}), w = () => {
|
|
301
301
|
if (r)
|
|
302
302
|
return;
|
|
303
|
-
let
|
|
304
|
-
const
|
|
303
|
+
let b;
|
|
304
|
+
const p = s === 0 ? t.initialPromise : void 0;
|
|
305
305
|
try {
|
|
306
|
-
|
|
307
|
-
} catch (
|
|
308
|
-
|
|
306
|
+
b = p ?? t.fn();
|
|
307
|
+
} catch (E) {
|
|
308
|
+
b = Promise.reject(E);
|
|
309
309
|
}
|
|
310
|
-
Promise.resolve(
|
|
311
|
-
var
|
|
310
|
+
Promise.resolve(b).then(h).catch((E) => {
|
|
311
|
+
var be;
|
|
312
312
|
if (r)
|
|
313
313
|
return;
|
|
314
|
-
const U = t.retry ?? (V ? 0 : 3), N = t.retryDelay ?? Ct, ce = typeof N == "function" ? N(s,
|
|
314
|
+
const U = t.retry ?? (V ? 0 : 3), N = t.retryDelay ?? Ct, ce = typeof N == "function" ? N(s, E) : N, le = U === !0 || typeof U == "number" && s < U || typeof U == "function" && U(s, E);
|
|
315
315
|
if (e || !le) {
|
|
316
|
-
|
|
316
|
+
R(E);
|
|
317
317
|
return;
|
|
318
318
|
}
|
|
319
|
-
s++, (
|
|
320
|
-
e ?
|
|
319
|
+
s++, (be = t.onFail) == null || be.call(t, s, E), vt(ce).then(() => S() ? void 0 : g()).then(() => {
|
|
320
|
+
e ? R(E) : w();
|
|
321
321
|
});
|
|
322
322
|
});
|
|
323
323
|
};
|
|
324
324
|
return {
|
|
325
|
-
promise:
|
|
325
|
+
promise: o,
|
|
326
326
|
cancel: a,
|
|
327
|
-
continue: () => (
|
|
328
|
-
cancelRetry:
|
|
327
|
+
continue: () => (i == null || i(), o),
|
|
328
|
+
cancelRetry: u,
|
|
329
329
|
continueRetry: l,
|
|
330
330
|
canStart: v,
|
|
331
|
-
start: () => (v() ? w() :
|
|
331
|
+
start: () => (v() ? w() : g().then(w), o)
|
|
332
332
|
};
|
|
333
333
|
}
|
|
334
334
|
function Et() {
|
|
335
|
-
let t = [], e = 0, s = (
|
|
336
|
-
|
|
337
|
-
}, r = (
|
|
338
|
-
|
|
339
|
-
},
|
|
340
|
-
const
|
|
341
|
-
e ? t.push(
|
|
342
|
-
s(
|
|
335
|
+
let t = [], e = 0, s = (u) => {
|
|
336
|
+
u();
|
|
337
|
+
}, r = (u) => {
|
|
338
|
+
u();
|
|
339
|
+
}, i = (u) => setTimeout(u, 0);
|
|
340
|
+
const o = (u) => {
|
|
341
|
+
e ? t.push(u) : i(() => {
|
|
342
|
+
s(u);
|
|
343
343
|
});
|
|
344
344
|
}, a = () => {
|
|
345
|
-
const
|
|
346
|
-
t = [],
|
|
345
|
+
const u = t;
|
|
346
|
+
t = [], u.length && i(() => {
|
|
347
347
|
r(() => {
|
|
348
|
-
|
|
348
|
+
u.forEach((l) => {
|
|
349
349
|
s(l);
|
|
350
350
|
});
|
|
351
351
|
});
|
|
352
352
|
});
|
|
353
353
|
};
|
|
354
354
|
return {
|
|
355
|
-
batch: (
|
|
355
|
+
batch: (u) => {
|
|
356
356
|
let l;
|
|
357
357
|
e++;
|
|
358
358
|
try {
|
|
359
|
-
l =
|
|
359
|
+
l = u();
|
|
360
360
|
} finally {
|
|
361
361
|
e--, e || a();
|
|
362
362
|
}
|
|
@@ -365,40 +365,40 @@ function Et() {
|
|
|
365
365
|
/**
|
|
366
366
|
* All calls to the wrapped function will be batched.
|
|
367
367
|
*/
|
|
368
|
-
batchCalls: (
|
|
369
|
-
|
|
370
|
-
|
|
368
|
+
batchCalls: (u) => (...l) => {
|
|
369
|
+
o(() => {
|
|
370
|
+
u(...l);
|
|
371
371
|
});
|
|
372
372
|
},
|
|
373
|
-
schedule:
|
|
373
|
+
schedule: o,
|
|
374
374
|
/**
|
|
375
375
|
* Use this method to set a custom notify function.
|
|
376
376
|
* This can be used to for example wrap notifications with `React.act` while running tests.
|
|
377
377
|
*/
|
|
378
|
-
setNotifyFunction: (
|
|
379
|
-
s =
|
|
378
|
+
setNotifyFunction: (u) => {
|
|
379
|
+
s = u;
|
|
380
380
|
},
|
|
381
381
|
/**
|
|
382
382
|
* Use this method to set a custom function to batch notifications together into a single tick.
|
|
383
383
|
* By default React Query will use the batch function provided by ReactDOM or React Native.
|
|
384
384
|
*/
|
|
385
|
-
setBatchNotifyFunction: (
|
|
386
|
-
r =
|
|
385
|
+
setBatchNotifyFunction: (u) => {
|
|
386
|
+
r = u;
|
|
387
387
|
},
|
|
388
|
-
setScheduler: (
|
|
389
|
-
|
|
388
|
+
setScheduler: (u) => {
|
|
389
|
+
i = u;
|
|
390
390
|
}
|
|
391
391
|
};
|
|
392
392
|
}
|
|
393
393
|
var Ae = Et(), _, Je, Ot = (Je = class {
|
|
394
394
|
constructor() {
|
|
395
|
-
|
|
395
|
+
f(this, _);
|
|
396
396
|
}
|
|
397
397
|
destroy() {
|
|
398
398
|
this.clearGcTimeout();
|
|
399
399
|
}
|
|
400
400
|
scheduleGc() {
|
|
401
|
-
this.clearGcTimeout(),
|
|
401
|
+
this.clearGcTimeout(), Se(this.gcTime) && c(this, _, setTimeout(() => {
|
|
402
402
|
this.optionalRemove();
|
|
403
403
|
}, this.gcTime));
|
|
404
404
|
}
|
|
@@ -409,36 +409,36 @@ var Ae = Et(), _, Je, Ot = (Je = class {
|
|
|
409
409
|
);
|
|
410
410
|
}
|
|
411
411
|
clearGcTimeout() {
|
|
412
|
-
|
|
412
|
+
n(this, _) && (clearTimeout(n(this, _)), c(this, _, void 0));
|
|
413
413
|
}
|
|
414
|
-
}, _ = new WeakMap(), Je), ee, te, I, C,
|
|
414
|
+
}, _ = new WeakMap(), Je), ee, te, I, C, ue, H, D, Q, Xe, es = (Xe = class extends Ot {
|
|
415
415
|
constructor(e) {
|
|
416
416
|
super();
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
c(this, H, !1), c(this,
|
|
417
|
+
f(this, D);
|
|
418
|
+
f(this, ee);
|
|
419
|
+
f(this, te);
|
|
420
|
+
f(this, I);
|
|
421
|
+
f(this, C);
|
|
422
|
+
f(this, ue);
|
|
423
|
+
f(this, H);
|
|
424
|
+
c(this, H, !1), c(this, ue, e.defaultOptions), this.setOptions(e.options), this.observers = [], c(this, I, e.cache), this.queryKey = e.queryKey, this.queryHash = e.queryHash, c(this, ee, Ft(this.options)), this.state = e.state ?? n(this, ee), this.scheduleGc();
|
|
425
425
|
}
|
|
426
426
|
get meta() {
|
|
427
427
|
return this.options.meta;
|
|
428
428
|
}
|
|
429
429
|
get promise() {
|
|
430
430
|
var e;
|
|
431
|
-
return (e =
|
|
431
|
+
return (e = n(this, C)) == null ? void 0 : e.promise;
|
|
432
432
|
}
|
|
433
433
|
setOptions(e) {
|
|
434
|
-
this.options = { ...
|
|
434
|
+
this.options = { ...n(this, ue), ...e }, this.updateGcTime(this.options.gcTime);
|
|
435
435
|
}
|
|
436
436
|
optionalRemove() {
|
|
437
|
-
!this.observers.length && this.state.fetchStatus === "idle" &&
|
|
437
|
+
!this.observers.length && this.state.fetchStatus === "idle" && n(this, I).remove(this);
|
|
438
438
|
}
|
|
439
439
|
setData(e, s) {
|
|
440
440
|
const r = Oe(this.state.data, e, this.options);
|
|
441
|
-
return
|
|
441
|
+
return m(this, D, Q).call(this, {
|
|
442
442
|
data: r,
|
|
443
443
|
type: "success",
|
|
444
444
|
dataUpdatedAt: s == null ? void 0 : s.updatedAt,
|
|
@@ -446,18 +446,18 @@ var Ae = Et(), _, Je, Ot = (Je = class {
|
|
|
446
446
|
}), r;
|
|
447
447
|
}
|
|
448
448
|
setState(e, s) {
|
|
449
|
-
|
|
449
|
+
m(this, D, Q).call(this, { type: "setState", state: e, setStateOptions: s });
|
|
450
450
|
}
|
|
451
451
|
cancel(e) {
|
|
452
|
-
var r,
|
|
453
|
-
const s = (r =
|
|
454
|
-
return (
|
|
452
|
+
var r, i;
|
|
453
|
+
const s = (r = n(this, C)) == null ? void 0 : r.promise;
|
|
454
|
+
return (i = n(this, C)) == null || i.cancel(e), s ? s.then(ge).catch(ge) : Promise.resolve();
|
|
455
455
|
}
|
|
456
456
|
destroy() {
|
|
457
457
|
super.destroy(), this.cancel({ silent: !0 });
|
|
458
458
|
}
|
|
459
459
|
reset() {
|
|
460
|
-
this.destroy(), this.setState(
|
|
460
|
+
this.destroy(), this.setState(n(this, ee));
|
|
461
461
|
}
|
|
462
462
|
isActive() {
|
|
463
463
|
return this.observers.some(
|
|
@@ -478,76 +478,76 @@ var Ae = Et(), _, Je, Ot = (Je = class {
|
|
|
478
478
|
onFocus() {
|
|
479
479
|
var s;
|
|
480
480
|
const e = this.observers.find((r) => r.shouldFetchOnWindowFocus());
|
|
481
|
-
e == null || e.refetch({ cancelRefetch: !1 }), (s =
|
|
481
|
+
e == null || e.refetch({ cancelRefetch: !1 }), (s = n(this, C)) == null || s.continue();
|
|
482
482
|
}
|
|
483
483
|
onOnline() {
|
|
484
484
|
var s;
|
|
485
485
|
const e = this.observers.find((r) => r.shouldFetchOnReconnect());
|
|
486
|
-
e == null || e.refetch({ cancelRefetch: !1 }), (s =
|
|
486
|
+
e == null || e.refetch({ cancelRefetch: !1 }), (s = n(this, C)) == null || s.continue();
|
|
487
487
|
}
|
|
488
488
|
addObserver(e) {
|
|
489
|
-
this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(),
|
|
489
|
+
this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(), n(this, I).notify({ type: "observerAdded", query: this, observer: e }));
|
|
490
490
|
}
|
|
491
491
|
removeObserver(e) {
|
|
492
|
-
this.observers.includes(e) && (this.observers = this.observers.filter((s) => s !== e), this.observers.length || (
|
|
492
|
+
this.observers.includes(e) && (this.observers = this.observers.filter((s) => s !== e), this.observers.length || (n(this, C) && (n(this, H) ? n(this, C).cancel({ revert: !0 }) : n(this, C).cancelRetry()), this.scheduleGc()), n(this, I).notify({ type: "observerRemoved", query: this, observer: e }));
|
|
493
493
|
}
|
|
494
494
|
getObserversCount() {
|
|
495
495
|
return this.observers.length;
|
|
496
496
|
}
|
|
497
497
|
invalidate() {
|
|
498
|
-
this.state.isInvalidated ||
|
|
498
|
+
this.state.isInvalidated || m(this, D, Q).call(this, { type: "invalidate" });
|
|
499
499
|
}
|
|
500
500
|
fetch(e, s) {
|
|
501
|
-
var l,
|
|
501
|
+
var l, S, v;
|
|
502
502
|
if (this.state.fetchStatus !== "idle") {
|
|
503
503
|
if (this.state.data !== void 0 && (s != null && s.cancelRefetch))
|
|
504
504
|
this.cancel({ silent: !0 });
|
|
505
|
-
else if (
|
|
506
|
-
return
|
|
505
|
+
else if (n(this, C))
|
|
506
|
+
return n(this, C).continueRetry(), n(this, C).promise;
|
|
507
507
|
}
|
|
508
508
|
if (e && this.setOptions(e), !this.options.queryFn) {
|
|
509
|
-
const h = this.observers.find((
|
|
509
|
+
const h = this.observers.find((R) => R.options.queryFn);
|
|
510
510
|
h && this.setOptions(h.options);
|
|
511
511
|
}
|
|
512
512
|
process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
|
|
513
513
|
"As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"
|
|
514
514
|
));
|
|
515
|
-
const r = new AbortController(),
|
|
515
|
+
const r = new AbortController(), i = (h) => {
|
|
516
516
|
Object.defineProperty(h, "signal", {
|
|
517
517
|
enumerable: !0,
|
|
518
518
|
get: () => (c(this, H, !0), r.signal)
|
|
519
519
|
});
|
|
520
|
-
},
|
|
521
|
-
const h = gt(this.options, s),
|
|
520
|
+
}, o = () => {
|
|
521
|
+
const h = gt(this.options, s), R = {
|
|
522
522
|
queryKey: this.queryKey,
|
|
523
523
|
meta: this.meta
|
|
524
524
|
};
|
|
525
|
-
return
|
|
525
|
+
return i(R), c(this, H, !1), this.options.persister ? this.options.persister(
|
|
526
526
|
h,
|
|
527
|
-
|
|
527
|
+
R,
|
|
528
528
|
this
|
|
529
|
-
) : h(
|
|
529
|
+
) : h(R);
|
|
530
530
|
}, a = {
|
|
531
531
|
fetchOptions: s,
|
|
532
532
|
options: this.options,
|
|
533
533
|
queryKey: this.queryKey,
|
|
534
534
|
state: this.state,
|
|
535
|
-
fetchFn:
|
|
535
|
+
fetchFn: o
|
|
536
536
|
};
|
|
537
|
-
|
|
537
|
+
i(a), (l = this.options.behavior) == null || l.onFetch(
|
|
538
538
|
a,
|
|
539
539
|
this
|
|
540
|
-
), c(this, te, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((
|
|
541
|
-
const
|
|
542
|
-
var
|
|
543
|
-
|
|
540
|
+
), c(this, te, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((S = a.fetchOptions) == null ? void 0 : S.meta)) && m(this, D, Q).call(this, { type: "fetch", meta: (v = a.fetchOptions) == null ? void 0 : v.meta });
|
|
541
|
+
const u = (h) => {
|
|
542
|
+
var R, g, w, b;
|
|
543
|
+
ve(h) && h.silent || m(this, D, Q).call(this, {
|
|
544
544
|
type: "error",
|
|
545
545
|
error: h
|
|
546
|
-
}),
|
|
547
|
-
|
|
546
|
+
}), ve(h) || ((g = (R = n(this, I).config).onError) == null || g.call(
|
|
547
|
+
R,
|
|
548
548
|
h,
|
|
549
549
|
this
|
|
550
|
-
), (
|
|
550
|
+
), (b = (w = n(this, I).config).onSettled) == null || b.call(
|
|
551
551
|
w,
|
|
552
552
|
this.state.data,
|
|
553
553
|
h,
|
|
@@ -559,43 +559,43 @@ var Ae = Et(), _, Je, Ot = (Je = class {
|
|
|
559
559
|
fn: a.fetchFn,
|
|
560
560
|
abort: r.abort.bind(r),
|
|
561
561
|
onSuccess: (h) => {
|
|
562
|
-
var
|
|
562
|
+
var R, g, w, b;
|
|
563
563
|
if (h === void 0) {
|
|
564
564
|
process.env.NODE_ENV !== "production" && console.error(
|
|
565
565
|
`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
|
|
566
|
-
),
|
|
566
|
+
), u(new Error(`${this.queryHash} data is undefined`));
|
|
567
567
|
return;
|
|
568
568
|
}
|
|
569
569
|
try {
|
|
570
570
|
this.setData(h);
|
|
571
|
-
} catch (
|
|
572
|
-
|
|
571
|
+
} catch (p) {
|
|
572
|
+
u(p);
|
|
573
573
|
return;
|
|
574
574
|
}
|
|
575
|
-
(
|
|
575
|
+
(g = (R = n(this, I).config).onSuccess) == null || g.call(R, h, this), (b = (w = n(this, I).config).onSettled) == null || b.call(
|
|
576
576
|
w,
|
|
577
577
|
h,
|
|
578
578
|
this.state.error,
|
|
579
579
|
this
|
|
580
580
|
), this.scheduleGc();
|
|
581
581
|
},
|
|
582
|
-
onError:
|
|
583
|
-
onFail: (h,
|
|
584
|
-
|
|
582
|
+
onError: u,
|
|
583
|
+
onFail: (h, R) => {
|
|
584
|
+
m(this, D, Q).call(this, { type: "failed", failureCount: h, error: R });
|
|
585
585
|
},
|
|
586
586
|
onPause: () => {
|
|
587
|
-
|
|
587
|
+
m(this, D, Q).call(this, { type: "pause" });
|
|
588
588
|
},
|
|
589
589
|
onContinue: () => {
|
|
590
|
-
|
|
590
|
+
m(this, D, Q).call(this, { type: "continue" });
|
|
591
591
|
},
|
|
592
592
|
retry: a.options.retry,
|
|
593
593
|
retryDelay: a.options.retryDelay,
|
|
594
594
|
networkMode: a.options.networkMode,
|
|
595
595
|
canRun: () => !0
|
|
596
|
-
})),
|
|
596
|
+
})), n(this, C).start();
|
|
597
597
|
}
|
|
598
|
-
}, ee = new WeakMap(), te = new WeakMap(), I = new WeakMap(), C = new WeakMap(),
|
|
598
|
+
}, ee = new WeakMap(), te = new WeakMap(), I = new WeakMap(), C = new WeakMap(), ue = new WeakMap(), H = new WeakMap(), D = new WeakSet(), Q = function(e) {
|
|
599
599
|
const s = (r) => {
|
|
600
600
|
switch (e.type) {
|
|
601
601
|
case "failed":
|
|
@@ -617,7 +617,7 @@ var Ae = Et(), _, Je, Ot = (Je = class {
|
|
|
617
617
|
case "fetch":
|
|
618
618
|
return {
|
|
619
619
|
...r,
|
|
620
|
-
...
|
|
620
|
+
...it(r.data, this.options),
|
|
621
621
|
fetchMeta: e.meta ?? null
|
|
622
622
|
};
|
|
623
623
|
case "success":
|
|
@@ -636,14 +636,14 @@ var Ae = Et(), _, Je, Ot = (Je = class {
|
|
|
636
636
|
}
|
|
637
637
|
};
|
|
638
638
|
case "error":
|
|
639
|
-
const
|
|
640
|
-
return
|
|
639
|
+
const i = e.error;
|
|
640
|
+
return ve(i) && i.revert && n(this, te) ? { ...n(this, te), fetchStatus: "idle" } : {
|
|
641
641
|
...r,
|
|
642
|
-
error:
|
|
642
|
+
error: i,
|
|
643
643
|
errorUpdateCount: r.errorUpdateCount + 1,
|
|
644
644
|
errorUpdatedAt: Date.now(),
|
|
645
645
|
fetchFailureCount: r.fetchFailureCount + 1,
|
|
646
|
-
fetchFailureReason:
|
|
646
|
+
fetchFailureReason: i,
|
|
647
647
|
fetchStatus: "idle",
|
|
648
648
|
status: "error"
|
|
649
649
|
};
|
|
@@ -662,10 +662,10 @@ var Ae = Et(), _, Je, Ot = (Je = class {
|
|
|
662
662
|
this.state = s(this.state), Ae.batch(() => {
|
|
663
663
|
this.observers.forEach((r) => {
|
|
664
664
|
r.onQueryUpdate();
|
|
665
|
-
}),
|
|
665
|
+
}), n(this, I).notify({ query: this, type: "updated", action: e });
|
|
666
666
|
});
|
|
667
667
|
}, Xe);
|
|
668
|
-
function
|
|
668
|
+
function it(t, e) {
|
|
669
669
|
return {
|
|
670
670
|
fetchFailureCount: 0,
|
|
671
671
|
fetchFailureReason: null,
|
|
@@ -693,28 +693,28 @@ function Ft(t) {
|
|
|
693
693
|
fetchStatus: "idle"
|
|
694
694
|
};
|
|
695
695
|
}
|
|
696
|
-
var
|
|
696
|
+
var P, d, oe, F, B, se, M, k, he, re, ne, G, z, L, ie, y, ae, Pe, Ie, Te, De, xe, je, ke, ut, Ye, at = (Ye = class extends Qe {
|
|
697
697
|
constructor(e, s) {
|
|
698
698
|
super();
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
699
|
+
f(this, y);
|
|
700
|
+
f(this, P);
|
|
701
|
+
f(this, d);
|
|
702
|
+
f(this, oe);
|
|
703
|
+
f(this, F);
|
|
704
|
+
f(this, B);
|
|
705
|
+
f(this, se);
|
|
706
|
+
f(this, M);
|
|
707
|
+
f(this, k);
|
|
708
|
+
f(this, he);
|
|
709
|
+
f(this, re);
|
|
710
710
|
// This property keeps track of the last query with defined data.
|
|
711
711
|
// It will be used to pass the previous data and query to the placeholder function between renders.
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
this.options = s, c(this,
|
|
712
|
+
f(this, ne);
|
|
713
|
+
f(this, G);
|
|
714
|
+
f(this, z);
|
|
715
|
+
f(this, L);
|
|
716
|
+
f(this, ie, /* @__PURE__ */ new Set());
|
|
717
|
+
this.options = s, c(this, P, e), c(this, k, null), c(this, M, Fe()), this.options.experimental_prefetchInRender || n(this, M).reject(
|
|
718
718
|
new Error("experimental_prefetchInRender feature flag is not enabled")
|
|
719
719
|
), this.bindMethods(), this.setOptions(s);
|
|
720
720
|
}
|
|
@@ -722,71 +722,71 @@ var F, d, ue, O, B, se, L, k, he, re, ie, G, z, M, ne, p, ae, Pe, Ie, Te, De, xe
|
|
|
722
722
|
this.refetch = this.refetch.bind(this);
|
|
723
723
|
}
|
|
724
724
|
onSubscribe() {
|
|
725
|
-
this.listeners.size === 1 && (
|
|
725
|
+
this.listeners.size === 1 && (n(this, d).addObserver(this), Ge(n(this, d), this.options) ? m(this, y, ae).call(this) : this.updateResult(), m(this, y, De).call(this));
|
|
726
726
|
}
|
|
727
727
|
onUnsubscribe() {
|
|
728
728
|
this.hasListeners() || this.destroy();
|
|
729
729
|
}
|
|
730
730
|
shouldFetchOnReconnect() {
|
|
731
731
|
return Ue(
|
|
732
|
-
|
|
732
|
+
n(this, d),
|
|
733
733
|
this.options,
|
|
734
734
|
this.options.refetchOnReconnect
|
|
735
735
|
);
|
|
736
736
|
}
|
|
737
737
|
shouldFetchOnWindowFocus() {
|
|
738
738
|
return Ue(
|
|
739
|
-
|
|
739
|
+
n(this, d),
|
|
740
740
|
this.options,
|
|
741
741
|
this.options.refetchOnWindowFocus
|
|
742
742
|
);
|
|
743
743
|
}
|
|
744
744
|
destroy() {
|
|
745
|
-
this.listeners = /* @__PURE__ */ new Set(),
|
|
745
|
+
this.listeners = /* @__PURE__ */ new Set(), m(this, y, xe).call(this), m(this, y, je).call(this), n(this, d).removeObserver(this);
|
|
746
746
|
}
|
|
747
747
|
setOptions(e, s) {
|
|
748
|
-
const r = this.options,
|
|
749
|
-
if (this.options =
|
|
748
|
+
const r = this.options, i = n(this, d);
|
|
749
|
+
if (this.options = n(this, P).defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof x(this.options.enabled, n(this, d)) != "boolean")
|
|
750
750
|
throw new Error(
|
|
751
751
|
"Expected enabled to be a boolean or a callback that returns a boolean"
|
|
752
752
|
);
|
|
753
|
-
|
|
753
|
+
m(this, y, ke).call(this), n(this, d).setOptions(this.options), r._defaulted && !we(this.options, r) && n(this, P).getQueryCache().notify({
|
|
754
754
|
type: "observerOptionsUpdated",
|
|
755
|
-
query:
|
|
755
|
+
query: n(this, d),
|
|
756
756
|
observer: this
|
|
757
757
|
});
|
|
758
|
-
const
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
758
|
+
const o = this.hasListeners();
|
|
759
|
+
o && ze(
|
|
760
|
+
n(this, d),
|
|
761
|
+
i,
|
|
762
762
|
this.options,
|
|
763
763
|
r
|
|
764
|
-
) &&
|
|
765
|
-
const a =
|
|
766
|
-
|
|
764
|
+
) && m(this, y, ae).call(this), this.updateResult(s), o && (n(this, d) !== i || x(this.options.enabled, n(this, d)) !== x(r.enabled, n(this, d)) || fe(this.options.staleTime, n(this, d)) !== fe(r.staleTime, n(this, d))) && m(this, y, Pe).call(this);
|
|
765
|
+
const a = m(this, y, Ie).call(this);
|
|
766
|
+
o && (n(this, d) !== i || x(this.options.enabled, n(this, d)) !== x(r.enabled, n(this, d)) || a !== n(this, L)) && m(this, y, Te).call(this, a);
|
|
767
767
|
}
|
|
768
768
|
getOptimisticResult(e) {
|
|
769
|
-
const s =
|
|
770
|
-
return It(this, r) && (c(this,
|
|
769
|
+
const s = n(this, P).getQueryCache().build(n(this, P), e), r = this.createResult(s, e);
|
|
770
|
+
return It(this, r) && (c(this, F, r), c(this, se, this.options), c(this, B, n(this, d).state)), r;
|
|
771
771
|
}
|
|
772
772
|
getCurrentResult() {
|
|
773
|
-
return
|
|
773
|
+
return n(this, F);
|
|
774
774
|
}
|
|
775
775
|
trackResult(e, s) {
|
|
776
776
|
const r = {};
|
|
777
|
-
return Object.keys(e).forEach((
|
|
778
|
-
Object.defineProperty(r,
|
|
777
|
+
return Object.keys(e).forEach((i) => {
|
|
778
|
+
Object.defineProperty(r, i, {
|
|
779
779
|
configurable: !1,
|
|
780
780
|
enumerable: !0,
|
|
781
|
-
get: () => (this.trackProp(
|
|
781
|
+
get: () => (this.trackProp(i), s == null || s(i), e[i])
|
|
782
782
|
});
|
|
783
783
|
}), r;
|
|
784
784
|
}
|
|
785
785
|
trackProp(e) {
|
|
786
|
-
|
|
786
|
+
n(this, ie).add(e);
|
|
787
787
|
}
|
|
788
788
|
getCurrentQuery() {
|
|
789
|
-
return
|
|
789
|
+
return n(this, d);
|
|
790
790
|
}
|
|
791
791
|
refetch({ ...e } = {}) {
|
|
792
792
|
return this.fetch({
|
|
@@ -794,95 +794,95 @@ var F, d, ue, O, B, se, L, k, he, re, ie, G, z, M, ne, p, ae, Pe, Ie, Te, De, xe
|
|
|
794
794
|
});
|
|
795
795
|
}
|
|
796
796
|
fetchOptimistic(e) {
|
|
797
|
-
const s =
|
|
797
|
+
const s = n(this, P).defaultQueryOptions(e), r = n(this, P).getQueryCache().build(n(this, P), s);
|
|
798
798
|
return r.fetch().then(() => this.createResult(r, s));
|
|
799
799
|
}
|
|
800
800
|
fetch(e) {
|
|
801
|
-
return
|
|
801
|
+
return m(this, y, ae).call(this, {
|
|
802
802
|
...e,
|
|
803
803
|
cancelRefetch: e.cancelRefetch ?? !0
|
|
804
|
-
}).then(() => (this.updateResult(),
|
|
804
|
+
}).then(() => (this.updateResult(), n(this, F)));
|
|
805
805
|
}
|
|
806
806
|
createResult(e, s) {
|
|
807
807
|
var Ke;
|
|
808
|
-
const r =
|
|
809
|
-
let h = { ...v },
|
|
808
|
+
const r = n(this, d), i = this.options, o = n(this, F), a = n(this, B), u = n(this, se), S = e !== r ? e.state : n(this, oe), { state: v } = e;
|
|
809
|
+
let h = { ...v }, R = !1, g;
|
|
810
810
|
if (s._optimisticResults) {
|
|
811
|
-
const
|
|
811
|
+
const O = this.hasListeners(), Z = !O && Ge(e, s), W = O && ze(e, r, s, i);
|
|
812
812
|
(Z || W) && (h = {
|
|
813
813
|
...h,
|
|
814
|
-
...
|
|
814
|
+
...it(v.data, e.options)
|
|
815
815
|
}), s._optimisticResults === "isRestoring" && (h.fetchStatus = "idle");
|
|
816
816
|
}
|
|
817
|
-
let { error: w, errorUpdatedAt:
|
|
817
|
+
let { error: w, errorUpdatedAt: b, status: p } = h;
|
|
818
818
|
if (s.select && h.data !== void 0)
|
|
819
|
-
if (
|
|
820
|
-
|
|
819
|
+
if (o && h.data === (a == null ? void 0 : a.data) && s.select === n(this, he))
|
|
820
|
+
g = n(this, re);
|
|
821
821
|
else
|
|
822
822
|
try {
|
|
823
|
-
c(this, he, s.select),
|
|
824
|
-
} catch (
|
|
825
|
-
c(this, k,
|
|
823
|
+
c(this, he, s.select), g = s.select(h.data), g = Oe(o == null ? void 0 : o.data, g, s), c(this, re, g), c(this, k, null);
|
|
824
|
+
} catch (O) {
|
|
825
|
+
c(this, k, O);
|
|
826
826
|
}
|
|
827
827
|
else
|
|
828
|
-
|
|
829
|
-
if (s.placeholderData !== void 0 &&
|
|
830
|
-
let
|
|
831
|
-
if (
|
|
832
|
-
|
|
833
|
-
else if (
|
|
834
|
-
(Ke =
|
|
835
|
-
|
|
836
|
-
) : s.placeholderData, s.select &&
|
|
828
|
+
g = h.data;
|
|
829
|
+
if (s.placeholderData !== void 0 && g === void 0 && p === "pending") {
|
|
830
|
+
let O;
|
|
831
|
+
if (o != null && o.isPlaceholderData && s.placeholderData === (u == null ? void 0 : u.placeholderData))
|
|
832
|
+
O = o.data;
|
|
833
|
+
else if (O = typeof s.placeholderData == "function" ? s.placeholderData(
|
|
834
|
+
(Ke = n(this, ne)) == null ? void 0 : Ke.state.data,
|
|
835
|
+
n(this, ne)
|
|
836
|
+
) : s.placeholderData, s.select && O !== void 0)
|
|
837
837
|
try {
|
|
838
|
-
|
|
838
|
+
O = s.select(O), c(this, k, null);
|
|
839
839
|
} catch (Z) {
|
|
840
840
|
c(this, k, Z);
|
|
841
841
|
}
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
842
|
+
O !== void 0 && (p = "success", g = Oe(
|
|
843
|
+
o == null ? void 0 : o.data,
|
|
844
|
+
O,
|
|
845
845
|
s
|
|
846
|
-
),
|
|
846
|
+
), R = !0);
|
|
847
847
|
}
|
|
848
|
-
|
|
849
|
-
const
|
|
850
|
-
status:
|
|
848
|
+
n(this, k) && (w = n(this, k), g = n(this, re), b = Date.now(), p = "error");
|
|
849
|
+
const E = h.fetchStatus === "fetching", U = p === "pending", N = p === "error", ce = U && E, le = g !== void 0, j = {
|
|
850
|
+
status: p,
|
|
851
851
|
fetchStatus: h.fetchStatus,
|
|
852
852
|
isPending: U,
|
|
853
|
-
isSuccess:
|
|
853
|
+
isSuccess: p === "success",
|
|
854
854
|
isError: N,
|
|
855
855
|
isInitialLoading: ce,
|
|
856
856
|
isLoading: ce,
|
|
857
|
-
data:
|
|
857
|
+
data: g,
|
|
858
858
|
dataUpdatedAt: h.dataUpdatedAt,
|
|
859
859
|
error: w,
|
|
860
|
-
errorUpdatedAt:
|
|
860
|
+
errorUpdatedAt: b,
|
|
861
861
|
failureCount: h.fetchFailureCount,
|
|
862
862
|
failureReason: h.fetchFailureReason,
|
|
863
863
|
errorUpdateCount: h.errorUpdateCount,
|
|
864
864
|
isFetched: h.dataUpdateCount > 0 || h.errorUpdateCount > 0,
|
|
865
|
-
isFetchedAfterMount: h.dataUpdateCount >
|
|
866
|
-
isFetching:
|
|
867
|
-
isRefetching:
|
|
865
|
+
isFetchedAfterMount: h.dataUpdateCount > S.dataUpdateCount || h.errorUpdateCount > S.errorUpdateCount,
|
|
866
|
+
isFetching: E,
|
|
867
|
+
isRefetching: E && !U,
|
|
868
868
|
isLoadingError: N && !le,
|
|
869
869
|
isPaused: h.fetchStatus === "paused",
|
|
870
|
-
isPlaceholderData:
|
|
870
|
+
isPlaceholderData: R,
|
|
871
871
|
isRefetchError: N && le,
|
|
872
|
-
isStale:
|
|
872
|
+
isStale: Me(e, s),
|
|
873
873
|
refetch: this.refetch,
|
|
874
|
-
promise:
|
|
874
|
+
promise: n(this, M)
|
|
875
875
|
};
|
|
876
876
|
if (this.options.experimental_prefetchInRender) {
|
|
877
|
-
const
|
|
877
|
+
const O = (de) => {
|
|
878
878
|
j.status === "error" ? de.reject(j.error) : j.data !== void 0 && de.resolve(j.data);
|
|
879
879
|
}, Z = () => {
|
|
880
|
-
const de = c(this,
|
|
881
|
-
|
|
882
|
-
}, W =
|
|
880
|
+
const de = c(this, M, j.promise = Fe());
|
|
881
|
+
O(de);
|
|
882
|
+
}, W = n(this, M);
|
|
883
883
|
switch (W.status) {
|
|
884
884
|
case "pending":
|
|
885
|
-
e.queryHash === r.queryHash &&
|
|
885
|
+
e.queryHash === r.queryHash && O(W);
|
|
886
886
|
break;
|
|
887
887
|
case "fulfilled":
|
|
888
888
|
(j.status === "error" || j.data !== W.value) && Z();
|
|
@@ -895,72 +895,72 @@ var F, d, ue, O, B, se, L, k, he, re, ie, G, z, M, ne, p, ae, Pe, Ie, Te, De, xe
|
|
|
895
895
|
return j;
|
|
896
896
|
}
|
|
897
897
|
updateResult(e) {
|
|
898
|
-
const s =
|
|
899
|
-
if (c(this, B,
|
|
898
|
+
const s = n(this, F), r = this.createResult(n(this, d), this.options);
|
|
899
|
+
if (c(this, B, n(this, d).state), c(this, se, this.options), n(this, B).data !== void 0 && c(this, ne, n(this, d)), we(r, s))
|
|
900
900
|
return;
|
|
901
|
-
c(this,
|
|
902
|
-
const
|
|
901
|
+
c(this, F, r);
|
|
902
|
+
const i = {}, o = () => {
|
|
903
903
|
if (!s)
|
|
904
904
|
return !0;
|
|
905
|
-
const { notifyOnChangeProps: a } = this.options,
|
|
906
|
-
if (
|
|
905
|
+
const { notifyOnChangeProps: a } = this.options, u = typeof a == "function" ? a() : a;
|
|
906
|
+
if (u === "all" || !u && !n(this, ie).size)
|
|
907
907
|
return !0;
|
|
908
908
|
const l = new Set(
|
|
909
|
-
|
|
909
|
+
u ?? n(this, ie)
|
|
910
910
|
);
|
|
911
|
-
return this.options.throwOnError && l.add("error"), Object.keys(
|
|
912
|
-
const v =
|
|
913
|
-
return
|
|
911
|
+
return this.options.throwOnError && l.add("error"), Object.keys(n(this, F)).some((S) => {
|
|
912
|
+
const v = S;
|
|
913
|
+
return n(this, F)[v] !== s[v] && l.has(v);
|
|
914
914
|
});
|
|
915
915
|
};
|
|
916
|
-
(e == null ? void 0 : e.listeners) !== !1 &&
|
|
916
|
+
(e == null ? void 0 : e.listeners) !== !1 && o() && (i.listeners = !0), m(this, y, ut).call(this, { ...i, ...e });
|
|
917
917
|
}
|
|
918
918
|
onQueryUpdate() {
|
|
919
|
-
this.updateResult(), this.hasListeners() &&
|
|
919
|
+
this.updateResult(), this.hasListeners() && m(this, y, De).call(this);
|
|
920
920
|
}
|
|
921
|
-
},
|
|
922
|
-
|
|
923
|
-
let s =
|
|
921
|
+
}, P = new WeakMap(), d = new WeakMap(), oe = new WeakMap(), F = new WeakMap(), B = new WeakMap(), se = new WeakMap(), M = new WeakMap(), k = new WeakMap(), he = new WeakMap(), re = new WeakMap(), ne = new WeakMap(), G = new WeakMap(), z = new WeakMap(), L = new WeakMap(), ie = new WeakMap(), y = new WeakSet(), ae = function(e) {
|
|
922
|
+
m(this, y, ke).call(this);
|
|
923
|
+
let s = n(this, d).fetch(
|
|
924
924
|
this.options,
|
|
925
925
|
e
|
|
926
926
|
);
|
|
927
927
|
return e != null && e.throwOnError || (s = s.catch(ge)), s;
|
|
928
928
|
}, Pe = function() {
|
|
929
|
-
|
|
929
|
+
m(this, y, xe).call(this);
|
|
930
930
|
const e = fe(
|
|
931
931
|
this.options.staleTime,
|
|
932
|
-
|
|
932
|
+
n(this, d)
|
|
933
933
|
);
|
|
934
|
-
if (V ||
|
|
934
|
+
if (V || n(this, F).isStale || !Se(e))
|
|
935
935
|
return;
|
|
936
|
-
const r = et(
|
|
936
|
+
const r = et(n(this, F).dataUpdatedAt, e) + 1;
|
|
937
937
|
c(this, G, setTimeout(() => {
|
|
938
|
-
|
|
938
|
+
n(this, F).isStale || this.updateResult();
|
|
939
939
|
}, r));
|
|
940
940
|
}, Ie = function() {
|
|
941
|
-
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(
|
|
941
|
+
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(n(this, d)) : this.options.refetchInterval) ?? !1;
|
|
942
942
|
}, Te = function(e) {
|
|
943
|
-
|
|
944
|
-
(this.options.refetchIntervalInBackground || tt.isFocused()) &&
|
|
945
|
-
},
|
|
943
|
+
m(this, y, je).call(this), c(this, L, e), !(V || x(this.options.enabled, n(this, d)) === !1 || !Se(n(this, L)) || n(this, L) === 0) && c(this, z, setInterval(() => {
|
|
944
|
+
(this.options.refetchIntervalInBackground || tt.isFocused()) && m(this, y, ae).call(this);
|
|
945
|
+
}, n(this, L)));
|
|
946
946
|
}, De = function() {
|
|
947
|
-
|
|
947
|
+
m(this, y, Pe).call(this), m(this, y, Te).call(this, m(this, y, Ie).call(this));
|
|
948
948
|
}, xe = function() {
|
|
949
|
-
|
|
949
|
+
n(this, G) && (clearTimeout(n(this, G)), c(this, G, void 0));
|
|
950
950
|
}, je = function() {
|
|
951
|
-
|
|
951
|
+
n(this, z) && (clearInterval(n(this, z)), c(this, z, void 0));
|
|
952
952
|
}, ke = function() {
|
|
953
|
-
const e =
|
|
954
|
-
if (e ===
|
|
953
|
+
const e = n(this, P).getQueryCache().build(n(this, P), this.options);
|
|
954
|
+
if (e === n(this, d))
|
|
955
955
|
return;
|
|
956
|
-
const s =
|
|
957
|
-
c(this, d, e), c(this,
|
|
958
|
-
},
|
|
956
|
+
const s = n(this, d);
|
|
957
|
+
c(this, d, e), c(this, oe, e.state), this.hasListeners() && (s == null || s.removeObserver(this), e.addObserver(this));
|
|
958
|
+
}, ut = function(e) {
|
|
959
959
|
Ae.batch(() => {
|
|
960
960
|
e.listeners && this.listeners.forEach((s) => {
|
|
961
|
-
s(
|
|
962
|
-
}),
|
|
963
|
-
query:
|
|
961
|
+
s(n(this, F));
|
|
962
|
+
}), n(this, P).getQueryCache().notify({
|
|
963
|
+
query: n(this, d),
|
|
964
964
|
type: "observerResultsUpdated"
|
|
965
965
|
});
|
|
966
966
|
});
|
|
@@ -974,23 +974,23 @@ function Ge(t, e) {
|
|
|
974
974
|
function Ue(t, e, s) {
|
|
975
975
|
if (x(e.enabled, t) !== !1) {
|
|
976
976
|
const r = typeof s == "function" ? s(t) : s;
|
|
977
|
-
return r === "always" || r !== !1 &&
|
|
977
|
+
return r === "always" || r !== !1 && Me(t, e);
|
|
978
978
|
}
|
|
979
979
|
return !1;
|
|
980
980
|
}
|
|
981
981
|
function ze(t, e, s, r) {
|
|
982
|
-
return (t !== e || x(r.enabled, t) === !1) && (!s.suspense || t.state.status !== "error") &&
|
|
982
|
+
return (t !== e || x(r.enabled, t) === !1) && (!s.suspense || t.state.status !== "error") && Me(t, s);
|
|
983
983
|
}
|
|
984
|
-
function
|
|
984
|
+
function Me(t, e) {
|
|
985
985
|
return x(e.enabled, t) !== !1 && t.isStaleByTime(fe(e.staleTime, t));
|
|
986
986
|
}
|
|
987
987
|
function It(t, e) {
|
|
988
988
|
return !we(t.getCurrentResult(), e);
|
|
989
989
|
}
|
|
990
|
-
var
|
|
990
|
+
var ot = T.createContext(
|
|
991
991
|
void 0
|
|
992
992
|
), Tt = (t) => {
|
|
993
|
-
const e = T.useContext(
|
|
993
|
+
const e = T.useContext(ot);
|
|
994
994
|
if (t)
|
|
995
995
|
return t;
|
|
996
996
|
if (!e)
|
|
@@ -1001,7 +1001,7 @@ var ut = T.createContext(
|
|
|
1001
1001
|
children: e
|
|
1002
1002
|
}) => (T.useEffect(() => (t.mount(), () => {
|
|
1003
1003
|
t.unmount();
|
|
1004
|
-
}), [t]), /* @__PURE__ */ pt.jsx(
|
|
1004
|
+
}), [t]), /* @__PURE__ */ pt.jsx(ot.Provider, { value: t, children: e })), ht = T.createContext(!1), Dt = () => T.useContext(ht);
|
|
1005
1005
|
ht.Provider;
|
|
1006
1006
|
function xt() {
|
|
1007
1007
|
let t = !1;
|
|
@@ -1032,66 +1032,67 @@ var Qt = (t, e) => {
|
|
|
1032
1032
|
errorResetBoundary: e,
|
|
1033
1033
|
throwOnError: s,
|
|
1034
1034
|
query: r
|
|
1035
|
-
}) => t.isError && !e.isReset() && !t.isFetching && r && Ut(s, [t.error, r]),
|
|
1036
|
-
|
|
1035
|
+
}) => t.isError && !e.isReset() && !t.isFetching && r && Ut(s, [t.error, r]), Mt = (t, e) => e.state.data === void 0, Lt = (t) => {
|
|
1036
|
+
const e = t.staleTime;
|
|
1037
|
+
t.suspense && (t.staleTime = typeof e == "function" ? (...s) => Math.max(e(...s), 1e3) : Math.max(e ?? 1e3, 1e3), typeof t.gcTime == "number" && (t.gcTime = Math.max(t.gcTime, 1e3)));
|
|
1037
1038
|
}, Nt = (t, e) => t.isLoading && t.isFetching && !e, Kt = (t, e) => (t == null ? void 0 : t.suspense) && e.isPending, $e = (t, e, s) => e.fetchOptimistic(t).catch(() => {
|
|
1038
1039
|
s.clearReset();
|
|
1039
1040
|
});
|
|
1040
1041
|
function ct(t, e, s) {
|
|
1041
|
-
var
|
|
1042
|
+
var h, R, g, w, b;
|
|
1042
1043
|
if (process.env.NODE_ENV !== "production" && (typeof t != "object" || Array.isArray(t)))
|
|
1043
1044
|
throw new Error(
|
|
1044
1045
|
'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'
|
|
1045
1046
|
);
|
|
1046
|
-
const r = Tt(s),
|
|
1047
|
-
(
|
|
1048
|
-
|
|
1047
|
+
const r = Tt(s), i = Dt(), o = kt(), a = r.defaultQueryOptions(t);
|
|
1048
|
+
(R = (h = r.getDefaultOptions().queries) == null ? void 0 : h._experimental_beforeQuery) == null || R.call(
|
|
1049
|
+
h,
|
|
1049
1050
|
a
|
|
1050
|
-
), a._optimisticResults =
|
|
1051
|
-
const
|
|
1051
|
+
), a._optimisticResults = i ? "isRestoring" : "optimistic", Lt(a), Qt(a, o), qt(o);
|
|
1052
|
+
const u = !r.getQueryCache().get(a.queryHash), [l] = T.useState(
|
|
1052
1053
|
() => new e(
|
|
1053
1054
|
r,
|
|
1054
1055
|
a
|
|
1055
1056
|
)
|
|
1056
|
-
),
|
|
1057
|
+
), S = l.getOptimisticResult(a), v = !i && t.subscribed !== !1;
|
|
1057
1058
|
if (T.useSyncExternalStore(
|
|
1058
1059
|
T.useCallback(
|
|
1059
|
-
(
|
|
1060
|
-
const
|
|
1061
|
-
return l.updateResult(),
|
|
1060
|
+
(p) => {
|
|
1061
|
+
const E = v ? l.subscribe(Ae.batchCalls(p)) : Ve;
|
|
1062
|
+
return l.updateResult(), E;
|
|
1062
1063
|
},
|
|
1063
|
-
[l,
|
|
1064
|
+
[l, v]
|
|
1064
1065
|
),
|
|
1065
1066
|
() => l.getCurrentResult(),
|
|
1066
1067
|
() => l.getCurrentResult()
|
|
1067
1068
|
), T.useEffect(() => {
|
|
1068
1069
|
l.setOptions(a, { listeners: !1 });
|
|
1069
|
-
}, [a, l]), Kt(a,
|
|
1070
|
-
throw $e(a, l,
|
|
1070
|
+
}, [a, l]), Kt(a, S))
|
|
1071
|
+
throw $e(a, l, o);
|
|
1071
1072
|
if (At({
|
|
1072
|
-
result:
|
|
1073
|
-
errorResetBoundary:
|
|
1073
|
+
result: S,
|
|
1074
|
+
errorResetBoundary: o,
|
|
1074
1075
|
throwOnError: a.throwOnError,
|
|
1075
1076
|
query: r.getQueryCache().get(a.queryHash)
|
|
1076
1077
|
}))
|
|
1077
|
-
throw
|
|
1078
|
-
if ((
|
|
1079
|
-
|
|
1078
|
+
throw S.error;
|
|
1079
|
+
if ((w = (g = r.getDefaultOptions().queries) == null ? void 0 : g._experimental_afterQuery) == null || w.call(
|
|
1080
|
+
g,
|
|
1080
1081
|
a,
|
|
1081
|
-
|
|
1082
|
-
), a.experimental_prefetchInRender && !V && Nt(
|
|
1083
|
-
const
|
|
1082
|
+
S
|
|
1083
|
+
), a.experimental_prefetchInRender && !V && Nt(S, i)) {
|
|
1084
|
+
const p = u ? (
|
|
1084
1085
|
// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
|
|
1085
|
-
$e(a, l,
|
|
1086
|
+
$e(a, l, o)
|
|
1086
1087
|
) : (
|
|
1087
1088
|
// subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
|
|
1088
|
-
(
|
|
1089
|
+
(b = r.getQueryCache().get(a.queryHash)) == null ? void 0 : b.promise
|
|
1089
1090
|
);
|
|
1090
|
-
|
|
1091
|
+
p == null || p.catch(Ve).finally(() => {
|
|
1091
1092
|
l.updateResult();
|
|
1092
1093
|
});
|
|
1093
1094
|
}
|
|
1094
|
-
return a.notifyOnChangeProps ?
|
|
1095
|
+
return a.notifyOnChangeProps ? S : l.trackResult(S);
|
|
1095
1096
|
}
|
|
1096
1097
|
function _t(t, e) {
|
|
1097
1098
|
return ct(t, at, e);
|
|
@@ -1102,7 +1103,7 @@ function Ht(t, e) {
|
|
|
1102
1103
|
...t,
|
|
1103
1104
|
enabled: !0,
|
|
1104
1105
|
suspense: !0,
|
|
1105
|
-
throwOnError:
|
|
1106
|
+
throwOnError: Mt,
|
|
1106
1107
|
placeholderData: void 0
|
|
1107
1108
|
},
|
|
1108
1109
|
at,
|
|
@@ -1112,7 +1113,7 @@ function Ht(t, e) {
|
|
|
1112
1113
|
const $ = (...t) => {
|
|
1113
1114
|
const e = t.filter((s) => !!s).map((s) => s.replace(/(^\/+|\/+$)/g, "")).join("/").replace(/(^\/+|\/+$)/g, "");
|
|
1114
1115
|
return e ? `/${e}` : "/";
|
|
1115
|
-
},
|
|
1116
|
+
}, Le = (t, e) => {
|
|
1116
1117
|
for (const s of t) {
|
|
1117
1118
|
const r = Ne(s, e);
|
|
1118
1119
|
if (r !== void 0) return r;
|
|
@@ -1121,16 +1122,16 @@ const $ = (...t) => {
|
|
|
1121
1122
|
const r = e(t, s);
|
|
1122
1123
|
if (r !== void 0) return r;
|
|
1123
1124
|
if (t.type === "category")
|
|
1124
|
-
for (const
|
|
1125
|
-
const
|
|
1125
|
+
for (const i of t.items) {
|
|
1126
|
+
const o = Ne(i, e, [
|
|
1126
1127
|
...s,
|
|
1127
1128
|
t
|
|
1128
1129
|
]);
|
|
1129
|
-
if (
|
|
1130
|
+
if (o !== void 0) return o;
|
|
1130
1131
|
}
|
|
1131
1132
|
}, ss = () => {
|
|
1132
1133
|
const t = pe(), s = dt().sidebar;
|
|
1133
|
-
return
|
|
1134
|
+
return Le(s, (r) => {
|
|
1134
1135
|
if (r.type === "doc" && $(r.id) === t.pathname)
|
|
1135
1136
|
return r;
|
|
1136
1137
|
});
|
|
@@ -1140,17 +1141,17 @@ const $ = (...t) => {
|
|
|
1140
1141
|
if (s.type === "category" && s.link && $(s.link.id) === e.pathname || s.type === "doc" && $(s.id) === e.pathname)
|
|
1141
1142
|
return !0;
|
|
1142
1143
|
});
|
|
1143
|
-
},
|
|
1144
|
+
}, ns = () => {
|
|
1144
1145
|
const t = pe().pathname, s = dt().sidebar;
|
|
1145
|
-
let r,
|
|
1146
|
-
return
|
|
1147
|
-
const
|
|
1148
|
-
if (
|
|
1149
|
-
if (
|
|
1150
|
-
return
|
|
1151
|
-
t ===
|
|
1146
|
+
let r, i, o = !1;
|
|
1147
|
+
return Le(s, (a) => {
|
|
1148
|
+
const u = a.type === "doc" ? $(a.id) : a.type === "category" && a.link ? $(a.link.id) : void 0;
|
|
1149
|
+
if (u) {
|
|
1150
|
+
if (o)
|
|
1151
|
+
return i = { label: a.label, id: u }, !0;
|
|
1152
|
+
t === u ? o = !0 : r = { label: a.label, id: u };
|
|
1152
1153
|
}
|
|
1153
|
-
}), { prev: r, next:
|
|
1154
|
+
}), { prev: r, next: i };
|
|
1154
1155
|
}, Bt = ft(
|
|
1155
1156
|
void 0
|
|
1156
1157
|
), lt = () => {
|
|
@@ -1158,23 +1159,23 @@ const $ = (...t) => {
|
|
|
1158
1159
|
if (!t)
|
|
1159
1160
|
throw new Error("useZudoku must be used within a ZudokuProvider.");
|
|
1160
1161
|
return t;
|
|
1161
|
-
},
|
|
1162
|
+
}, is = () => {
|
|
1162
1163
|
const { getApiIdentities: t } = lt();
|
|
1163
1164
|
return _t({
|
|
1164
1165
|
queryFn: t,
|
|
1165
1166
|
queryKey: ["api-identities"]
|
|
1166
1167
|
});
|
|
1167
1168
|
}, dt = () => {
|
|
1168
|
-
const { getPluginSidebar: t, sidebars: e, topNavigation: s } = lt(), r = pe(),
|
|
1169
|
+
const { getPluginSidebar: t, sidebars: e, topNavigation: s } = lt(), r = pe(), i = Object.entries(e).find(([, u]) => Le(u, (l) => {
|
|
1169
1170
|
if ((l.type === "doc" ? $(l.id) : l.type === "category" && l.link ? $(l.link.id) : void 0) === r.pathname)
|
|
1170
1171
|
return l;
|
|
1171
|
-
})),
|
|
1172
|
+
})), o = s.find((u) => u.id === (i == null ? void 0 : i[0])) ?? s.find((u) => bt(u.id, r.pathname)), { data: a } = Ht({
|
|
1172
1173
|
queryFn: () => t(r.pathname),
|
|
1173
1174
|
queryKey: ["plugin-sidebar", r.pathname]
|
|
1174
1175
|
});
|
|
1175
1176
|
return {
|
|
1176
|
-
sidebar: [...
|
|
1177
|
-
topNavItem:
|
|
1177
|
+
sidebar: [...i ? i[1] : [], ...a],
|
|
1178
|
+
topNavItem: o
|
|
1178
1179
|
};
|
|
1179
1180
|
};
|
|
1180
1181
|
export {
|
|
@@ -1182,7 +1183,7 @@ export {
|
|
|
1182
1183
|
ts as B,
|
|
1183
1184
|
rs as C,
|
|
1184
1185
|
dt as D,
|
|
1185
|
-
|
|
1186
|
+
Le as E,
|
|
1186
1187
|
es as Q,
|
|
1187
1188
|
Ot as R,
|
|
1188
1189
|
Qe as S,
|
|
@@ -1190,15 +1191,15 @@ export {
|
|
|
1190
1191
|
lt as a,
|
|
1191
1192
|
ss as b,
|
|
1192
1193
|
wt as c,
|
|
1193
|
-
|
|
1194
|
+
ns as d,
|
|
1194
1195
|
Tt as e,
|
|
1195
1196
|
Ve as f,
|
|
1196
1197
|
Ut as g,
|
|
1197
|
-
|
|
1198
|
-
|
|
1198
|
+
Re as h,
|
|
1199
|
+
is as i,
|
|
1199
1200
|
$ as j,
|
|
1200
1201
|
_t as k,
|
|
1201
|
-
|
|
1202
|
+
mt as l,
|
|
1202
1203
|
Wt as m,
|
|
1203
1204
|
Ae as n,
|
|
1204
1205
|
Jt as o,
|
|
@@ -1214,4 +1215,4 @@ export {
|
|
|
1214
1215
|
Zt as y,
|
|
1215
1216
|
qe as z
|
|
1216
1217
|
};
|
|
1217
|
-
//# sourceMappingURL=ZudokuContext-
|
|
1218
|
+
//# sourceMappingURL=ZudokuContext-DeQZEp-x.js.map
|