zudoku 0.3.0-dev.6 → 0.3.0-dev.60

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 (523) hide show
  1. package/dist/app/App.d.ts +1 -2
  2. package/dist/app/App.js +1 -29
  3. package/dist/app/App.js.map +1 -1
  4. package/dist/app/demo.d.ts +2 -0
  5. package/dist/app/demo.js +32 -0
  6. package/dist/app/demo.js.map +1 -0
  7. package/dist/app/entry.client.d.ts +2 -0
  8. package/dist/app/entry.client.js +35 -0
  9. package/dist/app/entry.client.js.map +1 -0
  10. package/dist/app/entry.server.d.ts +14 -0
  11. package/dist/app/entry.server.js +105 -0
  12. package/dist/app/entry.server.js.map +1 -0
  13. package/dist/app/main.d.ts +6 -1
  14. package/dist/app/main.js +67 -12
  15. package/dist/app/main.js.map +1 -1
  16. package/dist/app/standalone.d.ts +2 -0
  17. package/dist/app/standalone.js +37 -0
  18. package/dist/app/standalone.js.map +1 -0
  19. package/dist/app/tailwind.d.ts +1 -1
  20. package/dist/app/tailwind.js +0 -4
  21. package/dist/app/tailwind.js.map +1 -1
  22. package/dist/cli/cmds/dev.js +5 -0
  23. package/dist/cli/cmds/dev.js.map +1 -1
  24. package/dist/cli/dev/handler.d.ts +1 -0
  25. package/dist/cli/dev/handler.js +3 -1
  26. package/dist/cli/dev/handler.js.map +1 -1
  27. package/dist/config/config.d.ts +5 -39
  28. package/dist/config/validators/validate.d.ts +878 -2
  29. package/dist/config/validators/validate.js +144 -1
  30. package/dist/config/validators/validate.js.map +1 -1
  31. package/dist/internal.d.ts +1 -0
  32. package/dist/internal.js +2 -0
  33. package/dist/internal.js.map +1 -0
  34. package/dist/lib/authentication/AuthenticationPlugin.d.ts +16 -0
  35. package/dist/lib/authentication/AuthenticationPlugin.js +31 -0
  36. package/dist/lib/authentication/AuthenticationPlugin.js.map +1 -0
  37. package/dist/lib/authentication/Callback.js +1 -1
  38. package/dist/lib/authentication/Callback.js.map +1 -1
  39. package/dist/lib/authentication/authentication.d.ts +3 -4
  40. package/dist/lib/authentication/components/Login.d.ts +1 -0
  41. package/dist/lib/authentication/components/Login.js +10 -0
  42. package/dist/lib/authentication/components/Login.js.map +1 -0
  43. package/dist/lib/authentication/components/Logout.d.ts +1 -0
  44. package/dist/lib/authentication/components/Logout.js +10 -0
  45. package/dist/lib/authentication/components/Logout.js.map +1 -0
  46. package/dist/lib/authentication/providers/clerk.js +45 -27
  47. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  48. package/dist/lib/authentication/providers/openid.d.ts +11 -3
  49. package/dist/lib/authentication/providers/openid.js +22 -11
  50. package/dist/lib/authentication/providers/openid.js.map +1 -1
  51. package/dist/lib/authentication/routes.d.ts +5 -0
  52. package/dist/lib/authentication/routes.js +12 -0
  53. package/dist/lib/authentication/routes.js.map +1 -0
  54. package/dist/lib/components/Bootstrap.d.ts +13 -0
  55. package/dist/lib/components/Bootstrap.js +12 -0
  56. package/dist/lib/components/Bootstrap.js.map +1 -0
  57. package/dist/lib/components/DevPortal.d.ts +4 -19
  58. package/dist/lib/components/DevPortal.js +30 -12
  59. package/dist/lib/components/DevPortal.js.map +1 -1
  60. package/dist/lib/components/DeveloperHint.d.ts +5 -0
  61. package/dist/lib/components/DeveloperHint.js +10 -0
  62. package/dist/lib/components/DeveloperHint.js.map +1 -0
  63. package/dist/lib/components/ErrorPage.d.ts +6 -0
  64. package/dist/lib/components/ErrorPage.js +9 -0
  65. package/dist/lib/components/ErrorPage.js.map +1 -0
  66. package/dist/lib/components/Header.js +17 -3
  67. package/dist/lib/components/Header.js.map +1 -1
  68. package/dist/lib/components/Heading.d.ts +9 -4
  69. package/dist/lib/components/Heading.js +17 -2
  70. package/dist/lib/components/Heading.js.map +1 -1
  71. package/dist/lib/components/InlineCode.d.ts +5 -0
  72. package/dist/lib/components/InlineCode.js +4 -0
  73. package/dist/lib/components/InlineCode.js.map +1 -0
  74. package/dist/lib/components/Layout.js +3 -2
  75. package/dist/lib/components/Layout.js.map +1 -1
  76. package/dist/lib/components/NotFoundPage.d.ts +1 -0
  77. package/dist/lib/components/NotFoundPage.js +12 -0
  78. package/dist/lib/components/NotFoundPage.js.map +1 -0
  79. package/dist/lib/components/SyntaxHighlight.d.ts +3 -2
  80. package/dist/lib/components/SyntaxHighlight.js +20 -18
  81. package/dist/lib/components/SyntaxHighlight.js.map +1 -1
  82. package/dist/lib/components/TopNavigation.d.ts +1 -1
  83. package/dist/lib/components/TopNavigation.js +5 -1
  84. package/dist/lib/components/TopNavigation.js.map +1 -1
  85. package/dist/lib/components/context/DevPortalProvider.d.ts +1 -1
  86. package/dist/lib/components/context/DevPortalProvider.js +20 -3
  87. package/dist/lib/components/context/DevPortalProvider.js.map +1 -1
  88. package/dist/lib/components/index.d.ts +32 -3
  89. package/dist/lib/components/index.js +21 -3
  90. package/dist/lib/components/index.js.map +1 -1
  91. package/dist/lib/components/navigation/SideNavigationCategory.js +2 -2
  92. package/dist/lib/components/navigation/SideNavigationCategory.js.map +1 -1
  93. package/dist/lib/components/navigation/SideNavigationItem.js +1 -1
  94. package/dist/lib/components/navigation/SideNavigationItem.js.map +1 -1
  95. package/dist/lib/core/DevPortalContext.d.ts +46 -12
  96. package/dist/lib/core/DevPortalContext.js +7 -9
  97. package/dist/lib/core/DevPortalContext.js.map +1 -1
  98. package/dist/lib/core/plugins.d.ts +16 -4
  99. package/dist/lib/core/plugins.js +2 -0
  100. package/dist/lib/core/plugins.js.map +1 -1
  101. package/dist/lib/errors/ErrorAlert.d.ts +3 -0
  102. package/dist/lib/errors/ErrorAlert.js +8 -0
  103. package/dist/lib/errors/ErrorAlert.js.map +1 -0
  104. package/dist/lib/errors/RouterError.d.ts +1 -0
  105. package/dist/lib/errors/RouterError.js +12 -0
  106. package/dist/lib/errors/RouterError.js.map +1 -0
  107. package/dist/lib/errors/ServerError.d.ts +3 -0
  108. package/dist/lib/errors/ServerError.js +6 -0
  109. package/dist/lib/errors/ServerError.js.map +1 -0
  110. package/dist/lib/errors/TopLevelError.d.ts +2 -0
  111. package/dist/lib/errors/TopLevelError.js +7 -0
  112. package/dist/lib/errors/TopLevelError.js.map +1 -0
  113. package/dist/lib/oas/graphql/index.js +6 -4
  114. package/dist/lib/oas/graphql/index.js.map +1 -1
  115. package/dist/lib/oas/parser/index.d.ts +1 -1
  116. package/dist/lib/oas/parser/index.js +38 -12
  117. package/dist/lib/oas/parser/index.js.map +1 -1
  118. package/dist/lib/plugins/{api-key → api-keys}/CreateApiKey.js +1 -1
  119. package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -0
  120. package/dist/lib/plugins/api-keys/ProtectedRoute.d.ts +1 -0
  121. package/dist/lib/plugins/api-keys/ProtectedRoute.js +14 -0
  122. package/dist/lib/plugins/api-keys/ProtectedRoute.js.map +1 -0
  123. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +39 -0
  124. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -0
  125. package/dist/lib/plugins/{api-key → api-keys}/index.d.ts +4 -5
  126. package/dist/lib/plugins/{api-key → api-keys}/index.js +11 -19
  127. package/dist/lib/plugins/api-keys/index.js.map +1 -0
  128. package/dist/lib/plugins/custom-page/index.d.ts +8 -0
  129. package/dist/lib/plugins/custom-page/index.js +12 -0
  130. package/dist/lib/plugins/custom-page/index.js.map +1 -0
  131. package/dist/lib/plugins/markdown/MdxPage.d.ts +3 -2
  132. package/dist/lib/plugins/markdown/MdxPage.js +7 -6
  133. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  134. package/dist/lib/plugins/markdown/Toc.js +1 -1
  135. package/dist/lib/plugins/markdown/Toc.js.map +1 -1
  136. package/dist/lib/plugins/markdown/generateRoutes.d.ts +3 -3
  137. package/dist/lib/plugins/markdown/generateRoutes.js +4 -4
  138. package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -1
  139. package/dist/lib/plugins/markdown/index.d.ts +4 -1
  140. package/dist/lib/plugins/markdown/index.js +3 -7
  141. package/dist/lib/plugins/markdown/index.js.map +1 -1
  142. package/dist/lib/plugins/openapi/OperationList.js +17 -5
  143. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  144. package/dist/lib/plugins/openapi/OperationListItem.js +10 -5
  145. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  146. package/dist/lib/plugins/openapi/ParameterList.js +1 -1
  147. package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
  148. package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
  149. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  150. package/dist/lib/plugins/openapi/{MakeRequest.d.ts → PlaygroundDialogWrapper.d.ts} +1 -1
  151. package/dist/lib/plugins/openapi/{MakeRequest.js → PlaygroundDialogWrapper.js} +4 -16
  152. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -0
  153. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +1 -9
  154. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  155. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +1 -1
  156. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  157. package/dist/lib/plugins/openapi/Route.d.ts +6 -0
  158. package/dist/lib/plugins/openapi/Route.js +8 -0
  159. package/dist/lib/plugins/openapi/Route.js.map +1 -0
  160. package/dist/lib/plugins/openapi/SchemaListView.js +6 -27
  161. package/dist/lib/plugins/openapi/SchemaListView.js.map +1 -1
  162. package/dist/lib/plugins/openapi/SchemaListViewItem.d.ts +7 -0
  163. package/dist/lib/plugins/openapi/SchemaListViewItem.js +16 -0
  164. package/dist/lib/plugins/openapi/SchemaListViewItem.js.map +1 -0
  165. package/dist/lib/plugins/openapi/SchemaListViewItemGroup.d.ts +8 -0
  166. package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js +17 -0
  167. package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js.map +1 -0
  168. package/dist/lib/plugins/openapi/Sidecar.js +10 -8
  169. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  170. package/dist/lib/plugins/openapi/SidecarBox.js +1 -1
  171. package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -1
  172. package/dist/lib/plugins/openapi/{Select.d.ts → SimpleSelect.d.ts} +3 -2
  173. package/dist/lib/plugins/openapi/SimpleSelect.js +5 -0
  174. package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -0
  175. package/dist/lib/plugins/openapi/StaggeredRender.d.ts +8 -0
  176. package/dist/lib/plugins/openapi/StaggeredRender.js +18 -0
  177. package/dist/lib/plugins/openapi/StaggeredRender.js.map +1 -0
  178. package/dist/lib/plugins/openapi/client/createMemoryClient.d.ts +12 -0
  179. package/dist/lib/plugins/openapi/client/createMemoryClient.js +46 -0
  180. package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +1 -0
  181. package/dist/lib/plugins/openapi/client/createServer.d.ts +4 -0
  182. package/dist/lib/plugins/openapi/client/createServer.js +30 -0
  183. package/dist/lib/plugins/openapi/client/createServer.js.map +1 -0
  184. package/dist/lib/plugins/openapi/client/createWorkerClient.d.ts +10 -0
  185. package/dist/lib/plugins/openapi/{worker/createSharedWorkerClient.js → client/createWorkerClient.js} +15 -2
  186. package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -0
  187. package/dist/lib/plugins/openapi/client/interfaces.d.ts +4 -0
  188. package/dist/lib/plugins/openapi/client/interfaces.js +2 -0
  189. package/dist/lib/plugins/openapi/client/interfaces.js.map +1 -0
  190. package/dist/lib/plugins/openapi/{worker → client}/worker.js +2 -2
  191. package/dist/lib/plugins/openapi/client/worker.js.map +1 -0
  192. package/dist/lib/plugins/openapi/context.d.ts +5 -0
  193. package/dist/lib/plugins/openapi/context.js +11 -0
  194. package/dist/lib/plugins/openapi/context.js.map +1 -0
  195. package/dist/lib/plugins/openapi/index.d.ts +4 -18
  196. package/dist/lib/plugins/openapi/index.js +35 -20
  197. package/dist/lib/plugins/openapi/index.js.map +1 -1
  198. package/dist/lib/plugins/openapi/interfaces.d.ts +15 -0
  199. package/dist/lib/plugins/openapi/interfaces.js +2 -0
  200. package/dist/lib/plugins/openapi/interfaces.js.map +1 -0
  201. package/dist/lib/plugins/openapi/playground/Headers.d.ts +2 -3
  202. package/dist/lib/plugins/openapi/playground/Headers.js +16 -6
  203. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  204. package/dist/lib/plugins/openapi/playground/PathParams.d.ts +1 -1
  205. package/dist/lib/plugins/openapi/playground/Playground.d.ts +5 -4
  206. package/dist/lib/plugins/openapi/playground/Playground.js +22 -13
  207. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  208. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.d.ts +3 -0
  209. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +12 -0
  210. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -0
  211. package/dist/lib/plugins/openapi/playground/QueryParams.d.ts +1 -1
  212. package/dist/lib/plugins/openapi/playground/QueryParams.js +2 -1
  213. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  214. package/dist/lib/plugins/openapi/playground/createUrl.d.ts +1 -1
  215. package/dist/lib/plugins/openapi/util/prose.d.ts +1 -0
  216. package/dist/lib/plugins/openapi/util/prose.js +4 -0
  217. package/dist/lib/plugins/openapi/util/prose.js.map +1 -0
  218. package/dist/lib/plugins/openapi-worker.d.ts +1 -1
  219. package/dist/lib/plugins/openapi-worker.js +1 -1
  220. package/dist/lib/plugins/openapi-worker.js.map +1 -1
  221. package/dist/lib/plugins/redirect/index.d.ts +0 -1
  222. package/dist/lib/plugins/redirect/index.js +3 -4
  223. package/dist/lib/plugins/redirect/index.js.map +1 -1
  224. package/dist/lib/ui/Callout.js +2 -2
  225. package/dist/lib/ui/Callout.js.map +1 -1
  226. package/dist/lib/ui/Card.js +1 -1
  227. package/dist/lib/ui/Card.js.map +1 -1
  228. package/dist/lib/ui/DropdownMenu.d.ts +27 -0
  229. package/dist/lib/ui/DropdownMenu.js +36 -0
  230. package/dist/lib/ui/DropdownMenu.js.map +1 -0
  231. package/dist/lib/ui/button-variants.d.ts +2 -2
  232. package/dist/lib/ui/button-variants.js +1 -0
  233. package/dist/lib/ui/button-variants.js.map +1 -1
  234. package/dist/lib/util/MdxComponents.d.ts +2 -2
  235. package/dist/lib/util/MdxComponents.js +7 -5
  236. package/dist/lib/util/MdxComponents.js.map +1 -1
  237. package/dist/lib/util/groupBy.d.ts +1 -6
  238. package/dist/lib/util/groupBy.js +10 -8
  239. package/dist/lib/util/groupBy.js.map +1 -1
  240. package/dist/lib/util/joinPath.js +2 -1
  241. package/dist/lib/util/joinPath.js.map +1 -1
  242. package/dist/lib/util/logInit.d.ts +1 -0
  243. package/dist/lib/util/logInit.js +9 -0
  244. package/dist/lib/util/logInit.js.map +1 -0
  245. package/dist/lib/util/objectEntries.d.ts +4 -0
  246. package/dist/lib/util/objectEntries.js +2 -0
  247. package/dist/lib/util/objectEntries.js.map +1 -0
  248. package/dist/lib/util/renderIf.d.ts +1 -0
  249. package/dist/lib/util/renderIf.js +2 -0
  250. package/dist/lib/util/renderIf.js.map +1 -0
  251. package/dist/vite/build.js +30 -7
  252. package/dist/vite/build.js.map +1 -1
  253. package/dist/vite/config.d.ts +21 -12
  254. package/dist/vite/config.js +107 -55
  255. package/dist/vite/config.js.map +1 -1
  256. package/dist/vite/config.test.js +6 -3
  257. package/dist/vite/config.test.js.map +1 -1
  258. package/dist/vite/dev-server.d.ts +2 -1
  259. package/dist/vite/dev-server.js +44 -15
  260. package/dist/vite/dev-server.js.map +1 -1
  261. package/dist/vite/html.js +18 -5
  262. package/dist/vite/html.js.map +1 -1
  263. package/dist/vite/plugin-api-keys.js +7 -8
  264. package/dist/vite/plugin-api-keys.js.map +1 -1
  265. package/dist/vite/plugin-api.js +9 -20
  266. package/dist/vite/plugin-api.js.map +1 -1
  267. package/dist/vite/plugin-auth.js +5 -6
  268. package/dist/vite/plugin-auth.js.map +1 -1
  269. package/dist/vite/plugin-component.js +5 -2
  270. package/dist/vite/plugin-component.js.map +1 -1
  271. package/dist/vite/plugin-config.d.ts +0 -2
  272. package/dist/vite/plugin-config.js +2 -13
  273. package/dist/vite/plugin-config.js.map +1 -1
  274. package/dist/vite/plugin-custom-css.d.ts +6 -0
  275. package/dist/vite/plugin-custom-css.js +54 -0
  276. package/dist/vite/plugin-custom-css.js.map +1 -0
  277. package/dist/vite/plugin-docs.js +15 -5
  278. package/dist/vite/plugin-docs.js.map +1 -1
  279. package/dist/vite/plugin-mdx.d.ts +3 -1
  280. package/dist/vite/plugin-mdx.js +5 -5
  281. package/dist/vite/plugin-mdx.js.map +1 -1
  282. package/dist/vite/plugin-metadata.js +1 -1
  283. package/dist/vite/plugin-metadata.js.map +1 -1
  284. package/dist/vite/plugin-redirect.js +10 -10
  285. package/dist/vite/plugin-redirect.js.map +1 -1
  286. package/dist/vite/plugin.js +3 -5
  287. package/dist/vite/plugin.js.map +1 -1
  288. package/dist/vite/prerender.d.ts +17 -0
  289. package/dist/vite/prerender.js +79 -0
  290. package/dist/vite/prerender.js.map +1 -0
  291. package/lib/AnchorLink-Bj1hwDuD.js +705 -0
  292. package/lib/AnchorLink-Bj1hwDuD.js.map +1 -0
  293. package/lib/AuthenticationPlugin-CG6Bw32B.js +46 -0
  294. package/lib/AuthenticationPlugin-CG6Bw32B.js.map +1 -0
  295. package/lib/CategoryHeading-DMkTmmBh.js +10 -0
  296. package/lib/CategoryHeading-DMkTmmBh.js.map +1 -0
  297. package/lib/Combination-lAFQBd6U.js +2774 -0
  298. package/lib/Combination-lAFQBd6U.js.map +1 -0
  299. package/lib/DevPortalProvider-BBhQ8kgI.js +1125 -0
  300. package/lib/DevPortalProvider-BBhQ8kgI.js.map +1 -0
  301. package/lib/Markdown-BjRJKl_E.js +15028 -0
  302. package/lib/Markdown-BjRJKl_E.js.map +1 -0
  303. package/lib/MdxPage-DJTFOCbZ.js +190 -0
  304. package/lib/MdxPage-DJTFOCbZ.js.map +1 -0
  305. package/lib/OperationList-DDTtK3I7.js +5403 -0
  306. package/lib/OperationList-DDTtK3I7.js.map +1 -0
  307. package/lib/Route-Bsrd0acQ.js +13 -0
  308. package/lib/Route-Bsrd0acQ.js.map +1 -0
  309. package/lib/Select-CEnkyfyn.js +2223 -0
  310. package/lib/Select-CEnkyfyn.js.map +1 -0
  311. package/lib/Spinner-Ciq_pWU7.js +359 -0
  312. package/lib/Spinner-Ciq_pWU7.js.map +1 -0
  313. package/lib/_commonjsHelpers-BVfed4GL.js +29 -0
  314. package/lib/_commonjsHelpers-BVfed4GL.js.map +1 -0
  315. package/lib/assets/index-BPdJm2ty.js +1 -0
  316. package/lib/assets/index-BPdJm2ty.js.map +1 -0
  317. package/lib/assets/{worker-BCcpCNJ7.js → worker-BWwCA-wk.js} +10727 -10300
  318. package/lib/assets/worker-BWwCA-wk.js.map +1 -0
  319. package/lib/context-_fYfJFgk.js +14 -0
  320. package/lib/context-_fYfJFgk.js.map +1 -0
  321. package/lib/hook-Q_gAL2NZ.js +93 -0
  322. package/lib/hook-Q_gAL2NZ.js.map +1 -0
  323. package/lib/index-BE2a6gGC.js +726 -0
  324. package/lib/index-BE2a6gGC.js.map +1 -0
  325. package/lib/index-pI9JkN46.js +4765 -0
  326. package/lib/index-pI9JkN46.js.map +1 -0
  327. package/lib/jsx-runtime-BIr0WBt_.js +1526 -0
  328. package/lib/jsx-runtime-BIr0WBt_.js.map +1 -0
  329. package/lib/prism-bash.min-DadFsM4Z.js +1 -0
  330. package/lib/prism-bash.min-DadFsM4Z.js.map +1 -0
  331. package/lib/prism-csharp.min-Yizuc34Y.js +35 -0
  332. package/lib/prism-csharp.min-Yizuc34Y.js.map +1 -0
  333. package/lib/prism-java.min-d5iT_mOd.js +1 -0
  334. package/lib/prism-java.min-d5iT_mOd.js.map +1 -0
  335. package/lib/prism-json.min-B1GJqK1k.js +1 -0
  336. package/lib/prism-json.min-B1GJqK1k.js.map +1 -0
  337. package/lib/prism-markup-templating-DZrrEs0A.js +1 -0
  338. package/lib/prism-markup-templating-DZrrEs0A.js.map +1 -0
  339. package/lib/prism-objectivec.min-BXSWqpJJ.js +2 -0
  340. package/lib/prism-objectivec.min-BXSWqpJJ.js.map +1 -0
  341. package/lib/prism-php.min-o7FpoMP_.js +1 -0
  342. package/lib/prism-php.min-o7FpoMP_.js.map +1 -0
  343. package/lib/prism-ruby.min-C7LwcKyz.js +1 -0
  344. package/lib/prism-ruby.min-C7LwcKyz.js.map +1 -0
  345. package/lib/router-BiRCp01d.js +2971 -0
  346. package/lib/router-BiRCp01d.js.map +1 -0
  347. package/lib/slugify-CiPVjteN.js +28 -0
  348. package/lib/slugify-CiPVjteN.js.map +1 -0
  349. package/lib/state-DKdaQzvh.js +288 -0
  350. package/lib/state-DKdaQzvh.js.map +1 -0
  351. package/lib/urql-DMlBWUKL.js +1 -0
  352. package/lib/urql-DMlBWUKL.js.map +1 -0
  353. package/lib/zudoku.auth-auth0.js +2 -1
  354. package/lib/zudoku.auth-auth0.js.map +1 -0
  355. package/lib/zudoku.auth-clerk.js +48 -31
  356. package/lib/zudoku.auth-clerk.js.map +1 -0
  357. package/lib/zudoku.auth-openid.js +608 -448
  358. package/lib/zudoku.auth-openid.js.map +1 -0
  359. package/lib/zudoku.components.js +1793 -512
  360. package/lib/zudoku.components.js.map +1 -0
  361. package/lib/zudoku.openapi-worker.js +15035 -146
  362. package/lib/zudoku.openapi-worker.js.map +1 -0
  363. package/lib/zudoku.plugin-api-keys.js +313 -0
  364. package/lib/zudoku.plugin-api-keys.js.map +1 -0
  365. package/lib/zudoku.plugin-custom-page.js +13 -0
  366. package/lib/zudoku.plugin-custom-page.js.map +1 -0
  367. package/lib/zudoku.plugin-markdown.js +48 -0
  368. package/lib/zudoku.plugin-markdown.js.map +1 -0
  369. package/lib/zudoku.plugin-openapi.js +10 -0
  370. package/lib/zudoku.plugin-openapi.js.map +1 -0
  371. package/lib/zudoku.plugin-redirect.js +11 -0
  372. package/lib/zudoku.plugin-redirect.js.map +1 -0
  373. package/package.json +60 -24
  374. package/src/app/App.tsx +0 -41
  375. package/src/app/demo-cdn.html +26 -0
  376. package/src/app/demo.html +18 -0
  377. package/src/app/demo.tsx +45 -0
  378. package/src/app/entry.client.tsx +47 -0
  379. package/src/app/entry.server.tsx +160 -0
  380. package/src/app/main.css +80 -0
  381. package/src/app/main.tsx +86 -15
  382. package/src/app/standalone.html +20 -0
  383. package/src/app/standalone.tsx +51 -0
  384. package/src/app/tailwind.ts +2 -6
  385. package/src/lib/authentication/AuthenticationPlugin.tsx +36 -0
  386. package/src/lib/authentication/Callback.tsx +1 -1
  387. package/src/lib/authentication/authentication.ts +3 -7
  388. package/src/lib/authentication/components/Login.tsx +11 -0
  389. package/src/lib/authentication/components/Logout.tsx +11 -0
  390. package/src/lib/authentication/providers/clerk.tsx +44 -27
  391. package/src/lib/authentication/providers/openid.tsx +25 -13
  392. package/src/lib/authentication/routes.tsx +10 -0
  393. package/src/lib/components/Bootstrap.tsx +44 -0
  394. package/src/lib/components/DevPortal.tsx +55 -49
  395. package/src/lib/components/DeveloperHint.tsx +25 -0
  396. package/src/lib/components/ErrorPage.tsx +28 -0
  397. package/src/lib/components/Header.tsx +89 -28
  398. package/src/lib/components/Heading.tsx +26 -7
  399. package/src/lib/components/InlineCode.tsx +19 -0
  400. package/src/lib/components/Layout.tsx +9 -7
  401. package/src/lib/components/NotFoundPage.tsx +33 -0
  402. package/src/lib/components/SyntaxHighlight.tsx +26 -18
  403. package/src/lib/components/TopNavigation.tsx +6 -1
  404. package/src/lib/components/context/DevPortalProvider.ts +24 -4
  405. package/src/lib/components/index.ts +25 -3
  406. package/src/lib/components/navigation/SideNavigationCategory.tsx +3 -3
  407. package/src/lib/components/navigation/SideNavigationItem.tsx +1 -1
  408. package/src/lib/core/DevPortalContext.ts +52 -25
  409. package/src/lib/core/plugins.ts +26 -5
  410. package/src/lib/errors/ErrorAlert.tsx +21 -0
  411. package/src/lib/errors/RouterError.tsx +13 -0
  412. package/src/lib/errors/ServerError.tsx +5 -0
  413. package/src/lib/errors/TopLevelError.tsx +8 -0
  414. package/src/lib/oas/graphql/index.ts +9 -5
  415. package/src/lib/oas/parser/index.ts +41 -20
  416. package/src/lib/plugins/{api-key → api-keys}/CreateApiKey.tsx +1 -1
  417. package/src/lib/plugins/api-keys/ProtectedRoute.tsx +29 -0
  418. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +139 -0
  419. package/src/lib/plugins/{api-key → api-keys}/index.tsx +16 -40
  420. package/src/lib/plugins/custom-page/index.tsx +22 -0
  421. package/src/lib/plugins/markdown/MdxPage.tsx +51 -34
  422. package/src/lib/plugins/markdown/Toc.tsx +1 -1
  423. package/src/lib/plugins/markdown/generateRoutes.tsx +16 -6
  424. package/src/lib/plugins/markdown/index.tsx +10 -7
  425. package/src/lib/plugins/openapi/OperationList.tsx +46 -10
  426. package/src/lib/plugins/openapi/OperationListItem.tsx +68 -42
  427. package/src/lib/plugins/openapi/ParameterList.tsx +1 -1
  428. package/src/lib/plugins/openapi/ParameterListItem.tsx +3 -4
  429. package/src/lib/plugins/openapi/{MakeRequest.tsx → PlaygroundDialogWrapper.tsx} +3 -19
  430. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +2 -16
  431. package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +3 -1
  432. package/src/lib/plugins/openapi/Route.tsx +21 -0
  433. package/src/lib/plugins/openapi/SchemaListView.tsx +23 -192
  434. package/src/lib/plugins/openapi/SchemaListViewItem.tsx +110 -0
  435. package/src/lib/plugins/openapi/SchemaListViewItemGroup.tsx +63 -0
  436. package/src/lib/plugins/openapi/Sidecar.tsx +15 -10
  437. package/src/lib/plugins/openapi/SidecarBox.tsx +1 -1
  438. package/src/lib/plugins/openapi/{Select.tsx → SimpleSelect.tsx} +6 -3
  439. package/src/lib/plugins/openapi/StaggeredRender.tsx +31 -0
  440. package/src/lib/plugins/openapi/client/createMemoryClient.ts +56 -0
  441. package/src/lib/plugins/openapi/client/createServer.ts +33 -0
  442. package/src/lib/plugins/openapi/{worker/createSharedWorkerClient.ts → client/createWorkerClient.ts} +21 -2
  443. package/src/lib/plugins/openapi/client/interfaces.ts +5 -0
  444. package/src/lib/plugins/openapi/{worker → client}/worker.ts +3 -3
  445. package/src/lib/plugins/openapi/context.tsx +16 -0
  446. package/src/lib/plugins/openapi/index.tsx +59 -52
  447. package/src/lib/plugins/openapi/interfaces.ts +9 -0
  448. package/src/lib/plugins/openapi/playground/Headers.tsx +60 -33
  449. package/src/lib/plugins/openapi/playground/PathParams.tsx +1 -1
  450. package/src/lib/plugins/openapi/playground/Playground.tsx +172 -193
  451. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +36 -0
  452. package/src/lib/plugins/openapi/playground/QueryParams.tsx +7 -2
  453. package/src/lib/plugins/openapi/playground/createUrl.ts +1 -1
  454. package/src/lib/plugins/openapi/util/prose.ts +7 -0
  455. package/src/lib/plugins/openapi-worker.ts +1 -1
  456. package/src/lib/plugins/redirect/index.tsx +3 -4
  457. package/src/lib/ui/Callout.tsx +4 -4
  458. package/src/lib/ui/Card.tsx +1 -1
  459. package/src/lib/ui/DropdownMenu.tsx +199 -0
  460. package/src/lib/ui/button-variants.ts +1 -0
  461. package/src/lib/util/MdxComponents.tsx +7 -15
  462. package/src/lib/util/groupBy.ts +7 -12
  463. package/src/lib/util/joinPath.tsx +2 -1
  464. package/src/lib/util/logInit.ts +9 -0
  465. package/src/lib/util/objectEntries.ts +5 -0
  466. package/src/lib/util/renderIf.ts +4 -0
  467. package/dist/lib/components/Link.d.ts +0 -1
  468. package/dist/lib/components/Link.js +0 -2
  469. package/dist/lib/components/Link.js.map +0 -1
  470. package/dist/lib/components/Router.d.ts +0 -4
  471. package/dist/lib/components/Router.js +0 -20
  472. package/dist/lib/components/Router.js.map +0 -1
  473. package/dist/lib/core/helmet.d.ts +0 -4
  474. package/dist/lib/core/helmet.js +0 -5
  475. package/dist/lib/core/helmet.js.map +0 -1
  476. package/dist/lib/core/icons.d.ts +0 -1
  477. package/dist/lib/core/icons.js +0 -2
  478. package/dist/lib/core/icons.js.map +0 -1
  479. package/dist/lib/core/router.d.ts +0 -1
  480. package/dist/lib/core/router.js +0 -2
  481. package/dist/lib/core/router.js.map +0 -1
  482. package/dist/lib/plugins/api-key/CreateApiKey.js.map +0 -1
  483. package/dist/lib/plugins/api-key/SettingsApiKeys.js +0 -38
  484. package/dist/lib/plugins/api-key/SettingsApiKeys.js.map +0 -1
  485. package/dist/lib/plugins/api-key/index.js.map +0 -1
  486. package/dist/lib/plugins/index.d.ts +0 -4
  487. package/dist/lib/plugins/index.js +0 -5
  488. package/dist/lib/plugins/index.js.map +0 -1
  489. package/dist/lib/plugins/openapi/MakeRequest.js.map +0 -1
  490. package/dist/lib/plugins/openapi/Select.js +0 -5
  491. package/dist/lib/plugins/openapi/Select.js.map +0 -1
  492. package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.d.ts +0 -5
  493. package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.js.map +0 -1
  494. package/dist/lib/plugins/openapi/worker/shared-worker.d.ts +0 -1
  495. package/dist/lib/plugins/openapi/worker/shared-worker.js +0 -6
  496. package/dist/lib/plugins/openapi/worker/shared-worker.js.map +0 -1
  497. package/dist/lib/plugins/openapi/worker/worker.js.map +0 -1
  498. package/dist/vite/common.d.ts +0 -1
  499. package/dist/vite/common.js +0 -5
  500. package/dist/vite/common.js.map +0 -1
  501. package/dist/vite/plugin-html.d.ts +0 -3
  502. package/dist/vite/plugin-html.js +0 -47
  503. package/dist/vite/plugin-html.js.map +0 -1
  504. package/dist/vite/plugin-openapi-worker.d.ts +0 -4
  505. package/dist/vite/plugin-openapi-worker.js +0 -28
  506. package/dist/vite/plugin-openapi-worker.js.map +0 -1
  507. package/lib/Spinner-BINYpvLB.js +0 -8412
  508. package/lib/clerk-Wslx_mPo.js +0 -19685
  509. package/lib/index-PyGcnQFX.js +0 -3462
  510. package/lib/loglevel-CoH7VSwE.js +0 -152
  511. package/lib/state-2Hu1renZ.js +0 -313
  512. package/lib/zudoku.plugins.js +0 -19892
  513. package/src/lib/components/Link.tsx +0 -1
  514. package/src/lib/components/Router.tsx +0 -28
  515. package/src/lib/core/helmet.ts +0 -5
  516. package/src/lib/core/icons.tsx +0 -1
  517. package/src/lib/core/router.tsx +0 -1
  518. package/src/lib/plugins/api-key/SettingsApiKeys.tsx +0 -117
  519. package/src/lib/plugins/index.ts +0 -4
  520. package/src/lib/plugins/openapi/worker/shared-worker.ts +0 -5
  521. /package/dist/lib/plugins/{api-key → api-keys}/CreateApiKey.d.ts +0 -0
  522. /package/dist/lib/plugins/{api-key → api-keys}/SettingsApiKeys.d.ts +0 -0
  523. /package/dist/lib/plugins/openapi/{worker → client}/worker.d.ts +0 -0
@@ -1,14 +1,163 @@
1
- var ue = Object.defineProperty;
2
- var he = (e, t, n) => t in e ? ue(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var w = (e, t, n) => he(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { a as de, j as g } from "./index-PyGcnQFX.js";
5
- import { l as I } from "./loglevel-CoH7VSwE.js";
6
- import { useRef as fe, useState as le, useEffect as pe } from "react";
7
- import { u as M } from "./state-2Hu1renZ.js";
8
- let z;
9
- var v, Z;
10
- (typeof navigator > "u" || !((Z = (v = navigator.userAgent) == null ? void 0 : v.startsWith) != null && Z.call(v, "Mozilla/5.0 "))) && (z = "oauth4webapi/v2.11.1");
11
- function O(e, t) {
1
+ var Re = Object.defineProperty;
2
+ var Pe = (e, t, n) => t in e ? Re(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var S = (e, t, n) => Pe(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { b as xe, j as T } from "./jsx-runtime-BIr0WBt_.js";
5
+ import { c as Le, a as Ue } from "./_commonjsHelpers-BVfed4GL.js";
6
+ import { A as Ce } from "./AuthenticationPlugin-CG6Bw32B.js";
7
+ import { useRef as je, useState as Je, useEffect as ze } from "react";
8
+ import { u as re } from "./state-DKdaQzvh.js";
9
+ var he = { exports: {} };
10
+ (function(e) {
11
+ (function(t, n) {
12
+ e.exports ? e.exports = n() : t.log = n();
13
+ })(Le, function() {
14
+ var t = function() {
15
+ }, n = "undefined", o = typeof window !== n && typeof window.navigator !== n && /Trident\/|MSIE /.test(window.navigator.userAgent), s = [
16
+ "trace",
17
+ "debug",
18
+ "info",
19
+ "warn",
20
+ "error"
21
+ ], r = {}, i = null;
22
+ function d(u, f) {
23
+ var c = u[f];
24
+ if (typeof c.bind == "function")
25
+ return c.bind(u);
26
+ try {
27
+ return Function.prototype.bind.call(c, u);
28
+ } catch {
29
+ return function() {
30
+ return Function.prototype.apply.apply(c, [u, arguments]);
31
+ };
32
+ }
33
+ }
34
+ function g() {
35
+ console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace();
36
+ }
37
+ function m(u) {
38
+ return u === "debug" && (u = "log"), typeof console === n ? !1 : u === "trace" && o ? g : console[u] !== void 0 ? d(console, u) : console.log !== void 0 ? d(console, "log") : t;
39
+ }
40
+ function b() {
41
+ for (var u = this.getLevel(), f = 0; f < s.length; f++) {
42
+ var c = s[f];
43
+ this[c] = f < u ? t : this.methodFactory(c, u, this.name);
44
+ }
45
+ if (this.log = this.debug, typeof console === n && u < this.levels.SILENT)
46
+ return "No console available for logging";
47
+ }
48
+ function y(u) {
49
+ return function() {
50
+ typeof console !== n && (b.call(this), this[u].apply(this, arguments));
51
+ };
52
+ }
53
+ function h(u, f, c) {
54
+ return m(u) || y.apply(this, arguments);
55
+ }
56
+ function L(u, f) {
57
+ var c = this, z, $, P, _ = "loglevel";
58
+ typeof u == "string" ? _ += ":" + u : typeof u == "symbol" && (_ = void 0);
59
+ function Ee(l) {
60
+ var p = (s[l] || "silent").toUpperCase();
61
+ if (!(typeof window === n || !_)) {
62
+ try {
63
+ window.localStorage[_] = p;
64
+ return;
65
+ } catch {
66
+ }
67
+ try {
68
+ window.document.cookie = encodeURIComponent(_) + "=" + p + ";";
69
+ } catch {
70
+ }
71
+ }
72
+ }
73
+ function ee() {
74
+ var l;
75
+ if (!(typeof window === n || !_)) {
76
+ try {
77
+ l = window.localStorage[_];
78
+ } catch {
79
+ }
80
+ if (typeof l === n)
81
+ try {
82
+ var p = window.document.cookie, O = encodeURIComponent(_), ne = p.indexOf(O + "=");
83
+ ne !== -1 && (l = /^([^;]+)/.exec(
84
+ p.slice(ne + O.length + 1)
85
+ )[1]);
86
+ } catch {
87
+ }
88
+ return c.levels[l] === void 0 && (l = void 0), l;
89
+ }
90
+ }
91
+ function Te() {
92
+ if (!(typeof window === n || !_)) {
93
+ try {
94
+ window.localStorage.removeItem(_);
95
+ } catch {
96
+ }
97
+ try {
98
+ window.document.cookie = encodeURIComponent(_) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
99
+ } catch {
100
+ }
101
+ }
102
+ }
103
+ function U(l) {
104
+ var p = l;
105
+ if (typeof p == "string" && c.levels[p.toUpperCase()] !== void 0 && (p = c.levels[p.toUpperCase()]), typeof p == "number" && p >= 0 && p <= c.levels.SILENT)
106
+ return p;
107
+ throw new TypeError("log.setLevel() called with invalid level: " + l);
108
+ }
109
+ c.name = u, c.levels = {
110
+ TRACE: 0,
111
+ DEBUG: 1,
112
+ INFO: 2,
113
+ WARN: 3,
114
+ ERROR: 4,
115
+ SILENT: 5
116
+ }, c.methodFactory = f || h, c.getLevel = function() {
117
+ return P ?? $ ?? z;
118
+ }, c.setLevel = function(l, p) {
119
+ return P = U(l), p !== !1 && Ee(P), b.call(c);
120
+ }, c.setDefaultLevel = function(l) {
121
+ $ = U(l), ee() || c.setLevel(l, !1);
122
+ }, c.resetLevel = function() {
123
+ P = null, Te(), b.call(c);
124
+ }, c.enableAll = function(l) {
125
+ c.setLevel(c.levels.TRACE, l);
126
+ }, c.disableAll = function(l) {
127
+ c.setLevel(c.levels.SILENT, l);
128
+ }, c.rebuild = function() {
129
+ if (i !== c && (z = U(i.getLevel())), b.call(c), i === c)
130
+ for (var l in r)
131
+ r[l].rebuild();
132
+ }, z = U(
133
+ i ? i.getLevel() : "WARN"
134
+ );
135
+ var te = ee();
136
+ te != null && (P = U(te)), b.call(c);
137
+ }
138
+ i = new L(), i.getLogger = function(f) {
139
+ if (typeof f != "symbol" && typeof f != "string" || f === "")
140
+ throw new TypeError("You must supply a name when creating a logger.");
141
+ var c = r[f];
142
+ return c || (c = r[f] = new L(
143
+ f,
144
+ i.methodFactory
145
+ )), c;
146
+ };
147
+ var R = typeof window !== n ? window.log : void 0;
148
+ return i.noConflict = function() {
149
+ return typeof window !== n && window.log === i && (window.log = R), i;
150
+ }, i.getLoggers = function() {
151
+ return r;
152
+ }, i.default = i, i;
153
+ });
154
+ })(he);
155
+ var Oe = he.exports;
156
+ const oe = /* @__PURE__ */ Ue(Oe);
157
+ let M;
158
+ var I, de;
159
+ (typeof navigator > "u" || !((de = (I = navigator.userAgent) == null ? void 0 : I.startsWith) != null && de.call(I, "Mozilla/5.0 "))) && (M = "oauth4webapi/v2.11.1");
160
+ function q(e, t) {
12
161
  if (e == null)
13
162
  return !1;
14
163
  try {
@@ -17,32 +166,32 @@ function O(e, t) {
17
166
  return !1;
18
167
  }
19
168
  }
20
- const P = Symbol(), we = Symbol(), K = Symbol(), me = new TextEncoder(), ye = new TextDecoder();
21
- function _(e) {
22
- return typeof e == "string" ? me.encode(e) : ye.decode(e);
169
+ const K = Symbol(), Ie = Symbol(), V = Symbol(), Ne = new TextEncoder(), Ke = new TextDecoder();
170
+ function A(e) {
171
+ return typeof e == "string" ? Ne.encode(e) : Ke.decode(e);
23
172
  }
24
- const B = 32768;
25
- function ge(e) {
173
+ const ie = 32768;
174
+ function We(e) {
26
175
  e instanceof ArrayBuffer && (e = new Uint8Array(e));
27
176
  const t = [];
28
- for (let n = 0; n < e.byteLength; n += B)
29
- t.push(String.fromCharCode.apply(null, e.subarray(n, n + B)));
177
+ for (let n = 0; n < e.byteLength; n += ie)
178
+ t.push(String.fromCharCode.apply(null, e.subarray(n, n + ie)));
30
179
  return btoa(t.join("")).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
31
180
  }
32
- function _e(e) {
181
+ function De(e) {
33
182
  try {
34
183
  const t = atob(e.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "")), n = new Uint8Array(t.length);
35
- for (let r = 0; r < t.length; r++)
36
- n[r] = t.charCodeAt(r);
184
+ for (let o = 0; o < t.length; o++)
185
+ n[o] = t.charCodeAt(o);
37
186
  return n;
38
187
  } catch (t) {
39
- throw new o("The input to be decoded is not correctly encoded.", { cause: t });
188
+ throw new a("The input to be decoded is not correctly encoded.", { cause: t });
40
189
  }
41
190
  }
42
- function y(e) {
43
- return typeof e == "string" ? _e(e) : ge(e);
191
+ function E(e) {
192
+ return typeof e == "string" ? De(e) : We(e);
44
193
  }
45
- class be {
194
+ class He {
46
195
  constructor(t) {
47
196
  this.cache = /* @__PURE__ */ new Map(), this._cache = /* @__PURE__ */ new Map(), this.maxSize = t;
48
197
  }
@@ -66,54 +215,54 @@ class be {
66
215
  this.cache.set(t, n), this.cache.size >= this.maxSize && (this._cache = this.cache, this.cache = /* @__PURE__ */ new Map());
67
216
  }
68
217
  }
69
- class f extends Error {
218
+ class v extends Error {
70
219
  constructor(t) {
71
220
  var n;
72
221
  super(t ?? "operation not supported"), this.name = this.constructor.name, (n = Error.captureStackTrace) == null || n.call(Error, this, this.constructor);
73
222
  }
74
223
  }
75
- class Se extends Error {
224
+ class $e extends Error {
76
225
  constructor(t, n) {
77
- var r;
78
- super(t, n), this.name = this.constructor.name, (r = Error.captureStackTrace) == null || r.call(Error, this, this.constructor);
226
+ var o;
227
+ super(t, n), this.name = this.constructor.name, (o = Error.captureStackTrace) == null || o.call(Error, this, this.constructor);
79
228
  }
80
229
  }
81
- const o = Se, Q = new be(100);
82
- function X(e) {
230
+ const a = $e, fe = new He(100);
231
+ function pe(e) {
83
232
  return e instanceof CryptoKey;
84
233
  }
85
- function ee(e) {
86
- return X(e) && e.type === "private";
234
+ function we(e) {
235
+ return pe(e) && e.type === "private";
87
236
  }
88
- function ke(e) {
89
- return X(e) && e.type === "public";
237
+ function Fe(e) {
238
+ return pe(e) && e.type === "public";
90
239
  }
91
- function N(e) {
240
+ function Y(e) {
92
241
  try {
93
242
  const t = e.headers.get("dpop-nonce");
94
- t && Q.set(new URL(e.url).origin, t);
243
+ t && fe.set(new URL(e.url).origin, t);
95
244
  } catch {
96
245
  }
97
246
  return e;
98
247
  }
99
- function E(e) {
248
+ function C(e) {
100
249
  return !(e === null || typeof e != "object" || Array.isArray(e));
101
250
  }
102
- function x(e) {
103
- O(e, Headers) && (e = Object.fromEntries(e.entries()));
251
+ function W(e) {
252
+ q(e, Headers) && (e = Object.fromEntries(e.entries()));
104
253
  const t = new Headers(e);
105
- if (z && !t.has("user-agent") && t.set("user-agent", z), t.has("authorization"))
254
+ if (M && !t.has("user-agent") && t.set("user-agent", M), t.has("authorization"))
106
255
  throw new TypeError('"options.headers" must not include the "authorization" header name');
107
256
  if (t.has("dpop"))
108
257
  throw new TypeError('"options.headers" must not include the "dpop" header name');
109
258
  return t;
110
259
  }
111
- function W(e) {
260
+ function Z(e) {
112
261
  if (typeof e == "function" && (e = e()), !(e instanceof AbortSignal))
113
262
  throw new TypeError('"options.signal" must return or be an instance of AbortSignal');
114
263
  return e;
115
264
  }
116
- async function Ee(e, t) {
265
+ async function Me(e, t) {
117
266
  if (!(e instanceof URL))
118
267
  throw new TypeError('"issuerIdentifier" must be an instance of URL');
119
268
  if (e.protocol !== "https:" && e.protocol !== "http:")
@@ -130,70 +279,70 @@ async function Ee(e, t) {
130
279
  default:
131
280
  throw new TypeError('"options.algorithm" must be "oidc" (default), or "oauth2"');
132
281
  }
133
- const r = x(t == null ? void 0 : t.headers);
134
- return r.set("accept", "application/json"), ((t == null ? void 0 : t[K]) || fetch)(n.href, {
135
- headers: Object.fromEntries(r.entries()),
282
+ const o = W(t == null ? void 0 : t.headers);
283
+ return o.set("accept", "application/json"), ((t == null ? void 0 : t[V]) || fetch)(n.href, {
284
+ headers: Object.fromEntries(o.entries()),
136
285
  method: "GET",
137
286
  redirect: "manual",
138
- signal: t != null && t.signal ? W(t.signal) : null
139
- }).then(N);
287
+ signal: t != null && t.signal ? Z(t.signal) : null
288
+ }).then(Y);
140
289
  }
141
- function h(e) {
290
+ function w(e) {
142
291
  return typeof e == "string" && e.length !== 0;
143
292
  }
144
- async function Te(e, t) {
293
+ async function Be(e, t) {
145
294
  if (!(e instanceof URL))
146
295
  throw new TypeError('"expectedIssuer" must be an instance of URL');
147
- if (!O(t, Response))
296
+ if (!q(t, Response))
148
297
  throw new TypeError('"response" must be an instance of Response');
149
298
  if (t.status !== 200)
150
- throw new o('"response" is not a conform Authorization Server Metadata response');
151
- H(t);
299
+ throw new a('"response" is not a conform Authorization Server Metadata response');
300
+ X(t);
152
301
  let n;
153
302
  try {
154
303
  n = await t.json();
155
- } catch (r) {
156
- throw new o('failed to parse "response" body as JSON', { cause: r });
304
+ } catch (o) {
305
+ throw new a('failed to parse "response" body as JSON', { cause: o });
157
306
  }
158
- if (!E(n))
159
- throw new o('"response" body must be a top level object');
160
- if (!h(n.issuer))
161
- throw new o('"response" body "issuer" property must be a non-empty string');
307
+ if (!C(n))
308
+ throw new a('"response" body must be a top level object');
309
+ if (!w(n.issuer))
310
+ throw new a('"response" body "issuer" property must be a non-empty string');
162
311
  if (new URL(n.issuer).href !== e.href)
163
- throw new o('"response" body "issuer" does not match "expectedIssuer"');
312
+ throw new a('"response" body "issuer" does not match "expectedIssuer"');
164
313
  return n;
165
314
  }
166
- function j() {
167
- return y(crypto.getRandomValues(new Uint8Array(32)));
315
+ function D() {
316
+ return E(crypto.getRandomValues(new Uint8Array(32)));
168
317
  }
169
- function Ae() {
170
- return j();
318
+ function Ge() {
319
+ return D();
171
320
  }
172
- function ve() {
173
- return j();
321
+ function qe() {
322
+ return D();
174
323
  }
175
- async function Re(e) {
176
- if (!h(e))
324
+ async function Ve(e) {
325
+ if (!w(e))
177
326
  throw new TypeError('"codeVerifier" must be a non-empty string');
178
- return y(await crypto.subtle.digest("SHA-256", _(e)));
327
+ return E(await crypto.subtle.digest("SHA-256", A(e)));
179
328
  }
180
- function Pe(e) {
329
+ function Ye(e) {
181
330
  if (e instanceof CryptoKey)
182
331
  return { key: e };
183
332
  if (!((e == null ? void 0 : e.key) instanceof CryptoKey))
184
333
  return {};
185
- if (e.kid !== void 0 && !h(e.kid))
334
+ if (e.kid !== void 0 && !w(e.kid))
186
335
  throw new TypeError('"kid" must be a non-empty string');
187
336
  return { key: e.key, kid: e.kid };
188
337
  }
189
- function F(e) {
338
+ function se(e) {
190
339
  return encodeURIComponent(e).replace(/%20/g, "+");
191
340
  }
192
- function xe(e, t) {
193
- const n = F(e), r = F(t);
194
- return `Basic ${btoa(`${n}:${r}`)}`;
341
+ function Ze(e, t) {
342
+ const n = se(e), o = se(t);
343
+ return `Basic ${btoa(`${n}:${o}`)}`;
195
344
  }
196
- function je(e) {
345
+ function Qe(e) {
197
346
  switch (e.algorithm.hash.name) {
198
347
  case "SHA-256":
199
348
  return "PS256";
@@ -202,10 +351,10 @@ function je(e) {
202
351
  case "SHA-512":
203
352
  return "PS512";
204
353
  default:
205
- throw new f("unsupported RsaHashedKeyAlgorithm hash name");
354
+ throw new v("unsupported RsaHashedKeyAlgorithm hash name");
206
355
  }
207
356
  }
208
- function Ue(e) {
357
+ function Xe(e) {
209
358
  switch (e.algorithm.hash.name) {
210
359
  case "SHA-256":
211
360
  return "RS256";
@@ -214,10 +363,10 @@ function Ue(e) {
214
363
  case "SHA-512":
215
364
  return "RS512";
216
365
  default:
217
- throw new f("unsupported RsaHashedKeyAlgorithm hash name");
366
+ throw new v("unsupported RsaHashedKeyAlgorithm hash name");
218
367
  }
219
368
  }
220
- function Ce(e) {
369
+ function et(e) {
221
370
  switch (e.algorithm.namedCurve) {
222
371
  case "P-256":
223
372
  return "ES256";
@@ -226,39 +375,39 @@ function Ce(e) {
226
375
  case "P-521":
227
376
  return "ES512";
228
377
  default:
229
- throw new f("unsupported EcKeyAlgorithm namedCurve");
378
+ throw new v("unsupported EcKeyAlgorithm namedCurve");
230
379
  }
231
380
  }
232
- function te(e) {
381
+ function ge(e) {
233
382
  switch (e.algorithm.name) {
234
383
  case "RSA-PSS":
235
- return je(e);
384
+ return Qe(e);
236
385
  case "RSASSA-PKCS1-v1_5":
237
- return Ue(e);
386
+ return Xe(e);
238
387
  case "ECDSA":
239
- return Ce(e);
388
+ return et(e);
240
389
  case "Ed25519":
241
390
  case "Ed448":
242
391
  return "EdDSA";
243
392
  default:
244
- throw new f("unsupported CryptoKey algorithm name");
393
+ throw new v("unsupported CryptoKey algorithm name");
245
394
  }
246
395
  }
247
- function U(e) {
248
- const t = e == null ? void 0 : e[P];
396
+ function H(e) {
397
+ const t = e == null ? void 0 : e[K];
249
398
  return typeof t == "number" && Number.isFinite(t) ? t : 0;
250
399
  }
251
- function ze(e) {
252
- const t = e == null ? void 0 : e[we];
400
+ function tt(e) {
401
+ const t = e == null ? void 0 : e[Ie];
253
402
  return typeof t == "number" && Number.isFinite(t) && Math.sign(t) !== -1 ? t : 30;
254
403
  }
255
- function D() {
404
+ function Q() {
256
405
  return Math.floor(Date.now() / 1e3);
257
406
  }
258
- function Je(e, t) {
259
- const n = D() + U(t);
407
+ function nt(e, t) {
408
+ const n = Q() + H(t);
260
409
  return {
261
- jti: j(),
410
+ jti: D(),
262
411
  aud: [e.issuer, e.token_endpoint],
263
412
  exp: n + 60,
264
413
  iat: n,
@@ -267,240 +416,240 @@ function Je(e, t) {
267
416
  sub: t.client_id
268
417
  };
269
418
  }
270
- async function Le(e, t, n, r) {
271
- return ne({
272
- alg: te(n),
273
- kid: r
274
- }, Je(e, t), n);
419
+ async function rt(e, t, n, o) {
420
+ return me({
421
+ alg: ge(n),
422
+ kid: o
423
+ }, nt(e, t), n);
275
424
  }
276
- function T(e) {
425
+ function j(e) {
277
426
  if (typeof e != "object" || e === null)
278
427
  throw new TypeError('"as" must be an object');
279
- if (!h(e.issuer))
428
+ if (!w(e.issuer))
280
429
  throw new TypeError('"as.issuer" property must be a non-empty string');
281
430
  return !0;
282
431
  }
283
- function A(e) {
432
+ function J(e) {
284
433
  if (typeof e != "object" || e === null)
285
434
  throw new TypeError('"client" must be an object');
286
- if (!h(e.client_id))
435
+ if (!w(e.client_id))
287
436
  throw new TypeError('"client.client_id" property must be a non-empty string');
288
437
  return !0;
289
438
  }
290
- function q(e) {
291
- if (!h(e))
439
+ function ae(e) {
440
+ if (!w(e))
292
441
  throw new TypeError('"client.client_secret" property must be a non-empty string');
293
442
  return e;
294
443
  }
295
- function C(e, t) {
444
+ function F(e, t) {
296
445
  if (t !== void 0)
297
446
  throw new TypeError(`"options.clientPrivateKey" property must not be provided when ${e} client authentication method is used.`);
298
447
  }
299
- function V(e, t) {
448
+ function ce(e, t) {
300
449
  if (t !== void 0)
301
450
  throw new TypeError(`"client.client_secret" property must not be provided when ${e} client authentication method is used.`);
302
451
  }
303
- async function Oe(e, t, n, r, a) {
452
+ async function ot(e, t, n, o, s) {
304
453
  switch (n.delete("client_secret"), n.delete("client_assertion_type"), n.delete("client_assertion"), t.token_endpoint_auth_method) {
305
454
  case void 0:
306
455
  case "client_secret_basic": {
307
- C("client_secret_basic", a), r.set("authorization", xe(t.client_id, q(t.client_secret)));
456
+ F("client_secret_basic", s), o.set("authorization", Ze(t.client_id, ae(t.client_secret)));
308
457
  break;
309
458
  }
310
459
  case "client_secret_post": {
311
- C("client_secret_post", a), n.set("client_id", t.client_id), n.set("client_secret", q(t.client_secret));
460
+ F("client_secret_post", s), n.set("client_id", t.client_id), n.set("client_secret", ae(t.client_secret));
312
461
  break;
313
462
  }
314
463
  case "private_key_jwt": {
315
- if (V("private_key_jwt", t.client_secret), a === void 0)
464
+ if (ce("private_key_jwt", t.client_secret), s === void 0)
316
465
  throw new TypeError('"options.clientPrivateKey" must be provided when "client.token_endpoint_auth_method" is "private_key_jwt"');
317
- const { key: i, kid: s } = Pe(a);
318
- if (!ee(i))
466
+ const { key: r, kid: i } = Ye(s);
467
+ if (!we(r))
319
468
  throw new TypeError('"options.clientPrivateKey.key" must be a private CryptoKey');
320
- n.set("client_id", t.client_id), n.set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), n.set("client_assertion", await Le(e, t, i, s));
469
+ n.set("client_id", t.client_id), n.set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), n.set("client_assertion", await rt(e, t, r, i));
321
470
  break;
322
471
  }
323
472
  case "tls_client_auth":
324
473
  case "self_signed_tls_client_auth":
325
474
  case "none": {
326
- V(t.token_endpoint_auth_method, t.client_secret), C(t.token_endpoint_auth_method, a), n.set("client_id", t.client_id);
475
+ ce(t.token_endpoint_auth_method, t.client_secret), F(t.token_endpoint_auth_method, s), n.set("client_id", t.client_id);
327
476
  break;
328
477
  }
329
478
  default:
330
- throw new f("unsupported client token_endpoint_auth_method");
479
+ throw new v("unsupported client token_endpoint_auth_method");
331
480
  }
332
481
  }
333
- async function ne(e, t, n) {
482
+ async function me(e, t, n) {
334
483
  if (!n.usages.includes("sign"))
335
484
  throw new TypeError('CryptoKey instances used for signing assertions must include "sign" in their "usages"');
336
- const r = `${y(_(JSON.stringify(e)))}.${y(_(JSON.stringify(t)))}`, a = y(await crypto.subtle.sign(oe(n), n, _(r)));
337
- return `${r}.${a}`;
485
+ const o = `${E(A(JSON.stringify(e)))}.${E(A(JSON.stringify(t)))}`, s = E(await crypto.subtle.sign(Se(n), n, A(o)));
486
+ return `${o}.${s}`;
338
487
  }
339
- async function Ke(e, t, n, r, a, i) {
340
- const { privateKey: s, publicKey: c, nonce: d = Q.get(n.origin) } = t;
341
- if (!ee(s))
488
+ async function it(e, t, n, o, s, r) {
489
+ const { privateKey: i, publicKey: d, nonce: g = fe.get(n.origin) } = t;
490
+ if (!we(i))
342
491
  throw new TypeError('"DPoP.privateKey" must be a private CryptoKey');
343
- if (!ke(c))
492
+ if (!Fe(d))
344
493
  throw new TypeError('"DPoP.publicKey" must be a public CryptoKey');
345
- if (d !== void 0 && !h(d))
494
+ if (g !== void 0 && !w(g))
346
495
  throw new TypeError('"DPoP.nonce" must be a non-empty string or undefined');
347
- if (!c.extractable)
496
+ if (!d.extractable)
348
497
  throw new TypeError('"DPoP.publicKey.extractable" must be true');
349
- const l = D() + a, S = await ne({
350
- alg: te(s),
498
+ const m = Q() + s, b = await me({
499
+ alg: ge(i),
351
500
  typ: "dpop+jwt",
352
- jwk: await We(c)
501
+ jwk: await at(d)
353
502
  }, {
354
- iat: l,
355
- jti: j(),
356
- htm: r,
357
- nonce: d,
503
+ iat: m,
504
+ jti: D(),
505
+ htm: o,
506
+ nonce: g,
358
507
  htu: `${n.origin}${n.pathname}`,
359
- ath: i ? y(await crypto.subtle.digest("SHA-256", _(i))) : void 0
360
- }, s);
361
- e.set("dpop", S);
508
+ ath: r ? E(await crypto.subtle.digest("SHA-256", A(r))) : void 0
509
+ }, i);
510
+ e.set("dpop", b);
362
511
  }
363
- let R;
364
- async function Ne(e) {
365
- const { kty: t, e: n, n: r, x: a, y: i, crv: s } = await crypto.subtle.exportKey("jwk", e), c = { kty: t, e: n, n: r, x: a, y: i, crv: s };
366
- return R.set(e, c), c;
512
+ let N;
513
+ async function st(e) {
514
+ const { kty: t, e: n, n: o, x: s, y: r, crv: i } = await crypto.subtle.exportKey("jwk", e), d = { kty: t, e: n, n: o, x: s, y: r, crv: i };
515
+ return N.set(e, d), d;
367
516
  }
368
- async function We(e) {
369
- return R || (R = /* @__PURE__ */ new WeakMap()), R.get(e) || Ne(e);
517
+ async function at(e) {
518
+ return N || (N = /* @__PURE__ */ new WeakMap()), N.get(e) || st(e);
370
519
  }
371
- function De(e, t, n) {
520
+ function ct(e, t, n) {
372
521
  if (typeof e != "string")
373
522
  throw new TypeError(`"as.${t}" must be a string`);
374
523
  return new URL(e);
375
524
  }
376
- function re(e, t, n) {
377
- return De(e[t], t);
525
+ function ye(e, t, n) {
526
+ return ct(e[t], t);
378
527
  }
379
- function J(e) {
528
+ function B(e) {
380
529
  const t = e;
381
530
  return typeof t != "object" || Array.isArray(t) || t === null ? !1 : t.error !== void 0;
382
531
  }
383
- async function He(e, t, n, r, a, i) {
384
- if (!h(e))
532
+ async function ut(e, t, n, o, s, r) {
533
+ if (!w(e))
385
534
  throw new TypeError('"accessToken" must be a non-empty string');
386
535
  if (!(n instanceof URL))
387
536
  throw new TypeError('"url" must be an instance of URL');
388
- return r = x(r), (i == null ? void 0 : i.DPoP) === void 0 ? r.set("authorization", `Bearer ${e}`) : (await Ke(r, i.DPoP, n, "GET", U({ [P]: i == null ? void 0 : i[P] }), e), r.set("authorization", `DPoP ${e}`)), ((i == null ? void 0 : i[K]) || fetch)(n.href, {
389
- body: a,
390
- headers: Object.fromEntries(r.entries()),
537
+ return o = W(o), (r == null ? void 0 : r.DPoP) === void 0 ? o.set("authorization", `Bearer ${e}`) : (await it(o, r.DPoP, n, "GET", H({ [K]: r == null ? void 0 : r[K] }), e), o.set("authorization", `DPoP ${e}`)), ((r == null ? void 0 : r[V]) || fetch)(n.href, {
538
+ body: s,
539
+ headers: Object.fromEntries(o.entries()),
391
540
  method: t,
392
541
  redirect: "manual",
393
- signal: i != null && i.signal ? W(i.signal) : null
394
- }).then(N);
395
- }
396
- async function $e(e, t, n, r) {
397
- T(e), A(t);
398
- const a = re(e, "userinfo_endpoint"), i = x(r == null ? void 0 : r.headers);
399
- return t.userinfo_signed_response_alg ? i.set("accept", "application/jwt") : (i.set("accept", "application/json"), i.append("accept", "application/jwt")), He(n, "GET", a, i, null, {
400
- ...r,
401
- [P]: U(t)
542
+ signal: r != null && r.signal ? Z(r.signal) : null
543
+ }).then(Y);
544
+ }
545
+ async function lt(e, t, n, o) {
546
+ j(e), J(t);
547
+ const s = ye(e, "userinfo_endpoint"), r = W(o == null ? void 0 : o.headers);
548
+ return t.userinfo_signed_response_alg ? r.set("accept", "application/jwt") : (r.set("accept", "application/json"), r.append("accept", "application/jwt")), ut(n, "GET", s, r, null, {
549
+ ...o,
550
+ [K]: H(t)
402
551
  });
403
552
  }
404
- async function Ie(e, t, n, r, a, i, s) {
405
- return await Oe(e, t, a, i, s == null ? void 0 : s.clientPrivateKey), i.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"), ((s == null ? void 0 : s[K]) || fetch)(r.href, {
406
- body: a,
407
- headers: Object.fromEntries(i.entries()),
553
+ async function dt(e, t, n, o, s, r, i) {
554
+ return await ot(e, t, s, r, i == null ? void 0 : i.clientPrivateKey), r.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"), ((i == null ? void 0 : i[V]) || fetch)(o.href, {
555
+ body: s,
556
+ headers: Object.fromEntries(r.entries()),
408
557
  method: n,
409
558
  redirect: "manual",
410
- signal: s != null && s.signal ? W(s.signal) : null
411
- }).then(N);
559
+ signal: i != null && i.signal ? Z(i.signal) : null
560
+ }).then(Y);
412
561
  }
413
- async function ie(e, t, n, r, a) {
414
- const i = re(e, "token_endpoint");
415
- r.set("grant_type", n);
416
- const s = x(a == null ? void 0 : a.headers);
417
- return s.set("accept", "application/json"), Ie(e, t, "POST", i, r, s, a);
562
+ async function be(e, t, n, o, s) {
563
+ const r = ye(e, "token_endpoint");
564
+ o.set("grant_type", n);
565
+ const i = W(s == null ? void 0 : s.headers);
566
+ return i.set("accept", "application/json"), dt(e, t, "POST", r, o, i, s);
418
567
  }
419
- async function Me(e, t, n, r) {
420
- if (T(e), A(t), !h(n))
568
+ async function ht(e, t, n, o) {
569
+ if (j(e), J(t), !w(n))
421
570
  throw new TypeError('"refreshToken" must be a non-empty string');
422
- const a = new URLSearchParams(r == null ? void 0 : r.additionalParameters);
423
- return a.set("refresh_token", n), ie(e, t, "refresh_token", a, r);
571
+ const s = new URLSearchParams(o == null ? void 0 : o.additionalParameters);
572
+ return s.set("refresh_token", n), be(e, t, "refresh_token", s, o);
424
573
  }
425
- const Be = /* @__PURE__ */ new WeakMap();
426
- async function se(e, t, n, r = !1, a = !1) {
427
- if (T(e), A(t), !O(n, Response))
574
+ const ft = /* @__PURE__ */ new WeakMap();
575
+ async function _e(e, t, n, o = !1, s = !1) {
576
+ if (j(e), J(t), !q(n, Response))
428
577
  throw new TypeError('"response" must be an instance of Response');
429
578
  if (n.status !== 200) {
430
- let s;
431
- if (s = await et(n))
432
- return s;
433
- throw new o('"response" is not a conform Token Endpoint response');
579
+ let i;
580
+ if (i = await St(n))
581
+ return i;
582
+ throw new a('"response" is not a conform Token Endpoint response');
434
583
  }
435
- H(n);
436
- let i;
584
+ X(n);
585
+ let r;
437
586
  try {
438
- i = await n.json();
439
- } catch (s) {
440
- throw new o('failed to parse "response" body as JSON', { cause: s });
441
- }
442
- if (!E(i))
443
- throw new o('"response" body must be a top level object');
444
- if (!h(i.access_token))
445
- throw new o('"response" body "access_token" property must be a non-empty string');
446
- if (!h(i.token_type))
447
- throw new o('"response" body "token_type" property must be a non-empty string');
448
- if (i.token_type = i.token_type.toLowerCase(), i.token_type !== "dpop" && i.token_type !== "bearer")
449
- throw new f("unsupported `token_type` value");
450
- if (i.expires_in !== void 0 && (typeof i.expires_in != "number" || i.expires_in <= 0))
451
- throw new o('"response" body "expires_in" property must be a positive number');
452
- if (!a && i.refresh_token !== void 0 && !h(i.refresh_token))
453
- throw new o('"response" body "refresh_token" property must be a non-empty string');
454
- if (i.scope !== void 0 && typeof i.scope != "string")
455
- throw new o('"response" body "scope" property must be a string');
456
- if (!r) {
457
- if (i.id_token !== void 0 && !h(i.id_token))
458
- throw new o('"response" body "id_token" property must be a non-empty string');
459
- if (i.id_token) {
460
- const { claims: s } = await nt(i.id_token, rt.bind(void 0, t.id_token_signed_response_alg, e.id_token_signing_alg_values_supported), ce, U(t), ze(t)).then(Qe.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(Ve.bind(void 0, e.issuer)).then(qe.bind(void 0, t.client_id));
461
- if (Array.isArray(s.aud) && s.aud.length !== 1 && s.azp !== t.client_id)
462
- throw new o('unexpected ID Token "azp" (authorized party) claim value');
463
- if (s.auth_time !== void 0 && (!Number.isFinite(s.auth_time) || Math.sign(s.auth_time) !== 1))
464
- throw new o('ID Token "auth_time" (authentication time) must be a positive number');
465
- Be.set(i, s);
587
+ r = await n.json();
588
+ } catch (i) {
589
+ throw new a('failed to parse "response" body as JSON', { cause: i });
590
+ }
591
+ if (!C(r))
592
+ throw new a('"response" body must be a top level object');
593
+ if (!w(r.access_token))
594
+ throw new a('"response" body "access_token" property must be a non-empty string');
595
+ if (!w(r.token_type))
596
+ throw new a('"response" body "token_type" property must be a non-empty string');
597
+ if (r.token_type = r.token_type.toLowerCase(), r.token_type !== "dpop" && r.token_type !== "bearer")
598
+ throw new v("unsupported `token_type` value");
599
+ if (r.expires_in !== void 0 && (typeof r.expires_in != "number" || r.expires_in <= 0))
600
+ throw new a('"response" body "expires_in" property must be a positive number');
601
+ if (!s && r.refresh_token !== void 0 && !w(r.refresh_token))
602
+ throw new a('"response" body "refresh_token" property must be a non-empty string');
603
+ if (r.scope !== void 0 && typeof r.scope != "string")
604
+ throw new a('"response" body "scope" property must be a string');
605
+ if (!o) {
606
+ if (r.id_token !== void 0 && !w(r.id_token))
607
+ throw new a('"response" body "id_token" property must be a non-empty string');
608
+ if (r.id_token) {
609
+ const { claims: i } = await Et(r.id_token, Tt.bind(void 0, t.id_token_signed_response_alg, e.id_token_signing_alg_values_supported), ke, H(t), tt(t)).then(_t.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(gt.bind(void 0, e.issuer)).then(wt.bind(void 0, t.client_id));
610
+ if (Array.isArray(i.aud) && i.aud.length !== 1 && i.azp !== t.client_id)
611
+ throw new a('unexpected ID Token "azp" (authorized party) claim value');
612
+ if (i.auth_time !== void 0 && (!Number.isFinite(i.auth_time) || Math.sign(i.auth_time) !== 1))
613
+ throw new a('ID Token "auth_time" (authentication time) must be a positive number');
614
+ ft.set(r, i);
466
615
  }
467
616
  }
468
- return i;
617
+ return r;
469
618
  }
470
- async function Fe(e, t, n) {
471
- return se(e, t, n);
619
+ async function pt(e, t, n) {
620
+ return _e(e, t, n);
472
621
  }
473
- function qe(e, t) {
622
+ function wt(e, t) {
474
623
  if (Array.isArray(t.claims.aud)) {
475
624
  if (!t.claims.aud.includes(e))
476
- throw new o('unexpected JWT "aud" (audience) claim value');
625
+ throw new a('unexpected JWT "aud" (audience) claim value');
477
626
  } else if (t.claims.aud !== e)
478
- throw new o('unexpected JWT "aud" (audience) claim value');
627
+ throw new a('unexpected JWT "aud" (audience) claim value');
479
628
  return t;
480
629
  }
481
- function Ve(e, t) {
630
+ function gt(e, t) {
482
631
  if (t.claims.iss !== e)
483
- throw new o('unexpected JWT "iss" (issuer) claim value');
632
+ throw new a('unexpected JWT "iss" (issuer) claim value');
484
633
  return t;
485
634
  }
486
- const ae = /* @__PURE__ */ new WeakSet();
487
- function Ge(e) {
488
- return ae.add(e), e;
635
+ const ve = /* @__PURE__ */ new WeakSet();
636
+ function mt(e) {
637
+ return ve.add(e), e;
489
638
  }
490
- async function Ye(e, t, n, r, a, i) {
491
- if (T(e), A(t), !ae.has(n))
639
+ async function yt(e, t, n, o, s, r) {
640
+ if (j(e), J(t), !ve.has(n))
492
641
  throw new TypeError('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()');
493
- if (!h(r))
642
+ if (!w(o))
494
643
  throw new TypeError('"redirectUri" must be a non-empty string');
495
- if (!h(a))
644
+ if (!w(s))
496
645
  throw new TypeError('"codeVerifier" must be a non-empty string');
497
- const s = m(n, "code");
498
- if (!s)
499
- throw new o('no authorization code in "callbackParameters"');
500
- const c = new URLSearchParams(i == null ? void 0 : i.additionalParameters);
501
- return c.set("redirect_uri", r), c.set("code_verifier", a), c.set("code", s), ie(e, t, "authorization_code", c, i);
646
+ const i = k(n, "code");
647
+ if (!i)
648
+ throw new a('no authorization code in "callbackParameters"');
649
+ const d = new URLSearchParams(r == null ? void 0 : r.additionalParameters);
650
+ return d.set("redirect_uri", o), d.set("code_verifier", s), d.set("code", i), be(e, t, "authorization_code", d, r);
502
651
  }
503
- const Ze = {
652
+ const bt = {
504
653
  aud: "audience",
505
654
  c_hash: "code hash",
506
655
  client_id: "client id",
@@ -516,43 +665,43 @@ const Ze = {
516
665
  htu: "http uri",
517
666
  cnf: "confirmation"
518
667
  };
519
- function Qe(e, t) {
668
+ function _t(e, t) {
520
669
  for (const n of e)
521
670
  if (t.claims[n] === void 0)
522
- throw new o(`JWT "${n}" (${Ze[n]}) claim missing`);
671
+ throw new a(`JWT "${n}" (${bt[n]}) claim missing`);
523
672
  return t;
524
673
  }
525
- async function Xe(e, t, n) {
526
- const r = await se(e, t, n, !0);
527
- if (J(r))
528
- return r;
529
- if (r.id_token !== void 0) {
530
- if (typeof r.id_token == "string" && r.id_token.length)
531
- throw new o("Unexpected ID Token returned, use processAuthorizationCodeOpenIDResponse() for OpenID Connect callback processing");
532
- delete r.id_token;
674
+ async function vt(e, t, n) {
675
+ const o = await _e(e, t, n, !0);
676
+ if (B(o))
677
+ return o;
678
+ if (o.id_token !== void 0) {
679
+ if (typeof o.id_token == "string" && o.id_token.length)
680
+ throw new a("Unexpected ID Token returned, use processAuthorizationCodeOpenIDResponse() for OpenID Connect callback processing");
681
+ delete o.id_token;
533
682
  }
534
- return r;
683
+ return o;
535
684
  }
536
- function H(e) {
685
+ function X(e) {
537
686
  if (e.bodyUsed)
538
687
  throw new TypeError('"response" body has been used already');
539
688
  }
540
- async function et(e) {
689
+ async function St(e) {
541
690
  if (e.status > 399 && e.status < 500) {
542
- H(e);
691
+ X(e);
543
692
  try {
544
693
  const t = await e.json();
545
- if (E(t) && typeof t.error == "string" && t.error.length)
694
+ if (C(t) && typeof t.error == "string" && t.error.length)
546
695
  return t.error_description !== void 0 && typeof t.error_description != "string" && delete t.error_description, t.error_uri !== void 0 && typeof t.error_uri != "string" && delete t.error_uri, t.algs !== void 0 && typeof t.algs != "string" && delete t.algs, t.scope !== void 0 && typeof t.scope != "string" && delete t.scope, t;
547
696
  } catch {
548
697
  }
549
698
  }
550
699
  }
551
- function G(e) {
700
+ function ue(e) {
552
701
  if (typeof e.modulusLength != "number" || e.modulusLength < 2048)
553
- throw new o(`${e.name} modulusLength must be at least 2048 bits`);
702
+ throw new a(`${e.name} modulusLength must be at least 2048 bits`);
554
703
  }
555
- function tt(e) {
704
+ function kt(e) {
556
705
  switch (e) {
557
706
  case "P-256":
558
707
  return "SHA-256";
@@ -561,18 +710,18 @@ function tt(e) {
561
710
  case "P-521":
562
711
  return "SHA-512";
563
712
  default:
564
- throw new f();
713
+ throw new v();
565
714
  }
566
715
  }
567
- function oe(e) {
716
+ function Se(e) {
568
717
  switch (e.algorithm.name) {
569
718
  case "ECDSA":
570
719
  return {
571
720
  name: e.algorithm.name,
572
- hash: tt(e.algorithm.namedCurve)
721
+ hash: kt(e.algorithm.namedCurve)
573
722
  };
574
723
  case "RSA-PSS":
575
- switch (G(e.algorithm), e.algorithm.hash.name) {
724
+ switch (ue(e.algorithm), e.algorithm.hash.name) {
576
725
  case "SHA-256":
577
726
  case "SHA-384":
578
727
  case "SHA-512":
@@ -581,229 +730,243 @@ function oe(e) {
581
730
  saltLength: parseInt(e.algorithm.hash.name.slice(-3), 10) >> 3
582
731
  };
583
732
  default:
584
- throw new f();
733
+ throw new v();
585
734
  }
586
735
  case "RSASSA-PKCS1-v1_5":
587
- return G(e.algorithm), e.algorithm.name;
736
+ return ue(e.algorithm), e.algorithm.name;
588
737
  case "Ed448":
589
738
  case "Ed25519":
590
739
  return e.algorithm.name;
591
740
  }
592
- throw new f();
593
- }
594
- const ce = Symbol();
595
- async function nt(e, t, n, r, a) {
596
- const { 0: i, 1: s, 2: c, length: d } = e.split(".");
597
- if (d === 5)
598
- throw new f("JWE structure JWTs are not supported");
599
- if (d !== 3)
600
- throw new o("Invalid JWT");
601
- let l;
741
+ throw new v();
742
+ }
743
+ const ke = Symbol();
744
+ async function Et(e, t, n, o, s) {
745
+ const { 0: r, 1: i, 2: d, length: g } = e.split(".");
746
+ if (g === 5)
747
+ throw new v("JWE structure JWTs are not supported");
748
+ if (g !== 3)
749
+ throw new a("Invalid JWT");
750
+ let m;
602
751
  try {
603
- l = JSON.parse(_(y(i)));
604
- } catch (k) {
605
- throw new o("failed to parse JWT Header body as base64url encoded JSON", { cause: k });
606
- }
607
- if (!E(l))
608
- throw new o("JWT Header must be a top level object");
609
- if (t(l), l.crit !== void 0)
610
- throw new o('unexpected JWT "crit" header parameter');
611
- const S = y(c);
612
- let p;
613
- if (n !== ce) {
614
- p = await n(l);
615
- const k = `${i}.${s}`;
616
- if (!await crypto.subtle.verify(oe(p), p, S, _(k)))
617
- throw new o("JWT signature verification failed");
618
- }
619
- let u;
752
+ m = JSON.parse(A(E(r)));
753
+ } catch (R) {
754
+ throw new a("failed to parse JWT Header body as base64url encoded JSON", { cause: R });
755
+ }
756
+ if (!C(m))
757
+ throw new a("JWT Header must be a top level object");
758
+ if (t(m), m.crit !== void 0)
759
+ throw new a('unexpected JWT "crit" header parameter');
760
+ const b = E(d);
761
+ let y;
762
+ if (n !== ke) {
763
+ y = await n(m);
764
+ const R = `${r}.${i}`;
765
+ if (!await crypto.subtle.verify(Se(y), y, b, A(R)))
766
+ throw new a("JWT signature verification failed");
767
+ }
768
+ let h;
620
769
  try {
621
- u = JSON.parse(_(y(s)));
622
- } catch (k) {
623
- throw new o("failed to parse JWT Payload body as base64url encoded JSON", { cause: k });
624
- }
625
- if (!E(u))
626
- throw new o("JWT Payload must be a top level object");
627
- const $ = D() + r;
628
- if (u.exp !== void 0) {
629
- if (typeof u.exp != "number")
630
- throw new o('unexpected JWT "exp" (expiration time) claim type');
631
- if (u.exp <= $ - a)
632
- throw new o('unexpected JWT "exp" (expiration time) claim value, timestamp is <= now()');
633
- }
634
- if (u.iat !== void 0 && typeof u.iat != "number")
635
- throw new o('unexpected JWT "iat" (issued at) claim type');
636
- if (u.iss !== void 0 && typeof u.iss != "string")
637
- throw new o('unexpected JWT "iss" (issuer) claim type');
638
- if (u.nbf !== void 0) {
639
- if (typeof u.nbf != "number")
640
- throw new o('unexpected JWT "nbf" (not before) claim type');
641
- if (u.nbf > $ + a)
642
- throw new o('unexpected JWT "nbf" (not before) claim value, timestamp is > now()');
643
- }
644
- if (u.aud !== void 0 && typeof u.aud != "string" && !Array.isArray(u.aud))
645
- throw new o('unexpected JWT "aud" (audience) claim type');
646
- return { header: l, claims: u, signature: S, key: p };
647
- }
648
- function rt(e, t, n) {
770
+ h = JSON.parse(A(E(i)));
771
+ } catch (R) {
772
+ throw new a("failed to parse JWT Payload body as base64url encoded JSON", { cause: R });
773
+ }
774
+ if (!C(h))
775
+ throw new a("JWT Payload must be a top level object");
776
+ const L = Q() + o;
777
+ if (h.exp !== void 0) {
778
+ if (typeof h.exp != "number")
779
+ throw new a('unexpected JWT "exp" (expiration time) claim type');
780
+ if (h.exp <= L - s)
781
+ throw new a('unexpected JWT "exp" (expiration time) claim value, timestamp is <= now()');
782
+ }
783
+ if (h.iat !== void 0 && typeof h.iat != "number")
784
+ throw new a('unexpected JWT "iat" (issued at) claim type');
785
+ if (h.iss !== void 0 && typeof h.iss != "string")
786
+ throw new a('unexpected JWT "iss" (issuer) claim type');
787
+ if (h.nbf !== void 0) {
788
+ if (typeof h.nbf != "number")
789
+ throw new a('unexpected JWT "nbf" (not before) claim type');
790
+ if (h.nbf > L + s)
791
+ throw new a('unexpected JWT "nbf" (not before) claim value, timestamp is > now()');
792
+ }
793
+ if (h.aud !== void 0 && typeof h.aud != "string" && !Array.isArray(h.aud))
794
+ throw new a('unexpected JWT "aud" (audience) claim type');
795
+ return { header: m, claims: h, signature: b, key: y };
796
+ }
797
+ function Tt(e, t, n) {
649
798
  if (e !== void 0) {
650
799
  if (n.alg !== e)
651
- throw new o('unexpected JWT "alg" header parameter');
800
+ throw new a('unexpected JWT "alg" header parameter');
652
801
  return;
653
802
  }
654
803
  if (Array.isArray(t)) {
655
804
  if (!t.includes(n.alg))
656
- throw new o('unexpected JWT "alg" header parameter');
805
+ throw new a('unexpected JWT "alg" header parameter');
657
806
  return;
658
807
  }
659
808
  if (n.alg !== "RS256")
660
- throw new o('unexpected JWT "alg" header parameter');
809
+ throw new a('unexpected JWT "alg" header parameter');
661
810
  }
662
- function m(e, t) {
663
- const { 0: n, length: r } = e.getAll(t);
664
- if (r > 1)
665
- throw new o(`"${t}" parameter must be provided only once`);
811
+ function k(e, t) {
812
+ const { 0: n, length: o } = e.getAll(t);
813
+ if (o > 1)
814
+ throw new a(`"${t}" parameter must be provided only once`);
666
815
  return n;
667
816
  }
668
- const it = Symbol(), st = Symbol();
669
- function at(e, t, n, r) {
670
- if (T(e), A(t), n instanceof URL && (n = n.searchParams), !(n instanceof URLSearchParams))
817
+ const At = Symbol(), Rt = Symbol();
818
+ function Pt(e, t, n, o) {
819
+ if (j(e), J(t), n instanceof URL && (n = n.searchParams), !(n instanceof URLSearchParams))
671
820
  throw new TypeError('"parameters" must be an instance of URLSearchParams, or URL');
672
- if (m(n, "response"))
673
- throw new o('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()');
674
- const a = m(n, "iss"), i = m(n, "state");
675
- if (!a && e.authorization_response_iss_parameter_supported)
676
- throw new o('response parameter "iss" (issuer) missing');
677
- if (a && a !== e.issuer)
678
- throw new o('unexpected "iss" (issuer) response parameter value');
679
- switch (r) {
821
+ if (k(n, "response"))
822
+ throw new a('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()');
823
+ const s = k(n, "iss"), r = k(n, "state");
824
+ if (!s && e.authorization_response_iss_parameter_supported)
825
+ throw new a('response parameter "iss" (issuer) missing');
826
+ if (s && s !== e.issuer)
827
+ throw new a('unexpected "iss" (issuer) response parameter value');
828
+ switch (o) {
680
829
  case void 0:
681
- case st:
682
- if (i !== void 0)
683
- throw new o('unexpected "state" response parameter encountered');
830
+ case Rt:
831
+ if (r !== void 0)
832
+ throw new a('unexpected "state" response parameter encountered');
684
833
  break;
685
- case it:
834
+ case At:
686
835
  break;
687
836
  default:
688
- if (!h(r))
689
- throw new o('"expectedState" must be a non-empty string');
690
- if (i === void 0)
691
- throw new o('response parameter "state" missing');
692
- if (i !== r)
693
- throw new o('unexpected "state" response parameter value');
694
- }
695
- const s = m(n, "error");
696
- if (s)
837
+ if (!w(o))
838
+ throw new a('"expectedState" must be a non-empty string');
839
+ if (r === void 0)
840
+ throw new a('response parameter "state" missing');
841
+ if (r !== o)
842
+ throw new a('unexpected "state" response parameter value');
843
+ }
844
+ const i = k(n, "error");
845
+ if (i)
697
846
  return {
698
- error: s,
699
- error_description: m(n, "error_description"),
700
- error_uri: m(n, "error_uri")
847
+ error: i,
848
+ error_description: k(n, "error_description"),
849
+ error_uri: k(n, "error_uri")
701
850
  };
702
- const c = m(n, "id_token"), d = m(n, "token");
703
- if (c !== void 0 || d !== void 0)
704
- throw new f("implicit and hybrid flows are not supported");
705
- return Ge(new URLSearchParams(n));
851
+ const d = k(n, "id_token"), g = k(n, "token");
852
+ if (d !== void 0 || g !== void 0)
853
+ throw new v("implicit and hybrid flows are not supported");
854
+ return mt(new URLSearchParams(n));
706
855
  }
707
- class b extends Error {
856
+ class x extends Error {
708
857
  }
709
- class L extends b {
710
- constructor(t, n, r) {
711
- super(t, r), this.error = n;
858
+ class G extends x {
859
+ constructor(t, n, o) {
860
+ super(t, o), this.error = n;
712
861
  }
713
862
  }
714
- function ot({
863
+ function xt({
715
864
  handleCallback: e
716
865
  }) {
717
- const t = fe(!1), [n, r] = le(void 0), a = de();
718
- return pe(() => {
866
+ const t = je(!1), [n, o] = Je(void 0), s = xe();
867
+ return ze(() => {
719
868
  t.current || (t.current = !0, e().then(() => {
720
- a("/");
721
- }).catch((i) => {
722
- r(i);
869
+ s("/");
870
+ }).catch((r) => {
871
+ o(r);
723
872
  }));
724
- }, []), n ? n instanceof L ? /* @__PURE__ */ g.jsxs("div", { children: [
725
- /* @__PURE__ */ g.jsx("h2", { children: "Error" }),
726
- /* @__PURE__ */ g.jsxs("pre", { children: [
873
+ }, []), n ? n instanceof G ? /* @__PURE__ */ T.jsxs("div", { children: [
874
+ /* @__PURE__ */ T.jsx("h2", { children: "Error" }),
875
+ /* @__PURE__ */ T.jsxs("pre", { children: [
727
876
  n.error.error,
728
877
  n.error.error_description,
729
878
  n.error.error_uri
730
879
  ] })
731
- ] }) : /* @__PURE__ */ g.jsxs("div", { children: [
732
- /* @__PURE__ */ g.jsx("h2", { children: "Error" }),
733
- /* @__PURE__ */ g.jsxs("pre", { children: [
880
+ ] }) : /* @__PURE__ */ T.jsxs("div", { children: [
881
+ /* @__PURE__ */ T.jsx("h2", { children: "Error" }),
882
+ /* @__PURE__ */ T.jsxs("pre", { children: [
734
883
  n.message,
735
884
  n.stack
736
885
  ] })
737
- ] }) : /* @__PURE__ */ g.jsx("div", { children: "Loading..." });
886
+ ] }) : /* @__PURE__ */ T.jsx("div", { children: "Loading..." });
738
887
  }
739
- const Y = "code-verifier";
740
- class ct {
888
+ const le = "code-verifier";
889
+ class Lt extends Ce {
890
+ constructor(t, n) {
891
+ super(), this.callbackUrlPath = t, this.handleCallback = n;
892
+ }
893
+ getRoutes() {
894
+ return [
895
+ ...super.getRoutes(),
896
+ {
897
+ path: this.callbackUrlPath,
898
+ element: /* @__PURE__ */ T.jsx(xt, { handleCallback: this.handleCallback })
899
+ }
900
+ ];
901
+ }
902
+ }
903
+ class Ut {
741
904
  constructor({
742
905
  issuer: t,
743
906
  authorizationEndpoint: n,
744
- tokenEndpoint: r,
745
- clientId: a
907
+ tokenEndpoint: o,
908
+ clientId: s
746
909
  }) {
747
- w(this, "client");
748
- w(this, "issuer");
749
- w(this, "authorizationEndpoint");
750
- w(this, "tokenEndpoint");
751
- w(this, "authorizationServer");
752
- w(this, "tokens");
753
- w(this, "callbackUrlPath", "/oauth/callback");
754
- w(this, "logoutRedirectUrlPath", "/");
755
- w(this, "handleCallback", async () => {
756
- const t = new URL(window.location.href), n = t.searchParams.get("state"), r = localStorage.getItem(Y);
757
- if (!r)
758
- throw new b(
910
+ S(this, "client");
911
+ S(this, "issuer");
912
+ S(this, "authorizationEndpoint");
913
+ S(this, "tokenEndpoint");
914
+ S(this, "authorizationServer");
915
+ S(this, "tokens");
916
+ S(this, "callbackUrlPath", "/oauth/callback");
917
+ S(this, "logoutRedirectUrlPath", "/");
918
+ S(this, "handleCallback", async () => {
919
+ const t = new URL(window.location.href), n = t.searchParams.get("state"), o = localStorage.getItem(le);
920
+ if (!o)
921
+ throw new x(
759
922
  "Code verifier not found. Invalid auth state."
760
923
  );
761
- const a = await this.getAuthServer(), i = at(
762
- a,
924
+ const s = await this.getAuthServer(), r = Pt(
925
+ s,
763
926
  this.client,
764
927
  t.searchParams,
765
928
  n ?? void 0
766
929
  );
767
- if (J(i))
768
- throw I.error("Error validating OAuth response", i), new L(
930
+ if (B(r))
931
+ throw oe.error("Error validating OAuth response", r), new G(
769
932
  "Error validating OAuth response",
770
- i
933
+ r
771
934
  );
772
- const s = new URL(t);
773
- s.pathname = this.callbackUrlPath, s.search = "";
774
- const c = await Ye(
775
- a,
935
+ const i = new URL(t);
936
+ i.pathname = this.callbackUrlPath, i.search = "";
937
+ const d = await yt(
938
+ s,
776
939
  this.client,
777
- i,
778
- s.toString(),
779
- r
780
- ), d = await Xe(
781
- a,
940
+ r,
941
+ i.toString(),
942
+ o
943
+ ), g = await vt(
944
+ s,
782
945
  this.client,
783
- c
946
+ d
784
947
  );
785
- this.setTokensFromResponse(d);
786
- const l = await this.getAccessToken(), p = await (await $e(
787
- a,
948
+ this.setTokensFromResponse(g);
949
+ const m = await this.getAccessToken(), y = await (await lt(
950
+ s,
788
951
  this.client,
789
- l
790
- )).json(), u = {
791
- sub: p.sub,
792
- email: p.email,
793
- name: p.name,
794
- emailVerified: p.email_verified ?? !1,
795
- pictureUrl: p.picture
952
+ m
953
+ )).json(), h = {
954
+ sub: y.sub,
955
+ email: y.email,
956
+ name: y.name,
957
+ emailVerified: y.email_verified ?? !1,
958
+ pictureUrl: y.picture
796
959
  };
797
- M.setState({
960
+ re.setState({
798
961
  isAuthenticated: !0,
799
962
  isPending: !1,
800
- profile: u
963
+ profile: h
801
964
  });
802
965
  });
803
966
  this.client = {
804
- client_id: a,
967
+ client_id: s,
805
968
  token_endpoint_auth_method: "none"
806
- }, this.issuer = t, this.authorizationEndpoint = n, this.tokenEndpoint = r;
969
+ }, this.issuer = t, this.authorizationEndpoint = n, this.tokenEndpoint = o;
807
970
  }
808
971
  async getAuthServer() {
809
972
  if (!this.authorizationServer)
@@ -815,8 +978,8 @@ class ct {
815
978
  code_challenge_methods_supported: []
816
979
  };
817
980
  else {
818
- const t = new URL(this.issuer), n = await Ee(t);
819
- this.authorizationServer = await Te(
981
+ const t = new URL(this.issuer), n = await Me(t);
982
+ this.authorizationServer = await Be(
820
983
  t,
821
984
  n
822
985
  );
@@ -828,10 +991,10 @@ class ct {
828
991
  * @param response
829
992
  */
830
993
  setTokensFromResponse(t) {
831
- if (J(t))
832
- throw I.error("Bad Token Response", t), new L("Bad Token Response", t);
994
+ if (B(t))
995
+ throw oe.error("Bad Token Response", t), new G("Bad Token Response", t);
833
996
  if (!t.expires_in)
834
- throw new b("No expires_in in response");
997
+ throw new x("No expires_in in response");
835
998
  this.tokens = {
836
999
  accessToken: t.access_token,
837
1000
  refreshToken: t.refresh_token,
@@ -839,74 +1002,71 @@ class ct {
839
1002
  tokenType: t.token_type
840
1003
  };
841
1004
  }
842
- async initialize() {
843
- }
844
1005
  async login() {
845
- var c;
1006
+ var d;
846
1007
  const t = "S256", n = await this.getAuthServer();
847
1008
  if (!n.authorization_endpoint)
848
- throw new b("No authorization endpoint");
849
- const r = Ae(), a = await Re(r);
850
- localStorage.setItem(Y, r);
851
- const i = new URL(
1009
+ throw new x("No authorization endpoint");
1010
+ const o = Ge(), s = await Ve(o);
1011
+ localStorage.setItem(le, o);
1012
+ const r = new URL(
852
1013
  n.authorization_endpoint
853
- ), s = new URL(window.location.href);
854
- if (s.pathname = this.callbackUrlPath, s.search = "", i.searchParams.set("client_id", this.client.client_id), i.searchParams.set("redirect_uri", s.toString()), i.searchParams.set("response_type", "code"), i.searchParams.set("scope", "openid+profile+email"), i.searchParams.set("code_challenge", a), i.searchParams.set(
1014
+ ), i = new URL(window.location.href);
1015
+ if (i.pathname = this.callbackUrlPath, i.search = "", r.searchParams.set("client_id", this.client.client_id), r.searchParams.set("redirect_uri", i.toString()), r.searchParams.set("response_type", "code"), r.searchParams.set("scope", "openid+profile+email"), r.searchParams.set("code_challenge", s), r.searchParams.set(
855
1016
  "code_challenge_method",
856
1017
  t
857
- ), ((c = n.code_challenge_methods_supported) == null ? void 0 : c.includes("S256")) !== !0) {
858
- const d = ve();
859
- i.searchParams.set("state", d);
1018
+ ), ((d = n.code_challenge_methods_supported) == null ? void 0 : d.includes("S256")) !== !0) {
1019
+ const g = qe();
1020
+ r.searchParams.set("state", g);
860
1021
  }
861
- location.href = i.href;
1022
+ location.href = r.href;
862
1023
  }
863
1024
  async getAccessToken() {
864
1025
  const t = await this.getAuthServer();
865
1026
  if (!this.tokens)
866
- throw new b("User is not authenticated");
1027
+ throw new x("User is not authenticated");
867
1028
  if (this.tokens.expiresOn < /* @__PURE__ */ new Date()) {
868
1029
  if (!this.tokens.refreshToken)
869
- throw new b(
1030
+ throw new x(
870
1031
  "Token expired and no refresh token available"
871
1032
  );
872
- const n = await Me(
1033
+ const n = await ht(
873
1034
  t,
874
1035
  this.client,
875
1036
  this.tokens.refreshToken
876
- ), r = await Fe(
1037
+ ), o = await pt(
877
1038
  t,
878
1039
  this.client,
879
1040
  n
880
1041
  );
881
- this.setTokensFromResponse(r);
1042
+ this.setTokensFromResponse(o);
882
1043
  }
883
1044
  return this.tokens.accessToken;
884
1045
  }
885
1046
  async logout() {
886
- M.setState({
1047
+ re.setState({
887
1048
  isAuthenticated: !1,
888
1049
  isPending: !1,
889
1050
  profile: void 0
890
1051
  });
891
1052
  const t = await this.getAuthServer(), n = new URL(window.location.href);
892
1053
  n.pathname = this.logoutRedirectUrlPath;
893
- let r;
894
- t.end_session_endpoint ? (r = new URL(t.end_session_endpoint), r.searchParams.set(
1054
+ let o;
1055
+ t.end_session_endpoint ? (o = new URL(t.end_session_endpoint), o.searchParams.set(
895
1056
  "post_logout_redirect_uri",
896
1057
  n.toString()
897
- )) : r = n;
1058
+ )) : o = n;
898
1059
  }
899
- getRoutes() {
900
- return [
901
- {
902
- path: this.callbackUrlPath,
903
- element: /* @__PURE__ */ g.jsx(ot, { handleCallback: this.handleCallback })
904
- }
905
- ];
1060
+ getAuthenticationPlugin() {
1061
+ return new Lt(
1062
+ this.callbackUrlPath,
1063
+ () => this.handleCallback()
1064
+ );
906
1065
  }
907
1066
  }
908
- const wt = (e) => new ct(e);
1067
+ const Nt = (e) => new Ut(e);
909
1068
  export {
910
- ct as OpenIDAuthenticationProvider,
911
- wt as default
1069
+ Ut as OpenIDAuthenticationProvider,
1070
+ Nt as default
912
1071
  };
1072
+ //# sourceMappingURL=zudoku.auth-openid.js.map