@axa-fr/oidc-client 7.27.7 → 7.27.11

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
@@ -71,106 +71,132 @@ var e = class {
71
71
  syncTokensAsync_end: "syncTokensAsync_end",
72
72
  syncTokensAsync_error: "syncTokensAsync_error",
73
73
  tokensInvalidAndWaitingActionsToRefresh: "tokensInvalidAndWaitingActionsToRefresh"
74
- }, a = (e, t = sessionStorage, n) => {
75
- let r = n ?? t, i = (i) => (t[`oidc.${e}`] = JSON.stringify({
74
+ }, a = (e, t, n) => {
75
+ if (n == null) {
76
+ delete e[t];
77
+ return;
78
+ }
79
+ e[t] = JSON.stringify(n);
80
+ }, o = (e, t, n) => {
81
+ if (n == null) {
82
+ delete e[t];
83
+ return;
84
+ }
85
+ e[t] = n;
86
+ }, s = (e) => {
87
+ if (typeof e != "string" || e === "undefined" || e === "null" || e === "") return null;
88
+ try {
89
+ return JSON.parse(e);
90
+ } catch {
91
+ return null;
92
+ }
93
+ }, c = (e, t = sessionStorage, n) => {
94
+ let r = n ?? t, i = (i) => (a(t, `oidc.${e}`, {
76
95
  tokens: null,
77
96
  status: i
78
- }), delete t[`oidc.${e}.userInfo`], n && n !== t && (delete r[`oidc.login.${e}`], delete r[`oidc.state.${e}`], delete r[`oidc.code_verifier.${e}`], delete r[`oidc.nonce.${e}`]), Promise.resolve()), a = async () => {
79
- if (!t[`oidc.${e}`]) return t[`oidc.${e}`] = JSON.stringify({
97
+ }), delete t[`oidc.${e}.userInfo`], n && n !== t && (delete r[`oidc.login.${e}`], delete r[`oidc.state.${e}`], delete r[`oidc.code_verifier.${e}`], delete r[`oidc.nonce.${e}`]), Promise.resolve()), c = async () => {
98
+ let n = s(t[`oidc.${e}`]);
99
+ return n ? Promise.resolve({
100
+ tokens: n.tokens,
101
+ status: n.status
102
+ }) : (a(t, `oidc.${e}`, {
80
103
  tokens: null,
81
104
  status: null
82
105
  }), {
83
106
  tokens: null,
84
107
  status: null
85
- };
86
- let n = JSON.parse(t[`oidc.${e}`]);
87
- return Promise.resolve({
88
- tokens: n.tokens,
89
- status: n.status
90
108
  });
91
- }, o = (n) => {
92
- t[`oidc.${e}`] = JSON.stringify({ tokens: n });
93
- }, s = async (n) => {
94
- t[`oidc.session_state.${e}`] = n;
95
- }, c = async () => t[`oidc.session_state.${e}`], l = (t) => {
96
- r[`oidc.nonce.${e}`] = t.nonce;
97
- }, u = (n) => {
98
- t[`oidc.jwk.${e}`] = JSON.stringify(n);
99
- }, d = () => JSON.parse(t[`oidc.jwk.${e}`]), f = async () => ({ nonce: r[`oidc.nonce.${e}`] }), p = async (n) => {
100
- t[`oidc.dpop_nonce.${e}`] = n;
101
- }, m = () => t[`oidc.dpop_nonce.${e}`], h = () => t[`oidc.${e}`] ? JSON.stringify({ tokens: JSON.parse(t[`oidc.${e}`]).tokens }) : null, g = {};
109
+ }, l = (n) => {
110
+ a(t, `oidc.${e}`, { tokens: n });
111
+ }, u = async (n) => {
112
+ o(t, `oidc.session_state.${e}`, n);
113
+ }, d = async () => t[`oidc.session_state.${e}`], f = (t) => {
114
+ o(r, `oidc.nonce.${e}`, t?.nonce);
115
+ }, p = (n) => {
116
+ a(t, `oidc.jwk.${e}`, n);
117
+ }, m = () => s(t[`oidc.jwk.${e}`]), h = async () => ({ nonce: r[`oidc.nonce.${e}`] }), g = async (n) => {
118
+ o(t, `oidc.dpop_nonce.${e}`, n);
119
+ }, _ = () => t[`oidc.dpop_nonce.${e}`], v = () => {
120
+ let n = s(t[`oidc.${e}`]);
121
+ return n ? JSON.stringify({ tokens: n.tokens }) : null;
122
+ }, y = {};
102
123
  return {
103
124
  clearAsync: i,
104
- initAsync: a,
105
- setTokens: o,
106
- getTokens: h,
107
- setSessionStateAsync: s,
108
- getSessionStateAsync: c,
109
- setNonceAsync: l,
110
- getNonceAsync: f,
125
+ initAsync: c,
126
+ setTokens: l,
127
+ getTokens: v,
128
+ setSessionStateAsync: u,
129
+ getSessionStateAsync: d,
130
+ setNonceAsync: f,
131
+ getNonceAsync: h,
111
132
  setLoginParams: (t) => {
112
- g[e] = t, r[`oidc.login.${e}`] = JSON.stringify(t);
133
+ if (t == null) {
134
+ delete y[e], delete r[`oidc.login.${e}`];
135
+ return;
136
+ }
137
+ y[e] = t, a(r, `oidc.login.${e}`, t);
113
138
  },
114
139
  getLoginParams: () => {
115
- let t = r[`oidc.login.${e}`];
116
- return t ? (g[e] || (g[e] = JSON.parse(t)), g[e]) : (console.warn(`storage[oidc.login.${e}] is empty, you should have an bad OIDC or code configuration somewhere.`), null);
140
+ if (y[e]) return y[e];
141
+ let t = s(r[`oidc.login.${e}`]);
142
+ return t === null ? (console.warn(`storage[oidc.login.${e}] is empty, you should have an bad OIDC or code configuration somewhere.`), null) : (y[e] = t, t);
117
143
  },
118
144
  getStateAsync: async () => r[`oidc.state.${e}`],
119
145
  setStateAsync: async (t) => {
120
- r[`oidc.state.${e}`] = t;
146
+ o(r, `oidc.state.${e}`, t);
121
147
  },
122
148
  getCodeVerifierAsync: async () => r[`oidc.code_verifier.${e}`],
123
149
  setCodeVerifierAsync: async (t) => {
124
- r[`oidc.code_verifier.${e}`] = t;
150
+ o(r, `oidc.code_verifier.${e}`, t);
125
151
  },
126
- setDemonstratingProofOfPossessionNonce: p,
127
- getDemonstratingProofOfPossessionNonce: m,
128
- setDemonstratingProofOfPossessionJwkAsync: u,
129
- getDemonstratingProofOfPossessionJwkAsync: d
152
+ setDemonstratingProofOfPossessionNonce: g,
153
+ getDemonstratingProofOfPossessionNonce: _,
154
+ setDemonstratingProofOfPossessionJwkAsync: p,
155
+ getDemonstratingProofOfPossessionJwkAsync: m
130
156
  };
131
- }, o = /* @__PURE__ */ function(e) {
157
+ }, l = /* @__PURE__ */ function(e) {
132
158
  return e.AutomaticBeforeTokenExpiration = "AutomaticBeforeTokensExpiration", e.AutomaticOnlyWhenFetchExecuted = "AutomaticOnlyWhenFetchExecuted", e;
133
- }({}), s = (e) => decodeURIComponent(Array.prototype.map.call(atob(e), (e) => "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2)).join("")), c = (e) => JSON.parse(s(e.replaceAll(/-/g, "+").replaceAll(/_/g, "/"))), l = (e) => {
159
+ }({}), u = (e) => decodeURIComponent(Array.prototype.map.call(atob(e), (e) => "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2)).join("")), d = (e) => JSON.parse(u(e.replaceAll(/-/g, "+").replaceAll(/_/g, "/"))), f = (e) => {
134
160
  try {
135
- return e && u(e, ".") === 2 ? c(e.split(".")[1]) : null;
161
+ return e && p(e, ".") === 2 ? d(e.split(".")[1]) : null;
136
162
  } catch (e) {
137
163
  console.warn(e);
138
164
  }
139
165
  return null;
140
- }, u = (e, t) => e.split(t).length - 1, d = {
166
+ }, p = (e, t) => e.split(t).length - 1, m = {
141
167
  access_token_or_id_token_invalid: "access_token_or_id_token_invalid",
142
168
  access_token_invalid: "access_token_invalid",
143
169
  id_token_invalid: "id_token_invalid"
144
170
  };
145
- function f(e, t, n) {
171
+ function h(e, t, n) {
146
172
  return e.issuedAt ? typeof e.issuedAt == "string" ? parseInt(e.issuedAt, 10) : e.issuedAt : t && t.iat ? t.iat : n && n.iat ? n.iat : (/* @__PURE__ */ new Date()).getTime() / 1e3;
147
173
  }
148
- var p = (e, t = null, n) => {
174
+ var g = (e, t = null, n) => {
149
175
  if (!e) return null;
150
176
  let r, i = typeof e.expiresIn == "string" ? parseInt(e.expiresIn, 10) : e.expiresIn;
151
- r = e.accessTokenPayload === void 0 ? l(e.accessToken) : e.accessTokenPayload;
177
+ r = e.accessTokenPayload === void 0 ? f(e.accessToken) : e.accessTokenPayload;
152
178
  let a;
153
179
  a = t != null && "idToken" in t && !("idToken" in e) ? t.idToken : e.idToken;
154
- let o = e.idTokenPayload ? e.idTokenPayload : l(a), s = o && o.exp ? o.exp : Number.MAX_VALUE, c = r && r.exp ? r.exp : e.issuedAt + i;
155
- e.issuedAt = f(e, r, o);
156
- let u;
157
- u = e.expiresAt ? e.expiresAt : n === d.access_token_invalid ? c : n === d.id_token_invalid || s < c ? s : c;
158
- let p = {
180
+ let o = e.idTokenPayload ? e.idTokenPayload : f(a), s = o && o.exp ? o.exp : Number.MAX_VALUE, c = r && r.exp ? r.exp : e.issuedAt + i;
181
+ e.issuedAt = h(e, r, o);
182
+ let l;
183
+ l = e.expiresAt ? e.expiresAt : n === m.access_token_invalid ? c : n === m.id_token_invalid || s < c ? s : c;
184
+ let u = {
159
185
  ...e,
160
186
  idTokenPayload: o,
161
187
  accessTokenPayload: r,
162
- expiresAt: u,
188
+ expiresAt: l,
163
189
  idToken: a
164
190
  };
165
191
  if (t != null && "refreshToken" in t && !("refreshToken" in e)) {
166
192
  let e = t.refreshToken;
167
193
  return {
168
- ...p,
194
+ ...u,
169
195
  refreshToken: e
170
196
  };
171
197
  }
172
- return p;
173
- }, m = (e, t, n) => {
198
+ return u;
199
+ }, _ = (e, t, n) => {
174
200
  if (!e) return null;
175
201
  e.issued_at ||= (/* @__PURE__ */ new Date()).getTime() / 1e3;
176
202
  let r = {
@@ -181,29 +207,29 @@ var p = (e, t = null, n) => {
181
207
  tokenType: e.token_type,
182
208
  issuedAt: e.issued_at
183
209
  };
184
- return "refresh_token" in e && (r.refreshToken = e.refresh_token), e.accessTokenPayload !== void 0 && (r.accessTokenPayload = e.accessTokenPayload), e.idTokenPayload !== void 0 && (r.idTokenPayload = e.idTokenPayload), p(r, t, n);
185
- }, h = (e, t) => {
210
+ return "refresh_token" in e && (r.refreshToken = e.refresh_token), e.accessTokenPayload !== void 0 && (r.accessTokenPayload = e.accessTokenPayload), e.idTokenPayload !== void 0 && (r.idTokenPayload = e.idTokenPayload), g(r, t, n);
211
+ }, v = (e, t) => {
186
212
  let n = t - (/* @__PURE__ */ new Date()).getTime() / 1e3;
187
213
  return Math.round(n - e);
188
- }, g = (e, t = 0) => e ? h(t, e.expiresAt) > 0 : !1, _ = async (e, t = 200, n = 50) => {
214
+ }, y = (e, t = 0) => e ? v(t, e.expiresAt) > 0 : !1, b = async (e, t = 200, n = 50) => {
189
215
  let r = n, i = await e.syncTokensInfoAsync();
190
216
  for (; [
191
217
  G.REQUIRE_SYNC_TOKENS,
192
218
  G.TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_INVALID,
193
219
  G.TOKENS_INVALID
194
220
  ].includes(i) && r > 0;) {
195
- if (e.configuration.token_automatic_renew_mode == o.AutomaticOnlyWhenFetchExecuted) {
221
+ if (e.configuration.token_automatic_renew_mode == l.AutomaticOnlyWhenFetchExecuted) {
196
222
  await e.renewTokensAsync({});
197
223
  break;
198
- } else await C({ milliseconds: t });
224
+ } else await E({ milliseconds: t });
199
225
  --r, i = await e.syncTokensInfoAsync();
200
226
  }
201
227
  return {
202
- isTokensValid: g(e.getTokens()),
228
+ isTokensValid: y(e.getTokens()),
203
229
  tokens: e.getTokens(),
204
230
  numberWaited: r - n
205
231
  };
206
- }, v = (e, t, n) => {
232
+ }, x = (e, t, n) => {
207
233
  if (e.idTokenPayload) {
208
234
  let r = e.idTokenPayload;
209
235
  if (n.issuer !== r.iss) return {
@@ -229,7 +255,7 @@ var p = (e, t = null, n) => {
229
255
  isValid: !0,
230
256
  reason: ""
231
257
  };
232
- }, y = (function() {
258
+ }, S = (function() {
233
259
  let e = typeof window > "u" ? global : window;
234
260
  return {
235
261
  setTimeout: setTimeout.bind(e),
@@ -237,37 +263,37 @@ var p = (e, t = null, n) => {
237
263
  setInterval: setInterval.bind(e),
238
264
  clearInterval: clearInterval.bind(e)
239
265
  };
240
- })(), b = "7.27.7", x = null, S, C = ({ milliseconds: e }) => new Promise((t) => y.setTimeout(t, e)), w = (e = "/") => {
266
+ })(), C = "7.27.11", w = null, T, E = ({ milliseconds: e }) => new Promise((t) => S.setTimeout(t, e)), D = (e = "/") => {
241
267
  try {
242
- S = new AbortController(), fetch(`${e}OidcKeepAliveServiceWorker.json?minSleepSeconds=150`, { signal: S.signal }).catch((e) => {
268
+ T = new AbortController(), fetch(`${e}OidcKeepAliveServiceWorker.json?minSleepSeconds=150`, { signal: T.signal }).catch((e) => {
243
269
  console.log(e);
244
- }), C({ milliseconds: 150 * 1e3 }).then(() => w(e));
270
+ }), E({ milliseconds: 150 * 1e3 }).then(() => D(e));
245
271
  } catch (e) {
246
272
  console.log(e);
247
273
  }
248
- }, T = () => {
249
- S && S.abort();
250
- }, E = (e) => {
274
+ }, O = () => {
275
+ T && T.abort();
276
+ }, k = (e) => {
251
277
  let t = `oidc.tabId.${e}`, n = sessionStorage.getItem(t);
252
278
  if (n) return n;
253
279
  let r = globalThis.crypto.randomUUID();
254
280
  return sessionStorage.setItem(t, r), r;
255
- }, D = 5e3, ee = (e) => navigator.serviceWorker.controller ?? e.active ?? e.waiting ?? e.installing ?? null, O = (e, t) => (n) => {
256
- let r = t?.timeoutMs ?? D;
281
+ }, ee = 5e3, A = (e) => navigator.serviceWorker.controller ?? e.active ?? e.waiting ?? e.installing ?? null, j = (e, t) => (n) => {
282
+ let r = t?.timeoutMs ?? ee;
257
283
  return new Promise((t, i) => {
258
- let a = ee(e);
284
+ let a = A(e);
259
285
  if (!a) {
260
286
  i(/* @__PURE__ */ Error("Service worker target not available (controller/active/waiting/installing missing)"));
261
287
  return;
262
288
  }
263
289
  let o = new MessageChannel(), s = null, c = () => {
264
290
  try {
265
- s != null && (y.clearTimeout(s), s = null), o.port1.onmessage = null, o.port1.close(), o.port2.close();
291
+ s != null && (S.clearTimeout(s), s = null), o.port1.onmessage = null, o.port1.close(), o.port2.close();
266
292
  } catch (e) {
267
293
  console.error(e);
268
294
  }
269
295
  };
270
- s = y.setTimeout(() => {
296
+ s = S.setTimeout(() => {
271
297
  c(), i(/* @__PURE__ */ Error(`Service worker did not respond within ${r}ms (type=${n?.type})`));
272
298
  }, r), o.port1.onmessage = (e) => {
273
299
  c(), e?.data?.error ? i(e.data.error) : t(e.data);
@@ -276,7 +302,7 @@ var p = (e, t = null, n) => {
276
302
  let e = n?.configurationName;
277
303
  a.postMessage({
278
304
  ...n,
279
- tabId: E(e ?? "default")
305
+ tabId: k(e ?? "default")
280
306
  }, [o.port2]);
281
307
  } catch (e) {
282
308
  c(), i(e);
@@ -286,42 +312,42 @@ var p = (e, t = null, n) => {
286
312
  let n = !1, r = () => {
287
313
  n || (n = !0, navigator.serviceWorker.removeEventListener("controllerchange", r), t(navigator.serviceWorker.controller ?? null));
288
314
  };
289
- navigator.serviceWorker.addEventListener("controllerchange", r), y.setTimeout(() => {
315
+ navigator.serviceWorker.addEventListener("controllerchange", r), S.setTimeout(() => {
290
316
  n || (n = !0, navigator.serviceWorker.removeEventListener("controllerchange", r), t(navigator.serviceWorker.controller ?? null));
291
317
  }, e);
292
- }), ne = !1, k = !1, A = /* @__PURE__ */ new Map(), j = "oidc.sw.controllerchange_reload_count", M = 3, N = () => {
318
+ }), ne = !1, M = !1, N = /* @__PURE__ */ new Map(), P = "oidc.sw.controllerchange_reload_count", F = 3, I = () => {
293
319
  try {
294
- return parseInt(sessionStorage.getItem(j) ?? "0", 10);
320
+ return parseInt(sessionStorage.getItem(P) ?? "0", 10);
295
321
  } catch {
296
322
  return 0;
297
323
  }
298
324
  }, re = () => {
299
- let e = N() + 1;
325
+ let e = I() + 1;
300
326
  try {
301
- sessionStorage.setItem(j, String(e));
327
+ sessionStorage.setItem(P, String(e));
302
328
  } catch {}
303
329
  return e;
304
330
  }, ie = () => {
305
331
  try {
306
- sessionStorage.removeItem(j);
332
+ sessionStorage.removeItem(P);
307
333
  } catch {}
308
- }, P = async (e, t) => {
334
+ }, L = async (e, t) => {
309
335
  let n = e.service_worker_relative_url;
310
336
  if (typeof window > "u" || typeof navigator > "u" || !navigator.serviceWorker || !n || e.service_worker_activate() === !1) return null;
311
- let r = `${n}?v=${b}`, i = null;
312
- e.service_worker_register ? (A.has(n) || A.set(n, e.service_worker_register(n)), i = await A.get(n)) : (A.has(r) || A.set(r, navigator.serviceWorker.register(r, { updateViaCache: "none" })), i = await A.get(r));
337
+ let r = `${n}?v=${C}`, i = null;
338
+ e.service_worker_register ? (N.has(n) || N.set(n, e.service_worker_register(n)), i = await N.get(n)) : (N.has(r) || N.set(r, navigator.serviceWorker.register(r, { updateViaCache: "none" })), i = await N.get(r));
313
339
  let a = `oidc.sw.version_mismatch_reload.${t}`, o = async (e) => {
314
- T(), console.log("New SW waiting – SKIP_WAITING");
340
+ O(), console.log("New SW waiting – SKIP_WAITING");
315
341
  try {
316
342
  await new Promise((n, r) => {
317
343
  let i = new MessageChannel(), a = null, o = () => {
318
344
  try {
319
- a != null && (y.clearTimeout(a), a = null), i.port1.onmessage = null, i.port1.close(), i.port2.close();
345
+ a != null && (S.clearTimeout(a), a = null), i.port1.onmessage = null, i.port1.close(), i.port2.close();
320
346
  } catch (e) {
321
347
  console.error(e);
322
348
  }
323
349
  };
324
- a = y.setTimeout(() => {
350
+ a = S.setTimeout(() => {
325
351
  o(), r(/* @__PURE__ */ Error("SKIP_WAITING did not respond within 8000ms"));
326
352
  }, 8e3), i.port1.onmessage = (e) => {
327
353
  o(), e?.data?.error ? r(e.data.error) : n();
@@ -331,7 +357,7 @@ var p = (e, t = null, n) => {
331
357
  type: "SKIP_WAITING",
332
358
  configurationName: t,
333
359
  data: null,
334
- tabId: E(t ?? "default")
360
+ tabId: k(t ?? "default")
335
361
  }, [i.port2]);
336
362
  } catch (e) {
337
363
  o(), r(e);
@@ -344,9 +370,9 @@ var p = (e, t = null, n) => {
344
370
  let e = i.waiting;
345
371
  e ? await o(e) : console.warn("sendSkipWaiting called but no waiting service worker found");
346
372
  }, c = (e) => {
347
- T(), e.addEventListener("statechange", async () => {
373
+ O(), e.addEventListener("statechange", async () => {
348
374
  if (e.state === "installed" && navigator.serviceWorker.controller) {
349
- if (N() >= M) {
375
+ if (I() >= F) {
350
376
  console.warn("SW trackInstallingWorker: skipping SKIP_WAITING because the reload budget is exhausted");
351
377
  return;
352
378
  }
@@ -357,11 +383,11 @@ var p = (e, t = null, n) => {
357
383
  i.addEventListener("updatefound", () => {
358
384
  let e = i.installing;
359
385
  e && c(e);
360
- }), i.installing ? c(i.installing) : i.waiting && navigator.serviceWorker.controller && (N() < M ? s() : console.warn("SW: a waiting worker exists but reload budget is exhausted – skipping activation")), i.update().catch((e) => {
386
+ }), i.installing ? c(i.installing) : i.waiting && navigator.serviceWorker.controller && (I() < F ? s() : console.warn("SW: a waiting worker exists but reload budget is exhausted – skipping activation")), i.update().catch((e) => {
361
387
  console.error(e);
362
388
  });
363
389
  try {
364
- await navigator.serviceWorker.ready, navigator.serviceWorker.controller || (await O(i, { timeoutMs: 8e3 })({
390
+ await navigator.serviceWorker.ready, navigator.serviceWorker.controller || (await j(i, { timeoutMs: 8e3 })({
365
391
  type: "claim",
366
392
  configurationName: t,
367
393
  data: null
@@ -370,20 +396,20 @@ var p = (e, t = null, n) => {
370
396
  return console.warn(`Failed init ServiceWorker ${e?.toString?.() ?? String(e)}`), null;
371
397
  }
372
398
  ne || (ne = !0, navigator.serviceWorker.addEventListener("controllerchange", () => {
373
- if (k) return;
399
+ if (M) return;
374
400
  let e = re();
375
- if (e > M) {
401
+ if (e > F) {
376
402
  console.warn(`SW controllerchange: reload budget exhausted (${e - 1} reloads). Skipping reload to avoid infinite loop.`);
377
403
  return;
378
404
  }
379
- k = !0, console.log("SW controller changed – reloading page"), T(), window.location.reload();
405
+ M = !0, console.log("SW controller changed – reloading page"), O(), window.location.reload();
380
406
  }));
381
- let l = async (e) => O(i)({
407
+ let l = async (e) => j(i)({
382
408
  type: "clear",
383
409
  data: { status: e },
384
410
  configurationName: t
385
411
  }), u = async (e, n, r) => {
386
- let o = await O(i)({
412
+ let o = await j(i)({
387
413
  type: "init",
388
414
  data: {
389
415
  oidcServerConfiguration: e,
@@ -395,96 +421,107 @@ var p = (e, t = null, n) => {
395
421
  },
396
422
  configurationName: t
397
423
  }), c = o.version;
398
- if (c !== "7.27.7") {
399
- console.warn(`Service worker ${c} version mismatch with js client version ${b}, unregistering and reloading`);
424
+ if (c !== "7.27.11") {
425
+ console.warn(`Service worker ${c} version mismatch with js client version ${C}, unregistering and reloading`);
400
426
  let e = parseInt(sessionStorage.getItem(a) ?? "0", 10);
401
427
  if (e < 3) {
402
- if (sessionStorage.setItem(a, String(e + 1)), i.waiting) return await s(), await C({ milliseconds: 500 }), k || (k = !0, window.location.reload()), new Promise(() => {});
428
+ if (sessionStorage.setItem(a, String(e + 1)), i.waiting) return await s(), await E({ milliseconds: 500 }), M || (M = !0, window.location.reload()), new Promise(() => {});
403
429
  {
404
- T();
430
+ O();
405
431
  try {
406
432
  await i.update();
407
433
  } catch (e) {
408
434
  console.error(e);
409
435
  }
410
436
  let e = await i.unregister();
411
- return console.log(`Service worker unregistering ${e}`), await C({ milliseconds: 500 }), k || (k = !0, window.location.reload()), new Promise(() => {});
437
+ return console.log(`Service worker unregistering ${e}`), await E({ milliseconds: 500 }), M || (M = !0, window.location.reload()), new Promise(() => {});
412
438
  }
413
439
  } else console.error(`Service worker version mismatch persists after ${e} attempt(s). Continuing with mismatched version.`);
414
440
  } else sessionStorage.removeItem(a), ie();
415
441
  return {
416
- tokens: m(o.tokens, null, r.token_renew_mode),
442
+ tokens: _(o.tokens, null, r.token_renew_mode),
417
443
  status: o.status
418
444
  };
419
445
  }, d = (e = "/") => {
420
- x ?? (x = "not_null", w(e));
421
- }, f = (e) => O(i)({
446
+ w ?? (w = "not_null", D(e));
447
+ }, f = (e) => j(i)({
422
448
  type: "setSessionState",
423
449
  data: { sessionState: e },
424
450
  configurationName: t
425
- }), p = async () => (await O(i)({
451
+ }), p = async () => (await j(i)({
426
452
  type: "getSessionState",
427
453
  data: null,
428
454
  configurationName: t
429
- })).sessionState, h = (e) => (sessionStorage[`oidc.nonce.${t}`] = e.nonce, O(i)({
455
+ })).sessionState, m = (e) => (sessionStorage[`oidc.nonce.${t}`] = e.nonce, j(i)({
430
456
  type: "setNonce",
431
457
  data: { nonce: e },
432
458
  configurationName: t
433
- })), g = async (e = !0) => {
434
- let n = (await O(i)({
459
+ })), h = async (e = !0) => {
460
+ let n = (await j(i)({
435
461
  type: "getNonce",
436
462
  data: null,
437
463
  configurationName: t
438
464
  })).nonce;
439
- return n || (n = sessionStorage[`oidc.nonce.${t}`], console.warn("nonce not found in service worker, using sessionStorage"), e && (await h(n), n = (await g(!1)).nonce)), { nonce: n };
440
- }, _ = {}, v = (e) => {
441
- _[t] = e, localStorage[`oidc.login.${t}`] = JSON.stringify(e);
442
- }, S = () => {
465
+ return n || (n = sessionStorage[`oidc.nonce.${t}`], console.warn("nonce not found in service worker, using sessionStorage"), e && (await m(n), n = (await h(!1)).nonce)), { nonce: n };
466
+ }, g = {}, v = (e) => {
467
+ if (e == null) {
468
+ delete g[t], delete localStorage[`oidc.login.${t}`];
469
+ return;
470
+ }
471
+ g[t] = e, localStorage[`oidc.login.${t}`] = JSON.stringify(e);
472
+ }, y = () => {
473
+ if (g[t]) return g[t];
443
474
  let e = localStorage[`oidc.login.${t}`];
444
- return _[t] || (_[t] = JSON.parse(e)), _[t];
445
- }, D = async (e) => {
446
- await O(i)({
475
+ if (typeof e != "string" || e === "" || e === "undefined" || e === "null") return null;
476
+ try {
477
+ g[t] = JSON.parse(e);
478
+ } catch {
479
+ return null;
480
+ }
481
+ return g[t];
482
+ }, b = async (e) => {
483
+ await j(i)({
447
484
  type: "setDemonstratingProofOfPossessionNonce",
448
485
  data: { demonstratingProofOfPossessionNonce: e },
449
486
  configurationName: t
450
487
  });
451
- }, ee = async () => (await O(i)({
488
+ }, x = async () => (await j(i)({
452
489
  type: "getDemonstratingProofOfPossessionNonce",
453
490
  data: null,
454
491
  configurationName: t
455
- })).demonstratingProofOfPossessionNonce, j = async (e) => {
492
+ })).demonstratingProofOfPossessionNonce, T = async (e) => {
456
493
  let n = JSON.stringify(e);
457
- await O(i)({
494
+ await j(i)({
458
495
  type: "setDemonstratingProofOfPossessionJwk",
459
496
  data: { demonstratingProofOfPossessionJwkJson: n },
460
497
  configurationName: t
461
498
  });
462
- }, P = async () => {
463
- let e = await O(i)({
499
+ }, ee = async () => {
500
+ let e = await j(i)({
464
501
  type: "getDemonstratingProofOfPossessionJwk",
465
502
  data: null,
466
503
  configurationName: t
467
504
  });
468
505
  return e.demonstratingProofOfPossessionJwkJson ? JSON.parse(e.demonstratingProofOfPossessionJwkJson) : null;
469
- }, F = async (e = !0) => {
470
- let n = (await O(i)({
506
+ }, A = async (e = !0) => {
507
+ let n = (await j(i)({
471
508
  type: "getState",
472
509
  data: null,
473
510
  configurationName: t
474
511
  })).state;
475
- return n || (n = sessionStorage[`oidc.state.${t}`], console.warn("state not found in service worker, using sessionStorage"), e && (await I(n), n = await F(!1))), n;
476
- }, I = async (e) => (sessionStorage[`oidc.state.${t}`] = e, O(i)({
512
+ return n || (n = sessionStorage[`oidc.state.${t}`], console.warn("state not found in service worker, using sessionStorage"), e && (await P(n), n = await A(!1))), n;
513
+ }, P = async (e) => (sessionStorage[`oidc.state.${t}`] = e, j(i)({
477
514
  type: "setState",
478
515
  data: { state: e },
479
516
  configurationName: t
480
517
  })), L = async (e = !0) => {
481
- let n = (await O(i)({
518
+ let n = (await j(i)({
482
519
  type: "getCodeVerifier",
483
520
  data: null,
484
521
  configurationName: t
485
522
  })).codeVerifier;
486
523
  return n || (n = sessionStorage[`oidc.code_verifier.${t}`], console.warn("codeVerifier not found in service worker, using sessionStorage"), e && (await R(n), n = await L(!1))), n;
487
- }, R = async (e) => (sessionStorage[`oidc.code_verifier.${t}`] = e, O(i)({
524
+ }, R = async (e) => (sessionStorage[`oidc.code_verifier.${t}`] = e, j(i)({
488
525
  type: "setCodeVerifier",
489
526
  data: { codeVerifier: e },
490
527
  configurationName: t
@@ -495,29 +532,29 @@ var p = (e, t = null, n) => {
495
532
  startKeepAliveServiceWorker: () => d(e.service_worker_keep_alive_path),
496
533
  setSessionStateAsync: f,
497
534
  getSessionStateAsync: p,
498
- setNonceAsync: h,
499
- getNonceAsync: g,
535
+ setNonceAsync: m,
536
+ getNonceAsync: h,
500
537
  setLoginParams: v,
501
- getLoginParams: S,
502
- getStateAsync: F,
503
- setStateAsync: I,
538
+ getLoginParams: y,
539
+ getStateAsync: A,
540
+ setStateAsync: P,
504
541
  getCodeVerifierAsync: L,
505
542
  setCodeVerifierAsync: R,
506
- setDemonstratingProofOfPossessionNonce: D,
507
- getDemonstratingProofOfPossessionNonce: ee,
508
- setDemonstratingProofOfPossessionJwkAsync: j,
509
- getDemonstratingProofOfPossessionJwkAsync: P
543
+ setDemonstratingProofOfPossessionNonce: b,
544
+ getDemonstratingProofOfPossessionNonce: x,
545
+ setDemonstratingProofOfPossessionJwkAsync: T,
546
+ getDemonstratingProofOfPossessionJwkAsync: ee
510
547
  };
511
- }, F = {}, I = (e, t = window.sessionStorage, n) => {
512
- if (!F[e] && t) {
548
+ }, R = {}, ae = (e, t = window.sessionStorage, n) => {
549
+ if (!R[e] && t) {
513
550
  let n = t.getItem(e);
514
- n && (F[e] = JSON.parse(n));
551
+ n && (R[e] = JSON.parse(n));
515
552
  }
516
553
  let r = 1e3 * n;
517
- return F[e] && F[e].timestamp + r > Date.now() ? F[e].result : null;
518
- }, L = (e, t, n = window.sessionStorage) => {
554
+ return R[e] && R[e].timestamp + r > Date.now() ? R[e].result : null;
555
+ }, oe = (e, t, n = window.sessionStorage) => {
519
556
  let r = Date.now();
520
- F[e] = {
557
+ R[e] = {
521
558
  result: t,
522
559
  timestamp: r
523
560
  }, n && n.setItem(e, JSON.stringify({
@@ -527,13 +564,13 @@ var p = (e, t = null, n) => {
527
564
  };
528
565
  //#endregion
529
566
  //#region src/jwt.ts
530
- function R(e) {
567
+ function se(e) {
531
568
  return new TextEncoder().encode(e);
532
569
  }
533
- function ae(e) {
570
+ function ce(e) {
534
571
  return btoa(e).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+/g, "");
535
572
  }
536
- function oe(e) {
573
+ function le(e) {
537
574
  return encodeURIComponent(e).replace(/%([0-9A-F]{2})/g, function(e, t) {
538
575
  return String.fromCharCode(parseInt(t, 16));
539
576
  });
@@ -542,12 +579,12 @@ var z = (e) => {
542
579
  let t = "";
543
580
  return e.forEach(function(e) {
544
581
  t += String.fromCharCode(e);
545
- }), ae(t);
582
+ }), ce(t);
546
583
  };
547
- function se(e) {
548
- return ae(oe(e));
584
+ function ue(e) {
585
+ return ce(le(e));
549
586
  }
550
- var ce = {
587
+ var de = {
551
588
  importKeyAlgorithm: {
552
589
  name: "ECDSA",
553
590
  namedCurve: "P-256",
@@ -563,7 +600,7 @@ var ce = {
563
600
  },
564
601
  digestAlgorithm: { name: "SHA-256" },
565
602
  jwtHeaderAlgorithm: "ES256"
566
- }, le = { sign: (e) => async (t, n, r, i, a = "dpop+jwt") => {
603
+ }, fe = { sign: (e) => async (t, n, r, i, a = "dpop+jwt") => {
567
604
  switch (t = Object.assign({}, t), n.typ = a, n.alg = i.jwtHeaderAlgorithm, n.alg) {
568
605
  case "ES256":
569
606
  n.jwk = {
@@ -584,11 +621,11 @@ var ce = {
584
621
  default: throw Error("Unknown or not implemented JWS algorithm");
585
622
  }
586
623
  let o = {
587
- protected: se(JSON.stringify(n)),
588
- payload: se(JSON.stringify(r))
589
- }, s = i.importKeyAlgorithm, c = await e.crypto.subtle.importKey("jwk", t, s, !0, ["sign"]), l = R(`${o.protected}.${o.payload}`), u = i.signAlgorithm, d = await e.crypto.subtle.sign(u, c, l);
624
+ protected: ue(JSON.stringify(n)),
625
+ payload: ue(JSON.stringify(r))
626
+ }, s = i.importKeyAlgorithm, c = await e.crypto.subtle.importKey("jwk", t, s, !0, ["sign"]), l = se(`${o.protected}.${o.payload}`), u = i.signAlgorithm, d = await e.crypto.subtle.sign(u, c, l);
590
627
  return o.signature = z(new Uint8Array(d)), `${o.protected}.${o.payload}.${o.signature}`;
591
- } }, ue = {
628
+ } }, pe = {
592
629
  generate: (e) => async (t) => {
593
630
  let n = t, r = await e.crypto.subtle.generateKey(n, !0, ["sign", "verify"]);
594
631
  return await e.crypto.subtle.exportKey("jwk", r.privateKey);
@@ -597,7 +634,7 @@ var ce = {
597
634
  let t = Object.assign({}, e);
598
635
  return delete t.d, t.key_ops = ["verify"], t;
599
636
  }
600
- }, de = { thumbprint: (e) => async (t, n) => {
637
+ }, me = { thumbprint: (e) => async (t, n) => {
601
638
  let r;
602
639
  switch (t.kty) {
603
640
  case "EC":
@@ -608,61 +645,61 @@ var ce = {
608
645
  break;
609
646
  default: throw Error("Unknown or not implemented JWK type");
610
647
  }
611
- let i = await e.crypto.subtle.digest(n, R(r));
648
+ let i = await e.crypto.subtle.digest(n, se(r));
612
649
  return z(new Uint8Array(i));
613
- } }, fe = (e) => async (t) => await ue.generate(e)(t), pe = (e) => (t) => async (n, r = "POST", i, a = {}) => {
650
+ } }, he = (e) => async (t) => await pe.generate(e)(t), ge = (e) => (t) => async (n, r = "POST", i, a = {}) => {
614
651
  let o = {
615
- jti: btoa(me()),
652
+ jti: btoa(_e()),
616
653
  htm: r,
617
654
  htu: i,
618
655
  iat: Math.round(Date.now() / 1e3),
619
656
  ...a
620
- }, s = await de.thumbprint(e)(n, t.digestAlgorithm);
621
- return await le.sign(e)(n, { kid: s }, o, t);
622
- }, me = () => {
657
+ }, s = await me.thumbprint(e)(n, t.digestAlgorithm);
658
+ return await fe.sign(e)(n, { kid: s }, o, t);
659
+ }, _e = () => {
623
660
  let e = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx", t = "0123456789abcdef", n = 0, r = "";
624
661
  for (let i = 0; i < 36; i++) e[i] !== "-" && e[i] !== "4" && (n = Math.random() * 16 | 0), e[i] === "x" ? r += t[n] : e[i] === "y" ? (n &= 3, n |= 8, r += t[n]) : r += e[i];
625
662
  return r;
626
- }, he = () => {
663
+ }, ve = () => {
627
664
  let e = typeof window < "u" && !!window.crypto;
628
665
  return {
629
666
  hasCrypto: e,
630
667
  hasSubtleCrypto: e && !!window.crypto.subtle
631
668
  };
632
- }, ge = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", _e = (e) => {
669
+ }, ye = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", be = (e) => {
633
670
  let t = [];
634
671
  for (let n = 0; n < e.byteLength; n += 1) {
635
672
  let r = e[n] % 62;
636
- t.push(ge[r]);
673
+ t.push(ye[r]);
637
674
  }
638
675
  return t.join("");
639
676
  }, B = (e) => {
640
- let t = new Uint8Array(e), { hasCrypto: n } = he();
677
+ let t = new Uint8Array(e), { hasCrypto: n } = ve();
641
678
  if (n) window.crypto.getRandomValues(t);
642
679
  else for (let n = 0; n < e; n += 1) t[n] = Math.random() * 62 | 0;
643
- return _e(t);
680
+ return be(t);
644
681
  };
645
- function ve(e) {
682
+ function xe(e) {
646
683
  let t = new ArrayBuffer(e.length), n = new Uint8Array(t);
647
684
  for (let t = 0; t < e.length; t++) n[t] = e.charCodeAt(t);
648
685
  return n;
649
686
  }
650
- function ye(e) {
687
+ function Se(e) {
651
688
  return new Promise((t, n) => {
652
- crypto.subtle.digest("SHA-256", ve(e)).then((e) => t(z(new Uint8Array(e))), (e) => n(e));
689
+ crypto.subtle.digest("SHA-256", xe(e)).then((e) => t(z(new Uint8Array(e))), (e) => n(e));
653
690
  });
654
691
  }
655
- var be = (e) => {
692
+ var Ce = (e) => {
656
693
  if (e.length < 43 || e.length > 128) return Promise.reject(/* @__PURE__ */ Error("Invalid code length."));
657
- let { hasSubtleCrypto: t } = he();
658
- return t ? ye(e) : Promise.reject(/* @__PURE__ */ Error("window.crypto.subtle is unavailable."));
659
- }, xe = 3600, Se = (e) => async (t, n = xe, r = window.sessionStorage, i = 1e4) => {
660
- let a = `${t}/.well-known/openid-configuration`, o = `oidc.server:${t}`, s = I(o, r, n);
694
+ let { hasSubtleCrypto: t } = ve();
695
+ return t ? Se(e) : Promise.reject(/* @__PURE__ */ Error("window.crypto.subtle is unavailable."));
696
+ }, we = 3600, Te = (e) => async (t, n = we, r = window.sessionStorage, i = 1e4) => {
697
+ let a = `${t}/.well-known/openid-configuration`, o = `oidc.server:${t}`, s = ae(o, r, n);
661
698
  if (s) return new Z(s);
662
699
  let c = await V(e)(a, {}, i);
663
700
  if (c.status !== 200) return null;
664
701
  let l = await c.json();
665
- return L(o, l, r), new Z(l);
702
+ return oe(o, l, r), new Z(l);
666
703
  }, V = (e) => async (t, n = {}, r = 1e4, i = 0) => {
667
704
  let a;
668
705
  try {
@@ -681,7 +718,7 @@ var be = (e) => {
681
718
  }, H = {
682
719
  refresh_token: "refresh_token",
683
720
  access_token: "access_token"
684
- }, Ce = (e) => async (t, n, r = H.refresh_token, i, a = {}, o = 1e4) => {
721
+ }, Ee = (e) => async (t, n, r = H.refresh_token, i, a = {}, o = 1e4) => {
685
722
  let s = {
686
723
  token: n,
687
724
  token_type_hint: r,
@@ -699,7 +736,7 @@ var be = (e) => {
699
736
  headers: { "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8" },
700
737
  body: l
701
738
  }, o)).status === 200 ? { success: !0 } : { success: !1 };
702
- }, we = (e) => async (t, n, r, i, a = {}, o, s = 1e4) => {
739
+ }, De = (e) => async (t, n, r, i, a = {}, o, s = 1e4) => {
703
740
  for (let [e, t] of Object.entries(r)) n[e] === void 0 && (n[e] = t);
704
741
  let c = [];
705
742
  for (let e in n) {
@@ -723,17 +760,17 @@ var be = (e) => {
723
760
  return u.headers.has(U) && (f = u.headers.get(U)), {
724
761
  success: !0,
725
762
  status: u.status,
726
- data: m(d, i, o),
763
+ data: _(d, i, o),
727
764
  demonstratingProofOfPossessionNonce: f
728
765
  };
729
- }, Te = (e, t) => async (n, r) => {
766
+ }, Oe = (e, t) => async (n, r) => {
730
767
  r = r ? { ...r } : {};
731
- let i = B(128), a = await be(i);
768
+ let i = B(128), a = await Ce(i);
732
769
  await e.setCodeVerifierAsync(i), await e.setStateAsync(r.state), r.code_challenge = a, r.code_challenge_method = "S256";
733
770
  let o = "";
734
771
  if (r) for (let [e, t] of Object.entries(r)) o === "" ? o += "?" : o += "&", o += `${e}=${encodeURIComponent(t)}`;
735
772
  t.open(`${n}${o}`);
736
- }, U = "DPoP-Nonce", Ee = (e) => async (t, n, r, i, a = 1e4) => {
773
+ }, U = "DPoP-Nonce", ke = (e) => async (t, n, r, i, a = 1e4) => {
737
774
  n = n ? { ...n } : {}, n.code_verifier = await e.getCodeVerifierAsync();
738
775
  let o = [];
739
776
  for (let e in n) {
@@ -759,34 +796,34 @@ var be = (e) => {
759
796
  success: !0,
760
797
  data: {
761
798
  state: n.state,
762
- tokens: m(u, null, i),
799
+ tokens: _(u, null, i),
763
800
  demonstratingProofOfPossessionNonce: l
764
801
  }
765
802
  };
766
803
  };
767
804
  //#endregion
768
805
  //#region src/renewTokens.ts
769
- async function De(e, t, n, r = null) {
770
- let { tokens: i, status: o } = await q(e)((t) => {
806
+ async function Ae(e, t, n, r = null) {
807
+ let { tokens: i, status: a } = await q(e)((t) => {
771
808
  e.tokens = t;
772
809
  }, 0, 0, t, n, r);
773
- return await P(e.configuration, e.configurationName) || a(e.configurationName, e.configuration.storage, e.configuration.login_state_storage ?? e.configuration.storage).setTokens(e.tokens), e.tokens ? i : (await e.destroyAsync(o), null);
810
+ return await L(e.configuration, e.configurationName) || c(e.configurationName, e.configuration.storage, e.configuration.login_state_storage ?? e.configuration.storage).setTokens(e.tokens), e.tokens ? i : (await e.destroyAsync(a), null);
774
811
  }
775
- async function Oe(e, t = !1, n = null, r = null) {
776
- let i = e.configuration, a = `${i.client_id}_${e.configurationName}_${i.authority}`, o, s = await P(e.configuration, e.configurationName);
777
- if (i?.storage === window?.sessionStorage && !s || !navigator.locks) o = await De(e, t, n, r);
812
+ async function je(e, t = !1, n = null, r = null) {
813
+ let i = e.configuration, a = `${i.client_id}_${e.configurationName}_${i.authority}`, o, s = await L(e.configuration, e.configurationName);
814
+ if (i?.storage === window?.sessionStorage && !s || !navigator.locks) o = await Ae(e, t, n, r);
778
815
  else {
779
816
  let i = "retry";
780
- for (; i === "retry";) i = await navigator.locks.request(a, { ifAvailable: !0 }, async (i) => i ? await De(e, t, n, r) : (e.publishEvent($.eventNames.syncTokensAsync_lock_not_available, { lock: "lock not available" }), "retry"));
817
+ for (; i === "retry";) i = await navigator.locks.request(a, { ifAvailable: !0 }, async (i) => i ? await Ae(e, t, n, r) : (e.publishEvent($.eventNames.syncTokensAsync_lock_not_available, { lock: "lock not available" }), "retry"));
781
818
  o = i;
782
819
  }
783
820
  return o ? (e.timeoutId &&= W(e, e.tokens.expiresAt, n, r), e.tokens) : null;
784
821
  }
785
822
  var W = (e, t, n = null, r = null) => {
786
823
  let i = e.configuration.refresh_time_before_tokens_expiration_in_second;
787
- return e.timeoutId && y.clearTimeout(e.timeoutId), y.setTimeout(async () => {
788
- let a = { timeLeft: h(i, t) };
789
- e.publishEvent($.eventNames.token_timer, a), await Oe(e, !1, n, r);
824
+ return e.timeoutId && S.clearTimeout(e.timeoutId), S.setTimeout(async () => {
825
+ let a = { timeLeft: v(i, t) };
826
+ e.publishEvent($.eventNames.token_timer, a), await je(e, !1, n, r);
790
827
  }, 1e3);
791
828
  }, G = {
792
829
  FORCE_REFRESH: "FORCE_REFRESH",
@@ -799,95 +836,95 @@ var W = (e, t, n = null, r = null) => {
799
836
  REQUIRE_SYNC_TOKENS: "REQUIRE_SYNC_TOKENS",
800
837
  TOKENS_INVALID: "TOKENS_INVALID"
801
838
  }, K = (e) => async (t, n, r, i = !1) => {
802
- let o = { nonce: null };
839
+ let a = { nonce: null };
803
840
  if (!r) return {
804
841
  tokens: null,
805
842
  status: G.NOT_CONNECTED,
806
- nonce: o
843
+ nonce: a
807
844
  };
808
- let s, c = await e.initAsync(t.authority, t.authority_configuration), l = await P(t, n);
845
+ let o, s = await e.initAsync(t.authority, t.authority_configuration), l = await L(t, n);
809
846
  if (l) {
810
- let { status: e, tokens: n } = await l.initAsync(c, "syncTokensAsync", t);
847
+ let { status: e, tokens: n } = await l.initAsync(s, "syncTokensAsync", t);
811
848
  if (e === "LOGGED_OUT") return {
812
849
  tokens: null,
813
850
  status: G.LOGOUT_FROM_ANOTHER_TAB,
814
- nonce: o
851
+ nonce: a
815
852
  };
816
853
  if (e === "SESSIONS_LOST") return {
817
854
  tokens: null,
818
855
  status: G.SESSION_LOST,
819
- nonce: o
856
+ nonce: a
820
857
  };
821
858
  if (!e || !n) return {
822
859
  tokens: null,
823
860
  status: G.REQUIRE_SYNC_TOKENS,
824
- nonce: o
861
+ nonce: a
825
862
  };
826
863
  if (n.issuedAt !== r.issuedAt) return {
827
864
  tokens: n,
828
- status: h(t.refresh_time_before_tokens_expiration_in_second, n.expiresAt) > 0 ? G.TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID : G.TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_INVALID,
865
+ status: v(t.refresh_time_before_tokens_expiration_in_second, n.expiresAt) > 0 ? G.TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID : G.TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_INVALID,
829
866
  nonce: await l.getNonceAsync()
830
867
  };
831
- s = await l.getNonceAsync();
868
+ o = await l.getNonceAsync();
832
869
  } else {
833
- let i = a(n, t.storage ?? sessionStorage, t.login_state_storage ?? t.storage ?? sessionStorage), c = await i.initAsync(), { tokens: l } = c, { status: u } = c;
834
- if (l &&= p(l, e.tokens, t.token_renew_mode), !l) return {
870
+ let i = c(n, t.storage ?? sessionStorage, t.login_state_storage ?? t.storage ?? sessionStorage), s = await i.initAsync(), { tokens: l } = s, { status: u } = s;
871
+ if (l &&= g(l, e.tokens, t.token_renew_mode), !l) return {
835
872
  tokens: null,
836
873
  status: G.LOGOUT_FROM_ANOTHER_TAB,
837
- nonce: o
874
+ nonce: a
838
875
  };
839
876
  if (u === "SESSIONS_LOST") return {
840
877
  tokens: null,
841
878
  status: G.SESSION_LOST,
842
- nonce: o
879
+ nonce: a
843
880
  };
844
881
  if (l.issuedAt !== r.issuedAt) {
845
- let e = h(t.refresh_time_before_tokens_expiration_in_second, l.expiresAt) > 0 ? G.TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID : G.TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_INVALID, n = await i.getNonceAsync();
882
+ let e = v(t.refresh_time_before_tokens_expiration_in_second, l.expiresAt) > 0 ? G.TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID : G.TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_INVALID, n = await i.getNonceAsync();
846
883
  return {
847
884
  tokens: l,
848
885
  status: e,
849
886
  nonce: n
850
887
  };
851
888
  }
852
- s = await i.getNonceAsync();
889
+ o = await i.getNonceAsync();
853
890
  }
854
- let u = h(t.refresh_time_before_tokens_expiration_in_second, r.expiresAt) > 0 ? "TOKENS_VALID" : "TOKENS_INVALID";
891
+ let u = v(t.refresh_time_before_tokens_expiration_in_second, r.expiresAt) > 0 ? "TOKENS_VALID" : "TOKENS_INVALID";
855
892
  return i ? {
856
893
  tokens: r,
857
894
  status: "FORCE_REFRESH",
858
- nonce: s
895
+ nonce: o
859
896
  } : {
860
897
  tokens: r,
861
898
  status: u,
862
- nonce: s
899
+ nonce: o
863
900
  };
864
- }, q = (e) => async (t, n = 0, r = 0, s = !1, c = null, l = null) => {
901
+ }, q = (e) => async (t, n = 0, r = 0, a = !1, o = null, s = null) => {
865
902
  if (!navigator.onLine && document.hidden) return {
866
903
  tokens: e.tokens,
867
904
  status: "GIVE_UP"
868
905
  };
869
- let u = 6, d = s ? 2 : 5;
870
- for (; !navigator.onLine && u > 0;) await C({ milliseconds: 1e3 }), u--, e.publishEvent(i.refreshTokensAsync, { message: `wait because navigator is offline try ${u}` });
906
+ let u = 6, d = a ? 2 : 5;
907
+ for (; !navigator.onLine && u > 0;) await E({ milliseconds: 1e3 }), u--, e.publishEvent(i.refreshTokensAsync, { message: `wait because navigator is offline try ${u}` });
871
908
  let f = document.hidden, p = f ? n : n + 1, m = f ? r + 1 : r;
872
909
  if (n >= d || r >= 5) return t(null), e.publishEvent(i.refreshTokensAsync_error, { message: "refresh token" }), {
873
910
  tokens: null,
874
911
  status: "SESSION_LOST"
875
912
  };
876
- c ||= {};
913
+ o ||= {};
877
914
  let h = e.configuration, g = (t, n = null, r = null) => J(e.configurationName, e.configuration, e.publishEvent.bind(e))(t, n, r), _ = async () => {
878
915
  try {
879
- let n, r = await P(h, e.configurationName);
880
- n = r ? r.getLoginParams() : a(e.configurationName, h.storage, h.login_state_storage ?? h.storage).getLoginParams();
881
- let o = {};
882
- if (n && n.extras) for (let [e, t] of Object.entries(n.extras)) t != null && (o[e] = t);
883
- if (c) for (let [e, t] of Object.entries(c)) t != null && (o[e] = t);
884
- o.prompt = "none", l && (o.scope = l);
885
- let s = await g(o);
886
- return s ? s.error ? (t(null), e.publishEvent(i.refreshTokensAsync_error, { message: "refresh token silent" }), {
916
+ let n, r = await L(h, e.configurationName);
917
+ n = r ? r.getLoginParams() : c(e.configurationName, h.storage, h.login_state_storage ?? h.storage).getLoginParams();
918
+ let a = {};
919
+ if (n && n.extras) for (let [e, t] of Object.entries(n.extras)) t != null && (a[e] = t);
920
+ if (o) for (let [e, t] of Object.entries(o)) t != null && (a[e] = t);
921
+ a.prompt = "none", s && (a.scope = s);
922
+ let l = await g(a);
923
+ return l ? l.error ? (t(null), e.publishEvent(i.refreshTokensAsync_error, { message: "refresh token silent" }), {
887
924
  tokens: null,
888
925
  status: "SESSION_LOST"
889
- }) : (t(s.tokens), e.publishEvent($.eventNames.token_renewed, {}), {
890
- tokens: s.tokens,
926
+ }) : (t(l.tokens), e.publishEvent($.eventNames.token_renewed, {}), {
927
+ tokens: l.tokens,
891
928
  status: "LOGGED"
892
929
  }) : (t(null), e.publishEvent(i.refreshTokensAsync_error, { message: "refresh token silent not active" }), {
893
930
  tokens: null,
@@ -897,11 +934,11 @@ var W = (e, t, n = null, r = null) => {
897
934
  return console.error(n), e.publishEvent(i.refreshTokensAsync_silent_error, {
898
935
  message: "exceptionSilent",
899
936
  exception: n.message
900
- }), await q(e)(t, p, m, s, c, l);
937
+ }), await q(e)(t, p, m, a, o, s);
901
938
  }
902
939
  };
903
940
  try {
904
- let { status: u, tokens: d, nonce: f } = await K(e)(h, e.configurationName, e.tokens, s);
941
+ let { status: u, tokens: d, nonce: f } = await K(e)(h, e.configurationName, e.tokens, a);
905
942
  switch (u) {
906
943
  case G.SESSION_LOST: return t(null), e.publishEvent(i.refreshTokensAsync_error, { message: "refresh token session lost" }), {
907
944
  tokens: null,
@@ -923,12 +960,12 @@ var W = (e, t, n = null, r = null) => {
923
960
  tokens: null,
924
961
  status: "LOGGED_OUT"
925
962
  };
926
- case G.REQUIRE_SYNC_TOKENS: return h.token_automatic_renew_mode == o.AutomaticOnlyWhenFetchExecuted && !s ? (e.publishEvent(i.tokensInvalidAndWaitingActionsToRefresh, {}), {
963
+ case G.REQUIRE_SYNC_TOKENS: return h.token_automatic_renew_mode == l.AutomaticOnlyWhenFetchExecuted && !a ? (e.publishEvent(i.tokensInvalidAndWaitingActionsToRefresh, {}), {
927
964
  tokens: e.tokens,
928
965
  status: "GIVE_UP"
929
966
  }) : (e.publishEvent(i.refreshTokensAsync_begin, { tryNumber: n }), await _());
930
967
  default: {
931
- if (h.token_automatic_renew_mode == o.AutomaticOnlyWhenFetchExecuted && G.FORCE_REFRESH !== u) return e.publishEvent(i.tokensInvalidAndWaitingActionsToRefresh, {}), {
968
+ if (h.token_automatic_renew_mode == l.AutomaticOnlyWhenFetchExecuted && G.FORCE_REFRESH !== u) return e.publishEvent(i.tokensInvalidAndWaitingActionsToRefresh, {}), {
932
969
  tokens: e.tokens,
933
970
  status: "GIVE_UP"
934
971
  };
@@ -938,26 +975,26 @@ var W = (e, t, n = null, r = null) => {
938
975
  tryNumber: n,
939
976
  backgroundTry: r
940
977
  }), !d.refreshToken) return await _();
941
- let g = h.client_id, y = h.redirect_uri, b = h.authority, x = { ...h.token_request_extras ? h.token_request_extras : {} };
942
- for (let [e, t] of Object.entries(c)) e.endsWith(":token_request") && (x[e.replace(":token_request", "")] = t);
978
+ let g = h.client_id, v = h.redirect_uri, y = h.authority, b = { ...h.token_request_extras ? h.token_request_extras : {} };
979
+ for (let [e, t] of Object.entries(o)) e.endsWith(":token_request") && (b[e.replace(":token_request", "")] = t);
943
980
  return await (async () => {
944
981
  let n = {
945
982
  client_id: g,
946
- redirect_uri: y,
983
+ redirect_uri: v,
947
984
  grant_type: "refresh_token",
948
985
  refresh_token: d.refreshToken
949
- }, r = await e.initAsync(b, h.authority_configuration), o = document.hidden ? 1e4 : 3e4 * 10, u = r.tokenEndpoint, _ = {};
986
+ }, r = await e.initAsync(y, h.authority_configuration), l = document.hidden ? 1e4 : 3e4 * 10, u = r.tokenEndpoint, _ = {};
950
987
  h.demonstrating_proof_of_possession && (_.DPoP = await e.generateDemonstrationOfProofOfPossessionAsync(d.accessToken, u, "POST"));
951
- let S = await we(e.getFetch())(u, n, x, d, _, h.token_renew_mode, o);
988
+ let S = await De(e.getFetch())(u, n, b, d, _, h.token_renew_mode, l);
952
989
  if (S.success) {
953
- let { isValid: n, reason: o } = v(S.data, f.nonce, r);
954
- if (!n) return t(null), e.publishEvent(i.refreshTokensAsync_error, { message: `refresh token return not valid tokens, reason: ${o}` }), {
990
+ let { isValid: n, reason: a } = x(S.data, f.nonce, r);
991
+ if (!n) return t(null), e.publishEvent(i.refreshTokensAsync_error, { message: `refresh token return not valid tokens, reason: ${a}` }), {
955
992
  tokens: null,
956
993
  status: "SESSION_LOST"
957
994
  };
958
995
  if (t(S.data), S.demonstratingProofOfPossessionNonce) {
959
- let t = await P(h, e.configurationName);
960
- t ? await t.setDemonstratingProofOfPossessionNonce(S.demonstratingProofOfPossessionNonce) : await a(e.configurationName, h.storage, h.login_state_storage ?? h.storage).setDemonstratingProofOfPossessionNonce(S.demonstratingProofOfPossessionNonce);
996
+ let t = await L(h, e.configurationName);
997
+ t ? await t.setDemonstratingProofOfPossessionNonce(S.demonstratingProofOfPossessionNonce) : await c(e.configurationName, h.storage, h.login_state_storage ?? h.storage).setDemonstratingProofOfPossessionNonce(S.demonstratingProofOfPossessionNonce);
961
998
  }
962
999
  return e.publishEvent(i.refreshTokensAsync_end, { success: S.success }), e.publishEvent($.eventNames.token_renewed, { reason: "REFRESH_TOKEN" }), {
963
1000
  tokens: S.data,
@@ -969,7 +1006,7 @@ var W = (e, t, n = null, r = null) => {
969
1006
  }), S.status >= 400 && S.status < 500 ? (t(null), e.publishEvent(i.refreshTokensAsync_error, { message: `session lost: ${S.status}` }), {
970
1007
  tokens: null,
971
1008
  status: "SESSION_LOST"
972
- }) : await q(e)(t, p, m, s, c, l);
1009
+ }) : await q(e)(t, p, m, a, o, s);
973
1010
  })();
974
1011
  }
975
1012
  }
@@ -979,7 +1016,7 @@ var W = (e, t, n = null, r = null) => {
979
1016
  exception: n.message
980
1017
  }), new Promise((n, r) => {
981
1018
  setTimeout(() => {
982
- q(e)(t, p, m, s, c, l).then(n).catch(r);
1019
+ q(e)(t, p, m, a, o, s).then(n).catch(r);
983
1020
  }, 1e3);
984
1021
  });
985
1022
  }
@@ -1027,11 +1064,11 @@ var W = (e, t, n = null, r = null) => {
1027
1064
  } catch (e) {
1028
1065
  throw n(i.silentLoginAsync_error, e), e;
1029
1066
  }
1030
- }, ke = (e, t, n, r, a) => (e = null, o = void 0) => {
1067
+ }, Me = (e, t, n, r, a) => (e = null, o = void 0) => {
1031
1068
  e = { ...e };
1032
1069
  let s = (e, i, o) => J(t, n, r.bind(a))(e, i, o);
1033
1070
  return (async () => {
1034
- a.timeoutId && y.clearTimeout(a.timeoutId);
1071
+ a.timeoutId && S.clearTimeout(a.timeoutId);
1035
1072
  let t;
1036
1073
  e && "state" in e && (t = e.state, delete e.state);
1037
1074
  try {
@@ -1047,7 +1084,7 @@ var W = (e, t, n = null, r = null) => {
1047
1084
  return e;
1048
1085
  }
1049
1086
  })();
1050
- }, Ae = (e, t, n) => (i, a, o, s = !1) => {
1087
+ }, Ne = (e, t, n) => (i, a, o, s = !1) => {
1051
1088
  let c = (t, r = void 0, i = void 0) => J(e.configurationName, n, e.publishEvent.bind(e))(t, r, i);
1052
1089
  return new Promise((l, u) => {
1053
1090
  n.silent_login_uri && n.silent_redirect_uri && n.monitor_session && i && o && !s ? (e.checkSessionIFrame = new r(() => {
@@ -1076,7 +1113,7 @@ var W = (e, t, n = null, r = null) => {
1076
1113
  u(e);
1077
1114
  })) : l(null);
1078
1115
  });
1079
- }, je = (e) => !!(e.os === "iOS" && e.osVersion.startsWith("12") || e.os === "Mac OS X" && e.osVersion.startsWith("10_15_6")), Me = (e) => {
1116
+ }, Pe = (e) => !!(e.os === "iOS" && e.osVersion.startsWith("12") || e.os === "Mac OS X" && e.osVersion.startsWith("10_15_6")), Fe = (e) => {
1080
1117
  let t = e.appVersion, n = e.userAgent, r = "-", i = [
1081
1118
  {
1082
1119
  s: "Windows 10",
@@ -1212,7 +1249,7 @@ var W = (e, t, n = null, r = null) => {
1212
1249
  osVersion: a
1213
1250
  };
1214
1251
  };
1215
- function Ne() {
1252
+ function Ie() {
1216
1253
  let e = navigator.userAgent, t, n = e.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
1217
1254
  if (/trident/i.test(n[1])) return t = /\brv[ :]+(\d+)/g.exec(e) || [], {
1218
1255
  name: "ie",
@@ -1238,16 +1275,16 @@ function Ne() {
1238
1275
  version: n[1]
1239
1276
  };
1240
1277
  }
1241
- var Pe = () => {
1242
- let { name: e, version: t } = Ne();
1243
- return e === "chrome" && parseInt(t) <= 70 || e === "opera" && (!t || parseInt(t.split(".")[0]) < 80) || e === "ie" ? !1 : !je(Me(navigator));
1244
- }, Fe = async (e) => {
1278
+ var Le = () => {
1279
+ let { name: e, version: t } = Ie();
1280
+ return e === "chrome" && parseInt(t) <= 70 || e === "opera" && (!t || parseInt(t.split(".")[0]) < 80) || e === "ie" ? !1 : !Pe(Fe(navigator));
1281
+ }, Re = async (e) => {
1245
1282
  let t;
1246
1283
  if (e.tokens != null) return !1;
1247
1284
  e.publishEvent(i.tryKeepExistingSessionAsync_begin, {});
1248
1285
  try {
1249
1286
  let n = e.configuration, r = await e.initAsync(n.authority, n.authority_configuration);
1250
- if (t = await P(n, e.configurationName), t) {
1287
+ if (t = await L(n, e.configurationName), t) {
1251
1288
  let { tokens: a } = await t.initAsync(r, "tryKeepExistingSessionAsync", n);
1252
1289
  if (a) {
1253
1290
  t.startKeepAliveServiceWorker(), e.tokens = a;
@@ -1265,11 +1302,11 @@ var Pe = () => {
1265
1302
  });
1266
1303
  } else {
1267
1304
  n.service_worker_relative_url && e.publishEvent(i.service_worker_not_supported_by_browser, { message: "service worker is not supported by this browser" });
1268
- let t = a(e.configurationName, n.storage ?? sessionStorage, n.login_state_storage ?? n.storage ?? sessionStorage), { tokens: o } = await t.initAsync();
1269
- if (o) {
1270
- e.tokens = p(o, null, n.token_renew_mode);
1271
- let a = t.getLoginParams();
1272
- e.timeoutId = W(e, e.tokens.expiresAt, a.extras, a.scope);
1305
+ let t = c(e.configurationName, n.storage ?? sessionStorage, n.login_state_storage ?? n.storage ?? sessionStorage), { tokens: a } = await t.initAsync();
1306
+ if (a) {
1307
+ e.tokens = g(a, null, n.token_renew_mode);
1308
+ let o = t.getLoginParams();
1309
+ e.timeoutId = W(e, e.tokens.expiresAt, o.extras, o.scope);
1273
1310
  let s = await t.getSessionStateAsync();
1274
1311
  return await e.startCheckSessionAsync(r.checkSessionIframe, n.client_id, s), n.preload_user_info && await e.userInfoAsync(), e.publishEvent(i.tryKeepExistingSessionAsync_end, {
1275
1312
  success: !0,
@@ -1284,7 +1321,7 @@ var Pe = () => {
1284
1321
  } catch (n) {
1285
1322
  return console.error(n), t && await t.clearAsync(), e.publishEvent(i.tryKeepExistingSessionAsync_error, "tokens inside ServiceWorker are invalid"), !1;
1286
1323
  }
1287
- }, Ie = (e) => {
1324
+ }, ze = (e) => {
1288
1325
  let t = e.match(/^([a-z][\w-]+\:)\/\/(([^:\/?#]*)(?:\:([0-9]+))?)([\/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/);
1289
1326
  if (!t) throw Error("Invalid URL");
1290
1327
  let n = t[6], r = t[7];
@@ -1302,44 +1339,44 @@ var Pe = () => {
1302
1339
  search: n,
1303
1340
  hash: r
1304
1341
  };
1305
- }, Le = (e) => {
1306
- let t = Ie(e), { path: n } = t;
1342
+ }, Be = (e) => {
1343
+ let t = ze(e), { path: n } = t;
1307
1344
  n.endsWith("/") && (n = n.slice(0, -1));
1308
1345
  let { hash: r } = t;
1309
1346
  return r === "#_=_" && (r = ""), r && (n += r), n;
1310
1347
  }, Y = (e) => {
1311
- let { search: t } = Ie(e);
1312
- return Re(t);
1313
- }, Re = (e) => {
1348
+ let { search: t } = ze(e);
1349
+ return Ve(t);
1350
+ }, Ve = (e) => {
1314
1351
  let t = {}, n, r, i, a = e.split("&");
1315
1352
  for (r = 0, i = a.length; r < i; r++) n = a[r].split("="), t[decodeURIComponent(n[0])] = decodeURIComponent(n[1]);
1316
1353
  return t;
1317
- }, ze = (e, t, n, r, o) => (s = void 0, c = null, l = !1, u = void 0) => {
1318
- let d = c;
1319
- return c = { ...c }, (async () => {
1320
- let f = s || o.getPath();
1321
- if ("state" in c || (c.state = B(16)), n(i.loginAsync_begin, {}), c) for (let e of Object.keys(c)) e.endsWith(":token_request") && delete c[e];
1354
+ }, He = (e, t, n, r, a) => (o = void 0, s = null, l = !1, u = void 0) => {
1355
+ let d = s;
1356
+ return s = { ...s }, (async () => {
1357
+ let f = o || a.getPath();
1358
+ if ("state" in s || (s.state = B(16)), n(i.loginAsync_begin, {}), s) for (let e of Object.keys(s)) e.endsWith(":token_request") && delete s[e];
1322
1359
  try {
1323
1360
  let n = l ? t.silent_redirect_uri : t.redirect_uri;
1324
1361
  u ||= t.scope;
1325
1362
  let i = t.extras ? {
1326
1363
  ...t.extras,
1327
- ...c
1328
- } : c;
1364
+ ...s
1365
+ } : s;
1329
1366
  i.nonce ||= B(12);
1330
- let s = { nonce: i.nonce }, p = await P(t, e), m = await r(t.authority, t.authority_configuration), h;
1367
+ let o = { nonce: i.nonce }, p = await L(t, e), m = await r(t.authority, t.authority_configuration), h;
1331
1368
  if (p) p.setLoginParams({
1332
1369
  callbackPath: f,
1333
1370
  extras: d,
1334
1371
  scope: u
1335
- }), await p.initAsync(m, "loginAsync", t), await p.setNonceAsync(s), p.startKeepAliveServiceWorker(), h = p;
1372
+ }), await p.initAsync(m, "loginAsync", t), await p.setNonceAsync(o), p.startKeepAliveServiceWorker(), h = p;
1336
1373
  else {
1337
- let n = a(e, t.storage ?? sessionStorage, t.login_state_storage ?? t.storage ?? sessionStorage);
1374
+ let n = c(e, t.storage ?? sessionStorage, t.login_state_storage ?? t.storage ?? sessionStorage);
1338
1375
  n.setLoginParams({
1339
1376
  callbackPath: f,
1340
1377
  extras: d,
1341
1378
  scope: u
1342
- }), await n.setNonceAsync(s), h = n;
1379
+ }), await n.setNonceAsync(o), h = n;
1343
1380
  }
1344
1381
  let g = {
1345
1382
  client_id: t.client_id,
@@ -1348,18 +1385,18 @@ var Pe = () => {
1348
1385
  response_type: "code",
1349
1386
  ...i
1350
1387
  };
1351
- await Te(h, o)(m.authorizationEndpoint, g);
1388
+ await Oe(h, a)(m.authorizationEndpoint, g);
1352
1389
  } catch (e) {
1353
1390
  throw n(i.loginAsync_error, e), e;
1354
1391
  }
1355
1392
  })();
1356
- }, Be = (e) => async (t = !1) => {
1393
+ }, Ue = (e) => async (t = !1) => {
1357
1394
  try {
1358
1395
  e.publishEvent(i.loginCallbackAsync_begin, {});
1359
- let n = e.configuration, r = n.client_id, o = t ? n.silent_redirect_uri : n.redirect_uri, s = n.authority, c = n.token_request_timeout, l = await e.initAsync(s, n.authority_configuration), u = Y(e.location.getCurrentHref()), d = u.session_state, f = await P(n, e.configurationName), p, m, h, g;
1396
+ let n = e.configuration, r = n.client_id, a = t ? n.silent_redirect_uri : n.redirect_uri, o = n.authority, s = n.token_request_timeout, l = await e.initAsync(o, n.authority_configuration), u = Y(e.location.getCurrentHref()), d = u.session_state, f = await L(n, e.configurationName), p, m, h, g;
1360
1397
  if (f) await f.initAsync(l, "loginCallbackAsync", n), await f.setSessionStateAsync(d), m = await f.getNonceAsync(), h = f.getLoginParams(), g = await f.getStateAsync(), f.startKeepAliveServiceWorker(), p = f;
1361
1398
  else {
1362
- let t = a(e.configurationName, n.storage ?? sessionStorage, n.login_state_storage ?? n.storage ?? sessionStorage);
1399
+ let t = c(e.configurationName, n.storage ?? sessionStorage, n.login_state_storage ?? n.storage ?? sessionStorage);
1363
1400
  await t.setSessionStateAsync(d), m = await t.getNonceAsync(), h = t.getLoginParams(), g = await t.getStateAsync(), p = t;
1364
1401
  }
1365
1402
  if (u.error || u.error_description) throw Error(`Error from OIDC server: ${u.error} - ${u.error_description}`);
@@ -1369,24 +1406,24 @@ var Pe = () => {
1369
1406
  code: u.code,
1370
1407
  grant_type: "authorization_code",
1371
1408
  client_id: n.client_id,
1372
- redirect_uri: o
1373
- }, y = {};
1374
- if (n.token_request_extras) for (let [e, t] of Object.entries(n.token_request_extras)) y[e] = t;
1375
- if (h?.extras) for (let [e, t] of Object.entries(h.extras)) e.endsWith(":token_request") && (y[e.replace(":token_request", "")] = t);
1376
- let b = l.tokenEndpoint, x = {};
1377
- if (n.demonstrating_proof_of_possession) if (f) x.DPoP = `DPOP_SECURED_BY_OIDC_SERVICE_WORKER_${e.configurationName}`;
1409
+ redirect_uri: a
1410
+ }, v = {};
1411
+ if (n.token_request_extras) for (let [e, t] of Object.entries(n.token_request_extras)) v[e] = t;
1412
+ if (h?.extras) for (let [e, t] of Object.entries(h.extras)) e.endsWith(":token_request") && (v[e.replace(":token_request", "")] = t);
1413
+ let y = l.tokenEndpoint, b = {};
1414
+ if (n.demonstrating_proof_of_possession) if (f) b.DPoP = `DPOP_SECURED_BY_OIDC_SERVICE_WORKER_${e.configurationName}`;
1378
1415
  else {
1379
- let t = await fe(window)(n.demonstrating_proof_of_possession_configuration.generateKeyAlgorithm);
1380
- await a(e.configurationName, n.storage, n.login_state_storage ?? n.storage).setDemonstratingProofOfPossessionJwkAsync(t), x.DPoP = await pe(window)(n.demonstrating_proof_of_possession_configuration)(t, "POST", b);
1416
+ let t = await he(window)(n.demonstrating_proof_of_possession_configuration.generateKeyAlgorithm);
1417
+ await c(e.configurationName, n.storage, n.login_state_storage ?? n.storage).setDemonstratingProofOfPossessionJwkAsync(t), b.DPoP = await ge(window)(n.demonstrating_proof_of_possession_configuration)(t, "POST", y);
1381
1418
  }
1382
- let S = await Ee(p)(b, {
1419
+ let S = await ke(p)(y, {
1383
1420
  ..._,
1384
- ...y
1385
- }, x, e.configuration.token_renew_mode, c);
1421
+ ...v
1422
+ }, b, e.configuration.token_renew_mode, s);
1386
1423
  if (!S.success) throw Error("Token request failed");
1387
1424
  let C, w = S.data.tokens, T = S.data.demonstratingProofOfPossessionNonce;
1388
- if (S.data.state !== y.state) throw Error("state is not valid");
1389
- let { isValid: E, reason: D } = v(w, m.nonce, l);
1425
+ if (S.data.state !== v.state) throw Error("state is not valid");
1426
+ let { isValid: E, reason: D } = x(w, m.nonce, l);
1390
1427
  if (!E) throw Error(`Tokens are not OpenID valid, reason: ${D}`);
1391
1428
  if (f) {
1392
1429
  if (w.refreshToken && !w.refreshToken.includes("SECURED_BY_OIDC_SERVICE_WORKER")) throw Error("Refresh token should be hidden by service worker");
@@ -1394,7 +1431,7 @@ var Pe = () => {
1394
1431
  }
1395
1432
  if (f) await f.initAsync(l, "syncTokensAsync", n), C = f.getLoginParams(), T && await f.setDemonstratingProofOfPossessionNonce(T);
1396
1433
  else {
1397
- let t = a(e.configurationName, n.storage, n.login_state_storage ?? n.storage);
1434
+ let t = c(e.configurationName, n.storage, n.login_state_storage ?? n.storage);
1398
1435
  C = t.getLoginParams(), T && await t.setDemonstratingProofOfPossessionNonce(T);
1399
1436
  }
1400
1437
  return await e.startCheckSessionAsync(l.checkSessionIframe, r, d, t), e.publishEvent(i.loginCallbackAsync_end, {}), {
@@ -1407,7 +1444,7 @@ var Pe = () => {
1407
1444
  } catch (t) {
1408
1445
  throw console.error(t), e.publishEvent(i.loginCallbackAsync_error, t), t;
1409
1446
  }
1410
- }, Ve = {
1447
+ }, We = {
1411
1448
  access_token: "access_token",
1412
1449
  refresh_token: "refresh_token"
1413
1450
  }, X = (e, t) => {
@@ -1420,18 +1457,18 @@ var Pe = () => {
1420
1457
  return n;
1421
1458
  }
1422
1459
  return n;
1423
- }, He = (e) => {
1460
+ }, Ge = (e) => {
1424
1461
  let t = {};
1425
1462
  if (e) {
1426
1463
  for (let [n, r] of Object.entries(e)) n.includes(":") || (t[n] = r);
1427
1464
  return t;
1428
1465
  }
1429
1466
  return t;
1430
- }, Ue = (e) => async (t) => {
1431
- y.clearTimeout(e.timeoutId), e.timeoutId = null, e.checkSessionIFrame && e.checkSessionIFrame.stop();
1432
- let n = await P(e.configuration, e.configurationName);
1433
- n ? await n.clearAsync(t) : await a(e.configurationName, e.configuration.storage, e.configuration.login_state_storage ?? e.configuration.storage).clearAsync(t), e.tokens = null, e.userInfo = null;
1434
- }, We = (e, t, n, r, a) => async (o = void 0, s = null) => {
1467
+ }, Ke = (e) => async (t) => {
1468
+ S.clearTimeout(e.timeoutId), e.timeoutId = null, e.checkSessionIFrame && e.checkSessionIFrame.stop();
1469
+ let n = await L(e.configuration, e.configurationName);
1470
+ n ? await n.clearAsync(t) : await c(e.configurationName, e.configuration.storage, e.configuration.login_state_storage ?? e.configuration.storage).clearAsync(t), e.tokens = null, e.userInfo = null;
1471
+ }, qe = (e, t, n, r, a) => async (o = void 0, s = null) => {
1435
1472
  let c = e.configuration, l = await e.initAsync(c.authority, c.authority_configuration);
1436
1473
  o && typeof o != "string" && (o = void 0, r.warn("callbackPathOrUrl path is not a string"));
1437
1474
  let u = o ?? a.getPath(), d = !1;
@@ -1441,13 +1478,13 @@ var Pe = () => {
1441
1478
  let t = l.revocationEndpoint;
1442
1479
  if (t) {
1443
1480
  let r = [], i = e.tokens ? e.tokens.accessToken : null;
1444
- if (i && c.logout_tokens_to_invalidate.includes(Ve.access_token)) {
1445
- let e = X(s, ":revoke_access_token"), a = Ce(n)(t, i, H.access_token, c.client_id, e);
1481
+ if (i && c.logout_tokens_to_invalidate.includes(We.access_token)) {
1482
+ let e = X(s, ":revoke_access_token"), a = Ee(n)(t, i, H.access_token, c.client_id, e);
1446
1483
  r.push(a);
1447
1484
  }
1448
1485
  let a = e.tokens ? e.tokens.refreshToken : null;
1449
- if (a && c.logout_tokens_to_invalidate.includes(Ve.refresh_token)) {
1450
- let e = X(s, ":revoke_refresh_token"), i = Ce(n)(t, a, H.refresh_token, c.client_id, e);
1486
+ if (a && c.logout_tokens_to_invalidate.includes(We.refresh_token)) {
1487
+ let e = X(s, ":revoke_refresh_token"), i = Ee(n)(t, a, H.refresh_token, c.client_id, e);
1451
1488
  r.push(i);
1452
1489
  }
1453
1490
  r.length > 0 && await Promise.all(r);
@@ -1460,17 +1497,17 @@ var Pe = () => {
1460
1497
  for (let [, n] of Object.entries(t)) n === e ? e.publishEvent(i.logout_from_same_tab, {}) : await e.logoutSameTabAsync(e.configuration.client_id, m);
1461
1498
  let h = X(s, ":oidc");
1462
1499
  if (h && h.no_reload === "true") return;
1463
- let g = He(s);
1500
+ let g = Ge(s);
1464
1501
  if (l.endSessionEndpoint) {
1465
1502
  "id_token_hint" in g || (g.id_token_hint = p), !("post_logout_redirect_uri" in g) && o !== null && (g.post_logout_redirect_uri = f);
1466
1503
  let e = "";
1467
1504
  for (let [t, n] of Object.entries(g)) n != null && (e === "" ? e += "?" : e += "&", e += `${t}=${encodeURIComponent(n)}`);
1468
1505
  a.open(`${l.endSessionEndpoint}${e}`);
1469
1506
  } else a.reload();
1470
- }, Ge = (e, t, n = !1) => async (...r) => {
1507
+ }, Je = (e, t, n = !1) => async (...r) => {
1471
1508
  let [i, a, ...o] = r, s = a ? { ...a } : { method: "GET" }, c = new Headers();
1472
1509
  s.headers && (c = s.headers instanceof Headers ? s.headers : new Headers(s.headers));
1473
- let l = (await _({
1510
+ let l = (await b({
1474
1511
  getTokens: () => t.tokens,
1475
1512
  configuration: {
1476
1513
  token_automatic_renew_mode: t.configuration.token_automatic_renew_mode,
@@ -1493,46 +1530,46 @@ var Pe = () => {
1493
1530
  ...s,
1494
1531
  headers: c
1495
1532
  }, ...o);
1496
- }, Ke = (e) => async (t = !1, n = !1) => {
1533
+ }, Ye = (e) => async (t = !1, n = !1) => {
1497
1534
  if (e.userInfo != null && !t) return e.userInfo;
1498
1535
  let r = !t && e.configuration.storage?.getItem(`oidc.${e.configurationName}.userInfo`);
1499
1536
  if (r) return e.userInfo = JSON.parse(r), e.userInfo;
1500
1537
  let i = e.configuration, a = (await e.initAsync(i.authority, i.authority_configuration)).userInfoEndpoint, o = await (async () => {
1501
- let t = await Ge(fetch, e, n)(a);
1538
+ let t = await Je(fetch, e, n)(a);
1502
1539
  return t.status === 200 ? t.json() : null;
1503
1540
  })();
1504
1541
  return e.userInfo = o, o && e.configuration.storage?.setItem(`oidc.${e.configurationName}.userInfo`, JSON.stringify(o)), o;
1505
- }, qe = () => fetch, Z = class {
1542
+ }, Xe = () => fetch, Z = class {
1506
1543
  constructor(e) {
1507
1544
  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;
1508
1545
  }
1509
- }, Q = {}, Je = (t, n = new e()) => (e, r = "default") => (Q[r] || (Q[r] = new $(e, r, t, n)), Q[r]), Ye = async (e) => {
1546
+ }, Q = {}, Ze = (t, n = new e()) => (e, r = "default") => (Q[r] || (Q[r] = new $(e, r, t, n)), Q[r]), Qe = async (e) => {
1510
1547
  let { parsedTokens: t, callbackPath: n, extras: r, scope: i } = await e.loginCallbackAsync();
1511
1548
  return e.timeoutId = W(e, t.expiresAt, r, i), { callbackPath: n };
1512
- }, Xe = (e) => Math.floor(Math.random() * e), $ = class t {
1549
+ }, $e = (e) => Math.floor(Math.random() * e), $ = class t {
1513
1550
  constructor(t, n = "default", r, i = new e()) {
1514
1551
  this.initPromise = null, this.tryKeepExistingSessionPromise = null, this.loginPromise = null, this.loginCallbackPromise = null, this.loginCallbackWithAutoTokensRenewPromise = null, this.userInfoPromise = null, this.renewTokensPromise = null, this.logoutPromise = null;
1515
1552
  let a = t.silent_login_uri;
1516
1553
  t.silent_redirect_uri && !t.silent_login_uri && (a = `${t.silent_redirect_uri.replace("-callback", "").replace("callback", "")}-login`);
1517
- let s = t.refresh_time_before_tokens_expiration_in_second ?? 120;
1518
- s > 60 && (s -= Math.floor(Math.random() * 40)), this.location = i ?? new e(), this.configuration = {
1554
+ let o = t.refresh_time_before_tokens_expiration_in_second ?? 120;
1555
+ o > 60 && (o -= Math.floor(Math.random() * 40)), this.location = i ?? new e(), this.configuration = {
1519
1556
  ...t,
1520
1557
  silent_login_uri: a,
1521
- token_automatic_renew_mode: t.token_automatic_renew_mode ?? o.AutomaticBeforeTokenExpiration,
1558
+ token_automatic_renew_mode: t.token_automatic_renew_mode ?? l.AutomaticBeforeTokenExpiration,
1522
1559
  monitor_session: t.monitor_session ?? !1,
1523
- refresh_time_before_tokens_expiration_in_second: s,
1560
+ refresh_time_before_tokens_expiration_in_second: o,
1524
1561
  silent_login_timeout: t.silent_login_timeout ?? 12e3,
1525
- token_renew_mode: t.token_renew_mode ?? d.access_token_or_id_token_invalid,
1562
+ token_renew_mode: t.token_renew_mode ?? m.access_token_or_id_token_invalid,
1526
1563
  demonstrating_proof_of_possession: t.demonstrating_proof_of_possession ?? !1,
1527
1564
  authority_timeout_wellknowurl_in_millisecond: t.authority_timeout_wellknowurl_in_millisecond ?? 1e4,
1528
1565
  logout_tokens_to_invalidate: t.logout_tokens_to_invalidate ?? ["access_token", "refresh_token"],
1529
- service_worker_activate: t.service_worker_activate ?? Pe,
1530
- demonstrating_proof_of_possession_configuration: t.demonstrating_proof_of_possession_configuration ?? ce,
1566
+ service_worker_activate: t.service_worker_activate ?? Le,
1567
+ demonstrating_proof_of_possession_configuration: t.demonstrating_proof_of_possession_configuration ?? de,
1531
1568
  preload_user_info: t.preload_user_info ?? !1
1532
- }, this.getFetch = r ?? qe, this.configurationName = n, this.tokens = null, this.userInfo = null, this.events = [], this.timeoutId = null, 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);
1569
+ }, this.getFetch = r ?? Xe, this.configurationName = n, this.tokens = null, this.userInfo = null, this.events = [], this.timeoutId = null, 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);
1533
1570
  }
1534
1571
  subscribeEvents(e) {
1535
- let t = Xe(9999999999999).toString();
1572
+ let t = $e(9999999999999).toString();
1536
1573
  return this.events.push({
1537
1574
  id: t,
1538
1575
  func: e
@@ -1548,7 +1585,7 @@ var Pe = () => {
1548
1585
  });
1549
1586
  }
1550
1587
  static {
1551
- this.getOrCreate = (e, t) => (n, r = "default") => Je(e, t)(n, r);
1588
+ this.getOrCreate = (e, t) => (n, r = "default") => Ze(e, t)(n, r);
1552
1589
  }
1553
1590
  static get(e = "default") {
1554
1591
  let t = typeof process > "u";
@@ -1593,31 +1630,31 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1593
1630
  check_session_iframe: t.check_session_iframe,
1594
1631
  issuer: t.issuer
1595
1632
  });
1596
- let n = await P(this.configuration, this.configurationName) ? this.configuration.storage || window.sessionStorage : this.configuration.storage;
1597
- return await Se(this.getFetch())(e, this.configuration.authority_time_cache_wellknowurl_in_second ?? 3600, n, this.configuration.authority_timeout_wellknowurl_in_millisecond);
1633
+ let n = await L(this.configuration, this.configurationName) ? this.configuration.storage || window.sessionStorage : this.configuration.storage;
1634
+ return await Te(this.getFetch())(e, this.configuration.authority_time_cache_wellknowurl_in_second ?? 3600, n, this.configuration.authority_timeout_wellknowurl_in_millisecond);
1598
1635
  };
1599
1636
  return this.initPromise = n(), this.initPromise.finally(() => {
1600
1637
  this.initPromise = null;
1601
1638
  });
1602
1639
  }
1603
1640
  async tryKeepExistingSessionAsync() {
1604
- return this.tryKeepExistingSessionPromise === null ? (this.tryKeepExistingSessionPromise = Fe(this), this.tryKeepExistingSessionPromise.finally(() => {
1641
+ return this.tryKeepExistingSessionPromise === null ? (this.tryKeepExistingSessionPromise = Re(this), this.tryKeepExistingSessionPromise.finally(() => {
1605
1642
  this.tryKeepExistingSessionPromise = null;
1606
1643
  })) : this.tryKeepExistingSessionPromise;
1607
1644
  }
1608
1645
  async startCheckSessionAsync(e, t, n, r = !1) {
1609
- await Ae(this, Q, this.configuration)(e, t, n, r);
1646
+ await Ne(this, Q, this.configuration)(e, t, n, r);
1610
1647
  }
1611
1648
  async loginAsync(e = void 0, t = null, n = !1, r = void 0, i = !1) {
1612
- return this.logoutPromise && await this.logoutPromise, this.loginPromise === null ? (i ? this.loginPromise = ke(window, this.configurationName, this.configuration, this.publishEvent.bind(this), this)(t, r) : this.loginPromise = ze(this.configurationName, this.configuration, this.publishEvent.bind(this), this.initAsync.bind(this), this.location)(e, t, n, r), this.loginPromise.finally(() => {
1649
+ return this.logoutPromise && await this.logoutPromise, this.loginPromise === null ? (i ? this.loginPromise = Me(window, this.configurationName, this.configuration, this.publishEvent.bind(this), this)(t, r) : this.loginPromise = He(this.configurationName, this.configuration, this.publishEvent.bind(this), this.initAsync.bind(this), this.location)(e, t, n, r), this.loginPromise.finally(() => {
1613
1650
  this.loginPromise = null;
1614
1651
  })) : this.loginPromise;
1615
1652
  }
1616
1653
  async loginCallbackAsync(e = !1) {
1617
1654
  if (this.loginCallbackPromise !== null) return this.loginCallbackPromise;
1618
1655
  let n = async () => {
1619
- let n = await Be(this)(e), r = n.tokens;
1620
- return this.tokens = r, await P(this.configuration, this.configurationName) || a(this.configurationName, this.configuration.storage, this.configuration.login_state_storage ?? this.configuration.storage).setTokens(r), this.publishEvent(t.eventNames.token_acquired, r), this.configuration.preload_user_info && await this.userInfoAsync(), {
1656
+ let n = await Ue(this)(e), r = n.tokens;
1657
+ return this.tokens = r, await L(this.configuration, this.configurationName) || c(this.configurationName, this.configuration.storage, this.configuration.login_state_storage ?? this.configuration.storage).setTokens(r), this.publishEvent(t.eventNames.token_acquired, r), this.configuration.preload_user_info && await this.userInfoAsync(), {
1621
1658
  parsedTokens: r,
1622
1659
  state: n.state,
1623
1660
  callbackPath: n.callbackPath,
@@ -1630,32 +1667,32 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1630
1667
  });
1631
1668
  }
1632
1669
  async generateDemonstrationOfProofOfPossessionAsync(e, t, n, r = {}) {
1633
- let i = this.configuration, o = {
1634
- ath: await ye(e),
1670
+ let i = this.configuration, a = {
1671
+ ath: await Se(e),
1635
1672
  ...r
1636
1673
  };
1637
- if (await P(i, this.configurationName)) return `DPOP_SECURED_BY_OIDC_SERVICE_WORKER_${this.configurationName}#tabId=${E(this.configurationName)}`;
1638
- let s = a(this.configurationName, i.storage, i.login_state_storage ?? i.storage), c = await s.getDemonstratingProofOfPossessionJwkAsync(), l = s.getDemonstratingProofOfPossessionNonce();
1639
- return l && (o.nonce = l), await pe(window)(i.demonstrating_proof_of_possession_configuration)(c, n, t, o);
1674
+ if (await L(i, this.configurationName)) return `DPOP_SECURED_BY_OIDC_SERVICE_WORKER_${this.configurationName}#tabId=${k(this.configurationName)}`;
1675
+ let o = c(this.configurationName, i.storage, i.login_state_storage ?? i.storage), s = await o.getDemonstratingProofOfPossessionJwkAsync(), l = o.getDemonstratingProofOfPossessionNonce();
1676
+ return l && (a.nonce = l), await ge(window)(i.demonstrating_proof_of_possession_configuration)(s, n, t, a);
1640
1677
  }
1641
1678
  loginCallbackWithAutoTokensRenewAsync() {
1642
- return this.loginCallbackWithAutoTokensRenewPromise === null ? (this.loginCallbackWithAutoTokensRenewPromise = Ye(this), this.loginCallbackWithAutoTokensRenewPromise.finally(() => {
1679
+ return this.loginCallbackWithAutoTokensRenewPromise === null ? (this.loginCallbackWithAutoTokensRenewPromise = Qe(this), this.loginCallbackWithAutoTokensRenewPromise.finally(() => {
1643
1680
  this.loginCallbackWithAutoTokensRenewPromise = null;
1644
1681
  })) : this.loginCallbackWithAutoTokensRenewPromise;
1645
1682
  }
1646
1683
  userInfoAsync(e = !1, t = !1) {
1647
- return this.userInfoPromise === null ? (this.userInfoPromise = Ke(this)(e, t), this.userInfoPromise.finally(() => {
1684
+ return this.userInfoPromise === null ? (this.userInfoPromise = Ye(this)(e, t), this.userInfoPromise.finally(() => {
1648
1685
  this.userInfoPromise = null;
1649
1686
  })) : this.userInfoPromise;
1650
1687
  }
1651
1688
  async renewTokensAsync(e = null, t = null) {
1652
1689
  if (this.renewTokensPromise !== null) return this.renewTokensPromise;
1653
- if (this.timeoutId) return y.clearTimeout(this.timeoutId), this.renewTokensPromise = Oe(this, !0, e, t), this.renewTokensPromise.finally(() => {
1690
+ if (this.timeoutId) return S.clearTimeout(this.timeoutId), this.renewTokensPromise = je(this, !0, e, t), this.renewTokensPromise.finally(() => {
1654
1691
  this.renewTokensPromise = null;
1655
1692
  });
1656
1693
  }
1657
1694
  async destroyAsync(e) {
1658
- return await Ue(this)(e);
1695
+ return await Ke(this)(e);
1659
1696
  }
1660
1697
  async logoutSameTabAsync(e, t) {
1661
1698
  this.configuration.monitor_session && this.configuration.client_id === e && t && this.tokens && this.tokens.idTokenPayload && this.tokens.idTokenPayload.sub === t && (await this.destroyAsync("LOGGED_OUT"), this.publishEvent(i.logout_from_same_tab, {
@@ -1670,11 +1707,11 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1670
1707
  }));
1671
1708
  }
1672
1709
  async logoutAsync(e = void 0, t = null) {
1673
- return this.logoutPromise ? this.logoutPromise : (this.logoutPromise = We(this, Q, this.getFetch(), console, this.location)(e, t), this.logoutPromise.finally(() => {
1710
+ return this.logoutPromise ? this.logoutPromise : (this.logoutPromise = qe(this, Q, this.getFetch(), console, this.location)(e, t), this.logoutPromise.finally(() => {
1674
1711
  this.logoutPromise = null;
1675
1712
  }));
1676
1713
  }
1677
- }, Ze = class t {
1714
+ }, et = class t {
1678
1715
  constructor(e) {
1679
1716
  this._oidc = e;
1680
1717
  }
@@ -1725,7 +1762,7 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1725
1762
  }
1726
1763
  async getValidTokenAsync(e = 200, t = 50) {
1727
1764
  let n = this._oidc;
1728
- return _({
1765
+ return b({
1729
1766
  getTokens: () => n.tokens,
1730
1767
  configuration: {
1731
1768
  token_automatic_renew_mode: n.configuration.token_automatic_renew_mode,
@@ -1739,7 +1776,7 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1739
1776
  }, e, t);
1740
1777
  }
1741
1778
  fetchWithTokens(e, t = !1) {
1742
- return Ge(e, this._oidc, t);
1779
+ return Je(e, this._oidc, t);
1743
1780
  }
1744
1781
  async userInfoAsync(e = !1, t = !1) {
1745
1782
  return this._oidc.userInfoAsync(e, t);
@@ -1749,4 +1786,4 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1749
1786
  }
1750
1787
  };
1751
1788
  //#endregion
1752
- export { Ze as OidcClient, e as OidcLocation, o as TokenAutomaticRenewMode, d as TokenRenewMode, qe as getFetchDefault, Y as getParseQueryStringFromLocation, Le as getPath };
1789
+ export { et as OidcClient, e as OidcLocation, l as TokenAutomaticRenewMode, m as TokenRenewMode, Xe as getFetchDefault, Y as getParseQueryStringFromLocation, Be as getPath };