zudoku 0.3.1-dev.17 → 0.3.1-dev.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist/lib/authentication/components/CallbackHandler.js +2 -1
  2. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  3. package/dist/lib/authentication/providers/auth0.js +19 -0
  4. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  5. package/lib/{OperationList-DA1JffOY.js → OperationList-CZiSz5JH.js} +3 -3
  6. package/lib/{OperationList-DA1JffOY.js.map → OperationList-CZiSz5JH.js.map} +1 -1
  7. package/lib/{Route-DjCjfuk3.js → Route-Cle-r-bq.js} +2 -2
  8. package/lib/{Route-DjCjfuk3.js.map → Route-Cle-r-bq.js.map} +1 -1
  9. package/lib/{Spinner-BxpiCVtl.js → SidebarBadge-Ba0PhibA.js} +65 -75
  10. package/lib/SidebarBadge-Ba0PhibA.js.map +1 -0
  11. package/lib/Spinner-CvXZ7QK4.js +15 -0
  12. package/lib/Spinner-CvXZ7QK4.js.map +1 -0
  13. package/lib/{index-COKIoyh6.js → index-Br1MQPxy.js} +14 -13
  14. package/lib/{index-COKIoyh6.js.map → index-Br1MQPxy.js.map} +1 -1
  15. package/lib/{index-CKQG-w6R.js → index-DCJ9wEIV.js} +2 -2
  16. package/lib/{index-CKQG-w6R.js.map → index-DCJ9wEIV.js.map} +1 -1
  17. package/lib/zudoku.auth-auth0.js +32 -18
  18. package/lib/zudoku.auth-auth0.js.map +1 -1
  19. package/lib/zudoku.auth-openid.js +123 -122
  20. package/lib/zudoku.auth-openid.js.map +1 -1
  21. package/lib/zudoku.components.js +16 -15
  22. package/lib/zudoku.components.js.map +1 -1
  23. package/lib/zudoku.plugin-openapi.js +1 -1
  24. package/package.json +1 -1
  25. package/src/lib/authentication/components/CallbackHandler.tsx +6 -1
  26. package/src/lib/authentication/providers/auth0.tsx +27 -1
  27. package/lib/Spinner-BxpiCVtl.js.map +0 -1
@@ -1,14 +1,15 @@
1
1
  var xe = Object.defineProperty;
2
2
  var Le = (t, e, n) => e in t ? xe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
3
  var y = (t, e, n) => Le(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { j as P } from "./jsx-runtime-B6kdoens.js";
4
+ import { j as k } from "./jsx-runtime-B6kdoens.js";
5
5
  import { c as Ce, a as Ie } from "./_commonjsHelpers-BVfed4GL.js";
6
6
  import { A as je } from "./AuthenticationPlugin-owbEUimP.js";
7
7
  import { useState as ze, useRef as Je, useEffect as Oe } from "react";
8
8
  import { D as Ne } from "./DeveloperHint-BQSFXH01.js";
9
9
  import { E as De } from "./ErrorPage-PUg985n_.js";
10
- import { S as Ke } from "./Markdown-Chb9VIBv.js";
11
- import { e as We } from "./index-Yjb2PyPF.js";
10
+ import { S as Ke } from "./Spinner-CvXZ7QK4.js";
11
+ import { S as We } from "./Markdown-Chb9VIBv.js";
12
+ import { e as He } from "./index-Yjb2PyPF.js";
12
13
  import { u as N } from "./state-DsXXkBLH.js";
13
14
  var fe = { exports: {} };
14
15
  (function(t) {
@@ -57,7 +58,7 @@ var fe = { exports: {} };
57
58
  function f(l, w, c) {
58
59
  return m(l) || _.apply(this, arguments);
59
60
  }
60
- function A(l, w) {
61
+ function R(l, w) {
61
62
  var c = this, J, B, U, v = "loglevel";
62
63
  typeof l == "string" ? v += ":" + l : typeof l == "symbol" && (v = void 0);
63
64
  function Re(d) {
@@ -139,25 +140,25 @@ var fe = { exports: {} };
139
140
  var oe = re();
140
141
  oe != null && (U = L(oe)), b.call(c);
141
142
  }
142
- i = new A(), i.getLogger = function(w) {
143
+ i = new R(), i.getLogger = function(w) {
143
144
  if (typeof w != "symbol" && typeof w != "string" || w === "")
144
145
  throw new TypeError("You must supply a name when creating a logger.");
145
146
  var c = r[w];
146
- return c || (c = r[w] = new A(
147
+ return c || (c = r[w] = new R(
147
148
  w,
148
149
  i.methodFactory
149
150
  )), c;
150
151
  };
151
- var R = typeof window !== n ? window.log : void 0;
152
+ var P = typeof window !== n ? window.log : void 0;
152
153
  return i.noConflict = function() {
153
- return typeof window !== n && window.log === i && (window.log = R), i;
154
+ return typeof window !== n && window.log === i && (window.log = P), i;
154
155
  }, i.getLoggers = function() {
155
156
  return r;
156
157
  }, i.default = i, i;
157
158
  });
158
159
  })(fe);
159
- var He = fe.exports;
160
- const K = /* @__PURE__ */ Ie(He);
160
+ var $e = fe.exports;
161
+ const K = /* @__PURE__ */ Ie($e);
161
162
  let Y;
162
163
  var D, he;
163
164
  (typeof navigator > "u" || !((he = (D = navigator.userAgent) == null ? void 0 : D.startsWith) != null && he.call(D, "Mozilla/5.0 "))) && (Y = "oauth4webapi/v2.11.1");
@@ -170,19 +171,19 @@ function Q(t, e) {
170
171
  return !1;
171
172
  }
172
173
  }
173
- const H = Symbol(), $e = Symbol(), X = Symbol(), Fe = new TextEncoder(), Me = new TextDecoder();
174
- function k(t) {
175
- return typeof t == "string" ? Fe.encode(t) : Me.decode(t);
174
+ const H = Symbol(), Fe = Symbol(), X = Symbol(), Me = new TextEncoder(), Be = new TextDecoder();
175
+ function A(t) {
176
+ return typeof t == "string" ? Me.encode(t) : Be.decode(t);
176
177
  }
177
178
  const se = 32768;
178
- function Be(t) {
179
+ function qe(t) {
179
180
  t instanceof ArrayBuffer && (t = new Uint8Array(t));
180
181
  const e = [];
181
182
  for (let n = 0; n < t.byteLength; n += se)
182
183
  e.push(String.fromCharCode.apply(null, t.subarray(n, n + se)));
183
184
  return btoa(e.join("")).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
184
185
  }
185
- function qe(t) {
186
+ function Ge(t) {
186
187
  try {
187
188
  const e = atob(t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "")), n = new Uint8Array(e.length);
188
189
  for (let o = 0; o < e.length; o++)
@@ -193,9 +194,9 @@ function qe(t) {
193
194
  }
194
195
  }
195
196
  function E(t) {
196
- return typeof t == "string" ? qe(t) : Be(t);
197
+ return typeof t == "string" ? Ge(t) : qe(t);
197
198
  }
198
- class Ge {
199
+ class Ve {
199
200
  constructor(e) {
200
201
  this.cache = /* @__PURE__ */ new Map(), this._cache = /* @__PURE__ */ new Map(), this.maxSize = e;
201
202
  }
@@ -225,20 +226,20 @@ class S extends Error {
225
226
  super(e ?? "operation not supported"), this.name = this.constructor.name, (n = Error.captureStackTrace) == null || n.call(Error, this, this.constructor);
226
227
  }
227
228
  }
228
- class Ve extends Error {
229
+ class Ye extends Error {
229
230
  constructor(e, n) {
230
231
  var o;
231
232
  super(e, n), this.name = this.constructor.name, (o = Error.captureStackTrace) == null || o.call(Error, this, this.constructor);
232
233
  }
233
234
  }
234
- const a = Ve, pe = new Ge(100);
235
+ const a = Ye, pe = new Ve(100);
235
236
  function we(t) {
236
237
  return t instanceof CryptoKey;
237
238
  }
238
239
  function ge(t) {
239
240
  return we(t) && t.type === "private";
240
241
  }
241
- function Ye(t) {
242
+ function Ze(t) {
242
243
  return we(t) && t.type === "public";
243
244
  }
244
245
  function ee(t) {
@@ -266,7 +267,7 @@ function te(t) {
266
267
  throw new TypeError('"options.signal" must return or be an instance of AbortSignal');
267
268
  return t;
268
269
  }
269
- async function Ze(t, e) {
270
+ async function Qe(t, e) {
270
271
  if (!(t instanceof URL))
271
272
  throw new TypeError('"issuerIdentifier" must be an instance of URL');
272
273
  if (t.protocol !== "https:" && t.protocol !== "http:")
@@ -294,7 +295,7 @@ async function Ze(t, e) {
294
295
  function p(t) {
295
296
  return typeof t == "string" && t.length !== 0;
296
297
  }
297
- async function Qe(t, e) {
298
+ async function Xe(t, e) {
298
299
  if (!(t instanceof URL))
299
300
  throw new TypeError('"expectedIssuer" must be an instance of URL');
300
301
  if (!Q(e, Response))
@@ -319,18 +320,18 @@ async function Qe(t, e) {
319
320
  function F() {
320
321
  return E(crypto.getRandomValues(new Uint8Array(32)));
321
322
  }
322
- function Xe() {
323
+ function et() {
323
324
  return F();
324
325
  }
325
- function et() {
326
+ function tt() {
326
327
  return F();
327
328
  }
328
- async function tt(t) {
329
+ async function nt(t) {
329
330
  if (!p(t))
330
331
  throw new TypeError('"codeVerifier" must be a non-empty string');
331
- return E(await crypto.subtle.digest("SHA-256", k(t)));
332
+ return E(await crypto.subtle.digest("SHA-256", A(t)));
332
333
  }
333
- function nt(t) {
334
+ function rt(t) {
334
335
  if (t instanceof CryptoKey)
335
336
  return { key: t };
336
337
  if (!((t == null ? void 0 : t.key) instanceof CryptoKey))
@@ -342,11 +343,11 @@ function nt(t) {
342
343
  function ae(t) {
343
344
  return encodeURIComponent(t).replace(/%20/g, "+");
344
345
  }
345
- function rt(t, e) {
346
+ function ot(t, e) {
346
347
  const n = ae(t), o = ae(e);
347
348
  return `Basic ${btoa(`${n}:${o}`)}`;
348
349
  }
349
- function ot(t) {
350
+ function it(t) {
350
351
  switch (t.algorithm.hash.name) {
351
352
  case "SHA-256":
352
353
  return "PS256";
@@ -358,7 +359,7 @@ function ot(t) {
358
359
  throw new S("unsupported RsaHashedKeyAlgorithm hash name");
359
360
  }
360
361
  }
361
- function it(t) {
362
+ function st(t) {
362
363
  switch (t.algorithm.hash.name) {
363
364
  case "SHA-256":
364
365
  return "RS256";
@@ -370,7 +371,7 @@ function it(t) {
370
371
  throw new S("unsupported RsaHashedKeyAlgorithm hash name");
371
372
  }
372
373
  }
373
- function st(t) {
374
+ function at(t) {
374
375
  switch (t.algorithm.namedCurve) {
375
376
  case "P-256":
376
377
  return "ES256";
@@ -385,11 +386,11 @@ function st(t) {
385
386
  function me(t) {
386
387
  switch (t.algorithm.name) {
387
388
  case "RSA-PSS":
388
- return ot(t);
389
- case "RSASSA-PKCS1-v1_5":
390
389
  return it(t);
391
- case "ECDSA":
390
+ case "RSASSA-PKCS1-v1_5":
392
391
  return st(t);
392
+ case "ECDSA":
393
+ return at(t);
393
394
  case "Ed25519":
394
395
  case "Ed448":
395
396
  return "EdDSA";
@@ -402,13 +403,13 @@ function I(t) {
402
403
  return typeof e == "number" && Number.isFinite(e) ? e : 0;
403
404
  }
404
405
  function ye(t) {
405
- const e = t == null ? void 0 : t[$e];
406
+ const e = t == null ? void 0 : t[Fe];
406
407
  return typeof e == "number" && Number.isFinite(e) && Math.sign(e) !== -1 ? e : 30;
407
408
  }
408
409
  function M() {
409
410
  return Math.floor(Date.now() / 1e3);
410
411
  }
411
- function at(t, e) {
412
+ function ct(t, e) {
412
413
  const n = M() + I(e);
413
414
  return {
414
415
  jti: F(),
@@ -420,11 +421,11 @@ function at(t, e) {
420
421
  sub: e.client_id
421
422
  };
422
423
  }
423
- async function ct(t, e, n, o) {
424
+ async function ut(t, e, n, o) {
424
425
  return be({
425
426
  alg: me(n),
426
427
  kid: o
427
- }, at(t, e), n);
428
+ }, ct(t, e), n);
428
429
  }
429
430
  function j(t) {
430
431
  if (typeof t != "object" || t === null)
@@ -453,11 +454,11 @@ function ue(t, e) {
453
454
  if (e !== void 0)
454
455
  throw new TypeError(`"client.client_secret" property must not be provided when ${t} client authentication method is used.`);
455
456
  }
456
- async function ut(t, e, n, o, s) {
457
+ async function lt(t, e, n, o, s) {
457
458
  switch (n.delete("client_secret"), n.delete("client_assertion_type"), n.delete("client_assertion"), e.token_endpoint_auth_method) {
458
459
  case void 0:
459
460
  case "client_secret_basic": {
460
- q("client_secret_basic", s), o.set("authorization", rt(e.client_id, ce(e.client_secret)));
461
+ q("client_secret_basic", s), o.set("authorization", ot(e.client_id, ce(e.client_secret)));
461
462
  break;
462
463
  }
463
464
  case "client_secret_post": {
@@ -467,10 +468,10 @@ async function ut(t, e, n, o, s) {
467
468
  case "private_key_jwt": {
468
469
  if (ue("private_key_jwt", e.client_secret), s === void 0)
469
470
  throw new TypeError('"options.clientPrivateKey" must be provided when "client.token_endpoint_auth_method" is "private_key_jwt"');
470
- const { key: r, kid: i } = nt(s);
471
+ const { key: r, kid: i } = rt(s);
471
472
  if (!ge(r))
472
473
  throw new TypeError('"options.clientPrivateKey.key" must be a private CryptoKey');
473
- n.set("client_id", e.client_id), n.set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), n.set("client_assertion", await ct(t, e, r, i));
474
+ n.set("client_id", e.client_id), n.set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), n.set("client_assertion", await ut(t, e, r, i));
474
475
  break;
475
476
  }
476
477
  case "tls_client_auth":
@@ -486,14 +487,14 @@ async function ut(t, e, n, o, s) {
486
487
  async function be(t, e, n) {
487
488
  if (!n.usages.includes("sign"))
488
489
  throw new TypeError('CryptoKey instances used for signing assertions must include "sign" in their "usages"');
489
- const o = `${E(k(JSON.stringify(t)))}.${E(k(JSON.stringify(e)))}`, s = E(await crypto.subtle.sign(ke(n), n, k(o)));
490
+ const o = `${E(A(JSON.stringify(t)))}.${E(A(JSON.stringify(e)))}`, s = E(await crypto.subtle.sign(ke(n), n, A(o)));
490
491
  return `${o}.${s}`;
491
492
  }
492
- async function lt(t, e, n, o, s, r) {
493
+ async function dt(t, e, n, o, s, r) {
493
494
  const { privateKey: i, publicKey: u, nonce: h = pe.get(n.origin) } = e;
494
495
  if (!ge(i))
495
496
  throw new TypeError('"DPoP.privateKey" must be a private CryptoKey');
496
- if (!Ye(u))
497
+ if (!Ze(u))
497
498
  throw new TypeError('"DPoP.publicKey" must be a public CryptoKey');
498
499
  if (h !== void 0 && !p(h))
499
500
  throw new TypeError('"DPoP.nonce" must be a non-empty string or undefined');
@@ -502,43 +503,43 @@ async function lt(t, e, n, o, s, r) {
502
503
  const m = M() + s, b = await be({
503
504
  alg: me(i),
504
505
  typ: "dpop+jwt",
505
- jwk: await ht(u)
506
+ jwk: await ft(u)
506
507
  }, {
507
508
  iat: m,
508
509
  jti: F(),
509
510
  htm: o,
510
511
  nonce: h,
511
512
  htu: `${n.origin}${n.pathname}`,
512
- ath: r ? E(await crypto.subtle.digest("SHA-256", k(r))) : void 0
513
+ ath: r ? E(await crypto.subtle.digest("SHA-256", A(r))) : void 0
513
514
  }, i);
514
515
  t.set("dpop", b);
515
516
  }
516
517
  let W;
517
- async function dt(t) {
518
+ async function ht(t) {
518
519
  const { kty: e, e: n, n: o, x: s, y: r, crv: i } = await crypto.subtle.exportKey("jwk", t), u = { kty: e, e: n, n: o, x: s, y: r, crv: i };
519
520
  return W.set(t, u), u;
520
521
  }
521
- async function ht(t) {
522
- return W || (W = /* @__PURE__ */ new WeakMap()), W.get(t) || dt(t);
522
+ async function ft(t) {
523
+ return W || (W = /* @__PURE__ */ new WeakMap()), W.get(t) || ht(t);
523
524
  }
524
- function ft(t, e, n) {
525
+ function pt(t, e, n) {
525
526
  if (typeof t != "string")
526
527
  throw new TypeError(`"as.${e}" must be a string`);
527
528
  return new URL(t);
528
529
  }
529
530
  function _e(t, e, n) {
530
- return ft(t[e], e);
531
+ return pt(t[e], e);
531
532
  }
532
533
  function Z(t) {
533
534
  const e = t;
534
535
  return typeof e != "object" || Array.isArray(e) || e === null ? !1 : e.error !== void 0;
535
536
  }
536
- async function pt(t, e, n, o, s, r) {
537
+ async function wt(t, e, n, o, s, r) {
537
538
  if (!p(t))
538
539
  throw new TypeError('"accessToken" must be a non-empty string');
539
540
  if (!(n instanceof URL))
540
541
  throw new TypeError('"url" must be an instance of URL');
541
- return o = $(o), (r == null ? void 0 : r.DPoP) === void 0 ? o.set("authorization", `Bearer ${t}`) : (await lt(o, r.DPoP, n, "GET", I({ [H]: r == null ? void 0 : r[H] }), t), o.set("authorization", `DPoP ${t}`)), ((r == null ? void 0 : r[X]) || fetch)(n.href, {
542
+ return o = $(o), (r == null ? void 0 : r.DPoP) === void 0 ? o.set("authorization", `Bearer ${t}`) : (await dt(o, r.DPoP, n, "GET", I({ [H]: r == null ? void 0 : r[H] }), t), o.set("authorization", `DPoP ${t}`)), ((r == null ? void 0 : r[X]) || fetch)(n.href, {
542
543
  body: s,
543
544
  headers: Object.fromEntries(o.entries()),
544
545
  method: e,
@@ -546,16 +547,16 @@ async function pt(t, e, n, o, s, r) {
546
547
  signal: r != null && r.signal ? te(r.signal) : null
547
548
  }).then(ee);
548
549
  }
549
- async function wt(t, e, n, o) {
550
+ async function gt(t, e, n, o) {
550
551
  j(t), z(e);
551
552
  const s = _e(t, "userinfo_endpoint"), r = $(o == null ? void 0 : o.headers);
552
- return e.userinfo_signed_response_alg ? r.set("accept", "application/jwt") : (r.set("accept", "application/json"), r.append("accept", "application/jwt")), pt(n, "GET", s, r, null, {
553
+ return e.userinfo_signed_response_alg ? r.set("accept", "application/jwt") : (r.set("accept", "application/json"), r.append("accept", "application/jwt")), wt(n, "GET", s, r, null, {
553
554
  ...o,
554
555
  [H]: I(e)
555
556
  });
556
557
  }
557
- async function gt(t, e, n, o, s, r, i) {
558
- return await ut(t, e, s, r, i == null ? void 0 : i.clientPrivateKey), r.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"), ((i == null ? void 0 : i[X]) || fetch)(o.href, {
558
+ async function mt(t, e, n, o, s, r, i) {
559
+ return await lt(t, e, s, r, i == null ? void 0 : i.clientPrivateKey), r.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"), ((i == null ? void 0 : i[X]) || fetch)(o.href, {
559
560
  body: s,
560
561
  headers: Object.fromEntries(r.entries()),
561
562
  method: n,
@@ -567,16 +568,16 @@ async function ve(t, e, n, o, s) {
567
568
  const r = _e(t, "token_endpoint");
568
569
  o.set("grant_type", n);
569
570
  const i = $(s == null ? void 0 : s.headers);
570
- return i.set("accept", "application/json"), gt(t, e, "POST", r, o, i, s);
571
+ return i.set("accept", "application/json"), mt(t, e, "POST", r, o, i, s);
571
572
  }
572
- async function mt(t, e, n, o) {
573
+ async function yt(t, e, n, o) {
573
574
  if (j(t), z(e), !p(n))
574
575
  throw new TypeError('"refreshToken" must be a non-empty string');
575
576
  const s = new URLSearchParams(o == null ? void 0 : o.additionalParameters);
576
577
  return s.set("refresh_token", n), ve(t, e, "refresh_token", s, o);
577
578
  }
578
579
  const Se = /* @__PURE__ */ new WeakMap();
579
- function yt(t) {
580
+ function bt(t) {
580
581
  if (!t.id_token)
581
582
  return;
582
583
  const e = Se.get(t);
@@ -589,7 +590,7 @@ async function Te(t, e, n, o = !1, s = !1) {
589
590
  throw new TypeError('"response" must be an instance of Response');
590
591
  if (n.status !== 200) {
591
592
  let i;
592
- if (i = await Pt(n))
593
+ if (i = await Ut(n))
593
594
  return i;
594
595
  throw new a('"response" is not a conform Token Endpoint response');
595
596
  }
@@ -618,7 +619,7 @@ async function Te(t, e, n, o = !1, s = !1) {
618
619
  if (r.id_token !== void 0 && !p(r.id_token))
619
620
  throw new a('"response" body "id_token" property must be a non-empty string');
620
621
  if (r.id_token) {
621
- const { claims: i } = await xt(r.id_token, Lt.bind(void 0, e.id_token_signed_response_alg, t.id_token_signing_alg_values_supported), Ae, I(e), ye(e)).then(kt.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(vt.bind(void 0, t.issuer)).then(_t.bind(void 0, e.client_id));
622
+ const { claims: i } = await Lt(r.id_token, Ct.bind(void 0, e.id_token_signed_response_alg, t.id_token_signing_alg_values_supported), Ae, I(e), ye(e)).then(At.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(St.bind(void 0, t.issuer)).then(vt.bind(void 0, e.client_id));
622
623
  if (Array.isArray(i.aud) && i.aud.length !== 1 && i.azp !== e.client_id)
623
624
  throw new a('unexpected ID Token "azp" (authorized party) claim value');
624
625
  if (i.auth_time !== void 0 && (!Number.isFinite(i.auth_time) || Math.sign(i.auth_time) !== 1))
@@ -628,10 +629,10 @@ async function Te(t, e, n, o = !1, s = !1) {
628
629
  }
629
630
  return r;
630
631
  }
631
- async function bt(t, e, n) {
632
+ async function _t(t, e, n) {
632
633
  return Te(t, e, n);
633
634
  }
634
- function _t(t, e) {
635
+ function vt(t, e) {
635
636
  if (Array.isArray(e.claims.aud)) {
636
637
  if (!e.claims.aud.includes(t))
637
638
  throw new a('unexpected JWT "aud" (audience) claim value');
@@ -639,16 +640,16 @@ function _t(t, e) {
639
640
  throw new a('unexpected JWT "aud" (audience) claim value');
640
641
  return e;
641
642
  }
642
- function vt(t, e) {
643
+ function St(t, e) {
643
644
  if (e.claims.iss !== t)
644
645
  throw new a('unexpected JWT "iss" (issuer) claim value');
645
646
  return e;
646
647
  }
647
648
  const Ee = /* @__PURE__ */ new WeakSet();
648
- function St(t) {
649
+ function Tt(t) {
649
650
  return Ee.add(t), t;
650
651
  }
651
- async function Tt(t, e, n, o, s, r) {
652
+ async function Et(t, e, n, o, s, r) {
652
653
  if (j(t), z(e), !Ee.has(n))
653
654
  throw new TypeError('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()');
654
655
  if (!p(o))
@@ -661,7 +662,7 @@ async function Tt(t, e, n, o, s, r) {
661
662
  const u = new URLSearchParams(r == null ? void 0 : r.additionalParameters);
662
663
  return u.set("redirect_uri", o), u.set("code_verifier", s), u.set("code", i), ve(t, e, "authorization_code", u, r);
663
664
  }
664
- const Et = {
665
+ const kt = {
665
666
  aud: "audience",
666
667
  c_hash: "code hash",
667
668
  client_id: "client id",
@@ -677,21 +678,21 @@ const Et = {
677
678
  htu: "http uri",
678
679
  cnf: "confirmation"
679
680
  };
680
- function kt(t, e) {
681
+ function At(t, e) {
681
682
  for (const n of t)
682
683
  if (e.claims[n] === void 0)
683
- throw new a(`JWT "${n}" (${Et[n]}) claim missing`);
684
+ throw new a(`JWT "${n}" (${kt[n]}) claim missing`);
684
685
  return e;
685
686
  }
686
- const At = Symbol(), G = Symbol();
687
- async function Rt(t, e, n, o, s) {
687
+ const Rt = Symbol(), G = Symbol();
688
+ async function Pt(t, e, n, o, s) {
688
689
  const r = await Te(t, e, n);
689
690
  if (Z(r))
690
691
  return r;
691
692
  if (!p(r.id_token))
692
693
  throw new a('"response" body "id_token" property must be a non-empty string');
693
694
  s ?? (s = e.default_max_age ?? G);
694
- const i = yt(r);
695
+ const i = bt(r);
695
696
  if ((e.require_auth_time || s !== G) && i.auth_time === void 0)
696
697
  throw new a('ID Token "auth_time" (authentication time) claim missing');
697
698
  if (s !== G) {
@@ -703,7 +704,7 @@ async function Rt(t, e, n, o, s) {
703
704
  }
704
705
  switch (o) {
705
706
  case void 0:
706
- case At:
707
+ case Rt:
707
708
  if (i.nonce !== void 0)
708
709
  throw new a('unexpected ID Token "nonce" claim value');
709
710
  break;
@@ -721,7 +722,7 @@ function ne(t) {
721
722
  if (t.bodyUsed)
722
723
  throw new TypeError('"response" body has been used already');
723
724
  }
724
- async function Pt(t) {
725
+ async function Ut(t) {
725
726
  if (t.status > 399 && t.status < 500) {
726
727
  ne(t);
727
728
  try {
@@ -736,7 +737,7 @@ function le(t) {
736
737
  if (typeof t.modulusLength != "number" || t.modulusLength < 2048)
737
738
  throw new a(`${t.name} modulusLength must be at least 2048 bits`);
738
739
  }
739
- function Ut(t) {
740
+ function xt(t) {
740
741
  switch (t) {
741
742
  case "P-256":
742
743
  return "SHA-256";
@@ -753,7 +754,7 @@ function ke(t) {
753
754
  case "ECDSA":
754
755
  return {
755
756
  name: t.algorithm.name,
756
- hash: Ut(t.algorithm.namedCurve)
757
+ hash: xt(t.algorithm.namedCurve)
757
758
  };
758
759
  case "RSA-PSS":
759
760
  switch (le(t.algorithm), t.algorithm.hash.name) {
@@ -776,7 +777,7 @@ function ke(t) {
776
777
  throw new S();
777
778
  }
778
779
  const Ae = Symbol();
779
- async function xt(t, e, n, o, s) {
780
+ async function Lt(t, e, n, o, s) {
780
781
  const { 0: r, 1: i, 2: u, length: h } = t.split(".");
781
782
  if (h === 5)
782
783
  throw new S("JWE structure JWTs are not supported");
@@ -784,9 +785,9 @@ async function xt(t, e, n, o, s) {
784
785
  throw new a("Invalid JWT");
785
786
  let m;
786
787
  try {
787
- m = JSON.parse(k(E(r)));
788
- } catch (R) {
789
- throw new a("failed to parse JWT Header body as base64url encoded JSON", { cause: R });
788
+ m = JSON.parse(A(E(r)));
789
+ } catch (P) {
790
+ throw new a("failed to parse JWT Header body as base64url encoded JSON", { cause: P });
790
791
  }
791
792
  if (!C(m))
792
793
  throw new a("JWT Header must be a top level object");
@@ -796,23 +797,23 @@ async function xt(t, e, n, o, s) {
796
797
  let _;
797
798
  if (n !== Ae) {
798
799
  _ = await n(m);
799
- const R = `${r}.${i}`;
800
- if (!await crypto.subtle.verify(ke(_), _, b, k(R)))
800
+ const P = `${r}.${i}`;
801
+ if (!await crypto.subtle.verify(ke(_), _, b, A(P)))
801
802
  throw new a("JWT signature verification failed");
802
803
  }
803
804
  let f;
804
805
  try {
805
- f = JSON.parse(k(E(i)));
806
- } catch (R) {
807
- throw new a("failed to parse JWT Payload body as base64url encoded JSON", { cause: R });
806
+ f = JSON.parse(A(E(i)));
807
+ } catch (P) {
808
+ throw new a("failed to parse JWT Payload body as base64url encoded JSON", { cause: P });
808
809
  }
809
810
  if (!C(f))
810
811
  throw new a("JWT Payload must be a top level object");
811
- const A = M() + o;
812
+ const R = M() + o;
812
813
  if (f.exp !== void 0) {
813
814
  if (typeof f.exp != "number")
814
815
  throw new a('unexpected JWT "exp" (expiration time) claim type');
815
- if (f.exp <= A - s)
816
+ if (f.exp <= R - s)
816
817
  throw new a('unexpected JWT "exp" (expiration time) claim value, timestamp is <= now()');
817
818
  }
818
819
  if (f.iat !== void 0 && typeof f.iat != "number")
@@ -822,14 +823,14 @@ async function xt(t, e, n, o, s) {
822
823
  if (f.nbf !== void 0) {
823
824
  if (typeof f.nbf != "number")
824
825
  throw new a('unexpected JWT "nbf" (not before) claim type');
825
- if (f.nbf > A + s)
826
+ if (f.nbf > R + s)
826
827
  throw new a('unexpected JWT "nbf" (not before) claim value, timestamp is > now()');
827
828
  }
828
829
  if (f.aud !== void 0 && typeof f.aud != "string" && !Array.isArray(f.aud))
829
830
  throw new a('unexpected JWT "aud" (audience) claim type');
830
831
  return { header: m, claims: f, signature: b, key: _ };
831
832
  }
832
- function Lt(t, e, n) {
833
+ function Ct(t, e, n) {
833
834
  if (t !== void 0) {
834
835
  if (n.alg !== t)
835
836
  throw new a('unexpected JWT "alg" header parameter');
@@ -849,8 +850,8 @@ function T(t, e) {
849
850
  throw new a(`"${e}" parameter must be provided only once`);
850
851
  return n;
851
852
  }
852
- const Ct = Symbol(), It = Symbol();
853
- function jt(t, e, n, o) {
853
+ const It = Symbol(), jt = Symbol();
854
+ function zt(t, e, n, o) {
854
855
  if (j(t), z(e), n instanceof URL && (n = n.searchParams), !(n instanceof URLSearchParams))
855
856
  throw new TypeError('"parameters" must be an instance of URLSearchParams, or URL');
856
857
  if (T(n, "response"))
@@ -862,11 +863,11 @@ function jt(t, e, n, o) {
862
863
  throw new a('unexpected "iss" (issuer) response parameter value');
863
864
  switch (o) {
864
865
  case void 0:
865
- case It:
866
+ case jt:
866
867
  if (r !== void 0)
867
868
  throw new a('unexpected "state" response parameter encountered');
868
869
  break;
869
- case Ct:
870
+ case It:
870
871
  break;
871
872
  default:
872
873
  if (!p(o))
@@ -886,30 +887,30 @@ function jt(t, e, n, o) {
886
887
  const u = T(n, "id_token"), h = T(n, "token");
887
888
  if (u !== void 0 || h !== void 0)
888
889
  throw new S("implicit and hybrid flows are not supported");
889
- return St(new URLSearchParams(n));
890
+ return Tt(new URLSearchParams(n));
890
891
  }
891
- function zt({
892
+ function Jt({
892
893
  handleCallback: t
893
894
  }) {
894
- const [e, n] = ze(null), o = We(), s = Je(!1);
895
+ const [e, n] = ze(null), o = He(), s = Je(!1);
895
896
  return Oe(() => {
896
897
  s.current || (s.current = !0, t().then((r) => {
897
898
  o(r);
898
899
  }).catch((r) => {
899
900
  K.error(r), n(r);
900
901
  }));
901
- }, [o, t]), e ? /* @__PURE__ */ P.jsx(
902
+ }, [o, t]), e ? /* @__PURE__ */ k.jsx(
902
903
  De,
903
904
  {
904
905
  category: "Error",
905
906
  title: "Authentication Error",
906
- message: /* @__PURE__ */ P.jsxs(P.Fragment, { children: [
907
- /* @__PURE__ */ P.jsx(Ne, { className: "mb-4", children: "Check the configuration of your authorization provider and ensure all settings such as the callback URL are configured correctly." }),
907
+ message: /* @__PURE__ */ k.jsxs(k.Fragment, { children: [
908
+ /* @__PURE__ */ k.jsx(Ne, { className: "mb-4", children: "Check the configuration of your authorization provider and ensure all settings such as the callback URL are configured correctly." }),
908
909
  "An error occurred while authorizing the user.",
909
- /* @__PURE__ */ P.jsx(Ke, { code: e.toString(), language: "plain" })
910
+ /* @__PURE__ */ k.jsx(We, { code: e.toString(), language: "plain" })
910
911
  ] })
911
912
  }
912
- ) : /* @__PURE__ */ P.jsx("p", { children: "Loading..." });
913
+ ) : /* @__PURE__ */ k.jsx("div", { className: "grid h-full place-items-center", children: /* @__PURE__ */ k.jsx(Ke, {}) });
913
914
  }
914
915
  class x extends Error {
915
916
  }
@@ -919,7 +920,7 @@ class de extends x {
919
920
  }
920
921
  }
921
922
  const V = "code-verifier";
922
- class Jt extends je {
923
+ class Ot extends je {
923
924
  constructor(e, n) {
924
925
  super(), this.callbackUrlPath = e, this.handleCallback = n;
925
926
  }
@@ -928,12 +929,12 @@ class Jt extends je {
928
929
  ...super.getRoutes(),
929
930
  {
930
931
  path: this.callbackUrlPath,
931
- element: /* @__PURE__ */ P.jsx(zt, { handleCallback: this.handleCallback })
932
+ element: /* @__PURE__ */ k.jsx(Jt, { handleCallback: this.handleCallback })
932
933
  }
933
934
  ];
934
935
  }
935
936
  }
936
- class Ot {
937
+ class Nt {
937
938
  constructor({
938
939
  issuer: e,
939
940
  audience: n,
@@ -976,7 +977,7 @@ class Ot {
976
977
  const e = new URL(window.location.href), n = e.searchParams.get("state"), o = sessionStorage.getItem(V);
977
978
  if (sessionStorage.removeItem(V), !o)
978
979
  throw new x("No code verifier found in state.");
979
- const s = await this.getAuthServer(), r = jt(
980
+ const s = await this.getAuthServer(), r = zt(
980
981
  s,
981
982
  this.client,
982
983
  e.searchParams,
@@ -989,19 +990,19 @@ class Ot {
989
990
  );
990
991
  const i = new URL(e);
991
992
  i.pathname = this.redirectToAfterSignIn, i.search = "";
992
- const u = await Tt(
993
+ const u = await Et(
993
994
  s,
994
995
  this.client,
995
996
  r,
996
997
  i.toString(),
997
998
  o
998
- ), h = await Rt(
999
+ ), h = await Pt(
999
1000
  s,
1000
1001
  this.client,
1001
1002
  u
1002
1003
  );
1003
1004
  this.setTokensFromResponse(h);
1004
- const m = await this.getAccessToken(), _ = await (await wt(
1005
+ const m = await this.getAccessToken(), _ = await (await gt(
1005
1006
  s,
1006
1007
  this.client,
1007
1008
  m
@@ -1020,8 +1021,8 @@ class Ot {
1020
1021
  "profile-state",
1021
1022
  JSON.stringify(N.getState().profile)
1022
1023
  );
1023
- const A = sessionStorage.getItem("redirect-to") ?? "/";
1024
- return sessionStorage.removeItem("redirect-to"), A;
1024
+ const R = sessionStorage.getItem("redirect-to") ?? "/";
1025
+ return sessionStorage.removeItem("redirect-to"), R;
1025
1026
  });
1026
1027
  this.client = {
1027
1028
  client_id: r,
@@ -1038,8 +1039,8 @@ class Ot {
1038
1039
  code_challenge_methods_supported: []
1039
1040
  };
1040
1041
  else {
1041
- const e = new URL(this.issuer), n = await Ze(e);
1042
- this.authorizationServer = await Qe(
1042
+ const e = new URL(this.issuer), n = await Qe(e);
1043
+ this.authorizationServer = await Xe(
1043
1044
  e,
1044
1045
  n
1045
1046
  );
@@ -1082,7 +1083,7 @@ class Ot {
1082
1083
  const o = "S256", s = await this.getAuthServer();
1083
1084
  if (!s.authorization_endpoint)
1084
1085
  throw new x("No authorization endpoint");
1085
- const r = Xe(), i = await tt(r);
1086
+ const r = et(), i = await nt(r);
1086
1087
  sessionStorage.setItem(V, r);
1087
1088
  const u = new URL(
1088
1089
  s.authorization_endpoint
@@ -1096,7 +1097,7 @@ class Ot {
1096
1097
  isSignIn: !n,
1097
1098
  isSignUp: n
1098
1099
  }), ((b = s.code_challenge_methods_supported) == null ? void 0 : b.includes("S256")) !== !0) {
1099
- const _ = et();
1100
+ const _ = tt();
1100
1101
  u.searchParams.set("state", _);
1101
1102
  }
1102
1103
  location.href = u.href;
@@ -1109,11 +1110,11 @@ class Ot {
1109
1110
  if (o.expiresOn < /* @__PURE__ */ new Date()) {
1110
1111
  if (!o.refreshToken)
1111
1112
  return await this.signIn(), "";
1112
- const s = await mt(
1113
+ const s = await yt(
1113
1114
  e,
1114
1115
  this.client,
1115
1116
  o.refreshToken
1116
- ), r = await bt(
1117
+ ), r = await _t(
1117
1118
  e,
1118
1119
  this.client,
1119
1120
  s
@@ -1139,12 +1140,12 @@ class Ot {
1139
1140
  }
1140
1141
  }
1141
1142
  getAuthenticationPlugin() {
1142
- return new Jt(this.callbackUrlPath, this.handleCallback);
1143
+ return new Ot(this.callbackUrlPath, this.handleCallback);
1143
1144
  }
1144
1145
  }
1145
- const Gt = (t) => new Ot(t);
1146
+ const Yt = (t) => new Nt(t);
1146
1147
  export {
1147
- Ot as OpenIDAuthenticationProvider,
1148
- Gt as default
1148
+ Nt as OpenIDAuthenticationProvider,
1149
+ Yt as default
1149
1150
  };
1150
1151
  //# sourceMappingURL=zudoku.auth-openid.js.map