zudoku 0.34.4 → 0.35.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.
Files changed (130) hide show
  1. package/dist/config/config.d.ts +13 -8
  2. package/dist/config/validators/common.d.ts +980 -114
  3. package/dist/config/validators/common.js +27 -2
  4. package/dist/config/validators/common.js.map +1 -1
  5. package/dist/config/validators/validate.d.ts +358 -43
  6. package/dist/lib/authentication/providers/clerk.d.ts +2 -2
  7. package/dist/lib/authentication/providers/openid.js +4 -1
  8. package/dist/lib/authentication/providers/openid.js.map +1 -1
  9. package/dist/lib/authentication/providers/supabase.d.ts +4 -0
  10. package/dist/lib/authentication/providers/supabase.js +112 -0
  11. package/dist/lib/authentication/providers/supabase.js.map +1 -0
  12. package/dist/lib/components/Header.js +3 -3
  13. package/dist/lib/components/Header.js.map +1 -1
  14. package/dist/lib/components/InlineCode.js +1 -1
  15. package/dist/lib/components/InlineCode.js.map +1 -1
  16. package/dist/lib/components/Layout.js +4 -10
  17. package/dist/lib/components/Layout.js.map +1 -1
  18. package/dist/lib/components/Main.d.ts +2 -0
  19. package/dist/lib/components/Main.js +15 -0
  20. package/dist/lib/components/Main.js.map +1 -0
  21. package/dist/lib/components/context/ViewportAnchorContext.d.ts +2 -4
  22. package/dist/lib/components/context/ViewportAnchorContext.js +2 -4
  23. package/dist/lib/components/context/ViewportAnchorContext.js.map +1 -1
  24. package/dist/lib/components/index.d.ts +2 -1
  25. package/dist/lib/components/navigation/Sidebar.d.ts +3 -1
  26. package/dist/lib/components/navigation/Sidebar.js +2 -4
  27. package/dist/lib/components/navigation/Sidebar.js.map +1 -1
  28. package/dist/lib/components/navigation/SidebarWrapper.d.ts +8 -6
  29. package/dist/lib/components/navigation/SidebarWrapper.js +1 -2
  30. package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -1
  31. package/dist/lib/core/RouteGuard.js +2 -1
  32. package/dist/lib/core/RouteGuard.js.map +1 -1
  33. package/dist/lib/oas/graphql/index.js +34 -0
  34. package/dist/lib/oas/graphql/index.js.map +1 -1
  35. package/dist/lib/plugins/markdown/MdxPage.d.ts +1 -1
  36. package/dist/lib/plugins/markdown/MdxPage.js +1 -1
  37. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  38. package/dist/lib/plugins/openapi/OperationList.js +2 -1
  39. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  40. package/dist/lib/plugins/openapi/Sidecar.js +9 -4
  41. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  42. package/dist/lib/plugins/openapi/SimpleSelect.js +1 -1
  43. package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -1
  44. package/dist/lib/plugins/openapi/graphql/gql.d.ts +1 -1
  45. package/dist/lib/plugins/openapi/graphql/gql.js +1 -1
  46. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  47. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +6 -0
  48. package/dist/lib/plugins/openapi/graphql/graphql.js +2 -0
  49. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  50. package/dist/lib/plugins/openapi/index.d.ts +1 -1
  51. package/dist/lib/plugins/openapi/index.js +8 -8
  52. package/dist/lib/plugins/openapi/index.js.map +1 -1
  53. package/dist/lib/plugins/openapi/interfaces.d.ts +7 -10
  54. package/dist/lib/ui/Callout.d.ts +2 -1
  55. package/dist/lib/ui/Callout.js +3 -2
  56. package/dist/lib/ui/Callout.js.map +1 -1
  57. package/dist/lib/util/MdxComponents.d.ts +2 -1
  58. package/dist/vite/plugin-api.js +5 -9
  59. package/dist/vite/plugin-api.js.map +1 -1
  60. package/lib/{Callout-B_sEhkYd.js → Callout-B2vsR09t.js} +70 -52
  61. package/lib/{Callout-B_sEhkYd.js.map → Callout-B2vsR09t.js.map} +1 -1
  62. package/lib/Drawer-kDAfOq_2.js +1133 -0
  63. package/lib/Drawer-kDAfOq_2.js.map +1 -0
  64. package/lib/{Markdown-DZXjQjpH.js → Markdown-D1Y3cd9l.js} +4471 -3315
  65. package/lib/Markdown-D1Y3cd9l.js.map +1 -0
  66. package/lib/{MdxPage-52vRwa_7.js → MdxPage-CUL_SQzW.js} +9 -9
  67. package/lib/MdxPage-CUL_SQzW.js.map +1 -0
  68. package/lib/{OasProvider-CDyf845G.js → OasProvider-vimCZXXF.js} +2 -2
  69. package/lib/{OasProvider-CDyf845G.js.map → OasProvider-vimCZXXF.js.map} +1 -1
  70. package/lib/{OperationList-DdCWaqeE.js → OperationList-C6Tumce9.js} +179 -179
  71. package/lib/OperationList-C6Tumce9.js.map +1 -0
  72. package/lib/{SlotletProvider-TydSHROc.js → SlotletProvider-iDmNlxD5.js} +2 -2
  73. package/lib/{SlotletProvider-TydSHROc.js.map → SlotletProvider-iDmNlxD5.js.map} +1 -1
  74. package/lib/{createServer-DmusVVsi.js → createServer-BEFAOb-x.js} +1889 -1853
  75. package/lib/createServer-BEFAOb-x.js.map +1 -0
  76. package/lib/{index-BO-sA1cw.js → index-OD2IZ2Nn.js} +348 -346
  77. package/lib/index-OD2IZ2Nn.js.map +1 -0
  78. package/lib/prism-bash.min-HHIMdNJ_.js.map +1 -1
  79. package/lib/prism-csharp.min-bQAo2pmx.js.map +1 -1
  80. package/lib/prism-java.min-BpvsOuIa.js.map +1 -1
  81. package/lib/prism-javascript.min-CEqHqgbm.js.map +1 -1
  82. package/lib/prism-json.min-B1GJqK1k.js.map +1 -1
  83. package/lib/prism-markdown.min-C0Qn0m-5.js.map +1 -1
  84. package/lib/prism-markup-BNGj0Tvm.js.map +1 -1
  85. package/lib/prism-objectivec.min-BXSWqpJJ.js.map +1 -1
  86. package/lib/prism-ruby.min-Dx9KO9ds.js.map +1 -1
  87. package/lib/prism-typescript.min-CD7H2IYQ.js.map +1 -1
  88. package/lib/ui/Callout.js +39 -21
  89. package/lib/ui/Callout.js.map +1 -1
  90. package/lib/ui/Drawer.js +14 -1129
  91. package/lib/ui/Drawer.js.map +1 -1
  92. package/lib/zudoku.auth-clerk.js.map +1 -1
  93. package/lib/zudoku.auth-openid.js +94 -94
  94. package/lib/zudoku.auth-openid.js.map +1 -1
  95. package/lib/zudoku.components.js +675 -621
  96. package/lib/zudoku.components.js.map +1 -1
  97. package/lib/zudoku.plugin-api-catalog.js +1 -1
  98. package/lib/zudoku.plugin-api-keys.js +1 -1
  99. package/lib/zudoku.plugin-custom-pages.js +1 -1
  100. package/lib/zudoku.plugin-markdown.js +1 -1
  101. package/lib/zudoku.plugin-openapi.js +1 -1
  102. package/lib/zudoku.plugin-search-pagefind.js +1 -1
  103. package/package.json +12 -7
  104. package/src/app/main.css +5 -3
  105. package/src/lib/authentication/providers/clerk.tsx +2 -2
  106. package/src/lib/authentication/providers/openid.tsx +5 -1
  107. package/src/lib/authentication/providers/supabase.tsx +151 -0
  108. package/src/lib/components/Header.tsx +10 -6
  109. package/src/lib/components/InlineCode.tsx +1 -1
  110. package/src/lib/components/Layout.tsx +5 -40
  111. package/src/lib/components/Main.tsx +47 -0
  112. package/src/lib/components/context/ViewportAnchorContext.tsx +3 -9
  113. package/src/lib/components/navigation/Sidebar.tsx +7 -9
  114. package/src/lib/components/navigation/SidebarWrapper.tsx +13 -15
  115. package/src/lib/core/RouteGuard.tsx +2 -1
  116. package/src/lib/oas/graphql/index.ts +35 -0
  117. package/src/lib/plugins/markdown/MdxPage.tsx +2 -2
  118. package/src/lib/plugins/openapi/OperationList.tsx +3 -2
  119. package/src/lib/plugins/openapi/Sidecar.tsx +11 -4
  120. package/src/lib/plugins/openapi/SimpleSelect.tsx +1 -1
  121. package/src/lib/plugins/openapi/graphql/gql.ts +3 -3
  122. package/src/lib/plugins/openapi/graphql/graphql.ts +8 -0
  123. package/src/lib/plugins/openapi/index.tsx +10 -11
  124. package/src/lib/plugins/openapi/interfaces.ts +11 -15
  125. package/src/lib/ui/Callout.tsx +28 -10
  126. package/lib/Markdown-DZXjQjpH.js.map +0 -1
  127. package/lib/MdxPage-52vRwa_7.js.map +0 -1
  128. package/lib/OperationList-DdCWaqeE.js.map +0 -1
  129. package/lib/createServer-DmusVVsi.js.map +0 -1
  130. package/lib/index-BO-sA1cw.js.map +0 -1
@@ -23,8 +23,8 @@ function De() {
23
23
  "warn",
24
24
  "error"
25
25
  ], r = {}, i = null;
26
- function c(l, g) {
27
- var u = l[g];
26
+ function c(l, y) {
27
+ var u = l[y];
28
28
  if (typeof u.bind == "function")
29
29
  return u.bind(l);
30
30
  try {
@@ -35,57 +35,57 @@ function De() {
35
35
  };
36
36
  }
37
37
  }
38
- function f() {
38
+ function p() {
39
39
  console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace();
40
40
  }
41
41
  function w(l) {
42
- return l === "debug" && (l = "log"), typeof console === n ? !1 : l === "trace" && o ? f : console[l] !== void 0 ? c(console, l) : console.log !== void 0 ? c(console, "log") : e;
42
+ return l === "debug" && (l = "log"), typeof console === n ? !1 : l === "trace" && o ? p : console[l] !== void 0 ? c(console, l) : console.log !== void 0 ? c(console, "log") : e;
43
43
  }
44
- function p() {
45
- for (var l = this.getLevel(), g = 0; g < a.length; g++) {
46
- var u = a[g];
47
- this[u] = g < l ? e : this.methodFactory(u, l, this.name);
44
+ function f() {
45
+ for (var l = this.getLevel(), y = 0; y < a.length; y++) {
46
+ var u = a[y];
47
+ this[u] = y < l ? e : this.methodFactory(u, l, this.name);
48
48
  }
49
49
  if (this.log = this.debug, typeof console === n && l < this.levels.SILENT)
50
50
  return "No console available for logging";
51
51
  }
52
- function b(l) {
52
+ function g(l) {
53
53
  return function() {
54
- typeof console !== n && (p.call(this), this[l].apply(this, arguments));
54
+ typeof console !== n && (f.call(this), this[l].apply(this, arguments));
55
55
  };
56
56
  }
57
- function T(l, g, u) {
58
- return w(l) || b.apply(this, arguments);
57
+ function v(l, y, u) {
58
+ return w(l) || g.apply(this, arguments);
59
59
  }
60
- function h(l, g) {
61
- var u = this, J, $, R, v = "loglevel";
62
- typeof l == "string" ? v += ":" + l : typeof l == "symbol" && (v = void 0);
60
+ function h(l, y) {
61
+ var u = this, J, $, R, S = "loglevel";
62
+ typeof l == "string" ? S += ":" + l : typeof l == "symbol" && (S = void 0);
63
63
  function Ee(d) {
64
- var y = (a[d] || "silent").toUpperCase();
65
- if (!(typeof window === n || !v)) {
64
+ var b = (a[d] || "silent").toUpperCase();
65
+ if (!(typeof window === n || !S)) {
66
66
  try {
67
- window.localStorage[v] = y;
67
+ window.localStorage[S] = b;
68
68
  return;
69
69
  } catch {
70
70
  }
71
71
  try {
72
- window.document.cookie = encodeURIComponent(v) + "=" + y + ";";
72
+ window.document.cookie = encodeURIComponent(S) + "=" + b + ";";
73
73
  } catch {
74
74
  }
75
75
  }
76
76
  }
77
77
  function te() {
78
78
  var d;
79
- if (!(typeof window === n || !v)) {
79
+ if (!(typeof window === n || !S)) {
80
80
  try {
81
- d = window.localStorage[v];
81
+ d = window.localStorage[S];
82
82
  } catch {
83
83
  }
84
84
  if (typeof d === n)
85
85
  try {
86
- var y = window.document.cookie, O = encodeURIComponent(v), re = y.indexOf(O + "=");
86
+ var b = window.document.cookie, O = encodeURIComponent(S), re = b.indexOf(O + "=");
87
87
  re !== -1 && (d = /^([^;]+)/.exec(
88
- y.slice(re + O.length + 1)
88
+ b.slice(re + O.length + 1)
89
89
  )[1]);
90
90
  } catch {
91
91
  }
@@ -93,21 +93,21 @@ function De() {
93
93
  }
94
94
  }
95
95
  function Re() {
96
- if (!(typeof window === n || !v)) {
96
+ if (!(typeof window === n || !S)) {
97
97
  try {
98
- window.localStorage.removeItem(v);
98
+ window.localStorage.removeItem(S);
99
99
  } catch {
100
100
  }
101
101
  try {
102
- window.document.cookie = encodeURIComponent(v) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
102
+ window.document.cookie = encodeURIComponent(S) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
103
103
  } catch {
104
104
  }
105
105
  }
106
106
  }
107
107
  function U(d) {
108
- var y = d;
109
- if (typeof y == "string" && u.levels[y.toUpperCase()] !== void 0 && (y = u.levels[y.toUpperCase()]), typeof y == "number" && y >= 0 && y <= u.levels.SILENT)
110
- return y;
108
+ var b = d;
109
+ if (typeof b == "string" && u.levels[b.toUpperCase()] !== void 0 && (b = u.levels[b.toUpperCase()]), typeof b == "number" && b >= 0 && b <= u.levels.SILENT)
110
+ return b;
111
111
  throw new TypeError("log.setLevel() called with invalid level: " + d);
112
112
  }
113
113
  u.name = l, u.levels = {
@@ -117,34 +117,34 @@ function De() {
117
117
  WARN: 3,
118
118
  ERROR: 4,
119
119
  SILENT: 5
120
- }, u.methodFactory = g || T, u.getLevel = function() {
120
+ }, u.methodFactory = y || v, u.getLevel = function() {
121
121
  return R ?? $ ?? J;
122
- }, u.setLevel = function(d, y) {
123
- return R = U(d), y !== !1 && Ee(R), p.call(u);
122
+ }, u.setLevel = function(d, b) {
123
+ return R = U(d), b !== !1 && Ee(R), f.call(u);
124
124
  }, u.setDefaultLevel = function(d) {
125
125
  $ = U(d), te() || u.setLevel(d, !1);
126
126
  }, u.resetLevel = function() {
127
- R = null, Re(), p.call(u);
127
+ R = null, Re(), f.call(u);
128
128
  }, u.enableAll = function(d) {
129
129
  u.setLevel(u.levels.TRACE, d);
130
130
  }, u.disableAll = function(d) {
131
131
  u.setLevel(u.levels.SILENT, d);
132
132
  }, u.rebuild = function() {
133
- if (i !== u && (J = U(i.getLevel())), p.call(u), i === u)
133
+ if (i !== u && (J = U(i.getLevel())), f.call(u), i === u)
134
134
  for (var d in r)
135
135
  r[d].rebuild();
136
136
  }, J = U(
137
137
  i ? i.getLevel() : "WARN"
138
138
  );
139
139
  var ne = te();
140
- ne != null && (R = U(ne)), p.call(u);
140
+ ne != null && (R = U(ne)), f.call(u);
141
141
  }
142
- i = new h(), i.getLogger = function(g) {
143
- if (typeof g != "symbol" && typeof g != "string" || g === "")
142
+ i = new h(), i.getLogger = function(y) {
143
+ if (typeof y != "symbol" && typeof y != "string" || y === "")
144
144
  throw new TypeError("You must supply a name when creating a logger.");
145
- var u = r[g];
146
- return u || (u = r[g] = new h(
147
- g,
145
+ var u = r[y];
146
+ return u || (u = r[y] = new h(
147
+ y,
148
148
  i.methodFactory
149
149
  )), u;
150
150
  };
@@ -220,7 +220,7 @@ class Ve {
220
220
  this.cache.set(e, n), this.cache.size >= this.maxSize && (this._cache = this.cache, this.cache = /* @__PURE__ */ new Map());
221
221
  }
222
222
  }
223
- class S extends Error {
223
+ class T extends Error {
224
224
  constructor(e) {
225
225
  var n;
226
226
  super(e ?? "operation not supported"), this.name = this.constructor.name, (n = Error.captureStackTrace) == null || n.call(Error, this, this.constructor);
@@ -347,7 +347,7 @@ function it(t) {
347
347
  case "SHA-512":
348
348
  return "PS512";
349
349
  default:
350
- throw new S("unsupported RsaHashedKeyAlgorithm hash name");
350
+ throw new T("unsupported RsaHashedKeyAlgorithm hash name");
351
351
  }
352
352
  }
353
353
  function at(t) {
@@ -359,7 +359,7 @@ function at(t) {
359
359
  case "SHA-512":
360
360
  return "RS512";
361
361
  default:
362
- throw new S("unsupported RsaHashedKeyAlgorithm hash name");
362
+ throw new T("unsupported RsaHashedKeyAlgorithm hash name");
363
363
  }
364
364
  }
365
365
  function st(t) {
@@ -371,7 +371,7 @@ function st(t) {
371
371
  case "P-521":
372
372
  return "ES512";
373
373
  default:
374
- throw new S("unsupported EcKeyAlgorithm namedCurve");
374
+ throw new T("unsupported EcKeyAlgorithm namedCurve");
375
375
  }
376
376
  }
377
377
  function ct(t) {
@@ -386,7 +386,7 @@ function ct(t) {
386
386
  case "Ed448":
387
387
  return "EdDSA";
388
388
  default:
389
- throw new S("unsupported CryptoKey algorithm name");
389
+ throw new T("unsupported CryptoKey algorithm name");
390
390
  }
391
391
  }
392
392
  function H(t) {
@@ -443,7 +443,7 @@ async function ut(t, e, n, o, a) {
443
443
  break;
444
444
  }
445
445
  default:
446
- throw new S("unsupported client token_endpoint_auth_method");
446
+ throw new T("unsupported client token_endpoint_auth_method");
447
447
  }
448
448
  }
449
449
  async function lt(t, e, n) {
@@ -453,29 +453,29 @@ async function lt(t, e, n) {
453
453
  return `${o}.${a}`;
454
454
  }
455
455
  async function dt(t, e, n, o, a, r) {
456
- var T;
457
- const { privateKey: i, publicKey: c, nonce: f = we.get(n.origin) } = e;
456
+ var v;
457
+ const { privateKey: i, publicKey: c, nonce: p = we.get(n.origin) } = e;
458
458
  if (!Ze(i))
459
459
  throw new TypeError('"DPoP.privateKey" must be a private CryptoKey');
460
460
  if (!Ye(c))
461
461
  throw new TypeError('"DPoP.publicKey" must be a public CryptoKey');
462
- if (f !== void 0 && !m(f))
462
+ if (p !== void 0 && !m(p))
463
463
  throw new TypeError('"DPoP.nonce" must be a non-empty string or undefined');
464
464
  if (!c.extractable)
465
465
  throw new TypeError('"DPoP.publicKey.extractable" must be true');
466
- const w = X() + a, p = {
466
+ const w = X() + a, f = {
467
467
  alg: ct(i),
468
468
  typ: "dpop+jwt",
469
469
  jwk: await ft(c)
470
- }, b = {
470
+ }, g = {
471
471
  iat: w,
472
472
  jti: Q(),
473
473
  htm: o,
474
- nonce: f,
474
+ nonce: p,
475
475
  htu: `${n.origin}${n.pathname}`,
476
476
  ath: r ? k(await crypto.subtle.digest("SHA-256", E(r))) : void 0
477
477
  };
478
- (T = e[Ke]) == null || T.call(e, p, b), t.set("dpop", await lt(p, b, i));
478
+ (v = e[Ke]) == null || v.call(e, f, g), t.set("dpop", await lt(f, g, i));
479
479
  }
480
480
  let N;
481
481
  async function ht(t) {
@@ -574,7 +574,7 @@ async function Se(t, e, n, o = !1, a = !1) {
574
574
  if (!m(r.token_type))
575
575
  throw new s('"response" body "token_type" property must be a non-empty string');
576
576
  if (r.token_type = r.token_type.toLowerCase(), r.token_type !== "dpop" && r.token_type !== "bearer")
577
- throw new S("unsupported `token_type` value");
577
+ throw new T("unsupported `token_type` value");
578
578
  if (r.expires_in !== void 0 && (typeof r.expires_in != "number" || r.expires_in <= 0))
579
579
  throw new s('"response" body "expires_in" property must be a positive number');
580
580
  if (!a && r.refresh_token !== void 0 && !m(r.refresh_token))
@@ -668,8 +668,8 @@ async function Rt(t, e, n, o, a) {
668
668
  if (a !== F) {
669
669
  if (typeof a != "number" || a < 0)
670
670
  throw new TypeError('"maxAge" must be a non-negative number');
671
- const c = X() + H(e), f = ge(e);
672
- if (i.auth_time + a < c - f)
671
+ const c = X() + H(e), p = ge(e);
672
+ if (i.auth_time + a < c - p)
673
673
  throw new s("too much time has elapsed since the last End-User authentication");
674
674
  }
675
675
  switch (o) {
@@ -716,7 +716,7 @@ function Ut(t) {
716
716
  case "P-521":
717
717
  return "SHA-512";
718
718
  default:
719
- throw new S();
719
+ throw new T();
720
720
  }
721
721
  }
722
722
  function Ae(t) {
@@ -736,7 +736,7 @@ function Ae(t) {
736
736
  saltLength: parseInt(t.algorithm.hash.name.slice(-3), 10) >> 3
737
737
  };
738
738
  default:
739
- throw new S();
739
+ throw new T();
740
740
  }
741
741
  case "RSASSA-PKCS1-v1_5":
742
742
  return he(t.algorithm), t.algorithm.name;
@@ -744,7 +744,7 @@ function Ae(t) {
744
744
  case "Ed25519":
745
745
  return t.algorithm.name;
746
746
  }
747
- throw new S();
747
+ throw new T();
748
748
  }
749
749
  const ke = Symbol();
750
750
  async function Lt(t, e, n, o) {
@@ -753,27 +753,27 @@ async function Lt(t, e, n, o) {
753
753
  throw new s("JWT signature verification failed");
754
754
  }
755
755
  async function xt(t, e, n, o, a, r) {
756
- let { 0: i, 1: c, 2: f, length: w } = t.split(".");
756
+ let { 0: i, 1: c, 2: p, length: w } = t.split(".");
757
757
  if (w === 5)
758
758
  if (r !== void 0)
759
- t = await r(t), { 0: i, 1: c, 2: f, length: w } = t.split(".");
759
+ t = await r(t), { 0: i, 1: c, 2: p, length: w } = t.split(".");
760
760
  else
761
- throw new S("JWE structure JWTs are not supported");
761
+ throw new T("JWE structure JWTs are not supported");
762
762
  if (w !== 3)
763
763
  throw new s("Invalid JWT");
764
- let p;
764
+ let f;
765
765
  try {
766
- p = JSON.parse(E(k(i)));
766
+ f = JSON.parse(E(k(i)));
767
767
  } catch (l) {
768
768
  throw new s("failed to parse JWT Header body as base64url encoded JSON", { cause: l });
769
769
  }
770
- if (!x(p))
770
+ if (!x(f))
771
771
  throw new s("JWT Header must be a top level object");
772
- if (e(p), p.crit !== void 0)
772
+ if (e(f), f.crit !== void 0)
773
773
  throw new s('unexpected JWT "crit" header parameter');
774
- const b = k(f);
775
- let T;
776
- n !== ke && (T = await n(p), await Lt(i, c, T, b));
774
+ const g = k(p);
775
+ let v;
776
+ n !== ke && (v = await n(f), await Lt(i, c, v, g));
777
777
  let h;
778
778
  try {
779
779
  h = JSON.parse(E(k(c)));
@@ -801,7 +801,7 @@ async function xt(t, e, n, o, a, r) {
801
801
  }
802
802
  if (h.aud !== void 0 && typeof h.aud != "string" && !Array.isArray(h.aud))
803
803
  throw new s('unexpected JWT "aud" (audience) claim type');
804
- return { header: p, claims: h, signature: b, key: T, jwt: t };
804
+ return { header: f, claims: h, signature: g, key: v, jwt: t };
805
805
  }
806
806
  function Ct(t, e, n) {
807
807
  if (t !== void 0) {
@@ -857,9 +857,9 @@ function Jt(t, e, n, o) {
857
857
  error_description: A(n, "error_description"),
858
858
  error_uri: A(n, "error_uri")
859
859
  };
860
- const c = A(n, "id_token"), f = A(n, "token");
861
- if (c !== void 0 || f !== void 0)
862
- throw new S("implicit and hybrid flows are not supported");
860
+ const c = A(n, "id_token"), p = A(n, "token");
861
+ if (c !== void 0 || p !== void 0)
862
+ throw new T("implicit and hybrid flows are not supported");
863
863
  return St(new URLSearchParams(n));
864
864
  }
865
865
  function Ot({
@@ -913,7 +913,7 @@ class Dt {
913
913
  redirectToAfterSignIn: r,
914
914
  redirectToAfterSignOut: i,
915
915
  basePath: c,
916
- scopes: f
916
+ scopes: p
917
917
  }) {
918
918
  _(this, "client");
919
919
  _(this, "issuer");
@@ -966,27 +966,27 @@ class Dt {
966
966
  r,
967
967
  i.toString(),
968
968
  o
969
- ), f = await Rt(
969
+ ), p = await Rt(
970
970
  a,
971
971
  this.client,
972
972
  c
973
973
  );
974
- this.setTokensFromResponse(f);
975
- const w = await this.getAccessToken(), b = await (await wt(
974
+ this.setTokensFromResponse(p);
975
+ const w = await this.getAccessToken(), g = await (await wt(
976
976
  a,
977
977
  this.client,
978
978
  w
979
- )).json(), T = {
980
- sub: b.sub,
981
- email: b.email,
982
- name: b.name,
983
- emailVerified: b.email_verified ?? !1,
984
- pictureUrl: b.picture
979
+ )).json(), v = {
980
+ sub: g.sub,
981
+ email: g.email,
982
+ name: g.name,
983
+ emailVerified: g.email_verified ?? !1,
984
+ pictureUrl: g.picture
985
985
  };
986
986
  L.setState({
987
987
  isAuthenticated: !0,
988
988
  isPending: !1,
989
- profile: T
989
+ profile: v
990
990
  });
991
991
  const h = sessionStorage.getItem("redirect-to") ?? "/";
992
992
  return sessionStorage.removeItem("redirect-to"), h;
@@ -994,7 +994,7 @@ class Dt {
994
994
  this.client = {
995
995
  client_id: o,
996
996
  token_endpoint_auth_method: "none"
997
- }, this.audience = n, this.issuer = e, this.callbackUrlPath = oe(c, "/oauth/callback"), this.scopes = f ?? ["openid", "profile", "email"];
997
+ }, this.audience = n, this.issuer = e, this.callbackUrlPath = oe(c, "/oauth/callback"), this.scopes = p ?? ["openid", "profile", "email"];
998
998
  const w = oe(c, "/");
999
999
  this.logoutRedirectUrlPath = w, this.redirectToAfterSignUp = a ?? w, this.redirectToAfterSignIn = r ?? w, this.redirectToAfterSignOut = i ?? w;
1000
1000
  }
@@ -1043,7 +1043,7 @@ class Dt {
1043
1043
  redirectTo: e,
1044
1044
  isSignUp: n = !1
1045
1045
  }) {
1046
- var w, p;
1046
+ var f, g;
1047
1047
  const o = "S256", a = await this.getAuthServer();
1048
1048
  if (!a.authorization_endpoint)
1049
1049
  throw new P("No authorization endpoint");
@@ -1051,18 +1051,18 @@ class Dt {
1051
1051
  sessionStorage.setItem(M, r);
1052
1052
  const c = new URL(
1053
1053
  a.authorization_endpoint
1054
- );
1055
- sessionStorage.setItem("redirect-to", e);
1056
- const f = new URL(window.location.origin);
1057
- if (f.pathname = this.callbackUrlPath, f.search = "", c.searchParams.set("client_id", this.client.client_id), c.searchParams.set("redirect_uri", f.toString()), c.searchParams.set("response_type", "code"), c.searchParams.set("scope", this.scopes.join(" ")), c.searchParams.set("code_challenge", i), c.searchParams.set(
1054
+ ), p = e.startsWith(window.location.origin) ? e.slice(window.location.origin.length) : e;
1055
+ sessionStorage.setItem("redirect-to", p);
1056
+ const w = new URL(window.location.origin);
1057
+ if (w.pathname = this.callbackUrlPath, w.search = "", c.searchParams.set("client_id", this.client.client_id), c.searchParams.set("redirect_uri", w.toString()), c.searchParams.set("response_type", "code"), c.searchParams.set("scope", this.scopes.join(" ")), c.searchParams.set("code_challenge", i), c.searchParams.set(
1058
1058
  "code_challenge_method",
1059
1059
  o
1060
- ), this.audience && c.searchParams.set("audience", this.audience), (w = this.onAuthorizationUrl) == null || w.call(this, c, {
1060
+ ), this.audience && c.searchParams.set("audience", this.audience), (f = this.onAuthorizationUrl) == null || f.call(this, c, {
1061
1061
  isSignIn: !n,
1062
1062
  isSignUp: n
1063
- }), ((p = a.code_challenge_methods_supported) == null ? void 0 : p.includes("S256")) !== !0) {
1064
- const b = nt();
1065
- c.searchParams.set("state", b);
1063
+ }), ((g = a.code_challenge_methods_supported) == null ? void 0 : g.includes("S256")) !== !0) {
1064
+ const v = nt();
1065
+ c.searchParams.set("state", v);
1066
1066
  }
1067
1067
  location.href = c.href;
1068
1068
  }