@gemx-dev/clarity-js 0.8.47 → 0.8.49

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