zudoku 0.3.0-dev.58 → 0.3.0-dev.59

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 (199) hide show
  1. package/dist/app/entry.client.js +1 -1
  2. package/dist/app/entry.client.js.map +1 -1
  3. package/dist/app/entry.server.d.ts +2 -0
  4. package/dist/app/entry.server.js +1 -0
  5. package/dist/app/entry.server.js.map +1 -1
  6. package/dist/app/main.js +8 -2
  7. package/dist/app/main.js.map +1 -1
  8. package/dist/config/validators/validate.d.ts +121 -102
  9. package/dist/config/validators/validate.js +4 -0
  10. package/dist/config/validators/validate.js.map +1 -1
  11. package/dist/lib/authentication/AuthenticationPlugin.d.ts +16 -0
  12. package/dist/lib/authentication/AuthenticationPlugin.js +31 -0
  13. package/dist/lib/authentication/AuthenticationPlugin.js.map +1 -0
  14. package/dist/lib/authentication/authentication.d.ts +3 -4
  15. package/dist/lib/authentication/components/Login.d.ts +1 -0
  16. package/dist/lib/authentication/components/Login.js +10 -0
  17. package/dist/lib/authentication/components/Login.js.map +1 -0
  18. package/dist/lib/authentication/components/Logout.d.ts +1 -0
  19. package/dist/lib/authentication/components/Logout.js +10 -0
  20. package/dist/lib/authentication/components/Logout.js.map +1 -0
  21. package/dist/lib/authentication/providers/clerk.js +43 -27
  22. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  23. package/dist/lib/authentication/providers/openid.d.ts +11 -3
  24. package/dist/lib/authentication/providers/openid.js +22 -11
  25. package/dist/lib/authentication/providers/openid.js.map +1 -1
  26. package/dist/lib/authentication/routes.d.ts +5 -0
  27. package/dist/lib/authentication/routes.js +12 -0
  28. package/dist/lib/authentication/routes.js.map +1 -0
  29. package/dist/lib/components/Bootstrap.d.ts +2 -1
  30. package/dist/lib/components/Bootstrap.js +4 -1
  31. package/dist/lib/components/Bootstrap.js.map +1 -1
  32. package/dist/lib/components/DevPortal.js +14 -2
  33. package/dist/lib/components/DevPortal.js.map +1 -1
  34. package/dist/lib/components/Header.js +16 -3
  35. package/dist/lib/components/Header.js.map +1 -1
  36. package/dist/lib/components/InlineCode.js +1 -1
  37. package/dist/lib/components/InlineCode.js.map +1 -1
  38. package/dist/lib/components/TopNavigation.js +1 -1
  39. package/dist/lib/components/TopNavigation.js.map +1 -1
  40. package/dist/lib/components/context/DevPortalProvider.js +18 -1
  41. package/dist/lib/components/context/DevPortalProvider.js.map +1 -1
  42. package/dist/lib/components/index.d.ts +5 -1
  43. package/dist/lib/components/index.js +4 -0
  44. package/dist/lib/components/index.js.map +1 -1
  45. package/dist/lib/components/navigation/SideNavigationItem.js +1 -1
  46. package/dist/lib/components/navigation/SideNavigationItem.js.map +1 -1
  47. package/dist/lib/core/DevPortalContext.d.ts +1 -1
  48. package/dist/lib/core/DevPortalContext.js.map +1 -1
  49. package/dist/lib/core/plugins.d.ts +10 -1
  50. package/dist/lib/core/plugins.js +1 -0
  51. package/dist/lib/core/plugins.js.map +1 -1
  52. package/dist/lib/plugins/api-keys/CreateApiKey.js +1 -1
  53. package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
  54. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +2 -2
  55. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
  56. package/dist/lib/plugins/api-keys/index.d.ts +2 -2
  57. package/dist/lib/plugins/api-keys/index.js +6 -0
  58. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  59. package/dist/lib/plugins/custom-page/index.d.ts +8 -0
  60. package/dist/lib/plugins/custom-page/index.js +12 -0
  61. package/dist/lib/plugins/custom-page/index.js.map +1 -0
  62. package/dist/lib/plugins/markdown/MdxPage.js +1 -1
  63. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  64. package/dist/lib/plugins/openapi/OperationListItem.js +1 -1
  65. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  66. package/dist/lib/plugins/openapi/ParameterList.js +1 -1
  67. package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
  68. package/dist/lib/plugins/openapi/SchemaListViewItem.js +3 -3
  69. package/dist/lib/plugins/openapi/SchemaListViewItem.js.map +1 -1
  70. package/dist/lib/plugins/openapi/SidecarBox.js +1 -1
  71. package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -1
  72. package/dist/lib/plugins/openapi/StaggeredRender.d.ts +3 -0
  73. package/dist/lib/plugins/openapi/StaggeredRender.js +10 -5
  74. package/dist/lib/plugins/openapi/StaggeredRender.js.map +1 -1
  75. package/dist/lib/plugins/openapi/playground/Playground.js +2 -2
  76. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  77. package/dist/lib/ui/Card.js +1 -1
  78. package/dist/lib/ui/Card.js.map +1 -1
  79. package/dist/lib/ui/DropdownMenu.d.ts +27 -0
  80. package/dist/lib/ui/DropdownMenu.js +36 -0
  81. package/dist/lib/ui/DropdownMenu.js.map +1 -0
  82. package/dist/lib/ui/button-variants.d.ts +2 -2
  83. package/dist/lib/ui/button-variants.js +1 -0
  84. package/dist/lib/ui/button-variants.js.map +1 -1
  85. package/dist/lib/util/MdxComponents.js +1 -1
  86. package/dist/lib/util/MdxComponents.js.map +1 -1
  87. package/dist/lib/util/joinPath.js +2 -1
  88. package/dist/lib/util/joinPath.js.map +1 -1
  89. package/dist/vite/build.js +5 -2
  90. package/dist/vite/build.js.map +1 -1
  91. package/dist/vite/config.d.ts +8 -1
  92. package/dist/vite/config.js +13 -6
  93. package/dist/vite/config.js.map +1 -1
  94. package/dist/vite/plugin-component.js +1 -0
  95. package/dist/vite/plugin-component.js.map +1 -1
  96. package/dist/vite/prerender.d.ts +1 -1
  97. package/dist/vite/prerender.js +23 -3
  98. package/dist/vite/prerender.js.map +1 -1
  99. package/lib/{AnchorLink-B4IgsA83.js → AnchorLink-Bj1hwDuD.js} +3 -3
  100. package/lib/{AnchorLink-B4IgsA83.js.map → AnchorLink-Bj1hwDuD.js.map} +1 -1
  101. package/lib/AuthenticationPlugin-CG6Bw32B.js +46 -0
  102. package/lib/AuthenticationPlugin-CG6Bw32B.js.map +1 -0
  103. package/lib/CategoryHeading-DMkTmmBh.js +10 -0
  104. package/lib/CategoryHeading-DMkTmmBh.js.map +1 -0
  105. package/lib/Combination-lAFQBd6U.js +2774 -0
  106. package/lib/Combination-lAFQBd6U.js.map +1 -0
  107. package/lib/DevPortalProvider-BBhQ8kgI.js +1125 -0
  108. package/lib/DevPortalProvider-BBhQ8kgI.js.map +1 -0
  109. package/lib/{Markdown-DQrAhTkw.js → Markdown-BjRJKl_E.js} +1376 -1379
  110. package/lib/Markdown-BjRJKl_E.js.map +1 -0
  111. package/lib/{MdxPage-DMP-pM_g.js → MdxPage-DJTFOCbZ.js} +17 -17
  112. package/lib/{MdxPage-DMP-pM_g.js.map → MdxPage-DJTFOCbZ.js.map} +1 -1
  113. package/lib/OperationList-DDTtK3I7.js +5403 -0
  114. package/lib/OperationList-DDTtK3I7.js.map +1 -0
  115. package/lib/{Route-C1LyvITr.js → Route-Bsrd0acQ.js} +2 -2
  116. package/lib/{Route-C1LyvITr.js.map → Route-Bsrd0acQ.js.map} +1 -1
  117. package/lib/Select-CEnkyfyn.js +2223 -0
  118. package/lib/Select-CEnkyfyn.js.map +1 -0
  119. package/lib/Spinner-Ciq_pWU7.js +359 -0
  120. package/lib/Spinner-Ciq_pWU7.js.map +1 -0
  121. package/lib/{hook-CrQMC_eg.js → hook-Q_gAL2NZ.js} +20 -19
  122. package/lib/{hook-CrQMC_eg.js.map → hook-Q_gAL2NZ.js.map} +1 -1
  123. package/lib/{index-tOwoT-uJ.js → index-BE2a6gGC.js} +24 -23
  124. package/lib/{index-tOwoT-uJ.js.map → index-BE2a6gGC.js.map} +1 -1
  125. package/lib/{jsx-runtime-CJZJivg2.js → jsx-runtime-BIr0WBt_.js} +119 -119
  126. package/lib/jsx-runtime-BIr0WBt_.js.map +1 -0
  127. package/lib/{router-CBw2vqJE.js → router-BiRCp01d.js} +671 -673
  128. package/lib/router-BiRCp01d.js.map +1 -0
  129. package/lib/zudoku.auth-clerk.js +47 -32
  130. package/lib/zudoku.auth-clerk.js.map +1 -1
  131. package/lib/zudoku.auth-openid.js +170 -159
  132. package/lib/zudoku.auth-openid.js.map +1 -1
  133. package/lib/zudoku.components.js +1494 -591
  134. package/lib/zudoku.components.js.map +1 -1
  135. package/lib/zudoku.plugin-api-keys.js +31 -25
  136. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  137. package/lib/zudoku.plugin-custom-page.js +13 -0
  138. package/lib/zudoku.plugin-custom-page.js.map +1 -0
  139. package/lib/zudoku.plugin-markdown.js +19 -20
  140. package/lib/zudoku.plugin-markdown.js.map +1 -1
  141. package/lib/zudoku.plugin-openapi.js +4 -4
  142. package/lib/zudoku.plugin-redirect.js +3 -3
  143. package/package.json +29 -14
  144. package/src/app/entry.client.tsx +1 -1
  145. package/src/app/entry.server.tsx +2 -0
  146. package/src/app/main.css +6 -0
  147. package/src/app/main.tsx +8 -2
  148. package/src/lib/authentication/AuthenticationPlugin.tsx +36 -0
  149. package/src/lib/authentication/authentication.ts +3 -4
  150. package/src/lib/authentication/components/Login.tsx +11 -0
  151. package/src/lib/authentication/components/Logout.tsx +11 -0
  152. package/src/lib/authentication/providers/clerk.tsx +43 -27
  153. package/src/lib/authentication/providers/openid.tsx +25 -13
  154. package/src/lib/authentication/routes.tsx +10 -0
  155. package/src/lib/components/Bootstrap.tsx +14 -7
  156. package/src/lib/components/DevPortal.tsx +29 -9
  157. package/src/lib/components/Header.tsx +63 -24
  158. package/src/lib/components/InlineCode.tsx +1 -1
  159. package/src/lib/components/TopNavigation.tsx +1 -1
  160. package/src/lib/components/context/DevPortalProvider.ts +22 -2
  161. package/src/lib/components/index.ts +4 -0
  162. package/src/lib/components/navigation/SideNavigationItem.tsx +1 -1
  163. package/src/lib/core/DevPortalContext.ts +1 -1
  164. package/src/lib/core/plugins.ts +16 -0
  165. package/src/lib/plugins/api-keys/CreateApiKey.tsx +1 -1
  166. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +4 -4
  167. package/src/lib/plugins/api-keys/index.tsx +8 -1
  168. package/src/lib/plugins/custom-page/index.tsx +22 -0
  169. package/src/lib/plugins/markdown/MdxPage.tsx +2 -2
  170. package/src/lib/plugins/openapi/OperationListItem.tsx +1 -4
  171. package/src/lib/plugins/openapi/ParameterList.tsx +1 -1
  172. package/src/lib/plugins/openapi/SchemaListViewItem.tsx +3 -3
  173. package/src/lib/plugins/openapi/SidecarBox.tsx +1 -1
  174. package/src/lib/plugins/openapi/StaggeredRender.tsx +19 -5
  175. package/src/lib/plugins/openapi/playground/Playground.tsx +2 -2
  176. package/src/lib/ui/Card.tsx +1 -1
  177. package/src/lib/ui/DropdownMenu.tsx +199 -0
  178. package/src/lib/ui/button-variants.ts +1 -0
  179. package/src/lib/util/MdxComponents.tsx +1 -1
  180. package/src/lib/util/joinPath.tsx +2 -1
  181. package/dist/app/zudoku-manifest.d.ts +0 -1
  182. package/dist/app/zudoku-manifest.js +0 -20
  183. package/dist/app/zudoku-manifest.js.map +0 -1
  184. package/lib/Button-CnuhSW99.js +0 -4571
  185. package/lib/Button-CnuhSW99.js.map +0 -1
  186. package/lib/DevPortalProvider-Do9oJqme.js +0 -1081
  187. package/lib/DevPortalProvider-Do9oJqme.js.map +0 -1
  188. package/lib/Markdown-DQrAhTkw.js.map +0 -1
  189. package/lib/OperationList-Dw2SadHL.js +0 -5578
  190. package/lib/OperationList-Dw2SadHL.js.map +0 -1
  191. package/lib/Spinner-BuBOzK_8.js +0 -182
  192. package/lib/Spinner-BuBOzK_8.js.map +0 -1
  193. package/lib/index-gsAuUwQh.js +0 -418
  194. package/lib/index-gsAuUwQh.js.map +0 -1
  195. package/lib/jsx-runtime-CJZJivg2.js.map +0 -1
  196. package/lib/router-CBw2vqJE.js.map +0 -1
  197. package/lib/util-_jwUlTBU.js +0 -41
  198. package/lib/util-_jwUlTBU.js.map +0 -1
  199. package/src/app/zudoku-manifest.ts +0 -22
@@ -1,9 +1,10 @@
1
1
  var Re = Object.defineProperty;
2
- var xe = (e, t, n) => t in e ? Re(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var S = (e, t, n) => xe(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { a as Pe, j as T } from "./jsx-runtime-CJZJivg2.js";
2
+ var Pe = (e, t, n) => t in e ? Re(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var S = (e, t, n) => Pe(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { b as xe, j as T } from "./jsx-runtime-BIr0WBt_.js";
5
5
  import { c as Le, a as Ue } from "./_commonjsHelpers-BVfed4GL.js";
6
- import { useRef as Ce, useState as je, useEffect as ze } from "react";
6
+ import { A as Ce } from "./AuthenticationPlugin-CG6Bw32B.js";
7
+ import { useRef as je, useState as Je, useEffect as ze } from "react";
7
8
  import { u as re } from "./state-DKdaQzvh.js";
8
9
  var he = { exports: {} };
9
10
  (function(e) {
@@ -36,7 +37,7 @@ var he = { exports: {} };
36
37
  function m(u) {
37
38
  return u === "debug" && (u = "log"), typeof console === n ? !1 : u === "trace" && o ? g : console[u] !== void 0 ? d(console, u) : console.log !== void 0 ? d(console, "log") : t;
38
39
  }
39
- function _() {
40
+ function b() {
40
41
  for (var u = this.getLevel(), f = 0; f < s.length; f++) {
41
42
  var c = s[f];
42
43
  this[c] = f < u ? t : this.methodFactory(c, u, this.name);
@@ -46,39 +47,39 @@ var he = { exports: {} };
46
47
  }
47
48
  function y(u) {
48
49
  return function() {
49
- typeof console !== n && (_.call(this), this[u].apply(this, arguments));
50
+ typeof console !== n && (b.call(this), this[u].apply(this, arguments));
50
51
  };
51
52
  }
52
53
  function h(u, f, c) {
53
54
  return m(u) || y.apply(this, arguments);
54
55
  }
55
56
  function L(u, f) {
56
- var c = this, J, $, x, b = "loglevel";
57
- typeof u == "string" ? b += ":" + u : typeof u == "symbol" && (b = void 0);
58
- function ke(l) {
57
+ var c = this, z, $, P, _ = "loglevel";
58
+ typeof u == "string" ? _ += ":" + u : typeof u == "symbol" && (_ = void 0);
59
+ function Ee(l) {
59
60
  var p = (s[l] || "silent").toUpperCase();
60
- if (!(typeof window === n || !b)) {
61
+ if (!(typeof window === n || !_)) {
61
62
  try {
62
- window.localStorage[b] = p;
63
+ window.localStorage[_] = p;
63
64
  return;
64
65
  } catch {
65
66
  }
66
67
  try {
67
- window.document.cookie = encodeURIComponent(b) + "=" + p + ";";
68
+ window.document.cookie = encodeURIComponent(_) + "=" + p + ";";
68
69
  } catch {
69
70
  }
70
71
  }
71
72
  }
72
73
  function ee() {
73
74
  var l;
74
- if (!(typeof window === n || !b)) {
75
+ if (!(typeof window === n || !_)) {
75
76
  try {
76
- l = window.localStorage[b];
77
+ l = window.localStorage[_];
77
78
  } catch {
78
79
  }
79
80
  if (typeof l === n)
80
81
  try {
81
- var p = window.document.cookie, O = encodeURIComponent(b), ne = p.indexOf(O + "=");
82
+ var p = window.document.cookie, O = encodeURIComponent(_), ne = p.indexOf(O + "=");
82
83
  ne !== -1 && (l = /^([^;]+)/.exec(
83
84
  p.slice(ne + O.length + 1)
84
85
  )[1]);
@@ -88,13 +89,13 @@ var he = { exports: {} };
88
89
  }
89
90
  }
90
91
  function Te() {
91
- if (!(typeof window === n || !b)) {
92
+ if (!(typeof window === n || !_)) {
92
93
  try {
93
- window.localStorage.removeItem(b);
94
+ window.localStorage.removeItem(_);
94
95
  } catch {
95
96
  }
96
97
  try {
97
- window.document.cookie = encodeURIComponent(b) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
98
+ window.document.cookie = encodeURIComponent(_) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
98
99
  } catch {
99
100
  }
100
101
  }
@@ -113,26 +114,26 @@ var he = { exports: {} };
113
114
  ERROR: 4,
114
115
  SILENT: 5
115
116
  }, c.methodFactory = f || h, c.getLevel = function() {
116
- return x ?? $ ?? J;
117
+ return P ?? $ ?? z;
117
118
  }, c.setLevel = function(l, p) {
118
- return x = U(l), p !== !1 && ke(x), _.call(c);
119
+ return P = U(l), p !== !1 && Ee(P), b.call(c);
119
120
  }, c.setDefaultLevel = function(l) {
120
121
  $ = U(l), ee() || c.setLevel(l, !1);
121
122
  }, c.resetLevel = function() {
122
- x = null, Te(), _.call(c);
123
+ P = null, Te(), b.call(c);
123
124
  }, c.enableAll = function(l) {
124
125
  c.setLevel(c.levels.TRACE, l);
125
126
  }, c.disableAll = function(l) {
126
127
  c.setLevel(c.levels.SILENT, l);
127
128
  }, c.rebuild = function() {
128
- if (i !== c && (J = U(i.getLevel())), _.call(c), i === c)
129
+ if (i !== c && (z = U(i.getLevel())), b.call(c), i === c)
129
130
  for (var l in r)
130
131
  r[l].rebuild();
131
- }, J = U(
132
+ }, z = U(
132
133
  i ? i.getLevel() : "WARN"
133
134
  );
134
135
  var te = ee();
135
- te != null && (x = U(te)), _.call(c);
136
+ te != null && (P = U(te)), b.call(c);
136
137
  }
137
138
  i = new L(), i.getLogger = function(f) {
138
139
  if (typeof f != "symbol" && typeof f != "string" || f === "")
@@ -151,8 +152,8 @@ var he = { exports: {} };
151
152
  }, i.default = i, i;
152
153
  });
153
154
  })(he);
154
- var Je = he.exports;
155
- const oe = /* @__PURE__ */ Ue(Je);
155
+ var Oe = he.exports;
156
+ const oe = /* @__PURE__ */ Ue(Oe);
156
157
  let M;
157
158
  var I, de;
158
159
  (typeof navigator > "u" || !((de = (I = navigator.userAgent) == null ? void 0 : I.startsWith) != null && de.call(I, "Mozilla/5.0 "))) && (M = "oauth4webapi/v2.11.1");
@@ -165,19 +166,19 @@ function q(e, t) {
165
166
  return !1;
166
167
  }
167
168
  }
168
- const K = Symbol(), Oe = Symbol(), V = Symbol(), Ie = new TextEncoder(), Ne = new TextDecoder();
169
+ const K = Symbol(), Ie = Symbol(), V = Symbol(), Ne = new TextEncoder(), Ke = new TextDecoder();
169
170
  function A(e) {
170
- return typeof e == "string" ? Ie.encode(e) : Ne.decode(e);
171
+ return typeof e == "string" ? Ne.encode(e) : Ke.decode(e);
171
172
  }
172
173
  const ie = 32768;
173
- function Ke(e) {
174
+ function We(e) {
174
175
  e instanceof ArrayBuffer && (e = new Uint8Array(e));
175
176
  const t = [];
176
177
  for (let n = 0; n < e.byteLength; n += ie)
177
178
  t.push(String.fromCharCode.apply(null, e.subarray(n, n + ie)));
178
179
  return btoa(t.join("")).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
179
180
  }
180
- function We(e) {
181
+ function De(e) {
181
182
  try {
182
183
  const t = atob(e.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "")), n = new Uint8Array(t.length);
183
184
  for (let o = 0; o < t.length; o++)
@@ -187,10 +188,10 @@ function We(e) {
187
188
  throw new a("The input to be decoded is not correctly encoded.", { cause: t });
188
189
  }
189
190
  }
190
- function k(e) {
191
- return typeof e == "string" ? We(e) : Ke(e);
191
+ function E(e) {
192
+ return typeof e == "string" ? De(e) : We(e);
192
193
  }
193
- class De {
194
+ class He {
194
195
  constructor(t) {
195
196
  this.cache = /* @__PURE__ */ new Map(), this._cache = /* @__PURE__ */ new Map(), this.maxSize = t;
196
197
  }
@@ -220,20 +221,20 @@ class v extends Error {
220
221
  super(t ?? "operation not supported"), this.name = this.constructor.name, (n = Error.captureStackTrace) == null || n.call(Error, this, this.constructor);
221
222
  }
222
223
  }
223
- class He extends Error {
224
+ class $e extends Error {
224
225
  constructor(t, n) {
225
226
  var o;
226
227
  super(t, n), this.name = this.constructor.name, (o = Error.captureStackTrace) == null || o.call(Error, this, this.constructor);
227
228
  }
228
229
  }
229
- const a = He, fe = new De(100);
230
+ const a = $e, fe = new He(100);
230
231
  function pe(e) {
231
232
  return e instanceof CryptoKey;
232
233
  }
233
234
  function we(e) {
234
235
  return pe(e) && e.type === "private";
235
236
  }
236
- function $e(e) {
237
+ function Fe(e) {
237
238
  return pe(e) && e.type === "public";
238
239
  }
239
240
  function Y(e) {
@@ -261,7 +262,7 @@ function Z(e) {
261
262
  throw new TypeError('"options.signal" must return or be an instance of AbortSignal');
262
263
  return e;
263
264
  }
264
- async function Fe(e, t) {
265
+ async function Me(e, t) {
265
266
  if (!(e instanceof URL))
266
267
  throw new TypeError('"issuerIdentifier" must be an instance of URL');
267
268
  if (e.protocol !== "https:" && e.protocol !== "http:")
@@ -289,7 +290,7 @@ async function Fe(e, t) {
289
290
  function w(e) {
290
291
  return typeof e == "string" && e.length !== 0;
291
292
  }
292
- async function Me(e, t) {
293
+ async function Be(e, t) {
293
294
  if (!(e instanceof URL))
294
295
  throw new TypeError('"expectedIssuer" must be an instance of URL');
295
296
  if (!q(t, Response))
@@ -312,20 +313,20 @@ async function Me(e, t) {
312
313
  return n;
313
314
  }
314
315
  function D() {
315
- return k(crypto.getRandomValues(new Uint8Array(32)));
316
+ return E(crypto.getRandomValues(new Uint8Array(32)));
316
317
  }
317
- function Be() {
318
+ function Ge() {
318
319
  return D();
319
320
  }
320
- function Ge() {
321
+ function qe() {
321
322
  return D();
322
323
  }
323
- async function qe(e) {
324
+ async function Ve(e) {
324
325
  if (!w(e))
325
326
  throw new TypeError('"codeVerifier" must be a non-empty string');
326
- return k(await crypto.subtle.digest("SHA-256", A(e)));
327
+ return E(await crypto.subtle.digest("SHA-256", A(e)));
327
328
  }
328
- function Ve(e) {
329
+ function Ye(e) {
329
330
  if (e instanceof CryptoKey)
330
331
  return { key: e };
331
332
  if (!((e == null ? void 0 : e.key) instanceof CryptoKey))
@@ -337,11 +338,11 @@ function Ve(e) {
337
338
  function se(e) {
338
339
  return encodeURIComponent(e).replace(/%20/g, "+");
339
340
  }
340
- function Ye(e, t) {
341
+ function Ze(e, t) {
341
342
  const n = se(e), o = se(t);
342
343
  return `Basic ${btoa(`${n}:${o}`)}`;
343
344
  }
344
- function Ze(e) {
345
+ function Qe(e) {
345
346
  switch (e.algorithm.hash.name) {
346
347
  case "SHA-256":
347
348
  return "PS256";
@@ -353,7 +354,7 @@ function Ze(e) {
353
354
  throw new v("unsupported RsaHashedKeyAlgorithm hash name");
354
355
  }
355
356
  }
356
- function Qe(e) {
357
+ function Xe(e) {
357
358
  switch (e.algorithm.hash.name) {
358
359
  case "SHA-256":
359
360
  return "RS256";
@@ -365,7 +366,7 @@ function Qe(e) {
365
366
  throw new v("unsupported RsaHashedKeyAlgorithm hash name");
366
367
  }
367
368
  }
368
- function Xe(e) {
369
+ function et(e) {
369
370
  switch (e.algorithm.namedCurve) {
370
371
  case "P-256":
371
372
  return "ES256";
@@ -380,11 +381,11 @@ function Xe(e) {
380
381
  function ge(e) {
381
382
  switch (e.algorithm.name) {
382
383
  case "RSA-PSS":
383
- return Ze(e);
384
- case "RSASSA-PKCS1-v1_5":
385
384
  return Qe(e);
386
- case "ECDSA":
385
+ case "RSASSA-PKCS1-v1_5":
387
386
  return Xe(e);
387
+ case "ECDSA":
388
+ return et(e);
388
389
  case "Ed25519":
389
390
  case "Ed448":
390
391
  return "EdDSA";
@@ -396,14 +397,14 @@ function H(e) {
396
397
  const t = e == null ? void 0 : e[K];
397
398
  return typeof t == "number" && Number.isFinite(t) ? t : 0;
398
399
  }
399
- function et(e) {
400
- const t = e == null ? void 0 : e[Oe];
400
+ function tt(e) {
401
+ const t = e == null ? void 0 : e[Ie];
401
402
  return typeof t == "number" && Number.isFinite(t) && Math.sign(t) !== -1 ? t : 30;
402
403
  }
403
404
  function Q() {
404
405
  return Math.floor(Date.now() / 1e3);
405
406
  }
406
- function tt(e, t) {
407
+ function nt(e, t) {
407
408
  const n = Q() + H(t);
408
409
  return {
409
410
  jti: D(),
@@ -415,11 +416,11 @@ function tt(e, t) {
415
416
  sub: t.client_id
416
417
  };
417
418
  }
418
- async function nt(e, t, n, o) {
419
+ async function rt(e, t, n, o) {
419
420
  return me({
420
421
  alg: ge(n),
421
422
  kid: o
422
- }, tt(e, t), n);
423
+ }, nt(e, t), n);
423
424
  }
424
425
  function j(e) {
425
426
  if (typeof e != "object" || e === null)
@@ -428,7 +429,7 @@ function j(e) {
428
429
  throw new TypeError('"as.issuer" property must be a non-empty string');
429
430
  return !0;
430
431
  }
431
- function z(e) {
432
+ function J(e) {
432
433
  if (typeof e != "object" || e === null)
433
434
  throw new TypeError('"client" must be an object');
434
435
  if (!w(e.client_id))
@@ -448,11 +449,11 @@ function ce(e, t) {
448
449
  if (t !== void 0)
449
450
  throw new TypeError(`"client.client_secret" property must not be provided when ${e} client authentication method is used.`);
450
451
  }
451
- async function rt(e, t, n, o, s) {
452
+ async function ot(e, t, n, o, s) {
452
453
  switch (n.delete("client_secret"), n.delete("client_assertion_type"), n.delete("client_assertion"), t.token_endpoint_auth_method) {
453
454
  case void 0:
454
455
  case "client_secret_basic": {
455
- F("client_secret_basic", s), o.set("authorization", Ye(t.client_id, ae(t.client_secret)));
456
+ F("client_secret_basic", s), o.set("authorization", Ze(t.client_id, ae(t.client_secret)));
456
457
  break;
457
458
  }
458
459
  case "client_secret_post": {
@@ -462,10 +463,10 @@ async function rt(e, t, n, o, s) {
462
463
  case "private_key_jwt": {
463
464
  if (ce("private_key_jwt", t.client_secret), s === void 0)
464
465
  throw new TypeError('"options.clientPrivateKey" must be provided when "client.token_endpoint_auth_method" is "private_key_jwt"');
465
- const { key: r, kid: i } = Ve(s);
466
+ const { key: r, kid: i } = Ye(s);
466
467
  if (!we(r))
467
468
  throw new TypeError('"options.clientPrivateKey.key" must be a private CryptoKey');
468
- n.set("client_id", t.client_id), n.set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), n.set("client_assertion", await nt(e, t, r, i));
469
+ n.set("client_id", t.client_id), n.set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), n.set("client_assertion", await rt(e, t, r, i));
469
470
  break;
470
471
  }
471
472
  case "tls_client_auth":
@@ -481,59 +482,59 @@ async function rt(e, t, n, o, s) {
481
482
  async function me(e, t, n) {
482
483
  if (!n.usages.includes("sign"))
483
484
  throw new TypeError('CryptoKey instances used for signing assertions must include "sign" in their "usages"');
484
- const o = `${k(A(JSON.stringify(e)))}.${k(A(JSON.stringify(t)))}`, s = k(await crypto.subtle.sign(Se(n), n, A(o)));
485
+ const o = `${E(A(JSON.stringify(e)))}.${E(A(JSON.stringify(t)))}`, s = E(await crypto.subtle.sign(Se(n), n, A(o)));
485
486
  return `${o}.${s}`;
486
487
  }
487
- async function ot(e, t, n, o, s, r) {
488
+ async function it(e, t, n, o, s, r) {
488
489
  const { privateKey: i, publicKey: d, nonce: g = fe.get(n.origin) } = t;
489
490
  if (!we(i))
490
491
  throw new TypeError('"DPoP.privateKey" must be a private CryptoKey');
491
- if (!$e(d))
492
+ if (!Fe(d))
492
493
  throw new TypeError('"DPoP.publicKey" must be a public CryptoKey');
493
494
  if (g !== void 0 && !w(g))
494
495
  throw new TypeError('"DPoP.nonce" must be a non-empty string or undefined');
495
496
  if (!d.extractable)
496
497
  throw new TypeError('"DPoP.publicKey.extractable" must be true');
497
- const m = Q() + s, _ = await me({
498
+ const m = Q() + s, b = await me({
498
499
  alg: ge(i),
499
500
  typ: "dpop+jwt",
500
- jwk: await st(d)
501
+ jwk: await at(d)
501
502
  }, {
502
503
  iat: m,
503
504
  jti: D(),
504
505
  htm: o,
505
506
  nonce: g,
506
507
  htu: `${n.origin}${n.pathname}`,
507
- ath: r ? k(await crypto.subtle.digest("SHA-256", A(r))) : void 0
508
+ ath: r ? E(await crypto.subtle.digest("SHA-256", A(r))) : void 0
508
509
  }, i);
509
- e.set("dpop", _);
510
+ e.set("dpop", b);
510
511
  }
511
512
  let N;
512
- async function it(e) {
513
+ async function st(e) {
513
514
  const { kty: t, e: n, n: o, x: s, y: r, crv: i } = await crypto.subtle.exportKey("jwk", e), d = { kty: t, e: n, n: o, x: s, y: r, crv: i };
514
515
  return N.set(e, d), d;
515
516
  }
516
- async function st(e) {
517
- return N || (N = /* @__PURE__ */ new WeakMap()), N.get(e) || it(e);
517
+ async function at(e) {
518
+ return N || (N = /* @__PURE__ */ new WeakMap()), N.get(e) || st(e);
518
519
  }
519
- function at(e, t, n) {
520
+ function ct(e, t, n) {
520
521
  if (typeof e != "string")
521
522
  throw new TypeError(`"as.${t}" must be a string`);
522
523
  return new URL(e);
523
524
  }
524
525
  function ye(e, t, n) {
525
- return at(e[t], t);
526
+ return ct(e[t], t);
526
527
  }
527
528
  function B(e) {
528
529
  const t = e;
529
530
  return typeof t != "object" || Array.isArray(t) || t === null ? !1 : t.error !== void 0;
530
531
  }
531
- async function ct(e, t, n, o, s, r) {
532
+ async function ut(e, t, n, o, s, r) {
532
533
  if (!w(e))
533
534
  throw new TypeError('"accessToken" must be a non-empty string');
534
535
  if (!(n instanceof URL))
535
536
  throw new TypeError('"url" must be an instance of URL');
536
- return o = W(o), (r == null ? void 0 : r.DPoP) === void 0 ? o.set("authorization", `Bearer ${e}`) : (await ot(o, r.DPoP, n, "GET", H({ [K]: r == null ? void 0 : r[K] }), e), o.set("authorization", `DPoP ${e}`)), ((r == null ? void 0 : r[V]) || fetch)(n.href, {
537
+ return o = W(o), (r == null ? void 0 : r.DPoP) === void 0 ? o.set("authorization", `Bearer ${e}`) : (await it(o, r.DPoP, n, "GET", H({ [K]: r == null ? void 0 : r[K] }), e), o.set("authorization", `DPoP ${e}`)), ((r == null ? void 0 : r[V]) || fetch)(n.href, {
537
538
  body: s,
538
539
  headers: Object.fromEntries(o.entries()),
539
540
  method: t,
@@ -541,16 +542,16 @@ async function ct(e, t, n, o, s, r) {
541
542
  signal: r != null && r.signal ? Z(r.signal) : null
542
543
  }).then(Y);
543
544
  }
544
- async function ut(e, t, n, o) {
545
- j(e), z(t);
545
+ async function lt(e, t, n, o) {
546
+ j(e), J(t);
546
547
  const s = ye(e, "userinfo_endpoint"), r = W(o == null ? void 0 : o.headers);
547
- return t.userinfo_signed_response_alg ? r.set("accept", "application/jwt") : (r.set("accept", "application/json"), r.append("accept", "application/jwt")), ct(n, "GET", s, r, null, {
548
+ return t.userinfo_signed_response_alg ? r.set("accept", "application/jwt") : (r.set("accept", "application/json"), r.append("accept", "application/jwt")), ut(n, "GET", s, r, null, {
548
549
  ...o,
549
550
  [K]: H(t)
550
551
  });
551
552
  }
552
- async function lt(e, t, n, o, s, r, i) {
553
- return await rt(e, t, s, r, i == null ? void 0 : i.clientPrivateKey), r.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"), ((i == null ? void 0 : i[V]) || fetch)(o.href, {
553
+ async function dt(e, t, n, o, s, r, i) {
554
+ return await ot(e, t, s, r, i == null ? void 0 : i.clientPrivateKey), r.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"), ((i == null ? void 0 : i[V]) || fetch)(o.href, {
554
555
  body: s,
555
556
  headers: Object.fromEntries(r.entries()),
556
557
  method: n,
@@ -558,25 +559,25 @@ async function lt(e, t, n, o, s, r, i) {
558
559
  signal: i != null && i.signal ? Z(i.signal) : null
559
560
  }).then(Y);
560
561
  }
561
- async function _e(e, t, n, o, s) {
562
+ async function be(e, t, n, o, s) {
562
563
  const r = ye(e, "token_endpoint");
563
564
  o.set("grant_type", n);
564
565
  const i = W(s == null ? void 0 : s.headers);
565
- return i.set("accept", "application/json"), lt(e, t, "POST", r, o, i, s);
566
+ return i.set("accept", "application/json"), dt(e, t, "POST", r, o, i, s);
566
567
  }
567
- async function dt(e, t, n, o) {
568
- if (j(e), z(t), !w(n))
568
+ async function ht(e, t, n, o) {
569
+ if (j(e), J(t), !w(n))
569
570
  throw new TypeError('"refreshToken" must be a non-empty string');
570
571
  const s = new URLSearchParams(o == null ? void 0 : o.additionalParameters);
571
- return s.set("refresh_token", n), _e(e, t, "refresh_token", s, o);
572
+ return s.set("refresh_token", n), be(e, t, "refresh_token", s, o);
572
573
  }
573
- const ht = /* @__PURE__ */ new WeakMap();
574
- async function be(e, t, n, o = !1, s = !1) {
575
- if (j(e), z(t), !q(n, Response))
574
+ const ft = /* @__PURE__ */ new WeakMap();
575
+ async function _e(e, t, n, o = !1, s = !1) {
576
+ if (j(e), J(t), !q(n, Response))
576
577
  throw new TypeError('"response" must be an instance of Response');
577
578
  if (n.status !== 200) {
578
579
  let i;
579
- if (i = await vt(n))
580
+ if (i = await St(n))
580
581
  return i;
581
582
  throw new a('"response" is not a conform Token Endpoint response');
582
583
  }
@@ -605,20 +606,20 @@ async function be(e, t, n, o = !1, s = !1) {
605
606
  if (r.id_token !== void 0 && !w(r.id_token))
606
607
  throw new a('"response" body "id_token" property must be a non-empty string');
607
608
  if (r.id_token) {
608
- const { claims: i } = await Et(r.id_token, kt.bind(void 0, t.id_token_signed_response_alg, e.id_token_signing_alg_values_supported), Ee, H(t), et(t)).then(_t.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(wt.bind(void 0, e.issuer)).then(pt.bind(void 0, t.client_id));
609
+ const { claims: i } = await Et(r.id_token, Tt.bind(void 0, t.id_token_signed_response_alg, e.id_token_signing_alg_values_supported), ke, H(t), tt(t)).then(_t.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(gt.bind(void 0, e.issuer)).then(wt.bind(void 0, t.client_id));
609
610
  if (Array.isArray(i.aud) && i.aud.length !== 1 && i.azp !== t.client_id)
610
611
  throw new a('unexpected ID Token "azp" (authorized party) claim value');
611
612
  if (i.auth_time !== void 0 && (!Number.isFinite(i.auth_time) || Math.sign(i.auth_time) !== 1))
612
613
  throw new a('ID Token "auth_time" (authentication time) must be a positive number');
613
- ht.set(r, i);
614
+ ft.set(r, i);
614
615
  }
615
616
  }
616
617
  return r;
617
618
  }
618
- async function ft(e, t, n) {
619
- return be(e, t, n);
619
+ async function pt(e, t, n) {
620
+ return _e(e, t, n);
620
621
  }
621
- function pt(e, t) {
622
+ function wt(e, t) {
622
623
  if (Array.isArray(t.claims.aud)) {
623
624
  if (!t.claims.aud.includes(e))
624
625
  throw new a('unexpected JWT "aud" (audience) claim value');
@@ -626,29 +627,29 @@ function pt(e, t) {
626
627
  throw new a('unexpected JWT "aud" (audience) claim value');
627
628
  return t;
628
629
  }
629
- function wt(e, t) {
630
+ function gt(e, t) {
630
631
  if (t.claims.iss !== e)
631
632
  throw new a('unexpected JWT "iss" (issuer) claim value');
632
633
  return t;
633
634
  }
634
635
  const ve = /* @__PURE__ */ new WeakSet();
635
- function gt(e) {
636
+ function mt(e) {
636
637
  return ve.add(e), e;
637
638
  }
638
- async function mt(e, t, n, o, s, r) {
639
- if (j(e), z(t), !ve.has(n))
639
+ async function yt(e, t, n, o, s, r) {
640
+ if (j(e), J(t), !ve.has(n))
640
641
  throw new TypeError('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()');
641
642
  if (!w(o))
642
643
  throw new TypeError('"redirectUri" must be a non-empty string');
643
644
  if (!w(s))
644
645
  throw new TypeError('"codeVerifier" must be a non-empty string');
645
- const i = E(n, "code");
646
+ const i = k(n, "code");
646
647
  if (!i)
647
648
  throw new a('no authorization code in "callbackParameters"');
648
649
  const d = new URLSearchParams(r == null ? void 0 : r.additionalParameters);
649
- return d.set("redirect_uri", o), d.set("code_verifier", s), d.set("code", i), _e(e, t, "authorization_code", d, r);
650
+ return d.set("redirect_uri", o), d.set("code_verifier", s), d.set("code", i), be(e, t, "authorization_code", d, r);
650
651
  }
651
- const yt = {
652
+ const bt = {
652
653
  aud: "audience",
653
654
  c_hash: "code hash",
654
655
  client_id: "client id",
@@ -667,11 +668,11 @@ const yt = {
667
668
  function _t(e, t) {
668
669
  for (const n of e)
669
670
  if (t.claims[n] === void 0)
670
- throw new a(`JWT "${n}" (${yt[n]}) claim missing`);
671
+ throw new a(`JWT "${n}" (${bt[n]}) claim missing`);
671
672
  return t;
672
673
  }
673
- async function bt(e, t, n) {
674
- const o = await be(e, t, n, !0);
674
+ async function vt(e, t, n) {
675
+ const o = await _e(e, t, n, !0);
675
676
  if (B(o))
676
677
  return o;
677
678
  if (o.id_token !== void 0) {
@@ -685,7 +686,7 @@ function X(e) {
685
686
  if (e.bodyUsed)
686
687
  throw new TypeError('"response" body has been used already');
687
688
  }
688
- async function vt(e) {
689
+ async function St(e) {
689
690
  if (e.status > 399 && e.status < 500) {
690
691
  X(e);
691
692
  try {
@@ -700,7 +701,7 @@ function ue(e) {
700
701
  if (typeof e.modulusLength != "number" || e.modulusLength < 2048)
701
702
  throw new a(`${e.name} modulusLength must be at least 2048 bits`);
702
703
  }
703
- function St(e) {
704
+ function kt(e) {
704
705
  switch (e) {
705
706
  case "P-256":
706
707
  return "SHA-256";
@@ -717,7 +718,7 @@ function Se(e) {
717
718
  case "ECDSA":
718
719
  return {
719
720
  name: e.algorithm.name,
720
- hash: St(e.algorithm.namedCurve)
721
+ hash: kt(e.algorithm.namedCurve)
721
722
  };
722
723
  case "RSA-PSS":
723
724
  switch (ue(e.algorithm), e.algorithm.hash.name) {
@@ -739,7 +740,7 @@ function Se(e) {
739
740
  }
740
741
  throw new v();
741
742
  }
742
- const Ee = Symbol();
743
+ const ke = Symbol();
743
744
  async function Et(e, t, n, o, s) {
744
745
  const { 0: r, 1: i, 2: d, length: g } = e.split(".");
745
746
  if (g === 5)
@@ -748,7 +749,7 @@ async function Et(e, t, n, o, s) {
748
749
  throw new a("Invalid JWT");
749
750
  let m;
750
751
  try {
751
- m = JSON.parse(A(k(r)));
752
+ m = JSON.parse(A(E(r)));
752
753
  } catch (R) {
753
754
  throw new a("failed to parse JWT Header body as base64url encoded JSON", { cause: R });
754
755
  }
@@ -756,17 +757,17 @@ async function Et(e, t, n, o, s) {
756
757
  throw new a("JWT Header must be a top level object");
757
758
  if (t(m), m.crit !== void 0)
758
759
  throw new a('unexpected JWT "crit" header parameter');
759
- const _ = k(d);
760
+ const b = E(d);
760
761
  let y;
761
- if (n !== Ee) {
762
+ if (n !== ke) {
762
763
  y = await n(m);
763
764
  const R = `${r}.${i}`;
764
- if (!await crypto.subtle.verify(Se(y), y, _, A(R)))
765
+ if (!await crypto.subtle.verify(Se(y), y, b, A(R)))
765
766
  throw new a("JWT signature verification failed");
766
767
  }
767
768
  let h;
768
769
  try {
769
- h = JSON.parse(A(k(i)));
770
+ h = JSON.parse(A(E(i)));
770
771
  } catch (R) {
771
772
  throw new a("failed to parse JWT Payload body as base64url encoded JSON", { cause: R });
772
773
  }
@@ -791,9 +792,9 @@ async function Et(e, t, n, o, s) {
791
792
  }
792
793
  if (h.aud !== void 0 && typeof h.aud != "string" && !Array.isArray(h.aud))
793
794
  throw new a('unexpected JWT "aud" (audience) claim type');
794
- return { header: m, claims: h, signature: _, key: y };
795
+ return { header: m, claims: h, signature: b, key: y };
795
796
  }
796
- function kt(e, t, n) {
797
+ function Tt(e, t, n) {
797
798
  if (e !== void 0) {
798
799
  if (n.alg !== e)
799
800
  throw new a('unexpected JWT "alg" header parameter');
@@ -807,30 +808,30 @@ function kt(e, t, n) {
807
808
  if (n.alg !== "RS256")
808
809
  throw new a('unexpected JWT "alg" header parameter');
809
810
  }
810
- function E(e, t) {
811
+ function k(e, t) {
811
812
  const { 0: n, length: o } = e.getAll(t);
812
813
  if (o > 1)
813
814
  throw new a(`"${t}" parameter must be provided only once`);
814
815
  return n;
815
816
  }
816
- const Tt = Symbol(), At = Symbol();
817
- function Rt(e, t, n, o) {
818
- if (j(e), z(t), n instanceof URL && (n = n.searchParams), !(n instanceof URLSearchParams))
817
+ const At = Symbol(), Rt = Symbol();
818
+ function Pt(e, t, n, o) {
819
+ if (j(e), J(t), n instanceof URL && (n = n.searchParams), !(n instanceof URLSearchParams))
819
820
  throw new TypeError('"parameters" must be an instance of URLSearchParams, or URL');
820
- if (E(n, "response"))
821
+ if (k(n, "response"))
821
822
  throw new a('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()');
822
- const s = E(n, "iss"), r = E(n, "state");
823
+ const s = k(n, "iss"), r = k(n, "state");
823
824
  if (!s && e.authorization_response_iss_parameter_supported)
824
825
  throw new a('response parameter "iss" (issuer) missing');
825
826
  if (s && s !== e.issuer)
826
827
  throw new a('unexpected "iss" (issuer) response parameter value');
827
828
  switch (o) {
828
829
  case void 0:
829
- case At:
830
+ case Rt:
830
831
  if (r !== void 0)
831
832
  throw new a('unexpected "state" response parameter encountered');
832
833
  break;
833
- case Tt:
834
+ case At:
834
835
  break;
835
836
  default:
836
837
  if (!w(o))
@@ -840,21 +841,21 @@ function Rt(e, t, n, o) {
840
841
  if (r !== o)
841
842
  throw new a('unexpected "state" response parameter value');
842
843
  }
843
- const i = E(n, "error");
844
+ const i = k(n, "error");
844
845
  if (i)
845
846
  return {
846
847
  error: i,
847
- error_description: E(n, "error_description"),
848
- error_uri: E(n, "error_uri")
848
+ error_description: k(n, "error_description"),
849
+ error_uri: k(n, "error_uri")
849
850
  };
850
- const d = E(n, "id_token"), g = E(n, "token");
851
+ const d = k(n, "id_token"), g = k(n, "token");
851
852
  if (d !== void 0 || g !== void 0)
852
853
  throw new v("implicit and hybrid flows are not supported");
853
- return gt(new URLSearchParams(n));
854
+ return mt(new URLSearchParams(n));
854
855
  }
855
- class P extends Error {
856
+ class x extends Error {
856
857
  }
857
- class G extends P {
858
+ class G extends x {
858
859
  constructor(t, n, o) {
859
860
  super(t, o), this.error = n;
860
861
  }
@@ -862,7 +863,7 @@ class G extends P {
862
863
  function xt({
863
864
  handleCallback: e
864
865
  }) {
865
- const t = Ce(!1), [n, o] = je(void 0), s = Pe();
866
+ const t = je(!1), [n, o] = Je(void 0), s = xe();
866
867
  return ze(() => {
867
868
  t.current || (t.current = !0, e().then(() => {
868
869
  s("/");
@@ -885,7 +886,21 @@ function xt({
885
886
  ] }) : /* @__PURE__ */ T.jsx("div", { children: "Loading..." });
886
887
  }
887
888
  const le = "code-verifier";
888
- class Pt {
889
+ class Lt extends Ce {
890
+ constructor(t, n) {
891
+ super(), this.callbackUrlPath = t, this.handleCallback = n;
892
+ }
893
+ getRoutes() {
894
+ return [
895
+ ...super.getRoutes(),
896
+ {
897
+ path: this.callbackUrlPath,
898
+ element: /* @__PURE__ */ T.jsx(xt, { handleCallback: this.handleCallback })
899
+ }
900
+ ];
901
+ }
902
+ }
903
+ class Ut {
889
904
  constructor({
890
905
  issuer: t,
891
906
  authorizationEndpoint: n,
@@ -903,10 +918,10 @@ class Pt {
903
918
  S(this, "handleCallback", async () => {
904
919
  const t = new URL(window.location.href), n = t.searchParams.get("state"), o = localStorage.getItem(le);
905
920
  if (!o)
906
- throw new P(
921
+ throw new x(
907
922
  "Code verifier not found. Invalid auth state."
908
923
  );
909
- const s = await this.getAuthServer(), r = Rt(
924
+ const s = await this.getAuthServer(), r = Pt(
910
925
  s,
911
926
  this.client,
912
927
  t.searchParams,
@@ -919,19 +934,19 @@ class Pt {
919
934
  );
920
935
  const i = new URL(t);
921
936
  i.pathname = this.callbackUrlPath, i.search = "";
922
- const d = await mt(
937
+ const d = await yt(
923
938
  s,
924
939
  this.client,
925
940
  r,
926
941
  i.toString(),
927
942
  o
928
- ), g = await bt(
943
+ ), g = await vt(
929
944
  s,
930
945
  this.client,
931
946
  d
932
947
  );
933
948
  this.setTokensFromResponse(g);
934
- const m = await this.getAccessToken(), y = await (await ut(
949
+ const m = await this.getAccessToken(), y = await (await lt(
935
950
  s,
936
951
  this.client,
937
952
  m
@@ -963,8 +978,8 @@ class Pt {
963
978
  code_challenge_methods_supported: []
964
979
  };
965
980
  else {
966
- const t = new URL(this.issuer), n = await Fe(t);
967
- this.authorizationServer = await Me(
981
+ const t = new URL(this.issuer), n = await Me(t);
982
+ this.authorizationServer = await Be(
968
983
  t,
969
984
  n
970
985
  );
@@ -979,7 +994,7 @@ class Pt {
979
994
  if (B(t))
980
995
  throw oe.error("Bad Token Response", t), new G("Bad Token Response", t);
981
996
  if (!t.expires_in)
982
- throw new P("No expires_in in response");
997
+ throw new x("No expires_in in response");
983
998
  this.tokens = {
984
999
  accessToken: t.access_token,
985
1000
  refreshToken: t.refresh_token,
@@ -987,14 +1002,12 @@ class Pt {
987
1002
  tokenType: t.token_type
988
1003
  };
989
1004
  }
990
- async initialize() {
991
- }
992
1005
  async login() {
993
1006
  var d;
994
1007
  const t = "S256", n = await this.getAuthServer();
995
1008
  if (!n.authorization_endpoint)
996
- throw new P("No authorization endpoint");
997
- const o = Be(), s = await qe(o);
1009
+ throw new x("No authorization endpoint");
1010
+ const o = Ge(), s = await Ve(o);
998
1011
  localStorage.setItem(le, o);
999
1012
  const r = new URL(
1000
1013
  n.authorization_endpoint
@@ -1003,7 +1016,7 @@ class Pt {
1003
1016
  "code_challenge_method",
1004
1017
  t
1005
1018
  ), ((d = n.code_challenge_methods_supported) == null ? void 0 : d.includes("S256")) !== !0) {
1006
- const g = Ge();
1019
+ const g = qe();
1007
1020
  r.searchParams.set("state", g);
1008
1021
  }
1009
1022
  location.href = r.href;
@@ -1011,17 +1024,17 @@ class Pt {
1011
1024
  async getAccessToken() {
1012
1025
  const t = await this.getAuthServer();
1013
1026
  if (!this.tokens)
1014
- throw new P("User is not authenticated");
1027
+ throw new x("User is not authenticated");
1015
1028
  if (this.tokens.expiresOn < /* @__PURE__ */ new Date()) {
1016
1029
  if (!this.tokens.refreshToken)
1017
- throw new P(
1030
+ throw new x(
1018
1031
  "Token expired and no refresh token available"
1019
1032
  );
1020
- const n = await dt(
1033
+ const n = await ht(
1021
1034
  t,
1022
1035
  this.client,
1023
1036
  this.tokens.refreshToken
1024
- ), o = await ft(
1037
+ ), o = await pt(
1025
1038
  t,
1026
1039
  this.client,
1027
1040
  n
@@ -1044,18 +1057,16 @@ class Pt {
1044
1057
  n.toString()
1045
1058
  )) : o = n;
1046
1059
  }
1047
- getRoutes() {
1048
- return [
1049
- {
1050
- path: this.callbackUrlPath,
1051
- element: /* @__PURE__ */ T.jsx(xt, { handleCallback: this.handleCallback })
1052
- }
1053
- ];
1060
+ getAuthenticationPlugin() {
1061
+ return new Lt(
1062
+ this.callbackUrlPath,
1063
+ () => this.handleCallback()
1064
+ );
1054
1065
  }
1055
1066
  }
1056
- const Jt = (e) => new Pt(e);
1067
+ const Nt = (e) => new Ut(e);
1057
1068
  export {
1058
- Pt as OpenIDAuthenticationProvider,
1059
- Jt as default
1069
+ Ut as OpenIDAuthenticationProvider,
1070
+ Nt as default
1060
1071
  };
1061
1072
  //# sourceMappingURL=zudoku.auth-openid.js.map