@axa-fr/oidc-client 7.4.1 → 7.5.1

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