zudoku 0.44.1 → 0.45.1

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