@auth0/auth0-spa-js 1.19.1 → 1.20.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.
- package/README.md +2 -2
- package/dist/auth0-spa-js.development.js +565 -312
- package/dist/auth0-spa-js.development.js.map +1 -1
- package/dist/auth0-spa-js.production.esm.js +1 -1
- package/dist/auth0-spa-js.production.esm.js.map +1 -1
- package/dist/auth0-spa-js.production.js +1 -1
- package/dist/auth0-spa-js.production.js.map +1 -1
- package/dist/lib/auth0-spa-js.cjs.js +565 -312
- package/dist/lib/auth0-spa-js.cjs.js.map +1 -1
- package/dist/typings/Auth0Client.d.ts +22 -15
- package/dist/typings/global.d.ts +9 -5
- package/dist/typings/index.d.ts +9 -0
- package/dist/typings/storage.d.ts +1 -1
- package/dist/typings/transaction-manager.d.ts +2 -1
- package/dist/typings/version.d.ts +1 -1
- package/package.json +15 -15
- package/src/Auth0Client.ts +89 -44
- package/src/global.ts +11 -5
- package/src/http.ts +2 -0
- package/src/index.ts +9 -0
- package/src/storage.ts +1 -1
- package/src/transaction-manager.ts +4 -3
- package/src/version.ts +1 -1
|
@@ -162,6 +162,18 @@
|
|
|
162
162
|
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
163
163
|
});
|
|
164
164
|
|
|
165
|
+
var functionBindNative = !fails(function () {
|
|
166
|
+
var test = (function () { /* empty */ }).bind();
|
|
167
|
+
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
168
|
+
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
var call$2 = Function.prototype.call;
|
|
172
|
+
|
|
173
|
+
var functionCall = functionBindNative ? call$2.bind(call$2) : function () {
|
|
174
|
+
return call$2.apply(call$2, arguments);
|
|
175
|
+
};
|
|
176
|
+
|
|
165
177
|
var $propertyIsEnumerable$1 = {}.propertyIsEnumerable;
|
|
166
178
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
167
179
|
var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
|
|
@@ -171,13 +183,13 @@
|
|
|
171
183
|
|
|
172
184
|
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
173
185
|
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
174
|
-
var f$
|
|
186
|
+
var f$7 = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
175
187
|
var descriptor = getOwnPropertyDescriptor$2(this, V);
|
|
176
188
|
return !!descriptor && descriptor.enumerable;
|
|
177
189
|
} : $propertyIsEnumerable$1;
|
|
178
190
|
|
|
179
191
|
var objectPropertyIsEnumerable = {
|
|
180
|
-
f: f$
|
|
192
|
+
f: f$7
|
|
181
193
|
};
|
|
182
194
|
|
|
183
195
|
var createPropertyDescriptor = function (bitmap, value) {
|
|
@@ -189,27 +201,44 @@
|
|
|
189
201
|
};
|
|
190
202
|
};
|
|
191
203
|
|
|
192
|
-
var
|
|
204
|
+
var FunctionPrototype$2 = Function.prototype;
|
|
205
|
+
var bind$2 = FunctionPrototype$2.bind;
|
|
206
|
+
var call$1 = FunctionPrototype$2.call;
|
|
207
|
+
var uncurryThis = functionBindNative && bind$2.bind(call$1, call$1);
|
|
208
|
+
|
|
209
|
+
var functionUncurryThis = functionBindNative ? function (fn) {
|
|
210
|
+
return fn && uncurryThis(fn);
|
|
211
|
+
} : function (fn) {
|
|
212
|
+
return fn && function () {
|
|
213
|
+
return call$1.apply(fn, arguments);
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
var toString$1 = functionUncurryThis({}.toString);
|
|
218
|
+
var stringSlice$3 = functionUncurryThis(''.slice);
|
|
193
219
|
|
|
194
220
|
var classofRaw = function (it) {
|
|
195
|
-
return toString$1
|
|
221
|
+
return stringSlice$3(toString$1(it), 8, -1);
|
|
196
222
|
};
|
|
197
223
|
|
|
198
|
-
var
|
|
224
|
+
var Object$5 = global_1.Object;
|
|
225
|
+
var split = functionUncurryThis(''.split);
|
|
199
226
|
|
|
200
227
|
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
201
228
|
var indexedObject = fails(function () {
|
|
202
229
|
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
203
230
|
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
204
|
-
return !Object('z').propertyIsEnumerable(0);
|
|
231
|
+
return !Object$5('z').propertyIsEnumerable(0);
|
|
205
232
|
}) ? function (it) {
|
|
206
|
-
return classofRaw(it) == 'String' ? split
|
|
207
|
-
} : Object;
|
|
233
|
+
return classofRaw(it) == 'String' ? split(it, '') : Object$5(it);
|
|
234
|
+
} : Object$5;
|
|
235
|
+
|
|
236
|
+
var TypeError$g = global_1.TypeError;
|
|
208
237
|
|
|
209
238
|
// `RequireObjectCoercible` abstract operation
|
|
210
239
|
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
211
240
|
var requireObjectCoercible = function (it) {
|
|
212
|
-
if (it == undefined) throw TypeError("Can't call method on " + it);
|
|
241
|
+
if (it == undefined) throw TypeError$g("Can't call method on " + it);
|
|
213
242
|
return it;
|
|
214
243
|
};
|
|
215
244
|
|
|
@@ -224,11 +253,11 @@
|
|
|
224
253
|
// `IsCallable` abstract operation
|
|
225
254
|
// https://tc39.es/ecma262/#sec-iscallable
|
|
226
255
|
var isCallable = function (argument) {
|
|
227
|
-
return typeof argument
|
|
256
|
+
return typeof argument == 'function';
|
|
228
257
|
};
|
|
229
258
|
|
|
230
259
|
var isObject = function (it) {
|
|
231
|
-
return typeof it
|
|
260
|
+
return typeof it == 'object' ? it !== null : isCallable(it);
|
|
232
261
|
};
|
|
233
262
|
|
|
234
263
|
var aFunction = function (argument) {
|
|
@@ -239,6 +268,8 @@
|
|
|
239
268
|
return arguments.length < 2 ? aFunction(global_1[namespace]) : global_1[namespace] && global_1[namespace][method];
|
|
240
269
|
};
|
|
241
270
|
|
|
271
|
+
var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
|
|
272
|
+
|
|
242
273
|
var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
|
|
243
274
|
|
|
244
275
|
var process = global_1.process;
|
|
@@ -249,23 +280,29 @@
|
|
|
249
280
|
|
|
250
281
|
if (v8) {
|
|
251
282
|
match = v8.split('.');
|
|
252
|
-
|
|
253
|
-
|
|
283
|
+
// in old Chrome, versions of V8 isn't V8 = Chrome / 10
|
|
284
|
+
// but their correct versions are not interesting for us
|
|
285
|
+
version$1 = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
|
|
289
|
+
// so check `userAgent` even if `.v8` exists, but 0
|
|
290
|
+
if (!version$1 && engineUserAgent) {
|
|
254
291
|
match = engineUserAgent.match(/Edge\/(\d+)/);
|
|
255
292
|
if (!match || match[1] >= 74) {
|
|
256
293
|
match = engineUserAgent.match(/Chrome\/(\d+)/);
|
|
257
|
-
if (match) version$1 = match[1];
|
|
294
|
+
if (match) version$1 = +match[1];
|
|
258
295
|
}
|
|
259
296
|
}
|
|
260
297
|
|
|
261
|
-
var engineV8Version = version$1
|
|
298
|
+
var engineV8Version = version$1;
|
|
262
299
|
|
|
263
300
|
/* eslint-disable es/no-symbol -- required for testing */
|
|
264
301
|
|
|
265
302
|
|
|
266
303
|
|
|
267
304
|
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
268
|
-
var nativeSymbol
|
|
305
|
+
var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
269
306
|
var symbol = Symbol();
|
|
270
307
|
// Chrome 38 Symbol has incorrect toString conversion
|
|
271
308
|
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
@@ -277,29 +314,35 @@
|
|
|
277
314
|
/* eslint-disable es/no-symbol -- required for testing */
|
|
278
315
|
|
|
279
316
|
|
|
280
|
-
var useSymbolAsUid = nativeSymbol
|
|
317
|
+
var useSymbolAsUid = nativeSymbol
|
|
281
318
|
&& !Symbol.sham
|
|
282
319
|
&& typeof Symbol.iterator == 'symbol';
|
|
283
320
|
|
|
321
|
+
var Object$4 = global_1.Object;
|
|
322
|
+
|
|
284
323
|
var isSymbol = useSymbolAsUid ? function (it) {
|
|
285
324
|
return typeof it == 'symbol';
|
|
286
325
|
} : function (it) {
|
|
287
326
|
var $Symbol = getBuiltIn('Symbol');
|
|
288
|
-
return isCallable($Symbol) && Object(it)
|
|
327
|
+
return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, Object$4(it));
|
|
289
328
|
};
|
|
290
329
|
|
|
330
|
+
var String$4 = global_1.String;
|
|
331
|
+
|
|
291
332
|
var tryToString = function (argument) {
|
|
292
333
|
try {
|
|
293
|
-
return String(argument);
|
|
334
|
+
return String$4(argument);
|
|
294
335
|
} catch (error) {
|
|
295
336
|
return 'Object';
|
|
296
337
|
}
|
|
297
338
|
};
|
|
298
339
|
|
|
340
|
+
var TypeError$f = global_1.TypeError;
|
|
341
|
+
|
|
299
342
|
// `Assert: IsCallable(argument) is true`
|
|
300
343
|
var aCallable = function (argument) {
|
|
301
344
|
if (isCallable(argument)) return argument;
|
|
302
|
-
throw TypeError(tryToString(argument) + ' is not a function');
|
|
345
|
+
throw TypeError$f(tryToString(argument) + ' is not a function');
|
|
303
346
|
};
|
|
304
347
|
|
|
305
348
|
// `GetMethod` abstract operation
|
|
@@ -309,20 +352,24 @@
|
|
|
309
352
|
return func == null ? undefined : aCallable(func);
|
|
310
353
|
};
|
|
311
354
|
|
|
355
|
+
var TypeError$e = global_1.TypeError;
|
|
356
|
+
|
|
312
357
|
// `OrdinaryToPrimitive` abstract operation
|
|
313
358
|
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
314
359
|
var ordinaryToPrimitive = function (input, pref) {
|
|
315
360
|
var fn, val;
|
|
316
|
-
if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = fn
|
|
317
|
-
if (isCallable(fn = input.valueOf) && !isObject(val = fn
|
|
318
|
-
if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = fn
|
|
319
|
-
throw TypeError("Can't convert object to primitive value");
|
|
361
|
+
if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
|
|
362
|
+
if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
|
|
363
|
+
if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
|
|
364
|
+
throw TypeError$e("Can't convert object to primitive value");
|
|
320
365
|
};
|
|
321
366
|
|
|
367
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
368
|
+
var defineProperty$6 = Object.defineProperty;
|
|
369
|
+
|
|
322
370
|
var setGlobal = function (key, value) {
|
|
323
371
|
try {
|
|
324
|
-
|
|
325
|
-
Object.defineProperty(global_1, key, { value: value, configurable: true, writable: true });
|
|
372
|
+
defineProperty$6(global_1, key, { value: value, configurable: true, writable: true });
|
|
326
373
|
} catch (error) {
|
|
327
374
|
global_1[key] = value;
|
|
328
375
|
} return value;
|
|
@@ -337,47 +384,57 @@
|
|
|
337
384
|
(module.exports = function (key, value) {
|
|
338
385
|
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
|
339
386
|
})('versions', []).push({
|
|
340
|
-
version: '3.
|
|
387
|
+
version: '3.21.0',
|
|
341
388
|
mode: 'global',
|
|
342
|
-
copyright: '©
|
|
389
|
+
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
|
390
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.21.0/LICENSE',
|
|
391
|
+
source: 'https://github.com/zloirock/core-js'
|
|
343
392
|
});
|
|
344
393
|
});
|
|
345
394
|
|
|
395
|
+
var Object$3 = global_1.Object;
|
|
396
|
+
|
|
346
397
|
// `ToObject` abstract operation
|
|
347
398
|
// https://tc39.es/ecma262/#sec-toobject
|
|
348
399
|
var toObject = function (argument) {
|
|
349
|
-
return Object(requireObjectCoercible(argument));
|
|
400
|
+
return Object$3(requireObjectCoercible(argument));
|
|
350
401
|
};
|
|
351
402
|
|
|
352
|
-
var hasOwnProperty = {}.hasOwnProperty;
|
|
403
|
+
var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
|
|
353
404
|
|
|
354
405
|
// `HasOwnProperty` abstract operation
|
|
355
406
|
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
356
407
|
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
357
|
-
return hasOwnProperty
|
|
408
|
+
return hasOwnProperty(toObject(it), key);
|
|
358
409
|
};
|
|
359
410
|
|
|
360
411
|
var id = 0;
|
|
361
412
|
var postfix = Math.random();
|
|
413
|
+
var toString = functionUncurryThis(1.0.toString);
|
|
362
414
|
|
|
363
415
|
var uid = function (key) {
|
|
364
|
-
return 'Symbol(' +
|
|
416
|
+
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
|
|
365
417
|
};
|
|
366
418
|
|
|
367
419
|
var WellKnownSymbolsStore$1 = shared('wks');
|
|
368
420
|
var Symbol$1 = global_1.Symbol;
|
|
421
|
+
var symbolFor = Symbol$1 && Symbol$1['for'];
|
|
369
422
|
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
|
|
370
423
|
|
|
371
424
|
var wellKnownSymbol = function (name) {
|
|
372
|
-
if (!hasOwnProperty_1(WellKnownSymbolsStore$1, name) || !(nativeSymbol
|
|
373
|
-
|
|
425
|
+
if (!hasOwnProperty_1(WellKnownSymbolsStore$1, name) || !(nativeSymbol || typeof WellKnownSymbolsStore$1[name] == 'string')) {
|
|
426
|
+
var description = 'Symbol.' + name;
|
|
427
|
+
if (nativeSymbol && hasOwnProperty_1(Symbol$1, name)) {
|
|
374
428
|
WellKnownSymbolsStore$1[name] = Symbol$1[name];
|
|
429
|
+
} else if (useSymbolAsUid && symbolFor) {
|
|
430
|
+
WellKnownSymbolsStore$1[name] = symbolFor(description);
|
|
375
431
|
} else {
|
|
376
|
-
WellKnownSymbolsStore$1[name] = createWellKnownSymbol(
|
|
432
|
+
WellKnownSymbolsStore$1[name] = createWellKnownSymbol(description);
|
|
377
433
|
}
|
|
378
434
|
} return WellKnownSymbolsStore$1[name];
|
|
379
435
|
};
|
|
380
436
|
|
|
437
|
+
var TypeError$d = global_1.TypeError;
|
|
381
438
|
var TO_PRIMITIVE$1 = wellKnownSymbol('toPrimitive');
|
|
382
439
|
|
|
383
440
|
// `ToPrimitive` abstract operation
|
|
@@ -388,9 +445,9 @@
|
|
|
388
445
|
var result;
|
|
389
446
|
if (exoticToPrim) {
|
|
390
447
|
if (pref === undefined) pref = 'default';
|
|
391
|
-
result = exoticToPrim
|
|
448
|
+
result = functionCall(exoticToPrim, input, pref);
|
|
392
449
|
if (!isObject(result) || isSymbol(result)) return result;
|
|
393
|
-
throw TypeError("Can't convert object to primitive value");
|
|
450
|
+
throw TypeError$d("Can't convert object to primitive value");
|
|
394
451
|
}
|
|
395
452
|
if (pref === undefined) pref = 'number';
|
|
396
453
|
return ordinaryToPrimitive(input, pref);
|
|
@@ -400,7 +457,7 @@
|
|
|
400
457
|
// https://tc39.es/ecma262/#sec-topropertykey
|
|
401
458
|
var toPropertyKey = function (argument) {
|
|
402
459
|
var key = toPrimitive(argument, 'string');
|
|
403
|
-
return isSymbol(key) ? key :
|
|
460
|
+
return isSymbol(key) ? key : key + '';
|
|
404
461
|
};
|
|
405
462
|
|
|
406
463
|
var document$1 = global_1.document;
|
|
@@ -411,57 +468,91 @@
|
|
|
411
468
|
return EXISTS$1 ? document$1.createElement(it) : {};
|
|
412
469
|
};
|
|
413
470
|
|
|
414
|
-
//
|
|
471
|
+
// Thanks to IE8 for its funny defineProperty
|
|
415
472
|
var ie8DomDefine = !descriptors && !fails(function () {
|
|
416
|
-
// eslint-disable-next-line es/no-object-defineproperty --
|
|
473
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
417
474
|
return Object.defineProperty(documentCreateElement('div'), 'a', {
|
|
418
475
|
get: function () { return 7; }
|
|
419
476
|
}).a != 7;
|
|
420
477
|
});
|
|
421
478
|
|
|
422
479
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
423
|
-
var $getOwnPropertyDescriptor$
|
|
480
|
+
var $getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
|
|
424
481
|
|
|
425
482
|
// `Object.getOwnPropertyDescriptor` method
|
|
426
483
|
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
|
427
|
-
var f$
|
|
484
|
+
var f$6 = descriptors ? $getOwnPropertyDescriptor$2 : function getOwnPropertyDescriptor(O, P) {
|
|
428
485
|
O = toIndexedObject(O);
|
|
429
486
|
P = toPropertyKey(P);
|
|
430
487
|
if (ie8DomDefine) try {
|
|
431
|
-
return $getOwnPropertyDescriptor$
|
|
488
|
+
return $getOwnPropertyDescriptor$2(O, P);
|
|
432
489
|
} catch (error) { /* empty */ }
|
|
433
|
-
if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f
|
|
490
|
+
if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
|
|
434
491
|
};
|
|
435
492
|
|
|
436
493
|
var objectGetOwnPropertyDescriptor = {
|
|
437
|
-
f: f$
|
|
494
|
+
f: f$6
|
|
438
495
|
};
|
|
439
496
|
|
|
497
|
+
// V8 ~ Chrome 36-
|
|
498
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
499
|
+
var v8PrototypeDefineBug = descriptors && fails(function () {
|
|
500
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
501
|
+
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
502
|
+
value: 42,
|
|
503
|
+
writable: false
|
|
504
|
+
}).prototype != 42;
|
|
505
|
+
});
|
|
506
|
+
|
|
507
|
+
var String$3 = global_1.String;
|
|
508
|
+
var TypeError$c = global_1.TypeError;
|
|
509
|
+
|
|
440
510
|
// `Assert: Type(argument) is Object`
|
|
441
511
|
var anObject = function (argument) {
|
|
442
512
|
if (isObject(argument)) return argument;
|
|
443
|
-
throw TypeError(String(argument) + ' is not an object');
|
|
513
|
+
throw TypeError$c(String$3(argument) + ' is not an object');
|
|
444
514
|
};
|
|
445
515
|
|
|
516
|
+
var TypeError$b = global_1.TypeError;
|
|
446
517
|
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
447
518
|
var $defineProperty$1 = Object.defineProperty;
|
|
519
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
520
|
+
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
521
|
+
var ENUMERABLE = 'enumerable';
|
|
522
|
+
var CONFIGURABLE$1 = 'configurable';
|
|
523
|
+
var WRITABLE = 'writable';
|
|
448
524
|
|
|
449
525
|
// `Object.defineProperty` method
|
|
450
526
|
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
451
|
-
var f$
|
|
527
|
+
var f$5 = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
|
|
528
|
+
anObject(O);
|
|
529
|
+
P = toPropertyKey(P);
|
|
530
|
+
anObject(Attributes);
|
|
531
|
+
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
|
532
|
+
var current = $getOwnPropertyDescriptor$1(O, P);
|
|
533
|
+
if (current && current[WRITABLE]) {
|
|
534
|
+
O[P] = Attributes.value;
|
|
535
|
+
Attributes = {
|
|
536
|
+
configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
|
|
537
|
+
enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
|
|
538
|
+
writable: false
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
} return $defineProperty$1(O, P, Attributes);
|
|
542
|
+
} : $defineProperty$1 : function defineProperty(O, P, Attributes) {
|
|
452
543
|
anObject(O);
|
|
453
544
|
P = toPropertyKey(P);
|
|
454
545
|
anObject(Attributes);
|
|
455
546
|
if (ie8DomDefine) try {
|
|
456
547
|
return $defineProperty$1(O, P, Attributes);
|
|
457
548
|
} catch (error) { /* empty */ }
|
|
458
|
-
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
|
|
549
|
+
if ('get' in Attributes || 'set' in Attributes) throw TypeError$b('Accessors not supported');
|
|
459
550
|
if ('value' in Attributes) O[P] = Attributes.value;
|
|
460
551
|
return O;
|
|
461
552
|
};
|
|
462
553
|
|
|
463
554
|
var objectDefineProperty = {
|
|
464
|
-
f: f$
|
|
555
|
+
f: f$5
|
|
465
556
|
};
|
|
466
557
|
|
|
467
558
|
var createNonEnumerableProperty = descriptors ? function (object, key, value) {
|
|
@@ -471,12 +562,12 @@
|
|
|
471
562
|
return object;
|
|
472
563
|
};
|
|
473
564
|
|
|
474
|
-
var functionToString = Function.toString;
|
|
565
|
+
var functionToString = functionUncurryThis(Function.toString);
|
|
475
566
|
|
|
476
567
|
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
477
568
|
if (!isCallable(sharedStore.inspectSource)) {
|
|
478
569
|
sharedStore.inspectSource = function (it) {
|
|
479
|
-
return functionToString
|
|
570
|
+
return functionToString(it);
|
|
480
571
|
};
|
|
481
572
|
}
|
|
482
573
|
|
|
@@ -495,6 +586,7 @@
|
|
|
495
586
|
var hiddenKeys$1 = {};
|
|
496
587
|
|
|
497
588
|
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
589
|
+
var TypeError$a = global_1.TypeError;
|
|
498
590
|
var WeakMap = global_1.WeakMap;
|
|
499
591
|
var set, get, has;
|
|
500
592
|
|
|
@@ -506,33 +598,33 @@
|
|
|
506
598
|
return function (it) {
|
|
507
599
|
var state;
|
|
508
600
|
if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
|
509
|
-
throw TypeError('Incompatible receiver, ' + TYPE + ' required');
|
|
601
|
+
throw TypeError$a('Incompatible receiver, ' + TYPE + ' required');
|
|
510
602
|
} return state;
|
|
511
603
|
};
|
|
512
604
|
};
|
|
513
605
|
|
|
514
606
|
if (nativeWeakMap || sharedStore.state) {
|
|
515
607
|
var store = sharedStore.state || (sharedStore.state = new WeakMap());
|
|
516
|
-
var wmget = store.get;
|
|
517
|
-
var wmhas = store.has;
|
|
518
|
-
var wmset = store.set;
|
|
608
|
+
var wmget = functionUncurryThis(store.get);
|
|
609
|
+
var wmhas = functionUncurryThis(store.has);
|
|
610
|
+
var wmset = functionUncurryThis(store.set);
|
|
519
611
|
set = function (it, metadata) {
|
|
520
|
-
if (wmhas
|
|
612
|
+
if (wmhas(store, it)) throw new TypeError$a(OBJECT_ALREADY_INITIALIZED);
|
|
521
613
|
metadata.facade = it;
|
|
522
|
-
wmset
|
|
614
|
+
wmset(store, it, metadata);
|
|
523
615
|
return metadata;
|
|
524
616
|
};
|
|
525
617
|
get = function (it) {
|
|
526
|
-
return wmget
|
|
618
|
+
return wmget(store, it) || {};
|
|
527
619
|
};
|
|
528
620
|
has = function (it) {
|
|
529
|
-
return wmhas
|
|
621
|
+
return wmhas(store, it);
|
|
530
622
|
};
|
|
531
623
|
} else {
|
|
532
624
|
var STATE = sharedKey('state');
|
|
533
625
|
hiddenKeys$1[STATE] = true;
|
|
534
626
|
set = function (it, metadata) {
|
|
535
|
-
if (hasOwnProperty_1(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
|
|
627
|
+
if (hasOwnProperty_1(it, STATE)) throw new TypeError$a(OBJECT_ALREADY_INITIALIZED);
|
|
536
628
|
metadata.facade = it;
|
|
537
629
|
createNonEnumerableProperty(it, STATE, metadata);
|
|
538
630
|
return metadata;
|
|
@@ -553,14 +645,14 @@
|
|
|
553
645
|
getterFor: getterFor
|
|
554
646
|
};
|
|
555
647
|
|
|
556
|
-
var FunctionPrototype = Function.prototype;
|
|
648
|
+
var FunctionPrototype$1 = Function.prototype;
|
|
557
649
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
558
650
|
var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
|
|
559
651
|
|
|
560
|
-
var EXISTS = hasOwnProperty_1(FunctionPrototype, 'name');
|
|
652
|
+
var EXISTS = hasOwnProperty_1(FunctionPrototype$1, 'name');
|
|
561
653
|
// additional protection from minified / mangled / dropped function names
|
|
562
654
|
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
|
|
563
|
-
var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype, 'name').configurable));
|
|
655
|
+
var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype$1, 'name').configurable));
|
|
564
656
|
|
|
565
657
|
var functionName = {
|
|
566
658
|
EXISTS: EXISTS,
|
|
@@ -621,7 +713,7 @@
|
|
|
621
713
|
return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
|
|
622
714
|
};
|
|
623
715
|
|
|
624
|
-
var max = Math.max;
|
|
716
|
+
var max$1 = Math.max;
|
|
625
717
|
var min$2 = Math.min;
|
|
626
718
|
|
|
627
719
|
// Helper for a popular repeating case of the spec:
|
|
@@ -629,7 +721,7 @@
|
|
|
629
721
|
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
630
722
|
var toAbsoluteIndex = function (index, length) {
|
|
631
723
|
var integer = toIntegerOrInfinity(index);
|
|
632
|
-
return integer < 0 ? max(integer + length, 0) : min$2(integer, length);
|
|
724
|
+
return integer < 0 ? max$1(integer + length, 0) : min$2(integer, length);
|
|
633
725
|
};
|
|
634
726
|
|
|
635
727
|
var min$1 = Math.min;
|
|
@@ -678,15 +770,17 @@
|
|
|
678
770
|
var indexOf = arrayIncludes.indexOf;
|
|
679
771
|
|
|
680
772
|
|
|
773
|
+
var push$2 = functionUncurryThis([].push);
|
|
774
|
+
|
|
681
775
|
var objectKeysInternal = function (object, names) {
|
|
682
776
|
var O = toIndexedObject(object);
|
|
683
777
|
var i = 0;
|
|
684
778
|
var result = [];
|
|
685
779
|
var key;
|
|
686
|
-
for (key in O) !hasOwnProperty_1(hiddenKeys$1, key) && hasOwnProperty_1(O, key) &&
|
|
780
|
+
for (key in O) !hasOwnProperty_1(hiddenKeys$1, key) && hasOwnProperty_1(O, key) && push$2(result, key);
|
|
687
781
|
// Don't enum bug & hidden keys
|
|
688
782
|
while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
|
|
689
|
-
~indexOf(result, key) ||
|
|
783
|
+
~indexOf(result, key) || push$2(result, key);
|
|
690
784
|
}
|
|
691
785
|
return result;
|
|
692
786
|
};
|
|
@@ -707,35 +801,39 @@
|
|
|
707
801
|
// `Object.getOwnPropertyNames` method
|
|
708
802
|
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
709
803
|
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
710
|
-
var f$
|
|
804
|
+
var f$4 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
711
805
|
return objectKeysInternal(O, hiddenKeys);
|
|
712
806
|
};
|
|
713
807
|
|
|
714
808
|
var objectGetOwnPropertyNames = {
|
|
715
|
-
f: f$
|
|
809
|
+
f: f$4
|
|
716
810
|
};
|
|
717
811
|
|
|
718
812
|
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
|
719
|
-
var f$
|
|
813
|
+
var f$3 = Object.getOwnPropertySymbols;
|
|
720
814
|
|
|
721
815
|
var objectGetOwnPropertySymbols = {
|
|
722
|
-
f: f$
|
|
816
|
+
f: f$3
|
|
723
817
|
};
|
|
724
818
|
|
|
819
|
+
var concat = functionUncurryThis([].concat);
|
|
820
|
+
|
|
725
821
|
// all object keys, includes non-enumerable and symbols
|
|
726
822
|
var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
727
823
|
var keys = objectGetOwnPropertyNames.f(anObject(it));
|
|
728
824
|
var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
|
|
729
|
-
return getOwnPropertySymbols ?
|
|
825
|
+
return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
|
|
730
826
|
};
|
|
731
827
|
|
|
732
|
-
var copyConstructorProperties = function (target, source) {
|
|
828
|
+
var copyConstructorProperties = function (target, source, exceptions) {
|
|
733
829
|
var keys = ownKeys(source);
|
|
734
830
|
var defineProperty = objectDefineProperty.f;
|
|
735
831
|
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
736
832
|
for (var i = 0; i < keys.length; i++) {
|
|
737
833
|
var key = keys[i];
|
|
738
|
-
if (!hasOwnProperty_1(target, key)
|
|
834
|
+
if (!hasOwnProperty_1(target, key) && !(exceptions && hasOwnProperty_1(exceptions, key))) {
|
|
835
|
+
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
836
|
+
}
|
|
739
837
|
}
|
|
740
838
|
};
|
|
741
839
|
|
|
@@ -802,7 +900,7 @@
|
|
|
802
900
|
FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
|
803
901
|
// contained in target
|
|
804
902
|
if (!FORCED && targetProperty !== undefined) {
|
|
805
|
-
if (typeof sourceProperty
|
|
903
|
+
if (typeof sourceProperty == typeof targetProperty) continue;
|
|
806
904
|
copyConstructorProperties(sourceProperty, targetProperty);
|
|
807
905
|
}
|
|
808
906
|
// add a flag to not completely full polyfills
|
|
@@ -822,6 +920,8 @@
|
|
|
822
920
|
var toStringTagSupport = String(test) === '[object z]';
|
|
823
921
|
|
|
824
922
|
var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
|
|
923
|
+
var Object$2 = global_1.Object;
|
|
924
|
+
|
|
825
925
|
// ES3 wrong here
|
|
826
926
|
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
|
827
927
|
|
|
@@ -837,16 +937,18 @@
|
|
|
837
937
|
var O, tag, result;
|
|
838
938
|
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
839
939
|
// @@toStringTag case
|
|
840
|
-
: typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$2)) == 'string' ? tag
|
|
940
|
+
: typeof (tag = tryGet(O = Object$2(it), TO_STRING_TAG$2)) == 'string' ? tag
|
|
841
941
|
// builtinTag case
|
|
842
942
|
: CORRECT_ARGUMENTS ? classofRaw(O)
|
|
843
943
|
// ES3 arguments fallback
|
|
844
944
|
: (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
|
|
845
945
|
};
|
|
846
946
|
|
|
947
|
+
var String$2 = global_1.String;
|
|
948
|
+
|
|
847
949
|
var toString_1 = function (argument) {
|
|
848
950
|
if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
|
|
849
|
-
return String(argument);
|
|
951
|
+
return String$2(argument);
|
|
850
952
|
};
|
|
851
953
|
|
|
852
954
|
var MATCH$1 = wellKnownSymbol('match');
|
|
@@ -858,9 +960,11 @@
|
|
|
858
960
|
return isObject(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
|
|
859
961
|
};
|
|
860
962
|
|
|
963
|
+
var TypeError$9 = global_1.TypeError;
|
|
964
|
+
|
|
861
965
|
var notARegexp = function (it) {
|
|
862
966
|
if (isRegexp(it)) {
|
|
863
|
-
throw TypeError("The method doesn't accept regular expressions");
|
|
967
|
+
throw TypeError$9("The method doesn't accept regular expressions");
|
|
864
968
|
} return it;
|
|
865
969
|
};
|
|
866
970
|
|
|
@@ -887,7 +991,8 @@
|
|
|
887
991
|
|
|
888
992
|
|
|
889
993
|
// eslint-disable-next-line es/no-string-prototype-startswith -- safe
|
|
890
|
-
var $
|
|
994
|
+
var un$StartsWith = functionUncurryThis(''.startsWith);
|
|
995
|
+
var stringSlice$2 = functionUncurryThis(''.slice);
|
|
891
996
|
var min = Math.min;
|
|
892
997
|
|
|
893
998
|
var CORRECT_IS_REGEXP_LOGIC = correctIsRegexpLogic('startsWith');
|
|
@@ -905,39 +1010,14 @@
|
|
|
905
1010
|
notARegexp(searchString);
|
|
906
1011
|
var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length));
|
|
907
1012
|
var search = toString_1(searchString);
|
|
908
|
-
return $
|
|
909
|
-
? $
|
|
910
|
-
: that
|
|
1013
|
+
return un$StartsWith
|
|
1014
|
+
? un$StartsWith(that, search, index)
|
|
1015
|
+
: stringSlice$2(that, index, index + search.length) === search;
|
|
911
1016
|
}
|
|
912
1017
|
});
|
|
913
1018
|
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
aCallable(fn);
|
|
917
|
-
if (that === undefined) return fn;
|
|
918
|
-
switch (length) {
|
|
919
|
-
case 0: return function () {
|
|
920
|
-
return fn.call(that);
|
|
921
|
-
};
|
|
922
|
-
case 1: return function (a) {
|
|
923
|
-
return fn.call(that, a);
|
|
924
|
-
};
|
|
925
|
-
case 2: return function (a, b) {
|
|
926
|
-
return fn.call(that, a, b);
|
|
927
|
-
};
|
|
928
|
-
case 3: return function (a, b, c) {
|
|
929
|
-
return fn.call(that, a, b, c);
|
|
930
|
-
};
|
|
931
|
-
}
|
|
932
|
-
return function (/* ...args */) {
|
|
933
|
-
return fn.apply(that, arguments);
|
|
934
|
-
};
|
|
935
|
-
};
|
|
936
|
-
|
|
937
|
-
var call = Function.call;
|
|
938
|
-
|
|
939
|
-
var entryUnbind = function (CONSTRUCTOR, METHOD, length) {
|
|
940
|
-
return functionBindContext(call, global_1[CONSTRUCTOR].prototype[METHOD], length);
|
|
1019
|
+
var entryUnbind = function (CONSTRUCTOR, METHOD) {
|
|
1020
|
+
return functionUncurryThis(global_1[CONSTRUCTOR].prototype[METHOD]);
|
|
941
1021
|
};
|
|
942
1022
|
|
|
943
1023
|
entryUnbind('String', 'startsWith');
|
|
@@ -955,32 +1035,42 @@
|
|
|
955
1035
|
else object[propertyKey] = value;
|
|
956
1036
|
};
|
|
957
1037
|
|
|
1038
|
+
var noop$1 = function () { /* empty */ };
|
|
958
1039
|
var empty = [];
|
|
959
1040
|
var construct = getBuiltIn('Reflect', 'construct');
|
|
960
1041
|
var constructorRegExp = /^\s*(?:class|function)\b/;
|
|
961
|
-
var exec = constructorRegExp.exec;
|
|
962
|
-
var INCORRECT_TO_STRING = !constructorRegExp.exec(
|
|
1042
|
+
var exec = functionUncurryThis(constructorRegExp.exec);
|
|
1043
|
+
var INCORRECT_TO_STRING = !constructorRegExp.exec(noop$1);
|
|
963
1044
|
|
|
964
|
-
var isConstructorModern = function (argument) {
|
|
1045
|
+
var isConstructorModern = function isConstructor(argument) {
|
|
965
1046
|
if (!isCallable(argument)) return false;
|
|
966
1047
|
try {
|
|
967
|
-
construct(
|
|
1048
|
+
construct(noop$1, empty, argument);
|
|
968
1049
|
return true;
|
|
969
1050
|
} catch (error) {
|
|
970
1051
|
return false;
|
|
971
1052
|
}
|
|
972
1053
|
};
|
|
973
1054
|
|
|
974
|
-
var isConstructorLegacy = function (argument) {
|
|
1055
|
+
var isConstructorLegacy = function isConstructor(argument) {
|
|
975
1056
|
if (!isCallable(argument)) return false;
|
|
976
1057
|
switch (classof(argument)) {
|
|
977
1058
|
case 'AsyncFunction':
|
|
978
1059
|
case 'GeneratorFunction':
|
|
979
1060
|
case 'AsyncGeneratorFunction': return false;
|
|
1061
|
+
}
|
|
1062
|
+
try {
|
|
980
1063
|
// we can't check .prototype since constructors produced by .bind haven't it
|
|
981
|
-
|
|
1064
|
+
// `Function#toString` throws on some built-it function in some legacy engines
|
|
1065
|
+
// (for example, `DOMQuad` and similar in FF41-)
|
|
1066
|
+
return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
|
|
1067
|
+
} catch (error) {
|
|
1068
|
+
return true;
|
|
1069
|
+
}
|
|
982
1070
|
};
|
|
983
1071
|
|
|
1072
|
+
isConstructorLegacy.sham = true;
|
|
1073
|
+
|
|
984
1074
|
// `IsConstructor` abstract operation
|
|
985
1075
|
// https://tc39.es/ecma262/#sec-isconstructor
|
|
986
1076
|
var isConstructor = !construct || fails(function () {
|
|
@@ -992,6 +1082,7 @@
|
|
|
992
1082
|
}) ? isConstructorLegacy : isConstructorModern;
|
|
993
1083
|
|
|
994
1084
|
var SPECIES$3 = wellKnownSymbol('species');
|
|
1085
|
+
var Array$3 = global_1.Array;
|
|
995
1086
|
|
|
996
1087
|
// a part of `ArraySpeciesCreate` abstract operation
|
|
997
1088
|
// https://tc39.es/ecma262/#sec-arrayspeciescreate
|
|
@@ -1000,12 +1091,12 @@
|
|
|
1000
1091
|
if (isArray$1(originalArray)) {
|
|
1001
1092
|
C = originalArray.constructor;
|
|
1002
1093
|
// cross-realm fallback
|
|
1003
|
-
if (isConstructor(C) && (C === Array || isArray$1(C.prototype))) C = undefined;
|
|
1094
|
+
if (isConstructor(C) && (C === Array$3 || isArray$1(C.prototype))) C = undefined;
|
|
1004
1095
|
else if (isObject(C)) {
|
|
1005
1096
|
C = C[SPECIES$3];
|
|
1006
1097
|
if (C === null) C = undefined;
|
|
1007
1098
|
}
|
|
1008
|
-
} return C === undefined ? Array : C;
|
|
1099
|
+
} return C === undefined ? Array$3 : C;
|
|
1009
1100
|
};
|
|
1010
1101
|
|
|
1011
1102
|
// `ArraySpeciesCreate` abstract operation
|
|
@@ -1033,6 +1124,7 @@
|
|
|
1033
1124
|
var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
|
|
1034
1125
|
var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
|
|
1035
1126
|
var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
|
|
1127
|
+
var TypeError$8 = global_1.TypeError;
|
|
1036
1128
|
|
|
1037
1129
|
// We can't use this feature detection in V8 since it causes
|
|
1038
1130
|
// deoptimization and serious performance degradation
|
|
@@ -1067,10 +1159,10 @@
|
|
|
1067
1159
|
E = i === -1 ? O : arguments[i];
|
|
1068
1160
|
if (isConcatSpreadable(E)) {
|
|
1069
1161
|
len = lengthOfArrayLike(E);
|
|
1070
|
-
if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
|
1162
|
+
if (n + len > MAX_SAFE_INTEGER) throw TypeError$8(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
|
1071
1163
|
for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
|
|
1072
1164
|
} else {
|
|
1073
|
-
if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
|
1165
|
+
if (n >= MAX_SAFE_INTEGER) throw TypeError$8(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
|
1074
1166
|
createProperty(A, n++, E);
|
|
1075
1167
|
}
|
|
1076
1168
|
}
|
|
@@ -1091,6 +1183,15 @@
|
|
|
1091
1183
|
redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
|
|
1092
1184
|
}
|
|
1093
1185
|
|
|
1186
|
+
var FunctionPrototype = Function.prototype;
|
|
1187
|
+
var apply = FunctionPrototype.apply;
|
|
1188
|
+
var call = FunctionPrototype.call;
|
|
1189
|
+
|
|
1190
|
+
// eslint-disable-next-line es/no-reflect -- safe
|
|
1191
|
+
var functionApply = typeof Reflect == 'object' && Reflect.apply || (functionBindNative ? call.bind(apply) : function () {
|
|
1192
|
+
return call.apply(apply, arguments);
|
|
1193
|
+
});
|
|
1194
|
+
|
|
1094
1195
|
// `Object.keys` method
|
|
1095
1196
|
// https://tc39.es/ecma262/#sec-object.keys
|
|
1096
1197
|
// eslint-disable-next-line es/no-object-keys -- safe
|
|
@@ -1101,16 +1202,21 @@
|
|
|
1101
1202
|
// `Object.defineProperties` method
|
|
1102
1203
|
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
1103
1204
|
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
1104
|
-
var
|
|
1205
|
+
var f$2 = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
1105
1206
|
anObject(O);
|
|
1207
|
+
var props = toIndexedObject(Properties);
|
|
1106
1208
|
var keys = objectKeys(Properties);
|
|
1107
1209
|
var length = keys.length;
|
|
1108
1210
|
var index = 0;
|
|
1109
1211
|
var key;
|
|
1110
|
-
while (length > index) objectDefineProperty.f(O, key = keys[index++],
|
|
1212
|
+
while (length > index) objectDefineProperty.f(O, key = keys[index++], props[key]);
|
|
1111
1213
|
return O;
|
|
1112
1214
|
};
|
|
1113
1215
|
|
|
1216
|
+
var objectDefineProperties = {
|
|
1217
|
+
f: f$2
|
|
1218
|
+
};
|
|
1219
|
+
|
|
1114
1220
|
var html = getBuiltIn('document', 'documentElement');
|
|
1115
1221
|
|
|
1116
1222
|
/* global ActiveXObject -- old IE, WSH */
|
|
@@ -1193,14 +1299,27 @@
|
|
|
1193
1299
|
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
1194
1300
|
result[IE_PROTO$1] = O;
|
|
1195
1301
|
} else result = NullProtoObject();
|
|
1196
|
-
return Properties === undefined ? result : objectDefineProperties(result, Properties);
|
|
1302
|
+
return Properties === undefined ? result : objectDefineProperties.f(result, Properties);
|
|
1303
|
+
};
|
|
1304
|
+
|
|
1305
|
+
var Array$2 = global_1.Array;
|
|
1306
|
+
var max = Math.max;
|
|
1307
|
+
|
|
1308
|
+
var arraySliceSimple = function (O, start, end) {
|
|
1309
|
+
var length = lengthOfArrayLike(O);
|
|
1310
|
+
var k = toAbsoluteIndex(start, length);
|
|
1311
|
+
var fin = toAbsoluteIndex(end === undefined ? length : end, length);
|
|
1312
|
+
var result = Array$2(max(fin - k, 0));
|
|
1313
|
+
for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
|
|
1314
|
+
result.length = n;
|
|
1315
|
+
return result;
|
|
1197
1316
|
};
|
|
1198
1317
|
|
|
1199
1318
|
/* eslint-disable es/no-object-getownpropertynames -- safe */
|
|
1200
1319
|
|
|
1320
|
+
|
|
1201
1321
|
var $getOwnPropertyNames$1 = objectGetOwnPropertyNames.f;
|
|
1202
1322
|
|
|
1203
|
-
var toString = {}.toString;
|
|
1204
1323
|
|
|
1205
1324
|
var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
|
|
1206
1325
|
? Object.getOwnPropertyNames(window) : [];
|
|
@@ -1209,13 +1328,13 @@
|
|
|
1209
1328
|
try {
|
|
1210
1329
|
return $getOwnPropertyNames$1(it);
|
|
1211
1330
|
} catch (error) {
|
|
1212
|
-
return windowNames
|
|
1331
|
+
return arraySliceSimple(windowNames);
|
|
1213
1332
|
}
|
|
1214
1333
|
};
|
|
1215
1334
|
|
|
1216
1335
|
// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
|
|
1217
1336
|
var f$1 = function getOwnPropertyNames(it) {
|
|
1218
|
-
return windowNames &&
|
|
1337
|
+
return windowNames && classofRaw(it) == 'Window'
|
|
1219
1338
|
? getWindowNames(it)
|
|
1220
1339
|
: $getOwnPropertyNames$1(toIndexedObject(it));
|
|
1221
1340
|
};
|
|
@@ -1224,6 +1343,8 @@
|
|
|
1224
1343
|
f: f$1
|
|
1225
1344
|
};
|
|
1226
1345
|
|
|
1346
|
+
var arraySlice = functionUncurryThis([].slice);
|
|
1347
|
+
|
|
1227
1348
|
var f = wellKnownSymbol;
|
|
1228
1349
|
|
|
1229
1350
|
var wellKnownSymbolWrapped = {
|
|
@@ -1232,28 +1353,39 @@
|
|
|
1232
1353
|
|
|
1233
1354
|
var path = global_1;
|
|
1234
1355
|
|
|
1235
|
-
var defineProperty$
|
|
1356
|
+
var defineProperty$5 = objectDefineProperty.f;
|
|
1236
1357
|
|
|
1237
1358
|
var defineWellKnownSymbol = function (NAME) {
|
|
1238
1359
|
var Symbol = path.Symbol || (path.Symbol = {});
|
|
1239
|
-
if (!hasOwnProperty_1(Symbol, NAME)) defineProperty$
|
|
1360
|
+
if (!hasOwnProperty_1(Symbol, NAME)) defineProperty$5(Symbol, NAME, {
|
|
1240
1361
|
value: wellKnownSymbolWrapped.f(NAME)
|
|
1241
1362
|
});
|
|
1242
1363
|
};
|
|
1243
1364
|
|
|
1244
|
-
var defineProperty$
|
|
1365
|
+
var defineProperty$4 = objectDefineProperty.f;
|
|
1245
1366
|
|
|
1246
1367
|
|
|
1247
1368
|
|
|
1248
1369
|
var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
|
|
1249
1370
|
|
|
1250
|
-
var setToStringTag = function (
|
|
1251
|
-
if (
|
|
1252
|
-
|
|
1371
|
+
var setToStringTag = function (target, TAG, STATIC) {
|
|
1372
|
+
if (target && !STATIC) target = target.prototype;
|
|
1373
|
+
if (target && !hasOwnProperty_1(target, TO_STRING_TAG$1)) {
|
|
1374
|
+
defineProperty$4(target, TO_STRING_TAG$1, { configurable: true, value: TAG });
|
|
1253
1375
|
}
|
|
1254
1376
|
};
|
|
1255
1377
|
|
|
1256
|
-
var
|
|
1378
|
+
var bind$1 = functionUncurryThis(functionUncurryThis.bind);
|
|
1379
|
+
|
|
1380
|
+
// optional / simple context binding
|
|
1381
|
+
var functionBindContext = function (fn, that) {
|
|
1382
|
+
aCallable(fn);
|
|
1383
|
+
return that === undefined ? fn : functionBindNative ? bind$1(fn, that) : function (/* ...args */) {
|
|
1384
|
+
return fn.apply(that, arguments);
|
|
1385
|
+
};
|
|
1386
|
+
};
|
|
1387
|
+
|
|
1388
|
+
var push$1 = functionUncurryThis([].push);
|
|
1257
1389
|
|
|
1258
1390
|
// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
|
|
1259
1391
|
var createMethod$1 = function (TYPE) {
|
|
@@ -1267,7 +1399,7 @@
|
|
|
1267
1399
|
return function ($this, callbackfn, that, specificCreate) {
|
|
1268
1400
|
var O = toObject($this);
|
|
1269
1401
|
var self = indexedObject(O);
|
|
1270
|
-
var boundFunction = functionBindContext(callbackfn, that
|
|
1402
|
+
var boundFunction = functionBindContext(callbackfn, that);
|
|
1271
1403
|
var length = lengthOfArrayLike(self);
|
|
1272
1404
|
var index = 0;
|
|
1273
1405
|
var create = specificCreate || arraySpeciesCreate;
|
|
@@ -1282,10 +1414,10 @@
|
|
|
1282
1414
|
case 3: return true; // some
|
|
1283
1415
|
case 5: return value; // find
|
|
1284
1416
|
case 6: return index; // findIndex
|
|
1285
|
-
case 2: push
|
|
1417
|
+
case 2: push$1(target, value); // filter
|
|
1286
1418
|
} else switch (TYPE) {
|
|
1287
1419
|
case 4: return false; // every
|
|
1288
|
-
case 7: push
|
|
1420
|
+
case 7: push$1(target, value); // filterReject
|
|
1289
1421
|
}
|
|
1290
1422
|
}
|
|
1291
1423
|
}
|
|
@@ -1326,21 +1458,28 @@
|
|
|
1326
1458
|
var SYMBOL = 'Symbol';
|
|
1327
1459
|
var PROTOTYPE = 'prototype';
|
|
1328
1460
|
var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
|
1461
|
+
|
|
1329
1462
|
var setInternalState$3 = internalState.set;
|
|
1330
1463
|
var getInternalState$2 = internalState.getterFor(SYMBOL);
|
|
1464
|
+
|
|
1331
1465
|
var ObjectPrototype$2 = Object[PROTOTYPE];
|
|
1332
1466
|
var $Symbol = global_1.Symbol;
|
|
1467
|
+
var SymbolPrototype$1 = $Symbol && $Symbol[PROTOTYPE];
|
|
1468
|
+
var TypeError$7 = global_1.TypeError;
|
|
1469
|
+
var QObject = global_1.QObject;
|
|
1333
1470
|
var $stringify = getBuiltIn('JSON', 'stringify');
|
|
1334
1471
|
var nativeGetOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
1335
1472
|
var nativeDefineProperty = objectDefineProperty.f;
|
|
1336
1473
|
var nativeGetOwnPropertyNames = objectGetOwnPropertyNamesExternal.f;
|
|
1337
1474
|
var nativePropertyIsEnumerable = objectPropertyIsEnumerable.f;
|
|
1475
|
+
var push = functionUncurryThis([].push);
|
|
1476
|
+
|
|
1338
1477
|
var AllSymbols = shared('symbols');
|
|
1339
1478
|
var ObjectPrototypeSymbols = shared('op-symbols');
|
|
1340
1479
|
var StringToSymbolRegistry = shared('string-to-symbol-registry');
|
|
1341
1480
|
var SymbolToStringRegistry = shared('symbol-to-string-registry');
|
|
1342
1481
|
var WellKnownSymbolsStore = shared('wks');
|
|
1343
|
-
|
|
1482
|
+
|
|
1344
1483
|
// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
|
|
1345
1484
|
var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
|
|
1346
1485
|
|
|
@@ -1359,7 +1498,7 @@
|
|
|
1359
1498
|
} : nativeDefineProperty;
|
|
1360
1499
|
|
|
1361
1500
|
var wrap = function (tag, description) {
|
|
1362
|
-
var symbol = AllSymbols[tag] = objectCreate($
|
|
1501
|
+
var symbol = AllSymbols[tag] = objectCreate(SymbolPrototype$1);
|
|
1363
1502
|
setInternalState$3(symbol, {
|
|
1364
1503
|
type: SYMBOL,
|
|
1365
1504
|
tag: tag,
|
|
@@ -1390,7 +1529,7 @@
|
|
|
1390
1529
|
var properties = toIndexedObject(Properties);
|
|
1391
1530
|
var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
|
|
1392
1531
|
$forEach(keys, function (key) {
|
|
1393
|
-
if (!descriptors || $propertyIsEnumerable
|
|
1532
|
+
if (!descriptors || functionCall($propertyIsEnumerable, properties, key)) $defineProperty(O, key, properties[key]);
|
|
1394
1533
|
});
|
|
1395
1534
|
return O;
|
|
1396
1535
|
};
|
|
@@ -1401,7 +1540,7 @@
|
|
|
1401
1540
|
|
|
1402
1541
|
var $propertyIsEnumerable = function propertyIsEnumerable(V) {
|
|
1403
1542
|
var P = toPropertyKey(V);
|
|
1404
|
-
var enumerable = nativePropertyIsEnumerable
|
|
1543
|
+
var enumerable = functionCall(nativePropertyIsEnumerable, this, P);
|
|
1405
1544
|
if (this === ObjectPrototype$2 && hasOwnProperty_1(AllSymbols, P) && !hasOwnProperty_1(ObjectPrototypeSymbols, P)) return false;
|
|
1406
1545
|
return enumerable || !hasOwnProperty_1(this, P) || !hasOwnProperty_1(AllSymbols, P) || hasOwnProperty_1(this, HIDDEN) && this[HIDDEN][P]
|
|
1407
1546
|
? enumerable : true;
|
|
@@ -1422,7 +1561,7 @@
|
|
|
1422
1561
|
var names = nativeGetOwnPropertyNames(toIndexedObject(O));
|
|
1423
1562
|
var result = [];
|
|
1424
1563
|
$forEach(names, function (key) {
|
|
1425
|
-
if (!hasOwnProperty_1(AllSymbols, key) && !hasOwnProperty_1(hiddenKeys$1, key))
|
|
1564
|
+
if (!hasOwnProperty_1(AllSymbols, key) && !hasOwnProperty_1(hiddenKeys$1, key)) push(result, key);
|
|
1426
1565
|
});
|
|
1427
1566
|
return result;
|
|
1428
1567
|
};
|
|
@@ -1433,7 +1572,7 @@
|
|
|
1433
1572
|
var result = [];
|
|
1434
1573
|
$forEach(names, function (key) {
|
|
1435
1574
|
if (hasOwnProperty_1(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwnProperty_1(ObjectPrototype$2, key))) {
|
|
1436
|
-
|
|
1575
|
+
push(result, AllSymbols[key]);
|
|
1437
1576
|
}
|
|
1438
1577
|
});
|
|
1439
1578
|
return result;
|
|
@@ -1441,13 +1580,13 @@
|
|
|
1441
1580
|
|
|
1442
1581
|
// `Symbol` constructor
|
|
1443
1582
|
// https://tc39.es/ecma262/#sec-symbol-constructor
|
|
1444
|
-
if (!nativeSymbol
|
|
1583
|
+
if (!nativeSymbol) {
|
|
1445
1584
|
$Symbol = function Symbol() {
|
|
1446
|
-
if (this
|
|
1585
|
+
if (objectIsPrototypeOf(SymbolPrototype$1, this)) throw TypeError$7('Symbol is not a constructor');
|
|
1447
1586
|
var description = !arguments.length || arguments[0] === undefined ? undefined : toString_1(arguments[0]);
|
|
1448
1587
|
var tag = uid(description);
|
|
1449
1588
|
var setter = function (value) {
|
|
1450
|
-
if (this === ObjectPrototype$2) setter
|
|
1589
|
+
if (this === ObjectPrototype$2) functionCall(setter, ObjectPrototypeSymbols, value);
|
|
1451
1590
|
if (hasOwnProperty_1(this, HIDDEN) && hasOwnProperty_1(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
|
|
1452
1591
|
setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
|
|
1453
1592
|
};
|
|
@@ -1455,7 +1594,9 @@
|
|
|
1455
1594
|
return wrap(tag, description);
|
|
1456
1595
|
};
|
|
1457
1596
|
|
|
1458
|
-
|
|
1597
|
+
SymbolPrototype$1 = $Symbol[PROTOTYPE];
|
|
1598
|
+
|
|
1599
|
+
redefine(SymbolPrototype$1, 'toString', function toString() {
|
|
1459
1600
|
return getInternalState$2(this).tag;
|
|
1460
1601
|
});
|
|
1461
1602
|
|
|
@@ -1465,6 +1606,7 @@
|
|
|
1465
1606
|
|
|
1466
1607
|
objectPropertyIsEnumerable.f = $propertyIsEnumerable;
|
|
1467
1608
|
objectDefineProperty.f = $defineProperty;
|
|
1609
|
+
objectDefineProperties.f = $defineProperties;
|
|
1468
1610
|
objectGetOwnPropertyDescriptor.f = $getOwnPropertyDescriptor;
|
|
1469
1611
|
objectGetOwnPropertyNames.f = objectGetOwnPropertyNamesExternal.f = $getOwnPropertyNames;
|
|
1470
1612
|
objectGetOwnPropertySymbols.f = $getOwnPropertySymbols;
|
|
@@ -1475,7 +1617,7 @@
|
|
|
1475
1617
|
|
|
1476
1618
|
if (descriptors) {
|
|
1477
1619
|
// https://github.com/tc39/proposal-Symbol-description
|
|
1478
|
-
nativeDefineProperty($
|
|
1620
|
+
nativeDefineProperty(SymbolPrototype$1, 'description', {
|
|
1479
1621
|
configurable: true,
|
|
1480
1622
|
get: function description() {
|
|
1481
1623
|
return getInternalState$2(this).description;
|
|
@@ -1487,7 +1629,7 @@
|
|
|
1487
1629
|
}
|
|
1488
1630
|
}
|
|
1489
1631
|
|
|
1490
|
-
_export({ global: true, wrap: true, forced: !nativeSymbol
|
|
1632
|
+
_export({ global: true, wrap: true, forced: !nativeSymbol, sham: !nativeSymbol }, {
|
|
1491
1633
|
Symbol: $Symbol
|
|
1492
1634
|
});
|
|
1493
1635
|
|
|
@@ -1495,7 +1637,7 @@
|
|
|
1495
1637
|
defineWellKnownSymbol(name);
|
|
1496
1638
|
});
|
|
1497
1639
|
|
|
1498
|
-
_export({ target: SYMBOL, stat: true, forced: !nativeSymbol
|
|
1640
|
+
_export({ target: SYMBOL, stat: true, forced: !nativeSymbol }, {
|
|
1499
1641
|
// `Symbol.for` method
|
|
1500
1642
|
// https://tc39.es/ecma262/#sec-symbol.for
|
|
1501
1643
|
'for': function (key) {
|
|
@@ -1509,14 +1651,14 @@
|
|
|
1509
1651
|
// `Symbol.keyFor` method
|
|
1510
1652
|
// https://tc39.es/ecma262/#sec-symbol.keyfor
|
|
1511
1653
|
keyFor: function keyFor(sym) {
|
|
1512
|
-
if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');
|
|
1654
|
+
if (!isSymbol(sym)) throw TypeError$7(sym + ' is not a symbol');
|
|
1513
1655
|
if (hasOwnProperty_1(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
|
|
1514
1656
|
},
|
|
1515
1657
|
useSetter: function () { USE_SETTER = true; },
|
|
1516
1658
|
useSimple: function () { USE_SETTER = false; }
|
|
1517
1659
|
});
|
|
1518
1660
|
|
|
1519
|
-
_export({ target: 'Object', stat: true, forced: !nativeSymbol
|
|
1661
|
+
_export({ target: 'Object', stat: true, forced: !nativeSymbol, sham: !descriptors }, {
|
|
1520
1662
|
// `Object.create` method
|
|
1521
1663
|
// https://tc39.es/ecma262/#sec-object.create
|
|
1522
1664
|
create: $create,
|
|
@@ -1531,7 +1673,7 @@
|
|
|
1531
1673
|
getOwnPropertyDescriptor: $getOwnPropertyDescriptor
|
|
1532
1674
|
});
|
|
1533
1675
|
|
|
1534
|
-
_export({ target: 'Object', stat: true, forced: !nativeSymbol
|
|
1676
|
+
_export({ target: 'Object', stat: true, forced: !nativeSymbol }, {
|
|
1535
1677
|
// `Object.getOwnPropertyNames` method
|
|
1536
1678
|
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
1537
1679
|
getOwnPropertyNames: $getOwnPropertyNames,
|
|
@@ -1551,7 +1693,7 @@
|
|
|
1551
1693
|
// `JSON.stringify` method behavior with symbols
|
|
1552
1694
|
// https://tc39.es/ecma262/#sec-json.stringify
|
|
1553
1695
|
if ($stringify) {
|
|
1554
|
-
var FORCED_JSON_STRINGIFY = !nativeSymbol
|
|
1696
|
+
var FORCED_JSON_STRINGIFY = !nativeSymbol || fails(function () {
|
|
1555
1697
|
var symbol = $Symbol();
|
|
1556
1698
|
// MS Edge converts symbol values to JSON as {}
|
|
1557
1699
|
return $stringify([symbol]) != '[null]'
|
|
@@ -1564,28 +1706,27 @@
|
|
|
1564
1706
|
_export({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, {
|
|
1565
1707
|
// eslint-disable-next-line no-unused-vars -- required for `.length`
|
|
1566
1708
|
stringify: function stringify(it, replacer, space) {
|
|
1567
|
-
var args =
|
|
1568
|
-
var
|
|
1569
|
-
var $replacer;
|
|
1570
|
-
while (arguments.length > index) args.push(arguments[index++]);
|
|
1571
|
-
$replacer = replacer;
|
|
1709
|
+
var args = arraySlice(arguments);
|
|
1710
|
+
var $replacer = replacer;
|
|
1572
1711
|
if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
|
|
1573
1712
|
if (!isArray$1(replacer)) replacer = function (key, value) {
|
|
1574
|
-
if (isCallable($replacer)) value = $replacer
|
|
1713
|
+
if (isCallable($replacer)) value = functionCall($replacer, this, key, value);
|
|
1575
1714
|
if (!isSymbol(value)) return value;
|
|
1576
1715
|
};
|
|
1577
1716
|
args[1] = replacer;
|
|
1578
|
-
return $stringify
|
|
1717
|
+
return functionApply($stringify, null, args);
|
|
1579
1718
|
}
|
|
1580
1719
|
});
|
|
1581
1720
|
}
|
|
1582
1721
|
|
|
1583
1722
|
// `Symbol.prototype[@@toPrimitive]` method
|
|
1584
1723
|
// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
|
|
1585
|
-
if (
|
|
1586
|
-
var valueOf = $
|
|
1587
|
-
|
|
1588
|
-
|
|
1724
|
+
if (!SymbolPrototype$1[TO_PRIMITIVE]) {
|
|
1725
|
+
var valueOf = SymbolPrototype$1.valueOf;
|
|
1726
|
+
// eslint-disable-next-line no-unused-vars -- required for .length
|
|
1727
|
+
redefine(SymbolPrototype$1, TO_PRIMITIVE, function (hint) {
|
|
1728
|
+
// TODO: improve hint logic
|
|
1729
|
+
return functionCall(valueOf, this);
|
|
1589
1730
|
});
|
|
1590
1731
|
}
|
|
1591
1732
|
// `Symbol.prototype[@@toStringTag]` property
|
|
@@ -1598,40 +1739,46 @@
|
|
|
1598
1739
|
// https://tc39.es/ecma262/#sec-symbol.asynciterator
|
|
1599
1740
|
defineWellKnownSymbol('asyncIterator');
|
|
1600
1741
|
|
|
1601
|
-
var defineProperty$
|
|
1742
|
+
var defineProperty$3 = objectDefineProperty.f;
|
|
1602
1743
|
|
|
1603
1744
|
|
|
1604
1745
|
var NativeSymbol = global_1.Symbol;
|
|
1746
|
+
var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
|
|
1605
1747
|
|
|
1606
|
-
if (descriptors && isCallable(NativeSymbol) && (!('description' in
|
|
1748
|
+
if (descriptors && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) ||
|
|
1607
1749
|
// Safari 12 bug
|
|
1608
1750
|
NativeSymbol().description !== undefined
|
|
1609
1751
|
)) {
|
|
1610
1752
|
var EmptyStringDescriptionStore = {};
|
|
1611
1753
|
// wrap Symbol constructor for correct work with undefined description
|
|
1612
1754
|
var SymbolWrapper = function Symbol() {
|
|
1613
|
-
var description = arguments.length < 1 || arguments[0] === undefined ? undefined :
|
|
1614
|
-
var result = this
|
|
1755
|
+
var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString_1(arguments[0]);
|
|
1756
|
+
var result = objectIsPrototypeOf(SymbolPrototype, this)
|
|
1615
1757
|
? new NativeSymbol(description)
|
|
1616
1758
|
// in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
|
|
1617
1759
|
: description === undefined ? NativeSymbol() : NativeSymbol(description);
|
|
1618
1760
|
if (description === '') EmptyStringDescriptionStore[result] = true;
|
|
1619
1761
|
return result;
|
|
1620
1762
|
};
|
|
1763
|
+
|
|
1621
1764
|
copyConstructorProperties(SymbolWrapper, NativeSymbol);
|
|
1622
|
-
|
|
1623
|
-
|
|
1765
|
+
SymbolWrapper.prototype = SymbolPrototype;
|
|
1766
|
+
SymbolPrototype.constructor = SymbolWrapper;
|
|
1624
1767
|
|
|
1625
|
-
var
|
|
1626
|
-
var
|
|
1768
|
+
var NATIVE_SYMBOL = String(NativeSymbol('test')) == 'Symbol(test)';
|
|
1769
|
+
var symbolToString = functionUncurryThis(SymbolPrototype.toString);
|
|
1770
|
+
var symbolValueOf = functionUncurryThis(SymbolPrototype.valueOf);
|
|
1627
1771
|
var regexp = /^Symbol\((.*)\)[^)]+$/;
|
|
1628
|
-
|
|
1772
|
+
var replace = functionUncurryThis(''.replace);
|
|
1773
|
+
var stringSlice$1 = functionUncurryThis(''.slice);
|
|
1774
|
+
|
|
1775
|
+
defineProperty$3(SymbolPrototype, 'description', {
|
|
1629
1776
|
configurable: true,
|
|
1630
1777
|
get: function description() {
|
|
1631
|
-
var symbol =
|
|
1632
|
-
var string = symbolToString
|
|
1778
|
+
var symbol = symbolValueOf(this);
|
|
1779
|
+
var string = symbolToString(symbol);
|
|
1633
1780
|
if (hasOwnProperty_1(EmptyStringDescriptionStore, symbol)) return '';
|
|
1634
|
-
var desc =
|
|
1781
|
+
var desc = NATIVE_SYMBOL ? stringSlice$1(string, 7, -1) : replace(string, regexp, '$1');
|
|
1635
1782
|
return desc === '' ? undefined : desc;
|
|
1636
1783
|
}
|
|
1637
1784
|
});
|
|
@@ -1705,6 +1852,10 @@
|
|
|
1705
1852
|
|
|
1706
1853
|
path.Symbol;
|
|
1707
1854
|
|
|
1855
|
+
var charAt$1 = functionUncurryThis(''.charAt);
|
|
1856
|
+
var charCodeAt = functionUncurryThis(''.charCodeAt);
|
|
1857
|
+
var stringSlice = functionUncurryThis(''.slice);
|
|
1858
|
+
|
|
1708
1859
|
var createMethod = function (CONVERT_TO_STRING) {
|
|
1709
1860
|
return function ($this, pos) {
|
|
1710
1861
|
var S = toString_1(requireObjectCoercible($this));
|
|
@@ -1712,11 +1863,15 @@
|
|
|
1712
1863
|
var size = S.length;
|
|
1713
1864
|
var first, second;
|
|
1714
1865
|
if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
|
1715
|
-
first =
|
|
1866
|
+
first = charCodeAt(S, position);
|
|
1716
1867
|
return first < 0xD800 || first > 0xDBFF || position + 1 === size
|
|
1717
|
-
|| (second =
|
|
1718
|
-
? CONVERT_TO_STRING
|
|
1719
|
-
|
|
1868
|
+
|| (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
|
|
1869
|
+
? CONVERT_TO_STRING
|
|
1870
|
+
? charAt$1(S, position)
|
|
1871
|
+
: first
|
|
1872
|
+
: CONVERT_TO_STRING
|
|
1873
|
+
? stringSlice(S, position, position + 2)
|
|
1874
|
+
: (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
|
1720
1875
|
};
|
|
1721
1876
|
};
|
|
1722
1877
|
|
|
@@ -1737,18 +1892,18 @@
|
|
|
1737
1892
|
});
|
|
1738
1893
|
|
|
1739
1894
|
var IE_PROTO = sharedKey('IE_PROTO');
|
|
1740
|
-
var
|
|
1895
|
+
var Object$1 = global_1.Object;
|
|
1896
|
+
var ObjectPrototype$1 = Object$1.prototype;
|
|
1741
1897
|
|
|
1742
1898
|
// `Object.getPrototypeOf` method
|
|
1743
1899
|
// https://tc39.es/ecma262/#sec-object.getprototypeof
|
|
1744
|
-
|
|
1745
|
-
var objectGetPrototypeOf = correctPrototypeGetter ? Object.getPrototypeOf : function (O) {
|
|
1900
|
+
var objectGetPrototypeOf = correctPrototypeGetter ? Object$1.getPrototypeOf : function (O) {
|
|
1746
1901
|
var object = toObject(O);
|
|
1747
1902
|
if (hasOwnProperty_1(object, IE_PROTO)) return object[IE_PROTO];
|
|
1748
1903
|
var constructor = object.constructor;
|
|
1749
1904
|
if (isCallable(constructor) && object instanceof constructor) {
|
|
1750
1905
|
return constructor.prototype;
|
|
1751
|
-
} return object instanceof Object ? ObjectPrototype$1 : null;
|
|
1906
|
+
} return object instanceof Object$1 ? ObjectPrototype$1 : null;
|
|
1752
1907
|
};
|
|
1753
1908
|
|
|
1754
1909
|
var ITERATOR$4 = wellKnownSymbol('iterator');
|
|
@@ -1800,23 +1955,27 @@
|
|
|
1800
1955
|
|
|
1801
1956
|
var returnThis$1 = function () { return this; };
|
|
1802
1957
|
|
|
1803
|
-
var createIteratorConstructor = function (IteratorConstructor, NAME, next) {
|
|
1958
|
+
var createIteratorConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
|
|
1804
1959
|
var TO_STRING_TAG = NAME + ' Iterator';
|
|
1805
|
-
IteratorConstructor.prototype = objectCreate(IteratorPrototype$1, { next: createPropertyDescriptor(
|
|
1960
|
+
IteratorConstructor.prototype = objectCreate(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
|
|
1806
1961
|
setToStringTag(IteratorConstructor, TO_STRING_TAG, false);
|
|
1807
1962
|
iterators[TO_STRING_TAG] = returnThis$1;
|
|
1808
1963
|
return IteratorConstructor;
|
|
1809
1964
|
};
|
|
1810
1965
|
|
|
1966
|
+
var String$1 = global_1.String;
|
|
1967
|
+
var TypeError$6 = global_1.TypeError;
|
|
1968
|
+
|
|
1811
1969
|
var aPossiblePrototype = function (argument) {
|
|
1812
|
-
if (typeof argument
|
|
1813
|
-
throw TypeError("Can't set " + String(argument) + ' as a prototype');
|
|
1970
|
+
if (typeof argument == 'object' || isCallable(argument)) return argument;
|
|
1971
|
+
throw TypeError$6("Can't set " + String$1(argument) + ' as a prototype');
|
|
1814
1972
|
};
|
|
1815
1973
|
|
|
1816
1974
|
/* eslint-disable no-proto -- safe */
|
|
1817
1975
|
|
|
1818
1976
|
|
|
1819
1977
|
|
|
1978
|
+
|
|
1820
1979
|
// `Object.setPrototypeOf` method
|
|
1821
1980
|
// https://tc39.es/ecma262/#sec-object.setprototypeof
|
|
1822
1981
|
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
@@ -1827,14 +1986,14 @@
|
|
|
1827
1986
|
var setter;
|
|
1828
1987
|
try {
|
|
1829
1988
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
1830
|
-
setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
|
|
1831
|
-
setter
|
|
1989
|
+
setter = functionUncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
|
1990
|
+
setter(test, []);
|
|
1832
1991
|
CORRECT_SETTER = test instanceof Array;
|
|
1833
1992
|
} catch (error) { /* empty */ }
|
|
1834
1993
|
return function setPrototypeOf(O, proto) {
|
|
1835
1994
|
anObject(O);
|
|
1836
1995
|
aPossiblePrototype(proto);
|
|
1837
|
-
if (CORRECT_SETTER) setter
|
|
1996
|
+
if (CORRECT_SETTER) setter(O, proto);
|
|
1838
1997
|
else O.__proto__ = proto;
|
|
1839
1998
|
return O;
|
|
1840
1999
|
};
|
|
@@ -1896,7 +2055,7 @@
|
|
|
1896
2055
|
createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
|
|
1897
2056
|
} else {
|
|
1898
2057
|
INCORRECT_VALUES_NAME = true;
|
|
1899
|
-
defaultIterator = function values() { return nativeIterator
|
|
2058
|
+
defaultIterator = function values() { return functionCall(nativeIterator, this); };
|
|
1900
2059
|
}
|
|
1901
2060
|
}
|
|
1902
2061
|
|
|
@@ -1962,7 +2121,7 @@
|
|
|
1962
2121
|
if (kind === 'throw') throw value;
|
|
1963
2122
|
return value;
|
|
1964
2123
|
}
|
|
1965
|
-
innerResult = innerResult
|
|
2124
|
+
innerResult = functionCall(innerResult, iterator);
|
|
1966
2125
|
} catch (error) {
|
|
1967
2126
|
innerError = true;
|
|
1968
2127
|
innerResult = error;
|
|
@@ -1998,12 +2157,16 @@
|
|
|
1998
2157
|
|| iterators[classof(it)];
|
|
1999
2158
|
};
|
|
2000
2159
|
|
|
2160
|
+
var TypeError$5 = global_1.TypeError;
|
|
2161
|
+
|
|
2001
2162
|
var getIterator = function (argument, usingIterator) {
|
|
2002
2163
|
var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
|
|
2003
|
-
if (aCallable(iteratorMethod)) return anObject(iteratorMethod
|
|
2004
|
-
throw TypeError(
|
|
2164
|
+
if (aCallable(iteratorMethod)) return anObject(functionCall(iteratorMethod, argument));
|
|
2165
|
+
throw TypeError$5(tryToString(argument) + ' is not iterable');
|
|
2005
2166
|
};
|
|
2006
2167
|
|
|
2168
|
+
var Array$1 = global_1.Array;
|
|
2169
|
+
|
|
2007
2170
|
// `Array.from` method implementation
|
|
2008
2171
|
// https://tc39.es/ecma262/#sec-array.from
|
|
2009
2172
|
var arrayFrom = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
|
|
@@ -2012,22 +2175,22 @@
|
|
|
2012
2175
|
var argumentsLength = arguments.length;
|
|
2013
2176
|
var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
|
|
2014
2177
|
var mapping = mapfn !== undefined;
|
|
2015
|
-
if (mapping) mapfn = functionBindContext(mapfn, argumentsLength > 2 ? arguments[2] : undefined
|
|
2178
|
+
if (mapping) mapfn = functionBindContext(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
|
|
2016
2179
|
var iteratorMethod = getIteratorMethod(O);
|
|
2017
2180
|
var index = 0;
|
|
2018
2181
|
var length, result, step, iterator, next, value;
|
|
2019
2182
|
// if the target is not iterable or it's an array with the default iterator - use a simple case
|
|
2020
|
-
if (iteratorMethod && !(this == Array && isArrayIteratorMethod(iteratorMethod))) {
|
|
2183
|
+
if (iteratorMethod && !(this == Array$1 && isArrayIteratorMethod(iteratorMethod))) {
|
|
2021
2184
|
iterator = getIterator(O, iteratorMethod);
|
|
2022
2185
|
next = iterator.next;
|
|
2023
2186
|
result = IS_CONSTRUCTOR ? new this() : [];
|
|
2024
|
-
for (;!(step = next
|
|
2187
|
+
for (;!(step = functionCall(next, iterator)).done; index++) {
|
|
2025
2188
|
value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
|
|
2026
2189
|
createProperty(result, index, value);
|
|
2027
2190
|
}
|
|
2028
2191
|
} else {
|
|
2029
2192
|
length = lengthOfArrayLike(O);
|
|
2030
|
-
result = IS_CONSTRUCTOR ? new this(length) : Array(length);
|
|
2193
|
+
result = IS_CONSTRUCTOR ? new this(length) : Array$1(length);
|
|
2031
2194
|
for (;length > index; index++) {
|
|
2032
2195
|
value = mapping ? mapfn(O[index], index) : O[index];
|
|
2033
2196
|
createProperty(result, index, value);
|
|
@@ -2088,9 +2251,10 @@
|
|
|
2088
2251
|
path.Array.from;
|
|
2089
2252
|
|
|
2090
2253
|
// eslint-disable-next-line es/no-typed-arrays -- safe
|
|
2091
|
-
var arrayBufferNative = typeof ArrayBuffer
|
|
2254
|
+
var arrayBufferNative = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';
|
|
2255
|
+
|
|
2256
|
+
var defineProperty$2 = objectDefineProperty.f;
|
|
2092
2257
|
|
|
2093
|
-
var defineProperty$1 = objectDefineProperty.f;
|
|
2094
2258
|
|
|
2095
2259
|
|
|
2096
2260
|
|
|
@@ -2103,14 +2267,14 @@
|
|
|
2103
2267
|
var TypedArray = Int8Array$1 && objectGetPrototypeOf(Int8Array$1);
|
|
2104
2268
|
var TypedArrayPrototype = Int8ArrayPrototype && objectGetPrototypeOf(Int8ArrayPrototype);
|
|
2105
2269
|
var ObjectPrototype = Object.prototype;
|
|
2106
|
-
var
|
|
2270
|
+
var TypeError$4 = global_1.TypeError;
|
|
2107
2271
|
|
|
2108
2272
|
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
|
2109
2273
|
var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');
|
|
2110
2274
|
var TYPED_ARRAY_CONSTRUCTOR$1 = uid('TYPED_ARRAY_CONSTRUCTOR');
|
|
2111
2275
|
// Fixing native typed arrays in Opera Presto crashes the browser, see #595
|
|
2112
2276
|
var NATIVE_ARRAY_BUFFER_VIEWS = arrayBufferNative && !!objectSetPrototypeOf && classof(global_1.opera) !== 'Opera';
|
|
2113
|
-
var
|
|
2277
|
+
var TYPED_ARRAY_TAG_REQUIRED = false;
|
|
2114
2278
|
var NAME, Constructor, Prototype;
|
|
2115
2279
|
|
|
2116
2280
|
var TypedArrayConstructorsList = {
|
|
@@ -2147,25 +2311,30 @@
|
|
|
2147
2311
|
|
|
2148
2312
|
var aTypedArray$1 = function (it) {
|
|
2149
2313
|
if (isTypedArray(it)) return it;
|
|
2150
|
-
throw TypeError('Target is not a typed array');
|
|
2314
|
+
throw TypeError$4('Target is not a typed array');
|
|
2151
2315
|
};
|
|
2152
2316
|
|
|
2153
2317
|
var aTypedArrayConstructor$1 = function (C) {
|
|
2154
|
-
if (isCallable(C) && (!objectSetPrototypeOf ||
|
|
2155
|
-
throw TypeError(tryToString(C) + ' is not a typed array constructor');
|
|
2318
|
+
if (isCallable(C) && (!objectSetPrototypeOf || objectIsPrototypeOf(TypedArray, C))) return C;
|
|
2319
|
+
throw TypeError$4(tryToString(C) + ' is not a typed array constructor');
|
|
2156
2320
|
};
|
|
2157
2321
|
|
|
2158
|
-
var exportTypedArrayMethod$1 = function (KEY, property, forced) {
|
|
2322
|
+
var exportTypedArrayMethod$1 = function (KEY, property, forced, options) {
|
|
2159
2323
|
if (!descriptors) return;
|
|
2160
2324
|
if (forced) for (var ARRAY in TypedArrayConstructorsList) {
|
|
2161
2325
|
var TypedArrayConstructor = global_1[ARRAY];
|
|
2162
2326
|
if (TypedArrayConstructor && hasOwnProperty_1(TypedArrayConstructor.prototype, KEY)) try {
|
|
2163
2327
|
delete TypedArrayConstructor.prototype[KEY];
|
|
2164
|
-
} catch (error) {
|
|
2328
|
+
} catch (error) {
|
|
2329
|
+
// old WebKit bug - some methods are non-configurable
|
|
2330
|
+
try {
|
|
2331
|
+
TypedArrayConstructor.prototype[KEY] = property;
|
|
2332
|
+
} catch (error2) { /* empty */ }
|
|
2333
|
+
}
|
|
2165
2334
|
}
|
|
2166
2335
|
if (!TypedArrayPrototype[KEY] || forced) {
|
|
2167
2336
|
redefine(TypedArrayPrototype, KEY, forced ? property
|
|
2168
|
-
: NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property);
|
|
2337
|
+
: NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property, options);
|
|
2169
2338
|
}
|
|
2170
2339
|
};
|
|
2171
2340
|
|
|
@@ -2211,7 +2380,7 @@
|
|
|
2211
2380
|
if (!NATIVE_ARRAY_BUFFER_VIEWS || !isCallable(TypedArray) || TypedArray === Function.prototype) {
|
|
2212
2381
|
// eslint-disable-next-line no-shadow -- safe
|
|
2213
2382
|
TypedArray = function TypedArray() {
|
|
2214
|
-
throw TypeError('Incorrect invocation');
|
|
2383
|
+
throw TypeError$4('Incorrect invocation');
|
|
2215
2384
|
};
|
|
2216
2385
|
if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
|
|
2217
2386
|
if (global_1[NAME]) objectSetPrototypeOf(global_1[NAME], TypedArray);
|
|
@@ -2231,8 +2400,8 @@
|
|
|
2231
2400
|
}
|
|
2232
2401
|
|
|
2233
2402
|
if (descriptors && !hasOwnProperty_1(TypedArrayPrototype, TO_STRING_TAG)) {
|
|
2234
|
-
|
|
2235
|
-
defineProperty$
|
|
2403
|
+
TYPED_ARRAY_TAG_REQUIRED = true;
|
|
2404
|
+
defineProperty$2(TypedArrayPrototype, TO_STRING_TAG, { get: function () {
|
|
2236
2405
|
return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined;
|
|
2237
2406
|
} });
|
|
2238
2407
|
for (NAME in TypedArrayConstructorsList) if (global_1[NAME]) {
|
|
@@ -2243,7 +2412,7 @@
|
|
|
2243
2412
|
var arrayBufferViewCore = {
|
|
2244
2413
|
NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS,
|
|
2245
2414
|
TYPED_ARRAY_CONSTRUCTOR: TYPED_ARRAY_CONSTRUCTOR$1,
|
|
2246
|
-
TYPED_ARRAY_TAG:
|
|
2415
|
+
TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQUIRED && TYPED_ARRAY_TAG,
|
|
2247
2416
|
aTypedArray: aTypedArray$1,
|
|
2248
2417
|
aTypedArrayConstructor: aTypedArrayConstructor$1,
|
|
2249
2418
|
exportTypedArrayMethod: exportTypedArrayMethod$1,
|
|
@@ -2254,10 +2423,12 @@
|
|
|
2254
2423
|
TypedArrayPrototype: TypedArrayPrototype
|
|
2255
2424
|
};
|
|
2256
2425
|
|
|
2426
|
+
var TypeError$3 = global_1.TypeError;
|
|
2427
|
+
|
|
2257
2428
|
// `Assert: IsConstructor(argument) is true`
|
|
2258
2429
|
var aConstructor = function (argument) {
|
|
2259
2430
|
if (isConstructor(argument)) return argument;
|
|
2260
|
-
throw TypeError(tryToString(argument) + ' is not a constructor');
|
|
2431
|
+
throw TypeError$3(tryToString(argument) + ' is not a constructor');
|
|
2261
2432
|
};
|
|
2262
2433
|
|
|
2263
2434
|
var SPECIES$1 = wellKnownSymbol('species');
|
|
@@ -2281,7 +2452,6 @@
|
|
|
2281
2452
|
|
|
2282
2453
|
var aTypedArray = arrayBufferViewCore.aTypedArray;
|
|
2283
2454
|
var exportTypedArrayMethod = arrayBufferViewCore.exportTypedArrayMethod;
|
|
2284
|
-
var $slice = [].slice;
|
|
2285
2455
|
|
|
2286
2456
|
var FORCED = fails(function () {
|
|
2287
2457
|
// eslint-disable-next-line es/no-typed-arrays -- required for testing
|
|
@@ -2291,7 +2461,7 @@
|
|
|
2291
2461
|
// `%TypedArray%.prototype.slice` method
|
|
2292
2462
|
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.slice
|
|
2293
2463
|
exportTypedArrayMethod('slice', function slice(start, end) {
|
|
2294
|
-
var list =
|
|
2464
|
+
var list = arraySlice(aTypedArray(this), start, end);
|
|
2295
2465
|
var C = typedArraySpeciesConstructor(this);
|
|
2296
2466
|
var index = 0;
|
|
2297
2467
|
var length = list.length;
|
|
@@ -2333,17 +2503,27 @@
|
|
|
2333
2503
|
|
|
2334
2504
|
entryUnbind('Array', 'includes');
|
|
2335
2505
|
|
|
2506
|
+
var stringIndexOf = functionUncurryThis(''.indexOf);
|
|
2507
|
+
|
|
2336
2508
|
// `String.prototype.includes` method
|
|
2337
2509
|
// https://tc39.es/ecma262/#sec-string.prototype.includes
|
|
2338
2510
|
_export({ target: 'String', proto: true, forced: !correctIsRegexpLogic('includes') }, {
|
|
2339
2511
|
includes: function includes(searchString /* , position = 0 */) {
|
|
2340
|
-
return !!~
|
|
2341
|
-
|
|
2512
|
+
return !!~stringIndexOf(
|
|
2513
|
+
toString_1(requireObjectCoercible(this)),
|
|
2514
|
+
toString_1(notARegexp(searchString)),
|
|
2515
|
+
arguments.length > 1 ? arguments[1] : undefined
|
|
2516
|
+
);
|
|
2342
2517
|
}
|
|
2343
2518
|
});
|
|
2344
2519
|
|
|
2345
2520
|
entryUnbind('String', 'includes');
|
|
2346
2521
|
|
|
2522
|
+
var defineProperty$1 = objectDefineProperty.f;
|
|
2523
|
+
|
|
2524
|
+
|
|
2525
|
+
|
|
2526
|
+
|
|
2347
2527
|
var ARRAY_ITERATOR = 'Array Iterator';
|
|
2348
2528
|
var setInternalState$1 = internalState.set;
|
|
2349
2529
|
var getInternalState = internalState.getterFor(ARRAY_ITERATOR);
|
|
@@ -2384,13 +2564,41 @@
|
|
|
2384
2564
|
// argumentsList[@@iterator] is %ArrayProto_values%
|
|
2385
2565
|
// https://tc39.es/ecma262/#sec-createunmappedargumentsobject
|
|
2386
2566
|
// https://tc39.es/ecma262/#sec-createmappedargumentsobject
|
|
2387
|
-
iterators.Arguments = iterators.Array;
|
|
2567
|
+
var values = iterators.Arguments = iterators.Array;
|
|
2388
2568
|
|
|
2389
2569
|
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
2390
2570
|
addToUnscopables('keys');
|
|
2391
2571
|
addToUnscopables('values');
|
|
2392
2572
|
addToUnscopables('entries');
|
|
2393
2573
|
|
|
2574
|
+
// V8 ~ Chrome 45- bug
|
|
2575
|
+
if (descriptors && values.name !== 'values') try {
|
|
2576
|
+
defineProperty$1(values, 'name', { value: 'values' });
|
|
2577
|
+
} catch (error) { /* empty */ }
|
|
2578
|
+
|
|
2579
|
+
// FF26- bug: ArrayBuffers are non-extensible, but Object.isExtensible does not report it
|
|
2580
|
+
|
|
2581
|
+
|
|
2582
|
+
var arrayBufferNonExtensible = fails(function () {
|
|
2583
|
+
if (typeof ArrayBuffer == 'function') {
|
|
2584
|
+
var buffer = new ArrayBuffer(8);
|
|
2585
|
+
// eslint-disable-next-line es/no-object-isextensible, es/no-object-defineproperty -- safe
|
|
2586
|
+
if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 });
|
|
2587
|
+
}
|
|
2588
|
+
});
|
|
2589
|
+
|
|
2590
|
+
// eslint-disable-next-line es/no-object-isextensible -- safe
|
|
2591
|
+
var $isExtensible = Object.isExtensible;
|
|
2592
|
+
var FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); });
|
|
2593
|
+
|
|
2594
|
+
// `Object.isExtensible` method
|
|
2595
|
+
// https://tc39.es/ecma262/#sec-object.isextensible
|
|
2596
|
+
var objectIsExtensible = (FAILS_ON_PRIMITIVES || arrayBufferNonExtensible) ? function isExtensible(it) {
|
|
2597
|
+
if (!isObject(it)) return false;
|
|
2598
|
+
if (arrayBufferNonExtensible && classofRaw(it) == 'ArrayBuffer') return false;
|
|
2599
|
+
return $isExtensible ? $isExtensible(it) : true;
|
|
2600
|
+
} : $isExtensible;
|
|
2601
|
+
|
|
2394
2602
|
var freezing = !fails(function () {
|
|
2395
2603
|
// eslint-disable-next-line es/no-object-isextensible, es/no-object-preventextensions -- required for testing
|
|
2396
2604
|
return Object.isExtensible(Object.preventExtensions({}));
|
|
@@ -2403,15 +2611,11 @@
|
|
|
2403
2611
|
|
|
2404
2612
|
|
|
2405
2613
|
|
|
2614
|
+
|
|
2406
2615
|
var REQUIRED = false;
|
|
2407
2616
|
var METADATA = uid('meta');
|
|
2408
2617
|
var id = 0;
|
|
2409
2618
|
|
|
2410
|
-
// eslint-disable-next-line es/no-object-isextensible -- safe
|
|
2411
|
-
var isExtensible = Object.isExtensible || function () {
|
|
2412
|
-
return true;
|
|
2413
|
-
};
|
|
2414
|
-
|
|
2415
2619
|
var setMetadata = function (it) {
|
|
2416
2620
|
defineProperty(it, METADATA, { value: {
|
|
2417
2621
|
objectID: 'O' + id++, // object ID
|
|
@@ -2424,7 +2628,7 @@
|
|
|
2424
2628
|
if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
|
|
2425
2629
|
if (!hasOwnProperty_1(it, METADATA)) {
|
|
2426
2630
|
// can't set metadata to uncaught frozen object
|
|
2427
|
-
if (!
|
|
2631
|
+
if (!objectIsExtensible(it)) return 'F';
|
|
2428
2632
|
// not necessary to add metadata
|
|
2429
2633
|
if (!create) return 'E';
|
|
2430
2634
|
// add missing metadata
|
|
@@ -2436,7 +2640,7 @@
|
|
|
2436
2640
|
var getWeakData = function (it, create) {
|
|
2437
2641
|
if (!hasOwnProperty_1(it, METADATA)) {
|
|
2438
2642
|
// can't set metadata to uncaught frozen object
|
|
2439
|
-
if (!
|
|
2643
|
+
if (!objectIsExtensible(it)) return true;
|
|
2440
2644
|
// not necessary to add metadata
|
|
2441
2645
|
if (!create) return false;
|
|
2442
2646
|
// add missing metadata
|
|
@@ -2447,7 +2651,7 @@
|
|
|
2447
2651
|
|
|
2448
2652
|
// add metadata on freeze-family methods calling
|
|
2449
2653
|
var onFreeze = function (it) {
|
|
2450
|
-
if (freezing && REQUIRED &&
|
|
2654
|
+
if (freezing && REQUIRED && objectIsExtensible(it) && !hasOwnProperty_1(it, METADATA)) setMetadata(it);
|
|
2451
2655
|
return it;
|
|
2452
2656
|
};
|
|
2453
2657
|
|
|
@@ -2455,7 +2659,7 @@
|
|
|
2455
2659
|
meta.enable = function () { /* empty */ };
|
|
2456
2660
|
REQUIRED = true;
|
|
2457
2661
|
var getOwnPropertyNames = objectGetOwnPropertyNames.f;
|
|
2458
|
-
var splice = [].splice;
|
|
2662
|
+
var splice = functionUncurryThis([].splice);
|
|
2459
2663
|
var test = {};
|
|
2460
2664
|
test[METADATA] = 1;
|
|
2461
2665
|
|
|
@@ -2465,7 +2669,7 @@
|
|
|
2465
2669
|
var result = getOwnPropertyNames(it);
|
|
2466
2670
|
for (var i = 0, length = result.length; i < length; i++) {
|
|
2467
2671
|
if (result[i] === METADATA) {
|
|
2468
|
-
splice
|
|
2672
|
+
splice(result, i, 1);
|
|
2469
2673
|
break;
|
|
2470
2674
|
}
|
|
2471
2675
|
} return result;
|
|
@@ -2491,17 +2695,21 @@
|
|
|
2491
2695
|
internalMetadata.getWeakData;
|
|
2492
2696
|
internalMetadata.onFreeze;
|
|
2493
2697
|
|
|
2698
|
+
var TypeError$2 = global_1.TypeError;
|
|
2699
|
+
|
|
2494
2700
|
var Result = function (stopped, result) {
|
|
2495
2701
|
this.stopped = stopped;
|
|
2496
2702
|
this.result = result;
|
|
2497
2703
|
};
|
|
2498
2704
|
|
|
2705
|
+
var ResultPrototype = Result.prototype;
|
|
2706
|
+
|
|
2499
2707
|
var iterate = function (iterable, unboundFunction, options) {
|
|
2500
2708
|
var that = options && options.that;
|
|
2501
2709
|
var AS_ENTRIES = !!(options && options.AS_ENTRIES);
|
|
2502
2710
|
var IS_ITERATOR = !!(options && options.IS_ITERATOR);
|
|
2503
2711
|
var INTERRUPTED = !!(options && options.INTERRUPTED);
|
|
2504
|
-
var fn = functionBindContext(unboundFunction, that
|
|
2712
|
+
var fn = functionBindContext(unboundFunction, that);
|
|
2505
2713
|
var iterator, iterFn, index, length, result, next, step;
|
|
2506
2714
|
|
|
2507
2715
|
var stop = function (condition) {
|
|
@@ -2520,31 +2728,33 @@
|
|
|
2520
2728
|
iterator = iterable;
|
|
2521
2729
|
} else {
|
|
2522
2730
|
iterFn = getIteratorMethod(iterable);
|
|
2523
|
-
if (!iterFn) throw TypeError(
|
|
2731
|
+
if (!iterFn) throw TypeError$2(tryToString(iterable) + ' is not iterable');
|
|
2524
2732
|
// optimisation for array iterators
|
|
2525
2733
|
if (isArrayIteratorMethod(iterFn)) {
|
|
2526
2734
|
for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
|
|
2527
2735
|
result = callFn(iterable[index]);
|
|
2528
|
-
if (result && result
|
|
2736
|
+
if (result && objectIsPrototypeOf(ResultPrototype, result)) return result;
|
|
2529
2737
|
} return new Result(false);
|
|
2530
2738
|
}
|
|
2531
2739
|
iterator = getIterator(iterable, iterFn);
|
|
2532
2740
|
}
|
|
2533
2741
|
|
|
2534
2742
|
next = iterator.next;
|
|
2535
|
-
while (!(step = next
|
|
2743
|
+
while (!(step = functionCall(next, iterator)).done) {
|
|
2536
2744
|
try {
|
|
2537
2745
|
result = callFn(step.value);
|
|
2538
2746
|
} catch (error) {
|
|
2539
2747
|
iteratorClose(iterator, 'throw', error);
|
|
2540
2748
|
}
|
|
2541
|
-
if (typeof result == 'object' && result && result
|
|
2749
|
+
if (typeof result == 'object' && result && objectIsPrototypeOf(ResultPrototype, result)) return result;
|
|
2542
2750
|
} return new Result(false);
|
|
2543
2751
|
};
|
|
2544
2752
|
|
|
2545
|
-
var
|
|
2546
|
-
|
|
2547
|
-
|
|
2753
|
+
var TypeError$1 = global_1.TypeError;
|
|
2754
|
+
|
|
2755
|
+
var anInstance = function (it, Prototype) {
|
|
2756
|
+
if (objectIsPrototypeOf(Prototype, it)) return it;
|
|
2757
|
+
throw TypeError$1('Incorrect invocation');
|
|
2548
2758
|
};
|
|
2549
2759
|
|
|
2550
2760
|
// makes subclassing work correct for wrapped built-ins
|
|
@@ -2572,19 +2782,19 @@
|
|
|
2572
2782
|
var exported = {};
|
|
2573
2783
|
|
|
2574
2784
|
var fixMethod = function (KEY) {
|
|
2575
|
-
var
|
|
2785
|
+
var uncurriedNativeMethod = functionUncurryThis(NativePrototype[KEY]);
|
|
2576
2786
|
redefine(NativePrototype, KEY,
|
|
2577
2787
|
KEY == 'add' ? function add(value) {
|
|
2578
|
-
|
|
2788
|
+
uncurriedNativeMethod(this, value === 0 ? 0 : value);
|
|
2579
2789
|
return this;
|
|
2580
2790
|
} : KEY == 'delete' ? function (key) {
|
|
2581
|
-
return IS_WEAK && !isObject(key) ? false :
|
|
2791
|
+
return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
|
|
2582
2792
|
} : KEY == 'get' ? function get(key) {
|
|
2583
|
-
return IS_WEAK && !isObject(key) ? undefined :
|
|
2793
|
+
return IS_WEAK && !isObject(key) ? undefined : uncurriedNativeMethod(this, key === 0 ? 0 : key);
|
|
2584
2794
|
} : KEY == 'has' ? function has(key) {
|
|
2585
|
-
return IS_WEAK && !isObject(key) ? false :
|
|
2795
|
+
return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
|
|
2586
2796
|
} : function set(key, value) {
|
|
2587
|
-
|
|
2797
|
+
uncurriedNativeMethod(this, key === 0 ? 0 : key, value);
|
|
2588
2798
|
return this;
|
|
2589
2799
|
}
|
|
2590
2800
|
);
|
|
@@ -2621,7 +2831,7 @@
|
|
|
2621
2831
|
|
|
2622
2832
|
if (!ACCEPT_ITERABLES) {
|
|
2623
2833
|
Constructor = wrapper(function (dummy, iterable) {
|
|
2624
|
-
anInstance(dummy,
|
|
2834
|
+
anInstance(dummy, NativePrototype);
|
|
2625
2835
|
var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
|
|
2626
2836
|
if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
|
|
2627
2837
|
return that;
|
|
@@ -2688,8 +2898,8 @@
|
|
|
2688
2898
|
|
|
2689
2899
|
var collectionStrong = {
|
|
2690
2900
|
getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
|
|
2691
|
-
var
|
|
2692
|
-
anInstance(that,
|
|
2901
|
+
var Constructor = wrapper(function (that, iterable) {
|
|
2902
|
+
anInstance(that, Prototype);
|
|
2693
2903
|
setInternalState(that, {
|
|
2694
2904
|
type: CONSTRUCTOR_NAME,
|
|
2695
2905
|
index: objectCreate(null),
|
|
@@ -2701,6 +2911,8 @@
|
|
|
2701
2911
|
if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
|
|
2702
2912
|
});
|
|
2703
2913
|
|
|
2914
|
+
var Prototype = Constructor.prototype;
|
|
2915
|
+
|
|
2704
2916
|
var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
|
2705
2917
|
|
|
2706
2918
|
var define = function (that, key, value) {
|
|
@@ -2741,7 +2953,7 @@
|
|
|
2741
2953
|
}
|
|
2742
2954
|
};
|
|
2743
2955
|
|
|
2744
|
-
redefineAll(
|
|
2956
|
+
redefineAll(Prototype, {
|
|
2745
2957
|
// `{ Map, Set }.prototype.clear()` methods
|
|
2746
2958
|
// https://tc39.es/ecma262/#sec-map.prototype.clear
|
|
2747
2959
|
// https://tc39.es/ecma262/#sec-set.prototype.clear
|
|
@@ -2785,7 +2997,7 @@
|
|
|
2785
2997
|
// https://tc39.es/ecma262/#sec-set.prototype.foreach
|
|
2786
2998
|
forEach: function forEach(callbackfn /* , that = undefined */) {
|
|
2787
2999
|
var state = getInternalState(this);
|
|
2788
|
-
var boundFunction = functionBindContext(callbackfn, arguments.length > 1 ? arguments[1] : undefined
|
|
3000
|
+
var boundFunction = functionBindContext(callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
|
2789
3001
|
var entry;
|
|
2790
3002
|
while (entry = entry ? entry.next : state.first) {
|
|
2791
3003
|
boundFunction(entry.value, entry.key, this);
|
|
@@ -2801,7 +3013,7 @@
|
|
|
2801
3013
|
}
|
|
2802
3014
|
});
|
|
2803
3015
|
|
|
2804
|
-
redefineAll(
|
|
3016
|
+
redefineAll(Prototype, IS_MAP ? {
|
|
2805
3017
|
// `Map.prototype.get(key)` method
|
|
2806
3018
|
// https://tc39.es/ecma262/#sec-map.prototype.get
|
|
2807
3019
|
get: function get(key) {
|
|
@@ -2820,14 +3032,14 @@
|
|
|
2820
3032
|
return define(this, value = value === 0 ? 0 : value, value);
|
|
2821
3033
|
}
|
|
2822
3034
|
});
|
|
2823
|
-
if (descriptors) defineProperty(
|
|
3035
|
+
if (descriptors) defineProperty(Prototype, 'size', {
|
|
2824
3036
|
get: function () {
|
|
2825
3037
|
return getInternalState(this).size;
|
|
2826
3038
|
}
|
|
2827
3039
|
});
|
|
2828
|
-
return
|
|
3040
|
+
return Constructor;
|
|
2829
3041
|
},
|
|
2830
|
-
setStrong: function (
|
|
3042
|
+
setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) {
|
|
2831
3043
|
var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
|
|
2832
3044
|
var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
|
2833
3045
|
var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
|
|
@@ -2840,7 +3052,7 @@
|
|
|
2840
3052
|
// https://tc39.es/ecma262/#sec-set.prototype.keys
|
|
2841
3053
|
// https://tc39.es/ecma262/#sec-set.prototype.values
|
|
2842
3054
|
// https://tc39.es/ecma262/#sec-set.prototype-@@iterator
|
|
2843
|
-
defineIterator(
|
|
3055
|
+
defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) {
|
|
2844
3056
|
setInternalState(this, {
|
|
2845
3057
|
type: ITERATOR_NAME,
|
|
2846
3058
|
target: iterated,
|
|
@@ -2956,6 +3168,8 @@
|
|
|
2956
3168
|
// Store setTimeout reference so promise-polyfill will be unaffected by
|
|
2957
3169
|
// other code modifying setTimeout (like sinon.useFakeTimers())
|
|
2958
3170
|
var setTimeoutFunc = setTimeout;
|
|
3171
|
+
// @ts-ignore
|
|
3172
|
+
var setImmediateFunc = typeof setImmediate !== 'undefined' ? setImmediate : null;
|
|
2959
3173
|
|
|
2960
3174
|
function isArray(x) {
|
|
2961
3175
|
return Boolean(x && typeof x.length !== 'undefined');
|
|
@@ -3189,10 +3403,10 @@
|
|
|
3189
3403
|
// Use polyfill for setImmediate for performance gains
|
|
3190
3404
|
Promise$1._immediateFn =
|
|
3191
3405
|
// @ts-ignore
|
|
3192
|
-
(typeof
|
|
3406
|
+
(typeof setImmediateFunc === 'function' &&
|
|
3193
3407
|
function(fn) {
|
|
3194
3408
|
// @ts-ignore
|
|
3195
|
-
|
|
3409
|
+
setImmediateFunc(fn);
|
|
3196
3410
|
}) ||
|
|
3197
3411
|
function(fn) {
|
|
3198
3412
|
setTimeoutFunc(fn, 0);
|
|
@@ -3227,10 +3441,13 @@
|
|
|
3227
3441
|
// https://github.com/taylorhakes/promise-polyfill/issues/114
|
|
3228
3442
|
if (typeof globalNS['Promise'] !== 'function') {
|
|
3229
3443
|
globalNS['Promise'] = Promise$1;
|
|
3230
|
-
} else
|
|
3231
|
-
globalNS.Promise.prototype['finally']
|
|
3232
|
-
|
|
3233
|
-
|
|
3444
|
+
} else {
|
|
3445
|
+
if (!globalNS.Promise.prototype['finally']) {
|
|
3446
|
+
globalNS.Promise.prototype['finally'] = finallyConstructor;
|
|
3447
|
+
}
|
|
3448
|
+
if (!globalNS.Promise.allSettled) {
|
|
3449
|
+
globalNS.Promise.allSettled = allSettled;
|
|
3450
|
+
}
|
|
3234
3451
|
}
|
|
3235
3452
|
|
|
3236
3453
|
(function(l){function m(){}function k(a,c){a=void 0===a?"utf-8":a;c=void 0===c?{fatal:!1}:c;if(-1===r.indexOf(a.toLowerCase()))throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+a+"') is invalid.");if(c.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.");}function t(a){return Buffer.from(a.buffer,a.byteOffset,a.byteLength).toString("utf-8")}function u(a){var c=URL.createObjectURL(new Blob([a],{type:"text/plain;charset=UTF-8"}));
|
|
@@ -4008,7 +4225,7 @@
|
|
|
4008
4225
|
|
|
4009
4226
|
var Lock = unwrapExports(browserTabsLock);
|
|
4010
4227
|
|
|
4011
|
-
var version = '1.
|
|
4228
|
+
var version = '1.20.0';
|
|
4012
4229
|
|
|
4013
4230
|
/**
|
|
4014
4231
|
* @ignore
|
|
@@ -4234,7 +4451,7 @@
|
|
|
4234
4451
|
var height = 600;
|
|
4235
4452
|
var left = window.screenX + (window.innerWidth - width) / 2;
|
|
4236
4453
|
var top = window.screenY + (window.innerHeight - height) / 2;
|
|
4237
|
-
return window.open(url, 'auth0:authorize:popup', "left="
|
|
4454
|
+
return window.open(url, 'auth0:authorize:popup', "left=".concat(left, ",top=").concat(top, ",width=").concat(width, ",height=").concat(height, ",resizable,scrollbars=yes,status=1"));
|
|
4238
4455
|
};
|
|
4239
4456
|
var runPopup = function (config) {
|
|
4240
4457
|
return new Promise(function (resolve, reject) {
|
|
@@ -4478,7 +4695,7 @@
|
|
|
4478
4695
|
}
|
|
4479
4696
|
_a = response.json, error = _a.error, error_description = _a.error_description, data = __rest(_a, ["error", "error_description"]), ok = response.ok;
|
|
4480
4697
|
if (!ok) {
|
|
4481
|
-
errorMessage = error_description || "HTTP error. Unable to fetch "
|
|
4698
|
+
errorMessage = error_description || "HTTP error. Unable to fetch ".concat(url);
|
|
4482
4699
|
if (error === 'mfa_required') {
|
|
4483
4700
|
throw new MfaRequiredError(error, errorMessage, data.mfa_token);
|
|
4484
4701
|
}
|
|
@@ -4500,7 +4717,7 @@
|
|
|
4500
4717
|
body = useFormData
|
|
4501
4718
|
? createQueryParams(options)
|
|
4502
4719
|
: JSON.stringify(options);
|
|
4503
|
-
return [4 /*yield*/, getJSON(baseUrl
|
|
4720
|
+
return [4 /*yield*/, getJSON("".concat(baseUrl, "/oauth/token"), timeout, audience || 'default', scope, {
|
|
4504
4721
|
method: 'POST',
|
|
4505
4722
|
body: body,
|
|
4506
4723
|
headers: {
|
|
@@ -4545,7 +4762,7 @@
|
|
|
4545
4762
|
* @returns A string representation of the key
|
|
4546
4763
|
*/
|
|
4547
4764
|
CacheKey.prototype.toKey = function () {
|
|
4548
|
-
return this.prefix
|
|
4765
|
+
return "".concat(this.prefix, "::").concat(this.client_id, "::").concat(this.audience, "::").concat(this.scope);
|
|
4549
4766
|
};
|
|
4550
4767
|
/**
|
|
4551
4768
|
* Converts a cache key string into a `CacheKey` instance.
|
|
@@ -4839,7 +5056,7 @@
|
|
|
4839
5056
|
function TransactionManager(storage, clientId) {
|
|
4840
5057
|
this.storage = storage;
|
|
4841
5058
|
this.clientId = clientId;
|
|
4842
|
-
this.storageKey = TRANSACTION_STORAGE_KEY_PREFIX
|
|
5059
|
+
this.storageKey = "".concat(TRANSACTION_STORAGE_KEY_PREFIX, ".").concat(this.clientId);
|
|
4843
5060
|
this.transaction = this.storage.get(this.storageKey);
|
|
4844
5061
|
}
|
|
4845
5062
|
TransactionManager.prototype.create = function (transaction) {
|
|
@@ -4922,13 +5139,13 @@
|
|
|
4922
5139
|
throw new Error('Issuer (iss) claim must be a string present in the ID token');
|
|
4923
5140
|
}
|
|
4924
5141
|
if (decoded.claims.iss !== options.iss) {
|
|
4925
|
-
throw new Error("Issuer (iss) claim mismatch in the ID token; expected \""
|
|
5142
|
+
throw new Error("Issuer (iss) claim mismatch in the ID token; expected \"".concat(options.iss, "\", found \"").concat(decoded.claims.iss, "\""));
|
|
4926
5143
|
}
|
|
4927
5144
|
if (!decoded.user.sub) {
|
|
4928
5145
|
throw new Error('Subject (sub) claim must be a string present in the ID token');
|
|
4929
5146
|
}
|
|
4930
5147
|
if (decoded.header.alg !== 'RS256') {
|
|
4931
|
-
throw new Error("Signature algorithm of \""
|
|
5148
|
+
throw new Error("Signature algorithm of \"".concat(decoded.header.alg, "\" is not supported. Expected the ID token to be signed with \"RS256\"."));
|
|
4932
5149
|
}
|
|
4933
5150
|
if (!decoded.claims.aud ||
|
|
4934
5151
|
!(typeof decoded.claims.aud === 'string' ||
|
|
@@ -4937,26 +5154,26 @@
|
|
|
4937
5154
|
}
|
|
4938
5155
|
if (Array.isArray(decoded.claims.aud)) {
|
|
4939
5156
|
if (!decoded.claims.aud.includes(options.aud)) {
|
|
4940
|
-
throw new Error("Audience (aud) claim mismatch in the ID token; expected \""
|
|
5157
|
+
throw new Error("Audience (aud) claim mismatch in the ID token; expected \"".concat(options.aud, "\" but was not one of \"").concat(decoded.claims.aud.join(', '), "\""));
|
|
4941
5158
|
}
|
|
4942
5159
|
if (decoded.claims.aud.length > 1) {
|
|
4943
5160
|
if (!decoded.claims.azp) {
|
|
4944
5161
|
throw new Error('Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values');
|
|
4945
5162
|
}
|
|
4946
5163
|
if (decoded.claims.azp !== options.aud) {
|
|
4947
|
-
throw new Error("Authorized Party (azp) claim mismatch in the ID token; expected \""
|
|
5164
|
+
throw new Error("Authorized Party (azp) claim mismatch in the ID token; expected \"".concat(options.aud, "\", found \"").concat(decoded.claims.azp, "\""));
|
|
4948
5165
|
}
|
|
4949
5166
|
}
|
|
4950
5167
|
}
|
|
4951
5168
|
else if (decoded.claims.aud !== options.aud) {
|
|
4952
|
-
throw new Error("Audience (aud) claim mismatch in the ID token; expected \""
|
|
5169
|
+
throw new Error("Audience (aud) claim mismatch in the ID token; expected \"".concat(options.aud, "\" but found \"").concat(decoded.claims.aud, "\""));
|
|
4953
5170
|
}
|
|
4954
5171
|
if (options.nonce) {
|
|
4955
5172
|
if (!decoded.claims.nonce) {
|
|
4956
5173
|
throw new Error('Nonce (nonce) claim must be a string present in the ID token');
|
|
4957
5174
|
}
|
|
4958
5175
|
if (decoded.claims.nonce !== options.nonce) {
|
|
4959
|
-
throw new Error("Nonce (nonce) claim mismatch in the ID token; expected \""
|
|
5176
|
+
throw new Error("Nonce (nonce) claim mismatch in the ID token; expected \"".concat(options.nonce, "\", found \"").concat(decoded.claims.nonce, "\""));
|
|
4960
5177
|
}
|
|
4961
5178
|
}
|
|
4962
5179
|
if (options.max_age && !isNumber(decoded.claims.auth_time)) {
|
|
@@ -4978,20 +5195,20 @@
|
|
|
4978
5195
|
expDate.setUTCSeconds(decoded.claims.exp + leeway);
|
|
4979
5196
|
nbfDate.setUTCSeconds(decoded.claims.nbf - leeway);
|
|
4980
5197
|
if (now > expDate) {
|
|
4981
|
-
throw new Error("Expiration Time (exp) claim error in the ID token; current time ("
|
|
5198
|
+
throw new Error("Expiration Time (exp) claim error in the ID token; current time (".concat(now, ") is after expiration time (").concat(expDate, ")"));
|
|
4982
5199
|
}
|
|
4983
5200
|
if (isNumber(decoded.claims.nbf) && now < nbfDate) {
|
|
4984
|
-
throw new Error("Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Currrent time ("
|
|
5201
|
+
throw new Error("Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Currrent time (".concat(now, ") is before ").concat(nbfDate));
|
|
4985
5202
|
}
|
|
4986
5203
|
if (isNumber(decoded.claims.auth_time) && now > authTimeDate) {
|
|
4987
|
-
throw new Error("Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Currrent time ("
|
|
5204
|
+
throw new Error("Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Currrent time (".concat(now, ") is after last auth at ").concat(authTimeDate));
|
|
4988
5205
|
}
|
|
4989
5206
|
if (options.organizationId) {
|
|
4990
5207
|
if (!decoded.claims.org_id) {
|
|
4991
5208
|
throw new Error('Organization ID (org_id) claim must be a string present in the ID token');
|
|
4992
5209
|
}
|
|
4993
5210
|
else if (options.organizationId !== decoded.claims.org_id) {
|
|
4994
|
-
throw new Error("Organization ID (org_id) claim mismatch in the ID token; expected \""
|
|
5211
|
+
throw new Error("Organization ID (org_id) claim mismatch in the ID token; expected \"".concat(options.organizationId, "\", found \"").concat(decoded.claims.org_id, "\""));
|
|
4995
5212
|
}
|
|
4996
5213
|
}
|
|
4997
5214
|
return decoded;
|
|
@@ -5131,7 +5348,7 @@
|
|
|
5131
5348
|
if (value) {
|
|
5132
5349
|
return value;
|
|
5133
5350
|
}
|
|
5134
|
-
return CookieStorage.get(""
|
|
5351
|
+
return CookieStorage.get("".concat(LEGACY_PREFIX).concat(key));
|
|
5135
5352
|
},
|
|
5136
5353
|
save: function (key, value, options) {
|
|
5137
5354
|
var cookieAttributes = {};
|
|
@@ -5141,12 +5358,12 @@
|
|
|
5141
5358
|
if (options === null || options === void 0 ? void 0 : options.daysUntilExpire) {
|
|
5142
5359
|
cookieAttributes.expires = options.daysUntilExpire;
|
|
5143
5360
|
}
|
|
5144
|
-
esCookie_5(""
|
|
5361
|
+
esCookie_5("".concat(LEGACY_PREFIX).concat(key), JSON.stringify(value), cookieAttributes);
|
|
5145
5362
|
CookieStorage.save(key, value, options);
|
|
5146
5363
|
},
|
|
5147
5364
|
remove: function (key) {
|
|
5148
5365
|
CookieStorage.remove(key);
|
|
5149
|
-
CookieStorage.remove(""
|
|
5366
|
+
CookieStorage.remove("".concat(LEGACY_PREFIX).concat(key));
|
|
5150
5367
|
}
|
|
5151
5368
|
};
|
|
5152
5369
|
/**
|
|
@@ -5202,7 +5419,7 @@
|
|
|
5202
5419
|
};
|
|
5203
5420
|
}
|
|
5204
5421
|
|
|
5205
|
-
var WorkerFactory = createBase64WorkerFactory('Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKio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ICBpZiAoZiA9IDEsIHkgJiYgKHQgPSBvcFswXSAmIDIgPyB5WyJyZXR1cm4iXSA6IG9wWzBdID8geVsidGhyb3ciXSB8fCAoKHQgPSB5WyJyZXR1cm4iXSkgJiYgdC5jYWxsKHkpLCAwKSA6IHkubmV4dCkgJiYgISh0ID0gdC5jYWxsKHksIG9wWzFdKSkuZG9uZSkgcmV0dXJuIHQ7DQogICAgICAgICAgICAgICAgaWYgKHkgPSAwLCB0KSBvcCA9IFtvcFswXSAmIDIsIHQudmFsdWVdOw0KICAgICAgICAgICAgICAgIHN3aXRjaCAob3BbMF0pIHsNCiAgICAgICAgICAgICAgICAgICAgY2FzZSAwOiBjYXNlIDE6IHQgPSBvcDsgYnJlYWs7DQogICAgICAgICAgICAgICAgICAgIGNhc2UgNDogXy5sYWJlbCsrOyByZXR1cm4geyB2YWx1ZTogb3BbMV0sIGRvbmU6IGZhbHNlIH07DQogICAgICAgICAgICAgICAgICAgIGNhc2UgNTogXy5sYWJlbCsrOyB5ID0gb3BbMV07IG9wID0gWzBdOyBjb250aW51ZTsNCiAgICAgICAgICAgICAgICAgICAgY2FzZSA3OiBvcCA9IF8ub3BzLnBvcCgpOyBfLnRyeXMucG9wKCk7IGNvbnRpbnVlOw0KICAgICAgICAgICAgICAgICAgICBkZWZhdWx0Og0KICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEodCA9IF8udHJ5cywgdCA9IHQubGVuZ3RoID4gMCAmJiB0W3QubGVuZ3RoIC0gMV0pICYmIChvcFswXSA9PT0gNiB8fCBvcFswXSA9PT0gMikpIHsgXyA9IDA7IGNvbnRpbnVlOyB9DQogICAgICAgICAgICAgICAgICAgICAgICBpZiAob3BbMF0gPT09IDMgJiYgKCF0IHx8IChvcFsxXSA+IHRbMF0gJiYgb3BbMV0gPCB0WzNdKSkpIHsgXy5sYWJlbCA9IG9wWzFdOyBicmVhazsgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wWzBdID09PSA2ICYmIF8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2dlbmVyYXRvcih0aGlzLCBmdW5jdGlvbiAoX2UpIHsNCiAgICAgICAgICAgICAgICBzd2l0Y2ggKF9lLmxhYmVsKSB7DQogICAgICAgICAgICAgICAgICAgIGNhc2UgMDoNCiAgICAgICAgICAgICAgICAgICAgICAgIF9kID0gYXV0aCB8fCB7fSwgYXVkaWVuY2UgPSBfZC5hdWRpZW5jZSwgc2NvcGUgPSBfZC5zY29wZTsNCiAgICAgICAgICAgICAgICAgICAgICAgIF9lLmxhYmVsID0gMTsNCiAgICAgICAgICAgICAgICAgICAgY2FzZSAxOg0KICAgICAgICAgICAgICAgICAgICAgICAgX2UudHJ5cy5wdXNoKFsxLCA3LCAsIDhdKTsNCiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHkgPSB1c2VGb3JtRGF0YQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZm9ybURhdGFUb09iamVjdChmZXRjaE9wdGlvbnMuYm9keSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IEpTT04ucGFyc2UoZmV0Y2hPcHRpb25zLmJvZHkpOw0KICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFib2R5LnJlZnJlc2hfdG9rZW4gJiYgYm9keS5ncmFudF90eXBlID09PSAncmVmcmVzaF90b2tlbicpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoVG9rZW4gPSBnZXRSZWZyZXNoVG9rZW4oYXVkaWVuY2UsIHNjb3BlKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXJlZnJlc2hUb2tlbikgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoTUlTU0lOR19SRUZSRVNIX1RPS0VOX0VSUk9SX01FU1NBR0UpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmZXRjaE9wdGlvbnMuYm9keSA9IHVzZUZvcm1EYXRhDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbmV3IFVSTFNlYXJjaFBhcmFtcyhfX2Fzc2lnbihfX2Fzc2lnbih7fSwgYm9keSksIHsgcmVmcmVzaF90b2tlbjogcmVmcmVzaFRva2VuIH0pKS50b1N0cmluZygpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogSlNPTi5zdHJpbmdpZnkoX19hc3NpZ24oX19hc3NpZ24oe30sIGJvZHkpLCB7IHJlZnJlc2hfdG9rZW46IHJlZnJlc2hUb2tlbiB9KSk7DQogICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICBhYm9ydENvbnRyb2xsZXIgPSB2b2lkIDA7DQogICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIEFib3J0Q29udHJvbGxlciA9PT0gJ2Z1bmN0aW9uJykgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFib3J0Q29udHJvbGxlciA9IG5ldyBBYm9ydENvbnRyb2xsZXIoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmZXRjaE9wdGlvbnMuc2lnbmFsID0gYWJvcnRDb250cm9sbGVyLnNpZ25hbDsNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlID0gdm9pZCAwOw0KICAgICAgICAgICAgICAgICAgICAgICAgX2UubGFiZWwgPSAyOw0KICAgICAgICAgICAgICAgICAgICBjYXNlIDI6DQogICAgICAgICAgICAgICAgICAgICAgICBfZS50cnlzLnB1c2goWzIsIDQsICwgNV0pOw0KICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFs0IC8qeWllbGQqLywgUHJvbWlzZS5yYWNlKFsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2FpdCh0aW1lb3V0KSwNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmV0Y2goZmV0Y2hVcmwsIF9fYXNzaWduKHt9LCBmZXRjaE9wdGlvbnMpKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pXTsNCiAgICAgICAgICAgICAgICAgICAgY2FzZSAzOg0KICAgICAgICAgICAgICAgICAgICAgICAgcmVzcG9uc2UgPSBfZS5zZW50KCk7DQogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzMgLypicmVhayovLCA1XTsNCiAgICAgICAgICAgICAgICAgICAgY2FzZSA0Og0KICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3JfMSA9IF9lLnNlbnQoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZldGNoIGVycm9yLCByZWplY3QgYHNlbmRNZXNzYWdlYCB1c2luZyBgZXJyb3JgIGtleSBzbyB0aGF0IHdlIHJldHJ5Lg0KICAgICAgICAgICAgICAgICAgICAgICAgcG9ydC5wb3N0TWVzc2FnZSh7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3I6IGVycm9yXzEubWVzc2FnZQ0KICAgICAgICAgICAgICAgICAgICAgICAgfSk7DQogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzIgLypyZXR1cm4qL107DQogICAgICAgICAgICAgICAgICAgIGNhc2UgNToNCiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghcmVzcG9uc2UpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGUgcmVxdWVzdCB0aW1lcyBvdXQsIGFib3J0IGl0IGFuZCBsZXQgYHN3aXRjaEZldGNoYCByYWlzZSB0aGUgZXJyb3IuDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFib3J0Q29udHJvbGxlcikNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWJvcnRDb250cm9sbGVyLmFib3J0KCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9ydC5wb3N0TWVzc2FnZSh7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yOiAiVGltZW91dCB3aGVuIGV4ZWN1dGluZyAnZmV0Y2gnIg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbMiAvKnJldHVybiovXTsNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbNCAvKnlpZWxkKi8sIHJlc3BvbnNlLmpzb24oKV07DQogICAgICAgICAgICAgICAgICAgIGNhc2UgNjoNCiAgICAgICAgICAgICAgICAgICAgICAgIGpzb24gPSBfZS5zZW50KCk7DQogICAgICAgICAgICAgICAgICAgICAgICBpZiAoanNvbi5yZWZyZXNoX3Rva2VuKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0UmVmcmVzaFRva2VuKGpzb24ucmVmcmVzaF90b2tlbiwgYXVkaWVuY2UsIHNjb3BlKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGUganNvbi5yZWZyZXNoX3Rva2VuOw0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlUmVmcmVzaFRva2VuKGF1ZGllbmNlLCBzY29wZSk7DQogICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICBwb3J0LnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvazogcmVzcG9uc2Uub2ssDQogICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbjoganNvbg0KICAgICAgICAgICAgICAgICAgICAgICAgfSk7DQogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzMgLypicmVhayovLCA4XTsNCiAgICAgICAgICAgICAgICAgICAgY2FzZSA3Og0KICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3JfMiA9IF9lLnNlbnQoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgIHBvcnQucG9zdE1lc3NhZ2Uoew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9rOiBmYWxzZSwNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uOiB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yX2Rlc2NyaXB0aW9uOiBlcnJvcl8yLm1lc3NhZ2UNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbMyAvKmJyZWFrKi8sIDhdOw0KICAgICAgICAgICAgICAgICAgICBjYXNlIDg6IHJldHVybiBbMiAvKnJldHVybiovXTsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9KTsNCiAgICAgICAgfSk7DQogICAgfTsNCiAgICAvLyBEb24ndCBydW4gYGFkZEV2ZW50TGlzdGVuZXJgIGluIG91ciB0ZXN0cyAodGhpcyBpcyByZXBsYWNlZCBpbiByb2xsdXApDQogICAgLyogaXN0YW5idWwgaWdub3JlIGVsc2UgICovDQogICAgew0KICAgICAgICAvLyBAdHMtaWdub3JlDQogICAgICAgIGFkZEV2ZW50TGlzdGVuZXIoJ21lc3NhZ2UnLCBtZXNzYWdlSGFuZGxlcik7DQogICAgfQoKfSkoKTsKCg==', null, false);
|
|
5422
|
+
var WorkerFactory = createBase64WorkerFactory('Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1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uZG9uZSkgcmV0dXJuIHQ7DQogICAgICAgICAgICAgICAgaWYgKHkgPSAwLCB0KSBvcCA9IFtvcFswXSAmIDIsIHQudmFsdWVdOw0KICAgICAgICAgICAgICAgIHN3aXRjaCAob3BbMF0pIHsNCiAgICAgICAgICAgICAgICAgICAgY2FzZSAwOiBjYXNlIDE6IHQgPSBvcDsgYnJlYWs7DQogICAgICAgICAgICAgICAgICAgIGNhc2UgNDogXy5sYWJlbCsrOyByZXR1cm4geyB2YWx1ZTogb3BbMV0sIGRvbmU6IGZhbHNlIH07DQogICAgICAgICAgICAgICAgICAgIGNhc2UgNTogXy5sYWJlbCsrOyB5ID0gb3BbMV07IG9wID0gWzBdOyBjb250aW51ZTsNCiAgICAgICAgICAgICAgICAgICAgY2FzZSA3OiBvcCA9IF8ub3BzLnBvcCgpOyBfLnRyeXMucG9wKCk7IGNvbnRpbnVlOw0KICAgICAgICAgICAgICAgICAgICBkZWZhdWx0Og0KICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEodCA9IF8udHJ5cywgdCA9IHQubGVuZ3RoID4gMCAmJiB0W3QubGVuZ3RoIC0gMV0pICYmIChvcFswXSA9PT0gNiB8fCBvcFswXSA9PT0gMikpIHsgXyA9IDA7IGNvbnRpbnVlOyB9DQogICAgICAgICAgICAgICAgICAgICAgICBpZiAob3BbMF0gPT09IDMgJiYgKCF0IHx8IChvcFsxXSA+IHRbMF0gJiYgb3BbMV0gPCB0WzNdKSkpIHsgXy5sYWJlbCA9IG9wWzFdOyBicmVhazsgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wWzBdID09PSA2ICYmIF8ubGFiZWwgPCB0WzFdKSB7IF8ubGFiZWwgPSB0WzFdOyB0ID0gb3A7IGJyZWFrOyB9DQogICAgICAgICAgICAgICAgICAgICAgICBpZiAodCAmJiBfLmxhYmVsIDwgdFsyXSkgeyBfLmxhYmVsID0gdFsyXTsgXy5vcHMucHVzaChvcCk7IGJyZWFrOyB9DQogICAgICAgICAgICAgICAgICAgICAgICBpZiAodFsyXSkgXy5vcHMucG9wKCk7DQogICAgICAgICAgICAgICAgICAgICAgICBfLnRyeXMucG9wKCk7IGNvbnRpbnVlOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBvcCA9IGJvZHkuY2FsbCh0aGlzQXJnLCBfKTsNCiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHsgb3AgPSBbNiwgZV07IHkgPSAwOyB9IGZpbmFsbHkgeyBmID0gdCA9IDA7IH0NCiAgICAgICAgICAgIGlmIChvcFswXSAmIDUpIHRocm93IG9wWzFdOyByZXR1cm4geyB2YWx1ZTogb3BbMF0gPyBvcFsxXSA6IHZvaWQgMCwgZG9uZTogdHJ1ZSB9Ow0KICAgICAgICB9DQogICAgfQ0KDQogICAgZnVuY3Rpb24gX19yZWFkKG8sIG4pIHsNCiAgICAgICAgdmFyIG0gPSB0eXBlb2YgU3ltYm9sID09PSAiZnVuY3Rpb24iICYmIG9bU3ltYm9sLml0ZXJhdG9yXTsNCiAgICAgICAgaWYgKCFtKSByZXR1cm4gbzsNCiAgICAgICAgdmFyIGkgPSBtLmNhbGwobyksIHIsIGFyID0gW10sIGU7DQogICAgICAgIHRyeSB7DQogICAgICAgICAgICB3aGlsZSAoKG4gPT09IHZvaWQgMCB8fCBuLS0gPiAwKSAmJiAhKHIgPSBpLm5leHQoKSkuZG9uZSkgYXIucHVzaChyLnZhbHVlKTsNCiAgICAgICAgfQ0KICAgICAgICBjYXRjaCAoZXJyb3IpIHsgZSA9IHsgZXJyb3I6IGVycm9yIH07IH0NCiAgICAgICAgZmluYWxseSB7DQogICAgICAgICAgICB0cnkgew0KICAgICAgICAgICAgICAgIGlmIChyICYmICFyLmRvbmUgJiYgKG0gPSBpWyJyZXR1cm4iXSkpIG0uY2FsbChpKTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIGZpbmFsbHkgeyBpZiAoZSkgdGhyb3cgZS5lcnJvcjsgfQ0KICAgIC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30sIGF1ZGllbmNlID0gX2QuYXVkaWVuY2UsIHNjb3BlID0gX2Quc2NvcGU7DQogICAgICAgICAgICAgICAgICAgICAgICBfZS5sYWJlbCA9IDE7DQogICAgICAgICAgICAgICAgICAgIGNhc2UgMToNCiAgICAgICAgICAgICAgICAgICAgICAgIF9lLnRyeXMucHVzaChbMSwgNywgLCA4XSk7DQogICAgICAgICAgICAgICAgICAgICAgICBib2R5ID0gdXNlRm9ybURhdGENCiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZvcm1EYXRhVG9PYmplY3QoZmV0Y2hPcHRpb25zLmJvZHkpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBKU09OLnBhcnNlKGZldGNoT3B0aW9ucy5ib2R5KTsNCiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghYm9keS5yZWZyZXNoX3Rva2VuICYmIGJvZHkuZ3JhbnRfdHlwZSA9PT0gJ3JlZnJlc2hfdG9rZW4nKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFRva2VuID0gZ2V0UmVmcmVzaFRva2VuKGF1ZGllbmNlLCBzY29wZSk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFyZWZyZXNoVG9rZW4pIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKE1JU1NJTkdfUkVGUkVTSF9UT0tFTl9FUlJPUl9NRVNTQUdFKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgZmV0Y2hPcHRpb25zLmJvZHkgPSB1c2VGb3JtRGF0YQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG5ldyBVUkxTZWFyY2hQYXJhbXMoX19hc3NpZ24oX19hc3NpZ24oe30sIGJvZHkpLCB7IHJlZnJlc2hfdG9rZW46IHJlZnJlc2hUb2tlbiB9KSkudG9TdHJpbmcoKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IEpTT04uc3RyaW5naWZ5KF9fYXNzaWduKF9fYXNzaWduKHt9LCBib2R5KSwgeyByZWZyZXNoX3Rva2VuOiByZWZyZXNoVG9rZW4gfSkpOw0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgYWJvcnRDb250cm9sbGVyID0gdm9pZCAwOw0KICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBBYm9ydENvbnRyb2xsZXIgPT09ICdmdW5jdGlvbicpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYm9ydENvbnRyb2xsZXIgPSBuZXcgQWJvcnRDb250cm9sbGVyKCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgZmV0Y2hPcHRpb25zLnNpZ25hbCA9IGFib3J0Q29udHJvbGxlci5zaWduYWw7DQogICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICByZXNwb25zZSA9IHZvaWQgMDsNCiAgICAgICAgICAgICAgICAgICAgICAgIF9lLmxhYmVsID0gMjsNCiAgICAgICAgICAgICAgICAgICAgY2FzZSAyOg0KICAgICAgICAgICAgICAgICAgICAgICAgX2UudHJ5cy5wdXNoKFsyLCA0LCAsIDVdKTsNCiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbNCAvKnlpZWxkKi8sIFByb21pc2UucmFjZShbDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdhaXQodGltZW91dCksDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZldGNoKGZldGNoVXJsLCBfX2Fzc2lnbih7fSwgZmV0Y2hPcHRpb25zKSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKV07DQogICAgICAgICAgICAgICAgICAgIGNhc2UgMzoNCiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlID0gX2Uuc2VudCgpOw0KICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFszIC8qYnJlYWsqLywgNV07DQogICAgICAgICAgICAgICAgICAgIGNhc2UgNDoNCiAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yXzEgPSBfZS5zZW50KCk7DQogICAgICAgICAgICAgICAgICAgICAgICAvLyBmZXRjaCBlcnJvciwgcmVqZWN0IGBzZW5kTWVzc2FnZWAgdXNpbmcgYGVycm9yYCBrZXkgc28gdGhhdCB3ZSByZXRyeS4NCiAgICAgICAgICAgICAgICAgICAgICAgIHBvcnQucG9zdE1lc3NhZ2Uoew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yOiBlcnJvcl8xLm1lc3NhZ2UNCiAgICAgICAgICAgICAgICAgICAgICAgIH0pOw0KICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFsyIC8qcmV0dXJuKi9dOw0KICAgICAgICAgICAgICAgICAgICBjYXNlIDU6DQogICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXJlc3BvbnNlKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSWYgdGhlIHJlcXVlc3QgdGltZXMgb3V0LCBhYm9ydCBpdCBhbmQgbGV0IGBzd2l0Y2hGZXRjaGAgcmFpc2UgdGhlIGVycm9yLg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhYm9ydENvbnRyb2xsZXIpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFib3J0Q29udHJvbGxlci5hYm9ydCgpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvcnQucG9zdE1lc3NhZ2Uoew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlcnJvcjogIlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyINCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzIgLypyZXR1cm4qL107DQogICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzQgLyp5aWVsZCovLCByZXNwb25zZS5qc29uKCldOw0KICAgICAgICAgICAgICAgICAgICBjYXNlIDY6DQogICAgICAgICAgICAgICAgICAgICAgICBqc29uID0gX2Uuc2VudCgpOw0KICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGpzb24ucmVmcmVzaF90b2tlbikgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFJlZnJlc2hUb2tlbihqc29uLnJlZnJlc2hfdG9rZW4sIGF1ZGllbmNlLCBzY29wZSk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGpzb24ucmVmcmVzaF90b2tlbjsNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Ugew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZVJlZnJlc2hUb2tlbihhdWRpZW5jZSwgc2NvcGUpOw0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgcG9ydC5wb3N0TWVzc2FnZSh7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgb2s6IHJlc3BvbnNlLm9rLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb246IGpzb24NCiAgICAgICAgICAgICAgICAgICAgICAgIH0pOw0KICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFszIC8qYnJlYWsqLywgOF07DQogICAgICAgICAgICAgICAgICAgIGNhc2UgNzoNCiAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yXzIgPSBfZS5zZW50KCk7DQogICAgICAgICAgICAgICAgICAgICAgICBwb3J0LnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvazogZmFsc2UsDQogICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbjogew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlcnJvcl9kZXNjcmlwdGlvbjogZXJyb3JfMi5tZXNzYWdlDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgfSk7DQogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzMgLypicmVhayovLCA4XTsNCiAgICAgICAgICAgICAgICAgICAgY2FzZSA4OiByZXR1cm4gWzIgLypyZXR1cm4qL107DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfSk7DQogICAgICAgIH0pOw0KICAgIH07DQogICAgLy8gRG9uJ3QgcnVuIGBhZGRFdmVudExpc3RlbmVyYCBpbiBvdXIgdGVzdHMgKHRoaXMgaXMgcmVwbGFjZWQgaW4gcm9sbHVwKQ0KICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBlbHNlICAqLw0KICAgIHsNCiAgICAgICAgLy8gQHRzLWlnbm9yZQ0KICAgICAgICBhZGRFdmVudExpc3RlbmVyKCdtZXNzYWdlJywgbWVzc2FnZUhhbmRsZXIpOw0KICAgIH0KCn0pKCk7Cgo=', null, false);
|
|
5206
5423
|
/* eslint-enable */
|
|
5207
5424
|
|
|
5208
5425
|
var isIE11 = function () { return /Trident.*rv:11\.0/.test(navigator.userAgent); };
|
|
@@ -5301,7 +5518,7 @@
|
|
|
5301
5518
|
return this.cache.remove(this.manifestKey);
|
|
5302
5519
|
};
|
|
5303
5520
|
CacheKeyManifest.prototype.createManifestKeyFrom = function (clientId) {
|
|
5304
|
-
return CACHE_KEY_PREFIX
|
|
5521
|
+
return "".concat(CACHE_KEY_PREFIX, "::").concat(clientId);
|
|
5305
5522
|
};
|
|
5306
5523
|
return CacheKeyManifest;
|
|
5307
5524
|
}());
|
|
@@ -5318,7 +5535,7 @@
|
|
|
5318
5535
|
* @ignore
|
|
5319
5536
|
*/
|
|
5320
5537
|
var buildOrganizationHintCookieName = function (clientId) {
|
|
5321
|
-
return "auth0."
|
|
5538
|
+
return "auth0.".concat(clientId, ".organization_hint");
|
|
5322
5539
|
};
|
|
5323
5540
|
/**
|
|
5324
5541
|
* @ignore
|
|
@@ -5328,7 +5545,7 @@
|
|
|
5328
5545
|
* @ignore
|
|
5329
5546
|
*/
|
|
5330
5547
|
var buildIsAuthenticatedCookieName = function (clientId) {
|
|
5331
|
-
return "auth0."
|
|
5548
|
+
return "auth0.".concat(clientId, ".is.authenticated");
|
|
5332
5549
|
};
|
|
5333
5550
|
/**
|
|
5334
5551
|
* @ignore
|
|
@@ -5352,16 +5569,16 @@
|
|
|
5352
5569
|
*/
|
|
5353
5570
|
var getTokenIssuer = function (issuer, domainUrl) {
|
|
5354
5571
|
if (issuer) {
|
|
5355
|
-
return issuer.startsWith('https://') ? issuer : "https://"
|
|
5572
|
+
return issuer.startsWith('https://') ? issuer : "https://".concat(issuer, "/");
|
|
5356
5573
|
}
|
|
5357
|
-
return domainUrl
|
|
5574
|
+
return "".concat(domainUrl, "/");
|
|
5358
5575
|
};
|
|
5359
5576
|
/**
|
|
5360
5577
|
* @ignore
|
|
5361
5578
|
*/
|
|
5362
5579
|
var getDomain = function (domainUrl) {
|
|
5363
5580
|
if (!/^https?:\/\//.test(domainUrl)) {
|
|
5364
|
-
return "https://"
|
|
5581
|
+
return "https://".concat(domainUrl);
|
|
5365
5582
|
}
|
|
5366
5583
|
return domainUrl;
|
|
5367
5584
|
};
|
|
@@ -5390,10 +5607,13 @@
|
|
|
5390
5607
|
else {
|
|
5391
5608
|
this.cacheLocation = options.cacheLocation || CACHE_LOCATION_MEMORY;
|
|
5392
5609
|
if (!cacheFactory(this.cacheLocation)) {
|
|
5393
|
-
throw new Error("Invalid cache location \""
|
|
5610
|
+
throw new Error("Invalid cache location \"".concat(this.cacheLocation, "\""));
|
|
5394
5611
|
}
|
|
5395
5612
|
cache = cacheFactory(this.cacheLocation)();
|
|
5396
5613
|
}
|
|
5614
|
+
this.httpTimeoutMs = options.httpTimeoutInSeconds
|
|
5615
|
+
? options.httpTimeoutInSeconds * 1000
|
|
5616
|
+
: DEFAULT_FETCH_TIMEOUT_MS;
|
|
5397
5617
|
this.cookieStorage =
|
|
5398
5618
|
options.legacySameSiteCookie === false
|
|
5399
5619
|
? CookieStorage
|
|
@@ -5434,14 +5654,17 @@
|
|
|
5434
5654
|
}
|
|
5435
5655
|
Auth0Client.prototype._url = function (path) {
|
|
5436
5656
|
var auth0Client = encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client || DEFAULT_AUTH0_CLIENT)));
|
|
5437
|
-
return ""
|
|
5657
|
+
return "".concat(this.domainUrl).concat(path, "&auth0Client=").concat(auth0Client);
|
|
5438
5658
|
};
|
|
5439
5659
|
Auth0Client.prototype._getParams = function (authorizeOptions, state, nonce, code_challenge, redirect_uri) {
|
|
5440
|
-
|
|
5441
|
-
|
|
5660
|
+
// These options should be excluded from the authorize URL,
|
|
5661
|
+
// as they're options for the client and not for the IdP.
|
|
5662
|
+
// ** IMPORTANT ** If adding a new client option, include it in this destructure list.
|
|
5663
|
+
var _a = this.options; _a.useRefreshTokens; _a.useCookiesForTransactions; _a.useFormData; _a.auth0Client; _a.cacheLocation; _a.advancedOptions; _a.detailedResponse; _a.nowProvider; _a.authorizeTimeoutInSeconds; _a.legacySameSiteCookie; _a.sessionCheckExpiryDays; _a.domain; _a.leeway; _a.httpTimeoutInSeconds; var loginOptions = __rest(_a, ["useRefreshTokens", "useCookiesForTransactions", "useFormData", "auth0Client", "cacheLocation", "advancedOptions", "detailedResponse", "nowProvider", "authorizeTimeoutInSeconds", "legacySameSiteCookie", "sessionCheckExpiryDays", "domain", "leeway", "httpTimeoutInSeconds"]);
|
|
5664
|
+
return __assign(__assign(__assign({}, loginOptions), authorizeOptions), { scope: getUniqueScopes(this.defaultScope, this.scope, authorizeOptions.scope), response_type: 'code', response_mode: 'query', state: state, nonce: nonce, redirect_uri: redirect_uri || this.options.redirect_uri, code_challenge: code_challenge, code_challenge_method: 'S256' });
|
|
5442
5665
|
};
|
|
5443
5666
|
Auth0Client.prototype._authorizeUrl = function (authorizeOptions) {
|
|
5444
|
-
return this._url("/authorize?"
|
|
5667
|
+
return this._url("/authorize?".concat(createQueryParams(authorizeOptions)));
|
|
5445
5668
|
};
|
|
5446
5669
|
Auth0Client.prototype._verifyIdToken = function (id_token, nonce, organizationId) {
|
|
5447
5670
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -5473,7 +5696,9 @@
|
|
|
5473
5696
|
};
|
|
5474
5697
|
Auth0Client.prototype._processOrgIdHint = function (organizationId) {
|
|
5475
5698
|
if (organizationId) {
|
|
5476
|
-
this.cookieStorage.save(this.orgHintCookieName, organizationId
|
|
5699
|
+
this.cookieStorage.save(this.orgHintCookieName, organizationId, {
|
|
5700
|
+
daysUntilExpire: this.sessionCheckExpiryDays
|
|
5701
|
+
});
|
|
5477
5702
|
}
|
|
5478
5703
|
else {
|
|
5479
5704
|
this.cookieStorage.remove(this.orgHintCookieName);
|
|
@@ -5505,11 +5730,11 @@
|
|
|
5505
5730
|
case 1:
|
|
5506
5731
|
code_challengeBuffer = _a.sent();
|
|
5507
5732
|
code_challenge = bufferToBase64UrlEncoded(code_challengeBuffer);
|
|
5508
|
-
fragment = options.fragment ? "#"
|
|
5733
|
+
fragment = options.fragment ? "#".concat(options.fragment) : '';
|
|
5509
5734
|
params = this._getParams(authorizeOptions, stateIn, nonceIn, code_challenge, redirect_uri);
|
|
5510
5735
|
url = this._authorizeUrl(params);
|
|
5511
5736
|
organizationId = options.organization || this.options.organization;
|
|
5512
|
-
this.transactionManager.create(__assign({ nonce: nonceIn, code_verifier: code_verifier, appState: appState, scope: params.scope, audience: params.audience || 'default', redirect_uri: params.redirect_uri }, (organizationId && { organizationId: organizationId })));
|
|
5737
|
+
this.transactionManager.create(__assign({ nonce: nonceIn, code_verifier: code_verifier, appState: appState, scope: params.scope, audience: params.audience || 'default', redirect_uri: params.redirect_uri, state: stateIn }, (organizationId && { organizationId: organizationId })));
|
|
5513
5738
|
return [2 /*return*/, url + fragment];
|
|
5514
5739
|
}
|
|
5515
5740
|
});
|
|
@@ -5578,7 +5803,8 @@
|
|
|
5578
5803
|
grant_type: 'authorization_code',
|
|
5579
5804
|
redirect_uri: params.redirect_uri,
|
|
5580
5805
|
auth0Client: this.options.auth0Client,
|
|
5581
|
-
useFormData: this.options.useFormData
|
|
5806
|
+
useFormData: this.options.useFormData,
|
|
5807
|
+
timeout: this.httpTimeoutMs
|
|
5582
5808
|
}, this.worker)];
|
|
5583
5809
|
case 3:
|
|
5584
5810
|
authResult = _a.sent();
|
|
@@ -5716,14 +5942,18 @@
|
|
|
5716
5942
|
}
|
|
5717
5943
|
_a = parseQueryResult(queryStringFragments.join('')), state = _a.state, code = _a.code, error = _a.error, error_description = _a.error_description;
|
|
5718
5944
|
transaction = this.transactionManager.get();
|
|
5719
|
-
|
|
5720
|
-
if (!transaction || !transaction.code_verifier) {
|
|
5945
|
+
if (!transaction) {
|
|
5721
5946
|
throw new Error('Invalid state');
|
|
5722
5947
|
}
|
|
5723
5948
|
this.transactionManager.remove();
|
|
5724
5949
|
if (error) {
|
|
5725
5950
|
throw new AuthenticationError(error, error_description, state, transaction.appState);
|
|
5726
5951
|
}
|
|
5952
|
+
// Transaction should have a `code_verifier` to do PKCE for CSRF protection
|
|
5953
|
+
if (!transaction.code_verifier ||
|
|
5954
|
+
(transaction.state && transaction.state !== state)) {
|
|
5955
|
+
throw new Error('Invalid state');
|
|
5956
|
+
}
|
|
5727
5957
|
tokenOptions = {
|
|
5728
5958
|
audience: transaction.audience,
|
|
5729
5959
|
scope: transaction.scope,
|
|
@@ -5733,7 +5963,8 @@
|
|
|
5733
5963
|
grant_type: 'authorization_code',
|
|
5734
5964
|
code: code,
|
|
5735
5965
|
auth0Client: this.options.auth0Client,
|
|
5736
|
-
useFormData: this.options.useFormData
|
|
5966
|
+
useFormData: this.options.useFormData,
|
|
5967
|
+
timeout: this.httpTimeoutMs
|
|
5737
5968
|
};
|
|
5738
5969
|
// some old versions of the SDK might not have added redirect_uri to the
|
|
5739
5970
|
// transaction, we dont want the key to be set to undefined.
|
|
@@ -5746,7 +5977,7 @@
|
|
|
5746
5977
|
return [4 /*yield*/, this._verifyIdToken(authResult.id_token, transaction.nonce, transaction.organizationId)];
|
|
5747
5978
|
case 2:
|
|
5748
5979
|
decodedToken = _b.sent();
|
|
5749
|
-
return [4 /*yield*/, this.cacheManager.set(__assign(__assign({}, authResult), { decodedToken: decodedToken, audience: transaction.audience, scope: transaction.scope, client_id: this.options.client_id }))];
|
|
5980
|
+
return [4 /*yield*/, this.cacheManager.set(__assign(__assign(__assign(__assign({}, authResult), { decodedToken: decodedToken, audience: transaction.audience, scope: transaction.scope }), (authResult.scope ? { oauthTokenScope: authResult.scope } : null)), { client_id: this.options.client_id }))];
|
|
5750
5981
|
case 3:
|
|
5751
5982
|
_b.sent();
|
|
5752
5983
|
this.cookieStorage.save(this.isAuthenticatedCookieName, true, {
|
|
@@ -5777,6 +6008,12 @@
|
|
|
5777
6008
|
* `Auth0Client` constructor. You should not need this if you are using the
|
|
5778
6009
|
* `createAuth0Client` factory.
|
|
5779
6010
|
*
|
|
6011
|
+
* **Note:** the cookie **may not** be present if running an app using a private tab, as some
|
|
6012
|
+
* browsers clear JS cookie data and local storage when the tab or page is closed, or on page reload. This effectively
|
|
6013
|
+
* means that `checkSession` could silently return without authenticating the user on page refresh when
|
|
6014
|
+
* using a private tab, despite having previously logged in. As a workaround, use `getTokenSilently` instead
|
|
6015
|
+
* and handle the possible `login_required` error [as shown in the readme](https://github.com/auth0/auth0-spa-js#creating-the-client).
|
|
6016
|
+
*
|
|
5780
6017
|
* @param options
|
|
5781
6018
|
*/
|
|
5782
6019
|
Auth0Client.prototype.checkSession = function (options) {
|
|
@@ -5822,11 +6059,17 @@
|
|
|
5822
6059
|
* const token = await auth0.getTokenSilently(options);
|
|
5823
6060
|
* ```
|
|
5824
6061
|
*
|
|
5825
|
-
* If there's a valid token stored
|
|
5826
|
-
*
|
|
5827
|
-
*
|
|
5828
|
-
*
|
|
5829
|
-
* will be
|
|
6062
|
+
* If there's a valid token stored and it has more than 60 seconds
|
|
6063
|
+
* remaining before expiration, return the token. Otherwise, attempt
|
|
6064
|
+
* to obtain a new token.
|
|
6065
|
+
*
|
|
6066
|
+
* A new token will be obtained either by opening an iframe or a
|
|
6067
|
+
* refresh token (if `useRefreshTokens` is `true`)
|
|
6068
|
+
|
|
6069
|
+
* If iframes are used, opens an iframe with the `/authorize` URL
|
|
6070
|
+
* using the parameters provided as arguments. Random and secure `state`
|
|
6071
|
+
* and `nonce` parameters will be auto-generated. If the response is successful,
|
|
6072
|
+
* results will be validated according to their expiration times.
|
|
5830
6073
|
*
|
|
5831
6074
|
* If refresh tokens are used, the token endpoint is called directly with the
|
|
5832
6075
|
* 'refresh_token' grant. If no refresh token is available to make this call,
|
|
@@ -5852,7 +6095,7 @@
|
|
|
5852
6095
|
_a = __assign(__assign({ audience: this.options.audience, ignoreCache: false }, options), { scope: getUniqueScopes(this.defaultScope, this.scope, options.scope) }), ignoreCache = _a.ignoreCache, getTokenOptions = __rest(_a, ["ignoreCache"]);
|
|
5853
6096
|
return [2 /*return*/, singlePromise(function () {
|
|
5854
6097
|
return _this._getTokenSilently(__assign({ ignoreCache: ignoreCache }, getTokenOptions));
|
|
5855
|
-
}, this.options.client_id
|
|
6098
|
+
}, "".concat(this.options.client_id, "::").concat(getTokenOptions.audience, "::").concat(getTokenOptions.scope))];
|
|
5856
6099
|
});
|
|
5857
6100
|
});
|
|
5858
6101
|
};
|
|
@@ -6008,7 +6251,7 @@
|
|
|
6008
6251
|
}
|
|
6009
6252
|
var federated = options.federated, logoutOptions = __rest(options, ["federated"]);
|
|
6010
6253
|
var federatedQuery = federated ? "&federated" : '';
|
|
6011
|
-
var url = this._url("/v2/logout?"
|
|
6254
|
+
var url = this._url("/v2/logout?".concat(createQueryParams(logoutOptions)));
|
|
6012
6255
|
return url + federatedQuery;
|
|
6013
6256
|
};
|
|
6014
6257
|
/**
|
|
@@ -6055,7 +6298,7 @@
|
|
|
6055
6298
|
};
|
|
6056
6299
|
Auth0Client.prototype._getTokenFromIFrame = function (options) {
|
|
6057
6300
|
return __awaiter(this, void 0, void 0, function () {
|
|
6058
|
-
var stateIn, nonceIn, code_verifier, code_challengeBuffer, code_challenge, params, orgIdHint, url,
|
|
6301
|
+
var stateIn, nonceIn, code_verifier, code_challengeBuffer, code_challenge, withoutClientOptions, params, orgIdHint, url, authorizeTimeout, codeResult, scope, audience, customOptions, tokenResult, decodedToken, e_1;
|
|
6059
6302
|
return __generator(this, function (_a) {
|
|
6060
6303
|
switch (_a.label) {
|
|
6061
6304
|
case 0:
|
|
@@ -6066,7 +6309,8 @@
|
|
|
6066
6309
|
case 1:
|
|
6067
6310
|
code_challengeBuffer = _a.sent();
|
|
6068
6311
|
code_challenge = bufferToBase64UrlEncoded(code_challengeBuffer);
|
|
6069
|
-
|
|
6312
|
+
withoutClientOptions = __rest(options, ["detailedResponse"]);
|
|
6313
|
+
params = this._getParams(withoutClientOptions, stateIn, nonceIn, code_challenge, options.redirect_uri ||
|
|
6070
6314
|
this.options.redirect_uri ||
|
|
6071
6315
|
window.location.origin);
|
|
6072
6316
|
orgIdHint = this.cookieStorage.get(this.orgHintCookieName);
|
|
@@ -6074,7 +6318,6 @@
|
|
|
6074
6318
|
params.organization = orgIdHint;
|
|
6075
6319
|
}
|
|
6076
6320
|
url = this._authorizeUrl(__assign(__assign({}, params), { prompt: 'none', response_mode: 'web_message' }));
|
|
6077
|
-
timeout = options.timeoutInSeconds || this.options.authorizeTimeoutInSeconds;
|
|
6078
6321
|
_a.label = 2;
|
|
6079
6322
|
case 2:
|
|
6080
6323
|
_a.trys.push([2, 6, , 7]);
|
|
@@ -6084,14 +6327,15 @@
|
|
|
6084
6327
|
if (window.crossOriginIsolated) {
|
|
6085
6328
|
throw new GenericError('login_required', 'The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.');
|
|
6086
6329
|
}
|
|
6087
|
-
|
|
6330
|
+
authorizeTimeout = options.timeoutInSeconds || this.options.authorizeTimeoutInSeconds;
|
|
6331
|
+
return [4 /*yield*/, runIframe(url, this.domainUrl, authorizeTimeout)];
|
|
6088
6332
|
case 3:
|
|
6089
6333
|
codeResult = _a.sent();
|
|
6090
6334
|
if (stateIn !== codeResult.state) {
|
|
6091
6335
|
throw new Error('Invalid state');
|
|
6092
6336
|
}
|
|
6093
|
-
scope = options.scope, audience = options.audience, customOptions = __rest(options, ["scope", "audience", "redirect_uri", "ignoreCache", "timeoutInSeconds"]);
|
|
6094
|
-
return [4 /*yield*/, oauthToken(__assign(__assign(__assign({}, this.customOptions), customOptions), { scope: scope, audience: audience, baseUrl: this.domainUrl, client_id: this.options.client_id, code_verifier: code_verifier, code: codeResult.code, grant_type: 'authorization_code', redirect_uri: params.redirect_uri, auth0Client: this.options.auth0Client, useFormData: this.options.useFormData }), this.worker)];
|
|
6337
|
+
scope = options.scope, audience = options.audience, customOptions = __rest(options, ["scope", "audience", "redirect_uri", "ignoreCache", "timeoutInSeconds", "detailedResponse"]);
|
|
6338
|
+
return [4 /*yield*/, oauthToken(__assign(__assign(__assign({}, this.customOptions), customOptions), { scope: scope, audience: audience, baseUrl: this.domainUrl, client_id: this.options.client_id, code_verifier: code_verifier, code: codeResult.code, grant_type: 'authorization_code', redirect_uri: params.redirect_uri, auth0Client: this.options.auth0Client, useFormData: this.options.useFormData, timeout: customOptions.timeout || this.httpTimeoutMs }), this.worker)];
|
|
6095
6339
|
case 4:
|
|
6096
6340
|
tokenResult = _a.sent();
|
|
6097
6341
|
return [4 /*yield*/, this._verifyIdToken(tokenResult.id_token, nonceIn)];
|
|
@@ -6133,14 +6377,14 @@
|
|
|
6133
6377
|
redirect_uri = options.redirect_uri ||
|
|
6134
6378
|
this.options.redirect_uri ||
|
|
6135
6379
|
window.location.origin;
|
|
6136
|
-
scope = options.scope, audience = options.audience, customOptions = __rest(options, ["scope", "audience", "ignoreCache", "timeoutInSeconds"]);
|
|
6380
|
+
scope = options.scope, audience = options.audience, customOptions = __rest(options, ["scope", "audience", "ignoreCache", "timeoutInSeconds", "detailedResponse"]);
|
|
6137
6381
|
timeout = typeof options.timeoutInSeconds === 'number'
|
|
6138
6382
|
? options.timeoutInSeconds * 1000
|
|
6139
6383
|
: null;
|
|
6140
6384
|
_a.label = 4;
|
|
6141
6385
|
case 4:
|
|
6142
6386
|
_a.trys.push([4, 6, , 9]);
|
|
6143
|
-
return [4 /*yield*/, oauthToken(__assign(__assign(__assign(__assign(__assign({}, this.customOptions), customOptions), { audience: audience, scope: scope, baseUrl: this.domainUrl, client_id: this.options.client_id, grant_type: 'refresh_token', refresh_token: cache && cache.refresh_token, redirect_uri: redirect_uri }), (timeout && { timeout: timeout })), { auth0Client: this.options.auth0Client, useFormData: this.options.useFormData }), this.worker)];
|
|
6387
|
+
return [4 /*yield*/, oauthToken(__assign(__assign(__assign(__assign(__assign({}, this.customOptions), customOptions), { audience: audience, scope: scope, baseUrl: this.domainUrl, client_id: this.options.client_id, grant_type: 'refresh_token', refresh_token: cache && cache.refresh_token, redirect_uri: redirect_uri }), (timeout && { timeout: timeout })), { auth0Client: this.options.auth0Client, useFormData: this.options.useFormData, timeout: this.httpTimeoutMs }), this.worker)];
|
|
6144
6388
|
case 5:
|
|
6145
6389
|
tokenResult = _a.sent();
|
|
6146
6390
|
return [3 /*break*/, 9];
|
|
@@ -6197,6 +6441,15 @@
|
|
|
6197
6441
|
return Auth0Client;
|
|
6198
6442
|
}());
|
|
6199
6443
|
|
|
6444
|
+
/**
|
|
6445
|
+
* Asynchronously creates the Auth0Client instance and calls `checkSession`.
|
|
6446
|
+
*
|
|
6447
|
+
* **Note:** There are caveats to using this in a private browser tab, which may not silently authenticae
|
|
6448
|
+
* a user on page refresh. Please see [the checkSession docs](https://auth0.github.io/auth0-spa-js/classes/auth0client.html#checksession) for more info.
|
|
6449
|
+
*
|
|
6450
|
+
* @param options The client options
|
|
6451
|
+
* @returns An instance of Auth0Client
|
|
6452
|
+
*/
|
|
6200
6453
|
function createAuth0Client(options) {
|
|
6201
6454
|
return __awaiter(this, void 0, void 0, function () {
|
|
6202
6455
|
var auth0;
|