@gemx-dev/clarity-js 0.8.46 → 0.8.48

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.
@@ -13,43 +13,53 @@ var dom = /*#__PURE__*/Object.freeze({
13
13
  get parse () { return parse; },
14
14
  get removeIFrame () { return removeIFrame; },
15
15
  get sameorigin () { return sameorigin; },
16
- get start () { return start$k; },
17
- get stop () { return stop$i; },
16
+ get start () { return start$l; },
17
+ get stop () { return stop$j; },
18
18
  get update () { return update; },
19
19
  get updates () { return updates$2; }
20
20
  });
21
21
  var upload$1 = /*#__PURE__*/Object.freeze({
22
22
  __proto__: null,
23
23
  get queue () { return queue; },
24
- get start () { return start$g; },
25
- get stop () { return stop$e; },
24
+ get start () { return start$h; },
25
+ get stop () { return stop$f; },
26
26
  get track () { return track$1; }
27
27
  });
28
28
  var upgrade$1 = /*#__PURE__*/Object.freeze({
29
29
  __proto__: null,
30
- get data () { return data$5; },
31
- get start () { return start$b; },
32
- get stop () { return stop$b; },
30
+ get data () { return data$6; },
31
+ get start () { return start$c; },
32
+ get stop () { return stop$c; },
33
33
  get upgrade () { return upgrade; }
34
34
  });
35
35
  var limit = /*#__PURE__*/Object.freeze({
36
36
  __proto__: null,
37
37
  get check () { return check$2; },
38
+ get compute () { return compute$4; },
39
+ get data () { return data$5; },
40
+ get start () { return start$b; },
41
+ get stop () { return stop$b; },
42
+ get trigger () { return trigger; }
43
+ });
44
+ var dimension = /*#__PURE__*/Object.freeze({
45
+ __proto__: null,
38
46
  get compute () { return compute$3; },
39
47
  get data () { return data$4; },
48
+ get log () { return log; },
49
+ get reset () { return reset$3; },
40
50
  get start () { return start$a; },
41
51
  get stop () { return stop$a; },
42
- get trigger () { return trigger; }
52
+ get updates () { return updates; }
43
53
  });
44
- var dimension = /*#__PURE__*/Object.freeze({
54
+ var consent$2 = /*#__PURE__*/Object.freeze({
45
55
  __proto__: null,
46
56
  get compute () { return compute$2; },
57
+ get config () { return config$1; },
58
+ get consent () { return consent$1; },
47
59
  get data () { return data$3; },
48
- get log () { return log; },
49
- get reset () { return reset$3; },
50
60
  get start () { return start$9; },
51
61
  get stop () { return stop$9; },
52
- get updates () { return updates; }
62
+ get trackConsentv2 () { return trackConsentv2; }
53
63
  });
54
64
  var metadata$1 = /*#__PURE__*/Object.freeze({
55
65
  __proto__: null,
@@ -102,7 +112,7 @@ var clarity = /*#__PURE__*/Object.freeze({
102
112
  var w = window;
103
113
  var c = "clarityGemX" /* Constant.Clarity */;
104
114
  function setup() {
105
- // Start queuing up calls while Clarity is inactive and we are in a browser enviornment
115
+ // Start queuing up calls while Clarity is inactive and we are in a browser enviornment
106
116
  if (typeof w !== "undefined") {
107
117
  w[c] = function () {
108
118
  (w[c].q = w[c].q || []).push(arguments);
@@ -174,7 +184,7 @@ var startTime = 0;
174
184
  function computeStartTime() {
175
185
  return performance.now() + performance.timeOrigin;
176
186
  }
177
- function start$M() {
187
+ function start$N() {
178
188
  startTime = computeStartTime();
179
189
  }
180
190
  // event.timestamp is number of milliseconds elapsed since the document was loaded
@@ -190,11 +200,11 @@ function time(event) {
190
200
  var origin = event && event.view ? event.view.performance.timeOrigin : performance.timeOrigin;
191
201
  return Math.max(Math.round(ts + origin - baseline), 0);
192
202
  }
193
- function stop$J() {
203
+ function stop$K() {
194
204
  startTime = 0;
195
205
  }
196
206
 
197
- var version$1 = "0.8.42";
207
+ var version$1 = "0.8.48";
198
208
 
199
209
  // tslint:disable: no-bitwise
200
210
  function hash (input, precision) {
@@ -254,6 +264,8 @@ function text$1(value, hint, privacy, mangle, type) {
254
264
  case "srcset":
255
265
  case "title":
256
266
  case "alt":
267
+ case "href":
268
+ case "xlink:href":
257
269
  if (privacy === 3 /* Privacy.TextImage */) {
258
270
  if (hint === 'src' && (value === null || value === void 0 ? void 0 : value.startsWith('blob:'))) {
259
271
  return 'blob:';
@@ -415,7 +427,7 @@ function redact$1(value) {
415
427
  var state$b = null;
416
428
  var buffer = null;
417
429
  var update$2 = false;
418
- function start$L() {
430
+ function start$M() {
419
431
  update$2 = false;
420
432
  reset$u();
421
433
  }
@@ -558,7 +570,7 @@ function compute$g() {
558
570
  encode$1(4 /* Event.Baseline */);
559
571
  }
560
572
  }
561
- function stop$I() {
573
+ function stop$J() {
562
574
  reset$u();
563
575
  }
564
576
 
@@ -568,86 +580,14 @@ var baseline = /*#__PURE__*/Object.freeze({
568
580
  compute: compute$g,
569
581
  dynamic: dynamic$1,
570
582
  reset: reset$u,
571
- start: start$L,
583
+ start: start$M,
572
584
  get state () { return state$b; },
573
- stop: stop$I,
585
+ stop: stop$J,
574
586
  track: track$8,
575
587
  visibility: visibility
576
588
  });
577
589
 
578
590
  var data$l = null;
579
- var updateConsent = true;
580
- function start$K() {
581
- var _a;
582
- var ics = (_a = window.google_tag_data) === null || _a === void 0 ? void 0 : _a.ics;
583
- updateConsent = true;
584
- if (ics === null || ics === void 0 ? void 0 : ics.addListener) {
585
- ics.addListener(["ad_storage" /* Constant.AdStorage */, "analytics_storage" /* Constant.AnalyticsStorage */], processConsent);
586
- }
587
- }
588
- function stop$H() {
589
- updateConsent = true;
590
- }
591
- function processConsent() {
592
- var _a;
593
- var ics = (_a = window.google_tag_data) === null || _a === void 0 ? void 0 : _a.ics;
594
- if (!(ics === null || ics === void 0 ? void 0 : ics.getConsentState)) {
595
- return;
596
- }
597
- var analytics_storage = ics.getConsentState("analytics_storage" /* Constant.AnalyticsStorage */);
598
- var ad_storage = ics.getConsentState("ad_storage" /* Constant.AdStorage */);
599
- var consentState = getConsentState({ ad_Storage: ad_storage, analytics_Storage: analytics_storage });
600
- consentv2(consentState, 2 /* ConsentSource.GCM */);
601
- }
602
- function getConsentState(googleConsent) {
603
- var consentState = {
604
- ad_Storage: googleConsent.ad_Storage === 1 /* GCMConsent.Granted */ ? "granted" /* Constant.Granted */ : "denied" /* Constant.Denied */,
605
- analytics_Storage: googleConsent.analytics_Storage === 1 /* GCMConsent.Granted */ ? "granted" /* Constant.Granted */ : "denied" /* Constant.Denied */,
606
- };
607
- return consentState;
608
- }
609
- function config$1(consent) {
610
- trackConsent(consent.analytics_Storage ? 1 /* ConsentType.Implicit */ : 0 /* ConsentType.None */);
611
- data$l = consent;
612
- }
613
- // When we get consent signal as false, we restart the service and track config as false.
614
- function consent$1() {
615
- trackConsent(2 /* ConsentType.General */);
616
- }
617
- function trackConsent(consent) {
618
- log(36 /* Dimension.Consent */, consent.toString());
619
- }
620
- function trackConsentv2(consent) {
621
- data$l = consent;
622
- encode$1(47 /* Event.Consent */);
623
- }
624
- // Compute function is called every upload, but we only want to send consent data once.
625
- function compute$f() {
626
- var _a;
627
- if (updateConsent) {
628
- encode$1(47 /* Event.Consent */);
629
- updateConsent = false;
630
- if (!config$2.track) {
631
- var ics = (_a = window.google_tag_data) === null || _a === void 0 ? void 0 : _a.ics;
632
- if (ics === null || ics === void 0 ? void 0 : ics.usedUpdate) {
633
- processConsent();
634
- }
635
- }
636
- }
637
- }
638
-
639
- var consent$2 = /*#__PURE__*/Object.freeze({
640
- __proto__: null,
641
- compute: compute$f,
642
- config: config$1,
643
- consent: consent$1,
644
- get data () { return data$l; },
645
- start: start$K,
646
- stop: stop$H,
647
- trackConsentv2: trackConsentv2
648
- });
649
-
650
- var data$k = null;
651
591
  // custom events allow 2 parameters or 1 parameter to be passed. If 2 are passed we
652
592
  // consider it a key value pair. If only 1 is passed we only consider the event to have a value.
653
593
  function event$1(a, b) {
@@ -656,61 +596,61 @@ function event$1(a, b) {
656
596
  typeof a === "string" /* Constant.String */ &&
657
597
  a.length < 255) {
658
598
  if (b && typeof b === "string" /* Constant.String */ && b.length < 255) {
659
- data$k = { key: a, value: b };
599
+ data$l = { key: a, value: b };
660
600
  }
661
601
  else {
662
- data$k = { value: a };
602
+ data$l = { value: a };
663
603
  }
664
604
  encode$1(24 /* Event.Custom */);
665
605
  }
666
606
  }
667
607
 
668
- var data$j = null;
608
+ var data$k = null;
669
609
  var updates$3 = null;
670
- function start$J() {
671
- data$j = {};
610
+ function start$L() {
611
+ data$k = {};
672
612
  updates$3 = {};
673
613
  count$1(5 /* Metric.InvokeCount */);
674
614
  }
675
- function stop$G() {
676
- data$j = {};
615
+ function stop$I() {
616
+ data$k = {};
677
617
  updates$3 = {};
678
618
  }
679
619
  function count$1(metric) {
680
- if (!(metric in data$j)) {
681
- data$j[metric] = 0;
620
+ if (!(metric in data$k)) {
621
+ data$k[metric] = 0;
682
622
  }
683
623
  if (!(metric in updates$3)) {
684
624
  updates$3[metric] = 0;
685
625
  }
686
- data$j[metric]++;
626
+ data$k[metric]++;
687
627
  updates$3[metric]++;
688
628
  }
689
629
  function sum(metric, value) {
690
630
  if (value !== null) {
691
- if (!(metric in data$j)) {
692
- data$j[metric] = 0;
631
+ if (!(metric in data$k)) {
632
+ data$k[metric] = 0;
693
633
  }
694
634
  if (!(metric in updates$3)) {
695
635
  updates$3[metric] = 0;
696
636
  }
697
- data$j[metric] += value;
637
+ data$k[metric] += value;
698
638
  updates$3[metric] += value;
699
639
  }
700
640
  }
701
641
  function max(metric, value) {
702
642
  // Ensure that we do not process null or NaN values
703
643
  if (value !== null && isNaN(value) === false) {
704
- if (!(metric in data$j)) {
705
- data$j[metric] = 0;
644
+ if (!(metric in data$k)) {
645
+ data$k[metric] = 0;
706
646
  }
707
- if (value > data$j[metric] || data$j[metric] === 0) {
647
+ if (value > data$k[metric] || data$k[metric] === 0) {
708
648
  updates$3[metric] = value;
709
- data$j[metric] = value;
649
+ data$k[metric] = value;
710
650
  }
711
651
  }
712
652
  }
713
- function compute$e() {
653
+ function compute$f() {
714
654
  encode$1(0 /* Event.Metric */);
715
655
  }
716
656
  function reset$t() {
@@ -724,11 +664,11 @@ function clearTimeout$1(handle) {
724
664
  return window.clearTimeout(handle);
725
665
  }
726
666
 
727
- var data$i;
667
+ var data$j;
728
668
  var last = 0;
729
669
  var interval = 0;
730
670
  var timeout$7 = null;
731
- function start$I() {
671
+ function start$K() {
732
672
  interval = 60000 /* Setting.PingInterval */;
733
673
  last = 0;
734
674
  }
@@ -741,16 +681,16 @@ function reset$s() {
741
681
  }
742
682
  function ping() {
743
683
  var now = time();
744
- data$i = { gap: now - last };
684
+ data$j = { gap: now - last };
745
685
  encode$1(25 /* Event.Ping */);
746
- if (data$i.gap < 300000 /* Setting.PingTimeout */) {
686
+ if (data$j.gap < 300000 /* Setting.PingTimeout */) {
747
687
  timeout$7 = setTimeout$1(ping, interval);
748
688
  }
749
689
  else {
750
690
  suspend();
751
691
  }
752
692
  }
753
- function stop$F() {
693
+ function stop$H() {
754
694
  clearTimeout$1(timeout$7);
755
695
  last = 0;
756
696
  interval = 0;
@@ -758,50 +698,50 @@ function stop$F() {
758
698
 
759
699
  var ping$1 = /*#__PURE__*/Object.freeze({
760
700
  __proto__: null,
761
- get data () { return data$i; },
701
+ get data () { return data$j; },
762
702
  reset: reset$s,
763
- start: start$I,
764
- stop: stop$F
703
+ start: start$K,
704
+ stop: stop$H
765
705
  });
766
706
 
767
- var data$h = null;
768
- function start$H() {
769
- data$h = {};
707
+ var data$i = null;
708
+ function start$J() {
709
+ data$i = {};
770
710
  }
771
- function stop$E() {
772
- data$h = {};
711
+ function stop$G() {
712
+ data$i = {};
773
713
  }
774
714
  function track$7(event, time) {
775
- if (!(event in data$h)) {
776
- data$h[event] = [[time, 0]];
715
+ if (!(event in data$i)) {
716
+ data$i[event] = [[time, 0]];
777
717
  }
778
718
  else {
779
- var e = data$h[event];
719
+ var e = data$i[event];
780
720
  var last = e[e.length - 1];
781
721
  // Add a new entry only if the new event occurs after configured interval
782
722
  // Otherwise, extend the duration of the previous entry
783
723
  if (time - last[0] > 100 /* Setting.SummaryInterval */) {
784
- data$h[event].push([time, 0]);
724
+ data$i[event].push([time, 0]);
785
725
  }
786
726
  else {
787
727
  last[1] = time - last[0];
788
728
  }
789
729
  }
790
730
  }
791
- function compute$d() {
731
+ function compute$e() {
792
732
  encode$1(36 /* Event.Summary */);
793
733
  }
794
734
  function reset$r() {
795
- data$h = {};
735
+ data$i = {};
796
736
  }
797
737
 
798
738
  var summary = /*#__PURE__*/Object.freeze({
799
739
  __proto__: null,
800
- compute: compute$d,
801
- get data () { return data$h; },
740
+ compute: compute$e,
741
+ get data () { return data$i; },
802
742
  reset: reset$r,
803
- start: start$H,
804
- stop: stop$E,
743
+ start: start$J,
744
+ stop: stop$G,
805
745
  track: track$7
806
746
  });
807
747
 
@@ -822,6 +762,17 @@ PERFORMANCE OF THIS SOFTWARE.
822
762
  /* global Reflect, Promise */
823
763
 
824
764
 
765
+ var __assign = function() {
766
+ __assign = Object.assign || function __assign(t) {
767
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
768
+ s = arguments[i];
769
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
770
+ }
771
+ return t;
772
+ };
773
+ return __assign.apply(this, arguments);
774
+ };
775
+
825
776
  function __awaiter(thisArg, _arguments, P, generator) {
826
777
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
827
778
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -918,8 +869,8 @@ function read(stream) {
918
869
  });
919
870
  }
920
871
 
921
- var data$g = null;
922
- function start$G() {
872
+ var data$h = null;
873
+ function start$I() {
923
874
  reset$q();
924
875
  }
925
876
  function set(variable, value) {
@@ -966,22 +917,22 @@ function log$2(variable, value) {
966
917
  value &&
967
918
  typeof variable === "string" /* Constant.String */ &&
968
919
  variable.length < 255) {
969
- var validValues = variable in data$g ? data$g[variable] : [];
920
+ var validValues = variable in data$h ? data$h[variable] : [];
970
921
  for (var i = 0; i < value.length; i++) {
971
922
  if (typeof value[i] === "string" /* Constant.String */ && value[i].length < 255) {
972
923
  validValues.push(value[i]);
973
924
  }
974
925
  }
975
- data$g[variable] = validValues;
926
+ data$h[variable] = validValues;
976
927
  }
977
928
  }
978
- function compute$c() {
929
+ function compute$d() {
979
930
  encode$1(34 /* Event.Variable */);
980
931
  }
981
932
  function reset$q() {
982
- data$g = {};
933
+ data$h = {};
983
934
  }
984
- function stop$D() {
935
+ function stop$F() {
985
936
  reset$q();
986
937
  }
987
938
  function redact(input) {
@@ -1016,22 +967,22 @@ function detect(input) {
1016
967
 
1017
968
  var variable = /*#__PURE__*/Object.freeze({
1018
969
  __proto__: null,
1019
- compute: compute$c,
1020
- get data () { return data$g; },
970
+ compute: compute$d,
971
+ get data () { return data$h; },
1021
972
  identify: identify,
1022
973
  reset: reset$q,
1023
974
  set: set,
1024
- start: start$G,
1025
- stop: stop$D
975
+ start: start$I,
976
+ stop: stop$F
1026
977
  });
1027
978
 
1028
- var data$f = {};
979
+ var data$g = {};
1029
980
  var keys = new Set();
1030
981
  var variables = {};
1031
982
  var selectors = {};
1032
983
  var hashes = {};
1033
984
  var validation = {};
1034
- function start$F() {
985
+ function start$H() {
1035
986
  reset$p();
1036
987
  }
1037
988
  // Input string is of the following form:
@@ -1084,7 +1035,7 @@ function trigger$2(input) {
1084
1035
  function clone$1(v) {
1085
1036
  return JSON.parse(JSON.stringify(v));
1086
1037
  }
1087
- function compute$b() {
1038
+ function compute$c() {
1088
1039
  try {
1089
1040
  for (var v in variables) {
1090
1041
  var key = parseInt(v);
@@ -1133,21 +1084,21 @@ function reset$p() {
1133
1084
  }
1134
1085
  function update$1(key, subkey, value) {
1135
1086
  var update = false;
1136
- if (!(key in data$f)) {
1137
- data$f[key] = {};
1087
+ if (!(key in data$g)) {
1088
+ data$g[key] = {};
1138
1089
  update = true;
1139
1090
  }
1140
1091
  if (!isEmpty(hashes[key])
1141
- && (!(subkey in data$f[key]) || data$f[key][subkey] != value)) {
1092
+ && (!(subkey in data$g[key]) || data$g[key][subkey] != value)) {
1142
1093
  update = true;
1143
1094
  }
1144
- data$f[key][subkey] = value;
1095
+ data$g[key][subkey] = value;
1145
1096
  if (update) {
1146
1097
  keys.add(key);
1147
1098
  }
1148
1099
  return;
1149
1100
  }
1150
- function stop$C() {
1101
+ function stop$E() {
1151
1102
  reset$p();
1152
1103
  }
1153
1104
  function parse$1(variable) {
@@ -1216,16 +1167,128 @@ function isEmpty(obj) {
1216
1167
  var extract = /*#__PURE__*/Object.freeze({
1217
1168
  __proto__: null,
1218
1169
  clone: clone$1,
1219
- compute: compute$b,
1220
- data: data$f,
1170
+ compute: compute$c,
1171
+ data: data$g,
1221
1172
  keys: keys,
1222
1173
  reset: reset$p,
1223
- start: start$F,
1224
- stop: stop$C,
1174
+ start: start$H,
1175
+ stop: stop$E,
1225
1176
  trigger: trigger$2,
1226
1177
  update: update$1
1227
1178
  });
1228
1179
 
1180
+ function supported(target, api) {
1181
+ try {
1182
+ return !!target[api];
1183
+ }
1184
+ catch (_a) {
1185
+ return false;
1186
+ }
1187
+ }
1188
+ function encodeCookieValue(value) {
1189
+ return encodeURIComponent(value);
1190
+ }
1191
+ function decodeCookieValue(value) {
1192
+ try {
1193
+ var decodedValue = decodeURIComponent(value);
1194
+ return [decodedValue != value, decodedValue];
1195
+ }
1196
+ catch (_a) {
1197
+ }
1198
+ return [false, value];
1199
+ }
1200
+
1201
+ var rootDomain = null;
1202
+ var COOKIE_SEP = "^" /* Constant.Caret */;
1203
+ function start$G() {
1204
+ rootDomain = null;
1205
+ }
1206
+ function stop$D() {
1207
+ rootDomain = null;
1208
+ }
1209
+ function getCookie(key, limit) {
1210
+ var _a;
1211
+ if (limit === void 0) { limit = false; }
1212
+ if (supported(document, "cookie" /* Constant.Cookie */)) {
1213
+ var cookies = document.cookie.split(";" /* Constant.Semicolon */);
1214
+ if (cookies) {
1215
+ for (var i = 0; i < cookies.length; i++) {
1216
+ var pair = cookies[i].split("=" /* Constant.Equals */);
1217
+ if (pair.length > 1 && pair[0] && pair[0].trim() === key) {
1218
+ // Some browsers automatically url encode cookie values if they are not url encoded.
1219
+ // We therefore encode and decode cookie values ourselves.
1220
+ // For backwards compatability we need to consider 3 cases:
1221
+ // * Cookie was previously not encoded by Clarity and browser did not encode it
1222
+ // * Cookie was previously not encoded by Clarity and browser encoded it once or more
1223
+ // * Cookie was previously encoded by Clarity and browser did not encode it
1224
+ var _b = decodeCookieValue(pair[1]), isEncoded = _b[0], decodedValue = _b[1];
1225
+ while (isEncoded) {
1226
+ _a = decodeCookieValue(decodedValue), isEncoded = _a[0], decodedValue = _a[1];
1227
+ }
1228
+ // If we are limiting cookies, check if the cookie value is limited
1229
+ if (limit) {
1230
+ return decodedValue.endsWith("".concat("~" /* Constant.Tilde */, "1")) ? decodedValue.substring(0, decodedValue.length - 2) : null;
1231
+ }
1232
+ return decodedValue;
1233
+ }
1234
+ }
1235
+ }
1236
+ }
1237
+ return null;
1238
+ }
1239
+ function setCookie(key, value, time) {
1240
+ // only write cookies if we are currently in a cookie writing mode (and they are supported)
1241
+ // OR if we are trying to write an empty cookie (i.e. clear the cookie value out)
1242
+ if ((config$2.track || value == "" /* Constant.Empty */) && ((navigator && navigator.cookieEnabled) || supported(document, "cookie" /* Constant.Cookie */))) {
1243
+ // Some browsers automatically url encode cookie values if they are not url encoded.
1244
+ // We therefore encode and decode cookie values ourselves.
1245
+ var encodedValue = encodeCookieValue(value);
1246
+ var expiry = new Date();
1247
+ expiry.setDate(expiry.getDate() + time);
1248
+ var expires = expiry ? "expires=" /* Constant.Expires */ + expiry.toUTCString() : "" /* Constant.Empty */;
1249
+ var cookie = "".concat(key, "=").concat(encodedValue).concat(";" /* Constant.Semicolon */).concat(expires).concat(";path=/" /* Constant.Path */);
1250
+ try {
1251
+ // Attempt to get the root domain only once and fall back to writing cookie on the current domain.
1252
+ if (rootDomain === null) {
1253
+ var hostname = location.hostname ? location.hostname.split("." /* Constant.Dot */) : [];
1254
+ // Walk backwards on a domain and attempt to set a cookie, until successful
1255
+ for (var i = hostname.length - 1; i >= 0; i--) {
1256
+ rootDomain = ".".concat(hostname[i]).concat(rootDomain ? rootDomain : "" /* Constant.Empty */);
1257
+ // We do not wish to attempt writing a cookie on the absolute last part of the domain, e.g. .com or .net.
1258
+ // So we start attempting after second-last part, e.g. .domain.com (PASS) or .co.uk (FAIL)
1259
+ if (i < hostname.length - 1) {
1260
+ // Write the cookie on the current computed top level domain
1261
+ document.cookie = "".concat(cookie).concat(";" /* Constant.Semicolon */).concat("domain=" /* Constant.Domain */).concat(rootDomain);
1262
+ // Once written, check if the cookie exists and its value matches exactly with what we intended to set
1263
+ // Checking for exact value match helps us eliminate a corner case where the cookie may already be present with a different value
1264
+ // If the check is successful, no more action is required and we can return from the function since rootDomain cookie is already set
1265
+ // If the check fails, continue with the for loop until we can successfully set and verify the cookie
1266
+ if (getCookie(key) === value) {
1267
+ return;
1268
+ }
1269
+ }
1270
+ }
1271
+ // Finally, if we were not successful and gone through all the options, play it safe and reset rootDomain to be empty
1272
+ // This forces our code to fall back to always writing cookie to the current domain
1273
+ rootDomain = "" /* Constant.Empty */;
1274
+ }
1275
+ }
1276
+ catch (_a) {
1277
+ rootDomain = "" /* Constant.Empty */;
1278
+ }
1279
+ document.cookie = rootDomain ? "".concat(cookie).concat(";" /* Constant.Semicolon */).concat("domain=" /* Constant.Domain */).concat(rootDomain) : cookie;
1280
+ }
1281
+ }
1282
+
1283
+ var cookie = /*#__PURE__*/Object.freeze({
1284
+ __proto__: null,
1285
+ COOKIE_SEP: COOKIE_SEP,
1286
+ getCookie: getCookie,
1287
+ setCookie: setCookie,
1288
+ start: start$G,
1289
+ stop: stop$D
1290
+ });
1291
+
1229
1292
  var signalCallback = null;
1230
1293
  function signal(cb) {
1231
1294
  signalCallback = cb;
@@ -1254,34 +1317,34 @@ function signalsEvent(signalsPayload) {
1254
1317
  }
1255
1318
  }
1256
1319
 
1257
- var modules$2 = [baseline, dimension, variable, limit, summary, consent$2, metadata$1, envelope$1, upload$1, ping$1, upgrade$1, extract];
1258
- function start$E() {
1320
+ var modules$2 = [baseline, dimension, variable, limit, summary, cookie, consent$2, metadata$1, envelope$1, upload$1, ping$1, upgrade$1, extract];
1321
+ function start$F() {
1259
1322
  // Metric needs to be initialized before we can start measuring. so metric is not wrapped in measure
1260
- start$J();
1323
+ start$L();
1261
1324
  modules$2.forEach(function (x) { return measure(x.start)(); });
1262
1325
  }
1263
- function stop$B() {
1326
+ function stop$C() {
1264
1327
  // Stop modules in the reverse order of their initialization
1265
1328
  // The ordering below should respect inter-module dependency.
1266
1329
  // E.g. if upgrade depends on upload, then upgrade needs to end before upload.
1267
1330
  // Similarly, if upload depends on metadata, upload needs to end before metadata.
1268
1331
  modules$2.slice().reverse().forEach(function (x) { return measure(x.stop)(); });
1269
- stop$G();
1332
+ stop$I();
1270
1333
  }
1271
- function compute$a() {
1272
- compute$c();
1273
- compute$g();
1274
- compute$2();
1275
- compute$e();
1334
+ function compute$b() {
1276
1335
  compute$d();
1336
+ compute$g();
1277
1337
  compute$3();
1278
- compute$b();
1279
1338
  compute$f();
1339
+ compute$e();
1340
+ compute$4();
1341
+ compute$c();
1342
+ compute$2();
1280
1343
  }
1281
1344
 
1282
1345
  var history$5 = [];
1283
- var data$e;
1284
- function start$D() {
1346
+ var data$f;
1347
+ function start$E() {
1285
1348
  history$5 = [];
1286
1349
  max(26 /* Metric.Automation */, navigator.webdriver ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */);
1287
1350
  try {
@@ -1295,17 +1358,17 @@ function start$D() {
1295
1358
  function check$5(id, target, input) {
1296
1359
  // Compute hash for fraud detection, if enabled. Hash is computed only if input meets the minimum length criteria
1297
1360
  if (config$2.fraud && id !== null && input && input.length >= 5 /* Setting.WordLength */) {
1298
- data$e = { id: id, target: target, checksum: hash(input, 28 /* Setting.ChecksumPrecision */) };
1361
+ data$f = { id: id, target: target, checksum: hash(input, 28 /* Setting.ChecksumPrecision */) };
1299
1362
  // Only encode this event if we haven't already reported this hash
1300
- if (history$5.indexOf(data$e.checksum) < 0) {
1301
- history$5.push(data$e.checksum);
1363
+ if (history$5.indexOf(data$f.checksum) < 0) {
1364
+ history$5.push(data$f.checksum);
1302
1365
  encode$2(41 /* Event.Fraud */);
1303
1366
  }
1304
1367
  }
1305
1368
  }
1306
1369
 
1307
1370
  var state$a = [];
1308
- function start$C() {
1371
+ function start$D() {
1309
1372
  reset$o();
1310
1373
  }
1311
1374
  function observe$c(root) {
@@ -1323,7 +1386,7 @@ function recompute$8(evt) {
1323
1386
  function reset$o() {
1324
1387
  state$a = [];
1325
1388
  }
1326
- function stop$A() {
1389
+ function stop$B() {
1327
1390
  reset$o();
1328
1391
  }
1329
1392
 
@@ -1345,7 +1408,7 @@ function offset(element) {
1345
1408
 
1346
1409
  var UserInputTags = ["input", "textarea", "radio", "button", "canvas", "select"];
1347
1410
  var state$9 = [];
1348
- function start$B() {
1411
+ function start$C() {
1349
1412
  reset$n();
1350
1413
  }
1351
1414
  function observe$b(root) {
@@ -1486,12 +1549,12 @@ function context(a) {
1486
1549
  function reset$n() {
1487
1550
  state$9 = [];
1488
1551
  }
1489
- function stop$z() {
1552
+ function stop$A() {
1490
1553
  reset$n();
1491
1554
  }
1492
1555
 
1493
1556
  var state$8 = [];
1494
- function start$A() {
1557
+ function start$B() {
1495
1558
  reset$m();
1496
1559
  }
1497
1560
  function observe$a(root) {
@@ -1506,13 +1569,13 @@ function recompute$7(action, evt) {
1506
1569
  function reset$m() {
1507
1570
  state$8 = [];
1508
1571
  }
1509
- function stop$y() {
1572
+ function stop$z() {
1510
1573
  reset$m();
1511
1574
  }
1512
1575
 
1513
1576
  var timeout$6 = null;
1514
1577
  var state$7 = [];
1515
- function start$z() {
1578
+ function start$A() {
1516
1579
  reset$l();
1517
1580
  }
1518
1581
  function observe$9(root) {
@@ -1546,7 +1609,7 @@ function process$7(event) {
1546
1609
  function reset$l() {
1547
1610
  state$7 = [];
1548
1611
  }
1549
- function stop$x() {
1612
+ function stop$y() {
1550
1613
  clearTimeout$1(timeout$6);
1551
1614
  reset$l();
1552
1615
  }
@@ -1556,7 +1619,7 @@ var timeout$5 = null;
1556
1619
  var hasPrimaryTouch = false;
1557
1620
  var primaryTouchId = 0;
1558
1621
  var activeTouchPointIds = new Set();
1559
- function start$y() {
1622
+ function start$z() {
1560
1623
  reset$k();
1561
1624
  }
1562
1625
  function observe$8(root) {
@@ -1664,7 +1727,7 @@ function similar$1(last, current) {
1664
1727
  var sameId = current.data.id !== undefined ? current.data.id === last.data.id : true;
1665
1728
  return current.event === last.event && match && distance < 20 /* Setting.Distance */ && gap < 25 /* Setting.PointerInterval */ && sameId;
1666
1729
  }
1667
- function stop$w() {
1730
+ function stop$x() {
1668
1731
  clearTimeout$1(timeout$5);
1669
1732
  // Send out any pending pointer events in the pipeline
1670
1733
  if (state$6.length > 0) {
@@ -1720,11 +1783,11 @@ function throttle(func, duration) {
1720
1783
  return throttledFunction;
1721
1784
  }
1722
1785
 
1723
- var data$d;
1786
+ var data$e;
1724
1787
  var timeout$4 = null;
1725
1788
  var initialStateLogged = false;
1726
1789
  var throttledRecompute$1 = throttle(recompute$5, 500 /* Setting.LookAhead */);
1727
- function start$x() {
1790
+ function start$y() {
1728
1791
  initialStateLogged = false;
1729
1792
  bind(window, "resize", throttledRecompute$1);
1730
1793
  recompute$5();
@@ -1733,7 +1796,7 @@ function recompute$5() {
1733
1796
  var de = document.documentElement;
1734
1797
  // window.innerWidth includes width of the scrollbar and is not a true representation of the viewport width.
1735
1798
  // Therefore, when possible, use documentElement's clientWidth property.
1736
- data$d = {
1799
+ data$e = {
1737
1800
  width: de && "clientWidth" in de ? Math.min(de.clientWidth, window.innerWidth) : window.innerWidth,
1738
1801
  height: de && "clientHeight" in de ? Math.min(de.clientHeight, window.innerHeight) : window.innerHeight,
1739
1802
  };
@@ -1750,11 +1813,11 @@ function process$5(event) {
1750
1813
  schedule(encode$4.bind(this, event));
1751
1814
  }
1752
1815
  function reset$j() {
1753
- data$d = null;
1816
+ data$e = null;
1754
1817
  clearTimeout$1(timeout$4);
1755
1818
  throttledRecompute$1.cleanup();
1756
1819
  }
1757
- function stop$v() {
1820
+ function stop$w() {
1758
1821
  reset$j();
1759
1822
  }
1760
1823
 
@@ -1762,7 +1825,7 @@ var state$5 = [];
1762
1825
  var initialTop = null;
1763
1826
  var initialBottom = null;
1764
1827
  var timeout$3 = null;
1765
- function start$w() {
1828
+ function start$x() {
1766
1829
  state$5 = [];
1767
1830
  recompute$4();
1768
1831
  }
@@ -1847,7 +1910,7 @@ function similar(last, current) {
1847
1910
  var dy = last.data.y - current.data.y;
1848
1911
  return (dx * dx + dy * dy < 20 /* Setting.Distance */ * 20 /* Setting.Distance */) && (current.time - last.time < 50 /* Setting.ScrollInterval */);
1849
1912
  }
1850
- function compute$9() {
1913
+ function compute$a() {
1851
1914
  var _a, _b;
1852
1915
  if (initialTop) {
1853
1916
  var top_1 = metadata$2(initialTop, null);
@@ -1858,7 +1921,7 @@ function compute$9() {
1858
1921
  log(32 /* Dimension.InitialScrollBottom */, (_b = bottom === null || bottom === void 0 ? void 0 : bottom.hash) === null || _b === void 0 ? void 0 : _b.join("." /* Constant.Dot */));
1859
1922
  }
1860
1923
  }
1861
- function stop$u() {
1924
+ function stop$v() {
1862
1925
  clearTimeout$1(timeout$3);
1863
1926
  throttledRecompute.cleanup();
1864
1927
  state$5 = [];
@@ -1866,10 +1929,10 @@ function stop$u() {
1866
1929
  initialBottom = null;
1867
1930
  }
1868
1931
 
1869
- var data$c = null;
1932
+ var data$d = null;
1870
1933
  var previous = null;
1871
1934
  var timeout$2 = null;
1872
- function start$v() {
1935
+ function start$w() {
1873
1936
  reset$h();
1874
1937
  }
1875
1938
  function observe$6(root) {
@@ -1891,12 +1954,12 @@ function recompute$3(root) {
1891
1954
  (current.anchorNode === current.focusNode && current.anchorOffset === current.focusOffset)) {
1892
1955
  return;
1893
1956
  }
1894
- var startNode = data$c.start ? data$c.start : null;
1895
- if (previous !== null && data$c.start !== null && startNode !== current.anchorNode) {
1957
+ var startNode = data$d.start ? data$d.start : null;
1958
+ if (previous !== null && data$d.start !== null && startNode !== current.anchorNode) {
1896
1959
  clearTimeout$1(timeout$2);
1897
1960
  process$3(21 /* Event.Selection */);
1898
1961
  }
1899
- data$c = {
1962
+ data$d = {
1900
1963
  start: current.anchorNode,
1901
1964
  startOffset: current.anchorOffset,
1902
1965
  end: current.focusNode,
@@ -1911,15 +1974,15 @@ function process$3(event) {
1911
1974
  }
1912
1975
  function reset$h() {
1913
1976
  previous = null;
1914
- data$c = { start: 0, startOffset: 0, end: 0, endOffset: 0 };
1977
+ data$d = { start: 0, startOffset: 0, end: 0, endOffset: 0 };
1915
1978
  }
1916
- function stop$t() {
1979
+ function stop$u() {
1917
1980
  reset$h();
1918
1981
  clearTimeout$1(timeout$2);
1919
1982
  }
1920
1983
 
1921
1984
  var state$4 = [];
1922
- function start$u() {
1985
+ function start$v() {
1923
1986
  reset$g();
1924
1987
  }
1925
1988
  function observe$5(root) {
@@ -1932,28 +1995,28 @@ function recompute$2(evt) {
1932
1995
  function reset$g() {
1933
1996
  state$4 = [];
1934
1997
  }
1935
- function stop$s() {
1998
+ function stop$t() {
1936
1999
  reset$g();
1937
2000
  }
1938
2001
 
1939
- var data$b;
1940
- function start$t() {
2002
+ var data$c;
2003
+ function start$u() {
1941
2004
  bind(window, "pagehide", recompute$1);
1942
2005
  }
1943
2006
  function recompute$1(evt) {
1944
- data$b = { name: evt.type, persisted: evt.persisted ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */ };
2007
+ data$c = { name: evt.type, persisted: evt.persisted ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */ };
1945
2008
  encode$4(26 /* Event.Unload */, time(evt));
1946
2009
  stop();
1947
2010
  }
1948
2011
  function reset$f() {
1949
- data$b = null;
2012
+ data$c = null;
1950
2013
  }
1951
- function stop$r() {
2014
+ function stop$s() {
1952
2015
  reset$f();
1953
2016
  }
1954
2017
 
1955
- var data$a;
1956
- function start$s() {
2018
+ var data$b;
2019
+ function start$t() {
1957
2020
  bind(document, "visibilitychange", recompute);
1958
2021
  recompute();
1959
2022
  }
@@ -1961,62 +2024,62 @@ function recompute(evt) {
1961
2024
  if (evt === void 0) { evt = null; }
1962
2025
  if ("visibilityState" in document) {
1963
2026
  var visible = document.visibilityState === "visible" ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */;
1964
- data$a = { visible: visible };
2027
+ data$b = { visible: visible };
1965
2028
  encode$4(28 /* Event.Visibility */, time(evt));
1966
2029
  }
1967
2030
  }
1968
2031
  function reset$e() {
1969
- data$a = null;
2032
+ data$b = null;
1970
2033
  }
1971
- function stop$q() {
2034
+ function stop$r() {
1972
2035
  reset$e();
1973
2036
  }
1974
2037
 
1975
- var data$9;
1976
- function start$r() {
1977
- bind(window, "focus", function () { return compute$8(1 /* BooleanFlag.True */); });
1978
- bind(window, "blur", function () { return compute$8(0 /* BooleanFlag.False */); });
2038
+ var data$a;
2039
+ function start$s() {
2040
+ bind(window, "focus", function () { return compute$9(1 /* BooleanFlag.True */); });
2041
+ bind(window, "blur", function () { return compute$9(0 /* BooleanFlag.False */); });
1979
2042
  }
1980
- function stop$p() {
2043
+ function stop$q() {
1981
2044
  reset$d();
1982
2045
  }
1983
2046
  function reset$d() {
1984
- data$9 = null;
2047
+ data$a = null;
1985
2048
  }
1986
- function compute$8(focus) {
1987
- data$9 = { focused: focus };
2049
+ function compute$9(focus) {
2050
+ data$a = { focused: focus };
1988
2051
  encode$4(50 /* Event.Focus */);
1989
2052
  }
1990
2053
 
1991
- function start$q() {
1992
- start$i();
2054
+ function start$r() {
2055
+ start$j();
2056
+ start$C();
1993
2057
  start$B();
2058
+ start$z();
1994
2059
  start$A();
1995
2060
  start$y();
1996
- start$z();
1997
- start$x();
2061
+ start$t();
1998
2062
  start$s();
1999
- start$r();
2063
+ start$x();
2000
2064
  start$w();
2065
+ start$D();
2001
2066
  start$v();
2002
- start$C();
2003
2067
  start$u();
2004
- start$t();
2005
2068
  }
2006
- function stop$o() {
2007
- stop$g();
2069
+ function stop$p() {
2070
+ stop$h();
2071
+ stop$A();
2008
2072
  stop$z();
2073
+ stop$x();
2009
2074
  stop$y();
2010
2075
  stop$w();
2011
- stop$x();
2012
- stop$v();
2076
+ stop$r();
2013
2077
  stop$q();
2014
- stop$p();
2078
+ stop$v();
2015
2079
  stop$u();
2080
+ stop$B();
2016
2081
  stop$t();
2017
- stop$A();
2018
2082
  stop$s();
2019
- stop$r();
2020
2083
  }
2021
2084
  function observe$4(root) {
2022
2085
  observe$7(root);
@@ -2036,8 +2099,8 @@ function observe$4(root) {
2036
2099
  var interaction = /*#__PURE__*/Object.freeze({
2037
2100
  __proto__: null,
2038
2101
  observe: observe$4,
2039
- start: start$q,
2040
- stop: stop$o
2102
+ start: start$r,
2103
+ stop: stop$p
2041
2104
  });
2042
2105
 
2043
2106
  // Following code takes an array of tokens and transforms it to optimize for repeating tokens and make it efficient to send over the wire
@@ -2126,7 +2189,7 @@ function proxyStyleRules$1(win) {
2126
2189
  }
2127
2190
  }
2128
2191
  }
2129
- function start$p() {
2192
+ function start$q() {
2130
2193
  proxyStyleRules$1(window);
2131
2194
  }
2132
2195
  function checkDocumentStyles(documentNode, timestamp) {
@@ -2170,7 +2233,7 @@ function checkDocumentStyles(documentNode, timestamp) {
2170
2233
  styleTimeMap[documentId] = timestamp;
2171
2234
  }
2172
2235
  }
2173
- function compute$7() {
2236
+ function compute$8() {
2174
2237
  for (var _i = 0, documentNodes_1 = documentNodes; _i < documentNodes_1.length; _i++) {
2175
2238
  var documentNode = documentNodes_1[_i];
2176
2239
  var docId = documentNode == document ? -1 : getId$1(documentNode);
@@ -2182,7 +2245,7 @@ function reset$c() {
2182
2245
  sheetAdoptionState = [];
2183
2246
  sheetUpdateState = [];
2184
2247
  }
2185
- function stop$n() {
2248
+ function stop$o() {
2186
2249
  styleSheetMap = {};
2187
2250
  styleTimeMap = {};
2188
2251
  documentNodes = [];
@@ -2230,7 +2293,7 @@ var animationFinish = null;
2230
2293
  var animationId = 'clarityAnimationId';
2231
2294
  var operationCount = 'clarityOperationCount';
2232
2295
  var maxOperations = 20;
2233
- function start$o() {
2296
+ function start$p() {
2234
2297
  if (window["Animation"] &&
2235
2298
  window["Animation"].prototype &&
2236
2299
  window["KeyframeEffect"] &&
@@ -2285,7 +2348,7 @@ function track$6(time, id, operation, keyFrames, timing, targetId, timeline) {
2285
2348
  });
2286
2349
  encode$5(44 /* Event.Animation */);
2287
2350
  }
2288
- function stop$m() {
2351
+ function stop$n() {
2289
2352
  reset$b();
2290
2353
  }
2291
2354
  function overrideAnimationHelper(functionToOverride, name) {
@@ -2351,7 +2414,7 @@ function check$4(tag) {
2351
2414
  register$1(tag);
2352
2415
  }
2353
2416
  }
2354
- function start$n() {
2417
+ function start$o() {
2355
2418
  var _a;
2356
2419
  window.clarityOverrides = window.clarityOverrides || {};
2357
2420
  if (((_a = window.customElements) === null || _a === void 0 ? void 0 : _a.define) && !window.clarityOverrides.define) {
@@ -2367,7 +2430,7 @@ function start$n() {
2367
2430
  function reset$a() {
2368
2431
  elements.length = 0;
2369
2432
  }
2370
- function stop$l() {
2433
+ function stop$m() {
2371
2434
  reset$a();
2372
2435
  definedElements.clear();
2373
2436
  }
@@ -2395,7 +2458,7 @@ function encode$5 (type, timer, ts) {
2395
2458
  }
2396
2459
  return [3 /*break*/, 13];
2397
2460
  case 1:
2398
- d = data$8;
2461
+ d = data$9;
2399
2462
  tokens.push(d.width);
2400
2463
  tokens.push(d.height);
2401
2464
  track$8(type, d.width, d.height);
@@ -2552,15 +2615,15 @@ function attribute$1(key, value, privacy) {
2552
2615
  return "".concat(key, "=").concat(text$1(value, key.indexOf("data-" /* Constant.DataAttribute */) === 0 ? "data-" /* Constant.DataAttribute */ : key, privacy));
2553
2616
  }
2554
2617
 
2555
- var data$8;
2618
+ var data$9;
2556
2619
  function reset$9() {
2557
- data$8 = null;
2620
+ data$9 = null;
2558
2621
  }
2559
- function start$m() {
2622
+ function start$n() {
2560
2623
  reset$9();
2561
- compute$6();
2624
+ compute$7();
2562
2625
  }
2563
- function compute$6() {
2626
+ function compute$7() {
2564
2627
  var body = document.body;
2565
2628
  var d = document.documentElement;
2566
2629
  var bodyClientWidth = body ? body.clientWidth : null;
@@ -2578,12 +2641,12 @@ function compute$6() {
2578
2641
  var documentOffsetHeight = d ? d.offsetHeight : null;
2579
2642
  var height = Math.max(bodyClientHeight, bodyScrollHeight, bodyOffsetHeight, documentClientHeight, documentScrollHeight, documentOffsetHeight);
2580
2643
  // Check that width or height has changed from before, and also that width & height are not null values
2581
- if ((data$8 === null || width !== data$8.width || height !== data$8.height) && width !== null && height !== null) {
2582
- data$8 = { width: width, height: height };
2644
+ if ((data$9 === null || width !== data$9.width || height !== data$9.height) && width !== null && height !== null) {
2645
+ data$9 = { width: width, height: height };
2583
2646
  encode$5(8 /* Event.Document */);
2584
2647
  }
2585
2648
  }
2586
- function stop$k() {
2649
+ function stop$l() {
2587
2650
  reset$9();
2588
2651
  }
2589
2652
 
@@ -2635,7 +2698,7 @@ var history$4 = {};
2635
2698
  var observedNodes = new WeakMap();
2636
2699
  // We ignore mutations if these attributes are updated
2637
2700
  var IGNORED_ATTRIBUTES = ["data-google-query-id", "data-load-complete", "data-google-container-id"];
2638
- function start$l() {
2701
+ function start$m() {
2639
2702
  observers = new Set();
2640
2703
  queue$2 = [];
2641
2704
  timeout$1 = null;
@@ -2673,7 +2736,7 @@ function monitor(frame) {
2673
2736
  bind(frame, "load" /* Constant.LoadEvent */, generate.bind(this, frame, "childList" /* Constant.ChildList */), true);
2674
2737
  }
2675
2738
  }
2676
- function stop$j() {
2739
+ function stop$k() {
2677
2740
  for (var _i = 0, _a = Array.from(observers); _i < _a.length; _i++) {
2678
2741
  var observer = _a[_i];
2679
2742
  if (observer) {
@@ -2706,8 +2769,8 @@ function handle$1(m) {
2706
2769
  track$7(6 /* Event.Mutation */, now);
2707
2770
  mutations.push({ time: now, mutations: m });
2708
2771
  schedule(process$2, 1 /* Priority.High */).then(function () {
2709
- setTimeout$1(compute$6);
2710
- measure(compute$5)();
2772
+ setTimeout$1(compute$7);
2773
+ measure(compute$6)();
2711
2774
  });
2712
2775
  }
2713
2776
  function processMutation(timer, mutation, instance, timestamp) {
@@ -2760,7 +2823,7 @@ function process$2() {
2760
2823
  switch (_d.label) {
2761
2824
  case 0:
2762
2825
  timer = { id: id(), cost: 3 /* Metric.LayoutCost */ };
2763
- start$d(timer);
2826
+ start$e(timer);
2764
2827
  _d.label = 1;
2765
2828
  case 1:
2766
2829
  if (!(mutations.length > 0)) return [3 /*break*/, 7];
@@ -2810,7 +2873,7 @@ function process$2() {
2810
2873
  _d.label = 13;
2811
2874
  case 13:
2812
2875
  cleanHistory();
2813
- stop$c(timer);
2876
+ stop$d(timer);
2814
2877
  return [2 /*return*/];
2815
2878
  }
2816
2879
  });
@@ -3097,6 +3160,54 @@ function num$1(input, scale) {
3097
3160
  return null;
3098
3161
  }
3099
3162
 
3163
+ /**
3164
+ * Tracks dialog element state and determines if it's a modal dialog
3165
+ * Modal dialogs are opened via showModal() and rendered in the browser's top-layer
3166
+ *
3167
+ * @param dialogElement - The dialog element to track
3168
+ * @param attributes - Current attributes of the dialog
3169
+ * @returns Tracking result with updated attributes and modal state
3170
+ */
3171
+ function trackDialog(dialogElement, attributes) {
3172
+ var result = {
3173
+ attributes: __assign({}, attributes),
3174
+ isModal: false
3175
+ };
3176
+ // Capture the open attribute which indicates if dialog is currently shown
3177
+ if (dialogElement.open) {
3178
+ result.attributes["open"] = "";
3179
+ }
3180
+ // Detect if this is a modal dialog by checking for ::backdrop pseudo-element
3181
+ // Modal dialogs shown via showModal() have a backdrop, non-modal dialogs don't
3182
+ if (dialogElement.open) {
3183
+ try {
3184
+ var backdropStyle = window.getComputedStyle(dialogElement, "::backdrop");
3185
+ var backdropDisplay = backdropStyle.getPropertyValue("display");
3186
+ // Modal dialogs have ::backdrop with display !== 'none'
3187
+ if (backdropDisplay && backdropDisplay !== "none") {
3188
+ result.isModal = true;
3189
+ result.attributes["data-clarity-modal"] = "true";
3190
+ }
3191
+ }
3192
+ catch (e) {
3193
+ // If we can't check for backdrop (older browsers),
3194
+ // we can't reliably detect modal state
3195
+ console.warn("Error detecting modal dialog:", e);
3196
+ }
3197
+ }
3198
+ return result;
3199
+ }
3200
+ /**
3201
+ * Creates dialog node data for tracking
3202
+ *
3203
+ * @param tag - Tag name (should be "DIALOG")
3204
+ * @param attributes - Dialog attributes
3205
+ * @returns NodeInfo object ready for tracking
3206
+ */
3207
+ function createDialogNodeData(tag, attributes) {
3208
+ return { tag: tag, attributes: attributes };
3209
+ }
3210
+
3100
3211
  var IGNORE_ATTRIBUTES = ["title", "alt", "onload", "onfocus", "onerror", "data-drupal-form-submit-last", "aria-label"];
3101
3212
  var newlineRegex = /[\r\n]+/g;
3102
3213
  function processNode (node, source, timestamp) {
@@ -3287,6 +3398,13 @@ function processNode (node, source, timestamp) {
3287
3398
  var mediaTag = { tag: tag, attributes: attributes };
3288
3399
  dom[call](node, parent, mediaTag, source);
3289
3400
  break;
3401
+ case "DIALOG":
3402
+ // Use custom module for dialog tracking
3403
+ var dialogElement = node;
3404
+ var dialogTracking = trackDialog(dialogElement, attributes);
3405
+ var dialogData = createDialogNodeData(tag, dialogTracking.attributes);
3406
+ dom[call](node, parent, dialogData, source);
3407
+ break;
3290
3408
  default:
3291
3409
  check$4(element.localName);
3292
3410
  var data = { tag: tag, attributes: attributes };
@@ -3486,11 +3604,11 @@ var iframeMap = null; // Maps iframe's contentDocument => parent iframe element
3486
3604
  var iframeContentMap = null; // Maps parent iframe element => iframe's contentDocument & contentWindow
3487
3605
  var privacyMap = null; // Maps node => Privacy (enum)
3488
3606
  var fraudMap = null; // Maps node => FraudId (number)
3489
- function start$k() {
3607
+ function start$l() {
3490
3608
  reset$7();
3491
3609
  parse(document, true);
3492
3610
  }
3493
- function stop$i() {
3611
+ function stop$j() {
3494
3612
  reset$7();
3495
3613
  }
3496
3614
  function reset$7() {
@@ -3885,7 +4003,7 @@ var regions = {};
3885
4003
  var queue$1 = [];
3886
4004
  var watch = false;
3887
4005
  var observer$1 = null;
3888
- function start$j() {
4006
+ function start$k() {
3889
4007
  reset$6();
3890
4008
  observer$1 = null;
3891
4009
  regionMap = new WeakMap();
@@ -3930,7 +4048,7 @@ function track$3(id, event) {
3930
4048
  // Process updates to this region, if applicable
3931
4049
  process$1(node, data, interaction, data.visibility);
3932
4050
  }
3933
- function compute$5() {
4051
+ function compute$6() {
3934
4052
  // Process any regions where we couldn't resolve an "id" for at the time of last intersection observer event
3935
4053
  // This could happen in cases where elements are not yet processed by Clarity's virtual DOM but browser reports a change, regardless.
3936
4054
  // For those cases we add them to the queue and re-process them below
@@ -4013,7 +4131,7 @@ function clone(r) {
4013
4131
  function reset$6() {
4014
4132
  state$2 = [];
4015
4133
  }
4016
- function stop$h() {
4134
+ function stop$i() {
4017
4135
  reset$6();
4018
4136
  regionMap = null;
4019
4137
  regions = {};
@@ -4136,7 +4254,7 @@ function encode$4 (type, ts) {
4136
4254
  reset$m();
4137
4255
  break;
4138
4256
  case 11 /* Event.Resize */:
4139
- r = data$d;
4257
+ r = data$e;
4140
4258
  tokens.push(r.width);
4141
4259
  tokens.push(r.height);
4142
4260
  track$8(type, r.width, r.height);
@@ -4144,7 +4262,7 @@ function encode$4 (type, ts) {
4144
4262
  queue(tokens);
4145
4263
  break;
4146
4264
  case 26 /* Event.Unload */:
4147
- u = data$b;
4265
+ u = data$c;
4148
4266
  tokens.push(u.name);
4149
4267
  tokens.push(u.persisted);
4150
4268
  reset$f();
@@ -4163,7 +4281,7 @@ function encode$4 (type, ts) {
4163
4281
  reset$l();
4164
4282
  break;
4165
4283
  case 21 /* Event.Selection */:
4166
- s = data$c;
4284
+ s = data$d;
4167
4285
  if (s) {
4168
4286
  startTarget = metadata$2(s.start, type);
4169
4287
  endTarget = metadata$2(s.end, type);
@@ -4239,14 +4357,14 @@ function encode$4 (type, ts) {
4239
4357
  reset$5();
4240
4358
  break;
4241
4359
  case 28 /* Event.Visibility */:
4242
- v = data$a;
4360
+ v = data$b;
4243
4361
  tokens.push(v.visible);
4244
4362
  queue(tokens);
4245
4363
  visibility(t, v.visible);
4246
4364
  reset$e();
4247
4365
  break;
4248
4366
  case 50 /* Event.Focus */: {
4249
- f = data$9;
4367
+ f = data$a;
4250
4368
  tokens.push(f.focused);
4251
4369
  queue(tokens, false);
4252
4370
  reset$d();
@@ -4260,7 +4378,7 @@ function encode$4 (type, ts) {
4260
4378
 
4261
4379
  var state$1 = [];
4262
4380
  var updates$1 = [];
4263
- function start$i() {
4381
+ function start$j() {
4264
4382
  state$1 = [];
4265
4383
  reset$5();
4266
4384
  }
@@ -4287,7 +4405,7 @@ function track$2(time, event, hash, x, y, reaction, context) {
4287
4405
  // We would still need to capture the last scroll position as part of the baseline event, even when timeline will be empty.
4288
4406
  track$8(event, x, y, time);
4289
4407
  }
4290
- function compute$4() {
4408
+ function compute$5() {
4291
4409
  if (!data$1) {
4292
4410
  return;
4293
4411
  }
@@ -4307,7 +4425,7 @@ function compute$4() {
4307
4425
  state$1 = temp; // Drop events less than the min time
4308
4426
  encode$4(22 /* Event.Timeline */);
4309
4427
  }
4310
- function stop$g() {
4428
+ function stop$h() {
4311
4429
  state$1 = [];
4312
4430
  reset$5();
4313
4431
  }
@@ -4320,7 +4438,7 @@ function encode$3 (type) {
4320
4438
  tokens = [eventTime, type];
4321
4439
  switch (type) {
4322
4440
  case 8 /* Event.Document */:
4323
- d = data$8;
4441
+ d = data$9;
4324
4442
  tokens.push(d.width);
4325
4443
  tokens.push(d.height);
4326
4444
  track$8(type, d.width, d.height);
@@ -4448,11 +4566,11 @@ function add(node, parent, data) {
4448
4566
  var stopCallbacks = [];
4449
4567
  var active$2 = false;
4450
4568
  var modules$1 = null;
4451
- function start$h() {
4569
+ function start$i() {
4452
4570
  active$2 = true;
4453
4571
  modules$1 = new Set();
4454
4572
  }
4455
- function stop$f() {
4573
+ function stop$g() {
4456
4574
  stopCallbacks.reverse().forEach(function (callback) {
4457
4575
  try {
4458
4576
  callback();
@@ -4477,17 +4595,22 @@ function event(signal) {
4477
4595
  if (m && modules$1.has(m)) {
4478
4596
  return;
4479
4597
  }
4480
- load(parts[0]);
4481
- if (m) {
4482
- modules$1.add(m);
4483
- dynamic$1(modules$1);
4484
- }
4598
+ load(parts[0], m);
4485
4599
  }
4486
- function load(url) {
4600
+ function load(url, mid) {
4487
4601
  try {
4488
4602
  var script = document.createElement("script");
4489
4603
  script.src = url;
4490
4604
  script.async = true;
4605
+ script.onload = function () {
4606
+ if (mid) {
4607
+ modules$1.add(mid);
4608
+ dynamic$1(modules$1);
4609
+ }
4610
+ };
4611
+ script.onerror = function () {
4612
+ report(new Error("".concat("MODULE" /* DataConstant.Module */, ": ").concat(url)));
4613
+ };
4491
4614
  document.head.appendChild(script);
4492
4615
  }
4493
4616
  catch (error) {
@@ -4499,8 +4622,8 @@ var dynamic = /*#__PURE__*/Object.freeze({
4499
4622
  __proto__: null,
4500
4623
  event: event,
4501
4624
  register: register,
4502
- start: start$h,
4503
- stop: stop$f
4625
+ start: start$i,
4626
+ stop: stop$g
4504
4627
  });
4505
4628
 
4506
4629
  var discoverBytes = 0;
@@ -4513,7 +4636,7 @@ var active$1;
4513
4636
  var queuedTime = 0;
4514
4637
  var leanLimit = false;
4515
4638
  var track$1;
4516
- function start$g() {
4639
+ function start$h() {
4517
4640
  active$1 = true;
4518
4641
  discoverBytes = 0;
4519
4642
  playbackBytes = 0;
@@ -4584,7 +4707,7 @@ function queue(tokens, transmit) {
4584
4707
  check$2(playbackBytes);
4585
4708
  }
4586
4709
  }
4587
- function stop$e() {
4710
+ function stop$f() {
4588
4711
  clearTimeout$1(timeout);
4589
4712
  upload(true);
4590
4713
  discoverBytes = 0;
@@ -4614,10 +4737,10 @@ function upload(final) {
4614
4737
  }
4615
4738
  // CAUTION: Ensure "transmit" is set to false in the queue function for following events
4616
4739
  // Otherwise you run a risk of infinite loop.
4740
+ compute$6();
4617
4741
  compute$5();
4618
- compute$4();
4619
- compute$a();
4620
- compute$7();
4742
+ compute$b();
4743
+ compute$8();
4621
4744
  last = final === true;
4622
4745
  // In some cases envelope has null data because it's part of the shutdown process while there's one upload call queued which might introduce runtime error
4623
4746
  if (!data$1)
@@ -4830,8 +4953,8 @@ function response(payload) {
4830
4953
  }
4831
4954
 
4832
4955
  var history$3 = {};
4833
- var data$7;
4834
- function start$f() {
4956
+ var data$8;
4957
+ function start$g() {
4835
4958
  bind(window, "error", handler);
4836
4959
  history$3 = {};
4837
4960
  }
@@ -4847,7 +4970,7 @@ function handler(error) {
4847
4970
  }
4848
4971
  // Send back information only if the handled error has valid information
4849
4972
  if (e && e.message) {
4850
- data$7 = {
4973
+ data$8 = {
4851
4974
  message: e.message,
4852
4975
  line: error["lineno"],
4853
4976
  column: error["colno"],
@@ -4866,28 +4989,28 @@ function encode$2 (type) {
4866
4989
  tokens = [time(), type];
4867
4990
  switch (type) {
4868
4991
  case 31 /* Event.ScriptError */:
4869
- tokens.push(data$7.message);
4870
- tokens.push(data$7.line);
4871
- tokens.push(data$7.column);
4872
- tokens.push(data$7.stack);
4873
- tokens.push(url$1(data$7.source));
4992
+ tokens.push(data$8.message);
4993
+ tokens.push(data$8.line);
4994
+ tokens.push(data$8.column);
4995
+ tokens.push(data$8.stack);
4996
+ tokens.push(url$1(data$8.source));
4874
4997
  queue(tokens);
4875
4998
  break;
4876
4999
  case 33 /* Event.Log */:
4877
- if (data$6) {
4878
- tokens.push(data$6.code);
4879
- tokens.push(data$6.name);
4880
- tokens.push(data$6.message);
4881
- tokens.push(data$6.stack);
4882
- tokens.push(data$6.severity);
5000
+ if (data$7) {
5001
+ tokens.push(data$7.code);
5002
+ tokens.push(data$7.name);
5003
+ tokens.push(data$7.message);
5004
+ tokens.push(data$7.stack);
5005
+ tokens.push(data$7.severity);
4883
5006
  queue(tokens, false);
4884
5007
  }
4885
5008
  break;
4886
5009
  case 41 /* Event.Fraud */:
4887
- if (data$e) {
4888
- tokens.push(data$e.id);
4889
- tokens.push(data$e.target);
4890
- tokens.push(data$e.checksum);
5010
+ if (data$f) {
5011
+ tokens.push(data$f.id);
5012
+ tokens.push(data$f.target);
5013
+ tokens.push(data$f.checksum);
4891
5014
  queue(tokens, false);
4892
5015
  }
4893
5016
  break;
@@ -4898,8 +5021,8 @@ function encode$2 (type) {
4898
5021
  }
4899
5022
 
4900
5023
  var history$2 = {};
4901
- var data$6;
4902
- function start$e() {
5024
+ var data$7;
5025
+ function start$f() {
4903
5026
  history$2 = {};
4904
5027
  }
4905
5028
  function log$1(code, severity, name, message, stack) {
@@ -4912,7 +5035,7 @@ function log$1(code, severity, name, message, stack) {
4912
5035
  if (code in history$2 && history$2[code].indexOf(key) >= 0) {
4913
5036
  return;
4914
5037
  }
4915
- data$6 = { code: code, name: name, message: message, stack: stack, severity: severity };
5038
+ data$7 = { code: code, name: name, message: message, stack: stack, severity: severity };
4916
5039
  // Maintain history of errors in memory to avoid sending redundant information
4917
5040
  if (code in history$2) {
4918
5041
  history$2[code].push(key);
@@ -4922,7 +5045,7 @@ function log$1(code, severity, name, message, stack) {
4922
5045
  }
4923
5046
  encode$2(33 /* Event.Log */);
4924
5047
  }
4925
- function stop$d() {
5048
+ function stop$e() {
4926
5049
  history$2 = {};
4927
5050
  }
4928
5051
 
@@ -5019,7 +5142,7 @@ function state(timer) {
5019
5142
  // If this task is no longer being tracked, send stop message to the caller
5020
5143
  return 2 /* Task.Stop */;
5021
5144
  }
5022
- function start$d(timer) {
5145
+ function start$e(timer) {
5023
5146
  tracker[key(timer)] = { start: performance.now(), calls: 0, yield: 30 /* Setting.LongTask */ };
5024
5147
  }
5025
5148
  function restart$2(timer) {
@@ -5027,12 +5150,12 @@ function restart$2(timer) {
5027
5150
  if (tracker && tracker[id]) {
5028
5151
  var c = tracker[id].calls;
5029
5152
  var y = tracker[id].yield;
5030
- start$d(timer);
5153
+ start$e(timer);
5031
5154
  tracker[id].calls = c + 1;
5032
5155
  tracker[id].yield = y;
5033
5156
  }
5034
5157
  }
5035
- function stop$c(timer) {
5158
+ function stop$d(timer) {
5036
5159
  var end = performance.now();
5037
5160
  var id = key(timer);
5038
5161
  var duration = end - tracker[id].start;
@@ -5053,7 +5176,7 @@ function suspend$1(timer) {
5053
5176
  case 0:
5054
5177
  id = key(timer);
5055
5178
  if (!(id in tracker)) return [3 /*break*/, 2];
5056
- stop$c(timer);
5179
+ stop$d(timer);
5057
5180
  // some customer polyfills for requestIdleCallback return null
5058
5181
  _b = tracker[id];
5059
5182
  return [4 /*yield*/, wait()];
@@ -5124,11 +5247,11 @@ function requestIdleCallbackPolyfill(callback, options) {
5124
5247
  }
5125
5248
  var requestIdleCallback = window["requestIdleCallback"] || requestIdleCallbackPolyfill;
5126
5249
 
5127
- function start$c() {
5250
+ function start$d() {
5128
5251
  schedule(discover, 1 /* Priority.High */).then(function () {
5252
+ measure(compute$7)();
5129
5253
  measure(compute$6)();
5130
- measure(compute$5)();
5131
- measure(compute$9)();
5254
+ measure(compute$a)();
5132
5255
  });
5133
5256
  }
5134
5257
  function discover() {
@@ -5139,7 +5262,7 @@ function discover() {
5139
5262
  case 0:
5140
5263
  ts = time();
5141
5264
  timer = { id: id(), cost: 3 /* Metric.LayoutCost */ };
5142
- start$d(timer);
5265
+ start$e(timer);
5143
5266
  return [4 /*yield*/, traverse$1(document, timer, 0 /* Source.Discover */, ts)];
5144
5267
  case 1:
5145
5268
  _a.sent();
@@ -5147,19 +5270,19 @@ function discover() {
5147
5270
  return [4 /*yield*/, encode$5(5 /* Event.Discover */, timer, ts)];
5148
5271
  case 2:
5149
5272
  _a.sent();
5150
- stop$c(timer);
5273
+ stop$d(timer);
5151
5274
  return [2 /*return*/];
5152
5275
  }
5153
5276
  });
5154
5277
  });
5155
5278
  }
5156
5279
 
5157
- var data$5 = null;
5158
- function start$b() {
5280
+ var data$6 = null;
5281
+ function start$c() {
5159
5282
  if (!config$2.lean && config$2.upgrade) {
5160
5283
  config$2.upgrade("Config" /* Constant.Config */);
5161
5284
  }
5162
- data$5 = null;
5285
+ data$6 = null;
5163
5286
  }
5164
5287
  // Following call will upgrade the session from lean mode into the full mode retroactively from the start of the page.
5165
5288
  // As part of the lean mode, we do not send back any layout information - including discovery of DOM and mutations.
@@ -5169,7 +5292,7 @@ function upgrade(key) {
5169
5292
  // Upgrade only if Clarity was successfully activated on the page
5170
5293
  if (active() && config$2.lean) {
5171
5294
  config$2.lean = false;
5172
- data$5 = { key: key };
5295
+ data$6 = { key: key };
5173
5296
  // Update metadata to track we have upgraded this session
5174
5297
  callback();
5175
5298
  save();
@@ -5179,13 +5302,13 @@ function upgrade(key) {
5179
5302
  }
5180
5303
  encode$1(3 /* Event.Upgrade */);
5181
5304
  if (config$2.lite) {
5182
- start$c();
5183
- start$p();
5305
+ start$d();
5306
+ start$q();
5184
5307
  }
5185
5308
  }
5186
5309
  }
5187
- function stop$b() {
5188
- data$5 = null;
5310
+ function stop$c() {
5311
+ data$6 = null;
5189
5312
  }
5190
5313
 
5191
5314
  function encode$1 (event) {
@@ -5227,15 +5350,15 @@ function encode$1 (event) {
5227
5350
  break;
5228
5351
  }
5229
5352
  case 25 /* Event.Ping */:
5230
- tokens.push(data$i.gap);
5353
+ tokens.push(data$j.gap);
5231
5354
  queue(tokens);
5232
5355
  break;
5233
5356
  case 35 /* Event.Limit */:
5234
- tokens.push(data$4.check);
5357
+ tokens.push(data$5.check);
5235
5358
  queue(tokens, false);
5236
5359
  break;
5237
5360
  case 3 /* Event.Upgrade */:
5238
- tokens.push(data$5.key);
5361
+ tokens.push(data$6.key);
5239
5362
  queue(tokens);
5240
5363
  break;
5241
5364
  case 2 /* Event.Upload */:
@@ -5246,17 +5369,17 @@ function encode$1 (event) {
5246
5369
  break;
5247
5370
  case 24 /* Event.Custom */:
5248
5371
  // not all custom events have a key - if it wasn't passed server handles just value
5249
- data$k.key && tokens.push(data$k.key);
5250
- tokens.push(data$k.value);
5372
+ data$l.key && tokens.push(data$l.key);
5373
+ tokens.push(data$l.value);
5251
5374
  queue(tokens);
5252
5375
  break;
5253
5376
  case 34 /* Event.Variable */: {
5254
- var variableKeys = Object.keys(data$g);
5377
+ var variableKeys = Object.keys(data$h);
5255
5378
  if (variableKeys.length > 0) {
5256
5379
  for (var _i = 0, variableKeys_1 = variableKeys; _i < variableKeys_1.length; _i++) {
5257
5380
  var v = variableKeys_1[_i];
5258
5381
  tokens.push(v);
5259
- tokens.push(data$g[v]);
5382
+ tokens.push(data$h[v]);
5260
5383
  }
5261
5384
  reset$q();
5262
5385
  queue(tokens, false);
@@ -5294,13 +5417,13 @@ function encode$1 (event) {
5294
5417
  break;
5295
5418
  }
5296
5419
  case 36 /* Event.Summary */: {
5297
- var eventKeys = Object.keys(data$h);
5420
+ var eventKeys = Object.keys(data$i);
5298
5421
  if (eventKeys.length > 0) {
5299
5422
  for (var _c = 0, eventKeys_1 = eventKeys; _c < eventKeys_1.length; _c++) {
5300
5423
  var e = eventKeys_1[_c];
5301
5424
  var key = parseInt(e, 10);
5302
5425
  tokens.push(key);
5303
- tokens.push([].concat.apply([], data$h[e]));
5426
+ tokens.push([].concat.apply([], data$i[e]));
5304
5427
  }
5305
5428
  reset$r();
5306
5429
  queue(tokens, false);
@@ -5312,10 +5435,10 @@ function encode$1 (event) {
5312
5435
  extractKeys.forEach(function (e) {
5313
5436
  tokens.push(e);
5314
5437
  var token = [];
5315
- for (var d in data$f[e]) {
5438
+ for (var d in data$g[e]) {
5316
5439
  var key = parseInt(d, 10);
5317
5440
  token.push(key);
5318
- token.push(data$f[e][d]);
5441
+ token.push(data$g[e][d]);
5319
5442
  }
5320
5443
  tokens.push(token);
5321
5444
  });
@@ -5324,57 +5447,57 @@ function encode$1 (event) {
5324
5447
  break;
5325
5448
  }
5326
5449
  case 47 /* Event.Consent */:
5327
- tokens.push(data$l.source);
5328
- tokens.push(data$l.ad_Storage);
5329
- tokens.push(data$l.analytics_Storage);
5450
+ tokens.push(data$3.source);
5451
+ tokens.push(data$3.ad_Storage);
5452
+ tokens.push(data$3.analytics_Storage);
5330
5453
  queue(tokens, false);
5331
5454
  break;
5332
5455
  }
5333
5456
  }
5334
5457
 
5335
- var data$4;
5336
- function start$a() {
5337
- data$4 = { check: 0 /* Check.None */ };
5458
+ var data$5;
5459
+ function start$b() {
5460
+ data$5 = { check: 0 /* Check.None */ };
5338
5461
  }
5339
5462
  function check$2(bytes) {
5340
- if (data$4.check === 0 /* Check.None */) {
5341
- var reason = data$4.check;
5463
+ if (data$5.check === 0 /* Check.None */) {
5464
+ var reason = data$5.check;
5342
5465
  reason = data$1.sequence >= 128 /* Setting.PayloadLimit */ ? 1 /* Check.Payload */ : reason;
5343
5466
  reason = data$1.pageNum >= 128 /* Setting.PageLimit */ ? 7 /* Check.Page */ : reason;
5344
5467
  reason = time() > 7200000 /* Setting.ShutdownLimit */ ? 2 /* Check.Shutdown */ : reason;
5345
5468
  reason = bytes > 10485760 /* Setting.PlaybackBytesLimit */ ? 2 /* Check.Shutdown */ : reason;
5346
- if (reason !== data$4.check) {
5469
+ if (reason !== data$5.check) {
5347
5470
  trigger(reason);
5348
5471
  }
5349
5472
  }
5350
5473
  }
5351
5474
  function trigger(reason) {
5352
- data$4.check = reason;
5475
+ data$5.check = reason;
5353
5476
  // limit the dimensions we collect, but we don't need to stop Clarity entirely if we hit the limit
5354
5477
  if (reason !== 5 /* Check.Collection */) {
5355
5478
  clear();
5356
5479
  stop();
5357
5480
  }
5358
5481
  }
5359
- function compute$3() {
5360
- if (data$4.check !== 0 /* Check.None */) {
5482
+ function compute$4() {
5483
+ if (data$5.check !== 0 /* Check.None */) {
5361
5484
  encode$1(35 /* Event.Limit */);
5362
5485
  }
5363
5486
  }
5364
- function stop$a() {
5365
- data$4 = null;
5487
+ function stop$b() {
5488
+ data$5 = null;
5366
5489
  }
5367
5490
 
5368
- var data$3 = null;
5491
+ var data$4 = null;
5369
5492
  var updates = null;
5370
5493
  var limited = false;
5371
- function start$9() {
5372
- data$3 = {};
5494
+ function start$a() {
5495
+ data$4 = {};
5373
5496
  updates = {};
5374
5497
  limited = false;
5375
5498
  }
5376
- function stop$9() {
5377
- data$3 = {};
5499
+ function stop$a() {
5500
+ data$4 = {};
5378
5501
  updates = {};
5379
5502
  limited = false;
5380
5503
  }
@@ -5383,19 +5506,19 @@ function log(dimension, value) {
5383
5506
  if (value) {
5384
5507
  // Ensure received value is casted into a string if it wasn't a string to begin with
5385
5508
  value = "".concat(value);
5386
- if (!(dimension in data$3)) {
5387
- data$3[dimension] = [];
5509
+ if (!(dimension in data$4)) {
5510
+ data$4[dimension] = [];
5388
5511
  }
5389
- if (data$3[dimension].indexOf(value) < 0) {
5512
+ if (data$4[dimension].indexOf(value) < 0) {
5390
5513
  // Limit check to ensure we have a cap on number of dimensions we can collect
5391
- if (data$3[dimension].length > 128 /* Setting.CollectionLimit */) {
5514
+ if (data$4[dimension].length > 128 /* Setting.CollectionLimit */) {
5392
5515
  if (!limited) {
5393
5516
  limited = true;
5394
5517
  trigger(5 /* Check.Collection */);
5395
5518
  }
5396
5519
  return;
5397
5520
  }
5398
- data$3[dimension].push(value);
5521
+ data$4[dimension].push(value);
5399
5522
  // If this is a new value, track it as part of updates object
5400
5523
  // This allows us to only send back new values in subsequent payloads
5401
5524
  if (!(dimension in updates)) {
@@ -5405,7 +5528,7 @@ function log(dimension, value) {
5405
5528
  }
5406
5529
  }
5407
5530
  }
5408
- function compute$2() {
5531
+ function compute$3() {
5409
5532
  encode$1(1 /* Event.Dimension */);
5410
5533
  }
5411
5534
  function reset$3() {
@@ -5413,15 +5536,75 @@ function reset$3() {
5413
5536
  limited = false;
5414
5537
  }
5415
5538
 
5539
+ var data$3 = null;
5540
+ var updateConsent = true;
5541
+ function start$9() {
5542
+ var _a;
5543
+ var ics = (_a = window.google_tag_data) === null || _a === void 0 ? void 0 : _a.ics;
5544
+ updateConsent = true;
5545
+ if (ics === null || ics === void 0 ? void 0 : ics.addListener) {
5546
+ ics.addListener(["ad_storage" /* Constant.AdStorage */, "analytics_storage" /* Constant.AnalyticsStorage */], processConsent);
5547
+ }
5548
+ }
5549
+ function stop$9() {
5550
+ updateConsent = true;
5551
+ }
5552
+ function processConsent() {
5553
+ var _a;
5554
+ var ics = (_a = window.google_tag_data) === null || _a === void 0 ? void 0 : _a.ics;
5555
+ if (!(ics === null || ics === void 0 ? void 0 : ics.getConsentState)) {
5556
+ return;
5557
+ }
5558
+ var analytics_storage = ics.getConsentState("analytics_storage" /* Constant.AnalyticsStorage */);
5559
+ var ad_storage = ics.getConsentState("ad_storage" /* Constant.AdStorage */);
5560
+ var consentState = getGcmConsentState({ ad_Storage: ad_storage, analytics_Storage: analytics_storage });
5561
+ consentv2(consentState);
5562
+ }
5563
+ function getGcmConsentState(googleConsent) {
5564
+ var consentState = {
5565
+ source: 2 /* ConsentSource.GCM */,
5566
+ ad_Storage: googleConsent.ad_Storage === 1 /* GCMConsent.Granted */ ? "granted" /* Constant.Granted */ : "denied" /* Constant.Denied */,
5567
+ analytics_Storage: googleConsent.analytics_Storage === 1 /* GCMConsent.Granted */ ? "granted" /* Constant.Granted */ : "denied" /* Constant.Denied */,
5568
+ };
5569
+ return consentState;
5570
+ }
5571
+ function config$1(consent) {
5572
+ trackConsent(consent.analytics_Storage ? 1 /* ConsentType.Implicit */ : 0 /* ConsentType.None */);
5573
+ data$3 = consent;
5574
+ }
5575
+ // When we get consent signal as false, we restart the service and track config as false.
5576
+ function consent$1() {
5577
+ trackConsent(2 /* ConsentType.General */);
5578
+ }
5579
+ function trackConsent(consent) {
5580
+ log(36 /* Dimension.Consent */, consent.toString());
5581
+ }
5582
+ function trackConsentv2(consent) {
5583
+ data$3 = consent;
5584
+ encode$1(47 /* Event.Consent */);
5585
+ }
5586
+ // Compute function is called every upload, but we only want to send consent data once.
5587
+ function compute$2() {
5588
+ var _a;
5589
+ if (updateConsent) {
5590
+ encode$1(47 /* Event.Consent */);
5591
+ updateConsent = false;
5592
+ if (!config$2.track) {
5593
+ var ics = (_a = window.google_tag_data) === null || _a === void 0 ? void 0 : _a.ics;
5594
+ if (ics === null || ics === void 0 ? void 0 : ics.usedUpdate) {
5595
+ processConsent();
5596
+ }
5597
+ }
5598
+ }
5599
+ }
5600
+
5416
5601
  var data$2 = null;
5417
5602
  var callbacks = [];
5418
5603
  var electron = 0 /* BooleanFlag.False */;
5419
- var rootDomain = null;
5420
5604
  var consentStatus = null;
5421
- var defaultStatus = { ad_Storage: "denied" /* Constant.Denied */, analytics_Storage: "denied" /* Constant.Denied */ };
5605
+ var defaultStatus = { source: 7 /* ConsentSource.Default */, ad_Storage: "denied" /* Constant.Denied */, analytics_Storage: "denied" /* Constant.Denied */ };
5422
5606
  function start$8() {
5423
5607
  var _a, _b, _c;
5424
- rootDomain = null;
5425
5608
  var ua = navigator && "userAgent" in navigator ? navigator.userAgent : "" /* Constant.Empty */;
5426
5609
  var timezone = (_c = (typeof Intl !== 'undefined' && ((_b = (_a = Intl === null || Intl === void 0 ? void 0 : Intl.DateTimeFormat()) === null || _a === void 0 ? void 0 : _a.resolvedOptions()) === null || _b === void 0 ? void 0 : _b.timeZone))) !== null && _c !== void 0 ? _c : '';
5427
5610
  var timezoneOffset = new Date().getTimezoneOffset().toString();
@@ -5481,13 +5664,15 @@ function start$8() {
5481
5664
  }
5482
5665
  }
5483
5666
  // Track consent config
5667
+ // If consent status is not already set, initialize it based on project configuration. Otherwise, use the existing consent status.
5484
5668
  if (consentStatus === null) {
5485
5669
  consentStatus = {
5670
+ source: u.consent ? 6 /* ConsentSource.Cookie */ : 0 /* ConsentSource.Implicit */,
5486
5671
  ad_Storage: config$2.track ? "granted" /* Constant.Granted */ : "denied" /* Constant.Denied */,
5487
5672
  analytics_Storage: config$2.track ? "granted" /* Constant.Granted */ : "denied" /* Constant.Denied */,
5488
5673
  };
5489
5674
  }
5490
- var consent = getConsentData(consentStatus, 0 /* ConsentSource.Implicit */);
5675
+ var consent = getConsentData(consentStatus);
5491
5676
  config$1(consent);
5492
5677
  // Track ids using a cookie if configuration allows it
5493
5678
  track(u);
@@ -5509,7 +5694,6 @@ function userAgentData() {
5509
5694
  }
5510
5695
  }
5511
5696
  function stop$8() {
5512
- rootDomain = null;
5513
5697
  data$2 = null;
5514
5698
  callbacks.forEach(function (cb) { cb.called = false; });
5515
5699
  }
@@ -5538,31 +5722,35 @@ function id() {
5538
5722
  function consent(status) {
5539
5723
  if (status === void 0) { status = true; }
5540
5724
  if (!status) {
5541
- consentv2();
5725
+ consentv2({ source: 4 /* ConsentSource.APIv1 */, ad_Storage: "denied" /* Constant.Denied */, analytics_Storage: "denied" /* Constant.Denied */ });
5542
5726
  return;
5543
5727
  }
5544
- consentv2({ ad_Storage: "granted" /* Constant.Granted */, analytics_Storage: "granted" /* Constant.Granted */ });
5728
+ consentv2({ source: 4 /* ConsentSource.APIv1 */, ad_Storage: "granted" /* Constant.Granted */, analytics_Storage: "granted" /* Constant.Granted */ });
5545
5729
  consent$1();
5546
5730
  }
5547
5731
  function consentv2(consentState, source) {
5732
+ var _a;
5548
5733
  if (consentState === void 0) { consentState = defaultStatus; }
5549
- if (source === void 0) { source = 1 /* ConsentSource.API */; }
5734
+ if (source === void 0) { source = 5 /* ConsentSource.APIv2 */; }
5550
5735
  var updatedStatus = {
5551
- ad_Storage: normalizeConsent(consentState.ad_Storage),
5552
- analytics_Storage: normalizeConsent(consentState.analytics_Storage)
5736
+ source: (_a = consentState.source) !== null && _a !== void 0 ? _a : source,
5737
+ ad_Storage: normalizeConsent(consentState.ad_Storage, consentStatus === null || consentStatus === void 0 ? void 0 : consentStatus.ad_Storage),
5738
+ analytics_Storage: normalizeConsent(consentState.analytics_Storage, consentStatus === null || consentStatus === void 0 ? void 0 : consentStatus.analytics_Storage),
5553
5739
  };
5554
5740
  if (consentStatus &&
5555
5741
  updatedStatus.ad_Storage === consentStatus.ad_Storage &&
5556
5742
  updatedStatus.analytics_Storage === consentStatus.analytics_Storage) {
5743
+ consentStatus.source = updatedStatus.source;
5744
+ trackConsentv2(getConsentData(consentStatus));
5745
+ consent$1();
5557
5746
  return;
5558
5747
  }
5559
5748
  consentStatus = updatedStatus;
5560
5749
  callback(true);
5561
- var consentData = getConsentData(consentStatus, source);
5750
+ var consentData = getConsentData(consentStatus);
5562
5751
  if (!consentData.analytics_Storage && config$2.track) {
5563
5752
  config$2.track = false;
5564
- setCookie("_clsk" /* Constant.SessionKey */, "" /* Constant.Empty */, -Number.MAX_VALUE);
5565
- setCookie("_clck" /* Constant.CookieKey */, "" /* Constant.Empty */, -Number.MAX_VALUE);
5753
+ clear(true);
5566
5754
  stop();
5567
5755
  window.setTimeout(start, 250 /* Setting.RestartDelay */);
5568
5756
  return;
@@ -5575,20 +5763,27 @@ function consentv2(consentState, source) {
5575
5763
  trackConsentv2(consentData);
5576
5764
  consent$1();
5577
5765
  }
5578
- function getConsentData(consentState, source) {
5766
+ function getConsentData(consentState) {
5767
+ var _a;
5579
5768
  var consent = {
5580
- source: source,
5769
+ source: (_a = consentState.source) !== null && _a !== void 0 ? _a : 0 /* ConsentSource.Implicit */,
5581
5770
  ad_Storage: consentState.ad_Storage === "granted" /* Constant.Granted */ ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */,
5582
5771
  analytics_Storage: consentState.analytics_Storage === "granted" /* Constant.Granted */ ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */,
5583
5772
  };
5584
5773
  return consent;
5585
5774
  }
5586
- function normalizeConsent(value) {
5587
- return typeof value === 'string' ? value.toLowerCase() : "denied" /* Constant.Denied */;
5775
+ function normalizeConsent(value, fallback) {
5776
+ if (fallback === void 0) { fallback = "denied" /* Constant.Denied */; }
5777
+ return typeof value === 'string' ? value.toLowerCase() : fallback;
5588
5778
  }
5589
- function clear() {
5779
+ function clear(all) {
5780
+ if (all === void 0) { all = false; }
5590
5781
  // Clear any stored information in the cookie that tracks session information so we can restart fresh the next time
5591
- setCookie("_clsk" /* Constant.SessionKey */, "" /* Constant.Empty */, 0);
5782
+ setCookie("_clsk" /* Constant.SessionKey */, "" /* Constant.Empty */, -Number.MAX_VALUE);
5783
+ // Clear user cookie as well if all flag is set
5784
+ if (all) {
5785
+ setCookie("_clck" /* Constant.CookieKey */, "" /* Constant.Empty */, -Number.MAX_VALUE);
5786
+ }
5592
5787
  }
5593
5788
  function tab() {
5594
5789
  var id = shortid();
@@ -5610,7 +5805,7 @@ function save() {
5610
5805
  var ts = Math.round(Date.now());
5611
5806
  var upload = config$2.upload && typeof config$2.upload === "string" /* Constant.String */ ? config$2.upload.replace("https://" /* Constant.HTTPS */, "" /* Constant.Empty */) : "" /* Constant.Empty */;
5612
5807
  var upgrade = config$2.lean ? 0 /* BooleanFlag.False */ : 1 /* BooleanFlag.True */;
5613
- setCookie("_clsk" /* Constant.SessionKey */, [data$2.sessionId, ts, data$2.pageNum, upgrade, upload].join("^" /* Constant.Caret */), 1 /* Setting.SessionExpire */);
5808
+ setCookie("_clsk" /* Constant.SessionKey */, [data$2.sessionId, ts, data$2.pageNum, upgrade, upload].join(COOKIE_SEP), 1 /* Setting.SessionExpire */);
5614
5809
  }
5615
5810
  function processCallback(upgrade, consentUpdate) {
5616
5811
  if (consentUpdate === void 0) { consentUpdate = false; }
@@ -5630,14 +5825,6 @@ function processCallback(upgrade, consentUpdate) {
5630
5825
  }
5631
5826
  }
5632
5827
  }
5633
- function supported(target, api) {
5634
- try {
5635
- return !!target[api];
5636
- }
5637
- catch (_a) {
5638
- return false;
5639
- }
5640
- }
5641
5828
  function track(u, consent) {
5642
5829
  if (consent === void 0) { consent = null; }
5643
5830
  // If consent is not explicitly specified, infer it from the user object
@@ -5650,7 +5837,7 @@ function track(u, consent) {
5650
5837
  // To avoid cookie churn, write user id cookie only once every day
5651
5838
  if (u.expiry === null || Math.abs(end - u.expiry) >= 1 /* Setting.CookieInterval */ || u.consent !== consent || u.dob !== dob) {
5652
5839
  var cookieParts = [data$2.userId, 2 /* Setting.CookieVersion */, end.toString(36), consent, dob];
5653
- setCookie("_clck" /* Constant.CookieKey */, cookieParts.join("^" /* Constant.Caret */), 365 /* Setting.Expire */);
5840
+ setCookie("_clck" /* Constant.CookieKey */, cookieParts.join(COOKIE_SEP), 365 /* Setting.Expire */);
5654
5841
  }
5655
5842
  }
5656
5843
  function shortid() {
@@ -5709,93 +5896,6 @@ function user() {
5709
5896
  }
5710
5897
  return output;
5711
5898
  }
5712
- function getCookie(key, limit) {
5713
- var _a;
5714
- if (limit === void 0) { limit = false; }
5715
- if (supported(document, "cookie" /* Constant.Cookie */)) {
5716
- var cookies = document.cookie.split(";" /* Constant.Semicolon */);
5717
- if (cookies) {
5718
- for (var i = 0; i < cookies.length; i++) {
5719
- var pair = cookies[i].split("=" /* Constant.Equals */);
5720
- if (pair.length > 1 && pair[0] && pair[0].trim() === key) {
5721
- // Some browsers automatically url encode cookie values if they are not url encoded.
5722
- // We therefore encode and decode cookie values ourselves.
5723
- // For backwards compatability we need to consider 3 cases:
5724
- // * Cookie was previously not encoded by Clarity and browser did not encode it
5725
- // * Cookie was previously not encoded by Clarity and browser encoded it once or more
5726
- // * Cookie was previously encoded by Clarity and browser did not encode it
5727
- var _b = decodeCookieValue(pair[1]), isEncoded = _b[0], decodedValue = _b[1];
5728
- while (isEncoded) {
5729
- _a = decodeCookieValue(decodedValue), isEncoded = _a[0], decodedValue = _a[1];
5730
- }
5731
- // If we are limiting cookies, check if the cookie value is limited
5732
- if (limit) {
5733
- return decodedValue.endsWith("".concat("~" /* Constant.Tilde */, "1"))
5734
- ? decodedValue.substring(0, decodedValue.length - 2)
5735
- : null;
5736
- }
5737
- return decodedValue;
5738
- }
5739
- }
5740
- }
5741
- }
5742
- return null;
5743
- }
5744
- function decodeCookieValue(value) {
5745
- try {
5746
- var decodedValue = decodeURIComponent(value);
5747
- return [decodedValue != value, decodedValue];
5748
- }
5749
- catch (_a) {
5750
- }
5751
- return [false, value];
5752
- }
5753
- function encodeCookieValue(value) {
5754
- return encodeURIComponent(value);
5755
- }
5756
- function setCookie(key, value, time) {
5757
- // only write cookies if we are currently in a cookie writing mode (and they are supported)
5758
- // OR if we are trying to write an empty cookie (i.e. clear the cookie value out)
5759
- if ((config$2.track || value == "" /* Constant.Empty */) && ((navigator && navigator.cookieEnabled) || supported(document, "cookie" /* Constant.Cookie */))) {
5760
- // Some browsers automatically url encode cookie values if they are not url encoded.
5761
- // We therefore encode and decode cookie values ourselves.
5762
- var encodedValue = encodeCookieValue(value);
5763
- var expiry = new Date();
5764
- expiry.setDate(expiry.getDate() + time);
5765
- var expires = expiry ? "expires=" /* Constant.Expires */ + expiry.toUTCString() : "" /* Constant.Empty */;
5766
- var cookie = "".concat(key, "=").concat(encodedValue).concat(";" /* Constant.Semicolon */).concat(expires).concat(";path=/" /* Constant.Path */);
5767
- try {
5768
- // Attempt to get the root domain only once and fall back to writing cookie on the current domain.
5769
- if (rootDomain === null) {
5770
- var hostname = location.hostname ? location.hostname.split("." /* Constant.Dot */) : [];
5771
- // Walk backwards on a domain and attempt to set a cookie, until successful
5772
- for (var i = hostname.length - 1; i >= 0; i--) {
5773
- rootDomain = ".".concat(hostname[i]).concat(rootDomain ? rootDomain : "" /* Constant.Empty */);
5774
- // We do not wish to attempt writing a cookie on the absolute last part of the domain, e.g. .com or .net.
5775
- // So we start attempting after second-last part, e.g. .domain.com (PASS) or .co.uk (FAIL)
5776
- if (i < hostname.length - 1) {
5777
- // Write the cookie on the current computed top level domain
5778
- document.cookie = "".concat(cookie).concat(";" /* Constant.Semicolon */).concat("domain=" /* Constant.Domain */).concat(rootDomain);
5779
- // Once written, check if the cookie exists and its value matches exactly with what we intended to set
5780
- // Checking for exact value match helps us eliminate a corner case where the cookie may already be present with a different value
5781
- // If the check is successful, no more action is required and we can return from the function since rootDomain cookie is already set
5782
- // If the check fails, continue with the for loop until we can successfully set and verify the cookie
5783
- if (getCookie(key) === value) {
5784
- return;
5785
- }
5786
- }
5787
- }
5788
- // Finally, if we were not successful and gone through all the options, play it safe and reset rootDomain to be empty
5789
- // This forces our code to fall back to always writing cookie to the current domain
5790
- rootDomain = "" /* Constant.Empty */;
5791
- }
5792
- }
5793
- catch (_a) {
5794
- rootDomain = "" /* Constant.Empty */;
5795
- }
5796
- document.cookie = rootDomain ? "".concat(cookie).concat(";" /* Constant.Semicolon */).concat("domain=" /* Constant.Domain */).concat(rootDomain) : cookie;
5797
- }
5798
- }
5799
5899
 
5800
5900
  var data$1 = null;
5801
5901
  function start$7() {
@@ -5847,11 +5947,9 @@ function reset$2() {
5847
5947
  history$1 = [];
5848
5948
  }
5849
5949
  function report(e) {
5850
- console.log("\uD83D\uDE80 \uD83D\uDC25 ~ report ~ e:", e);
5851
5950
  // Do not report the same message twice for the same page
5852
5951
  if (history$1 && history$1.indexOf(e.message) === -1) {
5853
5952
  var url = config$2.report;
5854
- console.log("\uD83D\uDE80 \uD83D\uDC25 ~ report ~ url:", url);
5855
5953
  if (url && url.length > 0 && data$1) {
5856
5954
  var payload = { v: data$1.version, p: data$1.projectId, u: data$1.userId, s: data$1.sessionId, n: data$1.pageNum };
5857
5955
  if (e.message) {
@@ -5863,7 +5961,6 @@ function report(e) {
5863
5961
  // Using POST request instead of a GET request (img-src) to not violate existing CSP rules
5864
5962
  // Since, Clarity already uses XHR to upload data, we stick with similar POST mechanism for reporting too
5865
5963
  var xhr = new XMLHttpRequest();
5866
- console.log("\uD83D\uDE80 \uD83D\uDC25 ~ report ~ xhr:", xhr);
5867
5964
  xhr.open("POST", url, true);
5868
5965
  xhr.send(JSON.stringify(payload));
5869
5966
  history$1.push(e.message);
@@ -5998,7 +6095,7 @@ function stop$6() {
5998
6095
  var status = false;
5999
6096
  function start$5() {
6000
6097
  status = true;
6001
- start$M();
6098
+ start$N();
6002
6099
  reset$4();
6003
6100
  reset$1();
6004
6101
  reset$2();
@@ -6009,7 +6106,7 @@ function stop$5() {
6009
6106
  reset$2();
6010
6107
  reset$1();
6011
6108
  reset$4();
6012
- stop$J();
6109
+ stop$K();
6013
6110
  status = false;
6014
6111
  }
6015
6112
  function active() {
@@ -6065,12 +6162,12 @@ function restart() {
6065
6162
  }
6066
6163
 
6067
6164
  function start$4() {
6068
- start$D();
6165
+ start$E();
6166
+ start$g();
6069
6167
  start$f();
6070
- start$e();
6071
6168
  }
6072
6169
  function stop$4() {
6073
- stop$d();
6170
+ stop$e();
6074
6171
  }
6075
6172
 
6076
6173
  var diagnostic = /*#__PURE__*/Object.freeze({
@@ -6082,31 +6179,31 @@ var diagnostic = /*#__PURE__*/Object.freeze({
6082
6179
  function start$3() {
6083
6180
  // The order below is important
6084
6181
  // and is determined by interdependencies of modules
6085
- start$m();
6086
- start$j();
6182
+ start$n();
6087
6183
  start$k();
6184
+ start$l();
6088
6185
  if (config$2.delayDom) {
6089
6186
  // Lazy load layout module as part of page load time performance improvements experiment
6090
6187
  bind(window, 'load', function () {
6091
- start$l();
6188
+ start$m();
6092
6189
  });
6093
6190
  }
6094
6191
  else {
6095
- start$l();
6192
+ start$m();
6096
6193
  }
6097
- start$c();
6194
+ start$d();
6195
+ start$q();
6098
6196
  start$p();
6099
6197
  start$o();
6100
- start$n();
6101
6198
  }
6102
6199
  function stop$3() {
6103
- stop$h();
6104
6200
  stop$i();
6105
6201
  stop$j();
6106
6202
  stop$k();
6203
+ stop$l();
6204
+ stop$o();
6107
6205
  stop$n();
6108
6206
  stop$m();
6109
- stop$l();
6110
6207
  }
6111
6208
 
6112
6209
  var layout = /*#__PURE__*/Object.freeze({
@@ -6407,7 +6504,7 @@ function start(config$1) {
6407
6504
  if (check()) {
6408
6505
  config(config$1);
6409
6506
  start$5();
6410
- start$E();
6507
+ start$F();
6411
6508
  modules.forEach(function (x) { return measure(x.start)(); });
6412
6509
  // If it's an internal call to start, without explicit configuration,
6413
6510
  // re-process any newly accumulated items in the queue
@@ -6437,11 +6534,8 @@ function resume() {
6437
6534
  function stop() {
6438
6535
  if (active()) {
6439
6536
  // Stop modules in the reverse order of their initialization and start queuing up items again
6440
- modules
6441
- .slice()
6442
- .reverse()
6443
- .forEach(function (x) { return measure(x.stop)(); });
6444
- stop$B();
6537
+ modules.slice().reverse().forEach(function (x) { return measure(x.stop)(); });
6538
+ stop$C();
6445
6539
  stop$5();
6446
6540
  setup();
6447
6541
  }