@arkitektbedriftene/fe-lib 0.2.10 → 0.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/oidc.es.js +658 -650
- package/package.json +5 -9
- package/vite.config.ts +1 -0
- package/dist/hooks.cjs.js +0 -1
- package/dist/icons.cjs.js +0 -1
- package/dist/index.cjs.js +0 -1
- package/dist/jsx-runtime-1b33e5e6.cjs +0 -27
- package/dist/oidc.cjs.js +0 -1
- package/dist/useLocalStorageState-f72b4add.cjs +0 -1
package/dist/oidc.es.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { u as
|
|
1
|
+
import { j as re } from "./jsx-runtime-a0589023.js";
|
|
2
|
+
import { createContext as _e, useContext as pe, useMemo as fe, useEffect as L, useState as Te, useRef as we, useCallback as ce } from "react";
|
|
3
|
+
import { u as Ie } from "./useLocalStorageState-b4fb2a60.js";
|
|
4
4
|
var N = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
5
|
-
function
|
|
5
|
+
function Ue(e) {
|
|
6
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
7
|
+
}
|
|
8
|
+
function Pe(e) {
|
|
6
9
|
if (e.__esModule)
|
|
7
10
|
return e;
|
|
8
11
|
var t = e.default;
|
|
@@ -29,124 +32,400 @@ function Te(e) {
|
|
|
29
32
|
});
|
|
30
33
|
}), s;
|
|
31
34
|
}
|
|
32
|
-
function
|
|
35
|
+
function Ae(e) {
|
|
33
36
|
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.');
|
|
34
37
|
}
|
|
35
|
-
var
|
|
38
|
+
var F = {}, Oe = {
|
|
36
39
|
get exports() {
|
|
37
|
-
return
|
|
40
|
+
return F;
|
|
38
41
|
},
|
|
39
42
|
set exports(e) {
|
|
40
|
-
|
|
43
|
+
F = e;
|
|
41
44
|
}
|
|
42
45
|
};
|
|
43
|
-
const
|
|
46
|
+
const qe = {}, Ne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
44
47
|
__proto__: null,
|
|
45
|
-
default:
|
|
46
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
48
|
+
default: qe
|
|
49
|
+
}, Symbol.toStringTag, { value: "Module" })), je = /* @__PURE__ */ Pe(Ne);
|
|
50
|
+
var le;
|
|
51
|
+
function J() {
|
|
52
|
+
return le || (le = 1, function(e, t) {
|
|
53
|
+
(function(s, r) {
|
|
54
|
+
e.exports = r();
|
|
55
|
+
})(N, function() {
|
|
56
|
+
var s = s || function(r, i) {
|
|
57
|
+
var n;
|
|
58
|
+
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 N < "u" && N.crypto && (n = N.crypto), !n && typeof Ae == "function")
|
|
59
|
+
try {
|
|
60
|
+
n = je;
|
|
61
|
+
} catch {
|
|
62
|
+
}
|
|
63
|
+
var o = function() {
|
|
64
|
+
if (n) {
|
|
65
|
+
if (typeof n.getRandomValues == "function")
|
|
66
|
+
try {
|
|
67
|
+
return n.getRandomValues(new Uint32Array(1))[0];
|
|
68
|
+
} catch {
|
|
69
|
+
}
|
|
70
|
+
if (typeof n.randomBytes == "function")
|
|
71
|
+
try {
|
|
72
|
+
return n.randomBytes(4).readInt32LE();
|
|
73
|
+
} catch {
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
throw new Error("Native crypto module could not be used to get secure random number.");
|
|
77
|
+
}, c = Object.create || function() {
|
|
78
|
+
function a() {
|
|
79
|
+
}
|
|
80
|
+
return function(d) {
|
|
81
|
+
var p;
|
|
82
|
+
return a.prototype = d, p = new a(), a.prototype = null, p;
|
|
83
|
+
};
|
|
84
|
+
}(), l = {}, h = l.lib = {}, g = h.Base = function() {
|
|
85
|
+
return {
|
|
86
|
+
/**
|
|
87
|
+
* Creates a new object that inherits from this object.
|
|
88
|
+
*
|
|
89
|
+
* @param {Object} overrides Properties to copy into the new object.
|
|
90
|
+
*
|
|
91
|
+
* @return {Object} The new object.
|
|
92
|
+
*
|
|
93
|
+
* @static
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
*
|
|
97
|
+
* var MyType = CryptoJS.lib.Base.extend({
|
|
98
|
+
* field: 'value',
|
|
99
|
+
*
|
|
100
|
+
* method: function () {
|
|
101
|
+
* }
|
|
102
|
+
* });
|
|
103
|
+
*/
|
|
104
|
+
extend: function(a) {
|
|
105
|
+
var d = c(this);
|
|
106
|
+
return a && d.mixIn(a), (!d.hasOwnProperty("init") || this.init === d.init) && (d.init = function() {
|
|
107
|
+
d.$super.init.apply(this, arguments);
|
|
108
|
+
}), d.init.prototype = d, d.$super = this, d;
|
|
109
|
+
},
|
|
110
|
+
/**
|
|
111
|
+
* Extends this object and runs the init method.
|
|
112
|
+
* Arguments to create() will be passed to init().
|
|
113
|
+
*
|
|
114
|
+
* @return {Object} The new object.
|
|
115
|
+
*
|
|
116
|
+
* @static
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
*
|
|
120
|
+
* var instance = MyType.create();
|
|
121
|
+
*/
|
|
122
|
+
create: function() {
|
|
123
|
+
var a = this.extend();
|
|
124
|
+
return a.init.apply(a, arguments), a;
|
|
125
|
+
},
|
|
126
|
+
/**
|
|
127
|
+
* Initializes a newly created object.
|
|
128
|
+
* Override this method to add some logic when your objects are created.
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
*
|
|
132
|
+
* var MyType = CryptoJS.lib.Base.extend({
|
|
133
|
+
* init: function () {
|
|
134
|
+
* // ...
|
|
135
|
+
* }
|
|
136
|
+
* });
|
|
137
|
+
*/
|
|
138
|
+
init: function() {
|
|
139
|
+
},
|
|
140
|
+
/**
|
|
141
|
+
* Copies properties into this object.
|
|
142
|
+
*
|
|
143
|
+
* @param {Object} properties The properties to mix in.
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
*
|
|
147
|
+
* MyType.mixIn({
|
|
148
|
+
* field: 'value'
|
|
149
|
+
* });
|
|
150
|
+
*/
|
|
151
|
+
mixIn: function(a) {
|
|
152
|
+
for (var d in a)
|
|
153
|
+
a.hasOwnProperty(d) && (this[d] = a[d]);
|
|
154
|
+
a.hasOwnProperty("toString") && (this.toString = a.toString);
|
|
155
|
+
},
|
|
156
|
+
/**
|
|
157
|
+
* Creates a copy of this object.
|
|
158
|
+
*
|
|
159
|
+
* @return {Object} The clone.
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
*
|
|
163
|
+
* var clone = instance.clone();
|
|
164
|
+
*/
|
|
165
|
+
clone: function() {
|
|
166
|
+
return this.init.prototype.extend(this);
|
|
64
167
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
168
|
+
};
|
|
169
|
+
}(), u = h.WordArray = g.extend({
|
|
170
|
+
/**
|
|
171
|
+
* Initializes a newly created word array.
|
|
172
|
+
*
|
|
173
|
+
* @param {Array} words (Optional) An array of 32-bit words.
|
|
174
|
+
* @param {number} sigBytes (Optional) The number of significant bytes in the words.
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
*
|
|
178
|
+
* var wordArray = CryptoJS.lib.WordArray.create();
|
|
179
|
+
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
|
|
180
|
+
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
|
|
181
|
+
*/
|
|
182
|
+
init: function(a, d) {
|
|
183
|
+
a = this.words = a || [], d != i ? this.sigBytes = d : this.sigBytes = a.length * 4;
|
|
184
|
+
},
|
|
185
|
+
/**
|
|
186
|
+
* Converts this word array to a string.
|
|
187
|
+
*
|
|
188
|
+
* @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
|
|
189
|
+
*
|
|
190
|
+
* @return {string} The stringified word array.
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
*
|
|
194
|
+
* var string = wordArray + '';
|
|
195
|
+
* var string = wordArray.toString();
|
|
196
|
+
* var string = wordArray.toString(CryptoJS.enc.Utf8);
|
|
197
|
+
*/
|
|
198
|
+
toString: function(a) {
|
|
199
|
+
return (a || w).stringify(this);
|
|
200
|
+
},
|
|
201
|
+
/**
|
|
202
|
+
* Concatenates a word array to this word array.
|
|
203
|
+
*
|
|
204
|
+
* @param {WordArray} wordArray The word array to append.
|
|
205
|
+
*
|
|
206
|
+
* @return {WordArray} This word array.
|
|
207
|
+
*
|
|
208
|
+
* @example
|
|
209
|
+
*
|
|
210
|
+
* wordArray1.concat(wordArray2);
|
|
211
|
+
*/
|
|
212
|
+
concat: function(a) {
|
|
213
|
+
var d = this.words, p = a.words, v = this.sigBytes, b = a.sigBytes;
|
|
214
|
+
if (this.clamp(), v % 4)
|
|
215
|
+
for (var E = 0; E < b; E++) {
|
|
216
|
+
var x = p[E >>> 2] >>> 24 - E % 4 * 8 & 255;
|
|
217
|
+
d[v + E >>> 2] |= x << 24 - (v + E) % 4 * 8;
|
|
218
|
+
}
|
|
219
|
+
else
|
|
220
|
+
for (var C = 0; C < b; C += 4)
|
|
221
|
+
d[v + C >>> 2] = p[C >>> 2];
|
|
222
|
+
return this.sigBytes += b, this;
|
|
223
|
+
},
|
|
224
|
+
/**
|
|
225
|
+
* Removes insignificant bits.
|
|
226
|
+
*
|
|
227
|
+
* @example
|
|
228
|
+
*
|
|
229
|
+
* wordArray.clamp();
|
|
230
|
+
*/
|
|
231
|
+
clamp: function() {
|
|
232
|
+
var a = this.words, d = this.sigBytes;
|
|
233
|
+
a[d >>> 2] &= 4294967295 << 32 - d % 4 * 8, a.length = r.ceil(d / 4);
|
|
234
|
+
},
|
|
235
|
+
/**
|
|
236
|
+
* Creates a copy of this word array.
|
|
237
|
+
*
|
|
238
|
+
* @return {WordArray} The clone.
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
*
|
|
242
|
+
* var clone = wordArray.clone();
|
|
243
|
+
*/
|
|
244
|
+
clone: function() {
|
|
245
|
+
var a = g.clone.call(this);
|
|
246
|
+
return a.words = this.words.slice(0), a;
|
|
247
|
+
},
|
|
248
|
+
/**
|
|
249
|
+
* Creates a word array filled with random bytes.
|
|
250
|
+
*
|
|
251
|
+
* @param {number} nBytes The number of random bytes to generate.
|
|
252
|
+
*
|
|
253
|
+
* @return {WordArray} The random word array.
|
|
254
|
+
*
|
|
255
|
+
* @static
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
*
|
|
259
|
+
* var wordArray = CryptoJS.lib.WordArray.random(16);
|
|
260
|
+
*/
|
|
261
|
+
random: function(a) {
|
|
262
|
+
for (var d = [], p = 0; p < a; p += 4)
|
|
263
|
+
d.push(o());
|
|
264
|
+
return new u.init(d, a);
|
|
265
|
+
}
|
|
266
|
+
}), S = l.enc = {}, w = S.Hex = {
|
|
267
|
+
/**
|
|
268
|
+
* Converts a word array to a hex string.
|
|
269
|
+
*
|
|
270
|
+
* @param {WordArray} wordArray The word array.
|
|
271
|
+
*
|
|
272
|
+
* @return {string} The hex string.
|
|
273
|
+
*
|
|
274
|
+
* @static
|
|
275
|
+
*
|
|
276
|
+
* @example
|
|
277
|
+
*
|
|
278
|
+
* var hexString = CryptoJS.enc.Hex.stringify(wordArray);
|
|
279
|
+
*/
|
|
280
|
+
stringify: function(a) {
|
|
281
|
+
for (var d = a.words, p = a.sigBytes, v = [], b = 0; b < p; b++) {
|
|
282
|
+
var E = d[b >>> 2] >>> 24 - b % 4 * 8 & 255;
|
|
283
|
+
v.push((E >>> 4).toString(16)), v.push((E & 15).toString(16));
|
|
69
284
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}, c = Object.create || function() {
|
|
73
|
-
function a() {
|
|
74
|
-
}
|
|
75
|
-
return function(d) {
|
|
76
|
-
var p;
|
|
77
|
-
return a.prototype = d, p = new a(), a.prototype = null, p;
|
|
78
|
-
};
|
|
79
|
-
}(), l = {}, h = l.lib = {}, g = h.Base = function() {
|
|
80
|
-
return {
|
|
285
|
+
return v.join("");
|
|
286
|
+
},
|
|
81
287
|
/**
|
|
82
|
-
*
|
|
288
|
+
* Converts a hex string to a word array.
|
|
83
289
|
*
|
|
84
|
-
* @param {
|
|
290
|
+
* @param {string} hexStr The hex string.
|
|
85
291
|
*
|
|
86
|
-
* @return {
|
|
292
|
+
* @return {WordArray} The word array.
|
|
87
293
|
*
|
|
88
294
|
* @static
|
|
89
295
|
*
|
|
90
296
|
* @example
|
|
91
297
|
*
|
|
92
|
-
* var
|
|
93
|
-
|
|
298
|
+
* var wordArray = CryptoJS.enc.Hex.parse(hexString);
|
|
299
|
+
*/
|
|
300
|
+
parse: function(a) {
|
|
301
|
+
for (var d = a.length, p = [], v = 0; v < d; v += 2)
|
|
302
|
+
p[v >>> 3] |= parseInt(a.substr(v, 2), 16) << 24 - v % 8 * 4;
|
|
303
|
+
return new u.init(p, d / 2);
|
|
304
|
+
}
|
|
305
|
+
}, k = S.Latin1 = {
|
|
306
|
+
/**
|
|
307
|
+
* Converts a word array to a Latin1 string.
|
|
308
|
+
*
|
|
309
|
+
* @param {WordArray} wordArray The word array.
|
|
310
|
+
*
|
|
311
|
+
* @return {string} The Latin1 string.
|
|
312
|
+
*
|
|
313
|
+
* @static
|
|
314
|
+
*
|
|
315
|
+
* @example
|
|
316
|
+
*
|
|
317
|
+
* var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
|
|
318
|
+
*/
|
|
319
|
+
stringify: function(a) {
|
|
320
|
+
for (var d = a.words, p = a.sigBytes, v = [], b = 0; b < p; b++) {
|
|
321
|
+
var E = d[b >>> 2] >>> 24 - b % 4 * 8 & 255;
|
|
322
|
+
v.push(String.fromCharCode(E));
|
|
323
|
+
}
|
|
324
|
+
return v.join("");
|
|
325
|
+
},
|
|
326
|
+
/**
|
|
327
|
+
* Converts a Latin1 string to a word array.
|
|
328
|
+
*
|
|
329
|
+
* @param {string} latin1Str The Latin1 string.
|
|
330
|
+
*
|
|
331
|
+
* @return {WordArray} The word array.
|
|
332
|
+
*
|
|
333
|
+
* @static
|
|
334
|
+
*
|
|
335
|
+
* @example
|
|
336
|
+
*
|
|
337
|
+
* var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
|
|
338
|
+
*/
|
|
339
|
+
parse: function(a) {
|
|
340
|
+
for (var d = a.length, p = [], v = 0; v < d; v++)
|
|
341
|
+
p[v >>> 2] |= (a.charCodeAt(v) & 255) << 24 - v % 4 * 8;
|
|
342
|
+
return new u.init(p, d);
|
|
343
|
+
}
|
|
344
|
+
}, _ = S.Utf8 = {
|
|
345
|
+
/**
|
|
346
|
+
* Converts a word array to a UTF-8 string.
|
|
347
|
+
*
|
|
348
|
+
* @param {WordArray} wordArray The word array.
|
|
349
|
+
*
|
|
350
|
+
* @return {string} The UTF-8 string.
|
|
351
|
+
*
|
|
352
|
+
* @static
|
|
94
353
|
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
354
|
+
* @example
|
|
355
|
+
*
|
|
356
|
+
* var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
|
|
98
357
|
*/
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
358
|
+
stringify: function(a) {
|
|
359
|
+
try {
|
|
360
|
+
return decodeURIComponent(escape(k.stringify(a)));
|
|
361
|
+
} catch {
|
|
362
|
+
throw new Error("Malformed UTF-8 data");
|
|
363
|
+
}
|
|
104
364
|
},
|
|
105
365
|
/**
|
|
106
|
-
*
|
|
107
|
-
*
|
|
366
|
+
* Converts a UTF-8 string to a word array.
|
|
367
|
+
*
|
|
368
|
+
* @param {string} utf8Str The UTF-8 string.
|
|
108
369
|
*
|
|
109
|
-
* @return {
|
|
370
|
+
* @return {WordArray} The word array.
|
|
110
371
|
*
|
|
111
372
|
* @static
|
|
112
373
|
*
|
|
113
374
|
* @example
|
|
114
375
|
*
|
|
115
|
-
* var
|
|
376
|
+
* var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
|
|
116
377
|
*/
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
378
|
+
parse: function(a) {
|
|
379
|
+
return k.parse(unescape(encodeURIComponent(a)));
|
|
380
|
+
}
|
|
381
|
+
}, m = h.BufferedBlockAlgorithm = g.extend({
|
|
382
|
+
/**
|
|
383
|
+
* Resets this block algorithm's data buffer to its initial state.
|
|
384
|
+
*
|
|
385
|
+
* @example
|
|
386
|
+
*
|
|
387
|
+
* bufferedBlockAlgorithm.reset();
|
|
388
|
+
*/
|
|
389
|
+
reset: function() {
|
|
390
|
+
this._data = new u.init(), this._nDataBytes = 0;
|
|
120
391
|
},
|
|
121
392
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
393
|
+
* Adds new data to this block algorithm's buffer.
|
|
394
|
+
*
|
|
395
|
+
* @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
|
|
124
396
|
*
|
|
125
397
|
* @example
|
|
126
398
|
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
* // ...
|
|
130
|
-
* }
|
|
131
|
-
* });
|
|
399
|
+
* bufferedBlockAlgorithm._append('data');
|
|
400
|
+
* bufferedBlockAlgorithm._append(wordArray);
|
|
132
401
|
*/
|
|
133
|
-
|
|
402
|
+
_append: function(a) {
|
|
403
|
+
typeof a == "string" && (a = _.parse(a)), this._data.concat(a), this._nDataBytes += a.sigBytes;
|
|
134
404
|
},
|
|
135
405
|
/**
|
|
136
|
-
*
|
|
406
|
+
* Processes available data blocks.
|
|
407
|
+
*
|
|
408
|
+
* This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
|
|
409
|
+
*
|
|
410
|
+
* @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
|
|
137
411
|
*
|
|
138
|
-
* @
|
|
412
|
+
* @return {WordArray} The processed data.
|
|
139
413
|
*
|
|
140
414
|
* @example
|
|
141
415
|
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
* });
|
|
416
|
+
* var processedData = bufferedBlockAlgorithm._process();
|
|
417
|
+
* var processedData = bufferedBlockAlgorithm._process(!!'flush');
|
|
145
418
|
*/
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
419
|
+
_process: function(a) {
|
|
420
|
+
var d, p = this._data, v = p.words, b = p.sigBytes, E = this.blockSize, x = E * 4, C = b / x;
|
|
421
|
+
a ? C = r.ceil(C) : C = r.max((C | 0) - this._minBufferSize, 0);
|
|
422
|
+
var A = C * E, R = r.min(A * 4, b);
|
|
423
|
+
if (A) {
|
|
424
|
+
for (var q = 0; q < A; q += E)
|
|
425
|
+
this._doProcessBlock(v, q);
|
|
426
|
+
d = v.splice(0, A), p.sigBytes -= R;
|
|
427
|
+
}
|
|
428
|
+
return new u.init(d, R);
|
|
150
429
|
},
|
|
151
430
|
/**
|
|
152
431
|
* Creates a copy of this object.
|
|
@@ -155,404 +434,133 @@ const Pe = {}, Ae = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
155
434
|
*
|
|
156
435
|
* @example
|
|
157
436
|
*
|
|
158
|
-
* var clone =
|
|
437
|
+
* var clone = bufferedBlockAlgorithm.clone();
|
|
159
438
|
*/
|
|
160
439
|
clone: function() {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
* Converts a word array to a hex string.
|
|
264
|
-
*
|
|
265
|
-
* @param {WordArray} wordArray The word array.
|
|
266
|
-
*
|
|
267
|
-
* @return {string} The hex string.
|
|
268
|
-
*
|
|
269
|
-
* @static
|
|
270
|
-
*
|
|
271
|
-
* @example
|
|
272
|
-
*
|
|
273
|
-
* var hexString = CryptoJS.enc.Hex.stringify(wordArray);
|
|
274
|
-
*/
|
|
275
|
-
stringify: function(a) {
|
|
276
|
-
for (var d = a.words, p = a.sigBytes, v = [], b = 0; b < p; b++) {
|
|
277
|
-
var E = d[b >>> 2] >>> 24 - b % 4 * 8 & 255;
|
|
278
|
-
v.push((E >>> 4).toString(16)), v.push((E & 15).toString(16));
|
|
279
|
-
}
|
|
280
|
-
return v.join("");
|
|
281
|
-
},
|
|
282
|
-
/**
|
|
283
|
-
* Converts a hex string to a word array.
|
|
284
|
-
*
|
|
285
|
-
* @param {string} hexStr The hex string.
|
|
286
|
-
*
|
|
287
|
-
* @return {WordArray} The word array.
|
|
288
|
-
*
|
|
289
|
-
* @static
|
|
290
|
-
*
|
|
291
|
-
* @example
|
|
292
|
-
*
|
|
293
|
-
* var wordArray = CryptoJS.enc.Hex.parse(hexString);
|
|
294
|
-
*/
|
|
295
|
-
parse: function(a) {
|
|
296
|
-
for (var d = a.length, p = [], v = 0; v < d; v += 2)
|
|
297
|
-
p[v >>> 3] |= parseInt(a.substr(v, 2), 16) << 24 - v % 8 * 4;
|
|
298
|
-
return new u.init(p, d / 2);
|
|
299
|
-
}
|
|
300
|
-
}, k = S.Latin1 = {
|
|
301
|
-
/**
|
|
302
|
-
* Converts a word array to a Latin1 string.
|
|
303
|
-
*
|
|
304
|
-
* @param {WordArray} wordArray The word array.
|
|
305
|
-
*
|
|
306
|
-
* @return {string} The Latin1 string.
|
|
307
|
-
*
|
|
308
|
-
* @static
|
|
309
|
-
*
|
|
310
|
-
* @example
|
|
311
|
-
*
|
|
312
|
-
* var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
|
|
313
|
-
*/
|
|
314
|
-
stringify: function(a) {
|
|
315
|
-
for (var d = a.words, p = a.sigBytes, v = [], b = 0; b < p; b++) {
|
|
316
|
-
var E = d[b >>> 2] >>> 24 - b % 4 * 8 & 255;
|
|
317
|
-
v.push(String.fromCharCode(E));
|
|
318
|
-
}
|
|
319
|
-
return v.join("");
|
|
320
|
-
},
|
|
321
|
-
/**
|
|
322
|
-
* Converts a Latin1 string to a word array.
|
|
323
|
-
*
|
|
324
|
-
* @param {string} latin1Str The Latin1 string.
|
|
325
|
-
*
|
|
326
|
-
* @return {WordArray} The word array.
|
|
327
|
-
*
|
|
328
|
-
* @static
|
|
329
|
-
*
|
|
330
|
-
* @example
|
|
331
|
-
*
|
|
332
|
-
* var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
|
|
333
|
-
*/
|
|
334
|
-
parse: function(a) {
|
|
335
|
-
for (var d = a.length, p = [], v = 0; v < d; v++)
|
|
336
|
-
p[v >>> 2] |= (a.charCodeAt(v) & 255) << 24 - v % 4 * 8;
|
|
337
|
-
return new u.init(p, d);
|
|
338
|
-
}
|
|
339
|
-
}, _ = S.Utf8 = {
|
|
340
|
-
/**
|
|
341
|
-
* Converts a word array to a UTF-8 string.
|
|
342
|
-
*
|
|
343
|
-
* @param {WordArray} wordArray The word array.
|
|
344
|
-
*
|
|
345
|
-
* @return {string} The UTF-8 string.
|
|
346
|
-
*
|
|
347
|
-
* @static
|
|
348
|
-
*
|
|
349
|
-
* @example
|
|
350
|
-
*
|
|
351
|
-
* var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
|
|
352
|
-
*/
|
|
353
|
-
stringify: function(a) {
|
|
354
|
-
try {
|
|
355
|
-
return decodeURIComponent(escape(k.stringify(a)));
|
|
356
|
-
} catch {
|
|
357
|
-
throw new Error("Malformed UTF-8 data");
|
|
358
|
-
}
|
|
359
|
-
},
|
|
360
|
-
/**
|
|
361
|
-
* Converts a UTF-8 string to a word array.
|
|
362
|
-
*
|
|
363
|
-
* @param {string} utf8Str The UTF-8 string.
|
|
364
|
-
*
|
|
365
|
-
* @return {WordArray} The word array.
|
|
366
|
-
*
|
|
367
|
-
* @static
|
|
368
|
-
*
|
|
369
|
-
* @example
|
|
370
|
-
*
|
|
371
|
-
* var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
|
|
372
|
-
*/
|
|
373
|
-
parse: function(a) {
|
|
374
|
-
return k.parse(unescape(encodeURIComponent(a)));
|
|
375
|
-
}
|
|
376
|
-
}, m = h.BufferedBlockAlgorithm = g.extend({
|
|
377
|
-
/**
|
|
378
|
-
* Resets this block algorithm's data buffer to its initial state.
|
|
379
|
-
*
|
|
380
|
-
* @example
|
|
381
|
-
*
|
|
382
|
-
* bufferedBlockAlgorithm.reset();
|
|
383
|
-
*/
|
|
384
|
-
reset: function() {
|
|
385
|
-
this._data = new u.init(), this._nDataBytes = 0;
|
|
386
|
-
},
|
|
387
|
-
/**
|
|
388
|
-
* Adds new data to this block algorithm's buffer.
|
|
389
|
-
*
|
|
390
|
-
* @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
|
|
391
|
-
*
|
|
392
|
-
* @example
|
|
393
|
-
*
|
|
394
|
-
* bufferedBlockAlgorithm._append('data');
|
|
395
|
-
* bufferedBlockAlgorithm._append(wordArray);
|
|
396
|
-
*/
|
|
397
|
-
_append: function(a) {
|
|
398
|
-
typeof a == "string" && (a = _.parse(a)), this._data.concat(a), this._nDataBytes += a.sigBytes;
|
|
399
|
-
},
|
|
400
|
-
/**
|
|
401
|
-
* Processes available data blocks.
|
|
402
|
-
*
|
|
403
|
-
* This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
|
|
404
|
-
*
|
|
405
|
-
* @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
|
|
406
|
-
*
|
|
407
|
-
* @return {WordArray} The processed data.
|
|
408
|
-
*
|
|
409
|
-
* @example
|
|
410
|
-
*
|
|
411
|
-
* var processedData = bufferedBlockAlgorithm._process();
|
|
412
|
-
* var processedData = bufferedBlockAlgorithm._process(!!'flush');
|
|
413
|
-
*/
|
|
414
|
-
_process: function(a) {
|
|
415
|
-
var d, p = this._data, v = p.words, b = p.sigBytes, E = this.blockSize, x = E * 4, C = b / x;
|
|
416
|
-
a ? C = r.ceil(C) : C = r.max((C | 0) - this._minBufferSize, 0);
|
|
417
|
-
var A = C * E, R = r.min(A * 4, b);
|
|
418
|
-
if (A) {
|
|
419
|
-
for (var q = 0; q < A; q += E)
|
|
420
|
-
this._doProcessBlock(v, q);
|
|
421
|
-
d = v.splice(0, A), p.sigBytes -= R;
|
|
440
|
+
var a = g.clone.call(this);
|
|
441
|
+
return a._data = this._data.clone(), a;
|
|
442
|
+
},
|
|
443
|
+
_minBufferSize: 0
|
|
444
|
+
});
|
|
445
|
+
h.Hasher = m.extend({
|
|
446
|
+
/**
|
|
447
|
+
* Configuration options.
|
|
448
|
+
*/
|
|
449
|
+
cfg: g.extend(),
|
|
450
|
+
/**
|
|
451
|
+
* Initializes a newly created hasher.
|
|
452
|
+
*
|
|
453
|
+
* @param {Object} cfg (Optional) The configuration options to use for this hash computation.
|
|
454
|
+
*
|
|
455
|
+
* @example
|
|
456
|
+
*
|
|
457
|
+
* var hasher = CryptoJS.algo.SHA256.create();
|
|
458
|
+
*/
|
|
459
|
+
init: function(a) {
|
|
460
|
+
this.cfg = this.cfg.extend(a), this.reset();
|
|
461
|
+
},
|
|
462
|
+
/**
|
|
463
|
+
* Resets this hasher to its initial state.
|
|
464
|
+
*
|
|
465
|
+
* @example
|
|
466
|
+
*
|
|
467
|
+
* hasher.reset();
|
|
468
|
+
*/
|
|
469
|
+
reset: function() {
|
|
470
|
+
m.reset.call(this), this._doReset();
|
|
471
|
+
},
|
|
472
|
+
/**
|
|
473
|
+
* Updates this hasher with a message.
|
|
474
|
+
*
|
|
475
|
+
* @param {WordArray|string} messageUpdate The message to append.
|
|
476
|
+
*
|
|
477
|
+
* @return {Hasher} This hasher.
|
|
478
|
+
*
|
|
479
|
+
* @example
|
|
480
|
+
*
|
|
481
|
+
* hasher.update('message');
|
|
482
|
+
* hasher.update(wordArray);
|
|
483
|
+
*/
|
|
484
|
+
update: function(a) {
|
|
485
|
+
return this._append(a), this._process(), this;
|
|
486
|
+
},
|
|
487
|
+
/**
|
|
488
|
+
* Finalizes the hash computation.
|
|
489
|
+
* Note that the finalize operation is effectively a destructive, read-once operation.
|
|
490
|
+
*
|
|
491
|
+
* @param {WordArray|string} messageUpdate (Optional) A final message update.
|
|
492
|
+
*
|
|
493
|
+
* @return {WordArray} The hash.
|
|
494
|
+
*
|
|
495
|
+
* @example
|
|
496
|
+
*
|
|
497
|
+
* var hash = hasher.finalize();
|
|
498
|
+
* var hash = hasher.finalize('message');
|
|
499
|
+
* var hash = hasher.finalize(wordArray);
|
|
500
|
+
*/
|
|
501
|
+
finalize: function(a) {
|
|
502
|
+
a && this._append(a);
|
|
503
|
+
var d = this._doFinalize();
|
|
504
|
+
return d;
|
|
505
|
+
},
|
|
506
|
+
blockSize: 16,
|
|
507
|
+
/**
|
|
508
|
+
* Creates a shortcut function to a hasher's object interface.
|
|
509
|
+
*
|
|
510
|
+
* @param {Hasher} hasher The hasher to create a helper for.
|
|
511
|
+
*
|
|
512
|
+
* @return {Function} The shortcut function.
|
|
513
|
+
*
|
|
514
|
+
* @static
|
|
515
|
+
*
|
|
516
|
+
* @example
|
|
517
|
+
*
|
|
518
|
+
* var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
|
|
519
|
+
*/
|
|
520
|
+
_createHelper: function(a) {
|
|
521
|
+
return function(d, p) {
|
|
522
|
+
return new a.init(p).finalize(d);
|
|
523
|
+
};
|
|
524
|
+
},
|
|
525
|
+
/**
|
|
526
|
+
* Creates a shortcut function to the HMAC's object interface.
|
|
527
|
+
*
|
|
528
|
+
* @param {Hasher} hasher The hasher to use in this HMAC helper.
|
|
529
|
+
*
|
|
530
|
+
* @return {Function} The shortcut function.
|
|
531
|
+
*
|
|
532
|
+
* @static
|
|
533
|
+
*
|
|
534
|
+
* @example
|
|
535
|
+
*
|
|
536
|
+
* var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
|
|
537
|
+
*/
|
|
538
|
+
_createHmacHelper: function(a) {
|
|
539
|
+
return function(d, p) {
|
|
540
|
+
return new y.HMAC.init(a, p).finalize(d);
|
|
541
|
+
};
|
|
422
542
|
}
|
|
423
|
-
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
clone: function() {
|
|
435
|
-
var a = g.clone.call(this);
|
|
436
|
-
return a._data = this._data.clone(), a;
|
|
437
|
-
},
|
|
438
|
-
_minBufferSize: 0
|
|
439
|
-
});
|
|
440
|
-
h.Hasher = m.extend({
|
|
441
|
-
/**
|
|
442
|
-
* Configuration options.
|
|
443
|
-
*/
|
|
444
|
-
cfg: g.extend(),
|
|
445
|
-
/**
|
|
446
|
-
* Initializes a newly created hasher.
|
|
447
|
-
*
|
|
448
|
-
* @param {Object} cfg (Optional) The configuration options to use for this hash computation.
|
|
449
|
-
*
|
|
450
|
-
* @example
|
|
451
|
-
*
|
|
452
|
-
* var hasher = CryptoJS.algo.SHA256.create();
|
|
453
|
-
*/
|
|
454
|
-
init: function(a) {
|
|
455
|
-
this.cfg = this.cfg.extend(a), this.reset();
|
|
456
|
-
},
|
|
457
|
-
/**
|
|
458
|
-
* Resets this hasher to its initial state.
|
|
459
|
-
*
|
|
460
|
-
* @example
|
|
461
|
-
*
|
|
462
|
-
* hasher.reset();
|
|
463
|
-
*/
|
|
464
|
-
reset: function() {
|
|
465
|
-
m.reset.call(this), this._doReset();
|
|
466
|
-
},
|
|
467
|
-
/**
|
|
468
|
-
* Updates this hasher with a message.
|
|
469
|
-
*
|
|
470
|
-
* @param {WordArray|string} messageUpdate The message to append.
|
|
471
|
-
*
|
|
472
|
-
* @return {Hasher} This hasher.
|
|
473
|
-
*
|
|
474
|
-
* @example
|
|
475
|
-
*
|
|
476
|
-
* hasher.update('message');
|
|
477
|
-
* hasher.update(wordArray);
|
|
478
|
-
*/
|
|
479
|
-
update: function(a) {
|
|
480
|
-
return this._append(a), this._process(), this;
|
|
481
|
-
},
|
|
482
|
-
/**
|
|
483
|
-
* Finalizes the hash computation.
|
|
484
|
-
* Note that the finalize operation is effectively a destructive, read-once operation.
|
|
485
|
-
*
|
|
486
|
-
* @param {WordArray|string} messageUpdate (Optional) A final message update.
|
|
487
|
-
*
|
|
488
|
-
* @return {WordArray} The hash.
|
|
489
|
-
*
|
|
490
|
-
* @example
|
|
491
|
-
*
|
|
492
|
-
* var hash = hasher.finalize();
|
|
493
|
-
* var hash = hasher.finalize('message');
|
|
494
|
-
* var hash = hasher.finalize(wordArray);
|
|
495
|
-
*/
|
|
496
|
-
finalize: function(a) {
|
|
497
|
-
a && this._append(a);
|
|
498
|
-
var d = this._doFinalize();
|
|
499
|
-
return d;
|
|
500
|
-
},
|
|
501
|
-
blockSize: 16,
|
|
502
|
-
/**
|
|
503
|
-
* Creates a shortcut function to a hasher's object interface.
|
|
504
|
-
*
|
|
505
|
-
* @param {Hasher} hasher The hasher to create a helper for.
|
|
506
|
-
*
|
|
507
|
-
* @return {Function} The shortcut function.
|
|
508
|
-
*
|
|
509
|
-
* @static
|
|
510
|
-
*
|
|
511
|
-
* @example
|
|
512
|
-
*
|
|
513
|
-
* var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
|
|
514
|
-
*/
|
|
515
|
-
_createHelper: function(a) {
|
|
516
|
-
return function(d, p) {
|
|
517
|
-
return new a.init(p).finalize(d);
|
|
518
|
-
};
|
|
519
|
-
},
|
|
520
|
-
/**
|
|
521
|
-
* Creates a shortcut function to the HMAC's object interface.
|
|
522
|
-
*
|
|
523
|
-
* @param {Hasher} hasher The hasher to use in this HMAC helper.
|
|
524
|
-
*
|
|
525
|
-
* @return {Function} The shortcut function.
|
|
526
|
-
*
|
|
527
|
-
* @static
|
|
528
|
-
*
|
|
529
|
-
* @example
|
|
530
|
-
*
|
|
531
|
-
* var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
|
|
532
|
-
*/
|
|
533
|
-
_createHmacHelper: function(a) {
|
|
534
|
-
return function(d, p) {
|
|
535
|
-
return new y.HMAC.init(a, p).finalize(d);
|
|
536
|
-
};
|
|
537
|
-
}
|
|
538
|
-
});
|
|
539
|
-
var y = l.algo = {};
|
|
540
|
-
return l;
|
|
541
|
-
}(Math);
|
|
542
|
-
return s;
|
|
543
|
-
});
|
|
544
|
-
})(Ue);
|
|
545
|
-
var Q = {}, qe = {
|
|
543
|
+
});
|
|
544
|
+
var y = l.algo = {};
|
|
545
|
+
return l;
|
|
546
|
+
}(Math);
|
|
547
|
+
return s;
|
|
548
|
+
});
|
|
549
|
+
}(Oe)), F;
|
|
550
|
+
}
|
|
551
|
+
var Me = J();
|
|
552
|
+
const He = /* @__PURE__ */ Ue(Me);
|
|
553
|
+
var X = {}, We = {
|
|
546
554
|
get exports() {
|
|
547
|
-
return
|
|
555
|
+
return X;
|
|
548
556
|
},
|
|
549
557
|
set exports(e) {
|
|
550
|
-
|
|
558
|
+
X = e;
|
|
551
559
|
}
|
|
552
560
|
};
|
|
553
561
|
(function(e, t) {
|
|
554
562
|
(function(s, r) {
|
|
555
|
-
e.exports = r(
|
|
563
|
+
e.exports = r(J());
|
|
556
564
|
})(N, function(s) {
|
|
557
565
|
return function(r) {
|
|
558
566
|
var i = s, n = i.lib, o = n.WordArray, c = n.Hasher, l = i.algo, h = [], g = [];
|
|
@@ -581,8 +589,8 @@ var Q = {}, qe = {
|
|
|
581
589
|
var C = u[x - 15], A = (C << 25 | C >>> 7) ^ (C << 14 | C >>> 18) ^ C >>> 3, R = u[x - 2], q = (R << 15 | R >>> 17) ^ (R << 13 | R >>> 19) ^ R >>> 10;
|
|
582
590
|
u[x] = A + u[x - 7] + q + u[x - 16];
|
|
583
591
|
}
|
|
584
|
-
var
|
|
585
|
-
E = b, b = v, v = p, p = d +
|
|
592
|
+
var H = p & v ^ ~p & b, K = m & y ^ m & a ^ y & a, V = (m << 30 | m >>> 2) ^ (m << 19 | m >>> 13) ^ (m << 10 | m >>> 22), G = (p << 26 | p >>> 6) ^ (p << 21 | p >>> 11) ^ (p << 7 | p >>> 25), W = E + G + H + g[x] + u[x], Re = V + K;
|
|
593
|
+
E = b, b = v, v = p, p = d + W | 0, d = a, a = y, y = m, m = W + Re | 0;
|
|
586
594
|
}
|
|
587
595
|
_[0] = _[0] + m | 0, _[1] = _[1] + y | 0, _[2] = _[2] + a | 0, _[3] = _[3] + d | 0, _[4] = _[4] + p | 0, _[5] = _[5] + v | 0, _[6] = _[6] + b | 0, _[7] = _[7] + E | 0;
|
|
588
596
|
},
|
|
@@ -598,8 +606,8 @@ var Q = {}, qe = {
|
|
|
598
606
|
i.SHA256 = c._createHelper(S), i.HmacSHA256 = c._createHmacHelper(S);
|
|
599
607
|
}(Math), s.SHA256;
|
|
600
608
|
});
|
|
601
|
-
})(
|
|
602
|
-
var $ = {},
|
|
609
|
+
})(We);
|
|
610
|
+
var $ = {}, Be = {
|
|
603
611
|
get exports() {
|
|
604
612
|
return $;
|
|
605
613
|
},
|
|
@@ -609,7 +617,7 @@ var $ = {}, Ne = {
|
|
|
609
617
|
};
|
|
610
618
|
(function(e, t) {
|
|
611
619
|
(function(s, r) {
|
|
612
|
-
e.exports = r(
|
|
620
|
+
e.exports = r(J());
|
|
613
621
|
})(N, function(s) {
|
|
614
622
|
return function() {
|
|
615
623
|
var r = s, i = r.lib, n = i.WordArray, o = r.enc;
|
|
@@ -678,35 +686,35 @@ var $ = {}, Ne = {
|
|
|
678
686
|
}
|
|
679
687
|
}(), s.enc.Base64;
|
|
680
688
|
});
|
|
681
|
-
})(
|
|
682
|
-
var
|
|
689
|
+
})(Be);
|
|
690
|
+
var Y = {}, Le = {
|
|
683
691
|
get exports() {
|
|
684
|
-
return
|
|
692
|
+
return Y;
|
|
685
693
|
},
|
|
686
694
|
set exports(e) {
|
|
687
|
-
|
|
695
|
+
Y = e;
|
|
688
696
|
}
|
|
689
697
|
};
|
|
690
698
|
(function(e, t) {
|
|
691
699
|
(function(s, r) {
|
|
692
|
-
e.exports = r(
|
|
700
|
+
e.exports = r(J());
|
|
693
701
|
})(N, function(s) {
|
|
694
702
|
return s.enc.Utf8;
|
|
695
703
|
});
|
|
696
|
-
})(
|
|
697
|
-
function
|
|
704
|
+
})(Le);
|
|
705
|
+
function Z(e) {
|
|
698
706
|
this.message = e;
|
|
699
707
|
}
|
|
700
|
-
|
|
701
|
-
var
|
|
708
|
+
Z.prototype = new Error(), Z.prototype.name = "InvalidCharacterError";
|
|
709
|
+
var de = typeof window < "u" && window.atob && window.atob.bind(window) || function(e) {
|
|
702
710
|
var t = String(e).replace(/=+$/, "");
|
|
703
711
|
if (t.length % 4 == 1)
|
|
704
|
-
throw new
|
|
712
|
+
throw new Z("'atob' failed: The string to be decoded is not correctly encoded.");
|
|
705
713
|
for (var s, r, i = 0, n = 0, o = ""; r = t.charAt(n++); ~r && (s = i % 4 ? 64 * s + r : r, i++ % 4) ? o += String.fromCharCode(255 & s >> (-2 * i & 6)) : 0)
|
|
706
714
|
r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);
|
|
707
715
|
return o;
|
|
708
716
|
};
|
|
709
|
-
function
|
|
717
|
+
function Fe(e) {
|
|
710
718
|
var t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
711
719
|
switch (t.length % 4) {
|
|
712
720
|
case 0:
|
|
@@ -722,30 +730,30 @@ function He(e) {
|
|
|
722
730
|
}
|
|
723
731
|
try {
|
|
724
732
|
return function(s) {
|
|
725
|
-
return decodeURIComponent(
|
|
733
|
+
return decodeURIComponent(de(s).replace(/(.)/g, function(r, i) {
|
|
726
734
|
var n = i.charCodeAt(0).toString(16).toUpperCase();
|
|
727
735
|
return n.length < 2 && (n = "0" + n), "%" + n;
|
|
728
736
|
}));
|
|
729
737
|
}(t);
|
|
730
738
|
} catch {
|
|
731
|
-
return
|
|
739
|
+
return de(t);
|
|
732
740
|
}
|
|
733
741
|
}
|
|
734
742
|
function z(e) {
|
|
735
743
|
this.message = e;
|
|
736
744
|
}
|
|
737
|
-
function
|
|
745
|
+
function $e(e, t) {
|
|
738
746
|
if (typeof e != "string")
|
|
739
747
|
throw new z("Invalid token specified");
|
|
740
748
|
var s = (t = t || {}).header === !0 ? 0 : 1;
|
|
741
749
|
try {
|
|
742
|
-
return JSON.parse(
|
|
750
|
+
return JSON.parse(Fe(e.split(".")[s]));
|
|
743
751
|
} catch (r) {
|
|
744
752
|
throw new z("Invalid token specified: " + r.message);
|
|
745
753
|
}
|
|
746
754
|
}
|
|
747
755
|
z.prototype = new Error(), z.prototype.name = "InvalidTokenError";
|
|
748
|
-
var
|
|
756
|
+
var ze = {
|
|
749
757
|
debug: () => {
|
|
750
758
|
},
|
|
751
759
|
info: () => {
|
|
@@ -757,7 +765,7 @@ var We = {
|
|
|
757
765
|
}, I, U, D = /* @__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))(D || {});
|
|
758
766
|
((e) => {
|
|
759
767
|
function t() {
|
|
760
|
-
I = 3, U =
|
|
768
|
+
I = 3, U = ze;
|
|
761
769
|
}
|
|
762
770
|
e.reset = t;
|
|
763
771
|
function s(i) {
|
|
@@ -817,15 +825,15 @@ var f = class {
|
|
|
817
825
|
}
|
|
818
826
|
};
|
|
819
827
|
D.reset();
|
|
820
|
-
var
|
|
828
|
+
var De = "10000000-1000-4000-8000-100000000000", P = class {
|
|
821
829
|
static _randomWord() {
|
|
822
|
-
return
|
|
830
|
+
return He.lib.WordArray.random(1).words[0];
|
|
823
831
|
}
|
|
824
832
|
/**
|
|
825
833
|
* Generates RFC4122 version 4 guid
|
|
826
834
|
*/
|
|
827
835
|
static generateUUIDv4() {
|
|
828
|
-
return
|
|
836
|
+
return De.replace(
|
|
829
837
|
/[018]/g,
|
|
830
838
|
(t) => (+t ^ P._randomWord() & 15 >> +t / 4).toString(16)
|
|
831
839
|
).replace(/-/g, "");
|
|
@@ -841,7 +849,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
841
849
|
*/
|
|
842
850
|
static generateCodeChallenge(e) {
|
|
843
851
|
try {
|
|
844
|
-
const t =
|
|
852
|
+
const t = X(e);
|
|
845
853
|
return $.stringify(t).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
846
854
|
} catch (t) {
|
|
847
855
|
throw f.error("CryptoUtils.generateCodeChallenge", t), t;
|
|
@@ -851,7 +859,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
851
859
|
* Generates a base64-encoded string for a basic auth header
|
|
852
860
|
*/
|
|
853
861
|
static generateBasicAuth(e, t) {
|
|
854
|
-
const s =
|
|
862
|
+
const s = Y.parse([e, t].join(":"));
|
|
855
863
|
return $.stringify(s);
|
|
856
864
|
}
|
|
857
865
|
}, O = class {
|
|
@@ -870,16 +878,16 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
870
878
|
for (const t of this._callbacks)
|
|
871
879
|
t(...e);
|
|
872
880
|
}
|
|
873
|
-
},
|
|
881
|
+
}, ee = class {
|
|
874
882
|
// IMPORTANT: doesn't validate the token
|
|
875
883
|
static decode(e) {
|
|
876
884
|
try {
|
|
877
|
-
return
|
|
885
|
+
return $e(e);
|
|
878
886
|
} catch (t) {
|
|
879
887
|
throw f.error("JwtUtils.decode", t), t;
|
|
880
888
|
}
|
|
881
889
|
}
|
|
882
|
-
},
|
|
890
|
+
}, he = class {
|
|
883
891
|
/**
|
|
884
892
|
* Populates a map of window features with a placement centered in front of
|
|
885
893
|
* the current window. If no explicit width is given, a default value is
|
|
@@ -921,7 +929,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
921
929
|
cancel() {
|
|
922
930
|
this._logger.create("cancel"), this._timerHandle && (clearInterval(this._timerHandle), this._timerHandle = null);
|
|
923
931
|
}
|
|
924
|
-
},
|
|
932
|
+
}, te = class {
|
|
925
933
|
static readParams(e, t = "query") {
|
|
926
934
|
if (!e)
|
|
927
935
|
throw new TypeError("Invalid URL");
|
|
@@ -935,11 +943,11 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
935
943
|
throw f.error("ErrorResponse", "No error passed"), new Error("No error passed");
|
|
936
944
|
this.error = e.error, this.error_description = (s = e.error_description) != null ? s : null, this.error_uri = (r = e.error_uri) != null ? r : null, this.state = e.userState, this.session_state = (i = e.session_state) != null ? i : null;
|
|
937
945
|
}
|
|
938
|
-
},
|
|
946
|
+
}, ie = class extends Error {
|
|
939
947
|
constructor(e) {
|
|
940
948
|
super(e), this.name = "ErrorTimeout";
|
|
941
949
|
}
|
|
942
|
-
},
|
|
950
|
+
}, Je = class {
|
|
943
951
|
constructor(e) {
|
|
944
952
|
this._logger = new f("AccessTokenEvents"), this._expiringTimer = new T("Access token expiring"), this._expiredTimer = new T("Access token expired"), this._expiringNotificationTimeInSeconds = e.expiringNotificationTimeInSeconds;
|
|
945
953
|
}
|
|
@@ -984,7 +992,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
984
992
|
removeAccessTokenExpired(e) {
|
|
985
993
|
this._expiredTimer.removeHandler(e);
|
|
986
994
|
}
|
|
987
|
-
},
|
|
995
|
+
}, Ke = class {
|
|
988
996
|
constructor(e, t, s, r, i) {
|
|
989
997
|
this._callback = e, this._client_id = t, this._intervalInSeconds = r, this._stopOnError = i, this._logger = new f("CheckSessionIFrame"), this._timer = null, this._session_state = null, this._message = (o) => {
|
|
990
998
|
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"));
|
|
@@ -1011,7 +1019,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1011
1019
|
stop() {
|
|
1012
1020
|
this._logger.create("stop"), this._session_state = null, this._timer && (clearInterval(this._timer), this._timer = null);
|
|
1013
1021
|
}
|
|
1014
|
-
},
|
|
1022
|
+
}, ve = class {
|
|
1015
1023
|
constructor() {
|
|
1016
1024
|
this._logger = new f("InMemoryWebStorage"), this._data = {};
|
|
1017
1025
|
}
|
|
@@ -1033,7 +1041,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1033
1041
|
key(e) {
|
|
1034
1042
|
return Object.getOwnPropertyNames(this._data)[e];
|
|
1035
1043
|
}
|
|
1036
|
-
},
|
|
1044
|
+
}, ne = class {
|
|
1037
1045
|
constructor(e = [], t = null) {
|
|
1038
1046
|
this._jwtHandler = t, this._logger = new f("JsonService"), this._contentTypes = [], this._contentTypes.push(...e, "application/json"), t && this._contentTypes.push("application/jwt");
|
|
1039
1047
|
}
|
|
@@ -1048,7 +1056,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1048
1056
|
signal: i.signal
|
|
1049
1057
|
});
|
|
1050
1058
|
} catch (o) {
|
|
1051
|
-
throw o instanceof DOMException && o.name === "AbortError" ? new
|
|
1059
|
+
throw o instanceof DOMException && o.name === "AbortError" ? new ie("Network timed out") : o;
|
|
1052
1060
|
} finally {
|
|
1053
1061
|
clearTimeout(n);
|
|
1054
1062
|
}
|
|
@@ -1114,9 +1122,9 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1114
1122
|
throw n.error("Error from server:", g), g.error ? new j(g, t) : new Error(`${c.statusText} (${c.status}): ${JSON.stringify(g)}`);
|
|
1115
1123
|
return g;
|
|
1116
1124
|
}
|
|
1117
|
-
},
|
|
1125
|
+
}, Ve = class {
|
|
1118
1126
|
constructor(e) {
|
|
1119
|
-
this._settings = e, this._logger = new f("MetadataService"), this._jsonService = new
|
|
1127
|
+
this._settings = e, this._logger = new f("MetadataService"), this._jsonService = new ne(["application/jwk-set+json"]), this._signingKeys = null, this._metadata = null, this._metadataUrl = this._settings.metadataUrl, this._settings.signingKeys && (this._logger.debug("using signingKeys from settings"), this._signingKeys = this._settings.signingKeys), this._settings.metadata && (this._logger.debug("using metadata from settings"), this._metadata = this._settings.metadata), this._settings.fetchRequestCredentials && (this._logger.debug("using fetchRequestCredentials from settings"), this._fetchRequestCredentials = this._settings.fetchRequestCredentials);
|
|
1120
1128
|
}
|
|
1121
1129
|
resetSigningKeys() {
|
|
1122
1130
|
this._signingKeys = null;
|
|
@@ -1177,7 +1185,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1177
1185
|
throw e.throw(new Error("Missing keys on keyset")), null;
|
|
1178
1186
|
return this._signingKeys = s.keys, this._signingKeys;
|
|
1179
1187
|
}
|
|
1180
|
-
},
|
|
1188
|
+
}, me = class {
|
|
1181
1189
|
constructor({
|
|
1182
1190
|
prefix: e = "oidc.",
|
|
1183
1191
|
store: t = localStorage
|
|
@@ -1204,7 +1212,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1204
1212
|
}
|
|
1205
1213
|
return t;
|
|
1206
1214
|
}
|
|
1207
|
-
},
|
|
1215
|
+
}, Ge = "code", Qe = "openid", Xe = "client_secret_post", Ye = "query", Ze = 60 * 15, et = 60 * 5, Se = class {
|
|
1208
1216
|
constructor({
|
|
1209
1217
|
// metadata related
|
|
1210
1218
|
authority: e,
|
|
@@ -1215,11 +1223,11 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1215
1223
|
// client related
|
|
1216
1224
|
client_id: n,
|
|
1217
1225
|
client_secret: o,
|
|
1218
|
-
response_type: c =
|
|
1219
|
-
scope: l =
|
|
1226
|
+
response_type: c = Ge,
|
|
1227
|
+
scope: l = Qe,
|
|
1220
1228
|
redirect_uri: h,
|
|
1221
1229
|
post_logout_redirect_uri: g,
|
|
1222
|
-
client_authentication: u =
|
|
1230
|
+
client_authentication: u = Xe,
|
|
1223
1231
|
// optional protocol
|
|
1224
1232
|
prompt: S,
|
|
1225
1233
|
display: w,
|
|
@@ -1227,12 +1235,12 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1227
1235
|
ui_locales: _,
|
|
1228
1236
|
acr_values: m,
|
|
1229
1237
|
resource: y,
|
|
1230
|
-
response_mode: a =
|
|
1238
|
+
response_mode: a = Ye,
|
|
1231
1239
|
// behavior flags
|
|
1232
1240
|
filterProtocolClaims: d = !0,
|
|
1233
1241
|
loadUserInfo: p = !1,
|
|
1234
|
-
staleStateAgeInSeconds: v =
|
|
1235
|
-
clockSkewInSeconds: b =
|
|
1242
|
+
staleStateAgeInSeconds: v = Ze,
|
|
1243
|
+
clockSkewInSeconds: b = et,
|
|
1236
1244
|
userInfoJwtIssuer: E = "OP",
|
|
1237
1245
|
mergeClaims: x = !1,
|
|
1238
1246
|
disablePKCE: C = !1,
|
|
@@ -1240,31 +1248,31 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1240
1248
|
stateStore: A,
|
|
1241
1249
|
refreshTokenCredentials: R,
|
|
1242
1250
|
revokeTokenAdditionalContentTypes: q,
|
|
1243
|
-
fetchRequestCredentials:
|
|
1244
|
-
refreshTokenAllowedScope:
|
|
1251
|
+
fetchRequestCredentials: H,
|
|
1252
|
+
refreshTokenAllowedScope: K,
|
|
1245
1253
|
// extra query params
|
|
1246
|
-
extraQueryParams:
|
|
1247
|
-
extraTokenParams:
|
|
1254
|
+
extraQueryParams: V = {},
|
|
1255
|
+
extraTokenParams: G = {}
|
|
1248
1256
|
}) {
|
|
1249
|
-
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 = i, this.signingKeys = r, this.client_id = n, this.client_secret = o, this.response_type = c, this.scope = l, this.redirect_uri = h, this.post_logout_redirect_uri = g, this.client_authentication = u, this.prompt = S, this.display = w, this.max_age = k, this.ui_locales = _, this.acr_values = m, this.resource = y, this.response_mode = a, this.filterProtocolClaims = d ?? !0, this.loadUserInfo = !!p, this.staleStateAgeInSeconds = v, this.clockSkewInSeconds = b, this.userInfoJwtIssuer = E, this.mergeClaims = !!x, this.disablePKCE = !!C, this.revokeTokenAdditionalContentTypes = q,
|
|
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 = i, this.signingKeys = r, this.client_id = n, this.client_secret = o, this.response_type = c, this.scope = l, this.redirect_uri = h, this.post_logout_redirect_uri = g, this.client_authentication = u, this.prompt = S, this.display = w, this.max_age = k, this.ui_locales = _, this.acr_values = m, this.resource = y, this.response_mode = a, this.filterProtocolClaims = d ?? !0, this.loadUserInfo = !!p, this.staleStateAgeInSeconds = v, this.clockSkewInSeconds = b, this.userInfoJwtIssuer = E, this.mergeClaims = !!x, this.disablePKCE = !!C, this.revokeTokenAdditionalContentTypes = q, H && R && console.warn("Both fetchRequestCredentials and refreshTokenCredentials is set. Only fetchRequestCredentials will be used."), this.fetchRequestCredentials = H || R || "same-origin", A)
|
|
1250
1258
|
this.stateStore = A;
|
|
1251
1259
|
else {
|
|
1252
|
-
const
|
|
1253
|
-
this.stateStore = new
|
|
1260
|
+
const W = typeof window < "u" ? window.localStorage : new ve();
|
|
1261
|
+
this.stateStore = new me({ store: W });
|
|
1254
1262
|
}
|
|
1255
|
-
this.refreshTokenAllowedScope =
|
|
1263
|
+
this.refreshTokenAllowedScope = K, this.extraQueryParams = V, this.extraTokenParams = G;
|
|
1256
1264
|
}
|
|
1257
|
-
},
|
|
1265
|
+
}, tt = class {
|
|
1258
1266
|
constructor(e, t) {
|
|
1259
1267
|
this._settings = e, this._metadataService = t, this._logger = new f("UserInfoService"), this._getClaimsFromJwt = async (s) => {
|
|
1260
1268
|
const r = this._logger.create("_getClaimsFromJwt");
|
|
1261
1269
|
try {
|
|
1262
|
-
const i =
|
|
1270
|
+
const i = ee.decode(s);
|
|
1263
1271
|
return r.debug("JWT decoding successful"), i;
|
|
1264
1272
|
} catch (i) {
|
|
1265
1273
|
throw r.error("Error parsing JWT response"), i;
|
|
1266
1274
|
}
|
|
1267
|
-
}, this._jsonService = new
|
|
1275
|
+
}, this._jsonService = new ne(void 0, this._getClaimsFromJwt);
|
|
1268
1276
|
}
|
|
1269
1277
|
async getClaims(e) {
|
|
1270
1278
|
const t = this._logger.create("getClaims");
|
|
@@ -1277,9 +1285,9 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1277
1285
|
});
|
|
1278
1286
|
return t.debug("got claims", r), r;
|
|
1279
1287
|
}
|
|
1280
|
-
},
|
|
1288
|
+
}, ye = class {
|
|
1281
1289
|
constructor(e, t) {
|
|
1282
|
-
this._settings = e, this._metadataService = t, this._logger = new f("TokenClient"), this._jsonService = new
|
|
1290
|
+
this._settings = e, this._metadataService = t, this._logger = new f("TokenClient"), this._jsonService = new ne(this._settings.revokeTokenAdditionalContentTypes);
|
|
1283
1291
|
}
|
|
1284
1292
|
async exchangeCode({
|
|
1285
1293
|
grant_type: e = "authorization_code",
|
|
@@ -1381,7 +1389,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1381
1389
|
o != null && i.set(n, o);
|
|
1382
1390
|
i.set("client_id", this._settings.client_id), this._settings.client_secret && i.set("client_secret", this._settings.client_secret), await this._jsonService.postForm(r, { body: i }), s.debug("got response");
|
|
1383
1391
|
}
|
|
1384
|
-
},
|
|
1392
|
+
}, st = [
|
|
1385
1393
|
"nbf",
|
|
1386
1394
|
"jti",
|
|
1387
1395
|
"auth_time",
|
|
@@ -1391,9 +1399,9 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1391
1399
|
"azp",
|
|
1392
1400
|
"at_hash"
|
|
1393
1401
|
// https://openid.net/specs/openid-connect-core-1_0.html#CodeIDToken
|
|
1394
|
-
],
|
|
1402
|
+
], rt = ["sub", "iss", "aud", "exp", "iat"], it = class {
|
|
1395
1403
|
constructor(e, t) {
|
|
1396
|
-
this._settings = e, this._metadataService = t, this._logger = new f("ResponseValidator"), this._userInfoService = new
|
|
1404
|
+
this._settings = e, this._metadataService = t, this._logger = new f("ResponseValidator"), this._userInfoService = new tt(this._settings, this._metadataService), this._tokenClient = new ye(this._settings, this._metadataService);
|
|
1397
1405
|
}
|
|
1398
1406
|
async validateSigninResponse(e, t) {
|
|
1399
1407
|
const s = this._logger.create("validateSigninResponse");
|
|
@@ -1445,9 +1453,9 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1445
1453
|
const t = { ...e };
|
|
1446
1454
|
if (this._settings.filterProtocolClaims) {
|
|
1447
1455
|
let s;
|
|
1448
|
-
Array.isArray(this._settings.filterProtocolClaims) ? s = this._settings.filterProtocolClaims : s =
|
|
1456
|
+
Array.isArray(this._settings.filterProtocolClaims) ? s = this._settings.filterProtocolClaims : s = st;
|
|
1449
1457
|
for (const r of s)
|
|
1450
|
-
|
|
1458
|
+
rt.includes(r) || delete t[r];
|
|
1451
1459
|
}
|
|
1452
1460
|
return t;
|
|
1453
1461
|
}
|
|
@@ -1471,9 +1479,9 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1471
1479
|
var s;
|
|
1472
1480
|
const r = this._logger.create("_validateIdTokenAttributes");
|
|
1473
1481
|
r.debug("decoding ID Token JWT");
|
|
1474
|
-
const i =
|
|
1482
|
+
const i = ee.decode((s = e.id_token) != null ? s : "");
|
|
1475
1483
|
if (i.sub || r.throw(new Error("ID Token is missing a subject claim")), t) {
|
|
1476
|
-
const n =
|
|
1484
|
+
const n = ee.decode(t);
|
|
1477
1485
|
n.sub !== i.sub && r.throw(new Error("sub in id_token does not match current sub")), n.auth_time && n.auth_time !== i.auth_time && r.throw(new Error("auth_time in id_token does not match original auth_time")), n.azp && n.azp !== i.azp && r.throw(new Error("azp in id_token does not match original azp")), !n.azp && i.azp && r.throw(new Error("azp not in id_token, but present in original id_token"));
|
|
1478
1486
|
}
|
|
1479
1487
|
e.profile = i;
|
|
@@ -1511,7 +1519,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1511
1519
|
l && (s.debug("removed item for key:", o), e.remove(o));
|
|
1512
1520
|
}
|
|
1513
1521
|
}
|
|
1514
|
-
},
|
|
1522
|
+
}, oe = class extends M {
|
|
1515
1523
|
constructor(e) {
|
|
1516
1524
|
super(e), e.code_verifier === !0 ? this.code_verifier = P.generateCodeVerifier() : e.code_verifier && (this.code_verifier = e.code_verifier), this.code_verifier && (this.code_challenge = P.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;
|
|
1517
1525
|
}
|
|
@@ -1535,9 +1543,9 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1535
1543
|
static fromStorageString(e) {
|
|
1536
1544
|
f.createStatic("SigninState", "fromStorageString");
|
|
1537
1545
|
const t = JSON.parse(e);
|
|
1538
|
-
return new
|
|
1546
|
+
return new oe(t);
|
|
1539
1547
|
}
|
|
1540
|
-
},
|
|
1548
|
+
}, nt = class {
|
|
1541
1549
|
constructor({
|
|
1542
1550
|
// mandatory
|
|
1543
1551
|
url: e,
|
|
@@ -1571,7 +1579,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1571
1579
|
throw this._logger.error("ctor: No scope passed"), new Error("scope");
|
|
1572
1580
|
if (!t)
|
|
1573
1581
|
throw this._logger.error("ctor: No authority passed"), new Error("authority");
|
|
1574
|
-
this.state = new
|
|
1582
|
+
this.state = new oe({
|
|
1575
1583
|
data: o,
|
|
1576
1584
|
request_type: l,
|
|
1577
1585
|
code_verifier: !_,
|
|
@@ -1590,7 +1598,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1590
1598
|
d != null && y.searchParams.append(a, d.toString());
|
|
1591
1599
|
this.url = y.href;
|
|
1592
1600
|
}
|
|
1593
|
-
},
|
|
1601
|
+
}, ot = "openid", Q = class {
|
|
1594
1602
|
constructor(e) {
|
|
1595
1603
|
this.access_token = "", this.token_type = "", this.profile = {}, this.state = e.get("state"), this.session_state = e.get("session_state"), this.error = e.get("error"), this.error_description = e.get("error_description"), this.error_uri = e.get("error_uri"), this.code = e.get("code");
|
|
1596
1604
|
}
|
|
@@ -1603,9 +1611,9 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1603
1611
|
}
|
|
1604
1612
|
get isOpenId() {
|
|
1605
1613
|
var e;
|
|
1606
|
-
return ((e = this.scope) == null ? void 0 : e.split(" ").includes(
|
|
1614
|
+
return ((e = this.scope) == null ? void 0 : e.split(" ").includes(ot)) || !!this.id_token;
|
|
1607
1615
|
}
|
|
1608
|
-
},
|
|
1616
|
+
}, at = class {
|
|
1609
1617
|
constructor({
|
|
1610
1618
|
url: e,
|
|
1611
1619
|
state_data: t,
|
|
@@ -1622,13 +1630,13 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1622
1630
|
l != null && o.searchParams.append(c, l.toString());
|
|
1623
1631
|
this.url = o.href;
|
|
1624
1632
|
}
|
|
1625
|
-
},
|
|
1633
|
+
}, ct = class {
|
|
1626
1634
|
constructor(e) {
|
|
1627
1635
|
this.state = e.get("state"), this.error = e.get("error"), this.error_description = e.get("error_description"), this.error_uri = e.get("error_uri");
|
|
1628
1636
|
}
|
|
1629
|
-
},
|
|
1637
|
+
}, lt = class {
|
|
1630
1638
|
constructor(e) {
|
|
1631
|
-
this._logger = new f("OidcClient"), this.settings = new
|
|
1639
|
+
this._logger = new f("OidcClient"), this.settings = new Se(e), this.metadataService = new Ve(this.settings), this._validator = new it(this.settings, this.metadataService), this._tokenClient = new ye(this.settings, this.metadataService);
|
|
1632
1640
|
}
|
|
1633
1641
|
async createSigninRequest({
|
|
1634
1642
|
state: e,
|
|
@@ -1657,7 +1665,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1657
1665
|
throw new Error("Only the Authorization Code flow (with PKCE) is supported");
|
|
1658
1666
|
const v = await this.metadataService.getAuthorizationEndpoint();
|
|
1659
1667
|
p.debug("Received authorization endpoint", v);
|
|
1660
|
-
const b = new
|
|
1668
|
+
const b = new nt({
|
|
1661
1669
|
url: v,
|
|
1662
1670
|
authority: this.settings.authority,
|
|
1663
1671
|
client_id: this.settings.client_id,
|
|
@@ -1689,13 +1697,13 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1689
1697
|
return await this.settings.stateStore.set(E.id, E.toStorageString()), b;
|
|
1690
1698
|
}
|
|
1691
1699
|
async readSigninResponseState(e, t = !1) {
|
|
1692
|
-
const s = this._logger.create("readSigninResponseState"), r = new
|
|
1700
|
+
const s = this._logger.create("readSigninResponseState"), r = new Q(te.readParams(e, this.settings.response_mode));
|
|
1693
1701
|
if (!r.state)
|
|
1694
1702
|
throw s.throw(new Error("No state in response")), null;
|
|
1695
1703
|
const i = await this.settings.stateStore[t ? "remove" : "get"](r.state);
|
|
1696
1704
|
if (!i)
|
|
1697
1705
|
throw s.throw(new Error("No matching state found in storage")), null;
|
|
1698
|
-
return { state:
|
|
1706
|
+
return { state: oe.fromStorageString(i), response: r };
|
|
1699
1707
|
}
|
|
1700
1708
|
async processSigninResponse(e) {
|
|
1701
1709
|
const t = this._logger.create("processSigninResponse"), { state: s, response: r } = await this.readSigninResponseState(e, !0);
|
|
@@ -1707,7 +1715,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1707
1715
|
skipUserInfo: s = !1,
|
|
1708
1716
|
extraTokenParams: r = {}
|
|
1709
1717
|
}) {
|
|
1710
|
-
const i = await this._tokenClient.exchangeCredentials({ username: e, password: t, ...r }), n = new
|
|
1718
|
+
const i = await this._tokenClient.exchangeCredentials({ username: e, password: t, ...r }), n = new Q(new URLSearchParams());
|
|
1711
1719
|
return Object.assign(n, i), await this._validator.validateCredentialsResponse(n, s), n;
|
|
1712
1720
|
}
|
|
1713
1721
|
async useRefreshToken({
|
|
@@ -1728,7 +1736,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1728
1736
|
// provide the (possible filtered) scope list
|
|
1729
1737
|
scope: i,
|
|
1730
1738
|
timeoutInSeconds: t
|
|
1731
|
-
}), o = new
|
|
1739
|
+
}), o = new Q(new URLSearchParams());
|
|
1732
1740
|
return Object.assign(o, n), r.debug("validating response", o), await this._validator.validateRefreshResponse(o, {
|
|
1733
1741
|
...e,
|
|
1734
1742
|
// overide the scope in the state handed over to the validator
|
|
@@ -1747,7 +1755,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1747
1755
|
if (!o)
|
|
1748
1756
|
throw n.throw(new Error("No end session endpoint")), null;
|
|
1749
1757
|
n.debug("Received end session endpoint", o);
|
|
1750
|
-
const c = new
|
|
1758
|
+
const c = new at({
|
|
1751
1759
|
url: o,
|
|
1752
1760
|
id_token_hint: t,
|
|
1753
1761
|
post_logout_redirect_uri: r,
|
|
@@ -1760,7 +1768,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1760
1768
|
return l && (n.debug("Signout request has state to persist"), await this.settings.stateStore.set(l.id, l.toStorageString())), c;
|
|
1761
1769
|
}
|
|
1762
1770
|
async readSignoutResponseState(e, t = !1) {
|
|
1763
|
-
const s = this._logger.create("readSignoutResponseState"), r = new
|
|
1771
|
+
const s = this._logger.create("readSignoutResponseState"), r = new ct(te.readParams(e, this.settings.response_mode));
|
|
1764
1772
|
if (!r.state) {
|
|
1765
1773
|
if (s.debug("No state in response"), r.error)
|
|
1766
1774
|
throw s.warn("Response was error:", r.error), new j(r);
|
|
@@ -1784,7 +1792,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1784
1792
|
token_type_hint: t
|
|
1785
1793
|
});
|
|
1786
1794
|
}
|
|
1787
|
-
},
|
|
1795
|
+
}, dt = class {
|
|
1788
1796
|
constructor(e) {
|
|
1789
1797
|
this._userManager = e, this._logger = new f("SessionMonitor"), this._start = async (t) => {
|
|
1790
1798
|
const s = t.session_state;
|
|
@@ -1799,7 +1807,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1799
1807
|
const i = await this._userManager.metadataService.getCheckSessionIframe();
|
|
1800
1808
|
if (i) {
|
|
1801
1809
|
r.debug("initializing check session iframe");
|
|
1802
|
-
const n = this._userManager.settings.client_id, o = this._userManager.settings.checkSessionIntervalInSeconds, c = this._userManager.settings.stopCheckSessionOnError, l = new
|
|
1810
|
+
const n = this._userManager.settings.client_id, o = this._userManager.settings.checkSessionIntervalInSeconds, c = this._userManager.settings.stopCheckSessionOnError, l = new Ke(this._callback, n, i, o, c);
|
|
1803
1811
|
await l.load(), this._checkSessionIFrame = l, l.start(s);
|
|
1804
1812
|
} else
|
|
1805
1813
|
r.warn("no check session iframe found in the metadata");
|
|
@@ -1860,7 +1868,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1860
1868
|
}
|
|
1861
1869
|
}
|
|
1862
1870
|
}
|
|
1863
|
-
},
|
|
1871
|
+
}, B = class {
|
|
1864
1872
|
constructor(e) {
|
|
1865
1873
|
var t;
|
|
1866
1874
|
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;
|
|
@@ -1897,9 +1905,9 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1897
1905
|
});
|
|
1898
1906
|
}
|
|
1899
1907
|
static fromStorageString(e) {
|
|
1900
|
-
return f.createStatic("User", "fromStorageString"), new
|
|
1908
|
+
return f.createStatic("User", "fromStorageString"), new B(JSON.parse(e));
|
|
1901
1909
|
}
|
|
1902
|
-
},
|
|
1910
|
+
}, ue = "oidc-client", be = class {
|
|
1903
1911
|
constructor() {
|
|
1904
1912
|
this._abort = new O("Window navigation aborted"), this._disposeHandlers = /* @__PURE__ */ new Set(), this._window = null;
|
|
1905
1913
|
}
|
|
@@ -1912,9 +1920,9 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1912
1920
|
const o = (c) => {
|
|
1913
1921
|
var l;
|
|
1914
1922
|
const h = c.data, g = (l = e.scriptOrigin) != null ? l : window.location.origin;
|
|
1915
|
-
if (!(c.origin !== g || (h == null ? void 0 : h.source) !==
|
|
1923
|
+
if (!(c.origin !== g || (h == null ? void 0 : h.source) !== ue)) {
|
|
1916
1924
|
try {
|
|
1917
|
-
const u =
|
|
1925
|
+
const u = te.readParams(h.url, e.response_mode).get("state");
|
|
1918
1926
|
if (u || t.warn("no state found in response url"), c.source !== this._window && u !== e.state)
|
|
1919
1927
|
return;
|
|
1920
1928
|
} catch {
|
|
@@ -1937,54 +1945,54 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1937
1945
|
}
|
|
1938
1946
|
static _notifyParent(e, t, s = !1, r = window.location.origin) {
|
|
1939
1947
|
e.postMessage({
|
|
1940
|
-
source:
|
|
1948
|
+
source: ue,
|
|
1941
1949
|
url: t,
|
|
1942
1950
|
keepOpen: s
|
|
1943
1951
|
}, r);
|
|
1944
1952
|
}
|
|
1945
|
-
},
|
|
1953
|
+
}, ke = {
|
|
1946
1954
|
location: !1,
|
|
1947
1955
|
toolbar: !1,
|
|
1948
1956
|
height: 640
|
|
1949
|
-
},
|
|
1957
|
+
}, Ee = "_blank", ht = 60, ut = 2, xe = 10, gt = class extends Se {
|
|
1950
1958
|
constructor(e) {
|
|
1951
1959
|
const {
|
|
1952
1960
|
popup_redirect_uri: t = e.redirect_uri,
|
|
1953
1961
|
popup_post_logout_redirect_uri: s = e.post_logout_redirect_uri,
|
|
1954
|
-
popupWindowFeatures: r =
|
|
1955
|
-
popupWindowTarget: i =
|
|
1962
|
+
popupWindowFeatures: r = ke,
|
|
1963
|
+
popupWindowTarget: i = Ee,
|
|
1956
1964
|
redirectMethod: n = "assign",
|
|
1957
1965
|
redirectTarget: o = "self",
|
|
1958
1966
|
iframeNotifyParentOrigin: c = e.iframeNotifyParentOrigin,
|
|
1959
1967
|
iframeScriptOrigin: l = e.iframeScriptOrigin,
|
|
1960
1968
|
silent_redirect_uri: h = e.redirect_uri,
|
|
1961
|
-
silentRequestTimeoutInSeconds: g =
|
|
1969
|
+
silentRequestTimeoutInSeconds: g = xe,
|
|
1962
1970
|
automaticSilentRenew: u = !0,
|
|
1963
1971
|
validateSubOnSilentRenew: S = !0,
|
|
1964
1972
|
includeIdTokenInSilentRenew: w = !1,
|
|
1965
1973
|
monitorSession: k = !1,
|
|
1966
1974
|
monitorAnonymousSession: _ = !1,
|
|
1967
|
-
checkSessionIntervalInSeconds: m =
|
|
1975
|
+
checkSessionIntervalInSeconds: m = ut,
|
|
1968
1976
|
query_status_response_type: y = "code",
|
|
1969
1977
|
stopCheckSessionOnError: a = !0,
|
|
1970
1978
|
revokeTokenTypes: d = ["access_token", "refresh_token"],
|
|
1971
1979
|
revokeTokensOnSignout: p = !1,
|
|
1972
1980
|
includeIdTokenInSilentSignout: v = !1,
|
|
1973
|
-
accessTokenExpiringNotificationTimeInSeconds: b =
|
|
1981
|
+
accessTokenExpiringNotificationTimeInSeconds: b = ht,
|
|
1974
1982
|
userStore: E
|
|
1975
1983
|
} = e;
|
|
1976
1984
|
if (super(e), this.popup_redirect_uri = t, this.popup_post_logout_redirect_uri = s, this.popupWindowFeatures = r, this.popupWindowTarget = i, this.redirectMethod = n, this.redirectTarget = o, this.iframeNotifyParentOrigin = c, this.iframeScriptOrigin = l, this.silent_redirect_uri = h, this.silentRequestTimeoutInSeconds = g, this.automaticSilentRenew = u, this.validateSubOnSilentRenew = S, this.includeIdTokenInSilentRenew = w, this.monitorSession = k, this.monitorAnonymousSession = _, this.checkSessionIntervalInSeconds = m, this.stopCheckSessionOnError = a, this.query_status_response_type = y, this.revokeTokenTypes = d, this.revokeTokensOnSignout = p, this.includeIdTokenInSilentSignout = v, this.accessTokenExpiringNotificationTimeInSeconds = b, E)
|
|
1977
1985
|
this.userStore = E;
|
|
1978
1986
|
else {
|
|
1979
|
-
const x = typeof window < "u" ? window.sessionStorage : new
|
|
1980
|
-
this.userStore = new
|
|
1987
|
+
const x = typeof window < "u" ? window.sessionStorage : new ve();
|
|
1988
|
+
this.userStore = new me({ store: x });
|
|
1981
1989
|
}
|
|
1982
1990
|
}
|
|
1983
|
-
},
|
|
1991
|
+
}, se = class extends be {
|
|
1984
1992
|
constructor({
|
|
1985
|
-
silentRequestTimeoutInSeconds: e =
|
|
1993
|
+
silentRequestTimeoutInSeconds: e = xe
|
|
1986
1994
|
}) {
|
|
1987
|
-
super(), this._logger = new f("IFrameWindow"), this._timeoutInSeconds = e, this._frame =
|
|
1995
|
+
super(), this._logger = new f("IFrameWindow"), this._timeoutInSeconds = e, this._frame = se.createHiddenIframe(), this._window = this._frame.contentWindow;
|
|
1988
1996
|
}
|
|
1989
1997
|
static createHiddenIframe() {
|
|
1990
1998
|
const e = window.document.createElement("iframe");
|
|
@@ -1992,7 +2000,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
1992
2000
|
}
|
|
1993
2001
|
async navigate(e) {
|
|
1994
2002
|
this._logger.debug("navigate: Using timeout of:", this._timeoutInSeconds);
|
|
1995
|
-
const t = setTimeout(() => this._abort.raise(new
|
|
2003
|
+
const t = setTimeout(() => this._abort.raise(new ie("IFrame timed out without a response")), this._timeoutInSeconds * 1e3);
|
|
1996
2004
|
return this._disposeHandlers.add(() => clearTimeout(t)), await super.navigate(e);
|
|
1997
2005
|
}
|
|
1998
2006
|
close() {
|
|
@@ -2006,33 +2014,33 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
2006
2014
|
static notifyParent(e, t) {
|
|
2007
2015
|
return super._notifyParent(window.parent, e, !1, t);
|
|
2008
2016
|
}
|
|
2009
|
-
},
|
|
2017
|
+
}, _t = class {
|
|
2010
2018
|
constructor(e) {
|
|
2011
2019
|
this._settings = e, this._logger = new f("IFrameNavigator");
|
|
2012
2020
|
}
|
|
2013
2021
|
async prepare({
|
|
2014
2022
|
silentRequestTimeoutInSeconds: e = this._settings.silentRequestTimeoutInSeconds
|
|
2015
2023
|
}) {
|
|
2016
|
-
return new
|
|
2024
|
+
return new se({ silentRequestTimeoutInSeconds: e });
|
|
2017
2025
|
}
|
|
2018
2026
|
async callback(e) {
|
|
2019
|
-
this._logger.create("callback"),
|
|
2027
|
+
this._logger.create("callback"), se.notifyParent(e, this._settings.iframeNotifyParentOrigin);
|
|
2020
2028
|
}
|
|
2021
|
-
},
|
|
2029
|
+
}, pt = 500, ge = class extends be {
|
|
2022
2030
|
constructor({
|
|
2023
|
-
popupWindowTarget: e =
|
|
2031
|
+
popupWindowTarget: e = Ee,
|
|
2024
2032
|
popupWindowFeatures: t = {}
|
|
2025
2033
|
}) {
|
|
2026
2034
|
super(), this._logger = new f("PopupWindow");
|
|
2027
|
-
const s =
|
|
2028
|
-
this._window = window.open(void 0, e,
|
|
2035
|
+
const s = he.center({ ...ke, ...t });
|
|
2036
|
+
this._window = window.open(void 0, e, he.serialize(s));
|
|
2029
2037
|
}
|
|
2030
2038
|
async navigate(e) {
|
|
2031
2039
|
var t;
|
|
2032
2040
|
(t = this._window) == null || t.focus();
|
|
2033
2041
|
const s = setInterval(() => {
|
|
2034
2042
|
(!this._window || this._window.closed) && this._abort.raise(new Error("Popup closed by user"));
|
|
2035
|
-
},
|
|
2043
|
+
}, pt);
|
|
2036
2044
|
return this._disposeHandlers.add(() => clearInterval(s)), await super.navigate(e);
|
|
2037
2045
|
}
|
|
2038
2046
|
close() {
|
|
@@ -2043,7 +2051,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
2043
2051
|
throw new Error("No window.opener. Can't complete notification.");
|
|
2044
2052
|
return super._notifyParent(window.opener, e, t);
|
|
2045
2053
|
}
|
|
2046
|
-
},
|
|
2054
|
+
}, ft = class {
|
|
2047
2055
|
constructor(e) {
|
|
2048
2056
|
this._settings = e, this._logger = new f("PopupNavigator");
|
|
2049
2057
|
}
|
|
@@ -2051,12 +2059,12 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
2051
2059
|
popupWindowFeatures: e = this._settings.popupWindowFeatures,
|
|
2052
2060
|
popupWindowTarget: t = this._settings.popupWindowTarget
|
|
2053
2061
|
}) {
|
|
2054
|
-
return new
|
|
2062
|
+
return new ge({ popupWindowFeatures: e, popupWindowTarget: t });
|
|
2055
2063
|
}
|
|
2056
2064
|
async callback(e, t = !1) {
|
|
2057
|
-
this._logger.create("callback"),
|
|
2065
|
+
this._logger.create("callback"), ge.notifyOpener(e, t);
|
|
2058
2066
|
}
|
|
2059
|
-
},
|
|
2067
|
+
}, wt = class {
|
|
2060
2068
|
constructor(e) {
|
|
2061
2069
|
this._settings = e, this._logger = new f("RedirectNavigator");
|
|
2062
2070
|
}
|
|
@@ -2083,7 +2091,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
2083
2091
|
}
|
|
2084
2092
|
};
|
|
2085
2093
|
}
|
|
2086
|
-
},
|
|
2094
|
+
}, vt = class extends Je {
|
|
2087
2095
|
constructor(e) {
|
|
2088
2096
|
super({ expiringNotificationTimeInSeconds: e.accessTokenExpiringNotificationTimeInSeconds }), this._logger = new f("UserManagerEvents"), this._userLoaded = new O("User loaded"), this._userUnloaded = new O("User unloaded"), this._silentRenewError = new O("Silent renew error"), this._userSignedIn = new O("User signed in"), this._userSignedOut = new O("User signed out"), this._userSessionChanged = new O("User session changed");
|
|
2089
2097
|
}
|
|
@@ -2192,14 +2200,14 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
2192
2200
|
_raiseUserSessionChanged() {
|
|
2193
2201
|
this._userSessionChanged.raise();
|
|
2194
2202
|
}
|
|
2195
|
-
},
|
|
2203
|
+
}, mt = class {
|
|
2196
2204
|
constructor(e) {
|
|
2197
2205
|
this._userManager = e, this._logger = new f("SilentRenewService"), this._isStarted = !1, this._retryTimer = new T("Retry Silent Renew"), this._tokenExpiring = async () => {
|
|
2198
2206
|
const t = this._logger.create("_tokenExpiring");
|
|
2199
2207
|
try {
|
|
2200
2208
|
await this._userManager.signinSilent(), t.debug("silent token renewal successful");
|
|
2201
2209
|
} catch (s) {
|
|
2202
|
-
if (s instanceof
|
|
2210
|
+
if (s instanceof ie) {
|
|
2203
2211
|
t.warn("ErrorTimeout from signinSilent:", s, "retry in 5s"), this._retryTimer.init(5);
|
|
2204
2212
|
return;
|
|
2205
2213
|
}
|
|
@@ -2221,13 +2229,13 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
2221
2229
|
stop() {
|
|
2222
2230
|
this._isStarted && (this._retryTimer.cancel(), this._retryTimer.removeHandler(this._tokenExpiring), this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring), this._isStarted = !1);
|
|
2223
2231
|
}
|
|
2224
|
-
},
|
|
2232
|
+
}, St = class {
|
|
2225
2233
|
constructor(e) {
|
|
2226
2234
|
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;
|
|
2227
2235
|
}
|
|
2228
|
-
},
|
|
2236
|
+
}, Ut = class {
|
|
2229
2237
|
constructor(e) {
|
|
2230
|
-
this._logger = new f("UserManager"), this.settings = new
|
|
2238
|
+
this._logger = new f("UserManager"), this.settings = new gt(e), this._client = new lt(e), this._redirectNavigator = new wt(this.settings), this._popupNavigator = new ft(this.settings), this._iframeNavigator = new _t(this.settings), this._events = new vt(this.settings), this._silentRenewService = new mt(this), this.settings.automaticSilentRenew && this.startSilentRenew(), this._sessionMonitor = null, this.settings.monitorSession && (this._sessionMonitor = new dt(this));
|
|
2231
2239
|
}
|
|
2232
2240
|
/** Returns an object used to register for events raised by the `UserManager`. */
|
|
2233
2241
|
get events() {
|
|
@@ -2325,7 +2333,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
2325
2333
|
let n = await this._loadUser();
|
|
2326
2334
|
if (n != null && n.refresh_token) {
|
|
2327
2335
|
s.debug("using refresh token");
|
|
2328
|
-
const h = new
|
|
2336
|
+
const h = new St(n);
|
|
2329
2337
|
return await this._useRefreshToken(h);
|
|
2330
2338
|
}
|
|
2331
2339
|
const o = this.settings.silent_redirect_uri;
|
|
@@ -2345,7 +2353,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
2345
2353
|
const t = await this._client.useRefreshToken({
|
|
2346
2354
|
state: e,
|
|
2347
2355
|
timeoutInSeconds: this.settings.silentRequestTimeoutInSeconds
|
|
2348
|
-
}), s = new
|
|
2356
|
+
}), s = new B({ ...e, ...t });
|
|
2349
2357
|
return await this.storeUser(s), this._events.load(s), s;
|
|
2350
2358
|
}
|
|
2351
2359
|
/**
|
|
@@ -2450,7 +2458,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
2450
2458
|
return s.debug("got signin response"), await this._buildUser(r, t);
|
|
2451
2459
|
}
|
|
2452
2460
|
async _buildUser(e, t) {
|
|
2453
|
-
const s = this._logger.create("_buildUser"), r = new
|
|
2461
|
+
const s = this._logger.create("_buildUser"), r = new B(e);
|
|
2454
2462
|
if (t) {
|
|
2455
2463
|
if (t !== r.profile.sub)
|
|
2456
2464
|
throw s.debug("current user does not match user returned from signin. sub from signin:", r.profile.sub), new j({ ...e, error: "login_required" });
|
|
@@ -2593,7 +2601,7 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
2593
2601
|
}
|
|
2594
2602
|
async _loadUser() {
|
|
2595
2603
|
const e = this._logger.create("_loadUser"), t = await this.settings.userStore.get(this._userStoreKey);
|
|
2596
|
-
return t ? (e.debug("user storageString loaded"),
|
|
2604
|
+
return t ? (e.debug("user storageString loaded"), B.fromStorageString(t)) : (e.debug("no user storageString"), null);
|
|
2597
2605
|
}
|
|
2598
2606
|
async storeUser(e) {
|
|
2599
2607
|
const t = this._logger.create("storeUser");
|
|
@@ -2610,56 +2618,56 @@ var Be = "10000000-1000-4000-8000-100000000000", P = class {
|
|
|
2610
2618
|
async clearStaleState() {
|
|
2611
2619
|
await this._client.clearStaleState();
|
|
2612
2620
|
}
|
|
2613
|
-
},
|
|
2614
|
-
const
|
|
2621
|
+
}, yt = "2.2.2", Pt = yt;
|
|
2622
|
+
const Ce = _e(
|
|
2615
2623
|
null
|
|
2616
|
-
),
|
|
2617
|
-
const e =
|
|
2624
|
+
), bt = () => {
|
|
2625
|
+
const e = pe(Ce);
|
|
2618
2626
|
if (!e)
|
|
2619
2627
|
throw new Error(
|
|
2620
2628
|
"useImpersonationContext must be used within a ImpersonationContextProvider"
|
|
2621
2629
|
);
|
|
2622
2630
|
return e;
|
|
2623
|
-
},
|
|
2631
|
+
}, At = ({
|
|
2624
2632
|
children: e
|
|
2625
2633
|
}) => {
|
|
2626
|
-
const [t, s] =
|
|
2634
|
+
const [t, s] = Ie("impersonationState", {
|
|
2627
2635
|
defaultValue: {}
|
|
2628
|
-
}), r =
|
|
2636
|
+
}), r = fe(() => ({
|
|
2629
2637
|
accessToken: t == null ? void 0 : t.accessToken,
|
|
2630
2638
|
userInfo: t == null ? void 0 : t.userInfo,
|
|
2631
2639
|
setImpersonation: (i, n) => {
|
|
2632
2640
|
s({ accessToken: i, userInfo: n });
|
|
2633
2641
|
}
|
|
2634
2642
|
}), []);
|
|
2635
|
-
return /* @__PURE__ */
|
|
2636
|
-
},
|
|
2643
|
+
return /* @__PURE__ */ re.jsx(Ce.Provider, { value: r, children: e });
|
|
2644
|
+
}, kt = (e) => {
|
|
2637
2645
|
const s = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), r = atob(s);
|
|
2638
2646
|
return JSON.parse(r);
|
|
2639
|
-
},
|
|
2640
|
-
const { setImpersonation: t } =
|
|
2641
|
-
|
|
2647
|
+
}, Ot = (e) => {
|
|
2648
|
+
const { setImpersonation: t } = bt();
|
|
2649
|
+
L(() => {
|
|
2642
2650
|
const { search: s } = window.location, r = new URLSearchParams(s).get(
|
|
2643
2651
|
"impersonateAccessToken"
|
|
2644
2652
|
);
|
|
2645
2653
|
if (r && t) {
|
|
2646
|
-
const i =
|
|
2654
|
+
const i = kt(r);
|
|
2647
2655
|
t(r, i), e();
|
|
2648
2656
|
}
|
|
2649
2657
|
}, []);
|
|
2650
|
-
},
|
|
2658
|
+
}, Et = ({
|
|
2651
2659
|
userManager: e,
|
|
2652
2660
|
context: t,
|
|
2653
2661
|
children: s
|
|
2654
2662
|
}) => {
|
|
2655
|
-
const [r, i] =
|
|
2663
|
+
const [r, i] = Te({
|
|
2656
2664
|
user: null,
|
|
2657
2665
|
isLoading: !0,
|
|
2658
2666
|
isAuthenticated: !1,
|
|
2659
2667
|
isError: !1,
|
|
2660
2668
|
error: null
|
|
2661
|
-
}), n =
|
|
2662
|
-
|
|
2669
|
+
}), n = we(!1);
|
|
2670
|
+
L(() => {
|
|
2663
2671
|
n.current || (n.current = !0, (async () => {
|
|
2664
2672
|
try {
|
|
2665
2673
|
const h = await e.getUser();
|
|
@@ -2680,7 +2688,7 @@ const Ee = ue(
|
|
|
2680
2688
|
});
|
|
2681
2689
|
}
|
|
2682
2690
|
})());
|
|
2683
|
-
}, [e]),
|
|
2691
|
+
}, [e]), L(() => {
|
|
2684
2692
|
const h = (S) => {
|
|
2685
2693
|
i({
|
|
2686
2694
|
user: S,
|
|
@@ -2711,7 +2719,7 @@ const Ee = ue(
|
|
|
2711
2719
|
e.events.removeUserLoaded(h), e.events.removeUserUnloaded(g), e.events.removeSilentRenewError(u);
|
|
2712
2720
|
};
|
|
2713
2721
|
}, [e]);
|
|
2714
|
-
const o =
|
|
2722
|
+
const o = ce(async () => {
|
|
2715
2723
|
const h = await e.signinCallback();
|
|
2716
2724
|
return i({
|
|
2717
2725
|
user: h ?? null,
|
|
@@ -2720,7 +2728,7 @@ const Ee = ue(
|
|
|
2720
2728
|
isError: !1,
|
|
2721
2729
|
error: null
|
|
2722
2730
|
}), h ?? void 0;
|
|
2723
|
-
}, [e]), c =
|
|
2731
|
+
}, [e]), c = ce(
|
|
2724
2732
|
async (h) => {
|
|
2725
2733
|
try {
|
|
2726
2734
|
await e.signinRedirect(h);
|
|
@@ -2729,7 +2737,7 @@ const Ee = ue(
|
|
|
2729
2737
|
}
|
|
2730
2738
|
},
|
|
2731
2739
|
[e]
|
|
2732
|
-
), l =
|
|
2740
|
+
), l = fe(
|
|
2733
2741
|
() => ({
|
|
2734
2742
|
state: r,
|
|
2735
2743
|
handleSigninCallback: o,
|
|
@@ -2737,32 +2745,32 @@ const Ee = ue(
|
|
|
2737
2745
|
}),
|
|
2738
2746
|
[r, o, c]
|
|
2739
2747
|
);
|
|
2740
|
-
return /* @__PURE__ */
|
|
2741
|
-
},
|
|
2742
|
-
const t =
|
|
2748
|
+
return /* @__PURE__ */ re.jsx(t.Provider, { value: l, children: s });
|
|
2749
|
+
}, ae = (e) => {
|
|
2750
|
+
const t = pe(e);
|
|
2743
2751
|
if (!t)
|
|
2744
2752
|
throw new Error("useAuthContext must be used within an AuthProvider");
|
|
2745
2753
|
return t;
|
|
2746
|
-
},
|
|
2747
|
-
const { state: t } =
|
|
2754
|
+
}, xt = (e) => {
|
|
2755
|
+
const { state: t } = ae(e);
|
|
2748
2756
|
return t;
|
|
2749
|
-
},
|
|
2750
|
-
const { state: s, handleSigninCallback: r } =
|
|
2751
|
-
return
|
|
2757
|
+
}, Ct = (e, t) => {
|
|
2758
|
+
const { state: s, handleSigninCallback: r } = ae(e), i = we(!1);
|
|
2759
|
+
return L(() => {
|
|
2752
2760
|
i.current || (i.current = !0, r().then(
|
|
2753
2761
|
(n) => new Promise(
|
|
2754
2762
|
(o) => setTimeout(() => o(n), 0)
|
|
2755
2763
|
)
|
|
2756
2764
|
).then((n) => t == null ? void 0 : t(n)));
|
|
2757
2765
|
}, [r]), s;
|
|
2758
|
-
},
|
|
2759
|
-
const t =
|
|
2766
|
+
}, qt = (e) => {
|
|
2767
|
+
const t = _e(null);
|
|
2760
2768
|
return {
|
|
2761
2769
|
AuthContext: t,
|
|
2762
|
-
AuthProvider: ({ children: c }) => /* @__PURE__ */
|
|
2763
|
-
useAuthContext: () =>
|
|
2764
|
-
useAuthState: () =>
|
|
2765
|
-
useSigninCallback: (c) =>
|
|
2770
|
+
AuthProvider: ({ children: c }) => /* @__PURE__ */ re.jsx(Et, { userManager: e, context: t, children: c }),
|
|
2771
|
+
useAuthContext: () => ae(t),
|
|
2772
|
+
useAuthState: () => xt(t),
|
|
2773
|
+
useSigninCallback: (c) => Ct(t, c),
|
|
2766
2774
|
getAccessToken: async () => {
|
|
2767
2775
|
const c = await e.getUser();
|
|
2768
2776
|
return c ? c.access_token : null;
|
|
@@ -2770,28 +2778,28 @@ const Ee = ue(
|
|
|
2770
2778
|
};
|
|
2771
2779
|
};
|
|
2772
2780
|
export {
|
|
2773
|
-
|
|
2774
|
-
|
|
2781
|
+
Je as AccessTokenEvents,
|
|
2782
|
+
Ke as CheckSessionIFrame,
|
|
2775
2783
|
j as ErrorResponse,
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2784
|
+
ie as ErrorTimeout,
|
|
2785
|
+
At as ImpersonationContextProvider,
|
|
2786
|
+
ve as InMemoryWebStorage,
|
|
2779
2787
|
D as Log,
|
|
2780
2788
|
f as Logger,
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2789
|
+
Ve as MetadataService,
|
|
2790
|
+
lt as OidcClient,
|
|
2791
|
+
Se as OidcClientSettingsStore,
|
|
2792
|
+
dt as SessionMonitor,
|
|
2793
|
+
Q as SigninResponse,
|
|
2794
|
+
oe as SigninState,
|
|
2795
|
+
ct as SignoutResponse,
|
|
2788
2796
|
M as State,
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
+
B as User,
|
|
2798
|
+
Ut as UserManager,
|
|
2799
|
+
gt as UserManagerSettingsStore,
|
|
2800
|
+
Pt as Version,
|
|
2801
|
+
me as WebStorageStateStore,
|
|
2802
|
+
qt as createAuthContext,
|
|
2803
|
+
Ot as useImpersonationCallback,
|
|
2804
|
+
bt as useImpersonationContext
|
|
2797
2805
|
};
|