@qbix/q.js 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,8 +6,8 @@ Size: ~40KB (Minified + GZipped), [compare to other frameworks](https://gist.git
6
6
  How to use: copy contents of `dist` into your project, and then include it like this:
7
7
  | File Type | Code to Use |
8
8
  |------------|-------------|
9
- |`.html` files| `<script type="module" src="https://unpkg.com/@qbix/q.js@1.0.2/dist/Q.min.js">`|
10
- |`.js` or `.ts` files|`import Q from 'https://unpkg.com/@qbix/q.js@1.0.2/dist/Q.min.js';`
9
+ |`.html` files| `<script type="module" src="https://unpkg.com/@qbix/q/dist/Q.min.js">`|
10
+ |`.js` or `.ts` files|`import Q from 'https://unpkg.com/@qbix/q/dist/Q.min.js';`
11
11
  |<img src="https://github.com/user-attachments/assets/ba3df93e-0cd8-4189-93fc-11947b63b684" alt="Description" width="100" height="87"> | Full documentation here: https://qbix.com/platform/guide/javascript |
12
12
 
13
13
  This is part of the much larger full-stack [Qbix Platform](https://github.com/Qbix/Platform) that contains many pre-built reusable tools, plugins, and requires PHP and Node.js on the back-end. If you want to build an entire full-stack social network like Facebook you're well-advised to go with that. But if you just want to use the lightweight front-end core, with your own back-end and other frameworks, then start with this framework here.
@@ -646,17 +646,15 @@ In it, you will define the tools, methods, and other things. Here is an example:
646
646
  | **Learning Curve** 📚 | **Simple (declarative, minimal magic)** | Medium-high (hooks, context, JSX) | Medium (directives, reactivity caveats) | High (decorators, DI, RxJS) | Medium |
647
647
  | **Best For** ✅ | **High-performance apps, real-time dashboards, low-latency UI, social platforms** | Full-scale apps, large component hierarchies | Small-to-medium apps, good DX | Enterprise-scale apps | Small-to-medium apps, hobby projects |
648
648
 
649
- ```
650
-
651
649
 
652
650
  # 📊 Metrics.js — Standalone Telemetry
653
651
 
654
652
  This repo also includes **Metrics.js** — a standalone telemetry library that tracks scroll depth, section engagement, and video/audio playback across 9 embed providers. No dependencies, no build step, works on any website.
655
653
 
656
654
  ```html
657
- <script src="https://unpkg.com/@qbix/q.js/dist/Metrics.js"></script>
655
+ <script src="https://unpkg.com/@qbix/q/dist/Metrics.js"></script>
658
656
  <script>
659
- Metrics.init({ endpoint: '/telemetry', page: document.title });
657
+ Metrics.init(); // sends to invites.to by default — or pass {endpoint: '/your-own'}
660
658
  Metrics.ScrollTracker.init({ sections: 'h2[id]' });
661
659
  Metrics.MediaTracker.init(); // auto-discovers YouTube, Vimeo, SoundCloud, Wistia, JW Player, Dailymotion, Spotify, Twitch, Muse.ai
662
660
  </script>
package/dist/Metrics.js CHANGED
@@ -19,6 +19,12 @@ Metrics._visitorKey = 'metrics_vid';
19
19
  Metrics._sid = null;
20
20
  Metrics._vid = null;
21
21
 
22
+ /**
23
+ * Get or create a per-tab session ID (sessionStorage).
24
+ * A new ID is generated for each browser tab.
25
+ * @method getSessionId
26
+ * @return {String} The session ID
27
+ */
22
28
  Metrics.getSessionId = function () {
23
29
  if (Metrics._sid) return Metrics._sid;
24
30
  try {
@@ -38,20 +44,14 @@ Metrics.getSessionId = function () {
38
44
  * Get or create a persistent visitor ID that survives across sessions.
39
45
  * Tries localStorage first (persists until cleared).
40
46
  * Falls back to sessionStorage (ITP-safe, but per-tab only).
41
- * Either way, ITP won't block it both are first-party storage
42
- * when the script runs on the page's own domain.
43
- * When loaded cross-origin (e.g. from invites.to CDN onto
44
- * summerfest.com), localStorage may be partitioned by Safari's
45
- * ITP — meaning the same visitor gets different vids on different
46
- * sites. This is fine: the inv_token from the redirect query
47
- * string is what links visits across domains, not the vid.
47
+ * When loaded cross-origin (e.g. from a CDN), localStorage is still
48
+ * first-party to the page's domain ITP won't block it.
48
49
  * @method getVisitorId
49
- * @return {String}
50
+ * @return {String} The visitor ID
50
51
  */
51
52
  Metrics.getVisitorId = function () {
52
53
  if (Metrics._vid) return Metrics._vid;
53
54
  var vid = null;
54
- // Try localStorage first (persistent)
55
55
  try {
56
56
  vid = localStorage.getItem(Metrics._visitorKey);
57
57
  if (!vid) {
@@ -61,8 +61,7 @@ Metrics.getVisitorId = function () {
61
61
  }
62
62
  Metrics._vid = vid;
63
63
  return vid;
64
- } catch (e) { /* localStorage blocked or full */ }
65
- // Fall back to sessionStorage
64
+ } catch (e) {}
66
65
  try {
67
66
  vid = sessionStorage.getItem(Metrics._visitorKey);
68
67
  if (!vid) {
@@ -72,8 +71,7 @@ Metrics.getVisitorId = function () {
72
71
  }
73
72
  Metrics._vid = vid;
74
73
  return vid;
75
- } catch (e) { /* sessionStorage blocked */ }
76
- // Last resort: in-memory only (won't survive page reload)
74
+ } catch (e) {}
77
75
  vid = Math.random().toString(36).slice(2) + Date.now().toString(36)
78
76
  + Math.random().toString(36).slice(2);
79
77
  Metrics._vid = vid;
@@ -82,6 +80,7 @@ Metrics.getVisitorId = function () {
82
80
 
83
81
  // ── Transport (standalone — overridden by Q integration below) ──
84
82
 
83
+ Metrics._defaultEndpoint = 'https://invites.to/metrics';
85
84
  Metrics._endpoint = null;
86
85
  Metrics._page = null;
87
86
  Metrics._extra = null;
@@ -101,6 +100,8 @@ Metrics.send = function (label, data) {
101
100
  var payload = {
102
101
  session: Metrics.getSessionId(),
103
102
  visitor: Metrics.getVisitorId(),
103
+ origin: location.origin,
104
+ url: location.pathname + location.search + location.hash,
104
105
  page: Metrics._page || document.title,
105
106
  label: label,
106
107
  t: Date.now()
@@ -252,7 +253,7 @@ function _sendUnload() {
252
253
  */
253
254
  Metrics.init = function (options) {
254
255
  options = options || {};
255
- if (options.endpoint) Metrics._endpoint = options.endpoint;
256
+ Metrics._endpoint = options.endpoint || Metrics._defaultEndpoint;
256
257
  if (options.page) Metrics._page = options.page;
257
258
  if (options.sessionKey) Metrics._sessionKey = options.sessionKey;
258
259
  if (options.sessionId) Metrics._sid = options.sessionId;
@@ -263,7 +264,27 @@ Metrics.init = function (options) {
263
264
  _bindUnload();
264
265
  }
265
266
 
266
- Metrics.send('loaded');
267
+ // Context snapshot — sent once with the "loaded" event
268
+ var ctx = {
269
+ referrer: document.referrer || '',
270
+ screen: screen.width + 'x' + screen.height,
271
+ viewport: window.innerWidth + 'x' + window.innerHeight,
272
+ dpr: window.devicePixelRatio || 1,
273
+ lang: navigator.language || '',
274
+ touch: ('ontouchstart' in window) || (navigator.maxTouchPoints > 0)
275
+ };
276
+ try { ctx.tz = Intl.DateTimeFormat().resolvedOptions().timeZone; } catch (e) {}
277
+ try {
278
+ if (navigator.connection && navigator.connection.effectiveType) {
279
+ ctx.conn = navigator.connection.effectiveType;
280
+ }
281
+ } catch (e) {}
282
+ try {
283
+ var nav = performance.getEntriesByType('navigation');
284
+ if (nav && nav[0]) ctx.navType = nav[0].type;
285
+ } catch (e) {}
286
+
287
+ Metrics.send('loaded', ctx);
267
288
  return Metrics;
268
289
  };
269
290
 
@@ -863,338 +884,6 @@ Metrics.ScrollTracker = {
863
884
 
864
885
  })(typeof window !== 'undefined' ? window : this);
865
886
 
866
- /**
867
- * Metrics.ScrollTracker — Section-aware scroll telemetry
868
- *
869
- * Tracks which sections a user reads, how far they scroll,
870
- * and what they click. Delegates transport, session, visibility,
871
- * and unload handling to the core Metrics object.
872
- *
873
- * Usage (standalone):
874
- * Metrics.init({ endpoint: '/telemetry.php', page: 'My Page' });
875
- * Metrics.ScrollTracker.init({
876
- * sections: 'h2[id], h3[id]',
877
- * debounce: 1000
878
- * });
879
- *
880
- * Usage (with Q framework):
881
- * // Auto-initializes from config if endpoint is set
882
- *
883
- * @module Metrics
884
- * @class Metrics.ScrollTracker
885
- */
886
- "use strict";
887
- (function (root) {
888
-
889
- var Metrics = root.Metrics;
890
- if (!Metrics) {
891
- console.warn('Metrics.ScrollTracker: Metrics core not loaded');
892
- return;
893
- }
894
-
895
- var defaults = {
896
- // CSS selector for sections to track
897
- sections: 'h2[id], h3[id], section[id], [data-section]',
898
-
899
- // Minimum pixel height for auto-detected containers
900
- minSectionHeight: 100,
901
-
902
- // Milliseconds to wait after scroll stops before firing
903
- debounce: 1000,
904
-
905
- // Milliseconds to wait on page load (ignores scroll restoration)
906
- initDelay: 800,
907
-
908
- // Milliseconds to suppress tracking after anchor click
909
- anchorCooldown: 1500,
910
-
911
- // Scroll depth milestones (percentage)
912
- depthMilestones: [25, 50, 75, 100],
913
-
914
- // Max px above viewport top to consider a section "current"
915
- sectionLookback: 300,
916
-
917
- // Scroll considered settled if moved less than this (px)
918
- settleTolerance: 2,
919
-
920
- // Recheck interval when not settled (ms)
921
- recheckInterval: 500,
922
-
923
- // Track link/anchor clicks
924
- trackClicks: true,
925
-
926
- // Visual TOC highlighting selector (real-time, not debounced)
927
- tocSelector: null,
928
- tocActiveClass: 'active',
929
- tocSectionSelector: 'h2[id]'
930
- };
931
-
932
- // ── State ──
933
- var state = {
934
- initialized: false,
935
- options: null,
936
- sections: [],
937
- tocSections: [],
938
- seen: {},
939
- depthHit: {},
940
- scrollTimer: null,
941
- anchorCooling: false,
942
- _prevY: -1
943
- };
944
-
945
- // ── Section Discovery ──
946
-
947
- function discoverSections(selector) {
948
- var elements = document.querySelectorAll(selector);
949
- var result = [];
950
- var ordinal = 0;
951
- var minH = (state.options && state.options.minSectionHeight) || 0;
952
-
953
- for (var i = 0; i < elements.length; i++) {
954
- var el = elements[i];
955
- if (el.offsetHeight < minH) continue;
956
-
957
- if (!el.id) {
958
- var text = (el.textContent || '').trim().slice(0, 60);
959
- var slug = text.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '');
960
- el.id = slug || ('section-' + ordinal);
961
- }
962
-
963
- result.push({
964
- el: el,
965
- id: el.id,
966
- tag: el.tagName.toLowerCase(),
967
- ordinal: ordinal++,
968
- snippet: (el.textContent || '').trim().slice(0, 80)
969
- });
970
- }
971
- return result;
972
- }
973
-
974
- // ── Find Current Section ──
975
-
976
- function findCurrentSection() {
977
- var scrollY = window.scrollY || window.pageYOffset;
978
- var opts = state.options;
979
- var best = null;
980
- var bestDist = Infinity;
981
-
982
- for (var i = 0; i < state.sections.length; i++) {
983
- var sec = state.sections[i];
984
- var top = sec.el.offsetTop;
985
- if (top <= scrollY + opts.sectionLookback) {
986
- var dist = Math.abs(top - scrollY - 180);
987
- if (dist < bestDist) {
988
- bestDist = dist;
989
- best = sec;
990
- }
991
- }
992
- }
993
- return best;
994
- }
995
-
996
- // ── Scroll Settle Detection ──
997
-
998
- function onScrollSettle() {
999
- var opts = state.options;
1000
- var curY = window.scrollY || window.pageYOffset;
1001
-
1002
- if (Math.abs(curY - state._prevY) > opts.settleTolerance) {
1003
- state._prevY = curY;
1004
- state.scrollTimer = setTimeout(onScrollSettle, opts.recheckInterval);
1005
- return;
1006
- }
1007
-
1008
- // Settled — report section
1009
- var current = findCurrentSection();
1010
- if (current && !state.seen[current.id]) {
1011
- state.seen[current.id] = true;
1012
- Metrics.send('section:' + current.id, {
1013
- tag: current.tag,
1014
- ordinal: current.ordinal,
1015
- snippet: current.snippet
1016
- });
1017
- }
1018
-
1019
- // Report depth
1020
- var docH = document.documentElement.scrollHeight - window.innerHeight;
1021
- if (docH > 0) {
1022
- var pct = Math.round((curY / docH) * 100);
1023
- for (var j = 0; j < opts.depthMilestones.length; j++) {
1024
- var m = opts.depthMilestones[j];
1025
- if (pct >= m && !state.depthHit[m]) {
1026
- state.depthHit[m] = true;
1027
- Metrics.send('depth:' + m + '%');
1028
- }
1029
- }
1030
- }
1031
- }
1032
-
1033
- function onScroll() {
1034
- if (state.anchorCooling) return;
1035
- clearTimeout(state.scrollTimer);
1036
- state._prevY = window.scrollY || window.pageYOffset;
1037
- state.scrollTimer = setTimeout(onScrollSettle, state.options.debounce);
1038
- }
1039
-
1040
- // ── TOC Highlighting (real-time) ──
1041
-
1042
- function updateTocHighlight() {
1043
- var opts = state.options;
1044
- if (!opts.tocSelector) return;
1045
-
1046
- var scrollY = window.scrollY || window.pageYOffset;
1047
- var currentId = '';
1048
-
1049
- for (var i = 0; i < state.tocSections.length; i++) {
1050
- if (scrollY >= state.tocSections[i].el.offsetTop - 160) {
1051
- currentId = state.tocSections[i].id;
1052
- }
1053
- }
1054
-
1055
- var links = document.querySelectorAll(opts.tocSelector);
1056
- for (var j = 0; j < links.length; j++) {
1057
- links[j].classList.remove(opts.tocActiveClass);
1058
- if (links[j].getAttribute('href') === '#' + currentId) {
1059
- links[j].classList.add(opts.tocActiveClass);
1060
- }
1061
- }
1062
- }
1063
-
1064
- // ── Click Tracking ──
1065
-
1066
- function onDocumentClick(e) {
1067
- var a = e.target.closest('a[href]');
1068
- if (!a) return;
1069
-
1070
- var href = a.getAttribute('href') || '';
1071
-
1072
- if (href.charAt(0) === '#') {
1073
- // Anchor click — cooldown to suppress scroll tracking
1074
- state.anchorCooling = true;
1075
- setTimeout(function () { state.anchorCooling = false; },
1076
- state.options.anchorCooldown);
1077
- Metrics.send('anchor:' + href.slice(1));
1078
- return;
1079
- }
1080
-
1081
- // External link
1082
- var label = a.dataset.track || 'link:' + href;
1083
- Metrics.send(label);
1084
- }
1085
-
1086
- // ── Pre-mark Initial State ──
1087
-
1088
- function premarkInitialState() {
1089
- var scrollY = window.scrollY || window.pageYOffset;
1090
-
1091
- for (var i = 0; i < state.sections.length; i++) {
1092
- var rect = state.sections[i].el.getBoundingClientRect();
1093
- if (rect.top >= -100 && rect.top < window.innerHeight) {
1094
- state.seen[state.sections[i].id] = true;
1095
- }
1096
- }
1097
-
1098
- var docH = document.documentElement.scrollHeight - window.innerHeight;
1099
- if (docH > 0) {
1100
- var pct = Math.round((scrollY / docH) * 100);
1101
- for (var j = 0; j < state.options.depthMilestones.length; j++) {
1102
- var m = state.options.depthMilestones[j];
1103
- if (pct >= m) state.depthHit[m] = true;
1104
- }
1105
- }
1106
- }
1107
-
1108
- // ── Public API ──
1109
-
1110
- Metrics.ScrollTracker = {
1111
-
1112
- init: function (options) {
1113
- if (state.initialized) {
1114
- console.warn('Metrics.ScrollTracker already initialized');
1115
- return this;
1116
- }
1117
-
1118
- var opts = {};
1119
- var k;
1120
- for (k in defaults) { if (defaults.hasOwnProperty(k)) opts[k] = defaults[k]; }
1121
- for (k in (options || {})) { if (options.hasOwnProperty(k) && options[k] !== undefined) opts[k] = options[k]; }
1122
- state.options = opts;
1123
- state.initialized = true;
1124
-
1125
- // If Metrics core hasn't been initialized yet with an endpoint,
1126
- // initialize it now from our options
1127
- if (!Metrics._endpoint && options && options.endpoint) {
1128
- Metrics.init({
1129
- endpoint: options.endpoint,
1130
- page: options.page,
1131
- sessionKey: options.sessionKey,
1132
- sessionId: options.sessionId,
1133
- extra: options.extra,
1134
- trackUnload: options.trackUnload
1135
- });
1136
- }
1137
-
1138
- // Delayed init — let scroll restoration settle
1139
- setTimeout(function () {
1140
- state.sections = discoverSections(opts.sections);
1141
-
1142
- if (opts.tocSelector && opts.tocSectionSelector) {
1143
- state.tocSections = discoverSections(opts.tocSectionSelector);
1144
- }
1145
-
1146
- premarkInitialState();
1147
-
1148
- window.addEventListener('scroll', onScroll, { passive: true });
1149
-
1150
- if (opts.tocSelector) {
1151
- window.addEventListener('scroll', updateTocHighlight, { passive: true });
1152
- updateTocHighlight();
1153
- }
1154
- }, opts.initDelay);
1155
-
1156
- if (opts.trackClicks) {
1157
- document.addEventListener('click', onDocumentClick);
1158
- }
1159
-
1160
- return this;
1161
- },
1162
-
1163
- send: function (label, data) { Metrics.send(label, data); },
1164
- markSeen: function (id) { state.seen[id] = true; },
1165
- getSessionId: function () { return Metrics.getSessionId(); },
1166
- getSections: function () {
1167
- return state.sections.map(function (s) {
1168
- return { id: s.id, tag: s.tag, ordinal: s.ordinal, snippet: s.snippet };
1169
- });
1170
- },
1171
- getSeen: function () {
1172
- var copy = {};
1173
- for (var k in state.seen) copy[k] = true;
1174
- return copy;
1175
- },
1176
- reset: function () {
1177
- state.seen = {};
1178
- state.depthHit = {};
1179
- state.anchorCooling = false;
1180
- clearTimeout(state.scrollTimer);
1181
- state.sections = discoverSections(state.options.sections);
1182
- premarkInitialState();
1183
- },
1184
- destroy: function () {
1185
- window.removeEventListener('scroll', onScroll);
1186
- window.removeEventListener('scroll', updateTocHighlight);
1187
- document.removeEventListener('click', onDocumentClick);
1188
- clearTimeout(state.scrollTimer);
1189
- state.initialized = false;
1190
- },
1191
-
1192
- defaults: defaults,
1193
- state: state
1194
- };
1195
-
1196
- })(typeof window !== 'undefined' ? window : this);
1197
-
1198
887
  /**
1199
888
  * Metrics.NavigationTracker — Track how users navigate and explore content
1200
889
  *
@@ -1,95 +1,160 @@
1
- var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(c,k,d){c!=Array.prototype&&c!=Object.prototype&&(c[k]=d.value)};$jscomp.getGlobal=function(c){return"undefined"!=typeof window&&window===c?c:"undefined"!=typeof global&&null!=global?global:c};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";
2
- $jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.Symbol=function(){var c=0;return function(k){return $jscomp.SYMBOL_PREFIX+(k||"")+c++}}();
3
- $jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var c=$jscomp.global.Symbol.iterator;c||(c=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[c]&&$jscomp.defineProperty(Array.prototype,c,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(c){var k=0;return $jscomp.iteratorPrototype(function(){return k<c.length?{done:!1,value:c[k++]}:{done:!0}})};
4
- $jscomp.iteratorPrototype=function(c){$jscomp.initSymbolIterator();c={next:c};c[$jscomp.global.Symbol.iterator]=function(){return this};return c};$jscomp.iteratorFromArray=function(c,k){$jscomp.initSymbolIterator();c instanceof String&&(c+="");var d=0,a={next:function(){if(d<c.length){var b=d++;return{value:k(b,c[b]),done:!1}}a.next=function(){return{done:!0,value:void 0}};return a.next()}};a[Symbol.iterator]=function(){return a};return a};
5
- $jscomp.polyfill=function(c,k,d,a){if(k){d=$jscomp.global;c=c.split(".");for(a=0;a<c.length-1;a++){var b=c[a];b in d||(d[b]={});d=d[b]}c=c[c.length-1];a=d[c];k=k(a);k!=a&&null!=k&&$jscomp.defineProperty(d,c,{configurable:!0,writable:!0,value:k})}};$jscomp.polyfill("Array.prototype.keys",function(c){return c?c:function(){return $jscomp.iteratorFromArray(this,function(c){return c})}},"es6","es3");
6
- (function(c){function k(){function a(a){a=!("pause"===a.type||"resign"===a.type||("resume"===a.type||"active"===a.type?0:"hidden"===document.visibilityState));if(a!==b._visible){b._visible=a;for(var g=0;g<b._visibilityCallbacks.length;g++)try{b._visibilityCallbacks[g].fn(a)}catch(m){}}}if(!b._visibilityBound){b._visibilityBound=!0;for(var d=null,c=["","moz","ms","webkit","o"],k=0;k<c.length;k++){var e=c[k];if((e?e+"Hidden":"hidden")in document){d=e?e+"visibilitychange":"visibilitychange";break}}d&&
7
- document.addEventListener(d,a,!1);document.addEventListener("pause",a,!1);document.addEventListener("resume",a,!1);document.addEventListener("resign",a,!1);document.addEventListener("active",a,!1)}}function d(){b._unloadBound||(b._unloadBound=!0,b.onVisibilityChange(function(g){g?b._unloaded=!1:a()},"Metrics.unload"),window.addEventListener("pagehide",function(){a()}),window.addEventListener("pageshow",function(a){a.persisted&&(b._unloaded=!1)}))}function a(){if(!b._unloaded){b._unloaded=!0;var a=
8
- Math.round((Date.now()-b._startTime)/1E3);b.send("unload:"+a+"s")}}var b=c.Metrics||{};c.Metrics=b;b._sessionKey="metrics_sid";b._visitorKey="metrics_vid";b._sid=null;b._vid=null;b.getSessionId=function(){if(b._sid)return b._sid;try{var a=sessionStorage.getItem(b._sessionKey);a||(a=Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2),sessionStorage.setItem(b._sessionKey,a));b._sid=a}catch(p){b._sid=Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)}return b._sid};
9
- b.getVisitorId=function(){if(b._vid)return b._vid;var a=null;try{return a=localStorage.getItem(b._visitorKey),a||(a=Math.random().toString(36).slice(2)+Date.now().toString(36)+Math.random().toString(36).slice(2),localStorage.setItem(b._visitorKey,a)),b._vid=a}catch(p){}try{return a=sessionStorage.getItem(b._visitorKey),a||(a=Math.random().toString(36).slice(2)+Date.now().toString(36)+Math.random().toString(36).slice(2),sessionStorage.setItem(b._visitorKey,a)),b._vid=a}catch(p){}a=Math.random().toString(36).slice(2)+
10
- Date.now().toString(36)+Math.random().toString(36).slice(2);return b._vid=a};b._endpoint=null;b._page=null;b._extra=null;b._unloaded=!1;b._startTime=Date.now();b.send=function(a,d){if(b._endpoint&&!b._unloaded){a={session:b.getSessionId(),visitor:b.getVisitorId(),page:b._page||document.title,label:a,t:Date.now()};b._extra&&(a.extra=b._extra);d&&(a.data=d);d=JSON.stringify(a);try{navigator.sendBeacon?navigator.sendBeacon(b._endpoint,new Blob([d],{type:"text/plain"})):fetch(b._endpoint,{method:"POST",
11
- headers:{"Content-Type":"text/plain"},keepalive:!0,body:d})}catch(n){}}};b._visible=!0;b._visibilityCallbacks=[];b._visibilityBound=!1;b.isVisible=function(){return b._visible};b.onVisibilityChange=function(a,d){if(d)for(var c=0;c<b._visibilityCallbacks.length;c++)if(b._visibilityCallbacks[c].key===d){b._visibilityCallbacks[c].fn=a;return}b._visibilityCallbacks.push({fn:a,key:d||null})};b._unloadBound=!1;b.init=function(a){a=a||{};a.endpoint&&(b._endpoint=a.endpoint);a.page&&(b._page=a.page);a.sessionKey&&
12
- (b._sessionKey=a.sessionKey);a.sessionId&&(b._sid=a.sessionId);a.extra&&(b._extra=a.extra);k();!1!==a.trackUnload&&d();b.send("loaded");return b}})("undefined"!==typeof window?window:this);
13
- "undefined"!==typeof Q&&function(c){function k(a){var b=location.hash||"#";a=b.queryField("v",a);a!==b&&history.replaceState(history.state,document.title,a)}var d=c.Metrics=c.plugins.Metrics=window.Metrics;d.setState=function(a,b){var g=c.info.url;d.setState.pending[g]=c.setTimeout(function(){d.setState.pending[g]&&(clearTimeout(d.setState.pending[g]),delete d.setState.pending[g]);c.req("Metrics/update",[],null,{method:"POST",fields:{navigatorUrl:location.href,url:c.info.url,state:a,extra:JSON.stringify(b)},
14
- keepalive:!0})},5E3)};d.setState.pending={};c.extend.dontCopy["Q.Users.User"]=!0;c.text.Metrics={};c.onReady.add(function(){c.onVisibilityChange&&c.onVisibilityChange.set&&c.onVisibilityChange.set(function(a){if(d._visible!==a){d._visible=a;for(var b=0;b<d._visibilityCallbacks.length;b++)try{d._visibilityCallbacks[b].fn(a)}catch(e){}}},"Metrics");var a=c.getObject("Metrics.navigationTracker",c.plugins)||c.getObject("Metrics.navigationTracker",c);a&&d.NavigationTracker&&(a.page=a.page||c.info.url||
15
- document.title,d.NavigationTracker.init(a));(a=c.getObject("Metrics.mediaTracker",c.plugins)||c.getObject("Metrics.mediaTracker",c))&&d.MediaTracker&&d.MediaTracker.init(a);var b=d.NavigationTracker;if(b){var g=null;c.Tool.onActivate("Q/tabs").set(function(){this.state.onCurrent.set(function(a,d){clearTimeout(g);g=setTimeout(function(){d&&b.state.initialized&&b.opened("tab:"+d)},300)},"Metrics.NavigationTracker")},"Metrics.NavigationTracker");c.Tool.onActivate("Q/columns").set(function(){this.state.onActivate.set(function(a,
16
- d,c){b.state.initialized&&(a=a&&a.getAttribute("data-name")||"column-"+c,b.opened("column:"+a))},"Metrics.NavigationTracker");this.state.onClose.set(function(a,d){b.state.initialized&&(a=d&&d.getAttribute("data-name")||"column-"+a,b.closed("column:"+a))},"Metrics.NavigationTracker")},"Metrics.NavigationTracker");c.Tool.onActivate("Q/expandable").set(function(){var a=this.element.id||this.element.getAttribute("data-name")||this.id;this.state.onExpand.set(function(){b.state.initialized&&b.opened("expandable:"+
17
- a)},"Metrics.NavigationTracker");this.state.onCollapse.set(function(){b.state.initialized&&b.closed("expandable:"+a)},"Metrics.NavigationTracker")},"Metrics.NavigationTracker");if(c.Contextual){c.Contextual.onShow.set(function(a){if(b.state.initialized){var d=$(a).data("Q/contextual trigger");d=d&&d.attr("data-name")||d&&d.attr("id")||"contextual-"+c.Contextual.current;b.opened("contextual:"+d);(a=a.querySelector?a.querySelector(".Q_listing_wrapper, .Q_listing"):null)&&b.observeNavContainer(a)}},
18
- "Metrics.NavigationTracker");c.Contextual.onHide.set(function(a){b.state.initialized&&b.state.activeSection&&0===b.state.activeSection.indexOf("contextual:")&&b.closed(b.state.activeSection)},"Metrics.NavigationTracker");var p=c.Contextual.itemSelectHandler;p&&(c.Contextual.itemSelectHandler=function(a,c){if(b.state.initialized){var e=a.getAttribute("data-action")||a.getAttribute("data-name")||(a.textContent||"").trim().slice(0,40);d.send("contextual-item:"+e)}return p.apply(this,arguments)})}}if(a=
19
- location.hash.queryField("v"))k(a),c.req("Metrics/landed",{method:"POST",fields:{trackerId:"visitId:"+a}},function(a,b){a?window.console&&console.error("Metrics landed request failed",a):b&&b.slots&&b.slots.visitId&&k(b.slots.visitId)})},"Metrics");(function(){function a(a,d){var b="",g="";if(a instanceof Error)b=a.message,g=a.stack;else if("string"===typeof a)b=a;else if(a&&"object"===typeof a)try{var k=JSON.stringify(a)}catch(e){k="[unserializable reason]"}g={message:b||"",stack:g||"",url:location.href,
20
- userAgent:navigator.userAgent,timestamp:Date.now(),performanceNow:performance.now()};k&&(g.details=k);g=JSON.stringify({error:g});c.req("Metrics/update",[],null,{method:"POST",fields:{navigatorUrl:location.href,url:c.info&&c.info.url,state:"error",extra:g},keepalive:!0});console.warn(d?"Unhandled rejection:":"Unhandled error:",a);b&&/indexedDB/i.test(b)&&console.warn("[Recovery] Error suggests IndexedDB corruption. Triggering recovery...")}window.addEventListener("unhandledrejection",function(b){a(b.reason,
21
- !0)});window.addEventListener("error",function(b){a(b.error||b.message,!1)})})()}(Q);"use strict";
22
- (function(c){function k(a){a=document.querySelectorAll(a);for(var b=[],d=0,c=e.options&&e.options.minSectionHeight||0,h=0;h<a.length;h++){var g=a[h];if(!(g.offsetHeight<c)){if(!g.id){var q=(g.textContent||"").trim().slice(0,60).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");g.id=q||"section-"+d}b.push({el:g,id:g.id,tag:g.tagName.toLowerCase(),ordinal:d++,snippet:(g.textContent||"").trim().slice(0,80)})}}return b}function d(){var a=e.options,b=window.scrollY||window.pageYOffset;if(Math.abs(b-
23
- e._prevY)>a.settleTolerance)e._prevY=b,e.scrollTimer=setTimeout(d,a.recheckInterval);else{var c=window.scrollY||window.pageYOffset;for(var g=e.options,h=null,k=Infinity,q=0;q<e.sections.length;q++){var l=e.sections[q],f=l.el.offsetTop;f<=c+g.sectionLookback&&(f=Math.abs(f-c-180),f<k&&(k=f,h=l))}(c=h)&&!e.seen[c.id]&&(e.seen[c.id]=!0,n.send("section:"+c.id,{tag:c.tag,ordinal:c.ordinal,snippet:c.snippet}));c=document.documentElement.scrollHeight-window.innerHeight;if(0<c)for(b=Math.round(b/c*100),c=
24
- 0;c<a.depthMilestones.length;c++)g=a.depthMilestones[c],b>=g&&!e.depthHit[g]&&(e.depthHit[g]=!0,n.send("depth:"+g+"%"))}}function a(){e.anchorCooling||(clearTimeout(e.scrollTimer),e._prevY=window.scrollY||window.pageYOffset,e.scrollTimer=setTimeout(d,e.options.debounce))}function b(){var a=e.options;if(a.tocSelector){for(var b=window.scrollY||window.pageYOffset,d="",c=0;c<e.tocSections.length;c++)b>=e.tocSections[c].el.offsetTop-160&&(d=e.tocSections[c].id);b=document.querySelectorAll(a.tocSelector);
25
- for(c=0;c<b.length;c++)b[c].classList.remove(a.tocActiveClass),b[c].getAttribute("href")==="#"+d&&b[c].classList.add(a.tocActiveClass)}}function g(a){if(a=a.target.closest("a[href]")){var b=a.getAttribute("href")||"";"#"===b.charAt(0)?(e.anchorCooling=!0,setTimeout(function(){e.anchorCooling=!1},e.options.anchorCooldown),n.send("anchor:"+b.slice(1))):n.send(a.dataset.track||"link:"+b)}}function p(){for(var a=window.scrollY||window.pageYOffset,b=0;b<e.sections.length;b++){var c=e.sections[b].el.getBoundingClientRect();
26
- -100<=c.top&&c.top<window.innerHeight&&(e.seen[e.sections[b].id]=!0)}b=document.documentElement.scrollHeight-window.innerHeight;if(0<b)for(a=Math.round(a/b*100),b=0;b<e.options.depthMilestones.length;b++)c=e.options.depthMilestones[b],a>=c&&(e.depthHit[c]=!0)}var n=c.Metrics;if(n){var r={sections:"h2[id], h3[id], section[id], [data-section]",minSectionHeight:100,debounce:1E3,initDelay:800,anchorCooldown:1500,depthMilestones:[25,50,75,100],sectionLookback:300,settleTolerance:2,recheckInterval:500,
27
- trackClicks:!0,tocSelector:null,tocActiveClass:"active",tocSectionSelector:"h2[id]"},e={initialized:!1,options:null,sections:[],tocSections:[],seen:{},depthHit:{},scrollTimer:null,anchorCooling:!1,_prevY:-1};n.ScrollTracker={init:function(c){if(e.initialized)return console.warn("Metrics.ScrollTracker already initialized"),this;var d={},m;for(m in r)r.hasOwnProperty(m)&&(d[m]=r[m]);for(m in c||{})c.hasOwnProperty(m)&&void 0!==c[m]&&(d[m]=c[m]);e.options=d;e.initialized=!0;!n._endpoint&&c&&c.endpoint&&
28
- n.init({endpoint:c.endpoint,page:c.page,sessionKey:c.sessionKey,sessionId:c.sessionId,extra:c.extra,trackUnload:c.trackUnload});setTimeout(function(){e.sections=k(d.sections);d.tocSelector&&d.tocSectionSelector&&(e.tocSections=k(d.tocSectionSelector));p();window.addEventListener("scroll",a,{passive:!0});d.tocSelector&&(window.addEventListener("scroll",b,{passive:!0}),b())},d.initDelay);d.trackClicks&&document.addEventListener("click",g);return this},send:function(a,b){n.send(a,b)},markSeen:function(a){e.seen[a]=
29
- !0},getSessionId:function(){return n.getSessionId()},getSections:function(){return e.sections.map(function(a){return{id:a.id,tag:a.tag,ordinal:a.ordinal,snippet:a.snippet}})},getSeen:function(){var a={},b;for(b in e.seen)a[b]=!0;return a},reset:function(){e.seen={};e.depthHit={};e.anchorCooling=!1;clearTimeout(e.scrollTimer);e.sections=k(e.options.sections);p()},destroy:function(){window.removeEventListener("scroll",a);window.removeEventListener("scroll",b);document.removeEventListener("click",g);
30
- clearTimeout(e.scrollTimer);e.initialized=!1},defaults:r,state:e}}else console.warn("Metrics.ScrollTracker: Metrics core not loaded")})("undefined"!==typeof window?window:this);"use strict";
31
- (function(c){function k(a){a=document.querySelectorAll(a);for(var b=[],c=0,d=e.options&&e.options.minSectionHeight||0,g=0;g<a.length;g++){var k=a[g];if(!(k.offsetHeight<d)){if(!k.id){var q=(k.textContent||"").trim().slice(0,60).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");k.id=q||"section-"+c}b.push({el:k,id:k.id,tag:k.tagName.toLowerCase(),ordinal:c++,snippet:(k.textContent||"").trim().slice(0,80)})}}return b}function d(){var a=e.options,b=window.scrollY||window.pageYOffset;if(Math.abs(b-
32
- e._prevY)>a.settleTolerance)e._prevY=b,e.scrollTimer=setTimeout(d,a.recheckInterval);else{var c=window.scrollY||window.pageYOffset;for(var g=e.options,h=null,k=Infinity,q=0;q<e.sections.length;q++){var l=e.sections[q],f=l.el.offsetTop;f<=c+g.sectionLookback&&(f=Math.abs(f-c-180),f<k&&(k=f,h=l))}(c=h)&&!e.seen[c.id]&&(e.seen[c.id]=!0,n.send("section:"+c.id,{tag:c.tag,ordinal:c.ordinal,snippet:c.snippet}));c=document.documentElement.scrollHeight-window.innerHeight;if(0<c)for(b=Math.round(b/c*100),c=
33
- 0;c<a.depthMilestones.length;c++)g=a.depthMilestones[c],b>=g&&!e.depthHit[g]&&(e.depthHit[g]=!0,n.send("depth:"+g+"%"))}}function a(){e.anchorCooling||(clearTimeout(e.scrollTimer),e._prevY=window.scrollY||window.pageYOffset,e.scrollTimer=setTimeout(d,e.options.debounce))}function b(){var a=e.options;if(a.tocSelector){for(var b=window.scrollY||window.pageYOffset,c="",d=0;d<e.tocSections.length;d++)b>=e.tocSections[d].el.offsetTop-160&&(c=e.tocSections[d].id);b=document.querySelectorAll(a.tocSelector);
34
- for(d=0;d<b.length;d++)b[d].classList.remove(a.tocActiveClass),b[d].getAttribute("href")==="#"+c&&b[d].classList.add(a.tocActiveClass)}}function g(a){if(a=a.target.closest("a[href]")){var b=a.getAttribute("href")||"";"#"===b.charAt(0)?(e.anchorCooling=!0,setTimeout(function(){e.anchorCooling=!1},e.options.anchorCooldown),n.send("anchor:"+b.slice(1))):n.send(a.dataset.track||"link:"+b)}}function p(){for(var a=window.scrollY||window.pageYOffset,b=0;b<e.sections.length;b++){var c=e.sections[b].el.getBoundingClientRect();
35
- -100<=c.top&&c.top<window.innerHeight&&(e.seen[e.sections[b].id]=!0)}b=document.documentElement.scrollHeight-window.innerHeight;if(0<b)for(a=Math.round(a/b*100),b=0;b<e.options.depthMilestones.length;b++)c=e.options.depthMilestones[b],a>=c&&(e.depthHit[c]=!0)}var n=c.Metrics;if(n){var r={sections:"h2[id], h3[id], section[id], [data-section]",minSectionHeight:100,debounce:1E3,initDelay:800,anchorCooldown:1500,depthMilestones:[25,50,75,100],sectionLookback:300,settleTolerance:2,recheckInterval:500,
36
- trackClicks:!0,tocSelector:null,tocActiveClass:"active",tocSectionSelector:"h2[id]"},e={initialized:!1,options:null,sections:[],tocSections:[],seen:{},depthHit:{},scrollTimer:null,anchorCooling:!1,_prevY:-1};n.ScrollTracker={init:function(c){if(e.initialized)return console.warn("Metrics.ScrollTracker already initialized"),this;var d={},m;for(m in r)r.hasOwnProperty(m)&&(d[m]=r[m]);for(m in c||{})c.hasOwnProperty(m)&&void 0!==c[m]&&(d[m]=c[m]);e.options=d;e.initialized=!0;!n._endpoint&&c&&c.endpoint&&
37
- n.init({endpoint:c.endpoint,page:c.page,sessionKey:c.sessionKey,sessionId:c.sessionId,extra:c.extra,trackUnload:c.trackUnload});setTimeout(function(){e.sections=k(d.sections);d.tocSelector&&d.tocSectionSelector&&(e.tocSections=k(d.tocSectionSelector));p();window.addEventListener("scroll",a,{passive:!0});d.tocSelector&&(window.addEventListener("scroll",b,{passive:!0}),b())},d.initDelay);d.trackClicks&&document.addEventListener("click",g);return this},send:function(a,b){n.send(a,b)},markSeen:function(a){e.seen[a]=
38
- !0},getSessionId:function(){return n.getSessionId()},getSections:function(){return e.sections.map(function(a){return{id:a.id,tag:a.tag,ordinal:a.ordinal,snippet:a.snippet}})},getSeen:function(){var a={},b;for(b in e.seen)a[b]=!0;return a},reset:function(){e.seen={};e.depthHit={};e.anchorCooling=!1;clearTimeout(e.scrollTimer);e.sections=k(e.options.sections);p()},destroy:function(){window.removeEventListener("scroll",a);window.removeEventListener("scroll",b);document.removeEventListener("click",g);
39
- clearTimeout(e.scrollTimer);e.initialized=!1},defaults:r,state:e}}else console.warn("Metrics.ScrollTracker: Metrics core not loaded")})("undefined"!==typeof window?window:this);"use strict";
40
- (function(c){function k(a){return a.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,60)}function d(a){a=document.querySelectorAll(a);for(var b=[],c=0,d=h.options&&h.options.minSectionHeight||0,x=0;x<a.length;x++){var g=a[x];g.offsetHeight<d||(g.id||(g.id=k(g.textContent||"")||"section-"+c),b.push({el:g,id:g.id,tag:g.tagName.toLowerCase(),ordinal:c++,snippet:(g.textContent||"").trim().slice(0,80)}))}return b}function a(){var b=h.options,c=window.scrollY||window.pageYOffset;if(Math.abs(c-
41
- h._prevY)>b.settleTolerance)h._prevY=c,h.scrollTimer=setTimeout(a,b.recheckInterval);else{var f=window.scrollY||window.pageYOffset;for(var d=h.options,g=null,e=Infinity,y=0;y<h.sections.length;y++){var k=h.sections[y],p=k.el.offsetTop;p<=f+d.sectionLookback&&(p=Math.abs(p-f-180),p<e&&(e=p,g=k))}(f=g)&&!h.seen[f.id]&&(h.seen[f.id]=!0,m.send("section:"+f.id,{tag:f.tag,ordinal:f.ordinal,snippet:f.snippet}));f=document.documentElement.scrollHeight-window.innerHeight;if(0<f)for(c=Math.round(c/f*100),f=
42
- 0;f<b.depthMilestones.length;f++)d=b.depthMilestones[f],c>=d&&!h.depthHit[d]&&(h.depthHit[d]=!0,m.send("depth:"+d+"%"))}}function b(){h.anchorCooling||(clearTimeout(h.scrollTimer),h._prevY=window.scrollY||window.pageYOffset,h.scrollTimer=setTimeout(a,h.options.debounce))}function g(){var a=h.options;if(a.tocSelector){for(var b=window.scrollY||window.pageYOffset,c="",d=0;d<h.tocSections.length;d++)b>=h.tocSections[d].el.offsetTop-160&&(c=h.tocSections[d].id);b=document.querySelectorAll(a.tocSelector);
43
- for(d=0;d<b.length;d++)b[d].classList.remove(a.tocActiveClass),b[d].getAttribute("href")==="#"+c&&b[d].classList.add(a.tocActiveClass)}}function p(a){if(a=a.target.closest("a[href]")){var b=a.getAttribute("href")||"";"#"===b.charAt(0)?(h.anchorCooling=!0,setTimeout(function(){h.anchorCooling=!1},h.options.anchorCooldown),m.send("anchor:"+b.slice(1))):m.send(a.dataset.track||"link:"+b)}}function n(){if(h.activeSection&&h.options.trackDwell){var a=Math.round((Date.now()-h.activeSince)/1E3);if(0<a){var b=
44
- h.dynamicSections[h.activeSection];m.send("dwell:"+h.activeSection,{seconds:a,name:b?b.name:h.activeSection})}h.activeSection=null;h.activeSince=null}}function r(a,b){var c=b.id||a.id||a.getAttribute("data-section")||a.getAttribute("data-track-section")||k(a.textContent||"")||"dyn-"+Object.keys(h.dynamicSections).length;a.id||(a.id=c);h.dynamicSections[c]={el:a,id:c,name:b.name||a.getAttribute("data-section-name")||a.getAttribute("title")||c,snippet:(a.textContent||"").trim().slice(0,80),observedAt:Date.now()};
45
- window.IntersectionObserver&&!1!==b.autoTrack&&(b=new IntersectionObserver(function(a){a.forEach(function(a){a.isIntersecting&&.3<a.intersectionRatio?t.opened(c):a.isIntersecting||h.activeSection!==c||t.closed(c)})},{threshold:[0,.3]}),b.observe(a),h.dynamicSections[c]._io=b);return c}function e(a){var b=a.querySelectorAll("a[href], li[data-action], li[data-name]");if(b.length){a=new IntersectionObserver(function(a){a.forEach(function(a){if(a.isIntersecting){a=a.target;var b="nav-link:"+(a.getAttribute("data-name")||
46
- a.getAttribute("data-action")||a.getAttribute("href")||a.textContent.trim().slice(0,40));h._navLinksSeen[b]||(h._navLinksSeen[b]=!0,m.send(b,{text:a.textContent.trim().slice(0,60)}))}})},{root:a,threshold:.5});for(var c=0;c<b.length;c++)a.observe(b[c]);h._navObservers.push(a)}}function w(){if(window.MutationObserver&&h.options.observeDom){var a=h.options.observeRoot||document.body,b=h.options.observeSelector;h._mutationObserver=new MutationObserver(function(a){a.forEach(function(a){a.addedNodes.forEach(function(a){if(1===
47
- a.nodeType&&(a.matches&&a.matches(b)&&r(a,{}),a.querySelectorAll)){a=a.querySelectorAll(b);for(var c=0;c<a.length;c++)r(a[c],{})}})})});h._mutationObserver.observe(a,{childList:!0,subtree:!0})}}function u(){for(var a=window.scrollY||window.pageYOffset,b=0;b<h.sections.length;b++){var c=h.sections[b].el.getBoundingClientRect();-100<=c.top&&c.top<window.innerHeight&&(h.seen[h.sections[b].id]=!0)}b=document.documentElement.scrollHeight-window.innerHeight;if(0<b)for(a=Math.round(a/b*100),b=0;b<h.options.depthMilestones.length;b++)c=
48
- h.options.depthMilestones[b],a>=c&&(h.depthHit[c]=!0)}var m=c.Metrics;if(m){var v={sections:"h2[id], h3[id], section[id], [data-section]",minSectionHeight:100,debounce:1E3,initDelay:800,anchorCooldown:1500,depthMilestones:[25,50,75,100],sectionLookback:300,settleTolerance:2,recheckInterval:500,observeDom:!1,observeRoot:null,observeSelector:"[data-section], [data-track-section]",trackDwell:!0,navContainers:null,trackContextuals:!0,trackClicks:!0,tocSelector:null,tocActiveClass:"active",tocSectionSelector:"h2[id]"},
49
- h={initialized:!1,options:null,sections:[],tocSections:[],seen:{},depthHit:{},scrollTimer:null,anchorCooling:!1,_prevY:-1,dynamicSections:{},activeSection:null,activeSince:null,_mutationObserver:null,_navObservers:[],_navLinksSeen:{}},t={init:function(a){if(h.initialized)return console.warn("Metrics.NavigationTracker already initialized"),this;var c={},f;for(f in v)v.hasOwnProperty(f)&&(c[f]=v[f]);for(f in a||{})a.hasOwnProperty(f)&&void 0!==a[f]&&(c[f]=a[f]);h.options=c;h.initialized=!0;!m._endpoint&&
50
- a&&a.endpoint&&m.init({endpoint:a.endpoint,page:a.page,sessionKey:a.sessionKey,sessionId:a.sessionId,extra:a.extra,trackUnload:a.trackUnload});setTimeout(function(){h.sections=d(c.sections);c.tocSelector&&c.tocSectionSelector&&(h.tocSections=d(c.tocSectionSelector));u();window.addEventListener("scroll",b,{passive:!0});c.tocSelector&&(window.addEventListener("scroll",g,{passive:!0}),g());c.observeDom&&w();if(c.navContainers){var a=h.options.navContainers;if(a&&window.IntersectionObserver){a=document.querySelectorAll(a);
51
- for(var f=0;f<a.length;f++)e(a[f])}}},c.initDelay);c.trackClicks&&document.addEventListener("click",p);if(c.trackDwell)m.onVisibilityChange(function(a){a||n()},"NavigationTracker.dwell");return this},observe:function(a,b){return r(a,b||{})},opened:function(a){if(h.activeSection!==a)if(n(),h.activeSection=a,h.activeSince=Date.now(),h.seen[a])m.send("switched:"+a,{name:(h.dynamicSections[a]||{}).name||a});else{h.seen[a]=!0;var b=h.dynamicSections[a];m.send("opened:"+a,{name:b?b.name:a,snippet:b?b.snippet:
52
- ""})}},closed:function(a){h.activeSection===a&&n()},observeNavContainer:function(a){e(a)},send:function(a,b){m.send(a,b)},markSeen:function(a){h.seen[a]=!0},getSessionId:function(){return m.getSessionId()},getSections:function(){return h.sections.map(function(a){return{id:a.id,tag:a.tag,ordinal:a.ordinal,snippet:a.snippet}})},getDynamicSections:function(){var a={},b;for(b in h.dynamicSections){var c=h.dynamicSections[b];a[b]={id:c.id,name:c.name,snippet:c.snippet}}return a},getSeen:function(){var a=
53
- {},b;for(b in h.seen)a[b]=!0;return a},getActive:function(){return h.activeSection?{id:h.activeSection,since:h.activeSince,elapsed:Math.round((Date.now()-h.activeSince)/1E3)}:null},reset:function(){n();h.seen={};h.depthHit={};h.anchorCooling=!1;h._navLinksSeen={};clearTimeout(h.scrollTimer);for(var a in h.dynamicSections)h.dynamicSections[a]._io&&h.dynamicSections[a]._io.disconnect();h.dynamicSections={};h.activeSection=null;h.activeSince=null;h.sections=d(h.options.sections);u()},destroy:function(){n();
54
- window.removeEventListener("scroll",b);window.removeEventListener("scroll",g);document.removeEventListener("click",p);clearTimeout(h.scrollTimer);h._mutationObserver&&(h._mutationObserver.disconnect(),h._mutationObserver=null);for(var a in h.dynamicSections)h.dynamicSections[a]._io&&h.dynamicSections[a]._io.disconnect();for(a=0;a<h._navObservers.length;a++)h._navObservers[a].disconnect();h._navObservers=[];h.initialized=!1},defaults:v,state:h};m.NavigationTracker=t;m.SectionTracker=t;m.ScrollTracker=
55
- t}else console.warn("Metrics.NavigationTracker: Metrics core not loaded")})("undefined"!==typeof window?window:this);"use strict";
56
- (function(c){function k(a){if(a.id)return a.id;if(a=a.src||a.currentSrc||""){var b=a.match(/(?:youtu\.be\/|youtube\.com\/embed\/|vimeo\.com\/video\/|vimeo\.com\/)([^?&#]+)/);if(b)return b[1];if((a=a.split("/").pop().split("?")[0])&&60>a.length)return a}return"media-"+l._counter++}function d(){this.ranges=[]}function a(a,b,c,g){return{id:a,type:b,el:c,duration:g||0,playing:!1,lastPosition:0,lastCheckpointAt:0,watched:new d,checkpointTimer:null,_lastTimeUpdate:0}}function b(a,b,c){var d={type:a.type,
57
- position:Math.round(a.lastPosition),duration:Math.round(a.duration),watched:a.watched.total()};if(c)for(var f in c)d[f]=c[f];t.send(b+":"+a.id,d)}function g(a){p(a);a.checkpointTimer=setInterval(function(){a.playing&&b(a,"media-checkpoint")},1E3*l.options.checkpointInterval)}function p(a){a.checkpointTimer&&(clearInterval(a.checkpointTimer),a.checkpointTimer=null)}function n(c){var d=k(c);if(!l.tracked[d]){var f=a(d,"native",c,c.duration||0);l.tracked[d]=f;c.addEventListener("loadedmetadata",function(){f.duration=
58
- c.duration||0});c.addEventListener("play",function(){f.playing=!0;f.lastPosition=c.currentTime;f._lastTimeUpdate=c.currentTime;b(f,"media-play");g(f)});c.addEventListener("pause",function(){f.playing&&(f.playing=!1,f.watched.add(f._lastTimeUpdate,c.currentTime),f.lastPosition=c.currentTime,p(f),b(f,"media-pause"))});c.addEventListener("ended",function(){f.playing=!1;f.watched.add(f._lastTimeUpdate,c.currentTime);f.lastPosition=c.currentTime;p(f);b(f,"media-ended")});c.addEventListener("seeked",function(){var a=
59
- f.lastPosition;f.lastPosition=c.currentTime;f._lastTimeUpdate=c.currentTime;b(f,"media-seeked",{from:Math.round(a),to:Math.round(c.currentTime)})});c.addEventListener("timeupdate",function(){f.playing&&c.currentTime>f._lastTimeUpdate&&f.watched.add(f._lastTimeUpdate,c.currentTime);f._lastTimeUpdate=c.currentTime;f.lastPosition=c.currentTime})}}function r(a){if(l._ytApiLoaded)a();else if(l._ytApiLoading)l._ytPendingPlayers.push(a);else{l._ytApiLoading=!0;var b=c.onYouTubeIframeAPIReady;c.onYouTubeIframeAPIReady=
60
- function(){l._ytApiLoaded=!0;l._ytApiLoading=!1;b&&b();a();for(var c=0;c<l._ytPendingPlayers.length;c++)l._ytPendingPlayers[c]();l._ytPendingPlayers=[]};var d=document.createElement("script");d.src="https://www.youtube.com/iframe_api";document.head.appendChild(d)}}function e(c){var d=c.src||"",f=k(c);if(!l.tracked[f]){if(-1===d.indexOf("enablejsapi"))if(l.options.reloadIframes){var e=-1===d.indexOf("?")?"?":"&";c.src=d+e+"enablejsapi=1&origin="+encodeURIComponent(location.origin)}else{console.warn("Metrics.MediaTracker: YouTube iframe missing enablejsapi=1, set reloadIframes:true to auto-fix. iframe:",
61
- c);return}c.id||(c.id="yt-"+f);r(function(){if(!l.tracked[f]){var d=a(f,"youtube",c,0);l.tracked[f]=d;var e=new YT.Player(c.id,{events:{onReady:function(a){d.duration=e.getDuration()||0},onStateChange:function(a){var c=e.getCurrentTime()||0;d.lastPosition=c;switch(a.data){case YT.PlayerState.PLAYING:d.playing=!0;d._lastTimeUpdate=c;d.duration=e.getDuration()||d.duration;b(d,"media-play");g(d);d._pollTimer=setInterval(function(){var a=e.getCurrentTime()||0;d.playing&&a>d._lastTimeUpdate&&d.watched.add(d._lastTimeUpdate,
62
- a);d._lastTimeUpdate=a;d.lastPosition=a},1E3);break;case YT.PlayerState.PAUSED:if(!d.playing)break;d.playing=!1;d.watched.add(d._lastTimeUpdate,c);p(d);clearInterval(d._pollTimer);b(d,"media-pause");break;case YT.PlayerState.ENDED:d.playing=!1,d.watched.add(d._lastTimeUpdate,c),p(d),clearInterval(d._pollTimer),b(d,"media-ended")}}}});d._player=e}})}}function w(a){if(l._vimeoApiLoaded)a();else if(l._vimeoApiLoading)setTimeout(function(){w(a)},200);else{l._vimeoApiLoading=!0;var b=document.createElement("script");
63
- b.src="https://player.vimeo.com/api/player.js";b.onload=function(){l._vimeoApiLoaded=!0;l._vimeoApiLoading=!1;a()};document.head.appendChild(b)}}function u(c){var d=k(c);l.tracked[d]||w(function(){if(!l.tracked[d]){var f=a(d,"vimeo",c,0);l.tracked[d]=f;var e=new Vimeo.Player(c);f._player=e;e.getDuration().then(function(a){f.duration=a||0});e.on("play",function(a){f.playing=!0;f.lastPosition=a.seconds||0;f._lastTimeUpdate=f.lastPosition;f.duration=a.duration||f.duration;b(f,"media-play");g(f)});e.on("pause",
64
- function(a){f.playing&&(f.playing=!1,a=a.seconds||0,f.watched.add(f._lastTimeUpdate,a),f.lastPosition=a,p(f),b(f,"media-pause"))});e.on("ended",function(a){f.playing=!1;a=a.seconds||f.duration;f.watched.add(f._lastTimeUpdate,a);f.lastPosition=a;p(f);b(f,"media-ended")});e.on("seeked",function(a){var c=f.lastPosition;f.lastPosition=a.seconds||0;f._lastTimeUpdate=f.lastPosition;b(f,"media-seeked",{from:Math.round(c),to:Math.round(f.lastPosition)})});e.on("timeupdate",function(a){a=a.seconds||0;f.playing&&
65
- a>f._lastTimeUpdate&&f.watched.add(f._lastTimeUpdate,a);f._lastTimeUpdate=a;f.lastPosition=a})}})}function m(){for(var a=document.querySelectorAll(l.options.mediaSelector),b=0;b<a.length;b++)n(a[b]);a=document.querySelectorAll("iframe[src]");for(b=0;b<a.length;b++){var c=a[b].src||"";/youtube\.com\/embed|youtube-nocookie\.com\/embed/.test(c)?e(a[b]):/player\.vimeo\.com/.test(c)?u(a[b]):/w\.soundcloud\.com\/player/.test(c)?trackSoundCloud(a[b]):/dailymotion\.com\/embed/.test(c)?trackDailymotion(a[b]):
66
- /open\.spotify\.com\/embed/.test(c)?trackSpotify(a[b]):/player\.twitch\.tv/.test(c)?trackTwitch(a[b]):/muse\.ai\/embed/.test(c)&&trackMuseAi(a[b])}a=document.querySelectorAll('[class*="wistia_embed"], [class*="wistia_async_"]');for(b=0;b<a.length;b++)trackWistia(a[b]);a=document.querySelectorAll(".jwplayer, [data-jw-id]");for(b=0;b<a.length;b++)trackJWPlayer(a[b])}function v(){if(window.MutationObserver&&l.options.observeDom){var a=l.options.observeRoot||document.body;l._mutationObserver=new MutationObserver(function(a){a.forEach(function(a){a.addedNodes.forEach(function(a){if(1===
67
- a.nodeType){a.matches&&a.matches("video, audio")&&n(a);if("IFRAME"===a.tagName&&a.src){var b=a.src;/youtube\.com\/embed/.test(b)?e(a):/player\.vimeo\.com/.test(b)?u(a):/w\.soundcloud\.com\/player/.test(b)?trackSoundCloud(a):/dailymotion\.com\/embed/.test(b)?trackDailymotion(a):/open\.spotify\.com\/embed/.test(b)?trackSpotify(a):/player\.twitch\.tv/.test(b)?trackTwitch(a):/muse\.ai\/embed/.test(b)&&trackMuseAi(a)}a.className&&/wistia_embed|wistia_async_/.test(a.className)&&trackWistia(a);a.className&&
68
- /jwplayer/.test(a.className)&&trackJWPlayer(a);if(a.querySelectorAll){b=a.querySelectorAll("video, audio");for(var c=0;c<b.length;c++)n(b[c]);c=a.querySelectorAll("iframe[src]");for(var d=0;d<c.length;d++)b=c[d].src||"",/youtube\.com\/embed/.test(b)?e(c[d]):/player\.vimeo\.com/.test(b)?u(c[d]):/w\.soundcloud\.com\/player/.test(b)?trackSoundCloud(c[d]):/dailymotion\.com\/embed/.test(b)?trackDailymotion(c[d]):/open\.spotify\.com\/embed/.test(b)?trackSpotify(c[d]):/player\.twitch\.tv/.test(b)?trackTwitch(c[d]):
69
- /muse\.ai\/embed/.test(b)&&trackMuseAi(c[d]);b=a.querySelectorAll('[class*="wistia_embed"], [class*="wistia_async_"]');for(c=0;c<b.length;c++)trackWistia(b[c]);a=a.querySelectorAll(".jwplayer, [data-jw-id]");for(b=0;b<a.length;b++)trackJWPlayer(a[b])}}})})});l._mutationObserver.observe(a,{childList:!0,subtree:!0})}}function h(){for(var a in l.tracked){var c=l.tracked[a];c.playing&&("native"===c.type&&c.el&&(c.watched.add(c._lastTimeUpdate,c.el.currentTime||c.lastPosition),c.lastPosition=c.el.currentTime||
70
- c.lastPosition),b(c,"media-checkpoint"))}}var t=c.Metrics;if(t){var q={checkpointInterval:10,autoDiscover:!0,mediaSelector:"video, audio",reloadIframes:!1,observeDom:!0,observeRoot:null,checkpointDebounce:1E3},l={initialized:!1,options:null,tracked:{},_counter:0,_mutationObserver:null,_ytApiLoaded:!1,_ytApiLoading:!1,_ytPendingPlayers:[],_vimeoApiLoaded:!1,_vimeoApiLoading:!1};d.prototype.add=function(a,b){if(!(b<=a)){a={start:Math.floor(a),end:Math.ceil(b)};b=[];for(var c=!1,d=0;d<this.ranges.length;d++){var f=
71
- this.ranges[d];f.end<a.start?b.push(f):f.start>a.end?(c||(b.push(a),c=!0),b.push(f)):(a.start=Math.min(a.start,f.start),a.end=Math.max(a.end,f.end))}c||b.push(a);this.ranges=b}};d.prototype.total=function(){for(var a=0,b=0;b<this.ranges.length;b++)a+=this.ranges[b].end-this.ranges[b].start;return a};t.MediaTracker={init:function(a){if(l.initialized)return console.warn("Metrics.MediaTracker already initialized"),this;var b={},c;for(c in q)q.hasOwnProperty(c)&&(b[c]=q[c]);for(c in a||{})a.hasOwnProperty(c)&&
72
- void 0!==a[c]&&(b[c]=a[c]);l.options=b;l.initialized=!0;!t._endpoint&&a&&a.endpoint&&t.init({endpoint:a.endpoint,page:a.page,trackUnload:a.trackUnload});b.autoDiscover&&setTimeout(function(){m()},500);b.observeDom&&v();t.onVisibilityChange(function(a){a||h()},"MediaTracker.flush");return this},trackNative:function(a,b){b&&(a.id=b);n(a)},trackYouTube:function(a,b){b&&(a.id=b);e(a)},trackVimeo:function(a,b){b&&(a.id=b);u(a)},trackSoundCloud:function(a,b){b&&(a.id=b);trackSoundCloud(a)},trackWistia:function(a,
1
+ var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(d,k,c){d!=Array.prototype&&d!=Object.prototype&&(d[k]=c.value)};$jscomp.getGlobal=function(d){return"undefined"!=typeof window&&window===d?d:"undefined"!=typeof global&&null!=global?global:d};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";
2
+ $jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.Symbol=function(){var d=0;return function(k){return $jscomp.SYMBOL_PREFIX+(k||"")+d++}}();
3
+ $jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var d=$jscomp.global.Symbol.iterator;d||(d=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[d]&&$jscomp.defineProperty(Array.prototype,d,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(d){var k=0;return $jscomp.iteratorPrototype(function(){return k<d.length?{done:!1,value:d[k++]}:{done:!0}})};
4
+ $jscomp.iteratorPrototype=function(d){$jscomp.initSymbolIterator();d={next:d};d[$jscomp.global.Symbol.iterator]=function(){return this};return d};$jscomp.iteratorFromArray=function(d,k){$jscomp.initSymbolIterator();d instanceof String&&(d+="");var c=0,b={next:function(){if(c<d.length){var a=c++;return{value:k(a,d[a]),done:!1}}b.next=function(){return{done:!0,value:void 0}};return b.next()}};b[Symbol.iterator]=function(){return b};return b};
5
+ $jscomp.polyfill=function(d,k,c,b){if(k){c=$jscomp.global;d=d.split(".");for(b=0;b<d.length-1;b++){var a=d[b];a in c||(c[a]={});c=c[a]}d=d[d.length-1];b=c[d];k=k(b);k!=b&&null!=k&&$jscomp.defineProperty(c,d,{configurable:!0,writable:!0,value:k})}};$jscomp.polyfill("Array.prototype.keys",function(d){return d?d:function(){return $jscomp.iteratorFromArray(this,function(d){return d})}},"es6","es3");
6
+ (function(d){function k(){function b(b){b=!("pause"===b.type||"resign"===b.type||("resume"===b.type||"active"===b.type?0:"hidden"===document.visibilityState));if(b!==a._visible){a._visible=b;for(var c=0;c<a._visibilityCallbacks.length;c++)try{a._visibilityCallbacks[c].fn(b)}catch(m){}}}if(!a._visibilityBound){a._visibilityBound=!0;for(var c=null,d=["","moz","ms","webkit","o"],k=0;k<d.length;k++){var h=d[k];if((h?h+"Hidden":"hidden")in document){c=h?h+"visibilitychange":"visibilitychange";break}}c&&
7
+ document.addEventListener(c,b,!1);document.addEventListener("pause",b,!1);document.addEventListener("resume",b,!1);document.addEventListener("resign",b,!1);document.addEventListener("active",b,!1)}}function c(){a._unloadBound||(a._unloadBound=!0,a.onVisibilityChange(function(c){c?a._unloaded=!1:b()},"Metrics.unload"),window.addEventListener("pagehide",function(){b()}),window.addEventListener("pageshow",function(b){b.persisted&&(a._unloaded=!1)}))}function b(){if(!a._unloaded){a._unloaded=!0;var b=
8
+ Math.round((Date.now()-a._startTime)/1E3);a.send("unload:"+b+"s")}}var a=d.Metrics||{};d.Metrics=a;a._sessionKey="metrics_sid";a._visitorKey="metrics_vid";a._sid=null;a._vid=null;a.getSessionId=function(){if(a._sid)return a._sid;try{var b=sessionStorage.getItem(a._sessionKey);b||(b=Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2),sessionStorage.setItem(a._sessionKey,b));a._sid=b}catch(q){a._sid=Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)}return a._sid};
9
+ a.getVisitorId=function(){if(a._vid)return a._vid;var b=null;try{return b=localStorage.getItem(a._visitorKey),b||(b=Math.random().toString(36).slice(2)+Date.now().toString(36)+Math.random().toString(36).slice(2),localStorage.setItem(a._visitorKey,b)),a._vid=b}catch(q){}try{return b=sessionStorage.getItem(a._visitorKey),b||(b=Math.random().toString(36).slice(2)+Date.now().toString(36)+Math.random().toString(36).slice(2),sessionStorage.setItem(a._visitorKey,b)),a._vid=b}catch(q){}b=Math.random().toString(36).slice(2)+
10
+ Date.now().toString(36)+Math.random().toString(36).slice(2);return a._vid=b};a._endpoint=null;a._page=null;a._extra=null;a._unloaded=!1;a._startTime=Date.now();a.send=function(b,c){if(a._endpoint&&!a._unloaded){b={session:a.getSessionId(),visitor:a.getVisitorId(),origin:location.origin,page:a._page||document.title,label:b,t:Date.now()};a._extra&&(b.extra=a._extra);c&&(b.data=c);c=JSON.stringify(b);try{navigator.sendBeacon?navigator.sendBeacon(a._endpoint,new Blob([c],{type:"text/plain"})):fetch(a._endpoint,
11
+ {method:"POST",headers:{"Content-Type":"text/plain"},keepalive:!0,body:c})}catch(n){}}};a._visible=!0;a._visibilityCallbacks=[];a._visibilityBound=!1;a.isVisible=function(){return a._visible};a.onVisibilityChange=function(b,c){if(c)for(var g=0;g<a._visibilityCallbacks.length;g++)if(a._visibilityCallbacks[g].key===c){a._visibilityCallbacks[g].fn=b;return}a._visibilityCallbacks.push({fn:b,key:c||null})};a._unloadBound=!1;a._defaultEndpoint="https://invites.to/metrics";a.init=function(b){b=b||{};a._endpoint=
12
+ b.endpoint||a._defaultEndpoint;b.page&&(a._page=b.page);b.sessionKey&&(a._sessionKey=b.sessionKey);b.sessionId&&(a._sid=b.sessionId);b.extra&&(a._extra=b.extra);k();!1!==b.trackUnload&&c();a.send("loaded");return a}})("undefined"!==typeof window?window:this);
13
+ "undefined"!==typeof Q&&function(d){function k(b){var a=location.hash||"#";b=a.queryField("v",b);b!==a&&history.replaceState(history.state,document.title,b)}var c=d.Metrics=d.plugins.Metrics=window.Metrics;c.setState=function(b,a){var g=d.info.url;c.setState.pending[g]=d.setTimeout(function(){c.setState.pending[g]&&(clearTimeout(c.setState.pending[g]),delete c.setState.pending[g]);d.req("Metrics/update",[],null,{method:"POST",fields:{navigatorUrl:location.href,url:d.info.url,state:b,extra:JSON.stringify(a)},
14
+ keepalive:!0})},5E3)};c.setState.pending={};d.extend.dontCopy["Q.Users.User"]=!0;d.text.Metrics={};d.onReady.add(function(){d.onVisibilityChange&&d.onVisibilityChange.set&&d.onVisibilityChange.set(function(a){if(c._visible!==a){c._visible=a;for(var b=0;b<c._visibilityCallbacks.length;b++)try{c._visibilityCallbacks[b].fn(a)}catch(h){}}},"Metrics");var b=d.getObject("Metrics.navigationTracker",d.plugins)||d.getObject("Metrics.navigationTracker",d);b&&c.NavigationTracker&&(b.page=b.page||d.info.url||
15
+ document.title,c.NavigationTracker.init(b));(b=d.getObject("Metrics.mediaTracker",d.plugins)||d.getObject("Metrics.mediaTracker",d))&&c.MediaTracker&&c.MediaTracker.init(b);var a=c.NavigationTracker;if(a){var g=null;d.Tool.onActivate("Q/tabs").set(function(){this.state.onCurrent.set(function(b,c){clearTimeout(g);g=setTimeout(function(){c&&a.state.initialized&&a.opened("tab:"+c)},300)},"Metrics.NavigationTracker")},"Metrics.NavigationTracker");d.Tool.onActivate("Q/columns").set(function(){this.state.onActivate.set(function(b,
16
+ c,g){a.state.initialized&&(b=b&&b.getAttribute("data-name")||"column-"+g,a.opened("column:"+b))},"Metrics.NavigationTracker");this.state.onClose.set(function(b,c){a.state.initialized&&(b=c&&c.getAttribute("data-name")||"column-"+b,a.closed("column:"+b))},"Metrics.NavigationTracker")},"Metrics.NavigationTracker");d.Tool.onActivate("Q/expandable").set(function(){var b=this.element.id||this.element.getAttribute("data-name")||this.id;this.state.onExpand.set(function(){a.state.initialized&&a.opened("expandable:"+
17
+ b)},"Metrics.NavigationTracker");this.state.onCollapse.set(function(){a.state.initialized&&a.closed("expandable:"+b)},"Metrics.NavigationTracker")},"Metrics.NavigationTracker");if(d.Contextual){d.Contextual.onShow.set(function(b){if(a.state.initialized){var c=$(b).data("Q/contextual trigger");c=c&&c.attr("data-name")||c&&c.attr("id")||"contextual-"+d.Contextual.current;a.opened("contextual:"+c);(b=b.querySelector?b.querySelector(".Q_listing_wrapper, .Q_listing"):null)&&a.observeNavContainer(b)}},
18
+ "Metrics.NavigationTracker");d.Contextual.onHide.set(function(b){a.state.initialized&&a.state.activeSection&&0===a.state.activeSection.indexOf("contextual:")&&a.closed(a.state.activeSection)},"Metrics.NavigationTracker");var q=d.Contextual.itemSelectHandler;q&&(d.Contextual.itemSelectHandler=function(b,g){if(a.state.initialized){var d=b.getAttribute("data-action")||b.getAttribute("data-name")||(b.textContent||"").trim().slice(0,40);c.send("contextual-item:"+d)}return q.apply(this,arguments)})}}if(b=
19
+ location.hash.queryField("v"))k(b),d.req("Metrics/landed",{method:"POST",fields:{trackerId:"visitId:"+b}},function(a,b){a?window.console&&console.error("Metrics landed request failed",a):b&&b.slots&&b.slots.visitId&&k(b.slots.visitId)})},"Metrics");(function(){function b(a,b){var c="",g="";if(a instanceof Error)c=a.message,g=a.stack;else if("string"===typeof a)c=a;else if(a&&"object"===typeof a)try{var k=JSON.stringify(a)}catch(h){k="[unserializable reason]"}g={message:c||"",stack:g||"",url:location.href,
20
+ userAgent:navigator.userAgent,timestamp:Date.now(),performanceNow:performance.now()};k&&(g.details=k);g=JSON.stringify({error:g});d.req("Metrics/update",[],null,{method:"POST",fields:{navigatorUrl:location.href,url:d.info&&d.info.url,state:"error",extra:g},keepalive:!0});console.warn(b?"Unhandled rejection:":"Unhandled error:",a);c&&/indexedDB/i.test(c)&&console.warn("[Recovery] Error suggests IndexedDB corruption. Triggering recovery...")}window.addEventListener("unhandledrejection",function(a){b(a.reason,
21
+ !0)});window.addEventListener("error",function(a){b(a.error||a.message,!1)})})()}(Q);"use strict";
22
+ (function(d){function k(a){a=document.querySelectorAll(a);for(var b=[],c=0,g=h.options&&h.options.minSectionHeight||0,f=0;f<a.length;f++){var d=a[f];if(!(d.offsetHeight<g)){if(!d.id){var t=(d.textContent||"").trim().slice(0,60).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");d.id=t||"section-"+c}b.push({el:d,id:d.id,tag:d.tagName.toLowerCase(),ordinal:c++,snippet:(d.textContent||"").trim().slice(0,80)})}}return b}function c(){var a=h.options,b=window.scrollY||window.pageYOffset;if(Math.abs(b-
23
+ h._prevY)>a.settleTolerance)h._prevY=b,h.scrollTimer=setTimeout(c,a.recheckInterval);else{var g=window.scrollY||window.pageYOffset;for(var d=h.options,f=null,k=Infinity,t=0;t<h.sections.length;t++){var l=h.sections[t],e=l.el.offsetTop;e<=g+d.sectionLookback&&(e=Math.abs(e-g-180),e<k&&(k=e,f=l))}(g=f)&&!h.seen[g.id]&&(h.seen[g.id]=!0,n.send("section:"+g.id,{tag:g.tag,ordinal:g.ordinal,snippet:g.snippet}));g=document.documentElement.scrollHeight-window.innerHeight;if(0<g)for(b=Math.round(b/g*100),g=
24
+ 0;g<a.depthMilestones.length;g++)d=a.depthMilestones[g],b>=d&&!h.depthHit[d]&&(h.depthHit[d]=!0,n.send("depth:"+d+"%"))}}function b(){h.anchorCooling||(clearTimeout(h.scrollTimer),h._prevY=window.scrollY||window.pageYOffset,h.scrollTimer=setTimeout(c,h.options.debounce))}function a(){var a=h.options;if(a.tocSelector){for(var b=window.scrollY||window.pageYOffset,c="",g=0;g<h.tocSections.length;g++)b>=h.tocSections[g].el.offsetTop-160&&(c=h.tocSections[g].id);b=document.querySelectorAll(a.tocSelector);
25
+ for(g=0;g<b.length;g++)b[g].classList.remove(a.tocActiveClass),b[g].getAttribute("href")==="#"+c&&b[g].classList.add(a.tocActiveClass)}}function g(a){if(a=a.target.closest("a[href]")){var b=a.getAttribute("href")||"";"#"===b.charAt(0)?(h.anchorCooling=!0,setTimeout(function(){h.anchorCooling=!1},h.options.anchorCooldown),n.send("anchor:"+b.slice(1))):n.send(a.dataset.track||"link:"+b)}}function q(){for(var a=window.scrollY||window.pageYOffset,b=0;b<h.sections.length;b++){var c=h.sections[b].el.getBoundingClientRect();
26
+ -100<=c.top&&c.top<window.innerHeight&&(h.seen[h.sections[b].id]=!0)}b=document.documentElement.scrollHeight-window.innerHeight;if(0<b)for(a=Math.round(a/b*100),b=0;b<h.options.depthMilestones.length;b++)c=h.options.depthMilestones[b],a>=c&&(h.depthHit[c]=!0)}var n=d.Metrics;if(n){var u={sections:"h2[id], h3[id], section[id], [data-section]",minSectionHeight:100,debounce:1E3,initDelay:800,anchorCooldown:1500,depthMilestones:[25,50,75,100],sectionLookback:300,settleTolerance:2,recheckInterval:500,
27
+ trackClicks:!0,tocSelector:null,tocActiveClass:"active",tocSectionSelector:"h2[id]"},h={initialized:!1,options:null,sections:[],tocSections:[],seen:{},depthHit:{},scrollTimer:null,anchorCooling:!1,_prevY:-1};n.ScrollTracker={init:function(c){if(h.initialized)return console.warn("Metrics.ScrollTracker already initialized"),this;var d={},m;for(m in u)u.hasOwnProperty(m)&&(d[m]=u[m]);for(m in c||{})c.hasOwnProperty(m)&&void 0!==c[m]&&(d[m]=c[m]);h.options=d;h.initialized=!0;!n._endpoint&&c&&c.endpoint&&
28
+ n.init({endpoint:c.endpoint,page:c.page,sessionKey:c.sessionKey,sessionId:c.sessionId,extra:c.extra,trackUnload:c.trackUnload});setTimeout(function(){h.sections=k(d.sections);d.tocSelector&&d.tocSectionSelector&&(h.tocSections=k(d.tocSectionSelector));q();window.addEventListener("scroll",b,{passive:!0});d.tocSelector&&(window.addEventListener("scroll",a,{passive:!0}),a())},d.initDelay);d.trackClicks&&document.addEventListener("click",g);return this},send:function(a,b){n.send(a,b)},markSeen:function(a){h.seen[a]=
29
+ !0},getSessionId:function(){return n.getSessionId()},getSections:function(){return h.sections.map(function(a){return{id:a.id,tag:a.tag,ordinal:a.ordinal,snippet:a.snippet}})},getSeen:function(){var a={},b;for(b in h.seen)a[b]=!0;return a},reset:function(){h.seen={};h.depthHit={};h.anchorCooling=!1;clearTimeout(h.scrollTimer);h.sections=k(h.options.sections);q()},destroy:function(){window.removeEventListener("scroll",b);window.removeEventListener("scroll",a);document.removeEventListener("click",g);
30
+ clearTimeout(h.scrollTimer);h.initialized=!1},defaults:u,state:h}}else console.warn("Metrics.ScrollTracker: Metrics core not loaded")})("undefined"!==typeof window?window:this);"use strict";
31
+ (function(d){function k(a){a=document.querySelectorAll(a);for(var b=[],c=0,g=h.options&&h.options.minSectionHeight||0,f=0;f<a.length;f++){var d=a[f];if(!(d.offsetHeight<g)){if(!d.id){var t=(d.textContent||"").trim().slice(0,60).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");d.id=t||"section-"+c}b.push({el:d,id:d.id,tag:d.tagName.toLowerCase(),ordinal:c++,snippet:(d.textContent||"").trim().slice(0,80)})}}return b}function c(){var a=h.options,b=window.scrollY||window.pageYOffset;if(Math.abs(b-
32
+ h._prevY)>a.settleTolerance)h._prevY=b,h.scrollTimer=setTimeout(c,a.recheckInterval);else{var g=window.scrollY||window.pageYOffset;for(var d=h.options,f=null,k=Infinity,t=0;t<h.sections.length;t++){var l=h.sections[t],e=l.el.offsetTop;e<=g+d.sectionLookback&&(e=Math.abs(e-g-180),e<k&&(k=e,f=l))}(g=f)&&!h.seen[g.id]&&(h.seen[g.id]=!0,n.send("section:"+g.id,{tag:g.tag,ordinal:g.ordinal,snippet:g.snippet}));g=document.documentElement.scrollHeight-window.innerHeight;if(0<g)for(b=Math.round(b/g*100),g=
33
+ 0;g<a.depthMilestones.length;g++)d=a.depthMilestones[g],b>=d&&!h.depthHit[d]&&(h.depthHit[d]=!0,n.send("depth:"+d+"%"))}}function b(){h.anchorCooling||(clearTimeout(h.scrollTimer),h._prevY=window.scrollY||window.pageYOffset,h.scrollTimer=setTimeout(c,h.options.debounce))}function a(){var a=h.options;if(a.tocSelector){for(var b=window.scrollY||window.pageYOffset,c="",g=0;g<h.tocSections.length;g++)b>=h.tocSections[g].el.offsetTop-160&&(c=h.tocSections[g].id);b=document.querySelectorAll(a.tocSelector);
34
+ for(g=0;g<b.length;g++)b[g].classList.remove(a.tocActiveClass),b[g].getAttribute("href")==="#"+c&&b[g].classList.add(a.tocActiveClass)}}function g(a){if(a=a.target.closest("a[href]")){var b=a.getAttribute("href")||"";"#"===b.charAt(0)?(h.anchorCooling=!0,setTimeout(function(){h.anchorCooling=!1},h.options.anchorCooldown),n.send("anchor:"+b.slice(1))):n.send(a.dataset.track||"link:"+b)}}function q(){for(var a=window.scrollY||window.pageYOffset,b=0;b<h.sections.length;b++){var c=h.sections[b].el.getBoundingClientRect();
35
+ -100<=c.top&&c.top<window.innerHeight&&(h.seen[h.sections[b].id]=!0)}b=document.documentElement.scrollHeight-window.innerHeight;if(0<b)for(a=Math.round(a/b*100),b=0;b<h.options.depthMilestones.length;b++)c=h.options.depthMilestones[b],a>=c&&(h.depthHit[c]=!0)}var n=d.Metrics;if(n){var u={sections:"h2[id], h3[id], section[id], [data-section]",minSectionHeight:100,debounce:1E3,initDelay:800,anchorCooldown:1500,depthMilestones:[25,50,75,100],sectionLookback:300,settleTolerance:2,recheckInterval:500,
36
+ trackClicks:!0,tocSelector:null,tocActiveClass:"active",tocSectionSelector:"h2[id]"},h={initialized:!1,options:null,sections:[],tocSections:[],seen:{},depthHit:{},scrollTimer:null,anchorCooling:!1,_prevY:-1};n.ScrollTracker={init:function(c){if(h.initialized)return console.warn("Metrics.ScrollTracker already initialized"),this;var d={},m;for(m in u)u.hasOwnProperty(m)&&(d[m]=u[m]);for(m in c||{})c.hasOwnProperty(m)&&void 0!==c[m]&&(d[m]=c[m]);h.options=d;h.initialized=!0;!n._endpoint&&c&&c.endpoint&&
37
+ n.init({endpoint:c.endpoint,page:c.page,sessionKey:c.sessionKey,sessionId:c.sessionId,extra:c.extra,trackUnload:c.trackUnload});setTimeout(function(){h.sections=k(d.sections);d.tocSelector&&d.tocSectionSelector&&(h.tocSections=k(d.tocSectionSelector));q();window.addEventListener("scroll",b,{passive:!0});d.tocSelector&&(window.addEventListener("scroll",a,{passive:!0}),a())},d.initDelay);d.trackClicks&&document.addEventListener("click",g);return this},send:function(a,b){n.send(a,b)},markSeen:function(a){h.seen[a]=
38
+ !0},getSessionId:function(){return n.getSessionId()},getSections:function(){return h.sections.map(function(a){return{id:a.id,tag:a.tag,ordinal:a.ordinal,snippet:a.snippet}})},getSeen:function(){var a={},b;for(b in h.seen)a[b]=!0;return a},reset:function(){h.seen={};h.depthHit={};h.anchorCooling=!1;clearTimeout(h.scrollTimer);h.sections=k(h.options.sections);q()},destroy:function(){window.removeEventListener("scroll",b);window.removeEventListener("scroll",a);document.removeEventListener("click",g);
39
+ clearTimeout(h.scrollTimer);h.initialized=!1},defaults:u,state:h}}else console.warn("Metrics.ScrollTracker: Metrics core not loaded")})("undefined"!==typeof window?window:this);"use strict";
40
+ (function(d){function k(a){return a.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,60)}function c(a){a=document.querySelectorAll(a);for(var b=[],e=0,c=f.options&&f.options.minSectionHeight||0,r=0;r<a.length;r++){var g=a[r];g.offsetHeight<c||(g.id||(g.id=k(g.textContent||"")||"section-"+e),b.push({el:g,id:g.id,tag:g.tagName.toLowerCase(),ordinal:e++,snippet:(g.textContent||"").trim().slice(0,80)}))}return b}function b(){var a=f.options,c=window.scrollY||window.pageYOffset;if(Math.abs(c-
41
+ f._prevY)>a.settleTolerance)f._prevY=c,f.scrollTimer=setTimeout(b,a.recheckInterval);else{var e=window.scrollY||window.pageYOffset;for(var p=f.options,r=null,g=Infinity,d=0;d<f.sections.length;d++){var h=f.sections[d],k=h.el.offsetTop;k<=e+p.sectionLookback&&(k=Math.abs(k-e-180),k<g&&(g=k,r=h))}(e=r)&&!f.seen[e.id]&&(f.seen[e.id]=!0,m.send("section:"+e.id,{tag:e.tag,ordinal:e.ordinal,snippet:e.snippet}));e=document.documentElement.scrollHeight-window.innerHeight;if(0<e)for(c=Math.round(c/e*100),e=
42
+ 0;e<a.depthMilestones.length;e++)p=a.depthMilestones[e],c>=p&&!f.depthHit[p]&&(f.depthHit[p]=!0,m.send("depth:"+p+"%"))}}function a(){f.anchorCooling||(clearTimeout(f.scrollTimer),f._prevY=window.scrollY||window.pageYOffset,f.scrollTimer=setTimeout(b,f.options.debounce))}function g(){var a=f.options;if(a.tocSelector){for(var b=window.scrollY||window.pageYOffset,e="",c=0;c<f.tocSections.length;c++)b>=f.tocSections[c].el.offsetTop-160&&(e=f.tocSections[c].id);b=document.querySelectorAll(a.tocSelector);
43
+ for(c=0;c<b.length;c++)b[c].classList.remove(a.tocActiveClass),b[c].getAttribute("href")==="#"+e&&b[c].classList.add(a.tocActiveClass)}}function q(a){if(a=a.target.closest("a[href]")){var b=a.getAttribute("href")||"";"#"===b.charAt(0)?(f.anchorCooling=!0,setTimeout(function(){f.anchorCooling=!1},f.options.anchorCooldown),m.send("anchor:"+b.slice(1))):m.send(a.dataset.track||"link:"+b)}}function n(){if(f.activeSection&&f.options.trackDwell){var a=Math.round((Date.now()-f.activeSince)/1E3);if(0<a){var b=
44
+ f.dynamicSections[f.activeSection];m.send("dwell:"+f.activeSection,{seconds:a,name:b?b.name:f.activeSection})}f.activeSection=null;f.activeSince=null}}function u(a,b){var e=b.id||a.id||a.getAttribute("data-section")||a.getAttribute("data-track-section")||k(a.textContent||"")||"dyn-"+Object.keys(f.dynamicSections).length;a.id||(a.id=e);f.dynamicSections[e]={el:a,id:e,name:b.name||a.getAttribute("data-section-name")||a.getAttribute("title")||e,snippet:(a.textContent||"").trim().slice(0,80),observedAt:Date.now()};
45
+ window.IntersectionObserver&&!1!==b.autoTrack&&(b=new IntersectionObserver(function(a){a.forEach(function(a){a.isIntersecting&&.3<a.intersectionRatio?v.opened(e):a.isIntersecting||f.activeSection!==e||v.closed(e)})},{threshold:[0,.3]}),b.observe(a),f.dynamicSections[e]._io=b);return e}function h(a){var b=a.querySelectorAll("a[href], li[data-action], li[data-name]");if(b.length){a=new IntersectionObserver(function(a){a.forEach(function(a){if(a.isIntersecting){a=a.target;var b="nav-link:"+(a.getAttribute("data-name")||
46
+ a.getAttribute("data-action")||a.getAttribute("href")||a.textContent.trim().slice(0,40));f._navLinksSeen[b]||(f._navLinksSeen[b]=!0,m.send(b,{text:a.textContent.trim().slice(0,60)}))}})},{root:a,threshold:.5});for(var e=0;e<b.length;e++)a.observe(b[e]);f._navObservers.push(a)}}function y(){if(window.MutationObserver&&f.options.observeDom){var a=f.options.observeRoot||document.body,b=f.options.observeSelector;f._mutationObserver=new MutationObserver(function(a){a.forEach(function(a){a.addedNodes.forEach(function(a){if(1===
47
+ a.nodeType&&(a.matches&&a.matches(b)&&u(a,{}),a.querySelectorAll)){a=a.querySelectorAll(b);for(var e=0;e<a.length;e++)u(a[e],{})}})})});f._mutationObserver.observe(a,{childList:!0,subtree:!0})}}function w(){for(var a=window.scrollY||window.pageYOffset,b=0;b<f.sections.length;b++){var e=f.sections[b].el.getBoundingClientRect();-100<=e.top&&e.top<window.innerHeight&&(f.seen[f.sections[b].id]=!0)}b=document.documentElement.scrollHeight-window.innerHeight;if(0<b)for(a=Math.round(a/b*100),b=0;b<f.options.depthMilestones.length;b++)e=
48
+ f.options.depthMilestones[b],a>=e&&(f.depthHit[e]=!0)}var m=d.Metrics;if(m){var x={sections:"h2[id], h3[id], section[id], [data-section]",minSectionHeight:100,debounce:1E3,initDelay:800,anchorCooldown:1500,depthMilestones:[25,50,75,100],sectionLookback:300,settleTolerance:2,recheckInterval:500,observeDom:!1,observeRoot:null,observeSelector:"[data-section], [data-track-section]",trackDwell:!0,navContainers:null,trackContextuals:!0,trackClicks:!0,tocSelector:null,tocActiveClass:"active",tocSectionSelector:"h2[id]"},
49
+ f={initialized:!1,options:null,sections:[],tocSections:[],seen:{},depthHit:{},scrollTimer:null,anchorCooling:!1,_prevY:-1,dynamicSections:{},activeSection:null,activeSince:null,_mutationObserver:null,_navObservers:[],_navLinksSeen:{}},v={init:function(b){if(f.initialized)return console.warn("Metrics.NavigationTracker already initialized"),this;var d={},e;for(e in x)x.hasOwnProperty(e)&&(d[e]=x[e]);for(e in b||{})b.hasOwnProperty(e)&&void 0!==b[e]&&(d[e]=b[e]);f.options=d;f.initialized=!0;!m._endpoint&&
50
+ b&&b.endpoint&&m.init({endpoint:b.endpoint,page:b.page,sessionKey:b.sessionKey,sessionId:b.sessionId,extra:b.extra,trackUnload:b.trackUnload});setTimeout(function(){f.sections=c(d.sections);d.tocSelector&&d.tocSectionSelector&&(f.tocSections=c(d.tocSectionSelector));w();window.addEventListener("scroll",a,{passive:!0});d.tocSelector&&(window.addEventListener("scroll",g,{passive:!0}),g());d.observeDom&&y();if(d.navContainers){var b=f.options.navContainers;if(b&&window.IntersectionObserver){b=document.querySelectorAll(b);
51
+ for(var e=0;e<b.length;e++)h(b[e])}}},d.initDelay);d.trackClicks&&document.addEventListener("click",q);if(d.trackDwell)m.onVisibilityChange(function(a){a||n()},"NavigationTracker.dwell");return this},observe:function(a,b){return u(a,b||{})},opened:function(a){if(f.activeSection!==a)if(n(),f.activeSection=a,f.activeSince=Date.now(),f.seen[a])m.send("switched:"+a,{name:(f.dynamicSections[a]||{}).name||a});else{f.seen[a]=!0;var b=f.dynamicSections[a];m.send("opened:"+a,{name:b?b.name:a,snippet:b?b.snippet:
52
+ ""})}},closed:function(a){f.activeSection===a&&n()},observeNavContainer:function(a){h(a)},send:function(a,b){m.send(a,b)},markSeen:function(a){f.seen[a]=!0},getSessionId:function(){return m.getSessionId()},getSections:function(){return f.sections.map(function(a){return{id:a.id,tag:a.tag,ordinal:a.ordinal,snippet:a.snippet}})},getDynamicSections:function(){var a={},b;for(b in f.dynamicSections){var e=f.dynamicSections[b];a[b]={id:e.id,name:e.name,snippet:e.snippet}}return a},getSeen:function(){var a=
53
+ {},b;for(b in f.seen)a[b]=!0;return a},getActive:function(){return f.activeSection?{id:f.activeSection,since:f.activeSince,elapsed:Math.round((Date.now()-f.activeSince)/1E3)}:null},reset:function(){n();f.seen={};f.depthHit={};f.anchorCooling=!1;f._navLinksSeen={};clearTimeout(f.scrollTimer);for(var a in f.dynamicSections)f.dynamicSections[a]._io&&f.dynamicSections[a]._io.disconnect();f.dynamicSections={};f.activeSection=null;f.activeSince=null;f.sections=c(f.options.sections);w()},destroy:function(){n();
54
+ window.removeEventListener("scroll",a);window.removeEventListener("scroll",g);document.removeEventListener("click",q);clearTimeout(f.scrollTimer);f._mutationObserver&&(f._mutationObserver.disconnect(),f._mutationObserver=null);for(var b in f.dynamicSections)f.dynamicSections[b]._io&&f.dynamicSections[b]._io.disconnect();for(b=0;b<f._navObservers.length;b++)f._navObservers[b].disconnect();f._navObservers=[];f.initialized=!1},defaults:x,state:f};m.NavigationTracker=v;m.SectionTracker=v;m.ScrollTracker=
55
+ v}else console.warn("Metrics.NavigationTracker: Metrics core not loaded")})("undefined"!==typeof window?window:this);"use strict";
56
+ (function(d){function k(a){if(a.id)return a.id;if(a=a.src||a.currentSrc||""){var b=a.match(/(?:youtu\.be\/|youtube\.com\/embed\/|vimeo\.com\/video\/|vimeo\.com\/)([^?&#]+)/);if(b)return b[1];if((a=a.split("/").pop().split("?")[0])&&60>a.length)return a}return"media-"+l._counter++}function c(){this.ranges=[]}function b(a,b,r,g){return{id:a,type:b,el:r,duration:g||0,playing:!1,lastPosition:0,lastCheckpointAt:0,watched:new c,checkpointTimer:null,_lastTimeUpdate:0}}function a(a,b,c){var e={type:a.type,
57
+ position:Math.round(a.lastPosition),duration:Math.round(a.duration),watched:a.watched.total()};if(c)for(var p in c)e[p]=c[p];v.send(b+":"+a.id,e)}function g(b){q(b);b.checkpointTimer=setInterval(function(){b.playing&&a(b,"media-checkpoint")},1E3*l.options.checkpointInterval)}function q(a){a.checkpointTimer&&(clearInterval(a.checkpointTimer),a.checkpointTimer=null)}function n(e){var c=k(e);if(!l.tracked[c]){var r=b(c,"native",e,e.duration||0);l.tracked[c]=r;e.addEventListener("loadedmetadata",function(){r.duration=
58
+ e.duration||0});e.addEventListener("play",function(){r.playing=!0;r.lastPosition=e.currentTime;r._lastTimeUpdate=e.currentTime;a(r,"media-play");g(r)});e.addEventListener("pause",function(){r.playing&&(r.playing=!1,r.watched.add(r._lastTimeUpdate,e.currentTime),r.lastPosition=e.currentTime,q(r),a(r,"media-pause"))});e.addEventListener("ended",function(){r.playing=!1;r.watched.add(r._lastTimeUpdate,e.currentTime);r.lastPosition=e.currentTime;q(r);a(r,"media-ended")});e.addEventListener("seeked",function(){var b=
59
+ r.lastPosition;r.lastPosition=e.currentTime;r._lastTimeUpdate=e.currentTime;a(r,"media-seeked",{from:Math.round(b),to:Math.round(e.currentTime)})});e.addEventListener("timeupdate",function(){r.playing&&e.currentTime>r._lastTimeUpdate&&r.watched.add(r._lastTimeUpdate,e.currentTime);r._lastTimeUpdate=e.currentTime;r.lastPosition=e.currentTime})}}function u(a){if(l._ytApiLoaded)a();else if(l._ytApiLoading)l._ytPendingPlayers.push(a);else{l._ytApiLoading=!0;var b=d.onYouTubeIframeAPIReady;d.onYouTubeIframeAPIReady=
60
+ function(){l._ytApiLoaded=!0;l._ytApiLoading=!1;b&&b();a();for(var e=0;e<l._ytPendingPlayers.length;e++)l._ytPendingPlayers[e]();l._ytPendingPlayers=[]};var e=document.createElement("script");e.src="https://www.youtube.com/iframe_api";document.head.appendChild(e)}}function h(e){var c=e.src||"",r=k(e);if(!l.tracked[r]){if(-1===c.indexOf("enablejsapi"))if(l.options.reloadIframes){var d=-1===c.indexOf("?")?"?":"&";e.src=c+d+"enablejsapi=1&origin="+encodeURIComponent(location.origin)}else{console.warn("Metrics.MediaTracker: YouTube iframe missing enablejsapi=1, set reloadIframes:true to auto-fix. iframe:",
61
+ e);return}e.id||(e.id="yt-"+r);u(function(){if(!l.tracked[r]){var c=b(r,"youtube",e,0);l.tracked[r]=c;var p=new YT.Player(e.id,{events:{onReady:function(a){c.duration=p.getDuration()||0},onStateChange:function(b){var e=p.getCurrentTime()||0;c.lastPosition=e;switch(b.data){case YT.PlayerState.PLAYING:c.playing=!0;c._lastTimeUpdate=e;c.duration=p.getDuration()||c.duration;a(c,"media-play");g(c);c._pollTimer=setInterval(function(){var a=p.getCurrentTime()||0;c.playing&&a>c._lastTimeUpdate&&c.watched.add(c._lastTimeUpdate,
62
+ a);c._lastTimeUpdate=a;c.lastPosition=a},1E3);break;case YT.PlayerState.PAUSED:if(!c.playing)break;c.playing=!1;c.watched.add(c._lastTimeUpdate,e);q(c);clearInterval(c._pollTimer);a(c,"media-pause");break;case YT.PlayerState.ENDED:c.playing=!1,c.watched.add(c._lastTimeUpdate,e),q(c),clearInterval(c._pollTimer),a(c,"media-ended")}}}});c._player=p}})}}function y(a){if(l._vimeoApiLoaded)a();else if(l._vimeoApiLoading)setTimeout(function(){y(a)},200);else{l._vimeoApiLoading=!0;var b=document.createElement("script");
63
+ b.src="https://player.vimeo.com/api/player.js";b.onload=function(){l._vimeoApiLoaded=!0;l._vimeoApiLoading=!1;a()};document.head.appendChild(b)}}function w(e){var c=k(e);l.tracked[c]||y(function(){if(!l.tracked[c]){var p=b(c,"vimeo",e,0);l.tracked[c]=p;var d=new Vimeo.Player(e);p._player=d;d.getDuration().then(function(a){p.duration=a||0});d.on("play",function(b){p.playing=!0;p.lastPosition=b.seconds||0;p._lastTimeUpdate=p.lastPosition;p.duration=b.duration||p.duration;a(p,"media-play");g(p)});d.on("pause",
64
+ function(b){p.playing&&(p.playing=!1,b=b.seconds||0,p.watched.add(p._lastTimeUpdate,b),p.lastPosition=b,q(p),a(p,"media-pause"))});d.on("ended",function(b){p.playing=!1;b=b.seconds||p.duration;p.watched.add(p._lastTimeUpdate,b);p.lastPosition=b;q(p);a(p,"media-ended")});d.on("seeked",function(b){var e=p.lastPosition;p.lastPosition=b.seconds||0;p._lastTimeUpdate=p.lastPosition;a(p,"media-seeked",{from:Math.round(e),to:Math.round(p.lastPosition)})});d.on("timeupdate",function(a){a=a.seconds||0;p.playing&&
65
+ a>p._lastTimeUpdate&&p.watched.add(p._lastTimeUpdate,a);p._lastTimeUpdate=a;p.lastPosition=a})}})}function m(){for(var a=document.querySelectorAll(l.options.mediaSelector),b=0;b<a.length;b++)n(a[b]);a=document.querySelectorAll("iframe[src]");for(b=0;b<a.length;b++){var c=a[b].src||"";/youtube\.com\/embed|youtube-nocookie\.com\/embed/.test(c)?h(a[b]):/player\.vimeo\.com/.test(c)?w(a[b]):/w\.soundcloud\.com\/player/.test(c)?trackSoundCloud(a[b]):/dailymotion\.com\/embed/.test(c)?trackDailymotion(a[b]):
66
+ /open\.spotify\.com\/embed/.test(c)?trackSpotify(a[b]):/player\.twitch\.tv/.test(c)?trackTwitch(a[b]):/muse\.ai\/embed/.test(c)&&trackMuseAi(a[b])}a=document.querySelectorAll('[class*="wistia_embed"], [class*="wistia_async_"]');for(b=0;b<a.length;b++)trackWistia(a[b]);a=document.querySelectorAll(".jwplayer, [data-jw-id]");for(b=0;b<a.length;b++)trackJWPlayer(a[b])}function x(){if(window.MutationObserver&&l.options.observeDom){var a=l.options.observeRoot||document.body;l._mutationObserver=new MutationObserver(function(a){a.forEach(function(a){a.addedNodes.forEach(function(a){if(1===
67
+ a.nodeType){a.matches&&a.matches("video, audio")&&n(a);if("IFRAME"===a.tagName&&a.src){var b=a.src;/youtube\.com\/embed/.test(b)?h(a):/player\.vimeo\.com/.test(b)?w(a):/w\.soundcloud\.com\/player/.test(b)?trackSoundCloud(a):/dailymotion\.com\/embed/.test(b)?trackDailymotion(a):/open\.spotify\.com\/embed/.test(b)?trackSpotify(a):/player\.twitch\.tv/.test(b)?trackTwitch(a):/muse\.ai\/embed/.test(b)&&trackMuseAi(a)}a.className&&/wistia_embed|wistia_async_/.test(a.className)&&trackWistia(a);a.className&&
68
+ /jwplayer/.test(a.className)&&trackJWPlayer(a);if(a.querySelectorAll){b=a.querySelectorAll("video, audio");for(var e=0;e<b.length;e++)n(b[e]);e=a.querySelectorAll("iframe[src]");for(var c=0;c<e.length;c++)b=e[c].src||"",/youtube\.com\/embed/.test(b)?h(e[c]):/player\.vimeo\.com/.test(b)?w(e[c]):/w\.soundcloud\.com\/player/.test(b)?trackSoundCloud(e[c]):/dailymotion\.com\/embed/.test(b)?trackDailymotion(e[c]):/open\.spotify\.com\/embed/.test(b)?trackSpotify(e[c]):/player\.twitch\.tv/.test(b)?trackTwitch(e[c]):
69
+ /muse\.ai\/embed/.test(b)&&trackMuseAi(e[c]);b=a.querySelectorAll('[class*="wistia_embed"], [class*="wistia_async_"]');for(e=0;e<b.length;e++)trackWistia(b[e]);a=a.querySelectorAll(".jwplayer, [data-jw-id]");for(b=0;b<a.length;b++)trackJWPlayer(a[b])}}})})});l._mutationObserver.observe(a,{childList:!0,subtree:!0})}}function f(){for(var b in l.tracked){var c=l.tracked[b];c.playing&&("native"===c.type&&c.el&&(c.watched.add(c._lastTimeUpdate,c.el.currentTime||c.lastPosition),c.lastPosition=c.el.currentTime||
70
+ c.lastPosition),a(c,"media-checkpoint"))}}var v=d.Metrics;if(v){var t={checkpointInterval:10,autoDiscover:!0,mediaSelector:"video, audio",reloadIframes:!1,observeDom:!0,observeRoot:null,checkpointDebounce:1E3},l={initialized:!1,options:null,tracked:{},_counter:0,_mutationObserver:null,_ytApiLoaded:!1,_ytApiLoading:!1,_ytPendingPlayers:[],_vimeoApiLoaded:!1,_vimeoApiLoading:!1};c.prototype.add=function(a,b){if(!(b<=a)){a={start:Math.floor(a),end:Math.ceil(b)};b=[];for(var e=!1,c=0;c<this.ranges.length;c++){var g=
71
+ this.ranges[c];g.end<a.start?b.push(g):g.start>a.end?(e||(b.push(a),e=!0),b.push(g)):(a.start=Math.min(a.start,g.start),a.end=Math.max(a.end,g.end))}e||b.push(a);this.ranges=b}};c.prototype.total=function(){for(var a=0,b=0;b<this.ranges.length;b++)a+=this.ranges[b].end-this.ranges[b].start;return a};v.MediaTracker={init:function(a){if(l.initialized)return console.warn("Metrics.MediaTracker already initialized"),this;var b={},c;for(c in t)t.hasOwnProperty(c)&&(b[c]=t[c]);for(c in a||{})a.hasOwnProperty(c)&&
72
+ void 0!==a[c]&&(b[c]=a[c]);l.options=b;l.initialized=!0;!v._endpoint&&a&&a.endpoint&&v.init({endpoint:a.endpoint,page:a.page,trackUnload:a.trackUnload});b.autoDiscover&&setTimeout(function(){m()},500);b.observeDom&&x();v.onVisibilityChange(function(a){a||f()},"MediaTracker.flush");return this},trackNative:function(a,b){b&&(a.id=b);n(a)},trackYouTube:function(a,b){b&&(a.id=b);h(a)},trackVimeo:function(a,b){b&&(a.id=b);w(a)},trackSoundCloud:function(a,b){b&&(a.id=b);trackSoundCloud(a)},trackWistia:function(a,
73
73
  b){b&&(a.id=b);trackWistia(a)},trackJWPlayer:function(a,b){b&&(a.id=b);trackJWPlayer(a)},trackDailymotion:function(a,b){b&&(a.id=b);trackDailymotion(a)},trackSpotify:function(a,b){b&&(a.id=b);trackSpotify(a)},trackTwitch:function(a,b){b&&(a.id=b);trackTwitch(a)},trackMuseAi:function(a,b){b&&(a.id=b);trackMuseAi(a)},getTracked:function(){var a={},b;for(b in l.tracked){var c=l.tracked[b];a[b]={id:c.id,type:c.type,playing:c.playing,position:Math.round(c.lastPosition),duration:Math.round(c.duration),
74
- watched:c.watched.total()}}return a},flush:h,rescan:m,destroy:function(){for(var a in l.tracked){var b=l.tracked[a];p(b);b._pollTimer&&clearInterval(b._pollTimer)}l.tracked={};l._mutationObserver&&(l._mutationObserver.disconnect(),l._mutationObserver=null);l.initialized=!1},defaults:q,state:l}}else console.warn("Metrics.MediaTracker: Metrics core not loaded")})("undefined"!==typeof window?window:this);
75
- function loadSoundCloudAPI(c){if(root.SC&&root.SC.Widget)c();else{var k=document.createElement("script");k.src="https://w.soundcloud.com/player/api.js";k.onload=c;document.head.appendChild(k)}}
76
- function trackSoundCloud(c){var k=genId(c);state.tracked[k]||loadSoundCloudAPI(function(){if(!state.tracked[k]){var d=SC.Widget(c),a=createTracker(k,"soundcloud",c,0);state.tracked[k]=a;d.bind(SC.Widget.Events.READY,function(){d.getDuration(function(b){a.duration=(b||0)/1E3})});d.bind(SC.Widget.Events.PLAY,function(){a.playing=!0;d.getPosition(function(b){a.lastPosition=(b||0)/1E3;a._lastTimeUpdate=a.lastPosition;sendEvent(a,"media-play");startCheckpoints(a)})});d.bind(SC.Widget.Events.PAUSE,function(){a.playing&&
77
- (a.playing=!1,d.getPosition(function(b){b=(b||0)/1E3;a.watched.add(a._lastTimeUpdate,b);a.lastPosition=b;stopCheckpoints(a);sendEvent(a,"media-pause")}))});d.bind(SC.Widget.Events.FINISH,function(){a.playing=!1;a.watched.add(a._lastTimeUpdate,a.duration);a.lastPosition=a.duration;stopCheckpoints(a);sendEvent(a,"media-ended")});d.bind(SC.Widget.Events.SEEK,function(b){var c=a.lastPosition;a.lastPosition=(b.currentPosition||0)/1E3;a._lastTimeUpdate=a.lastPosition;sendEvent(a,"media-seeked",{from:Math.round(c),
78
- to:Math.round(a.lastPosition)})});d.bind(SC.Widget.Events.PLAY_PROGRESS,function(b){b=(b.currentPosition||0)/1E3;a.playing&&b>a._lastTimeUpdate&&a.watched.add(a._lastTimeUpdate,b);a._lastTimeUpdate=b;a.lastPosition=b})}})}
79
- function trackWistia(c){var k=genId(c);if(!state.tracked[k]){var d=c.getAttribute("data-wistia-id")||(c.className.match(/wistia_async_(\w+)/)||[])[1]||k;root._wq=root._wq||[];root._wq.push({id:d,onReady:function(a){if(!state.tracked[k]){var b=createTracker(k,"wistia",c,a.duration()||0);state.tracked[k]=b;b._player=a;a.bind("play",function(){b.playing=!0;b.lastPosition=a.time();b._lastTimeUpdate=b.lastPosition;b.duration=a.duration()||b.duration;sendEvent(b,"media-play");startCheckpoints(b)});a.bind("pause",
80
- function(){if(b.playing){b.playing=!1;var c=a.time();b.watched.add(b._lastTimeUpdate,c);b.lastPosition=c;stopCheckpoints(b);sendEvent(b,"media-pause")}});a.bind("end",function(){b.playing=!1;b.watched.add(b._lastTimeUpdate,b.duration);b.lastPosition=b.duration;stopCheckpoints(b);sendEvent(b,"media-ended")});a.bind("seek",function(a,c){b.lastPosition=a;b._lastTimeUpdate=a;sendEvent(b,"media-seeked",{from:Math.round(c),to:Math.round(a)})});a.bind("secondchange",function(a){b.playing&&a>b._lastTimeUpdate&&
81
- b.watched.add(b._lastTimeUpdate,a);b._lastTimeUpdate=a;b.lastPosition=a})}}});root.Wistia||(d=document.createElement("script"),d.src="https://fast.wistia.com/assets/external/E-v1.js",d.async=!0,document.head.appendChild(d))}}
82
- function trackJWPlayer(c){function k(){if(!root.jwplayer||"function"!==typeof root.jwplayer)return!1;try{var b=jwplayer(a)}catch(p){return!1}if(!b||!b.getState)return!1;var g=createTracker(d,"jwplayer",c,b.getDuration()||0);state.tracked[d]=g;g._player=b;b.on("play",function(){g.playing=!0;g.lastPosition=b.getPosition();g._lastTimeUpdate=g.lastPosition;g.duration=b.getDuration()||g.duration;sendEvent(g,"media-play");startCheckpoints(g)});b.on("pause",function(){if(g.playing){g.playing=!1;var a=b.getPosition();
83
- g.watched.add(g._lastTimeUpdate,a);g.lastPosition=a;stopCheckpoints(g);sendEvent(g,"media-pause")}});b.on("complete",function(){g.playing=!1;g.watched.add(g._lastTimeUpdate,g.duration);g.lastPosition=g.duration;stopCheckpoints(g);sendEvent(g,"media-ended")});b.on("seek",function(a){g.lastPosition=a.offset;g._lastTimeUpdate=a.offset;sendEvent(g,"media-seeked",{from:Math.round(a.position),to:Math.round(a.offset)})});b.on("time",function(a){var b=a.position;g.playing&&b>g._lastTimeUpdate&&g.watched.add(g._lastTimeUpdate,
84
- b);g._lastTimeUpdate=b;g.lastPosition=b;g.duration=a.duration||g.duration});return!0}var d=genId(c);if(!state.tracked[d]){var a=c.id||d;k()||setTimeout(function(){k()},2E3)}}
85
- function trackDailymotion(c){function k(){if(!state.tracked[d]){var a=createTracker(d,"dailymotion",c,0);state.tracked[d]=a;var b=DM.player(c,{events:{playing:function(){a.playing=!0;a.lastPosition=b.currentTime||0;a._lastTimeUpdate=a.lastPosition;a.duration=b.duration||a.duration;sendEvent(a,"media-play");startCheckpoints(a)},pause:function(){if(a.playing){a.playing=!1;var c=b.currentTime||0;a.watched.add(a._lastTimeUpdate,c);a.lastPosition=c;stopCheckpoints(a);sendEvent(a,"media-pause")}},end:function(){a.playing=
86
- !1;a.watched.add(a._lastTimeUpdate,a.duration);a.lastPosition=a.duration;stopCheckpoints(a);sendEvent(a,"media-ended")},seeking:function(){var c=a.lastPosition;a.lastPosition=b.currentTime||0;a._lastTimeUpdate=a.lastPosition;sendEvent(a,"media-seeked",{from:Math.round(c),to:Math.round(a.lastPosition)})},timeupdate:function(){var c=b.currentTime||0;a.playing&&c>a._lastTimeUpdate&&a.watched.add(a._lastTimeUpdate,c);a._lastTimeUpdate=c;a.lastPosition=c;a.duration=b.duration||a.duration}}});a._player=
87
- b}}var d=genId(c);state.tracked[d]||function(){if(root.DM&&root.DM.player)k();else{var a=document.createElement("script");a.src="https://api.dmcdn.net/all.js";a.onload=function(){k()};document.head.appendChild(a)}}()}
88
- function trackSpotify(c){var k=genId(c);if(!state.tracked[k]){var d=createTracker(k,"spotify",c,0);state.tracked[k]=d;window.addEventListener("message",function(a){if(a.data&&a.source===c.contentWindow){try{var b="string"===typeof a.data?JSON.parse(a.data):a.data}catch(p){return}if(b.type&&"playback_update"===b.type){a=b.payload&&b.payload.position||0;a/=1E3;var g=b.payload&&b.payload.isPaused;d.duration=(b.payload&&b.payload.duration||0)/1E3||d.duration;g||d.playing?g&&d.playing?(d.playing=!1,d.watched.add(d._lastTimeUpdate,
89
- a),d.lastPosition=a,stopCheckpoints(d),sendEvent(d,"media-pause")):!g&&d.playing&&a>d._lastTimeUpdate&&(d.watched.add(d._lastTimeUpdate,a),d._lastTimeUpdate=a,d.lastPosition=a):(d.playing=!0,d.lastPosition=a,d._lastTimeUpdate=a,sendEvent(d,"media-play"),startCheckpoints(d))}}})}}
90
- function trackTwitch(c){function k(){if(!state.tracked[d]){c.id||(c.id="twitch-"+d);var a=createTracker(d,"twitch",c,0);state.tracked[d]=a;var b=new Twitch.Player(c.id,{});a._player=b;b.addEventListener(Twitch.Player.PLAY,function(){a.playing=!0;a.lastPosition=b.getCurrentTime()||0;a._lastTimeUpdate=a.lastPosition;a.duration=b.getDuration()||a.duration;sendEvent(a,"media-play");startCheckpoints(a);a._pollTimer=setInterval(function(){var c=b.getCurrentTime()||0;a.playing&&c>a._lastTimeUpdate&&a.watched.add(a._lastTimeUpdate,
91
- c);a._lastTimeUpdate=c;a.lastPosition=c},1E3)});b.addEventListener(Twitch.Player.PAUSE,function(){if(a.playing){a.playing=!1;var c=b.getCurrentTime()||0;a.watched.add(a._lastTimeUpdate,c);a.lastPosition=c;stopCheckpoints(a);clearInterval(a._pollTimer);sendEvent(a,"media-pause")}});b.addEventListener(Twitch.Player.ENDED,function(){a.playing=!1;var c=b.getCurrentTime()||a.duration;a.watched.add(a._lastTimeUpdate,c);a.lastPosition=c;stopCheckpoints(a);clearInterval(a._pollTimer);sendEvent(a,"media-ended")})}}
92
- var d=genId(c);state.tracked[d]||function(){if(root.Twitch&&root.Twitch.Player)k();else{var a=document.createElement("script");a.src="https://player.twitch.tv/js/embed/v1.js";a.onload=function(){k()};document.head.appendChild(a)}}()}
93
- function trackMuseAi(c){var k=genId(c);if(!state.tracked[k]){var d=createTracker(k,"museai",c,0);state.tracked[k]=d;window.addEventListener("message",function(a){if(a.data&&a.source===c.contentWindow){try{var b="string"===typeof a.data?JSON.parse(a.data):a.data}catch(g){return}"play"===b.event?(d.playing=!0,d.lastPosition=b.currentTime||0,d._lastTimeUpdate=d.lastPosition,d.duration=b.duration||d.duration,sendEvent(d,"media-play"),startCheckpoints(d)):"pause"===b.event?d.playing&&(d.playing=!1,a=b.currentTime||
94
- 0,d.watched.add(d._lastTimeUpdate,a),d.lastPosition=a,stopCheckpoints(d),sendEvent(d,"media-pause")):"ended"===b.event?(d.playing=!1,d.watched.add(d._lastTimeUpdate,d.duration),d.lastPosition=d.duration,stopCheckpoints(d),sendEvent(d,"media-ended")):"timeupdate"===b.event&&(a=b.currentTime||0,d.duration=b.duration||d.duration,d.playing&&a>d._lastTimeUpdate&&d.watched.add(d._lastTimeUpdate,a),d._lastTimeUpdate=a,d.lastPosition=a)}});try{c.contentWindow.postMessage({method:"addEventListener",value:"play"},
95
- "*")}catch(a){}try{c.contentWindow.postMessage({method:"addEventListener",value:"pause"},"*")}catch(a){}try{c.contentWindow.postMessage({method:"addEventListener",value:"ended"},"*")}catch(a){}try{c.contentWindow.postMessage({method:"addEventListener",value:"timeupdate"},"*")}catch(a){}}};
74
+ watched:c.watched.total()}}return a},flush:f,rescan:m,destroy:function(){for(var a in l.tracked){var b=l.tracked[a];q(b);b._pollTimer&&clearInterval(b._pollTimer)}l.tracked={};l._mutationObserver&&(l._mutationObserver.disconnect(),l._mutationObserver=null);l.initialized=!1},defaults:t,state:l}}else console.warn("Metrics.MediaTracker: Metrics core not loaded")})("undefined"!==typeof window?window:this);
75
+ function loadSoundCloudAPI(d){if(root.SC&&root.SC.Widget)d();else{var k=document.createElement("script");k.src="https://w.soundcloud.com/player/api.js";k.onload=d;document.head.appendChild(k)}}
76
+ function trackSoundCloud(d){var k=genId(d);state.tracked[k]||loadSoundCloudAPI(function(){if(!state.tracked[k]){var c=SC.Widget(d),b=createTracker(k,"soundcloud",d,0);state.tracked[k]=b;c.bind(SC.Widget.Events.READY,function(){c.getDuration(function(a){b.duration=(a||0)/1E3})});c.bind(SC.Widget.Events.PLAY,function(){b.playing=!0;c.getPosition(function(a){b.lastPosition=(a||0)/1E3;b._lastTimeUpdate=b.lastPosition;sendEvent(b,"media-play");startCheckpoints(b)})});c.bind(SC.Widget.Events.PAUSE,function(){b.playing&&
77
+ (b.playing=!1,c.getPosition(function(a){a=(a||0)/1E3;b.watched.add(b._lastTimeUpdate,a);b.lastPosition=a;stopCheckpoints(b);sendEvent(b,"media-pause")}))});c.bind(SC.Widget.Events.FINISH,function(){b.playing=!1;b.watched.add(b._lastTimeUpdate,b.duration);b.lastPosition=b.duration;stopCheckpoints(b);sendEvent(b,"media-ended")});c.bind(SC.Widget.Events.SEEK,function(a){var c=b.lastPosition;b.lastPosition=(a.currentPosition||0)/1E3;b._lastTimeUpdate=b.lastPosition;sendEvent(b,"media-seeked",{from:Math.round(c),
78
+ to:Math.round(b.lastPosition)})});c.bind(SC.Widget.Events.PLAY_PROGRESS,function(a){a=(a.currentPosition||0)/1E3;b.playing&&a>b._lastTimeUpdate&&b.watched.add(b._lastTimeUpdate,a);b._lastTimeUpdate=a;b.lastPosition=a})}})}
79
+ function trackWistia(d){var k=genId(d);if(!state.tracked[k]){var c=d.getAttribute("data-wistia-id")||(d.className.match(/wistia_async_(\w+)/)||[])[1]||k;root._wq=root._wq||[];root._wq.push({id:c,onReady:function(b){if(!state.tracked[k]){var a=createTracker(k,"wistia",d,b.duration()||0);state.tracked[k]=a;a._player=b;b.bind("play",function(){a.playing=!0;a.lastPosition=b.time();a._lastTimeUpdate=a.lastPosition;a.duration=b.duration()||a.duration;sendEvent(a,"media-play");startCheckpoints(a)});b.bind("pause",
80
+ function(){if(a.playing){a.playing=!1;var c=b.time();a.watched.add(a._lastTimeUpdate,c);a.lastPosition=c;stopCheckpoints(a);sendEvent(a,"media-pause")}});b.bind("end",function(){a.playing=!1;a.watched.add(a._lastTimeUpdate,a.duration);a.lastPosition=a.duration;stopCheckpoints(a);sendEvent(a,"media-ended")});b.bind("seek",function(b,c){a.lastPosition=b;a._lastTimeUpdate=b;sendEvent(a,"media-seeked",{from:Math.round(c),to:Math.round(b)})});b.bind("secondchange",function(b){a.playing&&b>a._lastTimeUpdate&&
81
+ a.watched.add(a._lastTimeUpdate,b);a._lastTimeUpdate=b;a.lastPosition=b})}}});root.Wistia||(c=document.createElement("script"),c.src="https://fast.wistia.com/assets/external/E-v1.js",c.async=!0,document.head.appendChild(c))}}
82
+ function trackJWPlayer(d){function k(){if(!root.jwplayer||"function"!==typeof root.jwplayer)return!1;try{var a=jwplayer(b)}catch(q){return!1}if(!a||!a.getState)return!1;var g=createTracker(c,"jwplayer",d,a.getDuration()||0);state.tracked[c]=g;g._player=a;a.on("play",function(){g.playing=!0;g.lastPosition=a.getPosition();g._lastTimeUpdate=g.lastPosition;g.duration=a.getDuration()||g.duration;sendEvent(g,"media-play");startCheckpoints(g)});a.on("pause",function(){if(g.playing){g.playing=!1;var b=a.getPosition();
83
+ g.watched.add(g._lastTimeUpdate,b);g.lastPosition=b;stopCheckpoints(g);sendEvent(g,"media-pause")}});a.on("complete",function(){g.playing=!1;g.watched.add(g._lastTimeUpdate,g.duration);g.lastPosition=g.duration;stopCheckpoints(g);sendEvent(g,"media-ended")});a.on("seek",function(a){g.lastPosition=a.offset;g._lastTimeUpdate=a.offset;sendEvent(g,"media-seeked",{from:Math.round(a.position),to:Math.round(a.offset)})});a.on("time",function(a){var b=a.position;g.playing&&b>g._lastTimeUpdate&&g.watched.add(g._lastTimeUpdate,
84
+ b);g._lastTimeUpdate=b;g.lastPosition=b;g.duration=a.duration||g.duration});return!0}var c=genId(d);if(!state.tracked[c]){var b=d.id||c;k()||setTimeout(function(){k()},2E3)}}
85
+ function trackDailymotion(d){function k(){if(!state.tracked[c]){var b=createTracker(c,"dailymotion",d,0);state.tracked[c]=b;var a=DM.player(d,{events:{playing:function(){b.playing=!0;b.lastPosition=a.currentTime||0;b._lastTimeUpdate=b.lastPosition;b.duration=a.duration||b.duration;sendEvent(b,"media-play");startCheckpoints(b)},pause:function(){if(b.playing){b.playing=!1;var c=a.currentTime||0;b.watched.add(b._lastTimeUpdate,c);b.lastPosition=c;stopCheckpoints(b);sendEvent(b,"media-pause")}},end:function(){b.playing=
86
+ !1;b.watched.add(b._lastTimeUpdate,b.duration);b.lastPosition=b.duration;stopCheckpoints(b);sendEvent(b,"media-ended")},seeking:function(){var c=b.lastPosition;b.lastPosition=a.currentTime||0;b._lastTimeUpdate=b.lastPosition;sendEvent(b,"media-seeked",{from:Math.round(c),to:Math.round(b.lastPosition)})},timeupdate:function(){var c=a.currentTime||0;b.playing&&c>b._lastTimeUpdate&&b.watched.add(b._lastTimeUpdate,c);b._lastTimeUpdate=c;b.lastPosition=c;b.duration=a.duration||b.duration}}});b._player=
87
+ a}}var c=genId(d);state.tracked[c]||function(){if(root.DM&&root.DM.player)k();else{var b=document.createElement("script");b.src="https://api.dmcdn.net/all.js";b.onload=function(){k()};document.head.appendChild(b)}}()}
88
+ function trackSpotify(d){var k=genId(d);if(!state.tracked[k]){var c=createTracker(k,"spotify",d,0);state.tracked[k]=c;window.addEventListener("message",function(b){if(b.data&&b.source===d.contentWindow){try{var a="string"===typeof b.data?JSON.parse(b.data):b.data}catch(q){return}if(a.type&&"playback_update"===a.type){b=a.payload&&a.payload.position||0;b/=1E3;var g=a.payload&&a.payload.isPaused;c.duration=(a.payload&&a.payload.duration||0)/1E3||c.duration;g||c.playing?g&&c.playing?(c.playing=!1,c.watched.add(c._lastTimeUpdate,
89
+ b),c.lastPosition=b,stopCheckpoints(c),sendEvent(c,"media-pause")):!g&&c.playing&&b>c._lastTimeUpdate&&(c.watched.add(c._lastTimeUpdate,b),c._lastTimeUpdate=b,c.lastPosition=b):(c.playing=!0,c.lastPosition=b,c._lastTimeUpdate=b,sendEvent(c,"media-play"),startCheckpoints(c))}}})}}
90
+ function trackTwitch(d){function k(){if(!state.tracked[c]){d.id||(d.id="twitch-"+c);var b=createTracker(c,"twitch",d,0);state.tracked[c]=b;var a=new Twitch.Player(d.id,{});b._player=a;a.addEventListener(Twitch.Player.PLAY,function(){b.playing=!0;b.lastPosition=a.getCurrentTime()||0;b._lastTimeUpdate=b.lastPosition;b.duration=a.getDuration()||b.duration;sendEvent(b,"media-play");startCheckpoints(b);b._pollTimer=setInterval(function(){var c=a.getCurrentTime()||0;b.playing&&c>b._lastTimeUpdate&&b.watched.add(b._lastTimeUpdate,
91
+ c);b._lastTimeUpdate=c;b.lastPosition=c},1E3)});a.addEventListener(Twitch.Player.PAUSE,function(){if(b.playing){b.playing=!1;var c=a.getCurrentTime()||0;b.watched.add(b._lastTimeUpdate,c);b.lastPosition=c;stopCheckpoints(b);clearInterval(b._pollTimer);sendEvent(b,"media-pause")}});a.addEventListener(Twitch.Player.ENDED,function(){b.playing=!1;var c=a.getCurrentTime()||b.duration;b.watched.add(b._lastTimeUpdate,c);b.lastPosition=c;stopCheckpoints(b);clearInterval(b._pollTimer);sendEvent(b,"media-ended")})}}
92
+ var c=genId(d);state.tracked[c]||function(){if(root.Twitch&&root.Twitch.Player)k();else{var b=document.createElement("script");b.src="https://player.twitch.tv/js/embed/v1.js";b.onload=function(){k()};document.head.appendChild(b)}}()}
93
+ function trackMuseAi(d){var k=genId(d);if(!state.tracked[k]){var c=createTracker(k,"museai",d,0);state.tracked[k]=c;window.addEventListener("message",function(b){if(b.data&&b.source===d.contentWindow){try{var a="string"===typeof b.data?JSON.parse(b.data):b.data}catch(g){return}"play"===a.event?(c.playing=!0,c.lastPosition=a.currentTime||0,c._lastTimeUpdate=c.lastPosition,c.duration=a.duration||c.duration,sendEvent(c,"media-play"),startCheckpoints(c)):"pause"===a.event?c.playing&&(c.playing=!1,b=a.currentTime||
94
+ 0,c.watched.add(c._lastTimeUpdate,b),c.lastPosition=b,stopCheckpoints(c),sendEvent(c,"media-pause")):"ended"===a.event?(c.playing=!1,c.watched.add(c._lastTimeUpdate,c.duration),c.lastPosition=c.duration,stopCheckpoints(c),sendEvent(c,"media-ended")):"timeupdate"===a.event&&(b=a.currentTime||0,c.duration=a.duration||c.duration,c.playing&&b>c._lastTimeUpdate&&c.watched.add(c._lastTimeUpdate,b),c._lastTimeUpdate=b,c.lastPosition=b)}});try{d.contentWindow.postMessage({method:"addEventListener",value:"play"},
95
+ "*")}catch(b){}try{d.contentWindow.postMessage({method:"addEventListener",value:"pause"},"*")}catch(b){}try{d.contentWindow.postMessage({method:"addEventListener",value:"ended"},"*")}catch(b){}try{d.contentWindow.postMessage({method:"addEventListener",value:"timeupdate"},"*")}catch(b){}}}"use strict";
96
+ (function(d){function k(a){a=document.querySelectorAll(a);for(var b=[],c=0,d=h.options&&h.options.minSectionHeight||0,g=0;g<a.length;g++){var k=a[g];if(!(k.offsetHeight<d)){if(!k.id){var t=(k.textContent||"").trim().slice(0,60).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");k.id=t||"section-"+c}b.push({el:k,id:k.id,tag:k.tagName.toLowerCase(),ordinal:c++,snippet:(k.textContent||"").trim().slice(0,80)})}}return b}function c(){var a=h.options,b=window.scrollY||window.pageYOffset;if(Math.abs(b-
97
+ h._prevY)>a.settleTolerance)h._prevY=b,h.scrollTimer=setTimeout(c,a.recheckInterval);else{var d=window.scrollY||window.pageYOffset;for(var g=h.options,f=null,k=Infinity,t=0;t<h.sections.length;t++){var l=h.sections[t],e=l.el.offsetTop;e<=d+g.sectionLookback&&(e=Math.abs(e-d-180),e<k&&(k=e,f=l))}(d=f)&&!h.seen[d.id]&&(h.seen[d.id]=!0,n.send("section:"+d.id,{tag:d.tag,ordinal:d.ordinal,snippet:d.snippet}));d=document.documentElement.scrollHeight-window.innerHeight;if(0<d)for(b=Math.round(b/d*100),d=
98
+ 0;d<a.depthMilestones.length;d++)g=a.depthMilestones[d],b>=g&&!h.depthHit[g]&&(h.depthHit[g]=!0,n.send("depth:"+g+"%"))}}function b(){h.anchorCooling||(clearTimeout(h.scrollTimer),h._prevY=window.scrollY||window.pageYOffset,h.scrollTimer=setTimeout(c,h.options.debounce))}function a(){var a=h.options;if(a.tocSelector){for(var b=window.scrollY||window.pageYOffset,c="",d=0;d<h.tocSections.length;d++)b>=h.tocSections[d].el.offsetTop-160&&(c=h.tocSections[d].id);b=document.querySelectorAll(a.tocSelector);
99
+ for(d=0;d<b.length;d++)b[d].classList.remove(a.tocActiveClass),b[d].getAttribute("href")==="#"+c&&b[d].classList.add(a.tocActiveClass)}}function g(a){if(a=a.target.closest("a[href]")){var b=a.getAttribute("href")||"";"#"===b.charAt(0)?(h.anchorCooling=!0,setTimeout(function(){h.anchorCooling=!1},h.options.anchorCooldown),n.send("anchor:"+b.slice(1))):n.send(a.dataset.track||"link:"+b)}}function q(){for(var a=window.scrollY||window.pageYOffset,b=0;b<h.sections.length;b++){var c=h.sections[b].el.getBoundingClientRect();
100
+ -100<=c.top&&c.top<window.innerHeight&&(h.seen[h.sections[b].id]=!0)}b=document.documentElement.scrollHeight-window.innerHeight;if(0<b)for(a=Math.round(a/b*100),b=0;b<h.options.depthMilestones.length;b++)c=h.options.depthMilestones[b],a>=c&&(h.depthHit[c]=!0)}var n=d.Metrics;if(n){var u={sections:"h2[id], h3[id], section[id], [data-section]",minSectionHeight:100,debounce:1E3,initDelay:800,anchorCooldown:1500,depthMilestones:[25,50,75,100],sectionLookback:300,settleTolerance:2,recheckInterval:500,
101
+ trackClicks:!0,tocSelector:null,tocActiveClass:"active",tocSectionSelector:"h2[id]"},h={initialized:!1,options:null,sections:[],tocSections:[],seen:{},depthHit:{},scrollTimer:null,anchorCooling:!1,_prevY:-1};n.ScrollTracker={init:function(c){if(h.initialized)return console.warn("Metrics.ScrollTracker already initialized"),this;var d={},m;for(m in u)u.hasOwnProperty(m)&&(d[m]=u[m]);for(m in c||{})c.hasOwnProperty(m)&&void 0!==c[m]&&(d[m]=c[m]);h.options=d;h.initialized=!0;!n._endpoint&&c&&c.endpoint&&
102
+ n.init({endpoint:c.endpoint,page:c.page,sessionKey:c.sessionKey,sessionId:c.sessionId,extra:c.extra,trackUnload:c.trackUnload});setTimeout(function(){h.sections=k(d.sections);d.tocSelector&&d.tocSectionSelector&&(h.tocSections=k(d.tocSectionSelector));q();window.addEventListener("scroll",b,{passive:!0});d.tocSelector&&(window.addEventListener("scroll",a,{passive:!0}),a())},d.initDelay);d.trackClicks&&document.addEventListener("click",g);return this},send:function(a,b){n.send(a,b)},markSeen:function(a){h.seen[a]=
103
+ !0},getSessionId:function(){return n.getSessionId()},getSections:function(){return h.sections.map(function(a){return{id:a.id,tag:a.tag,ordinal:a.ordinal,snippet:a.snippet}})},getSeen:function(){var a={},b;for(b in h.seen)a[b]=!0;return a},reset:function(){h.seen={};h.depthHit={};h.anchorCooling=!1;clearTimeout(h.scrollTimer);h.sections=k(h.options.sections);q()},destroy:function(){window.removeEventListener("scroll",b);window.removeEventListener("scroll",a);document.removeEventListener("click",g);
104
+ clearTimeout(h.scrollTimer);h.initialized=!1},defaults:u,state:h}}else console.warn("Metrics.ScrollTracker: Metrics core not loaded")})("undefined"!==typeof window?window:this);"use strict";
105
+ (function(d){function k(a){return a.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,60)}function c(a){a=document.querySelectorAll(a);for(var b=[],c=0,d=f.options&&f.options.minSectionHeight||0,g=0;g<a.length;g++){var h=a[g];h.offsetHeight<d||(h.id||(h.id=k(h.textContent||"")||"section-"+c),b.push({el:h,id:h.id,tag:h.tagName.toLowerCase(),ordinal:c++,snippet:(h.textContent||"").trim().slice(0,80)}))}return b}function b(){var a=f.options,c=window.scrollY||window.pageYOffset;if(Math.abs(c-
106
+ f._prevY)>a.settleTolerance)f._prevY=c,f.scrollTimer=setTimeout(b,a.recheckInterval);else{var e=window.scrollY||window.pageYOffset;for(var d=f.options,g=null,h=Infinity,k=0;k<f.sections.length;k++){var q=f.sections[k],n=q.el.offsetTop;n<=e+d.sectionLookback&&(n=Math.abs(n-e-180),n<h&&(h=n,g=q))}(e=g)&&!f.seen[e.id]&&(f.seen[e.id]=!0,m.send("section:"+e.id,{tag:e.tag,ordinal:e.ordinal,snippet:e.snippet}));e=document.documentElement.scrollHeight-window.innerHeight;if(0<e)for(c=Math.round(c/e*100),e=
107
+ 0;e<a.depthMilestones.length;e++)d=a.depthMilestones[e],c>=d&&!f.depthHit[d]&&(f.depthHit[d]=!0,m.send("depth:"+d+"%"))}}function a(){f.anchorCooling||(clearTimeout(f.scrollTimer),f._prevY=window.scrollY||window.pageYOffset,f.scrollTimer=setTimeout(b,f.options.debounce))}function g(){var a=f.options;if(a.tocSelector){for(var b=window.scrollY||window.pageYOffset,c="",d=0;d<f.tocSections.length;d++)b>=f.tocSections[d].el.offsetTop-160&&(c=f.tocSections[d].id);b=document.querySelectorAll(a.tocSelector);
108
+ for(d=0;d<b.length;d++)b[d].classList.remove(a.tocActiveClass),b[d].getAttribute("href")==="#"+c&&b[d].classList.add(a.tocActiveClass)}}function q(a){if(a=a.target.closest("a[href]")){var b=a.getAttribute("href")||"";"#"===b.charAt(0)?(f.anchorCooling=!0,setTimeout(function(){f.anchorCooling=!1},f.options.anchorCooldown),m.send("anchor:"+b.slice(1))):m.send(a.dataset.track||"link:"+b)}}function n(){if(f.activeSection&&f.options.trackDwell){var a=Math.round((Date.now()-f.activeSince)/1E3);if(0<a){var b=
109
+ f.dynamicSections[f.activeSection];m.send("dwell:"+f.activeSection,{seconds:a,name:b?b.name:f.activeSection})}f.activeSection=null;f.activeSince=null}}function u(a,b){var c=b.id||a.id||a.getAttribute("data-section")||a.getAttribute("data-track-section")||k(a.textContent||"")||"dyn-"+Object.keys(f.dynamicSections).length;a.id||(a.id=c);f.dynamicSections[c]={el:a,id:c,name:b.name||a.getAttribute("data-section-name")||a.getAttribute("title")||c,snippet:(a.textContent||"").trim().slice(0,80),observedAt:Date.now()};
110
+ window.IntersectionObserver&&!1!==b.autoTrack&&(b=new IntersectionObserver(function(a){a.forEach(function(a){a.isIntersecting&&.3<a.intersectionRatio?v.opened(c):a.isIntersecting||f.activeSection!==c||v.closed(c)})},{threshold:[0,.3]}),b.observe(a),f.dynamicSections[c]._io=b);return c}function h(a){var b=a.querySelectorAll("a[href], li[data-action], li[data-name]");if(b.length){a=new IntersectionObserver(function(a){a.forEach(function(a){if(a.isIntersecting){a=a.target;var b="nav-link:"+(a.getAttribute("data-name")||
111
+ a.getAttribute("data-action")||a.getAttribute("href")||a.textContent.trim().slice(0,40));f._navLinksSeen[b]||(f._navLinksSeen[b]=!0,m.send(b,{text:a.textContent.trim().slice(0,60)}))}})},{root:a,threshold:.5});for(var c=0;c<b.length;c++)a.observe(b[c]);f._navObservers.push(a)}}function y(){if(window.MutationObserver&&f.options.observeDom){var a=f.options.observeRoot||document.body,b=f.options.observeSelector;f._mutationObserver=new MutationObserver(function(a){a.forEach(function(a){a.addedNodes.forEach(function(a){if(1===
112
+ a.nodeType&&(a.matches&&a.matches(b)&&u(a,{}),a.querySelectorAll)){a=a.querySelectorAll(b);for(var c=0;c<a.length;c++)u(a[c],{})}})})});f._mutationObserver.observe(a,{childList:!0,subtree:!0})}}function w(){for(var a=window.scrollY||window.pageYOffset,b=0;b<f.sections.length;b++){var c=f.sections[b].el.getBoundingClientRect();-100<=c.top&&c.top<window.innerHeight&&(f.seen[f.sections[b].id]=!0)}b=document.documentElement.scrollHeight-window.innerHeight;if(0<b)for(a=Math.round(a/b*100),b=0;b<f.options.depthMilestones.length;b++)c=
113
+ f.options.depthMilestones[b],a>=c&&(f.depthHit[c]=!0)}var m=d.Metrics;if(m){var x={sections:"h2[id], h3[id], section[id], [data-section]",minSectionHeight:100,debounce:1E3,initDelay:800,anchorCooldown:1500,depthMilestones:[25,50,75,100],sectionLookback:300,settleTolerance:2,recheckInterval:500,observeDom:!1,observeRoot:null,observeSelector:"[data-section], [data-track-section]",trackDwell:!0,navContainers:null,trackContextuals:!0,trackClicks:!0,tocSelector:null,tocActiveClass:"active",tocSectionSelector:"h2[id]"},
114
+ f={initialized:!1,options:null,sections:[],tocSections:[],seen:{},depthHit:{},scrollTimer:null,anchorCooling:!1,_prevY:-1,dynamicSections:{},activeSection:null,activeSince:null,_mutationObserver:null,_navObservers:[],_navLinksSeen:{}},v={init:function(b){if(f.initialized)return console.warn("Metrics.NavigationTracker already initialized"),this;var d={},e;for(e in x)x.hasOwnProperty(e)&&(d[e]=x[e]);for(e in b||{})b.hasOwnProperty(e)&&void 0!==b[e]&&(d[e]=b[e]);f.options=d;f.initialized=!0;!m._endpoint&&
115
+ b&&b.endpoint&&m.init({endpoint:b.endpoint,page:b.page,sessionKey:b.sessionKey,sessionId:b.sessionId,extra:b.extra,trackUnload:b.trackUnload});setTimeout(function(){f.sections=c(d.sections);d.tocSelector&&d.tocSectionSelector&&(f.tocSections=c(d.tocSectionSelector));w();window.addEventListener("scroll",a,{passive:!0});d.tocSelector&&(window.addEventListener("scroll",g,{passive:!0}),g());d.observeDom&&y();if(d.navContainers){var b=f.options.navContainers;if(b&&window.IntersectionObserver){b=document.querySelectorAll(b);
116
+ for(var e=0;e<b.length;e++)h(b[e])}}},d.initDelay);d.trackClicks&&document.addEventListener("click",q);if(d.trackDwell)m.onVisibilityChange(function(a){a||n()},"NavigationTracker.dwell");return this},observe:function(a,b){return u(a,b||{})},opened:function(a){if(f.activeSection!==a)if(n(),f.activeSection=a,f.activeSince=Date.now(),f.seen[a])m.send("switched:"+a,{name:(f.dynamicSections[a]||{}).name||a});else{f.seen[a]=!0;var b=f.dynamicSections[a];m.send("opened:"+a,{name:b?b.name:a,snippet:b?b.snippet:
117
+ ""})}},closed:function(a){f.activeSection===a&&n()},observeNavContainer:function(a){h(a)},send:function(a,b){m.send(a,b)},markSeen:function(a){f.seen[a]=!0},getSessionId:function(){return m.getSessionId()},getSections:function(){return f.sections.map(function(a){return{id:a.id,tag:a.tag,ordinal:a.ordinal,snippet:a.snippet}})},getDynamicSections:function(){var a={},b;for(b in f.dynamicSections){var c=f.dynamicSections[b];a[b]={id:c.id,name:c.name,snippet:c.snippet}}return a},getSeen:function(){var a=
118
+ {},b;for(b in f.seen)a[b]=!0;return a},getActive:function(){return f.activeSection?{id:f.activeSection,since:f.activeSince,elapsed:Math.round((Date.now()-f.activeSince)/1E3)}:null},reset:function(){n();f.seen={};f.depthHit={};f.anchorCooling=!1;f._navLinksSeen={};clearTimeout(f.scrollTimer);for(var a in f.dynamicSections)f.dynamicSections[a]._io&&f.dynamicSections[a]._io.disconnect();f.dynamicSections={};f.activeSection=null;f.activeSince=null;f.sections=c(f.options.sections);w()},destroy:function(){n();
119
+ window.removeEventListener("scroll",a);window.removeEventListener("scroll",g);document.removeEventListener("click",q);clearTimeout(f.scrollTimer);f._mutationObserver&&(f._mutationObserver.disconnect(),f._mutationObserver=null);for(var b in f.dynamicSections)f.dynamicSections[b]._io&&f.dynamicSections[b]._io.disconnect();for(b=0;b<f._navObservers.length;b++)f._navObservers[b].disconnect();f._navObservers=[];f.initialized=!1},defaults:x,state:f};m.NavigationTracker=v;m.SectionTracker=v;m.ScrollTracker=
120
+ v}else console.warn("Metrics.NavigationTracker: Metrics core not loaded")})("undefined"!==typeof window?window:this);"use strict";
121
+ (function(d){function k(a){if(a.id)return a.id;if(a=a.src||a.currentSrc||""){var b=a.match(/(?:youtu\.be\/|youtube\.com\/embed\/|vimeo\.com\/video\/|vimeo\.com\/)([^?&#]+)/);if(b)return b[1];if((a=a.split("/").pop().split("?")[0])&&60>a.length)return a}return"media-"+l._counter++}function c(){this.ranges=[]}function b(a,b,d,g){return{id:a,type:b,el:d,duration:g||0,playing:!1,lastPosition:0,lastCheckpointAt:0,watched:new c,checkpointTimer:null,_lastTimeUpdate:0}}function a(a,b,c){var d={type:a.type,
122
+ position:Math.round(a.lastPosition),duration:Math.round(a.duration),watched:a.watched.total()};if(c)for(var e in c)d[e]=c[e];v.send(b+":"+a.id,d)}function g(b){q(b);b.checkpointTimer=setInterval(function(){b.playing&&a(b,"media-checkpoint")},1E3*l.options.checkpointInterval)}function q(a){a.checkpointTimer&&(clearInterval(a.checkpointTimer),a.checkpointTimer=null)}function n(c){var d=k(c);if(!l.tracked[d]){var e=b(d,"native",c,c.duration||0);l.tracked[d]=e;c.addEventListener("loadedmetadata",function(){e.duration=
123
+ c.duration||0});c.addEventListener("play",function(){e.playing=!0;e.lastPosition=c.currentTime;e._lastTimeUpdate=c.currentTime;a(e,"media-play");g(e)});c.addEventListener("pause",function(){e.playing&&(e.playing=!1,e.watched.add(e._lastTimeUpdate,c.currentTime),e.lastPosition=c.currentTime,q(e),a(e,"media-pause"))});c.addEventListener("ended",function(){e.playing=!1;e.watched.add(e._lastTimeUpdate,c.currentTime);e.lastPosition=c.currentTime;q(e);a(e,"media-ended")});c.addEventListener("seeked",function(){var b=
124
+ e.lastPosition;e.lastPosition=c.currentTime;e._lastTimeUpdate=c.currentTime;a(e,"media-seeked",{from:Math.round(b),to:Math.round(c.currentTime)})});c.addEventListener("timeupdate",function(){e.playing&&c.currentTime>e._lastTimeUpdate&&e.watched.add(e._lastTimeUpdate,c.currentTime);e._lastTimeUpdate=c.currentTime;e.lastPosition=c.currentTime})}}function u(a){if(l._ytApiLoaded)a();else if(l._ytApiLoading)l._ytPendingPlayers.push(a);else{l._ytApiLoading=!0;var b=d.onYouTubeIframeAPIReady;d.onYouTubeIframeAPIReady=
125
+ function(){l._ytApiLoaded=!0;l._ytApiLoading=!1;b&&b();a();for(var c=0;c<l._ytPendingPlayers.length;c++)l._ytPendingPlayers[c]();l._ytPendingPlayers=[]};var c=document.createElement("script");c.src="https://www.youtube.com/iframe_api";document.head.appendChild(c)}}function h(c){var d=c.src||"",e=k(c);if(!l.tracked[e]){if(-1===d.indexOf("enablejsapi"))if(l.options.reloadIframes){var f=-1===d.indexOf("?")?"?":"&";c.src=d+f+"enablejsapi=1&origin="+encodeURIComponent(location.origin)}else{console.warn("Metrics.MediaTracker: YouTube iframe missing enablejsapi=1, set reloadIframes:true to auto-fix. iframe:",
126
+ c);return}c.id||(c.id="yt-"+e);u(function(){if(!l.tracked[e]){var d=b(e,"youtube",c,0);l.tracked[e]=d;var f=new YT.Player(c.id,{events:{onReady:function(a){d.duration=f.getDuration()||0},onStateChange:function(b){var c=f.getCurrentTime()||0;d.lastPosition=c;switch(b.data){case YT.PlayerState.PLAYING:d.playing=!0;d._lastTimeUpdate=c;d.duration=f.getDuration()||d.duration;a(d,"media-play");g(d);d._pollTimer=setInterval(function(){var a=f.getCurrentTime()||0;d.playing&&a>d._lastTimeUpdate&&d.watched.add(d._lastTimeUpdate,
127
+ a);d._lastTimeUpdate=a;d.lastPosition=a},1E3);break;case YT.PlayerState.PAUSED:if(!d.playing)break;d.playing=!1;d.watched.add(d._lastTimeUpdate,c);q(d);clearInterval(d._pollTimer);a(d,"media-pause");break;case YT.PlayerState.ENDED:d.playing=!1,d.watched.add(d._lastTimeUpdate,c),q(d),clearInterval(d._pollTimer),a(d,"media-ended")}}}});d._player=f}})}}function y(a){if(l._vimeoApiLoaded)a();else if(l._vimeoApiLoading)setTimeout(function(){y(a)},200);else{l._vimeoApiLoading=!0;var b=document.createElement("script");
128
+ b.src="https://player.vimeo.com/api/player.js";b.onload=function(){l._vimeoApiLoaded=!0;l._vimeoApiLoading=!1;a()};document.head.appendChild(b)}}function w(c){var d=k(c);l.tracked[d]||y(function(){if(!l.tracked[d]){var e=b(d,"vimeo",c,0);l.tracked[d]=e;var f=new Vimeo.Player(c);e._player=f;f.getDuration().then(function(a){e.duration=a||0});f.on("play",function(b){e.playing=!0;e.lastPosition=b.seconds||0;e._lastTimeUpdate=e.lastPosition;e.duration=b.duration||e.duration;a(e,"media-play");g(e)});f.on("pause",
129
+ function(b){e.playing&&(e.playing=!1,b=b.seconds||0,e.watched.add(e._lastTimeUpdate,b),e.lastPosition=b,q(e),a(e,"media-pause"))});f.on("ended",function(b){e.playing=!1;b=b.seconds||e.duration;e.watched.add(e._lastTimeUpdate,b);e.lastPosition=b;q(e);a(e,"media-ended")});f.on("seeked",function(b){var c=e.lastPosition;e.lastPosition=b.seconds||0;e._lastTimeUpdate=e.lastPosition;a(e,"media-seeked",{from:Math.round(c),to:Math.round(e.lastPosition)})});f.on("timeupdate",function(a){a=a.seconds||0;e.playing&&
130
+ a>e._lastTimeUpdate&&e.watched.add(e._lastTimeUpdate,a);e._lastTimeUpdate=a;e.lastPosition=a})}})}function m(){for(var a=document.querySelectorAll(l.options.mediaSelector),b=0;b<a.length;b++)n(a[b]);a=document.querySelectorAll("iframe[src]");for(b=0;b<a.length;b++){var c=a[b].src||"";/youtube\.com\/embed|youtube-nocookie\.com\/embed/.test(c)?h(a[b]):/player\.vimeo\.com/.test(c)?w(a[b]):/w\.soundcloud\.com\/player/.test(c)?trackSoundCloud(a[b]):/dailymotion\.com\/embed/.test(c)?trackDailymotion(a[b]):
131
+ /open\.spotify\.com\/embed/.test(c)?trackSpotify(a[b]):/player\.twitch\.tv/.test(c)?trackTwitch(a[b]):/muse\.ai\/embed/.test(c)&&trackMuseAi(a[b])}a=document.querySelectorAll('[class*="wistia_embed"], [class*="wistia_async_"]');for(b=0;b<a.length;b++)trackWistia(a[b]);a=document.querySelectorAll(".jwplayer, [data-jw-id]");for(b=0;b<a.length;b++)trackJWPlayer(a[b])}function x(){if(window.MutationObserver&&l.options.observeDom){var a=l.options.observeRoot||document.body;l._mutationObserver=new MutationObserver(function(a){a.forEach(function(a){a.addedNodes.forEach(function(a){if(1===
132
+ a.nodeType){a.matches&&a.matches("video, audio")&&n(a);if("IFRAME"===a.tagName&&a.src){var b=a.src;/youtube\.com\/embed/.test(b)?h(a):/player\.vimeo\.com/.test(b)?w(a):/w\.soundcloud\.com\/player/.test(b)?trackSoundCloud(a):/dailymotion\.com\/embed/.test(b)?trackDailymotion(a):/open\.spotify\.com\/embed/.test(b)?trackSpotify(a):/player\.twitch\.tv/.test(b)?trackTwitch(a):/muse\.ai\/embed/.test(b)&&trackMuseAi(a)}a.className&&/wistia_embed|wistia_async_/.test(a.className)&&trackWistia(a);a.className&&
133
+ /jwplayer/.test(a.className)&&trackJWPlayer(a);if(a.querySelectorAll){b=a.querySelectorAll("video, audio");for(var c=0;c<b.length;c++)n(b[c]);c=a.querySelectorAll("iframe[src]");for(var d=0;d<c.length;d++)b=c[d].src||"",/youtube\.com\/embed/.test(b)?h(c[d]):/player\.vimeo\.com/.test(b)?w(c[d]):/w\.soundcloud\.com\/player/.test(b)?trackSoundCloud(c[d]):/dailymotion\.com\/embed/.test(b)?trackDailymotion(c[d]):/open\.spotify\.com\/embed/.test(b)?trackSpotify(c[d]):/player\.twitch\.tv/.test(b)?trackTwitch(c[d]):
134
+ /muse\.ai\/embed/.test(b)&&trackMuseAi(c[d]);b=a.querySelectorAll('[class*="wistia_embed"], [class*="wistia_async_"]');for(c=0;c<b.length;c++)trackWistia(b[c]);a=a.querySelectorAll(".jwplayer, [data-jw-id]");for(b=0;b<a.length;b++)trackJWPlayer(a[b])}}})})});l._mutationObserver.observe(a,{childList:!0,subtree:!0})}}function f(){for(var b in l.tracked){var c=l.tracked[b];c.playing&&("native"===c.type&&c.el&&(c.watched.add(c._lastTimeUpdate,c.el.currentTime||c.lastPosition),c.lastPosition=c.el.currentTime||
135
+ c.lastPosition),a(c,"media-checkpoint"))}}var v=d.Metrics;if(v){var t={checkpointInterval:10,autoDiscover:!0,mediaSelector:"video, audio",reloadIframes:!1,observeDom:!0,observeRoot:null,checkpointDebounce:1E3},l={initialized:!1,options:null,tracked:{},_counter:0,_mutationObserver:null,_ytApiLoaded:!1,_ytApiLoading:!1,_ytPendingPlayers:[],_vimeoApiLoaded:!1,_vimeoApiLoading:!1};c.prototype.add=function(a,b){if(!(b<=a)){a={start:Math.floor(a),end:Math.ceil(b)};b=[];for(var c=!1,d=0;d<this.ranges.length;d++){var e=
136
+ this.ranges[d];e.end<a.start?b.push(e):e.start>a.end?(c||(b.push(a),c=!0),b.push(e)):(a.start=Math.min(a.start,e.start),a.end=Math.max(a.end,e.end))}c||b.push(a);this.ranges=b}};c.prototype.total=function(){for(var a=0,b=0;b<this.ranges.length;b++)a+=this.ranges[b].end-this.ranges[b].start;return a};v.MediaTracker={init:function(a){if(l.initialized)return console.warn("Metrics.MediaTracker already initialized"),this;var b={},c;for(c in t)t.hasOwnProperty(c)&&(b[c]=t[c]);for(c in a||{})a.hasOwnProperty(c)&&
137
+ void 0!==a[c]&&(b[c]=a[c]);l.options=b;l.initialized=!0;!v._endpoint&&a&&a.endpoint&&v.init({endpoint:a.endpoint,page:a.page,trackUnload:a.trackUnload});b.autoDiscover&&setTimeout(function(){m()},500);b.observeDom&&x();v.onVisibilityChange(function(a){a||f()},"MediaTracker.flush");return this},trackNative:function(a,b){b&&(a.id=b);n(a)},trackYouTube:function(a,b){b&&(a.id=b);h(a)},trackVimeo:function(a,b){b&&(a.id=b);w(a)},trackSoundCloud:function(a,b){b&&(a.id=b);trackSoundCloud(a)},trackWistia:function(a,
138
+ b){b&&(a.id=b);trackWistia(a)},trackJWPlayer:function(a,b){b&&(a.id=b);trackJWPlayer(a)},trackDailymotion:function(a,b){b&&(a.id=b);trackDailymotion(a)},trackSpotify:function(a,b){b&&(a.id=b);trackSpotify(a)},trackTwitch:function(a,b){b&&(a.id=b);trackTwitch(a)},trackMuseAi:function(a,b){b&&(a.id=b);trackMuseAi(a)},getTracked:function(){var a={},b;for(b in l.tracked){var c=l.tracked[b];a[b]={id:c.id,type:c.type,playing:c.playing,position:Math.round(c.lastPosition),duration:Math.round(c.duration),
139
+ watched:c.watched.total()}}return a},flush:f,rescan:m,destroy:function(){for(var a in l.tracked){var b=l.tracked[a];q(b);b._pollTimer&&clearInterval(b._pollTimer)}l.tracked={};l._mutationObserver&&(l._mutationObserver.disconnect(),l._mutationObserver=null);l.initialized=!1},defaults:t,state:l}}else console.warn("Metrics.MediaTracker: Metrics core not loaded")})("undefined"!==typeof window?window:this);
140
+ function loadSoundCloudAPI(d){if(root.SC&&root.SC.Widget)d();else{var k=document.createElement("script");k.src="https://w.soundcloud.com/player/api.js";k.onload=d;document.head.appendChild(k)}}
141
+ function trackSoundCloud(d){var k=genId(d);state.tracked[k]||loadSoundCloudAPI(function(){if(!state.tracked[k]){var c=SC.Widget(d),b=createTracker(k,"soundcloud",d,0);state.tracked[k]=b;c.bind(SC.Widget.Events.READY,function(){c.getDuration(function(a){b.duration=(a||0)/1E3})});c.bind(SC.Widget.Events.PLAY,function(){b.playing=!0;c.getPosition(function(a){b.lastPosition=(a||0)/1E3;b._lastTimeUpdate=b.lastPosition;sendEvent(b,"media-play");startCheckpoints(b)})});c.bind(SC.Widget.Events.PAUSE,function(){b.playing&&
142
+ (b.playing=!1,c.getPosition(function(a){a=(a||0)/1E3;b.watched.add(b._lastTimeUpdate,a);b.lastPosition=a;stopCheckpoints(b);sendEvent(b,"media-pause")}))});c.bind(SC.Widget.Events.FINISH,function(){b.playing=!1;b.watched.add(b._lastTimeUpdate,b.duration);b.lastPosition=b.duration;stopCheckpoints(b);sendEvent(b,"media-ended")});c.bind(SC.Widget.Events.SEEK,function(a){var c=b.lastPosition;b.lastPosition=(a.currentPosition||0)/1E3;b._lastTimeUpdate=b.lastPosition;sendEvent(b,"media-seeked",{from:Math.round(c),
143
+ to:Math.round(b.lastPosition)})});c.bind(SC.Widget.Events.PLAY_PROGRESS,function(a){a=(a.currentPosition||0)/1E3;b.playing&&a>b._lastTimeUpdate&&b.watched.add(b._lastTimeUpdate,a);b._lastTimeUpdate=a;b.lastPosition=a})}})}
144
+ function trackWistia(d){var k=genId(d);if(!state.tracked[k]){var c=d.getAttribute("data-wistia-id")||(d.className.match(/wistia_async_(\w+)/)||[])[1]||k;root._wq=root._wq||[];root._wq.push({id:c,onReady:function(b){if(!state.tracked[k]){var a=createTracker(k,"wistia",d,b.duration()||0);state.tracked[k]=a;a._player=b;b.bind("play",function(){a.playing=!0;a.lastPosition=b.time();a._lastTimeUpdate=a.lastPosition;a.duration=b.duration()||a.duration;sendEvent(a,"media-play");startCheckpoints(a)});b.bind("pause",
145
+ function(){if(a.playing){a.playing=!1;var c=b.time();a.watched.add(a._lastTimeUpdate,c);a.lastPosition=c;stopCheckpoints(a);sendEvent(a,"media-pause")}});b.bind("end",function(){a.playing=!1;a.watched.add(a._lastTimeUpdate,a.duration);a.lastPosition=a.duration;stopCheckpoints(a);sendEvent(a,"media-ended")});b.bind("seek",function(b,c){a.lastPosition=b;a._lastTimeUpdate=b;sendEvent(a,"media-seeked",{from:Math.round(c),to:Math.round(b)})});b.bind("secondchange",function(b){a.playing&&b>a._lastTimeUpdate&&
146
+ a.watched.add(a._lastTimeUpdate,b);a._lastTimeUpdate=b;a.lastPosition=b})}}});root.Wistia||(c=document.createElement("script"),c.src="https://fast.wistia.com/assets/external/E-v1.js",c.async=!0,document.head.appendChild(c))}}
147
+ function trackJWPlayer(d){function k(){if(!root.jwplayer||"function"!==typeof root.jwplayer)return!1;var a;try{a=jwplayer(b)}catch(q){return!1}if(!a||!a.getState)return!1;var g=createTracker(c,"jwplayer",d,a.getDuration()||0);state.tracked[c]=g;g._player=a;a.on("play",function(){g.playing=!0;g.lastPosition=a.getPosition();g._lastTimeUpdate=g.lastPosition;g.duration=a.getDuration()||g.duration;sendEvent(g,"media-play");startCheckpoints(g)});a.on("pause",function(){if(g.playing){g.playing=!1;var b=
148
+ a.getPosition();g.watched.add(g._lastTimeUpdate,b);g.lastPosition=b;stopCheckpoints(g);sendEvent(g,"media-pause")}});a.on("complete",function(){g.playing=!1;g.watched.add(g._lastTimeUpdate,g.duration);g.lastPosition=g.duration;stopCheckpoints(g);sendEvent(g,"media-ended")});a.on("seek",function(a){g.lastPosition=a.offset;g._lastTimeUpdate=a.offset;sendEvent(g,"media-seeked",{from:Math.round(a.position),to:Math.round(a.offset)})});a.on("time",function(a){var b=a.position;g.playing&&b>g._lastTimeUpdate&&
149
+ g.watched.add(g._lastTimeUpdate,b);g._lastTimeUpdate=b;g.lastPosition=b;g.duration=a.duration||g.duration});return!0}var c=genId(d);if(!state.tracked[c]){var b=d.id||c;k()||setTimeout(function(){k()},2E3)}}
150
+ function trackDailymotion(d){function k(){if(root.DM&&root.DM.player)c();else{var a=document.createElement("script");a.src="https://api.dmcdn.net/all.js";a.onload=function(){c()};document.head.appendChild(a)}}function c(){if(!state.tracked[b]){var a=createTracker(b,"dailymotion",d,0);state.tracked[b]=a;var c=DM.player(d,{events:{playing:function(){a.playing=!0;a.lastPosition=c.currentTime||0;a._lastTimeUpdate=a.lastPosition;a.duration=c.duration||a.duration;sendEvent(a,"media-play");startCheckpoints(a)},
151
+ pause:function(){if(a.playing){a.playing=!1;var b=c.currentTime||0;a.watched.add(a._lastTimeUpdate,b);a.lastPosition=b;stopCheckpoints(a);sendEvent(a,"media-pause")}},end:function(){a.playing=!1;a.watched.add(a._lastTimeUpdate,a.duration);a.lastPosition=a.duration;stopCheckpoints(a);sendEvent(a,"media-ended")},seeking:function(){var b=a.lastPosition;a.lastPosition=c.currentTime||0;a._lastTimeUpdate=a.lastPosition;sendEvent(a,"media-seeked",{from:Math.round(b),to:Math.round(a.lastPosition)})},timeupdate:function(){var b=
152
+ c.currentTime||0;a.playing&&b>a._lastTimeUpdate&&a.watched.add(a._lastTimeUpdate,b);a._lastTimeUpdate=b;a.lastPosition=b;a.duration=c.duration||a.duration}}});a._player=c}}var b=genId(d);state.tracked[b]||k()}
153
+ function trackSpotify(d){var k=genId(d);if(!state.tracked[k]){var c=createTracker(k,"spotify",d,0);state.tracked[k]=c;window.addEventListener("message",function(b){if(b.data&&b.source===d.contentWindow){var a;try{a="string"===typeof b.data?JSON.parse(b.data):b.data}catch(q){return}if(a.type&&"playback_update"===a.type){b=a.payload&&a.payload.position||0;b/=1E3;var g=a.payload&&a.payload.duration||0;a=a.payload&&a.payload.isPaused;c.duration=g/1E3||c.duration;a||c.playing?a&&c.playing?(c.playing=!1,
154
+ c.watched.add(c._lastTimeUpdate,b),c.lastPosition=b,stopCheckpoints(c),sendEvent(c,"media-pause")):!a&&c.playing&&b>c._lastTimeUpdate&&(c.watched.add(c._lastTimeUpdate,b),c._lastTimeUpdate=b,c.lastPosition=b):(c.playing=!0,c.lastPosition=b,c._lastTimeUpdate=b,sendEvent(c,"media-play"),startCheckpoints(c))}}})}}
155
+ function trackTwitch(d){function k(){if(root.Twitch&&root.Twitch.Player)c();else{var a=document.createElement("script");a.src="https://player.twitch.tv/js/embed/v1.js";a.onload=function(){c()};document.head.appendChild(a)}}function c(){if(!state.tracked[b]){d.id||(d.id="twitch-"+b);var a=createTracker(b,"twitch",d,0);state.tracked[b]=a;var c=new Twitch.Player(d.id,{});a._player=c;c.addEventListener(Twitch.Player.PLAY,function(){a.playing=!0;a.lastPosition=c.getCurrentTime()||0;a._lastTimeUpdate=a.lastPosition;
156
+ a.duration=c.getDuration()||a.duration;sendEvent(a,"media-play");startCheckpoints(a);a._pollTimer=setInterval(function(){var b=c.getCurrentTime()||0;a.playing&&b>a._lastTimeUpdate&&a.watched.add(a._lastTimeUpdate,b);a._lastTimeUpdate=b;a.lastPosition=b},1E3)});c.addEventListener(Twitch.Player.PAUSE,function(){if(a.playing){a.playing=!1;var b=c.getCurrentTime()||0;a.watched.add(a._lastTimeUpdate,b);a.lastPosition=b;stopCheckpoints(a);clearInterval(a._pollTimer);sendEvent(a,"media-pause")}});c.addEventListener(Twitch.Player.ENDED,
157
+ function(){a.playing=!1;var b=c.getCurrentTime()||a.duration;a.watched.add(a._lastTimeUpdate,b);a.lastPosition=b;stopCheckpoints(a);clearInterval(a._pollTimer);sendEvent(a,"media-ended")})}}var b=genId(d);state.tracked[b]||k()}
158
+ function trackMuseAi(d){var k=genId(d);if(!state.tracked[k]){var c=createTracker(k,"museai",d,0);state.tracked[k]=c;window.addEventListener("message",function(b){if(b.data&&b.source===d.contentWindow){var a;try{a="string"===typeof b.data?JSON.parse(b.data):b.data}catch(g){return}"play"===a.event?(c.playing=!0,c.lastPosition=a.currentTime||0,c._lastTimeUpdate=c.lastPosition,c.duration=a.duration||c.duration,sendEvent(c,"media-play"),startCheckpoints(c)):"pause"===a.event?c.playing&&(c.playing=!1,b=
159
+ a.currentTime||0,c.watched.add(c._lastTimeUpdate,b),c.lastPosition=b,stopCheckpoints(c),sendEvent(c,"media-pause")):"ended"===a.event?(c.playing=!1,c.watched.add(c._lastTimeUpdate,c.duration),c.lastPosition=c.duration,stopCheckpoints(c),sendEvent(c,"media-ended")):"timeupdate"===a.event&&(b=a.currentTime||0,c.duration=a.duration||c.duration,c.playing&&b>c._lastTimeUpdate&&c.watched.add(c._lastTimeUpdate,b),c._lastTimeUpdate=b,c.lastPosition=b)}});try{d.contentWindow.postMessage({method:"addEventListener",
160
+ value:"play"},"*")}catch(b){}try{d.contentWindow.postMessage({method:"addEventListener",value:"pause"},"*")}catch(b){}try{d.contentWindow.postMessage({method:"addEventListener",value:"ended"},"*")}catch(b){}try{d.contentWindow.postMessage({method:"addEventListener",value:"timeupdate"},"*")}catch(b){}}};
@@ -1 +1,12 @@
1
- !function(t,r){"object"==typeof module&&module.exports?module.exports=r():"function"==typeof define&&define.amd?define([],r):t.Handlebars=r()}("undefined"!=typeof self?self:this,function(){"use strict";function t(t){this.string=String(t)}function r(t,r){return Object.prototype.hasOwnProperty.call(t,r)}function e(t,e){for(var n in e)r(e,n)&&(t[n]=e[n]);return t}function n(t){var r={};return t&&"object"==typeof t&&e(r,t),r}function a(r){return null==r?"":r instanceof t?r.toString():String(r).replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[t]))}function i(t,r){if(null!=t){if(!r)return t;for(var e=r.split("."),n=t,a=0;a<e.length;a++){var i=e[a];"["===i[0]&&"]"==i[i.length-1]&&(i=i.slice(1,-1)),n=null!=n?n[i]:void 0}return n}}function s(t){for(var r=[],e="",n=null,a=!1,i=0,s=0;s<t.length;s++){var o=t[s];if(n){if(a){e+=o,a=!1;continue}if("\\"===o){e+=o,a=!0;continue}e+=o,o===n&&(n=null)}else"'"!==o&&'"'!==o?"("!==o?")"!==o?/\s/.test(o)&&0===i?e&&(r.push(e),e=""):e+=o:(i>0&&i--,e+=o):(i++,e+=o):(e+=o,n=o)}return e&&r.push(e),r}function o(t){var r=s(t);return r.length?r[0]:""}function f(t){return"("===t[0]&&")"===t[t.length-1]}function l(t,r,e,n){if(f(t)){var a=t.slice(1,-1).trim(),s=o(a);if(p[s]){var u=c(a.slice(s.length).trim(),r,e,n),h={hash:u.hash,data:n,fn:()=>"",inverse:()=>""};return p[s].apply(r,u.args.concat(h))}return l(a,r,e,n)}return"'"===t[0]&&"'"===t[t.length-1]||'"'===t[0]&&'"'===t[t.length-1]?t.slice(1,-1):function(t,r,e,n){if("this"===t||"."===t)return r;if("@index"===t)return n&&n["@index"];if("@key"===t)return n&&n["@key"];if("@first"===t)return n&&n["@first"];if("@last"===t)return n&&n["@last"];if(0===t.indexOf("@root."))return i(n.root,t.slice(6));if("@root"===t)return n.root;for(var a=0;0===t.indexOf("../");)a++,t=t.slice(3);var s=r;if(a>0){var o=e.length-1-a;o<0&&(o=0),s=e[o]}return i(s,t)}(t,r,e,n)}function c(t,r,e,n){for(var a=s(t),i=[],o={},f=0;f<a.length;f++){var c=a[f],u=c.indexOf("=");if(u>0){var p=c.slice(0,u),h=c.slice(u+1);o[p]=l(h,r,e,n)}else i.push(l(c,r,e,n))}return{args:i,hash:o}}function u(t){for(var r=0,e="var out='';var __stack=[ctx];\n",n=t.split(/(\{\{\{\{[\s\S]+?\}\}\}\}|\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\})/),a=[],i=0;i<n.length;i++){if(N=n[i])if(N.startsWith("{{{{raw}}}}")){var l=t.indexOf("{{{{/raw}}}}",t.indexOf(N)),c=t.slice(t.indexOf(N)+10,l);e+="out+="+JSON.stringify(c)+";\n",i+=2}else if(N.startsWith("{{{")&&N.endsWith("}}}")){var u=N.slice(3,-3).trim();e+="var v=evalMaybePath("+JSON.stringify(u)+",ctx,__stack,data);out+=(v==null?'':v);\n"}else if(N.startsWith("{{")&&N.endsWith("}}")){var p=N.slice(2,-2).trim();if("!"===p[0]||p.startsWith("--"))continue;if("#"===p[0]){var h=o(c=p.slice(1).trim()),v=c.slice(h.length).trim(),g=/\s+as\s+\|([^|]+)\|/.exec(v),d=null;g&&(d=g[1].trim().split(/\s+/),v=v.replace(g[0],""));var x=++r;if(a.push(x),e+="var parsed"+x+"=parseArgs("+JSON.stringify(v)+",ctx,__stack,data);",e+="var outerCtx"+x+"=ctx;var opts"+x+"={hash:parsed"+x+".hash,data:data,fn:function(sub,o){var out='';var d=createFrame(data);if(o&&o.data)assign(d,o.data);var data=d;ctx=sub||outerCtx"+x+";__stack.push(ctx);",d)for(var y=0;y<d.length;y++)e+="ctx["+JSON.stringify(d[y])+"]=sub;";continue}if("else"===p){e+="return out;},inverse:function(sub,o){var out='';ctx=sub||ctx;__stack.push(ctx);\n";continue}if("/"===p[0]){l=p.slice(1).trim();var O=a.pop();e+="return out;}};if(!opts"+O+".inverse)opts"+O+".inverse=function(){return '';};var r=(helpers["+JSON.stringify(l)+"]||helpers.blockHelperMissing).apply(ctx,parsed"+O+".args.concat(opts"+O+"));out+=(r||'');ctx=outerCtx"+O+";__stack.pop();\n";continue}if(p.startsWith("#>")){var S=p.slice(2).trim();e+="if(partials["+JSON.stringify(S)+"])out+=partials["+JSON.stringify(S)+"](ctx,partials,helpers,data,evalMaybePath,parseArgs,escapeExpression,createFrame,assign,firstToken,{fn:function(){return '';}});\n";continue}if(">"===p[0]){var m=s(v=p.slice(1).trim()),b=m.shift(),k=f(b),_=m.join(" ");e+="var pName"+(x=++r)+"="+(k?"evalMaybePath("+JSON.stringify(b)+",ctx,__stack,data)":"'"+b+"'")+";",e+="var pArgs=parseArgs("+JSON.stringify(_)+",ctx,__stack,data);",e+="var pCtx=ctx;if(Object.keys(pArgs.hash).length) pCtx=assign({},ctx),assign(pCtx,pArgs.hash);",e+="if(partials[pName"+x+"])out+=partials[pName"+x+"](pCtx,partials,helpers,data,evalMaybePath,parseArgs,escapeExpression,createFrame,assign,firstToken);\n";continue}var N=o(p);e+="if(helpers["+JSON.stringify(N)+"]) {var p=parseArgs("+JSON.stringify(p.slice(N.length).trim())+",ctx,__stack,data);var opts={hash:p.hash,data:data,fn:function(){return ''},inverse:function(){return ''}};out+=(helpers["+JSON.stringify(N)+"]||helpers.helperMissing).apply(ctx,p.args.concat(opts))||'';} else {var v=evalMaybePath("+JSON.stringify(p)+",ctx,__stack,data);out+=(v==null?'':escapeExpression(v));}\n"}else e+="out+="+JSON.stringify(N)+";\n"}return e+="return out;",new Function("ctx","partials","helpers","data","evalMaybePath","parseArgs","escapeExpression","createFrame","assign","firstToken",e)}t.prototype.toString=function(){return this.string};var p=Object.create(null),h=Object.create(null);return p.if=function(t,r){return t?r.fn(this,{data:r.data}):r.inverse(this,{data:r.data})},p.unless=function(t,r){return t?r.inverse(this,{data:r.data}):r.fn(this,{data:r.data})},p.each=function(t,r){if(!t||Array.isArray(t)&&!t.length)return r.inverse(this);var e,a="",i=0;if(Array.isArray(t))for(i=0;i<t.length;i++)(e=n(r.data))["@index"]=i,e["@first"]=0===i,e["@last"]=i===t.length-1,a+=r.fn(t[i],{data:e});else{var s=Object.keys(t);for(i=0;i<s.length;i++){var o=s[i];(e=n(r.data))["@key"]=o,e["@index"]=i,e["@first"]=0===i,e["@last"]=i===s.length-1,a+=r.fn(t[o],{data:e})}}return a},p.with=(t,r)=>t?r.fn(t):r.inverse(this),p.log=t=>{console&&console.log&&console.log(t)},p.lookup=(t,r)=>t?t[r]:"",p.helperMissing=()=>"",p.blockHelperMissing=(t,r)=>t?r.fn(t):r.inverse(t),{compile:(t,r)=>{return i=u(String(t)),function(t,r){var s=r&&r.data||{};return void 0===s.root&&(s.root=t),i(t||{},h,p,s,l,c,a,n,e,o)};var i},registerHelper:(t,e)=>{if("object"==typeof t)for(var n in t)r(t,n)&&(p[n]=t[n]);else p[t]=e},registerPartial:(t,e)=>{if("object"==typeof t)for(var n in t)r(t,n)&&(h[n]="function"==typeof e?e:u(String(e)));else h[t]="function"==typeof e?e:u(String(e))},helpers:p,partials:h,escapeExpression:a,createFrame:n,SafeString:t}});
1
+ if(!window.$){var c=function(a){this.length=a.length;for(var b=0;b<a.length;b++)this[b]=a[b]};if(!window.jQuery){var fn={each:function(a){for(var b=0;b<this.length;b++)a.call(this[b],b,this[b]);return this},html:function(a){if(a===undefined)return this[0]&&this[0].innerHTML;return this.each(function(){this.innerHTML=a})},text:function(a){if(a===undefined)return this[0]&&this[0].textContent;return this.each(function(){this.textContent=a})},val:function(v){if(!this[0])return;var el=this[0];if(v===undefined)return el.value;
2
+ if(el.value!==undefined)this.each(function(){this.value=v});return this},append:function(a){return this.each(function(){var b=this;if(a instanceof c)a.each(function(){b.appendChild(this)});else if(a instanceof Element)b.appendChild(a);else if(typeof a==="string")b.insertAdjacentHTML("beforeend",a)})},prepend:function(a){return this.each(function(){var b=this;if(a instanceof c)a.each(function(){b.insertBefore(this,b.firstChild)});else if(a instanceof Element)b.insertBefore(a,b.firstChild);else if(typeof a===
3
+ "string")b.insertAdjacentHTML("afterbegin",a)})},appendTo:function(a){var t=this;if(a instanceof c)a.each(function(){for(var i=0;i<t.length;i++)this.appendChild(t[i])});else if(a instanceof Element)for(var i=0;i<t.length;i++)a.appendChild(t[i]);else if(typeof a==="string")$(a).append(this);return this},prependTo:function(a){var t=this;if(a instanceof c)a.each(function(){for(var i=0;i<t.length;i++)this.insertBefore(t[i],this.firstChild)});else if(a instanceof Element)for(var i=0;i<t.length;i++)a.insertBefore(t[i],
4
+ a.firstChild);else if(typeof a==="string")$(a).prepend(this);return this},parents:function(s){var p=[];this.each(function(){for(var x=this.parentElement;x;x=x.parentElement)if(p.indexOf(x)<0)p.push(x)});p=new c(p);return s?p.filter(s):p},parent:function(s){var p=[];this.each(function(){var x=this.parentElement;if(x&&p.indexOf(x)<0)p.push(x)});p=new c(p);return s?p.filter(s):p},children:function(s){var ch=[];this.each(function(){for(var i=0;i<this.children.length;i++)ch.push(this.children[i])});ch=
5
+ new c(ch);return s?ch.filter(s):ch},filter:function(sel){var r=[];this.each(function(){if(this.matches(sel))r.push(this)});return new c(r)},eq:function(i){return new c([this[i]])},addClass:function(a){return this.each(function(){this.classList.add(a)})},removeClass:function(a){return this.each(function(){this.classList.remove(a)})},hasClass:function(a){return this[0]?this[0].classList.contains(a):false},attr:function(a,b){if(typeof a==="object"&&a){for(var k in a)this.each(function(){this.setAttribute(k,
6
+ a[k])});return this}if(b===undefined)return this[0]&&this[0].getAttribute(a);return this.each(function(){this.setAttribute(a,b)})},css:function(a,b){if(typeof a==="object"&&a){for(var k in a)this.each(function(){this.style[k]=a[k]});return this}if(b===undefined)return this[0]&&getComputedStyle(this[0])[a];return this.each(function(){this.style[a]=b})},scrollTop:function(v){if(!this[0])return 0;if(v===undefined)return this[0].scrollTop;return this.each(function(){this.scrollTop=v})},on:function(a,
7
+ b){return this.each(function(){this.addEventListener(a,b)})},off:function(a,b){return this.each(function(){this.removeEventListener(a,b)})},trigger:function(a){return this.each(function(){this.dispatchEvent(new Event(a))})},hide:function(){return this.each(function(){this.style.display="none"})},show:function(){return this.each(function(){this.style.display=""})},toggle:function(state){return this.each(function(){this.style.display=state===undefined?this.style.display==="none"?"":"none":state?"":
8
+ "none"})},empty:function(){return this.each(function(){this.innerHTML=""})},remove:function(){return this.each(function(){this.remove()})},find:function(a){return new c(this[0]?this[0].querySelectorAll(a):[])},closest:function(a){return new c(this[0]?[this[0].closest(a)]:[])},height:function(){return this[0]?this[0].offsetHeight:0},width:function(){return this[0]?this[0].offsetWidth:0},outerHeight:function(){if(!this[0])return 0;var s=getComputedStyle(this[0]);return this[0].offsetHeight+parseFloat(s.marginTop||
9
+ 0)+parseFloat(s.marginBottom||0)},outerWidth:function(){if(!this[0])return 0;var s=getComputedStyle(this[0]);return this[0].offsetWidth+parseFloat(s.marginLeft||0)+parseFloat(s.marginRight||0)},data:function(a,b){if(!this[0])return;if(!this[0].__data)this[0].__data={};if(b===undefined)return this[0].__data[a];this.each(function(){this.__data[a]=b});return this},is:function(a){if(!this[0])return!1;if(a===":visible")return this[0].offsetParent!==null;return this[0].matches(a)},ready:function(fn){if(this[0]===
10
+ document||this[0]===window)if(document.readyState==="complete"||document.readyState==="interactive")setTimeout(fn,0);else document.addEventListener("DOMContentLoaded",fn);return this}};["click","focus","blur","change","submit"].forEach(function(ev){fn[ev]=function(handler){if(handler)return this.on(ev,handler);return this.trigger(ev)}});c.prototype=fn;window.$=window.jQuery=function(a){if(typeof a==="function")return $(document).ready(a);if(typeof a==="string"&&a.trim().startsWith("<")){a=a.trim();
11
+ var tagMatch=a.match(/^<([a-z0-9-]+)/i);if(tagMatch){var tag=tagMatch[1];var attrMatch=a.match(/<[^>]+>/);var attrs={};(attrMatch?attrMatch[0]:"").replace(/([a-zA-Z_:][-a-zA-Z0-9_:.]*)="([^"]*)"/g,function(_,key,val){attrs[key]=val});return new c([Q.element?Q.element(tag,attrs):Object.assign(document.createElement(tag),attrs)])}var div=document.createElement("div");div.innerHTML=a;return new c(Array.from(div.children))}if(typeof a==="string")return new c(document.querySelectorAll(a));if(a instanceof
12
+ Element||a===window||a===document)return new c([a]);if(a&&a.length)return new c(a);return new c([])};window.$.fn=fn;fn.constructor=c}};
@@ -1,18 +1,10 @@
1
- var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.checkStringArgs=function(a,b,d){if(null==a)throw new TypeError("The 'this' value for String.prototype."+d+" must not be null or undefined");if(b instanceof RegExp)throw new TypeError("First argument to String.prototype."+d+" must not be a regular expression");return a+""};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;
2
- $jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,d){a!=Array.prototype&&a!=Object.prototype&&(a[b]=d.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);
3
- $jscomp.polyfill=function(a,b,d,f){if(b){d=$jscomp.global;a=a.split(".");for(f=0;f<a.length-1;f++){var g=a[f];g in d||(d[g]={});d=d[g]}a=a[a.length-1];f=d[a];b=b(f);b!=f&&null!=b&&$jscomp.defineProperty(d,a,{configurable:!0,writable:!0,value:b})}};
4
- $jscomp.polyfill("String.prototype.startsWith",function(a){return a?a:function(a,d){var b=$jscomp.checkStringArgs(this,a,"startsWith");a+="";var g=b.length,e=a.length;d=Math.max(0,Math.min(d|0,b.length));for(var h=0;h<e&&d<g;)if(b[d++]!=a[h++])return!1;return h>=e}},"es6","es3");$jscomp.owns=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};
5
- $jscomp.polyfill("Object.assign",function(a){return a?a:function(a,d){for(var b=1;b<arguments.length;b++){var g=arguments[b];if(g)for(var e in g)$jscomp.owns(g,e)&&(a[e]=g[e])}return a}},"es6","es3");$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.Symbol=function(){var a=0;return function(b){return $jscomp.SYMBOL_PREFIX+(b||"")+a++}}();
6
- $jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.iterator;a||(a=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&$jscomp.defineProperty(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(a){var b=0;return $jscomp.iteratorPrototype(function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}})};
7
- $jscomp.iteratorPrototype=function(a){$jscomp.initSymbolIterator();a={next:a};a[$jscomp.global.Symbol.iterator]=function(){return this};return a};$jscomp.polyfill("Array.from",function(a){return a?a:function(a,d,f){$jscomp.initSymbolIterator();d=null!=d?d:function(a){return a};var b=[],e=a[Symbol.iterator];if("function"==typeof e)for(a=e.call(a);!(e=a.next()).done;)b.push(d.call(f,e.value));else{e=a.length;for(var h=0;h<e;h++)b.push(d.call(f,a[h]))}return b}},"es6","es3");
8
- if(!window.$){var c=function(a){this.length=a.length;for(var b=0;b<a.length;b++)this[b]=a[b]};if(!window.jQuery){var fn={each:function(a){for(var b=0;b<this.length;b++)a.call(this[b],b,this[b]);return this},html:function(a){return void 0===a?this[0]&&this[0].innerHTML:this.each(function(){this.innerHTML=a})},text:function(a){return void 0===a?this[0]&&this[0].textContent:this.each(function(){this.textContent=a})},val:function(a){if(this[0]){var b=this[0];if(void 0===a)return b.value;void 0!==b.value&&
9
- this.each(function(){this.value=a});return this}},append:function(a){return this.each(function(){var b=this;a instanceof c?a.each(function(){b.appendChild(this)}):a instanceof Element?b.appendChild(a):"string"===typeof a&&b.insertAdjacentHTML("beforeend",a)})},prepend:function(a){return this.each(function(){var b=this;a instanceof c?a.each(function(){b.insertBefore(this,b.firstChild)}):a instanceof Element?b.insertBefore(a,b.firstChild):"string"===typeof a&&b.insertAdjacentHTML("afterbegin",a)})},
10
- appendTo:function(a){var b=this;if(a instanceof c)a.each(function(){for(var a=0;a<b.length;a++)this.appendChild(b[a])});else if(a instanceof Element)for(var d=0;d<b.length;d++)a.appendChild(b[d]);else"string"===typeof a&&$(a).append(this);return this},prependTo:function(a){var b=this;if(a instanceof c)a.each(function(){for(var a=0;a<b.length;a++)this.insertBefore(b[a],this.firstChild)});else if(a instanceof Element)for(var d=0;d<b.length;d++)a.insertBefore(b[d],a.firstChild);else"string"===typeof a&&
11
- $(a).prepend(this);return this},parents:function(a){var b=[];this.each(function(){for(var a=this.parentElement;a;a=a.parentElement)0>b.indexOf(a)&&b.push(a)});b=new c(b);return a?b.filter(a):b},parent:function(a){var b=[];this.each(function(){var a=this.parentElement;a&&0>b.indexOf(a)&&b.push(a)});b=new c(b);return a?b.filter(a):b},children:function(a){var b=[];this.each(function(){for(var a=0;a<this.children.length;a++)b.push(this.children[a])});b=new c(b);return a?b.filter(a):b},filter:function(a){var b=
12
- [];this.each(function(){this.matches(a)&&b.push(this)});return new c(b)},eq:function(a){return new c([this[a]])},addClass:function(a){return this.each(function(){this.classList.add(a)})},removeClass:function(a){return this.each(function(){this.classList.remove(a)})},hasClass:function(a){return this[0]?this[0].classList.contains(a):!1},attr:function(a,b){if("object"===typeof a&&a){for(var d in a)this.each(function(){this.setAttribute(d,a[d])});return this}return void 0===b?this[0]&&this[0].getAttribute(a):
13
- this.each(function(){this.setAttribute(a,b)})},css:function(a,b){if("object"===typeof a&&a){for(var d in a)this.each(function(){this.style[d]=a[d]});return this}return void 0===b?this[0]&&getComputedStyle(this[0])[a]:this.each(function(){this.style[a]=b})},scrollTop:function(a){return this[0]?void 0===a?this[0].scrollTop:this.each(function(){this.scrollTop=a}):0},on:function(a,b){return this.each(function(){this.addEventListener(a,b)})},off:function(a,b){return this.each(function(){this.removeEventListener(a,
14
- b)})},trigger:function(a){return this.each(function(){this.dispatchEvent(new Event(a))})},hide:function(){return this.each(function(){this.style.display="none"})},show:function(){return this.each(function(){this.style.display="block"})},toggle:function(a){return this.each(function(){this.style.display=void 0===a?"none"===this.style.display?"":"none":a?"":"none"})},empty:function(){return this.each(function(){this.innerHTML=""})},remove:function(){return this.each(function(){this.remove()})},find:function(a){return new c(this[0]?
15
- this[0].querySelectorAll(a):[])},closest:function(a){return new c(this[0]?[this[0].closest(a)]:[])},height:function(){return this[0]?this[0].offsetHeight:0},width:function(){return this[0]?this[0].offsetWidth:0},outerHeight:function(){if(!this[0])return 0;var a=getComputedStyle(this[0]);return this[0].offsetHeight+parseFloat(a.marginTop||0)+parseFloat(a.marginBottom||0)},outerWidth:function(){if(!this[0])return 0;var a=getComputedStyle(this[0]);return this[0].offsetWidth+parseFloat(a.marginLeft||
16
- 0)+parseFloat(a.marginRight||0)},data:function(a,b){if(this[0]){this[0].__data||(this[0].__data={});if(void 0===b)return this[0].__data[a];this.each(function(){this.__data[a]=b});return this}},is:function(a){return this[0]?":visible"===a?null!==this[0].offsetParent:this[0].matches(a):!1},ready:function(a){if(this[0]===document||this[0]===window)"complete"===document.readyState||"interactive"===document.readyState?setTimeout(a,0):document.addEventListener("DOMContentLoaded",a);return this}};["click",
17
- "focus","blur","change","submit"].forEach(function(a){fn[a]=function(b){return b?this.on(a,b):this.trigger(a)}});c.prototype=fn;window.$=window.jQuery=function(a){if("function"===typeof a)return $(document).ready(a);if("string"===typeof a&&a.trim().startsWith("<")){a=a.trim();var b=a.match(/^<([a-z0-9-]+)/i);if(b){b=b[1];a=a.match(/<[^>]+>/);var d={};(a?a[0]:"").replace(/([a-zA-Z_:][-a-zA-Z0-9_:.]*)="([^"]*)"/g,function(a,b,e){d[b]=e});return new c([Q.element?Q.element(b,d):Object.assign(document.createElement(b),
18
- d)])}b=document.createElement("div");b.innerHTML=a;return new c(Array.from(b.children))}return"string"===typeof a?new c(document.querySelectorAll(a)):a instanceof Element||a===window||a===document?new c([a]):a&&a.length?new c(a):new c([])};window.$.fn=fn;fn.constructor=c}};
1
+ if(!window.$){var c=function(a){this.length=a.length;for(var b=0;b<a.length;b++)this[b]=a[b]};if(!window.jQuery){var fn={each:function(a){for(var b=0;b<this.length;b++)a.call(this[b],b,this[b]);return this},html:function(a){if(a===undefined)return this[0]&&this[0].innerHTML;return this.each(function(){this.innerHTML=a})},append:function(a){return this.each(function(){var b=this;if(a instanceof c)a.each(function(){b.appendChild(this)});else if(a instanceof Element)b.appendChild(a);else if(typeof a===
2
+ "string")b.insertAdjacentHTML("beforeend",a)})},prepend:function(a){return this.each(function(){var b=this;if(a instanceof c)a.each(function(){b.insertBefore(this,b.firstChild)});else if(a instanceof Element)b.insertBefore(a,b.firstChild);else if(typeof a==="string")b.insertAdjacentHTML("afterbegin",a)})},appendTo:function(a){var t=this;if(a instanceof c)a.each(function(){for(var i=0;i<t.length;i++)this.appendChild(t[i])});else if(a instanceof Element)for(var i=0;i<t.length;i++)a.appendChild(t[i]);
3
+ else if(typeof a==="string")$(a).append(this);return this},prependTo:function(a){var t=this;if(a instanceof c)a.each(function(){for(var i=0;i<t.length;i++)this.insertBefore(t[i],this.firstChild)});else if(a instanceof Element)for(var i=0;i<t.length;i++)a.insertBefore(t[i],a.firstChild);else if(typeof a==="string")$(a).prepend(this);return this},parents:function(s){var p=[];this.each(function(){for(var x=this.parentElement;x;x=x.parentElement)if(p.indexOf(x)<0)p.push(x)});p=new c(p);return s?p.filter(s):
4
+ p},parent:function(s){var p=[];this.each(function(){var x=this.parentElement;if(x&&p.indexOf(x)<0)p.push(x)});p=new c(p);return s?p.filter(s):p},children:function(s){var ch=[];this.each(function(){for(var i=0;i<this.children.length;i++)ch.push(this.children[i])});ch=new c(ch);return s?ch.filter(s):ch},addClass:function(a){return this.each(function(){this.classList.add(a)})},removeClass:function(a){return this.each(function(){this.classList.remove(a)})},hasClass:function(a){return this[0]?this[0].classList.contains(a):
5
+ false},attr:function(a,b){if(b===undefined)return this[0]&&this[0].getAttribute(a);return this.each(function(){this.setAttribute(a,b)})},css:function(a,b){if(typeof a==="object"&&a){for(var k in a)this.each(function(){this.style[k]=a[k]});return this}if(b===undefined)return this[0]&&getComputedStyle(this[0])[a];return this.each(function(){this.style[a]=b})},scrollTop:function(v){if(!this[0])return 0;if(v===undefined)return this[0].scrollTop;return this.each(function(){this.scrollTop=v})},on:function(a,
6
+ b){return this.each(function(){this.addEventListener(a,b)})},off:function(a,b){return this.each(function(){this.removeEventListener(a,b)})},trigger:function(a){return this.each(function(){this.dispatchEvent(new Event(a))})},hide:function(){return this.each(function(){this.style.display="none"})},show:function(){return this.each(function(){this.style.display="block"})},empty:function(){return this.each(function(){this.innerHTML=""})},remove:function(){return this.each(function(){this.remove()})},find:function(a){return new c(this[0]?
7
+ this[0].querySelectorAll(a):[])},closest:function(a){return new c(this[0]?[this[0].closest(a)]:[])},height:function(){return this[0]?this[0].offsetHeight:0},width:function(){return this[0]?this[0].offsetWidth:0},outerHeight:function(){if(!this[0])return 0;var s=getComputedStyle(this[0]);return this[0].offsetHeight+parseFloat(s.marginTop||0)+parseFloat(s.marginBottom||0)},outerWidth:function(){if(!this[0])return 0;var s=getComputedStyle(this[0]);return this[0].offsetWidth+parseFloat(s.marginLeft||
8
+ 0)+parseFloat(s.marginRight||0)},data:function(a,b){if(!this[0])return;if(!this[0].__data)this[0].__data={};if(b===undefined)return this[0].__data[a];this.each(function(){this.__data[a]=b});return this},is:function(a){if(!this[0])return!1;if(a===":visible")return this[0].offsetParent!==null;return this[0].matches(a)},ready:function(fn){if(this[0]===document||this[0]===window)if(document.readyState==="complete"||document.readyState==="interactive")setTimeout(fn,0);else document.addEventListener("DOMContentLoaded",
9
+ fn);return this}};["click","focus","blur","change","submit"].forEach(function(ev){fn[ev]=function(handler){if(handler)return this.on(ev,handler);return this.trigger(ev)}});c.prototype=fn;window.$=window.jQuery=function(a){if(typeof a==="function")return $(document).ready(a);if(typeof a==="string"&&a.trim().startsWith("<")){a=a.trim();var tagMatch=a.match(/^<([a-z0-9-]+)/i);if(tagMatch){var tag=tagMatch[1];var attrMatch=a.match(/<[^>]+>/);var attrs={};(attrMatch?attrMatch[0]:"").replace(/([a-zA-Z_:][-a-zA-Z0-9_:.]*)="([^"]*)"/g,
10
+ function(_,key,val){attrs[key]=val});return new c([Q.element?Q.element(tag,attrs):Object.assign(document.createElement(tag),attrs)])}var div=document.createElement("div");div.innerHTML=a;return new c(Array.from(div.children))}if(typeof a==="string")return new c(document.querySelectorAll(a));if(a instanceof Element||a===window||a===document)return new c([a]);if(a&&a.length)return new c(a);return new c([])};window.$.fn=fn;fn.constructor=c}};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qbix/q.js",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "Q.js, the Qbix JavaScript framework",
5
5
  "main": "dist/Q.min.js",
6
6
  "files": [