@apicurio/common-ui-components 1.0.14 → 2.0.0

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 (2) hide show
  1. package/dist/main.js +1072 -1641
  2. package/package.json +6 -6
package/dist/main.js CHANGED
@@ -1,697 +1,24 @@
1
- import L, { createContext as ot, useContext as at, useState as N, useEffect as Se, memo as ye, forwardRef as Z, useCallback as Re, useMemo as Ue } from "react";
2
- import { jsx as l, jsxs as P, Fragment as oe } from "react/jsx-runtime";
3
- import { EmptyState as ee, EmptyStateVariant as ct, EmptyStateHeader as te, EmptyStateBody as ge, Spinner as X, Alert as lt, Dropdown as dt, MenuToggle as ae, DropdownList as ht, Divider as Le, DropdownItem as gt, Select as be, SelectOption as ke, TextInput as ut, Button as Pe, TextArea as _t, EmptyStateIcon as We, AboutModal as pt, TextContent as ft, Text as Oe, TextVariants as Ae, TextList as Ne, TextListItem as O, Modal as Be, Progress as wt, Pagination as mt, PaginationVariant as vt, Skeleton as St, SearchInput as yt, SelectList as bt, ToolbarItem as kt, InputGroup as Tt, ToolbarToggleGroup as It, ToolbarGroup as Ct, ToolbarFilter as Et } from "@patternfly/react-core";
4
- import { EllipsisVIcon as xt, ChevronDownIcon as Rt, ChevronRightIcon as Ut, ErrorCircleOIcon as Pt, FilterIcon as $e } from "@patternfly/react-icons";
5
- import { DateTime as de } from "luxon";
6
- import { Tr as se, Td as Te, Th as Ot, Table as At, Thead as Nt, Tbody as qt, ActionsColumn as Ht } from "@patternfly/react-table";
7
- import jt from "use-resize-observer";
1
+ import j, { createContext as ot, useContext as at, useState as E, useEffect as we, memo as ve, forwardRef as X, useCallback as Ce, useMemo as Re } from "react";
2
+ import { jsx as c, jsxs as m, Fragment as re } from "react/jsx-runtime";
3
+ import { EmptyState as Y, EmptyStateVariant as ct, EmptyStateHeader as Z, EmptyStateBody as de, Spinner as B, Alert as lt, Dropdown as dt, MenuToggle as ne, DropdownList as ht, Divider as De, DropdownItem as gt, Select as Se, SelectOption as be, TextInput as ut, Button as xe, TextArea as _t, EmptyStateIcon as Fe, AboutModal as pt, TextContent as ft, Text as Ue, TextVariants as Pe, TextList as Oe, TextListItem as y, Modal as $e, Progress as mt, Pagination as wt, PaginationVariant as vt, Skeleton as St, SearchInput as bt, SelectList as yt, ToolbarItem as kt, InputGroup as Tt, ToolbarToggleGroup as It, ToolbarGroup as Et, ToolbarFilter as Ct } from "@patternfly/react-core";
4
+ import { EllipsisVIcon as Rt, ChevronDownIcon as xt, ChevronRightIcon as Ut, ErrorCircleOIcon as Pt, FilterIcon as Le } from "@patternfly/react-icons";
5
+ import { DateTime as ae } from "luxon";
6
+ import { Tr as ee, Td as ye, Th as Ot, Table as At, Thead as Nt, Tbody as qt, ActionsColumn as jt } from "@patternfly/react-table";
7
+ import Ht from "use-resize-observer";
8
8
  const Mt = ot({
9
9
  type: "none"
10
10
  });
11
- var K = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
12
- function ce(e) {
13
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
11
+ class J extends Error {
14
12
  }
13
+ J.prototype.name = "InvalidTokenError";
15
14
  function Dt(e) {
16
- if (e.__esModule)
17
- return e;
18
- var t = e.default;
19
- if (typeof t == "function") {
20
- var s = function i() {
21
- return this instanceof i ? Reflect.construct(t, arguments, this.constructor) : t.apply(this, arguments);
22
- };
23
- s.prototype = t.prototype;
24
- } else
25
- s = {};
26
- return Object.defineProperty(s, "__esModule", { value: !0 }), Object.keys(e).forEach(function(i) {
27
- var r = Object.getOwnPropertyDescriptor(e, i);
28
- Object.defineProperty(s, i, r.get ? r : {
29
- enumerable: !0,
30
- get: function() {
31
- return e[i];
32
- }
33
- });
34
- }), s;
15
+ return decodeURIComponent(atob(e).replace(/(.)/g, (t, s) => {
16
+ let i = s.charCodeAt(0).toString(16).toUpperCase();
17
+ return i.length < 2 && (i = "0" + i), "%" + i;
18
+ }));
35
19
  }
36
20
  function Ft(e) {
37
- throw new Error('Could not dynamically require "' + e + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
38
- }
39
- var ze = { exports: {} };
40
- const Lt = {}, Wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
41
- __proto__: null,
42
- default: Lt
43
- }, Symbol.toStringTag, { value: "Module" })), Bt = /* @__PURE__ */ Dt(Wt);
44
- (function(e, t) {
45
- (function(s, i) {
46
- e.exports = i();
47
- })(K, function() {
48
- var s = s || function(i, r) {
49
- var n;
50
- if (typeof window < "u" && window.crypto && (n = window.crypto), typeof self < "u" && self.crypto && (n = self.crypto), typeof globalThis < "u" && globalThis.crypto && (n = globalThis.crypto), !n && typeof window < "u" && window.msCrypto && (n = window.msCrypto), !n && typeof K < "u" && K.crypto && (n = K.crypto), !n && typeof Ft == "function")
51
- try {
52
- n = Bt;
53
- } catch {
54
- }
55
- var o = function() {
56
- if (n) {
57
- if (typeof n.getRandomValues == "function")
58
- try {
59
- return n.getRandomValues(new Uint32Array(1))[0];
60
- } catch {
61
- }
62
- if (typeof n.randomBytes == "function")
63
- try {
64
- return n.randomBytes(4).readInt32LE();
65
- } catch {
66
- }
67
- }
68
- throw new Error("Native crypto module could not be used to get secure random number.");
69
- }, a = Object.create || /* @__PURE__ */ function() {
70
- function d() {
71
- }
72
- return function(g) {
73
- var f;
74
- return d.prototype = g, f = new d(), d.prototype = null, f;
75
- };
76
- }(), c = {}, h = c.lib = {}, u = h.Base = /* @__PURE__ */ function() {
77
- return {
78
- /**
79
- * Creates a new object that inherits from this object.
80
- *
81
- * @param {Object} overrides Properties to copy into the new object.
82
- *
83
- * @return {Object} The new object.
84
- *
85
- * @static
86
- *
87
- * @example
88
- *
89
- * var MyType = CryptoJS.lib.Base.extend({
90
- * field: 'value',
91
- *
92
- * method: function () {
93
- * }
94
- * });
95
- */
96
- extend: function(d) {
97
- var g = a(this);
98
- return d && g.mixIn(d), (!g.hasOwnProperty("init") || this.init === g.init) && (g.init = function() {
99
- g.$super.init.apply(this, arguments);
100
- }), g.init.prototype = g, g.$super = this, g;
101
- },
102
- /**
103
- * Extends this object and runs the init method.
104
- * Arguments to create() will be passed to init().
105
- *
106
- * @return {Object} The new object.
107
- *
108
- * @static
109
- *
110
- * @example
111
- *
112
- * var instance = MyType.create();
113
- */
114
- create: function() {
115
- var d = this.extend();
116
- return d.init.apply(d, arguments), d;
117
- },
118
- /**
119
- * Initializes a newly created object.
120
- * Override this method to add some logic when your objects are created.
121
- *
122
- * @example
123
- *
124
- * var MyType = CryptoJS.lib.Base.extend({
125
- * init: function () {
126
- * // ...
127
- * }
128
- * });
129
- */
130
- init: function() {
131
- },
132
- /**
133
- * Copies properties into this object.
134
- *
135
- * @param {Object} properties The properties to mix in.
136
- *
137
- * @example
138
- *
139
- * MyType.mixIn({
140
- * field: 'value'
141
- * });
142
- */
143
- mixIn: function(d) {
144
- for (var g in d)
145
- d.hasOwnProperty(g) && (this[g] = d[g]);
146
- d.hasOwnProperty("toString") && (this.toString = d.toString);
147
- },
148
- /**
149
- * Creates a copy of this object.
150
- *
151
- * @return {Object} The clone.
152
- *
153
- * @example
154
- *
155
- * var clone = instance.clone();
156
- */
157
- clone: function() {
158
- return this.init.prototype.extend(this);
159
- }
160
- };
161
- }(), _ = h.WordArray = u.extend({
162
- /**
163
- * Initializes a newly created word array.
164
- *
165
- * @param {Array} words (Optional) An array of 32-bit words.
166
- * @param {number} sigBytes (Optional) The number of significant bytes in the words.
167
- *
168
- * @example
169
- *
170
- * var wordArray = CryptoJS.lib.WordArray.create();
171
- * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
172
- * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
173
- */
174
- init: function(d, g) {
175
- d = this.words = d || [], g != r ? this.sigBytes = g : this.sigBytes = d.length * 4;
176
- },
177
- /**
178
- * Converts this word array to a string.
179
- *
180
- * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
181
- *
182
- * @return {string} The stringified word array.
183
- *
184
- * @example
185
- *
186
- * var string = wordArray + '';
187
- * var string = wordArray.toString();
188
- * var string = wordArray.toString(CryptoJS.enc.Utf8);
189
- */
190
- toString: function(d) {
191
- return (d || w).stringify(this);
192
- },
193
- /**
194
- * Concatenates a word array to this word array.
195
- *
196
- * @param {WordArray} wordArray The word array to append.
197
- *
198
- * @return {WordArray} This word array.
199
- *
200
- * @example
201
- *
202
- * wordArray1.concat(wordArray2);
203
- */
204
- concat: function(d) {
205
- var g = this.words, f = d.words, m = this.sigBytes, k = d.sigBytes;
206
- if (this.clamp(), m % 4)
207
- for (var T = 0; T < k; T++) {
208
- var R = f[T >>> 2] >>> 24 - T % 4 * 8 & 255;
209
- g[m + T >>> 2] |= R << 24 - (m + T) % 4 * 8;
210
- }
211
- else
212
- for (var U = 0; U < k; U += 4)
213
- g[m + U >>> 2] = f[U >>> 2];
214
- return this.sigBytes += k, this;
215
- },
216
- /**
217
- * Removes insignificant bits.
218
- *
219
- * @example
220
- *
221
- * wordArray.clamp();
222
- */
223
- clamp: function() {
224
- var d = this.words, g = this.sigBytes;
225
- d[g >>> 2] &= 4294967295 << 32 - g % 4 * 8, d.length = i.ceil(g / 4);
226
- },
227
- /**
228
- * Creates a copy of this word array.
229
- *
230
- * @return {WordArray} The clone.
231
- *
232
- * @example
233
- *
234
- * var clone = wordArray.clone();
235
- */
236
- clone: function() {
237
- var d = u.clone.call(this);
238
- return d.words = this.words.slice(0), d;
239
- },
240
- /**
241
- * Creates a word array filled with random bytes.
242
- *
243
- * @param {number} nBytes The number of random bytes to generate.
244
- *
245
- * @return {WordArray} The random word array.
246
- *
247
- * @static
248
- *
249
- * @example
250
- *
251
- * var wordArray = CryptoJS.lib.WordArray.random(16);
252
- */
253
- random: function(d) {
254
- for (var g = [], f = 0; f < d; f += 4)
255
- g.push(o());
256
- return new _.init(g, d);
257
- }
258
- }), y = c.enc = {}, w = y.Hex = {
259
- /**
260
- * Converts a word array to a hex string.
261
- *
262
- * @param {WordArray} wordArray The word array.
263
- *
264
- * @return {string} The hex string.
265
- *
266
- * @static
267
- *
268
- * @example
269
- *
270
- * var hexString = CryptoJS.enc.Hex.stringify(wordArray);
271
- */
272
- stringify: function(d) {
273
- for (var g = d.words, f = d.sigBytes, m = [], k = 0; k < f; k++) {
274
- var T = g[k >>> 2] >>> 24 - k % 4 * 8 & 255;
275
- m.push((T >>> 4).toString(16)), m.push((T & 15).toString(16));
276
- }
277
- return m.join("");
278
- },
279
- /**
280
- * Converts a hex string to a word array.
281
- *
282
- * @param {string} hexStr The hex string.
283
- *
284
- * @return {WordArray} The word array.
285
- *
286
- * @static
287
- *
288
- * @example
289
- *
290
- * var wordArray = CryptoJS.enc.Hex.parse(hexString);
291
- */
292
- parse: function(d) {
293
- for (var g = d.length, f = [], m = 0; m < g; m += 2)
294
- f[m >>> 3] |= parseInt(d.substr(m, 2), 16) << 24 - m % 8 * 4;
295
- return new _.init(f, g / 2);
296
- }
297
- }, C = y.Latin1 = {
298
- /**
299
- * Converts a word array to a Latin1 string.
300
- *
301
- * @param {WordArray} wordArray The word array.
302
- *
303
- * @return {string} The Latin1 string.
304
- *
305
- * @static
306
- *
307
- * @example
308
- *
309
- * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
310
- */
311
- stringify: function(d) {
312
- for (var g = d.words, f = d.sigBytes, m = [], k = 0; k < f; k++) {
313
- var T = g[k >>> 2] >>> 24 - k % 4 * 8 & 255;
314
- m.push(String.fromCharCode(T));
315
- }
316
- return m.join("");
317
- },
318
- /**
319
- * Converts a Latin1 string to a word array.
320
- *
321
- * @param {string} latin1Str The Latin1 string.
322
- *
323
- * @return {WordArray} The word array.
324
- *
325
- * @static
326
- *
327
- * @example
328
- *
329
- * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
330
- */
331
- parse: function(d) {
332
- for (var g = d.length, f = [], m = 0; m < g; m++)
333
- f[m >>> 2] |= (d.charCodeAt(m) & 255) << 24 - m % 4 * 8;
334
- return new _.init(f, g);
335
- }
336
- }, p = y.Utf8 = {
337
- /**
338
- * Converts a word array to a UTF-8 string.
339
- *
340
- * @param {WordArray} wordArray The word array.
341
- *
342
- * @return {string} The UTF-8 string.
343
- *
344
- * @static
345
- *
346
- * @example
347
- *
348
- * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
349
- */
350
- stringify: function(d) {
351
- try {
352
- return decodeURIComponent(escape(C.stringify(d)));
353
- } catch {
354
- throw new Error("Malformed UTF-8 data");
355
- }
356
- },
357
- /**
358
- * Converts a UTF-8 string to a word array.
359
- *
360
- * @param {string} utf8Str The UTF-8 string.
361
- *
362
- * @return {WordArray} The word array.
363
- *
364
- * @static
365
- *
366
- * @example
367
- *
368
- * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
369
- */
370
- parse: function(d) {
371
- return C.parse(unescape(encodeURIComponent(d)));
372
- }
373
- }, S = h.BufferedBlockAlgorithm = u.extend({
374
- /**
375
- * Resets this block algorithm's data buffer to its initial state.
376
- *
377
- * @example
378
- *
379
- * bufferedBlockAlgorithm.reset();
380
- */
381
- reset: function() {
382
- this._data = new _.init(), this._nDataBytes = 0;
383
- },
384
- /**
385
- * Adds new data to this block algorithm's buffer.
386
- *
387
- * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
388
- *
389
- * @example
390
- *
391
- * bufferedBlockAlgorithm._append('data');
392
- * bufferedBlockAlgorithm._append(wordArray);
393
- */
394
- _append: function(d) {
395
- typeof d == "string" && (d = p.parse(d)), this._data.concat(d), this._nDataBytes += d.sigBytes;
396
- },
397
- /**
398
- * Processes available data blocks.
399
- *
400
- * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
401
- *
402
- * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
403
- *
404
- * @return {WordArray} The processed data.
405
- *
406
- * @example
407
- *
408
- * var processedData = bufferedBlockAlgorithm._process();
409
- * var processedData = bufferedBlockAlgorithm._process(!!'flush');
410
- */
411
- _process: function(d) {
412
- var g, f = this._data, m = f.words, k = f.sigBytes, T = this.blockSize, R = T * 4, U = k / R;
413
- d ? U = i.ceil(U) : U = i.max((U | 0) - this._minBufferSize, 0);
414
- var H = U * T, b = i.min(H * 4, k);
415
- if (H) {
416
- for (var x = 0; x < H; x += T)
417
- this._doProcessBlock(m, x);
418
- g = m.splice(0, H), f.sigBytes -= b;
419
- }
420
- return new _.init(g, b);
421
- },
422
- /**
423
- * Creates a copy of this object.
424
- *
425
- * @return {Object} The clone.
426
- *
427
- * @example
428
- *
429
- * var clone = bufferedBlockAlgorithm.clone();
430
- */
431
- clone: function() {
432
- var d = u.clone.call(this);
433
- return d._data = this._data.clone(), d;
434
- },
435
- _minBufferSize: 0
436
- });
437
- h.Hasher = S.extend({
438
- /**
439
- * Configuration options.
440
- */
441
- cfg: u.extend(),
442
- /**
443
- * Initializes a newly created hasher.
444
- *
445
- * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
446
- *
447
- * @example
448
- *
449
- * var hasher = CryptoJS.algo.SHA256.create();
450
- */
451
- init: function(d) {
452
- this.cfg = this.cfg.extend(d), this.reset();
453
- },
454
- /**
455
- * Resets this hasher to its initial state.
456
- *
457
- * @example
458
- *
459
- * hasher.reset();
460
- */
461
- reset: function() {
462
- S.reset.call(this), this._doReset();
463
- },
464
- /**
465
- * Updates this hasher with a message.
466
- *
467
- * @param {WordArray|string} messageUpdate The message to append.
468
- *
469
- * @return {Hasher} This hasher.
470
- *
471
- * @example
472
- *
473
- * hasher.update('message');
474
- * hasher.update(wordArray);
475
- */
476
- update: function(d) {
477
- return this._append(d), this._process(), this;
478
- },
479
- /**
480
- * Finalizes the hash computation.
481
- * Note that the finalize operation is effectively a destructive, read-once operation.
482
- *
483
- * @param {WordArray|string} messageUpdate (Optional) A final message update.
484
- *
485
- * @return {WordArray} The hash.
486
- *
487
- * @example
488
- *
489
- * var hash = hasher.finalize();
490
- * var hash = hasher.finalize('message');
491
- * var hash = hasher.finalize(wordArray);
492
- */
493
- finalize: function(d) {
494
- d && this._append(d);
495
- var g = this._doFinalize();
496
- return g;
497
- },
498
- blockSize: 16,
499
- /**
500
- * Creates a shortcut function to a hasher's object interface.
501
- *
502
- * @param {Hasher} hasher The hasher to create a helper for.
503
- *
504
- * @return {Function} The shortcut function.
505
- *
506
- * @static
507
- *
508
- * @example
509
- *
510
- * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
511
- */
512
- _createHelper: function(d) {
513
- return function(g, f) {
514
- return new d.init(f).finalize(g);
515
- };
516
- },
517
- /**
518
- * Creates a shortcut function to the HMAC's object interface.
519
- *
520
- * @param {Hasher} hasher The hasher to use in this HMAC helper.
521
- *
522
- * @return {Function} The shortcut function.
523
- *
524
- * @static
525
- *
526
- * @example
527
- *
528
- * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
529
- */
530
- _createHmacHelper: function(d) {
531
- return function(g, f) {
532
- return new E.HMAC.init(d, f).finalize(g);
533
- };
534
- }
535
- });
536
- var E = c.algo = {};
537
- return c;
538
- }(Math);
539
- return s;
540
- });
541
- })(ze);
542
- var le = ze.exports;
543
- const $t = /* @__PURE__ */ ce(le);
544
- var Ke = { exports: {} };
545
- (function(e, t) {
546
- (function(s, i) {
547
- e.exports = i(le);
548
- })(K, function(s) {
549
- return function(i) {
550
- var r = s, n = r.lib, o = n.WordArray, a = n.Hasher, c = r.algo, h = [], u = [];
551
- (function() {
552
- function w(E) {
553
- for (var d = i.sqrt(E), g = 2; g <= d; g++)
554
- if (!(E % g))
555
- return !1;
556
- return !0;
557
- }
558
- function C(E) {
559
- return (E - (E | 0)) * 4294967296 | 0;
560
- }
561
- for (var p = 2, S = 0; S < 64; )
562
- w(p) && (S < 8 && (h[S] = C(i.pow(p, 1 / 2))), u[S] = C(i.pow(p, 1 / 3)), S++), p++;
563
- })();
564
- var _ = [], y = c.SHA256 = a.extend({
565
- _doReset: function() {
566
- this._hash = new o.init(h.slice(0));
567
- },
568
- _doProcessBlock: function(w, C) {
569
- for (var p = this._hash.words, S = p[0], E = p[1], d = p[2], g = p[3], f = p[4], m = p[5], k = p[6], T = p[7], R = 0; R < 64; R++) {
570
- if (R < 16)
571
- _[R] = w[C + R] | 0;
572
- else {
573
- var U = _[R - 15], H = (U << 25 | U >>> 7) ^ (U << 14 | U >>> 18) ^ U >>> 3, b = _[R - 2], x = (b << 15 | b >>> 17) ^ (b << 13 | b >>> 19) ^ b >>> 10;
574
- _[R] = H + _[R - 7] + x + _[R - 16];
575
- }
576
- var A = f & m ^ ~f & k, W = S & E ^ S & d ^ E & d, B = (S << 30 | S >>> 2) ^ (S << 19 | S >>> 13) ^ (S << 10 | S >>> 22), z = (f << 26 | f >>> 6) ^ (f << 21 | f >>> 11) ^ (f << 7 | f >>> 25), V = T + z + A + u[R] + _[R], G = B + W;
577
- T = k, k = m, m = f, f = g + V | 0, g = d, d = E, E = S, S = V + G | 0;
578
- }
579
- p[0] = p[0] + S | 0, p[1] = p[1] + E | 0, p[2] = p[2] + d | 0, p[3] = p[3] + g | 0, p[4] = p[4] + f | 0, p[5] = p[5] + m | 0, p[6] = p[6] + k | 0, p[7] = p[7] + T | 0;
580
- },
581
- _doFinalize: function() {
582
- var w = this._data, C = w.words, p = this._nDataBytes * 8, S = w.sigBytes * 8;
583
- return C[S >>> 5] |= 128 << 24 - S % 32, C[(S + 64 >>> 9 << 4) + 14] = i.floor(p / 4294967296), C[(S + 64 >>> 9 << 4) + 15] = p, w.sigBytes = C.length * 4, this._process(), this._hash;
584
- },
585
- clone: function() {
586
- var w = a.clone.call(this);
587
- return w._hash = this._hash.clone(), w;
588
- }
589
- });
590
- r.SHA256 = a._createHelper(y), r.HmacSHA256 = a._createHmacHelper(y);
591
- }(Math), s.SHA256;
592
- });
593
- })(Ke);
594
- var zt = Ke.exports;
595
- const Kt = /* @__PURE__ */ ce(zt);
596
- var Je = { exports: {} };
597
- (function(e, t) {
598
- (function(s, i) {
599
- e.exports = i(le);
600
- })(K, function(s) {
601
- return function() {
602
- var i = s, r = i.lib, n = r.WordArray, o = i.enc;
603
- o.Base64 = {
604
- /**
605
- * Converts a word array to a Base64 string.
606
- *
607
- * @param {WordArray} wordArray The word array.
608
- *
609
- * @return {string} The Base64 string.
610
- *
611
- * @static
612
- *
613
- * @example
614
- *
615
- * var base64String = CryptoJS.enc.Base64.stringify(wordArray);
616
- */
617
- stringify: function(c) {
618
- var h = c.words, u = c.sigBytes, _ = this._map;
619
- c.clamp();
620
- for (var y = [], w = 0; w < u; w += 3)
621
- for (var C = h[w >>> 2] >>> 24 - w % 4 * 8 & 255, p = h[w + 1 >>> 2] >>> 24 - (w + 1) % 4 * 8 & 255, S = h[w + 2 >>> 2] >>> 24 - (w + 2) % 4 * 8 & 255, E = C << 16 | p << 8 | S, d = 0; d < 4 && w + d * 0.75 < u; d++)
622
- y.push(_.charAt(E >>> 6 * (3 - d) & 63));
623
- var g = _.charAt(64);
624
- if (g)
625
- for (; y.length % 4; )
626
- y.push(g);
627
- return y.join("");
628
- },
629
- /**
630
- * Converts a Base64 string to a word array.
631
- *
632
- * @param {string} base64Str The Base64 string.
633
- *
634
- * @return {WordArray} The word array.
635
- *
636
- * @static
637
- *
638
- * @example
639
- *
640
- * var wordArray = CryptoJS.enc.Base64.parse(base64String);
641
- */
642
- parse: function(c) {
643
- var h = c.length, u = this._map, _ = this._reverseMap;
644
- if (!_) {
645
- _ = this._reverseMap = [];
646
- for (var y = 0; y < u.length; y++)
647
- _[u.charCodeAt(y)] = y;
648
- }
649
- var w = u.charAt(64);
650
- if (w) {
651
- var C = c.indexOf(w);
652
- C !== -1 && (h = C);
653
- }
654
- return a(c, h, _);
655
- },
656
- _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
657
- };
658
- function a(c, h, u) {
659
- for (var _ = [], y = 0, w = 0; w < h; w++)
660
- if (w % 4) {
661
- var C = u[c.charCodeAt(w - 1)] << w % 4 * 2, p = u[c.charCodeAt(w)] >>> 6 - w % 4 * 2, S = C | p;
662
- _[y >>> 2] |= S << 24 - y % 4 * 8, y++;
663
- }
664
- return n.create(_, y);
665
- }
666
- }(), s.enc.Base64;
667
- });
668
- })(Je);
669
- var Jt = Je.exports;
670
- const qe = /* @__PURE__ */ ce(Jt);
671
- var Ve = { exports: {} };
672
- (function(e, t) {
673
- (function(s, i) {
674
- e.exports = i(le);
675
- })(K, function(s) {
676
- return s.enc.Utf8;
677
- });
678
- })(Ve);
679
- var Vt = Ve.exports;
680
- const Gt = /* @__PURE__ */ ce(Vt);
681
- function ue(e) {
682
- this.message = e;
683
- }
684
- ue.prototype = new Error(), ue.prototype.name = "InvalidCharacterError";
685
- var He = typeof window < "u" && window.atob && window.atob.bind(window) || function(e) {
686
- var t = String(e).replace(/=+$/, "");
687
- if (t.length % 4 == 1)
688
- throw new ue("'atob' failed: The string to be decoded is not correctly encoded.");
689
- for (var s, i, r = 0, n = 0, o = ""; i = t.charAt(n++); ~i && (s = r % 4 ? 64 * s + i : i, r++ % 4) ? o += String.fromCharCode(255 & s >> (-2 * r & 6)) : 0)
690
- i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);
691
- return o;
692
- };
693
- function Qt(e) {
694
- var t = e.replace(/-/g, "+").replace(/_/g, "/");
21
+ let t = e.replace(/-/g, "+").replace(/_/g, "/");
695
22
  switch (t.length % 4) {
696
23
  case 0:
697
24
  break;
@@ -702,34 +29,34 @@ function Qt(e) {
702
29
  t += "=";
703
30
  break;
704
31
  default:
705
- throw "Illegal base64url string!";
32
+ throw new Error("base64 string is not of the correct length");
706
33
  }
707
34
  try {
708
- return function(s) {
709
- return decodeURIComponent(He(s).replace(/(.)/g, function(i, r) {
710
- var n = r.charCodeAt(0).toString(16).toUpperCase();
711
- return n.length < 2 && (n = "0" + n), "%" + n;
712
- }));
713
- }(t);
35
+ return Dt(t);
714
36
  } catch {
715
- return He(t);
37
+ return atob(t);
716
38
  }
717
39
  }
718
- function ie(e) {
719
- this.message = e;
720
- }
721
- function Xt(e, t) {
40
+ function $t(e, t) {
722
41
  if (typeof e != "string")
723
- throw new ie("Invalid token specified");
724
- var s = (t = t || {}).header === !0 ? 0 : 1;
42
+ throw new J("Invalid token specified: must be a string");
43
+ t || (t = {});
44
+ const s = t.header === !0 ? 0 : 1, i = e.split(".")[s];
45
+ if (typeof i != "string")
46
+ throw new J(`Invalid token specified: missing part #${s + 1}`);
47
+ let r;
725
48
  try {
726
- return JSON.parse(Qt(e.split(".")[s]));
727
- } catch (i) {
728
- throw new ie("Invalid token specified: " + i.message);
49
+ r = Ft(i);
50
+ } catch (n) {
51
+ throw new J(`Invalid token specified: invalid base64 for part #${s + 1} (${n.message})`);
52
+ }
53
+ try {
54
+ return JSON.parse(r);
55
+ } catch (n) {
56
+ throw new J(`Invalid token specified: invalid json for part #${s + 1} (${n.message})`);
729
57
  }
730
58
  }
731
- ie.prototype = new Error(), ie.prototype.name = "InvalidTokenError";
732
- var Yt = {
59
+ var Lt = {
733
60
  debug: () => {
734
61
  },
735
62
  info: () => {
@@ -738,113 +65,116 @@ var Yt = {
738
65
  },
739
66
  error: () => {
740
67
  }
741
- }, j, M, re = /* @__PURE__ */ ((e) => (e[e.NONE = 0] = "NONE", e[e.ERROR = 1] = "ERROR", e[e.WARN = 2] = "WARN", e[e.INFO = 3] = "INFO", e[e.DEBUG = 4] = "DEBUG", e))(re || {});
68
+ }, A, N, te = /* @__PURE__ */ ((e) => (e[e.NONE = 0] = "NONE", e[e.ERROR = 1] = "ERROR", e[e.WARN = 2] = "WARN", e[e.INFO = 3] = "INFO", e[e.DEBUG = 4] = "DEBUG", e))(te || {});
742
69
  ((e) => {
743
70
  function t() {
744
- j = 3, M = Yt;
71
+ A = 3, N = Lt;
745
72
  }
746
73
  e.reset = t;
747
74
  function s(r) {
748
75
  if (!(0 <= r && r <= 4))
749
76
  throw new Error("Invalid log level");
750
- j = r;
77
+ A = r;
751
78
  }
752
79
  e.setLevel = s;
753
80
  function i(r) {
754
- M = r;
81
+ N = r;
755
82
  }
756
83
  e.setLogger = i;
757
- })(re || (re = {}));
758
- var v = class {
759
- constructor(e) {
760
- this._name = e;
84
+ })(te || (te = {}));
85
+ var u = class O {
86
+ constructor(t) {
87
+ this._name = t;
761
88
  }
762
89
  /* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */
763
- debug(...e) {
764
- j >= 4 && M.debug(v._format(this._name, this._method), ...e);
90
+ debug(...t) {
91
+ A >= 4 && N.debug(O._format(this._name, this._method), ...t);
765
92
  }
766
- info(...e) {
767
- j >= 3 && M.info(v._format(this._name, this._method), ...e);
93
+ info(...t) {
94
+ A >= 3 && N.info(O._format(this._name, this._method), ...t);
768
95
  }
769
- warn(...e) {
770
- j >= 2 && M.warn(v._format(this._name, this._method), ...e);
96
+ warn(...t) {
97
+ A >= 2 && N.warn(O._format(this._name, this._method), ...t);
771
98
  }
772
- error(...e) {
773
- j >= 1 && M.error(v._format(this._name, this._method), ...e);
99
+ error(...t) {
100
+ A >= 1 && N.error(O._format(this._name, this._method), ...t);
774
101
  }
775
102
  /* eslint-enable @typescript-eslint/no-unsafe-enum-comparison */
776
- throw(e) {
777
- throw this.error(e), e;
103
+ throw(t) {
104
+ throw this.error(t), t;
778
105
  }
779
- create(e) {
780
- const t = Object.create(this);
781
- return t._method = e, t.debug("begin"), t;
106
+ create(t) {
107
+ const s = Object.create(this);
108
+ return s._method = t, s.debug("begin"), s;
782
109
  }
783
- static createStatic(e, t) {
784
- const s = new v(`${e}.${t}`);
785
- return s.debug("begin"), s;
110
+ static createStatic(t, s) {
111
+ const i = new O(`${t}.${s}`);
112
+ return i.debug("begin"), i;
786
113
  }
787
- static _format(e, t) {
788
- const s = `[${e}]`;
789
- return t ? `${s} ${t}:` : s;
114
+ static _format(t, s) {
115
+ const i = `[${t}]`;
116
+ return s ? `${i} ${s}:` : i;
790
117
  }
791
118
  /* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */
792
119
  // helpers for static class methods
793
- static debug(e, ...t) {
794
- j >= 4 && M.debug(v._format(e), ...t);
120
+ static debug(t, ...s) {
121
+ A >= 4 && N.debug(O._format(t), ...s);
795
122
  }
796
- static info(e, ...t) {
797
- j >= 3 && M.info(v._format(e), ...t);
123
+ static info(t, ...s) {
124
+ A >= 3 && N.info(O._format(t), ...s);
798
125
  }
799
- static warn(e, ...t) {
800
- j >= 2 && M.warn(v._format(e), ...t);
126
+ static warn(t, ...s) {
127
+ A >= 2 && N.warn(O._format(t), ...s);
801
128
  }
802
- static error(e, ...t) {
803
- j >= 1 && M.error(v._format(e), ...t);
129
+ static error(t, ...s) {
130
+ A >= 1 && N.error(O._format(t), ...s);
804
131
  }
805
132
  /* eslint-enable @typescript-eslint/no-unsafe-enum-comparison */
806
133
  };
807
- re.reset();
808
- var Zt = "10000000-1000-4000-8000-100000000000", F = class {
134
+ te.reset();
135
+ var Wt = "10000000-1000-4000-8000-100000000000", Ae = (e) => btoa([...new Uint8Array(e)].map((t) => String.fromCharCode(t)).join("")), K = class V {
809
136
  static _randomWord() {
810
- return $t.lib.WordArray.random(1).words[0];
137
+ const t = new Uint32Array(1);
138
+ return crypto.getRandomValues(t), t[0];
811
139
  }
812
140
  /**
813
141
  * Generates RFC4122 version 4 guid
814
142
  */
815
143
  static generateUUIDv4() {
816
- return Zt.replace(
144
+ return Wt.replace(
817
145
  /[018]/g,
818
- (t) => (+t ^ F._randomWord() & 15 >> +t / 4).toString(16)
146
+ (s) => (+s ^ V._randomWord() & 15 >> +s / 4).toString(16)
819
147
  ).replace(/-/g, "");
820
148
  }
821
149
  /**
822
150
  * PKCE: Generate a code verifier
823
151
  */
824
152
  static generateCodeVerifier() {
825
- return F.generateUUIDv4() + F.generateUUIDv4() + F.generateUUIDv4();
153
+ return V.generateUUIDv4() + V.generateUUIDv4() + V.generateUUIDv4();
826
154
  }
827
155
  /**
828
156
  * PKCE: Generate a code challenge
829
157
  */
830
- static generateCodeChallenge(e) {
158
+ static async generateCodeChallenge(t) {
159
+ if (!crypto.subtle)
160
+ throw new Error("Crypto.subtle is available only in secure contexts (HTTPS).");
831
161
  try {
832
- const t = Kt(e);
833
- return qe.stringify(t).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
834
- } catch (t) {
835
- throw v.error("CryptoUtils.generateCodeChallenge", t), t;
162
+ const i = new TextEncoder().encode(t), r = await crypto.subtle.digest("SHA-256", i);
163
+ return Ae(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
164
+ } catch (s) {
165
+ throw u.error("CryptoUtils.generateCodeChallenge", s), s;
836
166
  }
837
167
  }
838
168
  /**
839
169
  * Generates a base64-encoded string for a basic auth header
840
170
  */
841
- static generateBasicAuth(e, t) {
842
- const s = Gt.parse([e, t].join(":"));
843
- return qe.stringify(s);
171
+ static generateBasicAuth(t, s) {
172
+ const r = new TextEncoder().encode([t, s].join(":"));
173
+ return Ae(r);
844
174
  }
845
- }, $ = class {
175
+ }, F = class {
846
176
  constructor(e) {
847
- this._name = e, this._logger = new v(`Event('${this._name}')`), this._callbacks = [];
177
+ this._name = e, this._logger = new u(`Event('${this._name}')`), this._callbacks = [];
848
178
  }
849
179
  addHandler(e) {
850
180
  return this._callbacks.push(e), () => this.removeHandler(e);
@@ -853,21 +183,21 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
853
183
  const t = this._callbacks.lastIndexOf(e);
854
184
  t >= 0 && this._callbacks.splice(t, 1);
855
185
  }
856
- raise(...e) {
186
+ async raise(...e) {
857
187
  this._logger.debug("raise:", ...e);
858
188
  for (const t of this._callbacks)
859
- t(...e);
189
+ await t(...e);
860
190
  }
861
- }, _e = class {
191
+ }, he = class {
862
192
  // IMPORTANT: doesn't validate the token
863
193
  static decode(e) {
864
194
  try {
865
- return Xt(e);
195
+ return $t(e);
866
196
  } catch (t) {
867
- throw v.error("JwtUtils.decode", t), t;
197
+ throw u.error("JwtUtils.decode", t), t;
868
198
  }
869
199
  }
870
- }, je = class {
200
+ }, Ne = class {
871
201
  /**
872
202
  * Populates a map of window features with a placement centered in front of
873
203
  * the current window. If no explicit width is given, a default value is
@@ -880,28 +210,28 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
880
210
  static serialize(e) {
881
211
  return Object.entries(e).filter(([, t]) => t != null).map(([t, s]) => `${t}=${typeof s != "boolean" ? s : s ? "yes" : "no"}`).join(",");
882
212
  }
883
- }, q = class extends $ {
213
+ }, D = class Q extends F {
884
214
  constructor() {
885
- super(...arguments), this._logger = new v(`Timer('${this._name}')`), this._timerHandle = null, this._expiration = 0, this._callback = () => {
886
- const e = this._expiration - q.getEpochTime();
887
- this._logger.debug("timer completes in", e), this._expiration <= q.getEpochTime() && (this.cancel(), super.raise());
215
+ super(...arguments), this._logger = new u(`Timer('${this._name}')`), this._timerHandle = null, this._expiration = 0, this._callback = () => {
216
+ const t = this._expiration - Q.getEpochTime();
217
+ this._logger.debug("timer completes in", t), this._expiration <= Q.getEpochTime() && (this.cancel(), super.raise());
888
218
  };
889
219
  }
890
220
  // get the time
891
221
  static getEpochTime() {
892
222
  return Math.floor(Date.now() / 1e3);
893
223
  }
894
- init(e) {
895
- const t = this._logger.create("init");
896
- e = Math.max(Math.floor(e), 1);
897
- const s = q.getEpochTime() + e;
898
- if (this.expiration === s && this._timerHandle) {
899
- t.debug("skipping since already initialized for expiration at", this.expiration);
224
+ init(t) {
225
+ const s = this._logger.create("init");
226
+ t = Math.max(Math.floor(t), 1);
227
+ const i = Q.getEpochTime() + t;
228
+ if (this.expiration === i && this._timerHandle) {
229
+ s.debug("skipping since already initialized for expiration at", this.expiration);
900
230
  return;
901
231
  }
902
- this.cancel(), t.debug("using duration", e), this._expiration = s;
903
- const i = Math.min(e, 5);
904
- this._timerHandle = setInterval(this._callback, i * 1e3);
232
+ this.cancel(), s.debug("using duration", t), this._expiration = i;
233
+ const r = Math.min(t, 5);
234
+ this._timerHandle = setInterval(this._callback, r * 1e3);
905
235
  }
906
236
  get expiration() {
907
237
  return this._expiration;
@@ -909,27 +239,27 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
909
239
  cancel() {
910
240
  this._logger.create("cancel"), this._timerHandle && (clearInterval(this._timerHandle), this._timerHandle = null);
911
241
  }
912
- }, pe = class {
242
+ }, ge = class {
913
243
  static readParams(e, t = "query") {
914
244
  if (!e)
915
245
  throw new TypeError("Invalid URL");
916
246
  const i = new URL(e, "http://127.0.0.1")[t === "fragment" ? "hash" : "search"];
917
247
  return new URLSearchParams(i.slice(1));
918
248
  }
919
- }, fe = ";", J = class extends Error {
249
+ }, ue = ";", W = class extends Error {
920
250
  constructor(e, t) {
921
251
  var s, i, r;
922
252
  if (super(e.error_description || e.error || ""), this.form = t, this.name = "ErrorResponse", !e.error)
923
- throw v.error("ErrorResponse", "No error passed"), new Error("No error passed");
253
+ throw u.error("ErrorResponse", "No error passed"), new Error("No error passed");
924
254
  this.error = e.error, this.error_description = (s = e.error_description) != null ? s : null, this.error_uri = (i = e.error_uri) != null ? i : null, this.state = e.userState, this.session_state = (r = e.session_state) != null ? r : null, this.url_state = e.url_state;
925
255
  }
926
- }, Ie = class extends Error {
256
+ }, ke = class extends Error {
927
257
  constructor(e) {
928
258
  super(e), this.name = "ErrorTimeout";
929
259
  }
930
- }, es = class {
260
+ }, Kt = class {
931
261
  constructor(e) {
932
- this._logger = new v("AccessTokenEvents"), this._expiringTimer = new q("Access token expiring"), this._expiredTimer = new q("Access token expired"), this._expiringNotificationTimeInSeconds = e.expiringNotificationTimeInSeconds;
262
+ this._logger = new u("AccessTokenEvents"), this._expiringTimer = new D("Access token expiring"), this._expiredTimer = new D("Access token expired"), this._expiringNotificationTimeInSeconds = e.expiringNotificationTimeInSeconds;
933
263
  }
934
264
  load(e) {
935
265
  const t = this._logger.create("load");
@@ -972,10 +302,10 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
972
302
  removeAccessTokenExpired(e) {
973
303
  this._expiredTimer.removeHandler(e);
974
304
  }
975
- }, ts = class {
305
+ }, zt = class {
976
306
  constructor(e, t, s, i, r) {
977
- this._callback = e, this._client_id = t, this._intervalInSeconds = i, this._stopOnError = r, this._logger = new v("CheckSessionIFrame"), this._timer = null, this._session_state = null, this._message = (o) => {
978
- o.origin === this._frame_origin && o.source === this._frame.contentWindow && (o.data === "error" ? (this._logger.error("error message from check session op iframe"), this._stopOnError && this.stop()) : o.data === "changed" ? (this._logger.debug("changed message from check session op iframe"), this.stop(), this._callback()) : this._logger.debug(o.data + " message from check session op iframe"));
307
+ this._callback = e, this._client_id = t, this._intervalInSeconds = i, this._stopOnError = r, this._logger = new u("CheckSessionIFrame"), this._timer = null, this._session_state = null, this._message = (a) => {
308
+ a.origin === this._frame_origin && a.source === this._frame.contentWindow && (a.data === "error" ? (this._logger.error("error message from check session op iframe"), this._stopOnError && this.stop()) : a.data === "changed" ? (this._logger.debug("changed message from check session op iframe"), this.stop(), this._callback()) : this._logger.debug(a.data + " message from check session op iframe"));
979
309
  };
980
310
  const n = new URL(s);
981
311
  this._frame_origin = n.origin, this._frame = window.document.createElement("iframe"), this._frame.style.visibility = "hidden", this._frame.style.position = "fixed", this._frame.style.left = "-1000px", this._frame.style.top = "0", this._frame.width = "0", this._frame.height = "0", this._frame.src = n.href;
@@ -999,9 +329,9 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
999
329
  stop() {
1000
330
  this._logger.create("stop"), this._session_state = null, this._timer && (clearInterval(this._timer), this._timer = null);
1001
331
  }
1002
- }, Ge = class {
332
+ }, We = class {
1003
333
  constructor() {
1004
- this._logger = new v("InMemoryWebStorage"), this._data = {};
334
+ this._logger = new u("InMemoryWebStorage"), this._data = {};
1005
335
  }
1006
336
  clear() {
1007
337
  this._logger.create("clear"), this._data = {};
@@ -1021,9 +351,9 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1021
351
  key(e) {
1022
352
  return Object.getOwnPropertyNames(this._data)[e];
1023
353
  }
1024
- }, Ce = class {
354
+ }, Te = class {
1025
355
  constructor(e = [], t = null, s = {}) {
1026
- this._jwtHandler = t, this._extraHeaders = s, this._logger = new v("JsonService"), this._contentTypes = [], this._contentTypes.push(...e, "application/json"), t && this._contentTypes.push("application/jwt");
356
+ this._jwtHandler = t, this._extraHeaders = s, this._logger = new u("JsonService"), this._contentTypes = [], this._contentTypes.push(...e, "application/json"), t && this._contentTypes.push("application/jwt");
1027
357
  }
1028
358
  async fetchWithTimeout(e, t = {}) {
1029
359
  const { timeoutInSeconds: s, ...i } = t;
@@ -1035,8 +365,8 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1035
365
  ...t,
1036
366
  signal: r.signal
1037
367
  });
1038
- } catch (o) {
1039
- throw o instanceof DOMException && o.name === "AbortError" ? new Ie("Network timed out") : o;
368
+ } catch (a) {
369
+ throw a instanceof DOMException && a.name === "AbortError" ? new ke("Network timed out") : a;
1040
370
  } finally {
1041
371
  clearTimeout(n);
1042
372
  }
@@ -1052,22 +382,22 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1052
382
  let n;
1053
383
  try {
1054
384
  i.debug("url:", e), n = await this.fetchWithTimeout(e, { method: "GET", headers: r, credentials: s });
1055
- } catch (c) {
1056
- throw i.error("Network Error"), c;
385
+ } catch (l) {
386
+ throw i.error("Network Error"), l;
1057
387
  }
1058
388
  i.debug("HTTP response received, status", n.status);
1059
- const o = n.headers.get("Content-Type");
1060
- if (o && !this._contentTypes.find((c) => o.startsWith(c)) && i.throw(new Error(`Invalid response Content-Type: ${o ?? "undefined"}, from URL: ${e}`)), n.ok && this._jwtHandler && (o != null && o.startsWith("application/jwt")))
389
+ const a = n.headers.get("Content-Type");
390
+ if (a && !this._contentTypes.find((l) => a.startsWith(l)) && i.throw(new Error(`Invalid response Content-Type: ${a ?? "undefined"}, from URL: ${e}`)), n.ok && this._jwtHandler && (a != null && a.startsWith("application/jwt")))
1061
391
  return await this._jwtHandler(await n.text());
1062
- let a;
392
+ let o;
1063
393
  try {
1064
- a = await n.json();
1065
- } catch (c) {
1066
- throw i.error("Error parsing JSON response", c), n.ok ? c : new Error(`${n.statusText} (${n.status})`);
394
+ o = await n.json();
395
+ } catch (l) {
396
+ throw i.error("Error parsing JSON response", l), n.ok ? l : new Error(`${n.statusText} (${n.status})`);
1067
397
  }
1068
398
  if (!n.ok)
1069
- throw i.error("Error from server:", a), a.error ? new J(a) : new Error(`${n.statusText} (${n.status}): ${JSON.stringify(a)}`);
1070
- return a;
399
+ throw i.error("Error from server:", o), o.error ? new W(o) : new Error(`${n.statusText} (${n.status}): ${JSON.stringify(o)}`);
400
+ return o;
1071
401
  }
1072
402
  async postForm(e, {
1073
403
  body: t,
@@ -1075,32 +405,32 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1075
405
  timeoutInSeconds: i,
1076
406
  initCredentials: r
1077
407
  }) {
1078
- const n = this._logger.create("postForm"), o = {
408
+ const n = this._logger.create("postForm"), a = {
1079
409
  Accept: this._contentTypes.join(", "),
1080
410
  "Content-Type": "application/x-www-form-urlencoded"
1081
411
  };
1082
- s !== void 0 && (o.Authorization = "Basic " + s), this.appendExtraHeaders(o);
1083
- let a;
412
+ s !== void 0 && (a.Authorization = "Basic " + s), this.appendExtraHeaders(a);
413
+ let o;
1084
414
  try {
1085
- n.debug("url:", e), a = await this.fetchWithTimeout(e, { method: "POST", headers: o, body: t, timeoutInSeconds: i, credentials: r });
1086
- } catch (_) {
1087
- throw n.error("Network error"), _;
415
+ n.debug("url:", e), o = await this.fetchWithTimeout(e, { method: "POST", headers: a, body: t, timeoutInSeconds: i, credentials: r });
416
+ } catch (g) {
417
+ throw n.error("Network error"), g;
1088
418
  }
1089
- n.debug("HTTP response received, status", a.status);
1090
- const c = a.headers.get("Content-Type");
1091
- if (c && !this._contentTypes.find((_) => c.startsWith(_)))
1092
- throw new Error(`Invalid response Content-Type: ${c ?? "undefined"}, from URL: ${e}`);
1093
- const h = await a.text();
1094
- let u = {};
1095
- if (h)
419
+ n.debug("HTTP response received, status", o.status);
420
+ const l = o.headers.get("Content-Type");
421
+ if (l && !this._contentTypes.find((g) => l.startsWith(g)))
422
+ throw new Error(`Invalid response Content-Type: ${l ?? "undefined"}, from URL: ${e}`);
423
+ const d = await o.text();
424
+ let h = {};
425
+ if (d)
1096
426
  try {
1097
- u = JSON.parse(h);
1098
- } catch (_) {
1099
- throw n.error("Error parsing JSON response", _), a.ok ? _ : new Error(`${a.statusText} (${a.status})`);
427
+ h = JSON.parse(d);
428
+ } catch (g) {
429
+ throw n.error("Error parsing JSON response", g), o.ok ? g : new Error(`${o.statusText} (${o.status})`);
1100
430
  }
1101
- if (!a.ok)
1102
- throw n.error("Error from server:", u), u.error ? new J(u, t) : new Error(`${a.statusText} (${a.status}): ${JSON.stringify(u)}`);
1103
- return u;
431
+ if (!o.ok)
432
+ throw n.error("Error from server:", h), h.error ? new W(h, t) : new Error(`${o.statusText} (${o.status}): ${JSON.stringify(h)}`);
433
+ return h;
1104
434
  }
1105
435
  appendExtraHeaders(e) {
1106
436
  const t = this._logger.create("appendExtraHeaders"), s = Object.keys(this._extraHeaders), i = [
@@ -1117,9 +447,9 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1117
447
  n && n !== "" && (e[r] = n);
1118
448
  });
1119
449
  }
1120
- }, ss = class {
450
+ }, Jt = class {
1121
451
  constructor(e) {
1122
- this._settings = e, this._logger = new v("MetadataService"), this._signingKeys = null, this._metadata = null, this._metadataUrl = this._settings.metadataUrl, this._jsonService = new Ce(
452
+ this._settings = e, this._logger = new u("MetadataService"), this._signingKeys = null, this._metadata = null, this._metadataUrl = this._settings.metadataUrl, this._jsonService = new Te(
1123
453
  ["application/jwk-set+json"],
1124
454
  null,
1125
455
  this._settings.extraHeaders
@@ -1184,12 +514,12 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1184
514
  throw e.throw(new Error("Missing keys on keyset")), null;
1185
515
  return this._signingKeys = s.keys, this._signingKeys;
1186
516
  }
1187
- }, Qe = class {
517
+ }, Ke = class {
1188
518
  constructor({
1189
519
  prefix: e = "oidc.",
1190
520
  store: t = localStorage
1191
521
  } = {}) {
1192
- this._logger = new v("WebStorageStateStore"), this._store = t, this._prefix = e;
522
+ this._logger = new u("WebStorageStateStore"), this._store = t, this._prefix = e;
1193
523
  }
1194
524
  async set(e, t) {
1195
525
  this._logger.create(`set('${e}')`), e = this._prefix + e, await this._store.setItem(e, t);
@@ -1211,7 +541,7 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1211
541
  }
1212
542
  return t;
1213
543
  }
1214
- }, is = "code", rs = "openid", ns = "client_secret_post", os = "query", as = 60 * 15, cs = 60 * 5, we = class {
544
+ }, Vt = "code", Bt = "openid", Gt = "client_secret_post", Qt = 60 * 15, _e = class {
1215
545
  constructor({
1216
546
  // metadata related
1217
547
  authority: e,
@@ -1221,58 +551,55 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1221
551
  metadataSeed: r,
1222
552
  // client related
1223
553
  client_id: n,
1224
- client_secret: o,
1225
- response_type: a = is,
1226
- scope: c = rs,
1227
- redirect_uri: h,
1228
- post_logout_redirect_uri: u,
1229
- client_authentication: _ = ns,
554
+ client_secret: a,
555
+ response_type: o = Vt,
556
+ scope: l = Bt,
557
+ redirect_uri: d,
558
+ post_logout_redirect_uri: h,
559
+ client_authentication: g = Gt,
1230
560
  // optional protocol
1231
- prompt: y,
1232
- display: w,
1233
- max_age: C,
1234
- ui_locales: p,
1235
- acr_values: S,
1236
- resource: E,
1237
- response_mode: d = os,
561
+ prompt: v,
562
+ display: b,
563
+ max_age: R,
564
+ ui_locales: k,
565
+ acr_values: x,
566
+ resource: I,
567
+ response_mode: H,
1238
568
  // behavior flags
1239
- filterProtocolClaims: g = !0,
1240
- loadUserInfo: f = !1,
1241
- staleStateAgeInSeconds: m = as,
1242
- clockSkewInSeconds: k = cs,
1243
- userInfoJwtIssuer: T = "OP",
1244
- mergeClaims: R = !1,
1245
- disablePKCE: U = !1,
569
+ filterProtocolClaims: T = !0,
570
+ loadUserInfo: w = !1,
571
+ staleStateAgeInSeconds: U = Qt,
572
+ mergeClaimsStrategy: C = { array: "replace" },
573
+ disablePKCE: S = !1,
1246
574
  // other behavior
1247
- stateStore: H,
1248
- refreshTokenCredentials: b,
1249
- revokeTokenAdditionalContentTypes: x,
1250
- fetchRequestCredentials: A,
1251
- refreshTokenAllowedScope: W,
575
+ stateStore: M,
576
+ revokeTokenAdditionalContentTypes: z,
577
+ fetchRequestCredentials: G,
578
+ refreshTokenAllowedScope: p,
1252
579
  // extra
1253
- extraQueryParams: B = {},
1254
- extraTokenParams: z = {},
1255
- extraHeaders: V = {}
580
+ extraQueryParams: f = {},
581
+ extraTokenParams: P = {},
582
+ extraHeaders: $ = {}
1256
583
  }) {
1257
- if (this.authority = e, t ? this.metadataUrl = t : (this.metadataUrl = e, e && (this.metadataUrl.endsWith("/") || (this.metadataUrl += "/"), this.metadataUrl += ".well-known/openid-configuration")), this.metadata = s, this.metadataSeed = r, this.signingKeys = i, this.client_id = n, this.client_secret = o, this.response_type = a, this.scope = c, this.redirect_uri = h, this.post_logout_redirect_uri = u, this.client_authentication = _, this.prompt = y, this.display = w, this.max_age = C, this.ui_locales = p, this.acr_values = S, this.resource = E, this.response_mode = d, this.filterProtocolClaims = g ?? !0, this.loadUserInfo = !!f, this.staleStateAgeInSeconds = m, this.clockSkewInSeconds = k, this.userInfoJwtIssuer = T, this.mergeClaims = !!R, this.disablePKCE = !!U, this.revokeTokenAdditionalContentTypes = x, A && b && console.warn("Both fetchRequestCredentials and refreshTokenCredentials is set. Only fetchRequestCredentials will be used."), this.fetchRequestCredentials = A || b || "same-origin", H)
1258
- this.stateStore = H;
584
+ if (this.authority = e, t ? this.metadataUrl = t : (this.metadataUrl = e, e && (this.metadataUrl.endsWith("/") || (this.metadataUrl += "/"), this.metadataUrl += ".well-known/openid-configuration")), this.metadata = s, this.metadataSeed = r, this.signingKeys = i, this.client_id = n, this.client_secret = a, this.response_type = o, this.scope = l, this.redirect_uri = d, this.post_logout_redirect_uri = h, this.client_authentication = g, this.prompt = v, this.display = b, this.max_age = R, this.ui_locales = k, this.acr_values = x, this.resource = I, this.response_mode = H, this.filterProtocolClaims = T ?? !0, this.loadUserInfo = !!w, this.staleStateAgeInSeconds = U, this.mergeClaimsStrategy = C, this.disablePKCE = !!S, this.revokeTokenAdditionalContentTypes = z, this.fetchRequestCredentials = G || "same-origin", M)
585
+ this.stateStore = M;
1259
586
  else {
1260
- const G = typeof window < "u" ? window.localStorage : new Ge();
1261
- this.stateStore = new Qe({ store: G });
587
+ const L = typeof window < "u" ? window.localStorage : new We();
588
+ this.stateStore = new Ke({ store: L });
1262
589
  }
1263
- this.refreshTokenAllowedScope = W, this.extraQueryParams = B, this.extraTokenParams = z, this.extraHeaders = V;
590
+ this.refreshTokenAllowedScope = p, this.extraQueryParams = f, this.extraTokenParams = P, this.extraHeaders = $;
1264
591
  }
1265
- }, ls = class {
592
+ }, Xt = class {
1266
593
  constructor(e, t) {
1267
- this._settings = e, this._metadataService = t, this._logger = new v("UserInfoService"), this._getClaimsFromJwt = async (s) => {
594
+ this._settings = e, this._metadataService = t, this._logger = new u("UserInfoService"), this._getClaimsFromJwt = async (s) => {
1268
595
  const i = this._logger.create("_getClaimsFromJwt");
1269
596
  try {
1270
- const r = _e.decode(s);
597
+ const r = he.decode(s);
1271
598
  return i.debug("JWT decoding successful"), r;
1272
599
  } catch (r) {
1273
600
  throw i.error("Error parsing JWT response"), r;
1274
601
  }
1275
- }, this._jsonService = new Ce(
602
+ }, this._jsonService = new Te(
1276
603
  void 0,
1277
604
  this._getClaimsFromJwt,
1278
605
  this._settings.extraHeaders
@@ -1289,9 +616,9 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1289
616
  });
1290
617
  return t.debug("got claims", i), i;
1291
618
  }
1292
- }, Xe = class {
619
+ }, ze = class {
1293
620
  constructor(e, t) {
1294
- this._settings = e, this._metadataService = t, this._logger = new v("TokenClient"), this._jsonService = new Ce(
621
+ this._settings = e, this._metadataService = t, this._logger = new u("TokenClient"), this._jsonService = new Te(
1295
622
  this._settings.revokeTokenAdditionalContentTypes,
1296
623
  null,
1297
624
  this._settings.extraHeaders
@@ -1311,24 +638,24 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1311
638
  }) {
1312
639
  const n = this._logger.create("exchangeCode");
1313
640
  s || n.throw(new Error("A client_id is required")), t || n.throw(new Error("A redirect_uri is required")), r.code || n.throw(new Error("A code is required"));
1314
- const o = new URLSearchParams({ grant_type: e, redirect_uri: t });
1315
- for (const [u, _] of Object.entries(r))
1316
- _ != null && o.set(u, _);
1317
- let a;
641
+ const a = new URLSearchParams({ grant_type: e, redirect_uri: t });
642
+ for (const [h, g] of Object.entries(r))
643
+ g != null && a.set(h, g);
644
+ let o;
1318
645
  switch (this._settings.client_authentication) {
1319
646
  case "client_secret_basic":
1320
647
  if (!i)
1321
648
  throw n.throw(new Error("A client_secret is required")), null;
1322
- a = F.generateBasicAuth(s, i);
649
+ o = K.generateBasicAuth(s, i);
1323
650
  break;
1324
651
  case "client_secret_post":
1325
- o.append("client_id", s), i && o.append("client_secret", i);
652
+ a.append("client_id", s), i && a.append("client_secret", i);
1326
653
  break;
1327
654
  }
1328
- const c = await this._metadataService.getTokenEndpoint(!1);
655
+ const l = await this._metadataService.getTokenEndpoint(!1);
1329
656
  n.debug("got token endpoint");
1330
- const h = await this._jsonService.postForm(c, { body: o, basicAuth: a, initCredentials: this._settings.fetchRequestCredentials });
1331
- return n.debug("got response"), h;
657
+ const d = await this._jsonService.postForm(l, { body: a, basicAuth: o, initCredentials: this._settings.fetchRequestCredentials });
658
+ return n.debug("got response"), d;
1332
659
  }
1333
660
  /**
1334
661
  * Exchange credentials.
@@ -1344,24 +671,24 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1344
671
  }) {
1345
672
  const n = this._logger.create("exchangeCredentials");
1346
673
  t || n.throw(new Error("A client_id is required"));
1347
- const o = new URLSearchParams({ grant_type: e, scope: i });
1348
- for (const [u, _] of Object.entries(r))
1349
- _ != null && o.set(u, _);
1350
- let a;
674
+ const a = new URLSearchParams({ grant_type: e, scope: i });
675
+ for (const [h, g] of Object.entries(r))
676
+ g != null && a.set(h, g);
677
+ let o;
1351
678
  switch (this._settings.client_authentication) {
1352
679
  case "client_secret_basic":
1353
680
  if (!s)
1354
681
  throw n.throw(new Error("A client_secret is required")), null;
1355
- a = F.generateBasicAuth(t, s);
682
+ o = K.generateBasicAuth(t, s);
1356
683
  break;
1357
684
  case "client_secret_post":
1358
- o.append("client_id", t), s && o.append("client_secret", s);
685
+ a.append("client_id", t), s && a.append("client_secret", s);
1359
686
  break;
1360
687
  }
1361
- const c = await this._metadataService.getTokenEndpoint(!1);
688
+ const l = await this._metadataService.getTokenEndpoint(!1);
1362
689
  n.debug("got token endpoint");
1363
- const h = await this._jsonService.postForm(c, { body: o, basicAuth: a, initCredentials: this._settings.fetchRequestCredentials });
1364
- return n.debug("got response"), h;
690
+ const d = await this._jsonService.postForm(l, { body: a, basicAuth: o, initCredentials: this._settings.fetchRequestCredentials });
691
+ return n.debug("got response"), d;
1365
692
  }
1366
693
  /**
1367
694
  * Exchange a refresh token.
@@ -1377,24 +704,24 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1377
704
  }) {
1378
705
  const n = this._logger.create("exchangeRefreshToken");
1379
706
  t || n.throw(new Error("A client_id is required")), r.refresh_token || n.throw(new Error("A refresh_token is required"));
1380
- const o = new URLSearchParams({ grant_type: e });
1381
- for (const [u, _] of Object.entries(r))
1382
- Array.isArray(_) ? _.forEach((y) => o.append(u, y)) : _ != null && o.set(u, _);
1383
- let a;
707
+ const a = new URLSearchParams({ grant_type: e });
708
+ for (const [h, g] of Object.entries(r))
709
+ Array.isArray(g) ? g.forEach((v) => a.append(h, v)) : g != null && a.set(h, g);
710
+ let o;
1384
711
  switch (this._settings.client_authentication) {
1385
712
  case "client_secret_basic":
1386
713
  if (!s)
1387
714
  throw n.throw(new Error("A client_secret is required")), null;
1388
- a = F.generateBasicAuth(t, s);
715
+ o = K.generateBasicAuth(t, s);
1389
716
  break;
1390
717
  case "client_secret_post":
1391
- o.append("client_id", t), s && o.append("client_secret", s);
718
+ a.append("client_id", t), s && a.append("client_secret", s);
1392
719
  break;
1393
720
  }
1394
- const c = await this._metadataService.getTokenEndpoint(!1);
721
+ const l = await this._metadataService.getTokenEndpoint(!1);
1395
722
  n.debug("got token endpoint");
1396
- const h = await this._jsonService.postForm(c, { body: o, basicAuth: a, timeoutInSeconds: i, initCredentials: this._settings.fetchRequestCredentials });
1397
- return n.debug("got response"), h;
723
+ const d = await this._jsonService.postForm(l, { body: a, basicAuth: o, timeoutInSeconds: i, initCredentials: this._settings.fetchRequestCredentials });
724
+ return n.debug("got response"), d;
1398
725
  }
1399
726
  /**
1400
727
  * Revoke an access or refresh token.
@@ -1408,13 +735,13 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1408
735
  const i = await this._metadataService.getRevocationEndpoint(!1);
1409
736
  s.debug(`got revocation endpoint, revoking ${(t = e.token_type_hint) != null ? t : "default token type"}`);
1410
737
  const r = new URLSearchParams();
1411
- for (const [n, o] of Object.entries(e))
1412
- o != null && r.set(n, o);
738
+ for (const [n, a] of Object.entries(e))
739
+ a != null && r.set(n, a);
1413
740
  r.set("client_id", this._settings.client_id), this._settings.client_secret && r.set("client_secret", this._settings.client_secret), await this._jsonService.postForm(i, { body: r }), s.debug("got response");
1414
741
  }
1415
- }, ds = class {
742
+ }, Yt = class {
1416
743
  constructor(e, t, s) {
1417
- this._settings = e, this._metadataService = t, this._claimsService = s, this._logger = new v("ResponseValidator"), this._userInfoService = new ls(this._settings, this._metadataService), this._tokenClient = new Xe(this._settings, this._metadataService);
744
+ this._settings = e, this._metadataService = t, this._claimsService = s, this._logger = new u("ResponseValidator"), this._userInfoService = new Xt(this._settings, this._metadataService), this._tokenClient = new ze(this._settings, this._metadataService);
1418
745
  }
1419
746
  async validateSigninResponse(e, t) {
1420
747
  const s = this._logger.create("validateSigninResponse");
@@ -1434,13 +761,13 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1434
761
  validateSignoutResponse(e, t) {
1435
762
  const s = this._logger.create("validateSignoutResponse");
1436
763
  if (t.id !== e.state && s.throw(new Error("State does not match")), s.debug("state validated"), e.userState = t.data, e.error)
1437
- throw s.warn("Response was error", e.error), new J(e);
764
+ throw s.warn("Response was error", e.error), new W(e);
1438
765
  }
1439
766
  _processSigninState(e, t) {
1440
767
  var s;
1441
768
  const i = this._logger.create("_processSigninState");
1442
769
  if (t.id !== e.state && i.throw(new Error("State does not match")), t.client_id || i.throw(new Error("No client_id on state")), t.authority || i.throw(new Error("No authority on state")), this._settings.authority !== t.authority && i.throw(new Error("authority mismatch on settings vs. signin state")), this._settings.client_id && this._settings.client_id !== t.client_id && i.throw(new Error("client_id mismatch on settings vs. signin state")), i.debug("state validated"), e.userState = t.data, e.url_state = t.url_state, (s = e.scope) != null || (e.scope = t.scope), e.error)
1443
- throw i.warn("Response was error", e.error), new J(e);
770
+ throw i.warn("Response was error", e.error), new W(e);
1444
771
  t.code_verifier && !e.code && i.throw(new Error("Expected code in response"));
1445
772
  }
1446
773
  async _processClaims(e, t = !1, s = !0) {
@@ -1473,19 +800,19 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1473
800
  var s;
1474
801
  const i = this._logger.create("_validateIdTokenAttributes");
1475
802
  i.debug("decoding ID Token JWT");
1476
- const r = _e.decode((s = e.id_token) != null ? s : "");
803
+ const r = he.decode((s = e.id_token) != null ? s : "");
1477
804
  if (r.sub || i.throw(new Error("ID Token is missing a subject claim")), t) {
1478
- const n = _e.decode(t);
805
+ const n = he.decode(t);
1479
806
  r.sub !== n.sub && i.throw(new Error("sub in id_token does not match current sub")), r.auth_time && r.auth_time !== n.auth_time && i.throw(new Error("auth_time in id_token does not match original auth_time")), r.azp && r.azp !== n.azp && i.throw(new Error("azp in id_token does not match original azp")), !r.azp && n.azp && i.throw(new Error("azp not in id_token, but present in original id_token"));
1480
807
  }
1481
808
  e.profile = r;
1482
809
  }
1483
- }, Q = class {
1484
- constructor(e) {
1485
- this.id = e.id || F.generateUUIDv4(), this.data = e.data, e.created && e.created > 0 ? this.created = e.created : this.created = q.getEpochTime(), this.request_type = e.request_type, this.url_state = e.url_state;
810
+ }, se = class pe {
811
+ constructor(t) {
812
+ this.id = t.id || K.generateUUIDv4(), this.data = t.data, t.created && t.created > 0 ? this.created = t.created : this.created = D.getEpochTime(), this.request_type = t.request_type, this.url_state = t.url_state;
1486
813
  }
1487
814
  toStorageString() {
1488
- return new v("State").create("toStorageString"), JSON.stringify({
815
+ return new u("State").create("toStorageString"), JSON.stringify({
1489
816
  id: this.id,
1490
817
  data: this.data,
1491
818
  created: this.created,
@@ -1493,33 +820,41 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1493
820
  url_state: this.url_state
1494
821
  });
1495
822
  }
1496
- static fromStorageString(e) {
1497
- return v.createStatic("State", "fromStorageString"), new Q(JSON.parse(e));
823
+ static fromStorageString(t) {
824
+ return u.createStatic("State", "fromStorageString"), Promise.resolve(new pe(JSON.parse(t)));
1498
825
  }
1499
- static async clearStaleState(e, t) {
1500
- const s = v.createStatic("State", "clearStaleState"), i = q.getEpochTime() - t, r = await e.getAllKeys();
1501
- s.debug("got keys", r);
1502
- for (let n = 0; n < r.length; n++) {
1503
- const o = r[n], a = await e.get(o);
1504
- let c = !1;
1505
- if (a)
826
+ static async clearStaleState(t, s) {
827
+ const i = u.createStatic("State", "clearStaleState"), r = D.getEpochTime() - s, n = await t.getAllKeys();
828
+ i.debug("got keys", n);
829
+ for (let a = 0; a < n.length; a++) {
830
+ const o = n[a], l = await t.get(o);
831
+ let d = !1;
832
+ if (l)
1506
833
  try {
1507
- const h = Q.fromStorageString(a);
1508
- s.debug("got item from key:", o, h.created), h.created <= i && (c = !0);
834
+ const h = await pe.fromStorageString(l);
835
+ i.debug("got item from key:", o, h.created), h.created <= r && (d = !0);
1509
836
  } catch (h) {
1510
- s.error("Error parsing state for key:", o, h), c = !0;
837
+ i.error("Error parsing state for key:", o, h), d = !0;
1511
838
  }
1512
839
  else
1513
- s.debug("no item in storage for key:", o), c = !0;
1514
- c && (s.debug("removed item for key:", o), e.remove(o));
840
+ i.debug("no item in storage for key:", o), d = !0;
841
+ d && (i.debug("removed item for key:", o), t.remove(o));
1515
842
  }
1516
843
  }
1517
- }, Ee = class extends Q {
1518
- constructor(e) {
1519
- super(e), e.code_verifier === !0 ? this.code_verifier = F.generateCodeVerifier() : e.code_verifier && (this.code_verifier = e.code_verifier), this.code_verifier && (this.code_challenge = F.generateCodeChallenge(this.code_verifier)), this.authority = e.authority, this.client_id = e.client_id, this.redirect_uri = e.redirect_uri, this.scope = e.scope, this.client_secret = e.client_secret, this.extraTokenParams = e.extraTokenParams, this.response_mode = e.response_mode, this.skipUserInfo = e.skipUserInfo;
844
+ }, Je = class fe extends se {
845
+ constructor(t) {
846
+ super(t), this.code_verifier = t.code_verifier, this.code_challenge = t.code_challenge, this.authority = t.authority, this.client_id = t.client_id, this.redirect_uri = t.redirect_uri, this.scope = t.scope, this.client_secret = t.client_secret, this.extraTokenParams = t.extraTokenParams, this.response_mode = t.response_mode, this.skipUserInfo = t.skipUserInfo;
847
+ }
848
+ static async create(t) {
849
+ const s = t.code_verifier === !0 ? K.generateCodeVerifier() : t.code_verifier || void 0, i = s ? await K.generateCodeChallenge(s) : void 0;
850
+ return new fe({
851
+ ...t,
852
+ code_verifier: s,
853
+ code_challenge: i
854
+ });
1520
855
  }
1521
856
  toStorageString() {
1522
- return new v("SigninState").create("toStorageString"), JSON.stringify({
857
+ return new u("SigninState").create("toStorageString"), JSON.stringify({
1523
858
  id: this.id,
1524
859
  data: this.data,
1525
860
  created: this.created,
@@ -1536,88 +871,95 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1536
871
  skipUserInfo: this.skipUserInfo
1537
872
  });
1538
873
  }
1539
- static fromStorageString(e) {
1540
- v.createStatic("SigninState", "fromStorageString");
1541
- const t = JSON.parse(e);
1542
- return new Ee(t);
874
+ static fromStorageString(t) {
875
+ u.createStatic("SigninState", "fromStorageString");
876
+ const s = JSON.parse(t);
877
+ return fe.create(s);
1543
878
  }
1544
- }, hs = class {
1545
- constructor({
879
+ }, Ve = class Be {
880
+ constructor(t) {
881
+ this.url = t.url, this.state = t.state;
882
+ }
883
+ static async create({
1546
884
  // mandatory
1547
- url: e,
1548
- authority: t,
1549
- client_id: s,
1550
- redirect_uri: i,
1551
- response_type: r,
1552
- scope: n,
885
+ url: t,
886
+ authority: s,
887
+ client_id: i,
888
+ redirect_uri: r,
889
+ response_type: n,
890
+ scope: a,
1553
891
  // optional
1554
892
  state_data: o,
1555
- response_mode: a,
1556
- request_type: c,
893
+ response_mode: l,
894
+ request_type: d,
1557
895
  client_secret: h,
1558
- nonce: u,
1559
- url_state: _,
1560
- resource: y,
1561
- skipUserInfo: w,
1562
- extraQueryParams: C,
1563
- extraTokenParams: p,
1564
- disablePKCE: S,
1565
- ...E
896
+ nonce: g,
897
+ url_state: v,
898
+ resource: b,
899
+ skipUserInfo: R,
900
+ extraQueryParams: k,
901
+ extraTokenParams: x,
902
+ disablePKCE: I,
903
+ ...H
1566
904
  }) {
1567
- if (this._logger = new v("SigninRequest"), !e)
1568
- throw this._logger.error("ctor: No url passed"), new Error("url");
1569
- if (!s)
1570
- throw this._logger.error("ctor: No client_id passed"), new Error("client_id");
905
+ if (!t)
906
+ throw this._logger.error("create: No url passed"), new Error("url");
1571
907
  if (!i)
1572
- throw this._logger.error("ctor: No redirect_uri passed"), new Error("redirect_uri");
908
+ throw this._logger.error("create: No client_id passed"), new Error("client_id");
1573
909
  if (!r)
1574
- throw this._logger.error("ctor: No response_type passed"), new Error("response_type");
910
+ throw this._logger.error("create: No redirect_uri passed"), new Error("redirect_uri");
1575
911
  if (!n)
1576
- throw this._logger.error("ctor: No scope passed"), new Error("scope");
1577
- if (!t)
1578
- throw this._logger.error("ctor: No authority passed"), new Error("authority");
1579
- this.state = new Ee({
912
+ throw this._logger.error("create: No response_type passed"), new Error("response_type");
913
+ if (!a)
914
+ throw this._logger.error("create: No scope passed"), new Error("scope");
915
+ if (!s)
916
+ throw this._logger.error("create: No authority passed"), new Error("authority");
917
+ const T = await Je.create({
1580
918
  data: o,
1581
- request_type: c,
1582
- url_state: _,
1583
- code_verifier: !S,
1584
- client_id: s,
1585
- authority: t,
1586
- redirect_uri: i,
1587
- response_mode: a,
919
+ request_type: d,
920
+ url_state: v,
921
+ code_verifier: !I,
922
+ client_id: i,
923
+ authority: s,
924
+ redirect_uri: r,
925
+ response_mode: l,
1588
926
  client_secret: h,
1589
- scope: n,
1590
- extraTokenParams: p,
1591
- skipUserInfo: w
927
+ scope: a,
928
+ extraTokenParams: x,
929
+ skipUserInfo: R
930
+ }), w = new URL(t);
931
+ w.searchParams.append("client_id", i), w.searchParams.append("redirect_uri", r), w.searchParams.append("response_type", n), w.searchParams.append("scope", a), g && w.searchParams.append("nonce", g);
932
+ let U = T.id;
933
+ v && (U = `${U}${ue}${v}`), w.searchParams.append("state", U), T.code_challenge && (w.searchParams.append("code_challenge", T.code_challenge), w.searchParams.append("code_challenge_method", "S256")), b && (Array.isArray(b) ? b : [b]).forEach((S) => w.searchParams.append("resource", S));
934
+ for (const [C, S] of Object.entries({ response_mode: l, ...H, ...k }))
935
+ S != null && w.searchParams.append(C, S.toString());
936
+ return new Be({
937
+ url: w.href,
938
+ state: T
1592
939
  });
1593
- const d = new URL(e);
1594
- d.searchParams.append("client_id", s), d.searchParams.append("redirect_uri", i), d.searchParams.append("response_type", r), d.searchParams.append("scope", n), u && d.searchParams.append("nonce", u);
1595
- let g = this.state.id;
1596
- _ && (g = `${g}${fe}${_}`), d.searchParams.append("state", g), this.state.code_challenge && (d.searchParams.append("code_challenge", this.state.code_challenge), d.searchParams.append("code_challenge_method", "S256")), y && (Array.isArray(y) ? y : [y]).forEach((m) => d.searchParams.append("resource", m));
1597
- for (const [f, m] of Object.entries({ response_mode: a, ...E, ...C }))
1598
- m != null && d.searchParams.append(f, m.toString());
1599
- this.url = d.href;
1600
- }
1601
- }, gs = "openid", he = class {
940
+ }
941
+ };
942
+ Ve._logger = new u("SigninRequest");
943
+ var Zt = Ve, es = "openid", ce = class {
1602
944
  constructor(e) {
1603
945
  if (this.access_token = "", this.token_type = "", this.profile = {}, this.state = e.get("state"), this.session_state = e.get("session_state"), this.state) {
1604
- const t = decodeURIComponent(this.state).split(fe);
1605
- this.state = t[0], t.length > 1 && (this.url_state = t.slice(1).join(fe));
946
+ const t = decodeURIComponent(this.state).split(ue);
947
+ this.state = t[0], t.length > 1 && (this.url_state = t.slice(1).join(ue));
1606
948
  }
1607
949
  this.error = e.get("error"), this.error_description = e.get("error_description"), this.error_uri = e.get("error_uri"), this.code = e.get("code");
1608
950
  }
1609
951
  get expires_in() {
1610
952
  if (this.expires_at !== void 0)
1611
- return this.expires_at - q.getEpochTime();
953
+ return this.expires_at - D.getEpochTime();
1612
954
  }
1613
955
  set expires_in(e) {
1614
- typeof e == "string" && (e = Number(e)), e !== void 0 && e >= 0 && (this.expires_at = Math.floor(e) + q.getEpochTime());
956
+ typeof e == "string" && (e = Number(e)), e !== void 0 && e >= 0 && (this.expires_at = Math.floor(e) + D.getEpochTime());
1615
957
  }
1616
958
  get isOpenId() {
1617
959
  var e;
1618
- return ((e = this.scope) == null ? void 0 : e.split(" ").includes(gs)) || !!this.id_token;
960
+ return ((e = this.scope) == null ? void 0 : e.split(" ").includes(es)) || !!this.id_token;
1619
961
  }
1620
- }, us = class {
962
+ }, ts = class {
1621
963
  constructor({
1622
964
  url: e,
1623
965
  state_data: t,
@@ -1625,21 +967,21 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1625
967
  post_logout_redirect_uri: i,
1626
968
  extraQueryParams: r,
1627
969
  request_type: n,
1628
- client_id: o
970
+ client_id: a
1629
971
  }) {
1630
- if (this._logger = new v("SignoutRequest"), !e)
972
+ if (this._logger = new u("SignoutRequest"), !e)
1631
973
  throw this._logger.error("ctor: No url passed"), new Error("url");
1632
- const a = new URL(e);
1633
- s && a.searchParams.append("id_token_hint", s), o && a.searchParams.append("client_id", o), i && (a.searchParams.append("post_logout_redirect_uri", i), t && (this.state = new Q({ data: t, request_type: n }), a.searchParams.append("state", this.state.id)));
1634
- for (const [c, h] of Object.entries({ ...r }))
1635
- h != null && a.searchParams.append(c, h.toString());
1636
- this.url = a.href;
974
+ const o = new URL(e);
975
+ s && o.searchParams.append("id_token_hint", s), a && o.searchParams.append("client_id", a), i && (o.searchParams.append("post_logout_redirect_uri", i), t && (this.state = new se({ data: t, request_type: n }), o.searchParams.append("state", this.state.id)));
976
+ for (const [l, d] of Object.entries({ ...r }))
977
+ d != null && o.searchParams.append(l, d.toString());
978
+ this.url = o.href;
1637
979
  }
1638
- }, _s = class {
980
+ }, ss = class {
1639
981
  constructor(e) {
1640
982
  this.state = e.get("state"), this.error = e.get("error"), this.error_description = e.get("error_description"), this.error_uri = e.get("error_uri");
1641
983
  }
1642
- }, ps = [
984
+ }, is = [
1643
985
  "nbf",
1644
986
  "jti",
1645
987
  "auth_time",
@@ -1649,32 +991,40 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1649
991
  "azp",
1650
992
  "at_hash"
1651
993
  // https://openid.net/specs/openid-connect-core-1_0.html#CodeIDToken
1652
- ], fs = ["sub", "iss", "aud", "exp", "iat"], ws = class {
994
+ ], rs = ["sub", "iss", "aud", "exp", "iat"], ns = class {
1653
995
  constructor(e) {
1654
- this._settings = e, this._logger = new v("ClaimsService");
996
+ this._settings = e, this._logger = new u("ClaimsService");
1655
997
  }
1656
998
  filterProtocolClaims(e) {
1657
999
  const t = { ...e };
1658
1000
  if (this._settings.filterProtocolClaims) {
1659
1001
  let s;
1660
- Array.isArray(this._settings.filterProtocolClaims) ? s = this._settings.filterProtocolClaims : s = ps;
1002
+ Array.isArray(this._settings.filterProtocolClaims) ? s = this._settings.filterProtocolClaims : s = is;
1661
1003
  for (const i of s)
1662
- fs.includes(i) || delete t[i];
1004
+ rs.includes(i) || delete t[i];
1663
1005
  }
1664
1006
  return t;
1665
1007
  }
1666
1008
  mergeClaims(e, t) {
1667
1009
  const s = { ...e };
1668
1010
  for (const [i, r] of Object.entries(t))
1669
- for (const n of Array.isArray(r) ? r : [r]) {
1670
- const o = s[i];
1671
- o === void 0 ? s[i] = n : Array.isArray(o) ? o.includes(n) || o.push(n) : s[i] !== n && (typeof n == "object" && this._settings.mergeClaims ? s[i] = this.mergeClaims(o, n) : s[i] = [o, n]);
1672
- }
1011
+ if (s[i] !== r)
1012
+ if (Array.isArray(s[i]) || Array.isArray(r))
1013
+ if (this._settings.mergeClaimsStrategy.array == "replace")
1014
+ s[i] = r;
1015
+ else {
1016
+ const n = Array.isArray(s[i]) ? s[i] : [s[i]];
1017
+ for (const a of Array.isArray(r) ? r : [r])
1018
+ n.includes(a) || n.push(a);
1019
+ s[i] = n;
1020
+ }
1021
+ else
1022
+ typeof s[i] == "object" && typeof r == "object" ? s[i] = this.mergeClaims(s[i], r) : s[i] = r;
1673
1023
  return s;
1674
1024
  }
1675
- }, ms = class {
1025
+ }, os = class {
1676
1026
  constructor(e, t) {
1677
- this._logger = new v("OidcClient"), this.settings = e instanceof we ? e : new we(e), this.metadataService = t ?? new ss(this.settings), this._claimsService = new ws(this.settings), this._validator = new ds(this.settings, this.metadataService, this._claimsService), this._tokenClient = new Xe(this.settings, this.metadataService);
1027
+ this._logger = new u("OidcClient"), this.settings = e instanceof _e ? e : new _e(e), this.metadataService = t ?? new Jt(this.settings), this._claimsService = new ns(this.settings), this._validator = new Yt(this.settings, this.metadataService, this._claimsService), this._tokenClient = new ze(this.settings, this.metadataService);
1678
1028
  }
1679
1029
  async createSigninRequest({
1680
1030
  state: e,
@@ -1683,67 +1033,67 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1683
1033
  request_type: i,
1684
1034
  id_token_hint: r,
1685
1035
  login_hint: n,
1686
- skipUserInfo: o,
1687
- nonce: a,
1688
- url_state: c,
1689
- response_type: h = this.settings.response_type,
1690
- scope: u = this.settings.scope,
1691
- redirect_uri: _ = this.settings.redirect_uri,
1692
- prompt: y = this.settings.prompt,
1693
- display: w = this.settings.display,
1694
- max_age: C = this.settings.max_age,
1695
- ui_locales: p = this.settings.ui_locales,
1696
- acr_values: S = this.settings.acr_values,
1697
- resource: E = this.settings.resource,
1698
- response_mode: d = this.settings.response_mode,
1699
- extraQueryParams: g = this.settings.extraQueryParams,
1700
- extraTokenParams: f = this.settings.extraTokenParams
1036
+ skipUserInfo: a,
1037
+ nonce: o,
1038
+ url_state: l,
1039
+ response_type: d = this.settings.response_type,
1040
+ scope: h = this.settings.scope,
1041
+ redirect_uri: g = this.settings.redirect_uri,
1042
+ prompt: v = this.settings.prompt,
1043
+ display: b = this.settings.display,
1044
+ max_age: R = this.settings.max_age,
1045
+ ui_locales: k = this.settings.ui_locales,
1046
+ acr_values: x = this.settings.acr_values,
1047
+ resource: I = this.settings.resource,
1048
+ response_mode: H = this.settings.response_mode,
1049
+ extraQueryParams: T = this.settings.extraQueryParams,
1050
+ extraTokenParams: w = this.settings.extraTokenParams
1701
1051
  }) {
1702
- const m = this._logger.create("createSigninRequest");
1703
- if (h !== "code")
1052
+ const U = this._logger.create("createSigninRequest");
1053
+ if (d !== "code")
1704
1054
  throw new Error("Only the Authorization Code flow (with PKCE) is supported");
1705
- const k = await this.metadataService.getAuthorizationEndpoint();
1706
- m.debug("Received authorization endpoint", k);
1707
- const T = new hs({
1708
- url: k,
1055
+ const C = await this.metadataService.getAuthorizationEndpoint();
1056
+ U.debug("Received authorization endpoint", C);
1057
+ const S = await Zt.create({
1058
+ url: C,
1709
1059
  authority: this.settings.authority,
1710
1060
  client_id: this.settings.client_id,
1711
- redirect_uri: _,
1712
- response_type: h,
1713
- scope: u,
1061
+ redirect_uri: g,
1062
+ response_type: d,
1063
+ scope: h,
1714
1064
  state_data: e,
1715
- url_state: c,
1716
- prompt: y,
1717
- display: w,
1718
- max_age: C,
1719
- ui_locales: p,
1065
+ url_state: l,
1066
+ prompt: v,
1067
+ display: b,
1068
+ max_age: R,
1069
+ ui_locales: k,
1720
1070
  id_token_hint: r,
1721
1071
  login_hint: n,
1722
- acr_values: S,
1723
- resource: E,
1072
+ acr_values: x,
1073
+ resource: I,
1724
1074
  request: t,
1725
1075
  request_uri: s,
1726
- extraQueryParams: g,
1727
- extraTokenParams: f,
1076
+ extraQueryParams: T,
1077
+ extraTokenParams: w,
1728
1078
  request_type: i,
1729
- response_mode: d,
1079
+ response_mode: H,
1730
1080
  client_secret: this.settings.client_secret,
1731
- skipUserInfo: o,
1732
- nonce: a,
1081
+ skipUserInfo: a,
1082
+ nonce: o,
1733
1083
  disablePKCE: this.settings.disablePKCE
1734
1084
  });
1735
1085
  await this.clearStaleState();
1736
- const R = T.state;
1737
- return await this.settings.stateStore.set(R.id, R.toStorageString()), T;
1086
+ const M = S.state;
1087
+ return await this.settings.stateStore.set(M.id, M.toStorageString()), S;
1738
1088
  }
1739
1089
  async readSigninResponseState(e, t = !1) {
1740
- const s = this._logger.create("readSigninResponseState"), i = new he(pe.readParams(e, this.settings.response_mode));
1090
+ const s = this._logger.create("readSigninResponseState"), i = new ce(ge.readParams(e, this.settings.response_mode));
1741
1091
  if (!i.state)
1742
1092
  throw s.throw(new Error("No state in response")), null;
1743
1093
  const r = await this.settings.stateStore[t ? "remove" : "get"](i.state);
1744
1094
  if (!r)
1745
1095
  throw s.throw(new Error("No matching state found in storage")), null;
1746
- return { state: Ee.fromStorageString(r), response: i };
1096
+ return { state: await Je.fromStorageString(r), response: i };
1747
1097
  }
1748
1098
  async processSigninResponse(e) {
1749
1099
  const t = this._logger.create("processSigninResponse"), { state: s, response: i } = await this.readSigninResponseState(e, !0);
@@ -1755,35 +1105,40 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1755
1105
  skipUserInfo: s = !1,
1756
1106
  extraTokenParams: i = {}
1757
1107
  }) {
1758
- const r = await this._tokenClient.exchangeCredentials({ username: e, password: t, ...i }), n = new he(new URLSearchParams());
1108
+ const r = await this._tokenClient.exchangeCredentials({ username: e, password: t, ...i }), n = new ce(new URLSearchParams());
1759
1109
  return Object.assign(n, r), await this._validator.validateCredentialsResponse(n, s), n;
1760
1110
  }
1761
1111
  async useRefreshToken({
1762
1112
  state: e,
1763
- timeoutInSeconds: t
1113
+ redirect_uri: t,
1114
+ resource: s,
1115
+ timeoutInSeconds: i,
1116
+ extraTokenParams: r
1764
1117
  }) {
1765
- var s;
1766
- const i = this._logger.create("useRefreshToken");
1767
- let r;
1118
+ var n;
1119
+ const a = this._logger.create("useRefreshToken");
1120
+ let o;
1768
1121
  if (this.settings.refreshTokenAllowedScope === void 0)
1769
- r = e.scope;
1122
+ o = e.scope;
1770
1123
  else {
1771
- const a = this.settings.refreshTokenAllowedScope.split(" ");
1772
- r = (((s = e.scope) == null ? void 0 : s.split(" ")) || []).filter((h) => a.includes(h)).join(" ");
1124
+ const h = this.settings.refreshTokenAllowedScope.split(" ");
1125
+ o = (((n = e.scope) == null ? void 0 : n.split(" ")) || []).filter((v) => h.includes(v)).join(" ");
1773
1126
  }
1774
- const n = await this._tokenClient.exchangeRefreshToken({
1127
+ const l = await this._tokenClient.exchangeRefreshToken({
1775
1128
  refresh_token: e.refresh_token,
1776
- resource: e.resource,
1777
1129
  // provide the (possible filtered) scope list
1778
- scope: r,
1779
- timeoutInSeconds: t
1780
- }), o = new he(new URLSearchParams());
1781
- return Object.assign(o, n), i.debug("validating response", o), await this._validator.validateRefreshResponse(o, {
1130
+ scope: o,
1131
+ redirect_uri: t,
1132
+ resource: s,
1133
+ timeoutInSeconds: i,
1134
+ ...r
1135
+ }), d = new ce(new URLSearchParams());
1136
+ return Object.assign(d, l), a.debug("validating response", d), await this._validator.validateRefreshResponse(d, {
1782
1137
  ...e,
1783
- // overide the scope in the state handed over to the validator
1138
+ // override the scope in the state handed over to the validator
1784
1139
  // so it can set the granted scope to the requested scope in case none is included in the response
1785
- scope: r
1786
- }), o;
1140
+ scope: o
1141
+ }), d;
1787
1142
  }
1788
1143
  async createSignoutRequest({
1789
1144
  state: e,
@@ -1793,12 +1148,12 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1793
1148
  post_logout_redirect_uri: r = this.settings.post_logout_redirect_uri,
1794
1149
  extraQueryParams: n = this.settings.extraQueryParams
1795
1150
  } = {}) {
1796
- const o = this._logger.create("createSignoutRequest"), a = await this.metadataService.getEndSessionEndpoint();
1797
- if (!a)
1798
- throw o.throw(new Error("No end session endpoint")), null;
1799
- o.debug("Received end session endpoint", a), !s && r && !t && (s = this.settings.client_id);
1800
- const c = new us({
1801
- url: a,
1151
+ const a = this._logger.create("createSignoutRequest"), o = await this.metadataService.getEndSessionEndpoint();
1152
+ if (!o)
1153
+ throw a.throw(new Error("No end session endpoint")), null;
1154
+ a.debug("Received end session endpoint", o), !s && r && !t && (s = this.settings.client_id);
1155
+ const l = new ts({
1156
+ url: o,
1802
1157
  id_token_hint: t,
1803
1158
  client_id: s,
1804
1159
  post_logout_redirect_uri: r,
@@ -1807,27 +1162,27 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1807
1162
  request_type: i
1808
1163
  });
1809
1164
  await this.clearStaleState();
1810
- const h = c.state;
1811
- return h && (o.debug("Signout request has state to persist"), await this.settings.stateStore.set(h.id, h.toStorageString())), c;
1165
+ const d = l.state;
1166
+ return d && (a.debug("Signout request has state to persist"), await this.settings.stateStore.set(d.id, d.toStorageString())), l;
1812
1167
  }
1813
1168
  async readSignoutResponseState(e, t = !1) {
1814
- const s = this._logger.create("readSignoutResponseState"), i = new _s(pe.readParams(e, this.settings.response_mode));
1169
+ const s = this._logger.create("readSignoutResponseState"), i = new ss(ge.readParams(e, this.settings.response_mode));
1815
1170
  if (!i.state) {
1816
1171
  if (s.debug("No state in response"), i.error)
1817
- throw s.warn("Response was error:", i.error), new J(i);
1172
+ throw s.warn("Response was error:", i.error), new W(i);
1818
1173
  return { state: void 0, response: i };
1819
1174
  }
1820
1175
  const r = await this.settings.stateStore[t ? "remove" : "get"](i.state);
1821
1176
  if (!r)
1822
1177
  throw s.throw(new Error("No matching state found in storage")), null;
1823
- return { state: Q.fromStorageString(r), response: i };
1178
+ return { state: await se.fromStorageString(r), response: i };
1824
1179
  }
1825
1180
  async processSignoutResponse(e) {
1826
1181
  const t = this._logger.create("processSignoutResponse"), { state: s, response: i } = await this.readSignoutResponseState(e, !0);
1827
1182
  return s ? (t.debug("Received state from storage; validating response"), this._validator.validateSignoutResponse(i, s)) : t.debug("No state from storage; skipping response validation"), i;
1828
1183
  }
1829
1184
  clearStaleState() {
1830
- return this._logger.create("clearStaleState"), Q.clearStaleState(this.settings.stateStore, this.settings.staleStateAgeInSeconds);
1185
+ return this._logger.create("clearStaleState"), se.clearStaleState(this.settings.stateStore, this.settings.staleStateAgeInSeconds);
1831
1186
  }
1832
1187
  async revokeToken(e, t) {
1833
1188
  return this._logger.create("revokeToken"), await this._tokenClient.revoke({
@@ -1835,14 +1190,14 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1835
1190
  token_type_hint: t
1836
1191
  });
1837
1192
  }
1838
- }, vs = class {
1193
+ }, as = class {
1839
1194
  constructor(e) {
1840
- this._userManager = e, this._logger = new v("SessionMonitor"), this._start = async (t) => {
1195
+ this._userManager = e, this._logger = new u("SessionMonitor"), this._start = async (t) => {
1841
1196
  const s = t.session_state;
1842
1197
  if (!s)
1843
1198
  return;
1844
1199
  const i = this._logger.create("_start");
1845
- if (t.profile ? (this._sub = t.profile.sub, this._sid = t.profile.sid, i.debug("session_state", s, ", sub", this._sub)) : (this._sub = void 0, this._sid = void 0, i.debug("session_state", s, ", anonymous user")), this._checkSessionIFrame) {
1200
+ if (t.profile ? (this._sub = t.profile.sub, i.debug("session_state", s, ", sub", this._sub)) : (this._sub = void 0, i.debug("session_state", s, ", anonymous user")), this._checkSessionIFrame) {
1846
1201
  this._checkSessionIFrame.start(s);
1847
1202
  return;
1848
1203
  }
@@ -1850,8 +1205,8 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1850
1205
  const r = await this._userManager.metadataService.getCheckSessionIframe();
1851
1206
  if (r) {
1852
1207
  i.debug("initializing check session iframe");
1853
- const n = this._userManager.settings.client_id, o = this._userManager.settings.checkSessionIntervalInSeconds, a = this._userManager.settings.stopCheckSessionOnError, c = new ts(this._callback, n, r, o, a);
1854
- await c.load(), this._checkSessionIFrame = c, c.start(s);
1208
+ const n = this._userManager.settings.client_id, a = this._userManager.settings.checkSessionIntervalInSeconds, o = this._userManager.settings.stopCheckSessionOnError, l = new zt(this._callback, n, r, a, o);
1209
+ await l.load(), this._checkSessionIFrame = l, l.start(s);
1855
1210
  } else
1856
1211
  i.warn("no check session iframe found in the metadata");
1857
1212
  } catch (r) {
@@ -1859,7 +1214,7 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1859
1214
  }
1860
1215
  }, this._stop = () => {
1861
1216
  const t = this._logger.create("_stop");
1862
- if (this._sub = void 0, this._sid = void 0, this._checkSessionIFrame && this._checkSessionIFrame.stop(), this._userManager.settings.monitorAnonymousSession) {
1217
+ if (this._sub = void 0, this._checkSessionIFrame && this._checkSessionIFrame.stop(), this._userManager.settings.monitorAnonymousSession) {
1863
1218
  const s = setInterval(async () => {
1864
1219
  clearInterval(s);
1865
1220
  try {
@@ -1867,9 +1222,8 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1867
1222
  if (i) {
1868
1223
  const r = {
1869
1224
  session_state: i.session_state,
1870
- profile: i.sub && i.sid ? {
1871
- sub: i.sub,
1872
- sid: i.sid
1225
+ profile: i.sub ? {
1226
+ sub: i.sub
1873
1227
  } : null
1874
1228
  };
1875
1229
  this._start(r);
@@ -1884,9 +1238,9 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1884
1238
  try {
1885
1239
  const s = await this._userManager.querySessionStatus();
1886
1240
  let i = !0;
1887
- s && this._checkSessionIFrame ? s.sub === this._sub ? (i = !1, this._checkSessionIFrame.start(s.session_state), s.sid === this._sid ? t.debug("same sub still logged in at OP, restarting check session iframe; session_state", s.session_state) : (t.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state", s.session_state), this._userManager.events._raiseUserSessionChanged())) : t.debug("different subject signed into OP", s.sub) : t.debug("subject no longer signed into OP"), i ? this._sub ? this._userManager.events._raiseUserSignedOut() : this._userManager.events._raiseUserSignedIn() : t.debug("no change in session detected, no event to raise");
1241
+ s && this._checkSessionIFrame ? s.sub === this._sub ? (i = !1, this._checkSessionIFrame.start(s.session_state), t.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state", s.session_state), await this._userManager.events._raiseUserSessionChanged()) : t.debug("different subject signed into OP", s.sub) : t.debug("subject no longer signed into OP"), i ? this._sub ? await this._userManager.events._raiseUserSignedOut() : await this._userManager.events._raiseUserSignedIn() : t.debug("no change in session detected, no event to raise");
1888
1242
  } catch (s) {
1889
- this._sub && (t.debug("Error calling queryCurrentSigninSession; raising signed out event", s), this._userManager.events._raiseUserSignedOut());
1243
+ this._sub && (t.debug("Error calling queryCurrentSigninSession; raising signed out event", s), await this._userManager.events._raiseUserSignedOut());
1890
1244
  }
1891
1245
  }, e || this._logger.throw(new Error("No user manager passed")), this._userManager.events.addUserLoaded(this._start), this._userManager.events.addUserUnloaded(this._stop), this._init().catch((t) => {
1892
1246
  this._logger.error(t);
@@ -1902,41 +1256,40 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1902
1256
  if (t) {
1903
1257
  const s = {
1904
1258
  session_state: t.session_state,
1905
- profile: t.sub && t.sid ? {
1906
- sub: t.sub,
1907
- sid: t.sid
1259
+ profile: t.sub ? {
1260
+ sub: t.sub
1908
1261
  } : null
1909
1262
  };
1910
1263
  this._start(s);
1911
1264
  }
1912
1265
  }
1913
1266
  }
1914
- }, Y = class {
1915
- constructor(e) {
1916
- var t;
1917
- this.id_token = e.id_token, this.session_state = (t = e.session_state) != null ? t : null, this.access_token = e.access_token, this.refresh_token = e.refresh_token, this.token_type = e.token_type, this.scope = e.scope, this.profile = e.profile, this.expires_at = e.expires_at, this.state = e.userState, this.url_state = e.url_state;
1267
+ }, le = class Ge {
1268
+ constructor(t) {
1269
+ var s;
1270
+ this.id_token = t.id_token, this.session_state = (s = t.session_state) != null ? s : null, this.access_token = t.access_token, this.refresh_token = t.refresh_token, this.token_type = t.token_type, this.scope = t.scope, this.profile = t.profile, this.expires_at = t.expires_at, this.state = t.userState, this.url_state = t.url_state;
1918
1271
  }
1919
1272
  /** Computed number of seconds the access token has remaining. */
1920
1273
  get expires_in() {
1921
1274
  if (this.expires_at !== void 0)
1922
- return this.expires_at - q.getEpochTime();
1275
+ return this.expires_at - D.getEpochTime();
1923
1276
  }
1924
- set expires_in(e) {
1925
- e !== void 0 && (this.expires_at = Math.floor(e) + q.getEpochTime());
1277
+ set expires_in(t) {
1278
+ t !== void 0 && (this.expires_at = Math.floor(t) + D.getEpochTime());
1926
1279
  }
1927
1280
  /** Computed value indicating if the access token is expired. */
1928
1281
  get expired() {
1929
- const e = this.expires_in;
1930
- if (e !== void 0)
1931
- return e <= 0;
1282
+ const t = this.expires_in;
1283
+ if (t !== void 0)
1284
+ return t <= 0;
1932
1285
  }
1933
1286
  /** Array representing the parsed values from the `scope`. */
1934
1287
  get scopes() {
1935
- var e, t;
1936
- return (t = (e = this.scope) == null ? void 0 : e.split(" ")) != null ? t : [];
1288
+ var t, s;
1289
+ return (s = (t = this.scope) == null ? void 0 : t.split(" ")) != null ? s : [];
1937
1290
  }
1938
1291
  toStorageString() {
1939
- return new v("User").create("toStorageString"), JSON.stringify({
1292
+ return new u("User").create("toStorageString"), JSON.stringify({
1940
1293
  id_token: this.id_token,
1941
1294
  session_state: this.session_state,
1942
1295
  access_token: this.access_token,
@@ -1947,12 +1300,12 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1947
1300
  expires_at: this.expires_at
1948
1301
  });
1949
1302
  }
1950
- static fromStorageString(e) {
1951
- return v.createStatic("User", "fromStorageString"), new Y(JSON.parse(e));
1303
+ static fromStorageString(t) {
1304
+ return u.createStatic("User", "fromStorageString"), new Ge(JSON.parse(t));
1952
1305
  }
1953
- }, Me = "oidc-client", Ye = class {
1306
+ }, qe = "oidc-client", Qe = class {
1954
1307
  constructor() {
1955
- this._abort = new $("Window navigation aborted"), this._disposeHandlers = /* @__PURE__ */ new Set(), this._window = null;
1308
+ this._abort = new F("Window navigation aborted"), this._disposeHandlers = /* @__PURE__ */ new Set(), this._window = null;
1956
1309
  }
1957
1310
  async navigate(e) {
1958
1311
  const t = this._logger.create("navigate");
@@ -1960,22 +1313,22 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1960
1313
  throw new Error("Attempted to navigate on a disposed window");
1961
1314
  t.debug("setting URL in window"), this._window.location.replace(e.url);
1962
1315
  const { url: s, keepOpen: i } = await new Promise((r, n) => {
1963
- const o = (a) => {
1964
- var c;
1965
- const h = a.data, u = (c = e.scriptOrigin) != null ? c : window.location.origin;
1966
- if (!(a.origin !== u || (h == null ? void 0 : h.source) !== Me)) {
1316
+ const a = (o) => {
1317
+ var l;
1318
+ const d = o.data, h = (l = e.scriptOrigin) != null ? l : window.location.origin;
1319
+ if (!(o.origin !== h || (d == null ? void 0 : d.source) !== qe)) {
1967
1320
  try {
1968
- const _ = pe.readParams(h.url, e.response_mode).get("state");
1969
- if (_ || t.warn("no state found in response url"), a.source !== this._window && _ !== e.state)
1321
+ const g = ge.readParams(d.url, e.response_mode).get("state");
1322
+ if (g || t.warn("no state found in response url"), o.source !== this._window && g !== e.state)
1970
1323
  return;
1971
1324
  } catch {
1972
1325
  this._dispose(), n(new Error("Invalid response from window"));
1973
1326
  }
1974
- r(h);
1327
+ r(d);
1975
1328
  }
1976
1329
  };
1977
- window.addEventListener("message", o, !1), this._disposeHandlers.add(() => window.removeEventListener("message", o, !1)), this._disposeHandlers.add(this._abort.addHandler((a) => {
1978
- this._dispose(), n(a);
1330
+ window.addEventListener("message", a, !1), this._disposeHandlers.add(() => window.removeEventListener("message", a, !1)), this._disposeHandlers.add(this._abort.addHandler((o) => {
1331
+ this._dispose(), n(o);
1979
1332
  }));
1980
1333
  });
1981
1334
  return t.debug("got response from window"), this._dispose(), i || this.close(), { url: s };
@@ -1988,109 +1341,109 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
1988
1341
  }
1989
1342
  static _notifyParent(e, t, s = !1, i = window.location.origin) {
1990
1343
  e.postMessage({
1991
- source: Me,
1344
+ source: qe,
1992
1345
  url: t,
1993
1346
  keepOpen: s
1994
1347
  }, i);
1995
1348
  }
1996
- }, Ze = {
1349
+ }, Xe = {
1997
1350
  location: !1,
1998
1351
  toolbar: !1,
1999
1352
  height: 640,
2000
1353
  closePopupWindowAfterInSeconds: -1
2001
- }, et = "_blank", Ss = 60, ys = 2, tt = 10, bs = class extends we {
1354
+ }, Ye = "_blank", cs = 60, ls = 2, Ze = 10, ds = class extends _e {
2002
1355
  constructor(e) {
2003
1356
  const {
2004
1357
  popup_redirect_uri: t = e.redirect_uri,
2005
1358
  popup_post_logout_redirect_uri: s = e.post_logout_redirect_uri,
2006
- popupWindowFeatures: i = Ze,
2007
- popupWindowTarget: r = et,
1359
+ popupWindowFeatures: i = Xe,
1360
+ popupWindowTarget: r = Ye,
2008
1361
  redirectMethod: n = "assign",
2009
- redirectTarget: o = "self",
2010
- iframeNotifyParentOrigin: a = e.iframeNotifyParentOrigin,
2011
- iframeScriptOrigin: c = e.iframeScriptOrigin,
2012
- silent_redirect_uri: h = e.redirect_uri,
2013
- silentRequestTimeoutInSeconds: u = tt,
2014
- automaticSilentRenew: _ = !0,
2015
- validateSubOnSilentRenew: y = !0,
2016
- includeIdTokenInSilentRenew: w = !1,
2017
- monitorSession: C = !1,
2018
- monitorAnonymousSession: p = !1,
2019
- checkSessionIntervalInSeconds: S = ys,
2020
- query_status_response_type: E = "code",
2021
- stopCheckSessionOnError: d = !0,
2022
- revokeTokenTypes: g = ["access_token", "refresh_token"],
2023
- revokeTokensOnSignout: f = !1,
2024
- includeIdTokenInSilentSignout: m = !1,
2025
- accessTokenExpiringNotificationTimeInSeconds: k = Ss,
2026
- userStore: T
1362
+ redirectTarget: a = "self",
1363
+ iframeNotifyParentOrigin: o = e.iframeNotifyParentOrigin,
1364
+ iframeScriptOrigin: l = e.iframeScriptOrigin,
1365
+ silent_redirect_uri: d = e.redirect_uri,
1366
+ silentRequestTimeoutInSeconds: h = Ze,
1367
+ automaticSilentRenew: g = !0,
1368
+ validateSubOnSilentRenew: v = !0,
1369
+ includeIdTokenInSilentRenew: b = !1,
1370
+ monitorSession: R = !1,
1371
+ monitorAnonymousSession: k = !1,
1372
+ checkSessionIntervalInSeconds: x = ls,
1373
+ query_status_response_type: I = "code",
1374
+ stopCheckSessionOnError: H = !0,
1375
+ revokeTokenTypes: T = ["access_token", "refresh_token"],
1376
+ revokeTokensOnSignout: w = !1,
1377
+ includeIdTokenInSilentSignout: U = !1,
1378
+ accessTokenExpiringNotificationTimeInSeconds: C = cs,
1379
+ userStore: S
2027
1380
  } = e;
2028
- if (super(e), this.popup_redirect_uri = t, this.popup_post_logout_redirect_uri = s, this.popupWindowFeatures = i, this.popupWindowTarget = r, this.redirectMethod = n, this.redirectTarget = o, this.iframeNotifyParentOrigin = a, this.iframeScriptOrigin = c, this.silent_redirect_uri = h, this.silentRequestTimeoutInSeconds = u, this.automaticSilentRenew = _, this.validateSubOnSilentRenew = y, this.includeIdTokenInSilentRenew = w, this.monitorSession = C, this.monitorAnonymousSession = p, this.checkSessionIntervalInSeconds = S, this.stopCheckSessionOnError = d, this.query_status_response_type = E, this.revokeTokenTypes = g, this.revokeTokensOnSignout = f, this.includeIdTokenInSilentSignout = m, this.accessTokenExpiringNotificationTimeInSeconds = k, T)
2029
- this.userStore = T;
1381
+ if (super(e), this.popup_redirect_uri = t, this.popup_post_logout_redirect_uri = s, this.popupWindowFeatures = i, this.popupWindowTarget = r, this.redirectMethod = n, this.redirectTarget = a, this.iframeNotifyParentOrigin = o, this.iframeScriptOrigin = l, this.silent_redirect_uri = d, this.silentRequestTimeoutInSeconds = h, this.automaticSilentRenew = g, this.validateSubOnSilentRenew = v, this.includeIdTokenInSilentRenew = b, this.monitorSession = R, this.monitorAnonymousSession = k, this.checkSessionIntervalInSeconds = x, this.stopCheckSessionOnError = H, this.query_status_response_type = I, this.revokeTokenTypes = T, this.revokeTokensOnSignout = w, this.includeIdTokenInSilentSignout = U, this.accessTokenExpiringNotificationTimeInSeconds = C, S)
1382
+ this.userStore = S;
2030
1383
  else {
2031
- const R = typeof window < "u" ? window.sessionStorage : new Ge();
2032
- this.userStore = new Qe({ store: R });
1384
+ const M = typeof window < "u" ? window.sessionStorage : new We();
1385
+ this.userStore = new Ke({ store: M });
2033
1386
  }
2034
1387
  }
2035
- }, me = class extends Ye {
1388
+ }, je = class et extends Qe {
2036
1389
  constructor({
2037
- silentRequestTimeoutInSeconds: e = tt
1390
+ silentRequestTimeoutInSeconds: t = Ze
2038
1391
  }) {
2039
- super(), this._logger = new v("IFrameWindow"), this._timeoutInSeconds = e, this._frame = me.createHiddenIframe(), this._window = this._frame.contentWindow;
1392
+ super(), this._logger = new u("IFrameWindow"), this._timeoutInSeconds = t, this._frame = et.createHiddenIframe(), this._window = this._frame.contentWindow;
2040
1393
  }
2041
1394
  static createHiddenIframe() {
2042
- const e = window.document.createElement("iframe");
2043
- return e.style.visibility = "hidden", e.style.position = "fixed", e.style.left = "-1000px", e.style.top = "0", e.width = "0", e.height = "0", window.document.body.appendChild(e), e;
1395
+ const t = window.document.createElement("iframe");
1396
+ return t.style.visibility = "hidden", t.style.position = "fixed", t.style.left = "-1000px", t.style.top = "0", t.width = "0", t.height = "0", window.document.body.appendChild(t), t;
2044
1397
  }
2045
- async navigate(e) {
1398
+ async navigate(t) {
2046
1399
  this._logger.debug("navigate: Using timeout of:", this._timeoutInSeconds);
2047
- const t = setTimeout(() => this._abort.raise(new Ie("IFrame timed out without a response")), this._timeoutInSeconds * 1e3);
2048
- return this._disposeHandlers.add(() => clearTimeout(t)), await super.navigate(e);
1400
+ const s = setTimeout(() => void this._abort.raise(new ke("IFrame timed out without a response")), this._timeoutInSeconds * 1e3);
1401
+ return this._disposeHandlers.add(() => clearTimeout(s)), await super.navigate(t);
2049
1402
  }
2050
1403
  close() {
2051
- var e;
2052
- this._frame && (this._frame.parentNode && (this._frame.addEventListener("load", (t) => {
2053
- var s;
2054
- const i = t.target;
2055
- (s = i.parentNode) == null || s.removeChild(i), this._abort.raise(new Error("IFrame removed from DOM"));
2056
- }, !0), (e = this._frame.contentWindow) == null || e.location.replace("about:blank")), this._frame = null), this._window = null;
1404
+ var t;
1405
+ this._frame && (this._frame.parentNode && (this._frame.addEventListener("load", (s) => {
1406
+ var i;
1407
+ const r = s.target;
1408
+ (i = r.parentNode) == null || i.removeChild(r), this._abort.raise(new Error("IFrame removed from DOM"));
1409
+ }, !0), (t = this._frame.contentWindow) == null || t.location.replace("about:blank")), this._frame = null), this._window = null;
2057
1410
  }
2058
- static notifyParent(e, t) {
2059
- return super._notifyParent(window.parent, e, !1, t);
1411
+ static notifyParent(t, s) {
1412
+ return super._notifyParent(window.parent, t, !1, s);
2060
1413
  }
2061
- }, ks = class {
1414
+ }, hs = class {
2062
1415
  constructor(e) {
2063
- this._settings = e, this._logger = new v("IFrameNavigator");
1416
+ this._settings = e, this._logger = new u("IFrameNavigator");
2064
1417
  }
2065
1418
  async prepare({
2066
1419
  silentRequestTimeoutInSeconds: e = this._settings.silentRequestTimeoutInSeconds
2067
1420
  }) {
2068
- return new me({ silentRequestTimeoutInSeconds: e });
1421
+ return new je({ silentRequestTimeoutInSeconds: e });
2069
1422
  }
2070
1423
  async callback(e) {
2071
- this._logger.create("callback"), me.notifyParent(e, this._settings.iframeNotifyParentOrigin);
1424
+ this._logger.create("callback"), je.notifyParent(e, this._settings.iframeNotifyParentOrigin);
2072
1425
  }
2073
- }, Ts = 500, Is = 1e3, De = class extends Ye {
1426
+ }, gs = 500, us = 1e3, He = class extends Qe {
2074
1427
  constructor({
2075
- popupWindowTarget: e = et,
1428
+ popupWindowTarget: e = Ye,
2076
1429
  popupWindowFeatures: t = {}
2077
1430
  }) {
2078
- super(), this._logger = new v("PopupWindow");
2079
- const s = je.center({ ...Ze, ...t });
2080
- this._window = window.open(void 0, e, je.serialize(s)), t.closePopupWindowAfterInSeconds && t.closePopupWindowAfterInSeconds > 0 && setTimeout(() => {
1431
+ super(), this._logger = new u("PopupWindow");
1432
+ const s = Ne.center({ ...Xe, ...t });
1433
+ this._window = window.open(void 0, e, Ne.serialize(s)), t.closePopupWindowAfterInSeconds && t.closePopupWindowAfterInSeconds > 0 && setTimeout(() => {
2081
1434
  if (!this._window || typeof this._window.closed != "boolean" || this._window.closed) {
2082
1435
  this._abort.raise(new Error("Popup blocked by user"));
2083
1436
  return;
2084
1437
  }
2085
1438
  this.close();
2086
- }, t.closePopupWindowAfterInSeconds * Is);
1439
+ }, t.closePopupWindowAfterInSeconds * us);
2087
1440
  }
2088
1441
  async navigate(e) {
2089
1442
  var t;
2090
1443
  (t = this._window) == null || t.focus();
2091
1444
  const s = setInterval(() => {
2092
1445
  (!this._window || this._window.closed) && this._abort.raise(new Error("Popup closed by user"));
2093
- }, Ts);
1446
+ }, gs);
2094
1447
  return this._disposeHandlers.add(() => clearInterval(s)), await super.navigate(e);
2095
1448
  }
2096
1449
  close() {
@@ -2101,22 +1454,22 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
2101
1454
  throw new Error("No window.opener. Can't complete notification.");
2102
1455
  return super._notifyParent(window.opener, e, t);
2103
1456
  }
2104
- }, Cs = class {
1457
+ }, _s = class {
2105
1458
  constructor(e) {
2106
- this._settings = e, this._logger = new v("PopupNavigator");
1459
+ this._settings = e, this._logger = new u("PopupNavigator");
2107
1460
  }
2108
1461
  async prepare({
2109
1462
  popupWindowFeatures: e = this._settings.popupWindowFeatures,
2110
1463
  popupWindowTarget: t = this._settings.popupWindowTarget
2111
1464
  }) {
2112
- return new De({ popupWindowFeatures: e, popupWindowTarget: t });
1465
+ return new He({ popupWindowFeatures: e, popupWindowTarget: t });
2113
1466
  }
2114
1467
  async callback(e, { keepOpen: t = !1 }) {
2115
- this._logger.create("callback"), De.notifyOpener(e, t);
1468
+ this._logger.create("callback"), He.notifyOpener(e, t);
2116
1469
  }
2117
- }, Es = class {
1470
+ }, ps = class {
2118
1471
  constructor(e) {
2119
- this._settings = e, this._logger = new v("RedirectNavigator");
1472
+ this._settings = e, this._logger = new u("RedirectNavigator");
2120
1473
  }
2121
1474
  async prepare({
2122
1475
  redirectMethod: e = this._settings.redirectMethod,
@@ -2129,12 +1482,12 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
2129
1482
  const r = i.location[e].bind(i.location);
2130
1483
  let n;
2131
1484
  return {
2132
- navigate: async (o) => {
1485
+ navigate: async (a) => {
2133
1486
  this._logger.create("navigate");
2134
- const a = new Promise((c, h) => {
2135
- n = h;
1487
+ const o = new Promise((l, d) => {
1488
+ n = d;
2136
1489
  });
2137
- return r(o.url), await a;
1490
+ return r(a.url), await o;
2138
1491
  },
2139
1492
  close: () => {
2140
1493
  this._logger.create("close"), n == null || n(new Error("Redirect aborted")), i.stop();
@@ -2143,15 +1496,15 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
2143
1496
  }
2144
1497
  async callback() {
2145
1498
  }
2146
- }, xs = class extends es {
1499
+ }, fs = class extends Kt {
2147
1500
  constructor(e) {
2148
- super({ expiringNotificationTimeInSeconds: e.accessTokenExpiringNotificationTimeInSeconds }), this._logger = new v("UserManagerEvents"), this._userLoaded = new $("User loaded"), this._userUnloaded = new $("User unloaded"), this._silentRenewError = new $("Silent renew error"), this._userSignedIn = new $("User signed in"), this._userSignedOut = new $("User signed out"), this._userSessionChanged = new $("User session changed");
1501
+ super({ expiringNotificationTimeInSeconds: e.accessTokenExpiringNotificationTimeInSeconds }), this._logger = new u("UserManagerEvents"), this._userLoaded = new F("User loaded"), this._userUnloaded = new F("User unloaded"), this._silentRenewError = new F("Silent renew error"), this._userSignedIn = new F("User signed in"), this._userSignedOut = new F("User signed out"), this._userSessionChanged = new F("User session changed");
2149
1502
  }
2150
- load(e, t = !0) {
2151
- super.load(e), t && this._userLoaded.raise(e);
1503
+ async load(e, t = !0) {
1504
+ super.load(e), t && await this._userLoaded.raise(e);
2152
1505
  }
2153
- unload() {
2154
- super.unload(), this._userUnloaded.raise();
1506
+ async unload() {
1507
+ super.unload(), await this._userUnloaded.raise();
2155
1508
  }
2156
1509
  /**
2157
1510
  * Add callback: Raised when a user session has been established (or re-established).
@@ -2192,8 +1545,8 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
2192
1545
  /**
2193
1546
  * @internal
2194
1547
  */
2195
- _raiseSilentRenewError(e) {
2196
- this._silentRenewError.raise(e);
1548
+ async _raiseSilentRenewError(e) {
1549
+ await this._silentRenewError.raise(e);
2197
1550
  }
2198
1551
  /**
2199
1552
  * Add callback: Raised when the user is signed in (when `monitorSession` is set).
@@ -2211,8 +1564,8 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
2211
1564
  /**
2212
1565
  * @internal
2213
1566
  */
2214
- _raiseUserSignedIn() {
2215
- this._userSignedIn.raise();
1567
+ async _raiseUserSignedIn() {
1568
+ await this._userSignedIn.raise();
2216
1569
  }
2217
1570
  /**
2218
1571
  * Add callback: Raised when the user's sign-in status at the OP has changed (when `monitorSession` is set).
@@ -2230,8 +1583,8 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
2230
1583
  /**
2231
1584
  * @internal
2232
1585
  */
2233
- _raiseUserSignedOut() {
2234
- this._userSignedOut.raise();
1586
+ async _raiseUserSignedOut() {
1587
+ await this._userSignedOut.raise();
2235
1588
  }
2236
1589
  /**
2237
1590
  * Add callback: Raised when the user session changed (when `monitorSession` is set).
@@ -2249,21 +1602,21 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
2249
1602
  /**
2250
1603
  * @internal
2251
1604
  */
2252
- _raiseUserSessionChanged() {
2253
- this._userSessionChanged.raise();
1605
+ async _raiseUserSessionChanged() {
1606
+ await this._userSessionChanged.raise();
2254
1607
  }
2255
- }, Rs = class {
1608
+ }, ms = class {
2256
1609
  constructor(e) {
2257
- this._userManager = e, this._logger = new v("SilentRenewService"), this._isStarted = !1, this._retryTimer = new q("Retry Silent Renew"), this._tokenExpiring = async () => {
1610
+ this._userManager = e, this._logger = new u("SilentRenewService"), this._isStarted = !1, this._retryTimer = new D("Retry Silent Renew"), this._tokenExpiring = async () => {
2258
1611
  const t = this._logger.create("_tokenExpiring");
2259
1612
  try {
2260
1613
  await this._userManager.signinSilent(), t.debug("silent token renewal successful");
2261
1614
  } catch (s) {
2262
- if (s instanceof Ie) {
1615
+ if (s instanceof ke) {
2263
1616
  t.warn("ErrorTimeout from signinSilent:", s, "retry in 5s"), this._retryTimer.init(5);
2264
1617
  return;
2265
1618
  }
2266
- t.error("Error from signinSilent:", s), this._userManager.events._raiseSilentRenewError(s);
1619
+ t.error("Error from signinSilent:", s), await this._userManager.events._raiseSilentRenewError(s);
2267
1620
  }
2268
1621
  };
2269
1622
  }
@@ -2281,38 +1634,50 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
2281
1634
  stop() {
2282
1635
  this._isStarted && (this._retryTimer.cancel(), this._retryTimer.removeHandler(this._tokenExpiring), this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring), this._isStarted = !1);
2283
1636
  }
2284
- }, Us = class {
2285
- constructor(e, t) {
2286
- this.refresh_token = e.refresh_token, this.id_token = e.id_token, this.session_state = e.session_state, this.scope = e.scope, this.profile = e.profile, this.resource = t, this.data = e.state;
1637
+ }, ws = class {
1638
+ constructor(e) {
1639
+ this.refresh_token = e.refresh_token, this.id_token = e.id_token, this.session_state = e.session_state, this.scope = e.scope, this.profile = e.profile, this.data = e.state;
2287
1640
  }
2288
- }, Ps = class {
1641
+ }, vs = class {
2289
1642
  constructor(e, t, s, i) {
2290
- this._logger = new v("UserManager"), this.settings = new bs(e), this._client = new ms(e), this._redirectNavigator = t ?? new Es(this.settings), this._popupNavigator = s ?? new Cs(this.settings), this._iframeNavigator = i ?? new ks(this.settings), this._events = new xs(this.settings), this._silentRenewService = new Rs(this), this.settings.automaticSilentRenew && this.startSilentRenew(), this._sessionMonitor = null, this.settings.monitorSession && (this._sessionMonitor = new vs(this));
1643
+ this._logger = new u("UserManager"), this.settings = new ds(e), this._client = new os(e), this._redirectNavigator = t ?? new ps(this.settings), this._popupNavigator = s ?? new _s(this.settings), this._iframeNavigator = i ?? new hs(this.settings), this._events = new fs(this.settings), this._silentRenewService = new ms(this), this.settings.automaticSilentRenew && this.startSilentRenew(), this._sessionMonitor = null, this.settings.monitorSession && (this._sessionMonitor = new as(this));
2291
1644
  }
2292
- /** Returns an object used to register for events raised by the `UserManager`. */
1645
+ /**
1646
+ * Get object used to register for events raised by the `UserManager`.
1647
+ */
2293
1648
  get events() {
2294
1649
  return this._events;
2295
1650
  }
2296
- /** Returns an object used to access the metadata configuration of the OIDC provider. */
1651
+ /**
1652
+ * Get object used to access the metadata configuration of the identity provider.
1653
+ */
2297
1654
  get metadataService() {
2298
1655
  return this._client.metadataService;
2299
1656
  }
2300
1657
  /**
2301
- * Returns promise to load the `User` object for the currently authenticated user.
1658
+ * Load the `User` object for the currently authenticated user.
1659
+ *
1660
+ * @returns A promise
2302
1661
  */
2303
1662
  async getUser() {
2304
1663
  const e = this._logger.create("getUser"), t = await this._loadUser();
2305
- return t ? (e.info("user loaded"), this._events.load(t, !1), t) : (e.info("user not found in storage"), null);
1664
+ return t ? (e.info("user loaded"), await this._events.load(t, !1), t) : (e.info("user not found in storage"), null);
2306
1665
  }
2307
1666
  /**
2308
- * Returns promise to remove from any storage the currently authenticated user.
1667
+ * Remove from any storage the currently authenticated user.
1668
+ *
1669
+ * @returns A promise
2309
1670
  */
2310
1671
  async removeUser() {
2311
1672
  const e = this._logger.create("removeUser");
2312
- await this.storeUser(null), e.info("user removed from storage"), this._events.unload();
1673
+ await this.storeUser(null), e.info("user removed from storage"), await this._events.unload();
2313
1674
  }
2314
1675
  /**
2315
- * Returns promise to trigger a redirect of the current window to the authorization endpoint.
1676
+ * Trigger a redirect of the current window to the authorization endpoint.
1677
+ *
1678
+ * @returns A promise
1679
+ *
1680
+ * @throws `Error` In cases of wrong authentication.
2316
1681
  */
2317
1682
  async signinRedirect(e = {}) {
2318
1683
  this._logger.create("signinRedirect");
@@ -2326,16 +1691,22 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
2326
1691
  }, i);
2327
1692
  }
2328
1693
  /**
2329
- * Returns promise to process response from the authorization endpoint. The result of the promise is the authenticated `User`.
1694
+ * Process the response (callback) from the authorization endpoint.
1695
+ * It is recommend to use {@link UserManager.signinCallback} instead.
1696
+ *
1697
+ * @returns A promise containing the authenticated `User`.
1698
+ *
1699
+ * @see {@link UserManager.signinCallback}
2330
1700
  */
2331
1701
  async signinRedirectCallback(e = window.location.href) {
2332
1702
  const t = this._logger.create("signinRedirectCallback"), s = await this._signinEnd(e);
2333
1703
  return s.profile && s.profile.sub ? t.info("success, signed in subject", s.profile.sub) : t.info("no subject"), s;
2334
1704
  }
2335
1705
  /**
2336
- * Returns promise to process the signin with user/password. The result of the promise is the authenticated `User`.
1706
+ * Trigger the signin with user/password.
2337
1707
  *
2338
- * Throws an ErrorResponse in case of wrong authentication.
1708
+ * @returns A promise containing the authenticated `User`.
1709
+ * @throws {@link ErrorResponse} In cases of wrong authentication.
2339
1710
  */
2340
1711
  async signinResourceOwnerCredentials({
2341
1712
  username: e,
@@ -2348,7 +1719,10 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
2348
1719
  return n.profile && n.profile.sub ? i.info("success, signed in subject", n.profile.sub) : i.info("no subject"), n;
2349
1720
  }
2350
1721
  /**
2351
- * Returns promise to trigger a request (via a popup window) to the authorization endpoint. The result of the promise is the authenticated `User`.
1722
+ * Trigger a request (via a popup window) to the authorization endpoint.
1723
+ *
1724
+ * @returns A promise containing the authenticated `User`.
1725
+ * @throws `Error` In cases of wrong authentication.
2352
1726
  */
2353
1727
  async signinPopup(e = {}) {
2354
1728
  const t = this._logger.create("signinPopup"), {
@@ -2357,65 +1731,91 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
2357
1731
  ...r
2358
1732
  } = e, n = this.settings.popup_redirect_uri;
2359
1733
  n || t.throw(new Error("No popup_redirect_uri configured"));
2360
- const o = await this._popupNavigator.prepare({ popupWindowFeatures: s, popupWindowTarget: i }), a = await this._signin({
1734
+ const a = await this._popupNavigator.prepare({ popupWindowFeatures: s, popupWindowTarget: i }), o = await this._signin({
2361
1735
  request_type: "si:p",
2362
1736
  redirect_uri: n,
2363
1737
  display: "popup",
2364
1738
  ...r
2365
- }, o);
2366
- return a && (a.profile && a.profile.sub ? t.info("success, signed in subject", a.profile.sub) : t.info("no subject")), a;
1739
+ }, a);
1740
+ return o && (o.profile && o.profile.sub ? t.info("success, signed in subject", o.profile.sub) : t.info("no subject")), o;
2367
1741
  }
2368
1742
  /**
2369
- * Returns promise to notify the opening window of response from the authorization endpoint.
1743
+ * Notify the opening window of response (callback) from the authorization endpoint.
1744
+ * It is recommend to use {@link UserManager.signinCallback} instead.
1745
+ *
1746
+ * @returns A promise
1747
+ *
1748
+ * @see {@link UserManager.signinCallback}
2370
1749
  */
2371
1750
  async signinPopupCallback(e = window.location.href, t = !1) {
2372
1751
  const s = this._logger.create("signinPopupCallback");
2373
1752
  await this._popupNavigator.callback(e, { keepOpen: t }), s.info("success");
2374
1753
  }
2375
1754
  /**
2376
- * Returns promise to trigger a silent request (via an iframe) to the authorization endpoint.
2377
- * The result of the promise is the authenticated `User`.
1755
+ * Trigger a silent request (via refresh token or an iframe) to the authorization endpoint.
1756
+ *
1757
+ * @returns A promise that contains the authenticated `User`.
2378
1758
  */
2379
1759
  async signinSilent(e = {}) {
2380
1760
  var t;
2381
1761
  const s = this._logger.create("signinSilent"), {
2382
1762
  silentRequestTimeoutInSeconds: i,
2383
- resource: r,
2384
- ...n
1763
+ ...r
2385
1764
  } = e;
2386
- let o = await this._loadUser();
2387
- if (o != null && o.refresh_token) {
1765
+ let n = await this._loadUser();
1766
+ if (n != null && n.refresh_token) {
2388
1767
  s.debug("using refresh token");
2389
- const u = new Us(o, r);
2390
- return await this._useRefreshToken(u);
1768
+ const d = new ws(n);
1769
+ return await this._useRefreshToken({
1770
+ state: d,
1771
+ redirect_uri: r.redirect_uri,
1772
+ resource: r.resource,
1773
+ extraTokenParams: r.extraTokenParams,
1774
+ timeoutInSeconds: i
1775
+ });
2391
1776
  }
2392
1777
  const a = this.settings.silent_redirect_uri;
2393
1778
  a || s.throw(new Error("No silent_redirect_uri configured"));
2394
- let c;
2395
- o && this.settings.validateSubOnSilentRenew && (s.debug("subject prior to silent renew:", o.profile.sub), c = o.profile.sub);
2396
- const h = await this._iframeNavigator.prepare({ silentRequestTimeoutInSeconds: i });
2397
- return o = await this._signin({
1779
+ let o;
1780
+ n && this.settings.validateSubOnSilentRenew && (s.debug("subject prior to silent renew:", n.profile.sub), o = n.profile.sub);
1781
+ const l = await this._iframeNavigator.prepare({ silentRequestTimeoutInSeconds: i });
1782
+ return n = await this._signin({
2398
1783
  request_type: "si:s",
2399
1784
  redirect_uri: a,
2400
1785
  prompt: "none",
2401
- id_token_hint: this.settings.includeIdTokenInSilentRenew ? o == null ? void 0 : o.id_token : void 0,
2402
- ...n
2403
- }, h, c), o && ((t = o.profile) != null && t.sub ? s.info("success, signed in subject", o.profile.sub) : s.info("no subject")), o;
1786
+ id_token_hint: this.settings.includeIdTokenInSilentRenew ? n == null ? void 0 : n.id_token : void 0,
1787
+ ...r
1788
+ }, l, o), n && ((t = n.profile) != null && t.sub ? s.info("success, signed in subject", n.profile.sub) : s.info("no subject")), n;
2404
1789
  }
2405
1790
  async _useRefreshToken(e) {
2406
1791
  const t = await this._client.useRefreshToken({
2407
- state: e,
1792
+ ...e,
2408
1793
  timeoutInSeconds: this.settings.silentRequestTimeoutInSeconds
2409
- }), s = new Y({ ...e, ...t });
2410
- return await this.storeUser(s), this._events.load(s), s;
1794
+ }), s = new le({ ...e.state, ...t });
1795
+ return await this.storeUser(s), await this._events.load(s), s;
2411
1796
  }
2412
1797
  /**
2413
- * Returns promise to notify the parent window of response from the authorization endpoint.
1798
+ *
1799
+ * Notify the parent window of response (callback) from the authorization endpoint.
1800
+ * It is recommend to use {@link UserManager.signinCallback} instead.
1801
+ *
1802
+ * @returns A promise
1803
+ *
1804
+ * @see {@link UserManager.signinCallback}
2414
1805
  */
2415
1806
  async signinSilentCallback(e = window.location.href) {
2416
1807
  const t = this._logger.create("signinSilentCallback");
2417
1808
  await this._iframeNavigator.callback(e), t.info("success");
2418
1809
  }
1810
+ /**
1811
+ * Process any response (callback) from the authorization endpoint, by dispatching the request_type
1812
+ * and executing one of the following functions:
1813
+ * - {@link UserManager.signinRedirectCallback}
1814
+ * - {@link UserManager.signinPopupCallback}
1815
+ * - {@link UserManager.signinSilentCallback}
1816
+ *
1817
+ * @throws `Error` If request_type is unknown or signout can not processed.
1818
+ */
2419
1819
  async signinCallback(e = window.location.href) {
2420
1820
  const { state: t } = await this._client.readSigninResponseState(e);
2421
1821
  switch (t.request_type) {
@@ -2429,6 +1829,15 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
2429
1829
  throw new Error("invalid response_type in state");
2430
1830
  }
2431
1831
  }
1832
+ /**
1833
+ * Process any response (callback) from the end session endpoint, by dispatching the request_type
1834
+ * and executing one of the following functions:
1835
+ * - {@link UserManager.signoutRedirectCallback}
1836
+ * - {@link UserManager.signoutPopupCallback}
1837
+ * - {@link UserManager.signoutSilentCallback}
1838
+ *
1839
+ * @throws `Error` If request_type is unknown or signout can not processed.
1840
+ */
2432
1841
  async signoutCallback(e = window.location.href, t = !1) {
2433
1842
  const { state: s } = await this._client.readSignoutResponseState(e);
2434
1843
  if (s)
@@ -2447,7 +1856,9 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
2447
1856
  }
2448
1857
  }
2449
1858
  /**
2450
- * Returns promise to query OP for user's current signin status. Returns object with session_state and subject identifier.
1859
+ * Query OP for user's current signin status.
1860
+ *
1861
+ * @returns A promise object with session_state and subject identifier.
2451
1862
  */
2452
1863
  async querySessionStatus(e = {}) {
2453
1864
  const t = this._logger.create("querySessionStatus"), {
@@ -2455,7 +1866,7 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
2455
1866
  ...i
2456
1867
  } = e, r = this.settings.silent_redirect_uri;
2457
1868
  r || t.throw(new Error("No silent_redirect_uri configured"));
2458
- const n = await this._loadUser(), o = await this._iframeNavigator.prepare({ silentRequestTimeoutInSeconds: s }), a = await this._signinStart({
1869
+ const n = await this._loadUser(), a = await this._iframeNavigator.prepare({ silentRequestTimeoutInSeconds: s }), o = await this._signinStart({
2459
1870
  request_type: "si:s",
2460
1871
  // this acts like a signin silent
2461
1872
  redirect_uri: r,
@@ -2465,27 +1876,26 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
2465
1876
  scope: "openid",
2466
1877
  skipUserInfo: !0,
2467
1878
  ...i
2468
- }, o);
1879
+ }, a);
2469
1880
  try {
2470
- const c = await this._client.processSigninResponse(a.url);
2471
- return t.debug("got signin response"), c.session_state && c.profile.sub ? (t.info("success for subject", c.profile.sub), {
2472
- session_state: c.session_state,
2473
- sub: c.profile.sub,
2474
- sid: c.profile.sid
1881
+ const l = await this._client.processSigninResponse(o.url);
1882
+ return t.debug("got signin response"), l.session_state && l.profile.sub ? (t.info("success for subject", l.profile.sub), {
1883
+ session_state: l.session_state,
1884
+ sub: l.profile.sub
2475
1885
  }) : (t.info("success, user not authenticated"), null);
2476
- } catch (c) {
2477
- if (this.settings.monitorAnonymousSession && c instanceof J)
2478
- switch (c.error) {
1886
+ } catch (l) {
1887
+ if (this.settings.monitorAnonymousSession && l instanceof W)
1888
+ switch (l.error) {
2479
1889
  case "login_required":
2480
1890
  case "consent_required":
2481
1891
  case "interaction_required":
2482
1892
  case "account_selection_required":
2483
1893
  return t.info("success for anonymous user"), {
2484
1894
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
2485
- session_state: c.session_state
1895
+ session_state: l.session_state
2486
1896
  };
2487
1897
  }
2488
- throw c;
1898
+ throw l;
2489
1899
  }
2490
1900
  }
2491
1901
  async _signin(e, t, s) {
@@ -2511,16 +1921,18 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
2511
1921
  return s.debug("got signin response"), await this._buildUser(i, t);
2512
1922
  }
2513
1923
  async _buildUser(e, t) {
2514
- const s = this._logger.create("_buildUser"), i = new Y(e);
1924
+ const s = this._logger.create("_buildUser"), i = new le(e);
2515
1925
  if (t) {
2516
1926
  if (t !== i.profile.sub)
2517
- throw s.debug("current user does not match user returned from signin. sub from signin:", i.profile.sub), new J({ ...e, error: "login_required" });
1927
+ throw s.debug("current user does not match user returned from signin. sub from signin:", i.profile.sub), new W({ ...e, error: "login_required" });
2518
1928
  s.debug("current user matches user returned from signin");
2519
1929
  }
2520
- return await this.storeUser(i), s.debug("user stored"), this._events.load(i), i;
1930
+ return await this.storeUser(i), s.debug("user stored"), await this._events.load(i), i;
2521
1931
  }
2522
1932
  /**
2523
- * Returns promise to trigger a redirect of the current window to the end session endpoint.
1933
+ * Trigger a redirect of the current window to the end session endpoint.
1934
+ *
1935
+ * @returns A promise
2524
1936
  */
2525
1937
  async signoutRedirect(e = {}) {
2526
1938
  const t = this._logger.create("signoutRedirect"), {
@@ -2534,21 +1946,28 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
2534
1946
  }, r), t.info("success");
2535
1947
  }
2536
1948
  /**
2537
- * Returns promise to process response from the end session endpoint.
1949
+ * Process response (callback) from the end session endpoint.
1950
+ * It is recommend to use {@link UserManager.signoutCallback} instead.
1951
+ *
1952
+ * @returns A promise containing signout response
1953
+ *
1954
+ * @see {@link UserManager.signoutCallback}
2538
1955
  */
2539
1956
  async signoutRedirectCallback(e = window.location.href) {
2540
1957
  const t = this._logger.create("signoutRedirectCallback"), s = await this._signoutEnd(e);
2541
1958
  return t.info("success"), s;
2542
1959
  }
2543
1960
  /**
2544
- * Returns promise to trigger a redirect of a popup window window to the end session endpoint.
1961
+ * Trigger a redirect of a popup window window to the end session endpoint.
1962
+ *
1963
+ * @returns A promise
2545
1964
  */
2546
1965
  async signoutPopup(e = {}) {
2547
1966
  const t = this._logger.create("signoutPopup"), {
2548
1967
  popupWindowFeatures: s,
2549
1968
  popupWindowTarget: i,
2550
1969
  ...r
2551
- } = e, n = this.settings.popup_post_logout_redirect_uri, o = await this._popupNavigator.prepare({ popupWindowFeatures: s, popupWindowTarget: i });
1970
+ } = e, n = this.settings.popup_post_logout_redirect_uri, a = await this._popupNavigator.prepare({ popupWindowFeatures: s, popupWindowTarget: i });
2552
1971
  await this._signout({
2553
1972
  request_type: "so:p",
2554
1973
  post_logout_redirect_uri: n,
@@ -2559,10 +1978,15 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
2559
1978
  // and so we can close the popup after signout
2560
1979
  state: n == null ? void 0 : {},
2561
1980
  ...r
2562
- }, o), t.info("success");
1981
+ }, a), t.info("success");
2563
1982
  }
2564
1983
  /**
2565
- * Returns promise to process response from the end session endpoint from a popup window.
1984
+ * Process response (callback) from the end session endpoint from a popup window.
1985
+ * It is recommend to use {@link UserManager.signoutCallback} instead.
1986
+ *
1987
+ * @returns A promise
1988
+ *
1989
+ * @see {@link UserManager.signoutCallback}
2566
1990
  */
2567
1991
  async signoutPopupCallback(e = window.location.href, t = !1) {
2568
1992
  const s = this._logger.create("signoutPopupCallback");
@@ -2579,11 +2003,11 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
2579
2003
  const r = await this._loadUser();
2580
2004
  i.debug("loaded current user from storage"), this.settings.revokeTokensOnSignout && await this._revokeInternal(r);
2581
2005
  const n = e.id_token_hint || r && r.id_token;
2582
- n && (i.debug("setting id_token_hint in signout request"), e.id_token_hint = n), await this.removeUser(), i.debug("user removed, creating signout request");
2583
- const o = await this._client.createSignoutRequest(e);
2006
+ n && (i.debug("setting id_token_hint in signout request"), e.id_token_hint = n);
2007
+ const a = await this._client.createSignoutRequest(e);
2584
2008
  return i.debug("got signout request"), await t.navigate({
2585
- url: o.url,
2586
- state: (s = o.state) == null ? void 0 : s.id,
2009
+ url: a.url,
2010
+ state: (s = a.state) == null ? void 0 : s.id,
2587
2011
  scriptOrigin: this.settings.iframeScriptOrigin
2588
2012
  });
2589
2013
  } catch (r) {
@@ -2592,26 +2016,33 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
2592
2016
  }
2593
2017
  async _signoutEnd(e) {
2594
2018
  const t = this._logger.create("_signoutEnd"), s = await this._client.processSignoutResponse(e);
2595
- return t.debug("got signout response"), s;
2019
+ return t.debug("got signout response"), await this.removeUser(), t.debug("user removed"), s;
2596
2020
  }
2597
2021
  /**
2598
- * Returns promise to trigger a silent request (via an iframe) to the end session endpoint.
2022
+ * Trigger a silent request (via an iframe) to the end session endpoint.
2023
+ *
2024
+ * @returns A promise
2599
2025
  */
2600
2026
  async signoutSilent(e = {}) {
2601
2027
  var t;
2602
2028
  const s = this._logger.create("signoutSilent"), {
2603
2029
  silentRequestTimeoutInSeconds: i,
2604
2030
  ...r
2605
- } = e, n = this.settings.includeIdTokenInSilentSignout ? (t = await this._loadUser()) == null ? void 0 : t.id_token : void 0, o = this.settings.popup_post_logout_redirect_uri, a = await this._iframeNavigator.prepare({ silentRequestTimeoutInSeconds: i });
2031
+ } = e, n = this.settings.includeIdTokenInSilentSignout ? (t = await this._loadUser()) == null ? void 0 : t.id_token : void 0, a = this.settings.popup_post_logout_redirect_uri, o = await this._iframeNavigator.prepare({ silentRequestTimeoutInSeconds: i });
2606
2032
  await this._signout({
2607
2033
  request_type: "so:s",
2608
- post_logout_redirect_uri: o,
2034
+ post_logout_redirect_uri: a,
2609
2035
  id_token_hint: n,
2610
2036
  ...r
2611
- }, a), s.info("success");
2037
+ }, o), s.info("success");
2612
2038
  }
2613
2039
  /**
2614
- * Returns promise to notify the parent window of response from the end session endpoint.
2040
+ * Notify the parent window of response (callback) from the end session endpoint.
2041
+ * It is recommend to use {@link UserManager.signoutCallback} instead.
2042
+ *
2043
+ * @returns A promise
2044
+ *
2045
+ * @see {@link UserManager.signoutCallback}
2615
2046
  */
2616
2047
  async signoutSilentCallback(e = window.location.href) {
2617
2048
  const t = this._logger.create("signoutSilentCallback");
@@ -2636,7 +2067,7 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
2636
2067
  // eslint-disable-line @typescript-eslint/no-non-null-assertion
2637
2068
  r
2638
2069
  ), s.info(`${r} revoked successfully`), r !== "access_token" && (e[r] = null);
2639
- await this.storeUser(e), s.debug("user stored"), this._events.load(e);
2070
+ await this.storeUser(e), s.debug("user stored"), await this._events.load(e);
2640
2071
  }
2641
2072
  /**
2642
2073
  * Enables silent renew for the `UserManager`.
@@ -2655,7 +2086,7 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
2655
2086
  }
2656
2087
  async _loadUser() {
2657
2088
  const e = this._logger.create("_loadUser"), t = await this.settings.userStore.get(this._userStoreKey);
2658
- return t ? (e.debug("user storageString loaded"), Y.fromStorageString(t)) : (e.debug("no user storageString"), null);
2089
+ return t ? (e.debug("user storageString loaded"), le.fromStorageString(t)) : (e.debug("no user storageString"), null);
2659
2090
  }
2660
2091
  async storeUser(e) {
2661
2092
  const t = this._logger.create("storeUser");
@@ -2673,54 +2104,54 @@ var Zt = "10000000-1000-4000-8000-100000000000", F = class {
2673
2104
  await this._client.clearStaleState();
2674
2105
  }
2675
2106
  };
2676
- const Os = ["url", "clientId", "redirectUri", "scope"], As = "openid profile email";
2677
- function Ns(e, t) {
2107
+ const Ss = ["url", "clientId", "redirectUri", "scope"], bs = "openid profile email";
2108
+ function ys(e, t) {
2678
2109
  const s = {};
2679
2110
  return e.forEach((i) => {
2680
2111
  t[i] !== void 0 && (s[i] = t[i]);
2681
2112
  }), s;
2682
2113
  }
2683
- let I;
2684
- const qs = (e) => {
2685
- const t = Ns(Os, e);
2686
- return new Ps({
2114
+ let _;
2115
+ const ks = (e) => {
2116
+ const t = ys(Ss, e);
2117
+ return new vs({
2687
2118
  authority: t.url,
2688
2119
  client_id: t.clientId,
2689
2120
  redirect_uri: t.redirectUri,
2690
2121
  response_type: "code",
2691
- scope: t.scope || As,
2122
+ scope: t.scope || bs,
2692
2123
  filterProtocolClaims: !0,
2693
2124
  includeIdTokenInSilentRenew: !0,
2694
2125
  includeIdTokenInSilentSignout: !0,
2695
2126
  loadUserInfo: !0
2696
2127
  });
2697
- }, Hs = async () => {
2128
+ }, Ts = async () => {
2698
2129
  try {
2699
2130
  console.debug("[Auth] Logging in using OIDC");
2700
- const e = new URL(window.location.href), t = await (I == null ? void 0 : I.getUser());
2701
- e.searchParams.get("state") || t ? await (I == null ? void 0 : I.signinRedirectCallback()) : await (I == null ? void 0 : I.signinRedirect().then(() => {
2702
- I == null || I.startSilentRenew(), I == null || I.signinRedirectCallback();
2131
+ const e = new URL(window.location.href), t = await (_ == null ? void 0 : _.getUser());
2132
+ e.searchParams.get("state") || t ? await (_ == null ? void 0 : _.signinRedirectCallback()) : await (_ == null ? void 0 : _.signinRedirect().then(() => {
2133
+ _ == null || _.startSilentRenew(), _ == null || _.signinRedirectCallback();
2703
2134
  }).catch((s) => {
2704
2135
  console.log(s);
2705
2136
  }));
2706
2137
  } catch (e) {
2707
2138
  console.error("[Auth] Error logging in using OIDC: ", e);
2708
2139
  }
2709
- }, js = async () => I == null ? void 0 : I.removeUser().then(() => I == null ? void 0 : I.signoutRedirect({ post_logout_redirect_uri: window.location.href })), Ms = async () => await (I == null ? void 0 : I.getUser()) != null, Ds = async () => {
2710
- const e = await (I == null ? void 0 : I.getUser());
2140
+ }, Is = async () => _ == null ? void 0 : _.removeUser().then(() => _ == null ? void 0 : _.signoutRedirect({ post_logout_redirect_uri: window.location.href })), Es = async () => await (_ == null ? void 0 : _.getUser()) != null, Cs = async () => {
2141
+ const e = await (_ == null ? void 0 : _.getUser());
2711
2142
  return Promise.resolve(e == null ? void 0 : e.id_token);
2712
- }, Fs = async () => {
2713
- const e = await (I == null ? void 0 : I.getUser());
2143
+ }, Rs = async () => {
2144
+ const e = await (_ == null ? void 0 : _.getUser());
2714
2145
  return Promise.resolve(e == null ? void 0 : e.profile.preferred_username);
2715
- }, st = () => {
2146
+ }, tt = () => {
2716
2147
  const e = at(Mt);
2717
- return e.type === "oidc" ? (I === void 0 && (console.debug("[Auth] Creating OIDC UserManager with options: ", e.options), I = qs(e.options)), {
2148
+ return e.type === "oidc" ? (_ === void 0 && (console.debug("[Auth] Creating OIDC UserManager with options: ", e.options), _ = ks(e.options)), {
2718
2149
  isAuthEnabled: () => !0,
2719
- isAuthenticated: Ms,
2720
- getToken: Ds,
2721
- getUsername: Fs,
2722
- login: Hs,
2723
- logout: js
2150
+ isAuthenticated: Es,
2151
+ getToken: Cs,
2152
+ getUsername: Rs,
2153
+ login: Ts,
2154
+ logout: Is
2724
2155
  }) : {
2725
2156
  isAuthEnabled: () => !1,
2726
2157
  isAuthenticated: () => Promise.resolve(!1),
@@ -2729,101 +2160,101 @@ const qs = (e) => {
2729
2160
  login: () => Promise.resolve(),
2730
2161
  logout: () => Promise.resolve()
2731
2162
  };
2732
- }, Ls = (e) => {
2733
- const [t, s] = N(null), i = e.format || "locale";
2734
- return Se(() => {
2163
+ }, xs = (e) => {
2164
+ const [t, s] = E(null), i = e.format || "locale";
2165
+ return we(() => {
2735
2166
  let r;
2736
- if (e.date && typeof e.date == "string" ? r = de.fromISO(e.date) : e.date && typeof e.date == "object" && (r = de.fromJSDate(e.date)), r) {
2167
+ if (e.date && typeof e.date == "string" ? r = ae.fromISO(e.date) : e.date && typeof e.date == "object" && (r = ae.fromJSDate(e.date)), r) {
2737
2168
  const n = {
2738
2169
  locale: e.locale
2739
2170
  };
2740
- s(i === "fromNow" ? r.toRelative() : i === "locale" ? r.toLocaleString(de.DATETIME_FULL, n) : r.toFormat(i, n));
2171
+ s(i === "fromNow" ? r.toRelative() : i === "locale" ? r.toLocaleString(ae.DATETIME_FULL, n) : r.toFormat(i, n));
2741
2172
  } else
2742
2173
  s(null);
2743
- }, [e.date]), /* @__PURE__ */ l("span", { children: t || "" });
2744
- }, Zs = (e) => /* @__PURE__ */ l(Ls, { date: e.date, format: "fromNow" }), D = ({ condition: e, children: t }) => (typeof e == "boolean" ? e : e()) ? /* @__PURE__ */ l(L.Fragment, { children: t }) : /* @__PURE__ */ l(L.Fragment, {}), ei = ({ collection: e, emptyState: t, emptyStateTitle: s, emptyStateMessage: i, children: r }) => {
2745
- const n = () => !e || e.length === 0, o = t || /* @__PURE__ */ P(ee, { variant: ct.xs, children: [
2746
- /* @__PURE__ */ l(te, { titleText: s || "None found", headingLevel: "h4" }),
2747
- /* @__PURE__ */ l(ge, { children: i || "No items found." })
2174
+ }, [e.date]), /* @__PURE__ */ c("span", { children: t || "" });
2175
+ }, $s = (e) => /* @__PURE__ */ c(xs, { date: e.date, format: "fromNow" }), q = ({ condition: e, children: t }) => (typeof e == "boolean" ? e : e()) ? /* @__PURE__ */ c(j.Fragment, { children: t }) : /* @__PURE__ */ c(j.Fragment, {}), Ls = ({ collection: e, emptyState: t, emptyStateTitle: s, emptyStateMessage: i, children: r }) => {
2176
+ const n = () => !e || e.length === 0, a = t || /* @__PURE__ */ m(Y, { variant: ct.xs, children: [
2177
+ /* @__PURE__ */ c(Z, { titleText: s || "None found", headingLevel: "h4" }),
2178
+ /* @__PURE__ */ c(de, { children: i || "No items found." })
2748
2179
  ] });
2749
- return n() ? /* @__PURE__ */ l(L.Fragment, { children: o }) : /* @__PURE__ */ l(L.Fragment, { children: r });
2750
- }, ne = ({ isLoading: e, loadingComponent: t, children: s }) => {
2751
- const i = () => typeof e == "boolean" ? e : e(), r = t || /* @__PURE__ */ l(X, {});
2752
- return i() ? /* @__PURE__ */ l(L.Fragment, { children: r }) : /* @__PURE__ */ l(L.Fragment, { children: s });
2753
- }, ti = ({ toolbar: e, alwaysShowToolbar: t, emptyState: s, filteredEmptyState: i, isLoading: r, isError: n, loadingComponent: o, errorComponent: a, isEmpty: c, isFiltered: h, children: u }) => {
2754
- const _ = t || !c || h || n;
2755
- return a || (a = /* @__PURE__ */ l("div", { style: { padding: "15px", backgroundColor: "white" }, children: /* @__PURE__ */ l(lt, { isInline: !0, variant: "danger", title: "Error: Something went wrong!", children: /* @__PURE__ */ l("p", { children: "Something went wrong with the action you attempted, but we're not sure what it was. Try reloading the page and hopef for a better result, or contact your admin to report the error." }) }) })), /* @__PURE__ */ P(L.Fragment, { children: [
2756
- /* @__PURE__ */ l(D, { condition: _, children: e }),
2757
- /* @__PURE__ */ P(ne, { isLoading: r, loadingComponent: o, children: [
2758
- /* @__PURE__ */ l(D, { condition: !c && !n, children: u }),
2759
- /* @__PURE__ */ l(D, { condition: c && h && !n, children: i }),
2760
- /* @__PURE__ */ l(D, { condition: c && !h && !n, children: s }),
2761
- /* @__PURE__ */ l(D, { condition: n, children: a })
2180
+ return n() ? /* @__PURE__ */ c(j.Fragment, { children: a }) : /* @__PURE__ */ c(j.Fragment, { children: r });
2181
+ }, ie = ({ isLoading: e, loadingComponent: t, children: s }) => {
2182
+ const i = () => typeof e == "boolean" ? e : e(), r = t || /* @__PURE__ */ c(B, {});
2183
+ return i() ? /* @__PURE__ */ c(j.Fragment, { children: r }) : /* @__PURE__ */ c(j.Fragment, { children: s });
2184
+ }, Ws = ({ toolbar: e, alwaysShowToolbar: t, emptyState: s, filteredEmptyState: i, isLoading: r, isError: n, loadingComponent: a, errorComponent: o, isEmpty: l, isFiltered: d, children: h }) => {
2185
+ const g = t || !l || d || n;
2186
+ return o || (o = /* @__PURE__ */ c("div", { style: { padding: "15px", backgroundColor: "white" }, children: /* @__PURE__ */ c(lt, { isInline: !0, variant: "danger", title: "Error: Something went wrong!", children: /* @__PURE__ */ c("p", { children: "Something went wrong with the action you attempted, but we're not sure what it was. Try reloading the page and hopef for a better result, or contact your admin to report the error." }) }) })), /* @__PURE__ */ m(j.Fragment, { children: [
2187
+ /* @__PURE__ */ c(q, { condition: g, children: e }),
2188
+ /* @__PURE__ */ m(ie, { isLoading: r, loadingComponent: a, children: [
2189
+ /* @__PURE__ */ c(q, { condition: !l && !n, children: h }),
2190
+ /* @__PURE__ */ c(q, { condition: l && d && !n, children: i }),
2191
+ /* @__PURE__ */ c(q, { condition: l && !d && !n, children: s }),
2192
+ /* @__PURE__ */ c(q, { condition: n, children: o })
2762
2193
  ] })
2763
2194
  ] });
2764
- }, si = (e) => {
2765
- const [t, s] = N(!1), i = (c, h) => {
2195
+ }, Ks = (e) => {
2196
+ const [t, s] = E(!1), i = (l, d) => {
2766
2197
  s(!1);
2767
- const u = h;
2768
- u !== void 0 && u >= 0 ? e.onSelect(e.items[u]) : e.onSelect(void 0);
2198
+ const h = d;
2199
+ h !== void 0 && h >= 0 ? e.onSelect(e.items[h]) : e.onSelect(void 0);
2769
2200
  }, r = () => {
2770
2201
  s(!t);
2771
- }, n = (c) => {
2772
- let h;
2773
- return e.itemToTestId !== void 0 && (h = e.itemToTestId(c)), h;
2774
- }, o = e.popperProps || {
2202
+ }, n = (l) => {
2203
+ let d;
2204
+ return e.itemToTestId !== void 0 && (d = e.itemToTestId(l)), d;
2205
+ }, a = e.popperProps || {
2775
2206
  appendTo: e.menuAppendTo
2776
2207
  };
2777
- let a = /* @__PURE__ */ l(xt, { title: e.label });
2778
- return e.isKebab || (a = /* @__PURE__ */ l(L.Fragment, { children: e.label })), /* @__PURE__ */ l(
2208
+ let o = /* @__PURE__ */ c(Rt, { title: e.label });
2209
+ return e.isKebab || (o = /* @__PURE__ */ c(j.Fragment, { children: e.label })), /* @__PURE__ */ c(
2779
2210
  dt,
2780
2211
  {
2781
2212
  isOpen: t,
2782
2213
  onSelect: i,
2783
- onOpenChange: (c) => s(c),
2784
- toggle: (c) => /* @__PURE__ */ l(
2785
- ae,
2214
+ onOpenChange: (l) => s(l),
2215
+ toggle: (l) => /* @__PURE__ */ c(
2216
+ ne,
2786
2217
  {
2787
2218
  "data-testid": e.testId,
2788
- ref: c,
2219
+ ref: l,
2789
2220
  onClick: r,
2790
2221
  isExpanded: t,
2791
2222
  variant: e.isKebab ? "plain" : "default",
2792
- children: a
2223
+ children: o
2793
2224
  }
2794
2225
  ),
2795
2226
  ouiaId: "ObjectDropdown",
2796
- popperProps: o,
2227
+ popperProps: a,
2797
2228
  shouldFocusToggleOnSelect: !0,
2798
- children: /* @__PURE__ */ l(ht, { children: e.items.map((c, h) => e.itemIsVisible !== void 0 && !e.itemIsVisible(c) ? /* @__PURE__ */ l(oe, {}) : e.itemIsDivider && e.itemIsDivider(c) ? /* @__PURE__ */ l(Le, { component: "li" }, `divider-${h}`) : /* @__PURE__ */ l(
2229
+ children: /* @__PURE__ */ c(ht, { children: e.items.map((l, d) => e.itemIsVisible !== void 0 && !e.itemIsVisible(l) ? /* @__PURE__ */ c(re, {}) : e.itemIsDivider && e.itemIsDivider(l) ? /* @__PURE__ */ c(De, { component: "li" }, `divider-${d}`) : /* @__PURE__ */ c(
2799
2230
  gt,
2800
2231
  {
2801
- value: h,
2802
- isDisabled: e.itemIsDisabled === void 0 ? !1 : e.itemIsDisabled(c),
2803
- component: (u) => /* @__PURE__ */ l("button", { ...u, "data-testid": n(c) }),
2804
- children: e.itemToString(c)
2232
+ value: d,
2233
+ isDisabled: e.itemIsDisabled === void 0 ? !1 : e.itemIsDisabled(l),
2234
+ component: (h) => /* @__PURE__ */ c("button", { ...h, "data-testid": n(l) }),
2235
+ children: e.itemToString(l)
2805
2236
  },
2806
- `action-${h}`
2237
+ `action-${d}`
2807
2238
  )) })
2808
2239
  }
2809
2240
  );
2810
- }, ii = (e) => {
2811
- var a;
2812
- const [t, s] = N(!1), i = (c, h) => {
2813
- s(!1), e.onSelect(e.items[h]);
2241
+ }, zs = (e) => {
2242
+ var o;
2243
+ const [t, s] = E(!1), i = (l, d) => {
2244
+ s(!1), e.onSelect(e.items[d]);
2814
2245
  }, r = () => {
2815
2246
  s(!t);
2816
- }, n = (c) => {
2817
- let h;
2818
- return e.itemToTestId !== void 0 && (h = e.itemToTestId(c)), h;
2247
+ }, n = (l) => {
2248
+ let d;
2249
+ return e.itemToTestId !== void 0 && (d = e.itemToTestId(l)), d;
2819
2250
  };
2820
- return /* @__PURE__ */ l(
2821
- be,
2251
+ return /* @__PURE__ */ c(
2252
+ Se,
2822
2253
  {
2823
- toggle: (c) => /* @__PURE__ */ l(
2824
- ae,
2254
+ toggle: (l) => /* @__PURE__ */ c(
2255
+ ne,
2825
2256
  {
2826
- ref: c,
2257
+ ref: l,
2827
2258
  className: e.toggleClassname || "menu-toggle",
2828
2259
  onClick: r,
2829
2260
  "data-testid": e.testId,
@@ -2835,47 +2266,47 @@ const qs = (e) => {
2835
2266
  onSelect: i,
2836
2267
  onOpenChange: s,
2837
2268
  isOpen: t,
2838
- children: (a = e.items) == null ? void 0 : a.map((c, h) => e.itemIsDivider && e.itemIsDivider(c) ? /* @__PURE__ */ l(Le, {}, h) : /* @__PURE__ */ l(
2839
- ke,
2269
+ children: (o = e.items) == null ? void 0 : o.map((l, d) => e.itemIsDivider && e.itemIsDivider(l) ? /* @__PURE__ */ c(De, {}, d) : /* @__PURE__ */ c(
2270
+ be,
2840
2271
  {
2841
- isSelected: c === e.value,
2842
- component: (u) => /* @__PURE__ */ l("button", { ...u, "data-testid": n(c) }),
2843
- value: h,
2844
- children: e.itemToString(c)
2272
+ isSelected: l === e.value,
2273
+ component: (h) => /* @__PURE__ */ c("button", { ...h, "data-testid": n(l) }),
2274
+ value: d,
2275
+ children: e.itemToString(l)
2845
2276
  },
2846
- h
2277
+ d
2847
2278
  ))
2848
2279
  }
2849
2280
  );
2850
- }, ri = ({ expanded: e, onClick: t }) => e ? /* @__PURE__ */ l(Rt, { onClick: t, style: { cursor: "pointer" } }) : /* @__PURE__ */ l(Ut, { onClick: t, style: { cursor: "pointer" } }), it = {
2281
+ }, Js = ({ expanded: e, onClick: t }) => e ? /* @__PURE__ */ c(xt, { onClick: t, style: { cursor: "pointer" } }) : /* @__PURE__ */ c(Ut, { onClick: t, style: { cursor: "pointer" } }), st = {
2851
2282
  padding: "5px",
2852
2283
  minHeight: "128px",
2853
2284
  borderRight: 0,
2854
2285
  borderLeft: 0,
2855
2286
  borderBottom: "1px solid #666",
2856
2287
  backgroundColor: "rgb(240, 240, 240)"
2857
- }, Ws = {
2858
- ...it,
2288
+ }, Us = {
2289
+ ...st,
2859
2290
  color: "red",
2860
2291
  overflow: "auto"
2861
- }, ni = (e) => {
2862
- const [t, s] = N(""), [i, r] = N(""), [n, o] = N(!1), [a, c] = N(), h = (p, S) => {
2863
- s(S);
2864
- }, u = () => t != null && t.trim().length > 0, _ = () => a != null && a.trim().length > 0, y = () => {
2865
- o(!0), e.onUrlFetch(t).then((p) => {
2866
- c(void 0), r(p), o(!1), e.onChange(p, t);
2867
- }).catch((p) => {
2868
- c(p.message), o(!1);
2292
+ }, Vs = (e) => {
2293
+ const [t, s] = E(""), [i, r] = E(""), [n, a] = E(!1), [o, l] = E(), d = (k, x) => {
2294
+ s(x);
2295
+ }, h = () => t != null && t.trim().length > 0, g = () => o != null && o.trim().length > 0, v = () => {
2296
+ a(!0), e.onUrlFetch(t).then((k) => {
2297
+ l(void 0), r(k), a(!1), e.onChange(k, t);
2298
+ }).catch((k) => {
2299
+ l(k.message), a(!1);
2869
2300
  });
2870
- }, w = () => {
2301
+ }, b = () => {
2871
2302
  s(""), r(""), e.onChange(void 0, void 0);
2872
- }, C = /* @__PURE__ */ P("div", { className: "url-upload-loading", style: it, children: [
2873
- /* @__PURE__ */ l(X, { size: "md", className: "spinner", style: { marginRight: "5px" } }),
2874
- /* @__PURE__ */ l("span", { className: "spinner-message", children: "Loading URL content" })
2303
+ }, R = /* @__PURE__ */ m("div", { className: "url-upload-loading", style: st, children: [
2304
+ /* @__PURE__ */ c(B, { size: "md", className: "spinner", style: { marginRight: "5px" } }),
2305
+ /* @__PURE__ */ c("span", { className: "spinner-message", children: "Loading URL content" })
2875
2306
  ] });
2876
- return /* @__PURE__ */ P("div", { className: "url-upload", "data-testid": e.testId, children: [
2877
- /* @__PURE__ */ P("div", { className: "url-upload-flex", style: { display: "flex" }, children: [
2878
- /* @__PURE__ */ l("div", { className: "url-upload-url", style: { flexGrow: 1 }, children: /* @__PURE__ */ l(
2307
+ return /* @__PURE__ */ m("div", { className: "url-upload", "data-testid": e.testId, children: [
2308
+ /* @__PURE__ */ m("div", { className: "url-upload-flex", style: { display: "flex" }, children: [
2309
+ /* @__PURE__ */ c("div", { className: "url-upload-url", style: { flexGrow: 1 }, children: /* @__PURE__ */ c(
2879
2310
  ut,
2880
2311
  {
2881
2312
  "data-testid": `${e.testId}-input`,
@@ -2883,19 +2314,19 @@ const qs = (e) => {
2883
2314
  type: "text",
2884
2315
  placeholder: e.urlPlaceholder,
2885
2316
  id: e.id,
2886
- onChange: h,
2317
+ onChange: d,
2887
2318
  "aria-label": "url input"
2888
2319
  }
2889
2320
  ) }),
2890
- /* @__PURE__ */ l("div", { className: "url-fetch-button", children: /* @__PURE__ */ l(Pe, { "data-testid": `${e.testId}-fetch`, variant: "control", isDisabled: !u(), onClick: y, children: "Fetch" }) }),
2891
- /* @__PURE__ */ l("div", { className: "url-clear-button", children: /* @__PURE__ */ l(Pe, { "data-testid": `${e.testId}-clear`, variant: "control", isDisabled: !u(), onClick: w, children: "Clear" }) })
2321
+ /* @__PURE__ */ c("div", { className: "url-fetch-button", children: /* @__PURE__ */ c(xe, { "data-testid": `${e.testId}-fetch`, variant: "control", isDisabled: !h(), onClick: v, children: "Fetch" }) }),
2322
+ /* @__PURE__ */ c("div", { className: "url-clear-button", children: /* @__PURE__ */ c(xe, { "data-testid": `${e.testId}-clear`, variant: "control", isDisabled: !h(), onClick: b, children: "Clear" }) })
2892
2323
  ] }),
2893
- /* @__PURE__ */ l("div", { className: "url-upload-preview", children: /* @__PURE__ */ P(ne, { isLoading: n, loadingComponent: C, children: [
2894
- /* @__PURE__ */ l(D, { condition: _, children: /* @__PURE__ */ P("div", { className: "url-upload-error", style: Ws, children: [
2895
- /* @__PURE__ */ l("div", { children: "Error getting content from URL." }),
2896
- /* @__PURE__ */ l("div", { children: a })
2324
+ /* @__PURE__ */ c("div", { className: "url-upload-preview", children: /* @__PURE__ */ m(ie, { isLoading: n, loadingComponent: R, children: [
2325
+ /* @__PURE__ */ c(q, { condition: g, children: /* @__PURE__ */ m("div", { className: "url-upload-error", style: Us, children: [
2326
+ /* @__PURE__ */ c("div", { children: "Error getting content from URL." }),
2327
+ /* @__PURE__ */ c("div", { children: o })
2897
2328
  ] }) }),
2898
- /* @__PURE__ */ l(D, { condition: !_(), children: /* @__PURE__ */ l(
2329
+ /* @__PURE__ */ c(q, { condition: !g(), children: /* @__PURE__ */ c(
2899
2330
  _t,
2900
2331
  {
2901
2332
  "data-testid": `${e.testId}-preview`,
@@ -2907,12 +2338,12 @@ const qs = (e) => {
2907
2338
  ) })
2908
2339
  ] }) })
2909
2340
  ] });
2910
- }, oi = (e) => {
2911
- const [t, s] = N(
2341
+ }, Bs = (e) => {
2342
+ const [t, s] = E(
2912
2343
  0
2913
2344
  /* AUTHENTICATING */
2914
- ), i = st();
2915
- return Se(() => {
2345
+ ), i = tt();
2346
+ return we(() => {
2916
2347
  i.isAuthEnabled() ? i.login().then(() => {
2917
2348
  console.info("[ApplicationAuth] Authentication successful."), s(
2918
2349
  1
@@ -2927,28 +2358,28 @@ const qs = (e) => {
2927
2358
  1
2928
2359
  /* AUTHENTICATED */
2929
2360
  );
2930
- }, []), /* @__PURE__ */ P(oe, { children: [
2931
- /* @__PURE__ */ l(D, { condition: t === 0, children: /* @__PURE__ */ P(ee, { children: [
2932
- /* @__PURE__ */ l(te, { titleText: "Loading", headingLevel: "h4" }),
2933
- /* @__PURE__ */ l(ge, { children: /* @__PURE__ */ l(X, { size: "xl", "aria-label": "Loading spinner" }) })
2361
+ }, []), /* @__PURE__ */ m(re, { children: [
2362
+ /* @__PURE__ */ c(q, { condition: t === 0, children: /* @__PURE__ */ m(Y, { children: [
2363
+ /* @__PURE__ */ c(Z, { titleText: "Loading", headingLevel: "h4" }),
2364
+ /* @__PURE__ */ c(de, { children: /* @__PURE__ */ c(B, { size: "xl", "aria-label": "Loading spinner" }) })
2934
2365
  ] }) }),
2935
- /* @__PURE__ */ l(D, { condition: t === 2, children: /* @__PURE__ */ P(ee, { children: [
2936
- /* @__PURE__ */ l(te, { titleText: "Empty state", headingLevel: "h4", icon: /* @__PURE__ */ l(We, { icon: Pt }) }),
2937
- /* @__PURE__ */ l(ge, { children: "Authentication failed." })
2366
+ /* @__PURE__ */ c(q, { condition: t === 2, children: /* @__PURE__ */ m(Y, { children: [
2367
+ /* @__PURE__ */ c(Z, { titleText: "Empty state", headingLevel: "h4", icon: /* @__PURE__ */ c(Fe, { icon: Pt }) }),
2368
+ /* @__PURE__ */ c(de, { children: "Authentication failed." })
2938
2369
  ] }) }),
2939
- /* @__PURE__ */ l(D, { condition: t === 1, children: e.children })
2370
+ /* @__PURE__ */ c(q, { condition: t === 1, children: e.children })
2940
2371
  ] });
2941
- }, ai = (e) => {
2942
- const t = st();
2372
+ }, Gs = (e) => {
2373
+ const t = tt();
2943
2374
  return (() => {
2944
2375
  let i = !0;
2945
2376
  return e.enabled !== void 0 && (i = i && t.isAuthEnabled() === e.enabled), i;
2946
- })() ? /* @__PURE__ */ l(L.Fragment, { children: e.children }) : /* @__PURE__ */ l(L.Fragment, {});
2947
- }, ci = (e) => {
2948
- const [t, s] = N(), [i, r] = N(), n = (o) => typeof o == "string" ? o : o === void 0 ? "" : o.toDateString();
2949
- return Se(() => {
2377
+ })() ? /* @__PURE__ */ c(j.Fragment, { children: e.children }) : /* @__PURE__ */ c(j.Fragment, {});
2378
+ }, Qs = (e) => {
2379
+ const [t, s] = E(), [i, r] = E(), n = (a) => typeof a == "string" ? a : a === void 0 ? "" : a.toDateString();
2380
+ return we(() => {
2950
2381
  e.isOpen && (typeof e.frontendInfo == "function" ? e.frontendInfo().then(s) : s(e.frontendInfo), typeof e.backendInfo == "function" ? e.backendInfo().then(r) : r(e.backendInfo));
2951
- }, [e.isOpen]), /* @__PURE__ */ l(
2382
+ }, [e.isOpen]), /* @__PURE__ */ c(
2952
2383
  pt,
2953
2384
  {
2954
2385
  className: "app-about-modal",
@@ -2958,50 +2389,50 @@ const qs = (e) => {
2958
2389
  brandImageSrc: e.brandImageSrc,
2959
2390
  brandImageAlt: e.brandImageAlt,
2960
2391
  "aria-label": e.brandImageAlt,
2961
- children: /* @__PURE__ */ P(ft, { className: "app-about-modal-content", style: { marginTop: "-25px" }, children: [
2962
- /* @__PURE__ */ l(Oe, { component: Ae.h2, children: "Web console info" }),
2963
- /* @__PURE__ */ l(ne, { isLoading: t === void 0, children: /* @__PURE__ */ P(Ne, { component: "dl", children: [
2964
- /* @__PURE__ */ l(O, { component: "dt", children: "Project" }),
2965
- /* @__PURE__ */ l(O, { component: "dd", children: /* @__PURE__ */ l("a", { href: t == null ? void 0 : t.url, target: "_blank", children: t == null ? void 0 : t.name }) }),
2966
- /* @__PURE__ */ l(O, { component: "dt", children: "Version" }),
2967
- /* @__PURE__ */ l(O, { component: "dd", children: t == null ? void 0 : t.version }),
2968
- /* @__PURE__ */ l(O, { component: "dt", children: "Built on" }),
2969
- /* @__PURE__ */ l(O, { component: "dd", children: n(t == null ? void 0 : t.builtOn) }),
2970
- /* @__PURE__ */ l(O, { component: "dt", children: "Digest" }),
2971
- /* @__PURE__ */ l(O, { component: "dd", children: t == null ? void 0 : t.digest })
2392
+ children: /* @__PURE__ */ m(ft, { className: "app-about-modal-content", style: { marginTop: "-25px" }, children: [
2393
+ /* @__PURE__ */ c(Ue, { component: Pe.h2, children: "Web console info" }),
2394
+ /* @__PURE__ */ c(ie, { isLoading: t === void 0, children: /* @__PURE__ */ m(Oe, { component: "dl", children: [
2395
+ /* @__PURE__ */ c(y, { component: "dt", children: "Project" }),
2396
+ /* @__PURE__ */ c(y, { component: "dd", children: /* @__PURE__ */ c("a", { href: t == null ? void 0 : t.url, target: "_blank", children: t == null ? void 0 : t.name }) }),
2397
+ /* @__PURE__ */ c(y, { component: "dt", children: "Version" }),
2398
+ /* @__PURE__ */ c(y, { component: "dd", children: t == null ? void 0 : t.version }),
2399
+ /* @__PURE__ */ c(y, { component: "dt", children: "Built on" }),
2400
+ /* @__PURE__ */ c(y, { component: "dd", children: n(t == null ? void 0 : t.builtOn) }),
2401
+ /* @__PURE__ */ c(y, { component: "dt", children: "Digest" }),
2402
+ /* @__PURE__ */ c(y, { component: "dd", children: t == null ? void 0 : t.digest })
2972
2403
  ] }) }),
2973
- /* @__PURE__ */ l(Oe, { style: { marginTop: "40px" }, component: Ae.h2, children: e.backendLabel }),
2974
- /* @__PURE__ */ l(ne, { isLoading: i === void 0, children: /* @__PURE__ */ P(Ne, { component: "dl", children: [
2975
- /* @__PURE__ */ l(O, { component: "dt", children: "Name" }),
2976
- /* @__PURE__ */ l(O, { component: "dd", children: (i == null ? void 0 : i.name) || "" }),
2977
- /* @__PURE__ */ l(O, { component: "dt", children: "Description" }),
2978
- /* @__PURE__ */ l(O, { component: "dd", children: (i == null ? void 0 : i.description) || "" }),
2979
- /* @__PURE__ */ l(O, { component: "dt", children: "Version" }),
2980
- /* @__PURE__ */ l(O, { component: "dd", children: (i == null ? void 0 : i.version) || "" }),
2981
- /* @__PURE__ */ l(O, { component: "dt", children: "Built on" }),
2982
- /* @__PURE__ */ l(O, { component: "dd", children: n(i == null ? void 0 : i.builtOn) })
2404
+ /* @__PURE__ */ c(Ue, { style: { marginTop: "40px" }, component: Pe.h2, children: e.backendLabel }),
2405
+ /* @__PURE__ */ c(ie, { isLoading: i === void 0, children: /* @__PURE__ */ m(Oe, { component: "dl", children: [
2406
+ /* @__PURE__ */ c(y, { component: "dt", children: "Name" }),
2407
+ /* @__PURE__ */ c(y, { component: "dd", children: (i == null ? void 0 : i.name) || "" }),
2408
+ /* @__PURE__ */ c(y, { component: "dt", children: "Description" }),
2409
+ /* @__PURE__ */ c(y, { component: "dd", children: (i == null ? void 0 : i.description) || "" }),
2410
+ /* @__PURE__ */ c(y, { component: "dt", children: "Version" }),
2411
+ /* @__PURE__ */ c(y, { component: "dd", children: (i == null ? void 0 : i.version) || "" }),
2412
+ /* @__PURE__ */ c(y, { component: "dt", children: "Built on" }),
2413
+ /* @__PURE__ */ c(y, { component: "dd", children: n(i == null ? void 0 : i.builtOn) })
2983
2414
  ] }) })
2984
2415
  ] })
2985
2416
  }
2986
2417
  );
2987
- }, li = (e) => /* @__PURE__ */ P(
2988
- Be,
2418
+ }, Xs = (e) => /* @__PURE__ */ m(
2419
+ $e,
2989
2420
  {
2990
2421
  title: "Please Wait",
2991
2422
  variant: "small",
2992
2423
  isOpen: e.isOpen,
2993
- header: /* @__PURE__ */ l("a", { href: "#" }),
2424
+ header: /* @__PURE__ */ c("a", { href: "#" }),
2994
2425
  showClose: !1,
2995
2426
  className: "please-wait pf-m-redhat-font",
2996
2427
  "aria-label": "please-wait-modal",
2997
2428
  style: { marginTop: "-15px" },
2998
2429
  children: [
2999
- /* @__PURE__ */ l(X, { size: "md", className: "spinner" }),
3000
- /* @__PURE__ */ l("span", { className: "message", style: { fontSize: "15px", color: "#333", marginLeft: "10px" }, children: e.message })
2430
+ /* @__PURE__ */ c(B, { size: "md", className: "spinner" }),
2431
+ /* @__PURE__ */ c("span", { className: "message", style: { fontSize: "15px", color: "#333", marginLeft: "10px" }, children: e.message })
3001
2432
  ]
3002
2433
  }
3003
- ), di = (e) => /* @__PURE__ */ l(
3004
- Be,
2434
+ ), Ys = (e) => /* @__PURE__ */ c(
2435
+ $e,
3005
2436
  {
3006
2437
  title: e.title,
3007
2438
  variant: "small",
@@ -3010,20 +2441,20 @@ const qs = (e) => {
3010
2441
  onClose: e.onClose,
3011
2442
  className: "progress pf-m-redhat-font",
3012
2443
  "aria-label": "progress-modal",
3013
- children: /* @__PURE__ */ l(wt, { title: e.message, value: e.progress })
2444
+ children: /* @__PURE__ */ c(mt, { title: e.message, value: e.progress })
3014
2445
  }
3015
2446
  );
3016
- function hi() {
3017
- return /* @__PURE__ */ l(ee, { children: /* @__PURE__ */ l(
3018
- te,
2447
+ function Zs() {
2448
+ return /* @__PURE__ */ c(Y, { children: /* @__PURE__ */ c(
2449
+ Z,
3019
2450
  {
3020
2451
  titleText: "Loading",
3021
2452
  headingLevel: "h4",
3022
- icon: /* @__PURE__ */ l(We, { icon: X })
2453
+ icon: /* @__PURE__ */ c(Fe, { icon: B })
3023
2454
  }
3024
2455
  ) });
3025
2456
  }
3026
- function gi({
2457
+ function ei({
3027
2458
  itemCount: e,
3028
2459
  page: t,
3029
2460
  perPage: s,
@@ -3031,220 +2462,220 @@ function gi({
3031
2462
  onChange: r,
3032
2463
  variant: n = vt.top
3033
2464
  }) {
3034
- return /* @__PURE__ */ l(
3035
- mt,
2465
+ return /* @__PURE__ */ c(
2466
+ wt,
3036
2467
  {
3037
2468
  itemCount: e,
3038
2469
  page: t,
3039
2470
  perPage: s,
3040
- onSetPage: (o, a) => r(a, s),
3041
- onPerPageSelect: (o, a) => r(1, a),
2471
+ onSetPage: (a, o) => r(o, s),
2472
+ onPerPageSelect: (a, o) => r(1, o),
3042
2473
  variant: n,
3043
2474
  isCompact: i
3044
2475
  }
3045
2476
  );
3046
2477
  }
3047
- function Bs({ columns: e, rows: t, getTd: s = () => Te }) {
3048
- const i = new Array(e).fill(0).map((n, o) => {
3049
- const a = s(o);
3050
- return /* @__PURE__ */ l(a, { children: /* @__PURE__ */ l(
2478
+ function Ps({ columns: e, rows: t, getTd: s = () => ye }) {
2479
+ const i = new Array(e).fill(0).map((n, a) => {
2480
+ const o = s(a);
2481
+ return /* @__PURE__ */ c(o, { children: /* @__PURE__ */ c(
3051
2482
  St,
3052
2483
  {
3053
- screenreaderText: o === 0 ? "Loading data" : void 0
2484
+ screenreaderText: a === 0 ? "Loading data" : void 0
3054
2485
  }
3055
- ) }, `cell_${o}`);
3056
- }), r = new Array(t).fill(0).map((n, o) => /* @__PURE__ */ l(se, { children: i }, `row_${o}`));
3057
- return /* @__PURE__ */ l(oe, { children: r });
2486
+ ) }, `cell_${a}`);
2487
+ }), r = new Array(t).fill(0).map((n, a) => /* @__PURE__ */ c(ee, { children: i }, `row_${a}`));
2488
+ return /* @__PURE__ */ c(re, { children: r });
3058
2489
  }
3059
- const ui = ({
2490
+ const ti = ({
3060
2491
  ariaLabel: e,
3061
2492
  minimumColumnWidth: t = 250,
3062
2493
  columns: s,
3063
2494
  data: i,
3064
2495
  renderHeader: r,
3065
2496
  renderCell: n,
3066
- renderActions: o,
3067
- isColumnSortable: a,
3068
- isRowDeleted: c,
3069
- isRowSelected: h,
3070
- expectedLength: u = 3,
3071
- onRowClick: _,
3072
- setActionCellOuiaId: y,
3073
- setRowOuiaId: w,
3074
- tableOuiaId: C,
3075
- children: p,
3076
- variant: S
2497
+ renderActions: a,
2498
+ isColumnSortable: o,
2499
+ isRowDeleted: l,
2500
+ isRowSelected: d,
2501
+ expectedLength: h = 3,
2502
+ onRowClick: g,
2503
+ setActionCellOuiaId: v,
2504
+ setRowOuiaId: b,
2505
+ tableOuiaId: R,
2506
+ children: k,
2507
+ variant: x
3077
2508
  }) => {
3078
- const [E, d] = N(1e3);
3079
- let g;
3080
- const f = ({ width: b }) => {
3081
- g && cancelAnimationFrame(g), b && (g = requestAnimationFrame(() => {
3082
- d(b);
2509
+ const [I, H] = E(1e3);
2510
+ let T;
2511
+ const w = ({ width: p }) => {
2512
+ T && cancelAnimationFrame(T), p && (T = requestAnimationFrame(() => {
2513
+ H(p);
3083
2514
  }));
3084
- }, { ref: m } = jt({ onResize: f }), k = E >= 576, T = Re(
3085
- (b) => k && b !== 0 && b !== s.length - 1,
3086
- [s, k]
3087
- ), R = Ue(() => s.map((b, x) => {
3088
- const A = Z(
3089
- ({ children: W, ...B }, z) => /* @__PURE__ */ l(
3090
- rt,
2515
+ }, { ref: U } = Ht({ onResize: w }), C = I >= 576, S = Ce(
2516
+ (p) => C && p !== 0 && p !== s.length - 1,
2517
+ [s, C]
2518
+ ), M = Re(() => s.map((p, f) => {
2519
+ const P = X(
2520
+ ({ children: $, ...L }, oe) => /* @__PURE__ */ c(
2521
+ it,
3091
2522
  {
3092
- position: x,
3093
- tableWidth: E,
2523
+ position: f,
2524
+ tableWidth: I,
3094
2525
  columnWidth: t,
3095
- canHide: T(x),
3096
- sort: a ? a(b) : void 0,
3097
- ...B,
3098
- ref: z,
3099
- children: W
2526
+ canHide: S(f),
2527
+ sort: o ? o(p) : void 0,
2528
+ ...L,
2529
+ ref: oe,
2530
+ children: $
3100
2531
  }
3101
2532
  )
3102
2533
  );
3103
- return A.displayName = "ResponsiveThCurried", r({
3104
- Th: A,
3105
- key: `header_${b}`,
3106
- column: b,
3107
- colIndex: x
2534
+ return P.displayName = "ResponsiveThCurried", r({
2535
+ Th: P,
2536
+ key: `header_${p}`,
2537
+ column: p,
2538
+ colIndex: f
3108
2539
  });
3109
2540
  }), [
3110
- T,
2541
+ S,
3111
2542
  s,
3112
- a,
2543
+ o,
3113
2544
  t,
3114
2545
  r,
3115
- E
3116
- ]), U = Re(
3117
- (b) => {
3118
- const x = Z(
3119
- ({ children: A, ...W }, B) => /* @__PURE__ */ l(
3120
- ve,
2546
+ I
2547
+ ]), z = Ce(
2548
+ (p) => {
2549
+ const f = X(
2550
+ ({ children: P, ...$ }, L) => /* @__PURE__ */ c(
2551
+ me,
3121
2552
  {
3122
- position: b,
3123
- tableWidth: E,
2553
+ position: p,
2554
+ tableWidth: I,
3124
2555
  columnWidth: t,
3125
- canHide: T(b),
3126
- ...W,
3127
- ref: B,
3128
- children: A
2556
+ canHide: S(p),
2557
+ ...$,
2558
+ ref: L,
2559
+ children: P
3129
2560
  }
3130
2561
  )
3131
2562
  );
3132
- return x.displayName = "ResponsiveTdCurried", x;
2563
+ return f.displayName = "ResponsiveTdCurried", f;
3133
2564
  },
3134
- [T, t, E]
3135
- ), H = Ue(
3136
- () => s.map((b, x) => U(x)),
3137
- [s, U]
2565
+ [S, t, I]
2566
+ ), G = Re(
2567
+ () => s.map((p, f) => z(f)),
2568
+ [s, z]
3138
2569
  );
3139
- return /* @__PURE__ */ P(
2570
+ return /* @__PURE__ */ m(
3140
2571
  At,
3141
2572
  {
3142
2573
  "aria-label": e,
3143
2574
  gridBreakPoint: "",
3144
- ref: m,
3145
- className: k ? "" : "pf-m-grid",
3146
- ouiaId: C,
3147
- variant: S,
2575
+ ref: U,
2576
+ className: C ? "" : "pf-m-grid",
2577
+ ouiaId: R,
2578
+ variant: x,
3148
2579
  children: [
3149
- /* @__PURE__ */ l(Nt, { children: /* @__PURE__ */ l(se, { children: R }) }),
3150
- /* @__PURE__ */ P(qt, { children: [
3151
- i === void 0 && /* @__PURE__ */ l(
3152
- Bs,
2580
+ /* @__PURE__ */ c(Nt, { children: /* @__PURE__ */ c(ee, { children: M }) }),
2581
+ /* @__PURE__ */ m(qt, { children: [
2582
+ i === void 0 && /* @__PURE__ */ c(
2583
+ Ps,
3153
2584
  {
3154
2585
  columns: s.length,
3155
- rows: u,
3156
- getTd: U
2586
+ rows: h,
2587
+ getTd: z
3157
2588
  }
3158
2589
  ),
3159
- i == null ? void 0 : i.map((b, x) => {
3160
- const A = c !== void 0 && c({ row: b, rowIndex: x }), W = h !== void 0 && h({ row: b, rowIndex: x }), B = !A && _ ? () => _({ row: b, rowIndex: x }) : void 0, z = s.map((G, xe) => n({
3161
- Td: H[xe],
3162
- key: `row_${x}_cell_${G}`,
3163
- column: G,
3164
- colIndex: xe,
3165
- rowIndex: x,
3166
- row: b
3167
- })), V = !A && o && /* @__PURE__ */ l(
3168
- ve,
2590
+ i == null ? void 0 : i.map((p, f) => {
2591
+ const P = l !== void 0 && l({ row: p, rowIndex: f }), $ = d !== void 0 && d({ row: p, rowIndex: f }), L = !P && g ? () => g({ row: p, rowIndex: f }) : void 0, oe = s.map((Ie, Ee) => n({
2592
+ Td: G[Ee],
2593
+ key: `row_${f}_cell_${Ie}`,
2594
+ column: Ie,
2595
+ colIndex: Ee,
2596
+ rowIndex: f,
2597
+ row: p
2598
+ })), nt = !P && a && /* @__PURE__ */ c(
2599
+ me,
3169
2600
  {
3170
2601
  position: s.length,
3171
- tableWidth: E,
2602
+ tableWidth: I,
3172
2603
  columnWidth: t,
3173
2604
  canHide: !1,
3174
2605
  isActionCell: !0,
3175
- "data-testid": y ? y({ row: b, rowIndex: x }) : `actions-for-row-${x}`,
3176
- children: o({ rowIndex: x, row: b, ActionsColumn: Ht })
2606
+ "data-testid": v ? v({ row: p, rowIndex: f }) : `actions-for-row-${f}`,
2607
+ children: a({ rowIndex: f, row: p, ActionsColumn: jt })
3177
2608
  }
3178
2609
  );
3179
- return /* @__PURE__ */ P(
3180
- nt,
2610
+ return /* @__PURE__ */ m(
2611
+ rt,
3181
2612
  {
3182
- isDeleted: A,
3183
- isSelected: W,
3184
- onClick: B,
3185
- rowOuiaId: w == null ? void 0 : w({ row: b, rowIndex: x }),
2613
+ isDeleted: P,
2614
+ isSelected: $,
2615
+ onClick: L,
2616
+ rowOuiaId: b == null ? void 0 : b({ row: p, rowIndex: f }),
3186
2617
  children: [
3187
- z,
3188
- V
2618
+ oe,
2619
+ nt
3189
2620
  ]
3190
2621
  },
3191
- `row_${x}`
2622
+ `row_${f}`
3192
2623
  );
3193
2624
  }),
3194
- (i == null ? void 0 : i.length) === 0 && /* @__PURE__ */ l(se, { children: /* @__PURE__ */ l(Te, { colSpan: s.length, children: p }) })
2625
+ (i == null ? void 0 : i.length) === 0 && /* @__PURE__ */ c(ee, { children: /* @__PURE__ */ c(ye, { colSpan: s.length, children: k }) })
3195
2626
  ] })
3196
2627
  ]
3197
2628
  }
3198
2629
  );
3199
- }, rt = ye(
3200
- Z((e, t) => {
2630
+ }, it = ve(
2631
+ X((e, t) => {
3201
2632
  const {
3202
2633
  tableWidth: s,
3203
2634
  columnWidth: i,
3204
2635
  position: r,
3205
2636
  canHide: n,
3206
- className: o = "",
3207
- children: a,
3208
- ...c
3209
- } = e, h = n && s < i * (r + 1) ? "pf-m-hidden" : "pf-m-visible";
3210
- return /* @__PURE__ */ l(
2637
+ className: a = "",
2638
+ children: o,
2639
+ ...l
2640
+ } = e, d = n && s < i * (r + 1) ? "pf-m-hidden" : "pf-m-visible";
2641
+ return /* @__PURE__ */ c(
3211
2642
  Ot,
3212
2643
  {
3213
2644
  ref: t,
3214
- className: `${h} ${o}`,
3215
- ...c,
3216
- children: a
2645
+ className: `${d} ${a}`,
2646
+ ...l,
2647
+ children: o
3217
2648
  }
3218
2649
  );
3219
2650
  })
3220
2651
  );
3221
- rt.displayName = "ResponsiveTh";
3222
- const ve = ye(
3223
- Z((e, t) => {
2652
+ it.displayName = "ResponsiveTh";
2653
+ const me = ve(
2654
+ X((e, t) => {
3224
2655
  const {
3225
2656
  tableWidth: s,
3226
2657
  columnWidth: i,
3227
2658
  position: r,
3228
2659
  canHide: n,
3229
- className: o = "",
3230
- children: a,
3231
- ...c
3232
- } = e, h = n && s < i * (r + 1) ? "pf-m-hidden" : "pf-m-visible";
3233
- return /* @__PURE__ */ l(
3234
- Te,
2660
+ className: a = "",
2661
+ children: o,
2662
+ ...l
2663
+ } = e, d = n && s < i * (r + 1) ? "pf-m-hidden" : "pf-m-visible";
2664
+ return /* @__PURE__ */ c(
2665
+ ye,
3235
2666
  {
3236
2667
  ref: t,
3237
- className: `${h} ${o}`,
3238
- ...c,
3239
- children: a
2668
+ className: `${d} ${a}`,
2669
+ ...l,
2670
+ children: o
3240
2671
  }
3241
2672
  );
3242
2673
  })
3243
2674
  );
3244
- ve.displayName = "ResponsiveTd";
3245
- const nt = ye(
3246
- ({ isDeleted: e, isSelected: t, onClick: s, children: i, rowOuiaId: r }) => /* @__PURE__ */ l(
3247
- se,
2675
+ me.displayName = "ResponsiveTd";
2676
+ const rt = ve(
2677
+ ({ isDeleted: e, isSelected: t, onClick: s, children: i, rowOuiaId: r }) => /* @__PURE__ */ c(
2678
+ ee,
3248
2679
  {
3249
2680
  onRowClick: (n) => {
3250
2681
  (n == null ? void 0 : n.target) instanceof HTMLElement && (["a", "button"].includes(n.target.tagName.toLowerCase()) || s && s());
@@ -3258,71 +2689,71 @@ const nt = ye(
3258
2689
  }
3259
2690
  )
3260
2691
  );
3261
- nt.displayName = "DeletableRow";
3262
- const $s = ({ label: e, onSearch: t }) => {
2692
+ rt.displayName = "DeletableRow";
2693
+ const Os = ({ label: e, onSearch: t }) => {
3263
2694
  const s = (i, r, n) => {
3264
2695
  t(r);
3265
2696
  };
3266
- return /* @__PURE__ */ l(
3267
- yt,
2697
+ return /* @__PURE__ */ c(
2698
+ bt,
3268
2699
  {
3269
2700
  placeholder: `Filter by ${e}`,
3270
2701
  onSearch: s
3271
2702
  }
3272
2703
  );
3273
2704
  };
3274
- function Fe({
2705
+ function Me({
3275
2706
  options: e,
3276
2707
  value: t,
3277
2708
  onChange: s,
3278
2709
  ouiaId: i
3279
2710
  }) {
3280
- const [r, n] = N(!1);
3281
- return /* @__PURE__ */ l(
3282
- be,
2711
+ const [r, n] = E(!1);
2712
+ return /* @__PURE__ */ c(
2713
+ Se,
3283
2714
  {
3284
- toggle: (a) => /* @__PURE__ */ l(
3285
- ae,
2715
+ toggle: (o) => /* @__PURE__ */ c(
2716
+ ne,
3286
2717
  {
3287
- ref: a,
3288
- onClick: () => n((c) => !c),
2718
+ ref: o,
2719
+ onClick: () => n((l) => !l),
3289
2720
  isExpanded: r,
3290
2721
  variant: "plain",
3291
- children: /* @__PURE__ */ l($e, {})
2722
+ children: /* @__PURE__ */ c(Le, {})
3292
2723
  }
3293
2724
  ),
3294
2725
  "aria-label": "table:select_filter",
3295
2726
  selected: t,
3296
2727
  isOpen: r,
3297
- onSelect: (a, c) => {
3298
- s(c), n(!1);
2728
+ onSelect: (o, l) => {
2729
+ s(l), n(!1);
3299
2730
  },
3300
2731
  ouiaId: i,
3301
- children: /* @__PURE__ */ l(bt, { children: e.map((a, c) => /* @__PURE__ */ l(ke, { value: a, children: a }, c)) })
2732
+ children: /* @__PURE__ */ c(yt, { children: e.map((o, l) => /* @__PURE__ */ c(be, { value: o, children: o }, l)) })
3302
2733
  }
3303
2734
  );
3304
2735
  }
3305
- function zs({
2736
+ function As({
3306
2737
  label: e,
3307
2738
  chips: t,
3308
2739
  options: s,
3309
2740
  onToggle: i
3310
2741
  }) {
3311
- const [r, n] = N(!1);
3312
- return /* @__PURE__ */ l(
3313
- be,
2742
+ const [r, n] = E(!1);
2743
+ return /* @__PURE__ */ c(
2744
+ Se,
3314
2745
  {
3315
2746
  "aria-label": e,
3316
- onSelect: (o, a) => {
3317
- i(a);
2747
+ onSelect: (a, o) => {
2748
+ i(o);
3318
2749
  },
3319
2750
  selected: t,
3320
2751
  isOpen: r,
3321
- toggle: (o) => /* @__PURE__ */ l(
3322
- ae,
2752
+ toggle: (a) => /* @__PURE__ */ c(
2753
+ ne,
3323
2754
  {
3324
- ref: o,
3325
- onClick: () => n((a) => !a),
2755
+ ref: a,
2756
+ onClick: () => n((o) => !o),
3326
2757
  isExpanded: r,
3327
2758
  style: {
3328
2759
  width: "200px"
@@ -3330,45 +2761,45 @@ function zs({
3330
2761
  children: `Filter by ${e}`
3331
2762
  }
3332
2763
  ),
3333
- children: Object.entries(s).map(([o, a]) => /* @__PURE__ */ l(ke, { value: o, hasCheckbox: !0, children: a }, o))
2764
+ children: Object.entries(s).map(([a, o]) => /* @__PURE__ */ c(be, { value: a, hasCheckbox: !0, children: o }, a))
3334
2765
  }
3335
2766
  );
3336
2767
  }
3337
- function _i({ filters: e, breakpoint: t = "md" }) {
3338
- const s = Object.keys(e), [i, r] = N(s[0]), n = (o, a) => {
3339
- switch (a.type) {
2768
+ function si({ filters: e, breakpoint: t = "md" }) {
2769
+ const s = Object.keys(e), [i, r] = E(s[0]), n = (a, o) => {
2770
+ switch (o.type) {
3340
2771
  case "search":
3341
- return /* @__PURE__ */ l(
3342
- $s,
2772
+ return /* @__PURE__ */ c(
2773
+ Os,
3343
2774
  {
3344
- onSearch: a.onSearch,
3345
- label: o,
3346
- validate: a.validate,
3347
- errorMessage: a.errorMessage
2775
+ onSearch: o.onSearch,
2776
+ label: a,
2777
+ validate: o.validate,
2778
+ errorMessage: o.errorMessage
3348
2779
  }
3349
2780
  );
3350
2781
  case "checkbox":
3351
- return /* @__PURE__ */ l(
3352
- zs,
2782
+ return /* @__PURE__ */ c(
2783
+ As,
3353
2784
  {
3354
- chips: a.chips,
3355
- options: a.options,
3356
- onToggle: a.onToggle,
3357
- label: o
2785
+ chips: o.chips,
2786
+ options: o.options,
2787
+ onToggle: o.onToggle,
2788
+ label: a
3358
2789
  }
3359
2790
  );
3360
2791
  }
3361
2792
  };
3362
- return /* @__PURE__ */ P(oe, { children: [
3363
- /* @__PURE__ */ l(
2793
+ return /* @__PURE__ */ m(re, { children: [
2794
+ /* @__PURE__ */ c(
3364
2795
  kt,
3365
2796
  {
3366
2797
  variant: "search-filter",
3367
2798
  visibility: { default: "hidden", [t]: "visible" },
3368
2799
  "data-testid": "large-viewport-toolbar",
3369
- children: /* @__PURE__ */ P(Tt, { children: [
3370
- s.length > 1 && /* @__PURE__ */ l(
3371
- Fe,
2800
+ children: /* @__PURE__ */ m(Tt, { children: [
2801
+ s.length > 1 && /* @__PURE__ */ c(
2802
+ Me,
3372
2803
  {
3373
2804
  options: s,
3374
2805
  value: i,
@@ -3380,15 +2811,15 @@ function _i({ filters: e, breakpoint: t = "md" }) {
3380
2811
  ] })
3381
2812
  }
3382
2813
  ),
3383
- /* @__PURE__ */ l(
2814
+ /* @__PURE__ */ c(
3384
2815
  It,
3385
2816
  {
3386
- toggleIcon: /* @__PURE__ */ l($e, {}),
2817
+ toggleIcon: /* @__PURE__ */ c(Le, {}),
3387
2818
  breakpoint: t,
3388
2819
  visibility: { default: "visible", [t]: "hidden" },
3389
- children: /* @__PURE__ */ P(Ct, { variant: "filter-group", children: [
3390
- s.length > 1 && /* @__PURE__ */ l(
3391
- Fe,
2820
+ children: /* @__PURE__ */ m(Et, { variant: "filter-group", children: [
2821
+ s.length > 1 && /* @__PURE__ */ c(
2822
+ Me,
3392
2823
  {
3393
2824
  options: s,
3394
2825
  value: i,
@@ -3396,17 +2827,17 @@ function _i({ filters: e, breakpoint: t = "md" }) {
3396
2827
  ouiaId: "chip-filter-selector-small-viewport"
3397
2828
  }
3398
2829
  ),
3399
- Object.entries(e).map(([o, a], c) => /* @__PURE__ */ l(
3400
- Et,
2830
+ Object.entries(e).map(([a, o], l) => /* @__PURE__ */ c(
2831
+ Ct,
3401
2832
  {
3402
- chips: a.type === "checkbox" ? a.chips.map((h) => ({ key: h, node: a.options[h] })) : a.chips,
3403
- deleteChip: (h, u) => a.onRemoveChip(typeof u == "string" ? u : u.key),
3404
- deleteChipGroup: a.onRemoveGroup,
3405
- categoryName: o,
3406
- showToolbarItem: o === i,
3407
- children: o === i && n(o, a)
2833
+ chips: o.type === "checkbox" ? o.chips.map((d) => ({ key: d, node: o.options[d] })) : o.chips,
2834
+ deleteChip: (d, h) => o.onRemoveChip(typeof h == "string" ? h : h.key),
2835
+ deleteChipGroup: o.onRemoveGroup,
2836
+ categoryName: a,
2837
+ showToolbarItem: a === i,
2838
+ children: a === i && n(a, o)
3408
2839
  },
3409
- c
2840
+ l
3410
2841
  ))
3411
2842
  ] })
3412
2843
  }
@@ -3414,32 +2845,32 @@ function _i({ filters: e, breakpoint: t = "md" }) {
3414
2845
  ] });
3415
2846
  }
3416
2847
  export {
3417
- ci as AppAboutModal,
3418
- oi as ApplicationAuth,
2848
+ Qs as AppAboutModal,
2849
+ Bs as ApplicationAuth,
3419
2850
  Mt as AuthConfigContext,
3420
- _i as ChipFilter,
3421
- Ls as DateTime,
3422
- nt as DeletableRow,
3423
- zs as FilterCheckbox,
3424
- $s as FilterSearch,
3425
- Fe as FilterSelector,
3426
- Zs as FromNow,
3427
- D as If,
3428
- ai as IfAuth,
3429
- ei as IfNotEmpty,
3430
- ne as IfNotLoading,
3431
- ti as ListWithToolbar,
3432
- hi as Loading,
3433
- si as ObjectDropdown,
3434
- ii as ObjectSelect,
3435
- gi as Pagination,
3436
- li as PleaseWaitModal,
3437
- di as ProgressModal,
3438
- ui as ResponsiveTable,
3439
- ve as ResponsiveTd,
3440
- rt as ResponsiveTh,
3441
- Bs as TableSkeleton,
3442
- ri as ToggleIcon,
3443
- ni as UrlUpload,
3444
- st as useAuth
2851
+ si as ChipFilter,
2852
+ xs as DateTime,
2853
+ rt as DeletableRow,
2854
+ As as FilterCheckbox,
2855
+ Os as FilterSearch,
2856
+ Me as FilterSelector,
2857
+ $s as FromNow,
2858
+ q as If,
2859
+ Gs as IfAuth,
2860
+ Ls as IfNotEmpty,
2861
+ ie as IfNotLoading,
2862
+ Ws as ListWithToolbar,
2863
+ Zs as Loading,
2864
+ Ks as ObjectDropdown,
2865
+ zs as ObjectSelect,
2866
+ ei as Pagination,
2867
+ Xs as PleaseWaitModal,
2868
+ Ys as ProgressModal,
2869
+ ti as ResponsiveTable,
2870
+ me as ResponsiveTd,
2871
+ it as ResponsiveTh,
2872
+ Ps as TableSkeleton,
2873
+ Js as ToggleIcon,
2874
+ Vs as UrlUpload,
2875
+ tt as useAuth
3445
2876
  };