zudoku 0.0.0-fed343e → 0.0.0-ff3751f

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 (599) hide show
  1. package/README.md +121 -0
  2. package/cli.js +2 -2
  3. package/dist/app/entry.client.js +2 -2
  4. package/dist/app/entry.client.js.map +1 -1
  5. package/dist/app/entry.server.js +3 -0
  6. package/dist/app/entry.server.js.map +1 -1
  7. package/dist/app/main.d.ts +1 -0
  8. package/dist/app/main.js +12 -29
  9. package/dist/app/main.js.map +1 -1
  10. package/dist/app/standalone.js.map +1 -1
  11. package/dist/cli/cli.js +1 -2
  12. package/dist/cli/cli.js.map +1 -1
  13. package/dist/cli/common/machine-id/lib.js.map +1 -1
  14. package/dist/cli/common/outdated.js.map +1 -1
  15. package/dist/cli/common/utils/box.js.map +1 -1
  16. package/dist/cli/dev/handler.js +2 -2
  17. package/dist/cli/dev/handler.js.map +1 -1
  18. package/dist/config/config.d.ts +2 -6
  19. package/dist/config/validators/InputSidebarSchema.d.ts +21 -5
  20. package/dist/config/validators/InputSidebarSchema.js +7 -28
  21. package/dist/config/validators/InputSidebarSchema.js.map +1 -1
  22. package/dist/config/validators/SidebarSchema.d.ts +24 -1
  23. package/dist/config/validators/SidebarSchema.js +80 -44
  24. package/dist/config/validators/SidebarSchema.js.map +1 -1
  25. package/dist/config/validators/validate.d.ts +590 -311
  26. package/dist/config/validators/validate.js +42 -19
  27. package/dist/config/validators/validate.js.map +1 -1
  28. package/dist/index.d.ts +5 -1
  29. package/dist/index.js +1 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/lib/authentication/components/CallbackHandler.js +21 -31
  32. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  33. package/dist/lib/authentication/hook.d.ts +1 -1
  34. package/dist/lib/authentication/hook.js +1 -1
  35. package/dist/lib/authentication/hook.js.map +1 -1
  36. package/dist/lib/authentication/state.d.ts +16 -0
  37. package/dist/lib/authentication/state.js +5 -0
  38. package/dist/lib/authentication/state.js.map +1 -1
  39. package/dist/lib/components/Banner.js +7 -1
  40. package/dist/lib/components/Banner.js.map +1 -1
  41. package/dist/lib/components/ErrorPage.js +1 -2
  42. package/dist/lib/components/ErrorPage.js.map +1 -1
  43. package/dist/lib/components/Header.js +6 -1
  44. package/dist/lib/components/Header.js.map +1 -1
  45. package/dist/lib/components/Heading.d.ts +1 -1
  46. package/dist/lib/components/InlineCode.d.ts +2 -1
  47. package/dist/lib/components/InlineCode.js +9 -1
  48. package/dist/lib/components/InlineCode.js.map +1 -1
  49. package/dist/lib/components/Layout.js +1 -1
  50. package/dist/lib/components/Layout.js.map +1 -1
  51. package/dist/lib/components/MobileTopNavigation.js +5 -1
  52. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  53. package/dist/lib/components/Search.js +1 -1
  54. package/dist/lib/components/Search.js.map +1 -1
  55. package/dist/lib/components/SlotletProvider.d.ts +10 -2
  56. package/dist/lib/components/SlotletProvider.js +4 -2
  57. package/dist/lib/components/SlotletProvider.js.map +1 -1
  58. package/dist/lib/components/SyntaxHighlight.js +4 -1
  59. package/dist/lib/components/SyntaxHighlight.js.map +1 -1
  60. package/dist/lib/components/TopNavigation.d.ts +3 -0
  61. package/dist/lib/components/TopNavigation.js +38 -5
  62. package/dist/lib/components/TopNavigation.js.map +1 -1
  63. package/dist/lib/components/context/ZudokuContext.d.ts +6 -10
  64. package/dist/lib/components/context/ZudokuContext.js +26 -20
  65. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  66. package/dist/lib/components/index.d.ts +18 -8
  67. package/dist/lib/components/index.js +10 -3
  68. package/dist/lib/components/index.js.map +1 -1
  69. package/dist/lib/components/navigation/Sidebar.js +3 -3
  70. package/dist/lib/components/navigation/Sidebar.js.map +1 -1
  71. package/dist/lib/components/navigation/SidebarCategory.js +18 -9
  72. package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
  73. package/dist/lib/components/navigation/SidebarItem.js +12 -7
  74. package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
  75. package/dist/lib/components/navigation/utils.js +10 -14
  76. package/dist/lib/components/navigation/utils.js.map +1 -1
  77. package/dist/lib/core/DevPortalContext.d.ts +4 -7
  78. package/dist/lib/core/DevPortalContext.js.map +1 -1
  79. package/dist/lib/core/plugins.d.ts +1 -0
  80. package/dist/lib/core/plugins.js.map +1 -1
  81. package/dist/lib/errors/ErrorAlert.d.ts +1 -1
  82. package/dist/lib/errors/ErrorAlert.js +8 -3
  83. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  84. package/dist/lib/oas/graphql/index.d.ts +2 -1
  85. package/dist/lib/oas/graphql/index.js +24 -16
  86. package/dist/lib/oas/graphql/index.js.map +1 -1
  87. package/dist/lib/oas/parser/index.d.ts +1 -0
  88. package/dist/lib/oas/parser/index.js.map +1 -1
  89. package/dist/lib/plugins/api-keys/CreateApiKey.js +1 -1
  90. package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
  91. package/dist/lib/plugins/custom-pages/CustomPage.d.ts +2 -0
  92. package/dist/lib/plugins/custom-pages/CustomPage.js +11 -0
  93. package/dist/lib/plugins/custom-pages/CustomPage.js.map +1 -0
  94. package/dist/lib/plugins/custom-pages/index.d.ts +10 -0
  95. package/dist/lib/plugins/custom-pages/index.js +11 -0
  96. package/dist/lib/plugins/custom-pages/index.js.map +1 -0
  97. package/dist/lib/plugins/markdown/MdxPage.js +2 -2
  98. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  99. package/dist/lib/plugins/markdown/index.d.ts +5 -5
  100. package/dist/lib/plugins/markdown/index.js +31 -3
  101. package/dist/lib/plugins/markdown/index.js.map +1 -1
  102. package/dist/lib/plugins/markdown/resolver.d.ts +38 -0
  103. package/dist/lib/plugins/markdown/resolver.js +75 -0
  104. package/dist/lib/plugins/markdown/resolver.js.map +1 -0
  105. package/dist/lib/plugins/openapi/Endpoint.d.ts +1 -3
  106. package/dist/lib/plugins/openapi/Endpoint.js +46 -8
  107. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  108. package/dist/lib/plugins/openapi/OperationList.js +2 -2
  109. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  110. package/dist/lib/plugins/openapi/OperationListItem.js +1 -1
  111. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  112. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.d.ts +2 -1
  113. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +2 -2
  114. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
  115. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  116. package/dist/lib/plugins/openapi/Route.d.ts +1 -1
  117. package/dist/lib/plugins/openapi/Route.js +1 -1
  118. package/dist/lib/plugins/openapi/Route.js.map +1 -1
  119. package/dist/lib/plugins/openapi/Sidecar.js +17 -6
  120. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  121. package/dist/lib/plugins/openapi/SimpleSelect.d.ts +2 -1
  122. package/dist/lib/plugins/openapi/SimpleSelect.js +1 -1
  123. package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -1
  124. package/dist/lib/plugins/openapi/client/createMemoryClient.js +1 -1
  125. package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +1 -1
  126. package/dist/lib/plugins/openapi/client/createWorkerClient.js +1 -1
  127. package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -1
  128. package/dist/lib/plugins/openapi/client/worker.js.map +1 -1
  129. package/dist/lib/plugins/openapi/graphql/gql.d.ts +10 -2
  130. package/dist/lib/plugins/openapi/graphql/gql.js +2 -1
  131. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  132. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +29 -3
  133. package/dist/lib/plugins/openapi/graphql/graphql.js +87 -0
  134. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  135. package/dist/lib/plugins/openapi/index.js +1 -1
  136. package/dist/lib/plugins/openapi/index.js.map +1 -1
  137. package/dist/lib/plugins/openapi/interfaces.d.ts +3 -0
  138. package/dist/lib/plugins/openapi/playground/Playground.d.ts +2 -1
  139. package/dist/lib/plugins/openapi/playground/Playground.js +15 -6
  140. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  141. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
  142. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
  143. package/dist/lib/plugins/openapi/playground/ResponseTab.js +1 -1
  144. package/dist/lib/plugins/openapi/playground/ResponseTab.js.map +1 -1
  145. package/dist/lib/plugins/openapi/playground/createUrl.js +3 -1
  146. package/dist/lib/plugins/openapi/playground/createUrl.js.map +1 -1
  147. package/dist/lib/plugins/redirect/index.d.ts +2 -5
  148. package/dist/lib/plugins/redirect/index.js +1 -1
  149. package/dist/lib/plugins/redirect/index.js.map +1 -1
  150. package/dist/lib/ui/Accordion.d.ts +7 -0
  151. package/dist/lib/ui/Accordion.js +14 -0
  152. package/dist/lib/ui/Accordion.js.map +1 -0
  153. package/dist/lib/ui/Alert.d.ts +8 -0
  154. package/dist/lib/ui/Alert.js +23 -0
  155. package/dist/lib/ui/Alert.js.map +1 -0
  156. package/dist/lib/ui/AlertDialog.d.ts +20 -0
  157. package/dist/lib/ui/AlertDialog.js +27 -0
  158. package/dist/lib/ui/AlertDialog.js.map +1 -0
  159. package/dist/lib/ui/AspectRatio.d.ts +3 -0
  160. package/dist/lib/ui/AspectRatio.js +4 -0
  161. package/dist/lib/ui/AspectRatio.js.map +1 -0
  162. package/dist/lib/ui/Badge.d.ts +9 -0
  163. package/dist/lib/ui/Badge.js +21 -0
  164. package/dist/lib/ui/Badge.js.map +1 -0
  165. package/dist/lib/ui/Breadcrumb.d.ts +19 -0
  166. package/dist/lib/ui/Breadcrumb.js +24 -0
  167. package/dist/lib/ui/Breadcrumb.js.map +1 -0
  168. package/dist/lib/ui/Button.d.ts +2 -3
  169. package/dist/lib/ui/Button.js +1 -1
  170. package/dist/lib/ui/Button.js.map +1 -1
  171. package/dist/lib/ui/Callout.d.ts +36 -35
  172. package/dist/lib/ui/Callout.js.map +1 -1
  173. package/dist/lib/ui/Carousel.d.ts +18 -0
  174. package/dist/lib/ui/Carousel.js +99 -0
  175. package/dist/lib/ui/Carousel.js.map +1 -0
  176. package/dist/lib/ui/Checkbox.d.ts +4 -0
  177. package/dist/lib/ui/Checkbox.js +9 -0
  178. package/dist/lib/ui/Checkbox.js.map +1 -0
  179. package/dist/lib/ui/Collapsible.d.ts +5 -0
  180. package/dist/lib/ui/Collapsible.js +6 -0
  181. package/dist/lib/ui/Collapsible.js.map +1 -0
  182. package/dist/lib/ui/Command.d.ts +80 -0
  183. package/dist/lib/ui/Command.js +31 -0
  184. package/dist/lib/ui/Command.js.map +1 -0
  185. package/dist/lib/{components → ui}/Dialog.js +2 -2
  186. package/dist/lib/ui/Dialog.js.map +1 -0
  187. package/dist/lib/ui/Drawer.d.ts +8 -10
  188. package/dist/lib/ui/Drawer.js.map +1 -1
  189. package/dist/lib/ui/Form.d.ts +23 -0
  190. package/dist/lib/ui/Form.js +63 -0
  191. package/dist/lib/ui/Form.js.map +1 -0
  192. package/dist/lib/ui/HoverCard.d.ts +6 -0
  193. package/dist/lib/ui/HoverCard.js +10 -0
  194. package/dist/lib/ui/HoverCard.js.map +1 -0
  195. package/dist/lib/ui/Label.d.ts +5 -0
  196. package/dist/lib/ui/Label.js +10 -0
  197. package/dist/lib/ui/Label.js.map +1 -0
  198. package/dist/lib/ui/Pagination.d.ts +28 -0
  199. package/dist/lib/ui/Pagination.js +24 -0
  200. package/dist/lib/ui/Pagination.js.map +1 -0
  201. package/dist/lib/ui/Popover.d.ts +6 -0
  202. package/dist/lib/ui/Popover.js +10 -0
  203. package/dist/lib/ui/Popover.js.map +1 -0
  204. package/dist/lib/ui/Progress.d.ts +4 -0
  205. package/dist/lib/ui/Progress.js +8 -0
  206. package/dist/lib/ui/Progress.js.map +1 -0
  207. package/dist/lib/ui/RadioGroup.d.ts +5 -0
  208. package/dist/lib/ui/RadioGroup.js +15 -0
  209. package/dist/lib/ui/RadioGroup.js.map +1 -0
  210. package/dist/lib/ui/ScrollArea.d.ts +5 -0
  211. package/dist/lib/ui/ScrollArea.js +12 -0
  212. package/dist/lib/ui/ScrollArea.js.map +1 -0
  213. package/dist/lib/ui/Select.js.map +1 -0
  214. package/dist/lib/ui/Skeleton.d.ts +2 -0
  215. package/dist/lib/ui/Skeleton.js +7 -0
  216. package/dist/lib/ui/Skeleton.js.map +1 -0
  217. package/dist/lib/ui/Slider.d.ts +4 -0
  218. package/dist/lib/ui/Slider.js +8 -0
  219. package/dist/lib/ui/Slider.js.map +1 -0
  220. package/dist/lib/ui/Switch.d.ts +4 -0
  221. package/dist/lib/ui/Switch.js +8 -0
  222. package/dist/lib/ui/Switch.js.map +1 -0
  223. package/dist/lib/ui/Textarea.d.ts +4 -0
  224. package/dist/lib/ui/Textarea.js +9 -0
  225. package/dist/lib/ui/Textarea.js.map +1 -0
  226. package/dist/lib/ui/Toggle.d.ts +12 -0
  227. package/dist/lib/ui/Toggle.js +26 -0
  228. package/dist/lib/ui/Toggle.js.map +1 -0
  229. package/dist/lib/ui/ToggleGroup.d.ts +12 -0
  230. package/dist/lib/ui/ToggleGroup.js +21 -0
  231. package/dist/lib/ui/ToggleGroup.js.map +1 -0
  232. package/dist/lib/ui/Tooltip.d.ts +7 -0
  233. package/dist/lib/ui/Tooltip.js +11 -0
  234. package/dist/lib/ui/Tooltip.js.map +1 -0
  235. package/dist/lib/util/MdxComponents.js.map +1 -1
  236. package/dist/lib/util/invariant.d.ts +9 -0
  237. package/dist/lib/util/invariant.js +7 -3
  238. package/dist/lib/util/invariant.js.map +1 -1
  239. package/dist/lib/util/useExposedProps.d.ts +2 -0
  240. package/dist/lib/util/useExposedProps.js +9 -0
  241. package/dist/lib/util/useExposedProps.js.map +1 -0
  242. package/dist/lib/util/useScrollToAnchor.js.map +1 -1
  243. package/dist/vite/build.js +12 -3
  244. package/dist/vite/build.js.map +1 -1
  245. package/dist/vite/config.d.ts +3 -9
  246. package/dist/vite/config.js +40 -69
  247. package/dist/vite/config.js.map +1 -1
  248. package/dist/vite/debug.d.ts +1 -0
  249. package/dist/vite/debug.js +10 -0
  250. package/dist/vite/debug.js.map +1 -0
  251. package/dist/vite/dev-server.d.ts +7 -1
  252. package/dist/vite/dev-server.js +20 -16
  253. package/dist/vite/dev-server.js.map +1 -1
  254. package/dist/vite/output.d.ts +101 -0
  255. package/dist/vite/output.js +30 -0
  256. package/dist/vite/output.js.map +1 -0
  257. package/dist/vite/plugin-api.js +4 -7
  258. package/dist/vite/plugin-api.js.map +1 -1
  259. package/dist/vite/plugin-component.js +17 -8
  260. package/dist/vite/plugin-component.js.map +1 -1
  261. package/dist/vite/plugin-config-reload.js +7 -4
  262. package/dist/vite/plugin-config-reload.js.map +1 -1
  263. package/dist/vite/plugin-config.d.ts +2 -3
  264. package/dist/vite/plugin-config.js +2 -3
  265. package/dist/vite/plugin-config.js.map +1 -1
  266. package/dist/vite/plugin-custom-pages.d.ts +4 -0
  267. package/dist/vite/plugin-custom-pages.js +30 -0
  268. package/dist/vite/plugin-custom-pages.js.map +1 -0
  269. package/dist/vite/plugin-docs.js +37 -24
  270. package/dist/vite/plugin-docs.js.map +1 -1
  271. package/dist/vite/plugin-frontmatter.d.ts +3 -0
  272. package/dist/vite/plugin-frontmatter.js +33 -0
  273. package/dist/vite/plugin-frontmatter.js.map +1 -0
  274. package/dist/vite/plugin-mdx.js +17 -0
  275. package/dist/vite/plugin-mdx.js.map +1 -1
  276. package/dist/vite/plugin-search.d.ts +3 -0
  277. package/dist/vite/plugin-search.js +26 -0
  278. package/dist/vite/plugin-search.js.map +1 -0
  279. package/dist/vite/plugin-sidebar.js +21 -7
  280. package/dist/vite/plugin-sidebar.js.map +1 -1
  281. package/dist/vite/plugin.js +7 -3
  282. package/dist/vite/plugin.js.map +1 -1
  283. package/dist/vite/prerender.d.ts +5 -1
  284. package/dist/vite/prerender.js +6 -5
  285. package/dist/vite/prerender.js.map +1 -1
  286. package/lib/{utils-ByIc_KIM.js → AnchorLink-BbB2q-jx.js} +231 -275
  287. package/lib/AnchorLink-BbB2q-jx.js.map +1 -0
  288. package/lib/{AuthenticationPlugin-Bx9FK124.js → AuthenticationPlugin-C9BHGXlE.js} +3 -3
  289. package/lib/{AuthenticationPlugin-Bx9FK124.js.map → AuthenticationPlugin-C9BHGXlE.js.map} +1 -1
  290. package/lib/{CategoryHeading-XnFqN2lJ.js → CategoryHeading-Bb9dqxD3.js} +4 -4
  291. package/lib/{CategoryHeading-XnFqN2lJ.js.map → CategoryHeading-Bb9dqxD3.js.map} +1 -1
  292. package/lib/ClientOnly-CVN6leDu.js +11 -0
  293. package/lib/ClientOnly-CVN6leDu.js.map +1 -0
  294. package/lib/{DeveloperHint-FBb2uXJe.js → DeveloperHint-DHdLXGHA.js} +2 -2
  295. package/lib/{DeveloperHint-FBb2uXJe.js.map → DeveloperHint-DHdLXGHA.js.map} +1 -1
  296. package/lib/Dialog-k70Qfukb.js +67 -0
  297. package/lib/Dialog-k70Qfukb.js.map +1 -0
  298. package/lib/{Markdown-B4aR03g6.js → Markdown-BDcCAWwm.js} +4298 -6518
  299. package/lib/Markdown-BDcCAWwm.js.map +1 -0
  300. package/lib/{MdxPage-BZyQsH8Z.js → MdxPage-DKMH_t0f.js} +25 -23
  301. package/lib/MdxPage-DKMH_t0f.js.map +1 -0
  302. package/lib/{OperationList-2NeWEM0u.js → OperationList-Tj7ubW_t.js} +181 -137
  303. package/lib/OperationList-Tj7ubW_t.js.map +1 -0
  304. package/lib/{Route-BZPewmrN.js → Route-C3DGB6OS.js} +3 -4
  305. package/lib/Route-C3DGB6OS.js.map +1 -0
  306. package/lib/Select-Bagt3Bme.js +223 -0
  307. package/lib/Select-Bagt3Bme.js.map +1 -0
  308. package/lib/SlotletProvider-Da7eFgd2.js +241 -0
  309. package/lib/SlotletProvider-Da7eFgd2.js.map +1 -0
  310. package/lib/Spinner-C6zroowC.js +40 -0
  311. package/lib/Spinner-C6zroowC.js.map +1 -0
  312. package/lib/StaggeredRender-DDHSzQKE.js +17 -0
  313. package/lib/StaggeredRender-DDHSzQKE.js.map +1 -0
  314. package/lib/ZudokuContext-BKXGJTmu.js +1222 -0
  315. package/lib/ZudokuContext-BKXGJTmu.js.map +1 -0
  316. package/lib/__vite-browser-external-BYRIRx8p.js +9 -0
  317. package/lib/__vite-browser-external-BYRIRx8p.js.map +1 -0
  318. package/lib/assets/{index-B9EWVYfo.js → index-B_Jk_Yzp.js} +968 -938
  319. package/lib/assets/index-B_Jk_Yzp.js.map +1 -0
  320. package/lib/assets/{worker-BvD7B6MG.js → worker-Bf8vjASY.js} +6769 -4411
  321. package/lib/assets/worker-Bf8vjASY.js.map +1 -0
  322. package/lib/cn-BmFQLtkS.js +2279 -0
  323. package/lib/cn-BmFQLtkS.js.map +1 -0
  324. package/lib/hook-sn0zMTkE.js +229 -0
  325. package/lib/hook-sn0zMTkE.js.map +1 -0
  326. package/lib/{index-Dv2KZuEw.js → index-AjWCJNGC.js} +1681 -1676
  327. package/lib/index-AjWCJNGC.js.map +1 -0
  328. package/lib/index-Bn6Lc9tq.js +9 -0
  329. package/lib/index-Bn6Lc9tq.js.map +1 -0
  330. package/lib/index-BuAyrJe3.js +46 -0
  331. package/lib/index-BuAyrJe3.js.map +1 -0
  332. package/lib/{index-BG0g4WW0.js → index-CRo94sKK.js} +750 -738
  333. package/lib/index-CRo94sKK.js.map +1 -0
  334. package/lib/{index-CLd8ycZz.js → index-CkwDvuPt.js} +947 -917
  335. package/lib/index-CkwDvuPt.js.map +1 -0
  336. package/lib/index-LNp6rxyU.js +2094 -0
  337. package/lib/index-LNp6rxyU.js.map +1 -0
  338. package/lib/index.esm-C5mr_sKO.js +1193 -0
  339. package/lib/index.esm-C5mr_sKO.js.map +1 -0
  340. package/lib/invariant-Caa8-XvF.js +26 -0
  341. package/lib/invariant-Caa8-XvF.js.map +1 -0
  342. package/lib/router-BsfSoK2j.js +3024 -0
  343. package/lib/router-BsfSoK2j.js.map +1 -0
  344. package/lib/state-CsuHT8ZO.js +183 -0
  345. package/lib/state-CsuHT8ZO.js.map +1 -0
  346. package/lib/ui/Accordion.js +47 -0
  347. package/lib/ui/Accordion.js.map +1 -0
  348. package/lib/ui/Alert.js +51 -0
  349. package/lib/ui/Alert.js.map +1 -0
  350. package/lib/ui/AlertDialog.js +114 -0
  351. package/lib/ui/AlertDialog.js.map +1 -0
  352. package/lib/ui/AspectRatio.js +6 -0
  353. package/lib/ui/AspectRatio.js.map +1 -0
  354. package/lib/ui/Badge.js +27 -0
  355. package/lib/ui/Badge.js.map +1 -0
  356. package/lib/ui/Breadcrumb.js +94 -0
  357. package/lib/ui/Breadcrumb.js.map +1 -0
  358. package/lib/ui/Button.js +49 -0
  359. package/lib/ui/Button.js.map +1 -0
  360. package/lib/ui/Callout.js +77 -0
  361. package/lib/ui/Callout.js.map +1 -0
  362. package/lib/ui/Card.js +62 -0
  363. package/lib/ui/Card.js.map +1 -0
  364. package/lib/ui/Carousel.js +1410 -0
  365. package/lib/ui/Carousel.js.map +1 -0
  366. package/lib/ui/Checkbox.js +28 -0
  367. package/lib/ui/Checkbox.js.map +1 -0
  368. package/lib/ui/Collapsible.js +8 -0
  369. package/lib/ui/Collapsible.js.map +1 -0
  370. package/lib/ui/Command.js +550 -0
  371. package/lib/ui/Command.js.map +1 -0
  372. package/lib/ui/Dialog.js +101 -0
  373. package/lib/ui/Dialog.js.map +1 -0
  374. package/lib/ui/Drawer.js +1153 -0
  375. package/lib/ui/Drawer.js.map +1 -0
  376. package/lib/ui/DropdownMenu.js +145 -0
  377. package/lib/ui/DropdownMenu.js.map +1 -0
  378. package/lib/ui/Form.js +95 -0
  379. package/lib/ui/Form.js.map +1 -0
  380. package/lib/ui/HoverCard.js +24 -0
  381. package/lib/ui/HoverCard.js.map +1 -0
  382. package/lib/ui/Input.js +22 -0
  383. package/lib/ui/Input.js.map +1 -0
  384. package/lib/ui/Label.js +20 -0
  385. package/lib/ui/Label.js.map +1 -0
  386. package/lib/ui/Pagination.js +106 -0
  387. package/lib/ui/Pagination.js.map +1 -0
  388. package/lib/ui/Popover.js +24 -0
  389. package/lib/ui/Popover.js.map +1 -0
  390. package/lib/ui/Progress.js +27 -0
  391. package/lib/ui/Progress.js.map +1 -0
  392. package/lib/ui/RadioGroup.js +32 -0
  393. package/lib/ui/RadioGroup.js.map +1 -0
  394. package/lib/ui/ScrollArea.js +39 -0
  395. package/lib/ui/ScrollArea.js.map +1 -0
  396. package/lib/ui/Select.js +122 -0
  397. package/lib/ui/Select.js.map +1 -0
  398. package/lib/ui/Skeleton.js +18 -0
  399. package/lib/ui/Skeleton.js.map +1 -0
  400. package/lib/ui/Slider.js +24 -0
  401. package/lib/ui/Slider.js.map +1 -0
  402. package/lib/ui/Switch.js +28 -0
  403. package/lib/ui/Switch.js.map +1 -0
  404. package/lib/ui/Tabs.js +47 -0
  405. package/lib/ui/Tabs.js.map +1 -0
  406. package/lib/ui/Textarea.js +21 -0
  407. package/lib/ui/Textarea.js.map +1 -0
  408. package/lib/ui/Toggle.js +38 -0
  409. package/lib/ui/Toggle.js.map +1 -0
  410. package/lib/ui/ToggleGroup.js +42 -0
  411. package/lib/ui/ToggleGroup.js.map +1 -0
  412. package/lib/ui/Tooltip.js +24 -0
  413. package/lib/ui/Tooltip.js.map +1 -0
  414. package/lib/urql-core-KJnLL26g.js +1455 -0
  415. package/lib/urql-core-KJnLL26g.js.map +1 -0
  416. package/lib/useExposedProps-ChOIUaS4.js +9 -0
  417. package/lib/useExposedProps-ChOIUaS4.js.map +1 -0
  418. package/lib/zudoku.auth-auth0.js +1 -1
  419. package/lib/zudoku.auth-clerk.js +2 -2
  420. package/lib/zudoku.auth-openid.js +541 -534
  421. package/lib/zudoku.auth-openid.js.map +1 -1
  422. package/lib/zudoku.components.js +953 -2849
  423. package/lib/zudoku.components.js.map +1 -1
  424. package/lib/zudoku.openapi-worker.js +4668 -4380
  425. package/lib/zudoku.openapi-worker.js.map +1 -1
  426. package/lib/zudoku.plugin-api-keys.js +69 -76
  427. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  428. package/lib/zudoku.plugin-custom-pages.js +22 -0
  429. package/lib/zudoku.plugin-custom-pages.js.map +1 -0
  430. package/lib/zudoku.plugin-markdown.js +93 -24
  431. package/lib/zudoku.plugin-markdown.js.map +1 -1
  432. package/lib/zudoku.plugin-openapi.js +9 -10
  433. package/lib/zudoku.plugin-openapi.js.map +1 -1
  434. package/lib/zudoku.plugin-redirect.js +2 -2
  435. package/lib/zudoku.plugin-redirect.js.map +1 -1
  436. package/lib/zudoku.plugin-search-inkeep.js +9 -13
  437. package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
  438. package/package.json +98 -72
  439. package/src/app/entry.client.tsx +4 -2
  440. package/src/app/entry.server.tsx +4 -0
  441. package/src/app/main.css +4 -1
  442. package/src/app/main.tsx +15 -33
  443. package/src/app/standalone.tsx +1 -1
  444. package/src/lib/authentication/components/CallbackHandler.tsx +20 -51
  445. package/src/lib/authentication/hook.ts +1 -1
  446. package/src/lib/authentication/state.ts +17 -0
  447. package/src/lib/components/Banner.tsx +12 -2
  448. package/src/lib/components/ErrorPage.tsx +0 -2
  449. package/src/lib/components/Header.tsx +21 -4
  450. package/src/lib/components/InlineCode.tsx +10 -0
  451. package/src/lib/components/Layout.tsx +2 -1
  452. package/src/lib/components/MobileTopNavigation.tsx +10 -2
  453. package/src/lib/components/Search.tsx +1 -1
  454. package/src/lib/components/SlotletProvider.tsx +29 -4
  455. package/src/lib/components/SyntaxHighlight.tsx +5 -1
  456. package/src/lib/components/TopNavigation.tsx +70 -23
  457. package/src/lib/components/context/ZudokuContext.ts +28 -20
  458. package/src/lib/components/index.ts +13 -4
  459. package/src/lib/components/navigation/Sidebar.tsx +6 -6
  460. package/src/lib/components/navigation/SidebarCategory.tsx +35 -29
  461. package/src/lib/components/navigation/SidebarItem.tsx +17 -20
  462. package/src/lib/components/navigation/utils.ts +11 -16
  463. package/src/lib/core/DevPortalContext.ts +4 -3
  464. package/src/lib/core/plugins.ts +2 -0
  465. package/src/lib/errors/ErrorAlert.tsx +18 -5
  466. package/src/lib/oas/graphql/index.ts +36 -24
  467. package/src/lib/oas/parser/index.ts +1 -0
  468. package/src/lib/plugins/api-keys/CreateApiKey.tsx +2 -2
  469. package/src/lib/plugins/custom-pages/CustomPage.tsx +18 -0
  470. package/src/lib/plugins/custom-pages/index.tsx +24 -0
  471. package/src/lib/plugins/markdown/MdxPage.tsx +11 -9
  472. package/src/lib/plugins/markdown/index.tsx +49 -10
  473. package/src/lib/plugins/markdown/resolver.ts +92 -0
  474. package/src/lib/plugins/openapi/Endpoint.tsx +86 -22
  475. package/src/lib/plugins/openapi/OperationList.tsx +4 -2
  476. package/src/lib/plugins/openapi/OperationListItem.tsx +1 -1
  477. package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +3 -0
  478. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +1 -1
  479. package/src/lib/plugins/openapi/Route.tsx +1 -2
  480. package/src/lib/plugins/openapi/Sidecar.tsx +21 -6
  481. package/src/lib/plugins/openapi/SimpleSelect.tsx +10 -2
  482. package/src/lib/plugins/openapi/client/createMemoryClient.ts +1 -6
  483. package/src/lib/plugins/openapi/client/createWorkerClient.ts +1 -6
  484. package/src/lib/plugins/openapi/client/worker.ts +2 -2
  485. package/src/lib/plugins/openapi/graphql/gql.ts +11 -3
  486. package/src/lib/plugins/openapi/graphql/graphql.ts +116 -4
  487. package/src/lib/plugins/openapi/index.tsx +2 -6
  488. package/src/lib/plugins/openapi/interfaces.ts +4 -1
  489. package/src/lib/plugins/openapi/playground/Playground.tsx +42 -7
  490. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +1 -1
  491. package/src/lib/plugins/openapi/playground/ResponseTab.tsx +0 -1
  492. package/src/lib/plugins/openapi/playground/createUrl.ts +6 -1
  493. package/src/lib/plugins/redirect/index.tsx +3 -7
  494. package/src/lib/ui/Accordion.tsx +56 -0
  495. package/src/lib/ui/{Note.tsx → Alert.tsx} +11 -10
  496. package/src/lib/ui/AlertDialog.tsx +139 -0
  497. package/src/lib/ui/AspectRatio.tsx +5 -0
  498. package/src/lib/ui/Badge.tsx +36 -0
  499. package/src/lib/ui/Breadcrumb.tsx +115 -0
  500. package/src/lib/ui/Button.tsx +1 -1
  501. package/src/lib/ui/Callout.tsx +7 -6
  502. package/src/lib/ui/Carousel.tsx +260 -0
  503. package/src/lib/ui/Checkbox.tsx +28 -0
  504. package/src/lib/ui/Collapsible.tsx +9 -0
  505. package/src/lib/ui/Command.tsx +151 -0
  506. package/src/lib/{components → ui}/Dialog.tsx +4 -3
  507. package/src/lib/ui/Drawer.tsx +38 -36
  508. package/src/lib/ui/Form.tsx +177 -0
  509. package/src/lib/ui/HoverCard.tsx +27 -0
  510. package/src/lib/ui/Label.tsx +24 -0
  511. package/src/lib/ui/Pagination.tsx +117 -0
  512. package/src/lib/ui/Popover.tsx +29 -0
  513. package/src/lib/ui/Progress.tsx +26 -0
  514. package/src/lib/ui/RadioGroup.tsx +42 -0
  515. package/src/lib/ui/ScrollArea.tsx +46 -0
  516. package/src/lib/ui/Skeleton.tsx +15 -0
  517. package/src/lib/ui/Slider.tsx +26 -0
  518. package/src/lib/ui/Switch.tsx +27 -0
  519. package/src/lib/ui/Textarea.tsx +23 -0
  520. package/src/lib/ui/Toggle.tsx +43 -0
  521. package/src/lib/ui/ToggleGroup.tsx +59 -0
  522. package/src/lib/ui/Tooltip.tsx +28 -0
  523. package/src/lib/util/MdxComponents.tsx +0 -1
  524. package/src/lib/util/invariant.ts +15 -3
  525. package/src/lib/util/useExposedProps.tsx +16 -0
  526. package/src/lib/util/useScrollToAnchor.ts +1 -1
  527. package/dist/internal.d.ts +0 -1
  528. package/dist/internal.js +0 -2
  529. package/dist/internal.js.map +0 -1
  530. package/dist/lib/components/Dialog.js.map +0 -1
  531. package/dist/lib/components/Select.js.map +0 -1
  532. package/dist/lib/plugins/custom-page/index.d.ts +0 -8
  533. package/dist/lib/plugins/custom-page/index.js +0 -12
  534. package/dist/lib/plugins/custom-page/index.js.map +0 -1
  535. package/dist/lib/plugins/markdown/generateRoutes.d.ts +0 -3
  536. package/dist/lib/plugins/markdown/generateRoutes.js +0 -19
  537. package/dist/lib/plugins/markdown/generateRoutes.js.map +0 -1
  538. package/dist/lib/plugins/openapi/playground/Editor.d.ts +0 -1
  539. package/dist/lib/plugins/openapi/playground/Editor.js +0 -5
  540. package/dist/lib/plugins/openapi/playground/Editor.js.map +0 -1
  541. package/dist/lib/plugins/openapi/util/urql.d.ts +0 -7
  542. package/dist/lib/plugins/openapi/util/urql.js +0 -8
  543. package/dist/lib/plugins/openapi/util/urql.js.map +0 -1
  544. package/dist/lib/ui/Note.d.ts +0 -8
  545. package/dist/lib/ui/Note.js +0 -23
  546. package/dist/lib/ui/Note.js.map +0 -1
  547. package/dist/lib/util/slugify.d.ts +0 -2
  548. package/dist/lib/util/slugify.js +0 -3
  549. package/dist/lib/util/slugify.js.map +0 -1
  550. package/dist/vite/plugin-icons.d.ts +0 -3
  551. package/dist/vite/plugin-icons.js +0 -47
  552. package/dist/vite/plugin-icons.js.map +0 -1
  553. package/lib/ErrorPage-knunPbKI.js +0 -18
  554. package/lib/ErrorPage-knunPbKI.js.map +0 -1
  555. package/lib/Input-BEDZAKw0.js +0 -2198
  556. package/lib/Input-BEDZAKw0.js.map +0 -1
  557. package/lib/Markdown-B4aR03g6.js.map +0 -1
  558. package/lib/MdxPage-BZyQsH8Z.js.map +0 -1
  559. package/lib/OperationList-2NeWEM0u.js.map +0 -1
  560. package/lib/Route-BZPewmrN.js.map +0 -1
  561. package/lib/SidebarBadge-COz0hgfa.js +0 -498
  562. package/lib/SidebarBadge-COz0hgfa.js.map +0 -1
  563. package/lib/SlotletProvider-DJMaOUDs.js +0 -238
  564. package/lib/SlotletProvider-DJMaOUDs.js.map +0 -1
  565. package/lib/Spinner-3cQDBVGr.js +0 -7
  566. package/lib/Spinner-3cQDBVGr.js.map +0 -1
  567. package/lib/ZudokuContext-cr-pTRY1.js +0 -1084
  568. package/lib/ZudokuContext-cr-pTRY1.js.map +0 -1
  569. package/lib/assets/index-B9EWVYfo.js.map +0 -1
  570. package/lib/assets/worker-BvD7B6MG.js.map +0 -1
  571. package/lib/index-1EDgIO6b.js +0 -124
  572. package/lib/index-1EDgIO6b.js.map +0 -1
  573. package/lib/index-BG0g4WW0.js.map +0 -1
  574. package/lib/index-CLd8ycZz.js.map +0 -1
  575. package/lib/index-Dv2KZuEw.js.map +0 -1
  576. package/lib/index-Zezcv0xb.js +0 -2814
  577. package/lib/index-Zezcv0xb.js.map +0 -1
  578. package/lib/joinPath-B7kNnUX4.js +0 -8
  579. package/lib/joinPath-B7kNnUX4.js.map +0 -1
  580. package/lib/router-D2p7Olpn.js +0 -2971
  581. package/lib/router-D2p7Olpn.js.map +0 -1
  582. package/lib/slugify-DbLhpSPt.js +0 -28
  583. package/lib/slugify-DbLhpSPt.js.map +0 -1
  584. package/lib/state-lIwt9isb.js +0 -288
  585. package/lib/state-lIwt9isb.js.map +0 -1
  586. package/lib/urql-YhcsXYy8.js +0 -1591
  587. package/lib/urql-YhcsXYy8.js.map +0 -1
  588. package/lib/utils-ByIc_KIM.js.map +0 -1
  589. package/lib/zudoku.plugin-custom-page.js +0 -13
  590. package/lib/zudoku.plugin-custom-page.js.map +0 -1
  591. package/src/lib/plugins/custom-page/index.tsx +0 -22
  592. package/src/lib/plugins/markdown/generateRoutes.tsx +0 -35
  593. package/src/lib/plugins/openapi/playground/Editor.tsx +0 -4
  594. package/src/lib/plugins/openapi/util/urql.ts +0 -8
  595. package/src/lib/util/slugify.ts +0 -3
  596. /package/dist/lib/{components → ui}/Dialog.d.ts +0 -0
  597. /package/dist/lib/{components → ui}/Select.d.ts +0 -0
  598. /package/dist/lib/{components → ui}/Select.js +0 -0
  599. /package/src/lib/{components → ui}/Select.tsx +0 -0
@@ -1,100 +1,97 @@
1
- var Ue = Object.defineProperty;
2
- var Le = (t, e, r) => e in t ? Ue(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var _ = (t, e, r) => Le(t, typeof e != "symbol" ? e + "" : e, r);
4
- import { j as E } from "./jsx-runtime-B6kdoens.js";
5
- import { c as Ce, g as Ie } from "./_commonjsHelpers-BkfeUUK-.js";
6
- import { A as je } from "./AuthenticationPlugin-Bx9FK124.js";
7
- import { useState as Je, useRef as Oe, useEffect as Ne } from "react";
8
- import { D as ze } from "./DeveloperHint-FBb2uXJe.js";
9
- import { E as De } from "./ErrorPage-knunPbKI.js";
10
- import { S as Ke } from "./Spinner-3cQDBVGr.js";
11
- import { S as We } from "./Markdown-B4aR03g6.js";
12
- import { a as He } from "./index-BG0g4WW0.js";
13
- import { u as z } from "./state-lIwt9isb.js";
14
- var fe = { exports: {} };
1
+ var Ie = Object.defineProperty;
2
+ var je = (t, e, n) => e in t ? Ie(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var b = (t, e, n) => je(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { j as fe } from "./jsx-runtime-B6kdoens.js";
5
+ import { c as Je, g as Oe } from "./_commonjsHelpers-BkfeUUK-.js";
6
+ import { A as Ne } from "./AuthenticationPlugin-C9BHGXlE.js";
7
+ import { g as ze } from "./ZudokuContext-BKXGJTmu.js";
8
+ import { Z as De } from "./invariant-Caa8-XvF.js";
9
+ import { N as Ke } from "./index-CRo94sKK.js";
10
+ import { u as N } from "./state-CsuHT8ZO.js";
11
+ var pe = { exports: {} };
15
12
  (function(t) {
16
- (function(e, r) {
17
- t.exports ? t.exports = r() : e.log = r();
18
- })(Ce, function() {
13
+ (function(e, n) {
14
+ t.exports ? t.exports = n() : e.log = n();
15
+ })(Je, function() {
19
16
  var e = function() {
20
- }, r = "undefined", o = typeof window !== r && typeof window.navigator !== r && /Trident\/|MSIE /.test(window.navigator.userAgent), s = [
17
+ }, n = "undefined", o = typeof window !== n && typeof window.navigator !== n && /Trident\/|MSIE /.test(window.navigator.userAgent), a = [
21
18
  "trace",
22
19
  "debug",
23
20
  "info",
24
21
  "warn",
25
22
  "error"
26
- ], n = {}, i = null;
27
- function u(l, w) {
28
- var c = l[w];
29
- if (typeof c.bind == "function")
30
- return c.bind(l);
23
+ ], r = {}, i = null;
24
+ function c(l, g) {
25
+ var u = l[g];
26
+ if (typeof u.bind == "function")
27
+ return u.bind(l);
31
28
  try {
32
- return Function.prototype.bind.call(c, l);
29
+ return Function.prototype.bind.call(u, l);
33
30
  } catch {
34
31
  return function() {
35
- return Function.prototype.apply.apply(c, [l, arguments]);
32
+ return Function.prototype.apply.apply(u, [l, arguments]);
36
33
  };
37
34
  }
38
35
  }
39
- function f() {
36
+ function p() {
40
37
  console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace();
41
38
  }
42
- function m(l) {
43
- return l === "debug" && (l = "log"), typeof console === r ? !1 : l === "trace" && o ? f : console[l] !== void 0 ? u(console, l) : console.log !== void 0 ? u(console, "log") : e;
39
+ function _(l) {
40
+ return l === "debug" && (l = "log"), typeof console === n ? !1 : l === "trace" && o ? p : console[l] !== void 0 ? c(console, l) : console.log !== void 0 ? c(console, "log") : e;
44
41
  }
45
- function y() {
46
- for (var l = this.getLevel(), w = 0; w < s.length; w++) {
47
- var c = s[w];
48
- this[c] = w < l ? e : this.methodFactory(c, l, this.name);
42
+ function f() {
43
+ for (var l = this.getLevel(), g = 0; g < a.length; g++) {
44
+ var u = a[g];
45
+ this[u] = g < l ? e : this.methodFactory(u, l, this.name);
49
46
  }
50
- if (this.log = this.debug, typeof console === r && l < this.levels.SILENT)
47
+ if (this.log = this.debug, typeof console === n && l < this.levels.SILENT)
51
48
  return "No console available for logging";
52
49
  }
53
- function b(l) {
50
+ function y(l) {
54
51
  return function() {
55
- typeof console !== r && (y.call(this), this[l].apply(this, arguments));
52
+ typeof console !== n && (f.call(this), this[l].apply(this, arguments));
56
53
  };
57
54
  }
58
- function h(l, w, c) {
59
- return m(l) || b.apply(this, arguments);
55
+ function T(l, g, u) {
56
+ return _(l) || y.apply(this, arguments);
60
57
  }
61
- function R(l, w) {
62
- var c = this, O, B, x, v = "loglevel";
58
+ function h(l, g) {
59
+ var u = this, J, F, R, v = "loglevel";
63
60
  typeof l == "string" ? v += ":" + l : typeof l == "symbol" && (v = void 0);
64
- function Re(d) {
65
- var g = (s[d] || "silent").toUpperCase();
66
- if (!(typeof window === r || !v)) {
61
+ function Le(d) {
62
+ var m = (a[d] || "silent").toUpperCase();
63
+ if (!(typeof window === n || !v)) {
67
64
  try {
68
- window.localStorage[v] = g;
65
+ window.localStorage[v] = m;
69
66
  return;
70
67
  } catch {
71
68
  }
72
69
  try {
73
- window.document.cookie = encodeURIComponent(v) + "=" + g + ";";
70
+ window.document.cookie = encodeURIComponent(v) + "=" + m + ";";
74
71
  } catch {
75
72
  }
76
73
  }
77
74
  }
78
75
  function ne() {
79
76
  var d;
80
- if (!(typeof window === r || !v)) {
77
+ if (!(typeof window === n || !v)) {
81
78
  try {
82
79
  d = window.localStorage[v];
83
80
  } catch {
84
81
  }
85
- if (typeof d === r)
82
+ if (typeof d === n)
86
83
  try {
87
- var g = window.document.cookie, N = encodeURIComponent(v), ie = g.indexOf(N + "=");
88
- ie !== -1 && (d = /^([^;]+)/.exec(
89
- g.slice(ie + N.length + 1)
84
+ var m = window.document.cookie, O = encodeURIComponent(v), oe = m.indexOf(O + "=");
85
+ oe !== -1 && (d = /^([^;]+)/.exec(
86
+ m.slice(oe + O.length + 1)
90
87
  )[1]);
91
88
  } catch {
92
89
  }
93
- return c.levels[d] === void 0 && (d = void 0), d;
90
+ return u.levels[d] === void 0 && (d = void 0), d;
94
91
  }
95
92
  }
96
- function Pe() {
97
- if (!(typeof window === r || !v)) {
93
+ function Ce() {
94
+ if (!(typeof window === n || !v)) {
98
95
  try {
99
96
  window.localStorage.removeItem(v);
100
97
  } catch {
@@ -105,64 +102,64 @@ var fe = { exports: {} };
105
102
  }
106
103
  }
107
104
  }
108
- function L(d) {
109
- var g = d;
110
- if (typeof g == "string" && c.levels[g.toUpperCase()] !== void 0 && (g = c.levels[g.toUpperCase()]), typeof g == "number" && g >= 0 && g <= c.levels.SILENT)
111
- return g;
105
+ function U(d) {
106
+ var m = d;
107
+ if (typeof m == "string" && u.levels[m.toUpperCase()] !== void 0 && (m = u.levels[m.toUpperCase()]), typeof m == "number" && m >= 0 && m <= u.levels.SILENT)
108
+ return m;
112
109
  throw new TypeError("log.setLevel() called with invalid level: " + d);
113
110
  }
114
- c.name = l, c.levels = {
111
+ u.name = l, u.levels = {
115
112
  TRACE: 0,
116
113
  DEBUG: 1,
117
114
  INFO: 2,
118
115
  WARN: 3,
119
116
  ERROR: 4,
120
117
  SILENT: 5
121
- }, c.methodFactory = w || h, c.getLevel = function() {
122
- return x ?? B ?? O;
123
- }, c.setLevel = function(d, g) {
124
- return x = L(d), g !== !1 && Re(x), y.call(c);
125
- }, c.setDefaultLevel = function(d) {
126
- B = L(d), ne() || c.setLevel(d, !1);
127
- }, c.resetLevel = function() {
128
- x = null, Pe(), y.call(c);
129
- }, c.enableAll = function(d) {
130
- c.setLevel(c.levels.TRACE, d);
131
- }, c.disableAll = function(d) {
132
- c.setLevel(c.levels.SILENT, d);
133
- }, c.rebuild = function() {
134
- if (i !== c && (O = L(i.getLevel())), y.call(c), i === c)
135
- for (var d in n)
136
- n[d].rebuild();
137
- }, O = L(
118
+ }, u.methodFactory = g || T, u.getLevel = function() {
119
+ return R ?? F ?? J;
120
+ }, u.setLevel = function(d, m) {
121
+ return R = U(d), m !== !1 && Le(R), f.call(u);
122
+ }, u.setDefaultLevel = function(d) {
123
+ F = U(d), ne() || u.setLevel(d, !1);
124
+ }, u.resetLevel = function() {
125
+ R = null, Ce(), f.call(u);
126
+ }, u.enableAll = function(d) {
127
+ u.setLevel(u.levels.TRACE, d);
128
+ }, u.disableAll = function(d) {
129
+ u.setLevel(u.levels.SILENT, d);
130
+ }, u.rebuild = function() {
131
+ if (i !== u && (J = U(i.getLevel())), f.call(u), i === u)
132
+ for (var d in r)
133
+ r[d].rebuild();
134
+ }, J = U(
138
135
  i ? i.getLevel() : "WARN"
139
136
  );
140
- var oe = ne();
141
- oe != null && (x = L(oe)), y.call(c);
137
+ var re = ne();
138
+ re != null && (R = U(re)), f.call(u);
142
139
  }
143
- i = new R(), i.getLogger = function(w) {
144
- if (typeof w != "symbol" && typeof w != "string" || w === "")
140
+ i = new h(), i.getLogger = function(g) {
141
+ if (typeof g != "symbol" && typeof g != "string" || g === "")
145
142
  throw new TypeError("You must supply a name when creating a logger.");
146
- var c = n[w];
147
- return c || (c = n[w] = new R(
148
- w,
143
+ var u = r[g];
144
+ return u || (u = r[g] = new h(
145
+ g,
149
146
  i.methodFactory
150
- )), c;
147
+ )), u;
151
148
  };
152
- var P = typeof window !== r ? window.log : void 0;
149
+ var j = typeof window !== n ? window.log : void 0;
153
150
  return i.noConflict = function() {
154
- return typeof window !== r && window.log === i && (window.log = P), i;
151
+ return typeof window !== n && window.log === i && (window.log = j), i;
155
152
  }, i.getLoggers = function() {
156
- return n;
153
+ return r;
157
154
  }, i.default = i, i;
158
155
  });
159
- })(fe);
160
- var $e = fe.exports;
161
- const K = /* @__PURE__ */ Ie($e);
162
- let Y;
163
- var D, he;
164
- (typeof navigator > "u" || !((he = (D = navigator.userAgent) == null ? void 0 : D.startsWith) != null && he.call(D, "Mozilla/5.0 "))) && (Y = "oauth4webapi/v2.11.1");
165
- function Q(t, e) {
156
+ })(pe);
157
+ var We = pe.exports;
158
+ const M = /* @__PURE__ */ Oe(We);
159
+ let G;
160
+ var z, he;
161
+ (typeof navigator > "u" || !((he = (z = navigator.userAgent) == null ? void 0 : z.startsWith) != null && he.call(z, "Mozilla/5.0 "))) && (G = "oauth4webapi/v2.17.0");
162
+ function Y(t, e) {
166
163
  if (t == null)
167
164
  return !1;
168
165
  try {
@@ -171,98 +168,98 @@ function Q(t, e) {
171
168
  return !1;
172
169
  }
173
170
  }
174
- const H = Symbol(), Fe = Symbol(), X = Symbol(), Me = new TextEncoder(), Be = new TextDecoder();
175
- function A(t) {
171
+ const K = Symbol(), He = Symbol(), Q = Symbol(), we = Symbol(), $e = Symbol(), Fe = Symbol(), Me = new TextEncoder(), Be = new TextDecoder();
172
+ function E(t) {
176
173
  return typeof t == "string" ? Me.encode(t) : Be.decode(t);
177
174
  }
178
- const se = 32768;
175
+ const ie = 32768;
179
176
  function qe(t) {
180
177
  t instanceof ArrayBuffer && (t = new Uint8Array(t));
181
178
  const e = [];
182
- for (let r = 0; r < t.byteLength; r += se)
183
- e.push(String.fromCharCode.apply(null, t.subarray(r, r + se)));
179
+ for (let n = 0; n < t.byteLength; n += ie)
180
+ e.push(String.fromCharCode.apply(null, t.subarray(n, n + ie)));
184
181
  return btoa(e.join("")).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
185
182
  }
186
- function Ge(t) {
183
+ function Ve(t) {
187
184
  try {
188
- const e = atob(t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "")), r = new Uint8Array(e.length);
185
+ const e = atob(t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "")), n = new Uint8Array(e.length);
189
186
  for (let o = 0; o < e.length; o++)
190
- r[o] = e.charCodeAt(o);
191
- return r;
187
+ n[o] = e.charCodeAt(o);
188
+ return n;
192
189
  } catch (e) {
193
- throw new a("The input to be decoded is not correctly encoded.", { cause: e });
190
+ throw new s("The input to be decoded is not correctly encoded.", { cause: e });
194
191
  }
195
192
  }
196
- function k(t) {
197
- return typeof t == "string" ? Ge(t) : qe(t);
193
+ function A(t) {
194
+ return typeof t == "string" ? Ve(t) : qe(t);
198
195
  }
199
- class Ve {
196
+ class Ge {
200
197
  constructor(e) {
201
198
  this.cache = /* @__PURE__ */ new Map(), this._cache = /* @__PURE__ */ new Map(), this.maxSize = e;
202
199
  }
203
200
  get(e) {
204
- let r = this.cache.get(e);
205
- if (r)
206
- return r;
207
- if (r = this._cache.get(e))
208
- return this.update(e, r), r;
201
+ let n = this.cache.get(e);
202
+ if (n)
203
+ return n;
204
+ if (n = this._cache.get(e))
205
+ return this.update(e, n), n;
209
206
  }
210
207
  has(e) {
211
208
  return this.cache.has(e) || this._cache.has(e);
212
209
  }
213
- set(e, r) {
214
- return this.cache.has(e) ? this.cache.set(e, r) : this.update(e, r), this;
210
+ set(e, n) {
211
+ return this.cache.has(e) ? this.cache.set(e, n) : this.update(e, n), this;
215
212
  }
216
213
  delete(e) {
217
214
  return this.cache.has(e) ? this.cache.delete(e) : this._cache.has(e) ? this._cache.delete(e) : !1;
218
215
  }
219
- update(e, r) {
220
- this.cache.set(e, r), this.cache.size >= this.maxSize && (this._cache = this.cache, this.cache = /* @__PURE__ */ new Map());
216
+ update(e, n) {
217
+ this.cache.set(e, n), this.cache.size >= this.maxSize && (this._cache = this.cache, this.cache = /* @__PURE__ */ new Map());
221
218
  }
222
219
  }
223
220
  class S extends Error {
224
221
  constructor(e) {
225
- var r;
226
- super(e ?? "operation not supported"), this.name = this.constructor.name, (r = Error.captureStackTrace) == null || r.call(Error, this, this.constructor);
222
+ var n;
223
+ super(e ?? "operation not supported"), this.name = this.constructor.name, (n = Error.captureStackTrace) == null || n.call(Error, this, this.constructor);
227
224
  }
228
225
  }
229
- class Ye extends Error {
230
- constructor(e, r) {
226
+ class Ze extends Error {
227
+ constructor(e, n) {
231
228
  var o;
232
- super(e, r), this.name = this.constructor.name, (o = Error.captureStackTrace) == null || o.call(Error, this, this.constructor);
229
+ super(e, n), this.name = this.constructor.name, (o = Error.captureStackTrace) == null || o.call(Error, this, this.constructor);
233
230
  }
234
231
  }
235
- const a = Ye, pe = new Ve(100);
236
- function we(t) {
232
+ const s = Ze, ge = new Ge(100);
233
+ function me(t) {
237
234
  return t instanceof CryptoKey;
238
235
  }
239
- function ge(t) {
240
- return we(t) && t.type === "private";
236
+ function ye(t) {
237
+ return me(t) && t.type === "private";
241
238
  }
242
- function Ze(t) {
243
- return we(t) && t.type === "public";
239
+ function Ye(t) {
240
+ return me(t) && t.type === "public";
244
241
  }
245
- function ee(t) {
242
+ function X(t) {
246
243
  try {
247
244
  const e = t.headers.get("dpop-nonce");
248
- e && pe.set(new URL(t.url).origin, e);
245
+ e && ge.set(new URL(t.url).origin, e);
249
246
  } catch {
250
247
  }
251
248
  return t;
252
249
  }
253
- function C(t) {
250
+ function L(t) {
254
251
  return !(t === null || typeof t != "object" || Array.isArray(t));
255
252
  }
256
- function $(t) {
257
- Q(t, Headers) && (t = Object.fromEntries(t.entries()));
253
+ function W(t) {
254
+ Y(t, Headers) && (t = Object.fromEntries(t.entries()));
258
255
  const e = new Headers(t);
259
- if (Y && !e.has("user-agent") && e.set("user-agent", Y), e.has("authorization"))
256
+ if (G && !e.has("user-agent") && e.set("user-agent", G), e.has("authorization"))
260
257
  throw new TypeError('"options.headers" must not include the "authorization" header name');
261
258
  if (e.has("dpop"))
262
259
  throw new TypeError('"options.headers" must not include the "dpop" header name');
263
260
  return e;
264
261
  }
265
- function te(t) {
262
+ function ee(t) {
266
263
  if (typeof t == "function" && (t = t()), !(t instanceof AbortSignal))
267
264
  throw new TypeError('"options.signal" must return or be an instance of AbortSignal');
268
265
  return t;
@@ -272,80 +269,84 @@ async function Qe(t, e) {
272
269
  throw new TypeError('"issuerIdentifier" must be an instance of URL');
273
270
  if (t.protocol !== "https:" && t.protocol !== "http:")
274
271
  throw new TypeError('"issuer.protocol" must be "https:" or "http:"');
275
- const r = new URL(t.href);
272
+ const n = new URL(t.href);
276
273
  switch (e == null ? void 0 : e.algorithm) {
277
274
  case void 0:
278
275
  case "oidc":
279
- r.pathname = `${r.pathname}/.well-known/openid-configuration`.replace("//", "/");
276
+ n.pathname = `${n.pathname}/.well-known/openid-configuration`.replace("//", "/");
280
277
  break;
281
278
  case "oauth2":
282
- r.pathname === "/" ? r.pathname = ".well-known/oauth-authorization-server" : r.pathname = `.well-known/oauth-authorization-server/${r.pathname}`.replace("//", "/");
279
+ n.pathname === "/" ? n.pathname = ".well-known/oauth-authorization-server" : n.pathname = `.well-known/oauth-authorization-server/${n.pathname}`.replace("//", "/");
283
280
  break;
284
281
  default:
285
282
  throw new TypeError('"options.algorithm" must be "oidc" (default), or "oauth2"');
286
283
  }
287
- const o = $(e == null ? void 0 : e.headers);
288
- return o.set("accept", "application/json"), ((e == null ? void 0 : e[X]) || fetch)(r.href, {
284
+ const o = W(e == null ? void 0 : e.headers);
285
+ return o.set("accept", "application/json"), ((e == null ? void 0 : e[Q]) || fetch)(n.href, {
289
286
  headers: Object.fromEntries(o.entries()),
290
287
  method: "GET",
291
288
  redirect: "manual",
292
- signal: e != null && e.signal ? te(e.signal) : null
293
- }).then(ee);
289
+ signal: e != null && e.signal ? ee(e.signal) : null
290
+ }).then(X);
294
291
  }
295
- function p(t) {
292
+ function w(t) {
296
293
  return typeof t == "string" && t.length !== 0;
297
294
  }
298
295
  async function Xe(t, e) {
299
296
  if (!(t instanceof URL))
300
297
  throw new TypeError('"expectedIssuer" must be an instance of URL');
301
- if (!Q(e, Response))
298
+ if (!Y(e, Response))
302
299
  throw new TypeError('"response" must be an instance of Response');
303
300
  if (e.status !== 200)
304
- throw new a('"response" is not a conform Authorization Server Metadata response');
305
- re(e);
306
- let r;
301
+ throw new s('"response" is not a conform Authorization Server Metadata response');
302
+ te(e);
303
+ let n;
307
304
  try {
308
- r = await e.json();
305
+ n = await e.json();
309
306
  } catch (o) {
310
- throw new a('failed to parse "response" body as JSON', { cause: o });
307
+ throw new s('failed to parse "response" body as JSON', { cause: o });
311
308
  }
312
- if (!C(r))
313
- throw new a('"response" body must be a top level object');
314
- if (!p(r.issuer))
315
- throw new a('"response" body "issuer" property must be a non-empty string');
316
- if (new URL(r.issuer).href !== t.href)
317
- throw new a('"response" body "issuer" does not match "expectedIssuer"');
318
- return r;
309
+ if (!L(n))
310
+ throw new s('"response" body must be a top level object');
311
+ if (!w(n.issuer))
312
+ throw new s('"response" body "issuer" property must be a non-empty string');
313
+ if (new URL(n.issuer).href !== t.href)
314
+ throw new s('"response" body "issuer" does not match "expectedIssuer"');
315
+ return n;
319
316
  }
320
- function F() {
321
- return k(crypto.getRandomValues(new Uint8Array(32)));
317
+ function H() {
318
+ return A(crypto.getRandomValues(new Uint8Array(32)));
322
319
  }
323
320
  function et() {
324
- return F();
321
+ return H();
325
322
  }
326
323
  function tt() {
327
- return F();
324
+ return H();
328
325
  }
329
- async function rt(t) {
330
- if (!p(t))
326
+ async function nt(t) {
327
+ if (!w(t))
331
328
  throw new TypeError('"codeVerifier" must be a non-empty string');
332
- return k(await crypto.subtle.digest("SHA-256", A(t)));
329
+ return A(await crypto.subtle.digest("SHA-256", E(t)));
333
330
  }
334
- function nt(t) {
331
+ function rt(t) {
335
332
  if (t instanceof CryptoKey)
336
333
  return { key: t };
337
334
  if (!((t == null ? void 0 : t.key) instanceof CryptoKey))
338
335
  return {};
339
- if (t.kid !== void 0 && !p(t.kid))
336
+ if (t.kid !== void 0 && !w(t.kid))
340
337
  throw new TypeError('"kid" must be a non-empty string');
341
- return { key: t.key, kid: t.kid };
338
+ return {
339
+ key: t.key,
340
+ kid: t.kid,
341
+ modifyAssertion: t[we]
342
+ };
342
343
  }
343
344
  function ae(t) {
344
345
  return encodeURIComponent(t).replace(/%20/g, "+");
345
346
  }
346
347
  function ot(t, e) {
347
- const r = ae(t), o = ae(e);
348
- return `Basic ${btoa(`${r}:${o}`)}`;
348
+ const n = ae(t), o = ae(e);
349
+ return `Basic ${btoa(`${n}:${o}`)}`;
349
350
  }
350
351
  function it(t) {
351
352
  switch (t.algorithm.hash.name) {
@@ -359,7 +360,7 @@ function it(t) {
359
360
  throw new S("unsupported RsaHashedKeyAlgorithm hash name");
360
361
  }
361
362
  }
362
- function st(t) {
363
+ function at(t) {
363
364
  switch (t.algorithm.hash.name) {
364
365
  case "SHA-256":
365
366
  return "RS256";
@@ -371,7 +372,7 @@ function st(t) {
371
372
  throw new S("unsupported RsaHashedKeyAlgorithm hash name");
372
373
  }
373
374
  }
374
- function at(t) {
375
+ function st(t) {
375
376
  switch (t.algorithm.namedCurve) {
376
377
  case "P-256":
377
378
  return "ES256";
@@ -383,14 +384,14 @@ function at(t) {
383
384
  throw new S("unsupported EcKeyAlgorithm namedCurve");
384
385
  }
385
386
  }
386
- function me(t) {
387
+ function be(t) {
387
388
  switch (t.algorithm.name) {
388
389
  case "RSA-PSS":
389
390
  return it(t);
390
391
  case "RSASSA-PKCS1-v1_5":
391
- return st(t);
392
- case "ECDSA":
393
392
  return at(t);
393
+ case "ECDSA":
394
+ return st(t);
394
395
  case "Ed25519":
395
396
  case "Ed448":
396
397
  return "EdDSA";
@@ -398,271 +399,277 @@ function me(t) {
398
399
  throw new S("unsupported CryptoKey algorithm name");
399
400
  }
400
401
  }
401
- function I(t) {
402
- const e = t == null ? void 0 : t[H];
402
+ function C(t) {
403
+ const e = t == null ? void 0 : t[K];
403
404
  return typeof e == "number" && Number.isFinite(e) ? e : 0;
404
405
  }
405
- function ye(t) {
406
- const e = t == null ? void 0 : t[Fe];
406
+ function _e(t) {
407
+ const e = t == null ? void 0 : t[He];
407
408
  return typeof e == "number" && Number.isFinite(e) && Math.sign(e) !== -1 ? e : 30;
408
409
  }
409
- function M() {
410
+ function $() {
410
411
  return Math.floor(Date.now() / 1e3);
411
412
  }
412
413
  function ct(t, e) {
413
- const r = M() + I(e);
414
+ const n = $() + C(e);
414
415
  return {
415
- jti: F(),
416
+ jti: H(),
416
417
  aud: [t.issuer, t.token_endpoint],
417
- exp: r + 60,
418
- iat: r,
419
- nbf: r,
418
+ exp: n + 60,
419
+ iat: n,
420
+ nbf: n,
420
421
  iss: e.client_id,
421
422
  sub: e.client_id
422
423
  };
423
424
  }
424
- async function ut(t, e, r, o) {
425
- return be({
426
- alg: me(r),
427
- kid: o
428
- }, ct(t, e), r);
425
+ async function ut(t, e, n, o, a) {
426
+ const r = { alg: be(n), kid: o }, i = ct(t, e);
427
+ return a == null || a(r, i), ve(r, i, n);
429
428
  }
430
- function j(t) {
429
+ function x(t) {
431
430
  if (typeof t != "object" || t === null)
432
431
  throw new TypeError('"as" must be an object');
433
- if (!p(t.issuer))
432
+ if (!w(t.issuer))
434
433
  throw new TypeError('"as.issuer" property must be a non-empty string');
435
434
  return !0;
436
435
  }
437
- function J(t) {
436
+ function I(t) {
438
437
  if (typeof t != "object" || t === null)
439
438
  throw new TypeError('"client" must be an object');
440
- if (!p(t.client_id))
439
+ if (!w(t.client_id))
441
440
  throw new TypeError('"client.client_id" property must be a non-empty string');
442
441
  return !0;
443
442
  }
444
- function ce(t) {
445
- if (!p(t))
443
+ function se(t) {
444
+ if (!w(t))
446
445
  throw new TypeError('"client.client_secret" property must be a non-empty string');
447
446
  return t;
448
447
  }
449
- function q(t, e) {
448
+ function B(t, e) {
450
449
  if (e !== void 0)
451
450
  throw new TypeError(`"options.clientPrivateKey" property must not be provided when ${t} client authentication method is used.`);
452
451
  }
453
- function ue(t, e) {
452
+ function ce(t, e) {
454
453
  if (e !== void 0)
455
454
  throw new TypeError(`"client.client_secret" property must not be provided when ${t} client authentication method is used.`);
456
455
  }
457
- async function lt(t, e, r, o, s) {
458
- switch (r.delete("client_secret"), r.delete("client_assertion_type"), r.delete("client_assertion"), e.token_endpoint_auth_method) {
456
+ async function lt(t, e, n, o, a) {
457
+ switch (n.delete("client_secret"), n.delete("client_assertion_type"), n.delete("client_assertion"), e.token_endpoint_auth_method) {
459
458
  case void 0:
460
459
  case "client_secret_basic": {
461
- q("client_secret_basic", s), o.set("authorization", ot(e.client_id, ce(e.client_secret)));
460
+ B("client_secret_basic", a), o.set("authorization", ot(e.client_id, se(e.client_secret)));
462
461
  break;
463
462
  }
464
463
  case "client_secret_post": {
465
- q("client_secret_post", s), r.set("client_id", e.client_id), r.set("client_secret", ce(e.client_secret));
464
+ B("client_secret_post", a), n.set("client_id", e.client_id), n.set("client_secret", se(e.client_secret));
466
465
  break;
467
466
  }
468
467
  case "private_key_jwt": {
469
- if (ue("private_key_jwt", e.client_secret), s === void 0)
468
+ if (ce("private_key_jwt", e.client_secret), a === void 0)
470
469
  throw new TypeError('"options.clientPrivateKey" must be provided when "client.token_endpoint_auth_method" is "private_key_jwt"');
471
- const { key: n, kid: i } = nt(s);
472
- if (!ge(n))
470
+ const { key: r, kid: i, modifyAssertion: c } = rt(a);
471
+ if (!ye(r))
473
472
  throw new TypeError('"options.clientPrivateKey.key" must be a private CryptoKey');
474
- r.set("client_id", e.client_id), r.set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), r.set("client_assertion", await ut(t, e, n, i));
473
+ n.set("client_id", e.client_id), n.set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), n.set("client_assertion", await ut(t, e, r, i, c));
475
474
  break;
476
475
  }
477
476
  case "tls_client_auth":
478
477
  case "self_signed_tls_client_auth":
479
478
  case "none": {
480
- ue(e.token_endpoint_auth_method, e.client_secret), q(e.token_endpoint_auth_method, s), r.set("client_id", e.client_id);
479
+ ce(e.token_endpoint_auth_method, e.client_secret), B(e.token_endpoint_auth_method, a), n.set("client_id", e.client_id);
481
480
  break;
482
481
  }
483
482
  default:
484
483
  throw new S("unsupported client token_endpoint_auth_method");
485
484
  }
486
485
  }
487
- async function be(t, e, r) {
488
- if (!r.usages.includes("sign"))
486
+ async function ve(t, e, n) {
487
+ if (!n.usages.includes("sign"))
489
488
  throw new TypeError('CryptoKey instances used for signing assertions must include "sign" in their "usages"');
490
- const o = `${k(A(JSON.stringify(t)))}.${k(A(JSON.stringify(e)))}`, s = k(await crypto.subtle.sign(Ee(r), r, A(o)));
491
- return `${o}.${s}`;
489
+ const o = `${A(E(JSON.stringify(t)))}.${A(E(JSON.stringify(e)))}`, a = A(await crypto.subtle.sign(Pe(n), n, E(o)));
490
+ return `${o}.${a}`;
492
491
  }
493
- async function dt(t, e, r, o, s, n) {
494
- const { privateKey: i, publicKey: u, nonce: f = pe.get(r.origin) } = e;
495
- if (!ge(i))
492
+ async function dt(t, e, n, o, a, r) {
493
+ var T;
494
+ const { privateKey: i, publicKey: c, nonce: p = ge.get(n.origin) } = e;
495
+ if (!ye(i))
496
496
  throw new TypeError('"DPoP.privateKey" must be a private CryptoKey');
497
- if (!Ze(u))
497
+ if (!Ye(c))
498
498
  throw new TypeError('"DPoP.publicKey" must be a public CryptoKey');
499
- if (f !== void 0 && !p(f))
499
+ if (p !== void 0 && !w(p))
500
500
  throw new TypeError('"DPoP.nonce" must be a non-empty string or undefined');
501
- if (!u.extractable)
501
+ if (!c.extractable)
502
502
  throw new TypeError('"DPoP.publicKey.extractable" must be true');
503
- const m = M() + s, y = await be({
504
- alg: me(i),
503
+ const _ = $() + a, f = {
504
+ alg: be(i),
505
505
  typ: "dpop+jwt",
506
- jwk: await ft(u)
507
- }, {
508
- iat: m,
509
- jti: F(),
506
+ jwk: await ft(c)
507
+ }, y = {
508
+ iat: _,
509
+ jti: H(),
510
510
  htm: o,
511
- nonce: f,
512
- htu: `${r.origin}${r.pathname}`,
513
- ath: n ? k(await crypto.subtle.digest("SHA-256", A(n))) : void 0
514
- }, i);
515
- t.set("dpop", y);
511
+ nonce: p,
512
+ htu: `${n.origin}${n.pathname}`,
513
+ ath: r ? A(await crypto.subtle.digest("SHA-256", E(r))) : void 0
514
+ };
515
+ (T = e[we]) == null || T.call(e, f, y), t.set("dpop", await ve(f, y, i));
516
516
  }
517
- let W;
517
+ let D;
518
518
  async function ht(t) {
519
- const { kty: e, e: r, n: o, x: s, y: n, crv: i } = await crypto.subtle.exportKey("jwk", t), u = { kty: e, e: r, n: o, x: s, y: n, crv: i };
520
- return W.set(t, u), u;
519
+ const { kty: e, e: n, n: o, x: a, y: r, crv: i } = await crypto.subtle.exportKey("jwk", t), c = { kty: e, e: n, n: o, x: a, y: r, crv: i };
520
+ return D.set(t, c), c;
521
521
  }
522
522
  async function ft(t) {
523
- return W || (W = /* @__PURE__ */ new WeakMap()), W.get(t) || ht(t);
523
+ return D || (D = /* @__PURE__ */ new WeakMap()), D.get(t) || ht(t);
524
524
  }
525
- function pt(t, e, r) {
525
+ function ue(t, e, n) {
526
526
  if (typeof t != "string")
527
- throw new TypeError(`"as.${e}" must be a string`);
527
+ throw n ? new TypeError(`"as.mtls_endpoint_aliases.${e}" must be a string`) : new TypeError(`"as.${e}" must be a string`);
528
528
  return new URL(t);
529
529
  }
530
- function _e(t, e, r) {
531
- return pt(t[e], e);
530
+ function Se(t, e, n = !1) {
531
+ return n && t.mtls_endpoint_aliases && e in t.mtls_endpoint_aliases ? ue(t.mtls_endpoint_aliases[e], e, n) : ue(t[e], e, n);
532
+ }
533
+ function Te(t, e) {
534
+ return !!(t.use_mtls_endpoint_aliases || e != null && e[Fe]);
532
535
  }
533
536
  function Z(t) {
534
537
  const e = t;
535
538
  return typeof e != "object" || Array.isArray(e) || e === null ? !1 : e.error !== void 0;
536
539
  }
537
- async function wt(t, e, r, o, s, n) {
538
- if (!p(t))
540
+ async function pt(t, e, n, o, a, r) {
541
+ if (!w(t))
539
542
  throw new TypeError('"accessToken" must be a non-empty string');
540
- if (!(r instanceof URL))
543
+ if (!(n instanceof URL))
541
544
  throw new TypeError('"url" must be an instance of URL');
542
- return o = $(o), (n == null ? void 0 : n.DPoP) === void 0 ? o.set("authorization", `Bearer ${t}`) : (await dt(o, n.DPoP, r, "GET", I({ [H]: n == null ? void 0 : n[H] }), t), o.set("authorization", `DPoP ${t}`)), ((n == null ? void 0 : n[X]) || fetch)(r.href, {
543
- body: s,
545
+ return o = W(o), (r == null ? void 0 : r.DPoP) === void 0 ? o.set("authorization", `Bearer ${t}`) : (await dt(o, r.DPoP, n, e.toUpperCase(), C({ [K]: r == null ? void 0 : r[K] }), t), o.set("authorization", `DPoP ${t}`)), ((r == null ? void 0 : r[Q]) || fetch)(n.href, {
546
+ body: a,
544
547
  headers: Object.fromEntries(o.entries()),
545
548
  method: e,
546
549
  redirect: "manual",
547
- signal: n != null && n.signal ? te(n.signal) : null
548
- }).then(ee);
550
+ signal: r != null && r.signal ? ee(r.signal) : null
551
+ }).then(X);
549
552
  }
550
- async function gt(t, e, r, o) {
551
- j(t), J(e);
552
- const s = _e(t, "userinfo_endpoint"), n = $(o == null ? void 0 : o.headers);
553
- return e.userinfo_signed_response_alg ? n.set("accept", "application/jwt") : (n.set("accept", "application/json"), n.append("accept", "application/jwt")), wt(r, "GET", s, n, null, {
553
+ async function wt(t, e, n, o) {
554
+ x(t), I(e);
555
+ const a = Se(t, "userinfo_endpoint", Te(e, o)), r = W(o == null ? void 0 : o.headers);
556
+ return e.userinfo_signed_response_alg ? r.set("accept", "application/jwt") : (r.set("accept", "application/json"), r.append("accept", "application/jwt")), pt(n, "GET", a, r, null, {
554
557
  ...o,
555
- [H]: I(e)
558
+ [K]: C(e)
556
559
  });
557
560
  }
558
- async function mt(t, e, r, o, s, n, i) {
559
- return await lt(t, e, s, n, i == null ? void 0 : i.clientPrivateKey), n.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"), ((i == null ? void 0 : i[X]) || fetch)(o.href, {
560
- body: s,
561
- headers: Object.fromEntries(n.entries()),
562
- method: r,
561
+ async function gt(t, e, n, o, a, r, i) {
562
+ return await lt(t, e, a, r, i == null ? void 0 : i.clientPrivateKey), r.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"), ((i == null ? void 0 : i[Q]) || fetch)(o.href, {
563
+ body: a,
564
+ headers: Object.fromEntries(r.entries()),
565
+ method: n,
563
566
  redirect: "manual",
564
- signal: i != null && i.signal ? te(i.signal) : null
565
- }).then(ee);
567
+ signal: i != null && i.signal ? ee(i.signal) : null
568
+ }).then(X);
566
569
  }
567
- async function ve(t, e, r, o, s) {
568
- const n = _e(t, "token_endpoint");
569
- o.set("grant_type", r);
570
- const i = $(s == null ? void 0 : s.headers);
571
- return i.set("accept", "application/json"), mt(t, e, "POST", n, o, i, s);
570
+ async function ke(t, e, n, o, a) {
571
+ const r = Se(t, "token_endpoint", Te(e, a));
572
+ o.set("grant_type", n);
573
+ const i = W(a == null ? void 0 : a.headers);
574
+ return i.set("accept", "application/json"), gt(t, e, "POST", r, o, i, a);
572
575
  }
573
- async function yt(t, e, r, o) {
574
- if (j(t), J(e), !p(r))
576
+ async function mt(t, e, n, o) {
577
+ if (x(t), I(e), !w(n))
575
578
  throw new TypeError('"refreshToken" must be a non-empty string');
576
- const s = new URLSearchParams(o == null ? void 0 : o.additionalParameters);
577
- return s.set("refresh_token", r), ve(t, e, "refresh_token", s, o);
579
+ const a = new URLSearchParams(o == null ? void 0 : o.additionalParameters);
580
+ return a.set("refresh_token", n), ke(t, e, "refresh_token", a, o);
578
581
  }
579
- const Se = /* @__PURE__ */ new WeakMap();
580
- function bt(t) {
582
+ const Ae = /* @__PURE__ */ new WeakMap();
583
+ function yt(t) {
581
584
  if (!t.id_token)
582
585
  return;
583
- const e = Se.get(t);
586
+ const e = Ae.get(t);
584
587
  if (!e)
585
588
  throw new TypeError('"ref" was already garbage collected or did not resolve from the proper sources');
586
- return e;
589
+ return e[0];
587
590
  }
588
- async function Te(t, e, r, o = !1, s = !1) {
589
- if (j(t), J(e), !Q(r, Response))
591
+ async function Ee(t, e, n, o = !1, a = !1) {
592
+ if (x(t), I(e), !Y(n, Response))
590
593
  throw new TypeError('"response" must be an instance of Response');
591
- if (r.status !== 200) {
594
+ if (n.status !== 200) {
592
595
  let i;
593
- if (i = await xt(r))
596
+ if (i = await Pt(n))
594
597
  return i;
595
- throw new a('"response" is not a conform Token Endpoint response');
598
+ throw new s('"response" is not a conform Token Endpoint response');
596
599
  }
597
- re(r);
598
- let n;
600
+ te(n);
601
+ let r;
599
602
  try {
600
- n = await r.json();
603
+ r = await n.json();
601
604
  } catch (i) {
602
- throw new a('failed to parse "response" body as JSON', { cause: i });
605
+ throw new s('failed to parse "response" body as JSON', { cause: i });
603
606
  }
604
- if (!C(n))
605
- throw new a('"response" body must be a top level object');
606
- if (!p(n.access_token))
607
- throw new a('"response" body "access_token" property must be a non-empty string');
608
- if (!p(n.token_type))
609
- throw new a('"response" body "token_type" property must be a non-empty string');
610
- if (n.token_type = n.token_type.toLowerCase(), n.token_type !== "dpop" && n.token_type !== "bearer")
607
+ if (!L(r))
608
+ throw new s('"response" body must be a top level object');
609
+ if (!w(r.access_token))
610
+ throw new s('"response" body "access_token" property must be a non-empty string');
611
+ if (!w(r.token_type))
612
+ throw new s('"response" body "token_type" property must be a non-empty string');
613
+ if (r.token_type = r.token_type.toLowerCase(), r.token_type !== "dpop" && r.token_type !== "bearer")
611
614
  throw new S("unsupported `token_type` value");
612
- if (n.expires_in !== void 0 && (typeof n.expires_in != "number" || n.expires_in <= 0))
613
- throw new a('"response" body "expires_in" property must be a positive number');
614
- if (!s && n.refresh_token !== void 0 && !p(n.refresh_token))
615
- throw new a('"response" body "refresh_token" property must be a non-empty string');
616
- if (n.scope !== void 0 && typeof n.scope != "string")
617
- throw new a('"response" body "scope" property must be a string');
615
+ if (r.expires_in !== void 0 && (typeof r.expires_in != "number" || r.expires_in <= 0))
616
+ throw new s('"response" body "expires_in" property must be a positive number');
617
+ if (!a && r.refresh_token !== void 0 && !w(r.refresh_token))
618
+ throw new s('"response" body "refresh_token" property must be a non-empty string');
619
+ if (r.scope !== void 0 && typeof r.scope != "string")
620
+ throw new s('"response" body "scope" property must be a string');
618
621
  if (!o) {
619
- if (n.id_token !== void 0 && !p(n.id_token))
620
- throw new a('"response" body "id_token" property must be a non-empty string');
621
- if (n.id_token) {
622
- const { claims: i } = await Lt(n.id_token, Ct.bind(void 0, e.id_token_signed_response_alg, t.id_token_signing_alg_values_supported), Ae, I(e), ye(e)).then(At.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(St.bind(void 0, t.issuer)).then(vt.bind(void 0, e.client_id));
623
- if (Array.isArray(i.aud) && i.aud.length !== 1 && i.azp !== e.client_id)
624
- throw new a('unexpected ID Token "azp" (authorized party) claim value');
622
+ if (r.id_token !== void 0 && !w(r.id_token))
623
+ throw new s('"response" body "id_token" property must be a non-empty string');
624
+ if (r.id_token) {
625
+ const { claims: i, jwt: c } = await Ct(r.id_token, xt.bind(void 0, e.id_token_signed_response_alg, t.id_token_signing_alg_values_supported), Ue, C(e), _e(e), e[$e]).then(At.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(vt.bind(void 0, t.issuer)).then(_t.bind(void 0, e.client_id));
626
+ if (Array.isArray(i.aud) && i.aud.length !== 1) {
627
+ if (i.azp === void 0)
628
+ throw new s('ID Token "aud" (audience) claim includes additional untrusted audiences');
629
+ if (i.azp !== e.client_id)
630
+ throw new s('unexpected ID Token "azp" (authorized party) claim value');
631
+ }
625
632
  if (i.auth_time !== void 0 && (!Number.isFinite(i.auth_time) || Math.sign(i.auth_time) !== 1))
626
- throw new a('ID Token "auth_time" (authentication time) must be a positive number');
627
- Se.set(n, i);
633
+ throw new s('ID Token "auth_time" (authentication time) must be a positive number');
634
+ Ae.set(r, [i, c]);
628
635
  }
629
636
  }
630
- return n;
637
+ return r;
631
638
  }
632
- async function _t(t, e, r) {
633
- return Te(t, e, r);
639
+ async function bt(t, e, n) {
640
+ return Ee(t, e, n);
634
641
  }
635
- function vt(t, e) {
642
+ function _t(t, e) {
636
643
  if (Array.isArray(e.claims.aud)) {
637
644
  if (!e.claims.aud.includes(t))
638
- throw new a('unexpected JWT "aud" (audience) claim value');
645
+ throw new s('unexpected JWT "aud" (audience) claim value');
639
646
  } else if (e.claims.aud !== t)
640
- throw new a('unexpected JWT "aud" (audience) claim value');
647
+ throw new s('unexpected JWT "aud" (audience) claim value');
641
648
  return e;
642
649
  }
643
- function St(t, e) {
650
+ function vt(t, e) {
644
651
  if (e.claims.iss !== t)
645
- throw new a('unexpected JWT "iss" (issuer) claim value');
652
+ throw new s('unexpected JWT "iss" (issuer) claim value');
646
653
  return e;
647
654
  }
648
- const ke = /* @__PURE__ */ new WeakSet();
649
- function Tt(t) {
650
- return ke.add(t), t;
655
+ const Re = /* @__PURE__ */ new WeakSet();
656
+ function St(t) {
657
+ return Re.add(t), t;
651
658
  }
652
- async function kt(t, e, r, o, s, n) {
653
- if (j(t), J(e), !ke.has(r))
659
+ async function Tt(t, e, n, o, a, r) {
660
+ if (x(t), I(e), !Re.has(n))
654
661
  throw new TypeError('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()');
655
- if (!p(o))
662
+ if (!w(o))
656
663
  throw new TypeError('"redirectUri" must be a non-empty string');
657
- if (!p(s))
664
+ if (!w(a))
658
665
  throw new TypeError('"codeVerifier" must be a non-empty string');
659
- const i = T(r, "code");
666
+ const i = k(n, "code");
660
667
  if (!i)
661
- throw new a('no authorization code in "callbackParameters"');
662
- const u = new URLSearchParams(n == null ? void 0 : n.additionalParameters);
663
- return u.set("redirect_uri", o), u.set("code_verifier", s), u.set("code", i), ve(t, e, "authorization_code", u, n);
668
+ throw new s('no authorization code in "callbackParameters"');
669
+ const c = new URLSearchParams(r == null ? void 0 : r.additionalParameters);
670
+ return c.set("redirect_uri", o), c.set("code_verifier", a), c.set("code", i), ke(t, e, "authorization_code", c, r);
664
671
  }
665
- const Et = {
672
+ const kt = {
666
673
  aud: "audience",
667
674
  c_hash: "code hash",
668
675
  client_id: "client id",
@@ -679,55 +686,55 @@ const Et = {
679
686
  cnf: "confirmation"
680
687
  };
681
688
  function At(t, e) {
682
- for (const r of t)
683
- if (e.claims[r] === void 0)
684
- throw new a(`JWT "${r}" (${Et[r]}) claim missing`);
689
+ for (const n of t)
690
+ if (e.claims[n] === void 0)
691
+ throw new s(`JWT "${n}" (${kt[n]}) claim missing`);
685
692
  return e;
686
693
  }
687
- const Rt = Symbol(), G = Symbol();
688
- async function Pt(t, e, r, o, s) {
689
- const n = await Te(t, e, r);
690
- if (Z(n))
691
- return n;
692
- if (!p(n.id_token))
693
- throw new a('"response" body "id_token" property must be a non-empty string');
694
- s ?? (s = e.default_max_age ?? G);
695
- const i = bt(n);
696
- if ((e.require_auth_time || s !== G) && i.auth_time === void 0)
697
- throw new a('ID Token "auth_time" (authentication time) claim missing');
698
- if (s !== G) {
699
- if (typeof s != "number" || s < 0)
694
+ const Et = Symbol(), q = Symbol();
695
+ async function Rt(t, e, n, o, a) {
696
+ const r = await Ee(t, e, n);
697
+ if (Z(r))
698
+ return r;
699
+ if (!w(r.id_token))
700
+ throw new s('"response" body "id_token" property must be a non-empty string');
701
+ a ?? (a = e.default_max_age ?? q);
702
+ const i = yt(r);
703
+ if ((e.require_auth_time || a !== q) && i.auth_time === void 0)
704
+ throw new s('ID Token "auth_time" (authentication time) claim missing');
705
+ if (a !== q) {
706
+ if (typeof a != "number" || a < 0)
700
707
  throw new TypeError('"maxAge" must be a non-negative number');
701
- const u = M() + I(e), f = ye(e);
702
- if (i.auth_time + s < u - f)
703
- throw new a("too much time has elapsed since the last End-User authentication");
708
+ const c = $() + C(e), p = _e(e);
709
+ if (i.auth_time + a < c - p)
710
+ throw new s("too much time has elapsed since the last End-User authentication");
704
711
  }
705
712
  switch (o) {
706
713
  case void 0:
707
- case Rt:
714
+ case Et:
708
715
  if (i.nonce !== void 0)
709
- throw new a('unexpected ID Token "nonce" claim value');
716
+ throw new s('unexpected ID Token "nonce" claim value');
710
717
  break;
711
718
  default:
712
- if (!p(o))
719
+ if (!w(o))
713
720
  throw new TypeError('"expectedNonce" must be a non-empty string');
714
721
  if (i.nonce === void 0)
715
- throw new a('ID Token "nonce" claim missing');
722
+ throw new s('ID Token "nonce" claim missing');
716
723
  if (i.nonce !== o)
717
- throw new a('unexpected ID Token "nonce" claim value');
724
+ throw new s('unexpected ID Token "nonce" claim value');
718
725
  }
719
- return n;
726
+ return r;
720
727
  }
721
- function re(t) {
728
+ function te(t) {
722
729
  if (t.bodyUsed)
723
730
  throw new TypeError('"response" body has been used already');
724
731
  }
725
- async function xt(t) {
732
+ async function Pt(t) {
726
733
  if (t.status > 399 && t.status < 500) {
727
- re(t);
734
+ te(t);
728
735
  try {
729
736
  const e = await t.json();
730
- if (C(e) && typeof e.error == "string" && e.error.length)
737
+ if (L(e) && typeof e.error == "string" && e.error.length)
731
738
  return e.error_description !== void 0 && typeof e.error_description != "string" && delete e.error_description, e.error_uri !== void 0 && typeof e.error_uri != "string" && delete e.error_uri, e.algs !== void 0 && typeof e.algs != "string" && delete e.algs, e.scope !== void 0 && typeof e.scope != "string" && delete e.scope, e;
732
739
  } catch {
733
740
  }
@@ -735,7 +742,7 @@ async function xt(t) {
735
742
  }
736
743
  function le(t) {
737
744
  if (typeof t.modulusLength != "number" || t.modulusLength < 2048)
738
- throw new a(`${t.name} modulusLength must be at least 2048 bits`);
745
+ throw new s(`${t.name} modulusLength must be at least 2048 bits`);
739
746
  }
740
747
  function Ut(t) {
741
748
  switch (t) {
@@ -749,7 +756,7 @@ function Ut(t) {
749
756
  throw new S();
750
757
  }
751
758
  }
752
- function Ee(t) {
759
+ function Pe(t) {
753
760
  switch (t.algorithm.name) {
754
761
  case "ECDSA":
755
762
  return {
@@ -776,160 +783,160 @@ function Ee(t) {
776
783
  }
777
784
  throw new S();
778
785
  }
779
- const Ae = Symbol();
780
- async function Lt(t, e, r, o, s) {
781
- const { 0: n, 1: i, 2: u, length: f } = t.split(".");
782
- if (f === 5)
783
- throw new S("JWE structure JWTs are not supported");
784
- if (f !== 3)
785
- throw new a("Invalid JWT");
786
- let m;
786
+ const Ue = Symbol();
787
+ async function Lt(t, e, n, o) {
788
+ const a = `${t}.${e}`;
789
+ if (!await crypto.subtle.verify(Pe(n), n, o, E(a)))
790
+ throw new s("JWT signature verification failed");
791
+ }
792
+ async function Ct(t, e, n, o, a, r) {
793
+ let { 0: i, 1: c, 2: p, length: _ } = t.split(".");
794
+ if (_ === 5)
795
+ if (r !== void 0)
796
+ t = await r(t), { 0: i, 1: c, 2: p, length: _ } = t.split(".");
797
+ else
798
+ throw new S("JWE structure JWTs are not supported");
799
+ if (_ !== 3)
800
+ throw new s("Invalid JWT");
801
+ let f;
787
802
  try {
788
- m = JSON.parse(A(k(n)));
789
- } catch (P) {
790
- throw new a("failed to parse JWT Header body as base64url encoded JSON", { cause: P });
791
- }
792
- if (!C(m))
793
- throw new a("JWT Header must be a top level object");
794
- if (e(m), m.crit !== void 0)
795
- throw new a('unexpected JWT "crit" header parameter');
796
- const y = k(u);
797
- let b;
798
- if (r !== Ae) {
799
- b = await r(m);
800
- const P = `${n}.${i}`;
801
- if (!await crypto.subtle.verify(Ee(b), b, y, A(P)))
802
- throw new a("JWT signature verification failed");
803
+ f = JSON.parse(E(A(i)));
804
+ } catch (l) {
805
+ throw new s("failed to parse JWT Header body as base64url encoded JSON", { cause: l });
803
806
  }
807
+ if (!L(f))
808
+ throw new s("JWT Header must be a top level object");
809
+ if (e(f), f.crit !== void 0)
810
+ throw new s('unexpected JWT "crit" header parameter');
811
+ const y = A(p);
812
+ let T;
813
+ n !== Ue && (T = await n(f), await Lt(i, c, T, y));
804
814
  let h;
805
815
  try {
806
- h = JSON.parse(A(k(i)));
807
- } catch (P) {
808
- throw new a("failed to parse JWT Payload body as base64url encoded JSON", { cause: P });
816
+ h = JSON.parse(E(A(c)));
817
+ } catch (l) {
818
+ throw new s("failed to parse JWT Payload body as base64url encoded JSON", { cause: l });
809
819
  }
810
- if (!C(h))
811
- throw new a("JWT Payload must be a top level object");
812
- const R = M() + o;
820
+ if (!L(h))
821
+ throw new s("JWT Payload must be a top level object");
822
+ const j = $() + o;
813
823
  if (h.exp !== void 0) {
814
824
  if (typeof h.exp != "number")
815
- throw new a('unexpected JWT "exp" (expiration time) claim type');
816
- if (h.exp <= R - s)
817
- throw new a('unexpected JWT "exp" (expiration time) claim value, timestamp is <= now()');
825
+ throw new s('unexpected JWT "exp" (expiration time) claim type');
826
+ if (h.exp <= j - a)
827
+ throw new s('unexpected JWT "exp" (expiration time) claim value, timestamp is <= now()');
818
828
  }
819
829
  if (h.iat !== void 0 && typeof h.iat != "number")
820
- throw new a('unexpected JWT "iat" (issued at) claim type');
830
+ throw new s('unexpected JWT "iat" (issued at) claim type');
821
831
  if (h.iss !== void 0 && typeof h.iss != "string")
822
- throw new a('unexpected JWT "iss" (issuer) claim type');
832
+ throw new s('unexpected JWT "iss" (issuer) claim type');
823
833
  if (h.nbf !== void 0) {
824
834
  if (typeof h.nbf != "number")
825
- throw new a('unexpected JWT "nbf" (not before) claim type');
826
- if (h.nbf > R + s)
827
- throw new a('unexpected JWT "nbf" (not before) claim value, timestamp is > now()');
835
+ throw new s('unexpected JWT "nbf" (not before) claim type');
836
+ if (h.nbf > j + a)
837
+ throw new s('unexpected JWT "nbf" (not before) claim value, timestamp is > now()');
828
838
  }
829
839
  if (h.aud !== void 0 && typeof h.aud != "string" && !Array.isArray(h.aud))
830
- throw new a('unexpected JWT "aud" (audience) claim type');
831
- return { header: m, claims: h, signature: y, key: b };
840
+ throw new s('unexpected JWT "aud" (audience) claim type');
841
+ return { header: f, claims: h, signature: y, key: T, jwt: t };
832
842
  }
833
- function Ct(t, e, r) {
843
+ function xt(t, e, n) {
834
844
  if (t !== void 0) {
835
- if (r.alg !== t)
836
- throw new a('unexpected JWT "alg" header parameter');
845
+ if (n.alg !== t)
846
+ throw new s('unexpected JWT "alg" header parameter');
837
847
  return;
838
848
  }
839
849
  if (Array.isArray(e)) {
840
- if (!e.includes(r.alg))
841
- throw new a('unexpected JWT "alg" header parameter');
850
+ if (!e.includes(n.alg))
851
+ throw new s('unexpected JWT "alg" header parameter');
842
852
  return;
843
853
  }
844
- if (r.alg !== "RS256")
845
- throw new a('unexpected JWT "alg" header parameter');
854
+ if (n.alg !== "RS256")
855
+ throw new s('unexpected JWT "alg" header parameter');
846
856
  }
847
- function T(t, e) {
848
- const { 0: r, length: o } = t.getAll(e);
857
+ function k(t, e) {
858
+ const { 0: n, length: o } = t.getAll(e);
849
859
  if (o > 1)
850
- throw new a(`"${e}" parameter must be provided only once`);
851
- return r;
860
+ throw new s(`"${e}" parameter must be provided only once`);
861
+ return n;
852
862
  }
853
863
  const It = Symbol(), jt = Symbol();
854
- function Jt(t, e, r, o) {
855
- if (j(t), J(e), r instanceof URL && (r = r.searchParams), !(r instanceof URLSearchParams))
864
+ function Jt(t, e, n, o) {
865
+ if (x(t), I(e), n instanceof URL && (n = n.searchParams), !(n instanceof URLSearchParams))
856
866
  throw new TypeError('"parameters" must be an instance of URLSearchParams, or URL');
857
- if (T(r, "response"))
858
- throw new a('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()');
859
- const s = T(r, "iss"), n = T(r, "state");
860
- if (!s && t.authorization_response_iss_parameter_supported)
861
- throw new a('response parameter "iss" (issuer) missing');
862
- if (s && s !== t.issuer)
863
- throw new a('unexpected "iss" (issuer) response parameter value');
867
+ if (k(n, "response"))
868
+ throw new s('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()');
869
+ const a = k(n, "iss"), r = k(n, "state");
870
+ if (!a && t.authorization_response_iss_parameter_supported)
871
+ throw new s('response parameter "iss" (issuer) missing');
872
+ if (a && a !== t.issuer)
873
+ throw new s('unexpected "iss" (issuer) response parameter value');
864
874
  switch (o) {
865
875
  case void 0:
866
876
  case jt:
867
- if (n !== void 0)
868
- throw new a('unexpected "state" response parameter encountered');
877
+ if (r !== void 0)
878
+ throw new s('unexpected "state" response parameter encountered');
869
879
  break;
870
880
  case It:
871
881
  break;
872
882
  default:
873
- if (!p(o))
874
- throw new a('"expectedState" must be a non-empty string');
875
- if (n === void 0)
876
- throw new a('response parameter "state" missing');
877
- if (n !== o)
878
- throw new a('unexpected "state" response parameter value');
883
+ if (!w(o))
884
+ throw new s('"expectedState" must be a non-empty string');
885
+ if (r === void 0)
886
+ throw new s('response parameter "state" missing');
887
+ if (r !== o)
888
+ throw new s('unexpected "state" response parameter value');
879
889
  }
880
- const i = T(r, "error");
890
+ const i = k(n, "error");
881
891
  if (i)
882
892
  return {
883
893
  error: i,
884
- error_description: T(r, "error_description"),
885
- error_uri: T(r, "error_uri")
894
+ error_description: k(n, "error_description"),
895
+ error_uri: k(n, "error_uri")
886
896
  };
887
- const u = T(r, "id_token"), f = T(r, "token");
888
- if (u !== void 0 || f !== void 0)
897
+ const c = k(n, "id_token"), p = k(n, "token");
898
+ if (c !== void 0 || p !== void 0)
889
899
  throw new S("implicit and hybrid flows are not supported");
890
- return Tt(new URLSearchParams(r));
900
+ return St(new URLSearchParams(n));
891
901
  }
892
902
  function Ot({
893
903
  handleCallback: t
894
904
  }) {
895
- const [e, r] = Je(null), o = He(), s = Oe(!1);
896
- return Ne(() => {
897
- s.current || (s.current = !0, t().then((n) => {
898
- o(n);
899
- }).catch((n) => {
900
- K.error(n), r(n);
901
- }));
902
- }, [o, t]), e ? /* @__PURE__ */ E.jsx(
903
- De,
904
- {
905
- category: "Error",
906
- title: "Authentication Error",
907
- message: /* @__PURE__ */ E.jsxs(E.Fragment, { children: [
908
- /* @__PURE__ */ E.jsx(ze, { className: "mb-4", children: "Check the configuration of your authorization provider and ensure all settings such as the callback URL are configured correctly." }),
909
- "An error occurred while authorizing the user.",
910
- /* @__PURE__ */ E.jsx(We, { code: e.toString(), language: "plain" })
911
- ] })
905
+ const e = ze({
906
+ retry: !1,
907
+ queryKey: ["oauth-callback"],
908
+ queryFn: async () => {
909
+ try {
910
+ return await t();
911
+ } catch (n) {
912
+ throw new De("Could not validate user", {
913
+ cause: n,
914
+ title: "Authentication Error",
915
+ developerHint: "Check the configuration of your authorization provider and ensure all settings such as the callback URL are configured correctly."
916
+ });
917
+ }
912
918
  }
913
- ) : /* @__PURE__ */ E.jsx("div", { className: "grid h-full place-items-center", children: /* @__PURE__ */ E.jsx(Ke, {}) });
919
+ });
920
+ return /* @__PURE__ */ fe.jsx(Ke, { to: e.data });
914
921
  }
915
- class U extends Error {
922
+ class P extends Error {
916
923
  }
917
- class de extends U {
918
- constructor(e, r, o) {
919
- super(e, o), this.error = r;
924
+ class de extends P {
925
+ constructor(e, n, o) {
926
+ super(e, o), this.error = n;
920
927
  }
921
928
  }
922
929
  const V = "code-verifier";
923
- class Nt extends je {
924
- constructor(e, r) {
925
- super(), this.callbackUrlPath = e, this.handleCallback = r;
930
+ class Nt extends Ne {
931
+ constructor(e, n) {
932
+ super(), this.callbackUrlPath = e, this.handleCallback = n;
926
933
  }
927
934
  getRoutes() {
928
935
  return [
929
936
  ...super.getRoutes(),
930
937
  {
931
938
  path: this.callbackUrlPath,
932
- element: /* @__PURE__ */ E.jsx(Ot, { handleCallback: this.handleCallback })
939
+ element: /* @__PURE__ */ fe.jsx(Ot, { handleCallback: this.handleCallback })
933
940
  }
934
941
  ];
935
942
  }
@@ -937,100 +944,100 @@ class Nt extends je {
937
944
  class zt {
938
945
  constructor({
939
946
  issuer: e,
940
- audience: r,
947
+ audience: n,
941
948
  clientId: o,
942
- redirectToAfterSignUp: s,
943
- redirectToAfterSignIn: n,
949
+ redirectToAfterSignUp: a,
950
+ redirectToAfterSignIn: r,
944
951
  redirectToAfterSignOut: i
945
952
  }) {
946
- _(this, "client");
947
- _(this, "issuer");
948
- _(this, "authorizationServer");
949
- _(this, "callbackUrlPath", "/oauth/callback");
950
- _(this, "logoutRedirectUrlPath", "/");
951
- _(this, "onAuthorizationUrl");
952
- _(this, "redirectToAfterSignUp");
953
- _(this, "redirectToAfterSignIn");
954
- _(this, "redirectToAfterSignOut");
955
- _(this, "audience");
956
- _(this, "signOut", async () => {
957
- z.setState({
953
+ b(this, "client");
954
+ b(this, "issuer");
955
+ b(this, "authorizationServer");
956
+ b(this, "callbackUrlPath", "/oauth/callback");
957
+ b(this, "logoutRedirectUrlPath", "/");
958
+ b(this, "onAuthorizationUrl");
959
+ b(this, "redirectToAfterSignUp");
960
+ b(this, "redirectToAfterSignIn");
961
+ b(this, "redirectToAfterSignOut");
962
+ b(this, "audience");
963
+ b(this, "signOut", async () => {
964
+ N.setState({
958
965
  isAuthenticated: !1,
959
966
  isPending: !1,
960
967
  profile: void 0
961
968
  }), sessionStorage.clear();
962
- const e = await this.getAuthServer(), r = new URL(
969
+ const e = await this.getAuthServer(), n = new URL(
963
970
  window.location.origin + this.redirectToAfterSignOut
964
971
  );
965
- r.pathname = this.logoutRedirectUrlPath;
972
+ n.pathname = this.logoutRedirectUrlPath;
966
973
  let o;
967
974
  e.end_session_endpoint ? (o = new URL(e.end_session_endpoint), o.searchParams.set(
968
975
  "post_logout_redirect_uri",
969
- r.toString()
970
- )) : o = r;
976
+ n.toString()
977
+ )) : o = n;
971
978
  });
972
- _(this, "handleCallback", async () => {
973
- const e = new URL(window.location.href), r = e.searchParams.get("state"), o = sessionStorage.getItem(V);
979
+ b(this, "handleCallback", async () => {
980
+ const e = new URL(window.location.href), n = e.searchParams.get("state"), o = sessionStorage.getItem(V);
974
981
  if (sessionStorage.removeItem(V), !o)
975
- throw new U("No code verifier found in state.");
976
- const s = await this.getAuthServer(), n = Jt(
977
- s,
982
+ throw new P("No code verifier found in state.");
983
+ const a = await this.getAuthServer(), r = Jt(
984
+ a,
978
985
  this.client,
979
986
  e.searchParams,
980
- r ?? void 0
987
+ n ?? void 0
981
988
  );
982
- if (Z(n))
983
- throw K.error("Error validating OAuth response", n), new de(
989
+ if (Z(r))
990
+ throw M.error("Error validating OAuth response", r), new de(
984
991
  "Error validating OAuth response",
985
- n
992
+ r
986
993
  );
987
994
  const i = new URL(e);
988
995
  i.pathname = this.redirectToAfterSignIn, i.search = "";
989
- const u = await kt(
990
- s,
996
+ const c = await Tt(
997
+ a,
991
998
  this.client,
992
- n,
999
+ r,
993
1000
  i.toString(),
994
1001
  o
995
- ), f = await Pt(
996
- s,
1002
+ ), p = await Rt(
1003
+ a,
997
1004
  this.client,
998
- u
1005
+ c
999
1006
  );
1000
- this.setTokensFromResponse(f);
1001
- const m = await this.getAccessToken(), b = await (await gt(
1002
- s,
1007
+ this.setTokensFromResponse(p);
1008
+ const _ = await this.getAccessToken(), y = await (await wt(
1009
+ a,
1003
1010
  this.client,
1004
- m
1005
- )).json(), h = {
1006
- sub: b.sub,
1007
- email: b.email,
1008
- name: b.name,
1009
- emailVerified: b.email_verified ?? !1,
1010
- pictureUrl: b.picture
1011
+ _
1012
+ )).json(), T = {
1013
+ sub: y.sub,
1014
+ email: y.email,
1015
+ name: y.name,
1016
+ emailVerified: y.email_verified ?? !1,
1017
+ pictureUrl: y.picture
1011
1018
  };
1012
- z.setState({
1019
+ N.setState({
1013
1020
  isAuthenticated: !0,
1014
1021
  isPending: !1,
1015
- profile: h
1022
+ profile: T
1016
1023
  }), sessionStorage.setItem(
1017
1024
  "profile-state",
1018
- JSON.stringify(z.getState().profile)
1025
+ JSON.stringify(N.getState().profile)
1019
1026
  );
1020
- const R = sessionStorage.getItem("redirect-to") ?? "/";
1021
- return sessionStorage.removeItem("redirect-to"), R;
1027
+ const h = sessionStorage.getItem("redirect-to") ?? "/";
1028
+ return sessionStorage.removeItem("redirect-to"), h;
1022
1029
  });
1023
1030
  this.client = {
1024
1031
  client_id: o,
1025
1032
  token_endpoint_auth_method: "none"
1026
- }, this.audience = r, this.issuer = e, this.redirectToAfterSignUp = s ?? "/", this.redirectToAfterSignIn = n ?? "/", this.redirectToAfterSignOut = i ?? "/";
1033
+ }, this.audience = n, this.issuer = e, this.redirectToAfterSignUp = a ?? "/", this.redirectToAfterSignIn = r ?? "/", this.redirectToAfterSignOut = i ?? "/";
1027
1034
  }
1028
1035
  async getAuthServer() {
1029
1036
  if (!this.authorizationServer) {
1030
- const e = new URL(this.issuer), r = await Qe(e);
1037
+ const e = new URL(this.issuer), n = await Qe(e);
1031
1038
  this.authorizationServer = await Xe(
1032
1039
  e,
1033
- r
1040
+ n
1034
1041
  );
1035
1042
  }
1036
1043
  return this.authorizationServer;
@@ -1041,16 +1048,16 @@ class zt {
1041
1048
  */
1042
1049
  setTokensFromResponse(e) {
1043
1050
  if (Z(e))
1044
- throw K.error("Bad Token Response", e), new de("Bad Token Response", e);
1051
+ throw M.error("Bad Token Response", e), new de("Bad Token Response", e);
1045
1052
  if (!e.expires_in)
1046
- throw new U("No expires_in in response");
1047
- const r = {
1053
+ throw new P("No expires_in in response");
1054
+ const n = {
1048
1055
  accessToken: e.access_token,
1049
1056
  refreshToken: e.refresh_token,
1050
1057
  expiresOn: new Date(Date.now() + e.expires_in * 1e3),
1051
1058
  tokenType: e.token_type
1052
1059
  };
1053
- sessionStorage.setItem("token-state", JSON.stringify(r));
1060
+ sessionStorage.setItem("token-state", JSON.stringify(n));
1054
1061
  }
1055
1062
  async signUp({ redirectTo: e } = {}) {
1056
1063
  return this.authorize({
@@ -1065,51 +1072,51 @@ class zt {
1065
1072
  }
1066
1073
  async authorize({
1067
1074
  redirectTo: e,
1068
- isSignUp: r = !1
1075
+ isSignUp: n = !1
1069
1076
  }) {
1070
- var m, y;
1071
- const o = "S256", s = await this.getAuthServer();
1072
- if (!s.authorization_endpoint)
1073
- throw new U("No authorization endpoint");
1074
- const n = et(), i = await rt(n);
1075
- sessionStorage.setItem(V, n);
1076
- const u = new URL(
1077
- s.authorization_endpoint
1077
+ var _, f;
1078
+ const o = "S256", a = await this.getAuthServer();
1079
+ if (!a.authorization_endpoint)
1080
+ throw new P("No authorization endpoint");
1081
+ const r = et(), i = await nt(r);
1082
+ sessionStorage.setItem(V, r);
1083
+ const c = new URL(
1084
+ a.authorization_endpoint
1078
1085
  );
1079
1086
  sessionStorage.setItem("redirect-to", e);
1080
- const f = new URL(window.location.origin);
1081
- if (f.pathname = this.callbackUrlPath, f.search = "", u.searchParams.set("client_id", this.client.client_id), u.searchParams.set("redirect_uri", f.toString()), u.searchParams.set("response_type", "code"), u.searchParams.set("scope", "openid profile email"), u.searchParams.set("code_challenge", i), u.searchParams.set(
1087
+ const p = new URL(window.location.origin);
1088
+ if (p.pathname = this.callbackUrlPath, p.search = "", c.searchParams.set("client_id", this.client.client_id), c.searchParams.set("redirect_uri", p.toString()), c.searchParams.set("response_type", "code"), c.searchParams.set("scope", "openid profile email"), c.searchParams.set("code_challenge", i), c.searchParams.set(
1082
1089
  "code_challenge_method",
1083
1090
  o
1084
- ), this.audience && u.searchParams.set("audience", this.audience), (m = this.onAuthorizationUrl) == null || m.call(this, u, {
1085
- isSignIn: !r,
1086
- isSignUp: r
1087
- }), ((y = s.code_challenge_methods_supported) == null ? void 0 : y.includes("S256")) !== !0) {
1088
- const b = tt();
1089
- u.searchParams.set("state", b);
1091
+ ), this.audience && c.searchParams.set("audience", this.audience), (_ = this.onAuthorizationUrl) == null || _.call(this, c, {
1092
+ isSignIn: !n,
1093
+ isSignUp: n
1094
+ }), ((f = a.code_challenge_methods_supported) == null ? void 0 : f.includes("S256")) !== !0) {
1095
+ const y = tt();
1096
+ c.searchParams.set("state", y);
1090
1097
  }
1091
- location.href = u.href;
1098
+ location.href = c.href;
1092
1099
  }
1093
1100
  async getAccessToken() {
1094
- const e = await this.getAuthServer(), r = sessionStorage.getItem("token-state");
1095
- if (!r)
1096
- throw new U("User is not authenticated");
1097
- const o = JSON.parse(r);
1101
+ const e = await this.getAuthServer(), n = sessionStorage.getItem("token-state");
1102
+ if (!n)
1103
+ throw new P("User is not authenticated");
1104
+ const o = JSON.parse(n);
1098
1105
  if (o.expiresOn < /* @__PURE__ */ new Date()) {
1099
1106
  if (!o.refreshToken)
1100
1107
  return await this.signIn(), "";
1101
- const s = await yt(
1108
+ const a = await mt(
1102
1109
  e,
1103
1110
  this.client,
1104
1111
  o.refreshToken
1105
- ), n = await _t(
1112
+ ), r = await bt(
1106
1113
  e,
1107
1114
  this.client,
1108
- s
1115
+ a
1109
1116
  );
1110
- if (!n.access_token)
1111
- throw new U("No access token in response");
1112
- return this.setTokensFromResponse(n), n.access_token.toString();
1117
+ if (!r.access_token)
1118
+ throw new P("No access token in response");
1119
+ return this.setTokensFromResponse(r), r.access_token.toString();
1113
1120
  } else
1114
1121
  return o.accessToken;
1115
1122
  }
@@ -1117,23 +1124,23 @@ class zt {
1117
1124
  const e = sessionStorage.getItem("profile-state");
1118
1125
  if (e)
1119
1126
  try {
1120
- const r = JSON.parse(e);
1121
- z.setState({
1127
+ const n = JSON.parse(e);
1128
+ N.setState({
1122
1129
  isAuthenticated: !0,
1123
1130
  isPending: !1,
1124
- profile: r
1131
+ profile: n
1125
1132
  });
1126
- } catch (r) {
1127
- K.error("Error parsing auth state", r);
1133
+ } catch (n) {
1134
+ M.error("Error parsing auth state", n);
1128
1135
  }
1129
1136
  }
1130
1137
  getAuthenticationPlugin() {
1131
1138
  return new Nt(this.callbackUrlPath, this.handleCallback);
1132
1139
  }
1133
1140
  }
1134
- const Yt = (t) => new zt(t);
1141
+ const qt = (t) => new zt(t);
1135
1142
  export {
1136
1143
  zt as OpenIDAuthenticationProvider,
1137
- Yt as default
1144
+ qt as default
1138
1145
  };
1139
1146
  //# sourceMappingURL=zudoku.auth-openid.js.map