@jetthai/cuora 1.1.6 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.mjs CHANGED
@@ -1272,9 +1272,9 @@ var _equalArrays = equalArrays$2;
1272
1272
  var root$4 = _root;
1273
1273
 
1274
1274
  /** Built-in value references. */
1275
- var Uint8Array$2 = root$4.Uint8Array;
1275
+ var Uint8Array$1 = root$4.Uint8Array;
1276
1276
 
1277
- var _Uint8Array = Uint8Array$2;
1277
+ var _Uint8Array = Uint8Array$1;
1278
1278
 
1279
1279
  /**
1280
1280
  * Converts `map` to its key-value pairs.
@@ -1317,7 +1317,7 @@ function setToArray$1(set) {
1317
1317
  var _setToArray = setToArray$1;
1318
1318
 
1319
1319
  var Symbol$2 = _Symbol,
1320
- Uint8Array$1 = _Uint8Array,
1320
+ Uint8Array = _Uint8Array,
1321
1321
  eq$1 = eq_1,
1322
1322
  equalArrays$1 = _equalArrays,
1323
1323
  mapToArray = _mapToArray,
@@ -1374,7 +1374,7 @@ function equalByTag$1(object, other, tag, bitmask, customizer, equalFunc, stack)
1374
1374
 
1375
1375
  case arrayBufferTag$1:
1376
1376
  if ((object.byteLength != other.byteLength) ||
1377
- !equalFunc(new Uint8Array$1(object), new Uint8Array$1(other))) {
1377
+ !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
1378
1378
  return false;
1379
1379
  }
1380
1380
  return true;
@@ -9135,7 +9135,7 @@ var storage = {
9135
9135
  }
9136
9136
  };
9137
9137
 
9138
- /*! *****************************************************************************
9138
+ /******************************************************************************
9139
9139
  Copyright (c) Microsoft Corporation.
9140
9140
 
9141
9141
  Permission to use, copy, modify, and/or distribute this software for any
@@ -9160,2441 +9160,35 @@ var __assign = function() {
9160
9160
  };
9161
9161
  return __assign.apply(this, arguments);
9162
9162
  };
9163
-
9164
- function __rest(s, e) {
9165
- var t = {};
9166
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
9167
- t[p] = s[p];
9168
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
9169
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
9170
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9171
- t[p[i]] = s[p[i]];
9172
- }
9173
- return t;
9174
- }
9175
-
9176
- function __awaiter(thisArg, _arguments, P, generator) {
9177
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
9178
- return new (P || (P = Promise))(function (resolve, reject) {
9179
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
9180
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
9181
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9182
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9183
- });
9184
- }
9185
-
9186
- function __generator(thisArg, body) {
9187
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
9188
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
9189
- function verb(n) { return function (v) { return step([n, v]); }; }
9190
- function step(op) {
9191
- if (f) throw new TypeError("Generator is already executing.");
9192
- while (_) try {
9193
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
9194
- if (y = 0, t) op = [op[0] & 2, t.value];
9195
- switch (op[0]) {
9196
- case 0: case 1: t = op; break;
9197
- case 4: _.label++; return { value: op[1], done: false };
9198
- case 5: _.label++; y = op[1]; op = [0]; continue;
9199
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
9200
- default:
9201
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
9202
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
9203
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
9204
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
9205
- if (t[2]) _.ops.pop();
9206
- _.trys.pop(); continue;
9207
- }
9208
- op = body.call(thisArg, _);
9209
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
9210
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
9211
- }
9212
- }
9213
-
9214
- /** @deprecated */
9215
- function __spreadArrays() {
9216
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
9217
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
9218
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
9219
- r[k] = a[j];
9220
- return r;
9221
- }
9222
-
9223
- /**
9224
- * FingerprintJS v3.3.3 - Copyright (c) FingerprintJS, Inc, 2022 (https://fingerprintjs.com)
9225
- * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
9226
- *
9227
- * This software contains code from open-source projects:
9228
- * MurmurHash3 by Karan Lyons (https://github.com/karanlyons/murmurHash3.js)
9229
- */
9230
-
9231
- function wait(durationMs, resolveWith) {
9232
- return new Promise(function (resolve) { return setTimeout(resolve, durationMs, resolveWith); });
9233
- }
9234
- function requestIdleCallbackIfAvailable(fallbackTimeout, deadlineTimeout) {
9235
- if (deadlineTimeout === void 0) { deadlineTimeout = Infinity; }
9236
- var requestIdleCallback = window.requestIdleCallback;
9237
- if (requestIdleCallback) {
9238
- // The function `requestIdleCallback` loses the binding to `window` here.
9239
- // `globalThis` isn't always equal `window` (see https://github.com/fingerprintjs/fingerprintjs/issues/683).
9240
- // Therefore, an error can occur. `call(window,` prevents the error.
9241
- return new Promise(function (resolve) { return requestIdleCallback.call(window, function () { return resolve(); }, { timeout: deadlineTimeout }); });
9242
- }
9243
- else {
9244
- return wait(Math.min(fallbackTimeout, deadlineTimeout));
9245
- }
9246
- }
9247
- function isPromise(value) {
9248
- return value && typeof value.then === 'function';
9249
- }
9250
- /**
9251
- * Calls a maybe asynchronous function without creating microtasks when the function is synchronous.
9252
- * Catches errors in both cases.
9253
- *
9254
- * If just you run a code like this:
9255
- * ```
9256
- * console.time('Action duration')
9257
- * await action()
9258
- * console.timeEnd('Action duration')
9259
- * ```
9260
- * The synchronous function time can be measured incorrectly because another microtask may run before the `await`
9261
- * returns the control back to the code.
9262
- */
9263
- function awaitIfAsync(action, callback) {
9264
- try {
9265
- var returnedValue = action();
9266
- if (isPromise(returnedValue)) {
9267
- returnedValue.then(function (result) { return callback(true, result); }, function (error) { return callback(false, error); });
9268
- }
9269
- else {
9270
- callback(true, returnedValue);
9271
- }
9272
- }
9273
- catch (error) {
9274
- callback(false, error);
9275
- }
9276
- }
9277
- /**
9278
- * If you run many synchronous tasks without using this function, the JS main loop will be busy and asynchronous tasks
9279
- * (e.g. completing a network request, rendering the page) won't be able to happen.
9280
- * This function allows running many synchronous tasks such way that asynchronous tasks can run too in background.
9281
- */
9282
- function forEachWithBreaks(items, callback, loopReleaseInterval) {
9283
- if (loopReleaseInterval === void 0) { loopReleaseInterval = 16; }
9284
- return __awaiter(this, void 0, void 0, function () {
9285
- var lastLoopReleaseTime, i, now;
9286
- return __generator(this, function (_a) {
9287
- switch (_a.label) {
9288
- case 0:
9289
- lastLoopReleaseTime = Date.now();
9290
- i = 0;
9291
- _a.label = 1;
9292
- case 1:
9293
- if (!(i < items.length)) return [3 /*break*/, 4];
9294
- callback(items[i], i);
9295
- now = Date.now();
9296
- if (!(now >= lastLoopReleaseTime + loopReleaseInterval)) return [3 /*break*/, 3];
9297
- lastLoopReleaseTime = now;
9298
- // Allows asynchronous actions and microtasks to happen
9299
- return [4 /*yield*/, wait(0)];
9300
- case 2:
9301
- // Allows asynchronous actions and microtasks to happen
9302
- _a.sent();
9303
- _a.label = 3;
9304
- case 3:
9305
- ++i;
9306
- return [3 /*break*/, 1];
9307
- case 4: return [2 /*return*/];
9308
- }
9309
- });
9310
- });
9311
- }
9312
-
9313
- /*
9314
- * Taken from https://github.com/karanlyons/murmurHash3.js/blob/a33d0723127e2e5415056c455f8aed2451ace208/murmurHash3.js
9315
- */
9316
- //
9317
- // Given two 64bit ints (as an array of two 32bit ints) returns the two
9318
- // added together as a 64bit int (as an array of two 32bit ints).
9319
- //
9320
- function x64Add(m, n) {
9321
- m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];
9322
- n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];
9323
- var o = [0, 0, 0, 0];
9324
- o[3] += m[3] + n[3];
9325
- o[2] += o[3] >>> 16;
9326
- o[3] &= 0xffff;
9327
- o[2] += m[2] + n[2];
9328
- o[1] += o[2] >>> 16;
9329
- o[2] &= 0xffff;
9330
- o[1] += m[1] + n[1];
9331
- o[0] += o[1] >>> 16;
9332
- o[1] &= 0xffff;
9333
- o[0] += m[0] + n[0];
9334
- o[0] &= 0xffff;
9335
- return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];
9336
- }
9337
- //
9338
- // Given two 64bit ints (as an array of two 32bit ints) returns the two
9339
- // multiplied together as a 64bit int (as an array of two 32bit ints).
9340
- //
9341
- function x64Multiply(m, n) {
9342
- m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];
9343
- n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];
9344
- var o = [0, 0, 0, 0];
9345
- o[3] += m[3] * n[3];
9346
- o[2] += o[3] >>> 16;
9347
- o[3] &= 0xffff;
9348
- o[2] += m[2] * n[3];
9349
- o[1] += o[2] >>> 16;
9350
- o[2] &= 0xffff;
9351
- o[2] += m[3] * n[2];
9352
- o[1] += o[2] >>> 16;
9353
- o[2] &= 0xffff;
9354
- o[1] += m[1] * n[3];
9355
- o[0] += o[1] >>> 16;
9356
- o[1] &= 0xffff;
9357
- o[1] += m[2] * n[2];
9358
- o[0] += o[1] >>> 16;
9359
- o[1] &= 0xffff;
9360
- o[1] += m[3] * n[1];
9361
- o[0] += o[1] >>> 16;
9362
- o[1] &= 0xffff;
9363
- o[0] += m[0] * n[3] + m[1] * n[2] + m[2] * n[1] + m[3] * n[0];
9364
- o[0] &= 0xffff;
9365
- return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];
9366
- }
9367
- //
9368
- // Given a 64bit int (as an array of two 32bit ints) and an int
9369
- // representing a number of bit positions, returns the 64bit int (as an
9370
- // array of two 32bit ints) rotated left by that number of positions.
9371
- //
9372
- function x64Rotl(m, n) {
9373
- n %= 64;
9374
- if (n === 32) {
9375
- return [m[1], m[0]];
9376
- }
9377
- else if (n < 32) {
9378
- return [(m[0] << n) | (m[1] >>> (32 - n)), (m[1] << n) | (m[0] >>> (32 - n))];
9379
- }
9380
- else {
9381
- n -= 32;
9382
- return [(m[1] << n) | (m[0] >>> (32 - n)), (m[0] << n) | (m[1] >>> (32 - n))];
9383
- }
9384
- }
9385
- //
9386
- // Given a 64bit int (as an array of two 32bit ints) and an int
9387
- // representing a number of bit positions, returns the 64bit int (as an
9388
- // array of two 32bit ints) shifted left by that number of positions.
9389
- //
9390
- function x64LeftShift(m, n) {
9391
- n %= 64;
9392
- if (n === 0) {
9393
- return m;
9394
- }
9395
- else if (n < 32) {
9396
- return [(m[0] << n) | (m[1] >>> (32 - n)), m[1] << n];
9397
- }
9398
- else {
9399
- return [m[1] << (n - 32), 0];
9400
- }
9401
- }
9402
- //
9403
- // Given two 64bit ints (as an array of two 32bit ints) returns the two
9404
- // xored together as a 64bit int (as an array of two 32bit ints).
9405
- //
9406
- function x64Xor(m, n) {
9407
- return [m[0] ^ n[0], m[1] ^ n[1]];
9408
- }
9409
- //
9410
- // Given a block, returns murmurHash3's final x64 mix of that block.
9411
- // (`[0, h[0] >>> 1]` is a 33 bit unsigned right shift. This is the
9412
- // only place where we need to right shift 64bit ints.)
9413
- //
9414
- function x64Fmix(h) {
9415
- h = x64Xor(h, [0, h[0] >>> 1]);
9416
- h = x64Multiply(h, [0xff51afd7, 0xed558ccd]);
9417
- h = x64Xor(h, [0, h[0] >>> 1]);
9418
- h = x64Multiply(h, [0xc4ceb9fe, 0x1a85ec53]);
9419
- h = x64Xor(h, [0, h[0] >>> 1]);
9420
- return h;
9421
- }
9422
- //
9423
- // Given a string and an optional seed as an int, returns a 128 bit
9424
- // hash using the x64 flavor of MurmurHash3, as an unsigned hex.
9425
- //
9426
- function x64hash128(key, seed) {
9427
- key = key || '';
9428
- seed = seed || 0;
9429
- var remainder = key.length % 16;
9430
- var bytes = key.length - remainder;
9431
- var h1 = [0, seed];
9432
- var h2 = [0, seed];
9433
- var k1 = [0, 0];
9434
- var k2 = [0, 0];
9435
- var c1 = [0x87c37b91, 0x114253d5];
9436
- var c2 = [0x4cf5ad43, 0x2745937f];
9437
- var i;
9438
- for (i = 0; i < bytes; i = i + 16) {
9439
- k1 = [
9440
- (key.charCodeAt(i + 4) & 0xff) |
9441
- ((key.charCodeAt(i + 5) & 0xff) << 8) |
9442
- ((key.charCodeAt(i + 6) & 0xff) << 16) |
9443
- ((key.charCodeAt(i + 7) & 0xff) << 24),
9444
- (key.charCodeAt(i) & 0xff) |
9445
- ((key.charCodeAt(i + 1) & 0xff) << 8) |
9446
- ((key.charCodeAt(i + 2) & 0xff) << 16) |
9447
- ((key.charCodeAt(i + 3) & 0xff) << 24),
9448
- ];
9449
- k2 = [
9450
- (key.charCodeAt(i + 12) & 0xff) |
9451
- ((key.charCodeAt(i + 13) & 0xff) << 8) |
9452
- ((key.charCodeAt(i + 14) & 0xff) << 16) |
9453
- ((key.charCodeAt(i + 15) & 0xff) << 24),
9454
- (key.charCodeAt(i + 8) & 0xff) |
9455
- ((key.charCodeAt(i + 9) & 0xff) << 8) |
9456
- ((key.charCodeAt(i + 10) & 0xff) << 16) |
9457
- ((key.charCodeAt(i + 11) & 0xff) << 24),
9458
- ];
9459
- k1 = x64Multiply(k1, c1);
9460
- k1 = x64Rotl(k1, 31);
9461
- k1 = x64Multiply(k1, c2);
9462
- h1 = x64Xor(h1, k1);
9463
- h1 = x64Rotl(h1, 27);
9464
- h1 = x64Add(h1, h2);
9465
- h1 = x64Add(x64Multiply(h1, [0, 5]), [0, 0x52dce729]);
9466
- k2 = x64Multiply(k2, c2);
9467
- k2 = x64Rotl(k2, 33);
9468
- k2 = x64Multiply(k2, c1);
9469
- h2 = x64Xor(h2, k2);
9470
- h2 = x64Rotl(h2, 31);
9471
- h2 = x64Add(h2, h1);
9472
- h2 = x64Add(x64Multiply(h2, [0, 5]), [0, 0x38495ab5]);
9473
- }
9474
- k1 = [0, 0];
9475
- k2 = [0, 0];
9476
- switch (remainder) {
9477
- case 15:
9478
- k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 14)], 48));
9479
- // fallthrough
9480
- case 14:
9481
- k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 13)], 40));
9482
- // fallthrough
9483
- case 13:
9484
- k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 12)], 32));
9485
- // fallthrough
9486
- case 12:
9487
- k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 11)], 24));
9488
- // fallthrough
9489
- case 11:
9490
- k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 10)], 16));
9491
- // fallthrough
9492
- case 10:
9493
- k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 9)], 8));
9494
- // fallthrough
9495
- case 9:
9496
- k2 = x64Xor(k2, [0, key.charCodeAt(i + 8)]);
9497
- k2 = x64Multiply(k2, c2);
9498
- k2 = x64Rotl(k2, 33);
9499
- k2 = x64Multiply(k2, c1);
9500
- h2 = x64Xor(h2, k2);
9501
- // fallthrough
9502
- case 8:
9503
- k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 7)], 56));
9504
- // fallthrough
9505
- case 7:
9506
- k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 6)], 48));
9507
- // fallthrough
9508
- case 6:
9509
- k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 5)], 40));
9510
- // fallthrough
9511
- case 5:
9512
- k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 4)], 32));
9513
- // fallthrough
9514
- case 4:
9515
- k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 3)], 24));
9516
- // fallthrough
9517
- case 3:
9518
- k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 2)], 16));
9519
- // fallthrough
9520
- case 2:
9521
- k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 1)], 8));
9522
- // fallthrough
9523
- case 1:
9524
- k1 = x64Xor(k1, [0, key.charCodeAt(i)]);
9525
- k1 = x64Multiply(k1, c1);
9526
- k1 = x64Rotl(k1, 31);
9527
- k1 = x64Multiply(k1, c2);
9528
- h1 = x64Xor(h1, k1);
9529
- // fallthrough
9530
- }
9531
- h1 = x64Xor(h1, [0, key.length]);
9532
- h2 = x64Xor(h2, [0, key.length]);
9533
- h1 = x64Add(h1, h2);
9534
- h2 = x64Add(h2, h1);
9535
- h1 = x64Fmix(h1);
9536
- h2 = x64Fmix(h2);
9537
- h1 = x64Add(h1, h2);
9538
- h2 = x64Add(h2, h1);
9539
- return (('00000000' + (h1[0] >>> 0).toString(16)).slice(-8) +
9540
- ('00000000' + (h1[1] >>> 0).toString(16)).slice(-8) +
9541
- ('00000000' + (h2[0] >>> 0).toString(16)).slice(-8) +
9542
- ('00000000' + (h2[1] >>> 0).toString(16)).slice(-8));
9543
- }
9544
-
9545
- /*
9546
- * This file contains functions to work with pure data only (no browser features, DOM, side effects, etc).
9547
- */
9548
- /**
9549
- * Does the same as Array.prototype.includes but has better typing
9550
- */
9551
- function includes(haystack, needle) {
9552
- for (var i = 0, l = haystack.length; i < l; ++i) {
9553
- if (haystack[i] === needle) {
9554
- return true;
9555
- }
9556
- }
9557
- return false;
9558
- }
9559
- /**
9560
- * Like `!includes()` but with proper typing
9561
- */
9562
- function excludes(haystack, needle) {
9563
- return !includes(haystack, needle);
9564
- }
9565
- /**
9566
- * Be careful, NaN can return
9567
- */
9568
- function toInt(value) {
9569
- return parseInt(value);
9570
- }
9571
- /**
9572
- * Be careful, NaN can return
9573
- */
9574
- function toFloat(value) {
9575
- return parseFloat(value);
9576
- }
9577
- function replaceNaN(value, replacement) {
9578
- return typeof value === 'number' && isNaN(value) ? replacement : value;
9579
- }
9580
- function countTruthy(values) {
9581
- return values.reduce(function (sum, value) { return sum + (value ? 1 : 0); }, 0);
9582
- }
9583
- function round(value, base) {
9584
- if (base === void 0) { base = 1; }
9585
- if (Math.abs(base) >= 1) {
9586
- return Math.round(value / base) * base;
9587
- }
9588
- else {
9589
- // Sometimes when a number is multiplied by a small number, precision is lost,
9590
- // for example 1234 * 0.0001 === 0.12340000000000001, and it's more precise divide: 1234 / (1 / 0.0001) === 0.1234.
9591
- var counterBase = 1 / base;
9592
- return Math.round(value * counterBase) / counterBase;
9593
- }
9594
- }
9595
- /**
9596
- * Parses a CSS selector into tag name with HTML attributes.
9597
- * Only single element selector are supported (without operators like space, +, >, etc).
9598
- *
9599
- * Multiple values can be returned for each attribute. You decide how to handle them.
9600
- */
9601
- function parseSimpleCssSelector(selector) {
9602
- var _a, _b;
9603
- var errorMessage = "Unexpected syntax '" + selector + "'";
9604
- var tagMatch = /^\s*([a-z-]*)(.*)$/i.exec(selector);
9605
- var tag = tagMatch[1] || undefined;
9606
- var attributes = {};
9607
- var partsRegex = /([.:#][\w-]+|\[.+?\])/gi;
9608
- var addAttribute = function (name, value) {
9609
- attributes[name] = attributes[name] || [];
9610
- attributes[name].push(value);
9611
- };
9612
- for (;;) {
9613
- var match = partsRegex.exec(tagMatch[2]);
9614
- if (!match) {
9615
- break;
9616
- }
9617
- var part = match[0];
9618
- switch (part[0]) {
9619
- case '.':
9620
- addAttribute('class', part.slice(1));
9621
- break;
9622
- case '#':
9623
- addAttribute('id', part.slice(1));
9624
- break;
9625
- case '[': {
9626
- var attributeMatch = /^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(part);
9627
- if (attributeMatch) {
9628
- addAttribute(attributeMatch[1], (_b = (_a = attributeMatch[4]) !== null && _a !== void 0 ? _a : attributeMatch[5]) !== null && _b !== void 0 ? _b : '');
9629
- }
9630
- else {
9631
- throw new Error(errorMessage);
9632
- }
9633
- break;
9634
- }
9635
- default:
9636
- throw new Error(errorMessage);
9637
- }
9638
- }
9639
- return [tag, attributes];
9640
- }
9641
-
9642
- function ensureErrorWithMessage(error) {
9643
- return error && typeof error === 'object' && 'message' in error ? error : { message: error };
9644
- }
9645
- /**
9646
- * Loads the given entropy source. Returns a function that gets an entropy component from the source.
9647
- *
9648
- * The result is returned synchronously to prevent `loadSources` from
9649
- * waiting for one source to load before getting the components from the other sources.
9650
- */
9651
- function loadSource(source, sourceOptions) {
9652
- var isFinalResultLoaded = function (loadResult) {
9653
- return typeof loadResult !== 'function';
9654
- };
9655
- var sourceLoadPromise = new Promise(function (resolveLoad) {
9656
- var loadStartTime = Date.now();
9657
- // `awaitIfAsync` is used instead of just `await` in order to measure the duration of synchronous sources
9658
- // correctly (other microtasks won't affect the duration).
9659
- awaitIfAsync(source.bind(null, sourceOptions), function () {
9660
- var loadArgs = [];
9661
- for (var _i = 0; _i < arguments.length; _i++) {
9662
- loadArgs[_i] = arguments[_i];
9663
- }
9664
- var loadDuration = Date.now() - loadStartTime;
9665
- // Source loading failed
9666
- if (!loadArgs[0]) {
9667
- return resolveLoad(function () { return ({ error: ensureErrorWithMessage(loadArgs[1]), duration: loadDuration }); });
9668
- }
9669
- var loadResult = loadArgs[1];
9670
- // Source loaded with the final result
9671
- if (isFinalResultLoaded(loadResult)) {
9672
- return resolveLoad(function () { return ({ value: loadResult, duration: loadDuration }); });
9673
- }
9674
- // Source loaded with "get" stage
9675
- resolveLoad(function () {
9676
- return new Promise(function (resolveGet) {
9677
- var getStartTime = Date.now();
9678
- awaitIfAsync(loadResult, function () {
9679
- var getArgs = [];
9680
- for (var _i = 0; _i < arguments.length; _i++) {
9681
- getArgs[_i] = arguments[_i];
9682
- }
9683
- var duration = loadDuration + Date.now() - getStartTime;
9684
- // Source getting failed
9685
- if (!getArgs[0]) {
9686
- return resolveGet({ error: ensureErrorWithMessage(getArgs[1]), duration: duration });
9687
- }
9688
- // Source getting succeeded
9689
- resolveGet({ value: getArgs[1], duration: duration });
9690
- });
9691
- });
9692
- });
9693
- });
9694
- });
9695
- return function getComponent() {
9696
- return sourceLoadPromise.then(function (finalizeSource) { return finalizeSource(); });
9697
- };
9698
- }
9699
- /**
9700
- * Loads the given entropy sources. Returns a function that collects the entropy components.
9701
- *
9702
- * The result is returned synchronously in order to allow start getting the components
9703
- * before the sources are loaded completely.
9704
- *
9705
- * Warning for package users:
9706
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
9707
- */
9708
- function loadSources(sources, sourceOptions, excludeSources) {
9709
- var includedSources = Object.keys(sources).filter(function (sourceKey) { return excludes(excludeSources, sourceKey); });
9710
- var sourceGetters = Array(includedSources.length);
9711
- // Using `forEachWithBreaks` allows asynchronous sources to complete between synchronous sources
9712
- // and measure the duration correctly
9713
- forEachWithBreaks(includedSources, function (sourceKey, index) {
9714
- sourceGetters[index] = loadSource(sources[sourceKey], sourceOptions);
9715
- });
9716
- return function getComponents() {
9717
- return __awaiter(this, void 0, void 0, function () {
9718
- var components, _i, includedSources_1, sourceKey, componentPromises, _loop_1, state_1;
9719
- return __generator(this, function (_a) {
9720
- switch (_a.label) {
9721
- case 0:
9722
- components = {};
9723
- for (_i = 0, includedSources_1 = includedSources; _i < includedSources_1.length; _i++) {
9724
- sourceKey = includedSources_1[_i];
9725
- components[sourceKey] = undefined;
9726
- }
9727
- componentPromises = Array(includedSources.length);
9728
- _loop_1 = function () {
9729
- var hasAllComponentPromises;
9730
- return __generator(this, function (_a) {
9731
- switch (_a.label) {
9732
- case 0:
9733
- hasAllComponentPromises = true;
9734
- return [4 /*yield*/, forEachWithBreaks(includedSources, function (sourceKey, index) {
9735
- if (!componentPromises[index]) {
9736
- // `sourceGetters` may be incomplete at this point of execution because `forEachWithBreaks` is asynchronous
9737
- if (sourceGetters[index]) {
9738
- componentPromises[index] = sourceGetters[index]().then(function (component) { return (components[sourceKey] = component); });
9739
- }
9740
- else {
9741
- hasAllComponentPromises = false;
9742
- }
9743
- }
9744
- })];
9745
- case 1:
9746
- _a.sent();
9747
- if (hasAllComponentPromises) {
9748
- return [2 /*return*/, "break"];
9749
- }
9750
- return [4 /*yield*/, wait(1)]; // Lets the source load loop continue
9751
- case 2:
9752
- _a.sent(); // Lets the source load loop continue
9753
- return [2 /*return*/];
9754
- }
9755
- });
9756
- };
9757
- _a.label = 1;
9758
- case 1: return [5 /*yield**/, _loop_1()];
9759
- case 2:
9760
- state_1 = _a.sent();
9761
- if (state_1 === "break")
9762
- return [3 /*break*/, 4];
9763
- _a.label = 3;
9764
- case 3: return [3 /*break*/, 1];
9765
- case 4: return [4 /*yield*/, Promise.all(componentPromises)];
9766
- case 5:
9767
- _a.sent();
9768
- return [2 /*return*/, components];
9769
- }
9770
- });
9771
- });
9772
- };
9773
- }
9774
-
9775
- /*
9776
- * Functions to help with features that vary through browsers
9777
- */
9778
- /**
9779
- * Checks whether the browser is based on Trident (the Internet Explorer engine) without using user-agent.
9780
- *
9781
- * Warning for package users:
9782
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
9783
- */
9784
- function isTrident() {
9785
- var w = window;
9786
- var n = navigator;
9787
- // The properties are checked to be in IE 10, IE 11 and not to be in other browsers in October 2020
9788
- return (countTruthy([
9789
- 'MSCSSMatrix' in w,
9790
- 'msSetImmediate' in w,
9791
- 'msIndexedDB' in w,
9792
- 'msMaxTouchPoints' in n,
9793
- 'msPointerEnabled' in n,
9794
- ]) >= 4);
9795
- }
9796
- /**
9797
- * Checks whether the browser is based on EdgeHTML (the pre-Chromium Edge engine) without using user-agent.
9798
- *
9799
- * Warning for package users:
9800
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
9801
- */
9802
- function isEdgeHTML() {
9803
- // Based on research in October 2020
9804
- var w = window;
9805
- var n = navigator;
9806
- return (countTruthy(['msWriteProfilerMark' in w, 'MSStream' in w, 'msLaunchUri' in n, 'msSaveBlob' in n]) >= 3 &&
9807
- !isTrident());
9808
- }
9809
- /**
9810
- * Checks whether the browser is based on Chromium without using user-agent.
9811
- *
9812
- * Warning for package users:
9813
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
9814
- */
9815
- function isChromium() {
9816
- // Based on research in October 2020. Tested to detect Chromium 42-86.
9817
- var w = window;
9818
- var n = navigator;
9819
- return (countTruthy([
9820
- 'webkitPersistentStorage' in n,
9821
- 'webkitTemporaryStorage' in n,
9822
- n.vendor.indexOf('Google') === 0,
9823
- 'webkitResolveLocalFileSystemURL' in w,
9824
- 'BatteryManager' in w,
9825
- 'webkitMediaStream' in w,
9826
- 'webkitSpeechGrammar' in w,
9827
- ]) >= 5);
9828
- }
9829
- /**
9830
- * Checks whether the browser is based on mobile or desktop Safari without using user-agent.
9831
- * All iOS browsers use WebKit (the Safari engine).
9832
- *
9833
- * Warning for package users:
9834
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
9835
- */
9836
- function isWebKit() {
9837
- // Based on research in September 2020
9838
- var w = window;
9839
- var n = navigator;
9840
- return (countTruthy([
9841
- 'ApplePayError' in w,
9842
- 'CSSPrimitiveValue' in w,
9843
- 'Counter' in w,
9844
- n.vendor.indexOf('Apple') === 0,
9845
- 'getStorageUpdates' in n,
9846
- 'WebKitMediaKeys' in w,
9847
- ]) >= 4);
9848
- }
9849
- /**
9850
- * Checks whether the WebKit browser is a desktop Safari.
9851
- *
9852
- * Warning for package users:
9853
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
9854
- */
9855
- function isDesktopSafari() {
9856
- var w = window;
9857
- return (countTruthy([
9858
- 'safari' in w,
9859
- !('DeviceMotionEvent' in w),
9860
- !('ongestureend' in w),
9861
- !('standalone' in navigator),
9862
- ]) >= 3);
9863
- }
9864
- /**
9865
- * Checks whether the browser is based on Gecko (Firefox engine) without using user-agent.
9866
- *
9867
- * Warning for package users:
9868
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
9869
- */
9870
- function isGecko() {
9871
- var _a, _b;
9872
- var w = window;
9873
- // Based on research in September 2020
9874
- return (countTruthy([
9875
- 'buildID' in navigator,
9876
- 'MozAppearance' in ((_b = (_a = document.documentElement) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : {}),
9877
- 'onmozfullscreenchange' in w,
9878
- 'mozInnerScreenX' in w,
9879
- 'CSSMozDocumentRule' in w,
9880
- 'CanvasCaptureMediaStream' in w,
9881
- ]) >= 4);
9882
- }
9883
- /**
9884
- * Checks whether the browser is based on Chromium version ≥86 without using user-agent.
9885
- * It doesn't check that the browser is based on Chromium, there is a separate function for this.
9886
- */
9887
- function isChromium86OrNewer() {
9888
- // Checked in Chrome 85 vs Chrome 86 both on desktop and Android
9889
- var w = window;
9890
- return (countTruthy([
9891
- !('MediaSettingsRange' in w),
9892
- 'RTCEncodedAudioFrame' in w,
9893
- '' + w.Intl === '[object Intl]',
9894
- '' + w.Reflect === '[object Reflect]',
9895
- ]) >= 3);
9896
- }
9897
- /**
9898
- * Checks whether the browser is based on WebKit version ≥606 (Safari ≥12) without using user-agent.
9899
- * It doesn't check that the browser is based on WebKit, there is a separate function for this.
9900
- *
9901
- * @link https://en.wikipedia.org/wiki/Safari_version_history#Release_history Safari-WebKit versions map
9902
- */
9903
- function isWebKit606OrNewer() {
9904
- // Checked in Safari 9–14
9905
- var w = window;
9906
- return (countTruthy([
9907
- 'DOMRectList' in w,
9908
- 'RTCPeerConnectionIceEvent' in w,
9909
- 'SVGGeometryElement' in w,
9910
- 'ontransitioncancel' in w,
9911
- ]) >= 3);
9912
- }
9913
- /**
9914
- * Checks whether the device is an iPad.
9915
- * It doesn't check that the engine is WebKit and that the WebKit isn't desktop.
9916
- */
9917
- function isIPad() {
9918
- // Checked on:
9919
- // Safari on iPadOS (both mobile and desktop modes): 8, 11, 12, 13, 14
9920
- // Chrome on iPadOS (both mobile and desktop modes): 11, 12, 13, 14
9921
- // Safari on iOS (both mobile and desktop modes): 9, 10, 11, 12, 13, 14
9922
- // Chrome on iOS (both mobile and desktop modes): 9, 10, 11, 12, 13, 14
9923
- // Before iOS 13. Safari tampers the value in "request desktop site" mode since iOS 13.
9924
- if (navigator.platform === 'iPad') {
9925
- return true;
9926
- }
9927
- var s = screen;
9928
- var screenRatio = s.width / s.height;
9929
- return (countTruthy([
9930
- 'MediaSource' in window,
9931
- !!Element.prototype.webkitRequestFullscreen,
9932
- // iPhone 4S that runs iOS 9 matches this. But it won't match the criteria above, so it won't be detected as iPad.
9933
- screenRatio > 0.65 && screenRatio < 1.53,
9934
- ]) >= 2);
9935
- }
9936
- /**
9937
- * Warning for package users:
9938
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
9939
- */
9940
- function getFullscreenElement() {
9941
- var d = document;
9942
- return d.fullscreenElement || d.msFullscreenElement || d.mozFullScreenElement || d.webkitFullscreenElement || null;
9943
- }
9944
- function exitFullscreen() {
9945
- var d = document;
9946
- // `call` is required because the function throws an error without a proper "this" context
9947
- return (d.exitFullscreen || d.msExitFullscreen || d.mozCancelFullScreen || d.webkitExitFullscreen).call(d);
9948
- }
9949
- /**
9950
- * Checks whether the device runs on Android without using user-agent.
9951
- *
9952
- * Warning for package users:
9953
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
9954
- */
9955
- function isAndroid() {
9956
- var isItChromium = isChromium();
9957
- var isItGecko = isGecko();
9958
- // Only 2 browser engines are presented on Android.
9959
- // Actually, there is also Android 4.1 browser, but it's not worth detecting it at the moment.
9960
- if (!isItChromium && !isItGecko) {
9961
- return false;
9962
- }
9963
- var w = window;
9964
- // Chrome removes all words "Android" from `navigator` when desktop version is requested
9965
- // Firefox keeps "Android" in `navigator.appVersion` when desktop version is requested
9966
- return (countTruthy([
9967
- 'onorientationchange' in w,
9968
- 'orientation' in w,
9969
- isItChromium && !('SharedWorker' in w),
9970
- isItGecko && /android/i.test(navigator.appVersion),
9971
- ]) >= 2);
9972
- }
9973
-
9974
- /**
9975
- * A deep description: https://fingerprintjs.com/blog/audio-fingerprinting/
9976
- * Inspired by and based on https://github.com/cozylife/audio-fingerprint
9977
- */
9978
- function getAudioFingerprint() {
9979
- var w = window;
9980
- var AudioContext = w.OfflineAudioContext || w.webkitOfflineAudioContext;
9981
- if (!AudioContext) {
9982
- return -2 /* NotSupported */;
9983
- }
9984
- // In some browsers, audio context always stays suspended unless the context is started in response to a user action
9985
- // (e.g. a click or a tap). It prevents audio fingerprint from being taken at an arbitrary moment of time.
9986
- // Such browsers are old and unpopular, so the audio fingerprinting is just skipped in them.
9987
- // See a similar case explanation at https://stackoverflow.com/questions/46363048/onaudioprocess-not-called-on-ios11#46534088
9988
- if (doesCurrentBrowserSuspendAudioContext()) {
9989
- return -1 /* KnownToSuspend */;
9990
- }
9991
- var hashFromIndex = 4500;
9992
- var hashToIndex = 5000;
9993
- var context = new AudioContext(1, hashToIndex, 44100);
9994
- var oscillator = context.createOscillator();
9995
- oscillator.type = 'triangle';
9996
- oscillator.frequency.value = 10000;
9997
- var compressor = context.createDynamicsCompressor();
9998
- compressor.threshold.value = -50;
9999
- compressor.knee.value = 40;
10000
- compressor.ratio.value = 12;
10001
- compressor.attack.value = 0;
10002
- compressor.release.value = 0.25;
10003
- oscillator.connect(compressor);
10004
- compressor.connect(context.destination);
10005
- oscillator.start(0);
10006
- var _a = startRenderingAudio(context), renderPromise = _a[0], finishRendering = _a[1];
10007
- var fingerprintPromise = renderPromise.then(function (buffer) { return getHash(buffer.getChannelData(0).subarray(hashFromIndex)); }, function (error) {
10008
- if (error.name === "timeout" /* Timeout */ || error.name === "suspended" /* Suspended */) {
10009
- return -3 /* Timeout */;
10010
- }
10011
- throw error;
10012
- });
10013
- // Suppresses the console error message in case when the fingerprint fails before requested
10014
- fingerprintPromise.catch(function () { return undefined; });
10015
- return function () {
10016
- finishRendering();
10017
- return fingerprintPromise;
10018
- };
10019
- }
10020
- /**
10021
- * Checks if the current browser is known to always suspend audio context
10022
- */
10023
- function doesCurrentBrowserSuspendAudioContext() {
10024
- return isWebKit() && !isDesktopSafari() && !isWebKit606OrNewer();
10025
- }
10026
- /**
10027
- * Starts rendering the audio context.
10028
- * When the returned function is called, the render process starts finishing.
10029
- */
10030
- function startRenderingAudio(context) {
10031
- var renderTryMaxCount = 3;
10032
- var renderRetryDelay = 500;
10033
- var runningMaxAwaitTime = 500;
10034
- var runningSufficientTime = 5000;
10035
- var finalize = function () { return undefined; };
10036
- var resultPromise = new Promise(function (resolve, reject) {
10037
- var isFinalized = false;
10038
- var renderTryCount = 0;
10039
- var startedRunningAt = 0;
10040
- context.oncomplete = function (event) { return resolve(event.renderedBuffer); };
10041
- var startRunningTimeout = function () {
10042
- setTimeout(function () { return reject(makeInnerError("timeout" /* Timeout */)); }, Math.min(runningMaxAwaitTime, startedRunningAt + runningSufficientTime - Date.now()));
10043
- };
10044
- var tryRender = function () {
10045
- try {
10046
- context.startRendering();
10047
- switch (context.state) {
10048
- case 'running':
10049
- startedRunningAt = Date.now();
10050
- if (isFinalized) {
10051
- startRunningTimeout();
10052
- }
10053
- break;
10054
- // Sometimes the audio context doesn't start after calling `startRendering` (in addition to the cases where
10055
- // audio context doesn't start at all). A known case is starting an audio context when the browser tab is in
10056
- // background on iPhone. Retries usually help in this case.
10057
- case 'suspended':
10058
- // The audio context can reject starting until the tab is in foreground. Long fingerprint duration
10059
- // in background isn't a problem, therefore the retry attempts don't count in background. It can lead to
10060
- // a situation when a fingerprint takes very long time and finishes successfully. FYI, the audio context
10061
- // can be suspended when `document.hidden === false` and start running after a retry.
10062
- if (!document.hidden) {
10063
- renderTryCount++;
10064
- }
10065
- if (isFinalized && renderTryCount >= renderTryMaxCount) {
10066
- reject(makeInnerError("suspended" /* Suspended */));
10067
- }
10068
- else {
10069
- setTimeout(tryRender, renderRetryDelay);
10070
- }
10071
- break;
10072
- }
10073
- }
10074
- catch (error) {
10075
- reject(error);
10076
- }
10077
- };
10078
- tryRender();
10079
- finalize = function () {
10080
- if (!isFinalized) {
10081
- isFinalized = true;
10082
- if (startedRunningAt > 0) {
10083
- startRunningTimeout();
10084
- }
10085
- }
10086
- };
10087
- });
10088
- return [resultPromise, finalize];
10089
- }
10090
- function getHash(signal) {
10091
- var hash = 0;
10092
- for (var i = 0; i < signal.length; ++i) {
10093
- hash += Math.abs(signal[i]);
10094
- }
10095
- return hash;
10096
- }
10097
- function makeInnerError(name) {
10098
- var error = new Error(name);
10099
- error.name = name;
10100
- return error;
10101
- }
10102
-
10103
- /**
10104
- * Creates and keeps an invisible iframe while the given function runs.
10105
- * The given function is called when the iframe is loaded and has a body.
10106
- * The iframe allows to measure DOM sizes inside itself.
10107
- *
10108
- * Notice: passing an initial HTML code doesn't work in IE.
10109
- *
10110
- * Warning for package users:
10111
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
10112
- */
10113
- function withIframe(action, initialHtml, domPollInterval) {
10114
- var _a, _b, _c;
10115
- if (domPollInterval === void 0) { domPollInterval = 50; }
10116
- return __awaiter(this, void 0, void 0, function () {
10117
- var d, iframe;
10118
- return __generator(this, function (_d) {
10119
- switch (_d.label) {
10120
- case 0:
10121
- d = document;
10122
- _d.label = 1;
10123
- case 1:
10124
- if (!!d.body) return [3 /*break*/, 3];
10125
- return [4 /*yield*/, wait(domPollInterval)];
10126
- case 2:
10127
- _d.sent();
10128
- return [3 /*break*/, 1];
10129
- case 3:
10130
- iframe = d.createElement('iframe');
10131
- _d.label = 4;
10132
- case 4:
10133
- _d.trys.push([4, , 10, 11]);
10134
- return [4 /*yield*/, new Promise(function (_resolve, _reject) {
10135
- var isComplete = false;
10136
- var resolve = function () {
10137
- isComplete = true;
10138
- _resolve();
10139
- };
10140
- var reject = function (error) {
10141
- isComplete = true;
10142
- _reject(error);
10143
- };
10144
- iframe.onload = resolve;
10145
- iframe.onerror = reject;
10146
- var style = iframe.style;
10147
- style.setProperty('display', 'block', 'important'); // Required for browsers to calculate the layout
10148
- style.position = 'absolute';
10149
- style.top = '0';
10150
- style.left = '0';
10151
- style.visibility = 'hidden';
10152
- if (initialHtml && 'srcdoc' in iframe) {
10153
- iframe.srcdoc = initialHtml;
10154
- }
10155
- else {
10156
- iframe.src = 'about:blank';
10157
- }
10158
- d.body.appendChild(iframe);
10159
- // WebKit in WeChat doesn't fire the iframe's `onload` for some reason.
10160
- // This code checks for the loading state manually.
10161
- // See https://github.com/fingerprintjs/fingerprintjs/issues/645
10162
- var checkReadyState = function () {
10163
- var _a, _b;
10164
- // The ready state may never become 'complete' in Firefox despite the 'load' event being fired.
10165
- // So an infinite setTimeout loop can happen without this check.
10166
- // See https://github.com/fingerprintjs/fingerprintjs/pull/716#issuecomment-986898796
10167
- if (isComplete) {
10168
- return;
10169
- }
10170
- // Make sure iframe.contentWindow and iframe.contentWindow.document are both loaded
10171
- // The contentWindow.document can miss in JSDOM (https://github.com/jsdom/jsdom).
10172
- if (((_b = (_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.document) === null || _b === void 0 ? void 0 : _b.readyState) === 'complete') {
10173
- resolve();
10174
- }
10175
- else {
10176
- setTimeout(checkReadyState, 10);
10177
- }
10178
- };
10179
- checkReadyState();
10180
- })];
10181
- case 5:
10182
- _d.sent();
10183
- _d.label = 6;
10184
- case 6:
10185
- if (!!((_b = (_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.document) === null || _b === void 0 ? void 0 : _b.body)) return [3 /*break*/, 8];
10186
- return [4 /*yield*/, wait(domPollInterval)];
10187
- case 7:
10188
- _d.sent();
10189
- return [3 /*break*/, 6];
10190
- case 8: return [4 /*yield*/, action(iframe, iframe.contentWindow)];
10191
- case 9: return [2 /*return*/, _d.sent()];
10192
- case 10:
10193
- (_c = iframe.parentNode) === null || _c === void 0 ? void 0 : _c.removeChild(iframe);
10194
- return [7 /*endfinally*/];
10195
- case 11: return [2 /*return*/];
10196
- }
10197
- });
10198
- });
10199
- }
10200
- /**
10201
- * Creates a DOM element that matches the given selector.
10202
- * Only single element selector are supported (without operators like space, +, >, etc).
10203
- */
10204
- function selectorToElement(selector) {
10205
- var _a = parseSimpleCssSelector(selector), tag = _a[0], attributes = _a[1];
10206
- var element = document.createElement(tag !== null && tag !== void 0 ? tag : 'div');
10207
- for (var _i = 0, _b = Object.keys(attributes); _i < _b.length; _i++) {
10208
- var name_1 = _b[_i];
10209
- var value = attributes[name_1].join(' ');
10210
- // Changing the `style` attribute can cause a CSP error, therefore we change the `style.cssText` property.
10211
- // https://github.com/fingerprintjs/fingerprintjs/issues/733
10212
- if (name_1 === 'style') {
10213
- addStyleString(element.style, value);
10214
- }
10215
- else {
10216
- element.setAttribute(name_1, value);
10217
- }
10218
- }
10219
- return element;
10220
- }
10221
- /**
10222
- * Adds CSS styles from a string in such a way that doesn't trigger a CSP warning (unsafe-inline or unsafe-eval)
10223
- */
10224
- function addStyleString(style, source) {
10225
- // We don't use `style.cssText` because browsers must block it when no `unsafe-eval` CSP is presented: https://csplite.com/csp145/#w3c_note
10226
- // Even though the browsers ignore this standard, we don't use `cssText` just in case.
10227
- for (var _i = 0, _a = source.split(';'); _i < _a.length; _i++) {
10228
- var property = _a[_i];
10229
- var match = /^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(property);
10230
- if (match) {
10231
- var name_2 = match[1], value = match[2], priority = match[4];
10232
- style.setProperty(name_2, value, priority || ''); // The last argument can't be undefined in IE11
10233
- }
10234
- }
10235
- }
10236
-
10237
- // We use m or w because these two characters take up the maximum width.
10238
- // And we use a LLi so that the same matching fonts can get separated.
10239
- var testString = 'mmMwWLliI0O&1';
10240
- // We test using 48px font size, we may use any size. I guess larger the better.
10241
- var textSize = '48px';
10242
- // A font will be compared against all the three default fonts.
10243
- // And if for any default fonts it doesn't match, then that font is available.
10244
- var baseFonts = ['monospace', 'sans-serif', 'serif'];
10245
- var fontList = [
10246
- // This is android-specific font from "Roboto" family
10247
- 'sans-serif-thin',
10248
- 'ARNO PRO',
10249
- 'Agency FB',
10250
- 'Arabic Typesetting',
10251
- 'Arial Unicode MS',
10252
- 'AvantGarde Bk BT',
10253
- 'BankGothic Md BT',
10254
- 'Batang',
10255
- 'Bitstream Vera Sans Mono',
10256
- 'Calibri',
10257
- 'Century',
10258
- 'Century Gothic',
10259
- 'Clarendon',
10260
- 'EUROSTILE',
10261
- 'Franklin Gothic',
10262
- 'Futura Bk BT',
10263
- 'Futura Md BT',
10264
- 'GOTHAM',
10265
- 'Gill Sans',
10266
- 'HELV',
10267
- 'Haettenschweiler',
10268
- 'Helvetica Neue',
10269
- 'Humanst521 BT',
10270
- 'Leelawadee',
10271
- 'Letter Gothic',
10272
- 'Levenim MT',
10273
- 'Lucida Bright',
10274
- 'Lucida Sans',
10275
- 'Menlo',
10276
- 'MS Mincho',
10277
- 'MS Outlook',
10278
- 'MS Reference Specialty',
10279
- 'MS UI Gothic',
10280
- 'MT Extra',
10281
- 'MYRIAD PRO',
10282
- 'Marlett',
10283
- 'Meiryo UI',
10284
- 'Microsoft Uighur',
10285
- 'Minion Pro',
10286
- 'Monotype Corsiva',
10287
- 'PMingLiU',
10288
- 'Pristina',
10289
- 'SCRIPTINA',
10290
- 'Segoe UI Light',
10291
- 'Serifa',
10292
- 'SimHei',
10293
- 'Small Fonts',
10294
- 'Staccato222 BT',
10295
- 'TRAJAN PRO',
10296
- 'Univers CE 55 Medium',
10297
- 'Vrinda',
10298
- 'ZWAdobeF',
10299
- ];
10300
- // kudos to http://www.lalit.org/lab/javascript-css-font-detect/
10301
- function getFonts() {
10302
- // Running the script in an iframe makes it not affect the page look and not be affected by the page CSS. See:
10303
- // https://github.com/fingerprintjs/fingerprintjs/issues/592
10304
- // https://github.com/fingerprintjs/fingerprintjs/issues/628
10305
- return withIframe(function (_, _a) {
10306
- var document = _a.document;
10307
- var holder = document.body;
10308
- holder.style.fontSize = textSize;
10309
- // div to load spans for the default fonts and the fonts to detect
10310
- var spansContainer = document.createElement('div');
10311
- var defaultWidth = {};
10312
- var defaultHeight = {};
10313
- // creates a span where the fonts will be loaded
10314
- var createSpan = function (fontFamily) {
10315
- var span = document.createElement('span');
10316
- var style = span.style;
10317
- style.position = 'absolute';
10318
- style.top = '0';
10319
- style.left = '0';
10320
- style.fontFamily = fontFamily;
10321
- span.textContent = testString;
10322
- spansContainer.appendChild(span);
10323
- return span;
10324
- };
10325
- // creates a span and load the font to detect and a base font for fallback
10326
- var createSpanWithFonts = function (fontToDetect, baseFont) {
10327
- return createSpan("'" + fontToDetect + "'," + baseFont);
10328
- };
10329
- // creates spans for the base fonts and adds them to baseFontsDiv
10330
- var initializeBaseFontsSpans = function () {
10331
- return baseFonts.map(createSpan);
10332
- };
10333
- // creates spans for the fonts to detect and adds them to fontsDiv
10334
- var initializeFontsSpans = function () {
10335
- // Stores {fontName : [spans for that font]}
10336
- var spans = {};
10337
- var _loop_1 = function (font) {
10338
- spans[font] = baseFonts.map(function (baseFont) { return createSpanWithFonts(font, baseFont); });
10339
- };
10340
- for (var _i = 0, fontList_1 = fontList; _i < fontList_1.length; _i++) {
10341
- var font = fontList_1[_i];
10342
- _loop_1(font);
10343
- }
10344
- return spans;
10345
- };
10346
- // checks if a font is available
10347
- var isFontAvailable = function (fontSpans) {
10348
- return baseFonts.some(function (baseFont, baseFontIndex) {
10349
- return fontSpans[baseFontIndex].offsetWidth !== defaultWidth[baseFont] ||
10350
- fontSpans[baseFontIndex].offsetHeight !== defaultHeight[baseFont];
10351
- });
10352
- };
10353
- // create spans for base fonts
10354
- var baseFontsSpans = initializeBaseFontsSpans();
10355
- // create spans for fonts to detect
10356
- var fontsSpans = initializeFontsSpans();
10357
- // add all the spans to the DOM
10358
- holder.appendChild(spansContainer);
10359
- // get the default width for the three base fonts
10360
- for (var index = 0; index < baseFonts.length; index++) {
10361
- defaultWidth[baseFonts[index]] = baseFontsSpans[index].offsetWidth; // width for the default font
10362
- defaultHeight[baseFonts[index]] = baseFontsSpans[index].offsetHeight; // height for the default font
10363
- }
10364
- // check available fonts
10365
- return fontList.filter(function (font) { return isFontAvailable(fontsSpans[font]); });
10366
- });
10367
- }
10368
-
10369
- function getPlugins() {
10370
- var rawPlugins = navigator.plugins;
10371
- if (!rawPlugins) {
10372
- return undefined;
10373
- }
10374
- var plugins = [];
10375
- // Safari 10 doesn't support iterating navigator.plugins with for...of
10376
- for (var i = 0; i < rawPlugins.length; ++i) {
10377
- var plugin = rawPlugins[i];
10378
- if (!plugin) {
10379
- continue;
10380
- }
10381
- var mimeTypes = [];
10382
- for (var j = 0; j < plugin.length; ++j) {
10383
- var mimeType = plugin[j];
10384
- mimeTypes.push({
10385
- type: mimeType.type,
10386
- suffixes: mimeType.suffixes,
10387
- });
10388
- }
10389
- plugins.push({
10390
- name: plugin.name,
10391
- description: plugin.description,
10392
- mimeTypes: mimeTypes,
10393
- });
10394
- }
10395
- return plugins;
10396
- }
10397
-
10398
- // https://www.browserleaks.com/canvas#how-does-it-work
10399
- function getCanvasFingerprint() {
10400
- var _a = makeCanvasContext(), canvas = _a[0], context = _a[1];
10401
- if (!isSupported(canvas, context)) {
10402
- return { winding: false, geometry: '', text: '' };
10403
- }
10404
- return {
10405
- winding: doesSupportWinding(context),
10406
- geometry: makeGeometryImage(canvas, context),
10407
- // Text is unstable:
10408
- // https://github.com/fingerprintjs/fingerprintjs/issues/583
10409
- // https://github.com/fingerprintjs/fingerprintjs/issues/103
10410
- // Therefore it's extracted into a separate image.
10411
- text: makeTextImage(canvas, context),
10412
- };
10413
- }
10414
- function makeCanvasContext() {
10415
- var canvas = document.createElement('canvas');
10416
- canvas.width = 1;
10417
- canvas.height = 1;
10418
- return [canvas, canvas.getContext('2d')];
10419
- }
10420
- function isSupported(canvas, context) {
10421
- // TODO: look into: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob
10422
- return !!(context && canvas.toDataURL);
10423
- }
10424
- function doesSupportWinding(context) {
10425
- // https://web.archive.org/web/20170825024655/http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/
10426
- // https://github.com/Modernizr/Modernizr/blob/master/feature-detects/canvas/winding.js
10427
- context.rect(0, 0, 10, 10);
10428
- context.rect(2, 2, 6, 6);
10429
- return !context.isPointInPath(5, 5, 'evenodd');
10430
- }
10431
- function makeTextImage(canvas, context) {
10432
- // Resizing the canvas cleans it
10433
- canvas.width = 240;
10434
- canvas.height = 60;
10435
- context.textBaseline = 'alphabetic';
10436
- context.fillStyle = '#f60';
10437
- context.fillRect(100, 1, 62, 20);
10438
- context.fillStyle = '#069';
10439
- // It's important to use explicit built-in fonts in order to exclude the affect of font preferences
10440
- // (there is a separate entropy source for them).
10441
- context.font = '11pt "Times New Roman"';
10442
- // The choice of emojis has a gigantic impact on rendering performance (especially in FF).
10443
- // Some newer emojis cause it to slow down 50-200 times.
10444
- // There must be no text to the right of the emoji, see https://github.com/fingerprintjs/fingerprintjs/issues/574
10445
- // A bare emoji shouldn't be used because the canvas will change depending on the script encoding:
10446
- // https://github.com/fingerprintjs/fingerprintjs/issues/66
10447
- // Escape sequence shouldn't be used too because Terser will turn it into a bare unicode.
10448
- var printedText = "Cwm fjordbank gly " + String.fromCharCode(55357, 56835) /* 😃 */;
10449
- context.fillText(printedText, 2, 15);
10450
- context.fillStyle = 'rgba(102, 204, 0, 0.2)';
10451
- context.font = '18pt Arial';
10452
- context.fillText(printedText, 4, 45);
10453
- return save(canvas);
10454
- }
10455
- function makeGeometryImage(canvas, context) {
10456
- // Resizing the canvas cleans it
10457
- canvas.width = 122;
10458
- canvas.height = 110;
10459
- // Canvas blending
10460
- // https://web.archive.org/web/20170826194121/http://blogs.adobe.com/webplatform/2013/01/28/blending-features-in-canvas/
10461
- // http://jsfiddle.net/NDYV8/16/
10462
- context.globalCompositeOperation = 'multiply';
10463
- for (var _i = 0, _a = [
10464
- ['#f2f', 40, 40],
10465
- ['#2ff', 80, 40],
10466
- ['#ff2', 60, 80],
10467
- ]; _i < _a.length; _i++) {
10468
- var _b = _a[_i], color = _b[0], x = _b[1], y = _b[2];
10469
- context.fillStyle = color;
10470
- context.beginPath();
10471
- context.arc(x, y, 40, 0, Math.PI * 2, true);
10472
- context.closePath();
10473
- context.fill();
10474
- }
10475
- // Canvas winding
10476
- // https://web.archive.org/web/20130913061632/http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/
10477
- // http://jsfiddle.net/NDYV8/19/
10478
- context.fillStyle = '#f9c';
10479
- context.arc(60, 60, 60, 0, Math.PI * 2, true);
10480
- context.arc(60, 60, 20, 0, Math.PI * 2, true);
10481
- context.fill('evenodd');
10482
- return save(canvas);
10483
- }
10484
- function save(canvas) {
10485
- // TODO: look into: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob
10486
- return canvas.toDataURL();
10487
- }
10488
-
10489
- /**
10490
- * This is a crude and primitive touch screen detection. It's not possible to currently reliably detect the availability
10491
- * of a touch screen with a JS, without actually subscribing to a touch event.
10492
- *
10493
- * @see http://www.stucox.com/blog/you-cant-detect-a-touchscreen/
10494
- * @see https://github.com/Modernizr/Modernizr/issues/548
10495
- */
10496
- function getTouchSupport() {
10497
- var n = navigator;
10498
- var maxTouchPoints = 0;
10499
- var touchEvent;
10500
- if (n.maxTouchPoints !== undefined) {
10501
- maxTouchPoints = toInt(n.maxTouchPoints);
10502
- }
10503
- else if (n.msMaxTouchPoints !== undefined) {
10504
- maxTouchPoints = n.msMaxTouchPoints;
10505
- }
10506
- try {
10507
- document.createEvent('TouchEvent');
10508
- touchEvent = true;
10509
- }
10510
- catch (_a) {
10511
- touchEvent = false;
10512
- }
10513
- var touchStart = 'ontouchstart' in window;
10514
- return {
10515
- maxTouchPoints: maxTouchPoints,
10516
- touchEvent: touchEvent,
10517
- touchStart: touchStart,
10518
- };
10519
- }
10520
-
10521
- function getOsCpu() {
10522
- return navigator.oscpu;
10523
- }
10524
-
10525
- function getLanguages() {
10526
- var n = navigator;
10527
- var result = [];
10528
- var language = n.language || n.userLanguage || n.browserLanguage || n.systemLanguage;
10529
- if (language !== undefined) {
10530
- result.push([language]);
10531
- }
10532
- if (Array.isArray(n.languages)) {
10533
- // Starting from Chromium 86, there is only a single value in `navigator.language` in Incognito mode:
10534
- // the value of `navigator.language`. Therefore the value is ignored in this browser.
10535
- if (!(isChromium() && isChromium86OrNewer())) {
10536
- result.push(n.languages);
10537
- }
10538
- }
10539
- else if (typeof n.languages === 'string') {
10540
- var languages = n.languages;
10541
- if (languages) {
10542
- result.push(languages.split(','));
10543
- }
10544
- }
10545
- return result;
10546
- }
10547
-
10548
- function getColorDepth() {
10549
- return window.screen.colorDepth;
10550
- }
10551
-
10552
- function getDeviceMemory() {
10553
- // `navigator.deviceMemory` is a string containing a number in some unidentified cases
10554
- return replaceNaN(toFloat(navigator.deviceMemory), undefined);
10555
- }
10556
-
10557
- function getScreenResolution() {
10558
- var s = screen;
10559
- // Some browsers return screen resolution as strings, e.g. "1200", instead of a number, e.g. 1200.
10560
- // I suspect it's done by certain plugins that randomize browser properties to prevent fingerprinting.
10561
- // Some browsers even return screen resolution as not numbers.
10562
- var parseDimension = function (value) { return replaceNaN(toInt(value), null); };
10563
- var dimensions = [parseDimension(s.width), parseDimension(s.height)];
10564
- dimensions.sort().reverse();
10565
- return dimensions;
10566
- }
10567
-
10568
- var screenFrameCheckInterval = 2500;
10569
- var roundingPrecision = 10;
10570
- // The type is readonly to protect from unwanted mutations
10571
- var screenFrameBackup;
10572
- var screenFrameSizeTimeoutId;
10573
- /**
10574
- * Starts watching the screen frame size. When a non-zero size appears, the size is saved and the watch is stopped.
10575
- * Later, when `getScreenFrame` runs, it will return the saved non-zero size if the current size is null.
10576
- *
10577
- * This trick is required to mitigate the fact that the screen frame turns null in some cases.
10578
- * See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568
10579
- */
10580
- function watchScreenFrame() {
10581
- if (screenFrameSizeTimeoutId !== undefined) {
10582
- return;
10583
- }
10584
- var checkScreenFrame = function () {
10585
- var frameSize = getCurrentScreenFrame();
10586
- if (isFrameSizeNull(frameSize)) {
10587
- screenFrameSizeTimeoutId = setTimeout(checkScreenFrame, screenFrameCheckInterval);
10588
- }
10589
- else {
10590
- screenFrameBackup = frameSize;
10591
- screenFrameSizeTimeoutId = undefined;
10592
- }
10593
- };
10594
- checkScreenFrame();
10595
- }
10596
- function getScreenFrame() {
10597
- var _this = this;
10598
- watchScreenFrame();
10599
- return function () { return __awaiter(_this, void 0, void 0, function () {
10600
- var frameSize;
10601
- return __generator(this, function (_a) {
10602
- switch (_a.label) {
10603
- case 0:
10604
- frameSize = getCurrentScreenFrame();
10605
- if (!isFrameSizeNull(frameSize)) return [3 /*break*/, 2];
10606
- if (screenFrameBackup) {
10607
- return [2 /*return*/, __spreadArrays(screenFrameBackup)];
10608
- }
10609
- if (!getFullscreenElement()) return [3 /*break*/, 2];
10610
- // Some browsers set the screen frame to zero when programmatic fullscreen is on.
10611
- // There is a chance of getting a non-zero frame after exiting the fullscreen.
10612
- // See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568
10613
- return [4 /*yield*/, exitFullscreen()];
10614
- case 1:
10615
- // Some browsers set the screen frame to zero when programmatic fullscreen is on.
10616
- // There is a chance of getting a non-zero frame after exiting the fullscreen.
10617
- // See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568
10618
- _a.sent();
10619
- frameSize = getCurrentScreenFrame();
10620
- _a.label = 2;
10621
- case 2:
10622
- if (!isFrameSizeNull(frameSize)) {
10623
- screenFrameBackup = frameSize;
10624
- }
10625
- return [2 /*return*/, frameSize];
10626
- }
10627
- });
10628
- }); };
10629
- }
10630
- /**
10631
- * Sometimes the available screen resolution changes a bit, e.g. 1900x1440 → 1900x1439. A possible reason: macOS Dock
10632
- * shrinks to fit more icons when there is too little space. The rounding is used to mitigate the difference.
10633
- */
10634
- function getRoundedScreenFrame() {
10635
- var _this = this;
10636
- var screenFrameGetter = getScreenFrame();
10637
- return function () { return __awaiter(_this, void 0, void 0, function () {
10638
- var frameSize, processSize;
10639
- return __generator(this, function (_a) {
10640
- switch (_a.label) {
10641
- case 0: return [4 /*yield*/, screenFrameGetter()];
10642
- case 1:
10643
- frameSize = _a.sent();
10644
- processSize = function (sideSize) { return (sideSize === null ? null : round(sideSize, roundingPrecision)); };
10645
- // It might look like I don't know about `for` and `map`.
10646
- // In fact, such code is used to avoid TypeScript issues without using `as`.
10647
- return [2 /*return*/, [processSize(frameSize[0]), processSize(frameSize[1]), processSize(frameSize[2]), processSize(frameSize[3])]];
10648
- }
10649
- });
10650
- }); };
10651
- }
10652
- function getCurrentScreenFrame() {
10653
- var s = screen;
10654
- // Some browsers return screen resolution as strings, e.g. "1200", instead of a number, e.g. 1200.
10655
- // I suspect it's done by certain plugins that randomize browser properties to prevent fingerprinting.
10656
- //
10657
- // Some browsers (IE, Edge ≤18) don't provide `screen.availLeft` and `screen.availTop`. The property values are
10658
- // replaced with 0 in such cases to not lose the entropy from `screen.availWidth` and `screen.availHeight`.
10659
- return [
10660
- replaceNaN(toFloat(s.availTop), null),
10661
- replaceNaN(toFloat(s.width) - toFloat(s.availWidth) - replaceNaN(toFloat(s.availLeft), 0), null),
10662
- replaceNaN(toFloat(s.height) - toFloat(s.availHeight) - replaceNaN(toFloat(s.availTop), 0), null),
10663
- replaceNaN(toFloat(s.availLeft), null),
10664
- ];
10665
- }
10666
- function isFrameSizeNull(frameSize) {
10667
- for (var i = 0; i < 4; ++i) {
10668
- if (frameSize[i]) {
10669
- return false;
10670
- }
10671
- }
10672
- return true;
10673
- }
10674
-
10675
- function getHardwareConcurrency() {
10676
- // sometimes hardware concurrency is a string
10677
- return replaceNaN(toInt(navigator.hardwareConcurrency), undefined);
10678
- }
10679
-
10680
- function getTimezone() {
10681
- var _a;
10682
- var DateTimeFormat = (_a = window.Intl) === null || _a === void 0 ? void 0 : _a.DateTimeFormat;
10683
- if (DateTimeFormat) {
10684
- var timezone = new DateTimeFormat().resolvedOptions().timeZone;
10685
- if (timezone) {
10686
- return timezone;
10687
- }
10688
- }
10689
- // For browsers that don't support timezone names
10690
- // The minus is intentional because the JS offset is opposite to the real offset
10691
- var offset = -getTimezoneOffset();
10692
- return "UTC" + (offset >= 0 ? '+' : '') + Math.abs(offset);
10693
- }
10694
- function getTimezoneOffset() {
10695
- var currentYear = new Date().getFullYear();
10696
- // The timezone offset may change over time due to daylight saving time (DST) shifts.
10697
- // The non-DST timezone offset is used as the result timezone offset.
10698
- // Since the DST season differs in the northern and the southern hemispheres,
10699
- // both January and July timezones offsets are considered.
10700
- return Math.max(
10701
- // `getTimezoneOffset` returns a number as a string in some unidentified cases
10702
- toFloat(new Date(currentYear, 0, 1).getTimezoneOffset()), toFloat(new Date(currentYear, 6, 1).getTimezoneOffset()));
10703
- }
10704
-
10705
- function getSessionStorage() {
10706
- try {
10707
- return !!window.sessionStorage;
10708
- }
10709
- catch (error) {
10710
- /* SecurityError when referencing it means it exists */
10711
- return true;
10712
- }
10713
- }
10714
-
10715
- // https://bugzilla.mozilla.org/show_bug.cgi?id=781447
10716
- function getLocalStorage() {
10717
- try {
10718
- return !!window.localStorage;
10719
- }
10720
- catch (e) {
10721
- /* SecurityError when referencing it means it exists */
10722
- return true;
10723
- }
10724
- }
10725
-
10726
- function getIndexedDB() {
10727
- // IE and Edge don't allow accessing indexedDB in private mode, therefore IE and Edge will have different
10728
- // visitor identifier in normal and private modes.
10729
- if (isTrident() || isEdgeHTML()) {
10730
- return undefined;
10731
- }
10732
- try {
10733
- return !!window.indexedDB;
10734
- }
10735
- catch (e) {
10736
- /* SecurityError when referencing it means it exists */
10737
- return true;
10738
- }
10739
- }
10740
-
10741
- function getOpenDatabase() {
10742
- return !!window.openDatabase;
10743
- }
10744
-
10745
- function getCpuClass() {
10746
- return navigator.cpuClass;
10747
- }
10748
-
10749
- function getPlatform() {
10750
- // Android Chrome 86 and 87 and Android Firefox 80 and 84 don't mock the platform value when desktop mode is requested
10751
- var platform = navigator.platform;
10752
- // iOS mocks the platform value when desktop version is requested: https://github.com/fingerprintjs/fingerprintjs/issues/514
10753
- // iPad uses desktop mode by default since iOS 13
10754
- // The value is 'MacIntel' on M1 Macs
10755
- // The value is 'iPhone' on iPod Touch
10756
- if (platform === 'MacIntel') {
10757
- if (isWebKit() && !isDesktopSafari()) {
10758
- return isIPad() ? 'iPad' : 'iPhone';
10759
- }
10760
- }
10761
- return platform;
10762
- }
10763
-
10764
- function getVendor() {
10765
- return navigator.vendor || '';
10766
- }
10767
-
10768
- /**
10769
- * Checks for browser-specific (not engine specific) global variables to tell browsers with the same engine apart.
10770
- * Only somewhat popular browsers are considered.
10771
- */
10772
- function getVendorFlavors() {
10773
- var flavors = [];
10774
- for (var _i = 0, _a = [
10775
- // Blink and some browsers on iOS
10776
- 'chrome',
10777
- // Safari on macOS
10778
- 'safari',
10779
- // Chrome on iOS (checked in 85 on 13 and 87 on 14)
10780
- '__crWeb',
10781
- '__gCrWeb',
10782
- // Yandex Browser on iOS, macOS and Android (checked in 21.2 on iOS 14, macOS and Android)
10783
- 'yandex',
10784
- // Yandex Browser on iOS (checked in 21.2 on 14)
10785
- '__yb',
10786
- '__ybro',
10787
- // Firefox on iOS (checked in 32 on 14)
10788
- '__firefox__',
10789
- // Edge on iOS (checked in 46 on 14)
10790
- '__edgeTrackingPreventionStatistics',
10791
- 'webkit',
10792
- // Opera Touch on iOS (checked in 2.6 on 14)
10793
- 'oprt',
10794
- // Samsung Internet on Android (checked in 11.1)
10795
- 'samsungAr',
10796
- // UC Browser on Android (checked in 12.10 and 13.0)
10797
- 'ucweb',
10798
- 'UCShellJava',
10799
- // Puffin on Android (checked in 9.0)
10800
- 'puffinDevice',
10801
- ]; _i < _a.length; _i++) {
10802
- var key = _a[_i];
10803
- var value = window[key];
10804
- if (value && typeof value === 'object') {
10805
- flavors.push(key);
10806
- }
10807
- }
10808
- return flavors.sort();
10809
- }
10810
-
10811
- /**
10812
- * navigator.cookieEnabled cannot detect custom or nuanced cookie blocking configurations. For example, when blocking
10813
- * cookies via the Advanced Privacy Settings in IE9, it always returns true. And there have been issues in the past with
10814
- * site-specific exceptions. Don't rely on it.
10815
- *
10816
- * @see https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cookies.js Taken from here
10817
- */
10818
- function areCookiesEnabled() {
10819
- var d = document;
10820
- // Taken from here: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cookies.js
10821
- // navigator.cookieEnabled cannot detect custom or nuanced cookie blocking configurations. For example, when blocking
10822
- // cookies via the Advanced Privacy Settings in IE9, it always returns true. And there have been issues in the past
10823
- // with site-specific exceptions. Don't rely on it.
10824
- // try..catch because some in situations `document.cookie` is exposed but throws a
10825
- // SecurityError if you try to access it; e.g. documents created from data URIs
10826
- // or in sandboxed iframes (depending on flags/context)
10827
- try {
10828
- // Create cookie
10829
- d.cookie = 'cookietest=1; SameSite=Strict;';
10830
- var result = d.cookie.indexOf('cookietest=') !== -1;
10831
- // Delete cookie
10832
- d.cookie = 'cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT';
10833
- return result;
10834
- }
10835
- catch (e) {
10836
- return false;
10837
- }
10838
- }
10839
-
10840
- /**
10841
- * Only single element selector are supported (no operators like space, +, >, etc).
10842
- * `embed` and `position: fixed;` will be considered as blocked anyway because it always has no offsetParent.
10843
- * Avoid `iframe` and anything with `[src=]` because they produce excess HTTP requests.
10844
- *
10845
- * See docs/content_blockers.md to learn how to make the list
10846
- */
10847
- var filters = {
10848
- abpIndo: [
10849
- '#Iklan-Melayang',
10850
- '#Kolom-Iklan-728',
10851
- '#SidebarIklan-wrapper',
10852
- 'a[title="7naga poker" i]',
10853
- '[title="ALIENBOLA" i]',
10854
- ],
10855
- abpvn: [
10856
- '#quangcaomb',
10857
- '.iosAdsiosAds-layout',
10858
- '.quangcao',
10859
- '[href^="https://r88.vn/"]',
10860
- '[href^="https://zbet.vn/"]',
10861
- ],
10862
- adBlockFinland: [
10863
- '.mainostila',
10864
- '.sponsorit',
10865
- '.ylamainos',
10866
- 'a[href*="/clickthrgh.asp?"]',
10867
- 'a[href^="https://app.readpeak.com/ads"]',
10868
- ],
10869
- adBlockPersian: [
10870
- '#navbar_notice_50',
10871
- 'a[href^="http://g1.v.fwmrm.net/ad/"]',
10872
- '.kadr',
10873
- 'TABLE[width="140px"]',
10874
- '#divAgahi',
10875
- ],
10876
- adBlockWarningRemoval: ['#adblock-honeypot', '.adblocker-root', '.wp_adblock_detect'],
10877
- adGuardAnnoyances: ['amp-embed[type="zen"]', '.hs-sosyal', '#cookieconsentdiv', 'div[class^="app_gdpr"]', '.as-oil'],
10878
- adGuardBase: ['#ad-after', '#ad-p3', '.BetterJsPopOverlay', '#ad_300X250', '#bannerfloat22'],
10879
- adGuardChinese: [
10880
- // Disabled because not reproducible. Will be replaced during the next filter update.
10881
- // '#piao_div_0[style*="width:140px;"]',
10882
- 'a[href*=".ttz5.cn"]',
10883
- 'a[href*=".yabovip2027.com/"]',
10884
- '.tm3all2h4b',
10885
- '.cc5278_banner_ad',
10886
- ],
10887
- adGuardFrench: [
10888
- '.zonepub',
10889
- '[class*="_adLeaderboard"]',
10890
- '[id^="block-xiti_oas-"]',
10891
- 'a[href^="http://ptapjmp.com/"]',
10892
- 'a[href^="https://go.alvexo.com/"]',
10893
- ],
10894
- adGuardGerman: [
10895
- '.banneritemwerbung_head_1',
10896
- '.boxstartwerbung',
10897
- '.werbung3',
10898
- 'a[href^="http://www.eis.de/index.phtml?refid="]',
10899
- 'a[href^="https://www.tipico.com/?affiliateId="]',
10900
- ],
10901
- adGuardJapanese: [
10902
- '#kauli_yad_1',
10903
- '#ad-giftext',
10904
- '#adsSPRBlock',
10905
- 'a[href^="http://ad2.trafficgate.net/"]',
10906
- 'a[href^="http://www.rssad.jp/"]',
10907
- ],
10908
- adGuardMobile: ['amp-auto-ads', '#mgid_iframe', '.amp_ad', 'amp-embed[type="24smi"]', '#mgid_iframe1'],
10909
- adGuardRussian: [
10910
- 'a[href^="https://ya-distrib.ru/r/"]',
10911
- 'a[href^="https://ad.letmeads.com/"]',
10912
- '.reclama',
10913
- 'div[id^="smi2adblock"]',
10914
- 'div[id^="AdFox_banner_"]',
10915
- ],
10916
- adGuardSocial: [
10917
- 'a[href^="//www.stumbleupon.com/submit?url="]',
10918
- 'a[href^="//telegram.me/share/url?"]',
10919
- '.etsy-tweet',
10920
- '#inlineShare',
10921
- '.popup-social',
10922
- ],
10923
- adGuardSpanishPortuguese: [
10924
- '#barraPublicidade',
10925
- '#Publicidade',
10926
- '#publiEspecial',
10927
- '#queTooltip',
10928
- '[href^="http://ads.glispa.com/"]',
10929
- ],
10930
- adGuardTrackingProtection: [
10931
- 'amp-embed[type="taboola"]',
10932
- '#qoo-counter',
10933
- 'a[href^="http://click.hotlog.ru/"]',
10934
- 'a[href^="http://hitcounter.ru/top/stat.php"]',
10935
- 'a[href^="http://top.mail.ru/jump"]',
10936
- ],
10937
- adGuardTurkish: [
10938
- '#backkapat',
10939
- '#reklami',
10940
- 'a[href^="http://adserv.ontek.com.tr/"]',
10941
- 'a[href^="http://izlenzi.com/campaign/"]',
10942
- 'a[href^="http://www.installads.net/"]',
10943
- ],
10944
- bulgarian: ['td#freenet_table_ads', '#adbody', '#ea_intext_div', '.lapni-pop-over', '#xenium_hot_offers'],
10945
- easyList: ['#AD_banner_bottom', '#Ads_google_02', '#N-ad-article-rightRail-1', '#ad-fullbanner2', '#ad-zone-2'],
10946
- easyListChina: [
10947
- 'a[href*=".wensixuetang.com/"]',
10948
- 'A[href*="/hth107.com/"]',
10949
- '.appguide-wrap[onclick*="bcebos.com"]',
10950
- '.frontpageAdvM',
10951
- '#taotaole',
10952
- ],
10953
- easyListCookie: ['#adtoniq-msg-bar', '#CoockiesPage', '#CookieModal_cookiemodal', '#DO_CC_PANEL', '#ShowCookie'],
10954
- easyListCzechSlovak: ['#onlajny-stickers', '#reklamni-box', '.reklama-megaboard', '.sklik', '[id^="sklikReklama"]'],
10955
- easyListDutch: [
10956
- '#advertentie',
10957
- '#vipAdmarktBannerBlock',
10958
- '.adstekst',
10959
- 'a[href^="https://xltube.nl/click/"]',
10960
- '#semilo-lrectangle',
10961
- ],
10962
- easyListGermany: [
10963
- 'a[href^="http://www.hw-area.com/?dp="]',
10964
- 'a[href^="https://ads.sunmaker.com/tracking.php?"]',
10965
- '.werbung-skyscraper2',
10966
- '.bannergroup_werbung',
10967
- '.ads_rechts',
10968
- ],
10969
- easyListItaly: [
10970
- '.box_adv_annunci',
10971
- '.sb-box-pubbliredazionale',
10972
- 'a[href^="http://affiliazioniads.snai.it/"]',
10973
- 'a[href^="https://adserver.html.it/"]',
10974
- 'a[href^="https://affiliazioniads.snai.it/"]',
10975
- ],
10976
- easyListLithuania: [
10977
- '.reklamos_tarpas',
10978
- '.reklamos_nuorodos',
10979
- 'img[alt="Reklaminis skydelis"]',
10980
- 'img[alt="Dedikuoti.lt serveriai"]',
10981
- 'img[alt="Hostingas Serveriai.lt"]',
10982
- ],
10983
- estonian: ['A[href*="http://pay4results24.eu"]'],
10984
- fanboyAnnoyances: [
10985
- '#feedback-tab',
10986
- '#taboola-below-article',
10987
- '.feedburnerFeedBlock',
10988
- '.widget-feedburner-counter',
10989
- '[title="Subscribe to our blog"]',
10990
- ],
10991
- fanboyAntiFacebook: ['.util-bar-module-firefly-visible'],
10992
- fanboyEnhancedTrackers: [
10993
- '.open.pushModal',
10994
- '#issuem-leaky-paywall-articles-zero-remaining-nag',
10995
- '#sovrn_container',
10996
- 'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',
10997
- '.BlockNag__Card',
10998
- ],
10999
- fanboySocial: [
11000
- '.td-tags-and-social-wrapper-box',
11001
- '.twitterContainer',
11002
- '.youtube-social',
11003
- 'a[title^="Like us on Facebook"]',
11004
- 'img[alt^="Share on Digg"]',
11005
- ],
11006
- frellwitSwedish: [
11007
- 'a[href*="casinopro.se"][target="_blank"]',
11008
- 'a[href*="doktor-se.onelink.me"]',
11009
- 'article.category-samarbete',
11010
- 'div.holidAds',
11011
- 'ul.adsmodern',
11012
- ],
11013
- greekAdBlock: [
11014
- 'A[href*="adman.otenet.gr/click?"]',
11015
- 'A[href*="http://axiabanners.exodus.gr/"]',
11016
- 'A[href*="http://interactive.forthnet.gr/click?"]',
11017
- 'DIV.agores300',
11018
- 'TABLE.advright',
11019
- ],
11020
- hungarian: [
11021
- 'A[href*="ad.eval.hu"]',
11022
- 'A[href*="ad.netmedia.hu"]',
11023
- 'A[href*="daserver.ultraweb.hu"]',
11024
- '#cemp_doboz',
11025
- '.optimonk-iframe-container',
11026
- ],
11027
- iDontCareAboutCookies: [
11028
- '.alert-info[data-block-track*="CookieNotice"]',
11029
- '.ModuleTemplateCookieIndicator',
11030
- '.o--cookies--container',
11031
- '.cookie-msg-info-container',
11032
- '#cookies-policy-sticky',
11033
- ],
11034
- icelandicAbp: ['A[href^="/framework/resources/forms/ads.aspx"]'],
11035
- latvian: [
11036
- 'a[href="http://www.salidzini.lv/"][style="display: block; width: 120px; height: 40px; overflow: hidden; position: relative;"]',
11037
- 'a[href="http://www.salidzini.lv/"][style="display: block; width: 88px; height: 31px; overflow: hidden; position: relative;"]',
11038
- ],
11039
- listKr: [
11040
- 'a[href*="//kingtoon.slnk.kr"]',
11041
- 'a[href*="//playdsb.com/kr"]',
11042
- 'div.logly-lift-adz',
11043
- 'div[data-widget_id="ml6EJ074"]',
11044
- 'ins.daum_ddn_area',
11045
- ],
11046
- listeAr: [
11047
- '.geminiLB1Ad',
11048
- '.right-and-left-sponsers',
11049
- 'a[href*=".aflam.info"]',
11050
- 'a[href*="booraq.org"]',
11051
- 'a[href*="dubizzle.com/ar/?utm_source="]',
11052
- ],
11053
- listeFr: [
11054
- 'a[href^="http://promo.vador.com/"]',
11055
- '#adcontainer_recherche',
11056
- 'a[href*="weborama.fr/fcgi-bin/"]',
11057
- '.site-pub-interstitiel',
11058
- 'div[id^="crt-"][data-criteo-id]',
11059
- ],
11060
- officialPolish: [
11061
- '#ceneo-placeholder-ceneo-12',
11062
- '[href^="https://aff.sendhub.pl/"]',
11063
- 'a[href^="http://advmanager.techfun.pl/redirect/"]',
11064
- 'a[href^="http://www.trizer.pl/?utm_source"]',
11065
- 'div#skapiec_ad',
11066
- ],
11067
- ro: [
11068
- 'a[href^="//afftrk.altex.ro/Counter/Click"]',
11069
- 'a[href^="/magazin/"]',
11070
- 'a[href^="https://blackfridaysales.ro/trk/shop/"]',
11071
- 'a[href^="https://event.2performant.com/events/click"]',
11072
- 'a[href^="https://l.profitshare.ro/"]',
11073
- ],
11074
- ruAd: [
11075
- 'a[href*="//febrare.ru/"]',
11076
- 'a[href*="//utimg.ru/"]',
11077
- 'a[href*="://chikidiki.ru"]',
11078
- '#pgeldiz',
11079
- '.yandex-rtb-block',
11080
- ],
11081
- thaiAds: ['a[href*=macau-uta-popup]', '#ads-google-middle_rectangle-group', '.ads300s', '.bumq', '.img-kosana'],
11082
- webAnnoyancesUltralist: [
11083
- '#mod-social-share-2',
11084
- '#social-tools',
11085
- '.ctpl-fullbanner',
11086
- '.zergnet-recommend',
11087
- '.yt.btn-link.btn-md.btn',
11088
- ],
11089
- };
11090
- /**
11091
- * The order of the returned array means nothing (it's always sorted alphabetically).
11092
- *
11093
- * Notice that the source is slightly unstable.
11094
- * Safari provides a 2-taps way to disable all content blockers on a page temporarily.
11095
- * Also content blockers can be disabled permanently for a domain, but it requires 4 taps.
11096
- * So empty array shouldn't be treated as "no blockers", it should be treated as "no signal".
11097
- * If you are a website owner, don't make your visitors want to disable content blockers.
11098
- */
11099
- function getDomBlockers(_a) {
11100
- var debug = (_a === void 0 ? {} : _a).debug;
11101
- return __awaiter(this, void 0, void 0, function () {
11102
- var filterNames, allSelectors, blockedSelectors, activeBlockers;
11103
- var _b;
11104
- return __generator(this, function (_c) {
11105
- switch (_c.label) {
11106
- case 0:
11107
- if (!isApplicable()) {
11108
- return [2 /*return*/, undefined];
11109
- }
11110
- filterNames = Object.keys(filters);
11111
- allSelectors = (_b = []).concat.apply(_b, filterNames.map(function (filterName) { return filters[filterName]; }));
11112
- return [4 /*yield*/, getBlockedSelectors(allSelectors)];
11113
- case 1:
11114
- blockedSelectors = _c.sent();
11115
- if (debug) {
11116
- printDebug(blockedSelectors);
11117
- }
11118
- activeBlockers = filterNames.filter(function (filterName) {
11119
- var selectors = filters[filterName];
11120
- var blockedCount = countTruthy(selectors.map(function (selector) { return blockedSelectors[selector]; }));
11121
- return blockedCount > selectors.length * 0.6;
11122
- });
11123
- activeBlockers.sort();
11124
- return [2 /*return*/, activeBlockers];
11125
- }
11126
- });
11127
- });
11128
- }
11129
- function isApplicable() {
11130
- // Safari (desktop and mobile) and all Android browsers keep content blockers in both regular and private mode
11131
- return isWebKit() || isAndroid();
11132
- }
11133
- function getBlockedSelectors(selectors) {
11134
- var _a;
11135
- return __awaiter(this, void 0, void 0, function () {
11136
- var d, root, elements, blockedSelectors, i, element, holder, i;
11137
- return __generator(this, function (_b) {
11138
- switch (_b.label) {
11139
- case 0:
11140
- d = document;
11141
- root = d.createElement('div');
11142
- elements = new Array(selectors.length);
11143
- blockedSelectors = {} // Set() isn't used just in case somebody need older browser support
11144
- ;
11145
- forceShow(root);
11146
- // First create all elements that can be blocked. If the DOM steps below are done in a single cycle,
11147
- // browser will alternate tree modification and layout reading, that is very slow.
11148
- for (i = 0; i < selectors.length; ++i) {
11149
- element = selectorToElement(selectors[i]);
11150
- holder = d.createElement('div') // Protects from unwanted effects of `+` and `~` selectors of filters
11151
- ;
11152
- forceShow(holder);
11153
- holder.appendChild(element);
11154
- root.appendChild(holder);
11155
- elements[i] = element;
11156
- }
11157
- _b.label = 1;
11158
- case 1:
11159
- if (!!d.body) return [3 /*break*/, 3];
11160
- return [4 /*yield*/, wait(50)];
11161
- case 2:
11162
- _b.sent();
11163
- return [3 /*break*/, 1];
11164
- case 3:
11165
- d.body.appendChild(root);
11166
- try {
11167
- // Then check which of the elements are blocked
11168
- for (i = 0; i < selectors.length; ++i) {
11169
- if (!elements[i].offsetParent) {
11170
- blockedSelectors[selectors[i]] = true;
11171
- }
11172
- }
11173
- }
11174
- finally {
11175
- // Then remove the elements
11176
- (_a = root.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(root);
11177
- }
11178
- return [2 /*return*/, blockedSelectors];
11179
- }
11180
- });
11181
- });
11182
- }
11183
- function forceShow(element) {
11184
- element.style.setProperty('display', 'block', 'important');
11185
- }
11186
- function printDebug(blockedSelectors) {
11187
- var message = 'DOM blockers debug:\n```';
11188
- for (var _i = 0, _a = Object.keys(filters); _i < _a.length; _i++) {
11189
- var filterName = _a[_i];
11190
- message += "\n" + filterName + ":";
11191
- for (var _b = 0, _c = filters[filterName]; _b < _c.length; _b++) {
11192
- var selector = _c[_b];
11193
- message += "\n " + selector + " " + (blockedSelectors[selector] ? '🚫' : '➡️');
11194
- }
11195
- }
11196
- // console.log is ok here because it's under a debug clause
11197
- // eslint-disable-next-line no-console
11198
- console.log(message + "\n```");
11199
- }
11200
-
11201
- /**
11202
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/color-gamut
11203
- */
11204
- function getColorGamut() {
11205
- // rec2020 includes p3 and p3 includes srgb
11206
- for (var _i = 0, _a = ['rec2020', 'p3', 'srgb']; _i < _a.length; _i++) {
11207
- var gamut = _a[_i];
11208
- if (matchMedia("(color-gamut: " + gamut + ")").matches) {
11209
- return gamut;
11210
- }
11211
- }
11212
- return undefined;
11213
- }
11214
-
11215
- /**
11216
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/inverted-colors
11217
- */
11218
- function areColorsInverted() {
11219
- if (doesMatch('inverted')) {
11220
- return true;
11221
- }
11222
- if (doesMatch('none')) {
11223
- return false;
11224
- }
11225
- return undefined;
11226
- }
11227
- function doesMatch(value) {
11228
- return matchMedia("(inverted-colors: " + value + ")").matches;
11229
- }
11230
-
11231
- /**
11232
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/forced-colors
11233
- */
11234
- function areColorsForced() {
11235
- if (doesMatch$1('active')) {
11236
- return true;
11237
- }
11238
- if (doesMatch$1('none')) {
11239
- return false;
11240
- }
11241
- return undefined;
11242
- }
11243
- function doesMatch$1(value) {
11244
- return matchMedia("(forced-colors: " + value + ")").matches;
11245
- }
11246
-
11247
- var maxValueToCheck = 100;
11248
- /**
11249
- * If the display is monochrome (e.g. black&white), the value will be ≥0 and will mean the number of bits per pixel.
11250
- * If the display is not monochrome, the returned value will be 0.
11251
- * If the browser doesn't support this feature, the returned value will be undefined.
11252
- *
11253
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/monochrome
11254
- */
11255
- function getMonochromeDepth() {
11256
- if (!matchMedia('(min-monochrome: 0)').matches) {
11257
- // The media feature isn't supported by the browser
11258
- return undefined;
11259
- }
11260
- // A variation of binary search algorithm can be used here.
11261
- // But since expected values are very small (≤10), there is no sense in adding the complexity.
11262
- for (var i = 0; i <= maxValueToCheck; ++i) {
11263
- if (matchMedia("(max-monochrome: " + i + ")").matches) {
11264
- return i;
11265
- }
11266
- }
11267
- throw new Error('Too high value');
11268
- }
11269
-
11270
- /**
11271
- * @see https://www.w3.org/TR/mediaqueries-5/#prefers-contrast
11272
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-contrast
11273
- */
11274
- function getContrastPreference() {
11275
- if (doesMatch$2('no-preference')) {
11276
- return 0 /* None */;
11277
- }
11278
- // The sources contradict on the keywords. Probably 'high' and 'low' will never be implemented.
11279
- // Need to check it when all browsers implement the feature.
11280
- if (doesMatch$2('high') || doesMatch$2('more')) {
11281
- return 1 /* More */;
11282
- }
11283
- if (doesMatch$2('low') || doesMatch$2('less')) {
11284
- return -1 /* Less */;
11285
- }
11286
- if (doesMatch$2('forced')) {
11287
- return 10 /* ForcedColors */;
11288
- }
11289
- return undefined;
11290
- }
11291
- function doesMatch$2(value) {
11292
- return matchMedia("(prefers-contrast: " + value + ")").matches;
11293
- }
11294
-
11295
- /**
11296
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion
11297
- */
11298
- function isMotionReduced() {
11299
- if (doesMatch$3('reduce')) {
11300
- return true;
11301
- }
11302
- if (doesMatch$3('no-preference')) {
11303
- return false;
11304
- }
11305
- return undefined;
11306
- }
11307
- function doesMatch$3(value) {
11308
- return matchMedia("(prefers-reduced-motion: " + value + ")").matches;
11309
- }
11310
-
11311
- /**
11312
- * @see https://www.w3.org/TR/mediaqueries-5/#dynamic-range
11313
- */
11314
- function isHDR() {
11315
- if (doesMatch$4('high')) {
11316
- return true;
11317
- }
11318
- if (doesMatch$4('standard')) {
11319
- return false;
11320
- }
11321
- return undefined;
11322
- }
11323
- function doesMatch$4(value) {
11324
- return matchMedia("(dynamic-range: " + value + ")").matches;
11325
- }
11326
-
11327
- var M$1 = Math; // To reduce the minified code size
11328
- var fallbackFn = function () { return 0; };
11329
- /**
11330
- * @see https://gitlab.torproject.org/legacy/trac/-/issues/13018
11331
- * @see https://bugzilla.mozilla.org/show_bug.cgi?id=531915
11332
- */
11333
- function getMathFingerprint() {
11334
- // Native operations
11335
- var acos = M$1.acos || fallbackFn;
11336
- var acosh = M$1.acosh || fallbackFn;
11337
- var asin = M$1.asin || fallbackFn;
11338
- var asinh = M$1.asinh || fallbackFn;
11339
- var atanh = M$1.atanh || fallbackFn;
11340
- var atan = M$1.atan || fallbackFn;
11341
- var sin = M$1.sin || fallbackFn;
11342
- var sinh = M$1.sinh || fallbackFn;
11343
- var cos = M$1.cos || fallbackFn;
11344
- var cosh = M$1.cosh || fallbackFn;
11345
- var tan = M$1.tan || fallbackFn;
11346
- var tanh = M$1.tanh || fallbackFn;
11347
- var exp = M$1.exp || fallbackFn;
11348
- var expm1 = M$1.expm1 || fallbackFn;
11349
- var log1p = M$1.log1p || fallbackFn;
11350
- // Operation polyfills
11351
- var powPI = function (value) { return M$1.pow(M$1.PI, value); };
11352
- var acoshPf = function (value) { return M$1.log(value + M$1.sqrt(value * value - 1)); };
11353
- var asinhPf = function (value) { return M$1.log(value + M$1.sqrt(value * value + 1)); };
11354
- var atanhPf = function (value) { return M$1.log((1 + value) / (1 - value)) / 2; };
11355
- var sinhPf = function (value) { return M$1.exp(value) - 1 / M$1.exp(value) / 2; };
11356
- var coshPf = function (value) { return (M$1.exp(value) + 1 / M$1.exp(value)) / 2; };
11357
- var expm1Pf = function (value) { return M$1.exp(value) - 1; };
11358
- var tanhPf = function (value) { return (M$1.exp(2 * value) - 1) / (M$1.exp(2 * value) + 1); };
11359
- var log1pPf = function (value) { return M$1.log(1 + value); };
11360
- // Note: constant values are empirical
11361
- return {
11362
- acos: acos(0.123124234234234242),
11363
- acosh: acosh(1e308),
11364
- acoshPf: acoshPf(1e154),
11365
- asin: asin(0.123124234234234242),
11366
- asinh: asinh(1),
11367
- asinhPf: asinhPf(1),
11368
- atanh: atanh(0.5),
11369
- atanhPf: atanhPf(0.5),
11370
- atan: atan(0.5),
11371
- sin: sin(-1e300),
11372
- sinh: sinh(1),
11373
- sinhPf: sinhPf(1),
11374
- cos: cos(10.000000000123),
11375
- cosh: cosh(1),
11376
- coshPf: coshPf(1),
11377
- tan: tan(-1e300),
11378
- tanh: tanh(1),
11379
- tanhPf: tanhPf(1),
11380
- exp: exp(1),
11381
- expm1: expm1(1),
11382
- expm1Pf: expm1Pf(1),
11383
- log1p: log1p(10),
11384
- log1pPf: log1pPf(10),
11385
- powPI: powPI(-100),
11386
- };
11387
- }
11388
-
11389
- /**
11390
- * We use m or w because these two characters take up the maximum width.
11391
- * Also there are a couple of ligatures.
11392
- */
11393
- var defaultText = 'mmMwWLliI0fiflO&1';
11394
- /**
11395
- * Settings of text blocks to measure. The keys are random but persistent words.
11396
- */
11397
- var presets = {
11398
- /**
11399
- * The default font. User can change it in desktop Chrome, desktop Firefox, IE 11,
11400
- * Android Chrome (but only when the size is ≥ than the default) and Android Firefox.
11401
- */
11402
- default: [],
11403
- /** OS font on macOS. User can change its size and weight. Applies after Safari restart. */
11404
- apple: [{ font: '-apple-system-body' }],
11405
- /** User can change it in desktop Chrome and desktop Firefox. */
11406
- serif: [{ fontFamily: 'serif' }],
11407
- /** User can change it in desktop Chrome and desktop Firefox. */
11408
- sans: [{ fontFamily: 'sans-serif' }],
11409
- /** User can change it in desktop Chrome and desktop Firefox. */
11410
- mono: [{ fontFamily: 'monospace' }],
11411
- /**
11412
- * Check the smallest allowed font size. User can change it in desktop Chrome, desktop Firefox and desktop Safari.
11413
- * The height can be 0 in Chrome on a retina display.
11414
- */
11415
- min: [{ fontSize: '1px' }],
11416
- /** Tells one OS from another in desktop Chrome. */
11417
- system: [{ fontFamily: 'system-ui' }],
11418
- };
11419
- /**
11420
- * The result is a dictionary of the width of the text samples.
11421
- * Heights aren't included because they give no extra entropy and are unstable.
11422
- *
11423
- * The result is very stable in IE 11, Edge 18 and Safari 14.
11424
- * The result changes when the OS pixel density changes in Chromium 87. The real pixel density is required to solve,
11425
- * but seems like it's impossible: https://stackoverflow.com/q/1713771/1118709.
11426
- * The "min" and the "mono" (only on Windows) value may change when the page is zoomed in Firefox 87.
11427
- */
11428
- function getFontPreferences() {
11429
- return withNaturalFonts(function (document, container) {
11430
- var elements = {};
11431
- var sizes = {};
11432
- // First create all elements to measure. If the DOM steps below are done in a single cycle,
11433
- // browser will alternate tree modification and layout reading, that is very slow.
11434
- for (var _i = 0, _a = Object.keys(presets); _i < _a.length; _i++) {
11435
- var key = _a[_i];
11436
- var _b = presets[key], _c = _b[0], style = _c === void 0 ? {} : _c, _d = _b[1], text = _d === void 0 ? defaultText : _d;
11437
- var element = document.createElement('span');
11438
- element.textContent = text;
11439
- element.style.whiteSpace = 'nowrap';
11440
- for (var _e = 0, _f = Object.keys(style); _e < _f.length; _e++) {
11441
- var name_1 = _f[_e];
11442
- var value = style[name_1];
11443
- if (value !== undefined) {
11444
- element.style[name_1] = value;
11445
- }
11446
- }
11447
- elements[key] = element;
11448
- container.appendChild(document.createElement('br'));
11449
- container.appendChild(element);
11450
- }
11451
- // Then measure the created elements
11452
- for (var _g = 0, _h = Object.keys(presets); _g < _h.length; _g++) {
11453
- var key = _h[_g];
11454
- sizes[key] = elements[key].getBoundingClientRect().width;
11455
- }
11456
- return sizes;
11457
- });
11458
- }
11459
- /**
11460
- * Creates a DOM environment that provides the most natural font available, including Android OS font.
11461
- * Measurements of the elements are zoom-independent.
11462
- * Don't put a content to measure inside an absolutely positioned element.
11463
- */
11464
- function withNaturalFonts(action, containerWidthPx) {
11465
- if (containerWidthPx === void 0) { containerWidthPx = 4000; }
11466
- /*
11467
- * Requirements for Android Chrome to apply the system font size to a text inside an iframe:
11468
- * - The iframe mustn't have a `display: none;` style;
11469
- * - The text mustn't be positioned absolutely;
11470
- * - The text block must be wide enough.
11471
- * 2560px on some devices in portrait orientation for the biggest font size option (32px);
11472
- * - There must be much enough text to form a few lines (I don't know the exact numbers);
11473
- * - The text must have the `text-size-adjust: none` style. Otherwise the text will scale in "Desktop site" mode;
11474
- *
11475
- * Requirements for Android Firefox to apply the system font size to a text inside an iframe:
11476
- * - The iframe document must have a header: `<meta name="viewport" content="width=device-width, initial-scale=1" />`.
11477
- * The only way to set it is to use the `srcdoc` attribute of the iframe;
11478
- * - The iframe content must get loaded before adding extra content with JavaScript;
11479
- *
11480
- * https://example.com as the iframe target always inherits Android font settings so it can be used as a reference.
11481
- *
11482
- * Observations on how page zoom affects the measurements:
11483
- * - macOS Safari 11.1, 12.1, 13.1, 14.0: zoom reset + offsetWidth = 100% reliable;
11484
- * - macOS Safari 11.1, 12.1, 13.1, 14.0: zoom reset + getBoundingClientRect = 100% reliable;
11485
- * - macOS Safari 14.0: offsetWidth = 5% fluctuation;
11486
- * - macOS Safari 14.0: getBoundingClientRect = 5% fluctuation;
11487
- * - iOS Safari 9, 10, 11.0, 12.0: haven't found a way to zoom a page (pinch doesn't change layout);
11488
- * - iOS Safari 13.1, 14.0: zoom reset + offsetWidth = 100% reliable;
11489
- * - iOS Safari 13.1, 14.0: zoom reset + getBoundingClientRect = 100% reliable;
11490
- * - iOS Safari 14.0: offsetWidth = 100% reliable;
11491
- * - iOS Safari 14.0: getBoundingClientRect = 100% reliable;
11492
- * - Chrome 42, 65, 80, 87: zoom 1/devicePixelRatio + offsetWidth = 1px fluctuation;
11493
- * - Chrome 42, 65, 80, 87: zoom 1/devicePixelRatio + getBoundingClientRect = 100% reliable;
11494
- * - Chrome 87: offsetWidth = 1px fluctuation;
11495
- * - Chrome 87: getBoundingClientRect = 0.7px fluctuation;
11496
- * - Firefox 48, 51: offsetWidth = 10% fluctuation;
11497
- * - Firefox 48, 51: getBoundingClientRect = 10% fluctuation;
11498
- * - Firefox 52, 53, 57, 62, 66, 67, 68, 71, 75, 80, 84: offsetWidth = width 100% reliable, height 10% fluctuation;
11499
- * - Firefox 52, 53, 57, 62, 66, 67, 68, 71, 75, 80, 84: getBoundingClientRect = width 100% reliable, height 10%
11500
- * fluctuation;
11501
- * - Android Chrome 86: haven't found a way to zoom a page (pinch doesn't change layout);
11502
- * - Android Firefox 84: font size in accessibility settings changes all the CSS sizes, but offsetWidth and
11503
- * getBoundingClientRect keep measuring with regular units, so the size reflects the font size setting and doesn't
11504
- * fluctuate;
11505
- * - IE 11, Edge 18: zoom 1/devicePixelRatio + offsetWidth = 100% reliable;
11506
- * - IE 11, Edge 18: zoom 1/devicePixelRatio + getBoundingClientRect = reflects the zoom level;
11507
- * - IE 11, Edge 18: offsetWidth = 100% reliable;
11508
- * - IE 11, Edge 18: getBoundingClientRect = 100% reliable;
11509
- */
11510
- return withIframe(function (_, iframeWindow) {
11511
- var iframeDocument = iframeWindow.document;
11512
- var iframeBody = iframeDocument.body;
11513
- var bodyStyle = iframeBody.style;
11514
- bodyStyle.width = containerWidthPx + "px";
11515
- bodyStyle.webkitTextSizeAdjust = bodyStyle.textSizeAdjust = 'none';
11516
- // See the big comment above
11517
- if (isChromium()) {
11518
- iframeBody.style.zoom = "" + 1 / iframeWindow.devicePixelRatio;
11519
- }
11520
- else if (isWebKit()) {
11521
- iframeBody.style.zoom = 'reset';
11522
- }
11523
- // See the big comment above
11524
- var linesOfText = iframeDocument.createElement('div');
11525
- linesOfText.textContent = __spreadArrays(Array((containerWidthPx / 20) << 0)).map(function () { return 'word'; }).join(' ');
11526
- iframeBody.appendChild(linesOfText);
11527
- return action(iframeDocument, iframeBody);
11528
- }, '<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">');
11529
- }
11530
-
11531
- /**
11532
- * The list of entropy sources used to make visitor identifiers.
11533
- *
11534
- * This value isn't restricted by Semantic Versioning, i.e. it may be changed without bumping minor or major version of
11535
- * this package.
11536
- */
11537
- var sources = {
11538
- // READ FIRST:
11539
- // See https://github.com/fingerprintjs/fingerprintjs/blob/master/contributing.md#how-to-make-an-entropy-source
11540
- // to learn how entropy source works and how to make your own.
11541
- // The sources run in this exact order.
11542
- // The asynchronous sources are at the start to run in parallel with other sources.
11543
- fonts: getFonts,
11544
- domBlockers: getDomBlockers,
11545
- fontPreferences: getFontPreferences,
11546
- audio: getAudioFingerprint,
11547
- screenFrame: getRoundedScreenFrame,
11548
- osCpu: getOsCpu,
11549
- languages: getLanguages,
11550
- colorDepth: getColorDepth,
11551
- deviceMemory: getDeviceMemory,
11552
- screenResolution: getScreenResolution,
11553
- hardwareConcurrency: getHardwareConcurrency,
11554
- timezone: getTimezone,
11555
- sessionStorage: getSessionStorage,
11556
- localStorage: getLocalStorage,
11557
- indexedDB: getIndexedDB,
11558
- openDatabase: getOpenDatabase,
11559
- cpuClass: getCpuClass,
11560
- platform: getPlatform,
11561
- plugins: getPlugins,
11562
- canvas: getCanvasFingerprint,
11563
- touchSupport: getTouchSupport,
11564
- vendor: getVendor,
11565
- vendorFlavors: getVendorFlavors,
11566
- cookiesEnabled: areCookiesEnabled,
11567
- colorGamut: getColorGamut,
11568
- invertedColors: areColorsInverted,
11569
- forcedColors: areColorsForced,
11570
- monochrome: getMonochromeDepth,
11571
- contrast: getContrastPreference,
11572
- reducedMotion: isMotionReduced,
11573
- hdr: isHDR,
11574
- math: getMathFingerprint,
11575
- };
11576
- /**
11577
- * A delay is required to ensure consistent entropy components.
11578
- * See https://github.com/fingerprintjs/fingerprintjs/issues/254
11579
- * and https://github.com/fingerprintjs/fingerprintjs/issues/307
11580
- * and https://github.com/fingerprintjs/fingerprintjs/commit/945633e7c5f67ae38eb0fea37349712f0e669b18
11581
- */
11582
- function prepareForSources(delayFallback) {
11583
- if (delayFallback === void 0) { delayFallback = 50; }
11584
- // A proper deadline is unknown. Let it be twice the fallback timeout so that both cases have the same average time.
11585
- return requestIdleCallbackIfAvailable(delayFallback, delayFallback * 2);
9163
+
9164
+ function __rest(s, e) {
9165
+ var t = {};
9166
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
9167
+ t[p] = s[p];
9168
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
9169
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
9170
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9171
+ t[p[i]] = s[p[i]];
9172
+ }
9173
+ return t;
9174
+ }
9175
+
9176
+ /** @deprecated */
9177
+ function __spreadArrays() {
9178
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
9179
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
9180
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
9181
+ r[k] = a[j];
9182
+ return r;
11586
9183
  }
11587
- // The exports below are for private usage. They may change unexpectedly. Use them at your own risk.
11588
- /** Not documented, out of Semantic Versioning, usage is at your own risk */
11589
- var murmurX64Hash128 = x64hash128;
11590
9184
 
11591
9185
  /**
11592
- * FingerprintJS Pro v3.5.7 - Copyright (c) FingerprintJS, Inc, 2022 (https://fingerprintjs.com)
9186
+ * FingerprintJS Pro v3.8.0 - Copyright (c) FingerprintJS, Inc, 2022 (https://fingerprint.com)
11593
9187
  *
11594
9188
  * This software contains code from open-source projects:
11595
9189
  * MurmurHash3 by Karan Lyons (https://github.com/karanlyons/murmurHash3.js)
11596
9190
  */
11597
- function b(e,n){return new Promise((function(t){return y(t,e,n)}))}function y(e,n){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];var i=Date.now()+n,o=0,a=function(){o=setTimeout((function(){Date.now()<i?a():e.apply(void 0,t);}),i-Date.now());};return a(),function(){return clearTimeout(o)}}function w(e,n,t){for(var r=[],i=3;i<arguments.length;i++)r[i-3]=arguments[i];var o,a=!1,u=e,s=0,c=function(){a||o||(s=Date.now(),o=y((function(){a=!0,t.apply(void 0,r);}),u));},l=function(){!a&&o&&(o(),o=void 0,u-=Date.now()-s);};return n&&c(),{start:c,stop:l}}function E(e,n){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];var i=document,o="visibilitychange",a=function(){return i.hidden?c():s()},u=w(n,!i.hidden,(function(){i.removeEventListener(o,a),e.apply(void 0,t);})),s=u.start,c=u.stop;return i.addEventListener(o,a),function(){i.removeEventListener(o,a),c();}}function R(e,n){return new Promise((function(t){return E(t,e,n)}))}function T(t,r){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,t()];case 1:return [2,n.sent()];case 2:return e=n.sent(),console.error(e),[2,r];case 3:return [2]}}))}))}function S(t,r){var i=this;return new Promise((function(o,a){var u=r(),s=!1;null==t||t.then(o,a).then((function(){return s=!0}));var c=function(t){return __awaiter(i,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:if(t.done)return [2,o(t.value)];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.value];case 2:if(e=n.sent(),!s)try{c(u.next(e));}catch(i){a(i);}return [3,4];case 3:if(r=n.sent(),!s)try{c(u.throw(r));}catch(i){a(i);}return [3,4];case 4:return [2]}}))}))};c(u.next());}))}function I(t,r){return __awaiter(this,void 0,void 0,(function(){var e,i,o,a;return __generator(this,(function(n){switch(n.label){case 0:try{e=r().then((function(e){return i=[!0,e]}),(function(e){return i=[!1,e]}));}catch(u){i=[!1,u];}return a=t.then((function(e){return o=[!0,e]}),(function(e){return o=[!1,e]})),[4,Promise.race([e,a])];case 1:return n.sent(),[2,function(){if(i){if(i[0])return i[1];throw i[1]}if(o){if(o[0])return o[1];throw o[1]}throw new Error("96375")}]}}))}))}function A(){var e=window;try{return e.self!==e.top}catch(n){return !0}}function _(e,t){var r;return __generator(this,(function(n){switch(n.label){case 0:r=0,n.label=1;case 1:return [4,Math.random()*Math.min(t,e*Math.pow(2,r))];case 2:n.sent(),n.label=3;case 3:return ++r,[3,1];case 4:return [2]}}))}function C(e){return e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}var O="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",D=O+"+/";function P(e,n){if(0==n.length||n.length>e.length)return -1;for(var t=0;t<e.length;t++){for(var r=0,i=0;i<n.length;i++){if(e[t+i]!==n[i]){r=0;break}r++;}if(r==n.length)return t}return -1}function N(e){if("function"==typeof TextDecoder){var n=(new TextDecoder).decode(e);if(n)return n}var t=C(e);return decodeURIComponent(escape(String.fromCharCode.apply(null,t)))}function x(e){return e.reduce((function(e,n){return e+(n?1:0)}),0)}function L(e,n,t){return void 0===t&&(t="..."),e.length<=n?e:""+e.slice(0,Math.max(0,n-t.length))+t}function q(e,n){return (e-n+256)%256}function j(e){for(var n=C(e),t=n.length,r="",i=0;i<t;i+=3)r+=D[n[i]>>2]+D[(3&n[i])<<4|n[i+1]>>4]+D[(15&n[i+1])<<2|n[i+2]>>6]+D[63&n[i+2]];return t%3==2?r.slice(0,-1)+"=":t%3==1?r.slice(0,-2)+"==":r}function M(e){for(var n="",t=0;t<e.length;++t)if(t>0){var r=e[t].toLowerCase();r!==e[t]?n+=" "+r:n+=e[t];}else n+=e[t].toUpperCase();return n}function U(e){return void 0===e?void 0:""+e}function F(e,n){for(var t="",r=0;r<e;r++)t+=n.charAt(Math.random()*n.length);return t}function V(e){return F(e,O)}function B(){return 256*Math.random()|0}function G(e){var n=e.filter((function(e){return !!e}));return n.length?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=function(n){T((function(){return n.apply(void 0,e)}));},i=0,o=n;i<o.length;i++){var a=o[i];r(a);}}:void 0}function H(e){void 0===e&&(e="[FingerprintJS Pro] ");var n={};return function(t){switch(t.e){case 15:n[t.getCallId]=t.request;break;case 18:console.log(e+"Visitor id request",n[t.getCallId]);break;case 19:console.log(e+"Visitor id response",t.body);break;case 16:case 17:delete n[t.getCallId];}}}function X(e){var n=e.url,t=e.method,r=void 0===t?"get":t,i=e.body,o=e.headers,a=e.withCredentials,u=void 0!==a&&a,s=e.timeout,c=e.responseFormat,l=e.abort;return new Promise((function(e,t){var a=new XMLHttpRequest;for(var f in a.open(r,n,!0),a.withCredentials=u,a.timeout=void 0===s?0:Math.max(s,1),"binary"===c&&(a.responseType="arraybuffer"),o)a.setRequestHeader(f,o[f]);a.onload=function(){return e(function(e){return {body:e.response,status:e.status,statusText:e.statusText}}(a))},a.ontimeout=function(){return t(J("TimeoutError","The request timed out"))},a.onabort=function(){return t(J("AbortError","The request is aborted"))},a.onerror=function(){return t(J("TypeError",navigator.onLine?"Connection error":"Network offline"))},a.send(function(e){var n,t=function(){try{return new Blob([]),!1}catch(n){return !0}};if(e instanceof ArrayBuffer){if(!t())return new Uint8Array(e)}else if((null===(n=e)||void 0===n?void 0:n.buffer)instanceof ArrayBuffer&&t())return e.buffer;return e}(i)),null==l||l.catch((function(){})).then((function(){a.onabort=null,a.abort();}));}))}function J(e,n){var t=new Error(n);return t.name=e,t}function Y(e,n){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];e&&T((function(){var r=n.apply(void 0,t);void 0!==r&&e(r);}));}function Q(t,r,i,o,a){return __awaiter(this,void 0,void 0,(function(){var e,u;return __generator(this,(function(n){switch(n.label){case 0:Y(t,r),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,a()];case 2:return e=n.sent(),[3,4];case 3:throw u=n.sent(),Y(t,o,u),u;case 4:return Y(t,i,e),[2,e]}}))}))}function ne(){var e=window,n=navigator;return x(["maxTouchPoints"in n,"mediaCapabilities"in n,"PointerEvent"in e,"visualViewport"in e,"onafterprint"in e])>=4}function te(){var e=window;return x([!("PushManager"in e),!("AudioBuffer"in e),!("RTCPeerConnection"in e),!("geolocation"in navigator),!("ServiceWorker"in e)])>=3}var Re={us:"use1",eu:"eun1",ap:"aps1"};function Te(t,r,i){var o,a=function(e,t,r,i){void 0===r&&(r=1/0);var o=_(300,1e4);return S(null==i?void 0:i.then((function(){}),(function(){})),(function(){var a,u,s;return __generator(this,(function(n){switch(n.label){case 0:a=0,n.label=1;case 1:if(!(a<r))return [3,8];u=Date.now(),n.label=2;case 2:return n.trys.push([2,4,,5]),[4,e(a,i)];case 3:return [2,n.sent()];case 4:return s=n.sent(),t(s),[3,5];case 5:return [4,b(u+o.next().value-Date.now())];case 6:n.sent(),n.label=7;case 7:return ++a,[3,1];case 8:return [2,void 0]}}))}))}((function(r,o){return function(t,r,i,o,a){return __awaiter(this,void 0,void 0,(function(){var e,u;return __generator(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,Q(a,(function(){return {e:9,tryNumber:i,timeout:r}}),(function(e){var n=e.status,t=e.body;return {e:10,tryNumber:i,status:n,body:t}}),(function(e){return {e:11,tryNumber:i,error:e}}),(function(){return X({url:t,timeout:r,abort:o})}))];case 1:return e=n.sent(),[3,3];case 2:switch((u=n.sent()).name){case"AbortError":throw Se(u.message,-2);case"TimeoutError":throw Se(u.message,-3);case"TypeError":throw Se(u.message,-4)}throw u;case 3:if(200===e.status)return [2,e.body];throw Se(L(e.status+": "+e.body,255),-5)}}))}))}(t,5e3,r,o,i)}),(function(e){return o=e}),10,r);return a.catch((function(){})),function(e){return void 0===e&&(e=new Promise((function(){}))),Promise.race([e.then((function(){}),(function(){})),a]).then((function(e){if(void 0!==e)return e;throw o||Se("Timeout",-3)}))}}function Se(e,n){var t=new Error(e);return t.__="slt",t.s=n,t}function Ce(e){var n,r=e.components,i=e.customComponent,o=e.apiKey,u=e.visitorToken,s=e.tls,c=e.tag,l=e.extendedResult,f=e.linkedId,d=e.algorithm;return (n={}).c=o,n.url=location.href,n.t=function(e){if(e&&"object"==typeof e)return e;if(null==e)return;return {tag:e}}(c),n.cbd=l?1:void 0,n.lid=f,n.cr=document.referrer||void 0,n.a=d,n.s1=xe(r.osCpu,-1),n.s2=Pe(r.languages),n.s3=Pe(r.colorDepth),n.s4=xe(r.deviceMemory,-1),n.s5=Oe(r.screenResolution,(function(e){return {s:0,v:e.map((function(e){return null===e?-1:e}))}})),n.s6=Oe(r[5],(function(e){return {s:0,v:e.map((function(e){return null===e?-1:e}))}})),n.s7=xe(r.hardwareConcurrency,-1),n.s8=Le(r[6]),n.s9=Pe(r.timezone),n.s10=Pe(r.sessionStorage),n.s11=Pe(r.localStorage),n.s12=xe(r.indexedDB,-1),n.s13=Pe(r.openDatabase),n.s14=xe(r.cpuClass,-1),n.s15=Pe(r.platform),n.s16=xe(r.plugins,-1),n.s17=Oe(r.canvas,(function(e){return {s:0,v:__assign(__assign({},e),{geometry:murmurX64Hash128(e.geometry),text:murmurX64Hash128(e.text)})}})),n.s18=Le(r[7]),n.s19=Pe(r.touchSupport),n.s20=Pe(r.fonts),n.s21=Oe(r.audio,(function(e){return -1===e||-2===e||-3===e?{s:e,v:null}:{s:0,v:e}})),n.s22=xe(r[10],-1),n.s24=Pe(r[31]),n.s26=Le(r[8]),n.s27=Pe(r.vendor),n.s28=Pe(r.vendorFlavors),n.s30=xe(r[11],-1),n.s31=Pe(r[4]),n.s32=Pe(r.cookiesEnabled),n.s33=Pe(r[12]),n.s34=Ne(r[0]),n.s35=Ne(r[3]),n.s36=xe(r.domBlockers,-1),n.s37=xe(r.colorGamut,-1),n.s38=xe(r.contrast,-1),n.s39=xe(r.forcedColors,-1),n.s40=xe(r.hdr,-1),n.s41=xe(r.invertedColors,-1),n.s42=xe(r.monochrome,-1),n.s43=xe(r.reducedMotion,-1),n.s44=xe(r[13],-1),n.s45=Pe(r[14]),n.s46=Oe(r.math,(function(e){return {s:0,v:murmurX64Hash128(Object.keys(e).map((function(n){return n+"="+e[n]})).join(","))}})),n.s47=Oe(r.j,(function(e){return {s:e?0:-1,v:e?__assign(__assign({},e),{contextAttributes:murmurX64Hash128(e.contextAttributes),parameters:murmurX64Hash128(e.parameters),shaderPrecisions:murmurX64Hash128(e.shaderPrecisions),extensions:murmurX64Hash128(e.extensions),extensionParameters:murmurX64Hash128(e.extensionParameters),fingerprint:murmurX64Hash128(e.fingerprint)}):null}})),n.s48=Pe(r[15]),n.s49=xe(r[16],-1),n.s50=xe(r[17],-1),n.s51=Pe(r.fontPreferences),n.s52=Oe(r[2],(function(e){return {s:"number"==typeof e?e:e.length?0:1,v:"number"==typeof e?"":murmurX64Hash128(JSON.stringify(e))}})),n.s53=Ne(r[18]),n.s54=Le(r[1]),n.s55=function(e){var n=e[0],t=e[1];if(void 0!==n&&void 0!==t)return {s:0,v:n||t};if(void 0!==n)return {s:1,v:n};if(void 0!==t)return {s:2,v:t};return {s:-1,v:null}}(u),n.s56=function(e){if(!e)return {s:-1,v:null};if(e.error){var n=e.error;return function(e){return "slt"===e.__}(n)?{s:n.s,v:null}:{e:n.message}}return {s:0,v:e.value}}(s),n.s57=xe(r[19],-1),n.s58=xe(r[9],-1),n.s59=Pe(r[20]),n.s60=Pe(r[21]),n.s61=Pe(r[22]),n.s62=Pe(r[23]),n.s63=Pe(r[24]),n.s64=Pe(r[25]),n.s65=Pe(r[26]),n.s66=xe(r[27],-1),n.s67=i?{s:0,v:i}:{s:-1,v:null},n.s68=Pe(r[28]),n.s69=Ne(r[29]),n.s71=Pe(r[30]),n.s72=xe(r[32],-1),n}function Oe(e,n){return e.error?{e:De(e.error)}:n(e.value)}function De(e){var n;try{n=""+e.message,"name"in e&&(n=e.name+": "+n);}catch(e){n="Code 3017: "+e.name+": "+e.message;}return L(n,500)}function Pe(e){return Oe(e,(function(e){return {s:0,v:e}}))}function Ne(e){return Oe(e,(function(e){return e}))}function xe(e,n){return Oe(e,(function(e){return {s:null==e?n:0,v:null!=e?e:null}}))}function Le(e){return Oe(e,(function(e){return "number"==typeof e?{s:e,v:null}:{s:0,v:e}}))}var qe=M("WrongRegion"),je=M("SubscriptionNotActive"),Me=M("UnsupportedVersion");function Ue(e,n){var r=e.bodyData;return void 0===r?Ke(e):function(e){return e instanceof Object&&"2"===e.v&&e.products instanceof Object}(r)?function(e,n){var r=e.notifications,i=e.requestId,o=e.error,a=e.products;if(We(r),o)return Fe(o,i,n);var u=a.identification;if(!u)throw new Error("There is no identification result in the response");if(We(u.notifications),u.error)return Fe(u.error,i,n);return [__assign({requestId:i},u.data.result),u.data.visitorToken]}(r,n):Ke(e)}function Fe(e,n,t){switch(e.code){case"NotAvailableForCrawlBots":return Be(n,!0,t);case"NotAvailableWithoutUA":return Be(n,void 0,t);case"Failed":case"RequestTimeout":return Ge(Ve(e),n,e);default:throw Ge(Ve(e),n,e)}}function Ve(e){var n,t=e.code,r=e.message;return void 0===t?r:null!==(n=function(e){switch(e){case"TokenRequired":return "Token required";case"TokenNotFound":return "Token not found";case"TokenExpired":return "Token expired";case"RequestCannotBeParsed":return "Request cannot be parsed";case"Failed":return "Request failed";case"RequestTimeout":return "Request failed to process";case"TooManyRequests":return "Too many requests, rate limit exceeded";case"OriginNotAvailable":return "Not available for this origin";case"HeaderRestricted":return "Not available with restricted header";case"NotAvailableForCrawlBots":return "Not available for crawl bots";case"NotAvailableWithoutUA":return "Not available when User-Agent is unspecified"}}(t))&&void 0!==n?n:M(t)}function Be(e,n,r){var i={requestId:e,visitorFound:!1,visitorId:"",confidence:{score:.9,comment:"The real score is unknown"}};if(!r)return [i];var o="n/a",a=__assign(__assign({},i),{bot:{probability:1},incognito:!1,browserName:o,browserVersion:o,device:o,ip:o,os:o,osVersion:o});return void 0!==n&&(a.bot.safe=n),[a]}function Ge(e,n,t){var r=new Error(e);return void 0!==n&&(r.requestId=n),void 0!==t&&(r.raw=t),r}function We(e){null==e||e.forEach($e);}function $e(e){var n=e.level,t=e.message;"error"===n?console.error(t):"warning"===n?console.warn(t):console.log(t);}function Ke(e){var n=Ge("Response cannot be parsed",void 0,{httpStatusCode:e.status,bodyBase64:j(e.body)});if(e.status>=500)return n;throw n}function He(e,n,t,r,i){void 0===i&&(i=B);var o=i()%(t+1),a=function(e){if("function"==typeof TextEncoder)return (new TextEncoder).encode(e);for(var n=unescape(encodeURI(e)),t=new Uint8Array(n.length),r=0;r<n.length;++r)t[r]=n.charCodeAt(r);return t}(JSON.stringify(e)),u=1+n.length+1+o+r+a.length,s=new ArrayBuffer(u),c=new Uint8Array(s),l=0,f=i();c[l++]=f;for(var d=0,v=n;d<v.length;d++){var h=v[d];c[l++]=f+h;}c[l++]=f+o;for(var g=0;g<o;++g)c[l++]=i();var m=new Uint8Array(r);for(g=0;g<r;++g)m[g]=i(),c[l++]=m[g];for(g=0;g<a.length;++g)c[l++]=a[g]^m[g%r];return s}function Xe(e,n,t){var r=function(){throw new Error("Invalid data")},i=C(e);i.length<n.length+2&&r();for(var o=0;o<n.length;++o)q(i[1+o],i[0])!==n[o]&&r();var a=1+n.length,u=q(i[a],i[0]);i.length<a+1+u+t&&r();var s=a+1+u,c=s+t,l=new Uint8Array(i.length-c);for(o=0;o<l.length;++o)l[o]=i[c+o]^i[s+o%t];return JSON.parse(N(l))}var Je=[3,7];function ze(r){return __awaiter(this,void 0,void 0,(function(){var e,i,o;return __generator(this,(function(n){switch(n.label){case 0:return [4,X(__assign(__assign({},r),{body:(u=r.body,He(u,Je,3,7)),responseFormat:"binary"}))];case 1:e=n.sent();try{a=e.body,i=Xe(a,Je,7),o=!0;}catch(s){try{i=JSON.parse(N(e.body)),o=!1;}catch(c){}}return [2,__assign(__assign({},e),{bodyData:i,isSecret:o})]}var a,u;}))}))}function Ye(e,n){if(n)return n;var t="api.fpjs.io";return "us"!==e&&(t=e+"."+t),"https://"+t}function Qe(i,o,a){var u=i.endpoint,s=i.extendedResult,c=void 0!==s&&s,l=__rest(i,["endpoint","extendedResult"]);return __awaiter(this,void 0,void 0,(function(){var r,i,s;return __generator(this,(function(f){switch(f.label){case 0:return r=(d=u)+(-1===d.indexOf("?")?"?":"&")+"ci=js/"+encodeURIComponent("3.5.7"),i=Ce(__assign({extendedResult:c},l)),s=0,[4,Q(a,(function(){return {e:15,endpoint:r,request:i}}),(function(e){return {e:16,result:e}}),(function(e){return {e:17,error:e}}),(function(){return function(e,t){var r,i=_(300,1e4);return S(null==t?void 0:t.catch((function(e){r||(r=e);})).then((function(){throw r})),(function(){var o,a,u;return __generator(this,(function(n){switch(n.label){case 0:return o=Date.now(),[4,e(t)];case 1:return (a=n.sent())instanceof Error?(r=a,u=i.next().value,[4,b(o+u-Date.now())]):[2,a];case 2:n.sent(),n.label=3;case 3:return [3,0];case 4:return [2]}}))}))}((function(t){return function(t,r,i,o,a,u){return __awaiter(this,void 0,void 0,(function(){var e,s;return __generator(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,Q(u,(function(){return {e:18,tryNumber:o}}),(function(e){var n=e.status,t=e.body,r=e.bodyData,i=e.isSecret;return {e:19,tryNumber:o,status:n,body:null!=r?r:t,isSecret:i}}),(function(e){return {e:20,tryNumber:o,error:e}}),(function(){return ze({url:t,method:"post",body:r,headers:{"Content-Type":"text/plain"},withCredentials:!0,abort:a})}))];case 1:return e=n.sent(),[3,3];case 2:return s=n.sent(),[2,new Error("AbortError"===s.name?"Network request aborted":"Network connection error")];case 3:return [2,Ue(e,i)]}}))}))}(r,i,c,s++,t,a)}),o)}))];case 1:return [2,f.sent()]}var d;}))}))}function Ze(){var e,n,t=en();return (null===(n=null===(e=window[t[0]])||void 0===e?void 0:e[t[1]])||void 0===n?void 0:n[t[2]])||1073741824}function en(){return Xe(new Uint32Array([1238629110,448276002,3812774028,808844344,1040086494,3917076003,2006609522,3391962601,1618783843,902064594,3846817827,1945380650,2587245025,908308022,938305751,2922813991,1910122279,3709215973,809499767,66414809,3983071030,916072247,3711377838,822474088,300514777,4182498348,953759295,3408360096,591258990,229539788]),[],5)}function nn(){var e,n,t=on();try{n=A()?null===(e=window.top)||void 0===e?void 0:e[t[0]]:window[t[0]];}catch(r){if("SecurityError"===r.name)return !1;throw r}if(!n)return !1;try{n[t[1]][t[2]](t[3],t[4],{},(function(){}));}catch(r){return !new RegExp(t[5]).test(r)}return !1}function tn(){return __awaiter(this,void 0,void 0,(function(){var e,t,r;return __generator(this,(function(n){switch(n.label){case 0:e=document,t=on(),(r=e.createElement("iframe")).style.display="none",n.label=1;case 1:return e.body?[3,3]:[4,b(50)];case 2:return n.sent(),[3,1];case 3:return n.trys.push([3,,5,6]),e.body.appendChild(r),[4,Promise.race([b(20,!1),new Promise((function(e){r.contentWindow?r.contentWindow[t[6]].addEventListener("error",(function(){return e(!0)})):e(!1);}))])];case 4:return [2,n.sent()];case 5:return r.remove(),[7];case 6:return [2]}}))}))}function rn(){var e=window.openDatabase,n=window.localStorage;try{e(null,null,null,null);}catch(t){return !0}try{return n.setItem("test","1"),n.removeItem("test"),!1}catch(t){return !0}}function on(){return Xe(new Uint32Array([571803394,2333197341,667974149,459532809,2807590137,1996360231,241878290,3893584866,1793199716,1479125268,4262158585,1442777440,325646623,3826480888,665278571,175243026,2757050360,1760166496,1415636746,2836884200,2012960809,241499411,2840995822,1912086370,1482750223,4212860839,1726092917,359464731,3894101733,1487478637]),[],3)}var an=[[function(){return isChromium()},function(){return x(["ClipboardItem"in(t=window),"PerformanceEventTiming"in t,"RTCSctpTransport"in t])>=2?function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,i,o;return __generator(this,(function(n){switch(n.label){case 0:return e=en(),t=navigator,r=t[e[3]],(i=t[e[4]])?[4,new Promise((function(n){i[e[5]]((function(e,t){return n(t)}));}))]:[3,2];case 1:return o=n.sent(),[3,4];case 2:return (null==r?void 0:r[e[6]])?[4,r[e[6]]().then((function(e){return e.quota}))]:[3,4];case 3:o=n.sent(),n.label=4;case 4:return o?[2,o<Ze()]:[2,!1]}}))}))}():function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:return (e=window.webkitRequestFileSystem)?[4,new Promise((function(n){e(0,1,(function(){return n(!1)}),(function(){return n(!0)}));}))]:[2,!1];case 1:return [2,n.sent()]}}))}))}();var t;}],[function(){return isWebKit()},function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return ne()?isDesktopSafari()?[2,nn()]:[2,tn()]:[2,rn()]}))}))}],[function(){return isGecko()},function(){return new Promise((function(e){try{var n=indexedDB.open("test");n.onerror=function(){return e(!0)},n.onsuccess=function(){return e(!1)};}catch(t){return e(!0)}}))}],[function(){return isTrident()||isEdgeHTML()},function(){try{if(!window.indexedDB)return !0}catch(e){return !0}return !1}]];function un(t){var r=t.storageKeyPrefix;return __awaiter(this,void 0,void 0,(function(){var e,t,i;return __generator(this,(function(n){switch(n.label){case 0:return void 0!==(t=function(e){try{var n=localStorage.getItem(e);if(!n)return;return "1"===n}catch(t){return}}(e=r+"_i"))?[2,t]:[4,sn()];case 1:return i=n.sent(),function(e,n){try{localStorage.setItem(e,n?"1":"0");}catch(t){}}(e,i),[2,i]}}))}))}function sn(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,i,o;return __generator(this,(function(n){switch(n.label){case 0:e=0,t=an,n.label=1;case 1:return e<t.length?(r=t[e],i=r[0],o=r[1],i()?[4,o()]:[3,3]):[3,4];case 2:return [2,n.sent()];case 3:return e++,[3,1];case 4:return [2,!1]}}))}))}function cn(){var e=window;if(!isChromium())return !1;try{if([66,114,97,118,101].map((function(e){return String.fromCharCode(e)})).join("")in e)return !0;var n=document.createElement("canvas");n.width=4,n.height=4,n.style.display="inline";var t=n.toDataURL();if(""===t)return !0;for(var r=window.atob(t.split(",")[1]),i=r.length,o=new Uint8Array(i),a=0;a<i;a++)o[a]=r.charCodeAt(a);var u=P(o,[73,68,65,84,24]);if(-1===u)return !1;var c=P(o,[73,69,78,68]);return -1!==c&&1321!==o.slice(u+5,c).reduce((function(e,n){return e+n}),0)}catch(l){return !1}}function ln(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(n){switch(n.label){case 0:return e=[],[4,I(R(2e3,-4),fn.bind(null,(function(n){return e.push(n)})))];case 1:return t=n.sent(),[2,function(){var n=t();return 0===n||-4===n?{s:n,v:__spreadArrays(e)}:{s:n,v:null}}]}}))}))}function fn(t){return __awaiter(this,void 0,void 0,(function(){var e,r,i;return __generator(this,(function(n){switch(n.label){case 0:if(e=window,!(r=e.RTCPeerConnection||e.webkitRTCPeerConnection))return [2,-3];try{i=new r({iceServers:Xe(new Uint32Array([1116284708,2807606666,1856165634,1993636598,3410021538,3195192872,1656883084,2598385300,3564798284,1087152758,1841329857,3355624888,3127755894,1804885912,4294258839]),[],7).map((function(e){return {urls:"stun:"+e}}))});}catch(o){if("NotSupportedError"===o.name)return [2,-6];throw o}n.label=1;case 1:return n.trys.push([1,,3,4]),[4,new Promise((function(e,n){var r,a=!1;i.onicecandidate=function(n){var r=n.candidate;if(!r)return e(0);var i=r.candidate;i&&(t(i),!a&&/ typ [sp]rflx /.test(i)&&(a=!0,E(e,10,0)));},i.onicegatheringstatechange=function(){"complete"===i.iceGatheringState&&e(0);};try{null===(r=i.createDataChannel)||void 0===r||r.call(i,"test");}catch(o){return void("NotSupportedError"===o.name?e(-7):n(o))}var u=function(e,n){try{return e.createOffer(n)}catch(o){if(/\bcreateOffer\b.*(\bcallback\b.*\bnot a function\b|\barguments required\b.*\bpresent\b)/i.test(o.message))return new Promise((function(t,r){e.createOffer(t,r,n);}));throw o}}(i,isEdgeHTML()?{offerToReceiveAudio:!0}:void 0);void 0===u?e(-8):u.then((function(e){return i.setLocalDescription(e)}),n);}))];case 2:return [2,n.sent()];case 3:try{i.close();}catch(a){}return [7];case 4:return [2]}}))}))}function dn(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:if("function"!=typeof(e=window.ApplePaySession))return [2,{s:-1,v:null}];n.label=1;case 1:return n.trys.push([1,4,,5]),e.canMakePayments()?isWebKit()&&!ne()?[2,{s:0,v:1}]:[4,new Promise((function(e){return setTimeout(e,0)}))]:[2,{s:0,v:0}];case 2:return n.sent(),[4,Promise.race([e.canMakePaymentsWithActiveCard(""),R(100,!1)])];case 3:return [2,{s:0,v:n.sent()?3:2}];case 4:return [2,vn(n.sent())];case 5:return [2]}}))}))}function vn(e){if("InvalidAccessError"===e.name){if(/\bfrom\b.*\binsecure\b/i.test(e.message))return {s:-2,v:null};if(/\bdifferent\b.*\borigin\b.*top.level\b.*\bframe\b/i.test(e.message))return {s:-3,v:null}}throw e}function hn(){return !!gn("dark")||!gn("light")&&void 0}function gn(e){return matchMedia("(prefers-color-scheme: "+e+")").matches}function mn(){var e=Date.now();return [pn(e),pn(e-6e4*(new Date).getTimezoneOffset())]}function pn(e){var n=Number(e);return isNaN(n)?-1:n}function bn(){var e=window.performance;if(null==e?void 0:e.now){for(var n=1,t=1,r=e.now(),i=r,o=0;o<5e4;o++)if((r=i)<(i=e.now())){var a=i-r;a>n?a<t&&(t=a):a<n&&(t=n,n=a);}return [n,t]}}function yn(){var e,n;return null===(n=null===(e=window.performance)||void 0===e?void 0:e.memory)||void 0===n?void 0:n.jsHeapSizeLimit}var wn=["MAX_TEXTURE_MAX_ANISOTROPY_EXT","FRAGMENT_SHADER_DERIVATIVE_HINT_OES","MAX_COLOR_ATTACHMENTS_WEBGL","MAX_DRAW_BUFFERS_WEBGL","DRAW_BUFFER0_WEBGL","DRAW_BUFFER1_WEBGL","VERTEX_ARRAY_BINDING_OES","TIMESTAMP_EXT","GPU_DISJOINT_EXT","MAX_VIEWS_OVR"],En=[10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32926,32928,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938],Rn=[32926,32928],Tn=["FRAGMENT_SHADER","VERTEX_SHADER"],Sn=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"];function In(e,n,t){var r=e.getShaderPrecisionFormat(e[n],e[t]);return r?[r.rangeMin,r.rangeMax,r.precision]:[]}function kn(e){return "string"==typeof e&&!e.match(/[^A-Z0-9_x]/)}function An(e){return Object.keys(e.__proto__).filter(kn)}function _n(){for(var e=document.createElement("canvas"),n=["webgl","experimental-webgl"],r=void 0,i=0;i<n.length&&!r;i++)try{r=e.getContext(n[i]);}catch(a){}if(r){var o=__assign(__assign({},function(e){var n,t,r,i,o,a,u=e.getSupportedExtensions(),s=e.getExtension("WEBGL_debug_renderer_info"),c=e.getContextAttributes(),l=[],d=[],v=[],h=[];for(var g in c)Object.prototype.hasOwnProperty.call(c,g)&&l.push(g+"="+c[g]);for(var m=An(e),p=isTrident(),b=0,y=m;b<y.length;b++){var w=e[_=y[b]];if(En.indexOf(w)>-1){var E=p&&-1===Rn.indexOf(w)?e.getParameter(w):null;d.push(_+"("+w+")="+E);}else d.push(_+"="+w);}if(u)for(var R=0,T=u;R<T.length;R++){var S=T[R],I=e.getExtension(S);if(I)for(var k=0,A=An(I);k<A.length;k++){var _;w=I[_=A[k]],wn.indexOf(_)>0?v.push(_+"("+w+")="+e.getParameter(w)):v.push(_+"="+w);}}for(var C=0,O=Tn;C<O.length;C++)for(var D=O[C],P=0,N=Sn;P<N.length;P++){var x=N[P],L=In(e,D,x);h.push(D+"."+x+"="+L.join(","));}return v.sort(),d.sort(),{version:(null===(n=e.getParameter(e.VERSION))||void 0===n?void 0:n.toString())||"",vendor:(null===(t=e.getParameter(e.VENDOR))||void 0===t?void 0:t.toString())||"",vendorUnmasked:s?null===(r=e.getParameter(s.UNMASKED_VENDOR_WEBGL))||void 0===r?void 0:r.toString():"",renderer:(null===(i=e.getParameter(e.RENDERER))||void 0===i?void 0:i.toString())||"",rendererUnmasked:s?null===(o=e.getParameter(s.UNMASKED_RENDERER_WEBGL))||void 0===o?void 0:o.toString():"",shadingLanguageVersion:(null===(a=e.getParameter(e.SHADING_LANGUAGE_VERSION))||void 0===a?void 0:a.toString())||"",contextAttributes:l.join("&"),parameters:d.join("&"),shaderPrecisions:h.join("&"),extensions:u?u.join(","):"",extensionParameters:v.join(",")}}(r)),{fingerprint:""});return function(e){e.clearColor(0,0,1,1);var n=e.createProgram();if(n){i(0,"attribute vec2 p;uniform float t;void main(){float s=sin(t);float c=cos(t);gl_Position=vec4(p*mat2(c,s,-s,c),1,1);}"),i(1,"void main(){gl_FragColor=vec4(1,0,0,1);}"),e.linkProgram(n),e.useProgram(n),e.enableVertexAttribArray(0);var t=e.getUniformLocation(n,"t"),r=e.createBuffer();e.bindBuffer(34962,r),e.bufferData(34962,new Float32Array([0,1,-1,-1,1,-1]),35044),e.vertexAttribPointer(0,2,5126,!1,0,0),e.clear(16384),e.uniform1f(t,3.65),e.drawArrays(4,0,3);}function i(t,r){var i=e.createShader(35633-t);n&&i&&(e.shaderSource(i,r),e.compileShader(i),e.attachShader(n,i));}}(r),o.fingerprint=e.toDataURL(),o}}function Cn(){var t=window.speechSynthesis;if("function"!=typeof(null==t?void 0:t.getVoices))return -1;var r=function(){return t.getVoices()};return !t.addEventListener||isGecko()&&te()?On(r()):function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:return n.trys.push([0,,2,3]),[4,new Promise((function(n,r){var i,o=function(){t.getVoices().length?(null==i||i(),i=y(n,50)):i||(i=E(n,600));};e=function(){try{o();}catch(e){r(e);}},o(),t.addEventListener("voiceschanged",e);}))];case 1:return [2,n.sent()];case 2:return e&&t.removeEventListener("voiceschanged",e),[7];case 3:return [2]}}))}))}(t).then((function(){return function(){var e=r();return e.length?On(e):-2}}))}function On(e){var n=function(e){return e.replace(/([,\\])/g,"\\$1")};return e.map((function(e){return [n(e.voiceURI),n(e.name),n(e.lang),e.localService?"1":"0",e.default?"1":"0"].join(",")})).sort()}function Dn(){return {s:isWebKit()&&!isDesktopSafari()?ne()?0:1:2,v:[(typeof SourceBuffer).slice(0,3),(typeof SourceBufferList).slice(0,3)]}}var Pn={m:["$$s-macbook-pro","$$s-macbook-air","$$s-mac-mini"],i:["$$s-iphone"]},Nn={m:["macbook-pro-$$","macbook-air-$$","mac-mini-$$"],i:["iphone-$$"]},xn={us:["james","mary","john","patricia","robert","jennifer","michael","linda","william","elizabeth","david","barbara","richard","susan","joseph","jessica","thomas","sarah","charles","karen","christopher","nancy","daniel","lisa","matthew","margaret","anthony","betty","donald","sandra"],gb:["oliver","george","noah","arthur","harry","leo","muhammad","jack","charlie","oscar","jacob","henry","thomas","joshua","william","olivia","amelia","isla","ava","mia","isabella","sophia","grace","lily","freya","emily","ivy","ella","rosie","charlotte"],ru:["aleksandr","sergej","vladimir","elena","tatana","andrej","aleksej","olga","nikolaj","natala","anna","ivan","dmitrij","irina","maria","mihail","svetlana","ekaterina","evgenij","viktor","anastasia","urij","ulia","valentin","roman","igor","anatolij","oleg","pavel","maksim"]},Ln={m:["macbook-pro","macbook-air","mac-mini","mac-pro"],i:["iphone","iphone-2"]};function qn(t){return __awaiter(this,void 0,void 0,(function(){var r,i,o,a,u,s,c,l,f=this;return __generator(this,(function(d){switch(d.label){case 0:if(!(r=window.RTCPeerConnection))return [2,-5];i=Math.random().toString(),o=new Map,u="candidate:0 1 udp 2113937151 $ad $pt typ host generation 0 ufrag "+(a="ABCD")+" network-cost 999",s=new r({iceTransportPolicy:"all"}),c=s.createDataChannel(i),l=0,d.label=1;case 1:return d.trys.push([1,,3,4]),[4,new Promise((function(r,i){E((function(){return r(-4)}),1e3),s.oniceconnectionstatechange=function(){"checking"===s.iceConnectionState&&(l=setInterval((function(){return __awaiter(f,void 0,void 0,(function(){var e,t;return __generator(this,(function(n){switch(n.label){case 0:return "checking"!==s.iceConnectionState?[2,r([])]:[4,s.getStats()];case 1:return e=n.sent(),t=[],e.forEach((function(e){if("remote-candidate"===e.type){var n=o.get(e.port);t.push(n);}})),t.length>0&&r(t),[2]}}))}))}),30));},s.createOffer().then((function(e){var n=e.sdp;if(!n)return r(-5);for(var i=[],c=0;c<t.length;c++){var l=t[c],f=50003+c,d=u.replace("$ad",l).replace("$pt",f.toString());o.set(f,l),i.push("a="+d);}var v={type:"answer",sdp:n.replace(/a=ice-ufrag:(.*?)\s{1,2}/,"a=ice-ufrag:"+a+"\r\n").replace(/a=setup:(.*?)\s{1,2}/,"a=setup:active\r\n").replace(/c=IN IP4 ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/,(function(e,n){return "c=IN IP4 "+n+"\r\nb=AS:30\r\n"+i.join("\r\n")}))};return s.setLocalDescription(e),s.setRemoteDescription(v)}),i);}))];case 2:return [2,d.sent()];case 3:return c.close(),s.close(),clearInterval(l),[7];case 4:return [2]}}))}))}function jn(t){return __awaiter(this,void 0,void 0,(function(){var r,o=this;return __generator(this,(function(a){switch(a.label){case 0:r=new AbortController,a.label=1;case 1:return a.trys.push([1,,3,4]),[4,Promise.race(__spreadArrays(t.map((function(t){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,fetch("http"+("http:"===location.protocol?"":"s")+"://"+t,{signal:r.signal})];case 1:return e.sent(),[3,3];case 2:return e.sent(),[3,3];case 3:return [2,t]}}))}))})),[R(500,-4)]))];case 2:return [2,a.sent()];case 3:return r.abort(),[7];case 4:return [2]}}))}))}function Mn(){for(var e=!isDesktopSafari(),n=navigator.language.toLowerCase(),r=function(){var e={"en-us":__assign(__assign({},Pn),{n:xn.us}),"en-gb":__assign(__assign({},Pn),{n:xn.gb}),"ru-ru":__assign(__assign({},Nn),{n:xn.ru})};return e.default=e["en-us"],e.en=e["en-us"],e.ru=e["ru-ru"],e}(),i=r[n]||r[n.slice(0,2)]||r.default,o=e?i.i.slice():i.m.slice(),a=e?Ln.i.slice():Ln.m.slice(),u=0,s=e?i.n:i.n.slice(0,15);u<s.length;u++)for(var c=s[u],f=0,d=o;f<d.length;f++){var v=d[f];a.push(v.replace("$$",c));}return a.map((function(e){return e+".local"}))}function Un(t){return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:return !isWebKit()||(i=window,x(["mediaSession"in navigator,"BigInt64Array"in i,"FormDataEvent"in i,"ImageBitmap"in i,"WebGL2RenderingContext"in i,"onclose"in i])>=4)?[2,-2]:[4,qn(e=Mn())];case 1:return r=n.sent(),null==t||t(),"number"==typeof r?[2,r]:r.length===e.length?[2,-3]:r.length>1?[2,jn(r)]:1===r.length?[2,r[0]]:[2,-1]}var i;}))}))}function Fn(){var e,n,t,r=((t=new Promise((function(t,r){e=t,n=r;}))).resolve=e,t.reject=n,t),i=R(isDesktopSafari()?310:410);return I(Promise.race([r,i]).then((function(e){if(void 0!==e)return R(e+100-Date.now())})).then((function(){return -4})),(function(){return Un((function(){return r.resolve(Date.now())}))}))}var Vn=["brands","mobile","platform","platformVersion","architecture","bitness","model","uaFullVersion"];function Bn(){var t;return __awaiter(this,void 0,void 0,(function(){var r,i,o,a=this;return __generator(this,(function(u){switch(u.label){case 0:return (r=navigator.userAgentData)&&"object"==typeof r?(i={},o=[],"function"!=typeof r.getHighEntropyValues?[3,2]:[4,Promise.all(Vn.map((function(t){return __awaiter(a,void 0,void 0,(function(){var e,a;return __generator(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,r.getHighEntropyValues([t])];case 1:return void 0!==(e=n.sent()[t])&&(i[t]="string"==typeof e?e:JSON.stringify(e)),[3,3];case 2:if("NotAllowedError"!==(a=n.sent()).name)throw a;return o.push(t),[3,3];case 3:return [2]}}))}))})))]):[2,void 0];case 1:u.sent(),u.label=2;case 2:return [2,{b:r.brands.map((function(e){return {b:e.brand,v:e.version}})),m:r.mobile,p:null!==(t=r.platform)&&void 0!==t?t:null,h:i,nah:o}]}}))}))}function Gn(){var e=document.createElement("a").attributionsourceid;return void 0===e?void 0:String(e)}function Wn(){return function(e){for(var n,t,r=[],i=e;;)try{var o=null===(n=i.location)||void 0===n?void 0:n.href,a=null===(t=i.document)||void 0===t?void 0:t.referrer;if(void 0===o||void 0===a)return {s:1,v:r};r.push({l:o,f:a});var u=i.parent;if(!u||u===i)return {s:0,v:r};i=u;}catch(s){if($n(s))return {s:1,v:r};throw s}}(window)}function $n(e){if(!e||"object"!=typeof e)return !1;var n=e;return !(!isTrident()&&!isEdgeHTML()||"Error"!==n.name&&"TypeError"!==n.name||"Permission denied"!==n.message)||"SecurityError"===n.name}function Kn(){return function(e){var n=e.location,t=e.origin,r=n.origin,i=n.ancestorOrigins,o=null;if(i){o=new Array(i.length);for(var a=0;a<i.length;++a)o[a]=i[a];}return {w:null==t?null:t,l:null==r?null:r,a:o}}(window)}function Hn(){return eval.toString().length}function Xn(){var t=this;return I(b(250,-2),(function(){return __awaiter(t,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:return (null==(e=navigator.mediaDevices)?void 0:e.enumerateDevices)?[4,e.enumerateDevices()]:[2,-1];case 1:return [2,n.sent().map((function(e){return {d:e.deviceId,g:e.groupId,k:e.kind,l:e.label}}))]}}))}))}))}function Jn(){return navigator.webdriver}function zn(){var e;return null!==(e=navigator.doNotTrack)&&void 0!==e?e:void 0}function Yn(){var e;return null!==(e=window.devicePixelRatio)&&void 0!==e?e:void 0}function Qn(){var t=this;return I(b(75,-3),(function(){return __awaiter(t,void 0,void 0,(function(){var e,t,r,i;return __generator(this,(function(n){switch(n.label){case 0:if(!(e=navigator).requestMediaKeySystemAccess)return [2,-1];n.label=1;case 1:return n.trys.push([1,6,,7]),[4,e.requestMediaKeySystemAccess("org.w3.clearkey",[{initDataTypes:["keyids","webm"],audioCapabilities:["opus","vorbis"].map((function(e){return {contentType:'audio/webm; codecs="'+e+'"'}})),videoCapabilities:["vp9","vp8"].map((function(e){return {contentType:'video/webm; codecs="'+e+'"'}}))}])];case 2:return [4,n.sent().createMediaKeys()];case 3:return t=n.sent(),(r=t.createSession()).sessionId?[3,5]:[4,new Promise((function(e){r.onmessage=e,r.generateRequest("webm",new Uint8Array([1,1,1,1]));}))];case 4:n.sent(),n.label=5;case 5:return [2,r.sessionId];case 6:if("NotSupportedError"===(i=n.sent()).name)return [2,-2];throw i;case 7:return [2]}}))}))}))}function Zn(){var e=window.WebAssembly;if(null==e?void 0:e.validate){for(var n=[0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10],t=0,r=0,o=[[9,1,7,0,65,0,253,15,26,11,0,10,4,110,97,109,101,2,3,1,0,0],[240,67,0,0,0,12,1,10,0,252,2,3,1,1,0,0,110,26,11,161,10],[6,1,4,0,18,0,11,0,10,4,110,97,109,101,2,3,1,0,0],[8,1,6,0,65,0,192,26,11,0,10,4,110,97,109,101,2,3,1,0,0],[7,1,5,0,208,112,26,11,0,10,4,110,97,109,101,2,3,1,0,0]];r<o.length;r++){var a=o[r];t<<=1,t|=e.validate(Uint8Array.of.apply(Uint8Array,__spreadArrays(n,a)))?1:0;}return t}}function et(){for(var e=[],n=Math.random(),t=24575;t>=0;--t)if(t%4096==0){var r=Math.random();e.push((n-r)*Math.pow(2,31)|0),n=r;}return e}function nt(){var t;return __awaiter(this,void 0,void 0,(function(){var r,i,o,a,u,s,c=this;return __generator(this,(function(l){switch(l.label){case 0:if(!(r=null===(t=window.crypto)||void 0===t?void 0:t.subtle)||!r.generateKey||!r.exportKey)return [2,-1];i=function(){return __awaiter(c,void 0,void 0,(function(){var e,t;return __generator(this,(function(n){switch(n.label){case 0:return [4,r.generateKey({name:"AES-GCM",length:128},!0,["encrypt"])];case 1:return e=n.sent(),[4,r.exportKey("raw",e)];case 2:return t=n.sent(),[2,new Uint8Array(t)]}}))}))},l.label=1;case 1:return l.trys.push([1,3,,4]),[4,Promise.all([i(),i()])];case 2:for(o=l.sent(),a=new Uint8Array(o[0].length),u=0;u<o[0].length;++u)a[u]=165^o[0][u]^o[1][u];return [2,j(a)];case 3:if("NotSupportedError"===(s=l.sent()).name)return [2,-2];throw s;case 4:return [2]}}))}))}function tt(i){var o=this,a=i.delayFallback,b=__rest(i,["delayFallback"]),y=loadSources(function(){var e;return (e={})[0]=ln,e[1]=Fn,e}(),b,[]),w=prepareForSources(a).then((function(){sources.screenFrame;var e=__rest(sources,["screenFrame"]);return loadSources(__assign(__assign(__assign({},function(){var e;return (e={})[2]=Cn,e[3]=dn,e[4]=un,e[5]=getScreenFrame,e[8]=Xn,e[7]=nt,e[6]=Qn,e[9]=Bn,e[10]=Zn,e[11]=zn,e[12]=cn,e[13]=hn,e[14]=mn,e[15]=et,e[16]=bn,e[17]=yn,e[18]=Dn,e[19]=Yn,e[20]=isTrident,e[21]=isEdgeHTML,e[22]=isChromium,e[23]=isWebKit,e[24]=isDesktopSafari,e[25]=isGecko,e[26]=isAndroid,e[27]=Gn,e[28]=te,e[29]=Wn,e[30]=Kn,e[31]=Hn,e[32]=Jn,e}()),e),function(){var e;return (e={}).j=_n,e}()),b,[])}));return function(){return __awaiter(o,void 0,void 0,(function(){var e,r,i;return __generator(this,(function(n){switch(n.label){case 0:return [4,Promise.all([y(),w.then((function(e){return e()}))])];case 1:return e=n.sent(),r=e[0],i=e[1],[2,__assign(__assign({},r),i)]}}))}))}}function rt(e){for(var n=e+"=",t=0,r=document.cookie.split(";");t<r.length;t++){for(var i=r[t],o=0;" "===i[o]&&o<i.length;)++o;if(i.indexOf(n)===o)return i.slice(o+n.length)}}function it(e,n,t,r){var i=e+"="+n,o="expires="+new Date(Date.now()+24*t*60*60*1e3).toUTCString(),a=r?"domain="+r:"";document.cookie=[i,"path=/",o,a,"SameSite=Lax"].join("; ");}function ot(e,n,t){var r=location.hostname;(at(r,(function(n){!function(e,n){it(e,"",-1,n);}(e,n);})),t<0)||at(r,(function(r){return it(e,n,t,r),rt(e)!==n}))&&it(e,n,t);}function at(e,n){var t=e.length;do{if(t=t>0?e.lastIndexOf(".",t-1):-1,!1===n(e.slice(t+1)))return !1}while(t>=0);return !0}function ut(e,n){ot(n,e,365),function(e,n){var t;try{null===(t=null===localStorage||void 0===localStorage?void 0:localStorage.setItem)||void 0===t||t.call(localStorage,e,n);}catch(r){}}(n,e);}function st(e){var n,t;try{return null!==(t=null===(n=null===localStorage||void 0===localStorage?void 0:localStorage.getItem)||void 0===n?void 0:n.call(localStorage,e))&&void 0!==t?t:void 0}catch(r){}}function ct(e,n,t,r,i){if(!n){var o=function(e,n){return n||(Object.prototype.hasOwnProperty.call(Re,e)||(e="us"),"https://tls-"+Re[e]+".fpapi.io")}(e,t);return Y(i,(function(){return {e:6,endpoint:o}})),[Te(o,r,i),Date.now()]}}function lt(r,i,o,a,u,s,c,l){var f=this,d=function(t,r,i,l,d,g,m){return __awaiter(f,void 0,void 0,(function(){var e,f,p,b,y,w,E,T,S;return __generator(this,(function(n){switch(n.label){case 0:return e=R(l).then((function(){throw new Error("Client timeout")})),[4,Promise.race([e,Promise.all([h(m),v(l,i,m)])])];case 1:return f=n.sent(),p=f[0],b=f[1],w=function(e){return [rt(e),st(e)]}(y=c+"_t"),[4,Qe({apiKey:o,endpoint:Ye(a,u),components:p,customComponent:g,tag:t,visitorToken:w,tls:b,linkedId:r,extendedResult:d,algorithm:s},e,m)];case 2:return E=n.sent(),T=E[0],(S=E[1])&&ut(S,y),[2,T]}}))}))},v=function(t,r,o){return __awaiter(f,void 0,void 0,(function(){var e,a,u,s,c;return __generator(this,(function(n){switch(n.label){case 0:if(!i||r)return [2,void 0];e=i[0],a=i[1],u=Math.min(Math.max(.1*t,a+1e4-Date.now()),.4*t),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,e(R(u))];case 2:return s=n.sent(),Y(o,(function(){return {e:7,result:s}})),[2,{value:s}];case 3:return c=n.sent(),Y(o,(function(){return {e:8,error:c}})),[2,{error:c}];case 4:return [2]}}))}))},h=function(t){return __awaiter(f,void 0,void 0,(function(){var e,i;return __generator(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,r()];case 1:return e=n.sent(),Y(t,(function(){return {e:13,result:e}})),[2,e];case 2:throw i=n.sent(),Y(t,(function(){return {e:14,error:i}})),i;case 3:return [2]}}))}))};return {get:function(e){void 0===e&&(e={});var n=l&&function(e,n){return function(r){return e(__assign(__assign({},r),{getCallId:n}))}}(l,V(8));return Q(n,(function(){return {e:3,options:e}}),(function(e){return {e:4,result:e}}),(function(e){return {e:5,error:e}}),(function(){var t=e.timeout,r=void 0===t?1e4:t,i=e.tag,o=e.linkedId,a=e.disableTls,u=e.extendedResult,s=e.environment;return d(i,U(o),a,r,u,s,n)}))}}}function ft(e,n,r){var i,o=G([null==r?void 0:r.debug,(i=/{(.*?)}/.exec(location.hash),!!i&&1915004642===function(e){for(var n=0,t=0;t<e.length;++t)n=(n<<5)-n+e.charCodeAt(t)|0;return n}(i[1])&&H())]),a=o&&function(e,n){return function(r){return e(__assign(__assign({},r),{agentId:n}))}}(o,V(8));return Q(a,(function(){return {e:0,version:"3.5.7",options:r}}),(function(){return {e:1}}),(function(e){return {e:2,error:e}}),(function(){var t=r.token,i=r.apiKey,o=void 0===i?t:i,u=r.region,s=void 0===u?"us":u,c=r.tlsEndpoint,l=r.disableTls,f=r.storageKey,d=void 0===f?"_vid":f,v=r.endpoint,h=r.delayFallback,g=r.algorithm;if(!o||"string"!=typeof o)throw new Error("Token required");var m=ct(s,l,c,n,a);return Y(a,(function(){return {e:12}})),lt(e({delayFallback:h,storageKeyPrefix:d}),m,o,s,v,U(g),d,a)}))}var dt=function(e){return ft(tt,void 0,e)},It={load:dt,ERROR_CLIENT_TIMEOUT:"Client timeout",ERROR_NETWORK_CONNECTION:"Network connection error",ERROR_NETWORK_ABORT:"Network request aborted",ERROR_WRONG_REGION:qe,ERROR_SUBSCRIPTION_NOT_ACTIVE:je,ERROR_API_KEY_MISSING:"Token required",ERROR_API_KEY_INVALID:"Token not found",ERROR_API_KEY_EXPIRED:"Token expired",ERROR_BAD_REQUEST_FORMAT:"Request cannot be parsed",ERROR_BAD_RESPONSE_FORMAT:"Response cannot be parsed",ERROR_GENERAL_SERVER_FAILURE:"Request failed",ERROR_SERVER_TIMEOUT:"Request failed to process",ERROR_RATE_LIMIT:"Too many requests, rate limit exceeded",ERROR_FORBIDDEN_ORIGIN:"Not available for this origin",ERROR_FORBIDDEN_HEADER:"Not available with restricted header",ERROR_UNSUPPORTED_VERSION:Me,ERROR_TOKEN_MISSING:"Token required",ERROR_TOKEN_INVALID:"Token not found",ERROR_TOKEN_EXPIRED:"Token expired"};
9191
+ function n(e,t){return function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t)?e[t]:void 0}function o(e){for(var t="",r=0;r<e.length;++r)if(r>0){var n=e[r].toLowerCase();n!==e[r]?t+=" "+n:t+=e[r];}else t+=e[r].toUpperCase();return t}var i={default:"endpoint"},u={default:"tlsEndpoint"},l=/*#__PURE__*/o("WrongRegion"),f=/*#__PURE__*/o("SubscriptionNotActive"),E=/*#__PURE__*/o("UnsupportedVersion"),p=/*#__PURE__*/o("InstallationMethodRestricted"),_=/*#__PURE__*/o("HostnameRestricted");function k(t,r){var n=[];return function(t,r){var n=5,o=(d=t,s=__spreadArrays(d),{current:function(){return s[0]},postpone:function(){var e=s.shift();void 0!==e&&s.push(e);},exclude:function(){s.shift();}}),i=(a=100,R=3e3,c=0,function(){return Math.random()*Math.min(R,a*Math.pow(2,c++))}),u=o.current();var a,R,c;var d,s;if(void 0===u)return Promise.reject(new TypeError("The list of script URL patterns is empty"));var l=function(e,t){return r(e).catch((function(e){if(t+1>=n)throw e;!function(e){if(!(e instanceof Error))return !1;var t=e.message;return "Blocked by CSP"===t||"9319"===t}(e)?o.postpone():o.exclude();var r,u=o.current();if(void 0===u)throw e;return (r=i(),new Promise((function(e){return setTimeout(e,r)}))).then((function(){return l(u,t+1)}))}))};return l(u,0)}(t,(function(e){var t=new Date,o=function(){return n.push({url:e,startedAt:t,finishedAt:new Date})},i=r(e);return i.then(o,o),i})).then((function(e){return [e,{attempts:n}]}))}var b="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",D=b,C="Failed to load the JS script of the agent";function U(e){var o;e.scriptUrlPattern;var i=e.token,u=e.apiKey,a=void 0===u?i:u,R=__rest(e,["scriptUrlPattern","token","apiKey"]),c=null!==(o=n(e,"scriptUrlPattern"))&&void 0!==o?o:b;return Promise.resolve().then((function(){if(!a||"string"!=typeof a)throw new Error("API key required");return k(function(e,t){return (Array.isArray(e)?e:[e]).map((function(e){return function(e,t){var r=encodeURIComponent;return e.replace(/<[^<>]+>/g,(function(e){return "<version>"===e?"3":"<apiKey>"===e?r(t):"<loaderVersion>"===e?r("3.8.0"):e}))}(String(e),t)}))}(c,a),g).catch(q)})).then((function(e){var t=e[0],n=e[1];return t.load(__assign(__assign({},R),{ldi:n}))}))}function g(e){return function(e,t,r,n){var o,i=document,u="securitypolicyviolation",a=function(t){var r=new URL(e,location.href),n=t.blockedURI;n!==r.href&&n!==r.protocol.slice(0,-1)&&n!==r.origin||(o=t,R());};i.addEventListener(u,a);var R=function(){return i.removeEventListener(u,a)};return null==n||n.then(R,R),Promise.resolve().then(t).then((function(e){return R(),e}),(function(e){return new Promise((function(e){return setTimeout(e)})).then((function(){if(R(),o)return r(o);throw e}))}))}(e,(function(){return function(e){return new Promise((function(t,r){var n=document.createElement("script"),o=function(){var e;return null===(e=n.parentNode)||void 0===e?void 0:e.removeChild(n)},i=document.head||document.getElementsByTagName("head")[0];n.onload=function(){o(),t();},n.onerror=function(){o(),r(new Error(C));},n.async=!0,n.src=e,i.appendChild(n);}))}(e)}),(function(){throw new Error("Blocked by CSP")})).then(L)}function L(){var e=window,t="__fpjs_p_l_b",r=e[t];if(function(e,t){var r,n=null===(r=Object.getOwnPropertyDescriptor)||void 0===r?void 0:r.call(Object,e,t);(null==n?void 0:n.configurable)?delete e[t]:n&&!n.writable||(e[t]=void 0);}(e,t),"function"!=typeof(null==r?void 0:r.load))throw new Error("9319");return r}function q(e){throw e instanceof Error&&"9319"===e.message?new Error(C):e}var B={load:U,defaultScriptUrlPattern:D,ERROR_SCRIPT_LOAD_FAIL:C,ERROR_API_KEY_EXPIRED:"API key expired",ERROR_API_KEY_INVALID:"API key not found",ERROR_API_KEY_MISSING:"API key required",ERROR_BAD_REQUEST_FORMAT:"Request cannot be parsed",ERROR_BAD_RESPONSE_FORMAT:"Response cannot be parsed",ERROR_CLIENT_TIMEOUT:"Client timeout",ERROR_CSP_BLOCK:"Blocked by CSP",ERROR_FORBIDDEN_ENDPOINT:_,ERROR_FORBIDDEN_HEADER:"Not available with restricted header",ERROR_FORBIDDEN_ORIGIN:"Not available for this origin",ERROR_GENERAL_SERVER_FAILURE:"Request failed",ERROR_INSTALLATION_METHOD_RESTRICTED:p,ERROR_NETWORK_ABORT:"Network request aborted",ERROR_NETWORK_CONNECTION:"Network connection error",ERROR_RATE_LIMIT:"Too many requests, rate limit exceeded",ERROR_SERVER_TIMEOUT:"Request failed to process",ERROR_SUBSCRIPTION_NOT_ACTIVE:f,ERROR_TOKEN_EXPIRED:"API key expired",ERROR_TOKEN_INVALID:"API key not found",ERROR_TOKEN_MISSING:"API key required",ERROR_UNSUPPORTED_VERSION:E,ERROR_WRONG_REGION:l,defaultEndpoint:i,defaultTlsEndpoint:u};
11598
9192
 
11599
9193
  const reg = /fnapi\d*/;
11600
9194
  // const reg = /(?<=https:\/\/)\w+(?=(\.\w+\.\w+))/
@@ -11603,7 +9197,7 @@ const getDeviceToken = async ({ fpToken, sentry, apiURL }) => {
11603
9197
  let dt, endpoint;
11604
9198
  try {
11605
9199
  endpoint = apiURL.replace(reg, 'fp');
11606
- const fp = await It.load({ apiKey: fpToken, endpoint });
9200
+ const fp = await B.load({ apiKey: fpToken, endpoint });
11607
9201
  const result = await fp.get({ timeout: 30000 });
11608
9202
  dt = result.visitorId;
11609
9203
 
@@ -11899,306 +9493,107 @@ function auth (request) {
11899
9493
  storage.set(accountPhoneKey, `${context.loginData.phone}`, {
11900
9494
  path: '/',
11901
9495
  maxAge: 60 * 60 * 24 * 7,
11902
- });
11903
- storage.set(phoneCountryCode, `${context.countryAbbr}_${context.loginData.countryCode}`, {
11904
- path: '/',
11905
- maxAge: 60 * 60 * 24 * 7,
11906
- });
11907
- } else if (context.loginData.email) {
11908
- storage.remove(accountPhoneKey);
11909
- storage.remove(phoneCountryCode);
11910
- storage.set(accountEmailKey, context.loginData.email, {
11911
- path: '/',
11912
- maxAge: 60 * 60 * 24 * 7,
11913
- });
11914
- }
11915
- }),
11916
- removeToken: assign((context, event) => {
11917
- storage.remove(tokenKey, {
11918
- path: '/',
11919
- maxAge: 300,
11920
- });
11921
- return { token: null }
11922
- }),
11923
- extendToken: assign((context, event) => {
11924
- const token = storage.get(tokenKey);
11925
- storage.set(tokenKey, token, {
11926
- path: '/',
11927
- maxAge: 300,
11928
- });
11929
- return { token }
11930
- }),
11931
- redirectTo3Party: async (context, event) => {
11932
- const { provider, channel, subchannel, affiliate } = event.data;
11933
-
11934
- const dt = await getDeviceToken({ fpToken, sentry, apiURL: request.config.apiURL });
11935
- sentry.setTag('dt', dt);
11936
-
11937
- const referralCode = storage.get('referralCode');
11938
- const messages = {
11939
- url: window.location.href,
11940
- channelOrders: [
11941
- { channel: storage.get('channel'), subchannel: storage.get('subchannel') },
11942
- { channel: defaultChannel, subchannel: defaultSubchannel },
11943
- { channel: channel, subchannel: subchannel },
11944
- ],
11945
- referralCode
11946
- };
11947
- sentry.captureMessage(JSON.stringify(messages));
11948
-
11949
- const referralObj = {};
11950
- if (referralCode) {
11951
- referralObj.referralCode = referralCode;
11952
- } else {
11953
- referralObj.channel = storage.get('channel') || defaultChannel || channel,
11954
- referralObj.subchannel = storage.get('subchannel') || defaultSubchannel || subchannel;
11955
- }
11956
-
11957
- const redirectURL = urljoin(
11958
- request.config.fullURL,
11959
- 'login?' +
11960
- new URLSearchParams({
11961
- provider,
11962
- redirectURI: `${window.location.protocol}//${window.location.host}${context.base}`,
11963
- ...referralObj,
11964
- // dt,
11965
- platform: 'pwa',
11966
- affiliate,
11967
- }).toString()
11968
- );
11969
-
11970
- window.location.href = redirectURL;
11971
- },
11972
- setUserInfo: assign((context, event) => {
11973
- sentry.setUser({ id: event.data.uid_site });
11974
- return {
11975
- userInfo: event.data,
11976
- }
11977
- }),
11978
- setPlay: assign((context, event) => {
11979
- return {
11980
- isPlaying: event.data,
11981
- }
11982
- }),
11983
- },
11984
- services: {
11985
- authenticateApp: async (context, event) => {
11986
- const { token } = await request.send(auth$1.loginApp(event.data));
11987
- return token
11988
- },
11989
- authenticate: async (context, event) => {
11990
- const data = { ...context.loginData, reCaptchaToken: context.reCaptchaToken };
11991
- const { token } = await request.send(auth$1.login(data));
11992
- return token
11993
- },
11994
- authenticateGuest: async (context, event) => {
11995
- const { token } = await request.send(auth$1.guestLogin());
11996
- return token
11997
- },
11998
- logout: async (context, event) => {
11999
- return await request.send(auth$1.logout())
12000
- },
12001
- fetchUserInfo: async (context, event) => {
12002
- return await request.send(user.getUserInfo())
12003
- },
12004
- },
12005
- }
12006
- )
12007
- }
12008
-
12009
- function auth_otp (request) {
12010
- return createMachine(
12011
- {
12012
- id: 'auth_otp',
12013
- initial: 'fetching',
12014
- context: {
12015
- userInfo: null,
12016
- error: null,
12017
- countryCode: null,
12018
- phone: null,
12019
- number: null,
12020
- requestId: null,
12021
- ttl: 0,
12022
- },
12023
- states: {
12024
- fetching: {
12025
- invoke: {
12026
- src: 'fetchUserInfo',
12027
- onDone: {
12028
- target: 'checking',
12029
- actions: 'setUserInfo',
12030
- },
12031
- onError: {
12032
- target: 'fail',
12033
- },
12034
- },
12035
- },
12036
- checking: {
12037
- always: [
12038
- { target: 'verified', cond: 'isVerified' },
12039
- { target: 'notVerified', cond: 'isNotVerified' },
12040
- ],
12041
- },
12042
- notVerified: {
12043
- initial: 'checkingStatus',
12044
- states: {
12045
- checkingStatus: {
12046
- invoke: {
12047
- src: 'verify',
12048
- onDone: {
12049
- target: 'otp',
12050
- actions: 'setVerificationData',
12051
- },
12052
- onError: {
12053
- target: 'errorChecking',
12054
- actions: 'setError',
12055
- },
12056
- },
12057
- },
12058
- errorChecking: {
12059
- always: [{ target: 'phone', cond: 'hasNoPhone' }, { target: '#auth_otp.fail' }],
12060
- },
12061
- phone: {
12062
- on: {
12063
- SEND_PHONE: {
12064
- target: 'sendingPhone',
12065
- actions: 'setPhone',
12066
- },
12067
- },
12068
- },
12069
- sendingPhone: {
12070
- invoke: {
12071
- src: 'sendPhone',
12072
- onDone: {
12073
- target: 'checkingStatus',
12074
- },
12075
- onError: { target: 'phone' },
12076
- },
12077
- },
12078
- otp: {
12079
- type: 'parallel',
12080
- states: {
12081
- countdown: {
12082
- after: {
12083
- 1000: {
12084
- target: 'countdown',
12085
- actions: 'decreaseTtl',
12086
- cond: (context) => context.ttl > 0,
12087
- },
12088
- },
12089
- },
12090
- verification: {
12091
- initial: 'idle',
12092
- states: {
12093
- idle: {
12094
- on: {
12095
- SEND_OTP: {
12096
- target: 'acknowledging',
12097
- },
12098
- RESET_OTP: {
12099
- target: 'reset',
12100
- },
12101
- RESEND_PHONE: {
12102
- target: '#auth_otp.notVerified.phone',
12103
- },
12104
- },
12105
- },
12106
- acknowledging: {
12107
- invoke: {
12108
- src: 'acknowledge',
12109
- onDone: {
12110
- target: '#auth_otp.verified',
12111
- },
12112
- onError: {
12113
- target: 'idle',
12114
- },
12115
- },
12116
- },
12117
- reset: {
12118
- invoke: {
12119
- src: 'resetOtp',
12120
- onDone: {
12121
- target: 'idle',
12122
- actions: 'setVerificationData',
12123
- },
12124
- onError: { target: 'idle' },
12125
- },
12126
- },
12127
- },
12128
- },
12129
- },
12130
- },
12131
- },
12132
- },
12133
- verified: {},
12134
- fail: {},
12135
- },
12136
- },
12137
- {
12138
- actions: {
12139
- setUserInfo: assign((context, event) => {
12140
- return {
12141
- userInfo: event.data,
9496
+ });
9497
+ storage.set(phoneCountryCode, `${context.countryAbbr}_${context.loginData.countryCode}`, {
9498
+ path: '/',
9499
+ maxAge: 60 * 60 * 24 * 7,
9500
+ });
9501
+ } else if (context.loginData.email) {
9502
+ storage.remove(accountPhoneKey);
9503
+ storage.remove(phoneCountryCode);
9504
+ storage.set(accountEmailKey, context.loginData.email, {
9505
+ path: '/',
9506
+ maxAge: 60 * 60 * 24 * 7,
9507
+ });
12142
9508
  }
12143
9509
  }),
12144
- setVerificationData: assign((context, event) => {
12145
- const { number, requestId, ttl } = event.data;
12146
- return {
12147
- number,
12148
- requestId,
12149
- ttl,
12150
- }
9510
+ removeToken: assign((context, event) => {
9511
+ storage.remove(tokenKey, {
9512
+ path: '/',
9513
+ maxAge: 300,
9514
+ });
9515
+ return { token: null }
12151
9516
  }),
12152
- decreaseTtl: assign((context, evnet) => {
12153
- const ms = context.ttl;
12154
- return {
12155
- ttl: Math.max(ms - 1000, 0),
12156
- }
9517
+ extendToken: assign((context, event) => {
9518
+ const token = storage.get(tokenKey);
9519
+ storage.set(tokenKey, token, {
9520
+ path: '/',
9521
+ maxAge: 300,
9522
+ });
9523
+ return { token }
12157
9524
  }),
12158
- setError: assign((context, event) => {
9525
+ redirectTo3Party: async (context, event) => {
9526
+ const { provider, channel, subchannel, affiliate } = event.data;
9527
+
9528
+ const dt = await getDeviceToken({ fpToken, sentry, apiURL: request.config.apiURL });
9529
+ sentry.setTag('dt', dt);
9530
+
9531
+ const referralCode = storage.get('referralCode');
9532
+ const messages = {
9533
+ url: window.location.href,
9534
+ channelOrders: [
9535
+ { channel: storage.get('channel'), subchannel: storage.get('subchannel') },
9536
+ { channel: defaultChannel, subchannel: defaultSubchannel },
9537
+ { channel: channel, subchannel: subchannel },
9538
+ ],
9539
+ referralCode
9540
+ };
9541
+ sentry.captureMessage(JSON.stringify(messages));
9542
+
9543
+ const referralObj = {};
9544
+ if (referralCode) {
9545
+ referralObj.referralCode = referralCode;
9546
+ } else {
9547
+ referralObj.channel = storage.get('channel') || defaultChannel || channel,
9548
+ referralObj.subchannel = storage.get('subchannel') || defaultSubchannel || subchannel;
9549
+ }
9550
+
9551
+ const redirectURL = urljoin(
9552
+ request.config.fullURL,
9553
+ 'login?' +
9554
+ new URLSearchParams({
9555
+ provider,
9556
+ redirectURI: `${window.location.protocol}//${window.location.host}${context.base}`,
9557
+ ...referralObj,
9558
+ // dt,
9559
+ platform: 'pwa',
9560
+ affiliate,
9561
+ }).toString()
9562
+ );
9563
+
9564
+ window.location.href = redirectURL;
9565
+ },
9566
+ setUserInfo: assign((context, event) => {
9567
+ sentry.setUser({ id: event.data.uid_site });
12159
9568
  return {
12160
- error: event.data,
9569
+ userInfo: event.data,
12161
9570
  }
12162
9571
  }),
12163
- setPhone: assign((context, event) => {
12164
- const { countryCode, phone } = event.data;
9572
+ setPlay: assign((context, event) => {
12165
9573
  return {
12166
- countryCode,
12167
- phone,
9574
+ isPlaying: event.data,
12168
9575
  }
12169
9576
  }),
12170
9577
  },
12171
- guards: {
12172
- isVerified: (context, event) => {
12173
- return context.userInfo?.verification_status === 1
12174
- },
12175
- isNotVerified: (context, event) => {
12176
- return context.userInfo && context.userInfo.verification_status !== 1
12177
- },
12178
- hasNoPhone: (context, event) => {
12179
- const { error } = context;
12180
- return error.code === 'ERR_F106'
12181
- },
12182
- },
12183
9578
  services: {
12184
- fetchUserInfo: async (context, event) => {
12185
- return await request.send(user.getUserInfo())
9579
+ authenticateApp: async (context, event) => {
9580
+ const { token } = await request.send(auth$1.loginApp(event.data));
9581
+ return token
12186
9582
  },
12187
- verify: async (context, event) => {
12188
- return await request.send(user.verify())
9583
+ authenticate: async (context, event) => {
9584
+ const data = { ...context.loginData, reCaptchaToken: context.reCaptchaToken };
9585
+ const { token } = await request.send(auth$1.login(data));
9586
+ return token
12189
9587
  },
12190
- sendPhone: async (context, event) => {
12191
- const { countryCode, phone } = context;
12192
- return await request.send(user.updateUserInfo({ countryCode, phone }))
9588
+ authenticateGuest: async (context, event) => {
9589
+ const { token } = await request.send(auth$1.guestLogin());
9590
+ return token
12193
9591
  },
12194
- resetOtp: async (context, event) => {
12195
- const { requestId, number } = context;
12196
- return await request.send(user.resetOtp({ requestId, number }))
9592
+ logout: async (context, event) => {
9593
+ return await request.send(auth$1.logout())
12197
9594
  },
12198
- acknowledge: async (context, event) => {
12199
- const { requestId } = context;
12200
- const code = event.data;
12201
- return await request.send(user.acknowledge({ requestId, code }))
9595
+ fetchUserInfo: async (context, event) => {
9596
+ return await request.send(user.getUserInfo())
12202
9597
  },
12203
9598
  },
12204
9599
  }
@@ -17097,8 +14492,6 @@ function findLastIndex(array, predicate, fromIndex) {
17097
14492
 
17098
14493
  var findLastIndex_1 = findLastIndex;
17099
14494
 
17100
- // const findLastIndex = require('lodash/findLastIndex')
17101
-
17102
14495
  function withdraw_vn (request) {
17103
14496
  const { appSecret } = request.config;
17104
14497
  return createMachine(
@@ -17127,6 +14520,12 @@ function withdraw_vn (request) {
17127
14520
 
17128
14521
  withdrawDistance: null,
17129
14522
  withdrawAmount: null,
14523
+
14524
+ // otp
14525
+ requestId: null,
14526
+ status: null,
14527
+ target: null,
14528
+ ttl: null,
17130
14529
  },
17131
14530
  states: {
17132
14531
  loading: {
@@ -17173,9 +14572,14 @@ function withdraw_vn (request) {
17173
14572
  converting: {
17174
14573
  invoke: {
17175
14574
  src: 'submitWithdrawFree',
17176
- onDone: {
17177
- target: 'converted',
17178
- },
14575
+ onDone: [
14576
+ {
14577
+ target: '#withdraw_vn.otp',
14578
+ actions: 'setOtp',
14579
+ cond: 'isOtpRequired',
14580
+ },
14581
+ { target: 'converted' },
14582
+ ],
17179
14583
  onError: {
17180
14584
  target: 'convertible',
17181
14585
  },
@@ -17225,9 +14629,16 @@ function withdraw_vn (request) {
17225
14629
  submitting: {
17226
14630
  invoke: {
17227
14631
  src: 'submitWithdraw',
17228
- onDone: {
17229
- target: 'submitted',
17230
- },
14632
+ onDone: [
14633
+ {
14634
+ target: '#withdraw_vn.otp',
14635
+ actions: 'setOtp',
14636
+ cond: 'isOtpRequired',
14637
+ },
14638
+ {
14639
+ target: 'submitted',
14640
+ },
14641
+ ],
17231
14642
  onError: {
17232
14643
  target: 'withdrawable',
17233
14644
  },
@@ -17241,6 +14652,7 @@ function withdraw_vn (request) {
17241
14652
  invoke: {
17242
14653
  src: 'fetchPaymentData',
17243
14654
  onDone: {
14655
+ target: 'inProcessing',
17244
14656
  actions: 'setPaymentData',
17245
14657
  },
17246
14658
  onError: {
@@ -17250,6 +14662,71 @@ function withdraw_vn (request) {
17250
14662
  },
17251
14663
  },
17252
14664
  },
14665
+ otp: {
14666
+ type: 'parallel',
14667
+ states: {
14668
+ countdown: {
14669
+ after: {
14670
+ 1000: {
14671
+ target: 'countdown',
14672
+ actions: 'decreaseTtl',
14673
+ cond: (context) => context.ttl > 0,
14674
+ },
14675
+ },
14676
+ },
14677
+ verification: {
14678
+ initial: 'idle',
14679
+ states: {
14680
+ idle: {
14681
+ on: {
14682
+ ACKNOWLEDGE: {
14683
+ target: 'acknowledging',
14684
+ },
14685
+ RESET_OTP: {
14686
+ target: 'reset',
14687
+ },
14688
+ BACK: [
14689
+ {
14690
+ target: '#withdraw_vn.free.convertible',
14691
+ cond: 'isFree',
14692
+ },
14693
+ {
14694
+ target: '#withdraw_vn.cash.withdrawable',
14695
+ },
14696
+ ],
14697
+ },
14698
+ },
14699
+ acknowledging: {
14700
+ invoke: {
14701
+ src: 'acknowledge',
14702
+ onDone: [
14703
+ {
14704
+ target: '#withdraw_vn.free.converted',
14705
+ cond: 'isFree',
14706
+ },
14707
+ {
14708
+ target: '#withdraw_vn.cash.submitted',
14709
+ },
14710
+ ],
14711
+ onError: {
14712
+ target: 'idle',
14713
+ },
14714
+ },
14715
+ },
14716
+ reset: {
14717
+ invoke: {
14718
+ src: 'resetOtp',
14719
+ onDone: {
14720
+ target: 'idle',
14721
+ actions: 'setVerificationData',
14722
+ },
14723
+ onError: { target: 'idle' },
14724
+ },
14725
+ },
14726
+ },
14727
+ },
14728
+ },
14729
+ },
17253
14730
  fail: {},
17254
14731
  },
17255
14732
  on: {
@@ -17316,6 +14793,29 @@ function withdraw_vn (request) {
17316
14793
  availableWithdrawAmount,
17317
14794
  }
17318
14795
  }),
14796
+ setOtp: assign((context, event) => {
14797
+ const { requestId, status, target, ttl } = event.data;
14798
+ return {
14799
+ requestId,
14800
+ status,
14801
+ target,
14802
+ ttl,
14803
+ }
14804
+ }),
14805
+ decreaseTtl: assign((context, evnet) => {
14806
+ const second = context.ttl;
14807
+ return {
14808
+ ttl: Math.max(second - 1, 0),
14809
+ }
14810
+ }),
14811
+ setVerificationData: assign((context, event) => {
14812
+ const { requestId, ttl, target } = event.data;
14813
+ return {
14814
+ requestId,
14815
+ ttl,
14816
+ target,
14817
+ }
14818
+ }),
17319
14819
  },
17320
14820
  guards: {
17321
14821
  isFree: (context, event) => {
@@ -17345,6 +14845,9 @@ function withdraw_vn (request) {
17345
14845
  const minWithdrawAmount = paymentDetail[0]?.minimum || 0;
17346
14846
  return withdrawLimit !== 0 || balance < minWithdrawAmount
17347
14847
  },
14848
+ isOtpRequired: (context, event) => {
14849
+ return event.data?.status === 'otp-verifying'
14850
+ },
17348
14851
  },
17349
14852
  services: {
17350
14853
  fetchInitData: async (context, event) => {
@@ -17392,13 +14895,20 @@ function withdraw_vn (request) {
17392
14895
  submitWithdrawFree: async (context, event) => {
17393
14896
  return await request.send(payment.convertFreeCredit({ exchangeType: 1 }))
17394
14897
  },
14898
+ resetOtp: async (context, event) => {
14899
+ const { requestId, target } = context;
14900
+ return await request.send(user.otpReset({ requestId, target }))
14901
+ },
14902
+ acknowledge: async (context, event) => {
14903
+ const { requestId, target } = context;
14904
+ const code = event.data;
14905
+ return await request.send(user.otpAcknowledge({ requestId, target, code }))
14906
+ },
17395
14907
  },
17396
14908
  }
17397
14909
  )
17398
14910
  }
17399
14911
 
17400
- // const findLastIndex = require('lodash/findLastIndex')
17401
-
17402
14912
  function withdraw_crypto (request) {
17403
14913
  const { appSecret } = request.config;
17404
14914
  return createMachine(
@@ -17426,6 +14936,12 @@ function withdraw_crypto (request) {
17426
14936
 
17427
14937
  charge: null,
17428
14938
  realAmount: null,
14939
+
14940
+ // otp
14941
+ requestId: null,
14942
+ status: null,
14943
+ target: null,
14944
+ ttl: null,
17429
14945
  },
17430
14946
  states: {
17431
14947
  loading: {
@@ -17472,9 +14988,13 @@ function withdraw_crypto (request) {
17472
14988
  converting: {
17473
14989
  invoke: {
17474
14990
  src: 'submitWithdrawFree',
17475
- onDone: {
17476
- target: 'converted',
17477
- },
14991
+ onDone: [{
14992
+ target: '#withdraw_crypto.otp',
14993
+ actions: 'setOtp',
14994
+ cond: 'isOtpRequired'
14995
+ }, {
14996
+ target: 'converted',
14997
+ }],
17478
14998
  onError: {
17479
14999
  target: 'convertible',
17480
15000
  },
@@ -17542,10 +15062,13 @@ function withdraw_crypto (request) {
17542
15062
  submitting: {
17543
15063
  invoke: {
17544
15064
  src: 'submitWithdraw',
17545
- onDone: {
15065
+ onDone: [{
15066
+ target: '#withdraw_crypto.otp',
15067
+ actions: 'setOtp',
15068
+ cond: 'isOtpRequired'
15069
+ }, {
17546
15070
  target: 'submitted',
17547
- actions: 'setResult',
17548
- },
15071
+ }],
17549
15072
  onError: {
17550
15073
  target: 'withdrawable',
17551
15074
  },
@@ -17554,6 +15077,65 @@ function withdraw_crypto (request) {
17554
15077
  submitted: {},
17555
15078
  },
17556
15079
  },
15080
+ otp: {
15081
+ type: 'parallel',
15082
+ states: {
15083
+ countdown: {
15084
+ after: {
15085
+ 1000: {
15086
+ target: 'countdown',
15087
+ actions: 'decreaseTtl',
15088
+ cond: (context) => context.ttl > 0,
15089
+ },
15090
+ },
15091
+ },
15092
+ verification: {
15093
+ initial: 'idle',
15094
+ states: {
15095
+ idle: {
15096
+ on: {
15097
+ ACKNOWLEDGE: {
15098
+ target: 'acknowledging',
15099
+ },
15100
+ RESET_OTP: {
15101
+ target: 'reset',
15102
+ },
15103
+ BACK: [{
15104
+ target: '#withdraw_crypto.free.convertible',
15105
+ cond: 'isFree'
15106
+ }, {
15107
+ target: '#withdraw_crypto.cash.submittable',
15108
+ }],
15109
+ },
15110
+ },
15111
+ acknowledging: {
15112
+ invoke: {
15113
+ src: 'acknowledge',
15114
+ onDone: [{
15115
+ target: '#withdraw_crypto.free.converted',
15116
+ cond: 'isFree'
15117
+ }, {
15118
+ target: '#withdraw_crypto.cash.submitted',
15119
+ }],
15120
+ onError: {
15121
+ target: 'idle',
15122
+ },
15123
+ },
15124
+ },
15125
+ reset: {
15126
+ invoke: {
15127
+ src: 'resetOtp',
15128
+ onDone: {
15129
+ target: 'idle',
15130
+ actions: 'setVerificationData',
15131
+ },
15132
+ onError: { target: 'idle' },
15133
+ },
15134
+ },
15135
+ },
15136
+ },
15137
+ },
15138
+ },
17557
15139
  fail: {},
17558
15140
  },
17559
15141
  on: {
@@ -17656,6 +15238,29 @@ function withdraw_crypto (request) {
17656
15238
  realAmount,
17657
15239
  }
17658
15240
  }),
15241
+ setOtp: assign((context, event) => {
15242
+ const { requestId, status, target, ttl } = event.data;
15243
+ return {
15244
+ requestId,
15245
+ status,
15246
+ target,
15247
+ ttl,
15248
+ }
15249
+ }),
15250
+ decreaseTtl: assign((context, evnet) => {
15251
+ const second = context.ttl;
15252
+ return {
15253
+ ttl: Math.max(second - 1, 0),
15254
+ }
15255
+ }),
15256
+ setVerificationData: assign((context, event) => {
15257
+ const { requestId, ttl, target } = event.data;
15258
+ return {
15259
+ requestId,
15260
+ ttl,
15261
+ target,
15262
+ }
15263
+ }),
17659
15264
  },
17660
15265
  guards: {
17661
15266
  isFree: (context, event) => {
@@ -17686,6 +15291,9 @@ function withdraw_crypto (request) {
17686
15291
  const { selectedNetwork, amount } = context;
17687
15292
  return selectedNetwork && amount
17688
15293
  },
15294
+ isOtpRequired: (context, event) => {
15295
+ return event.data?.status === 'otp-verifying'
15296
+ }
17689
15297
  },
17690
15298
  services: {
17691
15299
  fetchInitData: async (context, event) => {
@@ -17730,6 +15338,15 @@ function withdraw_crypto (request) {
17730
15338
  })
17731
15339
  )
17732
15340
  },
15341
+ resetOtp: async (context, event) => {
15342
+ const { requestId, target } = context;
15343
+ return await request.send(user.otpReset({ requestId, target }))
15344
+ },
15345
+ acknowledge: async (context, event) => {
15346
+ const { requestId, target } = context;
15347
+ const code = event.data;
15348
+ return await request.send(user.otpAcknowledge({ requestId, target, code }))
15349
+ },
17733
15350
  },
17734
15351
  }
17735
15352
  )
@@ -20575,7 +18192,7 @@ function auth_otp_v3 (request) {
20575
18192
  states: {
20576
18193
  idle: {
20577
18194
  on: {
20578
- SEND_OTP: {
18195
+ ACKNOWLEDGE: {
20579
18196
  target: 'acknowledging',
20580
18197
  },
20581
18198
  RESET_OTP: {
@@ -20763,7 +18380,6 @@ function vip_table (request) {
20763
18380
  var index$1 = {
20764
18381
  ...activity,
20765
18382
  auth,
20766
- auth_otp,
20767
18383
  welcome,
20768
18384
  common,
20769
18385
  deposit,