@axa-fr/oidc-client 7.15.0-alpha.1286 → 7.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,26 +1,26 @@
1
1
  const L = console;
2
- class Ee {
3
- constructor(e, s, t, o = 2e3, i = !0) {
4
- this._callback = e, this._client_id = s, this._url = t, this._interval = o || 2e3, this._stopOnError = i;
2
+ class Oe {
3
+ constructor(s, n, t, o = 2e3, i = !0) {
4
+ this._callback = s, this._client_id = n, this._url = t, this._interval = o || 2e3, this._stopOnError = i;
5
5
  const r = t.indexOf("/", t.indexOf("//") + 2);
6
6
  this._frame_origin = t.substr(0, r), this._frame = window.document.createElement("iframe"), this._frame.style.visibility = "hidden", this._frame.style.position = "absolute", this._frame.style.display = "none", this._frame.width = 0, this._frame.height = 0, this._frame.src = t;
7
7
  }
8
8
  load() {
9
- return new Promise((e) => {
9
+ return new Promise((s) => {
10
10
  this._frame.onload = () => {
11
- e();
11
+ s();
12
12
  }, window.document.body.appendChild(this._frame), this._boundMessageEvent = this._message.bind(this), window.addEventListener("message", this._boundMessageEvent, !1);
13
13
  });
14
14
  }
15
- _message(e) {
16
- e.origin === this._frame_origin && e.source === this._frame.contentWindow && (e.data === "error" ? (L.error("CheckSessionIFrame: error message from check session op iframe"), this._stopOnError && this.stop()) : e.data === "changed" ? (L.debug(e), L.debug("CheckSessionIFrame: changed message from check session op iframe"), this.stop(), this._callback()) : L.debug("CheckSessionIFrame: " + e.data + " message from check session op iframe"));
15
+ _message(s) {
16
+ s.origin === this._frame_origin && s.source === this._frame.contentWindow && (s.data === "error" ? (L.error("CheckSessionIFrame: error message from check session op iframe"), this._stopOnError && this.stop()) : s.data === "changed" ? (L.debug(s), L.debug("CheckSessionIFrame: changed message from check session op iframe"), this.stop(), this._callback()) : L.debug("CheckSessionIFrame: " + s.data + " message from check session op iframe"));
17
17
  }
18
- start(e) {
19
- L.debug("CheckSessionIFrame.start :" + e), this.stop();
20
- const s = () => {
21
- this._frame.contentWindow.postMessage(this._client_id + " " + e, this._frame_origin);
18
+ start(s) {
19
+ L.debug("CheckSessionIFrame.start :" + s), this.stop();
20
+ const n = () => {
21
+ this._frame.contentWindow.postMessage(this._client_id + " " + s, this._frame_origin);
22
22
  };
23
- s(), this._timer = window.setInterval(s, this._interval);
23
+ n(), this._timer = window.setInterval(n, this._interval);
24
24
  }
25
25
  stop() {
26
26
  this._timer && (L.debug("CheckSessionIFrame.stop"), window.clearInterval(this._timer), this._timer = null);
@@ -54,26 +54,26 @@ const m = {
54
54
  syncTokensAsync_lock_not_available: "syncTokensAsync_lock_not_available",
55
55
  syncTokensAsync_end: "syncTokensAsync_end",
56
56
  syncTokensAsync_error: "syncTokensAsync_error"
57
- }, I = (n, e = sessionStorage) => {
58
- const s = (p) => (e[`oidc.${n}`] = JSON.stringify({ tokens: null, status: p }), Promise.resolve()), t = async () => {
59
- if (!e[`oidc.${n}`])
60
- return e[`oidc.${n}`] = JSON.stringify({ tokens: null, status: null }), { tokens: null, status: null };
61
- const p = JSON.parse(e[`oidc.${n}`]);
57
+ }, I = (e, s = sessionStorage) => {
58
+ const n = (p) => (s[`oidc.${e}`] = JSON.stringify({ tokens: null, status: p }), Promise.resolve()), t = async () => {
59
+ if (!s[`oidc.${e}`])
60
+ return s[`oidc.${e}`] = JSON.stringify({ tokens: null, status: null }), { tokens: null, status: null };
61
+ const p = JSON.parse(s[`oidc.${e}`]);
62
62
  return Promise.resolve({ tokens: p.tokens, status: p.status });
63
63
  }, o = (p) => {
64
- e[`oidc.${n}`] = JSON.stringify({ tokens: p });
64
+ s[`oidc.${e}`] = JSON.stringify({ tokens: p });
65
65
  }, i = async (p) => {
66
- e[`oidc.session_state.${n}`] = p;
67
- }, r = async () => e[`oidc.session_state.${n}`], c = (p) => {
68
- e[`oidc.nonce.${n}`] = p.nonce;
66
+ s[`oidc.session_state.${e}`] = p;
67
+ }, r = async () => s[`oidc.session_state.${e}`], c = (p) => {
68
+ s[`oidc.nonce.${e}`] = p.nonce;
69
69
  }, a = (p) => {
70
- e[`oidc.jwk.${n}`] = JSON.stringify(p);
71
- }, u = () => JSON.parse(e[`oidc.jwk.${n}`]), f = async () => ({ nonce: e[`oidc.nonce.${n}`] }), d = async (p) => {
72
- e[`oidc.dpop_nonce.${n}`] = p;
73
- }, l = () => e[`oidc.dpop_nonce.${n}`], _ = () => e[`oidc.${n}`] ? JSON.stringify({ tokens: JSON.parse(e[`oidc.${n}`]).tokens }) : null;
70
+ s[`oidc.jwk.${e}`] = JSON.stringify(p);
71
+ }, u = () => JSON.parse(s[`oidc.jwk.${e}`]), f = async () => ({ nonce: s[`oidc.nonce.${e}`] }), d = async (p) => {
72
+ s[`oidc.dpop_nonce.${e}`] = p;
73
+ }, l = () => s[`oidc.dpop_nonce.${e}`], _ = () => s[`oidc.${e}`] ? JSON.stringify({ tokens: JSON.parse(s[`oidc.${e}`]).tokens }) : null;
74
74
  let y = {};
75
75
  return {
76
- clearAsync: s,
76
+ clearAsync: n,
77
77
  initAsync: t,
78
78
  setTokens: o,
79
79
  getTokens: _,
@@ -82,110 +82,110 @@ const m = {
82
82
  setNonceAsync: c,
83
83
  getNonceAsync: f,
84
84
  setLoginParams: (p) => {
85
- y[n] = p, e[`oidc.login.${n}`] = JSON.stringify(p);
85
+ y[e] = p, s[`oidc.login.${e}`] = JSON.stringify(p);
86
86
  },
87
87
  getLoginParams: () => {
88
- const p = e[`oidc.login.${n}`];
89
- return y[n] || (y[n] = JSON.parse(p)), y[n];
88
+ const p = s[`oidc.login.${e}`];
89
+ return y[e] || (y[e] = JSON.parse(p)), y[e];
90
90
  },
91
- getStateAsync: async () => e[`oidc.state.${n}`],
91
+ getStateAsync: async () => s[`oidc.state.${e}`],
92
92
  setStateAsync: async (p) => {
93
- e[`oidc.state.${n}`] = p;
93
+ s[`oidc.state.${e}`] = p;
94
94
  },
95
- getCodeVerifierAsync: async () => e[`oidc.code_verifier.${n}`],
95
+ getCodeVerifierAsync: async () => s[`oidc.code_verifier.${e}`],
96
96
  setCodeVerifierAsync: async (p) => {
97
- e[`oidc.code_verifier.${n}`] = p;
97
+ s[`oidc.code_verifier.${e}`] = p;
98
98
  },
99
99
  setDemonstratingProofOfPossessionNonce: d,
100
100
  getDemonstratingProofOfPossessionNonce: l,
101
101
  setDemonstratingProofOfPossessionJwkAsync: a,
102
102
  getDemonstratingProofOfPossessionJwkAsync: u
103
103
  };
104
- }, Ie = (n) => decodeURIComponent(Array.prototype.map.call(atob(n), (e) => "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2)).join("")), Ce = (n) => JSON.parse(Ie(n.replace(/-/g, "+").replace(/_/g, "/"))), ce = (n) => {
104
+ }, Ee = (e) => decodeURIComponent(Array.prototype.map.call(atob(e), (s) => "%" + ("00" + s.charCodeAt(0).toString(16)).slice(-2)).join("")), Ie = (e) => JSON.parse(Ee(e.replace(/-/g, "+").replace(/_/g, "/"))), ce = (e) => {
105
105
  try {
106
- return n && Ne(n, ".") === 2 ? Ce(n.split(".")[1]) : null;
107
- } catch (e) {
108
- console.warn(e);
106
+ return e && Ce(e, ".") === 2 ? Ie(e.split(".")[1]) : null;
107
+ } catch (s) {
108
+ console.warn(s);
109
109
  }
110
110
  return null;
111
- }, Ne = (n, e) => n.split(e).length - 1, z = {
111
+ }, Ce = (e, s) => e.split(s).length - 1, z = {
112
112
  access_token_or_id_token_invalid: "access_token_or_id_token_invalid",
113
113
  access_token_invalid: "access_token_invalid",
114
114
  id_token_invalid: "id_token_invalid"
115
115
  };
116
- function xe(n, e, s) {
117
- if (n.issuedAt) {
118
- if (typeof n.issuedAt == "string")
119
- return parseInt(n.issuedAt, 10);
116
+ function Ne(e, s, n) {
117
+ if (e.issuedAt) {
118
+ if (typeof e.issuedAt == "string")
119
+ return parseInt(e.issuedAt, 10);
120
120
  } else
121
- return e && e.iat ? e.iat : s && s.iat ? s.iat : (/* @__PURE__ */ new Date()).getTime() / 1e3;
122
- return n.issuedAt;
121
+ return s && s.iat ? s.iat : n && n.iat ? n.iat : (/* @__PURE__ */ new Date()).getTime() / 1e3;
122
+ return e.issuedAt;
123
123
  }
124
- const te = (n, e = null, s) => {
125
- if (!n)
124
+ const te = (e, s = null, n) => {
125
+ if (!e)
126
126
  return null;
127
127
  let t;
128
- const o = typeof n.expiresIn == "string" ? parseInt(n.expiresIn, 10) : n.expiresIn;
129
- n.accessTokenPayload !== void 0 ? t = n.accessTokenPayload : t = ce(n.accessToken);
128
+ const o = typeof e.expiresIn == "string" ? parseInt(e.expiresIn, 10) : e.expiresIn;
129
+ e.accessTokenPayload !== void 0 ? t = e.accessTokenPayload : t = ce(e.accessToken);
130
130
  let i;
131
- e != null && "idToken" in e && !("idToken" in n) ? i = e.idToken : i = n.idToken;
132
- const r = n.idTokenPayload ? n.idTokenPayload : ce(i), c = r && r.exp ? r.exp : Number.MAX_VALUE, a = t && t.exp ? t.exp : n.issuedAt + o;
133
- n.issuedAt = xe(n, t, r);
131
+ s != null && "idToken" in s && !("idToken" in e) ? i = s.idToken : i = e.idToken;
132
+ const r = e.idTokenPayload ? e.idTokenPayload : ce(i), c = r && r.exp ? r.exp : Number.MAX_VALUE, a = t && t.exp ? t.exp : e.issuedAt + o;
133
+ e.issuedAt = Ne(e, t, r);
134
134
  let u;
135
- n.expiresAt ? u = n.expiresAt : s === z.access_token_invalid ? u = a : s === z.id_token_invalid ? u = c : u = c < a ? c : a;
136
- const f = { ...n, idTokenPayload: r, accessTokenPayload: t, expiresAt: u, idToken: i };
137
- if (e != null && "refreshToken" in e && !("refreshToken" in n)) {
138
- const d = e.refreshToken;
135
+ e.expiresAt ? u = e.expiresAt : n === z.access_token_invalid ? u = a : n === z.id_token_invalid ? u = c : u = c < a ? c : a;
136
+ const f = { ...e, idTokenPayload: r, accessTokenPayload: t, expiresAt: u, idToken: i };
137
+ if (s != null && "refreshToken" in s && !("refreshToken" in e)) {
138
+ const d = s.refreshToken;
139
139
  return { ...f, refreshToken: d };
140
140
  }
141
141
  return f;
142
- }, oe = (n, e, s) => {
143
- if (!n)
142
+ }, oe = (e, s, n) => {
143
+ if (!e)
144
144
  return null;
145
- if (!n.issued_at) {
145
+ if (!e.issued_at) {
146
146
  const o = (/* @__PURE__ */ new Date()).getTime() / 1e3;
147
- n.issued_at = o;
147
+ e.issued_at = o;
148
148
  }
149
149
  const t = {
150
- accessToken: n.access_token,
151
- expiresIn: n.expires_in,
152
- idToken: n.id_token,
153
- scope: n.scope,
154
- tokenType: n.token_type,
155
- issuedAt: n.issued_at
150
+ accessToken: e.access_token,
151
+ expiresIn: e.expires_in,
152
+ idToken: e.id_token,
153
+ scope: e.scope,
154
+ tokenType: e.token_type,
155
+ issuedAt: e.issued_at
156
156
  };
157
- return "refresh_token" in n && (t.refreshToken = n.refresh_token), n.accessTokenPayload !== void 0 && (t.accessTokenPayload = n.accessTokenPayload), n.idTokenPayload !== void 0 && (t.idTokenPayload = n.idTokenPayload), te(t, e, s);
158
- }, V = (n, e) => {
159
- const s = (/* @__PURE__ */ new Date()).getTime() / 1e3, t = e - s;
160
- return Math.round(t - n);
161
- }, Q = (n) => n ? V(0, n.expiresAt) > 0 : !1, We = async (n, e = 200, s = 50) => {
162
- let t = s;
163
- if (!n.tokens)
157
+ return "refresh_token" in e && (t.refreshToken = e.refresh_token), e.accessTokenPayload !== void 0 && (t.accessTokenPayload = e.accessTokenPayload), e.idTokenPayload !== void 0 && (t.idTokenPayload = e.idTokenPayload), te(t, s, n);
158
+ }, V = (e, s) => {
159
+ const n = (/* @__PURE__ */ new Date()).getTime() / 1e3, t = s - n;
160
+ return Math.round(t - e);
161
+ }, Q = (e) => e ? V(0, e.expiresAt) > 0 : !1, xe = async (e, s = 200, n = 50) => {
162
+ let t = n;
163
+ if (!e.tokens)
164
164
  return null;
165
- for (; !Q(n.tokens) && t > 0; )
166
- await R({ milliseconds: e }), t = t - 1;
165
+ for (; !Q(e.tokens) && t > 0; )
166
+ await R({ milliseconds: s }), t = t - 1;
167
167
  return {
168
- isTokensValid: Q(n.tokens),
169
- tokens: n.tokens,
170
- numberWaited: t - s
168
+ isTokensValid: Q(e.tokens),
169
+ tokens: e.tokens,
170
+ numberWaited: t - n
171
171
  };
172
- }, ke = (n, e, s) => {
173
- if (n.idTokenPayload) {
174
- const t = n.idTokenPayload;
175
- if (s.issuer !== t.iss)
176
- return { isValid: !1, reason: `Issuer does not match (oidcServerConfiguration issuer) ${s.issuer} !== (idTokenPayload issuer) ${t.iss}` };
172
+ }, ge = (e, s, n) => {
173
+ if (e.idTokenPayload) {
174
+ const t = e.idTokenPayload;
175
+ if (n.issuer !== t.iss)
176
+ return { isValid: !1, reason: `Issuer does not match (oidcServerConfiguration issuer) ${n.issuer} !== (idTokenPayload issuer) ${t.iss}` };
177
177
  const o = (/* @__PURE__ */ new Date()).getTime() / 1e3;
178
178
  if (t.exp && t.exp < o)
179
179
  return { isValid: !1, reason: `Token expired (idTokenPayload exp) ${t.exp} < (currentTimeUnixSecond) ${o}` };
180
180
  const i = 60 * 60 * 24 * 7;
181
181
  if (t.iat && t.iat + i < o)
182
182
  return { isValid: !1, reason: `Token is used from too long time (idTokenPayload iat + timeInSevenDays) ${t.iat + i} < (currentTimeUnixSecond) ${o}` };
183
- if (t.nonce && t.nonce !== e)
184
- return { isValid: !1, reason: `Nonce does not match (idTokenPayload nonce) ${t.nonce} !== (nonce) ${e}` };
183
+ if (t.nonce && t.nonce !== s)
184
+ return { isValid: !1, reason: `Nonce does not match (idTokenPayload nonce) ${t.nonce} !== (nonce) ${s}` };
185
185
  }
186
186
  return { isValid: !0, reason: "" };
187
187
  }, J = function() {
188
- const n = function() {
188
+ const e = function() {
189
189
  let a, u;
190
190
  const f = (function() {
191
191
  const l = {}, _ = {
@@ -240,7 +240,7 @@ const te = (n, e = null, s) => {
240
240
  }
241
241
  return null;
242
242
  }();
243
- if (!n) {
243
+ if (!e) {
244
244
  const a = typeof window > "u" ? global : window;
245
245
  return {
246
246
  setTimeout: setTimeout.bind(a),
@@ -249,34 +249,34 @@ const te = (n, e = null, s) => {
249
249
  clearInterval: clearInterval.bind(a)
250
250
  };
251
251
  }
252
- const e = function() {
252
+ const s = function() {
253
253
  let a = 0;
254
254
  return function() {
255
255
  return a++, a;
256
256
  };
257
- }(), s = {}, t = {};
258
- n.onmessage = function(a) {
259
- const u = a.data, f = s[u];
257
+ }(), n = {}, t = {};
258
+ e.onmessage = function(a) {
259
+ const u = a.data, f = n[u];
260
260
  if (f) {
261
- f(), s[u] = null;
261
+ f(), n[u] = null;
262
262
  return;
263
263
  }
264
264
  const d = t[u];
265
265
  d && d();
266
266
  };
267
267
  function o(a, u) {
268
- const f = e();
269
- return n.postMessage(["setTimeout", f, u]), s[f] = a, f;
268
+ const f = s();
269
+ return e.postMessage(["setTimeout", f, u]), n[f] = a, f;
270
270
  }
271
271
  function i(a) {
272
- n.postMessage(["clearTimeout", a]), s[a] = null;
272
+ e.postMessage(["clearTimeout", a]), n[a] = null;
273
273
  }
274
274
  function r(a, u) {
275
- const f = e();
276
- return n.postMessage(["setInterval", f, u]), t[f] = a, f;
275
+ const f = s();
276
+ return e.postMessage(["setInterval", f, u]), t[f] = a, f;
277
277
  }
278
278
  function c(a) {
279
- n.postMessage(["clearInterval", a]), t[a] = null;
279
+ e.postMessage(["clearInterval", a]), t[a] = null;
280
280
  }
281
281
  return {
282
282
  setTimeout: o,
@@ -284,45 +284,45 @@ const te = (n, e = null, s) => {
284
284
  setInterval: r,
285
285
  clearInterval: c
286
286
  };
287
- }(), le = "7.15.0-alpha.1286";
288
- let ue = null, q;
289
- const R = ({ milliseconds: n }) => new Promise((e) => J.setTimeout(e, n)), me = (n = "/") => {
287
+ }(), le = "7.15.1";
288
+ let ue = null, j;
289
+ const R = ({ milliseconds: e }) => new Promise((s) => J.setTimeout(s, e)), ke = (e = "/") => {
290
290
  try {
291
- q = new AbortController(), fetch(`${n}OidcKeepAliveServiceWorker.json?minSleepSeconds=150`, { signal: q.signal }).catch((t) => {
291
+ j = new AbortController(), fetch(`${e}OidcKeepAliveServiceWorker.json?minSleepSeconds=150`, { signal: j.signal }).catch((t) => {
292
292
  console.log(t);
293
- }), R({ milliseconds: 150 * 1e3 }).then(me);
294
- } catch (e) {
295
- console.log(e);
293
+ }), R({ milliseconds: 150 * 1e3 }).then(ke);
294
+ } catch (s) {
295
+ console.log(s);
296
296
  }
297
- }, Le = () => {
298
- q && q.abort();
299
- }, De = (n = "/") => fetch(`${n}OidcKeepAliveServiceWorker.json`, {
297
+ }, We = () => {
298
+ j && j.abort();
299
+ }, Le = (e = "/") => fetch(`${e}OidcKeepAliveServiceWorker.json`, {
300
300
  headers: {
301
301
  "oidc-vanilla": "true"
302
302
  }
303
- }).then((e) => e.statusText === "oidc-service-worker").catch((e) => {
304
- console.log(e);
305
- }), $e = (n) => async (e, s) => {
306
- s(), await e.update();
307
- const t = await e.unregister();
308
- console.log(`Service worker unregistering ${t}`), await R({ milliseconds: 2e3 }), n.reload();
309
- }, b = (n) => (e) => new Promise(function(s, t) {
303
+ }).then((s) => s.statusText === "oidc-service-worker").catch((s) => {
304
+ console.log(s);
305
+ }), De = (e) => async (s, n) => {
306
+ n(), await s.update();
307
+ const t = await s.unregister();
308
+ console.log(`Service worker unregistering ${t}`), await R({ milliseconds: 2e3 }), e.reload();
309
+ }, b = (e) => (s) => new Promise(function(n, t) {
310
310
  const o = new MessageChannel();
311
311
  o.port1.onmessage = function(i) {
312
- i.data && i.data.error ? t(i.data.error) : s(i.data);
313
- }, n.active.postMessage(e, [o.port2]);
314
- }), E = async (n, e) => {
315
- const s = n.service_worker_relative_url;
316
- if (typeof window > "u" || typeof navigator > "u" || !navigator.serviceWorker || !s || n.service_worker_activate() === !1)
312
+ i.data && i.data.error ? t(i.data.error) : n(i.data);
313
+ }, e.active.postMessage(s, [o.port2]);
314
+ }), E = async (e, s) => {
315
+ const n = e.service_worker_relative_url;
316
+ if (typeof window > "u" || typeof navigator > "u" || !navigator.serviceWorker || !n || e.service_worker_activate() === !1)
317
317
  return null;
318
318
  let t = null;
319
- n.register ? t = await n.service_worker_register(s) : t = await navigator.serviceWorker.register(s);
319
+ e.register ? t = await e.service_worker_register(n) : t = await navigator.serviceWorker.register(n);
320
320
  try {
321
321
  await navigator.serviceWorker.ready, navigator.serviceWorker.controller || await b(t)({ type: "claim" });
322
322
  } catch {
323
323
  return null;
324
324
  }
325
- const o = async (k) => b(t)({ type: "clear", data: { status: k }, configurationName: e }), i = async (k, A, O) => {
325
+ const o = async (k) => b(t)({ type: "clear", data: { status: k }, configurationName: s }), i = async (k, A, O) => {
326
326
  const N = await b(t)({
327
327
  type: "init",
328
328
  data: {
@@ -333,84 +333,84 @@ const R = ({ milliseconds: n }) => new Promise((e) => J.setTimeout(e, n)), me =
333
333
  service_worker_convert_all_requests_to_cors: O.service_worker_convert_all_requests_to_cors
334
334
  }
335
335
  },
336
- configurationName: e
336
+ configurationName: s
337
337
  }), P = N.version;
338
- return P !== le && (console.warn(`Service worker ${P} version mismatch with js client version ${le}, unregistering and reloading`), await O.service_worker_update_require_callback(t, Le)), { tokens: oe(N.tokens, null, O.token_renew_mode), status: N.status };
338
+ return P !== le && (console.warn(`Service worker ${P} version mismatch with js client version ${le}, unregistering and reloading`), await O.service_worker_update_require_callback(t, We)), { tokens: oe(N.tokens, null, O.token_renew_mode), status: N.status };
339
339
  }, r = (k = "/") => {
340
- ue == null && (ue = "not_null", me(k));
341
- }, c = (k) => b(t)({ type: "setSessionState", data: { sessionState: k }, configurationName: e }), a = async () => (await b(t)({ type: "getSessionState", data: null, configurationName: e })).sessionState, u = (k) => (sessionStorage[`oidc.nonce.${e}`] = k.nonce, b(t)({ type: "setNonce", data: { nonce: k }, configurationName: e })), f = async () => {
342
- let A = (await b(t)({ type: "getNonce", data: null, configurationName: e })).nonce;
343
- return A || (A = sessionStorage[`oidc.nonce.${e}`], console.warn("nonce not found in service worker, using sessionStorage")), { nonce: A };
340
+ ue == null && (ue = "not_null", ke(k));
341
+ }, c = (k) => b(t)({ type: "setSessionState", data: { sessionState: k }, configurationName: s }), a = async () => (await b(t)({ type: "getSessionState", data: null, configurationName: s })).sessionState, u = (k) => (sessionStorage[`oidc.nonce.${s}`] = k.nonce, b(t)({ type: "setNonce", data: { nonce: k }, configurationName: s })), f = async () => {
342
+ let A = (await b(t)({ type: "getNonce", data: null, configurationName: s })).nonce;
343
+ return A || (A = sessionStorage[`oidc.nonce.${s}`], console.warn("nonce not found in service worker, using sessionStorage")), { nonce: A };
344
344
  };
345
345
  let d = {};
346
346
  return {
347
347
  clearAsync: o,
348
348
  initAsync: i,
349
- startKeepAliveServiceWorker: () => r(n.service_worker_keep_alive_path),
350
- isServiceWorkerProxyActiveAsync: () => De(n.service_worker_keep_alive_path),
349
+ startKeepAliveServiceWorker: () => r(e.service_worker_keep_alive_path),
350
+ isServiceWorkerProxyActiveAsync: () => Le(e.service_worker_keep_alive_path),
351
351
  setSessionStateAsync: c,
352
352
  getSessionStateAsync: a,
353
353
  setNonceAsync: u,
354
354
  getNonceAsync: f,
355
355
  setLoginParams: (k) => {
356
- d[e] = k, localStorage[`oidc.login.${e}`] = JSON.stringify(k);
356
+ d[s] = k, localStorage[`oidc.login.${s}`] = JSON.stringify(k);
357
357
  },
358
358
  getLoginParams: () => {
359
- const k = localStorage[`oidc.login.${e}`];
360
- return d[e] || (d[e] = JSON.parse(k)), d[e];
359
+ const k = localStorage[`oidc.login.${s}`];
360
+ return d[s] || (d[s] = JSON.parse(k)), d[s];
361
361
  },
362
362
  getStateAsync: async () => {
363
- let A = (await b(t)({ type: "getState", data: null, configurationName: e })).state;
364
- return A || (A = sessionStorage[`oidc.state.${e}`], console.warn("state not found in service worker, using sessionStorage")), A;
363
+ let A = (await b(t)({ type: "getState", data: null, configurationName: s })).state;
364
+ return A || (A = sessionStorage[`oidc.state.${s}`], console.warn("state not found in service worker, using sessionStorage")), A;
365
365
  },
366
- setStateAsync: async (k) => (sessionStorage[`oidc.state.${e}`] = k, b(t)({ type: "setState", data: { state: k }, configurationName: e })),
366
+ setStateAsync: async (k) => (sessionStorage[`oidc.state.${s}`] = k, b(t)({ type: "setState", data: { state: k }, configurationName: s })),
367
367
  getCodeVerifierAsync: async () => {
368
- let A = (await b(t)({ type: "getCodeVerifier", data: null, configurationName: e })).codeVerifier;
369
- return A || (A = sessionStorage[`oidc.code_verifier.${e}`], console.warn("codeVerifier not found in service worker, using sessionStorage")), A;
368
+ let A = (await b(t)({ type: "getCodeVerifier", data: null, configurationName: s })).codeVerifier;
369
+ return A || (A = sessionStorage[`oidc.code_verifier.${s}`], console.warn("codeVerifier not found in service worker, using sessionStorage")), A;
370
370
  },
371
- setCodeVerifierAsync: async (k) => (sessionStorage[`oidc.code_verifier.${e}`] = k, b(t)({ type: "setCodeVerifier", data: { codeVerifier: k }, configurationName: e })),
371
+ setCodeVerifierAsync: async (k) => (sessionStorage[`oidc.code_verifier.${s}`] = k, b(t)({ type: "setCodeVerifier", data: { codeVerifier: k }, configurationName: s })),
372
372
  setDemonstratingProofOfPossessionNonce: async (k) => {
373
- await b(t)({ type: "setDemonstratingProofOfPossessionNonce", data: { demonstratingProofOfPossessionNonce: k }, configurationName: e });
373
+ await b(t)({ type: "setDemonstratingProofOfPossessionNonce", data: { demonstratingProofOfPossessionNonce: k }, configurationName: s });
374
374
  },
375
- getDemonstratingProofOfPossessionNonce: async () => (await b(t)({ type: "getDemonstratingProofOfPossessionNonce", data: null, configurationName: e })).demonstratingProofOfPossessionNonce,
375
+ getDemonstratingProofOfPossessionNonce: async () => (await b(t)({ type: "getDemonstratingProofOfPossessionNonce", data: null, configurationName: s })).demonstratingProofOfPossessionNonce,
376
376
  setDemonstratingProofOfPossessionJwkAsync: async (k) => {
377
377
  const A = JSON.stringify(k);
378
- b(t)({ type: "setDemonstratingProofOfPossessionJwk", data: { demonstratingProofOfPossessionJwkJson: A }, configurationName: e });
378
+ b(t)({ type: "setDemonstratingProofOfPossessionJwk", data: { demonstratingProofOfPossessionJwkJson: A }, configurationName: s });
379
379
  },
380
380
  getDemonstratingProofOfPossessionJwkAsync: async () => {
381
- const k = await b(t)({ type: "getDemonstratingProofOfPossessionJwk", data: null, configurationName: e });
381
+ const k = await b(t)({ type: "getDemonstratingProofOfPossessionJwk", data: null, configurationName: s });
382
382
  return k.demonstratingProofOfPossessionJwkJson ? JSON.parse(k.demonstratingProofOfPossessionJwkJson) : null;
383
383
  }
384
384
  };
385
385
  };
386
- async function de(n, e, s, t) {
386
+ async function de(e, s, n, t) {
387
387
  const o = (a) => {
388
- n.tokens = a;
389
- }, { tokens: i, status: r } = await n.synchroniseTokensAsync(e, 0, s, t, o);
390
- return await E(n.configuration, n.configurationName) || await I(n.configurationName, n.configuration.storage).setTokens(n.tokens), n.tokens ? i : (await n.destroyAsync(r), null);
388
+ e.tokens = a;
389
+ }, { tokens: i, status: r } = await e.synchroniseTokensAsync(s, 0, n, t, o);
390
+ return await E(e.configuration, e.configurationName) || await I(e.configurationName, e.configuration.storage).setTokens(e.tokens), e.tokens ? i : (await e.destroyAsync(r), null);
391
391
  }
392
- async function Re(n, e) {
393
- const s = await E(e, n.configurationName);
394
- if (s) {
395
- const t = await n.initAsync(e.authority, e.authority_configuration), { tokens: o } = await s.initAsync(t, "tryKeepExistingSessionAsync", e);
392
+ async function $e(e, s) {
393
+ const n = await E(s, e.configurationName);
394
+ if (n) {
395
+ const t = await e.initAsync(s.authority, s.authority_configuration), { tokens: o } = await n.initAsync(t, "tryKeepExistingSessionAsync", s);
396
396
  return o;
397
397
  } else {
398
- const t = I(n.configurationName, e.storage ?? sessionStorage);
398
+ const t = I(e.configurationName, s.storage ?? sessionStorage);
399
399
  let { tokens: o } = await t.initAsync();
400
- return o = te(o, n.tokens, e.token_renew_mode), o;
400
+ return o = te(o, e.tokens, s.token_renew_mode), o;
401
401
  }
402
402
  }
403
- async function pe(n, e, s = !1, t = null) {
404
- const o = n.configuration, i = `${o.client_id}_${n.configurationName}_${o.authority}`;
403
+ async function me(e, s, n = !1, t = null) {
404
+ const o = e.configuration, i = `${o.client_id}_${e.configurationName}_${o.authority}`;
405
405
  let r;
406
- const c = await E(n.configuration, n.configurationName);
407
- return (o == null ? void 0 : o.storage) === (window == null ? void 0 : window.sessionStorage) && !c ? r = await de(n, e, s, t) : r = await navigator.locks.request(i, { ifAvailable: !0 }, async (a) => a ? await de(n, e, s, t) : (n.publishEvent(K.eventNames.syncTokensAsync_lock_not_available, { lock: "lock not available" }), await Re(n, o))), r ? (n.timeoutId && (n.timeoutId = M(n, r.refreshToken, n.tokens.expiresAt, t)), n.tokens) : null;
406
+ const c = await E(e.configuration, e.configurationName);
407
+ return (o == null ? void 0 : o.storage) === (window == null ? void 0 : window.sessionStorage) && !c ? r = await de(e, s, n, t) : r = await navigator.locks.request(i, { ifAvailable: !0 }, async (a) => a ? await de(e, s, n, t) : (e.publishEvent(K.eventNames.syncTokensAsync_lock_not_available, { lock: "lock not available" }), await $e(e, o))), r ? (e.timeoutId && (e.timeoutId = M(e, r.refreshToken, e.tokens.expiresAt, t)), e.tokens) : null;
408
408
  }
409
- const M = (n, e, s, t = null) => {
410
- const o = n.configuration.refresh_time_before_tokens_expiration_in_second;
409
+ const M = (e, s, n, t = null) => {
410
+ const o = e.configuration.refresh_time_before_tokens_expiration_in_second;
411
411
  return J.setTimeout(async () => {
412
- const r = { timeLeft: V(o, s) };
413
- n.publishEvent(K.eventNames.token_timer, r), await pe(n, e, !1, t);
412
+ const r = { timeLeft: V(o, n) };
413
+ e.publishEvent(K.eventNames.token_timer, r), await me(e, s, !1, t);
414
414
  }, 1e3);
415
415
  }, D = {
416
416
  SESSION_LOST: "SESSION_LOST",
@@ -419,14 +419,14 @@ const M = (n, e, s, t = null) => {
419
419
  TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID: "TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID",
420
420
  LOGOUT_FROM_ANOTHER_TAB: "LOGOUT_FROM_ANOTHER_TAB",
421
421
  REQUIRE_SYNC_TOKENS: "REQUIRE_SYNC_TOKENS"
422
- }, Ke = (n) => async (e, s, t, o = !1) => {
422
+ }, Re = (e) => async (s, n, t, o = !1) => {
423
423
  const i = { nonce: null };
424
424
  if (!t)
425
425
  return { tokens: null, status: "NOT_CONNECTED", nonce: i };
426
426
  let r = i;
427
- const c = await n.initAsync(e.authority, e.authority_configuration), a = await E(e, s);
427
+ const c = await e.initAsync(s.authority, s.authority_configuration), a = await E(s, n);
428
428
  if (a) {
429
- const { status: d, tokens: l } = await a.initAsync(c, "syncTokensAsync", e);
429
+ const { status: d, tokens: l } = await a.initAsync(c, "syncTokensAsync", s);
430
430
  if (d === "LOGGED_OUT")
431
431
  return { tokens: null, status: "LOGOUT_FROM_ANOTHER_TAB", nonce: i };
432
432
  if (d === "SESSIONS_LOST")
@@ -434,72 +434,72 @@ const M = (n, e, s, t = null) => {
434
434
  if (!d || !l)
435
435
  return { tokens: null, status: "REQUIRE_SYNC_TOKENS", nonce: i };
436
436
  if (l.issuedAt !== t.issuedAt) {
437
- const y = V(e.refresh_time_before_tokens_expiration_in_second, l.expiresAt) > 0 ? "TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID" : "TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_INVALID", h = await a.getNonceAsync();
437
+ const y = V(s.refresh_time_before_tokens_expiration_in_second, l.expiresAt) > 0 ? "TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID" : "TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_INVALID", h = await a.getNonceAsync();
438
438
  return { tokens: l, status: y, nonce: h };
439
439
  }
440
440
  r = await a.getNonceAsync();
441
441
  } else {
442
- const d = I(s, e.storage ?? sessionStorage), { tokens: l, status: _ } = await d.initAsync();
442
+ const d = I(n, s.storage ?? sessionStorage), { tokens: l, status: _ } = await d.initAsync();
443
443
  if (l) {
444
444
  if (_ === "SESSIONS_LOST")
445
445
  return { tokens: null, status: "SESSIONS_LOST", nonce: i };
446
446
  if (l.issuedAt !== t.issuedAt) {
447
- const h = V(e.refresh_time_before_tokens_expiration_in_second, l.expiresAt) > 0 ? "TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID" : "TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_INVALID", g = await d.getNonceAsync();
447
+ const h = V(s.refresh_time_before_tokens_expiration_in_second, l.expiresAt) > 0 ? "TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID" : "TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_INVALID", g = await d.getNonceAsync();
448
448
  return { tokens: l, status: h, nonce: g };
449
449
  }
450
450
  } else
451
451
  return { tokens: null, status: "LOGOUT_FROM_ANOTHER_TAB", nonce: i };
452
452
  r = await d.getNonceAsync();
453
453
  }
454
- const f = V(e.refresh_time_before_tokens_expiration_in_second, t.expiresAt) > 0 ? "TOKENS_VALID" : "TOKENS_INVALID";
454
+ const f = V(s.refresh_time_before_tokens_expiration_in_second, t.expiresAt) > 0 ? "TOKENS_VALID" : "TOKENS_INVALID";
455
455
  return o ? { tokens: t, status: "FORCE_REFRESH", nonce: r } : { tokens: t, status: f, nonce: r };
456
- }, ie = (n, e, s) => (t = null, o = null, i = null) => {
457
- if (!e.silent_redirect_uri || !e.silent_login_uri)
456
+ }, ie = (e, s, n) => (t = null, o = null, i = null) => {
457
+ if (!s.silent_redirect_uri || !s.silent_login_uri)
458
458
  return Promise.resolve(null);
459
459
  try {
460
- s(m.silentLoginAsync_begin, {});
460
+ n(m.silentLoginAsync_begin, {});
461
461
  let r = "";
462
462
  if (o && (t == null && (t = {}), t.state = o), i && (t == null && (t = {}), t.scope = i), t != null)
463
463
  for (const [d, l] of Object.entries(t))
464
464
  r === "" ? r = `?${encodeURIComponent(d)}=${encodeURIComponent(l)}` : r += `&${encodeURIComponent(d)}=${encodeURIComponent(l)}`;
465
- const c = e.silent_login_uri + r, a = c.indexOf("/", c.indexOf("//") + 2), u = c.substr(0, a), f = document.createElement("iframe");
466
- return f.width = "0px", f.height = "0px", f.id = `${n}_oidc_iframe`, f.setAttribute("src", c), document.body.appendChild(f), new Promise((d, l) => {
465
+ const c = s.silent_login_uri + r, a = c.indexOf("/", c.indexOf("//") + 2), u = c.substr(0, a), f = document.createElement("iframe");
466
+ return f.width = "0px", f.height = "0px", f.id = `${e}_oidc_iframe`, f.setAttribute("src", c), document.body.appendChild(f), new Promise((d, l) => {
467
467
  try {
468
468
  let _ = !1;
469
469
  window.onmessage = (h) => {
470
470
  if (h.origin === u && h.source === f.contentWindow) {
471
- const g = `${n}_oidc_tokens:`, w = `${n}_oidc_error:`, S = h.data;
471
+ const g = `${e}_oidc_tokens:`, w = `${e}_oidc_error:`, S = h.data;
472
472
  if (S && typeof S == "string" && !_) {
473
473
  if (S.startsWith(g)) {
474
474
  const T = JSON.parse(h.data.replace(g, ""));
475
- s(m.silentLoginAsync_end, {}), f.remove(), _ = !0, d(T);
475
+ n(m.silentLoginAsync_end, {}), f.remove(), _ = !0, d(T);
476
476
  } else if (S.startsWith(w)) {
477
477
  const T = JSON.parse(h.data.replace(w, ""));
478
- s(m.silentLoginAsync_error, T), f.remove(), _ = !0, l(new Error("oidc_" + T.error));
478
+ n(m.silentLoginAsync_error, T), f.remove(), _ = !0, l(new Error("oidc_" + T.error));
479
479
  }
480
480
  }
481
481
  }
482
482
  };
483
- const y = e.silent_login_timeout;
483
+ const y = s.silent_login_timeout;
484
484
  setTimeout(() => {
485
- _ || (s(m.silentLoginAsync_error, { reason: "timeout" }), f.remove(), _ = !0, l(new Error("timeout")));
485
+ _ || (n(m.silentLoginAsync_error, { reason: "timeout" }), f.remove(), _ = !0, l(new Error("timeout")));
486
486
  }, y);
487
487
  } catch (_) {
488
- f.remove(), s(m.silentLoginAsync_error, _), l(_);
488
+ f.remove(), n(m.silentLoginAsync_error, _), l(_);
489
489
  }
490
490
  });
491
491
  } catch (r) {
492
- throw s(m.silentLoginAsync_error, r), r;
492
+ throw n(m.silentLoginAsync_error, r), r;
493
493
  }
494
- }, Ue = (n, e, s, t, o) => (i = null, r = void 0) => {
494
+ }, Ke = (e, s, n, t, o) => (i = null, r = void 0) => {
495
495
  i = { ...i };
496
- const c = (u, f, d) => ie(e, s, t.bind(o))(u, f, d);
496
+ const c = (u, f, d) => ie(s, n, t.bind(o))(u, f, d);
497
497
  return (async () => {
498
498
  o.timeoutId && J.clearTimeout(o.timeoutId);
499
499
  let u;
500
500
  i && "state" in i && (u = i.state, delete i.state);
501
501
  try {
502
- const f = s.extras ? { ...s.extras, ...i } : i, d = await c({
502
+ const f = n.extras ? { ...n.extras, ...i } : i, d = await c({
503
503
  ...f,
504
504
  prompt: "none"
505
505
  }, u, r);
@@ -509,35 +509,35 @@ const M = (n, e, s, t = null) => {
509
509
  return f;
510
510
  }
511
511
  })();
512
- }, Fe = (n, e, s) => (t, o, i, r = !1) => {
513
- const c = (a, u = void 0, f = void 0) => ie(n.configurationName, s, n.publishEvent.bind(n))(a, u, f);
512
+ }, Ue = (e, s, n) => (t, o, i, r = !1) => {
513
+ const c = (a, u = void 0, f = void 0) => ie(e.configurationName, n, e.publishEvent.bind(e))(a, u, f);
514
514
  return new Promise((a, u) => {
515
- if (s.silent_login_uri && s.silent_redirect_uri && s.monitor_session && t && i && !r) {
515
+ if (n.silent_login_uri && n.silent_redirect_uri && n.monitor_session && t && i && !r) {
516
516
  const f = () => {
517
- n.checkSessionIFrame.stop();
518
- const d = n.tokens;
517
+ e.checkSessionIFrame.stop();
518
+ const d = e.tokens;
519
519
  if (d === null)
520
520
  return;
521
521
  const l = d.idToken, _ = d.idTokenPayload;
522
522
  return c({
523
523
  prompt: "none",
524
524
  id_token_hint: l,
525
- scope: s.scope || "openid"
525
+ scope: n.scope || "openid"
526
526
  }).then((y) => {
527
527
  const h = y.tokens.idTokenPayload;
528
528
  if (_.sub === h.sub) {
529
529
  const g = y.sessionState;
530
- n.checkSessionIFrame.start(y.sessionState), _.sid === h.sid ? console.debug("SessionMonitor._callback: Same sub still logged in at OP, restarting check session iframe; session_state:", g) : console.debug("SessionMonitor._callback: Same sub still logged in at OP, session state has changed, restarting check session iframe; session_state:", g);
530
+ e.checkSessionIFrame.start(y.sessionState), _.sid === h.sid ? console.debug("SessionMonitor._callback: Same sub still logged in at OP, restarting check session iframe; session_state:", g) : console.debug("SessionMonitor._callback: Same sub still logged in at OP, session state has changed, restarting check session iframe; session_state:", g);
531
531
  } else
532
532
  console.debug("SessionMonitor._callback: Different subject signed into OP:", h.sub);
533
533
  }).catch(async (y) => {
534
534
  console.warn("SessionMonitor._callback: Silent login failed, logging out other tabs:", y);
535
- for (const [h, g] of Object.entries(e))
536
- await g.logoutOtherTabAsync(s.client_id, _.sub);
535
+ for (const [h, g] of Object.entries(s))
536
+ await g.logoutOtherTabAsync(n.client_id, _.sub);
537
537
  });
538
538
  };
539
- n.checkSessionIFrame = new Ee(f, o, t), n.checkSessionIFrame.load().then(() => {
540
- n.checkSessionIFrame.start(i), a(n.checkSessionIFrame);
539
+ e.checkSessionIFrame = new Oe(f, o, t), e.checkSessionIFrame.load().then(() => {
540
+ e.checkSessionIFrame.start(i), a(e.checkSessionIFrame);
541
541
  }).catch((d) => {
542
542
  u(d);
543
543
  });
@@ -545,100 +545,100 @@ const M = (n, e, s, t = null) => {
545
545
  a(null);
546
546
  });
547
547
  };
548
- var Ve = He, C = [], fe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
549
- for (var H = 0, Me = fe.length; H < Me; ++H)
548
+ var Fe = Be, C = [], fe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
549
+ for (var H = 0, Ve = fe.length; H < Ve; ++H)
550
550
  C[H] = fe[H];
551
- function Je(n) {
552
- return C[n >> 18 & 63] + C[n >> 12 & 63] + C[n >> 6 & 63] + C[n & 63];
551
+ function Me(e) {
552
+ return C[e >> 18 & 63] + C[e >> 12 & 63] + C[e >> 6 & 63] + C[e & 63];
553
553
  }
554
- function Be(n, e, s) {
555
- for (var t, o = [], i = e; i < s; i += 3)
556
- t = (n[i] << 16 & 16711680) + (n[i + 1] << 8 & 65280) + (n[i + 2] & 255), o.push(Je(t));
554
+ function Je(e, s, n) {
555
+ for (var t, o = [], i = s; i < n; i += 3)
556
+ t = (e[i] << 16 & 16711680) + (e[i + 1] << 8 & 65280) + (e[i + 2] & 255), o.push(Me(t));
557
557
  return o.join("");
558
558
  }
559
- function He(n) {
560
- for (var e, s = n.length, t = s % 3, o = [], i = 16383, r = 0, c = s - t; r < c; r += i)
561
- o.push(Be(n, r, r + i > c ? c : r + i));
562
- return t === 1 ? (e = n[s - 1], o.push(
563
- C[e >> 2] + C[e << 4 & 63] + "=="
564
- )) : t === 2 && (e = (n[s - 2] << 8) + n[s - 1], o.push(
565
- C[e >> 10] + C[e >> 4 & 63] + C[e << 2 & 63] + "="
559
+ function Be(e) {
560
+ for (var s, n = e.length, t = n % 3, o = [], i = 16383, r = 0, c = n - t; r < c; r += i)
561
+ o.push(Je(e, r, r + i > c ? c : r + i));
562
+ return t === 1 ? (s = e[n - 1], o.push(
563
+ C[s >> 2] + C[s << 4 & 63] + "=="
564
+ )) : t === 2 && (s = (e[n - 2] << 8) + e[n - 1], o.push(
565
+ C[s >> 10] + C[s >> 4 & 63] + C[s << 2 & 63] + "="
566
566
  )), o.join("");
567
567
  }
568
- const we = () => {
569
- const n = typeof window < "u" && !!window.crypto, e = n && !!window.crypto.subtle;
570
- return { hasCrypto: n, hasSubtleCrypto: e };
571
- }, Z = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", qe = (n) => {
572
- const e = [];
573
- for (let s = 0; s < n.byteLength; s += 1) {
574
- const t = n[s] % Z.length;
575
- e.push(Z[t]);
576
- }
577
- return e.join("");
578
- }, je = (n) => Ve(new Uint8Array(n)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, ""), ee = (n) => {
579
- const e = new Uint8Array(n), { hasCrypto: s } = we();
580
- if (s)
581
- window.crypto.getRandomValues(e);
568
+ const pe = () => {
569
+ const e = typeof window < "u" && !!window.crypto, s = e && !!window.crypto.subtle;
570
+ return { hasCrypto: e, hasSubtleCrypto: s };
571
+ }, Z = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", He = (e) => {
572
+ const s = [];
573
+ for (let n = 0; n < e.byteLength; n += 1) {
574
+ const t = e[n] % Z.length;
575
+ s.push(Z[t]);
576
+ }
577
+ return s.join("");
578
+ }, je = (e) => Fe(new Uint8Array(e)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, ""), ee = (e) => {
579
+ const s = new Uint8Array(e), { hasCrypto: n } = pe();
580
+ if (n)
581
+ window.crypto.getRandomValues(s);
582
582
  else
583
- for (let t = 0; t < n; t += 1)
584
- e[t] = Math.random() * Z.length | 0;
585
- return qe(e);
583
+ for (let t = 0; t < e; t += 1)
584
+ s[t] = Math.random() * Z.length | 0;
585
+ return He(s);
586
586
  };
587
- function Ge(n) {
588
- const e = new ArrayBuffer(n.length), s = new Uint8Array(e);
589
- for (let t = 0; t < n.length; t++)
590
- s[t] = n.charCodeAt(t);
591
- return s;
587
+ function qe(e) {
588
+ const s = new ArrayBuffer(e.length), n = new Uint8Array(s);
589
+ for (let t = 0; t < e.length; t++)
590
+ n[t] = e.charCodeAt(t);
591
+ return n;
592
592
  }
593
- function Ae(n) {
594
- return new Promise((e, s) => {
595
- crypto.subtle.digest("SHA-256", Ge(n)).then((t) => e(je(new Uint8Array(t))), (t) => s(t));
593
+ function we(e) {
594
+ return new Promise((s, n) => {
595
+ crypto.subtle.digest("SHA-256", qe(e)).then((t) => s(je(new Uint8Array(t))), (t) => n(t));
596
596
  });
597
597
  }
598
- const Ye = (n) => {
599
- if (n.length < 43 || n.length > 128)
598
+ const Ge = (e) => {
599
+ if (e.length < 43 || e.length > 128)
600
600
  return Promise.reject(new Error("Invalid code length."));
601
- const { hasSubtleCrypto: e } = we();
602
- return e ? Ae(n) : Promise.reject(new Error("window.crypto.subtle is unavailable."));
603
- }, $ = {}, Xe = (n, e = window.sessionStorage, s) => {
604
- if (!$[n] && e) {
605
- const o = e.getItem(n);
606
- o && ($[n] = JSON.parse(o));
607
- }
608
- const t = 1e3 * s;
609
- return $[n] && $[n].timestamp + t > Date.now() ? $[n].result : null;
610
- }, ze = (n, e, s = window.sessionStorage) => {
601
+ const { hasSubtleCrypto: s } = pe();
602
+ return s ? we(e) : Promise.reject(new Error("window.crypto.subtle is unavailable."));
603
+ }, $ = {}, Ye = (e, s = window.sessionStorage, n) => {
604
+ if (!$[e] && s) {
605
+ const o = s.getItem(e);
606
+ o && ($[e] = JSON.parse(o));
607
+ }
608
+ const t = 1e3 * n;
609
+ return $[e] && $[e].timestamp + t > Date.now() ? $[e].result : null;
610
+ }, Xe = (e, s, n = window.sessionStorage) => {
611
611
  const t = Date.now();
612
- $[n] = { result: e, timestamp: t }, s && s.setItem(n, JSON.stringify({ result: e, timestamp: t }));
613
- }, Qe = 60 * 60, Ze = (n) => async (e, s = Qe, t = window.sessionStorage, o = 1e4) => {
614
- const i = `${e}/.well-known/openid-configuration`, r = `oidc.server:${e}`, c = Xe(r, t, s);
612
+ $[e] = { result: s, timestamp: t }, n && n.setItem(e, JSON.stringify({ result: s, timestamp: t }));
613
+ }, ze = 60 * 60, Qe = (e) => async (s, n = ze, t = window.sessionStorage, o = 1e4) => {
614
+ const i = `${s}/.well-known/openid-configuration`, r = `oidc.server:${s}`, c = Ye(r, t, n);
615
615
  if (c)
616
- return new se(c);
617
- const a = await B(n)(i, {}, o);
616
+ return new ne(c);
617
+ const a = await B(e)(i, {}, o);
618
618
  if (a.status !== 200)
619
619
  return null;
620
620
  const u = await a.json();
621
- return ze(r, u, t), new se(u);
622
- }, B = (n) => async (e, s = {}, t = 1e4, o = 0) => {
621
+ return Xe(r, u, t), new ne(u);
622
+ }, B = (e) => async (s, n = {}, t = 1e4, o = 0) => {
623
623
  let i;
624
624
  try {
625
625
  const r = new AbortController();
626
- setTimeout(() => r.abort(), t), i = await n(e, { ...s, signal: r.signal });
626
+ setTimeout(() => r.abort(), t), i = await e(s, { ...n, signal: r.signal });
627
627
  } catch (r) {
628
628
  if (r.name === "AbortError" || r.message === "Network request failed") {
629
629
  if (o <= 1)
630
- return await B(n)(e, s, t, o + 1);
630
+ return await B(e)(s, n, t, o + 1);
631
631
  throw r;
632
632
  } else
633
633
  throw console.error(r.message), r;
634
634
  }
635
635
  return i;
636
- }, ne = {
636
+ }, se = {
637
637
  refresh_token: "refresh_token",
638
638
  access_token: "access_token"
639
- }, _e = (n) => async (e, s, t = ne.refresh_token, o, i = 1e4) => {
639
+ }, _e = (e) => async (s, n, t = se.refresh_token, o, i = 1e4) => {
640
640
  const r = {
641
- token: s,
641
+ token: n,
642
642
  token_type_hint: t,
643
643
  client_id: o
644
644
  }, c = [];
@@ -647,7 +647,7 @@ const Ye = (n) => {
647
647
  c.push(`${d}=${l}`);
648
648
  }
649
649
  const a = c.join("&");
650
- return (await B(n)(e, {
650
+ return (await B(e)(s, {
651
651
  method: "POST",
652
652
  headers: {
653
653
  "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
@@ -656,15 +656,15 @@ const Ye = (n) => {
656
656
  }, i)).status !== 200 ? { success: !1 } : {
657
657
  success: !0
658
658
  };
659
- }, en = (n) => async (e, s, t, o, i = {}, r, c = 1e4) => {
659
+ }, Ze = (e) => async (s, n, t, o, i = {}, r, c = 1e4) => {
660
660
  for (const [_, y] of Object.entries(t))
661
- s[_] === void 0 && (s[_] = y);
661
+ n[_] === void 0 && (n[_] = y);
662
662
  const a = [];
663
- for (const _ in s) {
664
- const y = encodeURIComponent(_), h = encodeURIComponent(s[_]);
663
+ for (const _ in n) {
664
+ const y = encodeURIComponent(_), h = encodeURIComponent(n[_]);
665
665
  a.push(`${y}=${h}`);
666
666
  }
667
- const u = a.join("&"), f = await B(n)(e, {
667
+ const u = a.join("&"), f = await B(e)(s, {
668
668
  method: "POST",
669
669
  headers: {
670
670
  "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
@@ -676,28 +676,28 @@ const Ye = (n) => {
676
676
  return { success: !1, status: f.status, demonstratingProofOfPossessionNonce: null };
677
677
  const d = await f.json();
678
678
  let l = null;
679
- return f.headers.has(j) && (l = f.headers.get(j)), {
679
+ return f.headers.has(q) && (l = f.headers.get(q)), {
680
680
  success: !0,
681
681
  data: oe(d, o, r),
682
682
  demonstratingProofOfPossessionNonce: l
683
683
  };
684
- }, nn = (n, e) => async (s, t) => {
684
+ }, es = (e, s) => async (n, t) => {
685
685
  t = t ? { ...t } : {};
686
- const o = ee(128), i = await Ye(o);
687
- await n.setCodeVerifierAsync(o), await n.setStateAsync(t.state), t.code_challenge = i, t.code_challenge_method = "S256";
686
+ const o = ee(128), i = await Ge(o);
687
+ await e.setCodeVerifierAsync(o), await e.setStateAsync(t.state), t.code_challenge = i, t.code_challenge_method = "S256";
688
688
  let r = "";
689
689
  if (t)
690
690
  for (const [c, a] of Object.entries(t))
691
691
  r === "" ? r += "?" : r += "&", r += `${c}=${encodeURIComponent(a)}`;
692
- e.open(`${s}${r}`);
693
- }, j = "DPoP-Nonce", sn = (n) => async (e, s, t, o, i = 1e4) => {
694
- s = s ? { ...s } : {}, s.code_verifier = await n.getCodeVerifierAsync();
692
+ s.open(`${n}${r}`);
693
+ }, q = "DPoP-Nonce", ss = (e) => async (s, n, t, o, i = 1e4) => {
694
+ n = n ? { ...n } : {}, n.code_verifier = await e.getCodeVerifierAsync();
695
695
  const r = [];
696
- for (const d in s) {
697
- const l = encodeURIComponent(d), _ = encodeURIComponent(s[d]);
696
+ for (const d in n) {
697
+ const l = encodeURIComponent(d), _ = encodeURIComponent(n[d]);
698
698
  r.push(`${l}=${_}`);
699
699
  }
700
- const c = r.join("&"), a = await B(fetch)(e, {
700
+ const c = r.join("&"), a = await B(fetch)(s, {
701
701
  method: "POST",
702
702
  headers: {
703
703
  "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
@@ -705,79 +705,79 @@ const Ye = (n) => {
705
705
  },
706
706
  body: c
707
707
  }, i);
708
- if (await Promise.all([n.setCodeVerifierAsync(null), n.setStateAsync(null)]), a.status !== 200)
708
+ if (await Promise.all([e.setCodeVerifierAsync(null), e.setStateAsync(null)]), a.status !== 200)
709
709
  return { success: !1, status: a.status };
710
710
  let u = null;
711
- a.headers.has(j) && (u = a.headers.get(j));
711
+ a.headers.has(q) && (u = a.headers.get(q));
712
712
  const f = await a.json();
713
713
  return {
714
714
  success: !0,
715
715
  data: {
716
- state: s.state,
716
+ state: n.state,
717
717
  tokens: oe(f, null, o),
718
718
  demonstratingProofOfPossessionNonce: u
719
719
  }
720
720
  };
721
- }, Se = (n) => {
722
- const e = n.match(
721
+ }, Ae = (e) => {
722
+ const s = e.match(
723
723
  // eslint-disable-next-line no-useless-escape
724
724
  /^([a-z][\w-]+\:)\/\/(([^:\/?#]*)(?:\:([0-9]+))?)([\/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/
725
725
  );
726
- if (!e)
726
+ if (!s)
727
727
  throw new Error("Invalid URL");
728
- let s = e[6], t = e[7];
728
+ let n = s[6], t = s[7];
729
729
  if (t) {
730
730
  const o = t.split("?");
731
- o.length === 2 && (t = o[0], s = o[1]);
732
- }
733
- return s.startsWith("?") && (s = s.slice(1)), e && {
734
- href: n,
735
- protocol: e[1],
736
- host: e[2],
737
- hostname: e[3],
738
- port: e[4],
739
- path: e[5],
740
- search: s,
731
+ o.length === 2 && (t = o[0], n = o[1]);
732
+ }
733
+ return n.startsWith("?") && (n = n.slice(1)), s && {
734
+ href: e,
735
+ protocol: s[1],
736
+ host: s[2],
737
+ hostname: s[3],
738
+ port: s[4],
739
+ path: s[5],
740
+ search: n,
741
741
  hash: t
742
742
  };
743
- }, Nn = (n) => {
744
- const e = Se(n);
745
- let { path: s } = e;
746
- s.endsWith("/") && (s = s.slice(0, -1));
747
- let { hash: t } = e;
748
- return t === "#_=_" && (t = ""), t && (s += t), s;
749
- }, G = (n) => {
750
- const e = Se(n), { search: s } = e;
751
- return tn(s);
752
- }, tn = (n) => {
753
- const e = {};
754
- let s, t, o;
755
- const i = n.split("&");
743
+ }, Cs = (e) => {
744
+ const s = Ae(e);
745
+ let { path: n } = s;
746
+ n.endsWith("/") && (n = n.slice(0, -1));
747
+ let { hash: t } = s;
748
+ return t === "#_=_" && (t = ""), t && (n += t), n;
749
+ }, G = (e) => {
750
+ const s = Ae(e), { search: n } = s;
751
+ return ns(n);
752
+ }, ns = (e) => {
753
+ const s = {};
754
+ let n, t, o;
755
+ const i = e.split("&");
756
756
  for (t = 0, o = i.length; t < o; t++)
757
- s = i[t].split("="), e[decodeURIComponent(s[0])] = decodeURIComponent(s[1]);
758
- return e;
757
+ n = i[t].split("="), s[decodeURIComponent(n[0])] = decodeURIComponent(n[1]);
758
+ return s;
759
759
  };
760
- function ve(n) {
761
- return new TextEncoder().encode(n);
760
+ function Se(e) {
761
+ return new TextEncoder().encode(e);
762
762
  }
763
- function Te(n) {
764
- return btoa(n).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+/g, "");
763
+ function ve(e) {
764
+ return btoa(e).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+/g, "");
765
765
  }
766
- function on(n) {
767
- return encodeURIComponent(n).replace(/%([0-9A-F]{2})/g, function(t, o) {
766
+ function ts(e) {
767
+ return encodeURIComponent(e).replace(/%([0-9A-F]{2})/g, function(t, o) {
768
768
  return String.fromCharCode(parseInt(o, 16));
769
769
  });
770
770
  }
771
- function be(n) {
772
- let e = "";
773
- return n.forEach(function(s) {
774
- e += String.fromCharCode(s);
775
- }), Te(e);
771
+ function Te(e) {
772
+ let s = "";
773
+ return e.forEach(function(n) {
774
+ s += String.fromCharCode(n);
775
+ }), ve(s);
776
776
  }
777
- function he(n) {
778
- return Te(on(n));
777
+ function he(e) {
778
+ return ve(ts(e));
779
779
  }
780
- const rn = {
780
+ const os = {
781
781
  importKeyAlgorithm: {
782
782
  name: "ECDSA",
783
783
  namedCurve: "P-256",
@@ -790,13 +790,13 @@ const rn = {
790
790
  },
791
791
  digestAlgorithm: { name: "SHA-256" },
792
792
  jwtHeaderAlgorithm: "ES256"
793
- }, an = async (n, e, s, t, o = "dpop+jwt") => {
794
- switch (n = Object.assign({}, n), e.typ = o, e.alg = t.jwtHeaderAlgorithm, e.alg) {
793
+ }, is = async (e, s, n, t, o = "dpop+jwt") => {
794
+ switch (e = Object.assign({}, e), s.typ = o, s.alg = t.jwtHeaderAlgorithm, s.alg) {
795
795
  case "ES256":
796
- e.jwk = { kty: n.kty, crv: n.crv, x: n.x, y: n.y };
796
+ s.jwk = { kty: e.kty, crv: e.crv, x: e.x, y: e.y };
797
797
  break;
798
798
  case "RS256":
799
- e.jwk = { kty: n.kty, n: n.n, e: n.e, kid: e.kid };
799
+ s.jwk = { kty: e.kty, n: e.n, e: e.e, kid: s.kid };
800
800
  break;
801
801
  default:
802
802
  throw new Error("Unknown or not implemented JWS algorithm");
@@ -804,99 +804,96 @@ const rn = {
804
804
  const i = {
805
805
  // @ts-ignore
806
806
  // JWT "headers" really means JWS "protected headers"
807
- protected: he(JSON.stringify(e)),
807
+ protected: he(JSON.stringify(s)),
808
808
  // @ts-ignore
809
809
  // JWT "claims" are really a JSON-defined JWS "payload"
810
- payload: he(JSON.stringify(s))
811
- }, r = t.importKeyAlgorithm, c = !0, a = ["sign"], u = await window.crypto.subtle.importKey("jwk", n, r, c, a), f = ve(`${i.protected}.${i.payload}`), d = t.signAlgorithm, l = await window.crypto.subtle.sign(d, u, f);
812
- return i.signature = be(new Uint8Array(l)), `${i.protected}.${i.payload}.${i.signature}`;
810
+ payload: he(JSON.stringify(n))
811
+ }, r = t.importKeyAlgorithm, c = !0, a = ["sign"], u = await window.crypto.subtle.importKey("jwk", e, r, c, a), f = Se(`${i.protected}.${i.payload}`), d = t.signAlgorithm, l = await window.crypto.subtle.sign(d, u, f);
812
+ return i.signature = Te(new Uint8Array(l)), `${i.protected}.${i.payload}.${i.signature}`;
813
813
  };
814
- var cn = { sign: an };
815
- const ln = async (n) => {
816
- const e = n, s = !0, t = ["sign", "verify"], o = await window.crypto.subtle.generateKey(e, s, t);
814
+ var rs = { sign: is };
815
+ const as = async (e) => {
816
+ const s = e, n = !0, t = ["sign", "verify"], o = await window.crypto.subtle.generateKey(s, n, t);
817
817
  return await window.crypto.subtle.exportKey("jwk", o.privateKey);
818
- }, un = (n) => {
819
- const e = Object.assign({}, n);
820
- return delete e.d, e.key_ops = ["verify"], e;
821
- }, ye = {
822
- generate: ln,
823
- neuter: un
824
- }, dn = async (n, e) => {
825
- let s;
826
- switch (n.kty) {
818
+ }, cs = (e) => {
819
+ const s = Object.assign({}, e);
820
+ return delete s.d, s.key_ops = ["verify"], s;
821
+ }, ls = {
822
+ generate: as,
823
+ neuter: cs
824
+ }, us = async (e, s) => {
825
+ let n;
826
+ switch (e.kty) {
827
827
  case "EC":
828
- s = '{"crv":"CRV","kty":"EC","x":"X","y":"Y"}'.replace("CRV", n.crv).replace("X", n.x).replace("Y", n.y);
828
+ n = '{"crv":"CRV","kty":"EC","x":"X","y":"Y"}'.replace("CRV", e.crv).replace("X", e.x).replace("Y", e.y);
829
829
  break;
830
830
  case "RSA":
831
- s = '{"e":"E","kty":"RSA","n":"N"}'.replace("E", n.e).replace("N", n.n);
831
+ n = '{"e":"E","kty":"RSA","n":"N"}'.replace("E", e.e).replace("N", e.n);
832
832
  break;
833
833
  default:
834
834
  throw new Error("Unknown or not implemented JWK type");
835
835
  }
836
- const t = await window.crypto.subtle.digest(e, ve(s));
837
- return be(new Uint8Array(t));
836
+ const t = await window.crypto.subtle.digest(s, Se(n));
837
+ return Te(new Uint8Array(t));
838
838
  };
839
- var fn = { thumbprint: dn };
840
- const _n = async (n) => {
841
- const e = await ye.generate(n);
842
- return console.info("Private Key:", JSON.stringify(e)), console.info("Public Key:", JSON.stringify(ye.neuter(e))), e;
843
- }, Pe = (n) => async (e, s = "POST", t, o = {}) => {
839
+ var ds = { thumbprint: us };
840
+ const fs = async (e) => await ls.generate(e), be = (e) => async (s, n = "POST", t, o = {}) => {
844
841
  const i = {
845
842
  // https://www.rfc-editor.org/rfc/rfc9449.html#name-concept
846
- jti: btoa(hn()),
847
- htm: s,
843
+ jti: btoa(_s()),
844
+ htm: n,
848
845
  htu: t,
849
846
  iat: Math.round(Date.now() / 1e3),
850
847
  ...o
851
- }, r = await fn.thumbprint(e, n.digestAlgorithm);
852
- return await cn.sign(e, { kid: r }, i, n);
853
- }, hn = () => {
854
- const n = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx", e = "0123456789abcdef";
855
- let s = 0, t = "";
848
+ }, r = await ds.thumbprint(s, e.digestAlgorithm);
849
+ return await rs.sign(s, { kid: r }, i, e);
850
+ }, _s = () => {
851
+ const e = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx", s = "0123456789abcdef";
852
+ let n = 0, t = "";
856
853
  for (let o = 0; o < 36; o++)
857
- n[o] !== "-" && n[o] !== "4" && (s = Math.random() * 16 | 0), n[o] === "x" ? t += e[s] : n[o] === "y" ? (s &= 3, s |= 8, t += e[s]) : t += n[o];
854
+ e[o] !== "-" && e[o] !== "4" && (n = Math.random() * 16 | 0), e[o] === "x" ? t += s[n] : e[o] === "y" ? (n &= 3, n |= 8, t += s[n]) : t += e[o];
858
855
  return t;
859
- }, yn = (n, e, s, t, o) => (i = void 0, r = null, c = !1, a = void 0) => {
856
+ }, hs = (e, s, n, t, o) => (i = void 0, r = null, c = !1, a = void 0) => {
860
857
  const u = r;
861
858
  return r = { ...r }, (async () => {
862
859
  const d = i || o.getPath();
863
- if ("state" in r || (r.state = ee(16)), s(m.loginAsync_begin, {}), r)
860
+ if ("state" in r || (r.state = ee(16)), n(m.loginAsync_begin, {}), r)
864
861
  for (const l of Object.keys(r))
865
862
  l.endsWith(":token_request") && delete r[l];
866
863
  try {
867
- const l = c ? e.silent_redirect_uri : e.redirect_uri;
868
- a || (a = e.scope);
869
- const _ = e.extras ? { ...e.extras, ...r } : r;
864
+ const l = c ? s.silent_redirect_uri : s.redirect_uri;
865
+ a || (a = s.scope);
866
+ const _ = s.extras ? { ...s.extras, ...r } : r;
870
867
  _.nonce || (_.nonce = ee(12));
871
- const y = { nonce: _.nonce }, h = await E(e, n), g = await t(e.authority, e.authority_configuration);
868
+ const y = { nonce: _.nonce }, h = await E(s, e), g = await t(s.authority, s.authority_configuration);
872
869
  let w;
873
870
  if (h)
874
- h.setLoginParams({ callbackPath: d, extras: u }), await h.initAsync(g, "loginAsync", e), await h.setNonceAsync(y), h.startKeepAliveServiceWorker(), w = h;
871
+ h.setLoginParams({ callbackPath: d, extras: u }), await h.initAsync(g, "loginAsync", s), await h.setNonceAsync(y), h.startKeepAliveServiceWorker(), w = h;
875
872
  else {
876
- const T = I(n, e.storage ?? sessionStorage);
873
+ const T = I(e, s.storage ?? sessionStorage);
877
874
  T.setLoginParams({ callbackPath: d, extras: u }), await T.setNonceAsync(y), w = T;
878
875
  }
879
876
  const S = {
880
- client_id: e.client_id,
877
+ client_id: s.client_id,
881
878
  redirect_uri: l,
882
879
  scope: a,
883
880
  response_type: "code",
884
881
  ..._
885
882
  };
886
- await nn(w, o)(g.authorizationEndpoint, S);
883
+ await es(w, o)(g.authorizationEndpoint, S);
887
884
  } catch (l) {
888
- throw s(m.loginAsync_error, l), l;
885
+ throw n(m.loginAsync_error, l), l;
889
886
  }
890
887
  })();
891
- }, gn = (n) => async (e = !1) => {
888
+ }, ys = (e) => async (s = !1) => {
892
889
  try {
893
- n.publishEvent(m.loginCallbackAsync_begin, {});
894
- const s = n.configuration, t = s.client_id, o = e ? s.silent_redirect_uri : s.redirect_uri, i = s.authority, r = s.token_request_timeout, c = await n.initAsync(i, s.authority_configuration), a = n.location.getCurrentHref(), f = G(a).session_state, d = await E(s, n.configurationName);
890
+ e.publishEvent(m.loginCallbackAsync_begin, {});
891
+ const n = e.configuration, t = n.client_id, o = s ? n.silent_redirect_uri : n.redirect_uri, i = n.authority, r = n.token_request_timeout, c = await e.initAsync(i, n.authority_configuration), a = e.location.getCurrentHref(), f = G(a).session_state, d = await E(n, e.configurationName);
895
892
  let l, _, y, h;
896
893
  if (d)
897
- await d.initAsync(c, "loginCallbackAsync", s), await d.setSessionStateAsync(f), _ = await d.getNonceAsync(), y = d.getLoginParams(), h = await d.getStateAsync(), d.startKeepAliveServiceWorker(), l = d;
894
+ await d.initAsync(c, "loginCallbackAsync", n), await d.setSessionStateAsync(f), _ = await d.getNonceAsync(), y = d.getLoginParams(), h = await d.getStateAsync(), d.startKeepAliveServiceWorker(), l = d;
898
895
  else {
899
- const v = I(n.configurationName, s.storage ?? sessionStorage);
896
+ const v = I(e.configurationName, n.storage ?? sessionStorage);
900
897
  await v.setSessionStateAsync(f), _ = await v.getNonceAsync(), y = v.getLoginParams(), h = await v.getStateAsync(), l = v;
901
898
  }
902
899
  const g = G(a);
@@ -909,25 +906,25 @@ const _n = async (n) => {
909
906
  const w = {
910
907
  code: g.code,
911
908
  grant_type: "authorization_code",
912
- client_id: s.client_id,
909
+ client_id: n.client_id,
913
910
  redirect_uri: o
914
911
  }, S = {};
915
- if (s.token_request_extras)
916
- for (const [v, W] of Object.entries(s.token_request_extras))
912
+ if (n.token_request_extras)
913
+ for (const [v, W] of Object.entries(n.token_request_extras))
917
914
  S[v] = W;
918
915
  if (y && y.extras)
919
916
  for (const [v, W] of Object.entries(y.extras))
920
917
  v.endsWith(":token_request") && (S[v.replace(":token_request", "")] = W);
921
918
  const T = c.tokenEndpoint, U = {};
922
- if (s.demonstrating_proof_of_possession) {
923
- const v = await _n(s.demonstrating_proof_of_possession_configuration.generateKeyAlgorithm);
924
- d ? await d.setDemonstratingProofOfPossessionJwkAsync(v) : await I(n.configurationName, s.storage).setDemonstratingProofOfPossessionJwkAsync(v), U.DPoP = await Pe(s.demonstrating_proof_of_possession_configuration)(v, "POST", T);
919
+ if (n.demonstrating_proof_of_possession) {
920
+ const v = await fs(n.demonstrating_proof_of_possession_configuration.generateKeyAlgorithm);
921
+ d ? await d.setDemonstratingProofOfPossessionJwkAsync(v) : await I(e.configurationName, n.storage).setDemonstratingProofOfPossessionJwkAsync(v), U.DPoP = await be(n.demonstrating_proof_of_possession_configuration)(v, "POST", T);
925
922
  }
926
- const p = await sn(l)(
923
+ const p = await ss(l)(
927
924
  T,
928
925
  { ...w, ...S },
929
926
  U,
930
- n.configuration.token_renew_mode,
927
+ e.configuration.token_renew_mode,
931
928
  r
932
929
  );
933
930
  if (!p.success)
@@ -936,7 +933,7 @@ const _n = async (n) => {
936
933
  const A = p.data.tokens, O = p.data.demonstratingProofOfPossessionNonce;
937
934
  if (p.data.state !== S.state)
938
935
  throw new Error("state is not valid");
939
- const { isValid: N, reason: P } = ke(A, _.nonce, c);
936
+ const { isValid: N, reason: P } = ge(A, _.nonce, c);
940
937
  if (!N)
941
938
  throw new Error(`Tokens are not OpenID valid, reason: ${P}`);
942
939
  if (d) {
@@ -946,44 +943,44 @@ const _n = async (n) => {
946
943
  throw new Error("Demonstration of proof of possession require Access token not hidden by service worker");
947
944
  }
948
945
  if (d)
949
- await d.initAsync(o, "syncTokensAsync", s), k = d.getLoginParams(), O && await d.setDemonstratingProofOfPossessionNonce(O);
946
+ await d.initAsync(o, "syncTokensAsync", n), k = d.getLoginParams(), O && await d.setDemonstratingProofOfPossessionNonce(O);
950
947
  else {
951
- const v = I(n.configurationName, s.storage);
948
+ const v = I(e.configurationName, n.storage);
952
949
  k = v.getLoginParams(), O && await v.setDemonstratingProofOfPossessionNonce(O);
953
950
  }
954
- return await n.startCheckSessionAsync(c.checkSessionIframe, t, f, e), n.publishEvent(m.loginCallbackAsync_end, {}), {
951
+ return await e.startCheckSessionAsync(c.checkSessionIframe, t, f, s), e.publishEvent(m.loginCallbackAsync_end, {}), {
955
952
  tokens: A,
956
953
  state: "request.state",
957
954
  callbackPath: k.callbackPath
958
955
  };
959
- } catch (s) {
960
- throw console.error(s), n.publishEvent(m.loginCallbackAsync_error, s), s;
956
+ } catch (n) {
957
+ throw console.error(n), e.publishEvent(m.loginCallbackAsync_error, n), n;
961
958
  }
962
- }, ge = {
959
+ }, ye = {
963
960
  access_token: "access_token",
964
961
  refresh_token: "refresh_token"
965
- }, kn = (n) => async (e) => {
966
- J.clearTimeout(n.timeoutId), n.timeoutId = null, n.checkSessionIFrame && n.checkSessionIFrame.stop();
967
- const s = await E(n.configuration, n.configurationName);
968
- s ? await s.clearAsync(e) : await I(n.configurationName, n.configuration.storage).clearAsync(e), n.tokens = null, n.userInfo = null;
969
- }, mn = (n, e, s, t, o) => async (i = void 0, r = null) => {
970
- const c = n.configuration, a = await n.initAsync(c.authority, c.authority_configuration);
962
+ }, gs = (e) => async (s) => {
963
+ J.clearTimeout(e.timeoutId), e.timeoutId = null, e.checkSessionIFrame && e.checkSessionIFrame.stop();
964
+ const n = await E(e.configuration, e.configurationName);
965
+ n ? await n.clearAsync(s) : await I(e.configurationName, e.configuration.storage).clearAsync(s), e.tokens = null, e.userInfo = null;
966
+ }, ks = (e, s, n, t, o) => async (i = void 0, r = null) => {
967
+ const c = e.configuration, a = await e.initAsync(c.authority, c.authority_configuration);
971
968
  i && typeof i != "string" && (i = void 0, t.warn("callbackPathOrUrl path is not a string"));
972
969
  const u = i ?? o.getPath();
973
970
  let f = !1;
974
971
  i && (f = i.includes("https://") || i.includes("http://"));
975
- const d = f ? i : o.getOrigin() + u, l = n.tokens ? n.tokens.idToken : "";
972
+ const d = f ? i : o.getOrigin() + u, l = e.tokens ? e.tokens.idToken : "";
976
973
  try {
977
974
  const y = a.revocationEndpoint;
978
975
  if (y) {
979
- const h = [], g = n.tokens ? n.tokens.accessToken : null;
980
- if (g && c.logout_tokens_to_invalidate.includes(ge.access_token)) {
981
- const S = _e(s)(y, g, ne.access_token, c.client_id);
976
+ const h = [], g = e.tokens ? e.tokens.accessToken : null;
977
+ if (g && c.logout_tokens_to_invalidate.includes(ye.access_token)) {
978
+ const S = _e(n)(y, g, se.access_token, c.client_id);
982
979
  h.push(S);
983
980
  }
984
- const w = n.tokens ? n.tokens.refreshToken : null;
985
- if (w && c.logout_tokens_to_invalidate.includes(ge.refresh_token)) {
986
- const S = _e(s)(y, w, ne.refresh_token, c.client_id);
981
+ const w = e.tokens ? e.tokens.refreshToken : null;
982
+ if (w && c.logout_tokens_to_invalidate.includes(ye.refresh_token)) {
983
+ const S = _e(n)(y, w, se.refresh_token, c.client_id);
987
984
  h.push(S);
988
985
  }
989
986
  h.length > 0 && await Promise.all(h);
@@ -991,10 +988,10 @@ const _n = async (n) => {
991
988
  } catch (y) {
992
989
  t.warn("logoutAsync: error when revoking tokens, if the error persist, you ay configure property logout_tokens_to_invalidate from configuration to avoid this error"), t.warn(y);
993
990
  }
994
- const _ = n.tokens && n.tokens.idTokenPayload ? n.tokens.idTokenPayload.sub : null;
995
- await n.destroyAsync("LOGGED_OUT");
996
- for (const [y, h] of Object.entries(e))
997
- h !== n && await n.logoutSameTabAsync(n.configuration.client_id, _);
991
+ const _ = e.tokens && e.tokens.idTokenPayload ? e.tokens.idTokenPayload.sub : null;
992
+ await e.destroyAsync("LOGGED_OUT");
993
+ for (const [y, h] of Object.entries(s))
994
+ h !== e && await e.logoutSameTabAsync(e.configuration.client_id, _);
998
995
  if (a.endSessionEndpoint) {
999
996
  r || (r = {
1000
997
  id_token_hint: l
@@ -1006,29 +1003,29 @@ const _n = async (n) => {
1006
1003
  o.open(`${a.endSessionEndpoint}${y}`);
1007
1004
  } else
1008
1005
  o.reload();
1009
- }, pn = (n) => async (e = !1) => {
1010
- if (n.userInfo != null && !e)
1011
- return n.userInfo;
1012
- for (; n.tokens && !Q(n.tokens); )
1006
+ }, ms = (e) => async (s = !1) => {
1007
+ if (e.userInfo != null && !s)
1008
+ return e.userInfo;
1009
+ for (; e.tokens && !Q(e.tokens); )
1013
1010
  await R({ milliseconds: 200 });
1014
- if (!n.tokens)
1011
+ if (!e.tokens)
1015
1012
  return null;
1016
- const s = n.tokens.accessToken;
1017
- if (!s)
1013
+ const n = e.tokens.accessToken;
1014
+ if (!n)
1018
1015
  return null;
1019
- const t = n.configuration, i = (await n.initAsync(t.authority, t.authority_configuration)).userInfoEndpoint, c = await (async (a) => {
1016
+ const t = e.configuration, i = (await e.initAsync(t.authority, t.authority_configuration)).userInfoEndpoint, c = await (async (a) => {
1020
1017
  const u = await fetch(i, {
1021
1018
  headers: {
1022
1019
  authorization: `Bearer ${a}`
1023
1020
  }
1024
1021
  });
1025
1022
  return u.status !== 200 ? null : u.json();
1026
- })(s);
1027
- return n.userInfo = c, c;
1023
+ })(n);
1024
+ return e.userInfo = c, c;
1028
1025
  };
1029
1026
  class Y {
1030
- open(e) {
1031
- window.open(e, "_self");
1027
+ open(s) {
1028
+ window.open(s, "_self");
1032
1029
  }
1033
1030
  reload() {
1034
1031
  window.location.reload();
@@ -1037,15 +1034,15 @@ class Y {
1037
1034
  return window.location.href;
1038
1035
  }
1039
1036
  getPath() {
1040
- const e = window.location;
1041
- return e.pathname + (e.search || "") + (e.hash || "");
1037
+ const s = window.location;
1038
+ return s.pathname + (s.search || "") + (s.hash || "");
1042
1039
  }
1043
1040
  getOrigin() {
1044
1041
  return window.origin;
1045
1042
  }
1046
1043
  }
1047
- const wn = (n) => !!(n.os === "iOS" && n.osVersion.startsWith("12") || n.os === "Mac OS X" && n.osVersion.startsWith("10_15_6")), An = (n) => {
1048
- const e = n.appVersion, s = n.userAgent, t = "-";
1044
+ const ps = (e) => !!(e.os === "iOS" && e.osVersion.startsWith("12") || e.os === "Mac OS X" && e.osVersion.startsWith("10_15_6")), ws = (e) => {
1045
+ const s = e.appVersion, n = e.userAgent, t = "-";
1049
1046
  let o = t;
1050
1047
  const i = [
1051
1048
  { s: "Windows 10", r: /(Windows 10.0|Windows NT 10.0)/ },
@@ -1078,7 +1075,7 @@ const wn = (n) => !!(n.os === "iOS" && n.osVersion.startsWith("12") || n.os ===
1078
1075
  ];
1079
1076
  for (const c in i) {
1080
1077
  const a = i[c];
1081
- if (a.r.test(s)) {
1078
+ if (a.r.test(n)) {
1082
1079
  o = a.s;
1083
1080
  break;
1084
1081
  }
@@ -1088,10 +1085,10 @@ const wn = (n) => !!(n.os === "iOS" && n.osVersion.startsWith("12") || n.os ===
1088
1085
  case "Mac OS":
1089
1086
  case "Mac OS X":
1090
1087
  case "Android":
1091
- r = /(?:Android|Mac OS|Mac OS X|MacPPC|MacIntel|Mac_PowerPC|Macintosh) ([._\d]+)/.exec(s)[1];
1088
+ r = /(?:Android|Mac OS|Mac OS X|MacPPC|MacIntel|Mac_PowerPC|Macintosh) ([._\d]+)/.exec(n)[1];
1092
1089
  break;
1093
1090
  case "iOS": {
1094
- const c = /OS (\d+)_(\d+)_?(\d+)?/.exec(e);
1091
+ const c = /OS (\d+)_(\d+)_?(\d+)?/.exec(s);
1095
1092
  c != null && c.length > 2 && (r = c[1] + "." + c[2] + "." + (parseInt(c[3]) | 0));
1096
1093
  break;
1097
1094
  }
@@ -1101,191 +1098,191 @@ const wn = (n) => !!(n.os === "iOS" && n.osVersion.startsWith("12") || n.os ===
1101
1098
  osVersion: r
1102
1099
  };
1103
1100
  };
1104
- function Sn() {
1105
- const n = navigator.userAgent;
1106
- let e, s = n.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
1107
- if (/trident/i.test(s[1]))
1108
- return e = /\brv[ :]+(\d+)/g.exec(n) || [], { name: "ie", version: e[1] || "" };
1109
- if (s[1] === "Chrome" && (e = n.match(/\bOPR|Edge\/(\d+)/), e != null)) {
1110
- let t = e[1];
1101
+ function As() {
1102
+ const e = navigator.userAgent;
1103
+ let s, n = e.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
1104
+ if (/trident/i.test(n[1]))
1105
+ return s = /\brv[ :]+(\d+)/g.exec(e) || [], { name: "ie", version: s[1] || "" };
1106
+ if (n[1] === "Chrome" && (s = e.match(/\bOPR|Edge\/(\d+)/), s != null)) {
1107
+ let t = s[1];
1111
1108
  if (!t) {
1112
- const o = n.split(e[0] + "/");
1109
+ const o = e.split(s[0] + "/");
1113
1110
  o.length > 1 && (t = o[1]);
1114
1111
  }
1115
1112
  return { name: "opera", version: t };
1116
1113
  }
1117
- return s = s[2] ? [s[1], s[2]] : [navigator.appName, navigator.appVersion, "-?"], (e = n.match(/version\/(\d+)/i)) != null && s.splice(1, 1, e[1]), {
1118
- name: s[0].toLowerCase(),
1119
- version: s[1]
1114
+ return n = n[2] ? [n[1], n[2]] : [navigator.appName, navigator.appVersion, "-?"], (s = e.match(/version\/(\d+)/i)) != null && n.splice(1, 1, s[1]), {
1115
+ name: n[0].toLowerCase(),
1116
+ version: n[1]
1120
1117
  };
1121
1118
  }
1122
- const vn = () => {
1123
- const { name: n, version: e } = Sn();
1124
- if (n === "chrome" && parseInt(e) <= 70 || n === "opera" && (!e || parseInt(e.split(".")[0]) < 80) || n === "ie")
1119
+ const Ss = () => {
1120
+ const { name: e, version: s } = As();
1121
+ if (e === "chrome" && parseInt(s) <= 70 || e === "opera" && (!s || parseInt(s.split(".")[0]) < 80) || e === "ie")
1125
1122
  return !1;
1126
- const s = An(navigator);
1127
- return !wn(s);
1128
- }, Tn = async (n) => {
1129
- let e;
1130
- if (n.tokens != null)
1123
+ const n = ws(navigator);
1124
+ return !ps(n);
1125
+ }, vs = async (e) => {
1126
+ let s;
1127
+ if (e.tokens != null)
1131
1128
  return !1;
1132
- n.publishEvent(m.tryKeepExistingSessionAsync_begin, {});
1129
+ e.publishEvent(m.tryKeepExistingSessionAsync_begin, {});
1133
1130
  try {
1134
- const s = n.configuration, t = await n.initAsync(s.authority, s.authority_configuration);
1135
- if (e = await E(s, n.configurationName), e) {
1136
- const { tokens: o } = await e.initAsync(t, "tryKeepExistingSessionAsync", s);
1131
+ const n = e.configuration, t = await e.initAsync(n.authority, n.authority_configuration);
1132
+ if (s = await E(n, e.configurationName), s) {
1133
+ const { tokens: o } = await s.initAsync(t, "tryKeepExistingSessionAsync", n);
1137
1134
  if (o) {
1138
- e.startKeepAliveServiceWorker(), n.tokens = o;
1139
- const i = e.getLoginParams(n.configurationName);
1140
- n.timeoutId = M(n, n.tokens.refreshToken, n.tokens.expiresAt, i.extras);
1141
- const r = await e.getSessionStateAsync();
1142
- return await n.startCheckSessionAsync(t.check_session_iframe, s.client_id, r), n.publishEvent(m.tryKeepExistingSessionAsync_end, {
1135
+ s.startKeepAliveServiceWorker(), e.tokens = o;
1136
+ const i = s.getLoginParams(e.configurationName);
1137
+ e.timeoutId = M(e, e.tokens.refreshToken, e.tokens.expiresAt, i.extras);
1138
+ const r = await s.getSessionStateAsync();
1139
+ return await e.startCheckSessionAsync(t.check_session_iframe, n.client_id, r), e.publishEvent(m.tryKeepExistingSessionAsync_end, {
1143
1140
  success: !0,
1144
1141
  message: "tokens inside ServiceWorker are valid"
1145
1142
  }), !0;
1146
1143
  }
1147
- n.publishEvent(m.tryKeepExistingSessionAsync_end, {
1144
+ e.publishEvent(m.tryKeepExistingSessionAsync_end, {
1148
1145
  success: !1,
1149
1146
  message: "no exiting session found"
1150
1147
  });
1151
1148
  } else {
1152
- s.service_worker_relative_url && n.publishEvent(m.service_worker_not_supported_by_browser, {
1149
+ n.service_worker_relative_url && e.publishEvent(m.service_worker_not_supported_by_browser, {
1153
1150
  message: "service worker is not supported by this browser"
1154
1151
  });
1155
- const o = I(n.configurationName, s.storage ?? sessionStorage), { tokens: i } = await o.initAsync();
1152
+ const o = I(e.configurationName, n.storage ?? sessionStorage), { tokens: i } = await o.initAsync();
1156
1153
  if (i) {
1157
- n.tokens = te(i, null, s.token_renew_mode);
1154
+ e.tokens = te(i, null, n.token_renew_mode);
1158
1155
  const r = o.getLoginParams();
1159
- n.timeoutId = M(n, i.refreshToken, n.tokens.expiresAt, r.extras);
1156
+ e.timeoutId = M(e, i.refreshToken, e.tokens.expiresAt, r.extras);
1160
1157
  const c = await o.getSessionStateAsync();
1161
- return await n.startCheckSessionAsync(t.check_session_iframe, s.client_id, c), n.publishEvent(m.tryKeepExistingSessionAsync_end, {
1158
+ return await e.startCheckSessionAsync(t.check_session_iframe, n.client_id, c), e.publishEvent(m.tryKeepExistingSessionAsync_end, {
1162
1159
  success: !0,
1163
1160
  message: "tokens inside storage are valid"
1164
1161
  }), !0;
1165
1162
  }
1166
1163
  }
1167
- return n.publishEvent(m.tryKeepExistingSessionAsync_end, {
1164
+ return e.publishEvent(m.tryKeepExistingSessionAsync_end, {
1168
1165
  success: !1,
1169
- message: e ? "service worker sessions not retrieved" : "session storage sessions not retrieved"
1166
+ message: s ? "service worker sessions not retrieved" : "session storage sessions not retrieved"
1170
1167
  }), !1;
1171
- } catch (s) {
1172
- return console.error(s), e && await e.clearAsync(), n.publishEvent(m.tryKeepExistingSessionAsync_error, "tokens inside ServiceWorker are invalid"), !1;
1168
+ } catch (n) {
1169
+ return console.error(n), s && await s.clearAsync(), e.publishEvent(m.tryKeepExistingSessionAsync_error, "tokens inside ServiceWorker are invalid"), !1;
1173
1170
  }
1174
- }, bn = () => fetch;
1175
- class se {
1176
- constructor(e) {
1177
- this.authorizationEndpoint = e.authorization_endpoint, this.tokenEndpoint = e.token_endpoint, this.revocationEndpoint = e.revocation_endpoint, this.userInfoEndpoint = e.userinfo_endpoint, this.checkSessionIframe = e.check_session_iframe, this.issuer = e.issuer, this.endSessionEndpoint = e.end_session_endpoint;
1171
+ }, Ts = () => fetch;
1172
+ class ne {
1173
+ constructor(s) {
1174
+ this.authorizationEndpoint = s.authorization_endpoint, this.tokenEndpoint = s.token_endpoint, this.revocationEndpoint = s.revocation_endpoint, this.userInfoEndpoint = s.userinfo_endpoint, this.checkSessionIframe = s.check_session_iframe, this.issuer = s.issuer, this.endSessionEndpoint = s.end_session_endpoint;
1178
1175
  }
1179
1176
  }
1180
- const x = {}, Pn = (n, e = new Y()) => (s, t = "default") => (x[t] || (x[t] = new K(s, t, n, e)), x[t]), On = async (n) => {
1181
- const { parsedTokens: e, callbackPath: s } = await n.loginCallbackAsync();
1182
- return n.timeoutId = M(n, e.refreshToken, e.expiresAt), { callbackPath: s };
1183
- }, En = (n) => Math.floor(Math.random() * n), re = class F {
1184
- constructor(e, s = "default", t, o = new Y()) {
1177
+ const x = {}, bs = (e, s = new Y()) => (n, t = "default") => (x[t] || (x[t] = new K(n, t, e, s)), x[t]), Ps = async (e) => {
1178
+ const { parsedTokens: s, callbackPath: n } = await e.loginCallbackAsync();
1179
+ return e.timeoutId = M(e, s.refreshToken, s.expiresAt), { callbackPath: n };
1180
+ }, Os = (e) => Math.floor(Math.random() * e), re = class F {
1181
+ constructor(s, n = "default", t, o = new Y()) {
1185
1182
  this.initPromise = null, this.tryKeepExistingSessionPromise = null, this.loginPromise = null, this.loginCallbackPromise = null, this.loginCallbackWithAutoTokensRenewPromise = null, this.userInfoPromise = null, this.renewTokensPromise = null, this.logoutPromise = null;
1186
- let i = e.silent_login_uri;
1187
- e.silent_redirect_uri && !e.silent_login_uri && (i = `${e.silent_redirect_uri.replace("-callback", "").replace("callback", "")}-login`);
1188
- let r = e.refresh_time_before_tokens_expiration_in_second ?? 120;
1183
+ let i = s.silent_login_uri;
1184
+ s.silent_redirect_uri && !s.silent_login_uri && (i = `${s.silent_redirect_uri.replace("-callback", "").replace("callback", "")}-login`);
1185
+ let r = s.refresh_time_before_tokens_expiration_in_second ?? 120;
1189
1186
  r > 60 && (r = r - Math.floor(Math.random() * 40)), this.location = o ?? new Y();
1190
- const c = e.service_worker_update_require_callback ?? $e(this.location);
1187
+ const c = s.service_worker_update_require_callback ?? De(this.location);
1191
1188
  this.configuration = {
1192
- ...e,
1189
+ ...s,
1193
1190
  silent_login_uri: i,
1194
- monitor_session: e.monitor_session ?? !1,
1191
+ monitor_session: s.monitor_session ?? !1,
1195
1192
  refresh_time_before_tokens_expiration_in_second: r,
1196
- silent_login_timeout: e.silent_login_timeout ?? 12e3,
1197
- token_renew_mode: e.token_renew_mode ?? z.access_token_or_id_token_invalid,
1198
- demonstrating_proof_of_possession: e.demonstrating_proof_of_possession ?? !1,
1199
- authority_timeout_wellknowurl_in_millisecond: e.authority_timeout_wellknowurl_in_millisecond ?? 1e4,
1200
- logout_tokens_to_invalidate: e.logout_tokens_to_invalidate ?? ["access_token", "refresh_token"],
1193
+ silent_login_timeout: s.silent_login_timeout ?? 12e3,
1194
+ token_renew_mode: s.token_renew_mode ?? z.access_token_or_id_token_invalid,
1195
+ demonstrating_proof_of_possession: s.demonstrating_proof_of_possession ?? !1,
1196
+ authority_timeout_wellknowurl_in_millisecond: s.authority_timeout_wellknowurl_in_millisecond ?? 1e4,
1197
+ logout_tokens_to_invalidate: s.logout_tokens_to_invalidate ?? ["access_token", "refresh_token"],
1201
1198
  service_worker_update_require_callback: c,
1202
- service_worker_activate: e.service_worker_activate ?? vn,
1203
- demonstrating_proof_of_possession_configuration: e.demonstrating_proof_of_possession_configuration ?? rn
1204
- }, this.getFetch = t ?? bn, this.configurationName = s, this.tokens = null, this.userInfo = null, this.events = [], this.timeoutId = null, this.synchroniseTokensAsync.bind(this), this.loginCallbackWithAutoTokensRenewAsync.bind(this), this.initAsync.bind(this), this.loginCallbackAsync.bind(this), this.subscribeEvents.bind(this), this.removeEventSubscription.bind(this), this.publishEvent.bind(this), this.destroyAsync.bind(this), this.logoutAsync.bind(this), this.renewTokensAsync.bind(this), this.initAsync(this.configuration.authority, this.configuration.authority_configuration);
1199
+ service_worker_activate: s.service_worker_activate ?? Ss,
1200
+ demonstrating_proof_of_possession_configuration: s.demonstrating_proof_of_possession_configuration ?? os
1201
+ }, this.getFetch = t ?? Ts, this.configurationName = n, this.tokens = null, this.userInfo = null, this.events = [], this.timeoutId = null, this.synchroniseTokensAsync.bind(this), this.loginCallbackWithAutoTokensRenewAsync.bind(this), this.initAsync.bind(this), this.loginCallbackAsync.bind(this), this.subscribeEvents.bind(this), this.removeEventSubscription.bind(this), this.publishEvent.bind(this), this.destroyAsync.bind(this), this.logoutAsync.bind(this), this.renewTokensAsync.bind(this), this.initAsync(this.configuration.authority, this.configuration.authority_configuration);
1205
1202
  }
1206
- subscribeEvents(e) {
1207
- const s = En(9999999999999).toString();
1208
- return this.events.push({ id: s, func: e }), s;
1203
+ subscribeEvents(s) {
1204
+ const n = Os(9999999999999).toString();
1205
+ return this.events.push({ id: n, func: s }), n;
1209
1206
  }
1210
- removeEventSubscription(e) {
1211
- const s = this.events.filter((t) => t.id !== e);
1212
- this.events = s;
1207
+ removeEventSubscription(s) {
1208
+ const n = this.events.filter((t) => t.id !== s);
1209
+ this.events = n;
1213
1210
  }
1214
- publishEvent(e, s) {
1211
+ publishEvent(s, n) {
1215
1212
  this.events.forEach((t) => {
1216
- t.func(e, s);
1213
+ t.func(s, n);
1217
1214
  });
1218
1215
  }
1219
- static get(e = "default") {
1220
- const s = typeof process > "u";
1221
- if (!Object.prototype.hasOwnProperty.call(x, e) && s)
1216
+ static get(s = "default") {
1217
+ const n = typeof process > "u";
1218
+ if (!Object.prototype.hasOwnProperty.call(x, s) && n)
1222
1219
  throw Error(`OIDC library does seem initialized.
1223
- Please checkout that you are using OIDC hook inside a <OidcProvider configurationName="${e}"></OidcProvider> compoment.`);
1224
- return x[e];
1220
+ Please checkout that you are using OIDC hook inside a <OidcProvider configurationName="${s}"></OidcProvider> compoment.`);
1221
+ return x[s];
1225
1222
  }
1226
1223
  _silentLoginCallbackFromIFrame() {
1227
1224
  if (this.configuration.silent_redirect_uri && this.configuration.silent_login_uri) {
1228
- const e = this.location, s = G(e.getCurrentHref());
1229
- window.parent.postMessage(`${this.configurationName}_oidc_tokens:${JSON.stringify({ tokens: this.tokens, sessionState: s.session_state })}`, e.getOrigin());
1225
+ const s = this.location, n = G(s.getCurrentHref());
1226
+ window.parent.postMessage(`${this.configurationName}_oidc_tokens:${JSON.stringify({ tokens: this.tokens, sessionState: n.session_state })}`, s.getOrigin());
1230
1227
  }
1231
1228
  }
1232
1229
  _silentLoginErrorCallbackFromIFrame() {
1233
1230
  if (this.configuration.silent_redirect_uri && this.configuration.silent_login_uri) {
1234
- const e = this.location, s = G(e.getCurrentHref());
1235
- window.parent.postMessage(`${this.configurationName}_oidc_error:${JSON.stringify({ error: s.error })}`, e.getOrigin());
1231
+ const s = this.location, n = G(s.getCurrentHref());
1232
+ window.parent.postMessage(`${this.configurationName}_oidc_error:${JSON.stringify({ error: n.error })}`, s.getOrigin());
1236
1233
  }
1237
1234
  }
1238
1235
  async silentLoginCallbackAsync() {
1239
1236
  try {
1240
1237
  await this.loginCallbackAsync(!0), this._silentLoginCallbackFromIFrame();
1241
- } catch (e) {
1242
- console.error(e), this._silentLoginErrorCallbackFromIFrame();
1238
+ } catch (s) {
1239
+ console.error(s), this._silentLoginErrorCallbackFromIFrame();
1243
1240
  }
1244
1241
  }
1245
- async initAsync(e, s) {
1242
+ async initAsync(s, n) {
1246
1243
  if (this.initPromise !== null)
1247
1244
  return this.initPromise;
1248
1245
  const t = async () => {
1249
- if (s != null)
1250
- return new se({
1251
- authorization_endpoint: s.authorization_endpoint,
1252
- end_session_endpoint: s.end_session_endpoint,
1253
- revocation_endpoint: s.revocation_endpoint,
1254
- token_endpoint: s.token_endpoint,
1255
- userinfo_endpoint: s.userinfo_endpoint,
1256
- check_session_iframe: s.check_session_iframe,
1257
- issuer: s.issuer
1246
+ if (n != null)
1247
+ return new ne({
1248
+ authorization_endpoint: n.authorization_endpoint,
1249
+ end_session_endpoint: n.end_session_endpoint,
1250
+ revocation_endpoint: n.revocation_endpoint,
1251
+ token_endpoint: n.token_endpoint,
1252
+ userinfo_endpoint: n.userinfo_endpoint,
1253
+ check_session_iframe: n.check_session_iframe,
1254
+ issuer: n.issuer
1258
1255
  });
1259
1256
  const i = await E(this.configuration, this.configurationName) ? window.localStorage : null;
1260
- return await Ze(this.getFetch())(e, this.configuration.authority_time_cache_wellknowurl_in_second ?? 60 * 60, i, this.configuration.authority_timeout_wellknowurl_in_millisecond);
1257
+ return await Qe(this.getFetch())(s, this.configuration.authority_time_cache_wellknowurl_in_second ?? 60 * 60, i, this.configuration.authority_timeout_wellknowurl_in_millisecond);
1261
1258
  };
1262
1259
  return this.initPromise = t(), this.initPromise.then((o) => (this.initPromise = null, o));
1263
1260
  }
1264
1261
  async tryKeepExistingSessionAsync() {
1265
- return this.tryKeepExistingSessionPromise !== null ? this.tryKeepExistingSessionPromise : (this.tryKeepExistingSessionPromise = Tn(this), this.tryKeepExistingSessionPromise.then((e) => (this.tryKeepExistingSessionPromise = null, e)));
1262
+ return this.tryKeepExistingSessionPromise !== null ? this.tryKeepExistingSessionPromise : (this.tryKeepExistingSessionPromise = vs(this), this.tryKeepExistingSessionPromise.then((s) => (this.tryKeepExistingSessionPromise = null, s)));
1266
1263
  }
1267
- async startCheckSessionAsync(e, s, t, o = !1) {
1268
- await Fe(this, x, this.configuration)(e, s, t, o);
1264
+ async startCheckSessionAsync(s, n, t, o = !1) {
1265
+ await Ue(this, x, this.configuration)(s, n, t, o);
1269
1266
  }
1270
- async loginAsync(e = void 0, s = null, t = !1, o = void 0, i = !1) {
1271
- return this.loginPromise !== null ? this.loginPromise : i ? Ue(window, this.configurationName, this.configuration, this.publishEvent.bind(this), this)(s, o) : (this.loginPromise = yn(this.configurationName, this.configuration, this.publishEvent.bind(this), this.initAsync.bind(this), this.location)(e, s, t, o), this.loginPromise.then((r) => (this.loginPromise = null, r)));
1267
+ async loginAsync(s = void 0, n = null, t = !1, o = void 0, i = !1) {
1268
+ return this.loginPromise !== null ? this.loginPromise : i ? Ke(window, this.configurationName, this.configuration, this.publishEvent.bind(this), this)(n, o) : (this.loginPromise = hs(this.configurationName, this.configuration, this.publishEvent.bind(this), this.initAsync.bind(this), this.location)(s, n, t, o), this.loginPromise.then((r) => (this.loginPromise = null, r)));
1272
1269
  }
1273
- async loginCallbackAsync(e = !1) {
1270
+ async loginCallbackAsync(s = !1) {
1274
1271
  if (this.loginCallbackPromise !== null)
1275
1272
  return this.loginCallbackPromise;
1276
- const s = async () => {
1277
- const t = await gn(this)(e), o = t.tokens;
1273
+ const n = async () => {
1274
+ const t = await ys(this)(s), o = t.tokens;
1278
1275
  return this.tokens = o, await E(this.configuration, this.configurationName) || I(this.configurationName, this.configuration.storage).setTokens(o), this.publishEvent(F.eventNames.token_aquired, o), { parsedTokens: o, state: t.state, callbackPath: t.callbackPath };
1279
1276
  };
1280
- return this.loginCallbackPromise = s(), this.loginCallbackPromise.then((t) => (this.loginCallbackPromise = null, t));
1277
+ return this.loginCallbackPromise = n(), this.loginCallbackPromise.then((t) => (this.loginCallbackPromise = null, t));
1281
1278
  }
1282
- async synchroniseTokensAsync(e, s = 0, t = !1, o = null, i) {
1279
+ async synchroniseTokensAsync(s, n = 0, t = !1, o = null, i) {
1283
1280
  for (; !navigator.onLine && document.hidden; )
1284
1281
  await R({ milliseconds: 1e3 }), this.publishEvent(m.refreshTokensAsync, { message: "wait because navigator is offline and hidden" });
1285
1282
  let r = 6;
1286
1283
  for (; !navigator.onLine && r > 0; )
1287
1284
  await R({ milliseconds: 1e3 }), r--, this.publishEvent(m.refreshTokensAsync, { message: `wait because navigator is offline try ${r}` });
1288
- const a = document.hidden ? s : s + 1;
1285
+ const a = document.hidden ? n : n + 1;
1289
1286
  o || (o = {});
1290
1287
  const u = this.configuration, f = (l, _, y = null) => ie(this.configurationName, this.configuration, this.publishEvent.bind(this))(l, _, y), d = async () => {
1291
1288
  try {
@@ -1305,10 +1302,10 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1305
1302
  }
1306
1303
  return this.publishEvent(m.refreshTokensAsync_error, { message: "refresh token silent return" }), await this.synchroniseTokensAsync(null, a, t, o, i);
1307
1304
  };
1308
- if (s > 4)
1305
+ if (n > 4)
1309
1306
  return i(null), this.publishEvent(m.refreshTokensAsync_error, { message: "refresh token" }), { tokens: null, status: "SESSION_LOST" };
1310
1307
  try {
1311
- const { status: l, tokens: _, nonce: y } = await Ke(this)(u, this.configurationName, this.tokens, t);
1308
+ const { status: l, tokens: _, nonce: y } = await Re(this)(u, this.configurationName, this.tokens, t);
1312
1309
  switch (l) {
1313
1310
  case D.SESSION_LOST:
1314
1311
  return i(null), this.publishEvent(m.refreshTokensAsync_error, { message: "refresh token session lost" }), { tokens: null, status: "SESSION_LOST" };
@@ -1321,9 +1318,9 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1321
1318
  case D.LOGOUT_FROM_ANOTHER_TAB:
1322
1319
  return i(null), this.publishEvent(m.logout_from_another_tab, { status: "session syncTokensAsync" }), { tokens: null, status: "LOGGED_OUT" };
1323
1320
  case D.REQUIRE_SYNC_TOKENS:
1324
- return this.publishEvent(m.refreshTokensAsync_begin, { refreshToken: e, status: l, tryNumber: s }), await d();
1321
+ return this.publishEvent(m.refreshTokensAsync_begin, { refreshToken: s, status: l, tryNumber: n }), await d();
1325
1322
  default: {
1326
- if (this.publishEvent(m.refreshTokensAsync_begin, { refreshToken: e, status: l, tryNumber: s }), !e)
1323
+ if (this.publishEvent(m.refreshTokensAsync_begin, { refreshToken: s, status: l, tryNumber: n }), !s)
1327
1324
  return await d();
1328
1325
  const h = u.client_id, g = u.redirect_uri, w = u.authority, T = { ...u.token_request_extras ? u.token_request_extras : {} };
1329
1326
  for (const [p, k] of Object.entries(o))
@@ -1336,7 +1333,7 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1336
1333
  refresh_token: _.refreshToken
1337
1334
  }, k = await this.initAsync(w, u.authority_configuration), A = document.hidden ? 1e4 : 3e4 * 10, O = k.tokenEndpoint, N = {};
1338
1335
  u.demonstrating_proof_of_possession && (N.DPoP = await this.generateDemonstrationOfProofOfPossessionAsync(_.accessToken, O, "POST"));
1339
- const P = await en(this.getFetch())(
1336
+ const P = await Ze(this.getFetch())(
1340
1337
  O,
1341
1338
  p,
1342
1339
  T,
@@ -1346,7 +1343,7 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1346
1343
  A
1347
1344
  );
1348
1345
  if (P.success) {
1349
- const { isValid: v, reason: W } = ke(P.data, y.nonce, k);
1346
+ const { isValid: v, reason: W } = ge(P.data, y.nonce, k);
1350
1347
  if (!v)
1351
1348
  return i(null), this.publishEvent(m.refreshTokensAsync_error, { message: `refresh token return not valid tokens, reason: ${W}` }), { tokens: null, status: "SESSION_LOST" };
1352
1349
  if (i(P.data), P.demonstratingProofOfPossessionNonce) {
@@ -1358,16 +1355,16 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1358
1355
  return this.publishEvent(m.refreshTokensAsync_silent_error, {
1359
1356
  message: "bad request",
1360
1357
  tokenResponse: P
1361
- }), await this.synchroniseTokensAsync(e, a, t, o, i);
1358
+ }), await this.synchroniseTokensAsync(s, a, t, o, i);
1362
1359
  })();
1363
1360
  }
1364
1361
  }
1365
1362
  } catch (l) {
1366
- return console.error(l), this.publishEvent(m.refreshTokensAsync_silent_error, { message: "exception", exception: l.message }), this.synchroniseTokensAsync(e, a, t, o, i);
1363
+ return console.error(l), this.publishEvent(m.refreshTokensAsync_silent_error, { message: "exception", exception: l.message }), this.synchroniseTokensAsync(s, a, t, o, i);
1367
1364
  }
1368
1365
  }
1369
- async generateDemonstrationOfProofOfPossessionAsync(e, s, t) {
1370
- const o = this.configuration, i = { ath: await Ae(e) }, r = await E(o, this.configurationName);
1366
+ async generateDemonstrationOfProofOfPossessionAsync(s, n, t) {
1367
+ const o = this.configuration, i = { ath: await we(s) }, r = await E(o, this.configurationName);
1371
1368
  let c, a;
1372
1369
  if (r)
1373
1370
  c = await r.getDemonstratingProofOfPossessionNonce(), a = await r.getDemonstratingProofOfPossessionJwkAsync();
@@ -1375,42 +1372,42 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1375
1372
  const u = I(this.configurationName, o.storage);
1376
1373
  a = await u.getDemonstratingProofOfPossessionJwkAsync(), c = await u.getDemonstratingProofOfPossessionNonce();
1377
1374
  }
1378
- return c && (i.nonce = c), await Pe(o.demonstrating_proof_of_possession_configuration)(a, t, s, i);
1375
+ return c && (i.nonce = c), await be(o.demonstrating_proof_of_possession_configuration)(a, t, n, i);
1379
1376
  }
1380
1377
  loginCallbackWithAutoTokensRenewAsync() {
1381
- return this.loginCallbackWithAutoTokensRenewPromise !== null ? this.loginCallbackWithAutoTokensRenewPromise : (this.loginCallbackWithAutoTokensRenewPromise = On(this), this.loginCallbackWithAutoTokensRenewPromise.then((e) => (this.loginCallbackWithAutoTokensRenewPromise = null, e)));
1378
+ return this.loginCallbackWithAutoTokensRenewPromise !== null ? this.loginCallbackWithAutoTokensRenewPromise : (this.loginCallbackWithAutoTokensRenewPromise = Ps(this), this.loginCallbackWithAutoTokensRenewPromise.then((s) => (this.loginCallbackWithAutoTokensRenewPromise = null, s)));
1382
1379
  }
1383
- userInfoAsync(e = !1) {
1384
- return this.userInfoPromise !== null ? this.userInfoPromise : (this.userInfoPromise = pn(this)(e), this.userInfoPromise.then((s) => (this.userInfoPromise = null, s)));
1380
+ userInfoAsync(s = !1) {
1381
+ return this.userInfoPromise !== null ? this.userInfoPromise : (this.userInfoPromise = ms(this)(s), this.userInfoPromise.then((n) => (this.userInfoPromise = null, n)));
1385
1382
  }
1386
- async renewTokensAsync(e = null) {
1383
+ async renewTokensAsync(s = null) {
1387
1384
  if (this.renewTokensPromise !== null)
1388
1385
  return this.renewTokensPromise;
1389
1386
  if (this.timeoutId)
1390
- return J.clearTimeout(this.timeoutId), this.renewTokensPromise = pe(this, this.tokens.refreshToken, !0, e), this.renewTokensPromise.then((s) => (this.renewTokensPromise = null, s));
1387
+ return J.clearTimeout(this.timeoutId), this.renewTokensPromise = me(this, this.tokens.refreshToken, !0, s), this.renewTokensPromise.then((n) => (this.renewTokensPromise = null, n));
1391
1388
  }
1392
- async destroyAsync(e) {
1393
- return await kn(this)(e);
1389
+ async destroyAsync(s) {
1390
+ return await gs(this)(s);
1394
1391
  }
1395
- async logoutSameTabAsync(e, s) {
1396
- this.configuration.monitor_session && this.configuration.client_id === e && s && this.tokens && this.tokens.idTokenPayload && this.tokens.idTokenPayload.sub === s && (this.publishEvent(m.logout_from_same_tab, { message: s }), await this.destroyAsync("LOGGED_OUT"));
1392
+ async logoutSameTabAsync(s, n) {
1393
+ this.configuration.monitor_session && this.configuration.client_id === s && n && this.tokens && this.tokens.idTokenPayload && this.tokens.idTokenPayload.sub === n && (this.publishEvent(m.logout_from_same_tab, { message: n }), await this.destroyAsync("LOGGED_OUT"));
1397
1394
  }
1398
- async logoutOtherTabAsync(e, s) {
1399
- this.configuration.monitor_session && this.configuration.client_id === e && s && this.tokens && this.tokens.idTokenPayload && this.tokens.idTokenPayload.sub === s && (await this.destroyAsync("LOGGED_OUT"), this.publishEvent(m.logout_from_another_tab, { message: "SessionMonitor", sub: s }));
1395
+ async logoutOtherTabAsync(s, n) {
1396
+ this.configuration.monitor_session && this.configuration.client_id === s && n && this.tokens && this.tokens.idTokenPayload && this.tokens.idTokenPayload.sub === n && (await this.destroyAsync("LOGGED_OUT"), this.publishEvent(m.logout_from_another_tab, { message: "SessionMonitor", sub: n }));
1400
1397
  }
1401
- async logoutAsync(e = void 0, s = null) {
1402
- return this.logoutPromise ? this.logoutPromise : (this.logoutPromise = mn(this, x, this.getFetch(), console, this.location)(e, s), this.logoutPromise.then((t) => (this.logoutPromise = null, t)));
1398
+ async logoutAsync(s = void 0, n = null) {
1399
+ return this.logoutPromise ? this.logoutPromise : (this.logoutPromise = ks(this, x, this.getFetch(), console, this.location)(s, n), this.logoutPromise.then((t) => (this.logoutPromise = null, t)));
1403
1400
  }
1404
1401
  };
1405
- re.getOrCreate = (n, e) => (s, t = "default") => Pn(n, e)(s, t);
1402
+ re.getOrCreate = (e, s) => (n, t = "default") => bs(e, s)(n, t);
1406
1403
  re.eventNames = m;
1407
1404
  let K = re;
1408
- const In = (n, e) => async (...s) => {
1405
+ const Es = (e, s) => async (...n) => {
1409
1406
  var l;
1410
- const [t, o, ...i] = s, r = o ? { ...o } : { method: "GET" };
1407
+ const [t, o, ...i] = n, r = o ? { ...o } : { method: "GET" };
1411
1408
  let c = new Headers();
1412
1409
  r.headers && (c = r.headers instanceof Headers ? r.headers : new Headers(r.headers));
1413
- const a = e, u = await a.getValidTokenAsync(), f = (l = u == null ? void 0 : u.tokens) == null ? void 0 : l.accessToken;
1410
+ const a = s, u = await a.getValidTokenAsync(), f = (l = u == null ? void 0 : u.tokens) == null ? void 0 : l.accessToken;
1414
1411
  if (c.has("Accept") || c.set("Accept", "application/json"), f) {
1415
1412
  if (a.configuration.demonstrating_proof_of_possession) {
1416
1413
  const _ = await a.generateDemonstrationOfProofOfPossessionAsync(f, t.toString(), r.method);
@@ -1420,37 +1417,37 @@ const In = (n, e) => async (...s) => {
1420
1417
  r.credentials || (r.credentials = "same-origin");
1421
1418
  }
1422
1419
  const d = { ...r, headers: c };
1423
- return await n(t, d, ...i);
1424
- }, X = class Oe {
1425
- constructor(e) {
1426
- this._oidc = e;
1420
+ return await e(t, d, ...i);
1421
+ }, X = class Pe {
1422
+ constructor(s) {
1423
+ this._oidc = s;
1427
1424
  }
1428
- subscribeEvents(e) {
1429
- return this._oidc.subscribeEvents(e);
1425
+ subscribeEvents(s) {
1426
+ return this._oidc.subscribeEvents(s);
1430
1427
  }
1431
- removeEventSubscription(e) {
1432
- this._oidc.removeEventSubscription(e);
1428
+ removeEventSubscription(s) {
1429
+ this._oidc.removeEventSubscription(s);
1433
1430
  }
1434
- publishEvent(e, s) {
1435
- this._oidc.publishEvent(e, s);
1431
+ publishEvent(s, n) {
1432
+ this._oidc.publishEvent(s, n);
1436
1433
  }
1437
- static get(e = "default") {
1438
- return new Oe(K.get(e));
1434
+ static get(s = "default") {
1435
+ return new Pe(K.get(s));
1439
1436
  }
1440
1437
  tryKeepExistingSessionAsync() {
1441
1438
  return this._oidc.tryKeepExistingSessionAsync();
1442
1439
  }
1443
- loginAsync(e = void 0, s = null, t = !1, o = void 0, i = !1) {
1444
- return this._oidc.loginAsync(e, s, t, o, i);
1440
+ loginAsync(s = void 0, n = null, t = !1, o = void 0, i = !1) {
1441
+ return this._oidc.loginAsync(s, n, t, o, i);
1445
1442
  }
1446
- logoutAsync(e = void 0, s = null) {
1447
- return this._oidc.logoutAsync(e, s);
1443
+ logoutAsync(s = void 0, n = null) {
1444
+ return this._oidc.logoutAsync(s, n);
1448
1445
  }
1449
1446
  silentLoginCallbackAsync() {
1450
1447
  return this._oidc.silentLoginCallbackAsync();
1451
1448
  }
1452
- renewTokensAsync(e = null) {
1453
- return this._oidc.renewTokensAsync(e);
1449
+ renewTokensAsync(s = null) {
1450
+ return this._oidc.renewTokensAsync(s);
1454
1451
  }
1455
1452
  loginCallbackAsync() {
1456
1453
  return this._oidc.loginCallbackWithAutoTokensRenewAsync();
@@ -1461,27 +1458,27 @@ const In = (n, e) => async (...s) => {
1461
1458
  get configuration() {
1462
1459
  return this._oidc.configuration;
1463
1460
  }
1464
- async generateDemonstrationOfProofOfPossessionAsync(e, s, t) {
1465
- return this._oidc.generateDemonstrationOfProofOfPossessionAsync(e, s, t);
1461
+ async generateDemonstrationOfProofOfPossessionAsync(s, n, t) {
1462
+ return this._oidc.generateDemonstrationOfProofOfPossessionAsync(s, n, t);
1466
1463
  }
1467
- async getValidTokenAsync(e = 200, s = 50) {
1468
- return We(this._oidc, e, s);
1464
+ async getValidTokenAsync(s = 200, n = 50) {
1465
+ return xe(this._oidc, s, n);
1469
1466
  }
1470
- fetchWithTokens(e) {
1471
- return In(e, this);
1467
+ fetchWithTokens(s) {
1468
+ return Es(s, this);
1472
1469
  }
1473
- async userInfoAsync(e = !1) {
1474
- return this._oidc.userInfoAsync(e);
1470
+ async userInfoAsync(s = !1) {
1471
+ return this._oidc.userInfoAsync(s);
1475
1472
  }
1476
1473
  };
1477
- X.getOrCreate = (n, e = new Y()) => (s, t = "default") => new X(K.getOrCreate(n, e)(s, t));
1474
+ X.getOrCreate = (e, s = new Y()) => (n, t = "default") => new X(K.getOrCreate(e, s)(n, t));
1478
1475
  X.eventNames = K.eventNames;
1479
- let xn = X;
1476
+ let Ns = X;
1480
1477
  export {
1481
- xn as OidcClient,
1478
+ Ns as OidcClient,
1482
1479
  Y as OidcLocation,
1483
1480
  z as TokenRenewMode,
1484
- bn as getFetchDefault,
1481
+ Ts as getFetchDefault,
1485
1482
  G as getParseQueryStringFromLocation,
1486
- Nn as getPath
1483
+ Cs as getPath
1487
1484
  };