zudoku 0.26.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/main.d.ts +1 -1
- package/dist/app/main.js +19 -7
- package/dist/app/main.js.map +1 -1
- package/dist/config/config.d.ts +1 -0
- package/dist/config/validators/InputSidebarSchema.d.ts +2 -2
- package/dist/config/validators/common.d.ts +78 -0
- package/dist/config/validators/common.js +6 -0
- package/dist/config/validators/common.js.map +1 -1
- package/dist/config/validators/validate.d.ts +34 -0
- 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/AnchorLink.js +5 -2
- package/dist/lib/components/AnchorLink.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 +4 -4
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +1 -1
- package/dist/lib/components/Markdown.d.ts +2 -2
- package/dist/lib/components/Markdown.js +3 -1
- package/dist/lib/components/Markdown.js.map +1 -1
- package/dist/lib/components/StatusPage.d.ts +7 -0
- package/dist/lib/components/StatusPage.js +71 -0
- package/dist/lib/components/StatusPage.js.map +1 -0
- package/dist/lib/components/SyntaxHighlight.d.ts +2 -1
- package/dist/lib/components/SyntaxHighlight.js +2 -2
- package/dist/lib/components/SyntaxHighlight.js.map +1 -1
- package/dist/lib/components/ThemeSwitch.js +4 -4
- package/dist/lib/components/ThemeSwitch.js.map +1 -1
- package/dist/lib/components/cache.d.ts +6 -0
- package/dist/lib/components/cache.js +13 -0
- package/dist/lib/components/cache.js.map +1 -0
- package/dist/lib/components/context/ViewportAnchorContext.js +16 -4
- package/dist/lib/components/context/ViewportAnchorContext.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.js +2 -1
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/index.d.ts +9 -2
- package/dist/lib/components/index.js +5 -2
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/core/RouteGuard.d.ts +1 -0
- package/dist/lib/core/RouteGuard.js +28 -0
- package/dist/lib/core/RouteGuard.js.map +1 -0
- package/dist/lib/core/ZudokuContext.d.ts +4 -2
- package/dist/lib/core/ZudokuContext.js +9 -7
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/oas/graphql/circular.d.ts +3 -0
- package/dist/lib/oas/graphql/circular.js +27 -0
- package/dist/lib/oas/graphql/circular.js.map +1 -0
- package/dist/lib/oas/graphql/index.js +5 -6
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/oas/parser/dereference/index.d.ts +0 -1
- package/dist/lib/oas/parser/dereference/index.js +1 -1
- package/dist/lib/oas/parser/dereference/index.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/OperationListItem.js +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.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/Sidecar.js +3 -3
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +4 -11
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +7 -2
- 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 +67 -4
- package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/ParamsGrid.d.ts +5 -0
- package/dist/lib/plugins/openapi/playground/ParamsGrid.js +4 -0
- package/dist/lib/plugins/openapi/playground/ParamsGrid.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/PathParams.js +4 -12
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +18 -1
- package/dist/lib/plugins/openapi/playground/Playground.js +53 -40
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.js +21 -30
- package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/SubmitButton.d.ts +7 -0
- package/dist/lib/plugins/openapi/playground/SubmitButton.js +22 -0
- package/dist/lib/plugins/openapi/playground/SubmitButton.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.d.ts +7 -0
- package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.js +11 -0
- package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.d.ts +8 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +95 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.d.ts +7 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js +16 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.d.ts +10 -0
- package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.js +32 -0
- package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.test.d.ts +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.test.js +56 -0
- package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.test.js.map +1 -0
- 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/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/ui/Select.js +2 -2
- package/dist/lib/ui/Select.js.map +1 -1
- package/dist/lib/util/MdxComponents.js +2 -2
- package/dist/lib/util/MdxComponents.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/lib/util/useScrollToAnchor.d.ts +1 -0
- package/dist/lib/util/useScrollToAnchor.js +26 -15
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- 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/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 +31 -7
- 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 +5 -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 -1
- package/dist/zuplo/with-zuplo.js +7 -26
- package/dist/zuplo/with-zuplo.js.map +1 -1
- package/lib/{AuthenticationPlugin-DNXBcsVN.js → AuthenticationPlugin-CO_YCd2x.js} +3 -3
- package/lib/{AuthenticationPlugin-DNXBcsVN.js.map → AuthenticationPlugin-CO_YCd2x.js.map} +1 -1
- package/lib/{Markdown-BrfrjEk_.js → Markdown-B8o9Qz4q.js} +1197 -1186
- package/lib/{Markdown-BrfrjEk_.js.map → Markdown-B8o9Qz4q.js.map} +1 -1
- package/lib/{MdxPage-LNZLj_A5.js → MdxPage-BxRt3Ly7.js} +63 -58
- package/lib/MdxPage-BxRt3Ly7.js.map +1 -0
- package/lib/OperationList-DH-zIgtq.js +5160 -0
- package/lib/OperationList-DH-zIgtq.js.map +1 -0
- package/lib/{Route-Pzk6qwIk.js → Route-DJ0ZlVq1.js} +3 -3
- package/lib/{Route-Pzk6qwIk.js.map → Route-DJ0ZlVq1.js.map} +1 -1
- package/lib/{Select-DkOpAG0c.js → Select-B7UXR0SB.js} +61 -61
- package/lib/Select-B7UXR0SB.js.map +1 -0
- package/lib/{SlotletProvider-DPbx9KdU.js → SlotletProvider-CtIp8rP3.js} +4 -4
- package/lib/{SlotletProvider-DPbx9KdU.js.map → SlotletProvider-CtIp8rP3.js.map} +1 -1
- package/lib/{Button-oroWHXAy.js → Spinner-BlzrEEk1.js} +15 -12
- package/lib/Spinner-BlzrEEk1.js.map +1 -0
- package/lib/{SyntaxHighlight-CJCSPG1F.js → SyntaxHighlight-C1w1QPdY.js} +300 -295
- package/lib/{SyntaxHighlight-CJCSPG1F.js.map → SyntaxHighlight-C1w1QPdY.js.map} +1 -1
- package/lib/{ZudokuContext-D3ayHjP-.js → ZudokuContext-8jts0fF3.js} +259 -248
- package/lib/ZudokuContext-8jts0fF3.js.map +1 -0
- package/lib/{chunk-SYFQ2XB5-KWlHsT7t.js → chunk-SYFQ2XB5-BPvC-soB.js} +6 -5
- package/lib/{chunk-SYFQ2XB5-KWlHsT7t.js.map → chunk-SYFQ2XB5-BPvC-soB.js.map} +1 -1
- package/lib/circular-Dgpd6AN-.js +15397 -0
- package/lib/circular-Dgpd6AN-.js.map +1 -0
- package/lib/{createServer-BcaswoFO.js → createServer-BV0tHzLK.js} +3450 -5577
- package/lib/createServer-BV0tHzLK.js.map +1 -0
- package/lib/{hook-DUyACbIK.js → hook-BG02esyv.js} +2 -2
- package/lib/{hook-DUyACbIK.js.map → hook-BG02esyv.js.map} +1 -1
- package/lib/index-B7mqiOei.js +509 -0
- package/lib/index-B7mqiOei.js.map +1 -0
- package/lib/index-DmqsUPcm.js +1915 -0
- package/lib/index-DmqsUPcm.js.map +1 -0
- package/lib/joinUrl-BTy9bvoK.js +20 -0
- package/lib/joinUrl-BTy9bvoK.js.map +1 -0
- 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/ui/ActionButton.js +10 -11
- package/lib/ui/ActionButton.js.map +1 -1
- package/lib/ui/Command.js +125 -13
- package/lib/ui/Command.js.map +1 -1
- package/lib/ui/Select.js +2 -2
- package/lib/ui/Select.js.map +1 -1
- package/lib/{useExposedProps-BBHR7aLM.js → useExposedProps-BLKFBylA.js} +2 -2
- package/lib/{useExposedProps-BBHR7aLM.js.map → useExposedProps-BLKFBylA.js.map} +1 -1
- package/lib/useScrollToAnchor-Bl6mz9_x.js +288 -0
- package/lib/useScrollToAnchor-Bl6mz9_x.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +7 -9
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +1 -1
- package/lib/zudoku.auth-openid.js +223 -219
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +754 -992
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.plugin-api-catalog.js +3 -3
- package/lib/zudoku.plugin-api-keys.js +5 -5
- package/lib/zudoku.plugin-custom-pages.js +2 -2
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +4 -4
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/package.json +2 -2
- package/src/app/main.css +50 -50
- package/src/app/main.tsx +26 -7
- package/src/lib/authentication/providers/auth0.tsx +1 -4
- package/src/lib/authentication/providers/openid.tsx +12 -5
- package/src/lib/components/AnchorLink.tsx +5 -2
- package/src/lib/components/Autocomplete.tsx +111 -0
- package/src/lib/components/Header.tsx +4 -4
- package/src/lib/components/Markdown.tsx +14 -15
- package/src/lib/components/StatusPage.tsx +91 -0
- package/src/lib/components/SyntaxHighlight.tsx +14 -0
- package/src/lib/components/ThemeSwitch.tsx +14 -15
- package/src/lib/components/cache.ts +15 -0
- package/src/lib/components/context/ViewportAnchorContext.tsx +20 -6
- package/src/lib/components/context/ZudokuContext.ts +3 -1
- package/src/lib/components/index.ts +9 -2
- package/src/lib/core/RouteGuard.tsx +35 -0
- package/src/lib/core/ZudokuContext.ts +9 -8
- package/src/lib/oas/graphql/circular.ts +29 -0
- package/src/lib/oas/graphql/index.ts +9 -9
- package/src/lib/oas/parser/dereference/index.ts +1 -2
- package/src/lib/plugins/markdown/MdxPage.tsx +9 -1
- package/src/lib/plugins/openapi/OperationListItem.tsx +0 -2
- package/src/lib/plugins/openapi/ParameterListItem.tsx +1 -0
- package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +5 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +4 -2
- package/src/lib/plugins/openapi/index.tsx +9 -15
- package/src/lib/plugins/openapi/interfaces.ts +10 -2
- package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +54 -0
- package/src/lib/plugins/openapi/playground/Headers.tsx +136 -39
- package/src/lib/plugins/openapi/playground/ParamsGrid.tsx +8 -0
- package/src/lib/plugins/openapi/playground/PathParams.tsx +34 -74
- package/src/lib/plugins/openapi/playground/Playground.tsx +219 -177
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +1 -1
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +90 -122
- package/src/lib/plugins/openapi/playground/SubmitButton.tsx +75 -0
- package/src/lib/plugins/openapi/playground/result-panel/RequestTab.tsx +73 -0
- package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +210 -0
- package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +101 -0
- package/src/lib/plugins/openapi/playground/result-panel/convertToTypes.test.ts +64 -0
- package/src/lib/plugins/openapi/playground/result-panel/convertToTypes.ts +36 -0
- 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/Command.tsx +20 -0
- package/src/lib/ui/Select.tsx +1 -1
- package/src/lib/util/MdxComponents.tsx +2 -1
- package/src/lib/util/joinUrl.ts +57 -0
- package/src/lib/util/useScrollToAnchor.ts +32 -15
- 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/dist/lib/plugins/openapi/playground/ResponseTab.d.ts +0 -4
- package/dist/lib/plugins/openapi/playground/ResponseTab.js +0 -42
- package/dist/lib/plugins/openapi/playground/ResponseTab.js.map +0 -1
- package/lib/AnchorLink-_Vu02ceN.js +0 -34
- package/lib/AnchorLink-_Vu02ceN.js.map +0 -1
- package/lib/Button-oroWHXAy.js.map +0 -1
- package/lib/Command-D5DE0DD7.js +0 -611
- package/lib/Command-D5DE0DD7.js.map +0 -1
- package/lib/MdxPage-LNZLj_A5.js.map +0 -1
- package/lib/OperationList-PCwzTp1r.js +0 -5144
- package/lib/OperationList-PCwzTp1r.js.map +0 -1
- package/lib/Select-DkOpAG0c.js.map +0 -1
- package/lib/Spinner-C5gHXrVz.js +0 -7
- package/lib/Spinner-C5gHXrVz.js.map +0 -1
- package/lib/ZudokuContext-D3ayHjP-.js.map +0 -1
- package/lib/createServer-BcaswoFO.js.map +0 -1
- package/lib/index-CaILD1AV.js +0 -1292
- package/lib/index-CaILD1AV.js.map +0 -1
- package/lib/index-TaRXY2w1.js +0 -43
- package/lib/index-TaRXY2w1.js.map +0 -1
- package/src/lib/plugins/openapi/playground/EnumSelector.tsx +0 -86
- package/src/lib/plugins/openapi/playground/ResponseTab.tsx +0 -76
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Ke = (t) => {
|
|
2
2
|
throw TypeError(t);
|
|
3
3
|
};
|
|
4
|
-
var me = (t, e, s) => e.has(t) ||
|
|
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) ?
|
|
4
|
+
var me = (t, e, s) => e.has(t) || Ke("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) ? Ke("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), h = (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
|
-
import { createContext as
|
|
8
|
-
import { j as
|
|
9
|
-
import { u as pe, m as
|
|
10
|
-
var
|
|
7
|
+
import { createContext as pt, useContext as bt } from "react";
|
|
8
|
+
import { j as mt } from "./jsx-runtime-Bdg6XQ1m.js";
|
|
9
|
+
import { u as pe, m as vt } from "./chunk-SYFQ2XB5-BPvC-soB.js";
|
|
10
|
+
var Ae = class {
|
|
11
11
|
constructor() {
|
|
12
12
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
13
13
|
}
|
|
@@ -26,7 +26,7 @@ var Qe = class {
|
|
|
26
26
|
}, V = typeof window > "u" || "Deno" in globalThis;
|
|
27
27
|
function ge() {
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function Wt(t, e) {
|
|
30
30
|
return typeof t == "function" ? t(e) : t;
|
|
31
31
|
}
|
|
32
32
|
function Se(t) {
|
|
@@ -41,7 +41,7 @@ function fe(t, e) {
|
|
|
41
41
|
function x(t, e) {
|
|
42
42
|
return typeof t == "function" ? t(e) : t;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function Jt(t, e) {
|
|
45
45
|
const {
|
|
46
46
|
type: s = "all",
|
|
47
47
|
exact: r,
|
|
@@ -52,9 +52,9 @@ function Wt(t, e) {
|
|
|
52
52
|
} = t;
|
|
53
53
|
if (a) {
|
|
54
54
|
if (r) {
|
|
55
|
-
if (e.queryHash !==
|
|
55
|
+
if (e.queryHash !== gt(a, e.options))
|
|
56
56
|
return !1;
|
|
57
|
-
} else if (!
|
|
57
|
+
} else if (!Qe(e.queryKey, a))
|
|
58
58
|
return !1;
|
|
59
59
|
}
|
|
60
60
|
if (s !== "all") {
|
|
@@ -64,32 +64,32 @@ function Wt(t, e) {
|
|
|
64
64
|
}
|
|
65
65
|
return !(typeof u == "boolean" && e.isStale() !== u || i && i !== e.state.fetchStatus || o && !o(e));
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function Yt(t, e) {
|
|
68
68
|
const { exact: s, status: r, predicate: i, mutationKey: o } = t;
|
|
69
69
|
if (o) {
|
|
70
70
|
if (!e.options.mutationKey)
|
|
71
71
|
return !1;
|
|
72
72
|
if (s) {
|
|
73
|
-
if (
|
|
73
|
+
if (Ce(e.options.mutationKey) !== Ce(o))
|
|
74
74
|
return !1;
|
|
75
|
-
} else if (!
|
|
75
|
+
} else if (!Qe(e.options.mutationKey, o))
|
|
76
76
|
return !1;
|
|
77
77
|
}
|
|
78
78
|
return !(r && e.state.status !== r || i && !i(e));
|
|
79
79
|
}
|
|
80
|
-
function
|
|
81
|
-
return ((e == null ? void 0 : e.queryKeyHashFn) ||
|
|
80
|
+
function gt(t, e) {
|
|
81
|
+
return ((e == null ? void 0 : e.queryKeyHashFn) || Ce)(t);
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function Ce(t) {
|
|
84
84
|
return JSON.stringify(
|
|
85
85
|
t,
|
|
86
86
|
(e, s) => Ee(s) ? Object.keys(s).sort().reduce((r, i) => (r[i] = s[i], r), {}) : s
|
|
87
87
|
);
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? !Object.keys(e).some((s) => !
|
|
89
|
+
function Qe(t, e) {
|
|
90
|
+
return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? !Object.keys(e).some((s) => !Qe(t[s], e[s])) : !1;
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function Re(t, e) {
|
|
93
93
|
if (t === e)
|
|
94
94
|
return t;
|
|
95
95
|
const s = He(t) && He(e);
|
|
@@ -98,7 +98,7 @@ function Ce(t, e) {
|
|
|
98
98
|
let l = 0;
|
|
99
99
|
for (let S = 0; S < a; S++) {
|
|
100
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] =
|
|
101
|
+
(!s && r.includes(v) || s) && t[v] === void 0 && e[v] === void 0 ? (u[v] = void 0, l++) : (u[v] = Re(t[v], e[v]), u[v] === t[v] && t[v] !== void 0 && l++);
|
|
102
102
|
}
|
|
103
103
|
return i === a && l === i ? t : u;
|
|
104
104
|
}
|
|
@@ -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 St(t) {
|
|
131
131
|
return new Promise((e) => {
|
|
132
132
|
setTimeout(e, t);
|
|
133
133
|
});
|
|
@@ -138,13 +138,13 @@ function Oe(t, e, s) {
|
|
|
138
138
|
if (s.structuralSharing !== !1) {
|
|
139
139
|
if (process.env.NODE_ENV !== "production")
|
|
140
140
|
try {
|
|
141
|
-
return
|
|
141
|
+
return Re(t, e);
|
|
142
142
|
} catch (r) {
|
|
143
143
|
console.error(
|
|
144
144
|
`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${r}`
|
|
145
145
|
);
|
|
146
146
|
}
|
|
147
|
-
return
|
|
147
|
+
return Re(t, e);
|
|
148
148
|
}
|
|
149
149
|
return e;
|
|
150
150
|
}
|
|
@@ -152,23 +152,23 @@ function Xt(t, e, s = 0) {
|
|
|
152
152
|
const r = [...t, e];
|
|
153
153
|
return s && r.length > s ? r.slice(1) : r;
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function es(t, e, s = 0) {
|
|
156
156
|
const r = [e, ...t];
|
|
157
157
|
return s && r.length > s ? r.slice(0, -1) : r;
|
|
158
158
|
}
|
|
159
159
|
var ye = Symbol();
|
|
160
|
-
function
|
|
160
|
+
function Ct(t, e) {
|
|
161
161
|
return process.env.NODE_ENV !== "production" && t.queryFn === ye && console.error(
|
|
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
|
|
165
|
+
var _, Q, J, Ze, Rt = (Ze = class extends Ae {
|
|
166
166
|
constructor() {
|
|
167
167
|
super();
|
|
168
|
-
f(this,
|
|
169
|
-
f(this,
|
|
168
|
+
f(this, _);
|
|
169
|
+
f(this, Q);
|
|
170
170
|
f(this, J);
|
|
171
|
-
|
|
171
|
+
h(this, J, (e) => {
|
|
172
172
|
if (!V && window.addEventListener) {
|
|
173
173
|
const s = () => e();
|
|
174
174
|
return window.addEventListener("visibilitychange", s, !1), () => {
|
|
@@ -178,20 +178,20 @@ var K, q, J, Ze, St = (Ze = class extends Qe {
|
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
180
|
onSubscribe() {
|
|
181
|
-
n(this,
|
|
181
|
+
n(this, Q) || this.setEventListener(n(this, J));
|
|
182
182
|
}
|
|
183
183
|
onUnsubscribe() {
|
|
184
184
|
var e;
|
|
185
|
-
this.hasListeners() || ((e = n(this,
|
|
185
|
+
this.hasListeners() || ((e = n(this, Q)) == null || e.call(this), h(this, Q, void 0));
|
|
186
186
|
}
|
|
187
187
|
setEventListener(e) {
|
|
188
188
|
var s;
|
|
189
|
-
|
|
189
|
+
h(this, J, e), (s = n(this, Q)) == null || s.call(this), h(this, Q, e((r) => {
|
|
190
190
|
typeof r == "boolean" ? this.setFocused(r) : this.onFocus();
|
|
191
191
|
}));
|
|
192
192
|
}
|
|
193
193
|
setFocused(e) {
|
|
194
|
-
n(this,
|
|
194
|
+
n(this, _) !== e && (h(this, _, e), this.onFocus());
|
|
195
195
|
}
|
|
196
196
|
onFocus() {
|
|
197
197
|
const e = this.isFocused();
|
|
@@ -201,15 +201,15 @@ var K, q, J, Ze, St = (Ze = class extends Qe {
|
|
|
201
201
|
}
|
|
202
202
|
isFocused() {
|
|
203
203
|
var e;
|
|
204
|
-
return typeof n(this,
|
|
204
|
+
return typeof n(this, _) == "boolean" ? n(this, _) : ((e = globalThis.document) == null ? void 0 : e.visibilityState) !== "hidden";
|
|
205
205
|
}
|
|
206
|
-
},
|
|
206
|
+
}, _ = new WeakMap(), Q = new WeakMap(), J = new WeakMap(), Ze), tt = new Rt(), Y, U, X, We, wt = (We = class extends Ae {
|
|
207
207
|
constructor() {
|
|
208
208
|
super();
|
|
209
|
-
f(this,
|
|
210
|
-
f(this,
|
|
211
|
-
f(this,
|
|
212
|
-
|
|
209
|
+
f(this, Y, !0);
|
|
210
|
+
f(this, U);
|
|
211
|
+
f(this, X);
|
|
212
|
+
h(this, X, (e) => {
|
|
213
213
|
if (!V && window.addEventListener) {
|
|
214
214
|
const s = () => e(!0), r = () => e(!1);
|
|
215
215
|
return window.addEventListener("online", s, !1), window.addEventListener("offline", r, !1), () => {
|
|
@@ -219,25 +219,25 @@ var K, q, J, Ze, St = (Ze = class extends Qe {
|
|
|
219
219
|
});
|
|
220
220
|
}
|
|
221
221
|
onSubscribe() {
|
|
222
|
-
n(this,
|
|
222
|
+
n(this, U) || this.setEventListener(n(this, X));
|
|
223
223
|
}
|
|
224
224
|
onUnsubscribe() {
|
|
225
225
|
var e;
|
|
226
|
-
this.hasListeners() || ((e = n(this,
|
|
226
|
+
this.hasListeners() || ((e = n(this, U)) == null || e.call(this), h(this, U, void 0));
|
|
227
227
|
}
|
|
228
228
|
setEventListener(e) {
|
|
229
229
|
var s;
|
|
230
|
-
|
|
230
|
+
h(this, X, e), (s = n(this, U)) == null || s.call(this), h(this, U, e(this.setOnline.bind(this)));
|
|
231
231
|
}
|
|
232
232
|
setOnline(e) {
|
|
233
|
-
n(this,
|
|
233
|
+
n(this, Y) !== e && (h(this, Y, e), this.listeners.forEach((r) => {
|
|
234
234
|
r(e);
|
|
235
235
|
}));
|
|
236
236
|
}
|
|
237
237
|
isOnline() {
|
|
238
|
-
return n(this,
|
|
238
|
+
return n(this, Y);
|
|
239
239
|
}
|
|
240
|
-
},
|
|
240
|
+
}, Y = new WeakMap(), U = new WeakMap(), X = new WeakMap(), We), st = new wt();
|
|
241
241
|
function Fe() {
|
|
242
242
|
let t, e;
|
|
243
243
|
const s = new Promise((i, o) => {
|
|
@@ -260,7 +260,7 @@ function Fe() {
|
|
|
260
260
|
}), e(i);
|
|
261
261
|
}, s;
|
|
262
262
|
}
|
|
263
|
-
function
|
|
263
|
+
function Et(t) {
|
|
264
264
|
return Math.min(1e3 * 2 ** t, 3e4);
|
|
265
265
|
}
|
|
266
266
|
function rt(t) {
|
|
@@ -274,19 +274,19 @@ var nt = class extends Error {
|
|
|
274
274
|
function ve(t) {
|
|
275
275
|
return t instanceof nt;
|
|
276
276
|
}
|
|
277
|
-
function
|
|
277
|
+
function Ot(t) {
|
|
278
278
|
let e = !1, s = 0, r = !1, i;
|
|
279
279
|
const o = Fe(), a = (b) => {
|
|
280
280
|
var p;
|
|
281
|
-
r || (
|
|
281
|
+
r || (C(new nt(b)), (p = t.abort) == null || p.call(t));
|
|
282
282
|
}, u = () => {
|
|
283
283
|
e = !0;
|
|
284
284
|
}, l = () => {
|
|
285
285
|
e = !1;
|
|
286
|
-
}, S = () => tt.isFocused() && (t.networkMode === "always" || st.isOnline()) && t.canRun(), v = () => rt(t.networkMode) && t.canRun(),
|
|
286
|
+
}, S = () => tt.isFocused() && (t.networkMode === "always" || st.isOnline()) && t.canRun(), v = () => rt(t.networkMode) && t.canRun(), c = (b) => {
|
|
287
287
|
var p;
|
|
288
288
|
r || (r = !0, (p = t.onSuccess) == null || p.call(t, b), i == null || i(), o.resolve(b));
|
|
289
|
-
},
|
|
289
|
+
}, C = (b) => {
|
|
290
290
|
var p;
|
|
291
291
|
r || (r = !0, (p = t.onError) == null || p.call(t, b), i == null || i(), o.reject(b));
|
|
292
292
|
}, g = () => new Promise((b) => {
|
|
@@ -307,17 +307,17 @@ function wt(t) {
|
|
|
307
307
|
} catch (E) {
|
|
308
308
|
b = Promise.reject(E);
|
|
309
309
|
}
|
|
310
|
-
Promise.resolve(b).then(
|
|
310
|
+
Promise.resolve(b).then(c).catch((E) => {
|
|
311
311
|
var be;
|
|
312
312
|
if (r)
|
|
313
313
|
return;
|
|
314
|
-
const
|
|
314
|
+
const q = t.retry ?? (V ? 0 : 3), N = t.retryDelay ?? Et, he = typeof N == "function" ? N(s, E) : N, le = q === !0 || typeof q == "number" && s < q || typeof q == "function" && q(s, E);
|
|
315
315
|
if (e || !le) {
|
|
316
|
-
|
|
316
|
+
C(E);
|
|
317
317
|
return;
|
|
318
318
|
}
|
|
319
|
-
s++, (be = t.onFail) == null || be.call(t, s, E),
|
|
320
|
-
e ?
|
|
319
|
+
s++, (be = t.onFail) == null || be.call(t, s, E), St(he).then(() => S() ? void 0 : g()).then(() => {
|
|
320
|
+
e ? C(E) : w();
|
|
321
321
|
});
|
|
322
322
|
});
|
|
323
323
|
};
|
|
@@ -331,7 +331,7 @@ function wt(t) {
|
|
|
331
331
|
start: () => (v() ? w() : g().then(w), o)
|
|
332
332
|
};
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function Ft() {
|
|
335
335
|
let t = [], e = 0, s = (u) => {
|
|
336
336
|
u();
|
|
337
337
|
}, r = (u) => {
|
|
@@ -390,15 +390,15 @@ function Et() {
|
|
|
390
390
|
}
|
|
391
391
|
};
|
|
392
392
|
}
|
|
393
|
-
var
|
|
393
|
+
var Ue = Ft(), K, Je, It = (Je = class {
|
|
394
394
|
constructor() {
|
|
395
|
-
f(this,
|
|
395
|
+
f(this, K);
|
|
396
396
|
}
|
|
397
397
|
destroy() {
|
|
398
398
|
this.clearGcTimeout();
|
|
399
399
|
}
|
|
400
400
|
scheduleGc() {
|
|
401
|
-
this.clearGcTimeout(), Se(this.gcTime) &&
|
|
401
|
+
this.clearGcTimeout(), Se(this.gcTime) && h(this, K, 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
|
-
n(this,
|
|
412
|
+
n(this, K) && (clearTimeout(n(this, K)), h(this, K, void 0));
|
|
413
413
|
}
|
|
414
|
-
},
|
|
414
|
+
}, K = new WeakMap(), Je), ee, te, P, R, ue, H, D, A, Ye, ts = (Ye = class extends It {
|
|
415
415
|
constructor(e) {
|
|
416
416
|
super();
|
|
417
417
|
f(this, D);
|
|
418
418
|
f(this, ee);
|
|
419
419
|
f(this, te);
|
|
420
|
-
f(this,
|
|
421
|
-
f(this,
|
|
420
|
+
f(this, P);
|
|
421
|
+
f(this, R);
|
|
422
422
|
f(this, ue);
|
|
423
423
|
f(this, H);
|
|
424
|
-
|
|
424
|
+
h(this, H, !1), h(this, ue, e.defaultOptions), this.setOptions(e.options), this.observers = [], h(this, P, e.cache), this.queryKey = e.queryKey, this.queryHash = e.queryHash, h(this, ee, Pt(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 = n(this,
|
|
431
|
+
return (e = n(this, R)) == null ? void 0 : e.promise;
|
|
432
432
|
}
|
|
433
433
|
setOptions(e) {
|
|
434
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" && n(this,
|
|
437
|
+
!this.observers.length && this.state.fetchStatus === "idle" && n(this, P).remove(this);
|
|
438
438
|
}
|
|
439
439
|
setData(e, s) {
|
|
440
440
|
const r = Oe(this.state.data, e, this.options);
|
|
441
|
-
return m(this, D,
|
|
441
|
+
return m(this, D, A).call(this, {
|
|
442
442
|
data: r,
|
|
443
443
|
type: "success",
|
|
444
444
|
dataUpdatedAt: s == null ? void 0 : s.updatedAt,
|
|
@@ -446,12 +446,12 @@ var Ae = Et(), _, Je, Ot = (Je = class {
|
|
|
446
446
|
}), r;
|
|
447
447
|
}
|
|
448
448
|
setState(e, s) {
|
|
449
|
-
m(this, D,
|
|
449
|
+
m(this, D, A).call(this, { type: "setState", state: e, setStateOptions: s });
|
|
450
450
|
}
|
|
451
451
|
cancel(e) {
|
|
452
452
|
var r, i;
|
|
453
|
-
const s = (r = n(this,
|
|
454
|
-
return (i = n(this,
|
|
453
|
+
const s = (r = n(this, R)) == null ? void 0 : r.promise;
|
|
454
|
+
return (i = n(this, R)) == 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 });
|
|
@@ -478,55 +478,55 @@ 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 = n(this,
|
|
481
|
+
e == null || e.refetch({ cancelRefetch: !1 }), (s = n(this, R)) == 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 = n(this,
|
|
486
|
+
e == null || e.refetch({ cancelRefetch: !1 }), (s = n(this, R)) == null || s.continue();
|
|
487
487
|
}
|
|
488
488
|
addObserver(e) {
|
|
489
|
-
this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(), n(this,
|
|
489
|
+
this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(), n(this, P).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 || (n(this,
|
|
492
|
+
this.observers.includes(e) && (this.observers = this.observers.filter((s) => s !== e), this.observers.length || (n(this, R) && (n(this, H) ? n(this, R).cancel({ revert: !0 }) : n(this, R).cancelRetry()), this.scheduleGc()), n(this, P).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 || m(this, D,
|
|
498
|
+
this.state.isInvalidated || m(this, D, A).call(this, { type: "invalidate" });
|
|
499
499
|
}
|
|
500
500
|
fetch(e, s) {
|
|
501
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 (n(this,
|
|
506
|
-
return n(this,
|
|
505
|
+
else if (n(this, R))
|
|
506
|
+
return n(this, R).continueRetry(), n(this, R).promise;
|
|
507
507
|
}
|
|
508
508
|
if (e && this.setOptions(e), !this.options.queryFn) {
|
|
509
|
-
const
|
|
510
|
-
|
|
509
|
+
const c = this.observers.find((C) => C.options.queryFn);
|
|
510
|
+
c && this.setOptions(c.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(), i = (
|
|
516
|
-
Object.defineProperty(
|
|
515
|
+
const r = new AbortController(), i = (c) => {
|
|
516
|
+
Object.defineProperty(c, "signal", {
|
|
517
517
|
enumerable: !0,
|
|
518
|
-
get: () => (
|
|
518
|
+
get: () => (h(this, H, !0), r.signal)
|
|
519
519
|
});
|
|
520
520
|
}, o = () => {
|
|
521
|
-
const
|
|
521
|
+
const c = Ct(this.options, s), C = {
|
|
522
522
|
queryKey: this.queryKey,
|
|
523
523
|
meta: this.meta
|
|
524
524
|
};
|
|
525
|
-
return i(
|
|
526
|
-
|
|
527
|
-
|
|
525
|
+
return i(C), h(this, H, !1), this.options.persister ? this.options.persister(
|
|
526
|
+
c,
|
|
527
|
+
C,
|
|
528
528
|
this
|
|
529
|
-
) :
|
|
529
|
+
) : c(C);
|
|
530
530
|
}, a = {
|
|
531
531
|
fetchOptions: s,
|
|
532
532
|
options: this.options,
|
|
@@ -537,65 +537,65 @@ var Ae = Et(), _, Je, Ot = (Je = class {
|
|
|
537
537
|
i(a), (l = this.options.behavior) == null || l.onFetch(
|
|
538
538
|
a,
|
|
539
539
|
this
|
|
540
|
-
),
|
|
541
|
-
const u = (
|
|
542
|
-
var
|
|
543
|
-
ve(
|
|
540
|
+
), h(this, te, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((S = a.fetchOptions) == null ? void 0 : S.meta)) && m(this, D, A).call(this, { type: "fetch", meta: (v = a.fetchOptions) == null ? void 0 : v.meta });
|
|
541
|
+
const u = (c) => {
|
|
542
|
+
var C, g, w, b;
|
|
543
|
+
ve(c) && c.silent || m(this, D, A).call(this, {
|
|
544
544
|
type: "error",
|
|
545
|
-
error:
|
|
546
|
-
}), ve(
|
|
547
|
-
|
|
548
|
-
|
|
545
|
+
error: c
|
|
546
|
+
}), ve(c) || ((g = (C = n(this, P).config).onError) == null || g.call(
|
|
547
|
+
C,
|
|
548
|
+
c,
|
|
549
549
|
this
|
|
550
|
-
), (b = (w = n(this,
|
|
550
|
+
), (b = (w = n(this, P).config).onSettled) == null || b.call(
|
|
551
551
|
w,
|
|
552
552
|
this.state.data,
|
|
553
|
-
|
|
553
|
+
c,
|
|
554
554
|
this
|
|
555
555
|
)), this.scheduleGc();
|
|
556
556
|
};
|
|
557
|
-
return
|
|
557
|
+
return h(this, R, Ot({
|
|
558
558
|
initialPromise: s == null ? void 0 : s.initialPromise,
|
|
559
559
|
fn: a.fetchFn,
|
|
560
560
|
abort: r.abort.bind(r),
|
|
561
|
-
onSuccess: (
|
|
562
|
-
var
|
|
563
|
-
if (
|
|
561
|
+
onSuccess: (c) => {
|
|
562
|
+
var C, g, w, b;
|
|
563
|
+
if (c === 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
|
-
this.setData(
|
|
570
|
+
this.setData(c);
|
|
571
571
|
} catch (p) {
|
|
572
572
|
u(p);
|
|
573
573
|
return;
|
|
574
574
|
}
|
|
575
|
-
(g = (
|
|
575
|
+
(g = (C = n(this, P).config).onSuccess) == null || g.call(C, c, this), (b = (w = n(this, P).config).onSettled) == null || b.call(
|
|
576
576
|
w,
|
|
577
|
-
|
|
577
|
+
c,
|
|
578
578
|
this.state.error,
|
|
579
579
|
this
|
|
580
580
|
), this.scheduleGc();
|
|
581
581
|
},
|
|
582
582
|
onError: u,
|
|
583
|
-
onFail: (
|
|
584
|
-
m(this, D,
|
|
583
|
+
onFail: (c, C) => {
|
|
584
|
+
m(this, D, A).call(this, { type: "failed", failureCount: c, error: C });
|
|
585
585
|
},
|
|
586
586
|
onPause: () => {
|
|
587
|
-
m(this, D,
|
|
587
|
+
m(this, D, A).call(this, { type: "pause" });
|
|
588
588
|
},
|
|
589
589
|
onContinue: () => {
|
|
590
|
-
m(this, D,
|
|
590
|
+
m(this, D, A).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
|
-
})), n(this,
|
|
596
|
+
})), n(this, R).start();
|
|
597
597
|
}
|
|
598
|
-
}, ee = new WeakMap(), te = new WeakMap(),
|
|
598
|
+
}, ee = new WeakMap(), te = new WeakMap(), P = new WeakMap(), R = new WeakMap(), ue = new WeakMap(), H = new WeakMap(), D = new WeakSet(), A = function(e) {
|
|
599
599
|
const s = (r) => {
|
|
600
600
|
switch (e.type) {
|
|
601
601
|
case "failed":
|
|
@@ -659,12 +659,12 @@ var Ae = Et(), _, Je, Ot = (Je = class {
|
|
|
659
659
|
};
|
|
660
660
|
}
|
|
661
661
|
};
|
|
662
|
-
this.state = s(this.state),
|
|
662
|
+
this.state = s(this.state), Ue.batch(() => {
|
|
663
663
|
this.observers.forEach((r) => {
|
|
664
664
|
r.onQueryUpdate();
|
|
665
|
-
}), n(this,
|
|
665
|
+
}), n(this, P).notify({ query: this, type: "updated", action: e });
|
|
666
666
|
});
|
|
667
|
-
},
|
|
667
|
+
}, Ye);
|
|
668
668
|
function it(t, e) {
|
|
669
669
|
return {
|
|
670
670
|
fetchFailureCount: 0,
|
|
@@ -676,7 +676,7 @@ function it(t, e) {
|
|
|
676
676
|
}
|
|
677
677
|
};
|
|
678
678
|
}
|
|
679
|
-
function
|
|
679
|
+
function Pt(t) {
|
|
680
680
|
const e = typeof t.initialData == "function" ? t.initialData() : t.initialData, s = e !== void 0, r = s ? typeof t.initialDataUpdatedAt == "function" ? t.initialDataUpdatedAt() : t.initialDataUpdatedAt : 0;
|
|
681
681
|
return {
|
|
682
682
|
data: e,
|
|
@@ -693,11 +693,11 @@ function Ft(t) {
|
|
|
693
693
|
fetchStatus: "idle"
|
|
694
694
|
};
|
|
695
695
|
}
|
|
696
|
-
var
|
|
696
|
+
var I, d, oe, F, B, se, M, k, ce, re, ne, G, z, L, ie, y, ae, Ie, Pe, Te, De, xe, je, ke, ut, Xe, at = (Xe = class extends Ae {
|
|
697
697
|
constructor(e, s) {
|
|
698
698
|
super();
|
|
699
699
|
f(this, y);
|
|
700
|
-
f(this,
|
|
700
|
+
f(this, I);
|
|
701
701
|
f(this, d);
|
|
702
702
|
f(this, oe);
|
|
703
703
|
f(this, F);
|
|
@@ -705,7 +705,7 @@ var P, d, oe, F, B, se, M, k, he, re, ne, G, z, L, ie, y, ae, Pe, Ie, Te, De, xe
|
|
|
705
705
|
f(this, se);
|
|
706
706
|
f(this, M);
|
|
707
707
|
f(this, k);
|
|
708
|
-
f(this,
|
|
708
|
+
f(this, ce);
|
|
709
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.
|
|
@@ -714,7 +714,7 @@ var P, d, oe, F, B, se, M, k, he, re, ne, G, z, L, ie, y, ae, Pe, Ie, Te, De, xe
|
|
|
714
714
|
f(this, z);
|
|
715
715
|
f(this, L);
|
|
716
716
|
f(this, ie, /* @__PURE__ */ new Set());
|
|
717
|
-
this.options = s,
|
|
717
|
+
this.options = s, h(this, I, e), h(this, k, null), h(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
|
}
|
|
@@ -728,14 +728,14 @@ var P, d, oe, F, B, se, M, k, he, re, ne, G, z, L, ie, y, ae, Pe, Ie, Te, De, xe
|
|
|
728
728
|
this.hasListeners() || this.destroy();
|
|
729
729
|
}
|
|
730
730
|
shouldFetchOnReconnect() {
|
|
731
|
-
return
|
|
731
|
+
return qe(
|
|
732
732
|
n(this, d),
|
|
733
733
|
this.options,
|
|
734
734
|
this.options.refetchOnReconnect
|
|
735
735
|
);
|
|
736
736
|
}
|
|
737
737
|
shouldFetchOnWindowFocus() {
|
|
738
|
-
return
|
|
738
|
+
return qe(
|
|
739
739
|
n(this, d),
|
|
740
740
|
this.options,
|
|
741
741
|
this.options.refetchOnWindowFocus
|
|
@@ -746,11 +746,11 @@ var P, d, oe, F, B, se, M, k, he, re, ne, G, z, L, ie, y, ae, Pe, Ie, Te, De, xe
|
|
|
746
746
|
}
|
|
747
747
|
setOptions(e, s) {
|
|
748
748
|
const r = this.options, i = n(this, d);
|
|
749
|
-
if (this.options = n(this,
|
|
749
|
+
if (this.options = n(this, I).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
|
-
m(this, y, ke).call(this), n(this, d).setOptions(this.options), r._defaulted && !we(this.options, r) && n(this,
|
|
753
|
+
m(this, y, ke).call(this), n(this, d).setOptions(this.options), r._defaulted && !we(this.options, r) && n(this, I).getQueryCache().notify({
|
|
754
754
|
type: "observerOptionsUpdated",
|
|
755
755
|
query: n(this, d),
|
|
756
756
|
observer: this
|
|
@@ -761,13 +761,13 @@ var P, d, oe, F, B, se, M, k, he, re, ne, G, z, L, ie, y, ae, Pe, Ie, Te, De, xe
|
|
|
761
761
|
i,
|
|
762
762
|
this.options,
|
|
763
763
|
r
|
|
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,
|
|
765
|
-
const a = m(this, y,
|
|
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, Ie).call(this);
|
|
765
|
+
const a = m(this, y, Pe).call(this);
|
|
766
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 = n(this,
|
|
770
|
-
return
|
|
769
|
+
const s = n(this, I).getQueryCache().build(n(this, I), e), r = this.createResult(s, e);
|
|
770
|
+
return Dt(this, r) && (h(this, F, r), h(this, se, this.options), h(this, B, n(this, d).state)), r;
|
|
771
771
|
}
|
|
772
772
|
getCurrentResult() {
|
|
773
773
|
return n(this, F);
|
|
@@ -794,7 +794,7 @@ var P, d, oe, F, B, se, M, k, he, re, ne, G, z, L, ie, y, ae, Pe, Ie, Te, De, xe
|
|
|
794
794
|
});
|
|
795
795
|
}
|
|
796
796
|
fetchOptimistic(e) {
|
|
797
|
-
const s = n(this,
|
|
797
|
+
const s = n(this, I).defaultQueryOptions(e), r = n(this, I).getQueryCache().build(n(this, I), s);
|
|
798
798
|
return r.fetch().then(() => this.createResult(r, s));
|
|
799
799
|
}
|
|
800
800
|
fetch(e) {
|
|
@@ -804,70 +804,70 @@ var P, d, oe, F, B, se, M, k, he, re, ne, G, z, L, ie, y, ae, Pe, Ie, Te, De, xe
|
|
|
804
804
|
}).then(() => (this.updateResult(), n(this, F)));
|
|
805
805
|
}
|
|
806
806
|
createResult(e, s) {
|
|
807
|
-
var
|
|
807
|
+
var _e;
|
|
808
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
|
|
809
|
+
let c = { ...v }, C = !1, g;
|
|
810
810
|
if (s._optimisticResults) {
|
|
811
811
|
const O = this.hasListeners(), Z = !O && Ge(e, s), W = O && ze(e, r, s, i);
|
|
812
|
-
(Z || W) && (
|
|
813
|
-
...
|
|
812
|
+
(Z || W) && (c = {
|
|
813
|
+
...c,
|
|
814
814
|
...it(v.data, e.options)
|
|
815
|
-
}), s._optimisticResults === "isRestoring" && (
|
|
815
|
+
}), s._optimisticResults === "isRestoring" && (c.fetchStatus = "idle");
|
|
816
816
|
}
|
|
817
|
-
let { error: w, errorUpdatedAt: b, status: p } =
|
|
818
|
-
if (s.select &&
|
|
819
|
-
if (o &&
|
|
817
|
+
let { error: w, errorUpdatedAt: b, status: p } = c;
|
|
818
|
+
if (s.select && c.data !== void 0)
|
|
819
|
+
if (o && c.data === (a == null ? void 0 : a.data) && s.select === n(this, ce))
|
|
820
820
|
g = n(this, re);
|
|
821
821
|
else
|
|
822
822
|
try {
|
|
823
|
-
|
|
823
|
+
h(this, ce, s.select), g = s.select(c.data), g = Oe(o == null ? void 0 : o.data, g, s), h(this, re, g), h(this, k, null);
|
|
824
824
|
} catch (O) {
|
|
825
|
-
|
|
825
|
+
h(this, k, O);
|
|
826
826
|
}
|
|
827
827
|
else
|
|
828
|
-
g =
|
|
828
|
+
g = c.data;
|
|
829
829
|
if (s.placeholderData !== void 0 && g === void 0 && p === "pending") {
|
|
830
830
|
let O;
|
|
831
831
|
if (o != null && o.isPlaceholderData && s.placeholderData === (u == null ? void 0 : u.placeholderData))
|
|
832
832
|
O = o.data;
|
|
833
833
|
else if (O = typeof s.placeholderData == "function" ? s.placeholderData(
|
|
834
|
-
(
|
|
834
|
+
(_e = n(this, ne)) == null ? void 0 : _e.state.data,
|
|
835
835
|
n(this, ne)
|
|
836
836
|
) : s.placeholderData, s.select && O !== void 0)
|
|
837
837
|
try {
|
|
838
|
-
O = s.select(O),
|
|
838
|
+
O = s.select(O), h(this, k, null);
|
|
839
839
|
} catch (Z) {
|
|
840
|
-
|
|
840
|
+
h(this, k, Z);
|
|
841
841
|
}
|
|
842
842
|
O !== void 0 && (p = "success", g = Oe(
|
|
843
843
|
o == null ? void 0 : o.data,
|
|
844
844
|
O,
|
|
845
845
|
s
|
|
846
|
-
),
|
|
846
|
+
), C = !0);
|
|
847
847
|
}
|
|
848
848
|
n(this, k) && (w = n(this, k), g = n(this, re), b = Date.now(), p = "error");
|
|
849
|
-
const E =
|
|
849
|
+
const E = c.fetchStatus === "fetching", q = p === "pending", N = p === "error", he = q && E, le = g !== void 0, j = {
|
|
850
850
|
status: p,
|
|
851
|
-
fetchStatus:
|
|
852
|
-
isPending:
|
|
851
|
+
fetchStatus: c.fetchStatus,
|
|
852
|
+
isPending: q,
|
|
853
853
|
isSuccess: p === "success",
|
|
854
854
|
isError: N,
|
|
855
|
-
isInitialLoading:
|
|
856
|
-
isLoading:
|
|
855
|
+
isInitialLoading: he,
|
|
856
|
+
isLoading: he,
|
|
857
857
|
data: g,
|
|
858
|
-
dataUpdatedAt:
|
|
858
|
+
dataUpdatedAt: c.dataUpdatedAt,
|
|
859
859
|
error: w,
|
|
860
860
|
errorUpdatedAt: b,
|
|
861
|
-
failureCount:
|
|
862
|
-
failureReason:
|
|
863
|
-
errorUpdateCount:
|
|
864
|
-
isFetched:
|
|
865
|
-
isFetchedAfterMount:
|
|
861
|
+
failureCount: c.fetchFailureCount,
|
|
862
|
+
failureReason: c.fetchFailureReason,
|
|
863
|
+
errorUpdateCount: c.errorUpdateCount,
|
|
864
|
+
isFetched: c.dataUpdateCount > 0 || c.errorUpdateCount > 0,
|
|
865
|
+
isFetchedAfterMount: c.dataUpdateCount > S.dataUpdateCount || c.errorUpdateCount > S.errorUpdateCount,
|
|
866
866
|
isFetching: E,
|
|
867
|
-
isRefetching: E && !
|
|
867
|
+
isRefetching: E && !q,
|
|
868
868
|
isLoadingError: N && !le,
|
|
869
|
-
isPaused:
|
|
870
|
-
isPlaceholderData:
|
|
869
|
+
isPaused: c.fetchStatus === "paused",
|
|
870
|
+
isPlaceholderData: C,
|
|
871
871
|
isRefetchError: N && le,
|
|
872
872
|
isStale: Me(e, s),
|
|
873
873
|
refetch: this.refetch,
|
|
@@ -877,7 +877,7 @@ var P, d, oe, F, B, se, M, k, he, re, ne, G, z, L, ie, y, ae, Pe, Ie, Te, De, xe
|
|
|
877
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 =
|
|
880
|
+
const de = h(this, M, j.promise = Fe());
|
|
881
881
|
O(de);
|
|
882
882
|
}, W = n(this, M);
|
|
883
883
|
switch (W.status) {
|
|
@@ -896,9 +896,9 @@ var P, d, oe, F, B, se, M, k, he, re, ne, G, z, L, ie, y, ae, Pe, Ie, Te, De, xe
|
|
|
896
896
|
}
|
|
897
897
|
updateResult(e) {
|
|
898
898
|
const s = n(this, F), r = this.createResult(n(this, d), this.options);
|
|
899
|
-
if (
|
|
899
|
+
if (h(this, B, n(this, d).state), h(this, se, this.options), n(this, B).data !== void 0 && h(this, ne, n(this, d)), we(r, s))
|
|
900
900
|
return;
|
|
901
|
-
|
|
901
|
+
h(this, F, r);
|
|
902
902
|
const i = {}, o = () => {
|
|
903
903
|
if (!s)
|
|
904
904
|
return !0;
|
|
@@ -918,14 +918,14 @@ var P, d, oe, F, B, se, M, k, he, re, ne, G, z, L, ie, y, ae, Pe, Ie, Te, De, xe
|
|
|
918
918
|
onQueryUpdate() {
|
|
919
919
|
this.updateResult(), this.hasListeners() && m(this, y, De).call(this);
|
|
920
920
|
}
|
|
921
|
-
},
|
|
921
|
+
}, I = new WeakMap(), d = new WeakMap(), oe = new WeakMap(), F = new WeakMap(), B = new WeakMap(), se = new WeakMap(), M = new WeakMap(), k = new WeakMap(), ce = 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
922
|
m(this, y, ke).call(this);
|
|
923
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
|
+
}, Ie = function() {
|
|
929
929
|
m(this, y, xe).call(this);
|
|
930
930
|
const e = fe(
|
|
931
931
|
this.options.staleTime,
|
|
@@ -934,44 +934,44 @@ var P, d, oe, F, B, se, M, k, he, re, ne, G, z, L, ie, y, ae, Pe, Ie, Te, De, xe
|
|
|
934
934
|
if (V || n(this, F).isStale || !Se(e))
|
|
935
935
|
return;
|
|
936
936
|
const r = et(n(this, F).dataUpdatedAt, e) + 1;
|
|
937
|
-
|
|
937
|
+
h(this, G, setTimeout(() => {
|
|
938
938
|
n(this, F).isStale || this.updateResult();
|
|
939
939
|
}, r));
|
|
940
|
-
},
|
|
940
|
+
}, Pe = function() {
|
|
941
941
|
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(n(this, d)) : this.options.refetchInterval) ?? !1;
|
|
942
942
|
}, Te = function(e) {
|
|
943
|
-
m(this, y, je).call(this),
|
|
943
|
+
m(this, y, je).call(this), h(this, L, e), !(V || x(this.options.enabled, n(this, d)) === !1 || !Se(n(this, L)) || n(this, L) === 0) && h(this, z, setInterval(() => {
|
|
944
944
|
(this.options.refetchIntervalInBackground || tt.isFocused()) && m(this, y, ae).call(this);
|
|
945
945
|
}, n(this, L)));
|
|
946
946
|
}, De = function() {
|
|
947
|
-
m(this, y,
|
|
947
|
+
m(this, y, Ie).call(this), m(this, y, Te).call(this, m(this, y, Pe).call(this));
|
|
948
948
|
}, xe = function() {
|
|
949
|
-
n(this, G) && (clearTimeout(n(this, G)),
|
|
949
|
+
n(this, G) && (clearTimeout(n(this, G)), h(this, G, void 0));
|
|
950
950
|
}, je = function() {
|
|
951
|
-
n(this, z) && (clearInterval(n(this, z)),
|
|
951
|
+
n(this, z) && (clearInterval(n(this, z)), h(this, z, void 0));
|
|
952
952
|
}, ke = function() {
|
|
953
|
-
const e = n(this,
|
|
953
|
+
const e = n(this, I).getQueryCache().build(n(this, I), this.options);
|
|
954
954
|
if (e === n(this, d))
|
|
955
955
|
return;
|
|
956
956
|
const s = n(this, d);
|
|
957
|
-
|
|
957
|
+
h(this, d, e), h(this, oe, e.state), this.hasListeners() && (s == null || s.removeObserver(this), e.addObserver(this));
|
|
958
958
|
}, ut = function(e) {
|
|
959
|
-
|
|
959
|
+
Ue.batch(() => {
|
|
960
960
|
e.listeners && this.listeners.forEach((s) => {
|
|
961
961
|
s(n(this, F));
|
|
962
|
-
}), n(this,
|
|
962
|
+
}), n(this, I).getQueryCache().notify({
|
|
963
963
|
query: n(this, d),
|
|
964
964
|
type: "observerResultsUpdated"
|
|
965
965
|
});
|
|
966
966
|
});
|
|
967
|
-
},
|
|
968
|
-
function
|
|
967
|
+
}, Xe);
|
|
968
|
+
function Tt(t, e) {
|
|
969
969
|
return x(e.enabled, t) !== !1 && t.state.data === void 0 && !(t.state.status === "error" && e.retryOnMount === !1);
|
|
970
970
|
}
|
|
971
971
|
function Ge(t, e) {
|
|
972
|
-
return
|
|
972
|
+
return Tt(t, e) || t.state.data !== void 0 && qe(t, e, e.refetchOnMount);
|
|
973
973
|
}
|
|
974
|
-
function
|
|
974
|
+
function qe(t, e, s) {
|
|
975
975
|
if (x(e.enabled, t) !== !1) {
|
|
976
976
|
const r = typeof s == "function" ? s(t) : s;
|
|
977
977
|
return r === "always" || r !== !1 && Me(t, e);
|
|
@@ -984,26 +984,26 @@ function ze(t, e, s, r) {
|
|
|
984
984
|
function Me(t, e) {
|
|
985
985
|
return x(e.enabled, t) !== !1 && t.isStaleByTime(fe(e.staleTime, t));
|
|
986
986
|
}
|
|
987
|
-
function
|
|
987
|
+
function Dt(t, e) {
|
|
988
988
|
return !we(t.getCurrentResult(), e);
|
|
989
989
|
}
|
|
990
990
|
var ot = T.createContext(
|
|
991
991
|
void 0
|
|
992
|
-
),
|
|
992
|
+
), ct = (t) => {
|
|
993
993
|
const e = T.useContext(ot);
|
|
994
994
|
if (t)
|
|
995
995
|
return t;
|
|
996
996
|
if (!e)
|
|
997
997
|
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
998
998
|
return e;
|
|
999
|
-
},
|
|
999
|
+
}, ss = ({
|
|
1000
1000
|
client: t,
|
|
1001
1001
|
children: e
|
|
1002
1002
|
}) => (T.useEffect(() => (t.mount(), () => {
|
|
1003
1003
|
t.unmount();
|
|
1004
|
-
}), [t]), /* @__PURE__ */
|
|
1004
|
+
}), [t]), /* @__PURE__ */ mt.jsx(ot.Provider, { value: t, children: e })), ht = T.createContext(!1), xt = () => T.useContext(ht);
|
|
1005
1005
|
ht.Provider;
|
|
1006
|
-
function
|
|
1006
|
+
function jt() {
|
|
1007
1007
|
let t = !1;
|
|
1008
1008
|
return {
|
|
1009
1009
|
clearReset: () => {
|
|
@@ -1015,40 +1015,40 @@ function xt() {
|
|
|
1015
1015
|
isReset: () => t
|
|
1016
1016
|
};
|
|
1017
1017
|
}
|
|
1018
|
-
var
|
|
1019
|
-
function
|
|
1018
|
+
var kt = T.createContext(jt()), qt = () => T.useContext(kt);
|
|
1019
|
+
function At(t, e) {
|
|
1020
1020
|
return typeof t == "function" ? t(...e) : !!t;
|
|
1021
1021
|
}
|
|
1022
1022
|
function Ve() {
|
|
1023
1023
|
}
|
|
1024
1024
|
var Qt = (t, e) => {
|
|
1025
1025
|
(t.suspense || t.throwOnError || t.experimental_prefetchInRender) && (e.isReset() || (t.retryOnMount = !1));
|
|
1026
|
-
},
|
|
1026
|
+
}, Ut = (t) => {
|
|
1027
1027
|
T.useEffect(() => {
|
|
1028
1028
|
t.clearReset();
|
|
1029
1029
|
}, [t]);
|
|
1030
|
-
},
|
|
1030
|
+
}, Mt = ({
|
|
1031
1031
|
result: t,
|
|
1032
1032
|
errorResetBoundary: e,
|
|
1033
1033
|
throwOnError: s,
|
|
1034
1034
|
query: r
|
|
1035
|
-
}) => t.isError && !e.isReset() && !t.isFetching && r &&
|
|
1035
|
+
}) => t.isError && !e.isReset() && !t.isFetching && r && At(s, [t.error, r]), Lt = (t, e) => e.state.data === void 0, Nt = (t) => {
|
|
1036
1036
|
const e = t.staleTime;
|
|
1037
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)));
|
|
1038
|
-
},
|
|
1038
|
+
}, _t = (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(() => {
|
|
1039
1039
|
s.clearReset();
|
|
1040
1040
|
});
|
|
1041
|
-
function
|
|
1042
|
-
var
|
|
1041
|
+
function lt(t, e, s) {
|
|
1042
|
+
var c, C, g, w, b;
|
|
1043
1043
|
if (process.env.NODE_ENV !== "production" && (typeof t != "object" || Array.isArray(t)))
|
|
1044
1044
|
throw new Error(
|
|
1045
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'
|
|
1046
1046
|
);
|
|
1047
|
-
const r =
|
|
1048
|
-
(
|
|
1049
|
-
|
|
1047
|
+
const r = ct(s), i = xt(), o = qt(), a = r.defaultQueryOptions(t);
|
|
1048
|
+
(C = (c = r.getDefaultOptions().queries) == null ? void 0 : c._experimental_beforeQuery) == null || C.call(
|
|
1049
|
+
c,
|
|
1050
1050
|
a
|
|
1051
|
-
), a._optimisticResults = i ? "isRestoring" : "optimistic",
|
|
1051
|
+
), a._optimisticResults = i ? "isRestoring" : "optimistic", Nt(a), Qt(a, o), Ut(o);
|
|
1052
1052
|
const u = !r.getQueryCache().get(a.queryHash), [l] = T.useState(
|
|
1053
1053
|
() => new e(
|
|
1054
1054
|
r,
|
|
@@ -1058,7 +1058,7 @@ function ct(t, e, s) {
|
|
|
1058
1058
|
if (T.useSyncExternalStore(
|
|
1059
1059
|
T.useCallback(
|
|
1060
1060
|
(p) => {
|
|
1061
|
-
const E = v ? l.subscribe(
|
|
1061
|
+
const E = v ? l.subscribe(Ue.batchCalls(p)) : Ve;
|
|
1062
1062
|
return l.updateResult(), E;
|
|
1063
1063
|
},
|
|
1064
1064
|
[l, v]
|
|
@@ -1069,7 +1069,7 @@ function ct(t, e, s) {
|
|
|
1069
1069
|
l.setOptions(a, { listeners: !1 });
|
|
1070
1070
|
}, [a, l]), Kt(a, S))
|
|
1071
1071
|
throw $e(a, l, o);
|
|
1072
|
-
if (
|
|
1072
|
+
if (Mt({
|
|
1073
1073
|
result: S,
|
|
1074
1074
|
errorResetBoundary: o,
|
|
1075
1075
|
throwOnError: a.throwOnError,
|
|
@@ -1080,7 +1080,7 @@ function ct(t, e, s) {
|
|
|
1080
1080
|
g,
|
|
1081
1081
|
a,
|
|
1082
1082
|
S
|
|
1083
|
-
), a.experimental_prefetchInRender && !V &&
|
|
1083
|
+
), a.experimental_prefetchInRender && !V && _t(S, i)) {
|
|
1084
1084
|
const p = u ? (
|
|
1085
1085
|
// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
|
|
1086
1086
|
$e(a, l, o)
|
|
@@ -1094,16 +1094,16 @@ function ct(t, e, s) {
|
|
|
1094
1094
|
}
|
|
1095
1095
|
return a.notifyOnChangeProps ? S : l.trackResult(S);
|
|
1096
1096
|
}
|
|
1097
|
-
function _t(t, e) {
|
|
1098
|
-
return ct(t, at, e);
|
|
1099
|
-
}
|
|
1100
1097
|
function Ht(t, e) {
|
|
1101
|
-
return
|
|
1098
|
+
return lt(t, at, e);
|
|
1099
|
+
}
|
|
1100
|
+
function Bt(t, e) {
|
|
1101
|
+
return process.env.NODE_ENV !== "production" && t.queryFn === ye && console.error("skipToken is not allowed for useSuspenseQuery"), lt(
|
|
1102
1102
|
{
|
|
1103
1103
|
...t,
|
|
1104
1104
|
enabled: !0,
|
|
1105
1105
|
suspense: !0,
|
|
1106
|
-
throwOnError:
|
|
1106
|
+
throwOnError: Lt,
|
|
1107
1107
|
placeholderData: void 0
|
|
1108
1108
|
},
|
|
1109
1109
|
at,
|
|
@@ -1113,6 +1113,15 @@ function Ht(t, e) {
|
|
|
1113
1113
|
const $ = (...t) => {
|
|
1114
1114
|
const e = t.filter((s) => !!s).map((s) => s.replace(/(^\/+|\/+$)/g, "")).join("/").replace(/(^\/+|\/+$)/g, "");
|
|
1115
1115
|
return e ? `/${e}` : "/";
|
|
1116
|
+
}, dt = Object.freeze({
|
|
1117
|
+
API_IDENTITIES: ["api-identities"]
|
|
1118
|
+
}), rs = () => {
|
|
1119
|
+
const t = ct();
|
|
1120
|
+
return {
|
|
1121
|
+
invalidateCache: async (e) => {
|
|
1122
|
+
await t.invalidateQueries({ queryKey: dt[e] });
|
|
1123
|
+
}
|
|
1124
|
+
};
|
|
1116
1125
|
}, Le = (t, e) => {
|
|
1117
1126
|
for (const s of t) {
|
|
1118
1127
|
const r = Ne(s, e);
|
|
@@ -1129,20 +1138,20 @@ const $ = (...t) => {
|
|
|
1129
1138
|
]);
|
|
1130
1139
|
if (o !== void 0) return o;
|
|
1131
1140
|
}
|
|
1132
|
-
},
|
|
1133
|
-
const t = pe(), s =
|
|
1141
|
+
}, ns = () => {
|
|
1142
|
+
const t = pe(), s = yt().sidebar;
|
|
1134
1143
|
return Le(s, (r) => {
|
|
1135
1144
|
if (r.type === "doc" && $(r.id) === t.pathname)
|
|
1136
1145
|
return r;
|
|
1137
1146
|
});
|
|
1138
|
-
},
|
|
1147
|
+
}, is = (t) => {
|
|
1139
1148
|
const e = pe();
|
|
1140
1149
|
return Ne(t, (s) => {
|
|
1141
1150
|
if (s.type === "category" && s.link && $(s.link.id) === e.pathname || s.type === "doc" && $(s.id) === e.pathname)
|
|
1142
1151
|
return !0;
|
|
1143
1152
|
});
|
|
1144
|
-
},
|
|
1145
|
-
const t = pe().pathname, s =
|
|
1153
|
+
}, as = () => {
|
|
1154
|
+
const t = pe().pathname, s = yt().sidebar;
|
|
1146
1155
|
let r, i, o = !1;
|
|
1147
1156
|
return Le(s, (a) => {
|
|
1148
1157
|
const u = a.type === "doc" ? $(a.id) : a.type === "category" && a.link ? $(a.link.id) : void 0;
|
|
@@ -1152,24 +1161,24 @@ const $ = (...t) => {
|
|
|
1152
1161
|
t === u ? o = !0 : r = { label: a.label, id: u };
|
|
1153
1162
|
}
|
|
1154
1163
|
}), { prev: r, next: i };
|
|
1155
|
-
},
|
|
1164
|
+
}, Gt = pt(
|
|
1156
1165
|
void 0
|
|
1157
|
-
),
|
|
1158
|
-
const t =
|
|
1166
|
+
), ft = () => {
|
|
1167
|
+
const t = bt(Gt);
|
|
1159
1168
|
if (!t)
|
|
1160
1169
|
throw new Error("useZudoku must be used within a ZudokuProvider.");
|
|
1161
1170
|
return t;
|
|
1162
|
-
},
|
|
1163
|
-
const { getApiIdentities: t } =
|
|
1164
|
-
return
|
|
1171
|
+
}, us = () => {
|
|
1172
|
+
const { getApiIdentities: t } = ft();
|
|
1173
|
+
return Ht({
|
|
1165
1174
|
queryFn: t,
|
|
1166
|
-
queryKey: [
|
|
1175
|
+
queryKey: [dt.API_IDENTITIES]
|
|
1167
1176
|
});
|
|
1168
|
-
},
|
|
1169
|
-
const { getPluginSidebar: t, sidebars: e, topNavigation: s } =
|
|
1177
|
+
}, yt = () => {
|
|
1178
|
+
const { getPluginSidebar: t, sidebars: e, topNavigation: s } = ft(), r = pe(), i = Object.entries(e).find(([, u]) => Le(u, (l) => {
|
|
1170
1179
|
if ((l.type === "doc" ? $(l.id) : l.type === "category" && l.link ? $(l.link.id) : void 0) === r.pathname)
|
|
1171
1180
|
return l;
|
|
1172
|
-
})), o = s.find((u) => u.id === (i == null ? void 0 : i[0])) ?? s.find((u) =>
|
|
1181
|
+
})), o = s.find((u) => u.id === (i == null ? void 0 : i[0])) ?? s.find((u) => vt(u.id, r.pathname)), { data: a } = Bt({
|
|
1173
1182
|
queryFn: () => t(r.pathname),
|
|
1174
1183
|
queryKey: ["plugin-sidebar", r.pathname]
|
|
1175
1184
|
});
|
|
@@ -1179,40 +1188,42 @@ const $ = (...t) => {
|
|
|
1179
1188
|
};
|
|
1180
1189
|
};
|
|
1181
1190
|
export {
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
ns as
|
|
1195
|
-
|
|
1191
|
+
ss as A,
|
|
1192
|
+
yt as B,
|
|
1193
|
+
Le as C,
|
|
1194
|
+
rs as D,
|
|
1195
|
+
dt as E,
|
|
1196
|
+
Ht as F,
|
|
1197
|
+
us as G,
|
|
1198
|
+
ts as Q,
|
|
1199
|
+
It as R,
|
|
1200
|
+
Ae as S,
|
|
1201
|
+
Gt as Z,
|
|
1202
|
+
ft as a,
|
|
1203
|
+
ns as b,
|
|
1204
|
+
Ot as c,
|
|
1205
|
+
as as d,
|
|
1206
|
+
ct as e,
|
|
1196
1207
|
Ve as f,
|
|
1197
|
-
|
|
1198
|
-
|
|
1208
|
+
At as g,
|
|
1209
|
+
Ce as h,
|
|
1199
1210
|
is as i,
|
|
1200
1211
|
$ as j,
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1212
|
+
gt as k,
|
|
1213
|
+
Yt as l,
|
|
1214
|
+
Jt as m,
|
|
1215
|
+
Ue as n,
|
|
1216
|
+
ge as o,
|
|
1217
|
+
Ct as p,
|
|
1218
|
+
es as q,
|
|
1219
|
+
Xt as r,
|
|
1209
1220
|
we as s,
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1221
|
+
tt as t,
|
|
1222
|
+
Bt as u,
|
|
1223
|
+
st as v,
|
|
1224
|
+
fe as w,
|
|
1225
|
+
Wt as x,
|
|
1226
|
+
Qe as y,
|
|
1227
|
+
ye as z
|
|
1217
1228
|
};
|
|
1218
|
-
//# sourceMappingURL=ZudokuContext-
|
|
1229
|
+
//# sourceMappingURL=ZudokuContext-8jts0fF3.js.map
|