zudoku 0.41.4 → 0.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (530) hide show
  1. package/dist/app/main.js +6 -0
  2. package/dist/app/main.js.map +1 -1
  3. package/dist/config/validators/common.d.ts +420 -288
  4. package/dist/config/validators/common.js +10 -0
  5. package/dist/config/validators/common.js.map +1 -1
  6. package/dist/config/validators/validate.d.ts +161 -108
  7. package/dist/index.d.ts +1 -0
  8. package/dist/index.js +1 -0
  9. package/dist/index.js.map +1 -1
  10. package/dist/lib/components/BuildCheck.js +5 -4
  11. package/dist/lib/components/BuildCheck.js.map +1 -1
  12. package/dist/lib/components/Markdown.d.ts +3 -1
  13. package/dist/lib/components/Markdown.js +8 -14
  14. package/dist/lib/components/Markdown.js.map +1 -1
  15. package/dist/lib/components/context/ZudokuContext.d.ts +1 -1
  16. package/dist/lib/components/index.d.ts +2 -1
  17. package/dist/lib/core/ZudokuContext.d.ts +7 -0
  18. package/dist/lib/core/ZudokuContext.js.map +1 -1
  19. package/dist/lib/errors/ErrorAlert.js +1 -1
  20. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  21. package/dist/lib/plugins/openapi/CollapsibleCode.js +1 -1
  22. package/dist/lib/plugins/openapi/CollapsibleCode.js.map +1 -1
  23. package/dist/lib/plugins/openapi/Sidecar.js +1 -1
  24. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  25. package/dist/lib/plugins/openapi/SidecarExamples.js +1 -1
  26. package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
  27. package/dist/lib/shiki.d.ts +35 -0
  28. package/dist/lib/shiki.js +103 -0
  29. package/dist/lib/shiki.js.map +1 -0
  30. package/dist/lib/ui/Callout.js +1 -1
  31. package/dist/lib/ui/Callout.js.map +1 -1
  32. package/dist/lib/ui/CodeBlock.d.ts +16 -0
  33. package/dist/lib/ui/CodeBlock.js +18 -0
  34. package/dist/lib/ui/CodeBlock.js.map +1 -0
  35. package/dist/lib/ui/SyntaxHighlight.d.ts +10 -15
  36. package/dist/lib/ui/SyntaxHighlight.js +10 -60
  37. package/dist/lib/ui/SyntaxHighlight.js.map +1 -1
  38. package/dist/lib/util/MdxComponents.d.ts +9 -3
  39. package/dist/lib/util/MdxComponents.js +9 -10
  40. package/dist/lib/util/MdxComponents.js.map +1 -1
  41. package/dist/vite/config.js +34 -0
  42. package/dist/vite/config.js.map +1 -1
  43. package/dist/vite/plugin-mdx.js +4 -11
  44. package/dist/vite/plugin-mdx.js.map +1 -1
  45. package/dist/vite/plugin-shiki-register.d.ts +3 -0
  46. package/dist/vite/plugin-shiki-register.js +38 -0
  47. package/dist/vite/plugin-shiki-register.js.map +1 -0
  48. package/dist/vite/plugin.js +2 -0
  49. package/dist/vite/plugin.js.map +1 -1
  50. package/lib/AuthenticationPlugin-EeQpQI3D.js +55 -0
  51. package/lib/{AuthenticationPlugin-CJOFRBk3.js.map → AuthenticationPlugin-EeQpQI3D.js.map} +1 -1
  52. package/lib/{Button-BBNrKpQd.js → Button-Bdk_Ij3U.js} +3 -3
  53. package/lib/{Button-BBNrKpQd.js.map → Button-Bdk_Ij3U.js.map} +1 -1
  54. package/lib/{Callout-D3Ja4OPX.js → Callout-XadUe37J.js} +12 -12
  55. package/lib/{Callout-D3Ja4OPX.js.map → Callout-XadUe37J.js.map} +1 -1
  56. package/lib/{CategoryHeading-D06WK_Wo.js → CategoryHeading-DZi-Szor.js} +2 -2
  57. package/lib/{CategoryHeading-D06WK_Wo.js.map → CategoryHeading-DZi-Szor.js.map} +1 -1
  58. package/lib/{Dialog-ByYz4ABw.js → Dialog-CNf2oWXG.js} +2 -2
  59. package/lib/{Dialog-ByYz4ABw.js.map → Dialog-CNf2oWXG.js.map} +1 -1
  60. package/lib/{Drawer-CEwbkLDb.js → Drawer-BPBxzel2.js} +25 -25
  61. package/lib/{Drawer-CEwbkLDb.js.map → Drawer-BPBxzel2.js.map} +1 -1
  62. package/lib/Markdown-1l-DtDbF.js +7688 -0
  63. package/lib/Markdown-1l-DtDbF.js.map +1 -0
  64. package/lib/MdxPage-Dxbq6lFr.js +84 -0
  65. package/lib/{MdxPage-OSMru6r8.js.map → MdxPage-Dxbq6lFr.js.map} +1 -1
  66. package/lib/{OasProvider-CHYfqkG3.js → OasProvider-DKpTJMH2.js} +4 -4
  67. package/lib/{OasProvider-CHYfqkG3.js.map → OasProvider-DKpTJMH2.js.map} +1 -1
  68. package/lib/{OperationList-jzJUa4hl.js → OperationList-DVOyNeno.js} +1385 -1417
  69. package/lib/{OperationList-jzJUa4hl.js.map → OperationList-DVOyNeno.js.map} +1 -1
  70. package/lib/{Pagination-BcY_siMl.js → Pagination-COMmV-g9.js} +4 -4
  71. package/lib/{Pagination-BcY_siMl.js.map → Pagination-COMmV-g9.js.map} +1 -1
  72. package/lib/RouteGuard-CGqivwrh.js +733 -0
  73. package/lib/{RouteGuard-BZ_VsiXc.js.map → RouteGuard-CGqivwrh.js.map} +1 -1
  74. package/lib/{SchemaList-DcWTacAj.js → SchemaList-BTWzXyYQ.js} +43 -44
  75. package/lib/{SchemaList-DcWTacAj.js.map → SchemaList-BTWzXyYQ.js.map} +1 -1
  76. package/lib/{SchemaView-DwlVvFfp.js → SchemaView-DNKKW3nB.js} +7 -11
  77. package/lib/{SchemaView-DwlVvFfp.js.map → SchemaView-DNKKW3nB.js.map} +1 -1
  78. package/lib/Select-m-ITdvFa.js +211 -0
  79. package/lib/{Select-Dg5R11Dx.js.map → Select-m-ITdvFa.js.map} +1 -1
  80. package/lib/SlotletProvider-DhK1Fmm9.js +254 -0
  81. package/lib/SlotletProvider-DhK1Fmm9.js.map +1 -0
  82. package/lib/SyntaxHighlight-CJ6FoYvt.js +9104 -0
  83. package/lib/SyntaxHighlight-CJ6FoYvt.js.map +1 -0
  84. package/lib/{Toc-BVdRaIC0.js → Toc-CzMOgcPS.js} +3 -3
  85. package/lib/{Toc-BVdRaIC0.js.map → Toc-CzMOgcPS.js.map} +1 -1
  86. package/lib/{chunk-KNED5TY2-BUPjb3LQ.js → chunk-BAXFHI7N-CFrZQ7Oh.js} +356 -359
  87. package/lib/chunk-BAXFHI7N-CFrZQ7Oh.js.map +1 -0
  88. package/lib/{circular-ByJI6Mci.js → circular-D__GEK2G.js} +47 -47
  89. package/lib/{circular-ByJI6Mci.js.map → circular-D__GEK2G.js.map} +1 -1
  90. package/lib/{cn-qaFjX9_3.js → cn-CwJPJKOE.js} +28 -29
  91. package/lib/{cn-qaFjX9_3.js.map → cn-CwJPJKOE.js.map} +1 -1
  92. package/lib/{createServer-IW7v5hWm.js → createServer-B4l2NSkt.js} +3724 -3868
  93. package/lib/{createServer-IW7v5hWm.js.map → createServer-B4l2NSkt.js.map} +1 -1
  94. package/lib/hook-CyNmcNr8.js +1443 -0
  95. package/lib/{hook-pPrHCB6G.js.map → hook-CyNmcNr8.js.map} +1 -1
  96. package/lib/{index-DwT-v3zK.js → index--oeBayMa.js} +2 -2
  97. package/lib/{index-DwT-v3zK.js.map → index--oeBayMa.js.map} +1 -1
  98. package/lib/index-BcMPFdRU.js +4975 -0
  99. package/lib/index-BcMPFdRU.js.map +1 -0
  100. package/lib/{index-LNp6rxyU.js → index-BvvmIczU.js} +2 -2
  101. package/lib/{index-LNp6rxyU.js.map → index-BvvmIczU.js.map} +1 -1
  102. package/lib/{index-DNFEg0uU.js → index-CCS3ifKs.js} +690 -733
  103. package/lib/{index-DNFEg0uU.js.map → index-CCS3ifKs.js.map} +1 -1
  104. package/lib/{index-CuBIgTKC.js → index-CrcNWbel.js} +9 -9
  105. package/lib/{index-CuBIgTKC.js.map → index-CrcNWbel.js.map} +1 -1
  106. package/lib/{index-CPNSgwSb.js → index-Z13x6tPX.js} +5 -5
  107. package/lib/{index-CPNSgwSb.js.map → index-Z13x6tPX.js.map} +1 -1
  108. package/lib/{index-DcHeSvkE.js → index-zddirpDj.js} +581 -609
  109. package/lib/{index-DcHeSvkE.js.map → index-zddirpDj.js.map} +1 -1
  110. package/lib/invariant-D3QcI9fa.js +22 -0
  111. package/lib/{invariant-Caa8-XvF.js.map → invariant-D3QcI9fa.js.map} +1 -1
  112. package/lib/mutation-narTVsCe.js +196 -0
  113. package/lib/{mutation-Csa9eQDM.js.map → mutation-narTVsCe.js.map} +1 -1
  114. package/lib/processors/removeParameters.js +27 -28
  115. package/lib/processors/removeParameters.js.map +1 -1
  116. package/lib/processors/removePaths.js +17 -17
  117. package/lib/processors/removePaths.js.map +1 -1
  118. package/lib/ui/Accordion.js +1 -1
  119. package/lib/ui/ActionButton.js +2 -2
  120. package/lib/ui/Alert.js +2 -2
  121. package/lib/ui/AlertDialog.js +1 -1
  122. package/lib/ui/Badge.js +2 -2
  123. package/lib/ui/Breadcrumb.js +1 -1
  124. package/lib/ui/Button.js +2 -2
  125. package/lib/ui/Callout.js +7 -7
  126. package/lib/ui/Callout.js.map +1 -1
  127. package/lib/ui/Card.js +1 -1
  128. package/lib/ui/Carousel.js +175 -175
  129. package/lib/ui/Carousel.js.map +1 -1
  130. package/lib/ui/Checkbox.js +1 -1
  131. package/lib/ui/CodeBlock.js +83 -0
  132. package/lib/ui/CodeBlock.js.map +1 -0
  133. package/lib/ui/Command.js +58 -58
  134. package/lib/ui/Command.js.map +1 -1
  135. package/lib/ui/Dialog.js +1 -1
  136. package/lib/ui/Drawer.js +2 -2
  137. package/lib/ui/DropdownMenu.js +1 -1
  138. package/lib/ui/Form.js +1 -1
  139. package/lib/ui/HoverCard.js +1 -1
  140. package/lib/ui/Input.js +1 -1
  141. package/lib/ui/Label.js +2 -2
  142. package/lib/ui/Pagination.js +1 -1
  143. package/lib/ui/Popover.js +1 -1
  144. package/lib/ui/Progress.js +1 -1
  145. package/lib/ui/RadioGroup.js +1 -1
  146. package/lib/ui/ScrollArea.js +1 -1
  147. package/lib/ui/Select.js +1 -1
  148. package/lib/ui/Skeleton.js +1 -1
  149. package/lib/ui/Slider.js +1 -1
  150. package/lib/ui/Switch.js +1 -1
  151. package/lib/ui/SyntaxHighlight.js +4 -6
  152. package/lib/ui/SyntaxHighlight.js.map +1 -1
  153. package/lib/ui/Tabs.js +1 -1
  154. package/lib/ui/Textarea.js +1 -1
  155. package/lib/ui/Toggle.js +2 -2
  156. package/lib/ui/ToggleGroup.js +1 -1
  157. package/lib/ui/Tooltip.js +1 -1
  158. package/lib/ui/util.js +1 -1
  159. package/lib/{useExposedProps-Dq2yUQIG.js → useExposedProps-n1u49409.js} +2 -2
  160. package/lib/{useExposedProps-Dq2yUQIG.js.map → useExposedProps-n1u49409.js.map} +1 -1
  161. package/lib/zudoku.auth-auth0.js +28 -31
  162. package/lib/zudoku.auth-auth0.js.map +1 -1
  163. package/lib/zudoku.auth-clerk.js +62 -68
  164. package/lib/zudoku.auth-clerk.js.map +1 -1
  165. package/lib/zudoku.auth-openid.js +475 -483
  166. package/lib/zudoku.auth-openid.js.map +1 -1
  167. package/lib/zudoku.components.js +7 -7
  168. package/lib/zudoku.hooks.js +2 -2
  169. package/lib/zudoku.plugin-api-catalog.js +45 -45
  170. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  171. package/lib/zudoku.plugin-api-keys.js +6 -6
  172. package/lib/zudoku.plugin-custom-pages.js +3 -3
  173. package/lib/zudoku.plugin-markdown.js +25 -28
  174. package/lib/zudoku.plugin-markdown.js.map +1 -1
  175. package/lib/zudoku.plugin-openapi.js +3 -3
  176. package/lib/zudoku.plugin-redirect.js +1 -1
  177. package/lib/zudoku.plugin-search-inkeep.js +26 -27
  178. package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
  179. package/lib/zudoku.plugin-search-pagefind.js +107 -110
  180. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  181. package/package.json +19 -9
  182. package/src/app/main.css +53 -3
  183. package/src/app/main.tsx +7 -0
  184. package/src/lib/components/BuildCheck.tsx +6 -4
  185. package/src/lib/components/Markdown.tsx +29 -24
  186. package/src/lib/core/ZudokuContext.ts +4 -0
  187. package/src/lib/errors/ErrorAlert.tsx +1 -1
  188. package/src/lib/plugins/openapi/CollapsibleCode.tsx +5 -2
  189. package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
  190. package/src/lib/plugins/openapi/SidecarExamples.tsx +2 -2
  191. package/src/lib/shiki.ts +129 -0
  192. package/src/lib/ui/Callout.tsx +1 -1
  193. package/src/lib/ui/CodeBlock.tsx +102 -0
  194. package/src/lib/ui/SyntaxHighlight.tsx +18 -182
  195. package/src/lib/util/MdxComponents.tsx +27 -14
  196. package/src/shiki/langs/abap.js +1 -0
  197. package/src/shiki/langs/actionscript-3.js +1 -0
  198. package/src/shiki/langs/ada.js +1 -0
  199. package/src/shiki/langs/angular-expression.js +1 -0
  200. package/src/shiki/langs/angular-html.js +1 -0
  201. package/src/shiki/langs/angular-inline-style.js +1 -0
  202. package/src/shiki/langs/angular-inline-template.js +1 -0
  203. package/src/shiki/langs/angular-let-declaration.js +1 -0
  204. package/src/shiki/langs/angular-template-blocks.js +1 -0
  205. package/src/shiki/langs/angular-template.js +1 -0
  206. package/src/shiki/langs/angular-ts.js +1 -0
  207. package/src/shiki/langs/apache.js +1 -0
  208. package/src/shiki/langs/apex.js +1 -0
  209. package/src/shiki/langs/apl.js +1 -0
  210. package/src/shiki/langs/applescript.js +1 -0
  211. package/src/shiki/langs/ara.js +1 -0
  212. package/src/shiki/langs/asciidoc.js +1 -0
  213. package/src/shiki/langs/asm.js +1 -0
  214. package/src/shiki/langs/astro.js +1 -0
  215. package/src/shiki/langs/awk.js +1 -0
  216. package/src/shiki/langs/ballerina.js +1 -0
  217. package/src/shiki/langs/bat.js +1 -0
  218. package/src/shiki/langs/beancount.js +1 -0
  219. package/src/shiki/langs/berry.js +1 -0
  220. package/src/shiki/langs/bibtex.js +1 -0
  221. package/src/shiki/langs/bicep.js +1 -0
  222. package/src/shiki/langs/blade.js +1 -0
  223. package/src/shiki/langs/bsl.js +1 -0
  224. package/src/shiki/langs/c.js +1 -0
  225. package/src/shiki/langs/cadence.js +1 -0
  226. package/src/shiki/langs/cairo.js +1 -0
  227. package/src/shiki/langs/clarity.js +1 -0
  228. package/src/shiki/langs/clojure.js +1 -0
  229. package/src/shiki/langs/cmake.js +1 -0
  230. package/src/shiki/langs/cobol.js +1 -0
  231. package/src/shiki/langs/codeowners.js +1 -0
  232. package/src/shiki/langs/codeql.js +1 -0
  233. package/src/shiki/langs/coffee.js +1 -0
  234. package/src/shiki/langs/common-lisp.js +1 -0
  235. package/src/shiki/langs/coq.js +1 -0
  236. package/src/shiki/langs/cpp-macro.js +1 -0
  237. package/src/shiki/langs/cpp.js +1 -0
  238. package/src/shiki/langs/crystal.js +1 -0
  239. package/src/shiki/langs/csharp.js +1 -0
  240. package/src/shiki/langs/css.js +1 -0
  241. package/src/shiki/langs/csv.js +1 -0
  242. package/src/shiki/langs/cue.js +1 -0
  243. package/src/shiki/langs/cypher.js +1 -0
  244. package/src/shiki/langs/d.js +1 -0
  245. package/src/shiki/langs/dart.js +1 -0
  246. package/src/shiki/langs/dax.js +1 -0
  247. package/src/shiki/langs/desktop.js +1 -0
  248. package/src/shiki/langs/diff.js +1 -0
  249. package/src/shiki/langs/docker.js +1 -0
  250. package/src/shiki/langs/dotenv.js +1 -0
  251. package/src/shiki/langs/dream-maker.js +1 -0
  252. package/src/shiki/langs/edge.js +1 -0
  253. package/src/shiki/langs/elixir.js +1 -0
  254. package/src/shiki/langs/elm.js +1 -0
  255. package/src/shiki/langs/emacs-lisp.js +1 -0
  256. package/src/shiki/langs/erb.js +1 -0
  257. package/src/shiki/langs/erlang.js +1 -0
  258. package/src/shiki/langs/es-tag-css.js +1 -0
  259. package/src/shiki/langs/es-tag-glsl.js +1 -0
  260. package/src/shiki/langs/es-tag-html.js +1 -0
  261. package/src/shiki/langs/es-tag-sql.js +1 -0
  262. package/src/shiki/langs/es-tag-xml.js +1 -0
  263. package/src/shiki/langs/fennel.js +1 -0
  264. package/src/shiki/langs/fish.js +1 -0
  265. package/src/shiki/langs/fluent.js +1 -0
  266. package/src/shiki/langs/fortran-fixed-form.js +1 -0
  267. package/src/shiki/langs/fortran-free-form.js +1 -0
  268. package/src/shiki/langs/fsharp.js +1 -0
  269. package/src/shiki/langs/gdresource.js +1 -0
  270. package/src/shiki/langs/gdscript.js +1 -0
  271. package/src/shiki/langs/gdshader.js +1 -0
  272. package/src/shiki/langs/genie.js +1 -0
  273. package/src/shiki/langs/gherkin.js +1 -0
  274. package/src/shiki/langs/git-commit.js +1 -0
  275. package/src/shiki/langs/git-rebase.js +1 -0
  276. package/src/shiki/langs/gleam.js +1 -0
  277. package/src/shiki/langs/glimmer-js.js +1 -0
  278. package/src/shiki/langs/glimmer-ts.js +1 -0
  279. package/src/shiki/langs/glsl.js +1 -0
  280. package/src/shiki/langs/gnuplot.js +1 -0
  281. package/src/shiki/langs/go.js +1 -0
  282. package/src/shiki/langs/graphql.js +1 -0
  283. package/src/shiki/langs/groovy.js +1 -0
  284. package/src/shiki/langs/hack.js +1 -0
  285. package/src/shiki/langs/haml.js +1 -0
  286. package/src/shiki/langs/handlebars.js +1 -0
  287. package/src/shiki/langs/haskell.js +1 -0
  288. package/src/shiki/langs/haxe.js +1 -0
  289. package/src/shiki/langs/hcl.js +1 -0
  290. package/src/shiki/langs/hjson.js +1 -0
  291. package/src/shiki/langs/hlsl.js +1 -0
  292. package/src/shiki/langs/html-derivative.js +1 -0
  293. package/src/shiki/langs/html.js +1 -0
  294. package/src/shiki/langs/http.js +1 -0
  295. package/src/shiki/langs/hxml.js +1 -0
  296. package/src/shiki/langs/hy.js +1 -0
  297. package/src/shiki/langs/imba.js +1 -0
  298. package/src/shiki/langs/ini.js +1 -0
  299. package/src/shiki/langs/java.js +1 -0
  300. package/src/shiki/langs/javascript.js +1 -0
  301. package/src/shiki/langs/jinja-html.js +1 -0
  302. package/src/shiki/langs/jinja.js +1 -0
  303. package/src/shiki/langs/jison.js +1 -0
  304. package/src/shiki/langs/json.js +1 -0
  305. package/src/shiki/langs/json5.js +1 -0
  306. package/src/shiki/langs/jsonc.js +1 -0
  307. package/src/shiki/langs/jsonl.js +1 -0
  308. package/src/shiki/langs/jsonnet.js +1 -0
  309. package/src/shiki/langs/jssm.js +1 -0
  310. package/src/shiki/langs/jsx.js +1 -0
  311. package/src/shiki/langs/julia.js +1 -0
  312. package/src/shiki/langs/kotlin.js +1 -0
  313. package/src/shiki/langs/kusto.js +1 -0
  314. package/src/shiki/langs/latex.js +1 -0
  315. package/src/shiki/langs/lean.js +1 -0
  316. package/src/shiki/langs/less.js +1 -0
  317. package/src/shiki/langs/liquid.js +1 -0
  318. package/src/shiki/langs/llvm.js +1 -0
  319. package/src/shiki/langs/log.js +1 -0
  320. package/src/shiki/langs/logo.js +1 -0
  321. package/src/shiki/langs/lua.js +1 -0
  322. package/src/shiki/langs/luau.js +1 -0
  323. package/src/shiki/langs/make.js +1 -0
  324. package/src/shiki/langs/markdown-vue.js +1 -0
  325. package/src/shiki/langs/markdown.js +1 -0
  326. package/src/shiki/langs/marko.js +1 -0
  327. package/src/shiki/langs/matlab.js +1 -0
  328. package/src/shiki/langs/mdc.js +1 -0
  329. package/src/shiki/langs/mdx.js +1 -0
  330. package/src/shiki/langs/mermaid.js +1 -0
  331. package/src/shiki/langs/mipsasm.js +1 -0
  332. package/src/shiki/langs/mojo.js +1 -0
  333. package/src/shiki/langs/move.js +1 -0
  334. package/src/shiki/langs/narrat.js +1 -0
  335. package/src/shiki/langs/nextflow.js +1 -0
  336. package/src/shiki/langs/nginx.js +1 -0
  337. package/src/shiki/langs/nim.js +1 -0
  338. package/src/shiki/langs/nix.js +1 -0
  339. package/src/shiki/langs/nushell.js +1 -0
  340. package/src/shiki/langs/objective-c.js +1 -0
  341. package/src/shiki/langs/objective-cpp.js +1 -0
  342. package/src/shiki/langs/ocaml.js +1 -0
  343. package/src/shiki/langs/pascal.js +1 -0
  344. package/src/shiki/langs/perl.js +1 -0
  345. package/src/shiki/langs/php.js +1 -0
  346. package/src/shiki/langs/plsql.js +1 -0
  347. package/src/shiki/langs/po.js +1 -0
  348. package/src/shiki/langs/polar.js +1 -0
  349. package/src/shiki/langs/postcss.js +1 -0
  350. package/src/shiki/langs/powerquery.js +1 -0
  351. package/src/shiki/langs/powershell.js +1 -0
  352. package/src/shiki/langs/prisma.js +1 -0
  353. package/src/shiki/langs/prolog.js +1 -0
  354. package/src/shiki/langs/proto.js +1 -0
  355. package/src/shiki/langs/pug.js +1 -0
  356. package/src/shiki/langs/puppet.js +1 -0
  357. package/src/shiki/langs/purescript.js +1 -0
  358. package/src/shiki/langs/python.js +1 -0
  359. package/src/shiki/langs/qml.js +1 -0
  360. package/src/shiki/langs/qmldir.js +1 -0
  361. package/src/shiki/langs/qss.js +1 -0
  362. package/src/shiki/langs/r.js +1 -0
  363. package/src/shiki/langs/racket.js +1 -0
  364. package/src/shiki/langs/raku.js +1 -0
  365. package/src/shiki/langs/razor.js +1 -0
  366. package/src/shiki/langs/reg.js +1 -0
  367. package/src/shiki/langs/regexp.js +1 -0
  368. package/src/shiki/langs/rel.js +1 -0
  369. package/src/shiki/langs/riscv.js +1 -0
  370. package/src/shiki/langs/rst.js +1 -0
  371. package/src/shiki/langs/ruby.js +1 -0
  372. package/src/shiki/langs/rust.js +1 -0
  373. package/src/shiki/langs/sas.js +1 -0
  374. package/src/shiki/langs/sass.js +1 -0
  375. package/src/shiki/langs/scala.js +1 -0
  376. package/src/shiki/langs/scheme.js +1 -0
  377. package/src/shiki/langs/scss.js +1 -0
  378. package/src/shiki/langs/sdbl.js +1 -0
  379. package/src/shiki/langs/shaderlab.js +1 -0
  380. package/src/shiki/langs/shellscript.js +1 -0
  381. package/src/shiki/langs/shellsession.js +1 -0
  382. package/src/shiki/langs/smalltalk.js +1 -0
  383. package/src/shiki/langs/solidity.js +1 -0
  384. package/src/shiki/langs/soy.js +1 -0
  385. package/src/shiki/langs/sparql.js +1 -0
  386. package/src/shiki/langs/splunk.js +1 -0
  387. package/src/shiki/langs/sql.js +1 -0
  388. package/src/shiki/langs/ssh-config.js +1 -0
  389. package/src/shiki/langs/stata.js +1 -0
  390. package/src/shiki/langs/stylus.js +1 -0
  391. package/src/shiki/langs/svelte.js +1 -0
  392. package/src/shiki/langs/swift.js +1 -0
  393. package/src/shiki/langs/system-verilog.js +1 -0
  394. package/src/shiki/langs/systemd.js +1 -0
  395. package/src/shiki/langs/talonscript.js +1 -0
  396. package/src/shiki/langs/tasl.js +1 -0
  397. package/src/shiki/langs/tcl.js +1 -0
  398. package/src/shiki/langs/templ.js +1 -0
  399. package/src/shiki/langs/terraform.js +1 -0
  400. package/src/shiki/langs/tex.js +1 -0
  401. package/src/shiki/langs/toml.js +1 -0
  402. package/src/shiki/langs/ts-tags.js +1 -0
  403. package/src/shiki/langs/tsv.js +1 -0
  404. package/src/shiki/langs/tsx.js +1 -0
  405. package/src/shiki/langs/turtle.js +1 -0
  406. package/src/shiki/langs/twig.js +1 -0
  407. package/src/shiki/langs/typescript.js +1 -0
  408. package/src/shiki/langs/typespec.js +1 -0
  409. package/src/shiki/langs/typst.js +1 -0
  410. package/src/shiki/langs/v.js +1 -0
  411. package/src/shiki/langs/vala.js +1 -0
  412. package/src/shiki/langs/vb.js +1 -0
  413. package/src/shiki/langs/verilog.js +1 -0
  414. package/src/shiki/langs/vhdl.js +1 -0
  415. package/src/shiki/langs/viml.js +1 -0
  416. package/src/shiki/langs/vue-directives.js +1 -0
  417. package/src/shiki/langs/vue-html.js +1 -0
  418. package/src/shiki/langs/vue-interpolations.js +1 -0
  419. package/src/shiki/langs/vue-sfc-style-variable-injection.js +1 -0
  420. package/src/shiki/langs/vue.js +1 -0
  421. package/src/shiki/langs/vyper.js +1 -0
  422. package/src/shiki/langs/wasm.js +1 -0
  423. package/src/shiki/langs/wenyan.js +1 -0
  424. package/src/shiki/langs/wgsl.js +1 -0
  425. package/src/shiki/langs/wikitext.js +1 -0
  426. package/src/shiki/langs/wit.js +1 -0
  427. package/src/shiki/langs/wolfram.js +1 -0
  428. package/src/shiki/langs/xml.js +1 -0
  429. package/src/shiki/langs/xsl.js +1 -0
  430. package/src/shiki/langs/yaml.js +1 -0
  431. package/src/shiki/langs/zenscript.js +1 -0
  432. package/src/shiki/langs/zig.js +1 -0
  433. package/src/shiki/themes/andromeeda.js +1 -0
  434. package/src/shiki/themes/aurora-x.js +1 -0
  435. package/src/shiki/themes/ayu-dark.js +1 -0
  436. package/src/shiki/themes/catppuccin-frappe.js +1 -0
  437. package/src/shiki/themes/catppuccin-latte.js +1 -0
  438. package/src/shiki/themes/catppuccin-macchiato.js +1 -0
  439. package/src/shiki/themes/catppuccin-mocha.js +1 -0
  440. package/src/shiki/themes/dark-plus.js +1 -0
  441. package/src/shiki/themes/dracula-soft.js +1 -0
  442. package/src/shiki/themes/dracula.js +1 -0
  443. package/src/shiki/themes/everforest-dark.js +1 -0
  444. package/src/shiki/themes/everforest-light.js +1 -0
  445. package/src/shiki/themes/github-dark-default.js +1 -0
  446. package/src/shiki/themes/github-dark-dimmed.js +1 -0
  447. package/src/shiki/themes/github-dark-high-contrast.js +1 -0
  448. package/src/shiki/themes/github-dark.js +1 -0
  449. package/src/shiki/themes/github-light-default.js +1 -0
  450. package/src/shiki/themes/github-light-high-contrast.js +1 -0
  451. package/src/shiki/themes/github-light.js +1 -0
  452. package/src/shiki/themes/gruvbox-dark-hard.js +1 -0
  453. package/src/shiki/themes/gruvbox-dark-medium.js +1 -0
  454. package/src/shiki/themes/gruvbox-dark-soft.js +1 -0
  455. package/src/shiki/themes/gruvbox-light-hard.js +1 -0
  456. package/src/shiki/themes/gruvbox-light-medium.js +1 -0
  457. package/src/shiki/themes/gruvbox-light-soft.js +1 -0
  458. package/src/shiki/themes/houston.js +1 -0
  459. package/src/shiki/themes/kanagawa-dragon.js +1 -0
  460. package/src/shiki/themes/kanagawa-lotus.js +1 -0
  461. package/src/shiki/themes/kanagawa-wave.js +1 -0
  462. package/src/shiki/themes/laserwave.js +1 -0
  463. package/src/shiki/themes/light-plus.js +1 -0
  464. package/src/shiki/themes/material-theme-darker.js +1 -0
  465. package/src/shiki/themes/material-theme-lighter.js +1 -0
  466. package/src/shiki/themes/material-theme-ocean.js +1 -0
  467. package/src/shiki/themes/material-theme-palenight.js +1 -0
  468. package/src/shiki/themes/material-theme.js +1 -0
  469. package/src/shiki/themes/min-dark.js +1 -0
  470. package/src/shiki/themes/min-light.js +1 -0
  471. package/src/shiki/themes/monokai.js +1 -0
  472. package/src/shiki/themes/night-owl.js +1 -0
  473. package/src/shiki/themes/nord.js +1 -0
  474. package/src/shiki/themes/one-dark-pro.js +1 -0
  475. package/src/shiki/themes/one-light.js +1 -0
  476. package/src/shiki/themes/plastic.js +1 -0
  477. package/src/shiki/themes/poimandres.js +1 -0
  478. package/src/shiki/themes/red.js +1 -0
  479. package/src/shiki/themes/rose-pine-dawn.js +1 -0
  480. package/src/shiki/themes/rose-pine-moon.js +1 -0
  481. package/src/shiki/themes/rose-pine.js +1 -0
  482. package/src/shiki/themes/slack-dark.js +1 -0
  483. package/src/shiki/themes/slack-ochin.js +1 -0
  484. package/src/shiki/themes/snazzy-light.js +1 -0
  485. package/src/shiki/themes/solarized-dark.js +1 -0
  486. package/src/shiki/themes/solarized-light.js +1 -0
  487. package/src/shiki/themes/synthwave-84.js +1 -0
  488. package/src/shiki/themes/tokyo-night.js +1 -0
  489. package/src/shiki/themes/vesper.js +1 -0
  490. package/src/shiki/themes/vitesse-black.js +1 -0
  491. package/src/shiki/themes/vitesse-dark.js +1 -0
  492. package/src/shiki/themes/vitesse-light.js +1 -0
  493. package/lib/AuthenticationPlugin-CJOFRBk3.js +0 -58
  494. package/lib/Markdown-DqDbGCj2.js +0 -17125
  495. package/lib/Markdown-DqDbGCj2.js.map +0 -1
  496. package/lib/MdxPage-OSMru6r8.js +0 -85
  497. package/lib/RouteGuard-BZ_VsiXc.js +0 -744
  498. package/lib/Select-Dg5R11Dx.js +0 -223
  499. package/lib/SlotletProvider-p4XaFFOh.js +0 -340
  500. package/lib/SlotletProvider-p4XaFFOh.js.map +0 -1
  501. package/lib/SyntaxHighlight-CxhyyMkF.js +0 -2890
  502. package/lib/SyntaxHighlight-CxhyyMkF.js.map +0 -1
  503. package/lib/chunk-KNED5TY2-BUPjb3LQ.js.map +0 -1
  504. package/lib/hook-pPrHCB6G.js +0 -1478
  505. package/lib/index-DMYbZ3i6.js +0 -5031
  506. package/lib/index-DMYbZ3i6.js.map +0 -1
  507. package/lib/invariant-Caa8-XvF.js +0 -26
  508. package/lib/mutation-Csa9eQDM.js +0 -211
  509. package/lib/prism-bash.min-HHIMdNJ_.js +0 -7
  510. package/lib/prism-bash.min-HHIMdNJ_.js.map +0 -1
  511. package/lib/prism-csharp.min-C43x1RY2.js +0 -63
  512. package/lib/prism-csharp.min-C43x1RY2.js.map +0 -1
  513. package/lib/prism-java.min-CQzr40NQ.js +0 -35
  514. package/lib/prism-java.min-CQzr40NQ.js.map +0 -1
  515. package/lib/prism-javascript.min-CEqHqgbm.js +0 -9
  516. package/lib/prism-javascript.min-CEqHqgbm.js.map +0 -1
  517. package/lib/prism-json.min-B1GJqK1k.js +0 -2
  518. package/lib/prism-json.min-B1GJqK1k.js.map +0 -1
  519. package/lib/prism-jsstacktrace.min-BfobCF2F.js +0 -2
  520. package/lib/prism-jsstacktrace.min-BfobCF2F.js.map +0 -1
  521. package/lib/prism-markdown.min-C0Qn0m-5.js +0 -61
  522. package/lib/prism-markdown.min-C0Qn0m-5.js.map +0 -1
  523. package/lib/prism-markup-BNGj0Tvm.js +0 -174
  524. package/lib/prism-markup-BNGj0Tvm.js.map +0 -1
  525. package/lib/prism-objectivec.min-BXSWqpJJ.js +0 -2
  526. package/lib/prism-objectivec.min-BXSWqpJJ.js.map +0 -1
  527. package/lib/prism-ruby.min-L9OdQ6tU.js +0 -38
  528. package/lib/prism-ruby.min-L9OdQ6tU.js.map +0 -1
  529. package/lib/prism-typescript.min-qTySPvCh.js +0 -34
  530. package/lib/prism-typescript.min-qTySPvCh.js.map +0 -1
@@ -1,29 +1,26 @@
1
- var Ce = Object.defineProperty;
2
- var Le = (t, e, n) => e in t ? Ce(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var w = (t, e, n) => Le(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { j as B } from "./jsx-runtime-C5mzlN2N.js";
5
- import { g as xe } from "./_commonjsHelpers-B4e78b8K.js";
6
- import { C as Ie } from "./ClientOnly-E7hGysn1.js";
7
- import { d as je, f as ie, u as L } from "./hook-pPrHCB6G.js";
8
- import { A as Je } from "./AuthenticationPlugin-CJOFRBk3.js";
9
- import { N as Oe } from "./chunk-KNED5TY2-BUPjb3LQ.js";
10
- import { Z as ze } from "./invariant-Caa8-XvF.js";
11
- var D = { exports: {} }, De = D.exports, ae;
12
- function Ne() {
13
- return ae || (ae = 1, function(t) {
1
+ import { j as M } from "./jsx-runtime-C5mzlN2N.js";
2
+ import { g as Re } from "./_commonjsHelpers-B4e78b8K.js";
3
+ import { C as Pe } from "./ClientOnly-E7hGysn1.js";
4
+ import { d as Ue, f as re, u as C } from "./hook-CyNmcNr8.js";
5
+ import { A as Ce } from "./AuthenticationPlugin-EeQpQI3D.js";
6
+ import { N as Le } from "./chunk-BAXFHI7N-CFrZQ7Oh.js";
7
+ import { Z as xe } from "./invariant-D3QcI9fa.js";
8
+ var O = { exports: {} }, Ie = O.exports, oe;
9
+ function je() {
10
+ return oe || (oe = 1, function(t) {
14
11
  (function(e, n) {
15
12
  t.exports ? t.exports = n() : e.log = n();
16
- })(De, function() {
13
+ })(Ie, function() {
17
14
  var e = function() {
18
- }, n = "undefined", o = typeof window !== n && typeof window.navigator !== n && /Trident\/|MSIE /.test(window.navigator.userAgent), a = [
15
+ }, n = "undefined", o = typeof window !== n && typeof window.navigator !== n && /Trident\/|MSIE /.test(window.navigator.userAgent), s = [
19
16
  "trace",
20
17
  "debug",
21
18
  "info",
22
19
  "warn",
23
20
  "error"
24
21
  ], r = {}, i = null;
25
- function c(l, m) {
26
- var u = l[m];
22
+ function c(l, g) {
23
+ var u = l[g];
27
24
  if (typeof u.bind == "function")
28
25
  return u.bind(l);
29
26
  try {
@@ -37,76 +34,76 @@ function Ne() {
37
34
  function p() {
38
35
  console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace();
39
36
  }
40
- function _(l) {
37
+ function y(l) {
41
38
  return l === "debug" && (l = "log"), typeof console === n ? !1 : l === "trace" && o ? p : console[l] !== void 0 ? c(console, l) : console.log !== void 0 ? c(console, "log") : e;
42
39
  }
43
40
  function f() {
44
- for (var l = this.getLevel(), m = 0; m < a.length; m++) {
45
- var u = a[m];
46
- this[u] = m < l ? e : this.methodFactory(u, l, this.name);
41
+ for (var l = this.getLevel(), g = 0; g < s.length; g++) {
42
+ var u = s[g];
43
+ this[u] = g < l ? e : this.methodFactory(u, l, this.name);
47
44
  }
48
45
  if (this.log = this.debug, typeof console === n && l < this.levels.SILENT)
49
46
  return "No console available for logging";
50
47
  }
51
- function v(l) {
48
+ function k(l) {
52
49
  return function() {
53
50
  typeof console !== n && (f.call(this), this[l].apply(this, arguments));
54
51
  };
55
52
  }
56
- function b(l, m, u) {
57
- return _(l) || v.apply(this, arguments);
53
+ function b(l, g, u) {
54
+ return y(l) || k.apply(this, arguments);
58
55
  }
59
- function d(l, m) {
60
- var u = this, J, $, U, S = "loglevel";
61
- typeof l == "string" ? S += ":" + l : typeof l == "symbol" && (S = void 0);
62
- function Re(h) {
63
- var y = (a[h] || "silent").toUpperCase();
64
- if (!(typeof window === n || !S)) {
56
+ function d(l, g) {
57
+ var u = this, j, K, P, _ = "loglevel";
58
+ typeof l == "string" ? _ += ":" + l : typeof l == "symbol" && (_ = void 0);
59
+ function ke(h) {
60
+ var m = (s[h] || "silent").toUpperCase();
61
+ if (!(typeof window === n || !_)) {
65
62
  try {
66
- window.localStorage[S] = y;
63
+ window.localStorage[_] = m;
67
64
  return;
68
65
  } catch {
69
66
  }
70
67
  try {
71
- window.document.cookie = encodeURIComponent(S) + "=" + y + ";";
68
+ window.document.cookie = encodeURIComponent(_) + "=" + m + ";";
72
69
  } catch {
73
70
  }
74
71
  }
75
72
  }
76
- function ne() {
73
+ function ee() {
77
74
  var h;
78
- if (!(typeof window === n || !S)) {
75
+ if (!(typeof window === n || !_)) {
79
76
  try {
80
- h = window.localStorage[S];
77
+ h = window.localStorage[_];
81
78
  } catch {
82
79
  }
83
80
  if (typeof h === n)
84
81
  try {
85
- var y = window.document.cookie, O = encodeURIComponent(S), oe = y.indexOf(O + "=");
86
- oe !== -1 && (h = /^([^;]+)/.exec(
87
- y.slice(oe + O.length + 1)
82
+ var m = window.document.cookie, J = encodeURIComponent(_), ne = m.indexOf(J + "=");
83
+ ne !== -1 && (h = /^([^;]+)/.exec(
84
+ m.slice(ne + J.length + 1)
88
85
  )[1]);
89
86
  } catch {
90
87
  }
91
88
  return u.levels[h] === void 0 && (h = void 0), h;
92
89
  }
93
90
  }
94
- function Pe() {
95
- if (!(typeof window === n || !S)) {
91
+ function Ae() {
92
+ if (!(typeof window === n || !_)) {
96
93
  try {
97
- window.localStorage.removeItem(S);
94
+ window.localStorage.removeItem(_);
98
95
  } catch {
99
96
  }
100
97
  try {
101
- window.document.cookie = encodeURIComponent(S) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
98
+ window.document.cookie = encodeURIComponent(_) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
102
99
  } catch {
103
100
  }
104
101
  }
105
102
  }
106
- function C(h) {
107
- var y = h;
108
- if (typeof y == "string" && u.levels[y.toUpperCase()] !== void 0 && (y = u.levels[y.toUpperCase()]), typeof y == "number" && y >= 0 && y <= u.levels.SILENT)
109
- return y;
103
+ function U(h) {
104
+ var m = h;
105
+ if (typeof m == "string" && u.levels[m.toUpperCase()] !== void 0 && (m = u.levels[m.toUpperCase()]), typeof m == "number" && m >= 0 && m <= u.levels.SILENT)
106
+ return m;
110
107
  throw new TypeError("log.setLevel() called with invalid level: " + h);
111
108
  }
112
109
  u.name = l, u.levels = {
@@ -116,52 +113,51 @@ function Ne() {
116
113
  WARN: 3,
117
114
  ERROR: 4,
118
115
  SILENT: 5
119
- }, u.methodFactory = m || b, u.getLevel = function() {
120
- return U ?? $ ?? J;
121
- }, u.setLevel = function(h, y) {
122
- return U = C(h), y !== !1 && Re(U), f.call(u);
116
+ }, u.methodFactory = g || b, u.getLevel = function() {
117
+ return P ?? K ?? j;
118
+ }, u.setLevel = function(h, m) {
119
+ return P = U(h), m !== !1 && ke(P), f.call(u);
123
120
  }, u.setDefaultLevel = function(h) {
124
- $ = C(h), ne() || u.setLevel(h, !1);
121
+ K = U(h), ee() || u.setLevel(h, !1);
125
122
  }, u.resetLevel = function() {
126
- U = null, Pe(), f.call(u);
123
+ P = null, Ae(), f.call(u);
127
124
  }, u.enableAll = function(h) {
128
125
  u.setLevel(u.levels.TRACE, h);
129
126
  }, u.disableAll = function(h) {
130
127
  u.setLevel(u.levels.SILENT, h);
131
128
  }, u.rebuild = function() {
132
- if (i !== u && (J = C(i.getLevel())), f.call(u), i === u)
129
+ if (i !== u && (j = U(i.getLevel())), f.call(u), i === u)
133
130
  for (var h in r)
134
131
  r[h].rebuild();
135
- }, J = C(
132
+ }, j = U(
136
133
  i ? i.getLevel() : "WARN"
137
134
  );
138
- var re = ne();
139
- re != null && (U = C(re)), f.call(u);
135
+ var te = ee();
136
+ te != null && (P = U(te)), f.call(u);
140
137
  }
141
- i = new d(), i.getLogger = function(m) {
142
- if (typeof m != "symbol" && typeof m != "string" || m === "")
138
+ i = new d(), i.getLogger = function(g) {
139
+ if (typeof g != "symbol" && typeof g != "string" || g === "")
143
140
  throw new TypeError("You must supply a name when creating a logger.");
144
- var u = r[m];
145
- return u || (u = r[m] = new d(
146
- m,
141
+ var u = r[g];
142
+ return u || (u = r[g] = new d(
143
+ g,
147
144
  i.methodFactory
148
145
  )), u;
149
146
  };
150
- var P = typeof window !== n ? window.log : void 0;
147
+ var R = typeof window !== n ? window.log : void 0;
151
148
  return i.noConflict = function() {
152
- return typeof window !== n && window.log === i && (window.log = P), i;
149
+ return typeof window !== n && window.log === i && (window.log = R), i;
153
150
  }, i.getLoggers = function() {
154
151
  return r;
155
152
  }, i.default = i, i;
156
153
  });
157
- }(D)), D.exports;
158
- }
159
- var We = Ne();
160
- const se = /* @__PURE__ */ xe(We);
161
- let V;
162
- var z, we;
163
- (typeof navigator > "u" || !((we = (z = navigator.userAgent) == null ? void 0 : z.startsWith) != null && we.call(z, "Mozilla/5.0 "))) && (V = "oauth4webapi/v2.17.0");
164
- function Y(t, e) {
154
+ }(O)), O.exports;
155
+ }
156
+ var Je = je();
157
+ const ie = /* @__PURE__ */ Re(Je);
158
+ let q;
159
+ (typeof navigator > "u" || !navigator.userAgent?.startsWith?.("Mozilla/5.0 ")) && (q = "oauth4webapi/v2.17.0");
160
+ function V(t, e) {
165
161
  if (t == null)
166
162
  return !1;
167
163
  try {
@@ -170,32 +166,32 @@ function Y(t, e) {
170
166
  return !1;
171
167
  }
172
168
  }
173
- const W = Symbol(), Ke = Symbol(), Z = Symbol(), He = Symbol(), $e = Symbol(), Fe = Symbol(), Me = new TextEncoder(), qe = new TextDecoder();
174
- function E(t) {
175
- return typeof t == "string" ? Me.encode(t) : qe.decode(t);
169
+ const D = Symbol(), Oe = Symbol(), G = Symbol(), ze = Symbol(), De = Symbol(), Ne = Symbol(), We = new TextEncoder(), Ke = new TextDecoder();
170
+ function A(t) {
171
+ return typeof t == "string" ? We.encode(t) : Ke.decode(t);
176
172
  }
177
- const ce = 32768;
178
- function Be(t) {
173
+ const se = 32768;
174
+ function He(t) {
179
175
  t instanceof ArrayBuffer && (t = new Uint8Array(t));
180
176
  const e = [];
181
- for (let n = 0; n < t.byteLength; n += ce)
182
- e.push(String.fromCharCode.apply(null, t.subarray(n, n + ce)));
177
+ for (let n = 0; n < t.byteLength; n += se)
178
+ e.push(String.fromCharCode.apply(null, t.subarray(n, n + se)));
183
179
  return btoa(e.join("")).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
184
180
  }
185
- function Ve(t) {
181
+ function $e(t) {
186
182
  try {
187
183
  const e = atob(t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "")), n = new Uint8Array(e.length);
188
184
  for (let o = 0; o < e.length; o++)
189
185
  n[o] = e.charCodeAt(o);
190
186
  return n;
191
187
  } catch (e) {
192
- throw new s("The input to be decoded is not correctly encoded.", { cause: e });
188
+ throw new a("The input to be decoded is not correctly encoded.", { cause: e });
193
189
  }
194
190
  }
195
- function A(t) {
196
- return typeof t == "string" ? Ve(t) : Be(t);
191
+ function T(t) {
192
+ return typeof t == "string" ? $e(t) : He(t);
197
193
  }
198
- class Ge {
194
+ class Fe {
199
195
  constructor(e) {
200
196
  this.cache = /* @__PURE__ */ new Map(), this._cache = /* @__PURE__ */ new Map(), this.maxSize = e;
201
197
  }
@@ -219,60 +215,58 @@ class Ge {
219
215
  this.cache.set(e, n), this.cache.size >= this.maxSize && (this._cache = this.cache, this.cache = /* @__PURE__ */ new Map());
220
216
  }
221
217
  }
222
- class T extends Error {
218
+ class v extends Error {
223
219
  constructor(e) {
224
- var n;
225
- super(e ?? "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, Error.captureStackTrace?.(this, this.constructor);
226
221
  }
227
222
  }
228
- class Ye extends Error {
223
+ class Me extends Error {
229
224
  constructor(e, n) {
230
- var o;
231
- super(e, n), this.name = this.constructor.name, (o = Error.captureStackTrace) == null || o.call(Error, this, this.constructor);
225
+ super(e, n), this.name = this.constructor.name, Error.captureStackTrace?.(this, this.constructor);
232
226
  }
233
227
  }
234
- const s = Ye, ge = new Ge(100);
235
- function me(t) {
228
+ const a = Me, fe = new Fe(100);
229
+ function pe(t) {
236
230
  return t instanceof CryptoKey;
237
231
  }
238
- function Ze(t) {
239
- return me(t) && t.type === "private";
232
+ function qe(t) {
233
+ return pe(t) && t.type === "private";
240
234
  }
241
- function Qe(t) {
242
- return me(t) && t.type === "public";
235
+ function Be(t) {
236
+ return pe(t) && t.type === "public";
243
237
  }
244
- function Q(t) {
238
+ function Y(t) {
245
239
  try {
246
240
  const e = t.headers.get("dpop-nonce");
247
- e && ge.set(new URL(t.url).origin, e);
241
+ e && fe.set(new URL(t.url).origin, e);
248
242
  } catch {
249
243
  }
250
244
  return t;
251
245
  }
252
- function x(t) {
246
+ function L(t) {
253
247
  return !(t === null || typeof t != "object" || Array.isArray(t));
254
248
  }
255
- function K(t) {
256
- Y(t, Headers) && (t = Object.fromEntries(t.entries()));
249
+ function N(t) {
250
+ V(t, Headers) && (t = Object.fromEntries(t.entries()));
257
251
  const e = new Headers(t);
258
- if (V && !e.has("user-agent") && e.set("user-agent", V), e.has("authorization"))
252
+ if (q && !e.has("user-agent") && e.set("user-agent", q), e.has("authorization"))
259
253
  throw new TypeError('"options.headers" must not include the "authorization" header name');
260
254
  if (e.has("dpop"))
261
255
  throw new TypeError('"options.headers" must not include the "dpop" header name');
262
256
  return e;
263
257
  }
264
- function Xe(t) {
258
+ function Ve(t) {
265
259
  if (typeof t == "function" && (t = t()), !(t instanceof AbortSignal))
266
260
  throw new TypeError('"options.signal" must return or be an instance of AbortSignal');
267
261
  return t;
268
262
  }
269
- async function et(t, e) {
263
+ async function Ge(t, e) {
270
264
  if (!(t instanceof URL))
271
265
  throw new TypeError('"issuerIdentifier" must be an instance of URL');
272
266
  if (t.protocol !== "https:" && t.protocol !== "http:")
273
267
  throw new TypeError('"issuer.protocol" must be "https:" or "http:"');
274
268
  const n = new URL(t.href);
275
- switch (e == null ? void 0 : e.algorithm) {
269
+ switch (e?.algorithm) {
276
270
  case void 0:
277
271
  case "oidc":
278
272
  n.pathname = `${n.pathname}/.well-known/openid-configuration`.replace("//", "/");
@@ -283,61 +277,61 @@ async function et(t, e) {
283
277
  default:
284
278
  throw new TypeError('"options.algorithm" must be "oidc" (default), or "oauth2"');
285
279
  }
286
- const o = K(e == null ? void 0 : e.headers);
287
- return o.set("accept", "application/json"), ((e == null ? void 0 : e[Z]) || fetch)(n.href, {
280
+ const o = N(e?.headers);
281
+ return o.set("accept", "application/json"), (e?.[G] || fetch)(n.href, {
288
282
  headers: Object.fromEntries(o.entries()),
289
283
  method: "GET",
290
284
  redirect: "manual",
291
285
  signal: null
292
- }).then(Q);
286
+ }).then(Y);
293
287
  }
294
- function g(t) {
288
+ function w(t) {
295
289
  return typeof t == "string" && t.length !== 0;
296
290
  }
297
- async function tt(t, e) {
291
+ async function Ye(t, e) {
298
292
  if (!(t instanceof URL))
299
293
  throw new TypeError('"expectedIssuer" must be an instance of URL');
300
- if (!Y(e, Response))
294
+ if (!V(e, Response))
301
295
  throw new TypeError('"response" must be an instance of Response');
302
296
  if (e.status !== 200)
303
- throw new s('"response" is not a conform Authorization Server Metadata response');
304
- te(e);
297
+ throw new a('"response" is not a conform Authorization Server Metadata response');
298
+ X(e);
305
299
  let n;
306
300
  try {
307
301
  n = await e.json();
308
302
  } catch (o) {
309
- throw new s('failed to parse "response" body as JSON', { cause: o });
303
+ throw new a('failed to parse "response" body as JSON', { cause: o });
310
304
  }
311
- if (!x(n))
312
- throw new s('"response" body must be a top level object');
313
- if (!g(n.issuer))
314
- throw new s('"response" body "issuer" property must be a non-empty string');
305
+ if (!L(n))
306
+ throw new a('"response" body must be a top level object');
307
+ if (!w(n.issuer))
308
+ throw new a('"response" body "issuer" property must be a non-empty string');
315
309
  if (new URL(n.issuer).href !== t.href)
316
- throw new s('"response" body "issuer" does not match "expectedIssuer"');
310
+ throw new a('"response" body "issuer" does not match "expectedIssuer"');
317
311
  return n;
318
312
  }
319
- function X() {
320
- return A(crypto.getRandomValues(new Uint8Array(32)));
313
+ function Z() {
314
+ return T(crypto.getRandomValues(new Uint8Array(32)));
321
315
  }
322
- function nt() {
323
- return X();
316
+ function Ze() {
317
+ return Z();
324
318
  }
325
- function rt() {
326
- return X();
319
+ function Qe() {
320
+ return Z();
327
321
  }
328
- async function ot(t) {
329
- if (!g(t))
322
+ async function Xe(t) {
323
+ if (!w(t))
330
324
  throw new TypeError('"codeVerifier" must be a non-empty string');
331
- return A(await crypto.subtle.digest("SHA-256", E(t)));
325
+ return T(await crypto.subtle.digest("SHA-256", A(t)));
332
326
  }
333
- function ue(t) {
327
+ function ae(t) {
334
328
  return encodeURIComponent(t).replace(/%20/g, "+");
335
329
  }
336
- function it(t, e) {
337
- const n = ue(t), o = ue(e);
330
+ function et(t, e) {
331
+ const n = ae(t), o = ae(e);
338
332
  return `Basic ${btoa(`${n}:${o}`)}`;
339
333
  }
340
- function at(t) {
334
+ function tt(t) {
341
335
  switch (t.algorithm.hash.name) {
342
336
  case "SHA-256":
343
337
  return "PS256";
@@ -346,10 +340,10 @@ function at(t) {
346
340
  case "SHA-512":
347
341
  return "PS512";
348
342
  default:
349
- throw new T("unsupported RsaHashedKeyAlgorithm hash name");
343
+ throw new v("unsupported RsaHashedKeyAlgorithm hash name");
350
344
  }
351
345
  }
352
- function st(t) {
346
+ function nt(t) {
353
347
  switch (t.algorithm.hash.name) {
354
348
  case "SHA-256":
355
349
  return "RS256";
@@ -358,10 +352,10 @@ function st(t) {
358
352
  case "SHA-512":
359
353
  return "RS512";
360
354
  default:
361
- throw new T("unsupported RsaHashedKeyAlgorithm hash name");
355
+ throw new v("unsupported RsaHashedKeyAlgorithm hash name");
362
356
  }
363
357
  }
364
- function ct(t) {
358
+ function rt(t) {
365
359
  switch (t.algorithm.namedCurve) {
366
360
  case "P-256":
367
361
  return "ES256";
@@ -370,268 +364,267 @@ function ct(t) {
370
364
  case "P-521":
371
365
  return "ES512";
372
366
  default:
373
- throw new T("unsupported EcKeyAlgorithm namedCurve");
367
+ throw new v("unsupported EcKeyAlgorithm namedCurve");
374
368
  }
375
369
  }
376
- function ut(t) {
370
+ function ot(t) {
377
371
  switch (t.algorithm.name) {
378
372
  case "RSA-PSS":
379
- return at(t);
373
+ return tt(t);
380
374
  case "RSASSA-PKCS1-v1_5":
381
- return st(t);
375
+ return nt(t);
382
376
  case "ECDSA":
383
- return ct(t);
377
+ return rt(t);
384
378
  case "Ed25519":
385
379
  case "Ed448":
386
380
  return "EdDSA";
387
381
  default:
388
- throw new T("unsupported CryptoKey algorithm name");
382
+ throw new v("unsupported CryptoKey algorithm name");
389
383
  }
390
384
  }
391
- function H(t) {
392
- const e = t == null ? void 0 : t[W];
385
+ function W(t) {
386
+ const e = t?.[D];
393
387
  return typeof e == "number" && Number.isFinite(e) ? e : 0;
394
388
  }
395
- function ye(t) {
396
- const e = t == null ? void 0 : t[Ke];
389
+ function we(t) {
390
+ const e = t?.[Oe];
397
391
  return typeof e == "number" && Number.isFinite(e) && Math.sign(e) !== -1 ? e : 30;
398
392
  }
399
- function ee() {
393
+ function Q() {
400
394
  return Math.floor(Date.now() / 1e3);
401
395
  }
402
- function I(t) {
396
+ function x(t) {
403
397
  if (typeof t != "object" || t === null)
404
398
  throw new TypeError('"as" must be an object');
405
- if (!g(t.issuer))
399
+ if (!w(t.issuer))
406
400
  throw new TypeError('"as.issuer" property must be a non-empty string');
407
401
  return !0;
408
402
  }
409
- function j(t) {
403
+ function I(t) {
410
404
  if (typeof t != "object" || t === null)
411
405
  throw new TypeError('"client" must be an object');
412
- if (!g(t.client_id))
406
+ if (!w(t.client_id))
413
407
  throw new TypeError('"client.client_id" property must be a non-empty string');
414
408
  return !0;
415
409
  }
416
- function le(t) {
417
- if (!g(t))
410
+ function ce(t) {
411
+ if (!w(t))
418
412
  throw new TypeError('"client.client_secret" property must be a non-empty string');
419
413
  return t;
420
414
  }
421
- function he(t, e) {
415
+ function ue(t, e) {
422
416
  if (e !== void 0)
423
417
  throw new TypeError(`"client.client_secret" property must not be provided when ${t} client authentication method is used.`);
424
418
  }
425
- async function lt(t, e, n, o, a) {
419
+ async function it(t, e, n, o, s) {
426
420
  switch (n.delete("client_secret"), n.delete("client_assertion_type"), n.delete("client_assertion"), e.token_endpoint_auth_method) {
427
421
  case void 0:
428
422
  case "client_secret_basic": {
429
- o.set("authorization", it(e.client_id, le(e.client_secret)));
423
+ o.set("authorization", et(e.client_id, ce(e.client_secret)));
430
424
  break;
431
425
  }
432
426
  case "client_secret_post": {
433
- n.set("client_id", e.client_id), n.set("client_secret", le(e.client_secret));
427
+ n.set("client_id", e.client_id), n.set("client_secret", ce(e.client_secret));
434
428
  break;
435
429
  }
436
430
  case "private_key_jwt":
437
- throw he("private_key_jwt", e.client_secret), new TypeError('"options.clientPrivateKey" must be provided when "client.token_endpoint_auth_method" is "private_key_jwt"');
431
+ throw ue("private_key_jwt", e.client_secret), new TypeError('"options.clientPrivateKey" must be provided when "client.token_endpoint_auth_method" is "private_key_jwt"');
438
432
  case "tls_client_auth":
439
433
  case "self_signed_tls_client_auth":
440
434
  case "none": {
441
- he(e.token_endpoint_auth_method, e.client_secret), e.token_endpoint_auth_method, n.set("client_id", e.client_id);
435
+ ue(e.token_endpoint_auth_method, e.client_secret), e.token_endpoint_auth_method, n.set("client_id", e.client_id);
442
436
  break;
443
437
  }
444
438
  default:
445
- throw new T("unsupported client token_endpoint_auth_method");
439
+ throw new v("unsupported client token_endpoint_auth_method");
446
440
  }
447
441
  }
448
- async function ht(t, e, n) {
442
+ async function st(t, e, n) {
449
443
  if (!n.usages.includes("sign"))
450
444
  throw new TypeError('CryptoKey instances used for signing assertions must include "sign" in their "usages"');
451
- const o = `${A(E(JSON.stringify(t)))}.${A(E(JSON.stringify(e)))}`, a = A(await crypto.subtle.sign(Ae(n), n, E(o)));
452
- return `${o}.${a}`;
445
+ const o = `${T(A(JSON.stringify(t)))}.${T(A(JSON.stringify(e)))}`, s = T(await crypto.subtle.sign(Se(n), n, A(o)));
446
+ return `${o}.${s}`;
453
447
  }
454
- async function dt(t, e, n, o, a, r) {
455
- var b;
456
- const { privateKey: i, publicKey: c, nonce: p = ge.get(n.origin) } = e;
457
- if (!Ze(i))
448
+ async function at(t, e, n, o, s, r) {
449
+ const { privateKey: i, publicKey: c, nonce: p = fe.get(n.origin) } = e;
450
+ if (!qe(i))
458
451
  throw new TypeError('"DPoP.privateKey" must be a private CryptoKey');
459
- if (!Qe(c))
452
+ if (!Be(c))
460
453
  throw new TypeError('"DPoP.publicKey" must be a public CryptoKey');
461
- if (p !== void 0 && !g(p))
454
+ if (p !== void 0 && !w(p))
462
455
  throw new TypeError('"DPoP.nonce" must be a non-empty string or undefined');
463
456
  if (!c.extractable)
464
457
  throw new TypeError('"DPoP.publicKey.extractable" must be true');
465
- const _ = ee() + a, f = {
466
- alg: ut(i),
458
+ const y = Q() + s, f = {
459
+ alg: ot(i),
467
460
  typ: "dpop+jwt",
468
- jwk: await pt(c)
469
- }, v = {
470
- iat: _,
471
- jti: X(),
461
+ jwk: await ut(c)
462
+ }, k = {
463
+ iat: y,
464
+ jti: Z(),
472
465
  htm: o,
473
466
  nonce: p,
474
467
  htu: `${n.origin}${n.pathname}`,
475
- ath: r ? A(await crypto.subtle.digest("SHA-256", E(r))) : void 0
468
+ ath: r ? T(await crypto.subtle.digest("SHA-256", A(r))) : void 0
476
469
  };
477
- (b = e[He]) == null || b.call(e, f, v), t.set("dpop", await ht(f, v, i));
470
+ e[ze]?.(f, k), t.set("dpop", await st(f, k, i));
478
471
  }
479
- let N;
480
- async function ft(t) {
481
- const { kty: e, e: n, n: o, x: a, y: r, crv: i } = await crypto.subtle.exportKey("jwk", t), c = { kty: e, e: n, n: o, x: a, y: r, crv: i };
482
- return N.set(t, c), c;
472
+ let z;
473
+ async function ct(t) {
474
+ const { kty: e, e: n, n: o, x: s, y: r, crv: i } = await crypto.subtle.exportKey("jwk", t), c = { kty: e, e: n, n: o, x: s, y: r, crv: i };
475
+ return z.set(t, c), c;
483
476
  }
484
- async function pt(t) {
485
- return N || (N = /* @__PURE__ */ new WeakMap()), N.get(t) || ft(t);
477
+ async function ut(t) {
478
+ return z || (z = /* @__PURE__ */ new WeakMap()), z.get(t) || ct(t);
486
479
  }
487
- function de(t, e, n) {
480
+ function le(t, e, n) {
488
481
  if (typeof t != "string")
489
482
  throw n ? new TypeError(`"as.mtls_endpoint_aliases.${e}" must be a string`) : new TypeError(`"as.${e}" must be a string`);
490
483
  return new URL(t);
491
484
  }
492
- function be(t, e, n = !1) {
493
- return n && t.mtls_endpoint_aliases && e in t.mtls_endpoint_aliases ? de(t.mtls_endpoint_aliases[e], e, n) : de(t[e], e, n);
485
+ function ge(t, e, n = !1) {
486
+ return n && t.mtls_endpoint_aliases && e in t.mtls_endpoint_aliases ? le(t.mtls_endpoint_aliases[e], e, n) : le(t[e], e, n);
494
487
  }
495
- function _e(t, e) {
496
- return !!(t.use_mtls_endpoint_aliases || e != null && e[Fe]);
488
+ function me(t, e) {
489
+ return !!(t.use_mtls_endpoint_aliases || e?.[Ne]);
497
490
  }
498
- function G(t) {
491
+ function B(t) {
499
492
  const e = t;
500
493
  return typeof e != "object" || Array.isArray(e) || e === null ? !1 : e.error !== void 0;
501
494
  }
502
- async function wt(t, e, n, o, a, r) {
503
- if (!g(t))
495
+ async function lt(t, e, n, o, s, r) {
496
+ if (!w(t))
504
497
  throw new TypeError('"accessToken" must be a non-empty string');
505
498
  if (!(n instanceof URL))
506
499
  throw new TypeError('"url" must be an instance of URL');
507
- return o = K(o), (r == null ? void 0 : r.DPoP) === void 0 ? o.set("authorization", `Bearer ${t}`) : (await dt(o, r.DPoP, n, e.toUpperCase(), H({ [W]: r == null ? void 0 : r[W] }), t), o.set("authorization", `DPoP ${t}`)), ((r == null ? void 0 : r[Z]) || fetch)(n.href, {
508
- body: a,
500
+ return o = N(o), r?.DPoP === void 0 ? o.set("authorization", `Bearer ${t}`) : (await at(o, r.DPoP, n, e.toUpperCase(), W({ [D]: r?.[D] }), t), o.set("authorization", `DPoP ${t}`)), (r?.[G] || fetch)(n.href, {
501
+ body: s,
509
502
  headers: Object.fromEntries(o.entries()),
510
503
  method: e,
511
504
  redirect: "manual",
512
- signal: r != null && r.signal ? Xe(r.signal) : null
513
- }).then(Q);
505
+ signal: r?.signal ? Ve(r.signal) : null
506
+ }).then(Y);
514
507
  }
515
- async function gt(t, e, n, o) {
516
- I(t), j(e);
517
- const a = be(t, "userinfo_endpoint", _e(e, o)), r = K(o == null ? void 0 : o.headers);
518
- return e.userinfo_signed_response_alg ? r.set("accept", "application/jwt") : (r.set("accept", "application/json"), r.append("accept", "application/jwt")), wt(n, "GET", a, r, null, {
508
+ async function ht(t, e, n, o) {
509
+ x(t), I(e);
510
+ const s = ge(t, "userinfo_endpoint", me(e, o)), r = N(o?.headers);
511
+ return e.userinfo_signed_response_alg ? r.set("accept", "application/jwt") : (r.set("accept", "application/json"), r.append("accept", "application/jwt")), lt(n, "GET", s, r, null, {
519
512
  ...o,
520
- [W]: H(e)
513
+ [D]: W(e)
521
514
  });
522
515
  }
523
- async function mt(t, e, n, o, a, r, i) {
524
- return await lt(t, e, a, r), r.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"), ((i == null ? void 0 : i[Z]) || fetch)(o.href, {
525
- body: a,
516
+ async function dt(t, e, n, o, s, r, i) {
517
+ return await it(t, e, s, r), r.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"), (i?.[G] || fetch)(o.href, {
518
+ body: s,
526
519
  headers: Object.fromEntries(r.entries()),
527
520
  method: n,
528
521
  redirect: "manual",
529
522
  signal: null
530
- }).then(Q);
523
+ }).then(Y);
531
524
  }
532
- async function ve(t, e, n, o, a) {
533
- const r = be(t, "token_endpoint", _e(e, a));
525
+ async function ye(t, e, n, o, s) {
526
+ const r = ge(t, "token_endpoint", me(e, s));
534
527
  o.set("grant_type", n);
535
- const i = K(a == null ? void 0 : a.headers);
536
- return i.set("accept", "application/json"), mt(t, e, "POST", r, o, i, a);
528
+ const i = N(s?.headers);
529
+ return i.set("accept", "application/json"), dt(t, e, "POST", r, o, i, s);
537
530
  }
538
- async function yt(t, e, n, o) {
539
- if (I(t), j(e), !g(n))
531
+ async function ft(t, e, n, o) {
532
+ if (x(t), I(e), !w(n))
540
533
  throw new TypeError('"refreshToken" must be a non-empty string');
541
- const a = new URLSearchParams(o == null ? void 0 : o.additionalParameters);
542
- return a.set("refresh_token", n), ve(t, e, "refresh_token", a, o);
534
+ const s = new URLSearchParams(o?.additionalParameters);
535
+ return s.set("refresh_token", n), ye(t, e, "refresh_token", s, o);
543
536
  }
544
- const Se = /* @__PURE__ */ new WeakMap();
545
- function bt(t) {
537
+ const be = /* @__PURE__ */ new WeakMap();
538
+ function pt(t) {
546
539
  if (!t.id_token)
547
540
  return;
548
- const e = Se.get(t);
541
+ const e = be.get(t);
549
542
  if (!e)
550
543
  throw new TypeError('"ref" was already garbage collected or did not resolve from the proper sources');
551
544
  return e[0];
552
545
  }
553
- async function Te(t, e, n, o = !1, a = !1) {
554
- if (I(t), j(e), !Y(n, Response))
546
+ async function _e(t, e, n, o = !1, s = !1) {
547
+ if (x(t), I(e), !V(n, Response))
555
548
  throw new TypeError('"response" must be an instance of Response');
556
549
  if (n.status !== 200) {
557
550
  let i;
558
- if (i = await Ut(n))
551
+ if (i = await kt(n))
559
552
  return i;
560
- throw new s('"response" is not a conform Token Endpoint response');
553
+ throw new a('"response" is not a conform Token Endpoint response');
561
554
  }
562
- te(n);
555
+ X(n);
563
556
  let r;
564
557
  try {
565
558
  r = await n.json();
566
559
  } catch (i) {
567
- throw new s('failed to parse "response" body as JSON', { cause: i });
560
+ throw new a('failed to parse "response" body as JSON', { cause: i });
568
561
  }
569
- if (!x(r))
570
- throw new s('"response" body must be a top level object');
571
- if (!g(r.access_token))
572
- throw new s('"response" body "access_token" property must be a non-empty string');
573
- if (!g(r.token_type))
574
- throw new s('"response" body "token_type" property must be a non-empty string');
562
+ if (!L(r))
563
+ throw new a('"response" body must be a top level object');
564
+ if (!w(r.access_token))
565
+ throw new a('"response" body "access_token" property must be a non-empty string');
566
+ if (!w(r.token_type))
567
+ throw new a('"response" body "token_type" property must be a non-empty string');
575
568
  if (r.token_type = r.token_type.toLowerCase(), r.token_type !== "dpop" && r.token_type !== "bearer")
576
- throw new T("unsupported `token_type` value");
569
+ throw new v("unsupported `token_type` value");
577
570
  if (r.expires_in !== void 0 && (typeof r.expires_in != "number" || r.expires_in <= 0))
578
- throw new s('"response" body "expires_in" property must be a positive number');
579
- if (!a && r.refresh_token !== void 0 && !g(r.refresh_token))
580
- throw new s('"response" body "refresh_token" property must be a non-empty string');
571
+ throw new a('"response" body "expires_in" property must be a positive number');
572
+ if (!s && r.refresh_token !== void 0 && !w(r.refresh_token))
573
+ throw new a('"response" body "refresh_token" property must be a non-empty string');
581
574
  if (r.scope !== void 0 && typeof r.scope != "string")
582
- throw new s('"response" body "scope" property must be a string');
575
+ throw new a('"response" body "scope" property must be a string');
583
576
  if (!o) {
584
- if (r.id_token !== void 0 && !g(r.id_token))
585
- throw new s('"response" body "id_token" property must be a non-empty string');
577
+ if (r.id_token !== void 0 && !w(r.id_token))
578
+ throw new a('"response" body "id_token" property must be a non-empty string');
586
579
  if (r.id_token) {
587
- const { claims: i, jwt: c } = await xt(r.id_token, It.bind(void 0, e.id_token_signed_response_alg, t.id_token_signing_alg_values_supported), Ee, H(e), ye(e), e[$e]).then(Et.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(St.bind(void 0, t.issuer)).then(vt.bind(void 0, e.client_id));
580
+ const { claims: i, jwt: c } = await Rt(r.id_token, Pt.bind(void 0, e.id_token_signed_response_alg, t.id_token_signing_alg_values_supported), Te, W(e), we(e), e[De]).then(vt.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(mt.bind(void 0, t.issuer)).then(gt.bind(void 0, e.client_id));
588
581
  if (Array.isArray(i.aud) && i.aud.length !== 1) {
589
582
  if (i.azp === void 0)
590
- throw new s('ID Token "aud" (audience) claim includes additional untrusted audiences');
583
+ throw new a('ID Token "aud" (audience) claim includes additional untrusted audiences');
591
584
  if (i.azp !== e.client_id)
592
- throw new s('unexpected ID Token "azp" (authorized party) claim value');
585
+ throw new a('unexpected ID Token "azp" (authorized party) claim value');
593
586
  }
594
587
  if (i.auth_time !== void 0 && (!Number.isFinite(i.auth_time) || Math.sign(i.auth_time) !== 1))
595
- throw new s('ID Token "auth_time" (authentication time) must be a positive number');
596
- Se.set(r, [i, c]);
588
+ throw new a('ID Token "auth_time" (authentication time) must be a positive number');
589
+ be.set(r, [i, c]);
597
590
  }
598
591
  }
599
592
  return r;
600
593
  }
601
- async function _t(t, e, n) {
602
- return Te(t, e, n);
594
+ async function wt(t, e, n) {
595
+ return _e(t, e, n);
603
596
  }
604
- function vt(t, e) {
597
+ function gt(t, e) {
605
598
  if (Array.isArray(e.claims.aud)) {
606
599
  if (!e.claims.aud.includes(t))
607
- throw new s('unexpected JWT "aud" (audience) claim value');
600
+ throw new a('unexpected JWT "aud" (audience) claim value');
608
601
  } else if (e.claims.aud !== t)
609
- throw new s('unexpected JWT "aud" (audience) claim value');
602
+ throw new a('unexpected JWT "aud" (audience) claim value');
610
603
  return e;
611
604
  }
612
- function St(t, e) {
605
+ function mt(t, e) {
613
606
  if (e.claims.iss !== t)
614
- throw new s('unexpected JWT "iss" (issuer) claim value');
607
+ throw new a('unexpected JWT "iss" (issuer) claim value');
615
608
  return e;
616
609
  }
617
- const ke = /* @__PURE__ */ new WeakSet();
618
- function Tt(t) {
619
- return ke.add(t), t;
610
+ const ve = /* @__PURE__ */ new WeakSet();
611
+ function yt(t) {
612
+ return ve.add(t), t;
620
613
  }
621
- async function kt(t, e, n, o, a, r) {
622
- if (I(t), j(e), !ke.has(n))
614
+ async function bt(t, e, n, o, s, r) {
615
+ if (x(t), I(e), !ve.has(n))
623
616
  throw new TypeError('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()');
624
- if (!g(o))
617
+ if (!w(o))
625
618
  throw new TypeError('"redirectUri" must be a non-empty string');
626
- if (!g(a))
619
+ if (!w(s))
627
620
  throw new TypeError('"codeVerifier" must be a non-empty string');
628
- const i = k(n, "code");
621
+ const i = S(n, "code");
629
622
  if (!i)
630
- throw new s('no authorization code in "callbackParameters"');
631
- const c = new URLSearchParams(r == null ? void 0 : r.additionalParameters);
632
- return c.set("redirect_uri", o), c.set("code_verifier", a), c.set("code", i), ve(t, e, "authorization_code", c, r);
623
+ throw new a('no authorization code in "callbackParameters"');
624
+ const c = new URLSearchParams(r?.additionalParameters);
625
+ return c.set("redirect_uri", o), c.set("code_verifier", s), c.set("code", i), ye(t, e, "authorization_code", c, r);
633
626
  }
634
- const At = {
627
+ const _t = {
635
628
  aud: "audience",
636
629
  c_hash: "code hash",
637
630
  client_id: "client id",
@@ -647,66 +640,66 @@ const At = {
647
640
  htu: "http uri",
648
641
  cnf: "confirmation"
649
642
  };
650
- function Et(t, e) {
643
+ function vt(t, e) {
651
644
  for (const n of t)
652
645
  if (e.claims[n] === void 0)
653
- throw new s(`JWT "${n}" (${At[n]}) claim missing`);
646
+ throw new a(`JWT "${n}" (${_t[n]}) claim missing`);
654
647
  return e;
655
648
  }
656
- const Rt = Symbol(), F = Symbol();
657
- async function Pt(t, e, n, o, a) {
658
- const r = await Te(t, e, n);
659
- if (G(r))
649
+ const St = Symbol(), H = Symbol();
650
+ async function Tt(t, e, n, o, s) {
651
+ const r = await _e(t, e, n);
652
+ if (B(r))
660
653
  return r;
661
- if (!g(r.id_token))
662
- throw new s('"response" body "id_token" property must be a non-empty string');
663
- a ?? (a = e.default_max_age ?? F);
664
- const i = bt(r);
665
- if ((e.require_auth_time || a !== F) && i.auth_time === void 0)
666
- throw new s('ID Token "auth_time" (authentication time) claim missing');
667
- if (a !== F) {
668
- if (typeof a != "number" || a < 0)
654
+ if (!w(r.id_token))
655
+ throw new a('"response" body "id_token" property must be a non-empty string');
656
+ s ?? (s = e.default_max_age ?? H);
657
+ const i = pt(r);
658
+ if ((e.require_auth_time || s !== H) && i.auth_time === void 0)
659
+ throw new a('ID Token "auth_time" (authentication time) claim missing');
660
+ if (s !== H) {
661
+ if (typeof s != "number" || s < 0)
669
662
  throw new TypeError('"maxAge" must be a non-negative number');
670
- const c = ee() + H(e), p = ye(e);
671
- if (i.auth_time + a < c - p)
672
- throw new s("too much time has elapsed since the last End-User authentication");
663
+ const c = Q() + W(e), p = we(e);
664
+ if (i.auth_time + s < c - p)
665
+ throw new a("too much time has elapsed since the last End-User authentication");
673
666
  }
674
667
  switch (o) {
675
668
  case void 0:
676
- case Rt:
669
+ case St:
677
670
  if (i.nonce !== void 0)
678
- throw new s('unexpected ID Token "nonce" claim value');
671
+ throw new a('unexpected ID Token "nonce" claim value');
679
672
  break;
680
673
  default:
681
- if (!g(o))
674
+ if (!w(o))
682
675
  throw new TypeError('"expectedNonce" must be a non-empty string');
683
676
  if (i.nonce === void 0)
684
- throw new s('ID Token "nonce" claim missing');
677
+ throw new a('ID Token "nonce" claim missing');
685
678
  if (i.nonce !== o)
686
- throw new s('unexpected ID Token "nonce" claim value');
679
+ throw new a('unexpected ID Token "nonce" claim value');
687
680
  }
688
681
  return r;
689
682
  }
690
- function te(t) {
683
+ function X(t) {
691
684
  if (t.bodyUsed)
692
685
  throw new TypeError('"response" body has been used already');
693
686
  }
694
- async function Ut(t) {
687
+ async function kt(t) {
695
688
  if (t.status > 399 && t.status < 500) {
696
- te(t);
689
+ X(t);
697
690
  try {
698
691
  const e = await t.json();
699
- if (x(e) && typeof e.error == "string" && e.error.length)
692
+ if (L(e) && typeof e.error == "string" && e.error.length)
700
693
  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;
701
694
  } catch {
702
695
  }
703
696
  }
704
697
  }
705
- function fe(t) {
698
+ function he(t) {
706
699
  if (typeof t.modulusLength != "number" || t.modulusLength < 2048)
707
- throw new s(`${t.name} modulusLength must be at least 2048 bits`);
700
+ throw new a(`${t.name} modulusLength must be at least 2048 bits`);
708
701
  }
709
- function Ct(t) {
702
+ function At(t) {
710
703
  switch (t) {
711
704
  case "P-256":
712
705
  return "SHA-256";
@@ -715,18 +708,18 @@ function Ct(t) {
715
708
  case "P-521":
716
709
  return "SHA-512";
717
710
  default:
718
- throw new T();
711
+ throw new v();
719
712
  }
720
713
  }
721
- function Ae(t) {
714
+ function Se(t) {
722
715
  switch (t.algorithm.name) {
723
716
  case "ECDSA":
724
717
  return {
725
718
  name: t.algorithm.name,
726
- hash: Ct(t.algorithm.namedCurve)
719
+ hash: At(t.algorithm.namedCurve)
727
720
  };
728
721
  case "RSA-PSS":
729
- switch (fe(t.algorithm), t.algorithm.hash.name) {
722
+ switch (he(t.algorithm), t.algorithm.hash.name) {
730
723
  case "SHA-256":
731
724
  case "SHA-384":
732
725
  case "SHA-512":
@@ -735,143 +728,143 @@ function Ae(t) {
735
728
  saltLength: parseInt(t.algorithm.hash.name.slice(-3), 10) >> 3
736
729
  };
737
730
  default:
738
- throw new T();
731
+ throw new v();
739
732
  }
740
733
  case "RSASSA-PKCS1-v1_5":
741
- return fe(t.algorithm), t.algorithm.name;
734
+ return he(t.algorithm), t.algorithm.name;
742
735
  case "Ed448":
743
736
  case "Ed25519":
744
737
  return t.algorithm.name;
745
738
  }
746
- throw new T();
739
+ throw new v();
747
740
  }
748
- const Ee = Symbol();
749
- async function Lt(t, e, n, o) {
750
- const a = `${t}.${e}`;
751
- if (!await crypto.subtle.verify(Ae(n), n, o, E(a)))
752
- throw new s("JWT signature verification failed");
741
+ const Te = Symbol();
742
+ async function Et(t, e, n, o) {
743
+ const s = `${t}.${e}`;
744
+ if (!await crypto.subtle.verify(Se(n), n, o, A(s)))
745
+ throw new a("JWT signature verification failed");
753
746
  }
754
- async function xt(t, e, n, o, a, r) {
755
- let { 0: i, 1: c, 2: p, length: _ } = t.split(".");
756
- if (_ === 5)
747
+ async function Rt(t, e, n, o, s, r) {
748
+ let { 0: i, 1: c, 2: p, length: y } = t.split(".");
749
+ if (y === 5)
757
750
  if (r !== void 0)
758
- t = await r(t), { 0: i, 1: c, 2: p, length: _ } = t.split(".");
751
+ t = await r(t), { 0: i, 1: c, 2: p, length: y } = t.split(".");
759
752
  else
760
- throw new T("JWE structure JWTs are not supported");
761
- if (_ !== 3)
762
- throw new s("Invalid JWT");
753
+ throw new v("JWE structure JWTs are not supported");
754
+ if (y !== 3)
755
+ throw new a("Invalid JWT");
763
756
  let f;
764
757
  try {
765
- f = JSON.parse(E(A(i)));
758
+ f = JSON.parse(A(T(i)));
766
759
  } catch (l) {
767
- throw new s("failed to parse JWT Header body as base64url encoded JSON", { cause: l });
760
+ throw new a("failed to parse JWT Header body as base64url encoded JSON", { cause: l });
768
761
  }
769
- if (!x(f))
770
- throw new s("JWT Header must be a top level object");
762
+ if (!L(f))
763
+ throw new a("JWT Header must be a top level object");
771
764
  if (e(f), f.crit !== void 0)
772
- throw new s('unexpected JWT "crit" header parameter');
773
- const v = A(p);
765
+ throw new a('unexpected JWT "crit" header parameter');
766
+ const k = T(p);
774
767
  let b;
775
- n !== Ee && (b = await n(f), await Lt(i, c, b, v));
768
+ n !== Te && (b = await n(f), await Et(i, c, b, k));
776
769
  let d;
777
770
  try {
778
- d = JSON.parse(E(A(c)));
771
+ d = JSON.parse(A(T(c)));
779
772
  } catch (l) {
780
- throw new s("failed to parse JWT Payload body as base64url encoded JSON", { cause: l });
773
+ throw new a("failed to parse JWT Payload body as base64url encoded JSON", { cause: l });
781
774
  }
782
- if (!x(d))
783
- throw new s("JWT Payload must be a top level object");
784
- const P = ee() + o;
775
+ if (!L(d))
776
+ throw new a("JWT Payload must be a top level object");
777
+ const R = Q() + o;
785
778
  if (d.exp !== void 0) {
786
779
  if (typeof d.exp != "number")
787
- throw new s('unexpected JWT "exp" (expiration time) claim type');
788
- if (d.exp <= P - a)
789
- throw new s('unexpected JWT "exp" (expiration time) claim value, timestamp is <= now()');
780
+ throw new a('unexpected JWT "exp" (expiration time) claim type');
781
+ if (d.exp <= R - s)
782
+ throw new a('unexpected JWT "exp" (expiration time) claim value, timestamp is <= now()');
790
783
  }
791
784
  if (d.iat !== void 0 && typeof d.iat != "number")
792
- throw new s('unexpected JWT "iat" (issued at) claim type');
785
+ throw new a('unexpected JWT "iat" (issued at) claim type');
793
786
  if (d.iss !== void 0 && typeof d.iss != "string")
794
- throw new s('unexpected JWT "iss" (issuer) claim type');
787
+ throw new a('unexpected JWT "iss" (issuer) claim type');
795
788
  if (d.nbf !== void 0) {
796
789
  if (typeof d.nbf != "number")
797
- throw new s('unexpected JWT "nbf" (not before) claim type');
798
- if (d.nbf > P + a)
799
- throw new s('unexpected JWT "nbf" (not before) claim value, timestamp is > now()');
790
+ throw new a('unexpected JWT "nbf" (not before) claim type');
791
+ if (d.nbf > R + s)
792
+ throw new a('unexpected JWT "nbf" (not before) claim value, timestamp is > now()');
800
793
  }
801
794
  if (d.aud !== void 0 && typeof d.aud != "string" && !Array.isArray(d.aud))
802
- throw new s('unexpected JWT "aud" (audience) claim type');
803
- return { header: f, claims: d, signature: v, key: b, jwt: t };
795
+ throw new a('unexpected JWT "aud" (audience) claim type');
796
+ return { header: f, claims: d, signature: k, key: b, jwt: t };
804
797
  }
805
- function It(t, e, n) {
798
+ function Pt(t, e, n) {
806
799
  if (t !== void 0) {
807
800
  if (n.alg !== t)
808
- throw new s('unexpected JWT "alg" header parameter');
801
+ throw new a('unexpected JWT "alg" header parameter');
809
802
  return;
810
803
  }
811
804
  if (Array.isArray(e)) {
812
805
  if (!e.includes(n.alg))
813
- throw new s('unexpected JWT "alg" header parameter');
806
+ throw new a('unexpected JWT "alg" header parameter');
814
807
  return;
815
808
  }
816
809
  if (n.alg !== "RS256")
817
- throw new s('unexpected JWT "alg" header parameter');
810
+ throw new a('unexpected JWT "alg" header parameter');
818
811
  }
819
- function k(t, e) {
812
+ function S(t, e) {
820
813
  const { 0: n, length: o } = t.getAll(e);
821
814
  if (o > 1)
822
- throw new s(`"${e}" parameter must be provided only once`);
815
+ throw new a(`"${e}" parameter must be provided only once`);
823
816
  return n;
824
817
  }
825
- const jt = Symbol(), Jt = Symbol();
826
- function Ot(t, e, n, o) {
827
- if (I(t), j(e), n instanceof URL && (n = n.searchParams), !(n instanceof URLSearchParams))
818
+ const Ut = Symbol(), Ct = Symbol();
819
+ function Lt(t, e, n, o) {
820
+ if (x(t), I(e), n instanceof URL && (n = n.searchParams), !(n instanceof URLSearchParams))
828
821
  throw new TypeError('"parameters" must be an instance of URLSearchParams, or URL');
829
- if (k(n, "response"))
830
- throw new s('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()');
831
- const a = k(n, "iss"), r = k(n, "state");
832
- if (!a && t.authorization_response_iss_parameter_supported)
833
- throw new s('response parameter "iss" (issuer) missing');
834
- if (a && a !== t.issuer)
835
- throw new s('unexpected "iss" (issuer) response parameter value');
822
+ if (S(n, "response"))
823
+ throw new a('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()');
824
+ const s = S(n, "iss"), r = S(n, "state");
825
+ if (!s && t.authorization_response_iss_parameter_supported)
826
+ throw new a('response parameter "iss" (issuer) missing');
827
+ if (s && s !== t.issuer)
828
+ throw new a('unexpected "iss" (issuer) response parameter value');
836
829
  switch (o) {
837
830
  case void 0:
838
- case Jt:
831
+ case Ct:
839
832
  if (r !== void 0)
840
- throw new s('unexpected "state" response parameter encountered');
833
+ throw new a('unexpected "state" response parameter encountered');
841
834
  break;
842
- case jt:
835
+ case Ut:
843
836
  break;
844
837
  default:
845
- if (!g(o))
846
- throw new s('"expectedState" must be a non-empty string');
838
+ if (!w(o))
839
+ throw new a('"expectedState" must be a non-empty string');
847
840
  if (r === void 0)
848
- throw new s('response parameter "state" missing');
841
+ throw new a('response parameter "state" missing');
849
842
  if (r !== o)
850
- throw new s('unexpected "state" response parameter value');
843
+ throw new a('unexpected "state" response parameter value');
851
844
  }
852
- const i = k(n, "error");
845
+ const i = S(n, "error");
853
846
  if (i)
854
847
  return {
855
848
  error: i,
856
- error_description: k(n, "error_description"),
857
- error_uri: k(n, "error_uri")
849
+ error_description: S(n, "error_description"),
850
+ error_uri: S(n, "error_uri")
858
851
  };
859
- const c = k(n, "id_token"), p = k(n, "token");
852
+ const c = S(n, "id_token"), p = S(n, "token");
860
853
  if (c !== void 0 || p !== void 0)
861
- throw new T("implicit and hybrid flows are not supported");
862
- return Tt(new URLSearchParams(n));
854
+ throw new v("implicit and hybrid flows are not supported");
855
+ return yt(new URLSearchParams(n));
863
856
  }
864
- function zt({
857
+ function xt({
865
858
  handleCallback: t
866
859
  }) {
867
- const e = je({
860
+ const e = Ue({
868
861
  retry: !1,
869
862
  queryKey: ["oauth-callback"],
870
863
  queryFn: async () => {
871
864
  try {
872
865
  return await t();
873
866
  } catch (n) {
874
- throw new ze("Could not validate user", {
867
+ throw new xe("Could not validate user", {
875
868
  cause: n,
876
869
  title: "Authentication Error",
877
870
  developerHint: "Check the configuration of your authorization provider and ensure all settings such as the callback URL are configured correctly."
@@ -879,17 +872,17 @@ function zt({
879
872
  }
880
873
  }
881
874
  });
882
- return /* @__PURE__ */ B.jsx(Oe, { to: e.data });
875
+ return /* @__PURE__ */ M.jsx(Le, { to: e.data });
883
876
  }
884
- class R extends Error {
877
+ class E extends Error {
885
878
  }
886
- class pe extends R {
879
+ class de extends E {
887
880
  constructor(e, n, o) {
888
881
  super(e, o), this.error = n;
889
882
  }
890
883
  }
891
- const M = "code-verifier", q = "oauth-state";
892
- class Dt extends Je {
884
+ const $ = "code-verifier", F = "oauth-state";
885
+ class It extends Ce {
893
886
  constructor(e, n) {
894
887
  super(), this.callbackUrlPath = e, this.handleCallback = n;
895
888
  }
@@ -898,119 +891,47 @@ class Dt extends Je {
898
891
  ...super.getRoutes(),
899
892
  {
900
893
  path: this.callbackUrlPath,
901
- element: /* @__PURE__ */ B.jsx(Ie, { children: /* @__PURE__ */ B.jsx(zt, { handleCallback: this.handleCallback }) })
894
+ element: /* @__PURE__ */ M.jsx(Pe, { children: /* @__PURE__ */ M.jsx(xt, { handleCallback: this.handleCallback }) })
902
895
  }
903
896
  ];
904
897
  }
905
898
  }
906
- class Nt {
899
+ class jt {
900
+ client;
901
+ issuer;
902
+ authorizationServer;
903
+ absoluteCallbackUrlPath;
904
+ relativeCallbackUrlPath;
905
+ logoutRedirectUrlPath;
906
+ onAuthorizationUrl;
907
+ redirectToAfterSignUp;
908
+ redirectToAfterSignIn;
909
+ redirectToAfterSignOut;
910
+ audience;
911
+ scopes;
912
+ root;
907
913
  constructor({
908
914
  issuer: e,
909
915
  audience: n,
910
916
  clientId: o,
911
- redirectToAfterSignUp: a,
917
+ redirectToAfterSignUp: s,
912
918
  redirectToAfterSignIn: r,
913
919
  redirectToAfterSignOut: i,
914
920
  basePath: c,
915
921
  scopes: p
916
922
  }) {
917
- w(this, "client");
918
- w(this, "issuer");
919
- w(this, "authorizationServer");
920
- w(this, "absoluteCallbackUrlPath");
921
- w(this, "relativeCallbackUrlPath");
922
- w(this, "logoutRedirectUrlPath");
923
- w(this, "onAuthorizationUrl");
924
- w(this, "redirectToAfterSignUp");
925
- w(this, "redirectToAfterSignIn");
926
- w(this, "redirectToAfterSignOut");
927
- w(this, "audience");
928
- w(this, "scopes");
929
- w(this, "root");
930
- w(this, "signRequest", async (e) => {
931
- const n = await this.getAccessToken();
932
- return e.headers.set("Authorization", `Bearer ${n}`), e;
933
- });
934
- w(this, "signOut", async () => {
935
- L.setState({
936
- isAuthenticated: !1,
937
- isPending: !1,
938
- profile: void 0,
939
- providerData: void 0
940
- });
941
- const e = await this.getAuthServer(), n = new URL(
942
- window.location.origin + this.redirectToAfterSignOut
943
- );
944
- n.pathname = this.logoutRedirectUrlPath;
945
- let o;
946
- e.end_session_endpoint ? (o = new URL(e.end_session_endpoint), o.searchParams.set(
947
- "post_logout_redirect_uri",
948
- n.toString()
949
- )) : o = n;
950
- });
951
- w(this, "handleCallback", async () => {
952
- const e = new URL(window.location.href), n = e.searchParams.get("state"), o = sessionStorage.getItem(q);
953
- if (sessionStorage.removeItem(q), n !== o)
954
- throw new R("Invalid state parameter");
955
- const a = sessionStorage.getItem(M);
956
- if (sessionStorage.removeItem(M), !a)
957
- throw new R("No code verifier found in state.");
958
- const r = await this.getAuthServer(), i = Ot(
959
- r,
960
- this.client,
961
- e.searchParams,
962
- n ?? void 0
963
- );
964
- if (G(i))
965
- throw se.error("Error validating OAuth response", i), new pe(
966
- "Error validating OAuth response",
967
- i
968
- );
969
- const c = new URL(e);
970
- c.pathname = this.absoluteCallbackUrlPath, c.search = "";
971
- const p = await kt(
972
- r,
973
- this.client,
974
- i,
975
- c.toString(),
976
- a
977
- ), _ = await Pt(
978
- r,
979
- this.client,
980
- p
981
- );
982
- this.setTokensFromResponse(_);
983
- const f = await this.getAccessToken(), b = await (await gt(
984
- r,
985
- this.client,
986
- f
987
- )).json(), d = {
988
- sub: b.sub,
989
- email: b.email,
990
- name: b.name,
991
- emailVerified: b.email_verified ?? !1,
992
- pictureUrl: b.picture
993
- };
994
- L.setState({
995
- isAuthenticated: !0,
996
- isPending: !1,
997
- profile: d
998
- });
999
- const P = sessionStorage.getItem("redirect-to") ?? "/";
1000
- return sessionStorage.removeItem("redirect-to"), P;
1001
- });
1002
923
  this.client = {
1003
924
  client_id: o,
1004
925
  token_endpoint_auth_method: "none"
1005
- }, this.audience = n, this.issuer = e, this.relativeCallbackUrlPath = "/oauth/callback", this.absoluteCallbackUrlPath = ie(
926
+ }, this.audience = n, this.issuer = e, this.relativeCallbackUrlPath = "/oauth/callback", this.absoluteCallbackUrlPath = re(
1006
927
  c,
1007
928
  this.relativeCallbackUrlPath
1008
- ), this.scopes = p ?? ["openid", "profile", "email"], this.root = ie(c, "/"), this.logoutRedirectUrlPath = this.root, this.redirectToAfterSignUp = a ?? this.root, this.redirectToAfterSignIn = r ?? this.root, this.redirectToAfterSignOut = i ?? this.root;
929
+ ), this.scopes = p ?? ["openid", "profile", "email"], this.root = re(c, "/"), this.logoutRedirectUrlPath = this.root, this.redirectToAfterSignUp = s ?? this.root, this.redirectToAfterSignIn = r ?? this.root, this.redirectToAfterSignOut = i ?? this.root;
1009
930
  }
1010
931
  async getAuthServer() {
1011
932
  if (!this.authorizationServer) {
1012
- const e = new URL(this.issuer), n = await et(e);
1013
- this.authorizationServer = await tt(
933
+ const e = new URL(this.issuer), n = await Ge(e);
934
+ this.authorizationServer = await Ye(
1014
935
  e,
1015
936
  n
1016
937
  );
@@ -1022,10 +943,10 @@ class Nt {
1022
943
  * @param response
1023
944
  */
1024
945
  setTokensFromResponse(e) {
1025
- if (G(e))
1026
- throw se.error("Bad Token Response", e), new pe("Bad Token Response", e);
946
+ if (B(e))
947
+ throw ie.error("Bad Token Response", e), new de("Bad Token Response", e);
1027
948
  if (!e.expires_in)
1028
- throw new R("No expires_in in response");
949
+ throw new E("No expires_in in response");
1029
950
  const n = {
1030
951
  accessToken: e.access_token,
1031
952
  refreshToken: e.refresh_token,
@@ -1033,7 +954,7 @@ class Nt {
1033
954
  expiresOn: new Date(Date.now() + e.expires_in * 1e3),
1034
955
  tokenType: e.token_type
1035
956
  };
1036
- L.setState({
957
+ C.setState({
1037
958
  providerData: n
1038
959
  });
1039
960
  }
@@ -1052,65 +973,136 @@ class Nt {
1052
973
  redirectTo: e,
1053
974
  isSignUp: n = !1
1054
975
  }) {
1055
- var v;
1056
- const o = "S256", a = await this.getAuthServer();
1057
- if (!a.authorization_endpoint)
1058
- throw new R("No authorization endpoint");
1059
- const r = nt(), i = await ot(r);
1060
- sessionStorage.setItem(M, r);
976
+ const o = "S256", s = await this.getAuthServer();
977
+ if (!s.authorization_endpoint)
978
+ throw new E("No authorization endpoint");
979
+ const r = Ze(), i = await Xe(r);
980
+ sessionStorage.setItem($, r);
1061
981
  const c = new URL(
1062
- a.authorization_endpoint
982
+ s.authorization_endpoint
1063
983
  ), p = e.startsWith(window.location.origin) ? this.root !== "/" && e.startsWith(window.location.origin + this.root) ? e.slice(window.location.origin.length + this.root.length) : e.slice(window.location.origin.length) : e;
1064
984
  sessionStorage.setItem("redirect-to", p);
1065
- const _ = new URL(window.location.origin);
1066
- _.pathname = this.absoluteCallbackUrlPath, _.search = "", c.searchParams.set("client_id", this.client.client_id), c.searchParams.set("redirect_uri", _.toString()), c.searchParams.set("response_type", "code"), c.searchParams.set("scope", this.scopes.join(" ")), c.searchParams.set("code_challenge", i), c.searchParams.set(
985
+ const y = new URL(window.location.origin);
986
+ y.pathname = this.absoluteCallbackUrlPath, y.search = "", c.searchParams.set("client_id", this.client.client_id), c.searchParams.set("redirect_uri", y.toString()), c.searchParams.set("response_type", "code"), c.searchParams.set("scope", this.scopes.join(" ")), c.searchParams.set("code_challenge", i), c.searchParams.set(
1067
987
  "code_challenge_method",
1068
988
  o
1069
- ), this.audience && c.searchParams.set("audience", this.audience), (v = this.onAuthorizationUrl) == null || v.call(this, c, {
989
+ ), this.audience && c.searchParams.set("audience", this.audience), this.onAuthorizationUrl?.(c, {
1070
990
  isSignIn: !n,
1071
991
  isSignUp: n
1072
992
  });
1073
- const f = rt();
1074
- sessionStorage.setItem(q, f), c.searchParams.set("state", f), location.href = c.href;
993
+ const f = Qe();
994
+ sessionStorage.setItem(F, f), c.searchParams.set("state", f), location.href = c.href;
1075
995
  }
1076
996
  async getAccessToken() {
1077
- const e = await this.getAuthServer(), { providerData: n } = L.getState();
997
+ const e = await this.getAuthServer(), { providerData: n } = C.getState();
1078
998
  if (!n)
1079
- throw new R("User is not authenticated");
999
+ throw new E("User is not authenticated");
1080
1000
  const o = n;
1081
1001
  if (new Date(o.expiresOn) < /* @__PURE__ */ new Date()) {
1082
1002
  if (!o.refreshToken)
1083
- return L.setState({
1003
+ return C.setState({
1084
1004
  isAuthenticated: !1,
1085
1005
  isPending: !1,
1086
1006
  profile: null,
1087
1007
  providerData: null
1088
1008
  }), "";
1089
- const a = await yt(
1009
+ const s = await ft(
1090
1010
  e,
1091
1011
  this.client,
1092
1012
  o.refreshToken
1093
- ), r = await _t(
1013
+ ), r = await wt(
1094
1014
  e,
1095
1015
  this.client,
1096
- a
1016
+ s
1097
1017
  );
1098
1018
  if (!r.access_token)
1099
- throw new R("No access token in response");
1019
+ throw new E("No access token in response");
1100
1020
  return this.setTokensFromResponse(r), r.access_token.toString();
1101
1021
  } else
1102
1022
  return o.accessToken;
1103
1023
  }
1024
+ signRequest = async (e) => {
1025
+ const n = await this.getAccessToken();
1026
+ return e.headers.set("Authorization", `Bearer ${n}`), e;
1027
+ };
1028
+ signOut = async () => {
1029
+ C.setState({
1030
+ isAuthenticated: !1,
1031
+ isPending: !1,
1032
+ profile: void 0,
1033
+ providerData: void 0
1034
+ });
1035
+ const e = await this.getAuthServer(), n = new URL(
1036
+ window.location.origin + this.redirectToAfterSignOut
1037
+ );
1038
+ n.pathname = this.logoutRedirectUrlPath;
1039
+ let o;
1040
+ e.end_session_endpoint ? (o = new URL(e.end_session_endpoint), o.searchParams.set(
1041
+ "post_logout_redirect_uri",
1042
+ n.toString()
1043
+ )) : o = n;
1044
+ };
1045
+ handleCallback = async () => {
1046
+ const e = new URL(window.location.href), n = e.searchParams.get("state"), o = sessionStorage.getItem(F);
1047
+ if (sessionStorage.removeItem(F), n !== o)
1048
+ throw new E("Invalid state parameter");
1049
+ const s = sessionStorage.getItem($);
1050
+ if (sessionStorage.removeItem($), !s)
1051
+ throw new E("No code verifier found in state.");
1052
+ const r = await this.getAuthServer(), i = Lt(
1053
+ r,
1054
+ this.client,
1055
+ e.searchParams,
1056
+ n ?? void 0
1057
+ );
1058
+ if (B(i))
1059
+ throw ie.error("Error validating OAuth response", i), new de(
1060
+ "Error validating OAuth response",
1061
+ i
1062
+ );
1063
+ const c = new URL(e);
1064
+ c.pathname = this.absoluteCallbackUrlPath, c.search = "";
1065
+ const p = await bt(
1066
+ r,
1067
+ this.client,
1068
+ i,
1069
+ c.toString(),
1070
+ s
1071
+ ), y = await Tt(
1072
+ r,
1073
+ this.client,
1074
+ p
1075
+ );
1076
+ this.setTokensFromResponse(y);
1077
+ const f = await this.getAccessToken(), b = await (await ht(
1078
+ r,
1079
+ this.client,
1080
+ f
1081
+ )).json(), d = {
1082
+ sub: b.sub,
1083
+ email: b.email,
1084
+ name: b.name,
1085
+ emailVerified: b.email_verified ?? !1,
1086
+ pictureUrl: b.picture
1087
+ };
1088
+ C.setState({
1089
+ isAuthenticated: !0,
1090
+ isPending: !1,
1091
+ profile: d
1092
+ });
1093
+ const R = sessionStorage.getItem("redirect-to") ?? "/";
1094
+ return sessionStorage.removeItem("redirect-to"), R;
1095
+ };
1104
1096
  getAuthenticationPlugin() {
1105
- return new Dt(
1097
+ return new It(
1106
1098
  this.relativeCallbackUrlPath,
1107
1099
  this.handleCallback
1108
1100
  );
1109
1101
  }
1110
1102
  }
1111
- const Vt = (t) => new Nt(t);
1103
+ const Ht = (t) => new jt(t);
1112
1104
  export {
1113
- Nt as OpenIDAuthenticationProvider,
1114
- Vt as default
1105
+ jt as OpenIDAuthenticationProvider,
1106
+ Ht as default
1115
1107
  };
1116
1108
  //# sourceMappingURL=zudoku.auth-openid.js.map