zudoku 0.44.0 → 0.45.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/entry.client.js +34 -21
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/main.js +7 -0
- package/dist/app/main.js.map +1 -1
- package/dist/config/validators/common.d.ts +420 -288
- package/dist/config/validators/common.js +10 -0
- package/dist/config/validators/common.js.map +1 -1
- package/dist/config/validators/validate.d.ts +161 -108
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/components/Header.js +1 -1
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Markdown.d.ts +3 -1
- package/dist/lib/components/Markdown.js +8 -14
- package/dist/lib/components/Markdown.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +1 -1
- package/dist/lib/components/context/ZudokuContext.js +2 -3
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/index.d.ts +2 -1
- package/dist/lib/core/ZudokuContext.d.ts +8 -0
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/errors/ErrorAlert.js +1 -1
- package/dist/lib/errors/ErrorAlert.js.map +1 -1
- package/dist/lib/oas/graphql/circular.js +23 -18
- package/dist/lib/oas/graphql/circular.js.map +1 -1
- package/dist/lib/oas/parser/index.d.ts +3 -0
- package/dist/lib/oas/parser/index.js +6 -1
- package/dist/lib/oas/parser/index.js.map +1 -1
- package/dist/lib/plugins/openapi/CollapsibleCode.js +1 -1
- package/dist/lib/plugins/openapi/CollapsibleCode.js.map +1 -1
- package/dist/lib/plugins/openapi/ParamInfos.js +3 -1
- package/dist/lib/plugins/openapi/ParamInfos.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +33 -3
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/SidecarExamples.js +1 -1
- package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Headers.js +2 -2
- package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/IdentitySelector.js +1 -3
- package/dist/lib/plugins/openapi/playground/IdentitySelector.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.js +2 -2
- package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js +4 -1
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +11 -12
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/utils.d.ts +5 -1
- package/dist/lib/plugins/openapi/schema/utils.js +9 -5
- package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
- package/dist/lib/plugins/openapi/util/generateSchemaExample.d.ts +1 -1
- package/dist/lib/plugins/openapi/util/generateSchemaExample.js +4 -0
- package/dist/lib/plugins/openapi/util/generateSchemaExample.js.map +1 -1
- package/dist/lib/shiki.d.ts +35 -0
- package/dist/lib/shiki.js +103 -0
- package/dist/lib/shiki.js.map +1 -0
- package/dist/lib/ui/Callout.js +1 -1
- package/dist/lib/ui/Callout.js.map +1 -1
- package/dist/lib/ui/CodeBlock.d.ts +16 -0
- package/dist/lib/ui/CodeBlock.js +18 -0
- package/dist/lib/ui/CodeBlock.js.map +1 -0
- package/dist/lib/ui/SyntaxHighlight.d.ts +10 -15
- package/dist/lib/ui/SyntaxHighlight.js +12 -60
- package/dist/lib/ui/SyntaxHighlight.js.map +1 -1
- package/dist/lib/util/MdxComponents.d.ts +9 -3
- package/dist/lib/util/MdxComponents.js +9 -10
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/vite/api/SchemaManager.js +2 -0
- package/dist/vite/api/SchemaManager.js.map +1 -1
- package/dist/vite/config.js +34 -0
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/plugin-mdx.js +4 -11
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin-shiki-register.d.ts +3 -0
- package/dist/vite/plugin-shiki-register.js +38 -0
- package/dist/vite/plugin-shiki-register.js.map +1 -0
- package/dist/vite/plugin.js +2 -0
- package/dist/vite/plugin.js.map +1 -1
- package/lib/AuthenticationPlugin-UNaAuxNo.js +90 -0
- package/lib/{AuthenticationPlugin-BlJsiGuX.js.map → AuthenticationPlugin-UNaAuxNo.js.map} +1 -1
- package/lib/{Button-BBNrKpQd.js → Button-Bdk_Ij3U.js} +3 -3
- package/lib/{Button-BBNrKpQd.js.map → Button-Bdk_Ij3U.js.map} +1 -1
- package/lib/{Callout-D3Ja4OPX.js → Callout-XadUe37J.js} +12 -12
- package/lib/{Callout-D3Ja4OPX.js.map → Callout-XadUe37J.js.map} +1 -1
- package/lib/{Card-BtheiD7j.js → Card-BlCYNw5W.js} +2 -2
- package/lib/{Card-BtheiD7j.js.map → Card-BlCYNw5W.js.map} +1 -1
- package/lib/{CategoryHeading-D06WK_Wo.js → CategoryHeading-DZi-Szor.js} +2 -2
- package/lib/{CategoryHeading-D06WK_Wo.js.map → CategoryHeading-DZi-Szor.js.map} +1 -1
- package/lib/{Dialog-ByYz4ABw.js → Dialog-CNf2oWXG.js} +2 -2
- package/lib/{Dialog-ByYz4ABw.js.map → Dialog-CNf2oWXG.js.map} +1 -1
- package/lib/{Drawer-CEwbkLDb.js → Drawer-BPBxzel2.js} +25 -25
- package/lib/{Drawer-CEwbkLDb.js.map → Drawer-BPBxzel2.js.map} +1 -1
- package/lib/Markdown-D96AphCL.js +7691 -0
- package/lib/Markdown-D96AphCL.js.map +1 -0
- package/lib/MdxPage-Sjv6y3cA.js +84 -0
- package/lib/{MdxPage-DlJaCSPf.js.map → MdxPage-Sjv6y3cA.js.map} +1 -1
- package/lib/{OasProvider-DHPC9PnR.js → OasProvider-CzRXrs_-.js} +4 -4
- package/lib/{OasProvider-DHPC9PnR.js.map → OasProvider-CzRXrs_-.js.map} +1 -1
- package/lib/{OperationList-C6Ky0zQa.js → OperationList-DefCF3ZI.js} +1737 -1757
- package/lib/{OperationList-C6Ky0zQa.js.map → OperationList-DefCF3ZI.js.map} +1 -1
- package/lib/{Pagination-C5Fi7z_v.js → Pagination-B89j9KJS.js} +4 -4
- package/lib/{Pagination-C5Fi7z_v.js.map → Pagination-B89j9KJS.js.map} +1 -1
- package/lib/RouteGuard-lkdEJoDV.js +732 -0
- package/lib/{RouteGuard-D2gX29iI.js.map → RouteGuard-lkdEJoDV.js.map} +1 -1
- package/lib/{SchemaList-Cu7rWQ_k.js → SchemaList-zHQ2Ekyw.js} +40 -41
- package/lib/{SchemaList-Cu7rWQ_k.js.map → SchemaList-zHQ2Ekyw.js.map} +1 -1
- package/lib/{SchemaView-Ci_CnNlv.js → SchemaView-CqF4oMU-.js} +120 -115
- package/lib/SchemaView-CqF4oMU-.js.map +1 -0
- package/lib/Select-HTio1oSE.js +211 -0
- package/lib/{Select-CYaEBIYK.js.map → Select-HTio1oSE.js.map} +1 -1
- package/lib/SlotletProvider-CTgIBRWg.js +257 -0
- package/lib/SlotletProvider-CTgIBRWg.js.map +1 -0
- package/lib/SyntaxHighlight-UxOF1xNb.js +9107 -0
- package/lib/SyntaxHighlight-UxOF1xNb.js.map +1 -0
- package/lib/{Toc-BnN4zBb3.js → Toc-Ax54Pw8S.js} +3 -3
- package/lib/{Toc-BnN4zBb3.js.map → Toc-Ax54Pw8S.js.map} +1 -1
- package/lib/{chunk-BAXFHI7N-BLTsN6tl.js → chunk-BAXFHI7N-C9WnHsLV.js} +510 -517
- package/lib/{chunk-BAXFHI7N-BLTsN6tl.js.map → chunk-BAXFHI7N-C9WnHsLV.js.map} +1 -1
- package/lib/{circular-P9P1oxbQ.js → circular-B_TODp4H.js} +1636 -1633
- package/lib/{circular-P9P1oxbQ.js.map → circular-B_TODp4H.js.map} +1 -1
- package/lib/{cn-qaFjX9_3.js → cn-CwJPJKOE.js} +28 -29
- package/lib/{cn-qaFjX9_3.js.map → cn-CwJPJKOE.js.map} +1 -1
- package/lib/{createServer-Iclzdx0h.js → createServer-CXd8q7nF.js} +3980 -3832
- package/lib/createServer-CXd8q7nF.js.map +1 -0
- package/lib/hook-BwOB_iZo.js +1442 -0
- package/lib/hook-BwOB_iZo.js.map +1 -0
- package/lib/{index-DwT-v3zK.js → index--oeBayMa.js} +2 -2
- package/lib/{index-DwT-v3zK.js.map → index--oeBayMa.js.map} +1 -1
- package/lib/{index-C56xKbMM.js → index-BY8J3gEh.js} +903 -953
- package/lib/index-BY8J3gEh.js.map +1 -0
- package/lib/{index-LNp6rxyU.js → index-BvvmIczU.js} +2 -2
- package/lib/{index-LNp6rxyU.js.map → index-BvvmIczU.js.map} +1 -1
- package/lib/index-CT2PstvH.js +4982 -0
- package/lib/{index-CzUOM_vE.js.map → index-CT2PstvH.js.map} +1 -1
- package/lib/{index-CuBIgTKC.js → index-CrcNWbel.js} +9 -9
- package/lib/{index-CuBIgTKC.js.map → index-CrcNWbel.js.map} +1 -1
- package/lib/{index-CPNSgwSb.js → index-Z13x6tPX.js} +5 -5
- package/lib/{index-CPNSgwSb.js.map → index-Z13x6tPX.js.map} +1 -1
- package/lib/{index-DcHeSvkE.js → index-zddirpDj.js} +581 -609
- package/lib/{index-DcHeSvkE.js.map → index-zddirpDj.js.map} +1 -1
- package/lib/invariant-DAFpPywt.js +48 -0
- package/lib/{invariant-Caa8-XvF.js.map → invariant-DAFpPywt.js.map} +1 -1
- package/lib/mutation-CL2MCRQL.js +196 -0
- package/lib/{mutation-Bq5bn7Hf.js.map → mutation-CL2MCRQL.js.map} +1 -1
- package/lib/processors/removeParameters.js +27 -28
- package/lib/processors/removeParameters.js.map +1 -1
- package/lib/processors/removePaths.js +17 -17
- package/lib/processors/removePaths.js.map +1 -1
- package/lib/ui/Accordion.js +1 -1
- package/lib/ui/ActionButton.js +2 -2
- package/lib/ui/Alert.js +2 -2
- package/lib/ui/AlertDialog.js +1 -1
- package/lib/ui/Badge.js +2 -2
- package/lib/ui/Breadcrumb.js +1 -1
- package/lib/ui/Button.js +2 -2
- package/lib/ui/Callout.js +7 -7
- package/lib/ui/Callout.js.map +1 -1
- package/lib/ui/Card.js +1 -1
- package/lib/ui/Carousel.js +175 -175
- package/lib/ui/Carousel.js.map +1 -1
- package/lib/ui/Checkbox.js +1 -1
- package/lib/ui/CodeBlock.js +83 -0
- package/lib/ui/CodeBlock.js.map +1 -0
- package/lib/ui/Command.js +58 -58
- package/lib/ui/Command.js.map +1 -1
- package/lib/ui/Dialog.js +1 -1
- package/lib/ui/Drawer.js +2 -2
- package/lib/ui/DropdownMenu.js +1 -1
- package/lib/ui/Form.js +1 -1
- 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 +1 -1
- package/lib/ui/Popover.js +1 -1
- package/lib/ui/Progress.js +1 -1
- package/lib/ui/RadioGroup.js +1 -1
- package/lib/ui/ScrollArea.js +1 -1
- package/lib/ui/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/SyntaxHighlight.js +5 -6
- package/lib/ui/SyntaxHighlight.js.map +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/ui/util.js +1 -1
- package/lib/{useExposedProps-DmTJxEXG.js → useExposedProps-DG8J6ewJ.js} +2 -2
- package/lib/{useExposedProps-DmTJxEXG.js.map → useExposedProps-DG8J6ewJ.js.map} +1 -1
- package/lib/zudoku.auth-auth0.js +28 -31
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +64 -70
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +373 -382
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +7 -7
- package/lib/zudoku.hooks.js +2 -2
- package/lib/zudoku.plugin-api-catalog.js +45 -45
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +6 -6
- package/lib/zudoku.plugin-custom-pages.js +3 -3
- package/lib/zudoku.plugin-markdown.js +25 -28
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +3 -3
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/lib/zudoku.plugin-search-inkeep.js +26 -27
- package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +107 -110
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
- package/package.json +39 -28
- package/src/app/entry.client.tsx +40 -25
- package/src/app/main.css +54 -3
- package/src/app/main.tsx +8 -0
- package/src/lib/components/Header.tsx +1 -1
- package/src/lib/components/Markdown.tsx +29 -24
- package/src/lib/components/context/ZudokuContext.ts +2 -3
- package/src/lib/core/ZudokuContext.ts +5 -0
- package/src/lib/errors/ErrorAlert.tsx +1 -1
- package/src/lib/oas/graphql/circular.ts +27 -19
- package/src/lib/oas/parser/index.ts +6 -1
- package/src/lib/plugins/openapi/CollapsibleCode.tsx +5 -2
- package/src/lib/plugins/openapi/ParamInfos.tsx +3 -1
- package/src/lib/plugins/openapi/Sidecar.tsx +36 -3
- package/src/lib/plugins/openapi/SidecarExamples.tsx +2 -2
- package/src/lib/plugins/openapi/playground/Headers.tsx +2 -2
- package/src/lib/plugins/openapi/playground/IdentitySelector.tsx +22 -35
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +2 -2
- package/src/lib/plugins/openapi/schema/SchemaExampleAndDefault.tsx +5 -2
- package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +23 -17
- package/src/lib/plugins/openapi/schema/utils.ts +18 -6
- package/src/lib/plugins/openapi/util/generateSchemaExample.ts +6 -1
- package/src/lib/shiki.ts +133 -0
- package/src/lib/ui/Callout.tsx +1 -1
- package/src/lib/ui/CodeBlock.tsx +102 -0
- package/src/lib/ui/SyntaxHighlight.tsx +23 -182
- package/src/lib/util/MdxComponents.tsx +27 -14
- package/src/shiki/langs/abap.js +1 -0
- package/src/shiki/langs/actionscript-3.js +1 -0
- package/src/shiki/langs/ada.js +1 -0
- package/src/shiki/langs/angular-expression.js +1 -0
- package/src/shiki/langs/angular-html.js +1 -0
- package/src/shiki/langs/angular-inline-style.js +1 -0
- package/src/shiki/langs/angular-inline-template.js +1 -0
- package/src/shiki/langs/angular-let-declaration.js +1 -0
- package/src/shiki/langs/angular-template-blocks.js +1 -0
- package/src/shiki/langs/angular-template.js +1 -0
- package/src/shiki/langs/angular-ts.js +1 -0
- package/src/shiki/langs/apache.js +1 -0
- package/src/shiki/langs/apex.js +1 -0
- package/src/shiki/langs/apl.js +1 -0
- package/src/shiki/langs/applescript.js +1 -0
- package/src/shiki/langs/ara.js +1 -0
- package/src/shiki/langs/asciidoc.js +1 -0
- package/src/shiki/langs/asm.js +1 -0
- package/src/shiki/langs/astro.js +1 -0
- package/src/shiki/langs/awk.js +1 -0
- package/src/shiki/langs/ballerina.js +1 -0
- package/src/shiki/langs/bat.js +1 -0
- package/src/shiki/langs/beancount.js +1 -0
- package/src/shiki/langs/berry.js +1 -0
- package/src/shiki/langs/bibtex.js +1 -0
- package/src/shiki/langs/bicep.js +1 -0
- package/src/shiki/langs/blade.js +1 -0
- package/src/shiki/langs/bsl.js +1 -0
- package/src/shiki/langs/c.js +1 -0
- package/src/shiki/langs/cadence.js +1 -0
- package/src/shiki/langs/cairo.js +1 -0
- package/src/shiki/langs/clarity.js +1 -0
- package/src/shiki/langs/clojure.js +1 -0
- package/src/shiki/langs/cmake.js +1 -0
- package/src/shiki/langs/cobol.js +1 -0
- package/src/shiki/langs/codeowners.js +1 -0
- package/src/shiki/langs/codeql.js +1 -0
- package/src/shiki/langs/coffee.js +1 -0
- package/src/shiki/langs/common-lisp.js +1 -0
- package/src/shiki/langs/coq.js +1 -0
- package/src/shiki/langs/cpp-macro.js +1 -0
- package/src/shiki/langs/cpp.js +1 -0
- package/src/shiki/langs/crystal.js +1 -0
- package/src/shiki/langs/csharp.js +1 -0
- package/src/shiki/langs/css.js +1 -0
- package/src/shiki/langs/csv.js +1 -0
- package/src/shiki/langs/cue.js +1 -0
- package/src/shiki/langs/cypher.js +1 -0
- package/src/shiki/langs/d.js +1 -0
- package/src/shiki/langs/dart.js +1 -0
- package/src/shiki/langs/dax.js +1 -0
- package/src/shiki/langs/desktop.js +1 -0
- package/src/shiki/langs/diff.js +1 -0
- package/src/shiki/langs/docker.js +1 -0
- package/src/shiki/langs/dotenv.js +1 -0
- package/src/shiki/langs/dream-maker.js +1 -0
- package/src/shiki/langs/edge.js +1 -0
- package/src/shiki/langs/elixir.js +1 -0
- package/src/shiki/langs/elm.js +1 -0
- package/src/shiki/langs/emacs-lisp.js +1 -0
- package/src/shiki/langs/erb.js +1 -0
- package/src/shiki/langs/erlang.js +1 -0
- package/src/shiki/langs/es-tag-css.js +1 -0
- package/src/shiki/langs/es-tag-glsl.js +1 -0
- package/src/shiki/langs/es-tag-html.js +1 -0
- package/src/shiki/langs/es-tag-sql.js +1 -0
- package/src/shiki/langs/es-tag-xml.js +1 -0
- package/src/shiki/langs/fennel.js +1 -0
- package/src/shiki/langs/fish.js +1 -0
- package/src/shiki/langs/fluent.js +1 -0
- package/src/shiki/langs/fortran-fixed-form.js +1 -0
- package/src/shiki/langs/fortran-free-form.js +1 -0
- package/src/shiki/langs/fsharp.js +1 -0
- package/src/shiki/langs/gdresource.js +1 -0
- package/src/shiki/langs/gdscript.js +1 -0
- package/src/shiki/langs/gdshader.js +1 -0
- package/src/shiki/langs/genie.js +1 -0
- package/src/shiki/langs/gherkin.js +1 -0
- package/src/shiki/langs/git-commit.js +1 -0
- package/src/shiki/langs/git-rebase.js +1 -0
- package/src/shiki/langs/gleam.js +1 -0
- package/src/shiki/langs/glimmer-js.js +1 -0
- package/src/shiki/langs/glimmer-ts.js +1 -0
- package/src/shiki/langs/glsl.js +1 -0
- package/src/shiki/langs/gnuplot.js +1 -0
- package/src/shiki/langs/go.js +1 -0
- package/src/shiki/langs/graphql.js +1 -0
- package/src/shiki/langs/groovy.js +1 -0
- package/src/shiki/langs/hack.js +1 -0
- package/src/shiki/langs/haml.js +1 -0
- package/src/shiki/langs/handlebars.js +1 -0
- package/src/shiki/langs/haskell.js +1 -0
- package/src/shiki/langs/haxe.js +1 -0
- package/src/shiki/langs/hcl.js +1 -0
- package/src/shiki/langs/hjson.js +1 -0
- package/src/shiki/langs/hlsl.js +1 -0
- package/src/shiki/langs/html-derivative.js +1 -0
- package/src/shiki/langs/html.js +1 -0
- package/src/shiki/langs/http.js +1 -0
- package/src/shiki/langs/hxml.js +1 -0
- package/src/shiki/langs/hy.js +1 -0
- package/src/shiki/langs/imba.js +1 -0
- package/src/shiki/langs/ini.js +1 -0
- package/src/shiki/langs/java.js +1 -0
- package/src/shiki/langs/javascript.js +1 -0
- package/src/shiki/langs/jinja-html.js +1 -0
- package/src/shiki/langs/jinja.js +1 -0
- package/src/shiki/langs/jison.js +1 -0
- package/src/shiki/langs/json.js +1 -0
- package/src/shiki/langs/json5.js +1 -0
- package/src/shiki/langs/jsonc.js +1 -0
- package/src/shiki/langs/jsonl.js +1 -0
- package/src/shiki/langs/jsonnet.js +1 -0
- package/src/shiki/langs/jssm.js +1 -0
- package/src/shiki/langs/jsx.js +1 -0
- package/src/shiki/langs/julia.js +1 -0
- package/src/shiki/langs/kotlin.js +1 -0
- package/src/shiki/langs/kusto.js +1 -0
- package/src/shiki/langs/latex.js +1 -0
- package/src/shiki/langs/lean.js +1 -0
- package/src/shiki/langs/less.js +1 -0
- package/src/shiki/langs/liquid.js +1 -0
- package/src/shiki/langs/llvm.js +1 -0
- package/src/shiki/langs/log.js +1 -0
- package/src/shiki/langs/logo.js +1 -0
- package/src/shiki/langs/lua.js +1 -0
- package/src/shiki/langs/luau.js +1 -0
- package/src/shiki/langs/make.js +1 -0
- package/src/shiki/langs/markdown-vue.js +1 -0
- package/src/shiki/langs/markdown.js +1 -0
- package/src/shiki/langs/marko.js +1 -0
- package/src/shiki/langs/matlab.js +1 -0
- package/src/shiki/langs/mdc.js +1 -0
- package/src/shiki/langs/mdx.js +1 -0
- package/src/shiki/langs/mermaid.js +1 -0
- package/src/shiki/langs/mipsasm.js +1 -0
- package/src/shiki/langs/mojo.js +1 -0
- package/src/shiki/langs/move.js +1 -0
- package/src/shiki/langs/narrat.js +1 -0
- package/src/shiki/langs/nextflow.js +1 -0
- package/src/shiki/langs/nginx.js +1 -0
- package/src/shiki/langs/nim.js +1 -0
- package/src/shiki/langs/nix.js +1 -0
- package/src/shiki/langs/nushell.js +1 -0
- package/src/shiki/langs/objective-c.js +1 -0
- package/src/shiki/langs/objective-cpp.js +1 -0
- package/src/shiki/langs/ocaml.js +1 -0
- package/src/shiki/langs/pascal.js +1 -0
- package/src/shiki/langs/perl.js +1 -0
- package/src/shiki/langs/php.js +1 -0
- package/src/shiki/langs/plsql.js +1 -0
- package/src/shiki/langs/po.js +1 -0
- package/src/shiki/langs/polar.js +1 -0
- package/src/shiki/langs/postcss.js +1 -0
- package/src/shiki/langs/powerquery.js +1 -0
- package/src/shiki/langs/powershell.js +1 -0
- package/src/shiki/langs/prisma.js +1 -0
- package/src/shiki/langs/prolog.js +1 -0
- package/src/shiki/langs/proto.js +1 -0
- package/src/shiki/langs/pug.js +1 -0
- package/src/shiki/langs/puppet.js +1 -0
- package/src/shiki/langs/purescript.js +1 -0
- package/src/shiki/langs/python.js +1 -0
- package/src/shiki/langs/qml.js +1 -0
- package/src/shiki/langs/qmldir.js +1 -0
- package/src/shiki/langs/qss.js +1 -0
- package/src/shiki/langs/r.js +1 -0
- package/src/shiki/langs/racket.js +1 -0
- package/src/shiki/langs/raku.js +1 -0
- package/src/shiki/langs/razor.js +1 -0
- package/src/shiki/langs/reg.js +1 -0
- package/src/shiki/langs/regexp.js +1 -0
- package/src/shiki/langs/rel.js +1 -0
- package/src/shiki/langs/riscv.js +1 -0
- package/src/shiki/langs/rst.js +1 -0
- package/src/shiki/langs/ruby.js +1 -0
- package/src/shiki/langs/rust.js +1 -0
- package/src/shiki/langs/sas.js +1 -0
- package/src/shiki/langs/sass.js +1 -0
- package/src/shiki/langs/scala.js +1 -0
- package/src/shiki/langs/scheme.js +1 -0
- package/src/shiki/langs/scss.js +1 -0
- package/src/shiki/langs/sdbl.js +1 -0
- package/src/shiki/langs/shaderlab.js +1 -0
- package/src/shiki/langs/shellscript.js +1 -0
- package/src/shiki/langs/shellsession.js +1 -0
- package/src/shiki/langs/smalltalk.js +1 -0
- package/src/shiki/langs/solidity.js +1 -0
- package/src/shiki/langs/soy.js +1 -0
- package/src/shiki/langs/sparql.js +1 -0
- package/src/shiki/langs/splunk.js +1 -0
- package/src/shiki/langs/sql.js +1 -0
- package/src/shiki/langs/ssh-config.js +1 -0
- package/src/shiki/langs/stata.js +1 -0
- package/src/shiki/langs/stylus.js +1 -0
- package/src/shiki/langs/svelte.js +1 -0
- package/src/shiki/langs/swift.js +1 -0
- package/src/shiki/langs/system-verilog.js +1 -0
- package/src/shiki/langs/systemd.js +1 -0
- package/src/shiki/langs/talonscript.js +1 -0
- package/src/shiki/langs/tasl.js +1 -0
- package/src/shiki/langs/tcl.js +1 -0
- package/src/shiki/langs/templ.js +1 -0
- package/src/shiki/langs/terraform.js +1 -0
- package/src/shiki/langs/tex.js +1 -0
- package/src/shiki/langs/toml.js +1 -0
- package/src/shiki/langs/ts-tags.js +1 -0
- package/src/shiki/langs/tsv.js +1 -0
- package/src/shiki/langs/tsx.js +1 -0
- package/src/shiki/langs/turtle.js +1 -0
- package/src/shiki/langs/twig.js +1 -0
- package/src/shiki/langs/typescript.js +1 -0
- package/src/shiki/langs/typespec.js +1 -0
- package/src/shiki/langs/typst.js +1 -0
- package/src/shiki/langs/v.js +1 -0
- package/src/shiki/langs/vala.js +1 -0
- package/src/shiki/langs/vb.js +1 -0
- package/src/shiki/langs/verilog.js +1 -0
- package/src/shiki/langs/vhdl.js +1 -0
- package/src/shiki/langs/viml.js +1 -0
- package/src/shiki/langs/vue-directives.js +1 -0
- package/src/shiki/langs/vue-html.js +1 -0
- package/src/shiki/langs/vue-interpolations.js +1 -0
- package/src/shiki/langs/vue-sfc-style-variable-injection.js +1 -0
- package/src/shiki/langs/vue.js +1 -0
- package/src/shiki/langs/vyper.js +1 -0
- package/src/shiki/langs/wasm.js +1 -0
- package/src/shiki/langs/wenyan.js +1 -0
- package/src/shiki/langs/wgsl.js +1 -0
- package/src/shiki/langs/wikitext.js +1 -0
- package/src/shiki/langs/wit.js +1 -0
- package/src/shiki/langs/wolfram.js +1 -0
- package/src/shiki/langs/xml.js +1 -0
- package/src/shiki/langs/xsl.js +1 -0
- package/src/shiki/langs/yaml.js +1 -0
- package/src/shiki/langs/zenscript.js +1 -0
- package/src/shiki/langs/zig.js +1 -0
- package/src/shiki/themes/andromeeda.js +1 -0
- package/src/shiki/themes/aurora-x.js +1 -0
- package/src/shiki/themes/ayu-dark.js +1 -0
- package/src/shiki/themes/catppuccin-frappe.js +1 -0
- package/src/shiki/themes/catppuccin-latte.js +1 -0
- package/src/shiki/themes/catppuccin-macchiato.js +1 -0
- package/src/shiki/themes/catppuccin-mocha.js +1 -0
- package/src/shiki/themes/dark-plus.js +1 -0
- package/src/shiki/themes/dracula-soft.js +1 -0
- package/src/shiki/themes/dracula.js +1 -0
- package/src/shiki/themes/everforest-dark.js +1 -0
- package/src/shiki/themes/everforest-light.js +1 -0
- package/src/shiki/themes/github-dark-default.js +1 -0
- package/src/shiki/themes/github-dark-dimmed.js +1 -0
- package/src/shiki/themes/github-dark-high-contrast.js +1 -0
- package/src/shiki/themes/github-dark.js +1 -0
- package/src/shiki/themes/github-light-default.js +1 -0
- package/src/shiki/themes/github-light-high-contrast.js +1 -0
- package/src/shiki/themes/github-light.js +1 -0
- package/src/shiki/themes/gruvbox-dark-hard.js +1 -0
- package/src/shiki/themes/gruvbox-dark-medium.js +1 -0
- package/src/shiki/themes/gruvbox-dark-soft.js +1 -0
- package/src/shiki/themes/gruvbox-light-hard.js +1 -0
- package/src/shiki/themes/gruvbox-light-medium.js +1 -0
- package/src/shiki/themes/gruvbox-light-soft.js +1 -0
- package/src/shiki/themes/houston.js +1 -0
- package/src/shiki/themes/kanagawa-dragon.js +1 -0
- package/src/shiki/themes/kanagawa-lotus.js +1 -0
- package/src/shiki/themes/kanagawa-wave.js +1 -0
- package/src/shiki/themes/laserwave.js +1 -0
- package/src/shiki/themes/light-plus.js +1 -0
- package/src/shiki/themes/material-theme-darker.js +1 -0
- package/src/shiki/themes/material-theme-lighter.js +1 -0
- package/src/shiki/themes/material-theme-ocean.js +1 -0
- package/src/shiki/themes/material-theme-palenight.js +1 -0
- package/src/shiki/themes/material-theme.js +1 -0
- package/src/shiki/themes/min-dark.js +1 -0
- package/src/shiki/themes/min-light.js +1 -0
- package/src/shiki/themes/monokai.js +1 -0
- package/src/shiki/themes/night-owl.js +1 -0
- package/src/shiki/themes/nord.js +1 -0
- package/src/shiki/themes/one-dark-pro.js +1 -0
- package/src/shiki/themes/one-light.js +1 -0
- package/src/shiki/themes/plastic.js +1 -0
- package/src/shiki/themes/poimandres.js +1 -0
- package/src/shiki/themes/red.js +1 -0
- package/src/shiki/themes/rose-pine-dawn.js +1 -0
- package/src/shiki/themes/rose-pine-moon.js +1 -0
- package/src/shiki/themes/rose-pine.js +1 -0
- package/src/shiki/themes/slack-dark.js +1 -0
- package/src/shiki/themes/slack-ochin.js +1 -0
- package/src/shiki/themes/snazzy-light.js +1 -0
- package/src/shiki/themes/solarized-dark.js +1 -0
- package/src/shiki/themes/solarized-light.js +1 -0
- package/src/shiki/themes/synthwave-84.js +1 -0
- package/src/shiki/themes/tokyo-night.js +1 -0
- package/src/shiki/themes/vesper.js +1 -0
- package/src/shiki/themes/vitesse-black.js +1 -0
- package/src/shiki/themes/vitesse-dark.js +1 -0
- package/src/shiki/themes/vitesse-light.js +1 -0
- package/lib/AuthenticationPlugin-BlJsiGuX.js +0 -99
- package/lib/Markdown-DvdVn1O7.js +0 -17128
- package/lib/Markdown-DvdVn1O7.js.map +0 -1
- package/lib/MdxPage-DlJaCSPf.js +0 -85
- package/lib/RouteGuard-D2gX29iI.js +0 -744
- package/lib/SchemaView-Ci_CnNlv.js.map +0 -1
- package/lib/Select-CYaEBIYK.js +0 -223
- package/lib/SlotletProvider-wWbHYqWf.js +0 -340
- package/lib/SlotletProvider-wWbHYqWf.js.map +0 -1
- package/lib/SyntaxHighlight-o7q0acut.js +0 -2890
- package/lib/SyntaxHighlight-o7q0acut.js.map +0 -1
- package/lib/_commonjsHelpers-B4e78b8K.js +0 -29
- package/lib/_commonjsHelpers-B4e78b8K.js.map +0 -1
- package/lib/createServer-Iclzdx0h.js.map +0 -1
- package/lib/hook-8GM2HXNM.js +0 -1478
- package/lib/hook-8GM2HXNM.js.map +0 -1
- package/lib/index-C56xKbMM.js.map +0 -1
- package/lib/index-CzUOM_vE.js +0 -5039
- package/lib/invariant-Caa8-XvF.js +0 -26
- package/lib/mutation-Bq5bn7Hf.js +0 -211
- package/lib/prism-bash.min-HHIMdNJ_.js +0 -7
- package/lib/prism-bash.min-HHIMdNJ_.js.map +0 -1
- package/lib/prism-csharp.min-C43x1RY2.js +0 -63
- package/lib/prism-csharp.min-C43x1RY2.js.map +0 -1
- package/lib/prism-java.min-CQzr40NQ.js +0 -35
- package/lib/prism-java.min-CQzr40NQ.js.map +0 -1
- package/lib/prism-javascript.min-CEqHqgbm.js +0 -9
- package/lib/prism-javascript.min-CEqHqgbm.js.map +0 -1
- package/lib/prism-json.min-B1GJqK1k.js +0 -2
- package/lib/prism-json.min-B1GJqK1k.js.map +0 -1
- package/lib/prism-jsstacktrace.min-BfobCF2F.js +0 -2
- package/lib/prism-jsstacktrace.min-BfobCF2F.js.map +0 -1
- package/lib/prism-markdown.min-C0Qn0m-5.js +0 -61
- package/lib/prism-markdown.min-C0Qn0m-5.js.map +0 -1
- package/lib/prism-markup-BNGj0Tvm.js +0 -174
- package/lib/prism-markup-BNGj0Tvm.js.map +0 -1
- package/lib/prism-objectivec.min-BXSWqpJJ.js +0 -2
- package/lib/prism-objectivec.min-BXSWqpJJ.js.map +0 -1
- package/lib/prism-ruby.min-L9OdQ6tU.js +0 -38
- package/lib/prism-ruby.min-L9OdQ6tU.js.map +0 -1
- package/lib/prism-typescript.min-qTySPvCh.js +0 -34
- package/lib/prism-typescript.min-qTySPvCh.js.map +0 -1
package/lib/hook-8GM2HXNM.js
DELETED
|
@@ -1,1478 +0,0 @@
|
|
|
1
|
-
var $e = (t) => {
|
|
2
|
-
throw TypeError(t);
|
|
3
|
-
};
|
|
4
|
-
var be = (t, e, s) => e.has(t) || $e("Cannot " + s);
|
|
5
|
-
var n = (t, e, s) => (be(t, e, "read from private field"), s ? s.call(t) : e.get(t)), b = (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), f = (t, e, s, r) => (be(t, e, "write to private field"), r ? r.call(t, s) : e.set(t, s), s), w = (t, e, s) => (be(t, e, "access private method"), s);
|
|
6
|
-
import * as j from "react";
|
|
7
|
-
import Ge, { createContext as Et, useContext as Ct } from "react";
|
|
8
|
-
import { j as Ot } from "./jsx-runtime-C5mzlN2N.js";
|
|
9
|
-
import { u as me, m as ze } from "./chunk-BAXFHI7N-BLTsN6tl.js";
|
|
10
|
-
var Qe = class {
|
|
11
|
-
constructor() {
|
|
12
|
-
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
13
|
-
}
|
|
14
|
-
subscribe(t) {
|
|
15
|
-
return this.listeners.add(t), this.onSubscribe(), () => {
|
|
16
|
-
this.listeners.delete(t), this.onUnsubscribe();
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
hasListeners() {
|
|
20
|
-
return this.listeners.size > 0;
|
|
21
|
-
}
|
|
22
|
-
onSubscribe() {
|
|
23
|
-
}
|
|
24
|
-
onUnsubscribe() {
|
|
25
|
-
}
|
|
26
|
-
}, J = typeof window > "u" || "Deno" in globalThis;
|
|
27
|
-
function Se() {
|
|
28
|
-
}
|
|
29
|
-
function gs(t, e) {
|
|
30
|
-
return typeof t == "function" ? t(e) : t;
|
|
31
|
-
}
|
|
32
|
-
function we(t) {
|
|
33
|
-
return typeof t == "number" && t >= 0 && t !== 1 / 0;
|
|
34
|
-
}
|
|
35
|
-
function ot(t, e) {
|
|
36
|
-
return Math.max(t + (e || 0) - Date.now(), 0);
|
|
37
|
-
}
|
|
38
|
-
function pe(t, e) {
|
|
39
|
-
return typeof t == "function" ? t(e) : t;
|
|
40
|
-
}
|
|
41
|
-
function k(t, e) {
|
|
42
|
-
return typeof t == "function" ? t(e) : t;
|
|
43
|
-
}
|
|
44
|
-
function Ss(t, e) {
|
|
45
|
-
const {
|
|
46
|
-
type: s = "all",
|
|
47
|
-
exact: r,
|
|
48
|
-
fetchStatus: i,
|
|
49
|
-
predicate: a,
|
|
50
|
-
queryKey: o,
|
|
51
|
-
stale: u
|
|
52
|
-
} = t;
|
|
53
|
-
if (o) {
|
|
54
|
-
if (r) {
|
|
55
|
-
if (e.queryHash !== Ft(o, e.options))
|
|
56
|
-
return !1;
|
|
57
|
-
} else if (!Ne(e.queryKey, o))
|
|
58
|
-
return !1;
|
|
59
|
-
}
|
|
60
|
-
if (s !== "all") {
|
|
61
|
-
const l = e.isActive();
|
|
62
|
-
if (s === "active" && !l || s === "inactive" && l)
|
|
63
|
-
return !1;
|
|
64
|
-
}
|
|
65
|
-
return !(typeof u == "boolean" && e.isStale() !== u || i && i !== e.state.fetchStatus || a && !a(e));
|
|
66
|
-
}
|
|
67
|
-
function ws(t, e) {
|
|
68
|
-
const { exact: s, status: r, predicate: i, mutationKey: a } = t;
|
|
69
|
-
if (a) {
|
|
70
|
-
if (!e.options.mutationKey)
|
|
71
|
-
return !1;
|
|
72
|
-
if (s) {
|
|
73
|
-
if (Re(e.options.mutationKey) !== Re(a))
|
|
74
|
-
return !1;
|
|
75
|
-
} else if (!Ne(e.options.mutationKey, a))
|
|
76
|
-
return !1;
|
|
77
|
-
}
|
|
78
|
-
return !(r && e.state.status !== r || i && !i(e));
|
|
79
|
-
}
|
|
80
|
-
function Ft(t, e) {
|
|
81
|
-
return ((e == null ? void 0 : e.queryKeyHashFn) || Re)(t);
|
|
82
|
-
}
|
|
83
|
-
function Re(t) {
|
|
84
|
-
return JSON.stringify(
|
|
85
|
-
t,
|
|
86
|
-
(e, s) => Oe(s) ? Object.keys(s).sort().reduce((r, i) => (r[i] = s[i], r), {}) : s
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
function Ne(t, e) {
|
|
90
|
-
return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? Object.keys(e).every((s) => Ne(t[s], e[s])) : !1;
|
|
91
|
-
}
|
|
92
|
-
function Ee(t, e) {
|
|
93
|
-
if (t === e)
|
|
94
|
-
return t;
|
|
95
|
-
const s = Ve(t) && Ve(e);
|
|
96
|
-
if (s || Oe(t) && Oe(e)) {
|
|
97
|
-
const r = s ? t : Object.keys(t), i = r.length, a = s ? e : Object.keys(e), o = a.length, u = s ? [] : {};
|
|
98
|
-
let l = 0;
|
|
99
|
-
for (let y = 0; y < o; y++) {
|
|
100
|
-
const g = s ? y : a[y];
|
|
101
|
-
(!s && r.includes(g) || s) && t[g] === void 0 && e[g] === void 0 ? (u[g] = void 0, l++) : (u[g] = Ee(t[g], e[g]), u[g] === t[g] && t[g] !== void 0 && l++);
|
|
102
|
-
}
|
|
103
|
-
return i === o && l === i ? t : u;
|
|
104
|
-
}
|
|
105
|
-
return e;
|
|
106
|
-
}
|
|
107
|
-
function Ce(t, e) {
|
|
108
|
-
if (!e || Object.keys(t).length !== Object.keys(e).length)
|
|
109
|
-
return !1;
|
|
110
|
-
for (const s in t)
|
|
111
|
-
if (t[s] !== e[s])
|
|
112
|
-
return !1;
|
|
113
|
-
return !0;
|
|
114
|
-
}
|
|
115
|
-
function Ve(t) {
|
|
116
|
-
return Array.isArray(t) && t.length === Object.keys(t).length;
|
|
117
|
-
}
|
|
118
|
-
function Oe(t) {
|
|
119
|
-
if (!Je(t))
|
|
120
|
-
return !1;
|
|
121
|
-
const e = t.constructor;
|
|
122
|
-
if (e === void 0)
|
|
123
|
-
return !0;
|
|
124
|
-
const s = e.prototype;
|
|
125
|
-
return !(!Je(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(t) !== Object.prototype);
|
|
126
|
-
}
|
|
127
|
-
function Je(t) {
|
|
128
|
-
return Object.prototype.toString.call(t) === "[object Object]";
|
|
129
|
-
}
|
|
130
|
-
function It(t) {
|
|
131
|
-
return new Promise((e) => {
|
|
132
|
-
setTimeout(e, t);
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
function Fe(t, e, s) {
|
|
136
|
-
if (typeof s.structuralSharing == "function")
|
|
137
|
-
return s.structuralSharing(t, e);
|
|
138
|
-
if (s.structuralSharing !== !1) {
|
|
139
|
-
if (process.env.NODE_ENV !== "production")
|
|
140
|
-
try {
|
|
141
|
-
return Ee(t, e);
|
|
142
|
-
} catch (r) {
|
|
143
|
-
throw console.error(
|
|
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
|
-
), r;
|
|
146
|
-
}
|
|
147
|
-
return Ee(t, e);
|
|
148
|
-
}
|
|
149
|
-
return e;
|
|
150
|
-
}
|
|
151
|
-
function Rs(t) {
|
|
152
|
-
return t;
|
|
153
|
-
}
|
|
154
|
-
function Es(t, e, s = 0) {
|
|
155
|
-
const r = [...t, e];
|
|
156
|
-
return s && r.length > s ? r.slice(1) : r;
|
|
157
|
-
}
|
|
158
|
-
function Cs(t, e, s = 0) {
|
|
159
|
-
const r = [e, ...t];
|
|
160
|
-
return s && r.length > s ? r.slice(0, -1) : r;
|
|
161
|
-
}
|
|
162
|
-
var ve = Symbol();
|
|
163
|
-
function Pt(t, e) {
|
|
164
|
-
return process.env.NODE_ENV !== "production" && t.queryFn === ve && console.error(
|
|
165
|
-
`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${t.queryHash}'`
|
|
166
|
-
), !t.queryFn && (e != null && e.initialPromise) ? () => e.initialPromise : !t.queryFn || t.queryFn === ve ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn;
|
|
167
|
-
}
|
|
168
|
-
var H, Q, Y, st, Tt = (st = class extends Qe {
|
|
169
|
-
constructor() {
|
|
170
|
-
super();
|
|
171
|
-
b(this, H);
|
|
172
|
-
b(this, Q);
|
|
173
|
-
b(this, Y);
|
|
174
|
-
f(this, Y, (e) => {
|
|
175
|
-
if (!J && window.addEventListener) {
|
|
176
|
-
const s = () => e();
|
|
177
|
-
return window.addEventListener("visibilitychange", s, !1), () => {
|
|
178
|
-
window.removeEventListener("visibilitychange", s);
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
onSubscribe() {
|
|
184
|
-
n(this, Q) || this.setEventListener(n(this, Y));
|
|
185
|
-
}
|
|
186
|
-
onUnsubscribe() {
|
|
187
|
-
var e;
|
|
188
|
-
this.hasListeners() || ((e = n(this, Q)) == null || e.call(this), f(this, Q, void 0));
|
|
189
|
-
}
|
|
190
|
-
setEventListener(e) {
|
|
191
|
-
var s;
|
|
192
|
-
f(this, Y, e), (s = n(this, Q)) == null || s.call(this), f(this, Q, e((r) => {
|
|
193
|
-
typeof r == "boolean" ? this.setFocused(r) : this.onFocus();
|
|
194
|
-
}));
|
|
195
|
-
}
|
|
196
|
-
setFocused(e) {
|
|
197
|
-
n(this, H) !== e && (f(this, H, e), this.onFocus());
|
|
198
|
-
}
|
|
199
|
-
onFocus() {
|
|
200
|
-
const e = this.isFocused();
|
|
201
|
-
this.listeners.forEach((s) => {
|
|
202
|
-
s(e);
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
isFocused() {
|
|
206
|
-
var e;
|
|
207
|
-
return typeof n(this, H) == "boolean" ? n(this, H) : ((e = globalThis.document) == null ? void 0 : e.visibilityState) !== "hidden";
|
|
208
|
-
}
|
|
209
|
-
}, H = new WeakMap(), Q = new WeakMap(), Y = new WeakMap(), st), ut = new Tt(), X, N, ee, rt, Dt = (rt = class extends Qe {
|
|
210
|
-
constructor() {
|
|
211
|
-
super();
|
|
212
|
-
b(this, X, !0);
|
|
213
|
-
b(this, N);
|
|
214
|
-
b(this, ee);
|
|
215
|
-
f(this, ee, (e) => {
|
|
216
|
-
if (!J && window.addEventListener) {
|
|
217
|
-
const s = () => e(!0), r = () => e(!1);
|
|
218
|
-
return window.addEventListener("online", s, !1), window.addEventListener("offline", r, !1), () => {
|
|
219
|
-
window.removeEventListener("online", s), window.removeEventListener("offline", r);
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
onSubscribe() {
|
|
225
|
-
n(this, N) || this.setEventListener(n(this, ee));
|
|
226
|
-
}
|
|
227
|
-
onUnsubscribe() {
|
|
228
|
-
var e;
|
|
229
|
-
this.hasListeners() || ((e = n(this, N)) == null || e.call(this), f(this, N, void 0));
|
|
230
|
-
}
|
|
231
|
-
setEventListener(e) {
|
|
232
|
-
var s;
|
|
233
|
-
f(this, ee, e), (s = n(this, N)) == null || s.call(this), f(this, N, e(this.setOnline.bind(this)));
|
|
234
|
-
}
|
|
235
|
-
setOnline(e) {
|
|
236
|
-
n(this, X) !== e && (f(this, X, e), this.listeners.forEach((r) => {
|
|
237
|
-
r(e);
|
|
238
|
-
}));
|
|
239
|
-
}
|
|
240
|
-
isOnline() {
|
|
241
|
-
return n(this, X);
|
|
242
|
-
}
|
|
243
|
-
}, X = new WeakMap(), N = new WeakMap(), ee = new WeakMap(), rt), ct = new Dt();
|
|
244
|
-
function Ie() {
|
|
245
|
-
let t, e;
|
|
246
|
-
const s = new Promise((i, a) => {
|
|
247
|
-
t = i, e = a;
|
|
248
|
-
});
|
|
249
|
-
s.status = "pending", s.catch(() => {
|
|
250
|
-
});
|
|
251
|
-
function r(i) {
|
|
252
|
-
Object.assign(s, i), delete s.resolve, delete s.reject;
|
|
253
|
-
}
|
|
254
|
-
return s.resolve = (i) => {
|
|
255
|
-
r({
|
|
256
|
-
status: "fulfilled",
|
|
257
|
-
value: i
|
|
258
|
-
}), t(i);
|
|
259
|
-
}, s.reject = (i) => {
|
|
260
|
-
r({
|
|
261
|
-
status: "rejected",
|
|
262
|
-
reason: i
|
|
263
|
-
}), e(i);
|
|
264
|
-
}, s;
|
|
265
|
-
}
|
|
266
|
-
function jt(t) {
|
|
267
|
-
return Math.min(1e3 * 2 ** t, 3e4);
|
|
268
|
-
}
|
|
269
|
-
function ht(t) {
|
|
270
|
-
return (t ?? "online") === "online" ? ct.isOnline() : !0;
|
|
271
|
-
}
|
|
272
|
-
var lt = class extends Error {
|
|
273
|
-
constructor(t) {
|
|
274
|
-
super("CancelledError"), this.revert = t == null ? void 0 : t.revert, this.silent = t == null ? void 0 : t.silent;
|
|
275
|
-
}
|
|
276
|
-
};
|
|
277
|
-
function ge(t) {
|
|
278
|
-
return t instanceof lt;
|
|
279
|
-
}
|
|
280
|
-
function At(t) {
|
|
281
|
-
let e = !1, s = 0, r = !1, i;
|
|
282
|
-
const a = Ie(), o = (h) => {
|
|
283
|
-
var v;
|
|
284
|
-
r || (p(new lt(h)), (v = t.abort) == null || v.call(t));
|
|
285
|
-
}, u = () => {
|
|
286
|
-
e = !0;
|
|
287
|
-
}, l = () => {
|
|
288
|
-
e = !1;
|
|
289
|
-
}, y = () => ut.isFocused() && (t.networkMode === "always" || ct.isOnline()) && t.canRun(), g = () => ht(t.networkMode) && t.canRun(), c = (h) => {
|
|
290
|
-
var v;
|
|
291
|
-
r || (r = !0, (v = t.onSuccess) == null || v.call(t, h), i == null || i(), a.resolve(h));
|
|
292
|
-
}, p = (h) => {
|
|
293
|
-
var v;
|
|
294
|
-
r || (r = !0, (v = t.onError) == null || v.call(t, h), i == null || i(), a.reject(h));
|
|
295
|
-
}, d = () => new Promise((h) => {
|
|
296
|
-
var v;
|
|
297
|
-
i = (C) => {
|
|
298
|
-
(r || y()) && h(C);
|
|
299
|
-
}, (v = t.onPause) == null || v.call(t);
|
|
300
|
-
}).then(() => {
|
|
301
|
-
var h;
|
|
302
|
-
i = void 0, r || (h = t.onContinue) == null || h.call(t);
|
|
303
|
-
}), E = () => {
|
|
304
|
-
if (r)
|
|
305
|
-
return;
|
|
306
|
-
let h;
|
|
307
|
-
const v = s === 0 ? t.initialPromise : void 0;
|
|
308
|
-
try {
|
|
309
|
-
h = v ?? t.fn();
|
|
310
|
-
} catch (C) {
|
|
311
|
-
h = Promise.reject(C);
|
|
312
|
-
}
|
|
313
|
-
Promise.resolve(h).then(c).catch((C) => {
|
|
314
|
-
var oe;
|
|
315
|
-
if (r)
|
|
316
|
-
return;
|
|
317
|
-
const R = t.retry ?? (J ? 0 : 3), O = t.retryDelay ?? jt, q = typeof O == "function" ? O(s, C) : O, Z = R === !0 || typeof R == "number" && s < R || typeof R == "function" && R(s, C);
|
|
318
|
-
if (e || !Z) {
|
|
319
|
-
p(C);
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
s++, (oe = t.onFail) == null || oe.call(t, s, C), It(q).then(() => y() ? void 0 : d()).then(() => {
|
|
323
|
-
e ? p(C) : E();
|
|
324
|
-
});
|
|
325
|
-
});
|
|
326
|
-
};
|
|
327
|
-
return {
|
|
328
|
-
promise: a,
|
|
329
|
-
cancel: o,
|
|
330
|
-
continue: () => (i == null || i(), a),
|
|
331
|
-
cancelRetry: u,
|
|
332
|
-
continueRetry: l,
|
|
333
|
-
canStart: g,
|
|
334
|
-
start: () => (g() ? E() : d().then(E), a)
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
var kt = (t) => setTimeout(t, 0);
|
|
338
|
-
function xt() {
|
|
339
|
-
let t = [], e = 0, s = (u) => {
|
|
340
|
-
u();
|
|
341
|
-
}, r = (u) => {
|
|
342
|
-
u();
|
|
343
|
-
}, i = kt;
|
|
344
|
-
const a = (u) => {
|
|
345
|
-
e ? t.push(u) : i(() => {
|
|
346
|
-
s(u);
|
|
347
|
-
});
|
|
348
|
-
}, o = () => {
|
|
349
|
-
const u = t;
|
|
350
|
-
t = [], u.length && i(() => {
|
|
351
|
-
r(() => {
|
|
352
|
-
u.forEach((l) => {
|
|
353
|
-
s(l);
|
|
354
|
-
});
|
|
355
|
-
});
|
|
356
|
-
});
|
|
357
|
-
};
|
|
358
|
-
return {
|
|
359
|
-
batch: (u) => {
|
|
360
|
-
let l;
|
|
361
|
-
e++;
|
|
362
|
-
try {
|
|
363
|
-
l = u();
|
|
364
|
-
} finally {
|
|
365
|
-
e--, e || o();
|
|
366
|
-
}
|
|
367
|
-
return l;
|
|
368
|
-
},
|
|
369
|
-
/**
|
|
370
|
-
* All calls to the wrapped function will be batched.
|
|
371
|
-
*/
|
|
372
|
-
batchCalls: (u) => (...l) => {
|
|
373
|
-
a(() => {
|
|
374
|
-
u(...l);
|
|
375
|
-
});
|
|
376
|
-
},
|
|
377
|
-
schedule: a,
|
|
378
|
-
/**
|
|
379
|
-
* Use this method to set a custom notify function.
|
|
380
|
-
* This can be used to for example wrap notifications with `React.act` while running tests.
|
|
381
|
-
*/
|
|
382
|
-
setNotifyFunction: (u) => {
|
|
383
|
-
s = u;
|
|
384
|
-
},
|
|
385
|
-
/**
|
|
386
|
-
* Use this method to set a custom function to batch notifications together into a single tick.
|
|
387
|
-
* By default React Query will use the batch function provided by ReactDOM or React Native.
|
|
388
|
-
*/
|
|
389
|
-
setBatchNotifyFunction: (u) => {
|
|
390
|
-
r = u;
|
|
391
|
-
},
|
|
392
|
-
setScheduler: (u) => {
|
|
393
|
-
i = u;
|
|
394
|
-
}
|
|
395
|
-
};
|
|
396
|
-
}
|
|
397
|
-
var Le = xt(), K, nt, qt = (nt = class {
|
|
398
|
-
constructor() {
|
|
399
|
-
b(this, K);
|
|
400
|
-
}
|
|
401
|
-
destroy() {
|
|
402
|
-
this.clearGcTimeout();
|
|
403
|
-
}
|
|
404
|
-
scheduleGc() {
|
|
405
|
-
this.clearGcTimeout(), we(this.gcTime) && f(this, K, setTimeout(() => {
|
|
406
|
-
this.optionalRemove();
|
|
407
|
-
}, this.gcTime));
|
|
408
|
-
}
|
|
409
|
-
updateGcTime(t) {
|
|
410
|
-
this.gcTime = Math.max(
|
|
411
|
-
this.gcTime || 0,
|
|
412
|
-
t ?? (J ? 1 / 0 : 5 * 60 * 1e3)
|
|
413
|
-
);
|
|
414
|
-
}
|
|
415
|
-
clearGcTimeout() {
|
|
416
|
-
n(this, K) && (clearTimeout(n(this, K)), f(this, K, void 0));
|
|
417
|
-
}
|
|
418
|
-
}, K = new WeakMap(), nt), te, se, D, B, F, he, $, A, U, it, Os = (it = class extends qt {
|
|
419
|
-
constructor(e) {
|
|
420
|
-
super();
|
|
421
|
-
b(this, A);
|
|
422
|
-
b(this, te);
|
|
423
|
-
b(this, se);
|
|
424
|
-
b(this, D);
|
|
425
|
-
b(this, B);
|
|
426
|
-
b(this, F);
|
|
427
|
-
b(this, he);
|
|
428
|
-
b(this, $);
|
|
429
|
-
f(this, $, !1), f(this, he, e.defaultOptions), this.setOptions(e.options), this.observers = [], f(this, B, e.client), f(this, D, n(this, B).getQueryCache()), this.queryKey = e.queryKey, this.queryHash = e.queryHash, f(this, te, Ut(this.options)), this.state = e.state ?? n(this, te), this.scheduleGc();
|
|
430
|
-
}
|
|
431
|
-
get meta() {
|
|
432
|
-
return this.options.meta;
|
|
433
|
-
}
|
|
434
|
-
get promise() {
|
|
435
|
-
var e;
|
|
436
|
-
return (e = n(this, F)) == null ? void 0 : e.promise;
|
|
437
|
-
}
|
|
438
|
-
setOptions(e) {
|
|
439
|
-
this.options = { ...n(this, he), ...e }, this.updateGcTime(this.options.gcTime);
|
|
440
|
-
}
|
|
441
|
-
optionalRemove() {
|
|
442
|
-
!this.observers.length && this.state.fetchStatus === "idle" && n(this, D).remove(this);
|
|
443
|
-
}
|
|
444
|
-
setData(e, s) {
|
|
445
|
-
const r = Fe(this.state.data, e, this.options);
|
|
446
|
-
return w(this, A, U).call(this, {
|
|
447
|
-
data: r,
|
|
448
|
-
type: "success",
|
|
449
|
-
dataUpdatedAt: s == null ? void 0 : s.updatedAt,
|
|
450
|
-
manual: s == null ? void 0 : s.manual
|
|
451
|
-
}), r;
|
|
452
|
-
}
|
|
453
|
-
setState(e, s) {
|
|
454
|
-
w(this, A, U).call(this, { type: "setState", state: e, setStateOptions: s });
|
|
455
|
-
}
|
|
456
|
-
cancel(e) {
|
|
457
|
-
var r, i;
|
|
458
|
-
const s = (r = n(this, F)) == null ? void 0 : r.promise;
|
|
459
|
-
return (i = n(this, F)) == null || i.cancel(e), s ? s.then(Se).catch(Se) : Promise.resolve();
|
|
460
|
-
}
|
|
461
|
-
destroy() {
|
|
462
|
-
super.destroy(), this.cancel({ silent: !0 });
|
|
463
|
-
}
|
|
464
|
-
reset() {
|
|
465
|
-
this.destroy(), this.setState(n(this, te));
|
|
466
|
-
}
|
|
467
|
-
isActive() {
|
|
468
|
-
return this.observers.some(
|
|
469
|
-
(e) => k(e.options.enabled, this) !== !1
|
|
470
|
-
);
|
|
471
|
-
}
|
|
472
|
-
isDisabled() {
|
|
473
|
-
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === ve || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
|
|
474
|
-
}
|
|
475
|
-
isStale() {
|
|
476
|
-
return this.state.isInvalidated ? !0 : this.getObserversCount() > 0 ? this.observers.some(
|
|
477
|
-
(e) => e.getCurrentResult().isStale
|
|
478
|
-
) : this.state.data === void 0;
|
|
479
|
-
}
|
|
480
|
-
isStaleByTime(e = 0) {
|
|
481
|
-
return this.state.isInvalidated || this.state.data === void 0 || !ot(this.state.dataUpdatedAt, e);
|
|
482
|
-
}
|
|
483
|
-
onFocus() {
|
|
484
|
-
var s;
|
|
485
|
-
const e = this.observers.find((r) => r.shouldFetchOnWindowFocus());
|
|
486
|
-
e == null || e.refetch({ cancelRefetch: !1 }), (s = n(this, F)) == null || s.continue();
|
|
487
|
-
}
|
|
488
|
-
onOnline() {
|
|
489
|
-
var s;
|
|
490
|
-
const e = this.observers.find((r) => r.shouldFetchOnReconnect());
|
|
491
|
-
e == null || e.refetch({ cancelRefetch: !1 }), (s = n(this, F)) == null || s.continue();
|
|
492
|
-
}
|
|
493
|
-
addObserver(e) {
|
|
494
|
-
this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(), n(this, D).notify({ type: "observerAdded", query: this, observer: e }));
|
|
495
|
-
}
|
|
496
|
-
removeObserver(e) {
|
|
497
|
-
this.observers.includes(e) && (this.observers = this.observers.filter((s) => s !== e), this.observers.length || (n(this, F) && (n(this, $) ? n(this, F).cancel({ revert: !0 }) : n(this, F).cancelRetry()), this.scheduleGc()), n(this, D).notify({ type: "observerRemoved", query: this, observer: e }));
|
|
498
|
-
}
|
|
499
|
-
getObserversCount() {
|
|
500
|
-
return this.observers.length;
|
|
501
|
-
}
|
|
502
|
-
invalidate() {
|
|
503
|
-
this.state.isInvalidated || w(this, A, U).call(this, { type: "invalidate" });
|
|
504
|
-
}
|
|
505
|
-
fetch(e, s) {
|
|
506
|
-
var l, y, g;
|
|
507
|
-
if (this.state.fetchStatus !== "idle") {
|
|
508
|
-
if (this.state.data !== void 0 && (s != null && s.cancelRefetch))
|
|
509
|
-
this.cancel({ silent: !0 });
|
|
510
|
-
else if (n(this, F))
|
|
511
|
-
return n(this, F).continueRetry(), n(this, F).promise;
|
|
512
|
-
}
|
|
513
|
-
if (e && this.setOptions(e), !this.options.queryFn) {
|
|
514
|
-
const c = this.observers.find((p) => p.options.queryFn);
|
|
515
|
-
c && this.setOptions(c.options);
|
|
516
|
-
}
|
|
517
|
-
process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
|
|
518
|
-
"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']"
|
|
519
|
-
));
|
|
520
|
-
const r = new AbortController(), i = (c) => {
|
|
521
|
-
Object.defineProperty(c, "signal", {
|
|
522
|
-
enumerable: !0,
|
|
523
|
-
get: () => (f(this, $, !0), r.signal)
|
|
524
|
-
});
|
|
525
|
-
}, a = () => {
|
|
526
|
-
const c = Pt(this.options, s), p = {
|
|
527
|
-
client: n(this, B),
|
|
528
|
-
queryKey: this.queryKey,
|
|
529
|
-
meta: this.meta
|
|
530
|
-
};
|
|
531
|
-
return i(p), f(this, $, !1), this.options.persister ? this.options.persister(
|
|
532
|
-
c,
|
|
533
|
-
p,
|
|
534
|
-
this
|
|
535
|
-
) : c(p);
|
|
536
|
-
}, o = {
|
|
537
|
-
fetchOptions: s,
|
|
538
|
-
options: this.options,
|
|
539
|
-
queryKey: this.queryKey,
|
|
540
|
-
client: n(this, B),
|
|
541
|
-
state: this.state,
|
|
542
|
-
fetchFn: a
|
|
543
|
-
};
|
|
544
|
-
i(o), (l = this.options.behavior) == null || l.onFetch(
|
|
545
|
-
o,
|
|
546
|
-
this
|
|
547
|
-
), f(this, se, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((y = o.fetchOptions) == null ? void 0 : y.meta)) && w(this, A, U).call(this, { type: "fetch", meta: (g = o.fetchOptions) == null ? void 0 : g.meta });
|
|
548
|
-
const u = (c) => {
|
|
549
|
-
var p, d, E, h;
|
|
550
|
-
ge(c) && c.silent || w(this, A, U).call(this, {
|
|
551
|
-
type: "error",
|
|
552
|
-
error: c
|
|
553
|
-
}), ge(c) || ((d = (p = n(this, D).config).onError) == null || d.call(
|
|
554
|
-
p,
|
|
555
|
-
c,
|
|
556
|
-
this
|
|
557
|
-
), (h = (E = n(this, D).config).onSettled) == null || h.call(
|
|
558
|
-
E,
|
|
559
|
-
this.state.data,
|
|
560
|
-
c,
|
|
561
|
-
this
|
|
562
|
-
)), this.scheduleGc();
|
|
563
|
-
};
|
|
564
|
-
return f(this, F, At({
|
|
565
|
-
initialPromise: s == null ? void 0 : s.initialPromise,
|
|
566
|
-
fn: o.fetchFn,
|
|
567
|
-
abort: r.abort.bind(r),
|
|
568
|
-
onSuccess: (c) => {
|
|
569
|
-
var p, d, E, h;
|
|
570
|
-
if (c === void 0) {
|
|
571
|
-
process.env.NODE_ENV !== "production" && console.error(
|
|
572
|
-
`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
|
|
573
|
-
), u(new Error(`${this.queryHash} data is undefined`));
|
|
574
|
-
return;
|
|
575
|
-
}
|
|
576
|
-
try {
|
|
577
|
-
this.setData(c);
|
|
578
|
-
} catch (v) {
|
|
579
|
-
u(v);
|
|
580
|
-
return;
|
|
581
|
-
}
|
|
582
|
-
(d = (p = n(this, D).config).onSuccess) == null || d.call(p, c, this), (h = (E = n(this, D).config).onSettled) == null || h.call(
|
|
583
|
-
E,
|
|
584
|
-
c,
|
|
585
|
-
this.state.error,
|
|
586
|
-
this
|
|
587
|
-
), this.scheduleGc();
|
|
588
|
-
},
|
|
589
|
-
onError: u,
|
|
590
|
-
onFail: (c, p) => {
|
|
591
|
-
w(this, A, U).call(this, { type: "failed", failureCount: c, error: p });
|
|
592
|
-
},
|
|
593
|
-
onPause: () => {
|
|
594
|
-
w(this, A, U).call(this, { type: "pause" });
|
|
595
|
-
},
|
|
596
|
-
onContinue: () => {
|
|
597
|
-
w(this, A, U).call(this, { type: "continue" });
|
|
598
|
-
},
|
|
599
|
-
retry: o.options.retry,
|
|
600
|
-
retryDelay: o.options.retryDelay,
|
|
601
|
-
networkMode: o.options.networkMode,
|
|
602
|
-
canRun: () => !0
|
|
603
|
-
})), n(this, F).start();
|
|
604
|
-
}
|
|
605
|
-
}, te = new WeakMap(), se = new WeakMap(), D = new WeakMap(), B = new WeakMap(), F = new WeakMap(), he = new WeakMap(), $ = new WeakMap(), A = new WeakSet(), U = function(e) {
|
|
606
|
-
const s = (r) => {
|
|
607
|
-
switch (e.type) {
|
|
608
|
-
case "failed":
|
|
609
|
-
return {
|
|
610
|
-
...r,
|
|
611
|
-
fetchFailureCount: e.failureCount,
|
|
612
|
-
fetchFailureReason: e.error
|
|
613
|
-
};
|
|
614
|
-
case "pause":
|
|
615
|
-
return {
|
|
616
|
-
...r,
|
|
617
|
-
fetchStatus: "paused"
|
|
618
|
-
};
|
|
619
|
-
case "continue":
|
|
620
|
-
return {
|
|
621
|
-
...r,
|
|
622
|
-
fetchStatus: "fetching"
|
|
623
|
-
};
|
|
624
|
-
case "fetch":
|
|
625
|
-
return {
|
|
626
|
-
...r,
|
|
627
|
-
...dt(r.data, this.options),
|
|
628
|
-
fetchMeta: e.meta ?? null
|
|
629
|
-
};
|
|
630
|
-
case "success":
|
|
631
|
-
return {
|
|
632
|
-
...r,
|
|
633
|
-
data: e.data,
|
|
634
|
-
dataUpdateCount: r.dataUpdateCount + 1,
|
|
635
|
-
dataUpdatedAt: e.dataUpdatedAt ?? Date.now(),
|
|
636
|
-
error: null,
|
|
637
|
-
isInvalidated: !1,
|
|
638
|
-
status: "success",
|
|
639
|
-
...!e.manual && {
|
|
640
|
-
fetchStatus: "idle",
|
|
641
|
-
fetchFailureCount: 0,
|
|
642
|
-
fetchFailureReason: null
|
|
643
|
-
}
|
|
644
|
-
};
|
|
645
|
-
case "error":
|
|
646
|
-
const i = e.error;
|
|
647
|
-
return ge(i) && i.revert && n(this, se) ? { ...n(this, se), fetchStatus: "idle" } : {
|
|
648
|
-
...r,
|
|
649
|
-
error: i,
|
|
650
|
-
errorUpdateCount: r.errorUpdateCount + 1,
|
|
651
|
-
errorUpdatedAt: Date.now(),
|
|
652
|
-
fetchFailureCount: r.fetchFailureCount + 1,
|
|
653
|
-
fetchFailureReason: i,
|
|
654
|
-
fetchStatus: "idle",
|
|
655
|
-
status: "error"
|
|
656
|
-
};
|
|
657
|
-
case "invalidate":
|
|
658
|
-
return {
|
|
659
|
-
...r,
|
|
660
|
-
isInvalidated: !0
|
|
661
|
-
};
|
|
662
|
-
case "setState":
|
|
663
|
-
return {
|
|
664
|
-
...r,
|
|
665
|
-
...e.state
|
|
666
|
-
};
|
|
667
|
-
}
|
|
668
|
-
};
|
|
669
|
-
this.state = s(this.state), Le.batch(() => {
|
|
670
|
-
this.observers.forEach((r) => {
|
|
671
|
-
r.onQueryUpdate();
|
|
672
|
-
}), n(this, D).notify({ query: this, type: "updated", action: e });
|
|
673
|
-
});
|
|
674
|
-
}, it);
|
|
675
|
-
function dt(t, e) {
|
|
676
|
-
return {
|
|
677
|
-
fetchFailureCount: 0,
|
|
678
|
-
fetchFailureReason: null,
|
|
679
|
-
fetchStatus: ht(e.networkMode) ? "fetching" : "paused",
|
|
680
|
-
...t === void 0 && {
|
|
681
|
-
error: null,
|
|
682
|
-
status: "pending"
|
|
683
|
-
}
|
|
684
|
-
};
|
|
685
|
-
}
|
|
686
|
-
function Ut(t) {
|
|
687
|
-
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;
|
|
688
|
-
return {
|
|
689
|
-
data: e,
|
|
690
|
-
dataUpdateCount: 0,
|
|
691
|
-
dataUpdatedAt: s ? r ?? Date.now() : 0,
|
|
692
|
-
error: null,
|
|
693
|
-
errorUpdateCount: 0,
|
|
694
|
-
errorUpdatedAt: 0,
|
|
695
|
-
fetchFailureCount: 0,
|
|
696
|
-
fetchFailureReason: null,
|
|
697
|
-
fetchMeta: null,
|
|
698
|
-
isInvalidated: !1,
|
|
699
|
-
status: s ? "success" : "pending",
|
|
700
|
-
fetchStatus: "idle"
|
|
701
|
-
};
|
|
702
|
-
}
|
|
703
|
-
var P, m, le, I, G, re, L, M, de, ne, ie, z, V, _, ae, S, ue, Pe, Te, De, je, Ae, ke, xe, yt, at, ft = (at = class extends Qe {
|
|
704
|
-
constructor(e, s) {
|
|
705
|
-
super();
|
|
706
|
-
b(this, S);
|
|
707
|
-
b(this, P);
|
|
708
|
-
b(this, m);
|
|
709
|
-
b(this, le);
|
|
710
|
-
b(this, I);
|
|
711
|
-
b(this, G);
|
|
712
|
-
b(this, re);
|
|
713
|
-
b(this, L);
|
|
714
|
-
b(this, M);
|
|
715
|
-
b(this, de);
|
|
716
|
-
b(this, ne);
|
|
717
|
-
// This property keeps track of the last query with defined data.
|
|
718
|
-
// It will be used to pass the previous data and query to the placeholder function between renders.
|
|
719
|
-
b(this, ie);
|
|
720
|
-
b(this, z);
|
|
721
|
-
b(this, V);
|
|
722
|
-
b(this, _);
|
|
723
|
-
b(this, ae, /* @__PURE__ */ new Set());
|
|
724
|
-
this.options = s, f(this, P, e), f(this, M, null), f(this, L, Ie()), this.options.experimental_prefetchInRender || n(this, L).reject(
|
|
725
|
-
new Error("experimental_prefetchInRender feature flag is not enabled")
|
|
726
|
-
), this.bindMethods(), this.setOptions(s);
|
|
727
|
-
}
|
|
728
|
-
bindMethods() {
|
|
729
|
-
this.refetch = this.refetch.bind(this);
|
|
730
|
-
}
|
|
731
|
-
onSubscribe() {
|
|
732
|
-
this.listeners.size === 1 && (n(this, m).addObserver(this), Ze(n(this, m), this.options) ? w(this, S, ue).call(this) : this.updateResult(), w(this, S, je).call(this));
|
|
733
|
-
}
|
|
734
|
-
onUnsubscribe() {
|
|
735
|
-
this.hasListeners() || this.destroy();
|
|
736
|
-
}
|
|
737
|
-
shouldFetchOnReconnect() {
|
|
738
|
-
return qe(
|
|
739
|
-
n(this, m),
|
|
740
|
-
this.options,
|
|
741
|
-
this.options.refetchOnReconnect
|
|
742
|
-
);
|
|
743
|
-
}
|
|
744
|
-
shouldFetchOnWindowFocus() {
|
|
745
|
-
return qe(
|
|
746
|
-
n(this, m),
|
|
747
|
-
this.options,
|
|
748
|
-
this.options.refetchOnWindowFocus
|
|
749
|
-
);
|
|
750
|
-
}
|
|
751
|
-
destroy() {
|
|
752
|
-
this.listeners = /* @__PURE__ */ new Set(), w(this, S, Ae).call(this), w(this, S, ke).call(this), n(this, m).removeObserver(this);
|
|
753
|
-
}
|
|
754
|
-
setOptions(e) {
|
|
755
|
-
const s = this.options, r = n(this, m);
|
|
756
|
-
if (this.options = n(this, P).defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof k(this.options.enabled, n(this, m)) != "boolean")
|
|
757
|
-
throw new Error(
|
|
758
|
-
"Expected enabled to be a boolean or a callback that returns a boolean"
|
|
759
|
-
);
|
|
760
|
-
w(this, S, xe).call(this), n(this, m).setOptions(this.options), s._defaulted && !Ce(this.options, s) && n(this, P).getQueryCache().notify({
|
|
761
|
-
type: "observerOptionsUpdated",
|
|
762
|
-
query: n(this, m),
|
|
763
|
-
observer: this
|
|
764
|
-
});
|
|
765
|
-
const i = this.hasListeners();
|
|
766
|
-
i && We(
|
|
767
|
-
n(this, m),
|
|
768
|
-
r,
|
|
769
|
-
this.options,
|
|
770
|
-
s
|
|
771
|
-
) && w(this, S, ue).call(this), this.updateResult(), i && (n(this, m) !== r || k(this.options.enabled, n(this, m)) !== k(s.enabled, n(this, m)) || pe(this.options.staleTime, n(this, m)) !== pe(s.staleTime, n(this, m))) && w(this, S, Pe).call(this);
|
|
772
|
-
const a = w(this, S, Te).call(this);
|
|
773
|
-
i && (n(this, m) !== r || k(this.options.enabled, n(this, m)) !== k(s.enabled, n(this, m)) || a !== n(this, _)) && w(this, S, De).call(this, a);
|
|
774
|
-
}
|
|
775
|
-
getOptimisticResult(e) {
|
|
776
|
-
const s = n(this, P).getQueryCache().build(n(this, P), e), r = this.createResult(s, e);
|
|
777
|
-
return Nt(this, r) && (f(this, I, r), f(this, re, this.options), f(this, G, n(this, m).state)), r;
|
|
778
|
-
}
|
|
779
|
-
getCurrentResult() {
|
|
780
|
-
return n(this, I);
|
|
781
|
-
}
|
|
782
|
-
trackResult(e, s) {
|
|
783
|
-
const r = {};
|
|
784
|
-
return Object.keys(e).forEach((i) => {
|
|
785
|
-
Object.defineProperty(r, i, {
|
|
786
|
-
configurable: !1,
|
|
787
|
-
enumerable: !0,
|
|
788
|
-
get: () => (this.trackProp(i), s == null || s(i), e[i])
|
|
789
|
-
});
|
|
790
|
-
}), r;
|
|
791
|
-
}
|
|
792
|
-
trackProp(e) {
|
|
793
|
-
n(this, ae).add(e);
|
|
794
|
-
}
|
|
795
|
-
getCurrentQuery() {
|
|
796
|
-
return n(this, m);
|
|
797
|
-
}
|
|
798
|
-
refetch({ ...e } = {}) {
|
|
799
|
-
return this.fetch({
|
|
800
|
-
...e
|
|
801
|
-
});
|
|
802
|
-
}
|
|
803
|
-
fetchOptimistic(e) {
|
|
804
|
-
const s = n(this, P).defaultQueryOptions(e), r = n(this, P).getQueryCache().build(n(this, P), s);
|
|
805
|
-
return r.fetch().then(() => this.createResult(r, s));
|
|
806
|
-
}
|
|
807
|
-
fetch(e) {
|
|
808
|
-
return w(this, S, ue).call(this, {
|
|
809
|
-
...e,
|
|
810
|
-
cancelRefetch: e.cancelRefetch ?? !0
|
|
811
|
-
}).then(() => (this.updateResult(), n(this, I)));
|
|
812
|
-
}
|
|
813
|
-
createResult(e, s) {
|
|
814
|
-
var Be;
|
|
815
|
-
const r = n(this, m), i = this.options, a = n(this, I), o = n(this, G), u = n(this, re), y = e !== r ? e.state : n(this, le), { state: g } = e;
|
|
816
|
-
let c = { ...g }, p = !1, d;
|
|
817
|
-
if (s._optimisticResults) {
|
|
818
|
-
const T = this.hasListeners(), fe = !T && Ze(e, s), W = T && We(e, r, s, i);
|
|
819
|
-
(fe || W) && (c = {
|
|
820
|
-
...c,
|
|
821
|
-
...dt(g.data, e.options)
|
|
822
|
-
}), s._optimisticResults === "isRestoring" && (c.fetchStatus = "idle");
|
|
823
|
-
}
|
|
824
|
-
let { error: E, errorUpdatedAt: h, status: v } = c;
|
|
825
|
-
d = c.data;
|
|
826
|
-
let C = !1;
|
|
827
|
-
if (s.placeholderData !== void 0 && d === void 0 && v === "pending") {
|
|
828
|
-
let T;
|
|
829
|
-
a != null && a.isPlaceholderData && s.placeholderData === (u == null ? void 0 : u.placeholderData) ? (T = a.data, C = !0) : T = typeof s.placeholderData == "function" ? s.placeholderData(
|
|
830
|
-
(Be = n(this, ie)) == null ? void 0 : Be.state.data,
|
|
831
|
-
n(this, ie)
|
|
832
|
-
) : s.placeholderData, T !== void 0 && (v = "success", d = Fe(
|
|
833
|
-
a == null ? void 0 : a.data,
|
|
834
|
-
T,
|
|
835
|
-
s
|
|
836
|
-
), p = !0);
|
|
837
|
-
}
|
|
838
|
-
if (s.select && d !== void 0 && !C)
|
|
839
|
-
if (a && d === (o == null ? void 0 : o.data) && s.select === n(this, de))
|
|
840
|
-
d = n(this, ne);
|
|
841
|
-
else
|
|
842
|
-
try {
|
|
843
|
-
f(this, de, s.select), d = s.select(d), d = Fe(a == null ? void 0 : a.data, d, s), f(this, ne, d), f(this, M, null);
|
|
844
|
-
} catch (T) {
|
|
845
|
-
f(this, M, T);
|
|
846
|
-
}
|
|
847
|
-
n(this, M) && (E = n(this, M), d = n(this, ne), h = Date.now(), v = "error");
|
|
848
|
-
const R = c.fetchStatus === "fetching", O = v === "pending", q = v === "error", Z = O && R, oe = d !== void 0, x = {
|
|
849
|
-
status: v,
|
|
850
|
-
fetchStatus: c.fetchStatus,
|
|
851
|
-
isPending: O,
|
|
852
|
-
isSuccess: v === "success",
|
|
853
|
-
isError: q,
|
|
854
|
-
isInitialLoading: Z,
|
|
855
|
-
isLoading: Z,
|
|
856
|
-
data: d,
|
|
857
|
-
dataUpdatedAt: c.dataUpdatedAt,
|
|
858
|
-
error: E,
|
|
859
|
-
errorUpdatedAt: h,
|
|
860
|
-
failureCount: c.fetchFailureCount,
|
|
861
|
-
failureReason: c.fetchFailureReason,
|
|
862
|
-
errorUpdateCount: c.errorUpdateCount,
|
|
863
|
-
isFetched: c.dataUpdateCount > 0 || c.errorUpdateCount > 0,
|
|
864
|
-
isFetchedAfterMount: c.dataUpdateCount > y.dataUpdateCount || c.errorUpdateCount > y.errorUpdateCount,
|
|
865
|
-
isFetching: R,
|
|
866
|
-
isRefetching: R && !O,
|
|
867
|
-
isLoadingError: q && !oe,
|
|
868
|
-
isPaused: c.fetchStatus === "paused",
|
|
869
|
-
isPlaceholderData: p,
|
|
870
|
-
isRefetchError: q && oe,
|
|
871
|
-
isStale: Me(e, s),
|
|
872
|
-
refetch: this.refetch,
|
|
873
|
-
promise: n(this, L)
|
|
874
|
-
};
|
|
875
|
-
if (this.options.experimental_prefetchInRender) {
|
|
876
|
-
const T = (ye) => {
|
|
877
|
-
x.status === "error" ? ye.reject(x.error) : x.data !== void 0 && ye.resolve(x.data);
|
|
878
|
-
}, fe = () => {
|
|
879
|
-
const ye = f(this, L, x.promise = Ie());
|
|
880
|
-
T(ye);
|
|
881
|
-
}, W = n(this, L);
|
|
882
|
-
switch (W.status) {
|
|
883
|
-
case "pending":
|
|
884
|
-
e.queryHash === r.queryHash && T(W);
|
|
885
|
-
break;
|
|
886
|
-
case "fulfilled":
|
|
887
|
-
(x.status === "error" || x.data !== W.value) && fe();
|
|
888
|
-
break;
|
|
889
|
-
case "rejected":
|
|
890
|
-
(x.status !== "error" || x.error !== W.reason) && fe();
|
|
891
|
-
break;
|
|
892
|
-
}
|
|
893
|
-
}
|
|
894
|
-
return x;
|
|
895
|
-
}
|
|
896
|
-
updateResult() {
|
|
897
|
-
const e = n(this, I), s = this.createResult(n(this, m), this.options);
|
|
898
|
-
if (f(this, G, n(this, m).state), f(this, re, this.options), n(this, G).data !== void 0 && f(this, ie, n(this, m)), Ce(s, e))
|
|
899
|
-
return;
|
|
900
|
-
f(this, I, s);
|
|
901
|
-
const r = () => {
|
|
902
|
-
if (!e)
|
|
903
|
-
return !0;
|
|
904
|
-
const { notifyOnChangeProps: i } = this.options, a = typeof i == "function" ? i() : i;
|
|
905
|
-
if (a === "all" || !a && !n(this, ae).size)
|
|
906
|
-
return !0;
|
|
907
|
-
const o = new Set(
|
|
908
|
-
a ?? n(this, ae)
|
|
909
|
-
);
|
|
910
|
-
return this.options.throwOnError && o.add("error"), Object.keys(n(this, I)).some((u) => {
|
|
911
|
-
const l = u;
|
|
912
|
-
return n(this, I)[l] !== e[l] && o.has(l);
|
|
913
|
-
});
|
|
914
|
-
};
|
|
915
|
-
w(this, S, yt).call(this, { listeners: r() });
|
|
916
|
-
}
|
|
917
|
-
onQueryUpdate() {
|
|
918
|
-
this.updateResult(), this.hasListeners() && w(this, S, je).call(this);
|
|
919
|
-
}
|
|
920
|
-
}, P = new WeakMap(), m = new WeakMap(), le = new WeakMap(), I = new WeakMap(), G = new WeakMap(), re = new WeakMap(), L = new WeakMap(), M = new WeakMap(), de = new WeakMap(), ne = new WeakMap(), ie = new WeakMap(), z = new WeakMap(), V = new WeakMap(), _ = new WeakMap(), ae = new WeakMap(), S = new WeakSet(), ue = function(e) {
|
|
921
|
-
w(this, S, xe).call(this);
|
|
922
|
-
let s = n(this, m).fetch(
|
|
923
|
-
this.options,
|
|
924
|
-
e
|
|
925
|
-
);
|
|
926
|
-
return e != null && e.throwOnError || (s = s.catch(Se)), s;
|
|
927
|
-
}, Pe = function() {
|
|
928
|
-
w(this, S, Ae).call(this);
|
|
929
|
-
const e = pe(
|
|
930
|
-
this.options.staleTime,
|
|
931
|
-
n(this, m)
|
|
932
|
-
);
|
|
933
|
-
if (J || n(this, I).isStale || !we(e))
|
|
934
|
-
return;
|
|
935
|
-
const r = ot(n(this, I).dataUpdatedAt, e) + 1;
|
|
936
|
-
f(this, z, setTimeout(() => {
|
|
937
|
-
n(this, I).isStale || this.updateResult();
|
|
938
|
-
}, r));
|
|
939
|
-
}, Te = function() {
|
|
940
|
-
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(n(this, m)) : this.options.refetchInterval) ?? !1;
|
|
941
|
-
}, De = function(e) {
|
|
942
|
-
w(this, S, ke).call(this), f(this, _, e), !(J || k(this.options.enabled, n(this, m)) === !1 || !we(n(this, _)) || n(this, _) === 0) && f(this, V, setInterval(() => {
|
|
943
|
-
(this.options.refetchIntervalInBackground || ut.isFocused()) && w(this, S, ue).call(this);
|
|
944
|
-
}, n(this, _)));
|
|
945
|
-
}, je = function() {
|
|
946
|
-
w(this, S, Pe).call(this), w(this, S, De).call(this, w(this, S, Te).call(this));
|
|
947
|
-
}, Ae = function() {
|
|
948
|
-
n(this, z) && (clearTimeout(n(this, z)), f(this, z, void 0));
|
|
949
|
-
}, ke = function() {
|
|
950
|
-
n(this, V) && (clearInterval(n(this, V)), f(this, V, void 0));
|
|
951
|
-
}, xe = function() {
|
|
952
|
-
const e = n(this, P).getQueryCache().build(n(this, P), this.options);
|
|
953
|
-
if (e === n(this, m))
|
|
954
|
-
return;
|
|
955
|
-
const s = n(this, m);
|
|
956
|
-
f(this, m, e), f(this, le, e.state), this.hasListeners() && (s == null || s.removeObserver(this), e.addObserver(this));
|
|
957
|
-
}, yt = function(e) {
|
|
958
|
-
Le.batch(() => {
|
|
959
|
-
e.listeners && this.listeners.forEach((s) => {
|
|
960
|
-
s(n(this, I));
|
|
961
|
-
}), n(this, P).getQueryCache().notify({
|
|
962
|
-
query: n(this, m),
|
|
963
|
-
type: "observerResultsUpdated"
|
|
964
|
-
});
|
|
965
|
-
});
|
|
966
|
-
}, at);
|
|
967
|
-
function Qt(t, e) {
|
|
968
|
-
return k(e.enabled, t) !== !1 && t.state.data === void 0 && !(t.state.status === "error" && e.retryOnMount === !1);
|
|
969
|
-
}
|
|
970
|
-
function Ze(t, e) {
|
|
971
|
-
return Qt(t, e) || t.state.data !== void 0 && qe(t, e, e.refetchOnMount);
|
|
972
|
-
}
|
|
973
|
-
function qe(t, e, s) {
|
|
974
|
-
if (k(e.enabled, t) !== !1) {
|
|
975
|
-
const r = typeof s == "function" ? s(t) : s;
|
|
976
|
-
return r === "always" || r !== !1 && Me(t, e);
|
|
977
|
-
}
|
|
978
|
-
return !1;
|
|
979
|
-
}
|
|
980
|
-
function We(t, e, s, r) {
|
|
981
|
-
return (t !== e || k(r.enabled, t) === !1) && (!s.suspense || t.state.status !== "error") && Me(t, s);
|
|
982
|
-
}
|
|
983
|
-
function Me(t, e) {
|
|
984
|
-
return k(e.enabled, t) !== !1 && t.isStaleByTime(pe(e.staleTime, t));
|
|
985
|
-
}
|
|
986
|
-
function Nt(t, e) {
|
|
987
|
-
return !Ce(t.getCurrentResult(), e);
|
|
988
|
-
}
|
|
989
|
-
var pt = j.createContext(
|
|
990
|
-
void 0
|
|
991
|
-
), vt = (t) => {
|
|
992
|
-
const e = j.useContext(pt);
|
|
993
|
-
if (t)
|
|
994
|
-
return t;
|
|
995
|
-
if (!e)
|
|
996
|
-
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
997
|
-
return e;
|
|
998
|
-
}, Fs = ({
|
|
999
|
-
client: t,
|
|
1000
|
-
children: e
|
|
1001
|
-
}) => (j.useEffect(() => (t.mount(), () => {
|
|
1002
|
-
t.unmount();
|
|
1003
|
-
}), [t]), /* @__PURE__ */ Ot.jsx(pt.Provider, { value: t, children: e })), mt = j.createContext(!1), Lt = () => j.useContext(mt);
|
|
1004
|
-
mt.Provider;
|
|
1005
|
-
function Mt() {
|
|
1006
|
-
let t = !1;
|
|
1007
|
-
return {
|
|
1008
|
-
clearReset: () => {
|
|
1009
|
-
t = !1;
|
|
1010
|
-
},
|
|
1011
|
-
reset: () => {
|
|
1012
|
-
t = !0;
|
|
1013
|
-
},
|
|
1014
|
-
isReset: () => t
|
|
1015
|
-
};
|
|
1016
|
-
}
|
|
1017
|
-
var _t = j.createContext(Mt()), Ht = () => j.useContext(_t);
|
|
1018
|
-
function Kt(t, e) {
|
|
1019
|
-
return typeof t == "function" ? t(...e) : !!t;
|
|
1020
|
-
}
|
|
1021
|
-
function Ye() {
|
|
1022
|
-
}
|
|
1023
|
-
var Bt = (t, e) => {
|
|
1024
|
-
(t.suspense || t.throwOnError || t.experimental_prefetchInRender) && (e.isReset() || (t.retryOnMount = !1));
|
|
1025
|
-
}, $t = (t) => {
|
|
1026
|
-
j.useEffect(() => {
|
|
1027
|
-
t.clearReset();
|
|
1028
|
-
}, [t]);
|
|
1029
|
-
}, Gt = ({
|
|
1030
|
-
result: t,
|
|
1031
|
-
errorResetBoundary: e,
|
|
1032
|
-
throwOnError: s,
|
|
1033
|
-
query: r,
|
|
1034
|
-
suspense: i
|
|
1035
|
-
}) => t.isError && !e.isReset() && !t.isFetching && r && (i && t.data === void 0 || Kt(s, [t.error, r])), zt = (t, e) => e.state.data === void 0, Vt = (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)));
|
|
1038
|
-
}, Jt = (t, e) => t.isLoading && t.isFetching && !e, Zt = (t, e) => (t == null ? void 0 : t.suspense) && e.isPending, Xe = (t, e, s) => e.fetchOptimistic(t).catch(() => {
|
|
1039
|
-
s.clearReset();
|
|
1040
|
-
});
|
|
1041
|
-
function bt(t, e, s) {
|
|
1042
|
-
var c, p, d, E, h;
|
|
1043
|
-
if (process.env.NODE_ENV !== "production" && (typeof t != "object" || Array.isArray(t)))
|
|
1044
|
-
throw new Error(
|
|
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
|
-
);
|
|
1047
|
-
const r = vt(s), i = Lt(), a = Ht(), o = r.defaultQueryOptions(t);
|
|
1048
|
-
(p = (c = r.getDefaultOptions().queries) == null ? void 0 : c._experimental_beforeQuery) == null || p.call(
|
|
1049
|
-
c,
|
|
1050
|
-
o
|
|
1051
|
-
), process.env.NODE_ENV !== "production" && (o.queryFn || console.error(
|
|
1052
|
-
`[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`
|
|
1053
|
-
)), o._optimisticResults = i ? "isRestoring" : "optimistic", Vt(o), Bt(o, a), $t(a);
|
|
1054
|
-
const u = !r.getQueryCache().get(o.queryHash), [l] = j.useState(
|
|
1055
|
-
() => new e(
|
|
1056
|
-
r,
|
|
1057
|
-
o
|
|
1058
|
-
)
|
|
1059
|
-
), y = l.getOptimisticResult(o), g = !i && t.subscribed !== !1;
|
|
1060
|
-
if (j.useSyncExternalStore(
|
|
1061
|
-
j.useCallback(
|
|
1062
|
-
(v) => {
|
|
1063
|
-
const C = g ? l.subscribe(Le.batchCalls(v)) : Ye;
|
|
1064
|
-
return l.updateResult(), C;
|
|
1065
|
-
},
|
|
1066
|
-
[l, g]
|
|
1067
|
-
),
|
|
1068
|
-
() => l.getCurrentResult(),
|
|
1069
|
-
() => l.getCurrentResult()
|
|
1070
|
-
), j.useEffect(() => {
|
|
1071
|
-
l.setOptions(o);
|
|
1072
|
-
}, [o, l]), Zt(o, y))
|
|
1073
|
-
throw Xe(o, l, a);
|
|
1074
|
-
if (Gt({
|
|
1075
|
-
result: y,
|
|
1076
|
-
errorResetBoundary: a,
|
|
1077
|
-
throwOnError: o.throwOnError,
|
|
1078
|
-
query: r.getQueryCache().get(o.queryHash),
|
|
1079
|
-
suspense: o.suspense
|
|
1080
|
-
}))
|
|
1081
|
-
throw y.error;
|
|
1082
|
-
if ((E = (d = r.getDefaultOptions().queries) == null ? void 0 : d._experimental_afterQuery) == null || E.call(
|
|
1083
|
-
d,
|
|
1084
|
-
o,
|
|
1085
|
-
y
|
|
1086
|
-
), o.experimental_prefetchInRender && !J && Jt(y, i)) {
|
|
1087
|
-
const v = u ? (
|
|
1088
|
-
// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
|
|
1089
|
-
Xe(o, l, a)
|
|
1090
|
-
) : (
|
|
1091
|
-
// subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
|
|
1092
|
-
(h = r.getQueryCache().get(o.queryHash)) == null ? void 0 : h.promise
|
|
1093
|
-
);
|
|
1094
|
-
v == null || v.catch(Ye).finally(() => {
|
|
1095
|
-
l.updateResult();
|
|
1096
|
-
});
|
|
1097
|
-
}
|
|
1098
|
-
return o.notifyOnChangeProps ? y : l.trackResult(y);
|
|
1099
|
-
}
|
|
1100
|
-
function Wt(t, e) {
|
|
1101
|
-
return bt(t, ft, e);
|
|
1102
|
-
}
|
|
1103
|
-
function Yt(t, e) {
|
|
1104
|
-
return process.env.NODE_ENV !== "production" && t.queryFn === ve && console.error("skipToken is not allowed for useSuspenseQuery"), bt(
|
|
1105
|
-
{
|
|
1106
|
-
...t,
|
|
1107
|
-
enabled: !0,
|
|
1108
|
-
suspense: !0,
|
|
1109
|
-
throwOnError: zt,
|
|
1110
|
-
placeholderData: void 0
|
|
1111
|
-
},
|
|
1112
|
-
ft,
|
|
1113
|
-
e
|
|
1114
|
-
);
|
|
1115
|
-
}
|
|
1116
|
-
const Xt = /^(\w+:\/\/[^/?]+)?([^?]*)(\?.*)?$/, es = (t) => t.filter(
|
|
1117
|
-
(e) => e != null && e !== !1 && (typeof e == "string" || typeof e == "number")
|
|
1118
|
-
).map((e) => `${e}`).filter((e) => e), ts = (t) => {
|
|
1119
|
-
const e = t.join("/"), [, s = "", r = ""] = e.match(Xt) ?? [];
|
|
1120
|
-
return {
|
|
1121
|
-
prefix: s,
|
|
1122
|
-
pathname: r.split("/").filter((i) => i !== "")
|
|
1123
|
-
};
|
|
1124
|
-
}, ss = (t) => {
|
|
1125
|
-
const { prefix: e, pathname: s } = t;
|
|
1126
|
-
let r = e;
|
|
1127
|
-
return s.length > 0 ? (r ? r += "/" : r = "/", r += s.join("/")) : r || (r = "/"), r;
|
|
1128
|
-
}, et = (...t) => {
|
|
1129
|
-
const e = es(t), s = ts(e);
|
|
1130
|
-
return ss(s);
|
|
1131
|
-
}, gt = Object.freeze({
|
|
1132
|
-
API_IDENTITIES: ["api-identities"]
|
|
1133
|
-
}), Is = () => {
|
|
1134
|
-
const t = vt();
|
|
1135
|
-
return {
|
|
1136
|
-
invalidateCache: async (e) => {
|
|
1137
|
-
await t.invalidateQueries({ queryKey: gt[e] });
|
|
1138
|
-
}
|
|
1139
|
-
};
|
|
1140
|
-
}, rs = "no-dehydrate", ce = (...t) => {
|
|
1141
|
-
const e = t.filter((s) => !!s).map((s) => s.replace(/(^\/+|\/+$)/g, "")).join("/").replace(/(^\/+|\/+$)/g, "");
|
|
1142
|
-
return e ? `/${e}` : "/";
|
|
1143
|
-
}, _e = (t, e) => {
|
|
1144
|
-
for (const s of t) {
|
|
1145
|
-
const r = He(s, e);
|
|
1146
|
-
if (r !== void 0) return r;
|
|
1147
|
-
}
|
|
1148
|
-
}, He = (t, e, s = []) => {
|
|
1149
|
-
const r = e(t, s);
|
|
1150
|
-
if (r !== void 0) return r;
|
|
1151
|
-
if (t.type === "category")
|
|
1152
|
-
for (const i of t.items) {
|
|
1153
|
-
const a = He(i, e, [
|
|
1154
|
-
...s,
|
|
1155
|
-
t
|
|
1156
|
-
]);
|
|
1157
|
-
if (a !== void 0) return a;
|
|
1158
|
-
}
|
|
1159
|
-
}, Ps = () => {
|
|
1160
|
-
const t = me(), s = St().sidebar;
|
|
1161
|
-
return _e(s, (r) => {
|
|
1162
|
-
if (r.type === "doc" && ce(r.id) === t.pathname)
|
|
1163
|
-
return r;
|
|
1164
|
-
});
|
|
1165
|
-
}, Ts = (t) => {
|
|
1166
|
-
const e = me();
|
|
1167
|
-
return He(t, (s) => {
|
|
1168
|
-
if (s.type === "category" && s.link && ce(s.link.id) === e.pathname || s.type === "doc" && ce(s.id) === e.pathname)
|
|
1169
|
-
return !0;
|
|
1170
|
-
});
|
|
1171
|
-
}, Ds = () => {
|
|
1172
|
-
const t = me().pathname, s = St().sidebar;
|
|
1173
|
-
let r, i, a = !1;
|
|
1174
|
-
return _e(s, (o) => {
|
|
1175
|
-
const u = o.type === "doc" ? ce(o.id) : o.type === "category" && o.link ? ce(o.link.id) : void 0;
|
|
1176
|
-
if (u) {
|
|
1177
|
-
if (a)
|
|
1178
|
-
return i = { label: o.label, id: u }, !0;
|
|
1179
|
-
t === u ? a = !0 : r = { label: o.label, id: u };
|
|
1180
|
-
}
|
|
1181
|
-
}), { prev: r, next: i };
|
|
1182
|
-
}, ns = Et(
|
|
1183
|
-
void 0
|
|
1184
|
-
), Ke = () => {
|
|
1185
|
-
const t = Ct(ns);
|
|
1186
|
-
if (!t)
|
|
1187
|
-
throw new Error("useZudoku must be used within a ZudokuProvider.");
|
|
1188
|
-
return t;
|
|
1189
|
-
}, js = () => {
|
|
1190
|
-
const { getApiIdentities: t } = Ke();
|
|
1191
|
-
return Wt({
|
|
1192
|
-
queryFn: t,
|
|
1193
|
-
queryKey: gt.API_IDENTITIES
|
|
1194
|
-
});
|
|
1195
|
-
}, St = () => {
|
|
1196
|
-
var c;
|
|
1197
|
-
const { getPluginSidebar: t, sidebars: e, topNavigation: s, options: r } = Ke(), i = me(), a = fs(), o = (c = r.protectedRoutes) == null ? void 0 : c.some(
|
|
1198
|
-
(p) => ze(p, i.pathname)
|
|
1199
|
-
);
|
|
1200
|
-
let u = Object.entries(e).find(([, p]) => _e(p, (d) => {
|
|
1201
|
-
if ((d.type === "doc" ? et(d.id) : d.type === "category" && d.link ? et(d.link.id) : void 0) === i.pathname)
|
|
1202
|
-
return d;
|
|
1203
|
-
}));
|
|
1204
|
-
const l = s.find((p) => p.id === (u == null ? void 0 : u[0])) ?? s.find((p) => ze(p.id, i.pathname));
|
|
1205
|
-
l && !u && l.id in e && (u = ["", e[l.id]]);
|
|
1206
|
-
const { data: y } = Yt({
|
|
1207
|
-
queryFn: () => t(i.pathname),
|
|
1208
|
-
// We just want to suspend here and don't store in SSR dehydrated state
|
|
1209
|
-
queryKey: ["plugin-sidebar", rs, i.pathname]
|
|
1210
|
-
});
|
|
1211
|
-
return {
|
|
1212
|
-
sidebar: a.isAuthEnabled && !a.isAuthenticated && o ? [] : [...u ? u[1] : [], ...y],
|
|
1213
|
-
topNavItem: l
|
|
1214
|
-
};
|
|
1215
|
-
}, tt = (t) => {
|
|
1216
|
-
let e;
|
|
1217
|
-
const s = /* @__PURE__ */ new Set(), r = (y, g) => {
|
|
1218
|
-
const c = typeof y == "function" ? y(e) : y;
|
|
1219
|
-
if (!Object.is(c, e)) {
|
|
1220
|
-
const p = e;
|
|
1221
|
-
e = g ?? (typeof c != "object" || c === null) ? c : Object.assign({}, e, c), s.forEach((d) => d(e, p));
|
|
1222
|
-
}
|
|
1223
|
-
}, i = () => e, u = { setState: r, getState: i, getInitialState: () => l, subscribe: (y) => (s.add(y), () => s.delete(y)) }, l = e = t(r, i, u);
|
|
1224
|
-
return u;
|
|
1225
|
-
}, is = (t) => t ? tt(t) : tt, as = (t) => t;
|
|
1226
|
-
function os(t, e = as) {
|
|
1227
|
-
const s = Ge.useSyncExternalStore(
|
|
1228
|
-
t.subscribe,
|
|
1229
|
-
() => e(t.getState()),
|
|
1230
|
-
() => e(t.getInitialState())
|
|
1231
|
-
);
|
|
1232
|
-
return Ge.useDebugValue(s), s;
|
|
1233
|
-
}
|
|
1234
|
-
const us = (t) => {
|
|
1235
|
-
const e = is(t), s = (r) => os(e, r);
|
|
1236
|
-
return Object.assign(s, e), s;
|
|
1237
|
-
}, cs = (t) => us;
|
|
1238
|
-
function wt(t, e) {
|
|
1239
|
-
let s;
|
|
1240
|
-
try {
|
|
1241
|
-
s = t();
|
|
1242
|
-
} catch {
|
|
1243
|
-
return;
|
|
1244
|
-
}
|
|
1245
|
-
return {
|
|
1246
|
-
getItem: (i) => {
|
|
1247
|
-
var a;
|
|
1248
|
-
const o = (l) => l === null ? null : JSON.parse(l, void 0), u = (a = s.getItem(i)) != null ? a : null;
|
|
1249
|
-
return u instanceof Promise ? u.then(o) : o(u);
|
|
1250
|
-
},
|
|
1251
|
-
setItem: (i, a) => s.setItem(
|
|
1252
|
-
i,
|
|
1253
|
-
JSON.stringify(a, void 0)
|
|
1254
|
-
),
|
|
1255
|
-
removeItem: (i) => s.removeItem(i)
|
|
1256
|
-
};
|
|
1257
|
-
}
|
|
1258
|
-
const Ue = (t) => (e) => {
|
|
1259
|
-
try {
|
|
1260
|
-
const s = t(e);
|
|
1261
|
-
return s instanceof Promise ? s : {
|
|
1262
|
-
then(r) {
|
|
1263
|
-
return Ue(r)(s);
|
|
1264
|
-
},
|
|
1265
|
-
catch(r) {
|
|
1266
|
-
return this;
|
|
1267
|
-
}
|
|
1268
|
-
};
|
|
1269
|
-
} catch (s) {
|
|
1270
|
-
return {
|
|
1271
|
-
then(r) {
|
|
1272
|
-
return this;
|
|
1273
|
-
},
|
|
1274
|
-
catch(r) {
|
|
1275
|
-
return Ue(r)(s);
|
|
1276
|
-
}
|
|
1277
|
-
};
|
|
1278
|
-
}
|
|
1279
|
-
}, hs = (t, e) => (s, r, i) => {
|
|
1280
|
-
let a = {
|
|
1281
|
-
storage: wt(() => localStorage),
|
|
1282
|
-
partialize: (h) => h,
|
|
1283
|
-
version: 0,
|
|
1284
|
-
merge: (h, v) => ({
|
|
1285
|
-
...v,
|
|
1286
|
-
...h
|
|
1287
|
-
}),
|
|
1288
|
-
...e
|
|
1289
|
-
}, o = !1;
|
|
1290
|
-
const u = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set();
|
|
1291
|
-
let y = a.storage;
|
|
1292
|
-
if (!y)
|
|
1293
|
-
return t(
|
|
1294
|
-
(...h) => {
|
|
1295
|
-
console.warn(
|
|
1296
|
-
`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`
|
|
1297
|
-
), s(...h);
|
|
1298
|
-
},
|
|
1299
|
-
r,
|
|
1300
|
-
i
|
|
1301
|
-
);
|
|
1302
|
-
const g = () => {
|
|
1303
|
-
const h = a.partialize({ ...r() });
|
|
1304
|
-
return y.setItem(a.name, {
|
|
1305
|
-
state: h,
|
|
1306
|
-
version: a.version
|
|
1307
|
-
});
|
|
1308
|
-
}, c = i.setState;
|
|
1309
|
-
i.setState = (h, v) => {
|
|
1310
|
-
c(h, v), g();
|
|
1311
|
-
};
|
|
1312
|
-
const p = t(
|
|
1313
|
-
(...h) => {
|
|
1314
|
-
s(...h), g();
|
|
1315
|
-
},
|
|
1316
|
-
r,
|
|
1317
|
-
i
|
|
1318
|
-
);
|
|
1319
|
-
i.getInitialState = () => p;
|
|
1320
|
-
let d;
|
|
1321
|
-
const E = () => {
|
|
1322
|
-
var h, v;
|
|
1323
|
-
if (!y) return;
|
|
1324
|
-
o = !1, u.forEach((R) => {
|
|
1325
|
-
var O;
|
|
1326
|
-
return R((O = r()) != null ? O : p);
|
|
1327
|
-
});
|
|
1328
|
-
const C = ((v = a.onRehydrateStorage) == null ? void 0 : v.call(a, (h = r()) != null ? h : p)) || void 0;
|
|
1329
|
-
return Ue(y.getItem.bind(y))(a.name).then((R) => {
|
|
1330
|
-
if (R)
|
|
1331
|
-
if (typeof R.version == "number" && R.version !== a.version) {
|
|
1332
|
-
if (a.migrate) {
|
|
1333
|
-
const O = a.migrate(
|
|
1334
|
-
R.state,
|
|
1335
|
-
R.version
|
|
1336
|
-
);
|
|
1337
|
-
return O instanceof Promise ? O.then((q) => [!0, q]) : [!0, O];
|
|
1338
|
-
}
|
|
1339
|
-
console.error(
|
|
1340
|
-
"State loaded from storage couldn't be migrated since no migrate function was provided"
|
|
1341
|
-
);
|
|
1342
|
-
} else
|
|
1343
|
-
return [!1, R.state];
|
|
1344
|
-
return [!1, void 0];
|
|
1345
|
-
}).then((R) => {
|
|
1346
|
-
var O;
|
|
1347
|
-
const [q, Z] = R;
|
|
1348
|
-
if (d = a.merge(
|
|
1349
|
-
Z,
|
|
1350
|
-
(O = r()) != null ? O : p
|
|
1351
|
-
), s(d, !0), q)
|
|
1352
|
-
return g();
|
|
1353
|
-
}).then(() => {
|
|
1354
|
-
C == null || C(d, void 0), d = r(), o = !0, l.forEach((R) => R(d));
|
|
1355
|
-
}).catch((R) => {
|
|
1356
|
-
C == null || C(void 0, R);
|
|
1357
|
-
});
|
|
1358
|
-
};
|
|
1359
|
-
return i.persist = {
|
|
1360
|
-
setOptions: (h) => {
|
|
1361
|
-
a = {
|
|
1362
|
-
...a,
|
|
1363
|
-
...h
|
|
1364
|
-
}, h.storage && (y = h.storage);
|
|
1365
|
-
},
|
|
1366
|
-
clearStorage: () => {
|
|
1367
|
-
y == null || y.removeItem(a.name);
|
|
1368
|
-
},
|
|
1369
|
-
getOptions: () => a,
|
|
1370
|
-
rehydrate: () => E(),
|
|
1371
|
-
hasHydrated: () => o,
|
|
1372
|
-
onHydrate: (h) => (u.add(h), () => {
|
|
1373
|
-
u.delete(h);
|
|
1374
|
-
}),
|
|
1375
|
-
onFinishHydration: (h) => (l.add(h), () => {
|
|
1376
|
-
l.delete(h);
|
|
1377
|
-
})
|
|
1378
|
-
}, a.skipHydration || E(), d || p;
|
|
1379
|
-
}, ls = hs, ds = (t) => {
|
|
1380
|
-
const e = (s) => {
|
|
1381
|
-
s.key === t.persist.getOptions().name && s.newValue && t.persist.rehydrate();
|
|
1382
|
-
};
|
|
1383
|
-
return window.addEventListener("storage", e), () => {
|
|
1384
|
-
window.removeEventListener("storage", e);
|
|
1385
|
-
};
|
|
1386
|
-
}, Rt = cs()(
|
|
1387
|
-
ls(
|
|
1388
|
-
(t) => ({
|
|
1389
|
-
isAuthenticated: !1,
|
|
1390
|
-
isPending: !0,
|
|
1391
|
-
profile: null,
|
|
1392
|
-
providerData: null
|
|
1393
|
-
}),
|
|
1394
|
-
{
|
|
1395
|
-
merge: (t, e) => ({
|
|
1396
|
-
...e,
|
|
1397
|
-
isPending: !1,
|
|
1398
|
-
...typeof t == "object" ? t : {}
|
|
1399
|
-
}),
|
|
1400
|
-
name: "auth-state",
|
|
1401
|
-
storage: wt(() => localStorage)
|
|
1402
|
-
}
|
|
1403
|
-
)
|
|
1404
|
-
);
|
|
1405
|
-
typeof window < "u" && ds(Rt);
|
|
1406
|
-
const fs = () => {
|
|
1407
|
-
const { authentication: t } = Ke(), e = Rt(), s = typeof t < "u";
|
|
1408
|
-
return {
|
|
1409
|
-
isAuthEnabled: s,
|
|
1410
|
-
...e,
|
|
1411
|
-
login: async () => {
|
|
1412
|
-
if (!s)
|
|
1413
|
-
throw new Error("Authentication is not enabled.");
|
|
1414
|
-
await t.signIn({
|
|
1415
|
-
redirectTo: window.location.href
|
|
1416
|
-
});
|
|
1417
|
-
},
|
|
1418
|
-
logout: async () => {
|
|
1419
|
-
if (!s)
|
|
1420
|
-
throw new Error("Authentication is not enabled.");
|
|
1421
|
-
await t.signOut(), window.location.href = "/";
|
|
1422
|
-
},
|
|
1423
|
-
signup: async () => {
|
|
1424
|
-
if (!s)
|
|
1425
|
-
throw new Error("Authentication is not enabled.");
|
|
1426
|
-
await t.signUp({
|
|
1427
|
-
redirectTo: window.location.href
|
|
1428
|
-
});
|
|
1429
|
-
}
|
|
1430
|
-
};
|
|
1431
|
-
};
|
|
1432
|
-
export {
|
|
1433
|
-
pe as A,
|
|
1434
|
-
gs as B,
|
|
1435
|
-
Ne as C,
|
|
1436
|
-
ve as D,
|
|
1437
|
-
Fs as E,
|
|
1438
|
-
St as F,
|
|
1439
|
-
_e as G,
|
|
1440
|
-
Is as H,
|
|
1441
|
-
gt as I,
|
|
1442
|
-
cs as J,
|
|
1443
|
-
ls as K,
|
|
1444
|
-
wt as L,
|
|
1445
|
-
js as M,
|
|
1446
|
-
Ts as N,
|
|
1447
|
-
Os as Q,
|
|
1448
|
-
qt as R,
|
|
1449
|
-
Qe as S,
|
|
1450
|
-
ns as Z,
|
|
1451
|
-
Ps as a,
|
|
1452
|
-
Ds as b,
|
|
1453
|
-
At as c,
|
|
1454
|
-
Yt as d,
|
|
1455
|
-
Ke as e,
|
|
1456
|
-
et as f,
|
|
1457
|
-
vt as g,
|
|
1458
|
-
Re as h,
|
|
1459
|
-
Ye as i,
|
|
1460
|
-
ce as j,
|
|
1461
|
-
Kt as k,
|
|
1462
|
-
fs as l,
|
|
1463
|
-
Wt as m,
|
|
1464
|
-
Le as n,
|
|
1465
|
-
Rs as o,
|
|
1466
|
-
Ft as p,
|
|
1467
|
-
Ss as q,
|
|
1468
|
-
ws as r,
|
|
1469
|
-
Ce as s,
|
|
1470
|
-
Se as t,
|
|
1471
|
-
Rt as u,
|
|
1472
|
-
Pt as v,
|
|
1473
|
-
Cs as w,
|
|
1474
|
-
Es as x,
|
|
1475
|
-
ut as y,
|
|
1476
|
-
ct as z
|
|
1477
|
-
};
|
|
1478
|
-
//# sourceMappingURL=hook-8GM2HXNM.js.map
|