zudoku 0.3.0-dev.60 → 0.3.0-dev.62

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