zudoku 0.45.1 → 0.46.1

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