zudoku 0.45.0 → 0.46.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.
Files changed (533) hide show
  1. package/cli.js +8 -2
  2. package/dist/app/main.js +4 -23
  3. package/dist/app/main.js.map +1 -1
  4. package/dist/config/config.d.ts +2 -2
  5. package/dist/config/file-exists.d.ts +1 -0
  6. package/dist/config/file-exists.js +5 -0
  7. package/dist/config/file-exists.js.map +1 -0
  8. package/dist/config/loader.d.ts +19 -4
  9. package/dist/config/loader.js +94 -14
  10. package/dist/config/loader.js.map +1 -1
  11. package/dist/config/validators/validate.d.ts +3536 -743
  12. package/dist/config/validators/validate.js +396 -11
  13. package/dist/config/validators/validate.js.map +1 -1
  14. package/dist/index.d.ts +4 -2
  15. package/dist/index.js +2 -0
  16. package/dist/index.js.map +1 -1
  17. package/dist/lib/authentication/AuthenticationPlugin.d.ts +7 -2
  18. package/dist/lib/authentication/AuthenticationPlugin.js +13 -1
  19. package/dist/lib/authentication/AuthenticationPlugin.js.map +1 -1
  20. package/dist/lib/authentication/authentication.d.ts +2 -4
  21. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  22. package/dist/lib/authentication/providers/clerk.js +62 -43
  23. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  24. package/dist/lib/authentication/providers/openid.d.ts +7 -12
  25. package/dist/lib/authentication/providers/openid.js +11 -22
  26. package/dist/lib/authentication/providers/openid.js.map +1 -1
  27. package/dist/lib/authentication/providers/supabase.js +3 -5
  28. package/dist/lib/authentication/providers/supabase.js.map +1 -1
  29. package/dist/lib/components/Autocomplete.js +1 -1
  30. package/dist/lib/components/Banner.js +1 -1
  31. package/dist/lib/components/Banner.js.map +1 -1
  32. package/dist/lib/components/ErrorPage.js +1 -1
  33. package/dist/lib/components/Footer.js +5 -5
  34. package/dist/lib/components/Footer.js.map +1 -1
  35. package/dist/lib/components/Header.js +16 -8
  36. package/dist/lib/components/Header.js.map +1 -1
  37. package/dist/lib/components/Heading.js +6 -1
  38. package/dist/lib/components/Heading.js.map +1 -1
  39. package/dist/lib/components/InlineCode.js +1 -1
  40. package/dist/lib/components/InlineCode.js.map +1 -1
  41. package/dist/lib/components/Layout.js +2 -2
  42. package/dist/lib/components/Layout.js.map +1 -1
  43. package/dist/lib/components/Main.js +2 -2
  44. package/dist/lib/components/Main.js.map +1 -1
  45. package/dist/lib/components/Markdown.js +8 -3
  46. package/dist/lib/components/Markdown.js.map +1 -1
  47. package/dist/lib/components/MobileTopNavigation.js +3 -2
  48. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  49. package/dist/lib/components/NotFoundPage.js +1 -1
  50. package/dist/lib/components/Pagination.js +1 -1
  51. package/dist/lib/components/Pagination.js.map +1 -1
  52. package/dist/lib/components/Search.js +1 -1
  53. package/dist/lib/components/Search.js.map +1 -1
  54. package/dist/lib/components/Slot.d.ts +17 -0
  55. package/dist/lib/components/Slot.js +24 -0
  56. package/dist/lib/components/Slot.js.map +1 -0
  57. package/dist/lib/components/Slot.test.js +168 -0
  58. package/dist/lib/components/Slot.test.js.map +1 -0
  59. package/dist/lib/components/TopNavigation.d.ts +1 -4
  60. package/dist/lib/components/TopNavigation.js +3 -11
  61. package/dist/lib/components/TopNavigation.js.map +1 -1
  62. package/dist/lib/components/Zudoku.js +2 -2
  63. package/dist/lib/components/Zudoku.js.map +1 -1
  64. package/dist/lib/components/context/SlotProvider.d.ts +26 -0
  65. package/dist/lib/components/context/SlotProvider.js +83 -0
  66. package/dist/lib/components/context/SlotProvider.js.map +1 -0
  67. package/dist/lib/components/context/ZudokuContext.d.ts +1 -1
  68. package/dist/lib/components/context/ZudokuProvider.js +2 -1
  69. package/dist/lib/components/context/ZudokuProvider.js.map +1 -1
  70. package/dist/lib/components/index.d.ts +29 -23
  71. package/dist/lib/components/index.js +13 -7
  72. package/dist/lib/components/index.js.map +1 -1
  73. package/dist/lib/components/navigation/PoweredByZudoku.js +1 -1
  74. package/dist/lib/components/navigation/Sidebar.js +3 -3
  75. package/dist/lib/components/navigation/Sidebar.js.map +1 -1
  76. package/dist/lib/components/navigation/SidebarBadge.js +1 -1
  77. package/dist/lib/components/navigation/SidebarBadge.js.map +1 -1
  78. package/dist/lib/components/navigation/SidebarCategory.js +3 -3
  79. package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
  80. package/dist/lib/components/navigation/SidebarItem.d.ts +0 -5
  81. package/dist/lib/components/navigation/SidebarItem.js +19 -23
  82. package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
  83. package/dist/lib/components/navigation/SidebarWrapper.js +1 -1
  84. package/dist/lib/components/navigation/Toc.js +1 -1
  85. package/dist/lib/components/navigation/Toc.js.map +1 -1
  86. package/dist/lib/components/navigation/utils.d.ts +8 -0
  87. package/dist/lib/components/navigation/utils.js +34 -6
  88. package/dist/lib/components/navigation/utils.js.map +1 -1
  89. package/dist/lib/core/ZudokuContext.d.ts +12 -8
  90. package/dist/lib/core/ZudokuContext.js +6 -5
  91. package/dist/lib/core/ZudokuContext.js.map +1 -1
  92. package/dist/lib/core/plugins.d.ts +5 -2
  93. package/dist/lib/core/plugins.js +1 -0
  94. package/dist/lib/core/plugins.js.map +1 -1
  95. package/dist/lib/errors/ErrorAlert.js +1 -1
  96. package/dist/lib/hooks/index.d.ts +19 -0
  97. package/dist/lib/hooks/index.js +11 -0
  98. package/dist/lib/hooks/index.js.map +1 -1
  99. package/dist/lib/plugins/api-catalog/Catalog.js +1 -1
  100. package/dist/lib/plugins/api-keys/CreateApiKey.d.ts +3 -2
  101. package/dist/lib/plugins/api-keys/CreateApiKey.js +8 -4
  102. package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
  103. package/dist/lib/plugins/api-keys/SettingsApiKeys.d.ts +1 -1
  104. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +54 -23
  105. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
  106. package/dist/lib/plugins/api-keys/index.d.ts +18 -9
  107. package/dist/lib/plugins/api-keys/index.js +49 -34
  108. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  109. package/dist/lib/plugins/custom-pages/index.d.ts +1 -1
  110. package/dist/lib/plugins/markdown/MdxPage.js +1 -1
  111. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  112. package/dist/lib/plugins/markdown/index.d.ts +1 -1
  113. package/dist/lib/plugins/markdown/resolver.d.ts +1 -1
  114. package/dist/lib/plugins/markdown/resolver.js.map +1 -1
  115. package/dist/lib/plugins/openapi/CollapsibleCode.js +1 -1
  116. package/dist/lib/plugins/openapi/ColorizedParam.js +1 -1
  117. package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
  118. package/dist/lib/plugins/openapi/OperationList.js +1 -1
  119. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  120. package/dist/lib/plugins/openapi/OperationListItem.js +2 -3
  121. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  122. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +5 -1
  123. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
  124. package/dist/lib/plugins/openapi/ResponsesSidecarBox.d.ts +2 -4
  125. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +1 -4
  126. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  127. package/dist/lib/plugins/openapi/SchemaList.js +6 -5
  128. package/dist/lib/plugins/openapi/SchemaList.js.map +1 -1
  129. package/dist/lib/plugins/openapi/Sidecar.js +1 -1
  130. package/dist/lib/plugins/openapi/SidecarExamples.js +8 -0
  131. package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
  132. package/dist/lib/plugins/openapi/components/EnumValues.js +1 -1
  133. package/dist/lib/plugins/openapi/components/EnumValues.js.map +1 -1
  134. package/dist/lib/plugins/openapi/components/ResponseContent.d.ts +12 -0
  135. package/dist/lib/plugins/openapi/components/ResponseContent.js +21 -0
  136. package/dist/lib/plugins/openapi/components/ResponseContent.js.map +1 -0
  137. package/dist/lib/plugins/openapi/playground/Playground.js +2 -0
  138. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  139. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
  140. package/dist/lib/plugins/openapi/playground/SubmitButton.js +7 -10
  141. package/dist/lib/plugins/openapi/playground/SubmitButton.js.map +1 -1
  142. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js +2 -2
  143. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js.map +1 -1
  144. package/dist/lib/plugins/openapi/schema/SchemaView.d.ts +2 -1
  145. package/dist/lib/plugins/openapi/schema/SchemaView.js +3 -3
  146. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  147. package/dist/lib/plugins/redirect/index.d.ts +1 -1
  148. package/dist/lib/ui/Badge.d.ts +2 -2
  149. package/dist/lib/ui/Badge.js +1 -1
  150. package/dist/lib/ui/Badge.js.map +1 -1
  151. package/dist/lib/ui/Button.d.ts +2 -2
  152. package/dist/lib/ui/Button.js +8 -6
  153. package/dist/lib/ui/Button.js.map +1 -1
  154. package/dist/lib/ui/Callout.js +1 -1
  155. package/dist/lib/ui/Callout.js.map +1 -1
  156. package/dist/lib/ui/Card.js +1 -1
  157. package/dist/lib/ui/Checkbox.js +1 -1
  158. package/dist/lib/ui/Checkbox.js.map +1 -1
  159. package/dist/lib/ui/Command.d.ts +2 -2
  160. package/dist/lib/ui/Command.js +3 -3
  161. package/dist/lib/ui/Command.js.map +1 -1
  162. package/dist/lib/ui/Dialog.js +1 -1
  163. package/dist/lib/ui/Dialog.js.map +1 -1
  164. package/dist/lib/ui/DropdownMenu.js +4 -4
  165. package/dist/lib/ui/DropdownMenu.js.map +1 -1
  166. package/dist/lib/ui/HoverCard.js +1 -1
  167. package/dist/lib/ui/HoverCard.js.map +1 -1
  168. package/dist/lib/ui/Input.js +1 -1
  169. package/dist/lib/ui/Input.js.map +1 -1
  170. package/dist/lib/ui/Popover.js +1 -1
  171. package/dist/lib/ui/Popover.js.map +1 -1
  172. package/dist/lib/ui/RadioGroup.js +1 -1
  173. package/dist/lib/ui/RadioGroup.js.map +1 -1
  174. package/dist/lib/ui/Select.js +2 -2
  175. package/dist/lib/ui/Select.js.map +1 -1
  176. package/dist/lib/ui/Slider.js +1 -1
  177. package/dist/lib/ui/Slider.js.map +1 -1
  178. package/dist/lib/ui/Switch.js +1 -1
  179. package/dist/lib/ui/Switch.js.map +1 -1
  180. package/dist/lib/ui/Tabs.js +2 -2
  181. package/dist/lib/ui/Tabs.js.map +1 -1
  182. package/dist/lib/ui/Textarea.js +1 -1
  183. package/dist/lib/ui/Textarea.js.map +1 -1
  184. package/dist/lib/ui/Toggle.js +1 -1
  185. package/dist/lib/ui/Toggle.js.map +1 -1
  186. package/dist/lib/ui/Tooltip.d.ts +2 -1
  187. package/dist/lib/ui/Tooltip.js +2 -1
  188. package/dist/lib/ui/Tooltip.js.map +1 -1
  189. package/dist/lib/util/useExposedProps.d.ts +8 -1
  190. package/dist/lib/util/useExposedProps.js.map +1 -1
  191. package/dist/vite/api/SchemaManager.js +16 -1
  192. package/dist/vite/api/SchemaManager.js.map +1 -1
  193. package/dist/vite/build.js +44 -6
  194. package/dist/vite/build.js.map +1 -1
  195. package/dist/vite/config.d.ts +2 -9
  196. package/dist/vite/config.js +6 -95
  197. package/dist/vite/config.js.map +1 -1
  198. package/dist/vite/config.test.js +1 -1
  199. package/dist/vite/config.test.js.map +1 -1
  200. package/dist/vite/css/plugin.d.ts +1 -2
  201. package/dist/vite/css/plugin.js +3 -2
  202. package/dist/vite/css/plugin.js.map +1 -1
  203. package/dist/vite/dev-server.d.ts +0 -1
  204. package/dist/vite/dev-server.js +10 -12
  205. package/dist/vite/dev-server.js.map +1 -1
  206. package/dist/vite/html.d.ts +2 -2
  207. package/dist/vite/html.js +5 -2
  208. package/dist/vite/html.js.map +1 -1
  209. package/dist/vite/plugin-api-keys.d.ts +1 -2
  210. package/dist/vite/plugin-api-keys.js +9 -3
  211. package/dist/vite/plugin-api-keys.js.map +1 -1
  212. package/dist/vite/plugin-api.d.ts +1 -2
  213. package/dist/vite/plugin-api.js +5 -4
  214. package/dist/vite/plugin-api.js.map +1 -1
  215. package/dist/vite/plugin-auth.d.ts +1 -2
  216. package/dist/vite/plugin-auth.js +3 -2
  217. package/dist/vite/plugin-auth.js.map +1 -1
  218. package/dist/vite/plugin-component.d.ts +1 -2
  219. package/dist/vite/plugin-component.js +3 -2
  220. package/dist/vite/plugin-component.js.map +1 -1
  221. package/dist/vite/plugin-config-reload.d.ts +1 -2
  222. package/dist/vite/plugin-config-reload.js +21 -22
  223. package/dist/vite/plugin-config-reload.js.map +1 -1
  224. package/dist/vite/plugin-config.d.ts +1 -2
  225. package/dist/vite/plugin-config.js +4 -3
  226. package/dist/vite/plugin-config.js.map +1 -1
  227. package/dist/vite/plugin-configure-tailwind.d.ts +2 -0
  228. package/dist/vite/plugin-configure-tailwind.js +38 -0
  229. package/dist/vite/plugin-configure-tailwind.js.map +1 -0
  230. package/dist/vite/plugin-custom-pages.d.ts +1 -2
  231. package/dist/vite/plugin-custom-pages.js +3 -2
  232. package/dist/vite/plugin-custom-pages.js.map +1 -1
  233. package/dist/vite/plugin-docs.d.ts +1 -2
  234. package/dist/vite/plugin-docs.js +4 -3
  235. package/dist/vite/plugin-docs.js.map +1 -1
  236. package/dist/vite/plugin-frontmatter.d.ts +1 -2
  237. package/dist/vite/plugin-frontmatter.js +3 -2
  238. package/dist/vite/plugin-frontmatter.js.map +1 -1
  239. package/dist/vite/plugin-mdx.d.ts +1 -2
  240. package/dist/vite/plugin-mdx.js +3 -2
  241. package/dist/vite/plugin-mdx.js.map +1 -1
  242. package/dist/vite/plugin-redirect.d.ts +1 -2
  243. package/dist/vite/plugin-redirect.js +3 -2
  244. package/dist/vite/plugin-redirect.js.map +1 -1
  245. package/dist/vite/plugin-search.d.ts +1 -2
  246. package/dist/vite/plugin-search.js +3 -2
  247. package/dist/vite/plugin-search.js.map +1 -1
  248. package/dist/vite/plugin-shiki-register.d.ts +1 -2
  249. package/dist/vite/plugin-shiki-register.js +2 -1
  250. package/dist/vite/plugin-shiki-register.js.map +1 -1
  251. package/dist/vite/plugin-sidebar.d.ts +1 -2
  252. package/dist/vite/plugin-sidebar.js +3 -2
  253. package/dist/vite/plugin-sidebar.js.map +1 -1
  254. package/dist/vite/plugin-theme-css.d.ts +1 -2
  255. package/dist/vite/plugin-theme-css.js +20 -60
  256. package/dist/vite/plugin-theme-css.js.map +1 -1
  257. package/dist/vite/plugin.d.ts +1 -2
  258. package/dist/vite/plugin.js +22 -21
  259. package/dist/vite/plugin.js.map +1 -1
  260. package/dist/vite/sitemap.d.ts +1 -1
  261. package/dist/zuplo/with-zuplo.d.ts +2 -2
  262. package/dist/zuplo/with-zuplo.js.map +1 -1
  263. package/lib/Button-BE9IVkWV.js +51 -0
  264. package/lib/Button-BE9IVkWV.js.map +1 -0
  265. package/lib/{Callout-XadUe37J.js → Callout-BkgOUkoZ.js} +9 -8
  266. package/lib/Callout-BkgOUkoZ.js.map +1 -0
  267. package/lib/{Card-BlCYNw5W.js → Card-DPhGbYUM.js} +3 -3
  268. package/lib/{Card-BlCYNw5W.js.map → Card-DPhGbYUM.js.map} +1 -1
  269. package/lib/{CategoryHeading-DZi-Szor.js → CategoryHeading-Cu2RwgjC.js} +2 -2
  270. package/lib/{CategoryHeading-DZi-Szor.js.map → CategoryHeading-Cu2RwgjC.js.map} +1 -1
  271. package/lib/{Dialog-CNf2oWXG.js → Dialog-Du6WMcIA.js} +8 -7
  272. package/lib/Dialog-Du6WMcIA.js.map +1 -0
  273. package/lib/{Drawer-BPBxzel2.js → Drawer-BzkOKwgC.js} +2 -2
  274. package/lib/{Drawer-BPBxzel2.js.map → Drawer-BzkOKwgC.js.map} +1 -1
  275. package/lib/Markdown-BRAyzyUJ.js +15348 -0
  276. package/lib/Markdown-BRAyzyUJ.js.map +1 -0
  277. package/lib/{MdxPage-Sjv6y3cA.js → MdxPage-B3v1BSKr.js} +11 -11
  278. package/lib/MdxPage-B3v1BSKr.js.map +1 -0
  279. package/lib/{OasProvider-CzRXrs_-.js → OasProvider-5jrFuhVk.js} +3 -3
  280. package/lib/{OasProvider-CzRXrs_-.js.map → OasProvider-5jrFuhVk.js.map} +1 -1
  281. package/lib/{OperationList-DefCF3ZI.js → OperationList-BmoMLQPO.js} +1039 -1005
  282. package/lib/OperationList-BmoMLQPO.js.map +1 -0
  283. package/lib/Pagination-Cr0fWZS3.js +36 -0
  284. package/lib/Pagination-Cr0fWZS3.js.map +1 -0
  285. package/lib/RouteGuard-PrSVLbSr.js +55 -0
  286. package/lib/RouteGuard-PrSVLbSr.js.map +1 -0
  287. package/lib/{SchemaList-zHQ2Ekyw.js → SchemaList-B4riYLoP.js} +61 -47
  288. package/lib/SchemaList-B4riYLoP.js.map +1 -0
  289. package/lib/{SchemaView-CqF4oMU-.js → SchemaView-CPZ6RgsF.js} +100 -95
  290. package/lib/SchemaView-CPZ6RgsF.js.map +1 -0
  291. package/lib/{AuthenticationPlugin-UNaAuxNo.js → SignUp-CWaiH0tY.js} +23 -50
  292. package/lib/SignUp-CWaiH0tY.js.map +1 -0
  293. package/lib/Slot-Bo6K4tnb.js +160 -0
  294. package/lib/Slot-Bo6K4tnb.js.map +1 -0
  295. package/lib/{SyntaxHighlight-UxOF1xNb.js → SyntaxHighlight-DedRjJNr.js} +233 -212
  296. package/lib/{SyntaxHighlight-UxOF1xNb.js.map → SyntaxHighlight-DedRjJNr.js.map} +1 -1
  297. package/lib/{Toc-Ax54Pw8S.js → Toc-lL3fzNkl.js} +5 -5
  298. package/lib/Toc-lL3fzNkl.js.map +1 -0
  299. package/lib/{circular-B_TODp4H.js → circular-oB4auIIg.js} +2 -2
  300. package/lib/{circular-B_TODp4H.js.map → circular-oB4auIIg.js.map} +1 -1
  301. package/lib/clsx-OuTLNxxd.js +17 -0
  302. package/lib/clsx-OuTLNxxd.js.map +1 -0
  303. package/lib/{cn-CwJPJKOE.js → cn-wvCW-ho6.js} +1015 -562
  304. package/lib/cn-wvCW-ho6.js.map +1 -0
  305. package/lib/{createServer-CXd8q7nF.js → createServer-DCB82j2t.js} +81 -81
  306. package/lib/{createServer-CXd8q7nF.js.map → createServer-DCB82j2t.js.map} +1 -1
  307. package/lib/{hook-BwOB_iZo.js → hook-DawSLaZr.js} +323 -300
  308. package/lib/hook-DawSLaZr.js.map +1 -0
  309. package/lib/{index-BY8J3gEh.js → index-BXYvD5-7.js} +868 -758
  310. package/lib/index-BXYvD5-7.js.map +1 -0
  311. package/lib/{index-Z13x6tPX.js → index-DI5SPFK9.js} +2 -2
  312. package/lib/{index-Z13x6tPX.js.map → index-DI5SPFK9.js.map} +1 -1
  313. package/lib/index-QzXzw_ra.js +24 -0
  314. package/lib/index-QzXzw_ra.js.map +1 -0
  315. package/lib/{RouteGuard-lkdEJoDV.js → index.esm-BFcSKCe-.js} +232 -281
  316. package/lib/index.esm-BFcSKCe-.js.map +1 -0
  317. package/lib/{index.esm-D2ZUREQN.js → index.esm-DSfX_eMP.js} +3 -3
  318. package/lib/{index.esm-D2ZUREQN.js.map → index.esm-DSfX_eMP.js.map} +1 -1
  319. package/lib/joinPath-B7kNnUX4.js +8 -0
  320. package/lib/joinPath-B7kNnUX4.js.map +1 -0
  321. package/lib/{mutation-CL2MCRQL.js → mutation-oxMvODNQ.js} +2 -2
  322. package/lib/{mutation-CL2MCRQL.js.map → mutation-oxMvODNQ.js.map} +1 -1
  323. package/lib/ui/Accordion.js +1 -1
  324. package/lib/ui/ActionButton.js +2 -2
  325. package/lib/ui/Alert.js +2 -2
  326. package/lib/ui/AlertDialog.js +1 -1
  327. package/lib/ui/Badge.js +3 -3
  328. package/lib/ui/Badge.js.map +1 -1
  329. package/lib/ui/Breadcrumb.js +1 -1
  330. package/lib/ui/Button.js +20 -18
  331. package/lib/ui/Button.js.map +1 -1
  332. package/lib/ui/Callout.js +6 -5
  333. package/lib/ui/Callout.js.map +1 -1
  334. package/lib/ui/Card.js +8 -8
  335. package/lib/ui/Card.js.map +1 -1
  336. package/lib/ui/Carousel.js +1 -1
  337. package/lib/ui/Checkbox.js +7 -7
  338. package/lib/ui/Checkbox.js.map +1 -1
  339. package/lib/ui/CodeBlock.js +1 -1
  340. package/lib/ui/Command.js +43 -43
  341. package/lib/ui/Command.js.map +1 -1
  342. package/lib/ui/Dialog.js +2 -2
  343. package/lib/ui/Dialog.js.map +1 -1
  344. package/lib/ui/Drawer.js +2 -2
  345. package/lib/ui/DropdownMenu.js +34 -34
  346. package/lib/ui/DropdownMenu.js.map +1 -1
  347. package/lib/ui/Form.js +2 -2
  348. package/lib/ui/HoverCard.js +5 -5
  349. package/lib/ui/HoverCard.js.map +1 -1
  350. package/lib/ui/Input.js +2 -2
  351. package/lib/ui/Input.js.map +1 -1
  352. package/lib/ui/Label.js +2 -2
  353. package/lib/ui/Pagination.js +1 -1
  354. package/lib/ui/Popover.js +2 -2
  355. package/lib/ui/Popover.js.map +1 -1
  356. package/lib/ui/Progress.js +1 -1
  357. package/lib/ui/RadioGroup.js +10 -10
  358. package/lib/ui/RadioGroup.js.map +1 -1
  359. package/lib/ui/ScrollArea.js +1 -1
  360. package/lib/ui/Select.js +31 -31
  361. package/lib/ui/Select.js.map +1 -1
  362. package/lib/ui/Skeleton.js +1 -1
  363. package/lib/ui/Slider.js +5 -5
  364. package/lib/ui/Slider.js.map +1 -1
  365. package/lib/ui/Switch.js +5 -5
  366. package/lib/ui/Switch.js.map +1 -1
  367. package/lib/ui/SyntaxHighlight.js +2 -2
  368. package/lib/ui/Tabs.js +16 -16
  369. package/lib/ui/Tabs.js.map +1 -1
  370. package/lib/ui/Textarea.js +5 -5
  371. package/lib/ui/Textarea.js.map +1 -1
  372. package/lib/ui/Toggle.js +7 -7
  373. package/lib/ui/Toggle.js.map +1 -1
  374. package/lib/ui/ToggleGroup.js +1 -1
  375. package/lib/ui/Tooltip.js +15 -8
  376. package/lib/ui/Tooltip.js.map +1 -1
  377. package/lib/ui/util.js +1 -1
  378. package/lib/useExposedProps-DG8J6ewJ.js.map +1 -1
  379. package/lib/useMutation-C_j3dA_L.js +97 -0
  380. package/lib/useMutation-C_j3dA_L.js.map +1 -0
  381. package/lib/zudoku.auth-auth0.js +1 -1
  382. package/lib/zudoku.auth-auth0.js.map +1 -1
  383. package/lib/zudoku.auth-clerk.js +99 -82
  384. package/lib/zudoku.auth-clerk.js.map +1 -1
  385. package/lib/zudoku.auth-openid.js +246 -216
  386. package/lib/zudoku.auth-openid.js.map +1 -1
  387. package/lib/zudoku.components.js +4957 -33
  388. package/lib/zudoku.components.js.map +1 -1
  389. package/lib/zudoku.hooks.js +21 -12
  390. package/lib/zudoku.hooks.js.map +1 -1
  391. package/lib/zudoku.plugin-api-catalog.js +8 -8
  392. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  393. package/lib/zudoku.plugin-api-keys.js +5022 -214
  394. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  395. package/lib/zudoku.plugin-custom-pages.js +2 -2
  396. package/lib/zudoku.plugin-custom-pages.js.map +1 -1
  397. package/lib/zudoku.plugin-markdown.js +1 -1
  398. package/lib/zudoku.plugin-markdown.js.map +1 -1
  399. package/lib/zudoku.plugin-openapi.js +3 -3
  400. package/lib/zudoku.plugin-redirect.js.map +1 -1
  401. package/lib/zudoku.plugin-search-pagefind.js +5 -5
  402. package/lib/zudoku.plugins.js +7 -6
  403. package/lib/zudoku.plugins.js.map +1 -1
  404. package/package.json +15 -16
  405. package/src/app/defaultTheme.css +54 -0
  406. package/src/app/font.geist.css +73 -0
  407. package/src/app/main.css +113 -156
  408. package/src/app/main.tsx +4 -28
  409. package/src/lib/authentication/AuthenticationPlugin.tsx +18 -4
  410. package/src/lib/authentication/authentication.ts +2 -5
  411. package/src/lib/authentication/providers/auth0.tsx +8 -2
  412. package/src/lib/authentication/providers/clerk.tsx +72 -48
  413. package/src/lib/authentication/providers/openid.tsx +19 -26
  414. package/src/lib/authentication/providers/supabase.tsx +7 -7
  415. package/src/lib/components/Autocomplete.tsx +1 -1
  416. package/src/lib/components/Banner.tsx +1 -1
  417. package/src/lib/components/ErrorPage.tsx +1 -1
  418. package/src/lib/components/Footer.tsx +7 -10
  419. package/src/lib/components/Header.tsx +29 -29
  420. package/src/lib/components/Heading.tsx +9 -5
  421. package/src/lib/components/InlineCode.tsx +1 -1
  422. package/src/lib/components/Layout.tsx +3 -3
  423. package/src/lib/components/Main.tsx +4 -4
  424. package/src/lib/components/Markdown.tsx +14 -4
  425. package/src/lib/components/MobileTopNavigation.tsx +3 -2
  426. package/src/lib/components/NotFoundPage.tsx +1 -1
  427. package/src/lib/components/Pagination.tsx +3 -9
  428. package/src/lib/components/Search.tsx +1 -1
  429. package/src/lib/components/Slot.test.tsx +465 -0
  430. package/src/lib/components/Slot.tsx +64 -0
  431. package/src/lib/components/TopNavigation.tsx +5 -17
  432. package/src/lib/components/Zudoku.tsx +9 -9
  433. package/src/lib/components/context/SlotProvider.tsx +149 -0
  434. package/src/lib/components/context/ZudokuProvider.tsx +2 -1
  435. package/src/lib/components/index.ts +14 -10
  436. package/src/lib/components/navigation/PoweredByZudoku.tsx +1 -1
  437. package/src/lib/components/navigation/Sidebar.tsx +3 -3
  438. package/src/lib/components/navigation/SidebarBadge.tsx +1 -1
  439. package/src/lib/components/navigation/SidebarCategory.tsx +3 -3
  440. package/src/lib/components/navigation/SidebarItem.tsx +57 -30
  441. package/src/lib/components/navigation/SidebarWrapper.tsx +2 -2
  442. package/src/lib/components/navigation/Toc.tsx +2 -2
  443. package/src/lib/components/navigation/utils.ts +42 -6
  444. package/src/lib/core/ZudokuContext.ts +24 -12
  445. package/src/lib/core/plugins.ts +10 -2
  446. package/src/lib/errors/ErrorAlert.tsx +1 -1
  447. package/src/lib/hooks/index.ts +11 -0
  448. package/src/lib/plugins/api-catalog/Catalog.tsx +1 -1
  449. package/src/lib/plugins/api-keys/CreateApiKey.tsx +54 -42
  450. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +292 -112
  451. package/src/lib/plugins/api-keys/index.tsx +101 -55
  452. package/src/lib/plugins/custom-pages/index.tsx +1 -1
  453. package/src/lib/plugins/markdown/MdxPage.tsx +2 -2
  454. package/src/lib/plugins/markdown/index.tsx +2 -2
  455. package/src/lib/plugins/markdown/resolver.ts +4 -2
  456. package/src/lib/plugins/openapi/CollapsibleCode.tsx +1 -1
  457. package/src/lib/plugins/openapi/ColorizedParam.tsx +2 -2
  458. package/src/lib/plugins/openapi/OperationList.tsx +2 -2
  459. package/src/lib/plugins/openapi/OperationListItem.tsx +6 -34
  460. package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +7 -1
  461. package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +5 -16
  462. package/src/lib/plugins/openapi/SchemaList.tsx +20 -8
  463. package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
  464. package/src/lib/plugins/openapi/SidecarExamples.tsx +6 -0
  465. package/src/lib/plugins/openapi/components/EnumValues.tsx +1 -1
  466. package/src/lib/plugins/openapi/components/ResponseContent.tsx +104 -0
  467. package/src/lib/plugins/openapi/playground/Playground.tsx +7 -1
  468. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +1 -1
  469. package/src/lib/plugins/openapi/playground/SubmitButton.tsx +24 -29
  470. package/src/lib/plugins/openapi/schema/SchemaExampleAndDefault.tsx +2 -2
  471. package/src/lib/plugins/openapi/schema/SchemaView.tsx +7 -3
  472. package/src/lib/plugins/redirect/index.tsx +1 -1
  473. package/src/lib/ui/Badge.tsx +2 -2
  474. package/src/lib/ui/Button.tsx +9 -6
  475. package/src/lib/ui/Callout.tsx +1 -0
  476. package/src/lib/ui/Card.tsx +1 -1
  477. package/src/lib/ui/Checkbox.tsx +1 -1
  478. package/src/lib/ui/Command.tsx +5 -5
  479. package/src/lib/ui/Dialog.tsx +1 -1
  480. package/src/lib/ui/DropdownMenu.tsx +4 -4
  481. package/src/lib/ui/HoverCard.tsx +1 -1
  482. package/src/lib/ui/Input.tsx +1 -1
  483. package/src/lib/ui/Popover.tsx +1 -1
  484. package/src/lib/ui/RadioGroup.tsx +1 -1
  485. package/src/lib/ui/Select.tsx +3 -3
  486. package/src/lib/ui/Slider.tsx +1 -1
  487. package/src/lib/ui/Switch.tsx +1 -1
  488. package/src/lib/ui/Tabs.tsx +2 -2
  489. package/src/lib/ui/Textarea.tsx +1 -1
  490. package/src/lib/ui/Toggle.tsx +1 -1
  491. package/src/lib/ui/Tooltip.tsx +16 -1
  492. package/src/lib/util/useExposedProps.tsx +12 -1
  493. package/dist/app/tailwind.d.ts +0 -4
  494. package/dist/app/tailwind.js +0 -97
  495. package/dist/app/tailwind.js.map +0 -1
  496. package/dist/config/common.d.ts +0 -10
  497. package/dist/config/common.js +0 -2
  498. package/dist/config/common.js.map +0 -1
  499. package/dist/config/validators/common.d.ts +0 -8001
  500. package/dist/config/validators/common.js +0 -414
  501. package/dist/config/validators/common.js.map +0 -1
  502. package/dist/lib/components/SlotletProvider.d.ts +0 -17
  503. package/dist/lib/components/SlotletProvider.js +0 -18
  504. package/dist/lib/components/SlotletProvider.js.map +0 -1
  505. package/dist/vite/plugin-docs.test.js +0 -22
  506. package/dist/vite/plugin-docs.test.js.map +0 -1
  507. package/lib/AuthenticationPlugin-UNaAuxNo.js.map +0 -1
  508. package/lib/Button-Bdk_Ij3U.js +0 -49
  509. package/lib/Button-Bdk_Ij3U.js.map +0 -1
  510. package/lib/Callout-XadUe37J.js.map +0 -1
  511. package/lib/Dialog-CNf2oWXG.js.map +0 -1
  512. package/lib/Markdown-D96AphCL.js +0 -7691
  513. package/lib/Markdown-D96AphCL.js.map +0 -1
  514. package/lib/MdxPage-Sjv6y3cA.js.map +0 -1
  515. package/lib/OperationList-DefCF3ZI.js.map +0 -1
  516. package/lib/Pagination-B89j9KJS.js +0 -48
  517. package/lib/Pagination-B89j9KJS.js.map +0 -1
  518. package/lib/RouteGuard-lkdEJoDV.js.map +0 -1
  519. package/lib/SchemaList-zHQ2Ekyw.js.map +0 -1
  520. package/lib/SchemaView-CqF4oMU-.js.map +0 -1
  521. package/lib/Select-HTio1oSE.js +0 -211
  522. package/lib/Select-HTio1oSE.js.map +0 -1
  523. package/lib/SlotletProvider-CTgIBRWg.js +0 -257
  524. package/lib/SlotletProvider-CTgIBRWg.js.map +0 -1
  525. package/lib/Toc-Ax54Pw8S.js.map +0 -1
  526. package/lib/cn-CwJPJKOE.js.map +0 -1
  527. package/lib/hook-BwOB_iZo.js.map +0 -1
  528. package/lib/index-BY8J3gEh.js.map +0 -1
  529. package/lib/index-CT2PstvH.js +0 -4982
  530. package/lib/index-CT2PstvH.js.map +0 -1
  531. package/src/app/tailwind.ts +0 -103
  532. package/src/lib/components/SlotletProvider.tsx +0 -55
  533. /package/dist/{vite/plugin-docs.test.d.ts → lib/components/Slot.test.d.ts} +0 -0
@@ -1,4982 +0,0 @@
1
- import { B as er, a as tr, H as wt, R as cs } from "./RouteGuard-lkdEJoDV.js";
2
- import { z as rr, J as ds } from "./index--oeBayMa.js";
3
- import { R as us, S as ls, u as nt, f as at, g as fs, L as kt, O as sr } from "./chunk-BAXFHI7N-C9WnHsLV.js";
4
- import { S as nr, p as ar, Q as hs, n as q, q as Ot, r as At, t as X, v as ms, w as ps, x as gs, y as vs, z as Pt, A as Rt, B as ys, h as Mt, C as It, D as xs, g as ir, E as or, m as _s, e as Q, l as Ne, F as cr, G as bs, f as be, u as ws, j as ks, d as js, Z as Ts, H as Ss, I as Cs } from "./hook-BwOB_iZo.js";
5
- import { E as dr, S as F, a as Ns, R as Es } from "./SlotletProvider-CTgIBRWg.js";
6
- import { j as i } from "./jsx-runtime-C5mzlN2N.js";
7
- import { Button as ur } from "./ui/Button.js";
8
- import { Callout as Os } from "./ui/Callout.js";
9
- import { M as As } from "./mutation-CL2MCRQL.js";
10
- import * as re from "react";
11
- import Ye, { createContext as jt, StrictMode as lr, useRef as oe, useEffect as G, useState as ve, useCallback as ie, Suspense as Tt, memo as fr, Component as Ps, createElement as Zt, useMemo as ut, useContext as Rs } from "react";
12
- import * as Ms from "react-dom";
13
- import { CircleFadingArrowUpIcon as Is, LoaderCircleIcon as Zs, ExternalLink as $s, CircleXIcon as Ds, ChevronRightIcon as zs, SearchIcon as qs, SunIcon as Fs, MoonIcon as Ls, MenuIcon as Bs, PanelLeftIcon as Vs } from "lucide-react";
14
- import { C as it } from "./ClientOnly-E7hGysn1.js";
15
- import { c as $ } from "./cn-CwJPJKOE.js";
16
- import { A as Us, s as Qs, a as $t, b as Hs, H as Ws, P as Ys, c as Ks, V as Gs, M as Js } from "./Markdown-D96AphCL.js";
17
- import { S as hr } from "./Spinner-mNLZ6awP.js";
18
- import { C as Xs } from "./CategoryHeading-DZi-Szor.js";
19
- import { isSearchPlugin as en, isProfileMenuPlugin as tn, isNavigationPlugin as rn, isEventConsumerPlugin as sn, needsInitialization as nn, isApiIdentityPlugin as an, isMdxProviderPlugin as on, hasHead as cn } from "./zudoku.plugins.js";
20
- import { o as dn } from "./objectEntries-yMIkr2mI.js";
21
- import { B as pt } from "./Button-Bdk_Ij3U.js";
22
- import { DropdownMenu as un, DropdownMenuTrigger as ln, DropdownMenuContent as fn, DropdownMenuLabel as hn, DropdownMenuSeparator as lt, DropdownMenuSub as mn, DropdownMenuSubTrigger as pn, DropdownMenuPortal as gn, DropdownMenuSubContent as vn, DropdownMenuItem as yn } from "./ui/DropdownMenu.js";
23
- import { VisuallyHidden as mr } from "@radix-ui/react-visually-hidden";
24
- import { D as xn, a as _n, b as pr, c as gr, d as J } from "./Drawer-BPBxzel2.js";
25
- import { a as bn } from "./index-Z13x6tPX.js";
26
- const gt = {}, vr = Ye.createContext(gt);
27
- function yr(t) {
28
- const e = Ye.useContext(vr);
29
- return Ye.useMemo(
30
- function() {
31
- return typeof t == "function" ? t(e) : { ...e, ...t };
32
- },
33
- [e, t]
34
- );
35
- }
36
- function wn(t) {
37
- let e;
38
- return t.disableParentContext ? e = typeof t.components == "function" ? t.components(gt) : t.components || gt : e = yr(t.components), Ye.createElement(
39
- vr.Provider,
40
- { value: e },
41
- t.children
42
- );
43
- }
44
- var kn = class extends nr {
45
- constructor(t = {}) {
46
- super(), this.config = t, this.#e = /* @__PURE__ */ new Map();
47
- }
48
- #e;
49
- build(t, e, r) {
50
- const s = e.queryKey, n = e.queryHash ?? ar(s, e);
51
- let a = this.get(n);
52
- return a || (a = new hs({
53
- client: t,
54
- queryKey: s,
55
- queryHash: n,
56
- options: t.defaultQueryOptions(e),
57
- state: r,
58
- defaultOptions: t.getQueryDefaults(s)
59
- }), this.add(a)), a;
60
- }
61
- add(t) {
62
- this.#e.has(t.queryHash) || (this.#e.set(t.queryHash, t), this.notify({
63
- type: "added",
64
- query: t
65
- }));
66
- }
67
- remove(t) {
68
- const e = this.#e.get(t.queryHash);
69
- e && (t.destroy(), e === t && this.#e.delete(t.queryHash), this.notify({ type: "removed", query: t }));
70
- }
71
- clear() {
72
- q.batch(() => {
73
- this.getAll().forEach((t) => {
74
- this.remove(t);
75
- });
76
- });
77
- }
78
- get(t) {
79
- return this.#e.get(t);
80
- }
81
- getAll() {
82
- return [...this.#e.values()];
83
- }
84
- find(t) {
85
- const e = { exact: !0, ...t };
86
- return this.getAll().find(
87
- (r) => Ot(e, r)
88
- );
89
- }
90
- findAll(t = {}) {
91
- const e = this.getAll();
92
- return Object.keys(t).length > 0 ? e.filter((r) => Ot(t, r)) : e;
93
- }
94
- notify(t) {
95
- q.batch(() => {
96
- this.listeners.forEach((e) => {
97
- e(t);
98
- });
99
- });
100
- }
101
- onFocus() {
102
- q.batch(() => {
103
- this.getAll().forEach((t) => {
104
- t.onFocus();
105
- });
106
- });
107
- }
108
- onOnline() {
109
- q.batch(() => {
110
- this.getAll().forEach((t) => {
111
- t.onOnline();
112
- });
113
- });
114
- }
115
- }, jn = class extends nr {
116
- constructor(t = {}) {
117
- super(), this.config = t, this.#e = /* @__PURE__ */ new Set(), this.#t = /* @__PURE__ */ new Map(), this.#r = 0;
118
- }
119
- #e;
120
- #t;
121
- #r;
122
- build(t, e, r) {
123
- const s = new As({
124
- mutationCache: this,
125
- mutationId: ++this.#r,
126
- options: t.defaultMutationOptions(e),
127
- state: r
128
- });
129
- return this.add(s), s;
130
- }
131
- add(t) {
132
- this.#e.add(t);
133
- const e = Ve(t);
134
- if (typeof e == "string") {
135
- const r = this.#t.get(e);
136
- r ? r.push(t) : this.#t.set(e, [t]);
137
- }
138
- this.notify({ type: "added", mutation: t });
139
- }
140
- remove(t) {
141
- if (this.#e.delete(t)) {
142
- const e = Ve(t);
143
- if (typeof e == "string") {
144
- const r = this.#t.get(e);
145
- if (r)
146
- if (r.length > 1) {
147
- const s = r.indexOf(t);
148
- s !== -1 && r.splice(s, 1);
149
- } else r[0] === t && this.#t.delete(e);
150
- }
151
- }
152
- this.notify({ type: "removed", mutation: t });
153
- }
154
- canRun(t) {
155
- const e = Ve(t);
156
- if (typeof e == "string") {
157
- const s = this.#t.get(e)?.find(
158
- (n) => n.state.status === "pending"
159
- );
160
- return !s || s === t;
161
- } else
162
- return !0;
163
- }
164
- runNext(t) {
165
- const e = Ve(t);
166
- return typeof e == "string" ? this.#t.get(e)?.find((s) => s !== t && s.state.isPaused)?.continue() ?? Promise.resolve() : Promise.resolve();
167
- }
168
- clear() {
169
- q.batch(() => {
170
- this.#e.forEach((t) => {
171
- this.notify({ type: "removed", mutation: t });
172
- }), this.#e.clear(), this.#t.clear();
173
- });
174
- }
175
- getAll() {
176
- return Array.from(this.#e);
177
- }
178
- find(t) {
179
- const e = { exact: !0, ...t };
180
- return this.getAll().find(
181
- (r) => At(e, r)
182
- );
183
- }
184
- findAll(t = {}) {
185
- return this.getAll().filter((e) => At(t, e));
186
- }
187
- notify(t) {
188
- q.batch(() => {
189
- this.listeners.forEach((e) => {
190
- e(t);
191
- });
192
- });
193
- }
194
- resumePausedMutations() {
195
- const t = this.getAll().filter((e) => e.state.isPaused);
196
- return q.batch(
197
- () => Promise.all(
198
- t.map((e) => e.continue().catch(X))
199
- )
200
- );
201
- }
202
- };
203
- function Ve(t) {
204
- return t.options.scope?.id;
205
- }
206
- function Dt(t) {
207
- return {
208
- onFetch: (e, r) => {
209
- const s = e.options, n = e.fetchOptions?.meta?.fetchMore?.direction, a = e.state.data?.pages || [], o = e.state.data?.pageParams || [];
210
- let c = { pages: [], pageParams: [] }, u = 0;
211
- const d = async () => {
212
- let f = !1;
213
- const b = (_) => {
214
- Object.defineProperty(_, "signal", {
215
- enumerable: !0,
216
- get: () => (e.signal.aborted ? f = !0 : e.signal.addEventListener("abort", () => {
217
- f = !0;
218
- }), e.signal)
219
- });
220
- }, k = ms(e.options, e.fetchOptions), w = async (_, C, M) => {
221
- if (f)
222
- return Promise.reject();
223
- if (C == null && _.pages.length)
224
- return Promise.resolve(_);
225
- const I = {
226
- client: e.client,
227
- queryKey: e.queryKey,
228
- pageParam: C,
229
- direction: M ? "backward" : "forward",
230
- meta: e.options.meta
231
- };
232
- b(I);
233
- const z = await k(
234
- I
235
- ), { maxPages: O } = e.options, A = M ? ps : gs;
236
- return {
237
- pages: A(_.pages, z, O),
238
- pageParams: A(_.pageParams, C, O)
239
- };
240
- };
241
- if (n && a.length) {
242
- const _ = n === "backward", C = _ ? Tn : zt, M = {
243
- pages: a,
244
- pageParams: o
245
- }, I = C(s, M);
246
- c = await w(M, I, _);
247
- } else {
248
- const _ = t ?? a.length;
249
- do {
250
- const C = u === 0 ? o[0] ?? s.initialPageParam : zt(s, c);
251
- if (u > 0 && C == null)
252
- break;
253
- c = await w(c, C), u++;
254
- } while (u < _);
255
- }
256
- return c;
257
- };
258
- e.options.persister ? e.fetchFn = () => e.options.persister?.(
259
- d,
260
- {
261
- client: e.client,
262
- queryKey: e.queryKey,
263
- meta: e.options.meta,
264
- signal: e.signal
265
- },
266
- r
267
- ) : e.fetchFn = d;
268
- }
269
- };
270
- }
271
- function zt(t, { pages: e, pageParams: r }) {
272
- const s = e.length - 1;
273
- return e.length > 0 ? t.getNextPageParam(
274
- e[s],
275
- e,
276
- r[s],
277
- r
278
- ) : void 0;
279
- }
280
- function Tn(t, { pages: e, pageParams: r }) {
281
- return e.length > 0 ? t.getPreviousPageParam?.(e[0], e, r[0], r) : void 0;
282
- }
283
- var Sn = class {
284
- #e;
285
- #t;
286
- #r;
287
- #n;
288
- #a;
289
- #s;
290
- #i;
291
- #o;
292
- constructor(t = {}) {
293
- this.#e = t.queryCache || new kn(), this.#t = t.mutationCache || new jn(), this.#r = t.defaultOptions || {}, this.#n = /* @__PURE__ */ new Map(), this.#a = /* @__PURE__ */ new Map(), this.#s = 0;
294
- }
295
- mount() {
296
- this.#s++, this.#s === 1 && (this.#i = vs.subscribe(async (t) => {
297
- t && (await this.resumePausedMutations(), this.#e.onFocus());
298
- }), this.#o = Pt.subscribe(async (t) => {
299
- t && (await this.resumePausedMutations(), this.#e.onOnline());
300
- }));
301
- }
302
- unmount() {
303
- this.#s--, this.#s === 0 && (this.#i?.(), this.#i = void 0, this.#o?.(), this.#o = void 0);
304
- }
305
- isFetching(t) {
306
- return this.#e.findAll({ ...t, fetchStatus: "fetching" }).length;
307
- }
308
- isMutating(t) {
309
- return this.#t.findAll({ ...t, status: "pending" }).length;
310
- }
311
- /**
312
- * Imperative (non-reactive) way to retrieve data for a QueryKey.
313
- * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.
314
- *
315
- * Hint: Do not use this function inside a component, because it won't receive updates.
316
- * Use `useQuery` to create a `QueryObserver` that subscribes to changes.
317
- */
318
- getQueryData(t) {
319
- const e = this.defaultQueryOptions({ queryKey: t });
320
- return this.#e.get(e.queryHash)?.state.data;
321
- }
322
- ensureQueryData(t) {
323
- const e = this.defaultQueryOptions(t), r = this.#e.build(this, e), s = r.state.data;
324
- return s === void 0 ? this.fetchQuery(t) : (t.revalidateIfStale && r.isStaleByTime(Rt(e.staleTime, r)) && this.prefetchQuery(e), Promise.resolve(s));
325
- }
326
- getQueriesData(t) {
327
- return this.#e.findAll(t).map(({ queryKey: e, state: r }) => {
328
- const s = r.data;
329
- return [e, s];
330
- });
331
- }
332
- setQueryData(t, e, r) {
333
- const s = this.defaultQueryOptions({ queryKey: t }), a = this.#e.get(
334
- s.queryHash
335
- )?.state.data, o = ys(e, a);
336
- if (o !== void 0)
337
- return this.#e.build(this, s).setData(o, { ...r, manual: !0 });
338
- }
339
- setQueriesData(t, e, r) {
340
- return q.batch(
341
- () => this.#e.findAll(t).map(({ queryKey: s }) => [
342
- s,
343
- this.setQueryData(s, e, r)
344
- ])
345
- );
346
- }
347
- getQueryState(t) {
348
- const e = this.defaultQueryOptions({ queryKey: t });
349
- return this.#e.get(
350
- e.queryHash
351
- )?.state;
352
- }
353
- removeQueries(t) {
354
- const e = this.#e;
355
- q.batch(() => {
356
- e.findAll(t).forEach((r) => {
357
- e.remove(r);
358
- });
359
- });
360
- }
361
- resetQueries(t, e) {
362
- const r = this.#e;
363
- return q.batch(() => (r.findAll(t).forEach((s) => {
364
- s.reset();
365
- }), this.refetchQueries(
366
- {
367
- type: "active",
368
- ...t
369
- },
370
- e
371
- )));
372
- }
373
- cancelQueries(t, e = {}) {
374
- const r = { revert: !0, ...e }, s = q.batch(
375
- () => this.#e.findAll(t).map((n) => n.cancel(r))
376
- );
377
- return Promise.all(s).then(X).catch(X);
378
- }
379
- invalidateQueries(t, e = {}) {
380
- return q.batch(() => (this.#e.findAll(t).forEach((r) => {
381
- r.invalidate();
382
- }), t?.refetchType === "none" ? Promise.resolve() : this.refetchQueries(
383
- {
384
- ...t,
385
- type: t?.refetchType ?? t?.type ?? "active"
386
- },
387
- e
388
- )));
389
- }
390
- refetchQueries(t, e = {}) {
391
- const r = {
392
- ...e,
393
- cancelRefetch: e.cancelRefetch ?? !0
394
- }, s = q.batch(
395
- () => this.#e.findAll(t).filter((n) => !n.isDisabled()).map((n) => {
396
- let a = n.fetch(void 0, r);
397
- return r.throwOnError || (a = a.catch(X)), n.state.fetchStatus === "paused" ? Promise.resolve() : a;
398
- })
399
- );
400
- return Promise.all(s).then(X);
401
- }
402
- fetchQuery(t) {
403
- const e = this.defaultQueryOptions(t);
404
- e.retry === void 0 && (e.retry = !1);
405
- const r = this.#e.build(this, e);
406
- return r.isStaleByTime(
407
- Rt(e.staleTime, r)
408
- ) ? r.fetch(e) : Promise.resolve(r.state.data);
409
- }
410
- prefetchQuery(t) {
411
- return this.fetchQuery(t).then(X).catch(X);
412
- }
413
- fetchInfiniteQuery(t) {
414
- return t.behavior = Dt(t.pages), this.fetchQuery(t);
415
- }
416
- prefetchInfiniteQuery(t) {
417
- return this.fetchInfiniteQuery(t).then(X).catch(X);
418
- }
419
- ensureInfiniteQueryData(t) {
420
- return t.behavior = Dt(t.pages), this.ensureQueryData(t);
421
- }
422
- resumePausedMutations() {
423
- return Pt.isOnline() ? this.#t.resumePausedMutations() : Promise.resolve();
424
- }
425
- getQueryCache() {
426
- return this.#e;
427
- }
428
- getMutationCache() {
429
- return this.#t;
430
- }
431
- getDefaultOptions() {
432
- return this.#r;
433
- }
434
- setDefaultOptions(t) {
435
- this.#r = t;
436
- }
437
- setQueryDefaults(t, e) {
438
- this.#n.set(Mt(t), {
439
- queryKey: t,
440
- defaultOptions: e
441
- });
442
- }
443
- getQueryDefaults(t) {
444
- const e = [...this.#n.values()], r = {};
445
- return e.forEach((s) => {
446
- It(t, s.queryKey) && Object.assign(r, s.defaultOptions);
447
- }), r;
448
- }
449
- setMutationDefaults(t, e) {
450
- this.#a.set(Mt(t), {
451
- mutationKey: t,
452
- defaultOptions: e
453
- });
454
- }
455
- getMutationDefaults(t) {
456
- const e = [...this.#a.values()], r = {};
457
- return e.forEach((s) => {
458
- It(t, s.mutationKey) && Object.assign(r, s.defaultOptions);
459
- }), r;
460
- }
461
- defaultQueryOptions(t) {
462
- if (t._defaulted)
463
- return t;
464
- const e = {
465
- ...this.#r.queries,
466
- ...this.getQueryDefaults(t.queryKey),
467
- ...t,
468
- _defaulted: !0
469
- };
470
- return e.queryHash || (e.queryHash = ar(
471
- e.queryKey,
472
- e
473
- )), e.refetchOnReconnect === void 0 && (e.refetchOnReconnect = e.networkMode !== "always"), e.throwOnError === void 0 && (e.throwOnError = !!e.suspense), !e.networkMode && e.persister && (e.networkMode = "offlineFirst"), e.queryFn === xs && (e.enabled = !1), e;
474
- }
475
- defaultMutationOptions(t) {
476
- return t?._defaulted ? t : {
477
- ...this.#r.mutations,
478
- ...t?.mutationKey && this.getMutationDefaults(t.mutationKey),
479
- ...t,
480
- _defaulted: !0
481
- };
482
- }
483
- clear() {
484
- this.#e.clear(), this.#t.clear();
485
- }
486
- };
487
- function Cn(t) {
488
- return t;
489
- }
490
- function qt(t, e, r) {
491
- if (typeof e != "object" || e === null)
492
- return;
493
- const s = t.getMutationCache(), n = t.getQueryCache(), a = r?.defaultOptions?.deserializeData ?? t.getDefaultOptions().hydrate?.deserializeData ?? Cn, o = e.mutations || [], c = e.queries || [];
494
- o.forEach(({ state: u, ...d }) => {
495
- s.build(
496
- t,
497
- {
498
- ...t.getDefaultOptions().hydrate?.mutations,
499
- ...r?.defaultOptions?.mutations,
500
- ...d
501
- },
502
- u
503
- );
504
- }), c.forEach(({ queryKey: u, state: d, queryHash: f, meta: b, promise: k }) => {
505
- let w = n.get(f);
506
- const _ = d.data === void 0 ? d.data : a(d.data);
507
- if (w) {
508
- if (w.state.dataUpdatedAt < d.dataUpdatedAt) {
509
- const { fetchStatus: C, ...M } = d;
510
- w.setState({
511
- ...M,
512
- data: _
513
- });
514
- }
515
- } else
516
- w = n.build(
517
- t,
518
- {
519
- ...t.getDefaultOptions().hydrate?.queries,
520
- ...r?.defaultOptions?.queries,
521
- queryKey: u,
522
- queryHash: f,
523
- meta: b
524
- },
525
- // Reset fetch status to idle to avoid
526
- // query being stuck in fetching state upon hydration
527
- {
528
- ...d,
529
- data: _,
530
- fetchStatus: "idle"
531
- }
532
- );
533
- if (k) {
534
- const C = Promise.resolve(k).then(a);
535
- w.fetch(void 0, { initialPromise: C });
536
- }
537
- });
538
- }
539
- var Ft = (t, e) => typeof t == "object" && t !== null && e in t, Nn = ({
540
- children: t,
541
- options: e = {},
542
- state: r,
543
- queryClient: s
544
- }) => {
545
- const n = ir(s), [a, o] = re.useState(), c = re.useRef(e);
546
- return c.current = e, re.useMemo(() => {
547
- if (r) {
548
- if (typeof r != "object")
549
- return;
550
- const u = n.getQueryCache(), d = r.queries || [], f = [], b = [];
551
- for (const k of d) {
552
- const w = u.get(k.queryHash);
553
- if (!w)
554
- f.push(k);
555
- else {
556
- const _ = k.state.dataUpdatedAt > w.state.dataUpdatedAt || // RSC special serialized then-able chunks
557
- Ft(k.promise, "status") && Ft(w.promise, "status") && k.promise.status !== w.promise.status, C = a?.find(
558
- (M) => M.queryHash === k.queryHash
559
- );
560
- _ && (!C || k.state.dataUpdatedAt > C.state.dataUpdatedAt) && b.push(k);
561
- }
562
- }
563
- f.length > 0 && qt(n, { queries: f }, c.current), b.length > 0 && o(
564
- (k) => k ? [...k, ...b] : b
565
- );
566
- }
567
- }, [n, a, r]), re.useEffect(() => {
568
- a && (qt(n, { queries: a }, c.current), o(void 0));
569
- }, [n, a]), t;
570
- };
571
- function En({ error: t }) {
572
- return /* @__PURE__ */ i.jsx(dr, { error: t });
573
- }
574
- /**
575
- * react-router v7.5.2
576
- *
577
- * Copyright (c) Remix Software Inc.
578
- *
579
- * This source code is licensed under the MIT license found in the
580
- * LICENSE.md file in the root directory of this source tree.
581
- *
582
- * @license MIT
583
- */
584
- function On(t) {
585
- return /* @__PURE__ */ re.createElement(us, { flushSync: Ms.flushSync, ...t });
586
- }
587
- const vt = jt({ stagger: !1 }), An = new Sn({
588
- defaultOptions: {
589
- queries: {
590
- staleTime: 1e3 * 60 * 5
591
- }
592
- }
593
- }), Pn = ({
594
- router: t,
595
- hydrate: e = !1
596
- }) => /* @__PURE__ */ i.jsx(lr, { children: /* @__PURE__ */ i.jsx(or, { client: An, children: /* @__PURE__ */ i.jsx(Nn, { state: e ? window.DATA : void 0, children: /* @__PURE__ */ i.jsx(er, { value: !1, children: /* @__PURE__ */ i.jsx(tr, { children: /* @__PURE__ */ i.jsx(vt.Provider, { value: { stagger: !e }, children: /* @__PURE__ */ i.jsx(On, { router: t }) }) }) }) }) }) }), Rn = ({
597
- router: t,
598
- context: e,
599
- queryClient: r,
600
- helmetContext: s,
601
- bypassProtection: n = !1
602
- }) => /* @__PURE__ */ i.jsx(lr, { children: /* @__PURE__ */ i.jsx(or, { client: r, children: /* @__PURE__ */ i.jsx(tr, { context: s, children: /* @__PURE__ */ i.jsx(er, { value: n, children: /* @__PURE__ */ i.jsx(ls, { router: t, context: e }) }) }) }) });
603
- var S;
604
- (function(t) {
605
- t.assertEqual = (n) => n;
606
- function e(n) {
607
- }
608
- t.assertIs = e;
609
- function r(n) {
610
- throw new Error();
611
- }
612
- t.assertNever = r, t.arrayToEnum = (n) => {
613
- const a = {};
614
- for (const o of n)
615
- a[o] = o;
616
- return a;
617
- }, t.getValidEnumValues = (n) => {
618
- const a = t.objectKeys(n).filter((c) => typeof n[n[c]] != "number"), o = {};
619
- for (const c of a)
620
- o[c] = n[c];
621
- return t.objectValues(o);
622
- }, t.objectValues = (n) => t.objectKeys(n).map(function(a) {
623
- return n[a];
624
- }), t.objectKeys = typeof Object.keys == "function" ? (n) => Object.keys(n) : (n) => {
625
- const a = [];
626
- for (const o in n)
627
- Object.prototype.hasOwnProperty.call(n, o) && a.push(o);
628
- return a;
629
- }, t.find = (n, a) => {
630
- for (const o of n)
631
- if (a(o))
632
- return o;
633
- }, t.isInteger = typeof Number.isInteger == "function" ? (n) => Number.isInteger(n) : (n) => typeof n == "number" && isFinite(n) && Math.floor(n) === n;
634
- function s(n, a = " | ") {
635
- return n.map((o) => typeof o == "string" ? `'${o}'` : o).join(a);
636
- }
637
- t.joinValues = s, t.jsonStringifyReplacer = (n, a) => typeof a == "bigint" ? a.toString() : a;
638
- })(S || (S = {}));
639
- var yt;
640
- (function(t) {
641
- t.mergeShapes = (e, r) => ({
642
- ...e,
643
- ...r
644
- // second overwrites first
645
- });
646
- })(yt || (yt = {}));
647
- const p = S.arrayToEnum([
648
- "string",
649
- "nan",
650
- "number",
651
- "integer",
652
- "float",
653
- "boolean",
654
- "date",
655
- "bigint",
656
- "symbol",
657
- "function",
658
- "undefined",
659
- "null",
660
- "array",
661
- "object",
662
- "unknown",
663
- "promise",
664
- "void",
665
- "never",
666
- "map",
667
- "set"
668
- ]), te = (t) => {
669
- switch (typeof t) {
670
- case "undefined":
671
- return p.undefined;
672
- case "string":
673
- return p.string;
674
- case "number":
675
- return isNaN(t) ? p.nan : p.number;
676
- case "boolean":
677
- return p.boolean;
678
- case "function":
679
- return p.function;
680
- case "bigint":
681
- return p.bigint;
682
- case "symbol":
683
- return p.symbol;
684
- case "object":
685
- return Array.isArray(t) ? p.array : t === null ? p.null : t.then && typeof t.then == "function" && t.catch && typeof t.catch == "function" ? p.promise : typeof Map < "u" && t instanceof Map ? p.map : typeof Set < "u" && t instanceof Set ? p.set : typeof Date < "u" && t instanceof Date ? p.date : p.object;
686
- default:
687
- return p.unknown;
688
- }
689
- }, l = S.arrayToEnum([
690
- "invalid_type",
691
- "invalid_literal",
692
- "custom",
693
- "invalid_union",
694
- "invalid_union_discriminator",
695
- "invalid_enum_value",
696
- "unrecognized_keys",
697
- "invalid_arguments",
698
- "invalid_return_type",
699
- "invalid_date",
700
- "invalid_string",
701
- "too_small",
702
- "too_big",
703
- "invalid_intersection_types",
704
- "not_multiple_of",
705
- "not_finite"
706
- ]), Mn = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
707
- class L extends Error {
708
- get errors() {
709
- return this.issues;
710
- }
711
- constructor(e) {
712
- super(), this.issues = [], this.addIssue = (s) => {
713
- this.issues = [...this.issues, s];
714
- }, this.addIssues = (s = []) => {
715
- this.issues = [...this.issues, ...s];
716
- };
717
- const r = new.target.prototype;
718
- Object.setPrototypeOf ? Object.setPrototypeOf(this, r) : this.__proto__ = r, this.name = "ZodError", this.issues = e;
719
- }
720
- format(e) {
721
- const r = e || function(a) {
722
- return a.message;
723
- }, s = { _errors: [] }, n = (a) => {
724
- for (const o of a.issues)
725
- if (o.code === "invalid_union")
726
- o.unionErrors.map(n);
727
- else if (o.code === "invalid_return_type")
728
- n(o.returnTypeError);
729
- else if (o.code === "invalid_arguments")
730
- n(o.argumentsError);
731
- else if (o.path.length === 0)
732
- s._errors.push(r(o));
733
- else {
734
- let c = s, u = 0;
735
- for (; u < o.path.length; ) {
736
- const d = o.path[u];
737
- u === o.path.length - 1 ? (c[d] = c[d] || { _errors: [] }, c[d]._errors.push(r(o))) : c[d] = c[d] || { _errors: [] }, c = c[d], u++;
738
- }
739
- }
740
- };
741
- return n(this), s;
742
- }
743
- static assert(e) {
744
- if (!(e instanceof L))
745
- throw new Error(`Not a ZodError: ${e}`);
746
- }
747
- toString() {
748
- return this.message;
749
- }
750
- get message() {
751
- return JSON.stringify(this.issues, S.jsonStringifyReplacer, 2);
752
- }
753
- get isEmpty() {
754
- return this.issues.length === 0;
755
- }
756
- flatten(e = (r) => r.message) {
757
- const r = {}, s = [];
758
- for (const n of this.issues)
759
- n.path.length > 0 ? (r[n.path[0]] = r[n.path[0]] || [], r[n.path[0]].push(e(n))) : s.push(e(n));
760
- return { formErrors: s, fieldErrors: r };
761
- }
762
- get formErrors() {
763
- return this.flatten();
764
- }
765
- }
766
- L.create = (t) => new L(t);
767
- const ke = (t, e) => {
768
- let r;
769
- switch (t.code) {
770
- case l.invalid_type:
771
- t.received === p.undefined ? r = "Required" : r = `Expected ${t.expected}, received ${t.received}`;
772
- break;
773
- case l.invalid_literal:
774
- r = `Invalid literal value, expected ${JSON.stringify(t.expected, S.jsonStringifyReplacer)}`;
775
- break;
776
- case l.unrecognized_keys:
777
- r = `Unrecognized key(s) in object: ${S.joinValues(t.keys, ", ")}`;
778
- break;
779
- case l.invalid_union:
780
- r = "Invalid input";
781
- break;
782
- case l.invalid_union_discriminator:
783
- r = `Invalid discriminator value. Expected ${S.joinValues(t.options)}`;
784
- break;
785
- case l.invalid_enum_value:
786
- r = `Invalid enum value. Expected ${S.joinValues(t.options)}, received '${t.received}'`;
787
- break;
788
- case l.invalid_arguments:
789
- r = "Invalid function arguments";
790
- break;
791
- case l.invalid_return_type:
792
- r = "Invalid function return type";
793
- break;
794
- case l.invalid_date:
795
- r = "Invalid date";
796
- break;
797
- case l.invalid_string:
798
- typeof t.validation == "object" ? "includes" in t.validation ? (r = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (r = `${r} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? r = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? r = `Invalid input: must end with "${t.validation.endsWith}"` : S.assertNever(t.validation) : t.validation !== "regex" ? r = `Invalid ${t.validation}` : r = "Invalid";
799
- break;
800
- case l.too_small:
801
- t.type === "array" ? r = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "more than"} ${t.minimum} element(s)` : t.type === "string" ? r = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "over"} ${t.minimum} character(s)` : t.type === "number" ? r = `Number must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${t.minimum}` : t.type === "date" ? r = `Date must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(t.minimum))}` : r = "Invalid input";
802
- break;
803
- case l.too_big:
804
- t.type === "array" ? r = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at most" : "less than"} ${t.maximum} element(s)` : t.type === "string" ? r = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at most" : "under"} ${t.maximum} character(s)` : t.type === "number" ? r = `Number must be ${t.exact ? "exactly" : t.inclusive ? "less than or equal to" : "less than"} ${t.maximum}` : t.type === "bigint" ? r = `BigInt must be ${t.exact ? "exactly" : t.inclusive ? "less than or equal to" : "less than"} ${t.maximum}` : t.type === "date" ? r = `Date must be ${t.exact ? "exactly" : t.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(t.maximum))}` : r = "Invalid input";
805
- break;
806
- case l.custom:
807
- r = "Invalid input";
808
- break;
809
- case l.invalid_intersection_types:
810
- r = "Intersection results could not be merged";
811
- break;
812
- case l.not_multiple_of:
813
- r = `Number must be a multiple of ${t.multipleOf}`;
814
- break;
815
- case l.not_finite:
816
- r = "Number must be finite";
817
- break;
818
- default:
819
- r = e.defaultError, S.assertNever(t);
820
- }
821
- return { message: r };
822
- };
823
- let xr = ke;
824
- function In(t) {
825
- xr = t;
826
- }
827
- function Ke() {
828
- return xr;
829
- }
830
- const Ge = (t) => {
831
- const { data: e, path: r, errorMaps: s, issueData: n } = t, a = [...r, ...n.path || []], o = {
832
- ...n,
833
- path: a
834
- };
835
- if (n.message !== void 0)
836
- return {
837
- ...n,
838
- path: a,
839
- message: n.message
840
- };
841
- let c = "";
842
- const u = s.filter((d) => !!d).slice().reverse();
843
- for (const d of u)
844
- c = d(o, { data: e, defaultError: c }).message;
845
- return {
846
- ...n,
847
- path: a,
848
- message: c
849
- };
850
- }, Zn = [];
851
- function h(t, e) {
852
- const r = Ke(), s = Ge({
853
- issueData: e,
854
- data: t.data,
855
- path: t.path,
856
- errorMaps: [
857
- t.common.contextualErrorMap,
858
- // contextual error map is first priority
859
- t.schemaErrorMap,
860
- // then schema-bound map if available
861
- r,
862
- // then global override map
863
- r === ke ? void 0 : ke
864
- // then global default map
865
- ].filter((n) => !!n)
866
- });
867
- t.common.issues.push(s);
868
- }
869
- class Z {
870
- constructor() {
871
- this.value = "valid";
872
- }
873
- dirty() {
874
- this.value === "valid" && (this.value = "dirty");
875
- }
876
- abort() {
877
- this.value !== "aborted" && (this.value = "aborted");
878
- }
879
- static mergeArray(e, r) {
880
- const s = [];
881
- for (const n of r) {
882
- if (n.status === "aborted")
883
- return x;
884
- n.status === "dirty" && e.dirty(), s.push(n.value);
885
- }
886
- return { status: e.value, value: s };
887
- }
888
- static async mergeObjectAsync(e, r) {
889
- const s = [];
890
- for (const n of r) {
891
- const a = await n.key, o = await n.value;
892
- s.push({
893
- key: a,
894
- value: o
895
- });
896
- }
897
- return Z.mergeObjectSync(e, s);
898
- }
899
- static mergeObjectSync(e, r) {
900
- const s = {};
901
- for (const n of r) {
902
- const { key: a, value: o } = n;
903
- if (a.status === "aborted" || o.status === "aborted")
904
- return x;
905
- a.status === "dirty" && e.dirty(), o.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof o.value < "u" || n.alwaysSet) && (s[a.value] = o.value);
906
- }
907
- return { status: e.value, value: s };
908
- }
909
- }
910
- const x = Object.freeze({
911
- status: "aborted"
912
- }), _e = (t) => ({ status: "dirty", value: t }), D = (t) => ({ status: "valid", value: t }), xt = (t) => t.status === "aborted", _t = (t) => t.status === "dirty", me = (t) => t.status === "valid", Ee = (t) => typeof Promise < "u" && t instanceof Promise;
913
- function Je(t, e, r, s) {
914
- if (typeof e == "function" ? t !== e || !0 : !e.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
915
- return e.get(t);
916
- }
917
- function _r(t, e, r, s, n) {
918
- if (typeof e == "function" ? t !== e || !0 : !e.has(t)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
919
- return e.set(t, r), r;
920
- }
921
- var g;
922
- (function(t) {
923
- t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e?.message;
924
- })(g || (g = {}));
925
- var Se, Ce;
926
- class Y {
927
- constructor(e, r, s, n) {
928
- this._cachedPath = [], this.parent = e, this.data = r, this._path = s, this._key = n;
929
- }
930
- get path() {
931
- return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
932
- }
933
- }
934
- const Lt = (t, e) => {
935
- if (me(e))
936
- return { success: !0, data: e.value };
937
- if (!t.common.issues.length)
938
- throw new Error("Validation failed but no issues detected.");
939
- return {
940
- success: !1,
941
- get error() {
942
- if (this._error)
943
- return this._error;
944
- const r = new L(t.common.issues);
945
- return this._error = r, this._error;
946
- }
947
- };
948
- };
949
- function j(t) {
950
- if (!t)
951
- return {};
952
- const { errorMap: e, invalid_type_error: r, required_error: s, description: n } = t;
953
- if (e && (r || s))
954
- throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
955
- return e ? { errorMap: e, description: n } : { errorMap: (o, c) => {
956
- var u, d;
957
- const { message: f } = t;
958
- return o.code === "invalid_enum_value" ? { message: f ?? c.defaultError } : typeof c.data > "u" ? { message: (u = f ?? s) !== null && u !== void 0 ? u : c.defaultError } : o.code !== "invalid_type" ? { message: c.defaultError } : { message: (d = f ?? r) !== null && d !== void 0 ? d : c.defaultError };
959
- }, description: n };
960
- }
961
- class T {
962
- get description() {
963
- return this._def.description;
964
- }
965
- _getType(e) {
966
- return te(e.data);
967
- }
968
- _getOrReturnCtx(e, r) {
969
- return r || {
970
- common: e.parent.common,
971
- data: e.data,
972
- parsedType: te(e.data),
973
- schemaErrorMap: this._def.errorMap,
974
- path: e.path,
975
- parent: e.parent
976
- };
977
- }
978
- _processInputParams(e) {
979
- return {
980
- status: new Z(),
981
- ctx: {
982
- common: e.parent.common,
983
- data: e.data,
984
- parsedType: te(e.data),
985
- schemaErrorMap: this._def.errorMap,
986
- path: e.path,
987
- parent: e.parent
988
- }
989
- };
990
- }
991
- _parseSync(e) {
992
- const r = this._parse(e);
993
- if (Ee(r))
994
- throw new Error("Synchronous parse encountered promise.");
995
- return r;
996
- }
997
- _parseAsync(e) {
998
- const r = this._parse(e);
999
- return Promise.resolve(r);
1000
- }
1001
- parse(e, r) {
1002
- const s = this.safeParse(e, r);
1003
- if (s.success)
1004
- return s.data;
1005
- throw s.error;
1006
- }
1007
- safeParse(e, r) {
1008
- var s;
1009
- const n = {
1010
- common: {
1011
- issues: [],
1012
- async: (s = r?.async) !== null && s !== void 0 ? s : !1,
1013
- contextualErrorMap: r?.errorMap
1014
- },
1015
- path: r?.path || [],
1016
- schemaErrorMap: this._def.errorMap,
1017
- parent: null,
1018
- data: e,
1019
- parsedType: te(e)
1020
- }, a = this._parseSync({ data: e, path: n.path, parent: n });
1021
- return Lt(n, a);
1022
- }
1023
- "~validate"(e) {
1024
- var r, s;
1025
- const n = {
1026
- common: {
1027
- issues: [],
1028
- async: !!this["~standard"].async
1029
- },
1030
- path: [],
1031
- schemaErrorMap: this._def.errorMap,
1032
- parent: null,
1033
- data: e,
1034
- parsedType: te(e)
1035
- };
1036
- if (!this["~standard"].async)
1037
- try {
1038
- const a = this._parseSync({ data: e, path: [], parent: n });
1039
- return me(a) ? {
1040
- value: a.value
1041
- } : {
1042
- issues: n.common.issues
1043
- };
1044
- } catch (a) {
1045
- !((s = (r = a?.message) === null || r === void 0 ? void 0 : r.toLowerCase()) === null || s === void 0) && s.includes("encountered") && (this["~standard"].async = !0), n.common = {
1046
- issues: [],
1047
- async: !0
1048
- };
1049
- }
1050
- return this._parseAsync({ data: e, path: [], parent: n }).then((a) => me(a) ? {
1051
- value: a.value
1052
- } : {
1053
- issues: n.common.issues
1054
- });
1055
- }
1056
- async parseAsync(e, r) {
1057
- const s = await this.safeParseAsync(e, r);
1058
- if (s.success)
1059
- return s.data;
1060
- throw s.error;
1061
- }
1062
- async safeParseAsync(e, r) {
1063
- const s = {
1064
- common: {
1065
- issues: [],
1066
- contextualErrorMap: r?.errorMap,
1067
- async: !0
1068
- },
1069
- path: r?.path || [],
1070
- schemaErrorMap: this._def.errorMap,
1071
- parent: null,
1072
- data: e,
1073
- parsedType: te(e)
1074
- }, n = this._parse({ data: e, path: s.path, parent: s }), a = await (Ee(n) ? n : Promise.resolve(n));
1075
- return Lt(s, a);
1076
- }
1077
- refine(e, r) {
1078
- const s = (n) => typeof r == "string" || typeof r > "u" ? { message: r } : typeof r == "function" ? r(n) : r;
1079
- return this._refinement((n, a) => {
1080
- const o = e(n), c = () => a.addIssue({
1081
- code: l.custom,
1082
- ...s(n)
1083
- });
1084
- return typeof Promise < "u" && o instanceof Promise ? o.then((u) => u ? !0 : (c(), !1)) : o ? !0 : (c(), !1);
1085
- });
1086
- }
1087
- refinement(e, r) {
1088
- return this._refinement((s, n) => e(s) ? !0 : (n.addIssue(typeof r == "function" ? r(s, n) : r), !1));
1089
- }
1090
- _refinement(e) {
1091
- return new U({
1092
- schema: this,
1093
- typeName: y.ZodEffects,
1094
- effect: { type: "refinement", refinement: e }
1095
- });
1096
- }
1097
- superRefine(e) {
1098
- return this._refinement(e);
1099
- }
1100
- constructor(e) {
1101
- this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this), this["~standard"] = {
1102
- version: 1,
1103
- vendor: "zod",
1104
- validate: (r) => this["~validate"](r)
1105
- };
1106
- }
1107
- optional() {
1108
- return W.create(this, this._def);
1109
- }
1110
- nullable() {
1111
- return le.create(this, this._def);
1112
- }
1113
- nullish() {
1114
- return this.nullable().optional();
1115
- }
1116
- array() {
1117
- return V.create(this);
1118
- }
1119
- promise() {
1120
- return Te.create(this, this._def);
1121
- }
1122
- or(e) {
1123
- return Re.create([this, e], this._def);
1124
- }
1125
- and(e) {
1126
- return Me.create(this, e, this._def);
1127
- }
1128
- transform(e) {
1129
- return new U({
1130
- ...j(this._def),
1131
- schema: this,
1132
- typeName: y.ZodEffects,
1133
- effect: { type: "transform", transform: e }
1134
- });
1135
- }
1136
- default(e) {
1137
- const r = typeof e == "function" ? e : () => e;
1138
- return new ze({
1139
- ...j(this._def),
1140
- innerType: this,
1141
- defaultValue: r,
1142
- typeName: y.ZodDefault
1143
- });
1144
- }
1145
- brand() {
1146
- return new St({
1147
- typeName: y.ZodBranded,
1148
- type: this,
1149
- ...j(this._def)
1150
- });
1151
- }
1152
- catch(e) {
1153
- const r = typeof e == "function" ? e : () => e;
1154
- return new qe({
1155
- ...j(this._def),
1156
- innerType: this,
1157
- catchValue: r,
1158
- typeName: y.ZodCatch
1159
- });
1160
- }
1161
- describe(e) {
1162
- const r = this.constructor;
1163
- return new r({
1164
- ...this._def,
1165
- description: e
1166
- });
1167
- }
1168
- pipe(e) {
1169
- return Le.create(this, e);
1170
- }
1171
- readonly() {
1172
- return Fe.create(this);
1173
- }
1174
- isOptional() {
1175
- return this.safeParse(void 0).success;
1176
- }
1177
- isNullable() {
1178
- return this.safeParse(null).success;
1179
- }
1180
- }
1181
- const $n = /^c[^\s-]{8,}$/i, Dn = /^[0-9a-z]+$/, zn = /^[0-9A-HJKMNP-TV-Z]{26}$/i, qn = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Fn = /^[a-z0-9_-]{21}$/i, Ln = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Bn = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Vn = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Un = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
1182
- let ft;
1183
- const Qn = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Hn = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Wn = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Yn = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Kn = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Gn = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, br = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Jn = new RegExp(`^${br}$`);
1184
- function wr(t) {
1185
- let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
1186
- return t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`), e;
1187
- }
1188
- function Xn(t) {
1189
- return new RegExp(`^${wr(t)}$`);
1190
- }
1191
- function kr(t) {
1192
- let e = `${br}T${wr(t)}`;
1193
- const r = [];
1194
- return r.push(t.local ? "Z?" : "Z"), t.offset && r.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${r.join("|")})`, new RegExp(`^${e}$`);
1195
- }
1196
- function ea(t, e) {
1197
- return !!((e === "v4" || !e) && Qn.test(t) || (e === "v6" || !e) && Wn.test(t));
1198
- }
1199
- function ta(t, e) {
1200
- if (!Ln.test(t))
1201
- return !1;
1202
- try {
1203
- const [r] = t.split("."), s = r.replace(/-/g, "+").replace(/_/g, "/").padEnd(r.length + (4 - r.length % 4) % 4, "="), n = JSON.parse(atob(s));
1204
- return !(typeof n != "object" || n === null || !n.typ || !n.alg || e && n.alg !== e);
1205
- } catch {
1206
- return !1;
1207
- }
1208
- }
1209
- function ra(t, e) {
1210
- return !!((e === "v4" || !e) && Hn.test(t) || (e === "v6" || !e) && Yn.test(t));
1211
- }
1212
- class B extends T {
1213
- _parse(e) {
1214
- if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== p.string) {
1215
- const a = this._getOrReturnCtx(e);
1216
- return h(a, {
1217
- code: l.invalid_type,
1218
- expected: p.string,
1219
- received: a.parsedType
1220
- }), x;
1221
- }
1222
- const s = new Z();
1223
- let n;
1224
- for (const a of this._def.checks)
1225
- if (a.kind === "min")
1226
- e.data.length < a.value && (n = this._getOrReturnCtx(e, n), h(n, {
1227
- code: l.too_small,
1228
- minimum: a.value,
1229
- type: "string",
1230
- inclusive: !0,
1231
- exact: !1,
1232
- message: a.message
1233
- }), s.dirty());
1234
- else if (a.kind === "max")
1235
- e.data.length > a.value && (n = this._getOrReturnCtx(e, n), h(n, {
1236
- code: l.too_big,
1237
- maximum: a.value,
1238
- type: "string",
1239
- inclusive: !0,
1240
- exact: !1,
1241
- message: a.message
1242
- }), s.dirty());
1243
- else if (a.kind === "length") {
1244
- const o = e.data.length > a.value, c = e.data.length < a.value;
1245
- (o || c) && (n = this._getOrReturnCtx(e, n), o ? h(n, {
1246
- code: l.too_big,
1247
- maximum: a.value,
1248
- type: "string",
1249
- inclusive: !0,
1250
- exact: !0,
1251
- message: a.message
1252
- }) : c && h(n, {
1253
- code: l.too_small,
1254
- minimum: a.value,
1255
- type: "string",
1256
- inclusive: !0,
1257
- exact: !0,
1258
- message: a.message
1259
- }), s.dirty());
1260
- } else if (a.kind === "email")
1261
- Vn.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1262
- validation: "email",
1263
- code: l.invalid_string,
1264
- message: a.message
1265
- }), s.dirty());
1266
- else if (a.kind === "emoji")
1267
- ft || (ft = new RegExp(Un, "u")), ft.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1268
- validation: "emoji",
1269
- code: l.invalid_string,
1270
- message: a.message
1271
- }), s.dirty());
1272
- else if (a.kind === "uuid")
1273
- qn.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1274
- validation: "uuid",
1275
- code: l.invalid_string,
1276
- message: a.message
1277
- }), s.dirty());
1278
- else if (a.kind === "nanoid")
1279
- Fn.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1280
- validation: "nanoid",
1281
- code: l.invalid_string,
1282
- message: a.message
1283
- }), s.dirty());
1284
- else if (a.kind === "cuid")
1285
- $n.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1286
- validation: "cuid",
1287
- code: l.invalid_string,
1288
- message: a.message
1289
- }), s.dirty());
1290
- else if (a.kind === "cuid2")
1291
- Dn.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1292
- validation: "cuid2",
1293
- code: l.invalid_string,
1294
- message: a.message
1295
- }), s.dirty());
1296
- else if (a.kind === "ulid")
1297
- zn.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1298
- validation: "ulid",
1299
- code: l.invalid_string,
1300
- message: a.message
1301
- }), s.dirty());
1302
- else if (a.kind === "url")
1303
- try {
1304
- new URL(e.data);
1305
- } catch {
1306
- n = this._getOrReturnCtx(e, n), h(n, {
1307
- validation: "url",
1308
- code: l.invalid_string,
1309
- message: a.message
1310
- }), s.dirty();
1311
- }
1312
- else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1313
- validation: "regex",
1314
- code: l.invalid_string,
1315
- message: a.message
1316
- }), s.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (n = this._getOrReturnCtx(e, n), h(n, {
1317
- code: l.invalid_string,
1318
- validation: { includes: a.value, position: a.position },
1319
- message: a.message
1320
- }), s.dirty()) : a.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : a.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : a.kind === "startsWith" ? e.data.startsWith(a.value) || (n = this._getOrReturnCtx(e, n), h(n, {
1321
- code: l.invalid_string,
1322
- validation: { startsWith: a.value },
1323
- message: a.message
1324
- }), s.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (n = this._getOrReturnCtx(e, n), h(n, {
1325
- code: l.invalid_string,
1326
- validation: { endsWith: a.value },
1327
- message: a.message
1328
- }), s.dirty()) : a.kind === "datetime" ? kr(a).test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1329
- code: l.invalid_string,
1330
- validation: "datetime",
1331
- message: a.message
1332
- }), s.dirty()) : a.kind === "date" ? Jn.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1333
- code: l.invalid_string,
1334
- validation: "date",
1335
- message: a.message
1336
- }), s.dirty()) : a.kind === "time" ? Xn(a).test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1337
- code: l.invalid_string,
1338
- validation: "time",
1339
- message: a.message
1340
- }), s.dirty()) : a.kind === "duration" ? Bn.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1341
- validation: "duration",
1342
- code: l.invalid_string,
1343
- message: a.message
1344
- }), s.dirty()) : a.kind === "ip" ? ea(e.data, a.version) || (n = this._getOrReturnCtx(e, n), h(n, {
1345
- validation: "ip",
1346
- code: l.invalid_string,
1347
- message: a.message
1348
- }), s.dirty()) : a.kind === "jwt" ? ta(e.data, a.alg) || (n = this._getOrReturnCtx(e, n), h(n, {
1349
- validation: "jwt",
1350
- code: l.invalid_string,
1351
- message: a.message
1352
- }), s.dirty()) : a.kind === "cidr" ? ra(e.data, a.version) || (n = this._getOrReturnCtx(e, n), h(n, {
1353
- validation: "cidr",
1354
- code: l.invalid_string,
1355
- message: a.message
1356
- }), s.dirty()) : a.kind === "base64" ? Kn.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1357
- validation: "base64",
1358
- code: l.invalid_string,
1359
- message: a.message
1360
- }), s.dirty()) : a.kind === "base64url" ? Gn.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1361
- validation: "base64url",
1362
- code: l.invalid_string,
1363
- message: a.message
1364
- }), s.dirty()) : S.assertNever(a);
1365
- return { status: s.value, value: e.data };
1366
- }
1367
- _regex(e, r, s) {
1368
- return this.refinement((n) => e.test(n), {
1369
- validation: r,
1370
- code: l.invalid_string,
1371
- ...g.errToObj(s)
1372
- });
1373
- }
1374
- _addCheck(e) {
1375
- return new B({
1376
- ...this._def,
1377
- checks: [...this._def.checks, e]
1378
- });
1379
- }
1380
- email(e) {
1381
- return this._addCheck({ kind: "email", ...g.errToObj(e) });
1382
- }
1383
- url(e) {
1384
- return this._addCheck({ kind: "url", ...g.errToObj(e) });
1385
- }
1386
- emoji(e) {
1387
- return this._addCheck({ kind: "emoji", ...g.errToObj(e) });
1388
- }
1389
- uuid(e) {
1390
- return this._addCheck({ kind: "uuid", ...g.errToObj(e) });
1391
- }
1392
- nanoid(e) {
1393
- return this._addCheck({ kind: "nanoid", ...g.errToObj(e) });
1394
- }
1395
- cuid(e) {
1396
- return this._addCheck({ kind: "cuid", ...g.errToObj(e) });
1397
- }
1398
- cuid2(e) {
1399
- return this._addCheck({ kind: "cuid2", ...g.errToObj(e) });
1400
- }
1401
- ulid(e) {
1402
- return this._addCheck({ kind: "ulid", ...g.errToObj(e) });
1403
- }
1404
- base64(e) {
1405
- return this._addCheck({ kind: "base64", ...g.errToObj(e) });
1406
- }
1407
- base64url(e) {
1408
- return this._addCheck({
1409
- kind: "base64url",
1410
- ...g.errToObj(e)
1411
- });
1412
- }
1413
- jwt(e) {
1414
- return this._addCheck({ kind: "jwt", ...g.errToObj(e) });
1415
- }
1416
- ip(e) {
1417
- return this._addCheck({ kind: "ip", ...g.errToObj(e) });
1418
- }
1419
- cidr(e) {
1420
- return this._addCheck({ kind: "cidr", ...g.errToObj(e) });
1421
- }
1422
- datetime(e) {
1423
- var r, s;
1424
- return typeof e == "string" ? this._addCheck({
1425
- kind: "datetime",
1426
- precision: null,
1427
- offset: !1,
1428
- local: !1,
1429
- message: e
1430
- }) : this._addCheck({
1431
- kind: "datetime",
1432
- precision: typeof e?.precision > "u" ? null : e?.precision,
1433
- offset: (r = e?.offset) !== null && r !== void 0 ? r : !1,
1434
- local: (s = e?.local) !== null && s !== void 0 ? s : !1,
1435
- ...g.errToObj(e?.message)
1436
- });
1437
- }
1438
- date(e) {
1439
- return this._addCheck({ kind: "date", message: e });
1440
- }
1441
- time(e) {
1442
- return typeof e == "string" ? this._addCheck({
1443
- kind: "time",
1444
- precision: null,
1445
- message: e
1446
- }) : this._addCheck({
1447
- kind: "time",
1448
- precision: typeof e?.precision > "u" ? null : e?.precision,
1449
- ...g.errToObj(e?.message)
1450
- });
1451
- }
1452
- duration(e) {
1453
- return this._addCheck({ kind: "duration", ...g.errToObj(e) });
1454
- }
1455
- regex(e, r) {
1456
- return this._addCheck({
1457
- kind: "regex",
1458
- regex: e,
1459
- ...g.errToObj(r)
1460
- });
1461
- }
1462
- includes(e, r) {
1463
- return this._addCheck({
1464
- kind: "includes",
1465
- value: e,
1466
- position: r?.position,
1467
- ...g.errToObj(r?.message)
1468
- });
1469
- }
1470
- startsWith(e, r) {
1471
- return this._addCheck({
1472
- kind: "startsWith",
1473
- value: e,
1474
- ...g.errToObj(r)
1475
- });
1476
- }
1477
- endsWith(e, r) {
1478
- return this._addCheck({
1479
- kind: "endsWith",
1480
- value: e,
1481
- ...g.errToObj(r)
1482
- });
1483
- }
1484
- min(e, r) {
1485
- return this._addCheck({
1486
- kind: "min",
1487
- value: e,
1488
- ...g.errToObj(r)
1489
- });
1490
- }
1491
- max(e, r) {
1492
- return this._addCheck({
1493
- kind: "max",
1494
- value: e,
1495
- ...g.errToObj(r)
1496
- });
1497
- }
1498
- length(e, r) {
1499
- return this._addCheck({
1500
- kind: "length",
1501
- value: e,
1502
- ...g.errToObj(r)
1503
- });
1504
- }
1505
- /**
1506
- * Equivalent to `.min(1)`
1507
- */
1508
- nonempty(e) {
1509
- return this.min(1, g.errToObj(e));
1510
- }
1511
- trim() {
1512
- return new B({
1513
- ...this._def,
1514
- checks: [...this._def.checks, { kind: "trim" }]
1515
- });
1516
- }
1517
- toLowerCase() {
1518
- return new B({
1519
- ...this._def,
1520
- checks: [...this._def.checks, { kind: "toLowerCase" }]
1521
- });
1522
- }
1523
- toUpperCase() {
1524
- return new B({
1525
- ...this._def,
1526
- checks: [...this._def.checks, { kind: "toUpperCase" }]
1527
- });
1528
- }
1529
- get isDatetime() {
1530
- return !!this._def.checks.find((e) => e.kind === "datetime");
1531
- }
1532
- get isDate() {
1533
- return !!this._def.checks.find((e) => e.kind === "date");
1534
- }
1535
- get isTime() {
1536
- return !!this._def.checks.find((e) => e.kind === "time");
1537
- }
1538
- get isDuration() {
1539
- return !!this._def.checks.find((e) => e.kind === "duration");
1540
- }
1541
- get isEmail() {
1542
- return !!this._def.checks.find((e) => e.kind === "email");
1543
- }
1544
- get isURL() {
1545
- return !!this._def.checks.find((e) => e.kind === "url");
1546
- }
1547
- get isEmoji() {
1548
- return !!this._def.checks.find((e) => e.kind === "emoji");
1549
- }
1550
- get isUUID() {
1551
- return !!this._def.checks.find((e) => e.kind === "uuid");
1552
- }
1553
- get isNANOID() {
1554
- return !!this._def.checks.find((e) => e.kind === "nanoid");
1555
- }
1556
- get isCUID() {
1557
- return !!this._def.checks.find((e) => e.kind === "cuid");
1558
- }
1559
- get isCUID2() {
1560
- return !!this._def.checks.find((e) => e.kind === "cuid2");
1561
- }
1562
- get isULID() {
1563
- return !!this._def.checks.find((e) => e.kind === "ulid");
1564
- }
1565
- get isIP() {
1566
- return !!this._def.checks.find((e) => e.kind === "ip");
1567
- }
1568
- get isCIDR() {
1569
- return !!this._def.checks.find((e) => e.kind === "cidr");
1570
- }
1571
- get isBase64() {
1572
- return !!this._def.checks.find((e) => e.kind === "base64");
1573
- }
1574
- get isBase64url() {
1575
- return !!this._def.checks.find((e) => e.kind === "base64url");
1576
- }
1577
- get minLength() {
1578
- let e = null;
1579
- for (const r of this._def.checks)
1580
- r.kind === "min" && (e === null || r.value > e) && (e = r.value);
1581
- return e;
1582
- }
1583
- get maxLength() {
1584
- let e = null;
1585
- for (const r of this._def.checks)
1586
- r.kind === "max" && (e === null || r.value < e) && (e = r.value);
1587
- return e;
1588
- }
1589
- }
1590
- B.create = (t) => {
1591
- var e;
1592
- return new B({
1593
- checks: [],
1594
- typeName: y.ZodString,
1595
- coerce: (e = t?.coerce) !== null && e !== void 0 ? e : !1,
1596
- ...j(t)
1597
- });
1598
- };
1599
- function sa(t, e) {
1600
- const r = (t.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, n = r > s ? r : s, a = parseInt(t.toFixed(n).replace(".", "")), o = parseInt(e.toFixed(n).replace(".", ""));
1601
- return a % o / Math.pow(10, n);
1602
- }
1603
- class ce extends T {
1604
- constructor() {
1605
- super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
1606
- }
1607
- _parse(e) {
1608
- if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== p.number) {
1609
- const a = this._getOrReturnCtx(e);
1610
- return h(a, {
1611
- code: l.invalid_type,
1612
- expected: p.number,
1613
- received: a.parsedType
1614
- }), x;
1615
- }
1616
- let s;
1617
- const n = new Z();
1618
- for (const a of this._def.checks)
1619
- a.kind === "int" ? S.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
1620
- code: l.invalid_type,
1621
- expected: "integer",
1622
- received: "float",
1623
- message: a.message
1624
- }), n.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), h(s, {
1625
- code: l.too_small,
1626
- minimum: a.value,
1627
- type: "number",
1628
- inclusive: a.inclusive,
1629
- exact: !1,
1630
- message: a.message
1631
- }), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), h(s, {
1632
- code: l.too_big,
1633
- maximum: a.value,
1634
- type: "number",
1635
- inclusive: a.inclusive,
1636
- exact: !1,
1637
- message: a.message
1638
- }), n.dirty()) : a.kind === "multipleOf" ? sa(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), h(s, {
1639
- code: l.not_multiple_of,
1640
- multipleOf: a.value,
1641
- message: a.message
1642
- }), n.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
1643
- code: l.not_finite,
1644
- message: a.message
1645
- }), n.dirty()) : S.assertNever(a);
1646
- return { status: n.value, value: e.data };
1647
- }
1648
- gte(e, r) {
1649
- return this.setLimit("min", e, !0, g.toString(r));
1650
- }
1651
- gt(e, r) {
1652
- return this.setLimit("min", e, !1, g.toString(r));
1653
- }
1654
- lte(e, r) {
1655
- return this.setLimit("max", e, !0, g.toString(r));
1656
- }
1657
- lt(e, r) {
1658
- return this.setLimit("max", e, !1, g.toString(r));
1659
- }
1660
- setLimit(e, r, s, n) {
1661
- return new ce({
1662
- ...this._def,
1663
- checks: [
1664
- ...this._def.checks,
1665
- {
1666
- kind: e,
1667
- value: r,
1668
- inclusive: s,
1669
- message: g.toString(n)
1670
- }
1671
- ]
1672
- });
1673
- }
1674
- _addCheck(e) {
1675
- return new ce({
1676
- ...this._def,
1677
- checks: [...this._def.checks, e]
1678
- });
1679
- }
1680
- int(e) {
1681
- return this._addCheck({
1682
- kind: "int",
1683
- message: g.toString(e)
1684
- });
1685
- }
1686
- positive(e) {
1687
- return this._addCheck({
1688
- kind: "min",
1689
- value: 0,
1690
- inclusive: !1,
1691
- message: g.toString(e)
1692
- });
1693
- }
1694
- negative(e) {
1695
- return this._addCheck({
1696
- kind: "max",
1697
- value: 0,
1698
- inclusive: !1,
1699
- message: g.toString(e)
1700
- });
1701
- }
1702
- nonpositive(e) {
1703
- return this._addCheck({
1704
- kind: "max",
1705
- value: 0,
1706
- inclusive: !0,
1707
- message: g.toString(e)
1708
- });
1709
- }
1710
- nonnegative(e) {
1711
- return this._addCheck({
1712
- kind: "min",
1713
- value: 0,
1714
- inclusive: !0,
1715
- message: g.toString(e)
1716
- });
1717
- }
1718
- multipleOf(e, r) {
1719
- return this._addCheck({
1720
- kind: "multipleOf",
1721
- value: e,
1722
- message: g.toString(r)
1723
- });
1724
- }
1725
- finite(e) {
1726
- return this._addCheck({
1727
- kind: "finite",
1728
- message: g.toString(e)
1729
- });
1730
- }
1731
- safe(e) {
1732
- return this._addCheck({
1733
- kind: "min",
1734
- inclusive: !0,
1735
- value: Number.MIN_SAFE_INTEGER,
1736
- message: g.toString(e)
1737
- })._addCheck({
1738
- kind: "max",
1739
- inclusive: !0,
1740
- value: Number.MAX_SAFE_INTEGER,
1741
- message: g.toString(e)
1742
- });
1743
- }
1744
- get minValue() {
1745
- let e = null;
1746
- for (const r of this._def.checks)
1747
- r.kind === "min" && (e === null || r.value > e) && (e = r.value);
1748
- return e;
1749
- }
1750
- get maxValue() {
1751
- let e = null;
1752
- for (const r of this._def.checks)
1753
- r.kind === "max" && (e === null || r.value < e) && (e = r.value);
1754
- return e;
1755
- }
1756
- get isInt() {
1757
- return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && S.isInteger(e.value));
1758
- }
1759
- get isFinite() {
1760
- let e = null, r = null;
1761
- for (const s of this._def.checks) {
1762
- if (s.kind === "finite" || s.kind === "int" || s.kind === "multipleOf")
1763
- return !0;
1764
- s.kind === "min" ? (r === null || s.value > r) && (r = s.value) : s.kind === "max" && (e === null || s.value < e) && (e = s.value);
1765
- }
1766
- return Number.isFinite(r) && Number.isFinite(e);
1767
- }
1768
- }
1769
- ce.create = (t) => new ce({
1770
- checks: [],
1771
- typeName: y.ZodNumber,
1772
- coerce: t?.coerce || !1,
1773
- ...j(t)
1774
- });
1775
- class de extends T {
1776
- constructor() {
1777
- super(...arguments), this.min = this.gte, this.max = this.lte;
1778
- }
1779
- _parse(e) {
1780
- if (this._def.coerce)
1781
- try {
1782
- e.data = BigInt(e.data);
1783
- } catch {
1784
- return this._getInvalidInput(e);
1785
- }
1786
- if (this._getType(e) !== p.bigint)
1787
- return this._getInvalidInput(e);
1788
- let s;
1789
- const n = new Z();
1790
- for (const a of this._def.checks)
1791
- a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), h(s, {
1792
- code: l.too_small,
1793
- type: "bigint",
1794
- minimum: a.value,
1795
- inclusive: a.inclusive,
1796
- message: a.message
1797
- }), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), h(s, {
1798
- code: l.too_big,
1799
- type: "bigint",
1800
- maximum: a.value,
1801
- inclusive: a.inclusive,
1802
- message: a.message
1803
- }), n.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (s = this._getOrReturnCtx(e, s), h(s, {
1804
- code: l.not_multiple_of,
1805
- multipleOf: a.value,
1806
- message: a.message
1807
- }), n.dirty()) : S.assertNever(a);
1808
- return { status: n.value, value: e.data };
1809
- }
1810
- _getInvalidInput(e) {
1811
- const r = this._getOrReturnCtx(e);
1812
- return h(r, {
1813
- code: l.invalid_type,
1814
- expected: p.bigint,
1815
- received: r.parsedType
1816
- }), x;
1817
- }
1818
- gte(e, r) {
1819
- return this.setLimit("min", e, !0, g.toString(r));
1820
- }
1821
- gt(e, r) {
1822
- return this.setLimit("min", e, !1, g.toString(r));
1823
- }
1824
- lte(e, r) {
1825
- return this.setLimit("max", e, !0, g.toString(r));
1826
- }
1827
- lt(e, r) {
1828
- return this.setLimit("max", e, !1, g.toString(r));
1829
- }
1830
- setLimit(e, r, s, n) {
1831
- return new de({
1832
- ...this._def,
1833
- checks: [
1834
- ...this._def.checks,
1835
- {
1836
- kind: e,
1837
- value: r,
1838
- inclusive: s,
1839
- message: g.toString(n)
1840
- }
1841
- ]
1842
- });
1843
- }
1844
- _addCheck(e) {
1845
- return new de({
1846
- ...this._def,
1847
- checks: [...this._def.checks, e]
1848
- });
1849
- }
1850
- positive(e) {
1851
- return this._addCheck({
1852
- kind: "min",
1853
- value: BigInt(0),
1854
- inclusive: !1,
1855
- message: g.toString(e)
1856
- });
1857
- }
1858
- negative(e) {
1859
- return this._addCheck({
1860
- kind: "max",
1861
- value: BigInt(0),
1862
- inclusive: !1,
1863
- message: g.toString(e)
1864
- });
1865
- }
1866
- nonpositive(e) {
1867
- return this._addCheck({
1868
- kind: "max",
1869
- value: BigInt(0),
1870
- inclusive: !0,
1871
- message: g.toString(e)
1872
- });
1873
- }
1874
- nonnegative(e) {
1875
- return this._addCheck({
1876
- kind: "min",
1877
- value: BigInt(0),
1878
- inclusive: !0,
1879
- message: g.toString(e)
1880
- });
1881
- }
1882
- multipleOf(e, r) {
1883
- return this._addCheck({
1884
- kind: "multipleOf",
1885
- value: e,
1886
- message: g.toString(r)
1887
- });
1888
- }
1889
- get minValue() {
1890
- let e = null;
1891
- for (const r of this._def.checks)
1892
- r.kind === "min" && (e === null || r.value > e) && (e = r.value);
1893
- return e;
1894
- }
1895
- get maxValue() {
1896
- let e = null;
1897
- for (const r of this._def.checks)
1898
- r.kind === "max" && (e === null || r.value < e) && (e = r.value);
1899
- return e;
1900
- }
1901
- }
1902
- de.create = (t) => {
1903
- var e;
1904
- return new de({
1905
- checks: [],
1906
- typeName: y.ZodBigInt,
1907
- coerce: (e = t?.coerce) !== null && e !== void 0 ? e : !1,
1908
- ...j(t)
1909
- });
1910
- };
1911
- class Oe extends T {
1912
- _parse(e) {
1913
- if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== p.boolean) {
1914
- const s = this._getOrReturnCtx(e);
1915
- return h(s, {
1916
- code: l.invalid_type,
1917
- expected: p.boolean,
1918
- received: s.parsedType
1919
- }), x;
1920
- }
1921
- return D(e.data);
1922
- }
1923
- }
1924
- Oe.create = (t) => new Oe({
1925
- typeName: y.ZodBoolean,
1926
- coerce: t?.coerce || !1,
1927
- ...j(t)
1928
- });
1929
- class pe extends T {
1930
- _parse(e) {
1931
- if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== p.date) {
1932
- const a = this._getOrReturnCtx(e);
1933
- return h(a, {
1934
- code: l.invalid_type,
1935
- expected: p.date,
1936
- received: a.parsedType
1937
- }), x;
1938
- }
1939
- if (isNaN(e.data.getTime())) {
1940
- const a = this._getOrReturnCtx(e);
1941
- return h(a, {
1942
- code: l.invalid_date
1943
- }), x;
1944
- }
1945
- const s = new Z();
1946
- let n;
1947
- for (const a of this._def.checks)
1948
- a.kind === "min" ? e.data.getTime() < a.value && (n = this._getOrReturnCtx(e, n), h(n, {
1949
- code: l.too_small,
1950
- message: a.message,
1951
- inclusive: !0,
1952
- exact: !1,
1953
- minimum: a.value,
1954
- type: "date"
1955
- }), s.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (n = this._getOrReturnCtx(e, n), h(n, {
1956
- code: l.too_big,
1957
- message: a.message,
1958
- inclusive: !0,
1959
- exact: !1,
1960
- maximum: a.value,
1961
- type: "date"
1962
- }), s.dirty()) : S.assertNever(a);
1963
- return {
1964
- status: s.value,
1965
- value: new Date(e.data.getTime())
1966
- };
1967
- }
1968
- _addCheck(e) {
1969
- return new pe({
1970
- ...this._def,
1971
- checks: [...this._def.checks, e]
1972
- });
1973
- }
1974
- min(e, r) {
1975
- return this._addCheck({
1976
- kind: "min",
1977
- value: e.getTime(),
1978
- message: g.toString(r)
1979
- });
1980
- }
1981
- max(e, r) {
1982
- return this._addCheck({
1983
- kind: "max",
1984
- value: e.getTime(),
1985
- message: g.toString(r)
1986
- });
1987
- }
1988
- get minDate() {
1989
- let e = null;
1990
- for (const r of this._def.checks)
1991
- r.kind === "min" && (e === null || r.value > e) && (e = r.value);
1992
- return e != null ? new Date(e) : null;
1993
- }
1994
- get maxDate() {
1995
- let e = null;
1996
- for (const r of this._def.checks)
1997
- r.kind === "max" && (e === null || r.value < e) && (e = r.value);
1998
- return e != null ? new Date(e) : null;
1999
- }
2000
- }
2001
- pe.create = (t) => new pe({
2002
- checks: [],
2003
- coerce: t?.coerce || !1,
2004
- typeName: y.ZodDate,
2005
- ...j(t)
2006
- });
2007
- class Xe extends T {
2008
- _parse(e) {
2009
- if (this._getType(e) !== p.symbol) {
2010
- const s = this._getOrReturnCtx(e);
2011
- return h(s, {
2012
- code: l.invalid_type,
2013
- expected: p.symbol,
2014
- received: s.parsedType
2015
- }), x;
2016
- }
2017
- return D(e.data);
2018
- }
2019
- }
2020
- Xe.create = (t) => new Xe({
2021
- typeName: y.ZodSymbol,
2022
- ...j(t)
2023
- });
2024
- class Ae extends T {
2025
- _parse(e) {
2026
- if (this._getType(e) !== p.undefined) {
2027
- const s = this._getOrReturnCtx(e);
2028
- return h(s, {
2029
- code: l.invalid_type,
2030
- expected: p.undefined,
2031
- received: s.parsedType
2032
- }), x;
2033
- }
2034
- return D(e.data);
2035
- }
2036
- }
2037
- Ae.create = (t) => new Ae({
2038
- typeName: y.ZodUndefined,
2039
- ...j(t)
2040
- });
2041
- class Pe extends T {
2042
- _parse(e) {
2043
- if (this._getType(e) !== p.null) {
2044
- const s = this._getOrReturnCtx(e);
2045
- return h(s, {
2046
- code: l.invalid_type,
2047
- expected: p.null,
2048
- received: s.parsedType
2049
- }), x;
2050
- }
2051
- return D(e.data);
2052
- }
2053
- }
2054
- Pe.create = (t) => new Pe({
2055
- typeName: y.ZodNull,
2056
- ...j(t)
2057
- });
2058
- class je extends T {
2059
- constructor() {
2060
- super(...arguments), this._any = !0;
2061
- }
2062
- _parse(e) {
2063
- return D(e.data);
2064
- }
2065
- }
2066
- je.create = (t) => new je({
2067
- typeName: y.ZodAny,
2068
- ...j(t)
2069
- });
2070
- class he extends T {
2071
- constructor() {
2072
- super(...arguments), this._unknown = !0;
2073
- }
2074
- _parse(e) {
2075
- return D(e.data);
2076
- }
2077
- }
2078
- he.create = (t) => new he({
2079
- typeName: y.ZodUnknown,
2080
- ...j(t)
2081
- });
2082
- class se extends T {
2083
- _parse(e) {
2084
- const r = this._getOrReturnCtx(e);
2085
- return h(r, {
2086
- code: l.invalid_type,
2087
- expected: p.never,
2088
- received: r.parsedType
2089
- }), x;
2090
- }
2091
- }
2092
- se.create = (t) => new se({
2093
- typeName: y.ZodNever,
2094
- ...j(t)
2095
- });
2096
- class et extends T {
2097
- _parse(e) {
2098
- if (this._getType(e) !== p.undefined) {
2099
- const s = this._getOrReturnCtx(e);
2100
- return h(s, {
2101
- code: l.invalid_type,
2102
- expected: p.void,
2103
- received: s.parsedType
2104
- }), x;
2105
- }
2106
- return D(e.data);
2107
- }
2108
- }
2109
- et.create = (t) => new et({
2110
- typeName: y.ZodVoid,
2111
- ...j(t)
2112
- });
2113
- class V extends T {
2114
- _parse(e) {
2115
- const { ctx: r, status: s } = this._processInputParams(e), n = this._def;
2116
- if (r.parsedType !== p.array)
2117
- return h(r, {
2118
- code: l.invalid_type,
2119
- expected: p.array,
2120
- received: r.parsedType
2121
- }), x;
2122
- if (n.exactLength !== null) {
2123
- const o = r.data.length > n.exactLength.value, c = r.data.length < n.exactLength.value;
2124
- (o || c) && (h(r, {
2125
- code: o ? l.too_big : l.too_small,
2126
- minimum: c ? n.exactLength.value : void 0,
2127
- maximum: o ? n.exactLength.value : void 0,
2128
- type: "array",
2129
- inclusive: !0,
2130
- exact: !0,
2131
- message: n.exactLength.message
2132
- }), s.dirty());
2133
- }
2134
- if (n.minLength !== null && r.data.length < n.minLength.value && (h(r, {
2135
- code: l.too_small,
2136
- minimum: n.minLength.value,
2137
- type: "array",
2138
- inclusive: !0,
2139
- exact: !1,
2140
- message: n.minLength.message
2141
- }), s.dirty()), n.maxLength !== null && r.data.length > n.maxLength.value && (h(r, {
2142
- code: l.too_big,
2143
- maximum: n.maxLength.value,
2144
- type: "array",
2145
- inclusive: !0,
2146
- exact: !1,
2147
- message: n.maxLength.message
2148
- }), s.dirty()), r.common.async)
2149
- return Promise.all([...r.data].map((o, c) => n.type._parseAsync(new Y(r, o, r.path, c)))).then((o) => Z.mergeArray(s, o));
2150
- const a = [...r.data].map((o, c) => n.type._parseSync(new Y(r, o, r.path, c)));
2151
- return Z.mergeArray(s, a);
2152
- }
2153
- get element() {
2154
- return this._def.type;
2155
- }
2156
- min(e, r) {
2157
- return new V({
2158
- ...this._def,
2159
- minLength: { value: e, message: g.toString(r) }
2160
- });
2161
- }
2162
- max(e, r) {
2163
- return new V({
2164
- ...this._def,
2165
- maxLength: { value: e, message: g.toString(r) }
2166
- });
2167
- }
2168
- length(e, r) {
2169
- return new V({
2170
- ...this._def,
2171
- exactLength: { value: e, message: g.toString(r) }
2172
- });
2173
- }
2174
- nonempty(e) {
2175
- return this.min(1, e);
2176
- }
2177
- }
2178
- V.create = (t, e) => new V({
2179
- type: t,
2180
- minLength: null,
2181
- maxLength: null,
2182
- exactLength: null,
2183
- typeName: y.ZodArray,
2184
- ...j(e)
2185
- });
2186
- function xe(t) {
2187
- if (t instanceof R) {
2188
- const e = {};
2189
- for (const r in t.shape) {
2190
- const s = t.shape[r];
2191
- e[r] = W.create(xe(s));
2192
- }
2193
- return new R({
2194
- ...t._def,
2195
- shape: () => e
2196
- });
2197
- } else return t instanceof V ? new V({
2198
- ...t._def,
2199
- type: xe(t.element)
2200
- }) : t instanceof W ? W.create(xe(t.unwrap())) : t instanceof le ? le.create(xe(t.unwrap())) : t instanceof K ? K.create(t.items.map((e) => xe(e))) : t;
2201
- }
2202
- class R extends T {
2203
- constructor() {
2204
- super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
2205
- }
2206
- _getCached() {
2207
- if (this._cached !== null)
2208
- return this._cached;
2209
- const e = this._def.shape(), r = S.objectKeys(e);
2210
- return this._cached = { shape: e, keys: r };
2211
- }
2212
- _parse(e) {
2213
- if (this._getType(e) !== p.object) {
2214
- const d = this._getOrReturnCtx(e);
2215
- return h(d, {
2216
- code: l.invalid_type,
2217
- expected: p.object,
2218
- received: d.parsedType
2219
- }), x;
2220
- }
2221
- const { status: s, ctx: n } = this._processInputParams(e), { shape: a, keys: o } = this._getCached(), c = [];
2222
- if (!(this._def.catchall instanceof se && this._def.unknownKeys === "strip"))
2223
- for (const d in n.data)
2224
- o.includes(d) || c.push(d);
2225
- const u = [];
2226
- for (const d of o) {
2227
- const f = a[d], b = n.data[d];
2228
- u.push({
2229
- key: { status: "valid", value: d },
2230
- value: f._parse(new Y(n, b, n.path, d)),
2231
- alwaysSet: d in n.data
2232
- });
2233
- }
2234
- if (this._def.catchall instanceof se) {
2235
- const d = this._def.unknownKeys;
2236
- if (d === "passthrough")
2237
- for (const f of c)
2238
- u.push({
2239
- key: { status: "valid", value: f },
2240
- value: { status: "valid", value: n.data[f] }
2241
- });
2242
- else if (d === "strict")
2243
- c.length > 0 && (h(n, {
2244
- code: l.unrecognized_keys,
2245
- keys: c
2246
- }), s.dirty());
2247
- else if (d !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
2248
- } else {
2249
- const d = this._def.catchall;
2250
- for (const f of c) {
2251
- const b = n.data[f];
2252
- u.push({
2253
- key: { status: "valid", value: f },
2254
- value: d._parse(
2255
- new Y(n, b, n.path, f)
2256
- //, ctx.child(key), value, getParsedType(value)
2257
- ),
2258
- alwaysSet: f in n.data
2259
- });
2260
- }
2261
- }
2262
- return n.common.async ? Promise.resolve().then(async () => {
2263
- const d = [];
2264
- for (const f of u) {
2265
- const b = await f.key, k = await f.value;
2266
- d.push({
2267
- key: b,
2268
- value: k,
2269
- alwaysSet: f.alwaysSet
2270
- });
2271
- }
2272
- return d;
2273
- }).then((d) => Z.mergeObjectSync(s, d)) : Z.mergeObjectSync(s, u);
2274
- }
2275
- get shape() {
2276
- return this._def.shape();
2277
- }
2278
- strict(e) {
2279
- return g.errToObj, new R({
2280
- ...this._def,
2281
- unknownKeys: "strict",
2282
- ...e !== void 0 ? {
2283
- errorMap: (r, s) => {
2284
- var n, a, o, c;
2285
- const u = (o = (a = (n = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(n, r, s).message) !== null && o !== void 0 ? o : s.defaultError;
2286
- return r.code === "unrecognized_keys" ? {
2287
- message: (c = g.errToObj(e).message) !== null && c !== void 0 ? c : u
2288
- } : {
2289
- message: u
2290
- };
2291
- }
2292
- } : {}
2293
- });
2294
- }
2295
- strip() {
2296
- return new R({
2297
- ...this._def,
2298
- unknownKeys: "strip"
2299
- });
2300
- }
2301
- passthrough() {
2302
- return new R({
2303
- ...this._def,
2304
- unknownKeys: "passthrough"
2305
- });
2306
- }
2307
- // const AugmentFactory =
2308
- // <Def extends ZodObjectDef>(def: Def) =>
2309
- // <Augmentation extends ZodRawShape>(
2310
- // augmentation: Augmentation
2311
- // ): ZodObject<
2312
- // extendShape<ReturnType<Def["shape"]>, Augmentation>,
2313
- // Def["unknownKeys"],
2314
- // Def["catchall"]
2315
- // > => {
2316
- // return new ZodObject({
2317
- // ...def,
2318
- // shape: () => ({
2319
- // ...def.shape(),
2320
- // ...augmentation,
2321
- // }),
2322
- // }) as any;
2323
- // };
2324
- extend(e) {
2325
- return new R({
2326
- ...this._def,
2327
- shape: () => ({
2328
- ...this._def.shape(),
2329
- ...e
2330
- })
2331
- });
2332
- }
2333
- /**
2334
- * Prior to zod@1.0.12 there was a bug in the
2335
- * inferred type of merged objects. Please
2336
- * upgrade if you are experiencing issues.
2337
- */
2338
- merge(e) {
2339
- return new R({
2340
- unknownKeys: e._def.unknownKeys,
2341
- catchall: e._def.catchall,
2342
- shape: () => ({
2343
- ...this._def.shape(),
2344
- ...e._def.shape()
2345
- }),
2346
- typeName: y.ZodObject
2347
- });
2348
- }
2349
- // merge<
2350
- // Incoming extends AnyZodObject,
2351
- // Augmentation extends Incoming["shape"],
2352
- // NewOutput extends {
2353
- // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
2354
- // ? Augmentation[k]["_output"]
2355
- // : k extends keyof Output
2356
- // ? Output[k]
2357
- // : never;
2358
- // },
2359
- // NewInput extends {
2360
- // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
2361
- // ? Augmentation[k]["_input"]
2362
- // : k extends keyof Input
2363
- // ? Input[k]
2364
- // : never;
2365
- // }
2366
- // >(
2367
- // merging: Incoming
2368
- // ): ZodObject<
2369
- // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
2370
- // Incoming["_def"]["unknownKeys"],
2371
- // Incoming["_def"]["catchall"],
2372
- // NewOutput,
2373
- // NewInput
2374
- // > {
2375
- // const merged: any = new ZodObject({
2376
- // unknownKeys: merging._def.unknownKeys,
2377
- // catchall: merging._def.catchall,
2378
- // shape: () =>
2379
- // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
2380
- // typeName: ZodFirstPartyTypeKind.ZodObject,
2381
- // }) as any;
2382
- // return merged;
2383
- // }
2384
- setKey(e, r) {
2385
- return this.augment({ [e]: r });
2386
- }
2387
- // merge<Incoming extends AnyZodObject>(
2388
- // merging: Incoming
2389
- // ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
2390
- // ZodObject<
2391
- // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
2392
- // Incoming["_def"]["unknownKeys"],
2393
- // Incoming["_def"]["catchall"]
2394
- // > {
2395
- // // const mergedShape = objectUtil.mergeShapes(
2396
- // // this._def.shape(),
2397
- // // merging._def.shape()
2398
- // // );
2399
- // const merged: any = new ZodObject({
2400
- // unknownKeys: merging._def.unknownKeys,
2401
- // catchall: merging._def.catchall,
2402
- // shape: () =>
2403
- // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
2404
- // typeName: ZodFirstPartyTypeKind.ZodObject,
2405
- // }) as any;
2406
- // return merged;
2407
- // }
2408
- catchall(e) {
2409
- return new R({
2410
- ...this._def,
2411
- catchall: e
2412
- });
2413
- }
2414
- pick(e) {
2415
- const r = {};
2416
- return S.objectKeys(e).forEach((s) => {
2417
- e[s] && this.shape[s] && (r[s] = this.shape[s]);
2418
- }), new R({
2419
- ...this._def,
2420
- shape: () => r
2421
- });
2422
- }
2423
- omit(e) {
2424
- const r = {};
2425
- return S.objectKeys(this.shape).forEach((s) => {
2426
- e[s] || (r[s] = this.shape[s]);
2427
- }), new R({
2428
- ...this._def,
2429
- shape: () => r
2430
- });
2431
- }
2432
- /**
2433
- * @deprecated
2434
- */
2435
- deepPartial() {
2436
- return xe(this);
2437
- }
2438
- partial(e) {
2439
- const r = {};
2440
- return S.objectKeys(this.shape).forEach((s) => {
2441
- const n = this.shape[s];
2442
- e && !e[s] ? r[s] = n : r[s] = n.optional();
2443
- }), new R({
2444
- ...this._def,
2445
- shape: () => r
2446
- });
2447
- }
2448
- required(e) {
2449
- const r = {};
2450
- return S.objectKeys(this.shape).forEach((s) => {
2451
- if (e && !e[s])
2452
- r[s] = this.shape[s];
2453
- else {
2454
- let a = this.shape[s];
2455
- for (; a instanceof W; )
2456
- a = a._def.innerType;
2457
- r[s] = a;
2458
- }
2459
- }), new R({
2460
- ...this._def,
2461
- shape: () => r
2462
- });
2463
- }
2464
- keyof() {
2465
- return jr(S.objectKeys(this.shape));
2466
- }
2467
- }
2468
- R.create = (t, e) => new R({
2469
- shape: () => t,
2470
- unknownKeys: "strip",
2471
- catchall: se.create(),
2472
- typeName: y.ZodObject,
2473
- ...j(e)
2474
- });
2475
- R.strictCreate = (t, e) => new R({
2476
- shape: () => t,
2477
- unknownKeys: "strict",
2478
- catchall: se.create(),
2479
- typeName: y.ZodObject,
2480
- ...j(e)
2481
- });
2482
- R.lazycreate = (t, e) => new R({
2483
- shape: t,
2484
- unknownKeys: "strip",
2485
- catchall: se.create(),
2486
- typeName: y.ZodObject,
2487
- ...j(e)
2488
- });
2489
- class Re extends T {
2490
- _parse(e) {
2491
- const { ctx: r } = this._processInputParams(e), s = this._def.options;
2492
- function n(a) {
2493
- for (const c of a)
2494
- if (c.result.status === "valid")
2495
- return c.result;
2496
- for (const c of a)
2497
- if (c.result.status === "dirty")
2498
- return r.common.issues.push(...c.ctx.common.issues), c.result;
2499
- const o = a.map((c) => new L(c.ctx.common.issues));
2500
- return h(r, {
2501
- code: l.invalid_union,
2502
- unionErrors: o
2503
- }), x;
2504
- }
2505
- if (r.common.async)
2506
- return Promise.all(s.map(async (a) => {
2507
- const o = {
2508
- ...r,
2509
- common: {
2510
- ...r.common,
2511
- issues: []
2512
- },
2513
- parent: null
2514
- };
2515
- return {
2516
- result: await a._parseAsync({
2517
- data: r.data,
2518
- path: r.path,
2519
- parent: o
2520
- }),
2521
- ctx: o
2522
- };
2523
- })).then(n);
2524
- {
2525
- let a;
2526
- const o = [];
2527
- for (const u of s) {
2528
- const d = {
2529
- ...r,
2530
- common: {
2531
- ...r.common,
2532
- issues: []
2533
- },
2534
- parent: null
2535
- }, f = u._parseSync({
2536
- data: r.data,
2537
- path: r.path,
2538
- parent: d
2539
- });
2540
- if (f.status === "valid")
2541
- return f;
2542
- f.status === "dirty" && !a && (a = { result: f, ctx: d }), d.common.issues.length && o.push(d.common.issues);
2543
- }
2544
- if (a)
2545
- return r.common.issues.push(...a.ctx.common.issues), a.result;
2546
- const c = o.map((u) => new L(u));
2547
- return h(r, {
2548
- code: l.invalid_union,
2549
- unionErrors: c
2550
- }), x;
2551
- }
2552
- }
2553
- get options() {
2554
- return this._def.options;
2555
- }
2556
- }
2557
- Re.create = (t, e) => new Re({
2558
- options: t,
2559
- typeName: y.ZodUnion,
2560
- ...j(e)
2561
- });
2562
- const ee = (t) => t instanceof Ze ? ee(t.schema) : t instanceof U ? ee(t.innerType()) : t instanceof $e ? [t.value] : t instanceof ue ? t.options : t instanceof De ? S.objectValues(t.enum) : t instanceof ze ? ee(t._def.innerType) : t instanceof Ae ? [void 0] : t instanceof Pe ? [null] : t instanceof W ? [void 0, ...ee(t.unwrap())] : t instanceof le ? [null, ...ee(t.unwrap())] : t instanceof St || t instanceof Fe ? ee(t.unwrap()) : t instanceof qe ? ee(t._def.innerType) : [];
2563
- class ot extends T {
2564
- _parse(e) {
2565
- const { ctx: r } = this._processInputParams(e);
2566
- if (r.parsedType !== p.object)
2567
- return h(r, {
2568
- code: l.invalid_type,
2569
- expected: p.object,
2570
- received: r.parsedType
2571
- }), x;
2572
- const s = this.discriminator, n = r.data[s], a = this.optionsMap.get(n);
2573
- return a ? r.common.async ? a._parseAsync({
2574
- data: r.data,
2575
- path: r.path,
2576
- parent: r
2577
- }) : a._parseSync({
2578
- data: r.data,
2579
- path: r.path,
2580
- parent: r
2581
- }) : (h(r, {
2582
- code: l.invalid_union_discriminator,
2583
- options: Array.from(this.optionsMap.keys()),
2584
- path: [s]
2585
- }), x);
2586
- }
2587
- get discriminator() {
2588
- return this._def.discriminator;
2589
- }
2590
- get options() {
2591
- return this._def.options;
2592
- }
2593
- get optionsMap() {
2594
- return this._def.optionsMap;
2595
- }
2596
- /**
2597
- * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
2598
- * However, it only allows a union of objects, all of which need to share a discriminator property. This property must
2599
- * have a different value for each object in the union.
2600
- * @param discriminator the name of the discriminator property
2601
- * @param types an array of object schemas
2602
- * @param params
2603
- */
2604
- static create(e, r, s) {
2605
- const n = /* @__PURE__ */ new Map();
2606
- for (const a of r) {
2607
- const o = ee(a.shape[e]);
2608
- if (!o.length)
2609
- throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
2610
- for (const c of o) {
2611
- if (n.has(c))
2612
- throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);
2613
- n.set(c, a);
2614
- }
2615
- }
2616
- return new ot({
2617
- typeName: y.ZodDiscriminatedUnion,
2618
- discriminator: e,
2619
- options: r,
2620
- optionsMap: n,
2621
- ...j(s)
2622
- });
2623
- }
2624
- }
2625
- function bt(t, e) {
2626
- const r = te(t), s = te(e);
2627
- if (t === e)
2628
- return { valid: !0, data: t };
2629
- if (r === p.object && s === p.object) {
2630
- const n = S.objectKeys(e), a = S.objectKeys(t).filter((c) => n.indexOf(c) !== -1), o = { ...t, ...e };
2631
- for (const c of a) {
2632
- const u = bt(t[c], e[c]);
2633
- if (!u.valid)
2634
- return { valid: !1 };
2635
- o[c] = u.data;
2636
- }
2637
- return { valid: !0, data: o };
2638
- } else if (r === p.array && s === p.array) {
2639
- if (t.length !== e.length)
2640
- return { valid: !1 };
2641
- const n = [];
2642
- for (let a = 0; a < t.length; a++) {
2643
- const o = t[a], c = e[a], u = bt(o, c);
2644
- if (!u.valid)
2645
- return { valid: !1 };
2646
- n.push(u.data);
2647
- }
2648
- return { valid: !0, data: n };
2649
- } else return r === p.date && s === p.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
2650
- }
2651
- class Me extends T {
2652
- _parse(e) {
2653
- const { status: r, ctx: s } = this._processInputParams(e), n = (a, o) => {
2654
- if (xt(a) || xt(o))
2655
- return x;
2656
- const c = bt(a.value, o.value);
2657
- return c.valid ? ((_t(a) || _t(o)) && r.dirty(), { status: r.value, value: c.data }) : (h(s, {
2658
- code: l.invalid_intersection_types
2659
- }), x);
2660
- };
2661
- return s.common.async ? Promise.all([
2662
- this._def.left._parseAsync({
2663
- data: s.data,
2664
- path: s.path,
2665
- parent: s
2666
- }),
2667
- this._def.right._parseAsync({
2668
- data: s.data,
2669
- path: s.path,
2670
- parent: s
2671
- })
2672
- ]).then(([a, o]) => n(a, o)) : n(this._def.left._parseSync({
2673
- data: s.data,
2674
- path: s.path,
2675
- parent: s
2676
- }), this._def.right._parseSync({
2677
- data: s.data,
2678
- path: s.path,
2679
- parent: s
2680
- }));
2681
- }
2682
- }
2683
- Me.create = (t, e, r) => new Me({
2684
- left: t,
2685
- right: e,
2686
- typeName: y.ZodIntersection,
2687
- ...j(r)
2688
- });
2689
- class K extends T {
2690
- _parse(e) {
2691
- const { status: r, ctx: s } = this._processInputParams(e);
2692
- if (s.parsedType !== p.array)
2693
- return h(s, {
2694
- code: l.invalid_type,
2695
- expected: p.array,
2696
- received: s.parsedType
2697
- }), x;
2698
- if (s.data.length < this._def.items.length)
2699
- return h(s, {
2700
- code: l.too_small,
2701
- minimum: this._def.items.length,
2702
- inclusive: !0,
2703
- exact: !1,
2704
- type: "array"
2705
- }), x;
2706
- !this._def.rest && s.data.length > this._def.items.length && (h(s, {
2707
- code: l.too_big,
2708
- maximum: this._def.items.length,
2709
- inclusive: !0,
2710
- exact: !1,
2711
- type: "array"
2712
- }), r.dirty());
2713
- const a = [...s.data].map((o, c) => {
2714
- const u = this._def.items[c] || this._def.rest;
2715
- return u ? u._parse(new Y(s, o, s.path, c)) : null;
2716
- }).filter((o) => !!o);
2717
- return s.common.async ? Promise.all(a).then((o) => Z.mergeArray(r, o)) : Z.mergeArray(r, a);
2718
- }
2719
- get items() {
2720
- return this._def.items;
2721
- }
2722
- rest(e) {
2723
- return new K({
2724
- ...this._def,
2725
- rest: e
2726
- });
2727
- }
2728
- }
2729
- K.create = (t, e) => {
2730
- if (!Array.isArray(t))
2731
- throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2732
- return new K({
2733
- items: t,
2734
- typeName: y.ZodTuple,
2735
- rest: null,
2736
- ...j(e)
2737
- });
2738
- };
2739
- class Ie extends T {
2740
- get keySchema() {
2741
- return this._def.keyType;
2742
- }
2743
- get valueSchema() {
2744
- return this._def.valueType;
2745
- }
2746
- _parse(e) {
2747
- const { status: r, ctx: s } = this._processInputParams(e);
2748
- if (s.parsedType !== p.object)
2749
- return h(s, {
2750
- code: l.invalid_type,
2751
- expected: p.object,
2752
- received: s.parsedType
2753
- }), x;
2754
- const n = [], a = this._def.keyType, o = this._def.valueType;
2755
- for (const c in s.data)
2756
- n.push({
2757
- key: a._parse(new Y(s, c, s.path, c)),
2758
- value: o._parse(new Y(s, s.data[c], s.path, c)),
2759
- alwaysSet: c in s.data
2760
- });
2761
- return s.common.async ? Z.mergeObjectAsync(r, n) : Z.mergeObjectSync(r, n);
2762
- }
2763
- get element() {
2764
- return this._def.valueType;
2765
- }
2766
- static create(e, r, s) {
2767
- return r instanceof T ? new Ie({
2768
- keyType: e,
2769
- valueType: r,
2770
- typeName: y.ZodRecord,
2771
- ...j(s)
2772
- }) : new Ie({
2773
- keyType: B.create(),
2774
- valueType: e,
2775
- typeName: y.ZodRecord,
2776
- ...j(r)
2777
- });
2778
- }
2779
- }
2780
- class tt extends T {
2781
- get keySchema() {
2782
- return this._def.keyType;
2783
- }
2784
- get valueSchema() {
2785
- return this._def.valueType;
2786
- }
2787
- _parse(e) {
2788
- const { status: r, ctx: s } = this._processInputParams(e);
2789
- if (s.parsedType !== p.map)
2790
- return h(s, {
2791
- code: l.invalid_type,
2792
- expected: p.map,
2793
- received: s.parsedType
2794
- }), x;
2795
- const n = this._def.keyType, a = this._def.valueType, o = [...s.data.entries()].map(([c, u], d) => ({
2796
- key: n._parse(new Y(s, c, s.path, [d, "key"])),
2797
- value: a._parse(new Y(s, u, s.path, [d, "value"]))
2798
- }));
2799
- if (s.common.async) {
2800
- const c = /* @__PURE__ */ new Map();
2801
- return Promise.resolve().then(async () => {
2802
- for (const u of o) {
2803
- const d = await u.key, f = await u.value;
2804
- if (d.status === "aborted" || f.status === "aborted")
2805
- return x;
2806
- (d.status === "dirty" || f.status === "dirty") && r.dirty(), c.set(d.value, f.value);
2807
- }
2808
- return { status: r.value, value: c };
2809
- });
2810
- } else {
2811
- const c = /* @__PURE__ */ new Map();
2812
- for (const u of o) {
2813
- const d = u.key, f = u.value;
2814
- if (d.status === "aborted" || f.status === "aborted")
2815
- return x;
2816
- (d.status === "dirty" || f.status === "dirty") && r.dirty(), c.set(d.value, f.value);
2817
- }
2818
- return { status: r.value, value: c };
2819
- }
2820
- }
2821
- }
2822
- tt.create = (t, e, r) => new tt({
2823
- valueType: e,
2824
- keyType: t,
2825
- typeName: y.ZodMap,
2826
- ...j(r)
2827
- });
2828
- class ge extends T {
2829
- _parse(e) {
2830
- const { status: r, ctx: s } = this._processInputParams(e);
2831
- if (s.parsedType !== p.set)
2832
- return h(s, {
2833
- code: l.invalid_type,
2834
- expected: p.set,
2835
- received: s.parsedType
2836
- }), x;
2837
- const n = this._def;
2838
- n.minSize !== null && s.data.size < n.minSize.value && (h(s, {
2839
- code: l.too_small,
2840
- minimum: n.minSize.value,
2841
- type: "set",
2842
- inclusive: !0,
2843
- exact: !1,
2844
- message: n.minSize.message
2845
- }), r.dirty()), n.maxSize !== null && s.data.size > n.maxSize.value && (h(s, {
2846
- code: l.too_big,
2847
- maximum: n.maxSize.value,
2848
- type: "set",
2849
- inclusive: !0,
2850
- exact: !1,
2851
- message: n.maxSize.message
2852
- }), r.dirty());
2853
- const a = this._def.valueType;
2854
- function o(u) {
2855
- const d = /* @__PURE__ */ new Set();
2856
- for (const f of u) {
2857
- if (f.status === "aborted")
2858
- return x;
2859
- f.status === "dirty" && r.dirty(), d.add(f.value);
2860
- }
2861
- return { status: r.value, value: d };
2862
- }
2863
- const c = [...s.data.values()].map((u, d) => a._parse(new Y(s, u, s.path, d)));
2864
- return s.common.async ? Promise.all(c).then((u) => o(u)) : o(c);
2865
- }
2866
- min(e, r) {
2867
- return new ge({
2868
- ...this._def,
2869
- minSize: { value: e, message: g.toString(r) }
2870
- });
2871
- }
2872
- max(e, r) {
2873
- return new ge({
2874
- ...this._def,
2875
- maxSize: { value: e, message: g.toString(r) }
2876
- });
2877
- }
2878
- size(e, r) {
2879
- return this.min(e, r).max(e, r);
2880
- }
2881
- nonempty(e) {
2882
- return this.min(1, e);
2883
- }
2884
- }
2885
- ge.create = (t, e) => new ge({
2886
- valueType: t,
2887
- minSize: null,
2888
- maxSize: null,
2889
- typeName: y.ZodSet,
2890
- ...j(e)
2891
- });
2892
- class we extends T {
2893
- constructor() {
2894
- super(...arguments), this.validate = this.implement;
2895
- }
2896
- _parse(e) {
2897
- const { ctx: r } = this._processInputParams(e);
2898
- if (r.parsedType !== p.function)
2899
- return h(r, {
2900
- code: l.invalid_type,
2901
- expected: p.function,
2902
- received: r.parsedType
2903
- }), x;
2904
- function s(c, u) {
2905
- return Ge({
2906
- data: c,
2907
- path: r.path,
2908
- errorMaps: [
2909
- r.common.contextualErrorMap,
2910
- r.schemaErrorMap,
2911
- Ke(),
2912
- ke
2913
- ].filter((d) => !!d),
2914
- issueData: {
2915
- code: l.invalid_arguments,
2916
- argumentsError: u
2917
- }
2918
- });
2919
- }
2920
- function n(c, u) {
2921
- return Ge({
2922
- data: c,
2923
- path: r.path,
2924
- errorMaps: [
2925
- r.common.contextualErrorMap,
2926
- r.schemaErrorMap,
2927
- Ke(),
2928
- ke
2929
- ].filter((d) => !!d),
2930
- issueData: {
2931
- code: l.invalid_return_type,
2932
- returnTypeError: u
2933
- }
2934
- });
2935
- }
2936
- const a = { errorMap: r.common.contextualErrorMap }, o = r.data;
2937
- if (this._def.returns instanceof Te) {
2938
- const c = this;
2939
- return D(async function(...u) {
2940
- const d = new L([]), f = await c._def.args.parseAsync(u, a).catch((w) => {
2941
- throw d.addIssue(s(u, w)), d;
2942
- }), b = await Reflect.apply(o, this, f);
2943
- return await c._def.returns._def.type.parseAsync(b, a).catch((w) => {
2944
- throw d.addIssue(n(b, w)), d;
2945
- });
2946
- });
2947
- } else {
2948
- const c = this;
2949
- return D(function(...u) {
2950
- const d = c._def.args.safeParse(u, a);
2951
- if (!d.success)
2952
- throw new L([s(u, d.error)]);
2953
- const f = Reflect.apply(o, this, d.data), b = c._def.returns.safeParse(f, a);
2954
- if (!b.success)
2955
- throw new L([n(f, b.error)]);
2956
- return b.data;
2957
- });
2958
- }
2959
- }
2960
- parameters() {
2961
- return this._def.args;
2962
- }
2963
- returnType() {
2964
- return this._def.returns;
2965
- }
2966
- args(...e) {
2967
- return new we({
2968
- ...this._def,
2969
- args: K.create(e).rest(he.create())
2970
- });
2971
- }
2972
- returns(e) {
2973
- return new we({
2974
- ...this._def,
2975
- returns: e
2976
- });
2977
- }
2978
- implement(e) {
2979
- return this.parse(e);
2980
- }
2981
- strictImplement(e) {
2982
- return this.parse(e);
2983
- }
2984
- static create(e, r, s) {
2985
- return new we({
2986
- args: e || K.create([]).rest(he.create()),
2987
- returns: r || he.create(),
2988
- typeName: y.ZodFunction,
2989
- ...j(s)
2990
- });
2991
- }
2992
- }
2993
- class Ze extends T {
2994
- get schema() {
2995
- return this._def.getter();
2996
- }
2997
- _parse(e) {
2998
- const { ctx: r } = this._processInputParams(e);
2999
- return this._def.getter()._parse({ data: r.data, path: r.path, parent: r });
3000
- }
3001
- }
3002
- Ze.create = (t, e) => new Ze({
3003
- getter: t,
3004
- typeName: y.ZodLazy,
3005
- ...j(e)
3006
- });
3007
- class $e extends T {
3008
- _parse(e) {
3009
- if (e.data !== this._def.value) {
3010
- const r = this._getOrReturnCtx(e);
3011
- return h(r, {
3012
- received: r.data,
3013
- code: l.invalid_literal,
3014
- expected: this._def.value
3015
- }), x;
3016
- }
3017
- return { status: "valid", value: e.data };
3018
- }
3019
- get value() {
3020
- return this._def.value;
3021
- }
3022
- }
3023
- $e.create = (t, e) => new $e({
3024
- value: t,
3025
- typeName: y.ZodLiteral,
3026
- ...j(e)
3027
- });
3028
- function jr(t, e) {
3029
- return new ue({
3030
- values: t,
3031
- typeName: y.ZodEnum,
3032
- ...j(e)
3033
- });
3034
- }
3035
- class ue extends T {
3036
- constructor() {
3037
- super(...arguments), Se.set(this, void 0);
3038
- }
3039
- _parse(e) {
3040
- if (typeof e.data != "string") {
3041
- const r = this._getOrReturnCtx(e), s = this._def.values;
3042
- return h(r, {
3043
- expected: S.joinValues(s),
3044
- received: r.parsedType,
3045
- code: l.invalid_type
3046
- }), x;
3047
- }
3048
- if (Je(this, Se) || _r(this, Se, new Set(this._def.values)), !Je(this, Se).has(e.data)) {
3049
- const r = this._getOrReturnCtx(e), s = this._def.values;
3050
- return h(r, {
3051
- received: r.data,
3052
- code: l.invalid_enum_value,
3053
- options: s
3054
- }), x;
3055
- }
3056
- return D(e.data);
3057
- }
3058
- get options() {
3059
- return this._def.values;
3060
- }
3061
- get enum() {
3062
- const e = {};
3063
- for (const r of this._def.values)
3064
- e[r] = r;
3065
- return e;
3066
- }
3067
- get Values() {
3068
- const e = {};
3069
- for (const r of this._def.values)
3070
- e[r] = r;
3071
- return e;
3072
- }
3073
- get Enum() {
3074
- const e = {};
3075
- for (const r of this._def.values)
3076
- e[r] = r;
3077
- return e;
3078
- }
3079
- extract(e, r = this._def) {
3080
- return ue.create(e, {
3081
- ...this._def,
3082
- ...r
3083
- });
3084
- }
3085
- exclude(e, r = this._def) {
3086
- return ue.create(this.options.filter((s) => !e.includes(s)), {
3087
- ...this._def,
3088
- ...r
3089
- });
3090
- }
3091
- }
3092
- Se = /* @__PURE__ */ new WeakMap();
3093
- ue.create = jr;
3094
- class De extends T {
3095
- constructor() {
3096
- super(...arguments), Ce.set(this, void 0);
3097
- }
3098
- _parse(e) {
3099
- const r = S.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
3100
- if (s.parsedType !== p.string && s.parsedType !== p.number) {
3101
- const n = S.objectValues(r);
3102
- return h(s, {
3103
- expected: S.joinValues(n),
3104
- received: s.parsedType,
3105
- code: l.invalid_type
3106
- }), x;
3107
- }
3108
- if (Je(this, Ce) || _r(this, Ce, new Set(S.getValidEnumValues(this._def.values))), !Je(this, Ce).has(e.data)) {
3109
- const n = S.objectValues(r);
3110
- return h(s, {
3111
- received: s.data,
3112
- code: l.invalid_enum_value,
3113
- options: n
3114
- }), x;
3115
- }
3116
- return D(e.data);
3117
- }
3118
- get enum() {
3119
- return this._def.values;
3120
- }
3121
- }
3122
- Ce = /* @__PURE__ */ new WeakMap();
3123
- De.create = (t, e) => new De({
3124
- values: t,
3125
- typeName: y.ZodNativeEnum,
3126
- ...j(e)
3127
- });
3128
- class Te extends T {
3129
- unwrap() {
3130
- return this._def.type;
3131
- }
3132
- _parse(e) {
3133
- const { ctx: r } = this._processInputParams(e);
3134
- if (r.parsedType !== p.promise && r.common.async === !1)
3135
- return h(r, {
3136
- code: l.invalid_type,
3137
- expected: p.promise,
3138
- received: r.parsedType
3139
- }), x;
3140
- const s = r.parsedType === p.promise ? r.data : Promise.resolve(r.data);
3141
- return D(s.then((n) => this._def.type.parseAsync(n, {
3142
- path: r.path,
3143
- errorMap: r.common.contextualErrorMap
3144
- })));
3145
- }
3146
- }
3147
- Te.create = (t, e) => new Te({
3148
- type: t,
3149
- typeName: y.ZodPromise,
3150
- ...j(e)
3151
- });
3152
- class U extends T {
3153
- innerType() {
3154
- return this._def.schema;
3155
- }
3156
- sourceType() {
3157
- return this._def.schema._def.typeName === y.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
3158
- }
3159
- _parse(e) {
3160
- const { status: r, ctx: s } = this._processInputParams(e), n = this._def.effect || null, a = {
3161
- addIssue: (o) => {
3162
- h(s, o), o.fatal ? r.abort() : r.dirty();
3163
- },
3164
- get path() {
3165
- return s.path;
3166
- }
3167
- };
3168
- if (a.addIssue = a.addIssue.bind(a), n.type === "preprocess") {
3169
- const o = n.transform(s.data, a);
3170
- if (s.common.async)
3171
- return Promise.resolve(o).then(async (c) => {
3172
- if (r.value === "aborted")
3173
- return x;
3174
- const u = await this._def.schema._parseAsync({
3175
- data: c,
3176
- path: s.path,
3177
- parent: s
3178
- });
3179
- return u.status === "aborted" ? x : u.status === "dirty" || r.value === "dirty" ? _e(u.value) : u;
3180
- });
3181
- {
3182
- if (r.value === "aborted")
3183
- return x;
3184
- const c = this._def.schema._parseSync({
3185
- data: o,
3186
- path: s.path,
3187
- parent: s
3188
- });
3189
- return c.status === "aborted" ? x : c.status === "dirty" || r.value === "dirty" ? _e(c.value) : c;
3190
- }
3191
- }
3192
- if (n.type === "refinement") {
3193
- const o = (c) => {
3194
- const u = n.refinement(c, a);
3195
- if (s.common.async)
3196
- return Promise.resolve(u);
3197
- if (u instanceof Promise)
3198
- throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
3199
- return c;
3200
- };
3201
- if (s.common.async === !1) {
3202
- const c = this._def.schema._parseSync({
3203
- data: s.data,
3204
- path: s.path,
3205
- parent: s
3206
- });
3207
- return c.status === "aborted" ? x : (c.status === "dirty" && r.dirty(), o(c.value), { status: r.value, value: c.value });
3208
- } else
3209
- return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((c) => c.status === "aborted" ? x : (c.status === "dirty" && r.dirty(), o(c.value).then(() => ({ status: r.value, value: c.value }))));
3210
- }
3211
- if (n.type === "transform")
3212
- if (s.common.async === !1) {
3213
- const o = this._def.schema._parseSync({
3214
- data: s.data,
3215
- path: s.path,
3216
- parent: s
3217
- });
3218
- if (!me(o))
3219
- return o;
3220
- const c = n.transform(o.value, a);
3221
- if (c instanceof Promise)
3222
- throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
3223
- return { status: r.value, value: c };
3224
- } else
3225
- return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => me(o) ? Promise.resolve(n.transform(o.value, a)).then((c) => ({ status: r.value, value: c })) : o);
3226
- S.assertNever(n);
3227
- }
3228
- }
3229
- U.create = (t, e, r) => new U({
3230
- schema: t,
3231
- typeName: y.ZodEffects,
3232
- effect: e,
3233
- ...j(r)
3234
- });
3235
- U.createWithPreprocess = (t, e, r) => new U({
3236
- schema: e,
3237
- effect: { type: "preprocess", transform: t },
3238
- typeName: y.ZodEffects,
3239
- ...j(r)
3240
- });
3241
- class W extends T {
3242
- _parse(e) {
3243
- return this._getType(e) === p.undefined ? D(void 0) : this._def.innerType._parse(e);
3244
- }
3245
- unwrap() {
3246
- return this._def.innerType;
3247
- }
3248
- }
3249
- W.create = (t, e) => new W({
3250
- innerType: t,
3251
- typeName: y.ZodOptional,
3252
- ...j(e)
3253
- });
3254
- class le extends T {
3255
- _parse(e) {
3256
- return this._getType(e) === p.null ? D(null) : this._def.innerType._parse(e);
3257
- }
3258
- unwrap() {
3259
- return this._def.innerType;
3260
- }
3261
- }
3262
- le.create = (t, e) => new le({
3263
- innerType: t,
3264
- typeName: y.ZodNullable,
3265
- ...j(e)
3266
- });
3267
- class ze extends T {
3268
- _parse(e) {
3269
- const { ctx: r } = this._processInputParams(e);
3270
- let s = r.data;
3271
- return r.parsedType === p.undefined && (s = this._def.defaultValue()), this._def.innerType._parse({
3272
- data: s,
3273
- path: r.path,
3274
- parent: r
3275
- });
3276
- }
3277
- removeDefault() {
3278
- return this._def.innerType;
3279
- }
3280
- }
3281
- ze.create = (t, e) => new ze({
3282
- innerType: t,
3283
- typeName: y.ZodDefault,
3284
- defaultValue: typeof e.default == "function" ? e.default : () => e.default,
3285
- ...j(e)
3286
- });
3287
- class qe extends T {
3288
- _parse(e) {
3289
- const { ctx: r } = this._processInputParams(e), s = {
3290
- ...r,
3291
- common: {
3292
- ...r.common,
3293
- issues: []
3294
- }
3295
- }, n = this._def.innerType._parse({
3296
- data: s.data,
3297
- path: s.path,
3298
- parent: {
3299
- ...s
3300
- }
3301
- });
3302
- return Ee(n) ? n.then((a) => ({
3303
- status: "valid",
3304
- value: a.status === "valid" ? a.value : this._def.catchValue({
3305
- get error() {
3306
- return new L(s.common.issues);
3307
- },
3308
- input: s.data
3309
- })
3310
- })) : {
3311
- status: "valid",
3312
- value: n.status === "valid" ? n.value : this._def.catchValue({
3313
- get error() {
3314
- return new L(s.common.issues);
3315
- },
3316
- input: s.data
3317
- })
3318
- };
3319
- }
3320
- removeCatch() {
3321
- return this._def.innerType;
3322
- }
3323
- }
3324
- qe.create = (t, e) => new qe({
3325
- innerType: t,
3326
- typeName: y.ZodCatch,
3327
- catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
3328
- ...j(e)
3329
- });
3330
- class rt extends T {
3331
- _parse(e) {
3332
- if (this._getType(e) !== p.nan) {
3333
- const s = this._getOrReturnCtx(e);
3334
- return h(s, {
3335
- code: l.invalid_type,
3336
- expected: p.nan,
3337
- received: s.parsedType
3338
- }), x;
3339
- }
3340
- return { status: "valid", value: e.data };
3341
- }
3342
- }
3343
- rt.create = (t) => new rt({
3344
- typeName: y.ZodNaN,
3345
- ...j(t)
3346
- });
3347
- const na = Symbol("zod_brand");
3348
- class St extends T {
3349
- _parse(e) {
3350
- const { ctx: r } = this._processInputParams(e), s = r.data;
3351
- return this._def.type._parse({
3352
- data: s,
3353
- path: r.path,
3354
- parent: r
3355
- });
3356
- }
3357
- unwrap() {
3358
- return this._def.type;
3359
- }
3360
- }
3361
- class Le extends T {
3362
- _parse(e) {
3363
- const { status: r, ctx: s } = this._processInputParams(e);
3364
- if (s.common.async)
3365
- return (async () => {
3366
- const a = await this._def.in._parseAsync({
3367
- data: s.data,
3368
- path: s.path,
3369
- parent: s
3370
- });
3371
- return a.status === "aborted" ? x : a.status === "dirty" ? (r.dirty(), _e(a.value)) : this._def.out._parseAsync({
3372
- data: a.value,
3373
- path: s.path,
3374
- parent: s
3375
- });
3376
- })();
3377
- {
3378
- const n = this._def.in._parseSync({
3379
- data: s.data,
3380
- path: s.path,
3381
- parent: s
3382
- });
3383
- return n.status === "aborted" ? x : n.status === "dirty" ? (r.dirty(), {
3384
- status: "dirty",
3385
- value: n.value
3386
- }) : this._def.out._parseSync({
3387
- data: n.value,
3388
- path: s.path,
3389
- parent: s
3390
- });
3391
- }
3392
- }
3393
- static create(e, r) {
3394
- return new Le({
3395
- in: e,
3396
- out: r,
3397
- typeName: y.ZodPipeline
3398
- });
3399
- }
3400
- }
3401
- class Fe extends T {
3402
- _parse(e) {
3403
- const r = this._def.innerType._parse(e), s = (n) => (me(n) && (n.value = Object.freeze(n.value)), n);
3404
- return Ee(r) ? r.then((n) => s(n)) : s(r);
3405
- }
3406
- unwrap() {
3407
- return this._def.innerType;
3408
- }
3409
- }
3410
- Fe.create = (t, e) => new Fe({
3411
- innerType: t,
3412
- typeName: y.ZodReadonly,
3413
- ...j(e)
3414
- });
3415
- function Bt(t, e) {
3416
- const r = typeof t == "function" ? t(e) : typeof t == "string" ? { message: t } : t;
3417
- return typeof r == "string" ? { message: r } : r;
3418
- }
3419
- function Tr(t, e = {}, r) {
3420
- return t ? je.create().superRefine((s, n) => {
3421
- var a, o;
3422
- const c = t(s);
3423
- if (c instanceof Promise)
3424
- return c.then((u) => {
3425
- var d, f;
3426
- if (!u) {
3427
- const b = Bt(e, s), k = (f = (d = b.fatal) !== null && d !== void 0 ? d : r) !== null && f !== void 0 ? f : !0;
3428
- n.addIssue({ code: "custom", ...b, fatal: k });
3429
- }
3430
- });
3431
- if (!c) {
3432
- const u = Bt(e, s), d = (o = (a = u.fatal) !== null && a !== void 0 ? a : r) !== null && o !== void 0 ? o : !0;
3433
- n.addIssue({ code: "custom", ...u, fatal: d });
3434
- }
3435
- }) : je.create();
3436
- }
3437
- const aa = {
3438
- object: R.lazycreate
3439
- };
3440
- var y;
3441
- (function(t) {
3442
- t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
3443
- })(y || (y = {}));
3444
- const ia = (t, e = {
3445
- message: `Input not instance of ${t.name}`
3446
- }) => Tr((r) => r instanceof t, e), Sr = B.create, Cr = ce.create, oa = rt.create, ca = de.create, Nr = Oe.create, da = pe.create, ua = Xe.create, la = Ae.create, fa = Pe.create, ha = je.create, ma = he.create, pa = se.create, ga = et.create, va = V.create, ya = R.create, xa = R.strictCreate, _a = Re.create, ba = ot.create, wa = Me.create, ka = K.create, ja = Ie.create, Ta = tt.create, Sa = ge.create, Ca = we.create, Na = Ze.create, Ea = $e.create, Oa = ue.create, Aa = De.create, Pa = Te.create, Vt = U.create, Ra = W.create, Ma = le.create, Ia = U.createWithPreprocess, Za = Le.create, $a = () => Sr().optional(), Da = () => Cr().optional(), za = () => Nr().optional(), qa = {
3447
- string: (t) => B.create({ ...t, coerce: !0 }),
3448
- number: (t) => ce.create({ ...t, coerce: !0 }),
3449
- boolean: (t) => Oe.create({
3450
- ...t,
3451
- coerce: !0
3452
- }),
3453
- bigint: (t) => de.create({ ...t, coerce: !0 }),
3454
- date: (t) => pe.create({ ...t, coerce: !0 })
3455
- }, Fa = x;
3456
- var Ue = /* @__PURE__ */ Object.freeze({
3457
- __proto__: null,
3458
- defaultErrorMap: ke,
3459
- setErrorMap: In,
3460
- getErrorMap: Ke,
3461
- makeIssue: Ge,
3462
- EMPTY_PATH: Zn,
3463
- addIssueToContext: h,
3464
- ParseStatus: Z,
3465
- INVALID: x,
3466
- DIRTY: _e,
3467
- OK: D,
3468
- isAborted: xt,
3469
- isDirty: _t,
3470
- isValid: me,
3471
- isAsync: Ee,
3472
- get util() {
3473
- return S;
3474
- },
3475
- get objectUtil() {
3476
- return yt;
3477
- },
3478
- ZodParsedType: p,
3479
- getParsedType: te,
3480
- ZodType: T,
3481
- datetimeRegex: kr,
3482
- ZodString: B,
3483
- ZodNumber: ce,
3484
- ZodBigInt: de,
3485
- ZodBoolean: Oe,
3486
- ZodDate: pe,
3487
- ZodSymbol: Xe,
3488
- ZodUndefined: Ae,
3489
- ZodNull: Pe,
3490
- ZodAny: je,
3491
- ZodUnknown: he,
3492
- ZodNever: se,
3493
- ZodVoid: et,
3494
- ZodArray: V,
3495
- ZodObject: R,
3496
- ZodUnion: Re,
3497
- ZodDiscriminatedUnion: ot,
3498
- ZodIntersection: Me,
3499
- ZodTuple: K,
3500
- ZodRecord: Ie,
3501
- ZodMap: tt,
3502
- ZodSet: ge,
3503
- ZodFunction: we,
3504
- ZodLazy: Ze,
3505
- ZodLiteral: $e,
3506
- ZodEnum: ue,
3507
- ZodNativeEnum: De,
3508
- ZodPromise: Te,
3509
- ZodEffects: U,
3510
- ZodTransformer: U,
3511
- ZodOptional: W,
3512
- ZodNullable: le,
3513
- ZodDefault: ze,
3514
- ZodCatch: qe,
3515
- ZodNaN: rt,
3516
- BRAND: na,
3517
- ZodBranded: St,
3518
- ZodPipeline: Le,
3519
- ZodReadonly: Fe,
3520
- custom: Tr,
3521
- Schema: T,
3522
- ZodSchema: T,
3523
- late: aa,
3524
- get ZodFirstPartyTypeKind() {
3525
- return y;
3526
- },
3527
- coerce: qa,
3528
- any: ha,
3529
- array: va,
3530
- bigint: ca,
3531
- boolean: Nr,
3532
- date: da,
3533
- discriminatedUnion: ba,
3534
- effect: Vt,
3535
- enum: Oa,
3536
- function: Ca,
3537
- instanceof: ia,
3538
- intersection: wa,
3539
- lazy: Na,
3540
- literal: Ea,
3541
- map: Ta,
3542
- nan: oa,
3543
- nativeEnum: Aa,
3544
- never: pa,
3545
- null: fa,
3546
- nullable: Ma,
3547
- number: Cr,
3548
- object: ya,
3549
- oboolean: za,
3550
- onumber: Da,
3551
- optional: Ra,
3552
- ostring: $a,
3553
- pipeline: Za,
3554
- preprocess: Ia,
3555
- promise: Pa,
3556
- record: ja,
3557
- set: Sa,
3558
- strictObject: xa,
3559
- string: Sr,
3560
- symbol: ua,
3561
- transformer: Vt,
3562
- tuple: ka,
3563
- undefined: la,
3564
- union: _a,
3565
- unknown: ma,
3566
- void: ga,
3567
- NEVER: Fa,
3568
- ZodIssueCode: l,
3569
- quotelessJson: Mn,
3570
- ZodError: L
3571
- });
3572
- const La = Ue.object({
3573
- buildId: Ue.string(),
3574
- timestamp: Ue.string(),
3575
- status: Ue.enum(["in-progress", "success", "failed"])
3576
- }), Ba = ({
3577
- buildId: t,
3578
- endpoint: e = "/__zuplo/docs"
3579
- }) => {
3580
- const r = _s({
3581
- queryKey: ["zuplo-build-check", t, e],
3582
- refetchInterval: 3e3,
3583
- enabled: typeof t < "u" && !1,
3584
- retry: !1,
3585
- queryFn: () => fetch(e, { signal: AbortSignal.timeout(2e3) }).then((n) => {
3586
- if (!n.ok) throw new Error("Failed to fetch build status");
3587
- return n.json();
3588
- }).then((n) => La.parse(n))
3589
- });
3590
- if (r.isError || !r.data || r.data.buildId === t)
3591
- return null;
3592
- const s = r.data.status === "success";
3593
- return /* @__PURE__ */ i.jsxs("div", { className: "fixed flex flex-col gap-3 p-4 rounded-xl w-96 border z-20 bg-background left-0 right-0 top-4 mx-auto shadow-lg", children: [
3594
- s ? /* @__PURE__ */ i.jsxs("div", { className: "flex flex-row items-center gap-2", children: [
3595
- /* @__PURE__ */ i.jsx(Is, { size: 16 }),
3596
- /* @__PURE__ */ i.jsx("span", { className: "text-sm", children: "New version available" })
3597
- ] }) : /* @__PURE__ */ i.jsxs("div", { className: "flex flex-row items-center gap-2", children: [
3598
- /* @__PURE__ */ i.jsx(Zs, { size: 16, className: "animate-spin" }),
3599
- /* @__PURE__ */ i.jsx("span", { className: "text-sm", children: "Building new version..." })
3600
- ] }),
3601
- /* @__PURE__ */ i.jsx("span", { className: "text-xs", children: s ? "To see the new version, reload the page now." : "A new version of the developer portal will be available soon." }),
3602
- /* @__PURE__ */ i.jsx(
3603
- ur,
3604
- {
3605
- variant: "outline",
3606
- size: "sm",
3607
- className: "w-full",
3608
- onClick: () => {
3609
- window.location.reload();
3610
- },
3611
- children: "Reload"
3612
- }
3613
- )
3614
- ] });
3615
- }, Va = () => {
3616
- const t = nt(), e = oe(t.pathname);
3617
- G(() => {
3618
- const r = e.current !== t.pathname, s = t.hash !== "";
3619
- r && !s && window.scrollTo(0, 0), e.current = t.pathname;
3620
- }, [t.pathname, t.hash]);
3621
- }, Ua = ({
3622
- icon: t
3623
- }) => typeof t == "string" ? /* @__PURE__ */ i.jsx(
3624
- "img",
3625
- {
3626
- src: `https://cdn.simpleicons.org/${t}/000000/ffffff`,
3627
- className: "size-5",
3628
- alt: t
3629
- }
3630
- ) : t, Qa = (t) => /^https?:/.test(t), Ha = () => {
3631
- const { page: t } = Mi(), e = t?.footer;
3632
- return e ? /* @__PURE__ */ i.jsx("footer", { className: "border-t bg-background", children: /* @__PURE__ */ i.jsxs("div", { className: "mx-auto max-w-screen-2xl px-4 lg:px-8 py-8 pt-20", children: [
3633
- /* @__PURE__ */ i.jsxs(
3634
- "div",
3635
- {
3636
- className: $("flex flex-row gap-8", {
3637
- "justify-center": !e.position || e.position === "center",
3638
- "justify-start": e.position === "start",
3639
- "justify-end": e.position === "end"
3640
- }),
3641
- children: [
3642
- /* @__PURE__ */ i.jsx(F, { name: "footer-before" }),
3643
- e.columns && /* @__PURE__ */ i.jsx(
3644
- "div",
3645
- {
3646
- className: "w-full md:max-w-screen-md grid grid-cols-[1fr_1fr] gap-8 md:grid-cols-[repeat(var(--columns),minmax(0,1fr))]",
3647
- style: { "--columns": e.columns.length },
3648
- children: e.columns.map((r) => /* @__PURE__ */ i.jsxs(
3649
- "div",
3650
- {
3651
- className: $({
3652
- "justify-self-center": !r.position || r.position === "center",
3653
- "justify-self-start": r.position === "start",
3654
- "justify-self-end": r.position === "end"
3655
- }),
3656
- children: [
3657
- /* @__PURE__ */ i.jsx("span", { className: "text-sm font-semibold", children: r.title }),
3658
- /* @__PURE__ */ i.jsx("ul", { className: "mt-4 space-y-2", children: r.links.map((s, n) => {
3659
- const a = "flex flex-row gap-1 items-center text-sm text-muted-foreground hover:text-accent-foreground";
3660
- return /* @__PURE__ */ i.jsx("li", { children: Qa(s.href) ? /* @__PURE__ */ i.jsxs(
3661
- "a",
3662
- {
3663
- href: s.href,
3664
- target: "_blank",
3665
- rel: "noopener noreferrer",
3666
- className: a,
3667
- children: [
3668
- /* @__PURE__ */ i.jsx("span", { children: s.label }),
3669
- /* @__PURE__ */ i.jsx($s, { size: 12 })
3670
- ]
3671
- }
3672
- ) : /* @__PURE__ */ i.jsx(
3673
- Us,
3674
- {
3675
- to: s.href + n,
3676
- className: a,
3677
- children: /* @__PURE__ */ i.jsx("span", { children: s.label })
3678
- }
3679
- ) }, s.href + n);
3680
- }) })
3681
- ]
3682
- },
3683
- r.title
3684
- ))
3685
- }
3686
- ),
3687
- /* @__PURE__ */ i.jsx(F, { name: "footer-after" })
3688
- ]
3689
- }
3690
- ),
3691
- /* @__PURE__ */ i.jsxs(
3692
- "div",
3693
- {
3694
- className: $(
3695
- "flex items-center justify-between",
3696
- e.columns && "border-t mt-8 pt-8"
3697
- ),
3698
- children: [
3699
- e.logo && /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
3700
- /* @__PURE__ */ i.jsx(
3701
- "img",
3702
- {
3703
- src: e.logo.src.light,
3704
- alt: e.logo.alt,
3705
- className: "w-8 dark:hidden",
3706
- style: { width: e.logo.width }
3707
- }
3708
- ),
3709
- /* @__PURE__ */ i.jsx(
3710
- "img",
3711
- {
3712
- src: e.logo.src.dark,
3713
- alt: e.logo.alt,
3714
- className: "w-8 hidden dark:block",
3715
- style: { width: e.logo.width }
3716
- }
3717
- )
3718
- ] }),
3719
- e.copyright && /* @__PURE__ */ i.jsx("p", { className: "text-sm text-muted-foreground", children: e.copyright }),
3720
- /* @__PURE__ */ i.jsx("div", { className: "flex items-center gap-2", children: e.social?.map((r) => /* @__PURE__ */ i.jsxs(
3721
- "a",
3722
- {
3723
- href: r.href,
3724
- target: "_blank",
3725
- rel: "noopener noreferrer",
3726
- className: "w-auto gap-2 flex text-muted-foreground hover:text-accent-foreground",
3727
- children: [
3728
- /* @__PURE__ */ i.jsx(Ua, { icon: r.icon }),
3729
- r.label
3730
- ]
3731
- },
3732
- r.href
3733
- )) })
3734
- ]
3735
- }
3736
- )
3737
- ] }) }) : null;
3738
- };
3739
- function Wa({
3740
- className: t,
3741
- ...e
3742
- }) {
3743
- return /* @__PURE__ */ i.jsx(
3744
- "div",
3745
- {
3746
- className: $("animate-pulse rounded-md bg-muted", t),
3747
- ...e
3748
- }
3749
- );
3750
- }
3751
- const Ut = {
3752
- info: "bg-blue-500",
3753
- note: "bg-gray-500",
3754
- tip: "bg-green-600",
3755
- caution: "bg-orange-500",
3756
- danger: "bg-rose-500"
3757
- }, Ya = () => {
3758
- const { page: t } = Q(), [e, r] = ve(!0);
3759
- if (!t?.banner || !e)
3760
- return /* @__PURE__ */ i.jsx("style", { children: ":root { --banner-height: 0px; }" });
3761
- const s = t.banner.color && t.banner.color in Ut ? Ut[t.banner.color] : t.banner.color ? void 0 : "bg-primary", n = s ? {} : { backgroundColor: t.banner.color };
3762
- return /* @__PURE__ */ i.jsxs(
3763
- "div",
3764
- {
3765
- className: $(
3766
- "relative text-primary-foreground text-sm font-medium px-4 py-2 flex gap-2 items-center",
3767
- s
3768
- ),
3769
- "data-pagefind-ignore": "all",
3770
- style: n,
3771
- children: [
3772
- /* @__PURE__ */ i.jsx("div", { className: "w-full", children: t.banner.message }),
3773
- t.banner.dismissible && /* @__PURE__ */ i.jsx(
3774
- "button",
3775
- {
3776
- type: "button",
3777
- className: "md:absolute md:end-4 -m-1.5 p-1.5 hover:bg-accent-foreground/10 rounded-md",
3778
- onClick: () => r(!1),
3779
- children: /* @__PURE__ */ i.jsx(Ds, { size: 16 })
3780
- }
3781
- )
3782
- ]
3783
- }
3784
- );
3785
- }, Er = (t) => /* @__PURE__ */ i.jsxs(
3786
- "svg",
3787
- {
3788
- xmlns: "http://www.w3.org/2000/svg",
3789
- viewBox: "0 0 132 100",
3790
- fill: "none",
3791
- ...t,
3792
- children: [
3793
- /* @__PURE__ */ i.jsx(
3794
- "path",
3795
- {
3796
- fill: "currentColor",
3797
- fillRule: "evenodd",
3798
- d: "M80.092 2.963A4.66 4.66 0 0 1 84.449 0h34.049c6.325 0 10.835 6.135 8.948 12.172L116.653 46.71a4.688 4.688 0 0 1-4.474 3.29H75c-5.178 0-7.813 4.687-9.375 9.374-1.288 3.864-11.07 28.963-14.467 37.662A4.66 4.66 0 0 1 46.801 100H12.75c-6.324 0-10.834-6.134-8.947-12.171l10.793-34.54A4.688 4.688 0 0 1 19.071 50H56.25c5.178 0 7.813-4.687 9.375-9.375 1.288-3.864 11.07-28.962 14.467-37.662Z",
3799
- clipRule: "evenodd"
3800
- }
3801
- ),
3802
- /* @__PURE__ */ i.jsx(
3803
- "path",
3804
- {
3805
- fill: "currentColor",
3806
- d: "M83.54 57.813a7.813 7.813 0 0 0-7.316 5.07L63.888 95.777c-.766 2.043.744 4.222 2.926 4.222h36.828c5.211 0 9.875-3.232 11.704-8.11l8.821-23.522c1.915-5.107-1.861-10.555-7.315-10.555H83.539ZM29.17 0a12.5 12.5 0 0 0-11.704 8.111l-8.82 23.521c-1.915 5.107 1.86 10.556 7.315 10.556h33.312a7.813 7.813 0 0 0 7.316-5.07L68.924 4.223C69.691 2.18 68.18 0 65.998 0H29.17Z"
3807
- }
3808
- )
3809
- ]
3810
- }
3811
- );
3812
- Er.displayName = "ZudokuLogo";
3813
- const Or = ({ className: t }) => /* @__PURE__ */ i.jsxs(
3814
- "a",
3815
- {
3816
- href: "https://zudoku.dev",
3817
- target: "_blank",
3818
- rel: "noopener noreferrer",
3819
- className: $(
3820
- "flex justify-between items-center w-full border border-transparent hover:border-border rounded-full hover:shadow-sm h-7 px-3 text-nowrap hover:bg-muted/80 transition-all",
3821
- t
3822
- ),
3823
- children: [
3824
- /* @__PURE__ */ i.jsxs("div", { className: "opacity-70 hover:opacity-100 transition-opacity gap-1.5 text-[11px] font-medium rounded-full h-7 flex items-center text-nowrap", children: [
3825
- /* @__PURE__ */ i.jsx(Er, { className: "w-3.5 h-3.5 dark:fill-white" }),
3826
- "powered by ",
3827
- "Zudoku"
3828
- ] }),
3829
- /* @__PURE__ */ i.jsx("div", { className: "text-xs font-medium opacity-70 hover:text-foreground transition-colors cursor-pointer", children: /* @__PURE__ */ i.jsx(
3830
- zs,
3831
- {
3832
- size: 12,
3833
- absoluteStrokeWidth: !0,
3834
- strokeWidth: 1.5,
3835
- className: "rtl:rotate-180"
3836
- }
3837
- ) })
3838
- ]
3839
- }
3840
- );
3841
- function Ka() {
3842
- const t = navigator.userAgent.toLowerCase();
3843
- if (t.includes("win")) return "Windows";
3844
- if (t.includes("mac")) return "macOS";
3845
- if (t.includes("linux")) return "Linux";
3846
- }
3847
- const Ar = ({ className: t }) => {
3848
- const e = Q(), [r, s] = ve(!1), n = ie(() => s(!1), []);
3849
- G(() => {
3850
- if (r)
3851
- return;
3852
- function o(c) {
3853
- c.key === "k" && (c.metaKey || c.ctrlKey) && (c.preventDefault(), s(!0));
3854
- }
3855
- return window.addEventListener("keydown", o), () => {
3856
- window.removeEventListener("keydown", o);
3857
- };
3858
- }, [r, s]);
3859
- const a = e.plugins.find(en);
3860
- return a ? /* @__PURE__ */ i.jsxs("div", { className: t, children: [
3861
- /* @__PURE__ */ i.jsxs(
3862
- "button",
3863
- {
3864
- type: "button",
3865
- onClick: () => s(!0),
3866
- className: "flex items-center border border-input hover:bg-accent hover:text-accent-foreground p-4 relative h-8 justify-start rounded-lg bg-background text-sm text-muted-foreground shadow-none w-full sm:w-72",
3867
- children: [
3868
- /* @__PURE__ */ i.jsxs("div", { className: "flex items-center gap-2 flex-grow", children: [
3869
- /* @__PURE__ */ i.jsx(qs, { size: 14 }),
3870
- "Search"
3871
- ] }),
3872
- /* @__PURE__ */ i.jsx(it, { children: /* @__PURE__ */ i.jsx(Ga, {}) })
3873
- ]
3874
- }
3875
- ),
3876
- /* @__PURE__ */ i.jsx(Tt, { fallback: null, children: a.renderSearch({
3877
- isOpen: r,
3878
- onClose: n
3879
- }) })
3880
- ] }) : null;
3881
- }, Ga = () => {
3882
- const t = Ka();
3883
- return /* @__PURE__ */ i.jsxs("kbd", { className: "absolute end-1.5 hidden h-5 select-none items-center gap-1 rounded-sm border bg-muted px-1.5 font-mono text-[11px] font-medium opacity-100 sm:flex", children: [
3884
- t === "macOS" ? "⌘" : "Ctrl",
3885
- "+K"
3886
- ] });
3887
- }, Pr = () => {
3888
- const { resolvedTheme: t, setTheme: e } = rr();
3889
- return /* @__PURE__ */ i.jsx(it, { fallback: /* @__PURE__ */ i.jsx(pt, { variant: "ghost", size: "icon" }), children: /* @__PURE__ */ i.jsxs(
3890
- "button",
3891
- {
3892
- type: "button",
3893
- className: "flex rounded-full border p-0.5 gap-0.5 group",
3894
- onClick: () => e(t === "dark" ? "light" : "dark"),
3895
- "aria-label": t === "dark" ? "Switch to light mode" : "Switch to dark mode",
3896
- children: [
3897
- /* @__PURE__ */ i.jsx(
3898
- "div",
3899
- {
3900
- className: $(
3901
- "border border-transparent rounded-full p-0.5 [&>svg>circle]:transition-colors [&>svg>path]:transition-transform transition-all [&>svg>path]:duration-200 [&>svg>circle]:duration-500 [&>svg>circle]:fill-transparent",
3902
- t === "light" && "border-border bg-muted",
3903
- t === "dark" && "group-hover:[&>svg>path]:scale-110 group-hover:[&>svg>path]:-translate-x-[1px] group-hover:[&>svg>path]:-translate-y-[1px] group-hover:rotate-[15deg] "
3904
- ),
3905
- children: /* @__PURE__ */ i.jsx(Fs, { size: 16 })
3906
- }
3907
- ),
3908
- /* @__PURE__ */ i.jsx(
3909
- "div",
3910
- {
3911
- className: $(
3912
- "border border-transparent rounded-full p-0.5 transition-transform transform-gpu duration-500",
3913
- t === "dark" && "border-border bg-muted [&>svg>path]:fill-white [&>svg>path]:stroke-transparent",
3914
- t === "light" && "group-hover:rotate-[-10deg] [&>svg>path]:stroke-currentColor"
3915
- ),
3916
- children: /* @__PURE__ */ i.jsx(Ls, { size: 16 })
3917
- }
3918
- )
3919
- ]
3920
- }
3921
- ) });
3922
- };
3923
- function st() {
3924
- return st = Object.assign ? Object.assign.bind() : function(t) {
3925
- for (var e = 1; e < arguments.length; e++) {
3926
- var r = arguments[e];
3927
- for (var s in r) ({}).hasOwnProperty.call(r, s) && (t[s] = r[s]);
3928
- }
3929
- return t;
3930
- }, st.apply(null, arguments);
3931
- }
3932
- var Qe = { exports: {} }, N = {};
3933
- /** @license React v16.13.1
3934
- * react-is.production.min.js
3935
- *
3936
- * Copyright (c) Facebook, Inc. and its affiliates.
3937
- *
3938
- * This source code is licensed under the MIT license found in the
3939
- * LICENSE file in the root directory of this source tree.
3940
- */
3941
- var Qt;
3942
- function Ja() {
3943
- if (Qt) return N;
3944
- Qt = 1;
3945
- var t = typeof Symbol == "function" && Symbol.for, e = t ? Symbol.for("react.element") : 60103, r = t ? Symbol.for("react.portal") : 60106, s = t ? Symbol.for("react.fragment") : 60107, n = t ? Symbol.for("react.strict_mode") : 60108, a = t ? Symbol.for("react.profiler") : 60114, o = t ? Symbol.for("react.provider") : 60109, c = t ? Symbol.for("react.context") : 60110, u = t ? Symbol.for("react.async_mode") : 60111, d = t ? Symbol.for("react.concurrent_mode") : 60111, f = t ? Symbol.for("react.forward_ref") : 60112, b = t ? Symbol.for("react.suspense") : 60113, k = t ? Symbol.for("react.suspense_list") : 60120, w = t ? Symbol.for("react.memo") : 60115, _ = t ? Symbol.for("react.lazy") : 60116, C = t ? Symbol.for("react.block") : 60121, M = t ? Symbol.for("react.fundamental") : 60117, I = t ? Symbol.for("react.responder") : 60118, z = t ? Symbol.for("react.scope") : 60119;
3946
- function O(m) {
3947
- if (typeof m == "object" && m !== null) {
3948
- var P = m.$$typeof;
3949
- switch (P) {
3950
- case e:
3951
- switch (m = m.type, m) {
3952
- case u:
3953
- case d:
3954
- case s:
3955
- case a:
3956
- case n:
3957
- case b:
3958
- return m;
3959
- default:
3960
- switch (m = m && m.$$typeof, m) {
3961
- case c:
3962
- case f:
3963
- case _:
3964
- case w:
3965
- case o:
3966
- return m;
3967
- default:
3968
- return P;
3969
- }
3970
- }
3971
- case r:
3972
- return P;
3973
- }
3974
- }
3975
- }
3976
- function A(m) {
3977
- return O(m) === d;
3978
- }
3979
- return N.AsyncMode = u, N.ConcurrentMode = d, N.ContextConsumer = c, N.ContextProvider = o, N.Element = e, N.ForwardRef = f, N.Fragment = s, N.Lazy = _, N.Memo = w, N.Portal = r, N.Profiler = a, N.StrictMode = n, N.Suspense = b, N.isAsyncMode = function(m) {
3980
- return A(m) || O(m) === u;
3981
- }, N.isConcurrentMode = A, N.isContextConsumer = function(m) {
3982
- return O(m) === c;
3983
- }, N.isContextProvider = function(m) {
3984
- return O(m) === o;
3985
- }, N.isElement = function(m) {
3986
- return typeof m == "object" && m !== null && m.$$typeof === e;
3987
- }, N.isForwardRef = function(m) {
3988
- return O(m) === f;
3989
- }, N.isFragment = function(m) {
3990
- return O(m) === s;
3991
- }, N.isLazy = function(m) {
3992
- return O(m) === _;
3993
- }, N.isMemo = function(m) {
3994
- return O(m) === w;
3995
- }, N.isPortal = function(m) {
3996
- return O(m) === r;
3997
- }, N.isProfiler = function(m) {
3998
- return O(m) === a;
3999
- }, N.isStrictMode = function(m) {
4000
- return O(m) === n;
4001
- }, N.isSuspense = function(m) {
4002
- return O(m) === b;
4003
- }, N.isValidElementType = function(m) {
4004
- return typeof m == "string" || typeof m == "function" || m === s || m === d || m === a || m === n || m === b || m === k || typeof m == "object" && m !== null && (m.$$typeof === _ || m.$$typeof === w || m.$$typeof === o || m.$$typeof === c || m.$$typeof === f || m.$$typeof === M || m.$$typeof === I || m.$$typeof === z || m.$$typeof === C);
4005
- }, N.typeOf = O, N;
4006
- }
4007
- var E = {};
4008
- /** @license React v16.13.1
4009
- * react-is.development.js
4010
- *
4011
- * Copyright (c) Facebook, Inc. and its affiliates.
4012
- *
4013
- * This source code is licensed under the MIT license found in the
4014
- * LICENSE file in the root directory of this source tree.
4015
- */
4016
- var Ht;
4017
- function Xa() {
4018
- return Ht || (Ht = 1, process.env.NODE_ENV !== "production" && function() {
4019
- var t = typeof Symbol == "function" && Symbol.for, e = t ? Symbol.for("react.element") : 60103, r = t ? Symbol.for("react.portal") : 60106, s = t ? Symbol.for("react.fragment") : 60107, n = t ? Symbol.for("react.strict_mode") : 60108, a = t ? Symbol.for("react.profiler") : 60114, o = t ? Symbol.for("react.provider") : 60109, c = t ? Symbol.for("react.context") : 60110, u = t ? Symbol.for("react.async_mode") : 60111, d = t ? Symbol.for("react.concurrent_mode") : 60111, f = t ? Symbol.for("react.forward_ref") : 60112, b = t ? Symbol.for("react.suspense") : 60113, k = t ? Symbol.for("react.suspense_list") : 60120, w = t ? Symbol.for("react.memo") : 60115, _ = t ? Symbol.for("react.lazy") : 60116, C = t ? Symbol.for("react.block") : 60121, M = t ? Symbol.for("react.fundamental") : 60117, I = t ? Symbol.for("react.responder") : 60118, z = t ? Symbol.for("react.scope") : 60119;
4020
- function O(v) {
4021
- return typeof v == "string" || typeof v == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
4022
- v === s || v === d || v === a || v === n || v === b || v === k || typeof v == "object" && v !== null && (v.$$typeof === _ || v.$$typeof === w || v.$$typeof === o || v.$$typeof === c || v.$$typeof === f || v.$$typeof === M || v.$$typeof === I || v.$$typeof === z || v.$$typeof === C);
4023
- }
4024
- function A(v) {
4025
- if (typeof v == "object" && v !== null) {
4026
- var dt = v.$$typeof;
4027
- switch (dt) {
4028
- case e:
4029
- var Be = v.type;
4030
- switch (Be) {
4031
- case u:
4032
- case d:
4033
- case s:
4034
- case a:
4035
- case n:
4036
- case b:
4037
- return Be;
4038
- default:
4039
- var Et = Be && Be.$$typeof;
4040
- switch (Et) {
4041
- case c:
4042
- case f:
4043
- case _:
4044
- case w:
4045
- case o:
4046
- return Et;
4047
- default:
4048
- return dt;
4049
- }
4050
- }
4051
- case r:
4052
- return dt;
4053
- }
4054
- }
4055
- }
4056
- var m = u, P = d, H = c, ne = o, ye = e, ae = f, ct = s, fe = _, Ur = w, Qr = r, Hr = a, Wr = n, Yr = b, Ct = !1;
4057
- function Kr(v) {
4058
- return Ct || (Ct = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), Nt(v) || A(v) === u;
4059
- }
4060
- function Nt(v) {
4061
- return A(v) === d;
4062
- }
4063
- function Gr(v) {
4064
- return A(v) === c;
4065
- }
4066
- function Jr(v) {
4067
- return A(v) === o;
4068
- }
4069
- function Xr(v) {
4070
- return typeof v == "object" && v !== null && v.$$typeof === e;
4071
- }
4072
- function es(v) {
4073
- return A(v) === f;
4074
- }
4075
- function ts(v) {
4076
- return A(v) === s;
4077
- }
4078
- function rs(v) {
4079
- return A(v) === _;
4080
- }
4081
- function ss(v) {
4082
- return A(v) === w;
4083
- }
4084
- function ns(v) {
4085
- return A(v) === r;
4086
- }
4087
- function as(v) {
4088
- return A(v) === a;
4089
- }
4090
- function is(v) {
4091
- return A(v) === n;
4092
- }
4093
- function os(v) {
4094
- return A(v) === b;
4095
- }
4096
- E.AsyncMode = m, E.ConcurrentMode = P, E.ContextConsumer = H, E.ContextProvider = ne, E.Element = ye, E.ForwardRef = ae, E.Fragment = ct, E.Lazy = fe, E.Memo = Ur, E.Portal = Qr, E.Profiler = Hr, E.StrictMode = Wr, E.Suspense = Yr, E.isAsyncMode = Kr, E.isConcurrentMode = Nt, E.isContextConsumer = Gr, E.isContextProvider = Jr, E.isElement = Xr, E.isForwardRef = es, E.isFragment = ts, E.isLazy = rs, E.isMemo = ss, E.isPortal = ns, E.isProfiler = as, E.isStrictMode = is, E.isSuspense = os, E.isValidElementType = O, E.typeOf = A;
4097
- }()), E;
4098
- }
4099
- var Wt;
4100
- function ei() {
4101
- return Wt || (Wt = 1, process.env.NODE_ENV === "production" ? Qe.exports = Ja() : Qe.exports = Xa()), Qe.exports;
4102
- }
4103
- var ht, Yt;
4104
- function ti() {
4105
- if (Yt) return ht;
4106
- Yt = 1;
4107
- var t = ei(), e = {
4108
- childContextTypes: !0,
4109
- contextType: !0,
4110
- contextTypes: !0,
4111
- defaultProps: !0,
4112
- displayName: !0,
4113
- getDefaultProps: !0,
4114
- getDerivedStateFromError: !0,
4115
- getDerivedStateFromProps: !0,
4116
- mixins: !0,
4117
- propTypes: !0,
4118
- type: !0
4119
- }, r = {
4120
- name: !0,
4121
- length: !0,
4122
- prototype: !0,
4123
- caller: !0,
4124
- callee: !0,
4125
- arguments: !0,
4126
- arity: !0
4127
- }, s = {
4128
- $$typeof: !0,
4129
- render: !0,
4130
- defaultProps: !0,
4131
- displayName: !0,
4132
- propTypes: !0
4133
- }, n = {
4134
- $$typeof: !0,
4135
- compare: !0,
4136
- defaultProps: !0,
4137
- displayName: !0,
4138
- propTypes: !0,
4139
- type: !0
4140
- }, a = {};
4141
- a[t.ForwardRef] = s, a[t.Memo] = n;
4142
- function o(_) {
4143
- return t.isMemo(_) ? n : a[_.$$typeof] || e;
4144
- }
4145
- var c = Object.defineProperty, u = Object.getOwnPropertyNames, d = Object.getOwnPropertySymbols, f = Object.getOwnPropertyDescriptor, b = Object.getPrototypeOf, k = Object.prototype;
4146
- function w(_, C, M) {
4147
- if (typeof C != "string") {
4148
- if (k) {
4149
- var I = b(C);
4150
- I && I !== k && w(_, I, M);
4151
- }
4152
- var z = u(C);
4153
- d && (z = z.concat(d(C)));
4154
- for (var O = o(_), A = o(C), m = 0; m < z.length; ++m) {
4155
- var P = z[m];
4156
- if (!r[P] && !(M && M[P]) && !(A && A[P]) && !(O && O[P])) {
4157
- var H = f(C, P);
4158
- try {
4159
- c(_, P, H);
4160
- } catch {
4161
- }
4162
- }
4163
- }
4164
- }
4165
- return _;
4166
- }
4167
- return ht = w, ht;
4168
- }
4169
- ti();
4170
- var Rr = function(e, r, s) {
4171
- return e = e <= s ? e : s, e = e >= r ? e : r, e;
4172
- }, ri = function() {
4173
- var e = !1, r = [], s = function() {
4174
- e = !0;
4175
- var c = r.shift();
4176
- if (c)
4177
- return c(s);
4178
- e = !1;
4179
- }, n = function() {
4180
- e = !1, r = [];
4181
- }, a = function(c) {
4182
- r.push(c), !e && r.length === 1 && s();
4183
- };
4184
- return {
4185
- clear: n,
4186
- enqueue: a
4187
- };
4188
- }, si = function() {
4189
- var e, r = function() {
4190
- e && window.cancelAnimationFrame(e);
4191
- }, s = function(a, o) {
4192
- var c, u, d = function(b) {
4193
- if (u = u || b, c = b - u, c > o) {
4194
- a();
4195
- return;
4196
- }
4197
- e = window.requestAnimationFrame(d);
4198
- };
4199
- e = window.requestAnimationFrame(d);
4200
- };
4201
- return {
4202
- cancel: r,
4203
- schedule: s
4204
- };
4205
- }, ni = function(e) {
4206
- var r = 0;
4207
- return e >= 0 && e < 0.2 ? r = 0.1 : e >= 0.2 && e < 0.5 ? r = 0.04 : e >= 0.5 && e < 0.8 ? r = 0.02 : e >= 0.8 && e < 0.99 && (r = 5e-3), Rr(e + r, 0, 0.994);
4208
- }, Kt = function(e) {
4209
- G(e, []);
4210
- }, ai = function(e) {
4211
- return ++e % 1e6;
4212
- }, ii = function() {
4213
- var e = ve(0), r = e[1];
4214
- return ie(function() {
4215
- return r(ai);
4216
- }, []);
4217
- }, oi = function(e) {
4218
- e === void 0 && (e = {});
4219
- var r = ii(), s = oe(st({}, e)), n = ie(function() {
4220
- return s.current;
4221
- }, []), a = ie(function(o) {
4222
- o && (Object.assign(s.current, o), r());
4223
- }, []);
4224
- return [n, a];
4225
- }, ci = function() {
4226
- var e = oe(!0);
4227
- return e.current ? (e.current = !1, !0) : e.current;
4228
- }, Gt = function(e, r) {
4229
- var s = ci();
4230
- G(function() {
4231
- if (!s)
4232
- return e();
4233
- }, r);
4234
- }, Mr = function() {
4235
- }, Jt = {
4236
- isFinished: !0,
4237
- progress: 0,
4238
- sideEffect: Mr
4239
- }, di = function(e) {
4240
- var r = e === void 0 ? {} : e, s = r.animationDuration, n = s === void 0 ? 200 : s, a = r.incrementDuration, o = a === void 0 ? 800 : a, c = r.isAnimating, u = c === void 0 ? !1 : c, d = r.minimum, f = d === void 0 ? 0.08 : d, b = oi(Jt), k = b[0], w = b[1], _ = oe(null), C = oe(null);
4241
- Kt(function() {
4242
- _.current = ri(), C.current = si();
4243
- });
4244
- var M = ie(function() {
4245
- var P, H;
4246
- (P = C.current) == null || P.cancel(), (H = _.current) == null || H.clear();
4247
- }, []), I = ie(function(P) {
4248
- var H;
4249
- if (P = Rr(P, f, 1), P === 1) {
4250
- var ne, ye;
4251
- M(), (ne = _.current) == null || ne.enqueue(function(ae) {
4252
- w({
4253
- progress: P,
4254
- sideEffect: function() {
4255
- var fe;
4256
- return (fe = C.current) == null ? void 0 : fe.schedule(ae, n);
4257
- }
4258
- });
4259
- }), (ye = _.current) == null || ye.enqueue(function() {
4260
- w({
4261
- isFinished: !0,
4262
- sideEffect: M
4263
- });
4264
- });
4265
- return;
4266
- }
4267
- (H = _.current) == null || H.enqueue(function(ae) {
4268
- w({
4269
- isFinished: !1,
4270
- progress: P,
4271
- sideEffect: function() {
4272
- var fe;
4273
- return (fe = C.current) == null ? void 0 : fe.schedule(ae, n);
4274
- }
4275
- });
4276
- });
4277
- }, [n, M, f, _, w, C]), z = ie(function() {
4278
- I(ni(k().progress));
4279
- }, [k, I]), O = ie(function() {
4280
- var P = function() {
4281
- var ne;
4282
- z(), (ne = _.current) == null || ne.enqueue(function(ye) {
4283
- var ae;
4284
- (ae = C.current) == null || ae.schedule(function() {
4285
- P(), ye();
4286
- }, o);
4287
- });
4288
- };
4289
- P();
4290
- }, [o, _, C, z]), A = oe(Mr), m = k().sideEffect;
4291
- return G(function() {
4292
- A.current = z;
4293
- }), Kt(function() {
4294
- return u && O(), M;
4295
- }), Gt(function() {
4296
- k().sideEffect();
4297
- }, [k, m]), Gt(function() {
4298
- u ? w(st({}, Jt, {
4299
- sideEffect: O
4300
- })) : I(1);
4301
- }, [u, I, w, O]), {
4302
- animationDuration: n,
4303
- isFinished: k().isFinished,
4304
- progress: k().progress
4305
- };
4306
- };
4307
- const Ir = (t) => (e) => e.display === "hide" ? !1 : e.display === "auth" && t || e.display === "anon" && !t || !e.display || e.display === "always", Zr = () => {
4308
- const e = at().state === "loading", [r, s] = ve(!1);
4309
- G(() => {
4310
- const o = setTimeout(() => s(e), 100);
4311
- return () => clearTimeout(o);
4312
- }, [e]);
4313
- const { isFinished: n, progress: a } = di({ isAnimating: r });
4314
- return /* @__PURE__ */ i.jsx(
4315
- "div",
4316
- {
4317
- className: "absolute w-0 left-0 right-0 bottom-[-1px] h-[2px] bg-primary transition-all duration-300 ease-in-out",
4318
- style: {
4319
- opacity: n ? 0 : 1,
4320
- width: n ? 0 : `${a * 100}%`
4321
- }
4322
- }
4323
- );
4324
- }, ui = () => {
4325
- const { topNavigation: t } = Q(), { isAuthenticated: e } = Ne(), r = t.filter(Ir(e));
4326
- return r.length === 0 ? /* @__PURE__ */ i.jsx("style", { children: ":root { --top-nav-height: 0px; }" }) : /* @__PURE__ */ i.jsxs(Tt, { children: [
4327
- /* @__PURE__ */ i.jsxs("div", { className: "items-center justify-between px-8 h-[--top-nav-height] hidden lg:flex text-sm relative", children: [
4328
- /* @__PURE__ */ i.jsx("nav", { className: "text-sm", children: /* @__PURE__ */ i.jsx("ul", { className: "flex flex-row items-center gap-8", children: r.map((s) => /* @__PURE__ */ i.jsx("li", { children: /* @__PURE__ */ i.jsx($r, { ...s }) }, s.id)) }) }),
4329
- /* @__PURE__ */ i.jsx(F, { name: "top-navigation-side" })
4330
- ] }),
4331
- /* @__PURE__ */ i.jsx(Zr, {})
4332
- ] });
4333
- }, $r = ({
4334
- id: t,
4335
- label: e,
4336
- default: r
4337
- }) => {
4338
- const { sidebars: s } = Q(), n = s[t], a = cr(), o = !!at().location, c = a.topNavItem?.id === t && !o, u = r ?? (n ? bs(n, (d) => {
4339
- if (d.type === "doc") return be(d.id);
4340
- }) : be(t)) ?? be(t);
4341
- return (
4342
- // We don't use isActive here because it has to be inside the sidebar,
4343
- // the top nav id doesn't necessarily start with the sidebar id
4344
- /* @__PURE__ */ i.jsx(
4345
- fs,
4346
- {
4347
- className: ({ isPending: d }) => bn(
4348
- "block lg:py-3.5 font-medium -mb-px",
4349
- c || d ? "border-primary text-foreground" : "border-transparent text-foreground/75 hover:text-foreground hover:border-accent-foreground/25"
4350
- ),
4351
- to: u,
4352
- children: e
4353
- }
4354
- )
4355
- );
4356
- }, li = () => {
4357
- const { topNavigation: t, options: e } = Q(), { isAuthenticated: r } = Ne(), [s, n] = ve(!1);
4358
- return /* @__PURE__ */ i.jsxs(
4359
- xn,
4360
- {
4361
- direction: e.page?.dir === "rtl" ? "left" : "right",
4362
- open: s,
4363
- onOpenChange: (a) => n(a),
4364
- children: [
4365
- /* @__PURE__ */ i.jsxs("div", { className: "flex lg:hidden justify-self-end", children: [
4366
- /* @__PURE__ */ i.jsx(_n, { className: "lg:hidden", children: /* @__PURE__ */ i.jsx(Bs, { size: 22 }) }),
4367
- /* @__PURE__ */ i.jsx(Zr, {})
4368
- ] }),
4369
- /* @__PURE__ */ i.jsx(
4370
- pr,
4371
- {
4372
- className: "lg:hidden h-[100dvh] end-0 start-auto w-[320px] rounded-none",
4373
- "aria-describedby": void 0,
4374
- children: /* @__PURE__ */ i.jsxs("div", { className: "p-4 overflow-y-auto overscroll-none h-full flex flex-col justify-between", children: [
4375
- /* @__PURE__ */ i.jsxs("div", { children: [
4376
- /* @__PURE__ */ i.jsx(mr, { children: /* @__PURE__ */ i.jsx(gr, { children: "Navigation" }) }),
4377
- /* @__PURE__ */ i.jsx(Ar, { className: "flex p-4" }),
4378
- /* @__PURE__ */ i.jsxs("ul", { className: "flex flex-col items-center gap-4 p-4", children: [
4379
- /* @__PURE__ */ i.jsx("li", { children: /* @__PURE__ */ i.jsx(Pr, {}) }),
4380
- t.filter(Ir(r)).map((a) => /* @__PURE__ */ i.jsx("li", { children: /* @__PURE__ */ i.jsx("button", { type: "button", onClick: () => n(!1), children: /* @__PURE__ */ i.jsx($r, { ...a }) }) }, a.label))
4381
- ] })
4382
- ] }),
4383
- e.page?.showPoweredBy !== !1 && /* @__PURE__ */ i.jsx(Or, { className: "flex-grow-0 justify-center gap-1" })
4384
- ] })
4385
- }
4386
- )
4387
- ]
4388
- }
4389
- );
4390
- }, We = ({ item: t }) => t.children ? /* @__PURE__ */ i.jsxs(mn, { children: [
4391
- /* @__PURE__ */ i.jsx(pn, { children: t.label }),
4392
- /* @__PURE__ */ i.jsx(gn, { children: /* @__PURE__ */ i.jsx(vn, { children: t.children.map((e, r) => (
4393
- // eslint-disable-next-line react/no-array-index-key
4394
- /* @__PURE__ */ i.jsx(We, { item: e }, r)
4395
- )) }) })
4396
- ] }, t.label) : /* @__PURE__ */ i.jsx(kt, { to: t.path ?? "", children: /* @__PURE__ */ i.jsxs(yn, { className: "flex gap-2", children: [
4397
- t.icon && /* @__PURE__ */ i.jsx(t.icon, { size: 16, strokeWidth: 1, absoluteStrokeWidth: !0 }),
4398
- t.label
4399
- ] }, t.label) }), Dr = fr(function() {
4400
- const e = Ne(), { isAuthenticated: r, profile: s, isAuthEnabled: n } = Ne(), a = Q(), { page: o, plugins: c } = a, u = c.filter((d) => tn(d)).flatMap((d) => d.getProfileMenuItems(a)).sort((d) => d.weight ?? 0);
4401
- return /* @__PURE__ */ i.jsxs("header", { className: "sticky lg:top-0 z-10 bg-background/80 backdrop-blur w-full", children: [
4402
- /* @__PURE__ */ i.jsx(Ya, {}),
4403
- /* @__PURE__ */ i.jsx("div", { className: "border-b", children: /* @__PURE__ */ i.jsxs("div", { className: "max-w-screen-2xl mx-auto flex relative items-center justify-between px-4 lg:px-8 h-[--top-header-height] border-transparent", children: [
4404
- /* @__PURE__ */ i.jsx("div", { className: "flex", children: /* @__PURE__ */ i.jsx(kt, { to: "/", children: /* @__PURE__ */ i.jsxs("div", { className: "flex items-center gap-3.5", children: [
4405
- o?.logo && /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
4406
- /* @__PURE__ */ i.jsx(
4407
- "img",
4408
- {
4409
- src: /https?:\/\//.test(o.logo.src.light) ? o.logo.src.light : be(
4410
- "/",
4411
- o.logo.src.light
4412
- ),
4413
- alt: o.logo.alt ?? o.pageTitle,
4414
- style: { width: o.logo.width },
4415
- className: "h-10 dark:hidden",
4416
- loading: "lazy"
4417
- }
4418
- ),
4419
- /* @__PURE__ */ i.jsx(
4420
- "img",
4421
- {
4422
- src: /https?:\/\//.test(o.logo.src.dark) ? o.logo.src.dark : be(
4423
- "/",
4424
- o.logo.src.dark
4425
- ),
4426
- alt: o.logo.alt ?? o.pageTitle,
4427
- style: { width: o.logo.width },
4428
- className: "h-10 hidden dark:block",
4429
- loading: "lazy"
4430
- }
4431
- )
4432
- ] }),
4433
- /* @__PURE__ */ i.jsx("span", { className: "font-semibold text-2xl", children: o?.pageTitle })
4434
- ] }) }) }),
4435
- /* @__PURE__ */ i.jsx("div", { className: "absolute inset-x-0 justify-center items-center hidden lg:flex w-full pointer-events-none", children: /* @__PURE__ */ i.jsx(Ar, { className: "pointer-events-auto" }) }),
4436
- /* @__PURE__ */ i.jsxs("div", { className: "flex items-center gap-8", children: [
4437
- /* @__PURE__ */ i.jsx(li, {}),
4438
- /* @__PURE__ */ i.jsxs("div", { className: "hidden lg:flex items-center justify-self-end text-sm gap-2", children: [
4439
- /* @__PURE__ */ i.jsx(F, { name: "head-navigation-start" }),
4440
- n && /* @__PURE__ */ i.jsx(
4441
- it,
4442
- {
4443
- fallback: /* @__PURE__ */ i.jsx(Wa, { className: "rounded h-5 w-24 mr-4" }),
4444
- children: r ? Object.values(u).length > 0 && /* @__PURE__ */ i.jsxs(un, { modal: !1, children: [
4445
- /* @__PURE__ */ i.jsx(ln, { asChild: !0, children: /* @__PURE__ */ i.jsx(pt, { variant: "ghost", children: s?.name ? `${s.name}` : "My Account" }) }),
4446
- /* @__PURE__ */ i.jsxs(fn, { className: "w-56", children: [
4447
- /* @__PURE__ */ i.jsxs(hn, { children: [
4448
- s?.name ? `${s.name}` : "My Account",
4449
- s?.email && /* @__PURE__ */ i.jsx("div", { className: "font-normal text-muted-foreground", children: s.email })
4450
- ] }),
4451
- u.filter((d) => d.category === "top").length > 0 && /* @__PURE__ */ i.jsx(lt, {}),
4452
- u.filter((d) => d.category === "top").map((d) => /* @__PURE__ */ i.jsx(We, { item: d }, d.label)),
4453
- u.filter(
4454
- (d) => !d.category || d.category === "middle"
4455
- ).length > 0 && /* @__PURE__ */ i.jsx(lt, {}),
4456
- u.filter(
4457
- (d) => !d.category || d.category === "middle"
4458
- ).map((d) => /* @__PURE__ */ i.jsx(We, { item: d }, d.label)),
4459
- u.filter((d) => d.category === "bottom").length > 0 && /* @__PURE__ */ i.jsx(lt, {}),
4460
- u.filter((d) => d.category === "bottom").map((d) => /* @__PURE__ */ i.jsx(We, { item: d }, d.label))
4461
- ] })
4462
- ] }) : /* @__PURE__ */ i.jsx(pt, { variant: "ghost", onClick: () => e.login(), children: "Login" })
4463
- }
4464
- ),
4465
- /* @__PURE__ */ i.jsx(F, { name: "head-navigation-end" }),
4466
- /* @__PURE__ */ i.jsx(Pr, {})
4467
- ] })
4468
- ] })
4469
- ] }) }),
4470
- /* @__PURE__ */ i.jsx("div", { className: "border-b hidden lg:block", children: /* @__PURE__ */ i.jsxs("div", { className: "max-w-screen-2xl mx-auto border-transparent", children: [
4471
- /* @__PURE__ */ i.jsx(F, { name: "top-navigation-before" }),
4472
- /* @__PURE__ */ i.jsx(ui, {}),
4473
- /* @__PURE__ */ i.jsx(F, { name: "top-navigation-after" })
4474
- ] }) })
4475
- ] });
4476
- }), zr = ({
4477
- shouldScaleBackground: t = !0,
4478
- ...e
4479
- }) => /* @__PURE__ */ i.jsx(
4480
- J.Root,
4481
- {
4482
- shouldScaleBackground: t,
4483
- ...e
4484
- }
4485
- );
4486
- zr.displayName = "Drawer";
4487
- const fi = J.Trigger, hi = J.Portal, qr = re.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i.jsx(
4488
- J.Overlay,
4489
- {
4490
- ref: r,
4491
- className: $("fixed inset-0 z-50 bg-black/80", t),
4492
- ...e
4493
- }
4494
- ));
4495
- qr.displayName = J.Overlay.displayName;
4496
- const mi = re.forwardRef(
4497
- ({ className: t, children: e, hideBar: r = !0, ...s }, n) => /* @__PURE__ */ i.jsxs(hi, { children: [
4498
- /* @__PURE__ */ i.jsx(qr, {}),
4499
- /* @__PURE__ */ i.jsxs(
4500
- J.Content,
4501
- {
4502
- ref: n,
4503
- className: $(
4504
- "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
4505
- t
4506
- ),
4507
- ...s,
4508
- children: [
4509
- !r && /* @__PURE__ */ i.jsx("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" }),
4510
- e
4511
- ]
4512
- }
4513
- )
4514
- ] })
4515
- );
4516
- mi.displayName = "DrawerContent";
4517
- const pi = re.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i.jsx(
4518
- J.Title,
4519
- {
4520
- ref: r,
4521
- className: $(
4522
- "text-lg font-semibold leading-none tracking-tight",
4523
- t
4524
- ),
4525
- ...e
4526
- }
4527
- ));
4528
- pi.displayName = J.Title.displayName;
4529
- const gi = re.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i.jsx(
4530
- J.Description,
4531
- {
4532
- ref: r,
4533
- className: $("text-sm text-muted-foreground", t),
4534
- ...e
4535
- }
4536
- ));
4537
- gi.displayName = J.Description.displayName;
4538
- const Fr = ({
4539
- children: t,
4540
- className: e
4541
- }) => {
4542
- const { options: r } = Q(), s = oe(null);
4543
- return G(() => {
4544
- const n = s.current?.querySelector('[aria-current="page"]');
4545
- Qs(n ?? null);
4546
- }, []), /* @__PURE__ */ i.jsxs("div", { className: "grid sticky top-[--header-height] lg:h-[calc(100vh-var(--header-height))] grid-rows-[1fr_min-content] border-r", children: [
4547
- /* @__PURE__ */ i.jsx(
4548
- "nav",
4549
- {
4550
- ref: s,
4551
- className: $(
4552
- "hidden max-w-[calc(var(--side-nav-width)+var(--padding-nav-item))] lg:flex scrollbar flex-col overflow-y-auto shrink-0 text-sm pe-3 ps-4 lg:ps-8",
4553
- "-mx-[--padding-nav-item] pb-[8vh] pt-[--padding-content-top] scroll-pt-2 gap-1",
4554
- // Revert the padding/margin on the first child
4555
- "-mt-2.5",
4556
- e
4557
- ),
4558
- style: {
4559
- maskImage: "linear-gradient(180deg, transparent 1%, rgba(0, 0, 0, 1) 20px, rgba(0, 0, 0, 1) 90%, transparent 99%)"
4560
- },
4561
- children: t
4562
- }
4563
- ),
4564
- /* @__PURE__ */ i.jsx("div", { className: "bg-background border-t p-2 mx-5 gap-2 items-center mt-2 drop-shadow-[0_-3px_1px_rgba(0,0,0,0.015)] hidden lg:[&:has(>_:nth-child(1):last-child)]:flex", children: r.page?.showPoweredBy !== !1 && /* @__PURE__ */ i.jsx(Or, {}) })
4565
- ] });
4566
- };
4567
- Fr.displayName = "SidebarWrapper";
4568
- const vi = ({
4569
- onRequestClose: t,
4570
- sidebar: e
4571
- }) => /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
4572
- /* @__PURE__ */ i.jsxs(Fr, { children: [
4573
- /* @__PURE__ */ i.jsx(F, { name: "zudoku-before-navigation" }),
4574
- e.map((r) => /* @__PURE__ */ i.jsx(
4575
- $t,
4576
- {
4577
- item: r
4578
- },
4579
- ("id" in r ? r.id : "") + ("href" in r ? r.href : "") + r.label
4580
- )),
4581
- /* @__PURE__ */ i.jsx(F, { name: "zudoku-after-navigation" })
4582
- ] }),
4583
- /* @__PURE__ */ i.jsx(
4584
- pr,
4585
- {
4586
- className: "lg:hidden h-[100dvh] start-0 w-[320px] rounded-none",
4587
- "aria-describedby": void 0,
4588
- children: /* @__PURE__ */ i.jsxs("div", { className: "p-4 overflow-y-auto overscroll-none", children: [
4589
- /* @__PURE__ */ i.jsx(mr, { children: /* @__PURE__ */ i.jsx(gr, { children: "Sidebar" }) }),
4590
- e.map((r) => /* @__PURE__ */ i.jsx(
4591
- $t,
4592
- {
4593
- item: r,
4594
- onRequestClose: t
4595
- },
4596
- r.label
4597
- ))
4598
- ] })
4599
- }
4600
- )
4601
- ] }), yi = ({ children: t }) => {
4602
- const [e, r] = ve(!1), { sidebar: s } = cr(), n = s.length > 0, a = at().state === "loading", { options: o } = Q();
4603
- return /* @__PURE__ */ i.jsxs(
4604
- zr,
4605
- {
4606
- direction: o.page?.dir === "rtl" ? "right" : "left",
4607
- open: e,
4608
- onOpenChange: (c) => r(c),
4609
- children: [
4610
- n && /* @__PURE__ */ i.jsx(
4611
- vi,
4612
- {
4613
- onRequestClose: () => r(!1),
4614
- sidebar: s
4615
- }
4616
- ),
4617
- n && /* @__PURE__ */ i.jsx("div", { className: "lg:hidden -mx-4 px-4 py-2 sticky bg-background/80 backdrop-blur z-10 top-0 start-0 end-0 border-b", children: /* @__PURE__ */ i.jsxs(fi, { className: "flex items-center gap-2 px-4", children: [
4618
- /* @__PURE__ */ i.jsx(Vs, { size: 16, strokeWidth: 1.5 }),
4619
- /* @__PURE__ */ i.jsx("span", { className: "text-sm", children: "Menu" })
4620
- ] }) }),
4621
- /* @__PURE__ */ i.jsxs(
4622
- "main",
4623
- {
4624
- "data-pagefind-body": !0,
4625
- className: $(
4626
- "px-4 lg:pe-8 lg:px-8",
4627
- !n && "col-span-full",
4628
- a && "animate-pulse"
4629
- ),
4630
- children: [
4631
- /* @__PURE__ */ i.jsx(F, { name: "zudoku-before-content" }),
4632
- t,
4633
- /* @__PURE__ */ i.jsx(F, { name: "zudoku-after-content" })
4634
- ]
4635
- }
4636
- )
4637
- ]
4638
- }
4639
- );
4640
- }, xi = () => /* @__PURE__ */ i.jsx("main", { className: "col-span-full row-span-full grid place-items-center", children: /* @__PURE__ */ i.jsx(hr, {}) }), _i = ({ children: t }) => {
4641
- const { meta: e, authentication: r, options: s } = Q(), n = nt();
4642
- return Hs(), Va(), G(() => {
4643
- r?.onPageLoad?.();
4644
- }, [r]), /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
4645
- /* @__PURE__ */ i.jsxs(wt, { titleTemplate: e?.title, children: [
4646
- s.canonicalUrlOrigin && /* @__PURE__ */ i.jsx(
4647
- "link",
4648
- {
4649
- rel: "canonical",
4650
- href: be(
4651
- s.canonicalUrlOrigin,
4652
- s.basePath,
4653
- n.pathname
4654
- )
4655
- }
4656
- ),
4657
- e?.description && /* @__PURE__ */ i.jsx("meta", { name: "description", content: e.description }),
4658
- e?.favicon && /* @__PURE__ */ i.jsx("link", { rel: "icon", href: e.favicon })
4659
- ] }),
4660
- /* @__PURE__ */ i.jsx(F, { name: "layout-before-head" }),
4661
- /* @__PURE__ */ i.jsx(Dr, {}),
4662
- /* @__PURE__ */ i.jsx(F, { name: "layout-after-head" }),
4663
- /* @__PURE__ */ i.jsx(
4664
- "div",
4665
- {
4666
- className: $(
4667
- "grid max-w-screen-2xl w-full lg:mx-auto",
4668
- "[&:has(>:only-child)]:grid-rows-1 grid-rows-[0_min-content_1fr] lg:grid-rows-[min-content_1fr]",
4669
- "grid-cols-1 lg:grid-cols-[var(--side-nav-width)_1fr]"
4670
- ),
4671
- children: /* @__PURE__ */ i.jsx(Tt, { fallback: /* @__PURE__ */ i.jsx(xi, {}), children: /* @__PURE__ */ i.jsx(yi, { children: t ?? /* @__PURE__ */ i.jsx(sr, {}) }) })
4672
- }
4673
- ),
4674
- /* @__PURE__ */ i.jsx(Ha, {})
4675
- ] });
4676
- }, bi = ({
4677
- title: t = "An error occurred",
4678
- message: e,
4679
- category: r
4680
- }) => /* @__PURE__ */ i.jsxs("div", { className: Ys + " h-full pt-[--padding-content-top]", children: [
4681
- r && /* @__PURE__ */ i.jsx(Xs, { children: r }),
4682
- t && /* @__PURE__ */ i.jsx(Ws, { level: 1, className: "flex gap-3.5 items-center", children: t }),
4683
- /* @__PURE__ */ i.jsx("p", { children: e })
4684
- ] }), wi = (t) => {
4685
- switch (t) {
4686
- case 400:
4687
- return {
4688
- title: "Bad Request",
4689
- message: "The request could not be understood by the server due to malformed syntax."
4690
- };
4691
- case 403:
4692
- return {
4693
- title: "Forbidden",
4694
- message: "You don't have permission to access this resource."
4695
- };
4696
- case 404:
4697
- return {
4698
- title: "Not Found",
4699
- message: "The requested resource could not be found."
4700
- };
4701
- case 405:
4702
- return {
4703
- title: "Method Not Allowed",
4704
- message: "The request method is not supported for the requested resource."
4705
- };
4706
- case 414:
4707
- return {
4708
- title: "Request URI Too Large",
4709
- message: "The request URI is too large."
4710
- };
4711
- case 416:
4712
- return {
4713
- title: "Range Not Satisfiable",
4714
- message: "The server cannot satisfy the request range."
4715
- };
4716
- case 500:
4717
- return {
4718
- title: "Internal Server Error",
4719
- message: "An unexpected error occurred while processing your request."
4720
- };
4721
- case 501:
4722
- return {
4723
- title: "Not Implemented",
4724
- message: "The server does not support the functionality required to fulfill the request."
4725
- };
4726
- case 502:
4727
- return {
4728
- title: "Bad Gateway",
4729
- message: "The server received an invalid response from the upstream server."
4730
- };
4731
- case 503:
4732
- return {
4733
- title: "Service Unavailable",
4734
- message: "The server is temporarily unable to handle the request."
4735
- };
4736
- case 504:
4737
- return {
4738
- title: "Gateway Timeout",
4739
- message: "The server did not receive a timely response from the upstream server."
4740
- };
4741
- default:
4742
- return {
4743
- title: "An error occurred",
4744
- message: "Something went wrong while processing your request."
4745
- };
4746
- }
4747
- }, ki = ({ statusCode: t, message: e }) => {
4748
- const r = wi(t);
4749
- return /* @__PURE__ */ i.jsx(
4750
- bi,
4751
- {
4752
- title: r.title,
4753
- message: e ?? r.message,
4754
- category: t
4755
- }
4756
- );
4757
- }, ji = jt(null), mt = {
4758
- didCatch: !1,
4759
- error: null
4760
- };
4761
- class Ti extends Ps {
4762
- constructor(e) {
4763
- super(e), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = mt;
4764
- }
4765
- static getDerivedStateFromError(e) {
4766
- return {
4767
- didCatch: !0,
4768
- error: e
4769
- };
4770
- }
4771
- resetErrorBoundary() {
4772
- const {
4773
- error: e
4774
- } = this.state;
4775
- if (e !== null) {
4776
- for (var r, s, n = arguments.length, a = new Array(n), o = 0; o < n; o++)
4777
- a[o] = arguments[o];
4778
- (r = (s = this.props).onReset) === null || r === void 0 || r.call(s, {
4779
- args: a,
4780
- reason: "imperative-api"
4781
- }), this.setState(mt);
4782
- }
4783
- }
4784
- componentDidCatch(e, r) {
4785
- var s, n;
4786
- (s = (n = this.props).onError) === null || s === void 0 || s.call(n, e, r);
4787
- }
4788
- componentDidUpdate(e, r) {
4789
- const {
4790
- didCatch: s
4791
- } = this.state, {
4792
- resetKeys: n
4793
- } = this.props;
4794
- if (s && r.error !== null && Si(e.resetKeys, n)) {
4795
- var a, o;
4796
- (a = (o = this.props).onReset) === null || a === void 0 || a.call(o, {
4797
- next: n,
4798
- prev: e.resetKeys,
4799
- reason: "keys"
4800
- }), this.setState(mt);
4801
- }
4802
- }
4803
- render() {
4804
- const {
4805
- children: e,
4806
- fallbackRender: r,
4807
- FallbackComponent: s,
4808
- fallback: n
4809
- } = this.props, {
4810
- didCatch: a,
4811
- error: o
4812
- } = this.state;
4813
- let c = e;
4814
- if (a) {
4815
- const u = {
4816
- error: o,
4817
- resetErrorBoundary: this.resetErrorBoundary
4818
- };
4819
- if (typeof r == "function")
4820
- c = r(u);
4821
- else if (s)
4822
- c = Zt(s, u);
4823
- else if (n !== void 0)
4824
- c = n;
4825
- else
4826
- throw o;
4827
- }
4828
- return Zt(ji.Provider, {
4829
- value: {
4830
- didCatch: a,
4831
- error: o,
4832
- resetErrorBoundary: this.resetErrorBoundary
4833
- }
4834
- }, c);
4835
- }
4836
- }
4837
- function Si() {
4838
- let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
4839
- return t.length !== e.length || t.some((r, s) => !Object.is(r, e[s]));
4840
- }
4841
- let Ci = () => ({
4842
- emit(t, ...e) {
4843
- for (let r = this.events[t] || [], s = 0, n = r.length; s < n; s++)
4844
- r[s](...e);
4845
- },
4846
- events: {},
4847
- on(t, e) {
4848
- return (this.events[t] ||= []).push(e), () => {
4849
- this.events[t] = this.events[t]?.filter((r) => e !== r);
4850
- };
4851
- }
4852
- });
4853
- class Ni {
4854
- constructor(e, r) {
4855
- this.options = e, this.queryClient = r, this.plugins = e.plugins ?? [], this.topNavigation = e.topNavigation ?? [], this.sidebars = e.sidebars ?? {}, this.navigationPlugins = this.plugins.filter(rn), this.authentication = e.authentication, this.meta = e.metadata, this.page = e.page, this.plugins.forEach((s) => {
4856
- sn(s) && dn(s.events).forEach(([n, a]) => {
4857
- this.emitter.on(n, a);
4858
- });
4859
- }), ws.subscribe((s, n) => {
4860
- this.emitEvent("auth", {
4861
- prev: n,
4862
- next: s
4863
- });
4864
- });
4865
- }
4866
- plugins;
4867
- sidebars;
4868
- topNavigation;
4869
- meta;
4870
- page;
4871
- authentication;
4872
- navigationPlugins;
4873
- emitter = Ci();
4874
- initialize = async () => {
4875
- await Promise.all(
4876
- this.plugins.filter(nn).map((e) => e.initialize?.(this))
4877
- );
4878
- };
4879
- getApiIdentities = async () => (await Promise.all(
4880
- this.plugins.filter(an).map((r) => r.getIdentities(this))
4881
- )).flat();
4882
- addEventListener(e, r) {
4883
- return this.emitter.on(e, r);
4884
- }
4885
- emitEvent = (e, ...r) => this.emitter.emit(e, ...r);
4886
- getPluginSidebar = async (e) => (await Promise.all(
4887
- this.navigationPlugins.map(
4888
- (s) => s.getSidebar?.(ks(e), this)
4889
- )
4890
- )).flatMap((s) => s ?? []);
4891
- signRequest = async (e) => {
4892
- if (!this.authentication)
4893
- throw new Error("No authentication provider configured");
4894
- return await this.authentication.signRequest(e);
4895
- };
4896
- }
4897
- function Ei({ error: t, resetErrorBoundary: e }) {
4898
- return /* @__PURE__ */ i.jsx(dr, { error: t });
4899
- }
4900
- const He = globalThis;
4901
- (!He.requestIdleCallback || !He.cancelIdleCallback) && (He.requestIdleCallback = (t) => setTimeout(t, 1), He.cancelIdleCallback = clearTimeout);
4902
- const Lr = {
4903
- Header: Dr
4904
- }, Oi = jt(Lr), Ai = Oi.Provider, Pi = () => {
4905
- const t = nt(), e = Q(), r = oe(void 0);
4906
- return G(() => {
4907
- e.emitEvent("location", {
4908
- from: r.current,
4909
- to: t
4910
- }), r.current = t;
4911
- }, [e, t]), null;
4912
- }, Ri = ({
4913
- children: t,
4914
- context: e
4915
- }) => (js({
4916
- queryFn: async () => (await e.initialize(), !0),
4917
- queryKey: ["zudoku-initialize"]
4918
- }), /* @__PURE__ */ i.jsx(Ts.Provider, { value: e, children: t }));
4919
- let Xt;
4920
- const Br = fr(
4921
- ({ children: t, ...e }) => {
4922
- const r = ut(
4923
- () => ({ ...Lr, ...e.overrides }),
4924
- [e.overrides]
4925
- ), s = nt(), n = ut(() => ({
4926
- ...(e.plugins ?? []).filter(on).flatMap(
4927
- (w) => w.getMdxComponents ? [w.getMdxComponents()] : []
4928
- ).reduce(
4929
- (w, _) => ({ ...w, ..._ }),
4930
- {}
4931
- ),
4932
- ...Ks,
4933
- ...e.mdx?.components
4934
- }), [e.mdx?.components, e.plugins]), { stagger: a } = Rs(vt), [o, c] = ve(!1), u = ut(
4935
- () => o ? { stagger: !0 } : { stagger: a },
4936
- [a, o]
4937
- ), d = at(), f = ir();
4938
- G(() => {
4939
- o || c(!0);
4940
- }, [o, d.location]), Xt ??= new Ni(e, f);
4941
- const b = e.plugins?.flatMap(
4942
- (k) => cn(k) ? k.getHead?.({ location: s }) ?? [] : []
4943
- ).map((k, w) => /* @__PURE__ */ i.jsx(wt, { children: k }, w));
4944
- return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
4945
- b,
4946
- /* @__PURE__ */ i.jsx(vt.Provider, { value: u, children: /* @__PURE__ */ i.jsxs(Ri, { context: Xt, children: [
4947
- /* @__PURE__ */ i.jsx(Pi, {}),
4948
- /* @__PURE__ */ i.jsx(wn, { components: n, children: /* @__PURE__ */ i.jsx(ds, { attribute: "class", disableTransitionOnChange: !0, children: /* @__PURE__ */ i.jsx(Ai, { value: r, children: /* @__PURE__ */ i.jsx(Ns, { slotlets: e.slotlets, children: /* @__PURE__ */ i.jsx(Gs, { children: t ?? /* @__PURE__ */ i.jsx(sr, {}) }) }) }) }) })
4949
- ] }) })
4950
- ] });
4951
- }
4952
- );
4953
- Br.displayName = "ZudokoInner";
4954
- const Vr = (t) => /* @__PURE__ */ i.jsx(Ti, { FallbackComponent: Ei, children: /* @__PURE__ */ i.jsx(Br, { ...t }) });
4955
- Vr.displayName = "Zudoku";
4956
- const no = yr, ao = _i, io = Es, oo = En, co = Pn, uo = Rn, lo = cs, fo = wt, Mi = Q, ho = Ne, mo = Ss, po = Cs, go = Vr, vo = ki, yo = Os, xo = Js, _o = hr, bo = it, wo = ur, ko = kt, jo = rr, To = Ba;
4957
- export {
4958
- wo as B,
4959
- po as C,
4960
- fo as H,
4961
- ko as L,
4962
- xo as M,
4963
- io as R,
4964
- oo as S,
4965
- go as Z,
4966
- Mi as a,
4967
- ho as b,
4968
- no as c,
4969
- ao as d,
4970
- co as e,
4971
- uo as f,
4972
- lo as g,
4973
- mo as h,
4974
- vo as i,
4975
- yo as j,
4976
- _o as k,
4977
- bo as l,
4978
- jo as m,
4979
- To as n,
4980
- yr as u
4981
- };
4982
- //# sourceMappingURL=index-CT2PstvH.js.map