@axa-fr/oidc-client 7.22.25 → 7.22.26

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
@@ -88,9 +88,9 @@ const m = {
88
88
  s[`oidc.session_state.${e}`] = h;
89
89
  }, r = async () => s[`oidc.session_state.${e}`], a = (h) => {
90
90
  s[`oidc.nonce.${e}`] = h.nonce;
91
- }, u = (h) => {
91
+ }, l = (h) => {
92
92
  s[`oidc.jwk.${e}`] = JSON.stringify(h);
93
- }, f = () => JSON.parse(s[`oidc.jwk.${e}`]), l = async () => ({ nonce: s[`oidc.nonce.${e}`] }), c = async (h) => {
93
+ }, f = () => JSON.parse(s[`oidc.jwk.${e}`]), u = async () => ({ nonce: s[`oidc.nonce.${e}`] }), c = async (h) => {
94
94
  s[`oidc.dpop_nonce.${e}`] = h;
95
95
  }, _ = () => s[`oidc.dpop_nonce.${e}`], d = () => s[`oidc.${e}`] ? JSON.stringify({ tokens: JSON.parse(s[`oidc.${e}`]).tokens }) : null, y = {};
96
96
  return {
@@ -101,7 +101,7 @@ const m = {
101
101
  setSessionStateAsync: i,
102
102
  getSessionStateAsync: r,
103
103
  setNonceAsync: a,
104
- getNonceAsync: l,
104
+ getNonceAsync: u,
105
105
  setLoginParams: (h) => {
106
106
  y[e] = h, s[`oidc.login.${e}`] = JSON.stringify(h);
107
107
  },
@@ -121,7 +121,7 @@ const m = {
121
121
  },
122
122
  setDemonstratingProofOfPossessionNonce: c,
123
123
  getDemonstratingProofOfPossessionNonce: _,
124
- setDemonstratingProofOfPossessionJwkAsync: u,
124
+ setDemonstratingProofOfPossessionJwkAsync: l,
125
125
  getDemonstratingProofOfPossessionJwkAsync: f
126
126
  };
127
127
  };
@@ -135,7 +135,7 @@ const Ie = (e) => decodeURIComponent(
135
135
  console.warn(s);
136
136
  }
137
137
  return null;
138
- }, Ne = (e, s) => e.split(s).length - 1, Z = {
138
+ }, Ne = (e, s) => e.split(s).length - 1, Q = {
139
139
  access_token_or_id_token_invalid: "access_token_or_id_token_invalid",
140
140
  access_token_invalid: "access_token_invalid",
141
141
  id_token_invalid: "id_token_invalid"
@@ -147,7 +147,7 @@ function xe(e, s, n) {
147
147
  } else return s && s.iat ? s.iat : n && n.iat ? n.iat : (/* @__PURE__ */ new Date()).getTime() / 1e3;
148
148
  return e.issuedAt;
149
149
  }
150
- const X = (e, s = null, n) => {
150
+ const te = (e, s = null, n) => {
151
151
  if (!e)
152
152
  return null;
153
153
  let t;
@@ -155,11 +155,11 @@ const X = (e, s = null, n) => {
155
155
  e.accessTokenPayload !== void 0 ? t = e.accessTokenPayload : t = ce(e.accessToken);
156
156
  let i;
157
157
  s != null && "idToken" in s && !("idToken" in e) ? i = s.idToken : i = e.idToken;
158
- const r = e.idTokenPayload ? e.idTokenPayload : ce(i), a = r && r.exp ? r.exp : Number.MAX_VALUE, u = t && t.exp ? t.exp : e.issuedAt + o;
158
+ const r = e.idTokenPayload ? e.idTokenPayload : ce(i), a = r && r.exp ? r.exp : Number.MAX_VALUE, l = t && t.exp ? t.exp : e.issuedAt + o;
159
159
  e.issuedAt = xe(e, t, r);
160
160
  let f;
161
- e.expiresAt ? f = e.expiresAt : n === Z.access_token_invalid ? f = u : n === Z.id_token_invalid ? f = a : f = a < u ? a : u;
162
- const l = {
161
+ e.expiresAt ? f = e.expiresAt : n === Q.access_token_invalid ? f = l : n === Q.id_token_invalid ? f = a : f = a < l ? a : l;
162
+ const u = {
163
163
  ...e,
164
164
  idTokenPayload: r,
165
165
  accessTokenPayload: t,
@@ -168,9 +168,9 @@ const X = (e, s = null, n) => {
168
168
  };
169
169
  if (s != null && "refreshToken" in s && !("refreshToken" in e)) {
170
170
  const c = s.refreshToken;
171
- return { ...l, refreshToken: c };
171
+ return { ...u, refreshToken: c };
172
172
  }
173
- return l;
173
+ return u;
174
174
  }, oe = (e, s, n) => {
175
175
  if (!e)
176
176
  return null;
@@ -186,7 +186,7 @@ const X = (e, s = null, n) => {
186
186
  tokenType: e.token_type,
187
187
  issuedAt: e.issued_at
188
188
  };
189
- 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), X(t, s, n);
189
+ 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);
190
190
  }, F = (e, s) => {
191
191
  const n = (/* @__PURE__ */ new Date()).getTime() / 1e3, t = s - n;
192
192
  return Math.round(t - e);
@@ -199,7 +199,7 @@ const X = (e, s = null, n) => {
199
199
  await e.renewTokensAsync({});
200
200
  break;
201
201
  } else
202
- await z({ milliseconds: s });
202
+ await X({ milliseconds: s });
203
203
  t = t - 1;
204
204
  }
205
205
  return {
@@ -242,16 +242,16 @@ const X = (e, s = null, n) => {
242
242
  setInterval: setInterval.bind(e),
243
243
  clearInterval: clearInterval.bind(e)
244
244
  };
245
- }(), ue = "7.22.25";
245
+ }(), ue = "7.22.26";
246
246
  let _e = null, j;
247
- const z = ({ milliseconds: e }) => new Promise((s) => K.setTimeout(s, e)), pe = (e = "/") => {
247
+ const X = ({ milliseconds: e }) => new Promise((s) => K.setTimeout(s, e)), pe = (e = "/") => {
248
248
  try {
249
249
  j = new AbortController(), fetch(
250
250
  `${e}OidcKeepAliveServiceWorker.json?minSleepSeconds=150`,
251
251
  { signal: j.signal }
252
252
  ).catch((t) => {
253
253
  console.log(t);
254
- }), z({ milliseconds: 150 * 1e3 }).then(pe);
254
+ }), X({ milliseconds: 150 * 1e3 }).then(pe);
255
255
  } catch (s) {
256
256
  console.log(s);
257
257
  }
@@ -266,7 +266,7 @@ const z = ({ milliseconds: e }) => new Promise((s) => K.setTimeout(s, e)), pe =
266
266
  }), De = (e) => async (s, n) => {
267
267
  n(), await s.update();
268
268
  const t = await s.unregister();
269
- console.log(`Service worker unregistration ${t ? "successful" : "failed"}`), await z({ milliseconds: 2e3 }), e.reload();
269
+ console.log(`Service worker unregistration ${t ? "successful" : "failed"}`), await X({ milliseconds: 2e3 }), e.reload();
270
270
  }, Re = (e) => {
271
271
  const s = sessionStorage.getItem(`oidc.tabId.${e}`);
272
272
  if (s)
@@ -316,7 +316,7 @@ const z = ({ milliseconds: e }) => new Promise((s) => K.setTimeout(s, e)), pe =
316
316
  type: "setSessionState",
317
317
  data: { sessionState: g },
318
318
  configurationName: s
319
- }), u = async () => (await O(t)({
319
+ }), l = async () => (await O(t)({
320
320
  type: "getSessionState",
321
321
  data: null,
322
322
  configurationName: s
@@ -324,7 +324,7 @@ const z = ({ milliseconds: e }) => new Promise((s) => K.setTimeout(s, e)), pe =
324
324
  type: "setNonce",
325
325
  data: { nonce: g },
326
326
  configurationName: s
327
- })), l = async () => {
327
+ })), u = async () => {
328
328
  let A = (await O(t)({
329
329
  type: "getNonce",
330
330
  data: null,
@@ -338,9 +338,9 @@ const z = ({ milliseconds: e }) => new Promise((s) => K.setTimeout(s, e)), pe =
338
338
  startKeepAliveServiceWorker: () => r(e.service_worker_keep_alive_path),
339
339
  isServiceWorkerProxyActiveAsync: () => Le(e.service_worker_keep_alive_path),
340
340
  setSessionStateAsync: a,
341
- getSessionStateAsync: u,
341
+ getSessionStateAsync: l,
342
342
  setNonceAsync: f,
343
- getNonceAsync: l,
343
+ getNonceAsync: u,
344
344
  setLoginParams: (g) => {
345
345
  c[s] = g, localStorage[`oidc.login.${s}`] = JSON.stringify(g);
346
346
  },
@@ -465,7 +465,7 @@ const Fe = {
465
465
  // @ts-ignore
466
466
  // JWT "claims" are really a JSON-defined JWS "payload"
467
467
  payload: fe(JSON.stringify(t))
468
- }, a = o.importKeyAlgorithm, u = !0, f = ["sign"], l = await e.crypto.subtle.importKey("jwk", s, a, u, f), c = we(`${r.protected}.${r.payload}`), _ = o.signAlgorithm, d = await e.crypto.subtle.sign(_, l, c);
468
+ }, a = o.importKeyAlgorithm, l = !0, f = ["sign"], u = await e.crypto.subtle.importKey("jwk", s, a, l, f), c = we(`${r.protected}.${r.payload}`), _ = o.signAlgorithm, d = await e.crypto.subtle.sign(_, u, c);
469
469
  return r.signature = ie(new Uint8Array(d)), `${r.protected}.${r.payload}.${r.signature}`;
470
470
  }, Je = { sign: Ve }, Me = (e) => async (s) => {
471
471
  const n = s, t = !0, o = ["sign", "verify"], i = await e.crypto.subtle.generateKey(n, t, o);
@@ -517,20 +517,20 @@ const Fe = {
517
517
  }, ve = () => {
518
518
  const e = typeof window < "u" && !!window.crypto, s = e && !!window.crypto.subtle;
519
519
  return { hasCrypto: e, hasSubtleCrypto: s };
520
- }, ee = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", Xe = (e) => {
520
+ }, Z = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", Xe = (e) => {
521
521
  const s = [];
522
522
  for (let n = 0; n < e.byteLength; n += 1) {
523
- const t = e[n] % ee.length;
524
- s.push(ee[t]);
523
+ const t = e[n] % Z.length;
524
+ s.push(Z[t]);
525
525
  }
526
526
  return s.join("");
527
- }, se = (e) => {
527
+ }, ee = (e) => {
528
528
  const s = new Uint8Array(e), { hasCrypto: n } = ve();
529
529
  if (n)
530
530
  window.crypto.getRandomValues(s);
531
531
  else
532
532
  for (let t = 0; t < e; t += 1)
533
- s[t] = Math.random() * ee.length | 0;
533
+ s[t] = Math.random() * Z.length | 0;
534
534
  return Xe(s);
535
535
  };
536
536
  function ze(e) {
@@ -555,12 +555,12 @@ const Qe = (e) => {
555
555
  }, Ze = 60 * 60, es = (e) => async (s, n = Ze, t = window.sessionStorage, o = 1e4) => {
556
556
  const i = `${s}/.well-known/openid-configuration`, r = `oidc.server:${s}`, a = $e(r, t, n);
557
557
  if (a)
558
- return new te(a);
559
- const u = await B(e)(i, {}, o);
560
- if (u.status !== 200)
558
+ return new ne(a);
559
+ const l = await B(e)(i, {}, o);
560
+ if (l.status !== 200)
561
561
  return null;
562
- const f = await u.json();
563
- return Ke(r, f, t), new te(f);
562
+ const f = await l.json();
563
+ return Ke(r, f, t), new ne(f);
564
564
  }, B = (e) => async (s, n = {}, t = 1e4, o = 0) => {
565
565
  let i;
566
566
  try {
@@ -575,10 +575,10 @@ const Qe = (e) => {
575
575
  throw console.error(r.message), r;
576
576
  }
577
577
  return i;
578
- }, ne = {
578
+ }, se = {
579
579
  refresh_token: "refresh_token",
580
580
  access_token: "access_token"
581
- }, de = (e) => async (s, n, t = ne.refresh_token, o, i = {}, r = 1e4) => {
581
+ }, de = (e) => async (s, n, t = se.refresh_token, o, i = {}, r = 1e4) => {
582
582
  const a = {
583
583
  token: n,
584
584
  token_type_hint: t,
@@ -586,12 +586,12 @@ const Qe = (e) => {
586
586
  };
587
587
  for (const [c, _] of Object.entries(i))
588
588
  a[c] === void 0 && (a[c] = _);
589
- const u = [];
589
+ const l = [];
590
590
  for (const c in a) {
591
591
  const _ = encodeURIComponent(c), d = encodeURIComponent(a[c]);
592
- u.push(`${_}=${d}`);
592
+ l.push(`${_}=${d}`);
593
593
  }
594
- const f = u.join("&");
594
+ const f = l.join("&");
595
595
  return (await B(e)(
596
596
  s,
597
597
  {
@@ -608,12 +608,12 @@ const Qe = (e) => {
608
608
  }, ss = (e) => async (s, n, t, o, i = {}, r, a = 1e4) => {
609
609
  for (const [d, y] of Object.entries(t))
610
610
  n[d] === void 0 && (n[d] = y);
611
- const u = [];
611
+ const l = [];
612
612
  for (const d in n) {
613
613
  const y = encodeURIComponent(d), p = encodeURIComponent(n[d]);
614
- u.push(`${y}=${p}`);
614
+ l.push(`${y}=${p}`);
615
615
  }
616
- const f = u.join("&"), l = await B(e)(
616
+ const f = l.join("&"), u = await B(e)(
617
617
  s,
618
618
  {
619
619
  method: "POST",
@@ -625,30 +625,30 @@ const Qe = (e) => {
625
625
  },
626
626
  a
627
627
  );
628
- if (l.status !== 200)
628
+ if (u.status !== 200)
629
629
  return {
630
630
  success: !1,
631
- status: l.status,
631
+ status: u.status,
632
632
  demonstratingProofOfPossessionNonce: null
633
633
  };
634
- const c = await l.json();
634
+ const c = await u.json();
635
635
  let _ = null;
636
- return l.headers.has(G) && (_ = l.headers.get(
636
+ return u.headers.has(G) && (_ = u.headers.get(
637
637
  G
638
638
  )), {
639
639
  success: !0,
640
- status: l.status,
640
+ status: u.status,
641
641
  data: oe(c, o, r),
642
642
  demonstratingProofOfPossessionNonce: _
643
643
  };
644
644
  }, ns = (e, s) => async (n, t) => {
645
645
  t = t ? { ...t } : {};
646
- const o = se(128), i = await Qe(o);
646
+ const o = ee(128), i = await Qe(o);
647
647
  await e.setCodeVerifierAsync(o), await e.setStateAsync(t.state), t.code_challenge = i, t.code_challenge_method = "S256";
648
648
  let r = "";
649
649
  if (t)
650
- for (const [a, u] of Object.entries(t))
651
- r === "" ? r += "?" : r += "&", r += `${a}=${encodeURIComponent(u)}`;
650
+ for (const [a, l] of Object.entries(t))
651
+ r === "" ? r += "?" : r += "&", r += `${a}=${encodeURIComponent(l)}`;
652
652
  s.open(`${n}${r}`);
653
653
  }, G = "DPoP-Nonce", ts = (e) => async (s, n, t, o, i = 1e4) => {
654
654
  n = n ? { ...n } : {}, n.code_verifier = await e.getCodeVerifierAsync();
@@ -657,7 +657,7 @@ const Qe = (e) => {
657
657
  const _ = encodeURIComponent(c), d = encodeURIComponent(n[c]);
658
658
  r.push(`${_}=${d}`);
659
659
  }
660
- const a = r.join("&"), u = await B(fetch)(
660
+ const a = r.join("&"), l = await B(fetch)(
661
661
  s,
662
662
  {
663
663
  method: "POST",
@@ -669,18 +669,18 @@ const Qe = (e) => {
669
669
  },
670
670
  i
671
671
  );
672
- if (await Promise.all([e.setCodeVerifierAsync(null), e.setStateAsync(null)]), u.status !== 200)
673
- return { success: !1, status: u.status };
672
+ if (await Promise.all([e.setCodeVerifierAsync(null), e.setStateAsync(null)]), l.status !== 200)
673
+ return { success: !1, status: l.status };
674
674
  let f = null;
675
- u.headers.has(G) && (f = u.headers.get(
675
+ l.headers.has(G) && (f = l.headers.get(
676
676
  G
677
677
  ));
678
- const l = await u.json();
678
+ const u = await l.json();
679
679
  return {
680
680
  success: !0,
681
681
  data: {
682
682
  state: n.state,
683
- tokens: oe(l, null, o),
683
+ tokens: oe(u, null, o),
684
684
  demonstratingProofOfPossessionNonce: f
685
685
  }
686
686
  };
@@ -696,31 +696,25 @@ async function he(e, s, n) {
696
696
  );
697
697
  return await I(e.configuration, e.configurationName) || await P(e.configurationName, e.configuration.storage).setTokens(e.tokens), e.tokens ? o : (await e.destroyAsync(i), null);
698
698
  }
699
- const os = async (e, s) => {
700
- const n = await I(s, e.configurationName);
701
- if (n) {
702
- const t = await e.initAsync(
703
- s.authority,
704
- s.authority_configuration
705
- ), { tokens: o } = await n.initAsync(
706
- t,
707
- "tryKeepExistingSessionAsync",
708
- s
709
- );
710
- return o;
711
- } else {
712
- const t = P(e.configurationName, s.storage ?? sessionStorage);
713
- let { tokens: o } = await t.initAsync();
714
- return o = X(o, e.tokens, s.token_renew_mode), o;
715
- }
716
- };
717
699
  async function be(e, s = !1, n = null) {
718
700
  const t = e.configuration, o = `${t.client_id}_${e.configurationName}_${t.authority}`;
719
701
  let i;
720
702
  const r = await I(e.configuration, e.configurationName);
721
- return (t == null ? void 0 : t.storage) === (window == null ? void 0 : window.sessionStorage) && !r ? i = await he(e, s, n) : i = await navigator.locks.request(o, { ifAvailable: !0 }, async (a) => a ? await he(e, s, n) : (e.publishEvent(C.eventNames.syncTokensAsync_lock_not_available, {
722
- lock: "lock not available"
723
- }), await os(e, t))), i ? (e.timeoutId && (e.timeoutId = M(e, e.tokens.expiresAt, n)), e.tokens) : null;
703
+ if ((t == null ? void 0 : t.storage) === (window == null ? void 0 : window.sessionStorage) && !r)
704
+ i = await he(e, s, n);
705
+ else {
706
+ let a = "retry";
707
+ for (; a === "retry"; )
708
+ a = await navigator.locks.request(
709
+ o,
710
+ { ifAvailable: !0 },
711
+ async (l) => l ? await he(e, s, n) : (e.publishEvent(C.eventNames.syncTokensAsync_lock_not_available, {
712
+ lock: "lock not available"
713
+ }), "retry")
714
+ );
715
+ i = a;
716
+ }
717
+ return i ? (e.timeoutId && (e.timeoutId = M(e, e.tokens.expiresAt, n)), e.tokens) : null;
724
718
  }
725
719
  const M = (e, s, n = null) => {
726
720
  const t = e.configuration.refresh_time_before_tokens_expiration_in_second;
@@ -736,7 +730,7 @@ const M = (e, s, n = null) => {
736
730
  TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID: "TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID",
737
731
  LOGOUT_FROM_ANOTHER_TAB: "LOGOUT_FROM_ANOTHER_TAB",
738
732
  REQUIRE_SYNC_TOKENS: "REQUIRE_SYNC_TOKENS"
739
- }, is = (e) => async (s, n, t, o = !1) => {
733
+ }, os = (e) => async (s, n, t, o = !1) => {
740
734
  const i = { nonce: null };
741
735
  if (!t)
742
736
  return { tokens: null, status: "NOT_CONNECTED", nonce: i };
@@ -744,9 +738,9 @@ const M = (e, s, n = null) => {
744
738
  const a = await e.initAsync(
745
739
  s.authority,
746
740
  s.authority_configuration
747
- ), u = await I(s, n);
748
- if (u) {
749
- const { status: c, tokens: _ } = await u.initAsync(
741
+ ), l = await I(s, n);
742
+ if (l) {
743
+ const { status: c, tokens: _ } = await l.initAsync(
750
744
  a,
751
745
  "syncTokensAsync",
752
746
  s
@@ -761,15 +755,15 @@ const M = (e, s, n = null) => {
761
755
  const y = F(
762
756
  s.refresh_time_before_tokens_expiration_in_second,
763
757
  _.expiresAt
764
- ) > 0 ? "TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID" : "TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_INVALID", p = await u.getNonceAsync();
758
+ ) > 0 ? "TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID" : "TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_INVALID", p = await l.getNonceAsync();
765
759
  return { tokens: _, status: y, nonce: p };
766
760
  }
767
- r = await u.getNonceAsync();
761
+ r = await l.getNonceAsync();
768
762
  } else {
769
763
  const c = P(n, s.storage ?? sessionStorage), _ = await c.initAsync();
770
764
  let { tokens: d } = _;
771
765
  const { status: y } = _;
772
- if (d && (d = X(d, e.tokens, s.token_renew_mode)), d) {
766
+ if (d && (d = te(d, e.tokens, s.token_renew_mode)), d) {
773
767
  if (y === "SESSIONS_LOST")
774
768
  return { tokens: null, status: "SESSIONS_LOST", nonce: i };
775
769
  if (d.issuedAt !== t.issuedAt) {
@@ -782,32 +776,32 @@ const M = (e, s, n = null) => {
782
776
  } else return { tokens: null, status: "LOGOUT_FROM_ANOTHER_TAB", nonce: i };
783
777
  r = await c.getNonceAsync();
784
778
  }
785
- const l = F(
779
+ const u = F(
786
780
  s.refresh_time_before_tokens_expiration_in_second,
787
781
  t.expiresAt
788
782
  ) > 0 ? "TOKENS_VALID" : "TOKENS_INVALID";
789
- return o ? { tokens: t, status: "FORCE_REFRESH", nonce: r } : { tokens: t, status: l, nonce: r };
783
+ return o ? { tokens: t, status: "FORCE_REFRESH", nonce: r } : { tokens: t, status: u, nonce: r };
790
784
  }, H = (e) => async (s, n = 0, t = !1, o = null) => {
791
785
  if (!navigator.onLine && document.hidden)
792
786
  return { tokens: e.tokens, status: "GIVE_UP" };
793
787
  let i = 6;
794
788
  for (; !navigator.onLine && i > 0; )
795
- await z({ milliseconds: 1e3 }), i--, e.publishEvent(m.refreshTokensAsync, {
789
+ await X({ milliseconds: 1e3 }), i--, e.publishEvent(m.refreshTokensAsync, {
796
790
  message: `wait because navigator is offline try ${i}`
797
791
  });
798
792
  const r = n + 1;
799
793
  o || (o = {});
800
- const a = e.configuration, u = (l, c = null, _ = null) => re(
794
+ const a = e.configuration, l = (u, c = null, _ = null) => re(
801
795
  e.configurationName,
802
796
  e.configuration,
803
797
  e.publishEvent.bind(e)
804
- )(l, c, _), f = async () => {
798
+ )(u, c, _), f = async () => {
805
799
  try {
806
- let l;
800
+ let u;
807
801
  const c = await I(a, e.configurationName);
808
- c ? l = c.getLoginParams() : l = P(e.configurationName, a.storage).getLoginParams();
809
- const _ = await u({
810
- ...l.extras,
802
+ c ? u = c.getLoginParams() : u = P(e.configurationName, a.storage).getLoginParams();
803
+ const _ = await l({
804
+ ...u.extras,
811
805
  ...o,
812
806
  prompt: "none"
813
807
  });
@@ -816,21 +810,21 @@ const M = (e, s, n = null) => {
816
810
  }), { tokens: null, status: "SESSION_LOST" }) : (s(_.tokens), e.publishEvent(C.eventNames.token_renewed, {}), { tokens: _.tokens, status: "LOGGED" }) : (s(null), e.publishEvent(m.refreshTokensAsync_error, {
817
811
  message: "refresh token silent not active"
818
812
  }), { tokens: null, status: "SESSION_LOST" });
819
- } catch (l) {
820
- return console.error(l), e.publishEvent(m.refreshTokensAsync_silent_error, {
813
+ } catch (u) {
814
+ return console.error(u), e.publishEvent(m.refreshTokensAsync_silent_error, {
821
815
  message: "exceptionSilent",
822
- exception: l.message
816
+ exception: u.message
823
817
  }), await H(e)(s, r, t, o);
824
818
  }
825
819
  };
826
820
  try {
827
- const { status: l, tokens: c, nonce: _ } = await is(e)(
821
+ const { status: u, tokens: c, nonce: _ } = await os(e)(
828
822
  a,
829
823
  e.configurationName,
830
824
  e.tokens,
831
825
  t
832
826
  );
833
- switch (l) {
827
+ switch (u) {
834
828
  case N.SESSION_LOST:
835
829
  return s(null), e.publishEvent(m.refreshTokensAsync_error, {
836
830
  message: "refresh token session lost"
@@ -848,13 +842,13 @@ const M = (e, s, n = null) => {
848
842
  status: "session syncTokensAsync"
849
843
  }), { tokens: null, status: "LOGGED_OUT" };
850
844
  case N.REQUIRE_SYNC_TOKENS:
851
- return a.token_automatic_renew_mode == J.AutomaticOnlyWhenFetchExecuted && N.FORCE_REFRESH !== l ? (e.publishEvent(m.tokensInvalidAndWaitingActionsToRefresh, {}), { tokens: e.tokens, status: "GIVE_UP" }) : (e.publishEvent(m.refreshTokensAsync_begin, { tryNumber: n }), await f());
845
+ return a.token_automatic_renew_mode == J.AutomaticOnlyWhenFetchExecuted && N.FORCE_REFRESH !== u ? (e.publishEvent(m.tokensInvalidAndWaitingActionsToRefresh, {}), { tokens: e.tokens, status: "GIVE_UP" }) : (e.publishEvent(m.refreshTokensAsync_begin, { tryNumber: n }), await f());
852
846
  default: {
853
- if (a.token_automatic_renew_mode == J.AutomaticOnlyWhenFetchExecuted && N.FORCE_REFRESH !== l)
847
+ if (a.token_automatic_renew_mode == J.AutomaticOnlyWhenFetchExecuted && N.FORCE_REFRESH !== u)
854
848
  return e.publishEvent(m.tokensInvalidAndWaitingActionsToRefresh, {}), { tokens: e.tokens, status: "GIVE_UP" };
855
849
  if (e.publishEvent(m.refreshTokensAsync_begin, {
856
850
  refreshToken: c.refreshToken,
857
- status: l,
851
+ status: u,
858
852
  tryNumber: n
859
853
  }), !c.refreshToken)
860
854
  return await f();
@@ -921,10 +915,10 @@ const M = (e, s, n = null) => {
921
915
  })();
922
916
  }
923
917
  }
924
- } catch (l) {
925
- return console.error(l), e.publishEvent(m.refreshTokensAsync_silent_error, {
918
+ } catch (u) {
919
+ return console.error(u), e.publishEvent(m.refreshTokensAsync_silent_error, {
926
920
  message: "exception",
927
- exception: l.message
921
+ exception: u.message
928
922
  }), new Promise((c, _) => {
929
923
  setTimeout(() => {
930
924
  H(e)(s, r, t, o).then(c).catch(_);
@@ -940,13 +934,13 @@ const M = (e, s, n = null) => {
940
934
  if (o && (t == null && (t = {}), t.state = o), i && (t == null && (t = {}), t.scope = i), t != null)
941
935
  for (const [c, _] of Object.entries(t))
942
936
  r === "" ? r = `?${encodeURIComponent(c)}=${encodeURIComponent(_)}` : r += `&${encodeURIComponent(c)}=${encodeURIComponent(_)}`;
943
- const a = s.silent_login_uri + r, u = a.indexOf("/", a.indexOf("//") + 2), f = a.substring(0, u), l = document.createElement("iframe");
944
- return l.width = "0px", l.height = "0px", l.id = `${e}_oidc_iframe`, l.setAttribute("src", a), document.body.appendChild(l), new Promise((c, _) => {
937
+ const a = s.silent_login_uri + r, l = a.indexOf("/", a.indexOf("//") + 2), f = a.substring(0, l), u = document.createElement("iframe");
938
+ return u.width = "0px", u.height = "0px", u.id = `${e}_oidc_iframe`, u.setAttribute("src", a), document.body.appendChild(u), new Promise((c, _) => {
945
939
  let d = !1;
946
940
  const y = () => {
947
- window.removeEventListener("message", p), l.remove(), d = !0;
941
+ window.removeEventListener("message", p), u.remove(), d = !0;
948
942
  }, p = (k) => {
949
- if (k.origin === f && k.source === l.contentWindow) {
943
+ if (k.origin === f && k.source === u.contentWindow) {
950
944
  const b = `${e}_oidc_tokens:`, E = `${e}_oidc_error:`, w = `${e}_oidc_exception:`, v = k.data;
951
945
  if (v && typeof v == "string" && !d) {
952
946
  if (v.startsWith(b)) {
@@ -975,11 +969,11 @@ const M = (e, s, n = null) => {
975
969
  } catch (r) {
976
970
  throw n(m.silentLoginAsync_error, r), r;
977
971
  }
978
- }, rs = (e, s, n, t, o) => (i = null, r = void 0) => {
972
+ }, is = (e, s, n, t, o) => (i = null, r = void 0) => {
979
973
  i = { ...i };
980
- const a = (f, l, c) => re(s, n, t.bind(o))(
974
+ const a = (f, u, c) => re(s, n, t.bind(o))(
981
975
  f,
982
- l,
976
+ u,
983
977
  c
984
978
  );
985
979
  return (async () => {
@@ -987,9 +981,9 @@ const M = (e, s, n = null) => {
987
981
  let f;
988
982
  i && "state" in i && (f = i.state, delete i.state);
989
983
  try {
990
- const l = n.extras ? { ...n.extras, ...i } : i, c = await a(
984
+ const u = n.extras ? { ...n.extras, ...i } : i, c = await a(
991
985
  {
992
- ...l,
986
+ ...u,
993
987
  prompt: "none"
994
988
  },
995
989
  f,
@@ -997,19 +991,19 @@ const M = (e, s, n = null) => {
997
991
  );
998
992
  if (c)
999
993
  return o.tokens = c.tokens, t(m.token_acquired, {}), o.timeoutId = M(o, o.tokens.expiresAt, i), {};
1000
- } catch (l) {
1001
- return l;
994
+ } catch (u) {
995
+ return u;
1002
996
  }
1003
997
  })();
1004
- }, as = (e, s, n) => (t, o, i, r = !1) => {
1005
- const a = (u, f = void 0, l = void 0) => re(e.configurationName, n, e.publishEvent.bind(e))(
1006
- u,
998
+ }, rs = (e, s, n) => (t, o, i, r = !1) => {
999
+ const a = (l, f = void 0, u = void 0) => re(e.configurationName, n, e.publishEvent.bind(e))(
1000
+ l,
1007
1001
  f,
1008
- l
1002
+ u
1009
1003
  );
1010
- return new Promise((u, f) => {
1004
+ return new Promise((l, f) => {
1011
1005
  if (n.silent_login_uri && n.silent_redirect_uri && n.monitor_session && t && i && !r) {
1012
- const l = () => {
1006
+ const u = () => {
1013
1007
  e.checkSessionIFrame.stop();
1014
1008
  const c = e.tokens;
1015
1009
  if (c === null)
@@ -1047,18 +1041,18 @@ const M = (e, s, n = null) => {
1047
1041
  });
1048
1042
  };
1049
1043
  e.checkSessionIFrame = new Pe(
1050
- l,
1044
+ u,
1051
1045
  o,
1052
1046
  t
1053
1047
  ), e.checkSessionIFrame.load().then(() => {
1054
- e.checkSessionIFrame.start(i), u(e.checkSessionIFrame);
1048
+ e.checkSessionIFrame.start(i), l(e.checkSessionIFrame);
1055
1049
  }).catch((c) => {
1056
1050
  f(c);
1057
1051
  });
1058
1052
  } else
1059
- u(null);
1053
+ l(null);
1060
1054
  });
1061
- }, cs = (e) => !!(e.os === "iOS" && e.osVersion.startsWith("12") || e.os === "Mac OS X" && e.osVersion.startsWith("10_15_6")), ls = (e) => {
1055
+ }, as = (e) => !!(e.os === "iOS" && e.osVersion.startsWith("12") || e.os === "Mac OS X" && e.osVersion.startsWith("10_15_6")), cs = (e) => {
1062
1056
  const s = e.appVersion, n = e.userAgent, t = "-";
1063
1057
  let o = t;
1064
1058
  const i = [
@@ -1094,9 +1088,9 @@ const M = (e, s, n = null) => {
1094
1088
  }
1095
1089
  ];
1096
1090
  for (const a in i) {
1097
- const u = i[a];
1098
- if (u.r.test(n)) {
1099
- o = u.s;
1091
+ const l = i[a];
1092
+ if (l.r.test(n)) {
1093
+ o = l.s;
1100
1094
  break;
1101
1095
  }
1102
1096
  }
@@ -1118,7 +1112,7 @@ const M = (e, s, n = null) => {
1118
1112
  osVersion: r
1119
1113
  };
1120
1114
  };
1121
- function us() {
1115
+ function ls() {
1122
1116
  const e = navigator.userAgent;
1123
1117
  let s, n = e.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
1124
1118
  if (/trident/i.test(n[1]))
@@ -1136,13 +1130,13 @@ function us() {
1136
1130
  version: n[1]
1137
1131
  };
1138
1132
  }
1139
- const _s = () => {
1140
- const { name: e, version: s } = us();
1133
+ const us = () => {
1134
+ const { name: e, version: s } = ls();
1141
1135
  if (e === "chrome" && parseInt(s) <= 70 || e === "opera" && (!s || parseInt(s.split(".")[0]) < 80) || e === "ie")
1142
1136
  return !1;
1143
- const n = ls(navigator);
1144
- return !cs(n);
1145
- }, fs = async (e) => {
1137
+ const n = cs(navigator);
1138
+ return !as(n);
1139
+ }, _s = async (e) => {
1146
1140
  let s;
1147
1141
  if (e.tokens != null)
1148
1142
  return !1;
@@ -1182,7 +1176,7 @@ const _s = () => {
1182
1176
  });
1183
1177
  const o = P(e.configurationName, n.storage ?? sessionStorage), { tokens: i } = await o.initAsync();
1184
1178
  if (i) {
1185
- e.tokens = X(i, null, n.token_renew_mode);
1179
+ e.tokens = te(i, null, n.token_renew_mode);
1186
1180
  const r = o.getLoginParams();
1187
1181
  e.timeoutId = M(e, e.tokens.expiresAt, r.extras);
1188
1182
  const a = await o.getSessionStateAsync();
@@ -1228,7 +1222,7 @@ const _s = () => {
1228
1222
  search: n,
1229
1223
  hash: t
1230
1224
  };
1231
- }, Ts = (e) => {
1225
+ }, vs = (e) => {
1232
1226
  const s = Ee(e);
1233
1227
  let { path: n } = s;
1234
1228
  n.endsWith("/") && (n = n.slice(0, -1));
@@ -1236,26 +1230,26 @@ const _s = () => {
1236
1230
  return t === "#_=_" && (t = ""), t && (n += t), n;
1237
1231
  }, Y = (e) => {
1238
1232
  const s = Ee(e), { search: n } = s;
1239
- return ds(n);
1240
- }, ds = (e) => {
1233
+ return fs(n);
1234
+ }, fs = (e) => {
1241
1235
  const s = {};
1242
1236
  let n, t, o;
1243
1237
  const i = e.split("&");
1244
1238
  for (t = 0, o = i.length; t < o; t++)
1245
1239
  n = i[t].split("="), s[decodeURIComponent(n[0])] = decodeURIComponent(n[1]);
1246
1240
  return s;
1247
- }, hs = (e, s, n, t, o) => (i = void 0, r = null, a = !1, u = void 0) => {
1241
+ }, ds = (e, s, n, t, o) => (i = void 0, r = null, a = !1, l = void 0) => {
1248
1242
  const f = r;
1249
1243
  return r = { ...r }, (async () => {
1250
1244
  const c = i || o.getPath();
1251
- if ("state" in r || (r.state = se(16)), n(m.loginAsync_begin, {}), r)
1245
+ if ("state" in r || (r.state = ee(16)), n(m.loginAsync_begin, {}), r)
1252
1246
  for (const _ of Object.keys(r))
1253
1247
  _.endsWith(":token_request") && delete r[_];
1254
1248
  try {
1255
1249
  const _ = a ? s.silent_redirect_uri : s.redirect_uri;
1256
- u || (u = s.scope);
1250
+ l || (l = s.scope);
1257
1251
  const d = s.extras ? { ...s.extras, ...r } : r;
1258
- d.nonce || (d.nonce = se(12));
1252
+ d.nonce || (d.nonce = ee(12));
1259
1253
  const y = { nonce: d.nonce }, p = await I(s, e), k = await t(
1260
1254
  s.authority,
1261
1255
  s.authority_configuration
@@ -1270,7 +1264,7 @@ const _s = () => {
1270
1264
  const E = {
1271
1265
  client_id: s.client_id,
1272
1266
  redirect_uri: _,
1273
- scope: u,
1267
+ scope: l,
1274
1268
  response_type: "code",
1275
1269
  ...d
1276
1270
  };
@@ -1282,24 +1276,24 @@ const _s = () => {
1282
1276
  throw n(m.loginAsync_error, _), _;
1283
1277
  }
1284
1278
  })();
1285
- }, ys = (e) => async (s = !1) => {
1279
+ }, hs = (e) => async (s = !1) => {
1286
1280
  try {
1287
1281
  e.publishEvent(m.loginCallbackAsync_begin, {});
1288
1282
  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, a = await e.initAsync(
1289
1283
  i,
1290
1284
  n.authority_configuration
1291
- ), u = e.location.getCurrentHref(), l = Y(u).session_state, c = await I(n, e.configurationName);
1285
+ ), l = e.location.getCurrentHref(), u = Y(l).session_state, c = await I(n, e.configurationName);
1292
1286
  let _, d, y, p;
1293
1287
  if (c)
1294
- await c.initAsync(a, "loginCallbackAsync", n), await c.setSessionStateAsync(l), d = await c.getNonceAsync(), y = c.getLoginParams(), p = await c.getStateAsync(), c.startKeepAliveServiceWorker(), _ = c;
1288
+ await c.initAsync(a, "loginCallbackAsync", n), await c.setSessionStateAsync(u), d = await c.getNonceAsync(), y = c.getLoginParams(), p = await c.getStateAsync(), c.startKeepAliveServiceWorker(), _ = c;
1295
1289
  else {
1296
1290
  const T = P(
1297
1291
  e.configurationName,
1298
1292
  n.storage ?? sessionStorage
1299
1293
  );
1300
- await T.setSessionStateAsync(l), d = await T.getNonceAsync(), y = T.getLoginParams(), p = await T.getStateAsync(), _ = T;
1294
+ await T.setSessionStateAsync(u), d = await T.getNonceAsync(), y = T.getLoginParams(), p = await T.getStateAsync(), _ = T;
1301
1295
  }
1302
- const k = Y(u);
1296
+ const k = Y(l);
1303
1297
  if (k.error || k.error_description)
1304
1298
  throw new Error(`Error from OIDC server: ${k.error} - ${k.error_description}`);
1305
1299
  if (k.iss && k.iss !== a.issuer)
@@ -1371,7 +1365,7 @@ const _s = () => {
1371
1365
  return await e.startCheckSessionAsync(
1372
1366
  a.checkSessionIframe,
1373
1367
  t,
1374
- l,
1368
+ u,
1375
1369
  s
1376
1370
  ), e.publishEvent(m.loginCallbackAsync_end, {}), {
1377
1371
  tokens: A,
@@ -1384,7 +1378,7 @@ const _s = () => {
1384
1378
  }, ye = {
1385
1379
  access_token: "access_token",
1386
1380
  refresh_token: "refresh_token"
1387
- }, Q = (e, s) => {
1381
+ }, z = (e, s) => {
1388
1382
  const n = {};
1389
1383
  if (e) {
1390
1384
  for (const [t, o] of Object.entries(e))
@@ -1395,7 +1389,7 @@ const _s = () => {
1395
1389
  return n;
1396
1390
  }
1397
1391
  return n;
1398
- }, gs = (e) => {
1392
+ }, ys = (e) => {
1399
1393
  const s = {};
1400
1394
  if (e) {
1401
1395
  for (const [n, t] of Object.entries(e))
@@ -1403,30 +1397,30 @@ const _s = () => {
1403
1397
  return s;
1404
1398
  }
1405
1399
  return s;
1406
- }, ks = (e) => async (s) => {
1400
+ }, gs = (e) => async (s) => {
1407
1401
  K.clearTimeout(e.timeoutId), e.timeoutId = null, e.checkSessionIFrame && e.checkSessionIFrame.stop();
1408
1402
  const n = await I(e.configuration, e.configurationName);
1409
1403
  n ? await n.clearAsync(s) : await P(e.configurationName, e.configuration.storage).clearAsync(s), e.tokens = null, e.userInfo = null;
1410
- }, ms = (e, s, n, t, o) => async (i = void 0, r = null) => {
1404
+ }, ks = (e, s, n, t, o) => async (i = void 0, r = null) => {
1411
1405
  var b, E;
1412
- const a = e.configuration, u = await e.initAsync(
1406
+ const a = e.configuration, l = await e.initAsync(
1413
1407
  a.authority,
1414
1408
  a.authority_configuration
1415
1409
  );
1416
1410
  i && typeof i != "string" && (i = void 0, t.warn("callbackPathOrUrl path is not a string"));
1417
1411
  const f = i ?? o.getPath();
1418
- let l = !1;
1419
- i && (l = i.includes("https://") || i.includes("http://"));
1420
- const c = l ? i : o.getOrigin() + f, _ = e.tokens ? e.tokens.idToken : "";
1412
+ let u = !1;
1413
+ i && (u = i.includes("https://") || i.includes("http://"));
1414
+ const c = u ? i : o.getOrigin() + f, _ = e.tokens ? e.tokens.idToken : "";
1421
1415
  try {
1422
- const w = u.revocationEndpoint;
1416
+ const w = l.revocationEndpoint;
1423
1417
  if (w) {
1424
1418
  const v = [], h = e.tokens ? e.tokens.accessToken : null;
1425
1419
  if (h && a.logout_tokens_to_invalidate.includes(ye.access_token)) {
1426
- const A = Q(r, ":revoke_access_token"), S = de(n)(
1420
+ const A = z(r, ":revoke_access_token"), S = de(n)(
1427
1421
  w,
1428
1422
  h,
1429
- ne.access_token,
1423
+ se.access_token,
1430
1424
  a.client_id,
1431
1425
  A
1432
1426
  );
@@ -1434,10 +1428,10 @@ const _s = () => {
1434
1428
  }
1435
1429
  const g = e.tokens ? e.tokens.refreshToken : null;
1436
1430
  if (g && a.logout_tokens_to_invalidate.includes(ye.refresh_token)) {
1437
- const A = Q(r, ":revoke_refresh_token"), S = de(n)(
1431
+ const A = z(r, ":revoke_refresh_token"), S = de(n)(
1438
1432
  w,
1439
1433
  g,
1440
- ne.refresh_token,
1434
+ se.refresh_token,
1441
1435
  a.client_id,
1442
1436
  A
1443
1437
  );
@@ -1454,43 +1448,43 @@ const _s = () => {
1454
1448
  await e.destroyAsync("LOGGED_OUT");
1455
1449
  for (const [, w] of Object.entries(s))
1456
1450
  w !== e ? await e.logoutSameTabAsync(e.configuration.client_id, d) : e.publishEvent(m.logout_from_same_tab, {});
1457
- const y = Q(r, ":oidc");
1451
+ const y = z(r, ":oidc");
1458
1452
  if (y && y.no_reload === "true")
1459
1453
  return;
1460
- const k = gs(r);
1461
- if (u.endSessionEndpoint) {
1454
+ const k = ys(r);
1455
+ if (l.endSessionEndpoint) {
1462
1456
  "id_token_hint" in k || (k.id_token_hint = _), !("post_logout_redirect_uri" in k) && i !== null && (k.post_logout_redirect_uri = c);
1463
1457
  let w = "";
1464
1458
  for (const [v, h] of Object.entries(k))
1465
1459
  h != null && (w === "" ? w += "?" : w += "&", w += `${v}=${encodeURIComponent(h)}`);
1466
- o.open(`${u.endSessionEndpoint}${w}`);
1460
+ o.open(`${l.endSessionEndpoint}${w}`);
1467
1461
  } else
1468
1462
  o.reload();
1469
1463
  }, Oe = (e, s, n = !1) => async (...t) => {
1470
1464
  var d;
1471
1465
  const [o, i, ...r] = t, a = i ? { ...i } : { method: "GET" };
1472
- let u = new Headers();
1473
- a.headers && (u = a.headers instanceof Headers ? a.headers : new Headers(a.headers));
1466
+ let l = new Headers();
1467
+ a.headers && (l = a.headers instanceof Headers ? a.headers : new Headers(a.headers));
1474
1468
  const f = {
1475
1469
  tokens: s.tokens,
1476
1470
  configuration: { token_automatic_renew_mode: s.configuration.token_automatic_renew_mode },
1477
1471
  renewTokensAsync: s.renewTokensAsync.bind(s)
1478
- }, l = await ke(f), c = (d = l == null ? void 0 : l.tokens) == null ? void 0 : d.accessToken;
1479
- if (u.has("Accept") || u.set("Accept", "application/json"), c) {
1472
+ }, u = await ke(f), c = (d = u == null ? void 0 : u.tokens) == null ? void 0 : d.accessToken;
1473
+ if (l.has("Accept") || l.set("Accept", "application/json"), c) {
1480
1474
  if (s.configuration.demonstrating_proof_of_possession && n) {
1481
1475
  const y = await s.generateDemonstrationOfProofOfPossessionAsync(
1482
1476
  c,
1483
1477
  o.toString(),
1484
1478
  a.method
1485
1479
  );
1486
- u.set("Authorization", `PoP ${c}`), u.set("DPoP", y);
1480
+ l.set("Authorization", `PoP ${c}`), l.set("DPoP", y);
1487
1481
  } else
1488
- u.set("Authorization", `Bearer ${c}`);
1482
+ l.set("Authorization", `Bearer ${c}`);
1489
1483
  a.credentials || (a.credentials = "same-origin");
1490
1484
  }
1491
- const _ = { ...a, headers: u };
1485
+ const _ = { ...a, headers: l };
1492
1486
  return await e(o, _, ...r);
1493
- }, ps = (e) => async (s = !1, n = !1) => {
1487
+ }, ms = (e) => async (s = !1, n = !1) => {
1494
1488
  if (e.userInfo != null && !s)
1495
1489
  return e.userInfo;
1496
1490
  const t = e.configuration, i = (await e.initAsync(
@@ -1501,16 +1495,16 @@ const _s = () => {
1501
1495
  return f.status !== 200 ? null : f.json();
1502
1496
  })();
1503
1497
  return e.userInfo = a, a;
1504
- }, ws = () => fetch;
1505
- class te {
1498
+ }, ps = () => fetch;
1499
+ class ne {
1506
1500
  constructor(s) {
1507
1501
  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;
1508
1502
  }
1509
1503
  }
1510
- const x = {}, As = (e, s = new q()) => (n, t = "default") => (x[t] || (x[t] = new C(n, t, e, s)), x[t]), Ss = async (e) => {
1504
+ const x = {}, ws = (e, s = new q()) => (n, t = "default") => (x[t] || (x[t] = new C(n, t, e, s)), x[t]), As = async (e) => {
1511
1505
  const { parsedTokens: s, callbackPath: n } = await e.loginCallbackAsync();
1512
1506
  return e.timeoutId = M(e, s.expiresAt), { callbackPath: n };
1513
- }, vs = (e) => Math.floor(Math.random() * e), V = class V {
1507
+ }, Ss = (e) => Math.floor(Math.random() * e), V = class V {
1514
1508
  constructor(s, n = "default", t, o = new q()) {
1515
1509
  this.initPromise = null, this.tryKeepExistingSessionPromise = null, this.loginPromise = null, this.loginCallbackPromise = null, this.loginCallbackWithAutoTokensRenewPromise = null, this.userInfoPromise = null, this.renewTokensPromise = null, this.logoutPromise = null;
1516
1510
  let i = s.silent_login_uri;
@@ -1525,7 +1519,7 @@ const x = {}, As = (e, s = new q()) => (n, t = "default") => (x[t] || (x[t] = ne
1525
1519
  monitor_session: s.monitor_session ?? !1,
1526
1520
  refresh_time_before_tokens_expiration_in_second: r,
1527
1521
  silent_login_timeout: s.silent_login_timeout ?? 12e3,
1528
- token_renew_mode: s.token_renew_mode ?? Z.access_token_or_id_token_invalid,
1522
+ token_renew_mode: s.token_renew_mode ?? Q.access_token_or_id_token_invalid,
1529
1523
  demonstrating_proof_of_possession: s.demonstrating_proof_of_possession ?? !1,
1530
1524
  authority_timeout_wellknowurl_in_millisecond: s.authority_timeout_wellknowurl_in_millisecond ?? 1e4,
1531
1525
  logout_tokens_to_invalidate: s.logout_tokens_to_invalidate ?? [
@@ -1533,13 +1527,13 @@ const x = {}, As = (e, s = new q()) => (n, t = "default") => (x[t] || (x[t] = ne
1533
1527
  "refresh_token"
1534
1528
  ],
1535
1529
  service_worker_update_require_callback: a,
1536
- service_worker_activate: s.service_worker_activate ?? _s,
1530
+ service_worker_activate: s.service_worker_activate ?? us,
1537
1531
  demonstrating_proof_of_possession_configuration: s.demonstrating_proof_of_possession_configuration ?? Fe,
1538
1532
  preload_user_info: s.preload_user_info ?? !1
1539
- }, this.getFetch = t ?? ws, 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
+ }, this.getFetch = t ?? ps, 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);
1540
1534
  }
1541
1535
  subscribeEvents(s) {
1542
- const n = vs(9999999999999).toString();
1536
+ const n = Ss(9999999999999).toString();
1543
1537
  return this.events.push({ id: n, func: s }), n;
1544
1538
  }
1545
1539
  removeEventSubscription(s) {
@@ -1591,7 +1585,7 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1591
1585
  return this.initPromise;
1592
1586
  const t = async () => {
1593
1587
  if (n != null)
1594
- return new te({
1588
+ return new ne({
1595
1589
  authorization_endpoint: n.authorization_endpoint,
1596
1590
  end_session_endpoint: n.end_session_endpoint,
1597
1591
  revocation_endpoint: n.revocation_endpoint,
@@ -1613,12 +1607,12 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1613
1607
  });
1614
1608
  }
1615
1609
  async tryKeepExistingSessionAsync() {
1616
- return this.tryKeepExistingSessionPromise !== null ? this.tryKeepExistingSessionPromise : (this.tryKeepExistingSessionPromise = fs(this), this.tryKeepExistingSessionPromise.finally(() => {
1610
+ return this.tryKeepExistingSessionPromise !== null ? this.tryKeepExistingSessionPromise : (this.tryKeepExistingSessionPromise = _s(this), this.tryKeepExistingSessionPromise.finally(() => {
1617
1611
  this.tryKeepExistingSessionPromise = null;
1618
1612
  }));
1619
1613
  }
1620
1614
  async startCheckSessionAsync(s, n, t, o = !1) {
1621
- await as(this, x, this.configuration)(
1615
+ await rs(this, x, this.configuration)(
1622
1616
  s,
1623
1617
  n,
1624
1618
  t,
@@ -1626,13 +1620,13 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1626
1620
  );
1627
1621
  }
1628
1622
  async loginAsync(s = void 0, n = null, t = !1, o = void 0, i = !1) {
1629
- return this.logoutPromise && await this.logoutPromise, this.loginPromise !== null ? this.loginPromise : i ? rs(
1623
+ return this.logoutPromise && await this.logoutPromise, this.loginPromise !== null ? this.loginPromise : i ? is(
1630
1624
  window,
1631
1625
  this.configurationName,
1632
1626
  this.configuration,
1633
1627
  this.publishEvent.bind(this),
1634
1628
  this
1635
- )(n, o) : (this.loginPromise = hs(
1629
+ )(n, o) : (this.loginPromise = ds(
1636
1630
  this.configurationName,
1637
1631
  this.configuration,
1638
1632
  this.publishEvent.bind(this),
@@ -1646,7 +1640,7 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1646
1640
  if (this.loginCallbackPromise !== null)
1647
1641
  return this.loginCallbackPromise;
1648
1642
  const n = async () => {
1649
- const t = await ys(this)(s), o = t.tokens;
1643
+ const t = await hs(this)(s), o = t.tokens;
1650
1644
  return this.tokens = o, await I(this.configuration, this.configurationName) || P(this.configurationName, this.configuration.storage).setTokens(o), this.publishEvent(V.eventNames.token_acquired, o), this.configuration.preload_user_info && await this.userInfoAsync(), { parsedTokens: o, state: t.state, callbackPath: t.callbackPath };
1651
1645
  };
1652
1646
  return this.loginCallbackPromise = n(), this.loginCallbackPromise.finally(() => {
@@ -1660,18 +1654,18 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1660
1654
  };
1661
1655
  if (await I(i, this.configurationName))
1662
1656
  return `DPOP_SECURED_BY_OIDC_SERVICE_WORKER_${this.configurationName}`;
1663
- const u = P(this.configurationName, i.storage), f = await u.getDemonstratingProofOfPossessionJwkAsync(), l = u.getDemonstratingProofOfPossessionNonce();
1664
- return l && (r.nonce = l), await Se(window)(
1657
+ const l = P(this.configurationName, i.storage), f = await l.getDemonstratingProofOfPossessionJwkAsync(), u = l.getDemonstratingProofOfPossessionNonce();
1658
+ return u && (r.nonce = u), await Se(window)(
1665
1659
  i.demonstrating_proof_of_possession_configuration
1666
1660
  )(f, t, n, r);
1667
1661
  }
1668
1662
  loginCallbackWithAutoTokensRenewAsync() {
1669
- return this.loginCallbackWithAutoTokensRenewPromise !== null ? this.loginCallbackWithAutoTokensRenewPromise : (this.loginCallbackWithAutoTokensRenewPromise = Ss(this), this.loginCallbackWithAutoTokensRenewPromise.finally(() => {
1663
+ return this.loginCallbackWithAutoTokensRenewPromise !== null ? this.loginCallbackWithAutoTokensRenewPromise : (this.loginCallbackWithAutoTokensRenewPromise = As(this), this.loginCallbackWithAutoTokensRenewPromise.finally(() => {
1670
1664
  this.loginCallbackWithAutoTokensRenewPromise = null;
1671
1665
  }));
1672
1666
  }
1673
1667
  userInfoAsync(s = !1, n = !1) {
1674
- return this.userInfoPromise !== null ? this.userInfoPromise : (this.userInfoPromise = ps(this)(s, n), this.userInfoPromise.finally(() => {
1668
+ return this.userInfoPromise !== null ? this.userInfoPromise : (this.userInfoPromise = ms(this)(s, n), this.userInfoPromise.finally(() => {
1675
1669
  this.userInfoPromise = null;
1676
1670
  }));
1677
1671
  }
@@ -1684,7 +1678,7 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1684
1678
  });
1685
1679
  }
1686
1680
  async destroyAsync(s) {
1687
- return await ks(this)(s);
1681
+ return await gs(this)(s);
1688
1682
  }
1689
1683
  async logoutSameTabAsync(s, n) {
1690
1684
  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_same_tab, { mmessage: "SessionMonitor", sub: n }));
@@ -1693,7 +1687,7 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1693
1687
  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 }));
1694
1688
  }
1695
1689
  async logoutAsync(s = void 0, n = null) {
1696
- return this.logoutPromise ? this.logoutPromise : (this.logoutPromise = ms(
1690
+ return this.logoutPromise ? this.logoutPromise : (this.logoutPromise = ks(
1697
1691
  this,
1698
1692
  x,
1699
1693
  this.getFetch(),
@@ -1704,7 +1698,7 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1704
1698
  }));
1705
1699
  }
1706
1700
  };
1707
- V.getOrCreate = (s, n) => (t, o = "default") => As(s, n)(t, o), V.eventNames = m;
1701
+ V.getOrCreate = (s, n) => (t, o = "default") => ws(s, n)(t, o), V.eventNames = m;
1708
1702
  let C = V;
1709
1703
  const $ = class $ {
1710
1704
  constructor(s) {
@@ -1773,8 +1767,8 @@ export {
1773
1767
  ge as OidcClient,
1774
1768
  q as OidcLocation,
1775
1769
  J as TokenAutomaticRenewMode,
1776
- Z as TokenRenewMode,
1777
- ws as getFetchDefault,
1770
+ Q as TokenRenewMode,
1771
+ ps as getFetchDefault,
1778
1772
  Y as getParseQueryStringFromLocation,
1779
- Ts as getPath
1773
+ vs as getPath
1780
1774
  };