clarity-js 0.7.10 → 0.7.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/clarity.js CHANGED
@@ -47,6 +47,7 @@ var metadata$1 = /*#__PURE__*/Object.freeze({
47
47
  get id () { return id; },
48
48
  get metadata () { return metadata; },
49
49
  get save () { return save; },
50
+ get shortid () { return shortid; },
50
51
  get start () { return start$9; },
51
52
  get stop () { return stop$8; }
52
53
  });
@@ -140,7 +141,7 @@ function api(method) {
140
141
  }
141
142
 
142
143
  var startTime = 0;
143
- function start$G() {
144
+ function start$H() {
144
145
  startTime = performance.now();
145
146
  }
146
147
  function time(event) {
@@ -148,11 +149,11 @@ function time(event) {
148
149
  var ts = event && event.timeStamp > 0 ? event.timeStamp : performance.now();
149
150
  return Math.max(Math.round(ts - startTime), 0);
150
151
  }
151
- function stop$D() {
152
+ function stop$E() {
152
153
  startTime = 0;
153
154
  }
154
155
 
155
- var version$1 = "0.7.10";
156
+ var version$1 = "0.7.12";
156
157
 
157
158
  // tslint:disable: no-bitwise
158
159
  function hash (input, precision) {
@@ -353,18 +354,18 @@ function redact$1(value) {
353
354
  return array ? array.join("" /* Data.Constant.Empty */) : value;
354
355
  }
355
356
 
356
- var state$a = null;
357
+ var state$b = null;
357
358
  var buffer = null;
358
359
  var update$2 = false;
359
- function start$F() {
360
+ function start$G() {
360
361
  update$2 = false;
361
- reset$q();
362
+ reset$r();
362
363
  }
363
- function reset$q() {
364
+ function reset$r() {
364
365
  // Baseline state holds the previous values - if it is updated in the current payload,
365
366
  // reset the state to current value after sending the previous state
366
367
  if (update$2) {
367
- state$a = { time: time(), event: 4 /* Event.Baseline */, data: {
368
+ state$b = { time: time(), event: 4 /* Event.Baseline */, data: {
368
369
  visible: buffer.visible,
369
370
  docWidth: buffer.docWidth,
370
371
  docHeight: buffer.docHeight,
@@ -391,7 +392,7 @@ function reset$q() {
391
392
  activityTime: 0
392
393
  };
393
394
  }
394
- function track$7(event, x, y) {
395
+ function track$8(event, x, y) {
395
396
  switch (event) {
396
397
  case 8 /* Event.Document */:
397
398
  buffer.docWidth = x;
@@ -427,19 +428,19 @@ function compute$c() {
427
428
  encode$1(4 /* Event.Baseline */);
428
429
  }
429
430
  }
430
- function stop$C() {
431
- reset$q();
431
+ function stop$D() {
432
+ reset$r();
432
433
  }
433
434
 
434
435
  var baseline = /*#__PURE__*/Object.freeze({
435
436
  __proto__: null,
436
437
  activity: activity,
437
438
  compute: compute$c,
438
- reset: reset$q,
439
- start: start$F,
440
- get state () { return state$a; },
441
- stop: stop$C,
442
- track: track$7,
439
+ reset: reset$r,
440
+ start: start$G,
441
+ get state () { return state$b; },
442
+ stop: stop$D,
443
+ track: track$8,
443
444
  visibility: visibility
444
445
  });
445
446
 
@@ -459,12 +460,12 @@ function event(key, value) {
459
460
 
460
461
  var data$i = null;
461
462
  var updates$3 = null;
462
- function start$E() {
463
+ function start$F() {
463
464
  data$i = {};
464
465
  updates$3 = {};
465
466
  count$1(5 /* Metric.InvokeCount */);
466
467
  }
467
- function stop$B() {
468
+ function stop$C() {
468
469
  data$i = {};
469
470
  updates$3 = {};
470
471
  }
@@ -505,7 +506,7 @@ function max(metric, value) {
505
506
  function compute$b() {
506
507
  encode$1(0 /* Event.Metric */);
507
508
  }
508
- function reset$p() {
509
+ function reset$q() {
509
510
  updates$3 = {};
510
511
  }
511
512
 
@@ -520,11 +521,11 @@ var data$h;
520
521
  var last = 0;
521
522
  var interval = 0;
522
523
  var timeout$6 = null;
523
- function start$D() {
524
+ function start$E() {
524
525
  interval = 60000 /* Setting.PingInterval */;
525
526
  last = 0;
526
527
  }
527
- function reset$o() {
528
+ function reset$p() {
528
529
  if (timeout$6) {
529
530
  clearTimeout(timeout$6);
530
531
  }
@@ -542,7 +543,7 @@ function ping() {
542
543
  suspend();
543
544
  }
544
545
  }
545
- function stop$A() {
546
+ function stop$B() {
546
547
  clearTimeout(timeout$6);
547
548
  last = 0;
548
549
  interval = 0;
@@ -551,19 +552,19 @@ function stop$A() {
551
552
  var ping$1 = /*#__PURE__*/Object.freeze({
552
553
  __proto__: null,
553
554
  get data () { return data$h; },
554
- reset: reset$o,
555
- start: start$D,
556
- stop: stop$A
555
+ reset: reset$p,
556
+ start: start$E,
557
+ stop: stop$B
557
558
  });
558
559
 
559
560
  var data$g = null;
560
- function start$C() {
561
+ function start$D() {
561
562
  data$g = {};
562
563
  }
563
- function stop$z() {
564
+ function stop$A() {
564
565
  data$g = {};
565
566
  }
566
- function track$6(event, time) {
567
+ function track$7(event, time) {
567
568
  if (!(event in data$g)) {
568
569
  data$g[event] = [[time, 0]];
569
570
  }
@@ -583,7 +584,7 @@ function track$6(event, time) {
583
584
  function compute$a() {
584
585
  encode$1(36 /* Event.Summary */);
585
586
  }
586
- function reset$n() {
587
+ function reset$o() {
587
588
  data$g = {};
588
589
  }
589
590
 
@@ -591,14 +592,14 @@ var summary = /*#__PURE__*/Object.freeze({
591
592
  __proto__: null,
592
593
  compute: compute$a,
593
594
  get data () { return data$g; },
594
- reset: reset$n,
595
- start: start$C,
596
- stop: stop$z,
597
- track: track$6
595
+ reset: reset$o,
596
+ start: start$D,
597
+ stop: stop$A,
598
+ track: track$7
598
599
  });
599
600
 
600
601
  var data$f = null;
601
- function start$B() {
602
+ function start$C() {
602
603
  if (!config$1.lean && config$1.upgrade) {
603
604
  config$1.upgrade("Config" /* Constant.Config */);
604
605
  }
@@ -622,15 +623,15 @@ function upgrade(key) {
622
623
  encode$1(3 /* Event.Upgrade */);
623
624
  }
624
625
  }
625
- function stop$y() {
626
+ function stop$z() {
626
627
  data$f = null;
627
628
  }
628
629
 
629
630
  var upgrade$1 = /*#__PURE__*/Object.freeze({
630
631
  __proto__: null,
631
632
  get data () { return data$f; },
632
- start: start$B,
633
- stop: stop$y,
633
+ start: start$C,
634
+ stop: stop$z,
634
635
  upgrade: upgrade
635
636
  });
636
637
 
@@ -688,8 +689,8 @@ function __generator(thisArg, body) {
688
689
  }
689
690
 
690
691
  var data$e = null;
691
- function start$A() {
692
- reset$m();
692
+ function start$B() {
693
+ reset$n();
693
694
  }
694
695
  function set(variable, value) {
695
696
  var values = typeof value === "string" /* Constant.String */ ? [value] : value;
@@ -747,11 +748,11 @@ function log$2(variable, value) {
747
748
  function compute$9() {
748
749
  encode$1(34 /* Event.Variable */);
749
750
  }
750
- function reset$m() {
751
+ function reset$n() {
751
752
  data$e = {};
752
753
  }
753
- function stop$x() {
754
- reset$m();
754
+ function stop$y() {
755
+ reset$n();
755
756
  }
756
757
  function redact(input) {
757
758
  return input && input.length >= 5 /* Setting.WordLength */ ?
@@ -788,10 +789,10 @@ var variable = /*#__PURE__*/Object.freeze({
788
789
  compute: compute$9,
789
790
  get data () { return data$e; },
790
791
  identify: identify,
791
- reset: reset$m,
792
+ reset: reset$n,
792
793
  set: set,
793
- start: start$A,
794
- stop: stop$x
794
+ start: start$B,
795
+ stop: stop$y
795
796
  });
796
797
 
797
798
  var supported$1 = "CompressionStream" /* Constant.CompressionStream */ in window;
@@ -853,18 +854,18 @@ function read(stream) {
853
854
  }
854
855
 
855
856
  var modules$1 = [baseline, dimension, variable, limit, summary, metadata$1, envelope$1, upload$1, ping$1, upgrade$1, extract];
856
- function start$z() {
857
+ function start$A() {
857
858
  // Metric needs to be initialized before we can start measuring. so metric is not wrapped in measure
858
- start$E();
859
+ start$F();
859
860
  modules$1.forEach(function (x) { return measure(x.start)(); });
860
861
  }
861
- function stop$w() {
862
+ function stop$x() {
862
863
  // Stop modules in the reverse order of their initialization
863
864
  // The ordering below should respect inter-module dependency.
864
865
  // E.g. if upgrade depends on upload, then upgrade needs to end before upload.
865
866
  // Similarly, if upload depends on metadata, upload needs to end before metadata.
866
867
  modules$1.slice().reverse().forEach(function (x) { return measure(x.stop)(); });
867
- stop$B();
868
+ stop$C();
868
869
  }
869
870
  function compute$8() {
870
871
  compute$9();
@@ -878,7 +879,7 @@ function compute$8() {
878
879
 
879
880
  var history$5 = [];
880
881
  var data$d;
881
- function start$y() {
882
+ function start$z() {
882
883
  history$5 = [];
883
884
  max(26 /* Metric.Automation */, navigator.webdriver ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */);
884
885
  try {
@@ -902,7 +903,7 @@ function check$4(id, target, input) {
902
903
 
903
904
  var excludeClassNames = "load,active,fixed,visible,focus,show,collaps,animat" /* Constant.ExcludeClassNames */.split("," /* Constant.Comma */);
904
905
  var selectorMap = {};
905
- function reset$l() {
906
+ function reset$m() {
906
907
  selectorMap = {};
907
908
  }
908
909
  function get$1(input, type) {
@@ -991,7 +992,7 @@ function filter(value) {
991
992
  var selector = /*#__PURE__*/Object.freeze({
992
993
  __proto__: null,
993
994
  get: get$1,
994
- reset: reset$l
995
+ reset: reset$m
995
996
  });
996
997
 
997
998
  var index = 1;
@@ -1010,14 +1011,14 @@ var idMap = null; // Maps node => id.
1010
1011
  var iframeMap = null; // Maps iframe's contentDocument => parent iframe element
1011
1012
  var privacyMap = null; // Maps node => Privacy (enum)
1012
1013
  var fraudMap = null; // Maps node => FraudId (number)
1013
- function start$x() {
1014
- reset$k();
1014
+ function start$y() {
1015
+ reset$l();
1015
1016
  parse$1(document, true);
1016
1017
  }
1017
- function stop$v() {
1018
- reset$k();
1018
+ function stop$w() {
1019
+ reset$l();
1019
1020
  }
1020
- function reset$k() {
1021
+ function reset$l() {
1021
1022
  index = 1;
1022
1023
  nodes = [];
1023
1024
  values = [];
@@ -1033,7 +1034,7 @@ function reset$k() {
1033
1034
  iframeMap = new WeakMap();
1034
1035
  privacyMap = new WeakMap();
1035
1036
  fraudMap = new WeakMap();
1036
- reset$l();
1037
+ reset$m();
1037
1038
  }
1038
1039
  // We parse new root nodes for any regions or masked nodes in the beginning (document) and
1039
1040
  // later whenever there are new additions or modifications to DOM (mutations)
@@ -1106,7 +1107,7 @@ function add(node, parent, data, source) {
1106
1107
  privacy(node, values[id], parentValue);
1107
1108
  updateSelector(values[id]);
1108
1109
  size$1(values[id]);
1109
- track$5(id, source);
1110
+ track$6(id, source);
1110
1111
  }
1111
1112
  function update$1(node, parent, data, source) {
1112
1113
  var id = getId(node);
@@ -1156,7 +1157,7 @@ function update$1(node, parent, data, source) {
1156
1157
  }
1157
1158
  // Update selector
1158
1159
  updateSelector(value);
1159
- track$5(id, source, changed, parentChanged);
1160
+ track$6(id, source, changed, parentChanged);
1160
1161
  }
1161
1162
  }
1162
1163
  function sameorigin(node) {
@@ -1312,7 +1313,7 @@ function remove(id, source) {
1312
1313
  var value = values[id];
1313
1314
  value.metadata.active = false;
1314
1315
  value.parent = null;
1315
- track$5(id, source);
1316
+ track$6(id, source);
1316
1317
  }
1317
1318
  }
1318
1319
  function size$1(value) {
@@ -1331,7 +1332,7 @@ function getPreviousId(node) {
1331
1332
  }
1332
1333
  return id;
1333
1334
  }
1334
- function track$5(id, source, changed, parentChanged) {
1335
+ function track$6(id, source, changed, parentChanged) {
1335
1336
  if (changed === void 0) { changed = true; }
1336
1337
  if (parentChanged === void 0) { parentChanged = false; }
1337
1338
  // Keep track of the order in which mutations happened, they may not be sequential
@@ -1360,8 +1361,8 @@ var dom = /*#__PURE__*/Object.freeze({
1360
1361
  lookup: lookup,
1361
1362
  parse: parse$1,
1362
1363
  sameorigin: sameorigin,
1363
- start: start$x,
1364
- stop: stop$v,
1364
+ start: start$y,
1365
+ stop: stop$w,
1365
1366
  update: update$1,
1366
1367
  updates: updates$2
1367
1368
  });
@@ -1389,7 +1390,7 @@ function resume$1() {
1389
1390
  }
1390
1391
  }
1391
1392
  }
1392
- function reset$j() {
1393
+ function reset$k() {
1393
1394
  tracker = {};
1394
1395
  queuedTasks = [];
1395
1396
  activeTask = null;
@@ -1450,7 +1451,7 @@ function run() {
1450
1451
  });
1451
1452
  }
1452
1453
  }
1453
- function state$9(timer) {
1454
+ function state$a(timer) {
1454
1455
  var id = key(timer);
1455
1456
  if (id in tracker) {
1456
1457
  var elapsed = performance.now() - tracker[id].start;
@@ -1459,7 +1460,7 @@ function state$9(timer) {
1459
1460
  // If this task is no longer being tracked, send stop message to the caller
1460
1461
  return 2 /* Task.Stop */;
1461
1462
  }
1462
- function start$w(timer) {
1463
+ function start$x(timer) {
1463
1464
  tracker[key(timer)] = { start: performance.now(), calls: 0, yield: 30 /* Setting.LongTask */ };
1464
1465
  }
1465
1466
  function restart$2(timer) {
@@ -1467,12 +1468,12 @@ function restart$2(timer) {
1467
1468
  if (tracker && tracker[id]) {
1468
1469
  var c = tracker[id].calls;
1469
1470
  var y = tracker[id].yield;
1470
- start$w(timer);
1471
+ start$x(timer);
1471
1472
  tracker[id].calls = c + 1;
1472
1473
  tracker[id].yield = y;
1473
1474
  }
1474
1475
  }
1475
- function stop$u(timer) {
1476
+ function stop$v(timer) {
1476
1477
  var end = performance.now();
1477
1478
  var id = key(timer);
1478
1479
  var duration = end - tracker[id].start;
@@ -1492,7 +1493,7 @@ function suspend$1(timer) {
1492
1493
  case 0:
1493
1494
  id = key(timer);
1494
1495
  if (!(id in tracker)) return [3 /*break*/, 2];
1495
- stop$u(timer);
1496
+ stop$v(timer);
1496
1497
  _a = tracker[id];
1497
1498
  return [4 /*yield*/, wait()];
1498
1499
  case 1:
@@ -1532,8 +1533,8 @@ function wait() {
1532
1533
  // While it's not possible to build a perfect polyfill given the nature of this API, the following code attempts to get close.
1533
1534
  // Background context: requestAnimationFrame invokes the js code right before: style, layout and paint computation within the frame.
1534
1535
  // This means, that any code that runs as part of requestAnimationFrame will by default be blocking in nature. Not what we want.
1535
- // For non-blocking behavior, We need to know when browser has finished painiting. This can be accomplished in two different ways (hacks):
1536
- // (1) Use MessageChannel to pass the message, and browser will receive the message right after pain event has occured.
1536
+ // For non-blocking behavior, We need to know when browser has finished painting. This can be accomplished in two different ways (hacks):
1537
+ // (1) Use MessageChannel to pass the message, and browser will receive the message right after paint event has occured.
1537
1538
  // (2) Use setTimeout call within requestAnimationFrame. This also works, but there's a risk that browser may throttle setTimeout calls.
1538
1539
  // Given this information, we are currently using (1) from above. More information on (2) as well as some additional context is below:
1539
1540
  // https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Performance_best_practices_for_Firefox_fe_engineers
@@ -1605,11 +1606,11 @@ function tokenize (tokens) {
1605
1606
  }
1606
1607
 
1607
1608
  var data$c;
1608
- function reset$i() {
1609
+ function reset$j() {
1609
1610
  data$c = null;
1610
1611
  }
1611
- function start$v() {
1612
- reset$i();
1612
+ function start$w() {
1613
+ reset$j();
1613
1614
  compute$7();
1614
1615
  }
1615
1616
  function compute$7() {
@@ -1635,17 +1636,91 @@ function compute$7() {
1635
1636
  encode$4(8 /* Event.Document */);
1636
1637
  }
1637
1638
  }
1639
+ function stop$u() {
1640
+ reset$j();
1641
+ }
1642
+
1643
+ var state$9 = [];
1644
+ var animationPlay = null;
1645
+ var animationPause = null;
1646
+ var animationCancel = null;
1647
+ var animationFinish = null;
1648
+ var animationId = 'clarityAnimationId';
1649
+ var operationCount = 'clarityOperationCount';
1650
+ var maxOperations = 20;
1651
+ function start$v() {
1652
+ reset$i();
1653
+ overrideAnimationHelper(animationPlay, "play");
1654
+ overrideAnimationHelper(animationPause, "pause");
1655
+ overrideAnimationHelper(animationCancel, "cancel");
1656
+ overrideAnimationHelper(animationFinish, "finish");
1657
+ }
1658
+ function reset$i() {
1659
+ state$9 = [];
1660
+ }
1661
+ function track$5(time, id, operation, keyFrames, timing, targetId, timeline) {
1662
+ state$9.push({
1663
+ time: time,
1664
+ event: 44 /* Event.Animation */,
1665
+ data: {
1666
+ id: id,
1667
+ operation: operation,
1668
+ keyFrames: keyFrames,
1669
+ timing: timing,
1670
+ targetId: targetId,
1671
+ timeline: timeline
1672
+ }
1673
+ });
1674
+ encode$4(44 /* Event.Animation */);
1675
+ }
1638
1676
  function stop$t() {
1639
1677
  reset$i();
1678
+ }
1679
+ function overrideAnimationHelper(functionToOverride, name) {
1680
+ if (functionToOverride === null) {
1681
+ functionToOverride = Animation.prototype[name];
1682
+ Animation.prototype[name] = function () {
1683
+ if (active()) {
1684
+ if (!this[animationId]) {
1685
+ this[animationId] = shortid();
1686
+ this[operationCount] = 0;
1687
+ var keyframes = this.effect.getKeyframes();
1688
+ var timing = this.effect.getTiming();
1689
+ track$5(time(), this[animationId], 0 /* AnimationOperation.Create */, JSON.stringify(keyframes), JSON.stringify(timing), getId(this.effect.target));
1690
+ }
1691
+ if (this[operationCount]++ < maxOperations) {
1692
+ var operation = null;
1693
+ switch (name) {
1694
+ case "play":
1695
+ operation = 1 /* AnimationOperation.Play */;
1696
+ break;
1697
+ case "pause":
1698
+ operation = 2 /* AnimationOperation.Pause */;
1699
+ break;
1700
+ case "cancel":
1701
+ operation = 3 /* AnimationOperation.Cancel */;
1702
+ break;
1703
+ case "finish":
1704
+ operation = 4 /* AnimationOperation.Finish */;
1705
+ break;
1706
+ }
1707
+ if (operation) {
1708
+ track$5(time(), this[animationId], operation);
1709
+ }
1710
+ }
1711
+ }
1712
+ return functionToOverride.apply(this, arguments);
1713
+ };
1714
+ }
1640
1715
  }
1641
1716
 
1642
1717
  function encode$4 (type, timer, ts) {
1643
1718
  if (timer === void 0) { timer = null; }
1644
1719
  if (ts === void 0) { ts = null; }
1645
1720
  return __awaiter(this, void 0, void 0, function () {
1646
- var eventTime, tokens, _a, d, _i, _b, r, values, _c, values_1, value, state, data, active, suspend, privacy, mangle, keys, _d, keys_1, key, box, factor, attr;
1647
- return __generator(this, function (_e) {
1648
- switch (_e.label) {
1721
+ var eventTime, tokens, _a, d, _i, _b, r, _c, _d, entry, values, _e, values_1, value, state, data, active, suspend, privacy, mangle, keys, _f, keys_1, key, box, factor, attr;
1722
+ return __generator(this, function (_g) {
1723
+ switch (_g.label) {
1649
1724
  case 0:
1650
1725
  eventTime = ts || time();
1651
1726
  tokens = [eventTime, type];
@@ -1653,17 +1728,18 @@ function encode$4 (type, timer, ts) {
1653
1728
  switch (_a) {
1654
1729
  case 8 /* Event.Document */: return [3 /*break*/, 1];
1655
1730
  case 7 /* Event.Region */: return [3 /*break*/, 2];
1656
- case 5 /* Event.Discover */: return [3 /*break*/, 3];
1657
- case 6 /* Event.Mutation */: return [3 /*break*/, 3];
1731
+ case 44 /* Event.Animation */: return [3 /*break*/, 3];
1732
+ case 5 /* Event.Discover */: return [3 /*break*/, 4];
1733
+ case 6 /* Event.Mutation */: return [3 /*break*/, 4];
1658
1734
  }
1659
- return [3 /*break*/, 10];
1735
+ return [3 /*break*/, 11];
1660
1736
  case 1:
1661
1737
  d = data$c;
1662
1738
  tokens.push(d.width);
1663
1739
  tokens.push(d.height);
1664
- track$7(type, d.width, d.height);
1740
+ track$8(type, d.width, d.height);
1665
1741
  queue(tokens);
1666
- return [3 /*break*/, 10];
1742
+ return [3 /*break*/, 11];
1667
1743
  case 2:
1668
1744
  for (_i = 0, _b = state$8; _i < _b.length; _i++) {
1669
1745
  r = _b[_i];
@@ -1675,28 +1751,42 @@ function encode$4 (type, timer, ts) {
1675
1751
  queue(tokens);
1676
1752
  }
1677
1753
  reset$h();
1678
- return [3 /*break*/, 10];
1754
+ return [3 /*break*/, 11];
1679
1755
  case 3:
1756
+ for (_c = 0, _d = state$9; _c < _d.length; _c++) {
1757
+ entry = _d[_c];
1758
+ tokens = [entry.time, entry.event];
1759
+ tokens.push(entry.data.id);
1760
+ tokens.push(entry.data.operation);
1761
+ tokens.push(entry.data.keyFrames);
1762
+ tokens.push(entry.data.timing);
1763
+ tokens.push(entry.data.timeline);
1764
+ tokens.push(entry.data.targetId);
1765
+ queue(tokens);
1766
+ }
1767
+ reset$i();
1768
+ return [3 /*break*/, 11];
1769
+ case 4:
1680
1770
  // Check if we are operating within the context of the current page
1681
- if (state$9(timer) === 2 /* Task.Stop */) {
1682
- return [3 /*break*/, 10];
1771
+ if (state$a(timer) === 2 /* Task.Stop */) {
1772
+ return [3 /*break*/, 11];
1683
1773
  }
1684
1774
  values = updates$2();
1685
- if (!(values.length > 0)) return [3 /*break*/, 9];
1686
- _c = 0, values_1 = values;
1687
- _e.label = 4;
1688
- case 4:
1689
- if (!(_c < values_1.length)) return [3 /*break*/, 8];
1690
- value = values_1[_c];
1691
- state = state$9(timer);
1692
- if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 6];
1693
- return [4 /*yield*/, suspend$1(timer)];
1775
+ if (!(values.length > 0)) return [3 /*break*/, 10];
1776
+ _e = 0, values_1 = values;
1777
+ _g.label = 5;
1694
1778
  case 5:
1695
- state = _e.sent();
1696
- _e.label = 6;
1779
+ if (!(_e < values_1.length)) return [3 /*break*/, 9];
1780
+ value = values_1[_e];
1781
+ state = state$a(timer);
1782
+ if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 7];
1783
+ return [4 /*yield*/, suspend$1(timer)];
1697
1784
  case 6:
1785
+ state = _g.sent();
1786
+ _g.label = 7;
1787
+ case 7:
1698
1788
  if (state === 2 /* Task.Stop */) {
1699
- return [3 /*break*/, 8];
1789
+ return [3 /*break*/, 9];
1700
1790
  }
1701
1791
  data = value.data;
1702
1792
  active = value.metadata.active;
@@ -1704,8 +1794,8 @@ function encode$4 (type, timer, ts) {
1704
1794
  privacy = value.metadata.privacy;
1705
1795
  mangle = shouldMangle(value);
1706
1796
  keys = active ? ["tag", "attributes", "value"] : ["tag"];
1707
- for (_d = 0, keys_1 = keys; _d < keys_1.length; _d++) {
1708
- key = keys_1[_d];
1797
+ for (_f = 0, keys_1 = keys; _f < keys_1.length; _f++) {
1798
+ key = keys_1[_f];
1709
1799
  if (data[key]) {
1710
1800
  switch (key) {
1711
1801
  case "tag":
@@ -1737,18 +1827,18 @@ function encode$4 (type, timer, ts) {
1737
1827
  }
1738
1828
  }
1739
1829
  }
1740
- _e.label = 7;
1741
- case 7:
1742
- _c++;
1743
- return [3 /*break*/, 4];
1830
+ _g.label = 8;
1744
1831
  case 8:
1832
+ _e++;
1833
+ return [3 /*break*/, 5];
1834
+ case 9:
1745
1835
  if (type === 6 /* Event.Mutation */) {
1746
1836
  activity(eventTime);
1747
1837
  }
1748
1838
  queue(tokenize(tokens), !config$1.lean);
1749
- _e.label = 9;
1750
- case 9: return [3 /*break*/, 10];
1751
- case 10: return [2 /*return*/];
1839
+ _g.label = 10;
1840
+ case 10: return [3 /*break*/, 11];
1841
+ case 11: return [2 /*return*/];
1752
1842
  }
1753
1843
  });
1754
1844
  });
@@ -1931,7 +2021,7 @@ function recompute$8(evt) {
1931
2021
  var element = target(evt);
1932
2022
  if (element) {
1933
2023
  var value = element.value;
1934
- var checksum = value && value.length >= 5 /* Setting.WordLength */ && config$1.fraud ? hash(value, 24 /* Setting.ChecksumPrecision */) : "" /* Constant.Empty */;
2024
+ var checksum = value && value.length >= 5 /* Setting.WordLength */ && config$1.fraud && "password,secret,pass,social,ssn,code,hidden" /* Mask.Exclude */.indexOf(element.type) === -1 ? hash(value, 24 /* Setting.ChecksumPrecision */) : "" /* Constant.Empty */;
1935
2025
  state$7.push({ time: time(evt), event: 42 /* Event.Change */, data: { target: target(evt), type: element.type, value: value, checksum: checksum } });
1936
2026
  schedule$1(encode$3.bind(this, 42 /* Event.Change */));
1937
2027
  }
@@ -2593,8 +2683,8 @@ function processNode (node, source) {
2593
2683
  var styleSheet = adoptedStyleSheets_1[_i];
2594
2684
  style += getCssRules(styleSheet);
2595
2685
  }
2596
- var fragementData = { tag: "*S" /* Constant.ShadowDomTag */, attributes: { style: style } };
2597
- dom[call](node, shadowRoot.host, fragementData, source);
2686
+ var fragmentData = { tag: "*S" /* Constant.ShadowDomTag */, attributes: { style: style } };
2687
+ dom[call](node, shadowRoot.host, fragmentData, source);
2598
2688
  }
2599
2689
  else {
2600
2690
  // If the browser doesn't support shadow DOM natively, we detect that, and send appropriate tag back.
@@ -2779,7 +2869,7 @@ function traverse (root, timer, source) {
2779
2869
  queue.push(next);
2780
2870
  next = next.nextSibling;
2781
2871
  }
2782
- state = state$9(timer);
2872
+ state = state$a(timer);
2783
2873
  if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 3];
2784
2874
  return [4 /*yield*/, suspend$1(timer)];
2785
2875
  case 2:
@@ -2902,7 +2992,7 @@ function active$2() {
2902
2992
  function handle$1(m) {
2903
2993
  // Queue up mutation records for asynchronous processing
2904
2994
  var now = time();
2905
- track$6(6 /* Event.Mutation */, now);
2995
+ track$7(6 /* Event.Mutation */, now);
2906
2996
  mutations.push({ time: now, mutations: m });
2907
2997
  schedule$1(process$1, 1 /* Priority.High */).then(function () {
2908
2998
  setTimeout(compute$7);
@@ -2916,7 +3006,7 @@ function process$1() {
2916
3006
  switch (_b.label) {
2917
3007
  case 0:
2918
3008
  timer = { id: id(), cost: 3 /* Metric.LayoutCost */ };
2919
- start$w(timer);
3009
+ start$x(timer);
2920
3010
  _b.label = 1;
2921
3011
  case 1:
2922
3012
  if (!(mutations.length > 0)) return [3 /*break*/, 8];
@@ -2927,7 +3017,7 @@ function process$1() {
2927
3017
  case 2:
2928
3018
  if (!(_i < _a.length)) return [3 /*break*/, 6];
2929
3019
  mutation = _a[_i];
2930
- state = state$9(timer);
3020
+ state = state$a(timer);
2931
3021
  if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 4];
2932
3022
  return [4 /*yield*/, suspend$1(timer)];
2933
3023
  case 3:
@@ -2972,7 +3062,7 @@ function process$1() {
2972
3062
  _b.sent();
2973
3063
  return [3 /*break*/, 1];
2974
3064
  case 8:
2975
- stop$u(timer);
3065
+ stop$v(timer);
2976
3066
  return [2 /*return*/];
2977
3067
  }
2978
3068
  });
@@ -3035,7 +3125,7 @@ function processNodeList(list, source, timer) {
3035
3125
  traverse(list[i], timer, source);
3036
3126
  return [3 /*break*/, 5];
3037
3127
  case 2:
3038
- state = state$9(timer);
3128
+ state = state$a(timer);
3039
3129
  if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 4];
3040
3130
  return [4 /*yield*/, suspend$1(timer)];
3041
3131
  case 3:
@@ -3152,7 +3242,7 @@ function encode$3 (type, ts) {
3152
3242
  tokens.push(entry.data.x);
3153
3243
  tokens.push(entry.data.y);
3154
3244
  queue(tokens);
3155
- track$7(entry.event, entry.data.x, entry.data.y);
3245
+ track$8(entry.event, entry.data.x, entry.data.y);
3156
3246
  }
3157
3247
  }
3158
3248
  reset$c();
@@ -3197,7 +3287,7 @@ function encode$3 (type, ts) {
3197
3287
  r = data$b;
3198
3288
  tokens.push(r.width);
3199
3289
  tokens.push(r.height);
3200
- track$7(type, r.width, r.height);
3290
+ track$8(type, r.width, r.height);
3201
3291
  reset$b();
3202
3292
  queue(tokens);
3203
3293
  break;
@@ -3241,7 +3331,7 @@ function encode$3 (type, ts) {
3241
3331
  tokens.push(entry.data.x);
3242
3332
  tokens.push(entry.data.y);
3243
3333
  queue(tokens);
3244
- track$7(entry.event, entry.data.x, entry.data.y);
3334
+ track$8(entry.event, entry.data.x, entry.data.y);
3245
3335
  }
3246
3336
  }
3247
3337
  reset$a();
@@ -3328,7 +3418,7 @@ function track$2(time, event, hash, x, y, reaction, context) {
3328
3418
  // Since timeline only keeps the data for configured time, we still want to continue tracking these values
3329
3419
  // as part of the baseline. For instance, in a scenario where last scroll happened 5s ago.
3330
3420
  // We would still need to capture the last scroll position as part of the baseline event, even when timeline will be empty.
3331
- track$7(event, x, y);
3421
+ track$8(event, x, y);
3332
3422
  }
3333
3423
  function compute$5() {
3334
3424
  var temp = [];
@@ -3405,7 +3495,7 @@ function queue(tokens, transmit) {
3405
3495
  // We enrich the data going out with the existing upload. In these cases, call to upload comes with 'transmit' set to false.
3406
3496
  if (transmit && timeout === null) {
3407
3497
  if (type !== 25 /* Event.Ping */) {
3408
- reset$o();
3498
+ reset$p();
3409
3499
  }
3410
3500
  timeout = setTimeout(upload, gap);
3411
3501
  queuedTime = now;
@@ -3909,7 +3999,7 @@ function encode$1 (event) {
3909
3999
  var tokens = [t, event];
3910
4000
  switch (event) {
3911
4001
  case 4 /* Event.Baseline */:
3912
- var b = state$a;
4002
+ var b = state$b;
3913
4003
  if (b) {
3914
4004
  tokens = [b.time, b.event];
3915
4005
  tokens.push(b.data.visible);
@@ -3924,7 +4014,7 @@ function encode$1 (event) {
3924
4014
  tokens.push(b.data.activityTime);
3925
4015
  queue(tokens, false);
3926
4016
  }
3927
- reset$q();
4017
+ reset$r();
3928
4018
  break;
3929
4019
  case 25 /* Event.Ping */:
3930
4020
  tokens.push(data$h.gap);
@@ -3957,7 +4047,7 @@ function encode$1 (event) {
3957
4047
  tokens.push(v);
3958
4048
  tokens.push(data$e[v]);
3959
4049
  }
3960
- reset$m();
4050
+ reset$n();
3961
4051
  queue(tokens, false);
3962
4052
  }
3963
4053
  break;
@@ -3972,7 +4062,7 @@ function encode$1 (event) {
3972
4062
  // However, for data over the wire, we round it off to milliseconds precision.
3973
4063
  tokens.push(Math.round(updates$3[m]));
3974
4064
  }
3975
- reset$p();
4065
+ reset$q();
3976
4066
  queue(tokens, false);
3977
4067
  }
3978
4068
  break;
@@ -3998,7 +4088,7 @@ function encode$1 (event) {
3998
4088
  tokens.push(key);
3999
4089
  tokens.push([].concat.apply([], data$g[e]));
4000
4090
  }
4001
- reset$n();
4091
+ reset$o();
4002
4092
  queue(tokens, false);
4003
4093
  }
4004
4094
  break;
@@ -4532,8 +4622,8 @@ function stop$6() {
4532
4622
  var status = false;
4533
4623
  function start$6() {
4534
4624
  status = true;
4535
- start$G();
4536
- reset$j();
4625
+ start$H();
4626
+ reset$k();
4537
4627
  reset$1();
4538
4628
  reset$2();
4539
4629
  start$7();
@@ -4542,8 +4632,8 @@ function stop$5() {
4542
4632
  stop$6();
4543
4633
  reset$2();
4544
4634
  reset$1();
4545
- reset$j();
4546
- stop$D();
4635
+ reset$k();
4636
+ stop$E();
4547
4637
  status = false;
4548
4638
  }
4549
4639
  function active() {
@@ -4597,7 +4687,7 @@ function restart() {
4597
4687
  }
4598
4688
 
4599
4689
  function start$5() {
4600
- start$y();
4690
+ start$z();
4601
4691
  start$e();
4602
4692
  start$d();
4603
4693
  }
@@ -4625,14 +4715,14 @@ function discover() {
4625
4715
  case 0:
4626
4716
  ts = time();
4627
4717
  timer = { id: id(), cost: 3 /* Metric.LayoutCost */ };
4628
- start$w(timer);
4718
+ start$x(timer);
4629
4719
  return [4 /*yield*/, traverse(document, timer, 0 /* Source.Discover */)];
4630
4720
  case 1:
4631
4721
  _a.sent();
4632
4722
  return [4 /*yield*/, encode$4(5 /* Event.Discover */, timer, ts)];
4633
4723
  case 2:
4634
4724
  _a.sent();
4635
- stop$u(timer);
4725
+ stop$v(timer);
4636
4726
  return [2 /*return*/];
4637
4727
  }
4638
4728
  });
@@ -4642,16 +4732,18 @@ function discover() {
4642
4732
  function start$3() {
4643
4733
  // The order below is important
4644
4734
  // and is determined by interdependencies of modules
4645
- start$v();
4735
+ start$w();
4646
4736
  start$u();
4647
- start$x();
4737
+ start$y();
4648
4738
  start$h();
4649
4739
  start$4();
4740
+ start$v();
4650
4741
  }
4651
4742
  function stop$3() {
4652
4743
  stop$s();
4653
- stop$v();
4744
+ stop$w();
4654
4745
  stop$f();
4746
+ stop$u();
4655
4747
  stop$t();
4656
4748
  }
4657
4749
 
@@ -4846,7 +4938,7 @@ function start(config$1) {
4846
4938
  if (check()) {
4847
4939
  config(config$1);
4848
4940
  start$6();
4849
- start$z();
4941
+ start$A();
4850
4942
  modules.forEach(function (x) { return measure(x.start)(); });
4851
4943
  // If it's an internal call to start, without explicit configuration,
4852
4944
  // re-process any newly accumulated items in the queue
@@ -4877,7 +4969,7 @@ function stop() {
4877
4969
  if (active()) {
4878
4970
  // Stop modules in the reverse order of their initialization and start queuing up items again
4879
4971
  modules.slice().reverse().forEach(function (x) { return measure(x.stop)(); });
4880
- stop$w();
4972
+ stop$x();
4881
4973
  stop$5();
4882
4974
  setup();
4883
4975
  }