zudoku 0.3.0-dev.9 → 0.3.0-dev.90

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