mixpanel-browser 2.52.0 → 2.53.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ **2.53.0** (21 Jun 2024)
2
+ - Switch to new session-recording network payload format, utilizing client-side compression when available
3
+ - Session-recording methods are now available through Google Tag Manager wrapper
4
+
5
+ **2.52.0** (7 Jun 2024)
6
+ - Reverted UTM param persistence change from 2.51.0: UTM parameters are again persisted by default
7
+
8
+ **2.51.0** (30 May 2024)
9
+ - UTM parameter properties are no longer persisted by default
10
+ - Existing superproperties persisted in localStorage are now copied back to cookie storage if the library is initialized with cookie persistence (support migrations from localStorage->cookie)
11
+ - Added session-recording options `record_block_class`, `record_block_selector`, and `record_mask_text_class`
12
+ - Added method `mixpanel.get_session_recording_properties()` for interop with other client-side SDKs
13
+
14
+ **2.50.0** (26 Apr 2024)
15
+ - Initial support for session recording
16
+
1
17
  **2.49.0** (5 Feb 2024)
2
18
  - SPA support in pageview-tracking
3
19
  - Support for configurable UTM parameter persistence
@@ -141,6 +141,8 @@ var MIXPANEL_LIB_URL = '//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js';
141
141
  'reset',
142
142
  'set_config',
143
143
  'set_group',
144
+ 'start_session_recording',
145
+ 'stop_session_recording',
144
146
  'time_event',
145
147
  'track',
146
148
  'track_forms',
@@ -1,5 +1,5 @@
1
1
  (function(d,c){if(!c.__SV){var e,g,b,a;window.mixpanel=c;c._i=[];c.init=function(i,g,d){function e(b,a){var d=a.split(".");2==d.length&&(b=b[d[0]],a=d[1]);b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,0)))}}var f=c;"undefined"!==typeof d?f=c[d]=[]:d="mixpanel";f.people=f.people||[];f.toString=function(b){var a="mixpanel";"mixpanel"!==d&&(a+="."+d);b||(a+=" (stub)");return a};f.people.toString=function(){return f.toString(1)+".people (stub)"};b="disable time_event track track_pageview track_links track_forms track_with_groups add_group set_group remove_group register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking start_batch_senders start_session_recording stop_session_recording people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user people.remove".split(" ");
2
2
  for(a=0;a<b.length;a++)e(f,b[a]);var h="set set_once union unset remove delete".split(" ");f.get_group=function(){function a(c){b[c]=function(){var a=[c].concat(Array.prototype.slice.call(arguments,0));f.push([d,a])}}for(var b={},d=["get_group"].concat(Array.prototype.slice.call(arguments,0)),c=0;c<h.length;c++)a(h[c]);return b};c._i.push([i,g,d])};c.__SV=1.2;e=d.createElement("script");e.type="text/javascript";e.async=!0;e.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:
3
3
  "file:"===d.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";g=d.getElementsByTagName("script")[0];g.parentNode.insertBefore(e,g)}})(document,window.mixpanel||[]);
4
- (function(d,c){if(d.mixpanel&&"function"===typeof d.mixpanel.init){var e="add_group,alias,clear_opt_in_out_tracking,disable,identify,opt_in_tracking,opt_out_tracking,register,register_once,remove_group,reset,set_config,set_group,time_event,track,track_forms,track_links,track_pageview,track_with_groups,unregister,people.append,people.clear_charges,people.delete_user,people.increment,people.remove,people.set,people.set_once,people.track_charge,people.union,people.unset,group.remove,group.set,group.set_once,group.union,group.unset".split(",");d[c]=
4
+ (function(d,c){if(d.mixpanel&&"function"===typeof d.mixpanel.init){var e="add_group,alias,clear_opt_in_out_tracking,disable,identify,opt_in_tracking,opt_out_tracking,register,register_once,remove_group,reset,set_config,set_group,start_session_recording,stop_session_recording,time_event,track,track_forms,track_links,track_pageview,track_with_groups,unregister,people.append,people.clear_charges,people.delete_user,people.increment,people.remove,people.set,people.set_once,people.track_charge,people.union,people.unset,group.remove,group.set,group.set_once,group.union,group.unset".split(",");d[c]=
5
5
  d[c]||function(){var d=[].slice.call(arguments,0),b=d.shift(),a=null,c=b.match(/^([^.]+)\.(.+)$/);c&&3===c.length&&!/people|group/.test(c[1])&&(a=c[1],b=c[2]);if((a=a?window.mixpanel[a]:window.mixpanel)&&-1!==e.indexOf(b))return/^people\./.test(b)?(b=b.split(".").pop(),a.people[b].apply(a.people,d),b=void 0):/^group\./.test(b)?(b=b.split(".").pop(),c=d.shift(),Array.isArray(c)&&2===c.length&&(a=a.get_group.apply(a,c),a[b].apply(a,d)),b=void 0):b=a.push.apply(a,[[b].concat(d)]),b}}})(window,"_mixpanel");
@@ -4479,7 +4479,7 @@
4479
4479
 
4480
4480
  var Config = {
4481
4481
  DEBUG: false,
4482
- LIB_VERSION: '2.52.0'
4482
+ LIB_VERSION: '2.53.0'
4483
4483
  };
4484
4484
 
4485
4485
  /* eslint camelcase: "off", eqeqeq: "off" */
@@ -6345,6 +6345,7 @@
6345
6345
  }
6346
6346
 
6347
6347
  var logger = console_with_prefix('recorder');
6348
+ var CompressionStream = window['CompressionStream'];
6348
6349
 
6349
6350
  var MixpanelRecorder = function(mixpanelInstance) {
6350
6351
  this._mixpanel = mixpanelInstance;
@@ -6454,6 +6455,17 @@
6454
6455
  }
6455
6456
  };
6456
6457
 
6458
+ MixpanelRecorder.prototype._sendRequest = function(reqParams, reqBody) {
6459
+ window['fetch'](this.get_config('api_host') + '/' + this.get_config('api_routes')['record'] + '?' + new URLSearchParams(reqParams), {
6460
+ 'method': 'POST',
6461
+ 'headers': {
6462
+ 'Authorization': 'Basic ' + btoa(this.get_config('token') + ':'),
6463
+ 'Content-Type': 'application/octet-stream'
6464
+ },
6465
+ 'body': reqBody
6466
+ });
6467
+ };
6468
+
6457
6469
  /**
6458
6470
  * @api private
6459
6471
  * Private method, flushes the current batch of events to the server.
@@ -6461,36 +6473,41 @@
6461
6473
  MixpanelRecorder.prototype._flushEvents = addOptOutCheckMixpanelLib(function() {
6462
6474
  var numEvents = this.recEvents.length;
6463
6475
  if (numEvents > 0) {
6464
- var reqBody = {
6476
+ var reqParams = {
6465
6477
  'distinct_id': String(this._mixpanel.get_distinct_id()),
6466
- 'events': this.recEvents,
6467
6478
  'seq': this.seqNo++,
6468
6479
  'batch_start_time': this.batchStartTime / 1000,
6469
6480
  'replay_id': this.replayId,
6470
6481
  'replay_length_ms': this.replayLengthMs,
6471
6482
  'replay_start_time': this.replayStartTime / 1000
6472
6483
  };
6484
+ var eventsJson = _.JSONEncode(this.recEvents);
6473
6485
 
6474
6486
  // send ID management props if they exist
6475
6487
  var deviceId = this._mixpanel.get_property('$device_id');
6476
6488
  if (deviceId) {
6477
- reqBody['$device_id'] = deviceId;
6489
+ reqParams['$device_id'] = deviceId;
6478
6490
  }
6479
6491
  var userId = this._mixpanel.get_property('$user_id');
6480
6492
  if (userId) {
6481
- reqBody['$user_id'] = userId;
6493
+ reqParams['$user_id'] = userId;
6482
6494
  }
6483
6495
 
6484
- window['fetch'](this.get_config('api_host') + '/' + this.get_config('api_routes')['record'], {
6485
- 'method': 'POST',
6486
- 'headers': {
6487
- 'Authorization': 'Basic ' + btoa(this.get_config('token') + ':'),
6488
- 'Content-Type': 'application/json'
6489
- },
6490
- 'body': _.JSONEncode(reqBody)
6491
- });
6492
6496
  this.recEvents = this.recEvents.slice(numEvents);
6493
6497
  this.batchStartTime = new Date().getTime();
6498
+ if (CompressionStream) {
6499
+ var jsonStream = new Blob([eventsJson], {type: 'application/json'}).stream();
6500
+ var gzipStream = jsonStream.pipeThrough(new CompressionStream('gzip'));
6501
+ new Response(gzipStream)
6502
+ .blob()
6503
+ .then(_.bind(function(compressedBlob) {
6504
+ reqParams['format'] = 'gzip';
6505
+ this._sendRequest(reqParams, compressedBlob);
6506
+ }, this));
6507
+ } else {
6508
+ reqParams['format'] = 'body';
6509
+ this._sendRequest(reqParams, eventsJson);
6510
+ }
6494
6511
  }
6495
6512
  });
6496
6513
 
@@ -1,6 +1,6 @@
1
- (function(){"use strict";var A;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(A||(A={}));function sr(e){return e.nodeType===e.ELEMENT_NODE}function ge(e){const t=e?.host;return t?.shadowRoot===e}function ye(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function ar(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),e}function lr(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function _e(e){try{const t=e.rules||e.cssRules;return t?ar(Array.from(t,ft).join("")):null}catch{return null}}function ft(e){let t;if(ur(e))try{t=_e(e.styleSheet)||lr(e)}catch{}else if(dr(e)&&e.selectorText.includes(":"))return cr(e.cssText);return t||e.cssText}function cr(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function ur(e){return"styleSheet"in e}function dr(e){return"selectorText"in e}class ht{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var r;if(!t)return-1;const n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){const n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){const n=this.getNode(t);if(n){const i=this.nodeMetaMap.get(n);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function fr(){return new ht}function Ve({element:e,maskInputOptions:t,tagName:r,type:n,value:i,maskInputFn:o}){let a=i||"";const l=n&&te(n);return(t[r.toLowerCase()]||l&&t[l])&&(o?a=o(a,e):a="*".repeat(a.length)),a}function te(e){return e.toLowerCase()}const pt="__rrweb_original__";function hr(e){const t=e.getContext("2d");if(!t)return!0;const r=50;for(let n=0;n<e.width;n+=r)for(let i=0;i<e.height;i+=r){const o=t.getImageData,a=pt in o?o[pt]:o;if(new Uint32Array(a.call(t,n,i,Math.min(r,e.width-n),Math.min(r,e.height-i)).data.buffer).some(s=>s!==0))return!1}return!0}function qe(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?te(t):null}function mt(e,t){var r;let n;try{n=new URL(e,t??window.location.href)}catch{return null}const i=/\.([0-9a-z]+)(?:$)/i,o=n.pathname.match(i);return(r=o?.[1])!==null&&r!==void 0?r:null}let pr=1;const mr=new RegExp("[^a-z0-9-_:]"),Se=-2;function gt(){return pr++}function gr(e){if(e instanceof HTMLFormElement)return"form";const t=te(e.tagName);return mr.test(t)?"div":t}function yr(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let ce,yt;const Sr=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,vr=/^(?:[a-z+]+:)?\/\//i,br=/^www\..*/i,wr=/^(data:)([^,]*),(.*)/i;function xe(e,t){return(e||"").replace(Sr,(r,n,i,o,a,l)=>{const s=i||a||l,c=n||o||"";if(!s)return r;if(vr.test(s)||br.test(s))return`url(${c}${s}${c})`;if(wr.test(s))return`url(${c}${s}${c})`;if(s[0]==="/")return`url(${c}${yr(t)+s}${c})`;const u=t.split("/"),p=s.split("/");u.pop();for(const m of p)m!=="."&&(m===".."?u.pop():u.push(m));return`url(${c}${u.join("/")}${c})`})}const Mr=/^[^ \t\n\r\u000c]+/,Ir=/^[, \t\n\r\u000c]+/;function Cr(e,t){if(t.trim()==="")return t;let r=0;function n(o){let a;const l=o.exec(t.substring(r));return l?(a=l[0],r+=a.length,a):""}const i=[];for(;n(Ir),!(r>=t.length);){let o=n(Mr);if(o.slice(-1)===",")o=ue(e,o.substring(0,o.length-1)),i.push(o);else{let a="";o=ue(e,o);let l=!1;for(;;){const s=t.charAt(r);if(s===""){i.push((o+a).trim());break}else if(l)s===")"&&(l=!1);else if(s===","){r+=1,i.push((o+a).trim());break}else s==="("&&(l=!0);a+=s,r+=1}}}return i.join(", ")}function ue(e,t){if(!t||t.trim()==="")return t;const r=e.createElement("a");return r.href=t,r.href}function Or(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Je(){const e=document.createElement("a");return e.href="",e.href}function St(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&(t==="table"||t==="td"||t==="th")?ue(e,n):r==="srcset"?Cr(e,n):r==="style"?xe(n,Je()):t==="object"&&r==="data"?ue(e,n):n)}function vt(e,t,r){return(e==="video"||e==="audio")&&t==="autoplay"}function _r(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const i=e.classList[n];if(t.test(i))return!0}if(r)return e.matches(r)}catch{}return!1}function Ee(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?Ee(e.parentNode,t,r):!1;for(let n=e.classList.length;n--;){const i=e.classList[n];if(t.test(i))return!0}return r?Ee(e.parentNode,t,r):!1}function bt(e,t,r,n){try{const i=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(i===null)return!1;if(typeof t=="string"){if(n){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(Ee(i,t,n))return!0;if(r){if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}}catch{}return!1}function xr(e,t,r){const n=e.contentWindow;if(!n)return;let i=!1,o;try{o=n.document.readyState}catch{return}if(o!=="complete"){const l=setTimeout(()=>{i||(t(),i=!0)},r);e.addEventListener("load",()=>{clearTimeout(l),i=!0,t()});return}const a="about:blank";if(n.location.href!==a||e.src===a||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function Er(e,t,r){let n=!1,i;try{i=e.sheet}catch{return}if(i)return;const o=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),n=!0,t()})}function kr(e,t){const{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:a,inlineStylesheet:l,maskInputOptions:s={},maskTextFn:c,maskInputFn:u,dataURLOptions:p={},inlineImages:m,recordCanvas:f,keepIframeSrcFn:g,newlyAddedElement:h=!1}=t,y=Tr(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:A.Document,childNodes:[],compatMode:e.compatMode}:{type:A.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:A.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return Nr(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:l,maskInputOptions:s,maskInputFn:u,dataURLOptions:p,inlineImages:m,recordCanvas:f,keepIframeSrcFn:g,newlyAddedElement:h,rootId:y});case e.TEXT_NODE:return Rr(e,{needsMask:a,maskTextFn:c,rootId:y});case e.CDATA_SECTION_NODE:return{type:A.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:A.Comment,textContent:e.textContent||"",rootId:y};default:return!1}}function Tr(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return r===1?void 0:r}function Rr(e,t){var r;const{needsMask:n,maskTextFn:i,rootId:o}=t,a=e.parentNode&&e.parentNode.tagName;let l=e.textContent;const s=a==="STYLE"?!0:void 0,c=a==="SCRIPT"?!0:void 0;if(s&&l){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(l=_e(e.parentNode.sheet))}catch(u){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${u}`,e)}l=xe(l,Je())}return c&&(l="SCRIPT_PLACEHOLDER"),!s&&!c&&l&&n&&(l=i?i(l,e.parentElement):l.replace(/[\S]/g,"*")),{type:A.Text,textContent:l||"",isStyle:s,rootId:o}}function Nr(e,t){const{doc:r,blockClass:n,blockSelector:i,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:l,dataURLOptions:s={},inlineImages:c,recordCanvas:u,keepIframeSrcFn:p,newlyAddedElement:m=!1,rootId:f}=t,g=_r(e,n,i),h=gr(e);let y={};const w=e.attributes.length;for(let S=0;S<w;S++){const b=e.attributes[S];vt(h,b.name,b.value)||(y[b.name]=St(r,h,te(b.name),b.value))}if(h==="link"&&o){const S=Array.from(r.styleSheets).find(M=>M.href===e.href);let b=null;S&&(b=_e(S)),b&&(delete y.rel,delete y.href,y._cssText=xe(b,S.href))}if(h==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const S=_e(e.sheet);S&&(y._cssText=xe(S,Je()))}if(h==="input"||h==="textarea"||h==="select"){const S=e.value,b=e.checked;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&S?y.value=Ve({element:e,type:qe(e),tagName:h,value:S,maskInputOptions:a,maskInputFn:l}):b&&(y.checked=b)}if(h==="option"&&(e.selected&&!a.select?y.selected=!0:delete y.selected),h==="canvas"&&u){if(e.__context==="2d")hr(e)||(y.rr_dataURL=e.toDataURL(s.type,s.quality));else if(!("__context"in e)){const S=e.toDataURL(s.type,s.quality),b=document.createElement("canvas");b.width=e.width,b.height=e.height;const M=b.toDataURL(s.type,s.quality);S!==M&&(y.rr_dataURL=S)}}if(h==="img"&&c){ce||(ce=r.createElement("canvas"),yt=ce.getContext("2d"));const S=e,b=S.crossOrigin;S.crossOrigin="anonymous";const M=()=>{S.removeEventListener("load",M);try{ce.width=S.naturalWidth,ce.height=S.naturalHeight,yt.drawImage(S,0,0),y.rr_dataURL=ce.toDataURL(s.type,s.quality)}catch(F){console.warn(`Cannot inline img src=${S.currentSrc}! Error: ${F}`)}b?y.crossOrigin=b:S.removeAttribute("crossorigin")};S.complete&&S.naturalWidth!==0?M():S.addEventListener("load",M)}if(h==="audio"||h==="video"){const S=y;S.rr_mediaState=e.paused?"paused":"played",S.rr_mediaCurrentTime=e.currentTime,S.rr_mediaPlaybackRate=e.playbackRate,S.rr_mediaMuted=e.muted,S.rr_mediaLoop=e.loop,S.rr_mediaVolume=e.volume}if(m||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),g){const{width:S,height:b}=e.getBoundingClientRect();y={class:y.class,rr_width:`${S}px`,rr_height:`${b}px`}}h==="iframe"&&!p(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src);let v;try{customElements.get(h)&&(v=!0)}catch{}return{type:A.Element,tagName:h,attributes:y,childNodes:[],isSVG:Or(e)||void 0,needBlock:g,rootId:f,isCustom:v}}function E(e){return e==null?"":e.toLowerCase()}function Dr(e,t){if(t.comment&&e.type===A.Comment)return!0;if(e.type===A.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&mt(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(E(e.attributes.name).match(/^msapplication-tile(image|color)$/)||E(e.attributes.name)==="application-name"||E(e.attributes.rel)==="icon"||E(e.attributes.rel)==="apple-touch-icon"||E(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&E(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(E(e.attributes.property).match(/^(og|twitter|fb):/)||E(e.attributes.name).match(/^(og|twitter):/)||E(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(E(e.attributes.name)==="robots"||E(e.attributes.name)==="googlebot"||E(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(E(e.attributes.name)==="author"||E(e.attributes.name)==="generator"||E(e.attributes.name)==="framework"||E(e.attributes.name)==="publisher"||E(e.attributes.name)==="progid"||E(e.attributes.property).match(/^article:/)||E(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(E(e.attributes.name)==="google-site-verification"||E(e.attributes.name)==="yandex-verification"||E(e.attributes.name)==="csrf-token"||E(e.attributes.name)==="p:domain_verify"||E(e.attributes.name)==="verify-v1"||E(e.attributes.name)==="verification"||E(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function de(e,t){const{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:l,skipChild:s=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:p,maskInputFn:m,slimDOMOptions:f,dataURLOptions:g={},inlineImages:h=!1,recordCanvas:y=!1,onSerialize:w,onIframeLoad:v,iframeLoadTimeout:S=5e3,onStylesheetLoad:b,stylesheetLoadTimeout:M=5e3,keepIframeSrcFn:F=()=>!1,newlyAddedElement:P=!1}=t;let{needsMask:k}=t,{preserveWhiteSpace:T=!0}=t;!k&&e.childNodes&&(k=bt(e,a,l,k===void 0));const j=kr(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:k,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:m,dataURLOptions:g,inlineImages:h,recordCanvas:y,keepIframeSrcFn:F,newlyAddedElement:P});if(!j)return console.warn(e,"not serialized"),null;let V;n.hasNode(e)?V=n.getId(e):Dr(j,f)||!T&&j.type===A.Text&&!j.isStyle&&!j.textContent.replace(/^\s+|\s+$/gm,"").length?V=Se:V=gt();const x=Object.assign(j,{id:V});if(n.add(e,x),V===Se)return null;w&&w(e);let oe=!s;if(x.type===A.Element){oe=oe&&!x.needBlock,delete x.needBlock;const H=e.shadowRoot;H&&ye(H)&&(x.isShadowHost=!0)}if((x.type===A.Document||x.type===A.Element)&&oe){f.headWhitespace&&x.type===A.Element&&x.tagName==="head"&&(T=!1);const H={doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:k,maskTextClass:a,maskTextSelector:l,skipChild:s,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:m,slimDOMOptions:f,dataURLOptions:g,inlineImages:h,recordCanvas:y,preserveWhiteSpace:T,onSerialize:w,onIframeLoad:v,iframeLoadTimeout:S,onStylesheetLoad:b,stylesheetLoadTimeout:M,keepIframeSrcFn:F};if(!(x.type===A.Element&&x.tagName==="textarea"&&x.attributes.value!==void 0))for(const ee of Array.from(e.childNodes)){const K=de(ee,H);K&&x.childNodes.push(K)}if(sr(e)&&e.shadowRoot)for(const ee of Array.from(e.shadowRoot.childNodes)){const K=de(ee,H);K&&(ye(e.shadowRoot)&&(K.isShadow=!0),x.childNodes.push(K))}}return e.parentNode&&ge(e.parentNode)&&ye(e.parentNode)&&(x.isShadow=!0),x.type===A.Element&&x.tagName==="iframe"&&xr(e,()=>{const H=e.contentDocument;if(H&&v){const ee=de(H,{doc:H,mirror:n,blockClass:i,blockSelector:o,needsMask:k,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:m,slimDOMOptions:f,dataURLOptions:g,inlineImages:h,recordCanvas:y,preserveWhiteSpace:T,onSerialize:w,onIframeLoad:v,iframeLoadTimeout:S,onStylesheetLoad:b,stylesheetLoadTimeout:M,keepIframeSrcFn:F});ee&&v(e,ee)}},S),x.type===A.Element&&x.tagName==="link"&&typeof x.attributes.rel=="string"&&(x.attributes.rel==="stylesheet"||x.attributes.rel==="preload"&&typeof x.attributes.href=="string"&&mt(x.attributes.href)==="css")&&Er(e,()=>{if(b){const H=de(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:k,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:m,slimDOMOptions:f,dataURLOptions:g,inlineImages:h,recordCanvas:y,preserveWhiteSpace:T,onSerialize:w,onIframeLoad:v,iframeLoadTimeout:S,onStylesheetLoad:b,stylesheetLoadTimeout:M,keepIframeSrcFn:F});H&&b(e,H)}},M),x}function Ar(e,t){const{mirror:r=new ht,blockClass:n="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:a=null,inlineStylesheet:l=!0,inlineImages:s=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:p,maskInputFn:m,slimDOM:f=!1,dataURLOptions:g,preserveWhiteSpace:h,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:v,onStylesheetLoad:S,stylesheetLoadTimeout:b,keepIframeSrcFn:M=()=>!1}=t||{};return de(e,{doc:e,mirror:r,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:u===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:u===!1?{password:!0}:u,maskTextFn:p,maskInputFn:m,slimDOMOptions:f===!0||f==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:f==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:f===!1?{}:f,dataURLOptions:g,inlineImages:s,recordCanvas:c,preserveWhiteSpace:h,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:v,onStylesheetLoad:S,stylesheetLoadTimeout:b,keepIframeSrcFn:M,newlyAddedElement:!1})}function W(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const fe=`Please stop import mirror directly. Instead of that,\r
1
+ (function(){"use strict";var A;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(A||(A={}));function ar(e){return e.nodeType===e.ELEMENT_NODE}function ge(e){const t=e?.host;return t?.shadowRoot===e}function ye(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function lr(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),e}function cr(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function _e(e){try{const t=e.rules||e.cssRules;return t?lr(Array.from(t,ft).join("")):null}catch{return null}}function ft(e){let t;if(dr(e))try{t=_e(e.styleSheet)||cr(e)}catch{}else if(fr(e)&&e.selectorText.includes(":"))return ur(e.cssText);return t||e.cssText}function ur(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function dr(e){return"styleSheet"in e}function fr(e){return"selectorText"in e}class ht{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var r;if(!t)return-1;const n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){const n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){const n=this.getNode(t);if(n){const i=this.nodeMetaMap.get(n);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function hr(){return new ht}function Ve({element:e,maskInputOptions:t,tagName:r,type:n,value:i,maskInputFn:o}){let a=i||"";const l=n&&te(n);return(t[r.toLowerCase()]||l&&t[l])&&(o?a=o(a,e):a="*".repeat(a.length)),a}function te(e){return e.toLowerCase()}const pt="__rrweb_original__";function pr(e){const t=e.getContext("2d");if(!t)return!0;const r=50;for(let n=0;n<e.width;n+=r)for(let i=0;i<e.height;i+=r){const o=t.getImageData,a=pt in o?o[pt]:o;if(new Uint32Array(a.call(t,n,i,Math.min(r,e.width-n),Math.min(r,e.height-i)).data.buffer).some(s=>s!==0))return!1}return!0}function qe(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?te(t):null}function mt(e,t){var r;let n;try{n=new URL(e,t??window.location.href)}catch{return null}const i=/\.([0-9a-z]+)(?:$)/i,o=n.pathname.match(i);return(r=o?.[1])!==null&&r!==void 0?r:null}let mr=1;const gr=new RegExp("[^a-z0-9-_:]"),Se=-2;function gt(){return mr++}function yr(e){if(e instanceof HTMLFormElement)return"form";const t=te(e.tagName);return gr.test(t)?"div":t}function Sr(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let ce,yt;const vr=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,br=/^(?:[a-z+]+:)?\/\//i,wr=/^www\..*/i,Mr=/^(data:)([^,]*),(.*)/i;function xe(e,t){return(e||"").replace(vr,(r,n,i,o,a,l)=>{const s=i||a||l,c=n||o||"";if(!s)return r;if(br.test(s)||wr.test(s))return`url(${c}${s}${c})`;if(Mr.test(s))return`url(${c}${s}${c})`;if(s[0]==="/")return`url(${c}${Sr(t)+s}${c})`;const u=t.split("/"),p=s.split("/");u.pop();for(const m of p)m!=="."&&(m===".."?u.pop():u.push(m));return`url(${c}${u.join("/")}${c})`})}const Ir=/^[^ \t\n\r\u000c]+/,Cr=/^[, \t\n\r\u000c]+/;function Or(e,t){if(t.trim()==="")return t;let r=0;function n(o){let a;const l=o.exec(t.substring(r));return l?(a=l[0],r+=a.length,a):""}const i=[];for(;n(Cr),!(r>=t.length);){let o=n(Ir);if(o.slice(-1)===",")o=ue(e,o.substring(0,o.length-1)),i.push(o);else{let a="";o=ue(e,o);let l=!1;for(;;){const s=t.charAt(r);if(s===""){i.push((o+a).trim());break}else if(l)s===")"&&(l=!1);else if(s===","){r+=1,i.push((o+a).trim());break}else s==="("&&(l=!0);a+=s,r+=1}}}return i.join(", ")}function ue(e,t){if(!t||t.trim()==="")return t;const r=e.createElement("a");return r.href=t,r.href}function _r(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Je(){const e=document.createElement("a");return e.href="",e.href}function St(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&(t==="table"||t==="td"||t==="th")?ue(e,n):r==="srcset"?Or(e,n):r==="style"?xe(n,Je()):t==="object"&&r==="data"?ue(e,n):n)}function vt(e,t,r){return(e==="video"||e==="audio")&&t==="autoplay"}function xr(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const i=e.classList[n];if(t.test(i))return!0}if(r)return e.matches(r)}catch{}return!1}function Ee(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?Ee(e.parentNode,t,r):!1;for(let n=e.classList.length;n--;){const i=e.classList[n];if(t.test(i))return!0}return r?Ee(e.parentNode,t,r):!1}function bt(e,t,r,n){try{const i=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(i===null)return!1;if(typeof t=="string"){if(n){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(Ee(i,t,n))return!0;if(r){if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}}catch{}return!1}function Er(e,t,r){const n=e.contentWindow;if(!n)return;let i=!1,o;try{o=n.document.readyState}catch{return}if(o!=="complete"){const l=setTimeout(()=>{i||(t(),i=!0)},r);e.addEventListener("load",()=>{clearTimeout(l),i=!0,t()});return}const a="about:blank";if(n.location.href!==a||e.src===a||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function kr(e,t,r){let n=!1,i;try{i=e.sheet}catch{return}if(i)return;const o=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),n=!0,t()})}function Tr(e,t){const{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:a,inlineStylesheet:l,maskInputOptions:s={},maskTextFn:c,maskInputFn:u,dataURLOptions:p={},inlineImages:m,recordCanvas:f,keepIframeSrcFn:g,newlyAddedElement:h=!1}=t,y=Rr(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:A.Document,childNodes:[],compatMode:e.compatMode}:{type:A.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:A.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return Dr(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:l,maskInputOptions:s,maskInputFn:u,dataURLOptions:p,inlineImages:m,recordCanvas:f,keepIframeSrcFn:g,newlyAddedElement:h,rootId:y});case e.TEXT_NODE:return Nr(e,{needsMask:a,maskTextFn:c,rootId:y});case e.CDATA_SECTION_NODE:return{type:A.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:A.Comment,textContent:e.textContent||"",rootId:y};default:return!1}}function Rr(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return r===1?void 0:r}function Nr(e,t){var r;const{needsMask:n,maskTextFn:i,rootId:o}=t,a=e.parentNode&&e.parentNode.tagName;let l=e.textContent;const s=a==="STYLE"?!0:void 0,c=a==="SCRIPT"?!0:void 0;if(s&&l){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(l=_e(e.parentNode.sheet))}catch(u){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${u}`,e)}l=xe(l,Je())}return c&&(l="SCRIPT_PLACEHOLDER"),!s&&!c&&l&&n&&(l=i?i(l,e.parentElement):l.replace(/[\S]/g,"*")),{type:A.Text,textContent:l||"",isStyle:s,rootId:o}}function Dr(e,t){const{doc:r,blockClass:n,blockSelector:i,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:l,dataURLOptions:s={},inlineImages:c,recordCanvas:u,keepIframeSrcFn:p,newlyAddedElement:m=!1,rootId:f}=t,g=xr(e,n,i),h=yr(e);let y={};const w=e.attributes.length;for(let S=0;S<w;S++){const b=e.attributes[S];vt(h,b.name,b.value)||(y[b.name]=St(r,h,te(b.name),b.value))}if(h==="link"&&o){const S=Array.from(r.styleSheets).find(M=>M.href===e.href);let b=null;S&&(b=_e(S)),b&&(delete y.rel,delete y.href,y._cssText=xe(b,S.href))}if(h==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const S=_e(e.sheet);S&&(y._cssText=xe(S,Je()))}if(h==="input"||h==="textarea"||h==="select"){const S=e.value,b=e.checked;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&S?y.value=Ve({element:e,type:qe(e),tagName:h,value:S,maskInputOptions:a,maskInputFn:l}):b&&(y.checked=b)}if(h==="option"&&(e.selected&&!a.select?y.selected=!0:delete y.selected),h==="canvas"&&u){if(e.__context==="2d")pr(e)||(y.rr_dataURL=e.toDataURL(s.type,s.quality));else if(!("__context"in e)){const S=e.toDataURL(s.type,s.quality),b=document.createElement("canvas");b.width=e.width,b.height=e.height;const M=b.toDataURL(s.type,s.quality);S!==M&&(y.rr_dataURL=S)}}if(h==="img"&&c){ce||(ce=r.createElement("canvas"),yt=ce.getContext("2d"));const S=e,b=S.crossOrigin;S.crossOrigin="anonymous";const M=()=>{S.removeEventListener("load",M);try{ce.width=S.naturalWidth,ce.height=S.naturalHeight,yt.drawImage(S,0,0),y.rr_dataURL=ce.toDataURL(s.type,s.quality)}catch(F){console.warn(`Cannot inline img src=${S.currentSrc}! Error: ${F}`)}b?y.crossOrigin=b:S.removeAttribute("crossorigin")};S.complete&&S.naturalWidth!==0?M():S.addEventListener("load",M)}if(h==="audio"||h==="video"){const S=y;S.rr_mediaState=e.paused?"paused":"played",S.rr_mediaCurrentTime=e.currentTime,S.rr_mediaPlaybackRate=e.playbackRate,S.rr_mediaMuted=e.muted,S.rr_mediaLoop=e.loop,S.rr_mediaVolume=e.volume}if(m||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),g){const{width:S,height:b}=e.getBoundingClientRect();y={class:y.class,rr_width:`${S}px`,rr_height:`${b}px`}}h==="iframe"&&!p(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src);let v;try{customElements.get(h)&&(v=!0)}catch{}return{type:A.Element,tagName:h,attributes:y,childNodes:[],isSVG:_r(e)||void 0,needBlock:g,rootId:f,isCustom:v}}function E(e){return e==null?"":e.toLowerCase()}function Ar(e,t){if(t.comment&&e.type===A.Comment)return!0;if(e.type===A.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&mt(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(E(e.attributes.name).match(/^msapplication-tile(image|color)$/)||E(e.attributes.name)==="application-name"||E(e.attributes.rel)==="icon"||E(e.attributes.rel)==="apple-touch-icon"||E(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&E(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(E(e.attributes.property).match(/^(og|twitter|fb):/)||E(e.attributes.name).match(/^(og|twitter):/)||E(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(E(e.attributes.name)==="robots"||E(e.attributes.name)==="googlebot"||E(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(E(e.attributes.name)==="author"||E(e.attributes.name)==="generator"||E(e.attributes.name)==="framework"||E(e.attributes.name)==="publisher"||E(e.attributes.name)==="progid"||E(e.attributes.property).match(/^article:/)||E(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(E(e.attributes.name)==="google-site-verification"||E(e.attributes.name)==="yandex-verification"||E(e.attributes.name)==="csrf-token"||E(e.attributes.name)==="p:domain_verify"||E(e.attributes.name)==="verify-v1"||E(e.attributes.name)==="verification"||E(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function de(e,t){const{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:l,skipChild:s=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:p,maskInputFn:m,slimDOMOptions:f,dataURLOptions:g={},inlineImages:h=!1,recordCanvas:y=!1,onSerialize:w,onIframeLoad:v,iframeLoadTimeout:S=5e3,onStylesheetLoad:b,stylesheetLoadTimeout:M=5e3,keepIframeSrcFn:F=()=>!1,newlyAddedElement:P=!1}=t;let{needsMask:k}=t,{preserveWhiteSpace:T=!0}=t;!k&&e.childNodes&&(k=bt(e,a,l,k===void 0));const j=Tr(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:k,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:m,dataURLOptions:g,inlineImages:h,recordCanvas:y,keepIframeSrcFn:F,newlyAddedElement:P});if(!j)return console.warn(e,"not serialized"),null;let V;n.hasNode(e)?V=n.getId(e):Ar(j,f)||!T&&j.type===A.Text&&!j.isStyle&&!j.textContent.replace(/^\s+|\s+$/gm,"").length?V=Se:V=gt();const x=Object.assign(j,{id:V});if(n.add(e,x),V===Se)return null;w&&w(e);let oe=!s;if(x.type===A.Element){oe=oe&&!x.needBlock,delete x.needBlock;const H=e.shadowRoot;H&&ye(H)&&(x.isShadowHost=!0)}if((x.type===A.Document||x.type===A.Element)&&oe){f.headWhitespace&&x.type===A.Element&&x.tagName==="head"&&(T=!1);const H={doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:k,maskTextClass:a,maskTextSelector:l,skipChild:s,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:m,slimDOMOptions:f,dataURLOptions:g,inlineImages:h,recordCanvas:y,preserveWhiteSpace:T,onSerialize:w,onIframeLoad:v,iframeLoadTimeout:S,onStylesheetLoad:b,stylesheetLoadTimeout:M,keepIframeSrcFn:F};if(!(x.type===A.Element&&x.tagName==="textarea"&&x.attributes.value!==void 0))for(const ee of Array.from(e.childNodes)){const K=de(ee,H);K&&x.childNodes.push(K)}if(ar(e)&&e.shadowRoot)for(const ee of Array.from(e.shadowRoot.childNodes)){const K=de(ee,H);K&&(ye(e.shadowRoot)&&(K.isShadow=!0),x.childNodes.push(K))}}return e.parentNode&&ge(e.parentNode)&&ye(e.parentNode)&&(x.isShadow=!0),x.type===A.Element&&x.tagName==="iframe"&&Er(e,()=>{const H=e.contentDocument;if(H&&v){const ee=de(H,{doc:H,mirror:n,blockClass:i,blockSelector:o,needsMask:k,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:m,slimDOMOptions:f,dataURLOptions:g,inlineImages:h,recordCanvas:y,preserveWhiteSpace:T,onSerialize:w,onIframeLoad:v,iframeLoadTimeout:S,onStylesheetLoad:b,stylesheetLoadTimeout:M,keepIframeSrcFn:F});ee&&v(e,ee)}},S),x.type===A.Element&&x.tagName==="link"&&typeof x.attributes.rel=="string"&&(x.attributes.rel==="stylesheet"||x.attributes.rel==="preload"&&typeof x.attributes.href=="string"&&mt(x.attributes.href)==="css")&&kr(e,()=>{if(b){const H=de(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:k,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:m,slimDOMOptions:f,dataURLOptions:g,inlineImages:h,recordCanvas:y,preserveWhiteSpace:T,onSerialize:w,onIframeLoad:v,iframeLoadTimeout:S,onStylesheetLoad:b,stylesheetLoadTimeout:M,keepIframeSrcFn:F});H&&b(e,H)}},M),x}function Lr(e,t){const{mirror:r=new ht,blockClass:n="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:a=null,inlineStylesheet:l=!0,inlineImages:s=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:p,maskInputFn:m,slimDOM:f=!1,dataURLOptions:g,preserveWhiteSpace:h,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:v,onStylesheetLoad:S,stylesheetLoadTimeout:b,keepIframeSrcFn:M=()=>!1}=t||{};return de(e,{doc:e,mirror:r,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:u===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:u===!1?{password:!0}:u,maskTextFn:p,maskInputFn:m,slimDOMOptions:f===!0||f==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:f==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:f===!1?{}:f,dataURLOptions:g,inlineImages:s,recordCanvas:c,preserveWhiteSpace:h,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:v,onStylesheetLoad:S,stylesheetLoadTimeout:b,keepIframeSrcFn:M,newlyAddedElement:!1})}function W(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const fe=`Please stop import mirror directly. Instead of that,\r
2
2
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
3
- or you can use record.mirror to access the mirror instance during recording.`;let wt={map:{},getId(){return console.error(fe),-1},getNode(){return console.error(fe),null},removeNodeFromMap(){console.error(fe)},has(){return console.error(fe),!1},reset(){console.error(fe)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(wt=new Proxy(wt,{get(e,t,r){return t==="map"&&console.error(fe),Reflect.get(e,t,r)}}));function ve(e,t,r={}){let n=null,i=0;return function(...o){const a=Date.now();!i&&r.leading===!1&&(i=a);const l=t-(a-i),s=this;l<=0||l>t?(n&&(clearTimeout(n),n=null),i=a,e.apply(s,o)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{i=r.leading===!1?0:Date.now(),n=null,e.apply(s,o)},l))}}function ke(e,t,r,n,i=window){const o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(a){setTimeout(()=>{r.set.call(this,a)},0),o&&o.set&&o.set.call(this,a)}}),()=>ke(e,t,o||{},!0)}function he(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],i=r(n);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch{return()=>{}}}let Te=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Te=()=>new Date().getTime());function Mt(e){var t,r,n,i,o,a;const l=e.document;return{left:l.scrollingElement?l.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:l?.documentElement.scrollLeft||((r=(t=l?.body)===null||t===void 0?void 0:t.parentElement)===null||r===void 0?void 0:r.scrollLeft)||((n=l?.body)===null||n===void 0?void 0:n.scrollLeft)||0,top:l.scrollingElement?l.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:l?.documentElement.scrollTop||((o=(i=l?.body)===null||i===void 0?void 0:i.parentElement)===null||o===void 0?void 0:o.scrollTop)||((a=l?.body)===null||a===void 0?void 0:a.scrollTop)||0}}function It(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ct(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ot(e){return e?e.nodeType===e.ELEMENT_NODE?e:e.parentElement:null}function U(e,t,r,n){if(!e)return!1;const i=Ot(e);if(!i)return!1;try{if(typeof t=="string"){if(i.classList.contains(t)||n&&i.closest("."+t)!==null)return!0}else if(Ee(i,t,n))return!0}catch{}return!!(r&&(i.matches(r)||n&&i.closest(r)!==null))}function Lr(e,t){return t.getId(e)!==-1}function Xe(e,t){return t.getId(e)===Se}function _t(e,t){if(ge(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?_t(e.parentNode,t):!0:!0}function Ke(e){return!!e.changedTouches}function Pr(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let r=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===r)return!0;while(r=r&&r.parentNode);return!1})}function xt(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Et(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Ye(e){return!!e?.shadowRoot}class Fr{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){var r;return(r=this.styleIDMap.get(t))!==null&&r!==void 0?r:-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function kt(e){var t,r;let n=null;return((r=(t=e.getRootNode)===null||t===void 0?void 0:t.call(e))===null||r===void 0?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(n=e.getRootNode().host),n}function Br(e){let t=e,r;for(;r=kt(t);)t=r;return t}function Wr(e){const t=e.ownerDocument;if(!t)return!1;const r=Br(e);return t.contains(r)}function Tt(e){const t=e.ownerDocument;return t?t.contains(e)||Wr(e):!1}var _=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(_||{}),C=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(C||{}),$=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))($||{}),Y=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Y||{}),pe=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(pe||{});function Rt(e){return"__ln"in e}class Ur{constructor(){this.length=0,this.head=null,this.tail=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){const r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&Rt(t.previousSibling)){const n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&Rt(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;r.next===null&&(this.tail=r),this.length++}removeNode(t){const r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next?r.next.previous=r.previous:this.tail=r.previous):(this.head=r.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}const Nt=(e,t)=>`${e}@${t}`;class Hr{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],r=new Set,n=new Ur,i=s=>{let c=s,u=Se;for(;u===Se;)c=c&&c.nextSibling,u=c&&this.mirror.getId(c);return u},o=s=>{if(!s.parentNode||!Tt(s)||s.parentNode.tagName==="TEXTAREA")return;const c=ge(s.parentNode)?this.mirror.getId(kt(s)):this.mirror.getId(s.parentNode),u=i(s);if(c===-1||u===-1)return n.addNode(s);const p=de(s,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:m=>{xt(m,this.mirror)&&this.iframeManager.addIframe(m),Et(m,this.mirror)&&this.stylesheetManager.trackLinkElement(m),Ye(s)&&this.shadowDomManager.addShadowRoot(s.shadowRoot,this.doc)},onIframeLoad:(m,f)=>{this.iframeManager.attachIframe(m,f),this.shadowDomManager.observeAttachShadow(m)},onStylesheetLoad:(m,f)=>{this.stylesheetManager.attachLinkElement(m,f)}});p&&(t.push({parentId:c,nextId:u,node:p}),r.add(p.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const s of this.movedSet)Dt(this.removes,s,this.mirror)&&!this.movedSet.has(s.parentNode)||o(s);for(const s of this.addedSet)!Lt(this.droppedSet,s)&&!Dt(this.removes,s,this.mirror)||Lt(this.movedSet,s)?o(s):this.droppedSet.add(s);let a=null;for(;n.length;){let s=null;if(a){const c=this.mirror.getId(a.value.parentNode),u=i(a.value);c!==-1&&u!==-1&&(s=a)}if(!s){let c=n.tail;for(;c;){const u=c;if(c=c.previous,u){const p=this.mirror.getId(u.value.parentNode);if(i(u.value)===-1)continue;if(p!==-1){s=u;break}else{const f=u.value;if(f.parentNode&&f.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const g=f.parentNode.host;if(this.mirror.getId(g)!==-1){s=u;break}}}}}}if(!s){for(;n.head;)n.removeNode(n.head.value);break}a=s.previous,n.removeNode(s.value),o(s.value)}const l={texts:this.texts.map(s=>{const c=s.node;return c.parentNode&&c.parentNode.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c.parentNode),{id:this.mirror.getId(c),value:s.value}}).filter(s=>!r.has(s.id)).filter(s=>this.mirror.has(s.id)),attributes:this.attributes.map(s=>{const{attributes:c}=s;if(typeof c.style=="string"){const u=JSON.stringify(s.styleDiff),p=JSON.stringify(s._unchangedStyles);u.length<c.style.length&&(u+p).split("var(").length===c.style.split("var(").length&&(c.style=s.styleDiff)}return{id:this.mirror.getId(s.node),attributes:c}}).filter(s=>!r.has(s.id)).filter(s=>this.mirror.has(s.id)),removes:this.removes,adds:t};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(l))},this.genTextAreaValueMutation=t=>{let r=this.attributeMap.get(t);r||(r={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(t,r)),r.attributes.value=Array.from(t.childNodes,n=>n.textContent||"").join("")},this.processMutation=t=>{if(!Xe(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!U(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:bt(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,Ot(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let n=t.attributeName,i=t.target.getAttribute(n);if(n==="value"){const a=qe(r);i=Ve({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:a,value:i,maskInputFn:this.maskInputFn})}if(U(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;let o=this.attributeMap.get(t.target);if(r.tagName==="IFRAME"&&n==="src"&&!this.keepIframeSrcFn(i))if(!r.contentDocument)n="rr_src";else return;if(o||(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(t.target,o)),n==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!vt(r.tagName,n)&&(o.attributes[n]=St(this.doc,te(r.tagName),te(n),i),n==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const a=this.unattachedDoc.createElement("span");t.oldValue&&a.setAttribute("style",t.oldValue);for(const l of Array.from(r.style)){const s=r.style.getPropertyValue(l),c=r.style.getPropertyPriority(l);s!==a.style.getPropertyValue(l)||c!==a.style.getPropertyPriority(l)?c===""?o.styleDiff[l]=s:o.styleDiff[l]=[s,c]:o._unchangedStyles[l]=[s,c]}for(const l of Array.from(a.style))r.style.getPropertyValue(l)===""&&(o.styleDiff[l]=!1)}break}case"childList":{if(U(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const n=this.mirror.getId(r),i=ge(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);U(t.target,this.blockClass,this.blockSelector,!1)||Xe(r,this.mirror)||!Lr(r,this.mirror)||(this.addedSet.has(r)?(Qe(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||_t(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Nt(n,i)]?Qe(this.movedSet,r):this.removes.push({parentId:i,id:n,isShadow:ge(t.target)&&ye(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Xe(t,this.mirror))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[Nt(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);U(t,this.blockClass,this.blockSelector,!1)||(t.childNodes.forEach(n=>this.genAdds(n)),Ye(t)&&t.shadowRoot.childNodes.forEach(n=>{this.processedNodeManager.add(n,this),this.genAdds(n,t)}))}}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Qe(e,t){e.delete(t),t.childNodes.forEach(r=>Qe(e,r))}function Dt(e,t,r){return e.length===0?!1:At(e,t,r)}function At(e,t,r){const{parentNode:n}=t;if(!n)return!1;const i=r.getId(n);return e.some(o=>o.id===i)?!0:At(e,n,r)}function Lt(e,t){return e.size===0?!1:Pt(e,t)}function Pt(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:Pt(e,r):!1}let be;function zr(e){be=e}function $r(){be=void 0}const O=e=>be?(...r)=>{try{return e(...r)}catch(n){if(be&&be(n)===!0)return;throw n}}:e,re=[];function we(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Ft(e,t){var r,n;const i=new Hr;re.push(i),i.init(e);let o=window.MutationObserver||window.__rrMutationObserver;const a=(n=(r=window?.Zone)===null||r===void 0?void 0:r.__symbol__)===null||n===void 0?void 0:n.call(r,"MutationObserver");a&&window[a]&&(o=window[a]);const l=new o(O(i.processMutations.bind(i)));return l.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),l}function Gr({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const i=typeof t.mousemove=="number"?t.mousemove:50,o=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let a=[],l;const s=ve(O(p=>{const m=Date.now()-l;e(a.map(f=>(f.timeOffset-=m,f)),p),a=[],l=null}),o),c=O(ve(O(p=>{const m=we(p),{clientX:f,clientY:g}=Ke(p)?p.changedTouches[0]:p;l||(l=Te()),a.push({x:f,y:g,id:n.getId(m),timeOffset:Te()-l}),s(typeof DragEvent<"u"&&p instanceof DragEvent?C.Drag:p instanceof MouseEvent?C.MouseMove:C.TouchMove)}),i,{trailing:!1})),u=[W("mousemove",c,r),W("touchmove",c,r),W("drag",c,r)];return O(()=>{u.forEach(p=>p())})}function jr({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const a=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[];let s=null;const c=u=>p=>{const m=we(p);if(U(m,n,i,!0))return;let f=null,g=u;if("pointerType"in p){switch(p.pointerType){case"mouse":f=Y.Mouse;break;case"touch":f=Y.Touch;break;case"pen":f=Y.Pen;break}f===Y.Touch?$[u]===$.MouseDown?g="TouchStart":$[u]===$.MouseUp&&(g="TouchEnd"):Y.Pen}else Ke(p)&&(f=Y.Touch);f!==null?(s=f,(g.startsWith("Touch")&&f===Y.Touch||g.startsWith("Mouse")&&f===Y.Mouse)&&(f=null)):$[u]===$.Click&&(f=s,s=null);const h=Ke(p)?p.changedTouches[0]:p;if(!h)return;const y=r.getId(m),{clientX:w,clientY:v}=h;O(e)(Object.assign({type:$[g],id:y,x:w,y:v},f!==null&&{pointerType:f}))};return Object.keys($).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&a[u]!==!1).forEach(u=>{let p=te(u);const m=c(u);if(window.PointerEvent)switch($[u]){case $.MouseDown:case $.MouseUp:p=p.replace("mouse","pointer");break;case $.TouchStart:case $.TouchEnd:return}l.push(W(p,m,t))}),O(()=>{l.forEach(u=>u())})}function Bt({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){const a=O(ve(O(l=>{const s=we(l);if(!s||U(s,n,i,!0))return;const c=r.getId(s);if(s===t&&t.defaultView){const u=Mt(t.defaultView);e({id:c,x:u.left,y:u.top})}else e({id:c,x:s.scrollLeft,y:s.scrollTop})}),o.scroll||100));return W("scroll",a,t)}function Vr({viewportResizeCb:e},{win:t}){let r=-1,n=-1;const i=O(ve(O(()=>{const o=It(),a=Ct();(r!==o||n!==a)&&(e({width:Number(a),height:Number(o)}),r=o,n=a)}),200));return W("resize",i,t)}const qr=["INPUT","TEXTAREA","SELECT"],Wt=new WeakMap;function Jr({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,ignoreClass:o,ignoreSelector:a,maskInputOptions:l,maskInputFn:s,sampling:c,userTriggeredOnInput:u}){function p(v){let S=we(v);const b=v.isTrusted,M=S&&S.tagName;if(S&&M==="OPTION"&&(S=S.parentElement),!S||!M||qr.indexOf(M)<0||U(S,n,i,!0)||S.classList.contains(o)||a&&S.matches(a))return;let F=S.value,P=!1;const k=qe(S)||"";k==="radio"||k==="checkbox"?P=S.checked:(l[M.toLowerCase()]||l[k])&&(F=Ve({element:S,maskInputOptions:l,tagName:M,type:k,value:F,maskInputFn:s})),m(S,u?{text:F,isChecked:P,userTriggered:b}:{text:F,isChecked:P});const T=S.name;k==="radio"&&T&&P&&t.querySelectorAll(`input[type="radio"][name="${T}"]`).forEach(j=>{if(j!==S){const V=j.value;m(j,u?{text:V,isChecked:!P,userTriggered:!1}:{text:V,isChecked:!P})}})}function m(v,S){const b=Wt.get(v);if(!b||b.text!==S.text||b.isChecked!==S.isChecked){Wt.set(v,S);const M=r.getId(v);O(e)(Object.assign(Object.assign({},S),{id:M}))}}const g=(c.input==="last"?["change"]:["input","change"]).map(v=>W(v,O(p),t)),h=t.defaultView;if(!h)return()=>{g.forEach(v=>v())};const y=h.Object.getOwnPropertyDescriptor(h.HTMLInputElement.prototype,"value"),w=[[h.HTMLInputElement.prototype,"value"],[h.HTMLInputElement.prototype,"checked"],[h.HTMLSelectElement.prototype,"value"],[h.HTMLTextAreaElement.prototype,"value"],[h.HTMLSelectElement.prototype,"selectedIndex"],[h.HTMLOptionElement.prototype,"selected"]];return y&&y.set&&g.push(...w.map(v=>ke(v[0],v[1],{set(){O(p)({target:this,isTrusted:!1})}},!1,h))),O(()=>{g.forEach(v=>v())})}function Re(e){const t=[];function r(n,i){if(Ne("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||Ne("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||Ne("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||Ne("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){const a=Array.from(n.parentRule.cssRules).indexOf(n);i.unshift(a)}else if(n.parentStyleSheet){const a=Array.from(n.parentStyleSheet.cssRules).indexOf(n);i.unshift(a)}return i}return r(e,t)}function Q(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function Xr({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const i=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:O((u,p,m)=>{const[f,g]=m,{id:h,styleId:y}=Q(p,t,r.styleMirror);return(h&&h!==-1||y&&y!==-1)&&e({id:h,styleId:y,adds:[{rule:f,index:g}]}),u.apply(p,m)})});const o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:O((u,p,m)=>{const[f]=m,{id:g,styleId:h}=Q(p,t,r.styleMirror);return(g&&g!==-1||h&&h!==-1)&&e({id:g,styleId:h,removes:[{index:f}]}),u.apply(p,m)})});let a;n.CSSStyleSheet.prototype.replace&&(a=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:O((u,p,m)=>{const[f]=m,{id:g,styleId:h}=Q(p,t,r.styleMirror);return(g&&g!==-1||h&&h!==-1)&&e({id:g,styleId:h,replace:f}),u.apply(p,m)})}));let l;n.CSSStyleSheet.prototype.replaceSync&&(l=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:O((u,p,m)=>{const[f]=m,{id:g,styleId:h}=Q(p,t,r.styleMirror);return(g&&g!==-1||h&&h!==-1)&&e({id:g,styleId:h,replaceSync:f}),u.apply(p,m)})}));const s={};De("CSSGroupingRule")?s.CSSGroupingRule=n.CSSGroupingRule:(De("CSSMediaRule")&&(s.CSSMediaRule=n.CSSMediaRule),De("CSSConditionRule")&&(s.CSSConditionRule=n.CSSConditionRule),De("CSSSupportsRule")&&(s.CSSSupportsRule=n.CSSSupportsRule));const c={};return Object.entries(s).forEach(([u,p])=>{c[u]={insertRule:p.prototype.insertRule,deleteRule:p.prototype.deleteRule},p.prototype.insertRule=new Proxy(c[u].insertRule,{apply:O((m,f,g)=>{const[h,y]=g,{id:w,styleId:v}=Q(f.parentStyleSheet,t,r.styleMirror);return(w&&w!==-1||v&&v!==-1)&&e({id:w,styleId:v,adds:[{rule:h,index:[...Re(f),y||0]}]}),m.apply(f,g)})}),p.prototype.deleteRule=new Proxy(c[u].deleteRule,{apply:O((m,f,g)=>{const[h]=g,{id:y,styleId:w}=Q(f.parentStyleSheet,t,r.styleMirror);return(y&&y!==-1||w&&w!==-1)&&e({id:y,styleId:w,removes:[{index:[...Re(f),h]}]}),m.apply(f,g)})})}),O(()=>{n.CSSStyleSheet.prototype.insertRule=i,n.CSSStyleSheet.prototype.deleteRule=o,a&&(n.CSSStyleSheet.prototype.replace=a),l&&(n.CSSStyleSheet.prototype.replaceSync=l),Object.entries(s).forEach(([u,p])=>{p.prototype.insertRule=c[u].insertRule,p.prototype.deleteRule=c[u].deleteRule})})}function Ut({mirror:e,stylesheetManager:t},r){var n,i,o;let a=null;r.nodeName==="#document"?a=e.getId(r):a=e.getId(r.host);const l=r.nodeName==="#document"?(n=r.defaultView)===null||n===void 0?void 0:n.Document:(o=(i=r.ownerDocument)===null||i===void 0?void 0:i.defaultView)===null||o===void 0?void 0:o.ShadowRoot,s=l?.prototype?Object.getOwnPropertyDescriptor(l?.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!l||!s?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){var c;return(c=s.get)===null||c===void 0?void 0:c.call(this)},set(c){var u;const p=(u=s.set)===null||u===void 0?void 0:u.call(this,c);if(a!==null&&a!==-1)try{t.adoptStyleSheets(c,a)}catch{}return p}}),O(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})}))}function Kr({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:O((l,s,c)=>{var u;const[p,m,f]=c;if(r.has(p))return o.apply(s,[p,m,f]);const{id:g,styleId:h}=Q((u=s.parentRule)===null||u===void 0?void 0:u.parentStyleSheet,t,n.styleMirror);return(g&&g!==-1||h&&h!==-1)&&e({id:g,styleId:h,set:{property:p,value:m,priority:f},index:Re(s.parentRule)}),l.apply(s,c)})});const a=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:O((l,s,c)=>{var u;const[p]=c;if(r.has(p))return a.apply(s,[p]);const{id:m,styleId:f}=Q((u=s.parentRule)===null||u===void 0?void 0:u.parentStyleSheet,t,n.styleMirror);return(m&&m!==-1||f&&f!==-1)&&e({id:m,styleId:f,remove:{property:p},index:Re(s.parentRule)}),l.apply(s,c)})}),O(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=a})}function Yr({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i,doc:o}){const a=O(s=>ve(O(c=>{const u=we(c);if(!u||U(u,t,r,!0))return;const{currentTime:p,volume:m,muted:f,playbackRate:g,loop:h}=u;e({type:s,id:n.getId(u),currentTime:p,volume:m,muted:f,playbackRate:g,loop:h})}),i.media||500)),l=[W("play",a(0),o),W("pause",a(1),o),W("seeked",a(2),o),W("volumechange",a(3),o),W("ratechange",a(4),o)];return O(()=>{l.forEach(s=>s())})}function Qr({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],i=new WeakMap,o=r.FontFace;r.FontFace=function(s,c,u){const p=new o(s,c,u);return i.set(p,{family:s,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),p};const a=he(t.fonts,"add",function(l){return function(s){return setTimeout(O(()=>{const c=i.get(s);c&&(e(c),i.delete(s))}),0),l.apply(this,[s])}});return n.push(()=>{r.FontFace=o}),n.push(a),O(()=>{n.forEach(l=>l())})}function Zr(e){const{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=e;let a=!0;const l=O(()=>{const s=t.getSelection();if(!s||a&&s?.isCollapsed)return;a=s.isCollapsed||!1;const c=[],u=s.rangeCount||0;for(let p=0;p<u;p++){const m=s.getRangeAt(p),{startContainer:f,startOffset:g,endContainer:h,endOffset:y}=m;U(f,n,i,!0)||U(h,n,i,!0)||c.push({start:r.getId(f),startOffset:g,end:r.getId(h),endOffset:y})}o({ranges:c})});return l(),W("selectionchange",l)}function en({doc:e,customElementCb:t}){const r=e.defaultView;return!r||!r.customElements?()=>{}:he(r.customElements,"define",function(i){return function(o,a,l){try{t({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return i.apply(this,[o,a,l])}})}function tn(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:a,inputCb:l,mediaInteractionCb:s,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:p,fontCb:m,selectionCb:f,customElementCb:g}=e;e.mutationCb=(...h)=>{t.mutation&&t.mutation(...h),r(...h)},e.mousemoveCb=(...h)=>{t.mousemove&&t.mousemove(...h),n(...h)},e.mouseInteractionCb=(...h)=>{t.mouseInteraction&&t.mouseInteraction(...h),i(...h)},e.scrollCb=(...h)=>{t.scroll&&t.scroll(...h),o(...h)},e.viewportResizeCb=(...h)=>{t.viewportResize&&t.viewportResize(...h),a(...h)},e.inputCb=(...h)=>{t.input&&t.input(...h),l(...h)},e.mediaInteractionCb=(...h)=>{t.mediaInteaction&&t.mediaInteaction(...h),s(...h)},e.styleSheetRuleCb=(...h)=>{t.styleSheetRule&&t.styleSheetRule(...h),c(...h)},e.styleDeclarationCb=(...h)=>{t.styleDeclaration&&t.styleDeclaration(...h),u(...h)},e.canvasMutationCb=(...h)=>{t.canvasMutation&&t.canvasMutation(...h),p(...h)},e.fontCb=(...h)=>{t.font&&t.font(...h),m(...h)},e.selectionCb=(...h)=>{t.selection&&t.selection(...h),f(...h)},e.customElementCb=(...h)=>{t.customElement&&t.customElement(...h),g(...h)}}function rn(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};tn(e,t);let n;e.recordDOM&&(n=Ft(e,e.doc));const i=Gr(e),o=jr(e),a=Bt(e),l=Vr(e,{win:r}),s=Jr(e),c=Yr(e);let u=()=>{},p=()=>{},m=()=>{},f=()=>{};e.recordDOM&&(u=Xr(e,{win:r}),p=Ut(e,e.doc),m=Kr(e,{win:r}),e.collectFonts&&(f=Qr(e)));const g=Zr(e),h=en(e),y=[];for(const w of e.plugins)y.push(w.observer(w.callback,r,w.options));return O(()=>{re.forEach(w=>w.reset()),n?.disconnect(),i(),o(),a(),l(),s(),c(),u(),p(),m(),f(),g(),h(),y.forEach(w=>w())})}function Ne(e){return typeof window[e]<"u"}function De(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Ht{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,r,n,i){const o=n||this.getIdToRemoteIdMap(t),a=i||this.getRemoteIdToIdMap(t);let l=o.get(r);return l||(l=this.generateIdFn(),o.set(r,l),a.set(l,r)),l}getIds(t,r){const n=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return r.map(o=>this.getId(t,o,n,i))}getRemoteId(t,r,n){const i=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;const o=i.get(r);return o||-1}getRemoteIds(t,r){const n=this.getRemoteIdToIdMap(t);return r.map(i=>this.getRemoteId(t,i,n))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}}class nn{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Ht(gt),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ht(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,r){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(n=this.loadListener)===null||n===void 0||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;const i=this.crossOriginIframeMap.get(t.source);if(!i)return;const o=this.transformCrossOriginEvent(i,r.data.event);o&&this.wrappedEmit(o,r.data.isCheckout)}transformCrossOriginEvent(t,r){var n;switch(r.type){case _.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);const i=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(r.data.node,i),{timestamp:r.timestamp,type:_.IncrementalSnapshot,data:{source:C.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case _.Meta:case _.Load:case _.DomContentLoaded:return!1;case _.Plugin:return r;case _.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case _.IncrementalSnapshot:switch(r.data.source){case C.Mutation:return r.data.adds.forEach(i=>{this.replaceIds(i,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,t);const o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(i.node,o)}),r.data.removes.forEach(i=>{this.replaceIds(i,t,["parentId","id"])}),r.data.attributes.forEach(i=>{this.replaceIds(i,t,["id"])}),r.data.texts.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case C.Drag:case C.TouchMove:case C.MouseMove:return r.data.positions.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case C.ViewportResize:return!1;case C.MediaInteraction:case C.MouseInteraction:case C.Scroll:case C.CanvasMutation:case C.Input:return this.replaceIds(r.data,t,["id"]),r;case C.StyleSheetRule:case C.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case C.Font:return r;case C.Selection:return r.data.ranges.forEach(i=>{this.replaceIds(i,t,["start","end"])}),r;case C.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)===null||n===void 0||n.forEach(i=>{this.replaceStyleIds(i,t,["styleId"])}),r}}return!1}replace(t,r,n,i){for(const o of i)!Array.isArray(r[o])&&typeof r[o]!="number"||(Array.isArray(r[o])?r[o]=t.getIds(n,r[o]):r[o]=t.getId(n,r[o]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}patchRootIdOnNode(t,r){t.type!==A.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}}class on{constructor(t){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,r){if(!ye(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);const n=Ft(Object.assign(Object.assign({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(Bt(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(Ut({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,r){const n=this;this.restoreHandlers.push(he(t.prototype,"attachShadow",function(i){return function(o){const a=i.call(this,o);return this.shadowRoot&&Tt(this)&&n.addShadowRoot(this.shadowRoot,r),a}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}/*! *****************************************************************************
3
+ or you can use record.mirror to access the mirror instance during recording.`;let wt={map:{},getId(){return console.error(fe),-1},getNode(){return console.error(fe),null},removeNodeFromMap(){console.error(fe)},has(){return console.error(fe),!1},reset(){console.error(fe)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(wt=new Proxy(wt,{get(e,t,r){return t==="map"&&console.error(fe),Reflect.get(e,t,r)}}));function ve(e,t,r={}){let n=null,i=0;return function(...o){const a=Date.now();!i&&r.leading===!1&&(i=a);const l=t-(a-i),s=this;l<=0||l>t?(n&&(clearTimeout(n),n=null),i=a,e.apply(s,o)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{i=r.leading===!1?0:Date.now(),n=null,e.apply(s,o)},l))}}function ke(e,t,r,n,i=window){const o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(a){setTimeout(()=>{r.set.call(this,a)},0),o&&o.set&&o.set.call(this,a)}}),()=>ke(e,t,o||{},!0)}function he(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],i=r(n);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch{return()=>{}}}let Te=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Te=()=>new Date().getTime());function Mt(e){var t,r,n,i,o,a;const l=e.document;return{left:l.scrollingElement?l.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:l?.documentElement.scrollLeft||((r=(t=l?.body)===null||t===void 0?void 0:t.parentElement)===null||r===void 0?void 0:r.scrollLeft)||((n=l?.body)===null||n===void 0?void 0:n.scrollLeft)||0,top:l.scrollingElement?l.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:l?.documentElement.scrollTop||((o=(i=l?.body)===null||i===void 0?void 0:i.parentElement)===null||o===void 0?void 0:o.scrollTop)||((a=l?.body)===null||a===void 0?void 0:a.scrollTop)||0}}function It(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ct(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ot(e){return e?e.nodeType===e.ELEMENT_NODE?e:e.parentElement:null}function U(e,t,r,n){if(!e)return!1;const i=Ot(e);if(!i)return!1;try{if(typeof t=="string"){if(i.classList.contains(t)||n&&i.closest("."+t)!==null)return!0}else if(Ee(i,t,n))return!0}catch{}return!!(r&&(i.matches(r)||n&&i.closest(r)!==null))}function Pr(e,t){return t.getId(e)!==-1}function Xe(e,t){return t.getId(e)===Se}function _t(e,t){if(ge(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?_t(e.parentNode,t):!0:!0}function Ke(e){return!!e.changedTouches}function Fr(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let r=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===r)return!0;while(r=r&&r.parentNode);return!1})}function xt(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Et(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Ye(e){return!!e?.shadowRoot}class Br{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){var r;return(r=this.styleIDMap.get(t))!==null&&r!==void 0?r:-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function kt(e){var t,r;let n=null;return((r=(t=e.getRootNode)===null||t===void 0?void 0:t.call(e))===null||r===void 0?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(n=e.getRootNode().host),n}function Wr(e){let t=e,r;for(;r=kt(t);)t=r;return t}function Ur(e){const t=e.ownerDocument;if(!t)return!1;const r=Wr(e);return t.contains(r)}function Tt(e){const t=e.ownerDocument;return t?t.contains(e)||Ur(e):!1}var _=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(_||{}),C=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(C||{}),$=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))($||{}),Y=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Y||{}),pe=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(pe||{});function Rt(e){return"__ln"in e}class Hr{constructor(){this.length=0,this.head=null,this.tail=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){const r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&Rt(t.previousSibling)){const n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&Rt(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;r.next===null&&(this.tail=r),this.length++}removeNode(t){const r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next?r.next.previous=r.previous:this.tail=r.previous):(this.head=r.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}const Nt=(e,t)=>`${e}@${t}`;class zr{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],r=new Set,n=new Hr,i=s=>{let c=s,u=Se;for(;u===Se;)c=c&&c.nextSibling,u=c&&this.mirror.getId(c);return u},o=s=>{if(!s.parentNode||!Tt(s)||s.parentNode.tagName==="TEXTAREA")return;const c=ge(s.parentNode)?this.mirror.getId(kt(s)):this.mirror.getId(s.parentNode),u=i(s);if(c===-1||u===-1)return n.addNode(s);const p=de(s,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:m=>{xt(m,this.mirror)&&this.iframeManager.addIframe(m),Et(m,this.mirror)&&this.stylesheetManager.trackLinkElement(m),Ye(s)&&this.shadowDomManager.addShadowRoot(s.shadowRoot,this.doc)},onIframeLoad:(m,f)=>{this.iframeManager.attachIframe(m,f),this.shadowDomManager.observeAttachShadow(m)},onStylesheetLoad:(m,f)=>{this.stylesheetManager.attachLinkElement(m,f)}});p&&(t.push({parentId:c,nextId:u,node:p}),r.add(p.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const s of this.movedSet)Dt(this.removes,s,this.mirror)&&!this.movedSet.has(s.parentNode)||o(s);for(const s of this.addedSet)!Lt(this.droppedSet,s)&&!Dt(this.removes,s,this.mirror)||Lt(this.movedSet,s)?o(s):this.droppedSet.add(s);let a=null;for(;n.length;){let s=null;if(a){const c=this.mirror.getId(a.value.parentNode),u=i(a.value);c!==-1&&u!==-1&&(s=a)}if(!s){let c=n.tail;for(;c;){const u=c;if(c=c.previous,u){const p=this.mirror.getId(u.value.parentNode);if(i(u.value)===-1)continue;if(p!==-1){s=u;break}else{const f=u.value;if(f.parentNode&&f.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const g=f.parentNode.host;if(this.mirror.getId(g)!==-1){s=u;break}}}}}}if(!s){for(;n.head;)n.removeNode(n.head.value);break}a=s.previous,n.removeNode(s.value),o(s.value)}const l={texts:this.texts.map(s=>{const c=s.node;return c.parentNode&&c.parentNode.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c.parentNode),{id:this.mirror.getId(c),value:s.value}}).filter(s=>!r.has(s.id)).filter(s=>this.mirror.has(s.id)),attributes:this.attributes.map(s=>{const{attributes:c}=s;if(typeof c.style=="string"){const u=JSON.stringify(s.styleDiff),p=JSON.stringify(s._unchangedStyles);u.length<c.style.length&&(u+p).split("var(").length===c.style.split("var(").length&&(c.style=s.styleDiff)}return{id:this.mirror.getId(s.node),attributes:c}}).filter(s=>!r.has(s.id)).filter(s=>this.mirror.has(s.id)),removes:this.removes,adds:t};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(l))},this.genTextAreaValueMutation=t=>{let r=this.attributeMap.get(t);r||(r={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(t,r)),r.attributes.value=Array.from(t.childNodes,n=>n.textContent||"").join("")},this.processMutation=t=>{if(!Xe(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!U(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:bt(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,Ot(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let n=t.attributeName,i=t.target.getAttribute(n);if(n==="value"){const a=qe(r);i=Ve({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:a,value:i,maskInputFn:this.maskInputFn})}if(U(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;let o=this.attributeMap.get(t.target);if(r.tagName==="IFRAME"&&n==="src"&&!this.keepIframeSrcFn(i))if(!r.contentDocument)n="rr_src";else return;if(o||(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(t.target,o)),n==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!vt(r.tagName,n)&&(o.attributes[n]=St(this.doc,te(r.tagName),te(n),i),n==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const a=this.unattachedDoc.createElement("span");t.oldValue&&a.setAttribute("style",t.oldValue);for(const l of Array.from(r.style)){const s=r.style.getPropertyValue(l),c=r.style.getPropertyPriority(l);s!==a.style.getPropertyValue(l)||c!==a.style.getPropertyPriority(l)?c===""?o.styleDiff[l]=s:o.styleDiff[l]=[s,c]:o._unchangedStyles[l]=[s,c]}for(const l of Array.from(a.style))r.style.getPropertyValue(l)===""&&(o.styleDiff[l]=!1)}break}case"childList":{if(U(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const n=this.mirror.getId(r),i=ge(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);U(t.target,this.blockClass,this.blockSelector,!1)||Xe(r,this.mirror)||!Pr(r,this.mirror)||(this.addedSet.has(r)?(Qe(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||_t(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Nt(n,i)]?Qe(this.movedSet,r):this.removes.push({parentId:i,id:n,isShadow:ge(t.target)&&ye(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Xe(t,this.mirror))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[Nt(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);U(t,this.blockClass,this.blockSelector,!1)||(t.childNodes.forEach(n=>this.genAdds(n)),Ye(t)&&t.shadowRoot.childNodes.forEach(n=>{this.processedNodeManager.add(n,this),this.genAdds(n,t)}))}}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Qe(e,t){e.delete(t),t.childNodes.forEach(r=>Qe(e,r))}function Dt(e,t,r){return e.length===0?!1:At(e,t,r)}function At(e,t,r){const{parentNode:n}=t;if(!n)return!1;const i=r.getId(n);return e.some(o=>o.id===i)?!0:At(e,n,r)}function Lt(e,t){return e.size===0?!1:Pt(e,t)}function Pt(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:Pt(e,r):!1}let be;function $r(e){be=e}function Gr(){be=void 0}const O=e=>be?(...r)=>{try{return e(...r)}catch(n){if(be&&be(n)===!0)return;throw n}}:e,re=[];function we(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Ft(e,t){var r,n;const i=new zr;re.push(i),i.init(e);let o=window.MutationObserver||window.__rrMutationObserver;const a=(n=(r=window?.Zone)===null||r===void 0?void 0:r.__symbol__)===null||n===void 0?void 0:n.call(r,"MutationObserver");a&&window[a]&&(o=window[a]);const l=new o(O(i.processMutations.bind(i)));return l.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),l}function jr({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const i=typeof t.mousemove=="number"?t.mousemove:50,o=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let a=[],l;const s=ve(O(p=>{const m=Date.now()-l;e(a.map(f=>(f.timeOffset-=m,f)),p),a=[],l=null}),o),c=O(ve(O(p=>{const m=we(p),{clientX:f,clientY:g}=Ke(p)?p.changedTouches[0]:p;l||(l=Te()),a.push({x:f,y:g,id:n.getId(m),timeOffset:Te()-l}),s(typeof DragEvent<"u"&&p instanceof DragEvent?C.Drag:p instanceof MouseEvent?C.MouseMove:C.TouchMove)}),i,{trailing:!1})),u=[W("mousemove",c,r),W("touchmove",c,r),W("drag",c,r)];return O(()=>{u.forEach(p=>p())})}function Vr({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const a=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[];let s=null;const c=u=>p=>{const m=we(p);if(U(m,n,i,!0))return;let f=null,g=u;if("pointerType"in p){switch(p.pointerType){case"mouse":f=Y.Mouse;break;case"touch":f=Y.Touch;break;case"pen":f=Y.Pen;break}f===Y.Touch?$[u]===$.MouseDown?g="TouchStart":$[u]===$.MouseUp&&(g="TouchEnd"):Y.Pen}else Ke(p)&&(f=Y.Touch);f!==null?(s=f,(g.startsWith("Touch")&&f===Y.Touch||g.startsWith("Mouse")&&f===Y.Mouse)&&(f=null)):$[u]===$.Click&&(f=s,s=null);const h=Ke(p)?p.changedTouches[0]:p;if(!h)return;const y=r.getId(m),{clientX:w,clientY:v}=h;O(e)(Object.assign({type:$[g],id:y,x:w,y:v},f!==null&&{pointerType:f}))};return Object.keys($).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&a[u]!==!1).forEach(u=>{let p=te(u);const m=c(u);if(window.PointerEvent)switch($[u]){case $.MouseDown:case $.MouseUp:p=p.replace("mouse","pointer");break;case $.TouchStart:case $.TouchEnd:return}l.push(W(p,m,t))}),O(()=>{l.forEach(u=>u())})}function Bt({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){const a=O(ve(O(l=>{const s=we(l);if(!s||U(s,n,i,!0))return;const c=r.getId(s);if(s===t&&t.defaultView){const u=Mt(t.defaultView);e({id:c,x:u.left,y:u.top})}else e({id:c,x:s.scrollLeft,y:s.scrollTop})}),o.scroll||100));return W("scroll",a,t)}function qr({viewportResizeCb:e},{win:t}){let r=-1,n=-1;const i=O(ve(O(()=>{const o=It(),a=Ct();(r!==o||n!==a)&&(e({width:Number(a),height:Number(o)}),r=o,n=a)}),200));return W("resize",i,t)}const Jr=["INPUT","TEXTAREA","SELECT"],Wt=new WeakMap;function Xr({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,ignoreClass:o,ignoreSelector:a,maskInputOptions:l,maskInputFn:s,sampling:c,userTriggeredOnInput:u}){function p(v){let S=we(v);const b=v.isTrusted,M=S&&S.tagName;if(S&&M==="OPTION"&&(S=S.parentElement),!S||!M||Jr.indexOf(M)<0||U(S,n,i,!0)||S.classList.contains(o)||a&&S.matches(a))return;let F=S.value,P=!1;const k=qe(S)||"";k==="radio"||k==="checkbox"?P=S.checked:(l[M.toLowerCase()]||l[k])&&(F=Ve({element:S,maskInputOptions:l,tagName:M,type:k,value:F,maskInputFn:s})),m(S,u?{text:F,isChecked:P,userTriggered:b}:{text:F,isChecked:P});const T=S.name;k==="radio"&&T&&P&&t.querySelectorAll(`input[type="radio"][name="${T}"]`).forEach(j=>{if(j!==S){const V=j.value;m(j,u?{text:V,isChecked:!P,userTriggered:!1}:{text:V,isChecked:!P})}})}function m(v,S){const b=Wt.get(v);if(!b||b.text!==S.text||b.isChecked!==S.isChecked){Wt.set(v,S);const M=r.getId(v);O(e)(Object.assign(Object.assign({},S),{id:M}))}}const g=(c.input==="last"?["change"]:["input","change"]).map(v=>W(v,O(p),t)),h=t.defaultView;if(!h)return()=>{g.forEach(v=>v())};const y=h.Object.getOwnPropertyDescriptor(h.HTMLInputElement.prototype,"value"),w=[[h.HTMLInputElement.prototype,"value"],[h.HTMLInputElement.prototype,"checked"],[h.HTMLSelectElement.prototype,"value"],[h.HTMLTextAreaElement.prototype,"value"],[h.HTMLSelectElement.prototype,"selectedIndex"],[h.HTMLOptionElement.prototype,"selected"]];return y&&y.set&&g.push(...w.map(v=>ke(v[0],v[1],{set(){O(p)({target:this,isTrusted:!1})}},!1,h))),O(()=>{g.forEach(v=>v())})}function Re(e){const t=[];function r(n,i){if(Ne("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||Ne("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||Ne("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||Ne("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){const a=Array.from(n.parentRule.cssRules).indexOf(n);i.unshift(a)}else if(n.parentStyleSheet){const a=Array.from(n.parentStyleSheet.cssRules).indexOf(n);i.unshift(a)}return i}return r(e,t)}function Z(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function Kr({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const i=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:O((u,p,m)=>{const[f,g]=m,{id:h,styleId:y}=Z(p,t,r.styleMirror);return(h&&h!==-1||y&&y!==-1)&&e({id:h,styleId:y,adds:[{rule:f,index:g}]}),u.apply(p,m)})});const o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:O((u,p,m)=>{const[f]=m,{id:g,styleId:h}=Z(p,t,r.styleMirror);return(g&&g!==-1||h&&h!==-1)&&e({id:g,styleId:h,removes:[{index:f}]}),u.apply(p,m)})});let a;n.CSSStyleSheet.prototype.replace&&(a=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:O((u,p,m)=>{const[f]=m,{id:g,styleId:h}=Z(p,t,r.styleMirror);return(g&&g!==-1||h&&h!==-1)&&e({id:g,styleId:h,replace:f}),u.apply(p,m)})}));let l;n.CSSStyleSheet.prototype.replaceSync&&(l=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:O((u,p,m)=>{const[f]=m,{id:g,styleId:h}=Z(p,t,r.styleMirror);return(g&&g!==-1||h&&h!==-1)&&e({id:g,styleId:h,replaceSync:f}),u.apply(p,m)})}));const s={};De("CSSGroupingRule")?s.CSSGroupingRule=n.CSSGroupingRule:(De("CSSMediaRule")&&(s.CSSMediaRule=n.CSSMediaRule),De("CSSConditionRule")&&(s.CSSConditionRule=n.CSSConditionRule),De("CSSSupportsRule")&&(s.CSSSupportsRule=n.CSSSupportsRule));const c={};return Object.entries(s).forEach(([u,p])=>{c[u]={insertRule:p.prototype.insertRule,deleteRule:p.prototype.deleteRule},p.prototype.insertRule=new Proxy(c[u].insertRule,{apply:O((m,f,g)=>{const[h,y]=g,{id:w,styleId:v}=Z(f.parentStyleSheet,t,r.styleMirror);return(w&&w!==-1||v&&v!==-1)&&e({id:w,styleId:v,adds:[{rule:h,index:[...Re(f),y||0]}]}),m.apply(f,g)})}),p.prototype.deleteRule=new Proxy(c[u].deleteRule,{apply:O((m,f,g)=>{const[h]=g,{id:y,styleId:w}=Z(f.parentStyleSheet,t,r.styleMirror);return(y&&y!==-1||w&&w!==-1)&&e({id:y,styleId:w,removes:[{index:[...Re(f),h]}]}),m.apply(f,g)})})}),O(()=>{n.CSSStyleSheet.prototype.insertRule=i,n.CSSStyleSheet.prototype.deleteRule=o,a&&(n.CSSStyleSheet.prototype.replace=a),l&&(n.CSSStyleSheet.prototype.replaceSync=l),Object.entries(s).forEach(([u,p])=>{p.prototype.insertRule=c[u].insertRule,p.prototype.deleteRule=c[u].deleteRule})})}function Ut({mirror:e,stylesheetManager:t},r){var n,i,o;let a=null;r.nodeName==="#document"?a=e.getId(r):a=e.getId(r.host);const l=r.nodeName==="#document"?(n=r.defaultView)===null||n===void 0?void 0:n.Document:(o=(i=r.ownerDocument)===null||i===void 0?void 0:i.defaultView)===null||o===void 0?void 0:o.ShadowRoot,s=l?.prototype?Object.getOwnPropertyDescriptor(l?.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!l||!s?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){var c;return(c=s.get)===null||c===void 0?void 0:c.call(this)},set(c){var u;const p=(u=s.set)===null||u===void 0?void 0:u.call(this,c);if(a!==null&&a!==-1)try{t.adoptStyleSheets(c,a)}catch{}return p}}),O(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})}))}function Yr({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:O((l,s,c)=>{var u;const[p,m,f]=c;if(r.has(p))return o.apply(s,[p,m,f]);const{id:g,styleId:h}=Z((u=s.parentRule)===null||u===void 0?void 0:u.parentStyleSheet,t,n.styleMirror);return(g&&g!==-1||h&&h!==-1)&&e({id:g,styleId:h,set:{property:p,value:m,priority:f},index:Re(s.parentRule)}),l.apply(s,c)})});const a=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:O((l,s,c)=>{var u;const[p]=c;if(r.has(p))return a.apply(s,[p]);const{id:m,styleId:f}=Z((u=s.parentRule)===null||u===void 0?void 0:u.parentStyleSheet,t,n.styleMirror);return(m&&m!==-1||f&&f!==-1)&&e({id:m,styleId:f,remove:{property:p},index:Re(s.parentRule)}),l.apply(s,c)})}),O(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=a})}function Qr({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i,doc:o}){const a=O(s=>ve(O(c=>{const u=we(c);if(!u||U(u,t,r,!0))return;const{currentTime:p,volume:m,muted:f,playbackRate:g,loop:h}=u;e({type:s,id:n.getId(u),currentTime:p,volume:m,muted:f,playbackRate:g,loop:h})}),i.media||500)),l=[W("play",a(0),o),W("pause",a(1),o),W("seeked",a(2),o),W("volumechange",a(3),o),W("ratechange",a(4),o)];return O(()=>{l.forEach(s=>s())})}function Zr({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],i=new WeakMap,o=r.FontFace;r.FontFace=function(s,c,u){const p=new o(s,c,u);return i.set(p,{family:s,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),p};const a=he(t.fonts,"add",function(l){return function(s){return setTimeout(O(()=>{const c=i.get(s);c&&(e(c),i.delete(s))}),0),l.apply(this,[s])}});return n.push(()=>{r.FontFace=o}),n.push(a),O(()=>{n.forEach(l=>l())})}function en(e){const{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=e;let a=!0;const l=O(()=>{const s=t.getSelection();if(!s||a&&s?.isCollapsed)return;a=s.isCollapsed||!1;const c=[],u=s.rangeCount||0;for(let p=0;p<u;p++){const m=s.getRangeAt(p),{startContainer:f,startOffset:g,endContainer:h,endOffset:y}=m;U(f,n,i,!0)||U(h,n,i,!0)||c.push({start:r.getId(f),startOffset:g,end:r.getId(h),endOffset:y})}o({ranges:c})});return l(),W("selectionchange",l)}function tn({doc:e,customElementCb:t}){const r=e.defaultView;return!r||!r.customElements?()=>{}:he(r.customElements,"define",function(i){return function(o,a,l){try{t({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return i.apply(this,[o,a,l])}})}function rn(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:a,inputCb:l,mediaInteractionCb:s,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:p,fontCb:m,selectionCb:f,customElementCb:g}=e;e.mutationCb=(...h)=>{t.mutation&&t.mutation(...h),r(...h)},e.mousemoveCb=(...h)=>{t.mousemove&&t.mousemove(...h),n(...h)},e.mouseInteractionCb=(...h)=>{t.mouseInteraction&&t.mouseInteraction(...h),i(...h)},e.scrollCb=(...h)=>{t.scroll&&t.scroll(...h),o(...h)},e.viewportResizeCb=(...h)=>{t.viewportResize&&t.viewportResize(...h),a(...h)},e.inputCb=(...h)=>{t.input&&t.input(...h),l(...h)},e.mediaInteractionCb=(...h)=>{t.mediaInteaction&&t.mediaInteaction(...h),s(...h)},e.styleSheetRuleCb=(...h)=>{t.styleSheetRule&&t.styleSheetRule(...h),c(...h)},e.styleDeclarationCb=(...h)=>{t.styleDeclaration&&t.styleDeclaration(...h),u(...h)},e.canvasMutationCb=(...h)=>{t.canvasMutation&&t.canvasMutation(...h),p(...h)},e.fontCb=(...h)=>{t.font&&t.font(...h),m(...h)},e.selectionCb=(...h)=>{t.selection&&t.selection(...h),f(...h)},e.customElementCb=(...h)=>{t.customElement&&t.customElement(...h),g(...h)}}function nn(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};rn(e,t);let n;e.recordDOM&&(n=Ft(e,e.doc));const i=jr(e),o=Vr(e),a=Bt(e),l=qr(e,{win:r}),s=Xr(e),c=Qr(e);let u=()=>{},p=()=>{},m=()=>{},f=()=>{};e.recordDOM&&(u=Kr(e,{win:r}),p=Ut(e,e.doc),m=Yr(e,{win:r}),e.collectFonts&&(f=Zr(e)));const g=en(e),h=tn(e),y=[];for(const w of e.plugins)y.push(w.observer(w.callback,r,w.options));return O(()=>{re.forEach(w=>w.reset()),n?.disconnect(),i(),o(),a(),l(),s(),c(),u(),p(),m(),f(),g(),h(),y.forEach(w=>w())})}function Ne(e){return typeof window[e]<"u"}function De(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Ht{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,r,n,i){const o=n||this.getIdToRemoteIdMap(t),a=i||this.getRemoteIdToIdMap(t);let l=o.get(r);return l||(l=this.generateIdFn(),o.set(r,l),a.set(l,r)),l}getIds(t,r){const n=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return r.map(o=>this.getId(t,o,n,i))}getRemoteId(t,r,n){const i=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;const o=i.get(r);return o||-1}getRemoteIds(t,r){const n=this.getRemoteIdToIdMap(t);return r.map(i=>this.getRemoteId(t,i,n))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}}class on{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Ht(gt),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ht(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,r){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(n=this.loadListener)===null||n===void 0||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;const i=this.crossOriginIframeMap.get(t.source);if(!i)return;const o=this.transformCrossOriginEvent(i,r.data.event);o&&this.wrappedEmit(o,r.data.isCheckout)}transformCrossOriginEvent(t,r){var n;switch(r.type){case _.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);const i=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(r.data.node,i),{timestamp:r.timestamp,type:_.IncrementalSnapshot,data:{source:C.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case _.Meta:case _.Load:case _.DomContentLoaded:return!1;case _.Plugin:return r;case _.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case _.IncrementalSnapshot:switch(r.data.source){case C.Mutation:return r.data.adds.forEach(i=>{this.replaceIds(i,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,t);const o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(i.node,o)}),r.data.removes.forEach(i=>{this.replaceIds(i,t,["parentId","id"])}),r.data.attributes.forEach(i=>{this.replaceIds(i,t,["id"])}),r.data.texts.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case C.Drag:case C.TouchMove:case C.MouseMove:return r.data.positions.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case C.ViewportResize:return!1;case C.MediaInteraction:case C.MouseInteraction:case C.Scroll:case C.CanvasMutation:case C.Input:return this.replaceIds(r.data,t,["id"]),r;case C.StyleSheetRule:case C.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case C.Font:return r;case C.Selection:return r.data.ranges.forEach(i=>{this.replaceIds(i,t,["start","end"])}),r;case C.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)===null||n===void 0||n.forEach(i=>{this.replaceStyleIds(i,t,["styleId"])}),r}}return!1}replace(t,r,n,i){for(const o of i)!Array.isArray(r[o])&&typeof r[o]!="number"||(Array.isArray(r[o])?r[o]=t.getIds(n,r[o]):r[o]=t.getId(n,r[o]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}patchRootIdOnNode(t,r){t.type!==A.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}}class sn{constructor(t){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,r){if(!ye(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);const n=Ft(Object.assign(Object.assign({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(Bt(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(Ut({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,r){const n=this;this.restoreHandlers.push(he(t.prototype,"attachShadow",function(i){return function(o){const a=i.call(this,o);return this.shadowRoot&&Tt(this)&&n.addShadowRoot(this.shadowRoot,r),a}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}/*! *****************************************************************************
4
4
  Copyright (c) Microsoft Corporation.
5
5
 
6
6
  Permission to use, copy, modify, and/or distribute this software for any
@@ -13,10 +13,10 @@ or you can use record.mirror to access the mirror instance during recording.`;le
13
13
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
14
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
15
  PERFORMANCE OF THIS SOFTWARE.
16
- ***************************************************************************** */function sn(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function an(e,t,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function l(u){try{c(n.next(u))}catch(p){a(p)}}function s(u){try{c(n.throw(u))}catch(p){a(p)}}function c(u){u.done?o(u.value):i(u.value).then(l,s)}c((n=n.apply(e,t||[])).next())})}for(var me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ln=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ae=0;Ae<me.length;Ae++)ln[me.charCodeAt(Ae)]=Ae;var cn=function(e){var t=new Uint8Array(e),r,n=t.length,i="";for(r=0;r<n;r+=3)i+=me[t[r]>>2],i+=me[(t[r]&3)<<4|t[r+1]>>4],i+=me[(t[r+1]&15)<<2|t[r+2]>>6],i+=me[t[r+2]&63];return n%3===2?i=i.substring(0,i.length-1)+"=":n%3===1&&(i=i.substring(0,i.length-2)+"=="),i};const zt=new Map;function un(e,t){let r=zt.get(e);return r||(r=new Map,zt.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const $t=(e,t,r)=>{if(!e||!(jt(e,t)||typeof e=="object"))return;const n=e.constructor.name,i=un(r,n);let o=i.indexOf(e);return o===-1&&(o=i.length,i.push(e)),o};function Le(e,t,r){if(e instanceof Array)return e.map(n=>Le(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const n=e.constructor.name,i=cn(e);return{rr_type:n,base64:i}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Le(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const n=e.constructor.name,{src:i}=e;return{rr_type:n,src:i}}else if(e instanceof HTMLCanvasElement){const n="HTMLImageElement",i=e.toDataURL();return{rr_type:n,src:i}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Le(e.data,t,r),e.width,e.height]};if(jt(e,t)||typeof e=="object"){const n=e.constructor.name,i=$t(e,t,r);return{rr_type:n,index:i}}}}return e}const Gt=(e,t,r)=>e.map(n=>Le(n,t,r)),jt=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof t[i]=="function").find(i=>e instanceof t[i]);function dn(e,t,r,n){const i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of o)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;const l=he(t.CanvasRenderingContext2D.prototype,a,function(s){return function(...c){return U(this.canvas,r,n,!0)||setTimeout(()=>{const u=Gt(c,t,this);e(this.canvas,{type:pe["2D"],property:a,args:u})},0),s.apply(this,c)}});i.push(l)}catch{const s=ke(t.CanvasRenderingContext2D.prototype,a,{set(c){e(this.canvas,{type:pe["2D"],property:a,args:[c],setter:!0})}});i.push(s)}return()=>{i.forEach(a=>a())}}function fn(e){return e==="experimental-webgl"?"webgl":e}function Vt(e,t,r,n){const i=[];try{const o=he(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(l,...s){if(!U(this,t,r,!0)){const c=fn(l);if("__context"in this||(this.__context=c),n&&["webgl","webgl2"].includes(c))if(s[0]&&typeof s[0]=="object"){const u=s[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[l,...s])}});i.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(o=>o())}}function qt(e,t,r,n,i,o,a){const l=[],s=Object.getOwnPropertyNames(e);for(const c of s)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{if(typeof e[c]!="function")continue;const u=he(e,c,function(p){return function(...m){const f=p.apply(this,m);if($t(f,a,this),"tagName"in this.canvas&&!U(this.canvas,n,i,!0)){const g=Gt(m,a,this),h={type:t,property:c,args:g};r(this.canvas,h)}return f}});l.push(u)}catch{const p=ke(e,c,{set(m){r(this.canvas,{type:t,property:c,args:[m],setter:!0})}});l.push(p)}return l}function hn(e,t,r,n,i){const o=[];return o.push(...qt(t.WebGLRenderingContext.prototype,pe.WebGL,e,r,n,i,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...qt(t.WebGL2RenderingContext.prototype,pe.WebGL2,e,r,n,i,t)),()=>{o.forEach(a=>a())}}function pn(e,t){var r=t===void 0?null:t,n=e.toString(),i=n.split(`
16
+ ***************************************************************************** */function an(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function ln(e,t,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function l(u){try{c(n.next(u))}catch(p){a(p)}}function s(u){try{c(n.throw(u))}catch(p){a(p)}}function c(u){u.done?o(u.value):i(u.value).then(l,s)}c((n=n.apply(e,t||[])).next())})}for(var me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",cn=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ae=0;Ae<me.length;Ae++)cn[me.charCodeAt(Ae)]=Ae;var un=function(e){var t=new Uint8Array(e),r,n=t.length,i="";for(r=0;r<n;r+=3)i+=me[t[r]>>2],i+=me[(t[r]&3)<<4|t[r+1]>>4],i+=me[(t[r+1]&15)<<2|t[r+2]>>6],i+=me[t[r+2]&63];return n%3===2?i=i.substring(0,i.length-1)+"=":n%3===1&&(i=i.substring(0,i.length-2)+"=="),i};const zt=new Map;function dn(e,t){let r=zt.get(e);return r||(r=new Map,zt.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const $t=(e,t,r)=>{if(!e||!(jt(e,t)||typeof e=="object"))return;const n=e.constructor.name,i=dn(r,n);let o=i.indexOf(e);return o===-1&&(o=i.length,i.push(e)),o};function Le(e,t,r){if(e instanceof Array)return e.map(n=>Le(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const n=e.constructor.name,i=un(e);return{rr_type:n,base64:i}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Le(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const n=e.constructor.name,{src:i}=e;return{rr_type:n,src:i}}else if(e instanceof HTMLCanvasElement){const n="HTMLImageElement",i=e.toDataURL();return{rr_type:n,src:i}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Le(e.data,t,r),e.width,e.height]};if(jt(e,t)||typeof e=="object"){const n=e.constructor.name,i=$t(e,t,r);return{rr_type:n,index:i}}}}return e}const Gt=(e,t,r)=>e.map(n=>Le(n,t,r)),jt=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof t[i]=="function").find(i=>e instanceof t[i]);function fn(e,t,r,n){const i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of o)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;const l=he(t.CanvasRenderingContext2D.prototype,a,function(s){return function(...c){return U(this.canvas,r,n,!0)||setTimeout(()=>{const u=Gt(c,t,this);e(this.canvas,{type:pe["2D"],property:a,args:u})},0),s.apply(this,c)}});i.push(l)}catch{const s=ke(t.CanvasRenderingContext2D.prototype,a,{set(c){e(this.canvas,{type:pe["2D"],property:a,args:[c],setter:!0})}});i.push(s)}return()=>{i.forEach(a=>a())}}function hn(e){return e==="experimental-webgl"?"webgl":e}function Vt(e,t,r,n){const i=[];try{const o=he(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(l,...s){if(!U(this,t,r,!0)){const c=hn(l);if("__context"in this||(this.__context=c),n&&["webgl","webgl2"].includes(c))if(s[0]&&typeof s[0]=="object"){const u=s[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[l,...s])}});i.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(o=>o())}}function qt(e,t,r,n,i,o,a){const l=[],s=Object.getOwnPropertyNames(e);for(const c of s)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{if(typeof e[c]!="function")continue;const u=he(e,c,function(p){return function(...m){const f=p.apply(this,m);if($t(f,a,this),"tagName"in this.canvas&&!U(this.canvas,n,i,!0)){const g=Gt(m,a,this),h={type:t,property:c,args:g};r(this.canvas,h)}return f}});l.push(u)}catch{const p=ke(e,c,{set(m){r(this.canvas,{type:t,property:c,args:[m],setter:!0})}});l.push(p)}return l}function pn(e,t,r,n,i){const o=[];return o.push(...qt(t.WebGLRenderingContext.prototype,pe.WebGL,e,r,n,i,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...qt(t.WebGL2RenderingContext.prototype,pe.WebGL2,e,r,n,i,t)),()=>{o.forEach(a=>a())}}function mn(e,t){var r=t===void 0?null:t,n=e.toString(),i=n.split(`
17
17
  `);i.pop(),i.shift();for(var o=i[0].search(/\S/),a=/(['"])__worker_loader_strict__(['"])/g,l=0,s=i.length;l<s;++l)i[l]=i[l].substring(o).replace(a,"$1use strict$2")+`
18
18
  `;return r&&i.push("//# sourceMappingURL="+r+`
19
- `),i}function mn(e,t){var r=pn(e,t),n=new Blob(r,{type:"application/javascript"});return URL.createObjectURL(n)}function gn(e,t){var r;return function(i){return r=r||mn(e,t),new Worker(r,i)}}var yn=gn(function(){(function(){"__worker_loader_strict__";/*! *****************************************************************************
19
+ `),i}function gn(e,t){var r=mn(e,t),n=new Blob(r,{type:"application/javascript"});return URL.createObjectURL(n)}function yn(e,t){var r;return function(i){return r=r||gn(e,t),new Worker(r,i)}}var Sn=yn(function(){(function(){"__worker_loader_strict__";/*! *****************************************************************************
20
20
  Copyright (c) Microsoft Corporation.
21
21
 
22
22
  Permission to use, copy, modify, and/or distribute this software for any
@@ -29,10 +29,10 @@ or you can use record.mirror to access the mirror instance during recording.`;le
29
29
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
30
30
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
31
31
  PERFORMANCE OF THIS SOFTWARE.
32
- ***************************************************************************** */function e(c,u,p,m){function f(g){return g instanceof p?g:new p(function(h){h(g)})}return new(p||(p=Promise))(function(g,h){function y(S){try{v(m.next(S))}catch(b){h(b)}}function w(S){try{v(m.throw(S))}catch(b){h(b)}}function v(S){S.done?g(S.value):f(S.value).then(y,w)}v((m=m.apply(c,u||[])).next())})}for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=typeof Uint8Array>"u"?[]:new Uint8Array(256),n=0;n<t.length;n++)r[t.charCodeAt(n)]=n;var i=function(c){var u=new Uint8Array(c),p,m=u.length,f="";for(p=0;p<m;p+=3)f+=t[u[p]>>2],f+=t[(u[p]&3)<<4|u[p+1]>>4],f+=t[(u[p+1]&15)<<2|u[p+2]>>6],f+=t[u[p+2]&63];return m%3===2?f=f.substring(0,f.length-1)+"=":m%3===1&&(f=f.substring(0,f.length-2)+"=="),f};const o=new Map,a=new Map;function l(c,u,p){return e(this,void 0,void 0,function*(){const m=`${c}-${u}`;if("OffscreenCanvas"in globalThis){if(a.has(m))return a.get(m);const f=new OffscreenCanvas(c,u);f.getContext("2d");const h=yield(yield f.convertToBlob(p)).arrayBuffer(),y=i(h);return a.set(m,y),y}else return""})}const s=self;s.onmessage=function(c){return e(this,void 0,void 0,function*(){if("OffscreenCanvas"in globalThis){const{id:u,bitmap:p,width:m,height:f,dataURLOptions:g}=c.data,h=l(m,f,g),y=new OffscreenCanvas(m,f);y.getContext("2d").drawImage(p,0,0),p.close();const v=yield y.convertToBlob(g),S=v.type,b=yield v.arrayBuffer(),M=i(b);if(!o.has(u)&&(yield h)===M)return o.set(u,M),s.postMessage({id:u});if(o.get(u)===M)return s.postMessage({id:u});s.postMessage({id:u,type:S,base64:M,width:m,height:f}),o.set(u,M)}else return s.postMessage({id:c.data.id})})}})()},null);class Sn{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(s,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(s)||this.pendingCanvasMutations.set(s,[]),this.pendingCanvasMutations.get(s).push(c)};const{sampling:r="all",win:n,blockClass:i,blockSelector:o,recordCanvas:a,dataURLOptions:l}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&r==="all"&&this.initCanvasMutationObserver(n,i,o),a&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,i,o,{dataURLOptions:l})}initCanvasFPSObserver(t,r,n,i,o){const a=Vt(r,n,i,!0),l=new Map,s=new yn;s.onmessage=g=>{const{id:h}=g.data;if(l.set(h,!1),!("base64"in g.data))return;const{base64:y,type:w,width:v,height:S}=g.data;this.mutationCb({id:h,type:pe["2D"],commands:[{property:"clearRect",args:[0,0,v,S]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:y}],type:w}]},0,0]}]})};const c=1e3/t;let u=0,p;const m=()=>{const g=[];return r.document.querySelectorAll("canvas").forEach(h=>{U(h,n,i,!0)||g.push(h)}),g},f=g=>{if(u&&g-u<c){p=requestAnimationFrame(f);return}u=g,m().forEach(h=>an(this,void 0,void 0,function*(){var y;const w=this.mirror.getId(h);if(l.get(w)||h.width===0||h.height===0)return;if(l.set(w,!0),["webgl","webgl2"].includes(h.__context)){const S=h.getContext(h.__context);((y=S?.getContextAttributes())===null||y===void 0?void 0:y.preserveDrawingBuffer)===!1&&S.clear(S.COLOR_BUFFER_BIT)}const v=yield createImageBitmap(h);s.postMessage({id:w,bitmap:v,width:h.width,height:h.height,dataURLOptions:o.dataURLOptions},[v])})),p=requestAnimationFrame(f)};p=requestAnimationFrame(f),this.resetObservers=()=>{a(),cancelAnimationFrame(p)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=Vt(t,r,n,!1),o=dn(this.processMutation.bind(this),t,r,n),a=hn(this.processMutation.bind(this),t,r,n,this.mirror);this.resetObservers=()=>{i(),o(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const i=n.map(a=>sn(a,["type"])),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}}class vn{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new Fr,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;const n={id:r,styleIds:[]},i=[];for(const o of t){let a;this.styleMirror.has(o)?a=this.styleMirror.getId(o):(a=this.styleMirror.add(o),i.push({styleId:a,rules:Array.from(o.rules||CSSRule,(l,s)=>({rule:ft(l),index:s}))})),n.styleIds.push(a)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class bn{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(t,r){const n=this.nodeMap.get(t);return n&&Array.from(n).some(i=>i!==r)}add(t,r){this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function L(e){return Object.assign(Object.assign({},e),{timestamp:Te()})}let D,Pe,Ze,Fe=!1;const q=fr();function Me(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:s="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:p,maskInputOptions:m,slimDOMOptions:f,maskInputFn:g,maskTextFn:h,hooks:y,packFn:w,sampling:v={},dataURLOptions:S={},mousemoveWait:b,recordDOM:M=!0,recordCanvas:F=!1,recordCrossOriginIframes:P=!1,recordAfter:k=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:T=!1,collectFonts:j=!1,inlineImages:V=!1,plugins:x,keepIframeSrcFn:oe=()=>!1,ignoreCSSAttributes:H=new Set([]),errorHandler:ee}=e;zr(ee);const K=P?window.parent===window:!0;let $e=!1;if(!K)try{window.parent.document&&($e=!1)}catch{$e=!0}if(K&&!t)throw new Error("emit function is required");b!==void 0&&v.mousemove===void 0&&(v.mousemove=b),q.reset();const at=p===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:m!==void 0?m:{password:!0},lt=f===!0||f==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:f==="all",headMetaDescKeywords:f==="all"}:f||{};Pr();let rr,ct=0;const nr=I=>{for(const X of x||[])X.eventProcessor&&(I=X.eventProcessor(I));return w&&!$e&&(I=w(I)),I};D=(I,X)=>{var N;if(!((N=re[0])===null||N===void 0)&&N.isFrozen()&&I.type!==_.FullSnapshot&&!(I.type===_.IncrementalSnapshot&&I.data.source===C.Mutation)&&re.forEach(z=>z.unfreeze()),K)t?.(nr(I),X);else if($e){const z={type:"rrweb",event:nr(I),origin:window.location.origin,isCheckout:X};window.parent.postMessage(z,"*")}if(I.type===_.FullSnapshot)rr=I,ct=0;else if(I.type===_.IncrementalSnapshot){if(I.data.source===C.Mutation&&I.data.isAttachIframe)return;ct++;const z=n&&ct>=n,le=r&&I.timestamp-rr.timestamp>r;(z||le)&&Pe(!0)}};const Ge=I=>{D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.Mutation},I)}))},ir=I=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.Scroll},I)})),or=I=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.CanvasMutation},I)})),Wn=I=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.AdoptedStyleSheet},I)})),se=new vn({mutationCb:Ge,adoptedStyleSheetCb:Wn}),ae=new nn({mirror:q,mutationCb:Ge,stylesheetManager:se,recordCrossOriginIframes:P,wrappedEmit:D});for(const I of x||[])I.getMirror&&I.getMirror({nodeMirror:q,crossOriginIframeMirror:ae.crossOriginIframeMirror,crossOriginIframeStyleMirror:ae.crossOriginIframeStyleMirror});const ut=new bn;Ze=new Sn({recordCanvas:F,mutationCb:or,win:window,blockClass:i,blockSelector:o,mirror:q,sampling:v.canvas,dataURLOptions:S});const je=new on({mutationCb:Ge,scrollCb:ir,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:at,dataURLOptions:S,maskTextFn:h,maskInputFn:g,recordCanvas:F,inlineImages:V,sampling:v,slimDOMOptions:lt,iframeManager:ae,stylesheetManager:se,canvasManager:Ze,keepIframeSrcFn:oe,processedNodeManager:ut},mirror:q});Pe=(I=!1)=>{if(!M)return;D(L({type:_.Meta,data:{href:window.location.href,width:Ct(),height:It()}}),I),se.reset(),je.init(),re.forEach(N=>N.lock());const X=Ar(document,{mirror:q,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:at,maskTextFn:h,slimDOM:lt,dataURLOptions:S,recordCanvas:F,inlineImages:V,onSerialize:N=>{xt(N,q)&&ae.addIframe(N),Et(N,q)&&se.trackLinkElement(N),Ye(N)&&je.addShadowRoot(N.shadowRoot,document)},onIframeLoad:(N,z)=>{ae.attachIframe(N,z),je.observeAttachShadow(N)},onStylesheetLoad:(N,z)=>{se.attachLinkElement(N,z)},keepIframeSrcFn:oe});if(!X)return console.warn("Failed to snapshot the document");D(L({type:_.FullSnapshot,data:{node:X,initialOffset:Mt(window)}}),I),re.forEach(N=>N.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&se.adoptStyleSheets(document.adoptedStyleSheets,q.getId(document))};try{const I=[],X=z=>{var le;return O(rn)({mutationCb:Ge,mousemoveCb:(R,dt)=>D(L({type:_.IncrementalSnapshot,data:{source:dt,positions:R}})),mouseInteractionCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.MouseInteraction},R)})),scrollCb:ir,viewportResizeCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.ViewportResize},R)})),inputCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.Input},R)})),mediaInteractionCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.MediaInteraction},R)})),styleSheetRuleCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.StyleSheetRule},R)})),styleDeclarationCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.StyleDeclaration},R)})),canvasMutationCb:or,fontCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.Font},R)})),selectionCb:R=>{D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.Selection},R)}))},customElementCb:R=>{D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.CustomElement},R)}))},blockClass:i,ignoreClass:a,ignoreSelector:l,maskTextClass:s,maskTextSelector:c,maskInputOptions:at,inlineStylesheet:u,sampling:v,recordDOM:M,recordCanvas:F,inlineImages:V,userTriggeredOnInput:T,collectFonts:j,doc:z,maskInputFn:g,maskTextFn:h,keepIframeSrcFn:oe,blockSelector:o,slimDOMOptions:lt,dataURLOptions:S,mirror:q,iframeManager:ae,stylesheetManager:se,shadowDomManager:je,processedNodeManager:ut,canvasManager:Ze,ignoreCSSAttributes:H,plugins:((le=x?.filter(R=>R.observer))===null||le===void 0?void 0:le.map(R=>({observer:R.observer,options:R.options,callback:dt=>D(L({type:_.Plugin,data:{plugin:R.name,payload:dt}}))})))||[]},y)};ae.addLoadListener(z=>{try{I.push(X(z.contentDocument))}catch(le){console.warn(le)}});const N=()=>{Pe(),I.push(X(document)),Fe=!0};return document.readyState==="interactive"||document.readyState==="complete"?N():(I.push(W("DOMContentLoaded",()=>{D(L({type:_.DomContentLoaded,data:{}})),k==="DOMContentLoaded"&&N()})),I.push(W("load",()=>{D(L({type:_.Load,data:{}})),k==="load"&&N()},window))),()=>{I.forEach(z=>z()),ut.destroy(),Fe=!1,$r()}}catch(I){console.warn(I)}}Me.addCustomEvent=(e,t)=>{if(!Fe)throw new Error("please add custom event after start recording");D(L({type:_.Custom,data:{tag:e,payload:t}}))},Me.freezePage=()=>{re.forEach(e=>e.freeze())},Me.takeFullSnapshot=e=>{if(!Fe)throw new Error("please take full snapshot after start recording");Pe(e)},Me.mirror=q;var wn={DEBUG:!1,LIB_VERSION:"2.52.0"},B;if(typeof window>"u"){var Jt={hostname:""};B={navigator:{userAgent:""},document:{location:Jt,referrer:""},screen:{width:0,height:0},location:Jt}}else B=window;var Be=24*60*60*1e3,We=Array.prototype,Mn=Function.prototype,Xt=Object.prototype,ne=We.slice,Ie=Xt.toString,Ue=Xt.hasOwnProperty,Ce=B.console,Oe=B.navigator,G=B.document,He=B.opera,ze=B.screen,ie=Oe.userAgent,et=Mn.bind,Kt=We.forEach,Yt=We.indexOf,Qt=We.map,In=Array.isArray,tt={},d={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},J={log:function(){},warn:function(){},error:function(){},critical:function(){if(!d.isUndefined(Ce)&&Ce){var e=["Mixpanel error:"].concat(d.toArray(arguments));try{Ce.error.apply(Ce,e)}catch{d.each(e,function(r){Ce.error(r)})}}}},rt=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(J,arguments)}},Cn=function(e){return{log:rt(J.log,e),error:rt(J.error,e),critical:rt(J.critical,e)}};d.bind=function(e,t){var r,n;if(et&&e.bind===et)return et.apply(e,ne.call(arguments,1));if(!d.isFunction(e))throw new TypeError;return r=ne.call(arguments,2),n=function(){if(!(this instanceof n))return e.apply(t,r.concat(ne.call(arguments)));var i={};i.prototype=e.prototype;var o=new i;i.prototype=null;var a=e.apply(o,r.concat(ne.call(arguments)));return Object(a)===a?a:o},n},d.each=function(e,t,r){if(e!=null){if(Kt&&e.forEach===Kt)e.forEach(t,r);else if(e.length===+e.length){for(var n=0,i=e.length;n<i;n++)if(n in e&&t.call(r,e[n],n,e)===tt)return}else for(var o in e)if(Ue.call(e,o)&&t.call(r,e[o],o,e)===tt)return}},d.extend=function(e){return d.each(ne.call(arguments,1),function(t){for(var r in t)t[r]!==void 0&&(e[r]=t[r])}),e},d.isArray=In||function(e){return Ie.call(e)==="[object Array]"},d.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch{return!1}},d.isArguments=function(e){return!!(e&&Ue.call(e,"callee"))},d.toArray=function(e){return e?e.toArray?e.toArray():d.isArray(e)||d.isArguments(e)?ne.call(e):d.values(e):[]},d.map=function(e,t,r){if(Qt&&e.map===Qt)return e.map(t,r);var n=[];return d.each(e,function(i){n.push(t.call(r,i))}),n},d.keys=function(e){var t=[];return e===null||d.each(e,function(r,n){t[t.length]=n}),t},d.values=function(e){var t=[];return e===null||d.each(e,function(r){t[t.length]=r}),t},d.include=function(e,t){var r=!1;return e===null?r:Yt&&e.indexOf===Yt?e.indexOf(t)!=-1:(d.each(e,function(n){if(r||(r=n===t))return tt}),r)},d.includes=function(e,t){return e.indexOf(t)!==-1},d.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},d.isObject=function(e){return e===Object(e)&&!d.isArray(e)},d.isEmptyObject=function(e){if(d.isObject(e)){for(var t in e)if(Ue.call(e,t))return!1;return!0}return!1},d.isUndefined=function(e){return e===void 0},d.isString=function(e){return Ie.call(e)=="[object String]"},d.isDate=function(e){return Ie.call(e)=="[object Date]"},d.isNumber=function(e){return Ie.call(e)=="[object Number]"},d.isElement=function(e){return!!(e&&e.nodeType===1)},d.encodeDates=function(e){return d.each(e,function(t,r){d.isDate(t)?e[r]=d.formatDate(t):d.isObject(t)&&(e[r]=d.encodeDates(t))}),e},d.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},d.formatDate=function(e){function t(r){return r<10?"0"+r:r}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},d.strip_empty_properties=function(e){var t={};return d.each(e,function(r,n){d.isString(r)&&r.length>0&&(t[n]=r)}),t},d.truncate=function(e,t){var r;return typeof e=="string"?r=e.slice(0,t):d.isArray(e)?(r=[],d.each(e,function(n){r.push(d.truncate(n,t))})):d.isObject(e)?(r={},d.each(e,function(n,i){r[i]=d.truncate(n,t)})):r=e,r},d.JSONEncode=function(){return function(e){var t=e,r=function(i){var o=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return o.lastIndex=0,o.test(i)?'"'+i.replace(o,function(l){var s=a[l];return typeof s=="string"?s:"\\u"+("0000"+l.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+i+'"'},n=function(i,o){var a="",l=" ",s=0,c="",u="",p=0,m=a,f=[],g=o[i];switch(g&&typeof g=="object"&&typeof g.toJSON=="function"&&(g=g.toJSON(i)),typeof g){case"string":return r(g);case"number":return isFinite(g)?String(g):"null";case"boolean":case"null":return String(g);case"object":if(!g)return"null";if(a+=l,f=[],Ie.apply(g)==="[object Array]"){for(p=g.length,s=0;s<p;s+=1)f[s]=n(s,g)||"null";return u=f.length===0?"[]":a?`[
32
+ ***************************************************************************** */function e(c,u,p,m){function f(g){return g instanceof p?g:new p(function(h){h(g)})}return new(p||(p=Promise))(function(g,h){function y(S){try{v(m.next(S))}catch(b){h(b)}}function w(S){try{v(m.throw(S))}catch(b){h(b)}}function v(S){S.done?g(S.value):f(S.value).then(y,w)}v((m=m.apply(c,u||[])).next())})}for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=typeof Uint8Array>"u"?[]:new Uint8Array(256),n=0;n<t.length;n++)r[t.charCodeAt(n)]=n;var i=function(c){var u=new Uint8Array(c),p,m=u.length,f="";for(p=0;p<m;p+=3)f+=t[u[p]>>2],f+=t[(u[p]&3)<<4|u[p+1]>>4],f+=t[(u[p+1]&15)<<2|u[p+2]>>6],f+=t[u[p+2]&63];return m%3===2?f=f.substring(0,f.length-1)+"=":m%3===1&&(f=f.substring(0,f.length-2)+"=="),f};const o=new Map,a=new Map;function l(c,u,p){return e(this,void 0,void 0,function*(){const m=`${c}-${u}`;if("OffscreenCanvas"in globalThis){if(a.has(m))return a.get(m);const f=new OffscreenCanvas(c,u);f.getContext("2d");const h=yield(yield f.convertToBlob(p)).arrayBuffer(),y=i(h);return a.set(m,y),y}else return""})}const s=self;s.onmessage=function(c){return e(this,void 0,void 0,function*(){if("OffscreenCanvas"in globalThis){const{id:u,bitmap:p,width:m,height:f,dataURLOptions:g}=c.data,h=l(m,f,g),y=new OffscreenCanvas(m,f);y.getContext("2d").drawImage(p,0,0),p.close();const v=yield y.convertToBlob(g),S=v.type,b=yield v.arrayBuffer(),M=i(b);if(!o.has(u)&&(yield h)===M)return o.set(u,M),s.postMessage({id:u});if(o.get(u)===M)return s.postMessage({id:u});s.postMessage({id:u,type:S,base64:M,width:m,height:f}),o.set(u,M)}else return s.postMessage({id:c.data.id})})}})()},null);class vn{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(s,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(s)||this.pendingCanvasMutations.set(s,[]),this.pendingCanvasMutations.get(s).push(c)};const{sampling:r="all",win:n,blockClass:i,blockSelector:o,recordCanvas:a,dataURLOptions:l}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&r==="all"&&this.initCanvasMutationObserver(n,i,o),a&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,i,o,{dataURLOptions:l})}initCanvasFPSObserver(t,r,n,i,o){const a=Vt(r,n,i,!0),l=new Map,s=new Sn;s.onmessage=g=>{const{id:h}=g.data;if(l.set(h,!1),!("base64"in g.data))return;const{base64:y,type:w,width:v,height:S}=g.data;this.mutationCb({id:h,type:pe["2D"],commands:[{property:"clearRect",args:[0,0,v,S]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:y}],type:w}]},0,0]}]})};const c=1e3/t;let u=0,p;const m=()=>{const g=[];return r.document.querySelectorAll("canvas").forEach(h=>{U(h,n,i,!0)||g.push(h)}),g},f=g=>{if(u&&g-u<c){p=requestAnimationFrame(f);return}u=g,m().forEach(h=>ln(this,void 0,void 0,function*(){var y;const w=this.mirror.getId(h);if(l.get(w)||h.width===0||h.height===0)return;if(l.set(w,!0),["webgl","webgl2"].includes(h.__context)){const S=h.getContext(h.__context);((y=S?.getContextAttributes())===null||y===void 0?void 0:y.preserveDrawingBuffer)===!1&&S.clear(S.COLOR_BUFFER_BIT)}const v=yield createImageBitmap(h);s.postMessage({id:w,bitmap:v,width:h.width,height:h.height,dataURLOptions:o.dataURLOptions},[v])})),p=requestAnimationFrame(f)};p=requestAnimationFrame(f),this.resetObservers=()=>{a(),cancelAnimationFrame(p)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=Vt(t,r,n,!1),o=fn(this.processMutation.bind(this),t,r,n),a=pn(this.processMutation.bind(this),t,r,n,this.mirror);this.resetObservers=()=>{i(),o(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const i=n.map(a=>an(a,["type"])),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}}class bn{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new Br,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;const n={id:r,styleIds:[]},i=[];for(const o of t){let a;this.styleMirror.has(o)?a=this.styleMirror.getId(o):(a=this.styleMirror.add(o),i.push({styleId:a,rules:Array.from(o.rules||CSSRule,(l,s)=>({rule:ft(l),index:s}))})),n.styleIds.push(a)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class wn{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(t,r){const n=this.nodeMap.get(t);return n&&Array.from(n).some(i=>i!==r)}add(t,r){this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function L(e){return Object.assign(Object.assign({},e),{timestamp:Te()})}let D,Pe,Ze,Fe=!1;const q=hr();function Me(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:s="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:p,maskInputOptions:m,slimDOMOptions:f,maskInputFn:g,maskTextFn:h,hooks:y,packFn:w,sampling:v={},dataURLOptions:S={},mousemoveWait:b,recordDOM:M=!0,recordCanvas:F=!1,recordCrossOriginIframes:P=!1,recordAfter:k=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:T=!1,collectFonts:j=!1,inlineImages:V=!1,plugins:x,keepIframeSrcFn:oe=()=>!1,ignoreCSSAttributes:H=new Set([]),errorHandler:ee}=e;$r(ee);const K=P?window.parent===window:!0;let $e=!1;if(!K)try{window.parent.document&&($e=!1)}catch{$e=!0}if(K&&!t)throw new Error("emit function is required");b!==void 0&&v.mousemove===void 0&&(v.mousemove=b),q.reset();const at=p===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:m!==void 0?m:{password:!0},lt=f===!0||f==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:f==="all",headMetaDescKeywords:f==="all"}:f||{};Fr();let nr,ct=0;const ir=I=>{for(const X of x||[])X.eventProcessor&&(I=X.eventProcessor(I));return w&&!$e&&(I=w(I)),I};D=(I,X)=>{var N;if(!((N=re[0])===null||N===void 0)&&N.isFrozen()&&I.type!==_.FullSnapshot&&!(I.type===_.IncrementalSnapshot&&I.data.source===C.Mutation)&&re.forEach(z=>z.unfreeze()),K)t?.(ir(I),X);else if($e){const z={type:"rrweb",event:ir(I),origin:window.location.origin,isCheckout:X};window.parent.postMessage(z,"*")}if(I.type===_.FullSnapshot)nr=I,ct=0;else if(I.type===_.IncrementalSnapshot){if(I.data.source===C.Mutation&&I.data.isAttachIframe)return;ct++;const z=n&&ct>=n,le=r&&I.timestamp-nr.timestamp>r;(z||le)&&Pe(!0)}};const Ge=I=>{D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.Mutation},I)}))},or=I=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.Scroll},I)})),sr=I=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.CanvasMutation},I)})),Un=I=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.AdoptedStyleSheet},I)})),se=new bn({mutationCb:Ge,adoptedStyleSheetCb:Un}),ae=new on({mirror:q,mutationCb:Ge,stylesheetManager:se,recordCrossOriginIframes:P,wrappedEmit:D});for(const I of x||[])I.getMirror&&I.getMirror({nodeMirror:q,crossOriginIframeMirror:ae.crossOriginIframeMirror,crossOriginIframeStyleMirror:ae.crossOriginIframeStyleMirror});const ut=new wn;Ze=new vn({recordCanvas:F,mutationCb:sr,win:window,blockClass:i,blockSelector:o,mirror:q,sampling:v.canvas,dataURLOptions:S});const je=new sn({mutationCb:Ge,scrollCb:or,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:at,dataURLOptions:S,maskTextFn:h,maskInputFn:g,recordCanvas:F,inlineImages:V,sampling:v,slimDOMOptions:lt,iframeManager:ae,stylesheetManager:se,canvasManager:Ze,keepIframeSrcFn:oe,processedNodeManager:ut},mirror:q});Pe=(I=!1)=>{if(!M)return;D(L({type:_.Meta,data:{href:window.location.href,width:Ct(),height:It()}}),I),se.reset(),je.init(),re.forEach(N=>N.lock());const X=Lr(document,{mirror:q,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:at,maskTextFn:h,slimDOM:lt,dataURLOptions:S,recordCanvas:F,inlineImages:V,onSerialize:N=>{xt(N,q)&&ae.addIframe(N),Et(N,q)&&se.trackLinkElement(N),Ye(N)&&je.addShadowRoot(N.shadowRoot,document)},onIframeLoad:(N,z)=>{ae.attachIframe(N,z),je.observeAttachShadow(N)},onStylesheetLoad:(N,z)=>{se.attachLinkElement(N,z)},keepIframeSrcFn:oe});if(!X)return console.warn("Failed to snapshot the document");D(L({type:_.FullSnapshot,data:{node:X,initialOffset:Mt(window)}}),I),re.forEach(N=>N.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&se.adoptStyleSheets(document.adoptedStyleSheets,q.getId(document))};try{const I=[],X=z=>{var le;return O(nn)({mutationCb:Ge,mousemoveCb:(R,dt)=>D(L({type:_.IncrementalSnapshot,data:{source:dt,positions:R}})),mouseInteractionCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.MouseInteraction},R)})),scrollCb:or,viewportResizeCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.ViewportResize},R)})),inputCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.Input},R)})),mediaInteractionCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.MediaInteraction},R)})),styleSheetRuleCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.StyleSheetRule},R)})),styleDeclarationCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.StyleDeclaration},R)})),canvasMutationCb:sr,fontCb:R=>D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.Font},R)})),selectionCb:R=>{D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.Selection},R)}))},customElementCb:R=>{D(L({type:_.IncrementalSnapshot,data:Object.assign({source:C.CustomElement},R)}))},blockClass:i,ignoreClass:a,ignoreSelector:l,maskTextClass:s,maskTextSelector:c,maskInputOptions:at,inlineStylesheet:u,sampling:v,recordDOM:M,recordCanvas:F,inlineImages:V,userTriggeredOnInput:T,collectFonts:j,doc:z,maskInputFn:g,maskTextFn:h,keepIframeSrcFn:oe,blockSelector:o,slimDOMOptions:lt,dataURLOptions:S,mirror:q,iframeManager:ae,stylesheetManager:se,shadowDomManager:je,processedNodeManager:ut,canvasManager:Ze,ignoreCSSAttributes:H,plugins:((le=x?.filter(R=>R.observer))===null||le===void 0?void 0:le.map(R=>({observer:R.observer,options:R.options,callback:dt=>D(L({type:_.Plugin,data:{plugin:R.name,payload:dt}}))})))||[]},y)};ae.addLoadListener(z=>{try{I.push(X(z.contentDocument))}catch(le){console.warn(le)}});const N=()=>{Pe(),I.push(X(document)),Fe=!0};return document.readyState==="interactive"||document.readyState==="complete"?N():(I.push(W("DOMContentLoaded",()=>{D(L({type:_.DomContentLoaded,data:{}})),k==="DOMContentLoaded"&&N()})),I.push(W("load",()=>{D(L({type:_.Load,data:{}})),k==="load"&&N()},window))),()=>{I.forEach(z=>z()),ut.destroy(),Fe=!1,Gr()}}catch(I){console.warn(I)}}Me.addCustomEvent=(e,t)=>{if(!Fe)throw new Error("please add custom event after start recording");D(L({type:_.Custom,data:{tag:e,payload:t}}))},Me.freezePage=()=>{re.forEach(e=>e.freeze())},Me.takeFullSnapshot=e=>{if(!Fe)throw new Error("please take full snapshot after start recording");Pe(e)},Me.mirror=q;var Mn={DEBUG:!1,LIB_VERSION:"2.53.0"},B;if(typeof window>"u"){var Jt={hostname:""};B={navigator:{userAgent:""},document:{location:Jt,referrer:""},screen:{width:0,height:0},location:Jt}}else B=window;var Be=24*60*60*1e3,We=Array.prototype,In=Function.prototype,Xt=Object.prototype,ne=We.slice,Ie=Xt.toString,Ue=Xt.hasOwnProperty,Ce=B.console,Oe=B.navigator,G=B.document,He=B.opera,ze=B.screen,ie=Oe.userAgent,et=In.bind,Kt=We.forEach,Yt=We.indexOf,Qt=We.map,Cn=Array.isArray,tt={},d={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},J={log:function(){},warn:function(){},error:function(){},critical:function(){if(!d.isUndefined(Ce)&&Ce){var e=["Mixpanel error:"].concat(d.toArray(arguments));try{Ce.error.apply(Ce,e)}catch{d.each(e,function(r){Ce.error(r)})}}}},rt=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(J,arguments)}},On=function(e){return{log:rt(J.log,e),error:rt(J.error,e),critical:rt(J.critical,e)}};d.bind=function(e,t){var r,n;if(et&&e.bind===et)return et.apply(e,ne.call(arguments,1));if(!d.isFunction(e))throw new TypeError;return r=ne.call(arguments,2),n=function(){if(!(this instanceof n))return e.apply(t,r.concat(ne.call(arguments)));var i={};i.prototype=e.prototype;var o=new i;i.prototype=null;var a=e.apply(o,r.concat(ne.call(arguments)));return Object(a)===a?a:o},n},d.each=function(e,t,r){if(e!=null){if(Kt&&e.forEach===Kt)e.forEach(t,r);else if(e.length===+e.length){for(var n=0,i=e.length;n<i;n++)if(n in e&&t.call(r,e[n],n,e)===tt)return}else for(var o in e)if(Ue.call(e,o)&&t.call(r,e[o],o,e)===tt)return}},d.extend=function(e){return d.each(ne.call(arguments,1),function(t){for(var r in t)t[r]!==void 0&&(e[r]=t[r])}),e},d.isArray=Cn||function(e){return Ie.call(e)==="[object Array]"},d.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch{return!1}},d.isArguments=function(e){return!!(e&&Ue.call(e,"callee"))},d.toArray=function(e){return e?e.toArray?e.toArray():d.isArray(e)||d.isArguments(e)?ne.call(e):d.values(e):[]},d.map=function(e,t,r){if(Qt&&e.map===Qt)return e.map(t,r);var n=[];return d.each(e,function(i){n.push(t.call(r,i))}),n},d.keys=function(e){var t=[];return e===null||d.each(e,function(r,n){t[t.length]=n}),t},d.values=function(e){var t=[];return e===null||d.each(e,function(r){t[t.length]=r}),t},d.include=function(e,t){var r=!1;return e===null?r:Yt&&e.indexOf===Yt?e.indexOf(t)!=-1:(d.each(e,function(n){if(r||(r=n===t))return tt}),r)},d.includes=function(e,t){return e.indexOf(t)!==-1},d.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},d.isObject=function(e){return e===Object(e)&&!d.isArray(e)},d.isEmptyObject=function(e){if(d.isObject(e)){for(var t in e)if(Ue.call(e,t))return!1;return!0}return!1},d.isUndefined=function(e){return e===void 0},d.isString=function(e){return Ie.call(e)=="[object String]"},d.isDate=function(e){return Ie.call(e)=="[object Date]"},d.isNumber=function(e){return Ie.call(e)=="[object Number]"},d.isElement=function(e){return!!(e&&e.nodeType===1)},d.encodeDates=function(e){return d.each(e,function(t,r){d.isDate(t)?e[r]=d.formatDate(t):d.isObject(t)&&(e[r]=d.encodeDates(t))}),e},d.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},d.formatDate=function(e){function t(r){return r<10?"0"+r:r}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},d.strip_empty_properties=function(e){var t={};return d.each(e,function(r,n){d.isString(r)&&r.length>0&&(t[n]=r)}),t},d.truncate=function(e,t){var r;return typeof e=="string"?r=e.slice(0,t):d.isArray(e)?(r=[],d.each(e,function(n){r.push(d.truncate(n,t))})):d.isObject(e)?(r={},d.each(e,function(n,i){r[i]=d.truncate(n,t)})):r=e,r},d.JSONEncode=function(){return function(e){var t=e,r=function(i){var o=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return o.lastIndex=0,o.test(i)?'"'+i.replace(o,function(l){var s=a[l];return typeof s=="string"?s:"\\u"+("0000"+l.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+i+'"'},n=function(i,o){var a="",l=" ",s=0,c="",u="",p=0,m=a,f=[],g=o[i];switch(g&&typeof g=="object"&&typeof g.toJSON=="function"&&(g=g.toJSON(i)),typeof g){case"string":return r(g);case"number":return isFinite(g)?String(g):"null";case"boolean":case"null":return String(g);case"object":if(!g)return"null";if(a+=l,f=[],Ie.apply(g)==="[object Array]"){for(p=g.length,s=0;s<p;s+=1)f[s]=n(s,g)||"null";return u=f.length===0?"[]":a?`[
33
33
  `+a+f.join(`,
34
34
  `+a)+`
35
35
  `+m+"]":"["+f.join(",")+"]",a=m,u}for(c in g)Ue.call(g,c)&&(u=n(c,g),u&&f.push(r(c)+(a?": ":":")+u));return u=f.length===0?"{}":a?"{"+f.join(",")+m+"}":"{"+f.join(",")+"}",a=m,u}};return n("",{"":t})}}(),d.JSONDecode=function(){var e,t,r={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
36
36
  `,r:"\r",t:" "},n,i=function(f){var g=new SyntaxError(f);throw g.at=e,g.text=n,g},o=function(f){return f&&f!==t&&i("Expected '"+f+"' instead of '"+t+"'"),t=n.charAt(e),e+=1,t},a=function(){var f,g="";for(t==="-"&&(g="-",o("-"));t>="0"&&t<="9";)g+=t,o();if(t===".")for(g+=".";o()&&t>="0"&&t<="9";)g+=t;if(t==="e"||t==="E")for(g+=t,o(),(t==="-"||t==="+")&&(g+=t,o());t>="0"&&t<="9";)g+=t,o();if(f=+g,!isFinite(f))i("Bad number");else return f},l=function(){var f,g,h="",y;if(t==='"')for(;o();){if(t==='"')return o(),h;if(t==="\\")if(o(),t==="u"){for(y=0,g=0;g<4&&(f=parseInt(o(),16),!!isFinite(f));g+=1)y=y*16+f;h+=String.fromCharCode(y)}else if(typeof r[t]=="string")h+=r[t];else break;else h+=t}i("Bad string")},s=function(){for(;t&&t<=" ";)o()},c=function(){switch(t){case"t":return o("t"),o("r"),o("u"),o("e"),!0;case"f":return o("f"),o("a"),o("l"),o("s"),o("e"),!1;case"n":return o("n"),o("u"),o("l"),o("l"),null}i('Unexpected "'+t+'"')},u,p=function(){var f=[];if(t==="["){if(o("["),s(),t==="]")return o("]"),f;for(;t;){if(f.push(u()),s(),t==="]")return o("]"),f;o(","),s()}}i("Bad array")},m=function(){var f,g={};if(t==="{"){if(o("{"),s(),t==="}")return o("}"),g;for(;t;){if(f=l(),s(),o(":"),Object.hasOwnProperty.call(g,f)&&i('Duplicate key "'+f+'"'),g[f]=u(),s(),t==="}")return o("}"),g;o(","),s()}}i("Bad object")};return u=function(){switch(s(),t){case"{":return m();case"[":return p();case'"':return l();case"-":return a();default:return t>="0"&&t<="9"?a():c()}},function(f){var g;return n=f,e=0,t=" ",g=u(),s(),t&&i("Syntax error"),g}}(),d.base64Encode=function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r,n,i,o,a,l,s,c,u=0,p=0,m="",f=[];if(!e)return e;e=d.utf8Encode(e);do r=e.charCodeAt(u++),n=e.charCodeAt(u++),i=e.charCodeAt(u++),c=r<<16|n<<8|i,o=c>>18&63,a=c>>12&63,l=c>>6&63,s=c&63,f[p++]=t.charAt(o)+t.charAt(a)+t.charAt(l)+t.charAt(s);while(u<e.length);switch(m=f.join(""),e.length%3){case 1:m=m.slice(0,-2)+"==";break;case 2:m=m.slice(0,-1)+"=";break}return m},d.utf8Encode=function(e){e=(e+"").replace(/\r\n/g,`
37
37
  `).replace(/\r/g,`
38
- `);var t="",r,n,i=0,o;for(r=n=0,i=e.length,o=0;o<i;o++){var a=e.charCodeAt(o),l=null;a<128?n++:a>127&&a<2048?l=String.fromCharCode(a>>6|192,a&63|128):l=String.fromCharCode(a>>12|224,a>>6&63|128,a&63|128),l!==null&&(n>r&&(t+=e.substring(r,n)),t+=l,r=n=o+1)}return n>r&&(t+=e.substring(r,e.length)),t},d.UUID=function(){var e=function(){var n=1*new Date,i;if(B.performance&&B.performance.now)i=B.performance.now();else for(i=0;n==1*new Date;)i++;return n.toString(16)+Math.floor(i).toString(16)},t=function(){return Math.random().toString(16).replace(".","")},r=function(){var n=ie,i,o,a=[],l=0;function s(c,u){var p,m=0;for(p=0;p<u.length;p++)m|=a[p]<<p*8;return c^m}for(i=0;i<n.length;i++)o=n.charCodeAt(i),a.unshift(o&255),a.length>=4&&(l=s(l,a),a=[]);return a.length>0&&(l=s(l,a)),l.toString(16)};return function(){var n=(ze.height*ze.width).toString(16);return e()+"-"+t()+"-"+r()+"-"+n+"-"+e()}}();var Zt=["ahrefsbot","ahrefssiteaudit","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];d.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t<Zt.length;t++)if(e.indexOf(Zt[t])!==-1)return!0;return!1},d.HTTPBuildQuery=function(e,t){var r,n,i=[];return d.isUndefined(t)&&(t="&"),d.each(e,function(o,a){r=encodeURIComponent(o.toString()),n=encodeURIComponent(a),i[i.length]=n+"="+r}),i.join(t)},d.getQueryParam=function(e,t){t=t.replace(/[[]/,"\\[").replace(/[\]]/,"\\]");var r="[\\?&]"+t+"=([^&#]*)",n=new RegExp(r),i=n.exec(e);if(i===null||i&&typeof i[1]!="string"&&i[1].length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch{J.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},d.cookie={get:function(e){for(var t=e+"=",r=G.cookie.split(";"),n=0;n<r.length;n++){for(var i=r[n];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return decodeURIComponent(i.substring(t.length,i.length))}return null},parse:function(e){var t;try{t=d.JSONDecode(d.cookie.get(e))||{}}catch{}return t},set_seconds:function(e,t,r,n,i,o,a){var l="",s="",c="";if(a)l="; domain="+a;else if(n){var u=tr(G.location.hostname);l=u?"; domain=."+u:""}if(r){var p=new Date;p.setTime(p.getTime()+r*1e3),s="; expires="+p.toGMTString()}o&&(i=!0,c="; SameSite=None"),i&&(c+="; secure"),G.cookie=e+"="+encodeURIComponent(t)+s+"; path=/"+l+c},set:function(e,t,r,n,i,o,a){var l="",s="",c="";if(a)l="; domain="+a;else if(n){var u=tr(G.location.hostname);l=u?"; domain=."+u:""}if(r){var p=new Date;p.setTime(p.getTime()+r*24*60*60*1e3),s="; expires="+p.toGMTString()}o&&(i=!0,c="; SameSite=None"),i&&(c+="; secure");var m=e+"="+encodeURIComponent(t)+s+"; path=/"+l+c;return G.cookie=m,m},remove:function(e,t,r){d.cookie.set(e,"",-1,t,!1,!1,r)}};var nt=null,On=function(e,t){if(nt!==null&&!t)return nt;var r=!0;try{e=e||window.localStorage;var n="__mplss_"+er(8),i="xyz";e.setItem(n,i),e.getItem(n)!==i&&(r=!1),e.removeItem(n)}catch{r=!1}return nt=r,r};d.localStorage={is_supported:function(e){var t=On(null,e);return t||J.error("localStorage unsupported; falling back to cookie store"),t},error:function(e){J.error("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(t){d.localStorage.error(t)}return null},parse:function(e){try{return d.JSONDecode(d.localStorage.get(e))||{}}catch{}return null},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){d.localStorage.error(r)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(t){d.localStorage.error(t)}}},d.register_event=function(){var e=function(n,i,o,a,l){if(!n){J.error("No valid element provided to register_event");return}if(n.addEventListener&&!a)n.addEventListener(i,o,!!l);else{var s="on"+i,c=n[s];n[s]=t(n,o,c)}};function t(n,i,o){var a=function(l){if(l=l||r(window.event),!!l){var s=!0,c,u;return d.isFunction(o)&&(c=o(l)),u=i.call(n,l),(c===!1||u===!1)&&(s=!1),s}};return a}function r(n){return n&&(n.preventDefault=r.preventDefault,n.stopPropagation=r.stopPropagation),n}return r.preventDefault=function(){this.returnValue=!1},r.stopPropagation=function(){this.cancelBubble=!0},e}();var _n=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');d.dom_query=function(){function e(i){return i.all?i.all:i.getElementsByTagName("*")}var t=/[\t\r\n]/g;function r(i,o){var a=" "+o+" ";return(" "+i.className+" ").replace(t," ").indexOf(a)>=0}function n(i){if(!G.getElementsByTagName)return[];var o=i.split(" "),a,l,s,c,u,p,m,f,g,h,y=[G];for(p=0;p<o.length;p++){if(a=o[p].replace(/^\s+/,"").replace(/\s+$/,""),a.indexOf("#")>-1){l=a.split("#"),s=l[0];var w=l[1],v=G.getElementById(w);if(!v||s&&v.nodeName.toLowerCase()!=s)return[];y=[v];continue}if(a.indexOf(".")>-1){l=a.split("."),s=l[0];var S=l[1];for(s||(s="*"),c=[],u=0,m=0;m<y.length;m++)for(s=="*"?g=e(y[m]):g=y[m].getElementsByTagName(s),f=0;f<g.length;f++)c[u++]=g[f];for(y=[],h=0,m=0;m<c.length;m++)c[m].className&&d.isString(c[m].className)&&r(c[m],S)&&(y[h++]=c[m]);continue}var b=a.match(_n);if(b){s=b[1];var M=b[2],F=b[3],P=b[4];for(s||(s="*"),c=[],u=0,m=0;m<y.length;m++)for(s=="*"?g=e(y[m]):g=y[m].getElementsByTagName(s),f=0;f<g.length;f++)c[u++]=g[f];y=[],h=0;var k;switch(F){case"=":k=function(T){return T.getAttribute(M)==P};break;case"~":k=function(T){return T.getAttribute(M).match(new RegExp("\\b"+P+"\\b"))};break;case"|":k=function(T){return T.getAttribute(M).match(new RegExp("^"+P+"-?"))};break;case"^":k=function(T){return T.getAttribute(M).indexOf(P)===0};break;case"$":k=function(T){return T.getAttribute(M).lastIndexOf(P)==T.getAttribute(M).length-P.length};break;case"*":k=function(T){return T.getAttribute(M).indexOf(P)>-1};break;default:k=function(T){return T.getAttribute(M)}}for(y=[],h=0,m=0;m<c.length;m++)k(c[m])&&(y[h++]=c[m]);continue}for(s=a,c=[],u=0,m=0;m<y.length;m++)for(g=y[m].getElementsByTagName(s),f=0;f<g.length;f++)c[u++]=g[f];y=c}return y}return function(i){return d.isElement(i)?[i]:d.isObject(i)&&!d.isUndefined(i.length)?i:n.call(this,i)}}();var xn=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],En=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","ttclid","twclid","wbraid"];d.info={campaignParams:function(e){var t="",r={};return d.each(xn,function(n){t=d.getQueryParam(G.URL,n),t.length?r[n]=t:e!==void 0&&(r[n]=e)}),r},clickParams:function(){var e="",t={};return d.each(En,function(r){e=d.getQueryParam(G.URL,r),e.length&&(t[r]=e)}),t},marketingParams:function(){return d.extend(d.info.campaignParams(),d.info.clickParams())},searchEngine:function(e){return e.search("https?://(.*)google.([^/?]*)")===0?"google":e.search("https?://(.*)bing.com")===0?"bing":e.search("https?://(.*)yahoo.com")===0?"yahoo":e.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null},searchInfo:function(e){var t=d.info.searchEngine(e),r=t!="yahoo"?"q":"p",n={};if(t!==null){n.$search_engine=t;var i=d.getQueryParam(e,r);i.length&&(n.mp_keyword=i)}return n},browser:function(e,t,r){return t=t||"",r||d.includes(e," OPR/")?d.includes(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":d.includes(e,"IEMobile")||d.includes(e,"WPDesktop")?"Internet Explorer Mobile":d.includes(e,"SamsungBrowser/")?"Samsung Internet":d.includes(e,"Edge")||d.includes(e,"Edg/")?"Microsoft Edge":d.includes(e,"FBIOS")?"Facebook Mobile":d.includes(e,"Chrome")?"Chrome":d.includes(e,"CriOS")?"Chrome iOS":d.includes(e,"UCWEB")||d.includes(e,"UCBrowser")?"UC Browser":d.includes(e,"FxiOS")?"Firefox iOS":d.includes(t,"Apple")?d.includes(e,"Mobile")?"Mobile Safari":"Safari":d.includes(e,"Android")?"Android Mobile":d.includes(e,"Konqueror")?"Konqueror":d.includes(e,"Firefox")?"Firefox":d.includes(e,"MSIE")||d.includes(e,"Trident/")?"Internet Explorer":d.includes(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,r){var n=d.info.browser(e,t,r),i={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/},o=i[n];if(o===void 0)return null;var a=e.match(o);return a?parseFloat(a[a.length-2]):null},os:function(){var e=ie;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)?"Android":""},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},currentUrl:function(){return B.location.href},properties:function(e){return typeof e!="object"&&(e={}),d.extend(d.strip_empty_properties({$os:d.info.os(),$browser:d.info.browser(ie,Oe.vendor,He),$referrer:G.referrer,$referring_domain:d.info.referringDomain(G.referrer),$device:d.info.device(ie)}),{$current_url:d.info.currentUrl(),$browser_version:d.info.browserVersion(ie,Oe.vendor,He),$screen_height:ze.height,$screen_width:ze.width,mp_lib:"web",$lib_version:wn.LIB_VERSION,$insert_id:er(),time:d.timestamp()/1e3},d.strip_empty_properties(e))},people_properties:function(){return d.extend(d.strip_empty_properties({$os:d.info.os(),$browser:d.info.browser(ie,Oe.vendor,He)}),{$browser_version:d.info.browserVersion(ie,Oe.vendor,He)})},mpPageViewProperties:function(){return d.strip_empty_properties({current_page_title:G.title,current_domain:B.location.hostname,current_url_path:B.location.pathname,current_url_protocol:B.location.protocol,current_url_search:B.location.search})}};var er=function(e){var t=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return e?t.substring(0,e):t},kn=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,Tn=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,tr=function(e){var t=Tn,r=e.split("."),n=r[r.length-1];(n.length>4||n==="com"||n==="org")&&(t=kn);var i=e.match(t);return i?i[0]:""},it=null,ot=null;typeof JSON<"u"&&(it=JSON.stringify,ot=JSON.parse),it=it||d.JSONEncode,ot=ot||d.JSONDecode,d.toArray=d.toArray,d.isObject=d.isObject,d.JSONEncode=d.JSONEncode,d.JSONDecode=d.JSONDecode,d.isBlockedUA=d.isBlockedUA,d.isEmptyObject=d.isEmptyObject,d.info=d.info,d.info.device=d.info.device,d.info.browser=d.info.browser,d.info.browserVersion=d.info.browserVersion,d.info.properties=d.info.properties;var Rn="__mp_opt_in_out_";function Nn(e,t){if(Fn(t))return J.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var r=Pn(e,t)==="0";return r&&J.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),r}function Dn(e){return Bn(e,function(t){return this.get_config(t)})}function An(e){return e=e||{},e.persistenceType==="localStorage"?d.localStorage:d.cookie}function Ln(e,t){return t=t||{},(t.persistencePrefix||Rn)+e}function Pn(e,t){return An(t).get(Ln(e,t))}function Fn(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||B,r=t.navigator||{},n=!1;return d.each([r.doNotTrack,r.msDoNotTrack,t.doNotTrack],function(i){d.includes([!0,1,"1","yes"],i)&&(n=!0)}),n}function Bn(e,t){return function(){var r=!1;try{var n=t.call(this,"token"),i=t.call(this,"ignore_dnt"),o=t.call(this,"opt_out_tracking_persistence_type"),a=t.call(this,"opt_out_tracking_cookie_prefix"),l=t.call(this,"window");n&&(r=Nn(n,{ignoreDnt:i,persistenceType:o,persistencePrefix:a,window:l}))}catch(c){J.error("Unexpected error when checking tracking opt-out status: "+c)}if(!r)return e.apply(this,arguments);var s=arguments[arguments.length-1];typeof s=="function"&&s(0)}}var st=Cn("recorder"),Z=function(e){this._mixpanel=e,this._stopRecording=null,this.recEvents=[],this.seqNo=0,this.replayId=null,this.replayStartTime=null,this.batchStartTime=null,this.replayLengthMs=0,this.sendBatchId=null,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=Be};Z.prototype.get_config=function(e){return this._mixpanel.get_config(e)},Z.prototype.startRecording=function(){if(this._stopRecording!==null){st.log("Recording already in progress, skipping startRecording.");return}this.recordMaxMs=this.get_config("record_max_ms"),this.recordMaxMs>Be&&(this.recordMaxMs=Be,st.critical("record_max_ms cannot be greater than "+Be+"ms. Capping value.")),this.recEvents=[],this.seqNo=0,this.startDate=new Date,this.replayStartTime=this.startDate.getTime(),this.batchStartTime=this.replayStartTime,this.replayId=d.UUID(),this.replayLengthMs=0;var e=d.bind(function(){clearTimeout(this.idleTimeoutId),this.idleTimeoutId=setTimeout(d.bind(function(){st.log("Idle timeout reached, restarting recording."),this.resetRecording()},this),this.get_config("record_idle_timeout_ms"))},this);this._stopRecording=Me({emit:d.bind(function(t){this.recEvents.push(t),this.replayLengthMs=new Date().getTime()-this.replayStartTime,e()},this),maskAllInputs:!0,maskTextSelector:this.get_config("record_mask_text_selector"),blockSelector:this.get_config("record_block_selector"),maskTextClass:this.get_config("record_mask_text_class"),blockClass:this.get_config("record_block_class")}),e(),this.sendBatchId=setInterval(d.bind(this.flushEventsWithOptOut,this),1e4),this.maxTimeoutId=setTimeout(d.bind(this.resetRecording,this),this.recordMaxMs)},Z.prototype.resetRecording=function(){this.stopRecording(),this.startRecording()},Z.prototype.stopRecording=function(){this._stopRecording!==null&&(this._stopRecording(),this._stopRecording=null),this._flushEvents(),this.replayId=null,clearInterval(this.sendBatchId),clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId)},Z.prototype.flushEventsWithOptOut=function(){this._flushEvents(d.bind(this._onOptOut,this))},Z.prototype._onOptOut=function(e){e===0&&(this.recEvents=[],this.stopRecording())},Z.prototype._flushEvents=Dn(function(){var e=this.recEvents.length;if(e>0){var t={distinct_id:String(this._mixpanel.get_distinct_id()),events:this.recEvents,seq:this.seqNo++,batch_start_time:this.batchStartTime/1e3,replay_id:this.replayId,replay_length_ms:this.replayLengthMs,replay_start_time:this.replayStartTime/1e3},r=this._mixpanel.get_property("$device_id");r&&(t.$device_id=r);var n=this._mixpanel.get_property("$user_id");n&&(t.$user_id=n),window.fetch(this.get_config("api_host")+"/"+this.get_config("api_routes").record,{method:"POST",headers:{Authorization:"Basic "+btoa(this.get_config("token")+":"),"Content-Type":"application/json"},body:d.JSONEncode(t)}),this.recEvents=this.recEvents.slice(e),this.batchStartTime=new Date().getTime()}}),window.__mp_recorder=Z})();
38
+ `);var t="",r,n,i=0,o;for(r=n=0,i=e.length,o=0;o<i;o++){var a=e.charCodeAt(o),l=null;a<128?n++:a>127&&a<2048?l=String.fromCharCode(a>>6|192,a&63|128):l=String.fromCharCode(a>>12|224,a>>6&63|128,a&63|128),l!==null&&(n>r&&(t+=e.substring(r,n)),t+=l,r=n=o+1)}return n>r&&(t+=e.substring(r,e.length)),t},d.UUID=function(){var e=function(){var n=1*new Date,i;if(B.performance&&B.performance.now)i=B.performance.now();else for(i=0;n==1*new Date;)i++;return n.toString(16)+Math.floor(i).toString(16)},t=function(){return Math.random().toString(16).replace(".","")},r=function(){var n=ie,i,o,a=[],l=0;function s(c,u){var p,m=0;for(p=0;p<u.length;p++)m|=a[p]<<p*8;return c^m}for(i=0;i<n.length;i++)o=n.charCodeAt(i),a.unshift(o&255),a.length>=4&&(l=s(l,a),a=[]);return a.length>0&&(l=s(l,a)),l.toString(16)};return function(){var n=(ze.height*ze.width).toString(16);return e()+"-"+t()+"-"+r()+"-"+n+"-"+e()}}();var Zt=["ahrefsbot","ahrefssiteaudit","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];d.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t<Zt.length;t++)if(e.indexOf(Zt[t])!==-1)return!0;return!1},d.HTTPBuildQuery=function(e,t){var r,n,i=[];return d.isUndefined(t)&&(t="&"),d.each(e,function(o,a){r=encodeURIComponent(o.toString()),n=encodeURIComponent(a),i[i.length]=n+"="+r}),i.join(t)},d.getQueryParam=function(e,t){t=t.replace(/[[]/,"\\[").replace(/[\]]/,"\\]");var r="[\\?&]"+t+"=([^&#]*)",n=new RegExp(r),i=n.exec(e);if(i===null||i&&typeof i[1]!="string"&&i[1].length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch{J.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},d.cookie={get:function(e){for(var t=e+"=",r=G.cookie.split(";"),n=0;n<r.length;n++){for(var i=r[n];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return decodeURIComponent(i.substring(t.length,i.length))}return null},parse:function(e){var t;try{t=d.JSONDecode(d.cookie.get(e))||{}}catch{}return t},set_seconds:function(e,t,r,n,i,o,a){var l="",s="",c="";if(a)l="; domain="+a;else if(n){var u=tr(G.location.hostname);l=u?"; domain=."+u:""}if(r){var p=new Date;p.setTime(p.getTime()+r*1e3),s="; expires="+p.toGMTString()}o&&(i=!0,c="; SameSite=None"),i&&(c+="; secure"),G.cookie=e+"="+encodeURIComponent(t)+s+"; path=/"+l+c},set:function(e,t,r,n,i,o,a){var l="",s="",c="";if(a)l="; domain="+a;else if(n){var u=tr(G.location.hostname);l=u?"; domain=."+u:""}if(r){var p=new Date;p.setTime(p.getTime()+r*24*60*60*1e3),s="; expires="+p.toGMTString()}o&&(i=!0,c="; SameSite=None"),i&&(c+="; secure");var m=e+"="+encodeURIComponent(t)+s+"; path=/"+l+c;return G.cookie=m,m},remove:function(e,t,r){d.cookie.set(e,"",-1,t,!1,!1,r)}};var nt=null,_n=function(e,t){if(nt!==null&&!t)return nt;var r=!0;try{e=e||window.localStorage;var n="__mplss_"+er(8),i="xyz";e.setItem(n,i),e.getItem(n)!==i&&(r=!1),e.removeItem(n)}catch{r=!1}return nt=r,r};d.localStorage={is_supported:function(e){var t=_n(null,e);return t||J.error("localStorage unsupported; falling back to cookie store"),t},error:function(e){J.error("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(t){d.localStorage.error(t)}return null},parse:function(e){try{return d.JSONDecode(d.localStorage.get(e))||{}}catch{}return null},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){d.localStorage.error(r)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(t){d.localStorage.error(t)}}},d.register_event=function(){var e=function(n,i,o,a,l){if(!n){J.error("No valid element provided to register_event");return}if(n.addEventListener&&!a)n.addEventListener(i,o,!!l);else{var s="on"+i,c=n[s];n[s]=t(n,o,c)}};function t(n,i,o){var a=function(l){if(l=l||r(window.event),!!l){var s=!0,c,u;return d.isFunction(o)&&(c=o(l)),u=i.call(n,l),(c===!1||u===!1)&&(s=!1),s}};return a}function r(n){return n&&(n.preventDefault=r.preventDefault,n.stopPropagation=r.stopPropagation),n}return r.preventDefault=function(){this.returnValue=!1},r.stopPropagation=function(){this.cancelBubble=!0},e}();var xn=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');d.dom_query=function(){function e(i){return i.all?i.all:i.getElementsByTagName("*")}var t=/[\t\r\n]/g;function r(i,o){var a=" "+o+" ";return(" "+i.className+" ").replace(t," ").indexOf(a)>=0}function n(i){if(!G.getElementsByTagName)return[];var o=i.split(" "),a,l,s,c,u,p,m,f,g,h,y=[G];for(p=0;p<o.length;p++){if(a=o[p].replace(/^\s+/,"").replace(/\s+$/,""),a.indexOf("#")>-1){l=a.split("#"),s=l[0];var w=l[1],v=G.getElementById(w);if(!v||s&&v.nodeName.toLowerCase()!=s)return[];y=[v];continue}if(a.indexOf(".")>-1){l=a.split("."),s=l[0];var S=l[1];for(s||(s="*"),c=[],u=0,m=0;m<y.length;m++)for(s=="*"?g=e(y[m]):g=y[m].getElementsByTagName(s),f=0;f<g.length;f++)c[u++]=g[f];for(y=[],h=0,m=0;m<c.length;m++)c[m].className&&d.isString(c[m].className)&&r(c[m],S)&&(y[h++]=c[m]);continue}var b=a.match(xn);if(b){s=b[1];var M=b[2],F=b[3],P=b[4];for(s||(s="*"),c=[],u=0,m=0;m<y.length;m++)for(s=="*"?g=e(y[m]):g=y[m].getElementsByTagName(s),f=0;f<g.length;f++)c[u++]=g[f];y=[],h=0;var k;switch(F){case"=":k=function(T){return T.getAttribute(M)==P};break;case"~":k=function(T){return T.getAttribute(M).match(new RegExp("\\b"+P+"\\b"))};break;case"|":k=function(T){return T.getAttribute(M).match(new RegExp("^"+P+"-?"))};break;case"^":k=function(T){return T.getAttribute(M).indexOf(P)===0};break;case"$":k=function(T){return T.getAttribute(M).lastIndexOf(P)==T.getAttribute(M).length-P.length};break;case"*":k=function(T){return T.getAttribute(M).indexOf(P)>-1};break;default:k=function(T){return T.getAttribute(M)}}for(y=[],h=0,m=0;m<c.length;m++)k(c[m])&&(y[h++]=c[m]);continue}for(s=a,c=[],u=0,m=0;m<y.length;m++)for(g=y[m].getElementsByTagName(s),f=0;f<g.length;f++)c[u++]=g[f];y=c}return y}return function(i){return d.isElement(i)?[i]:d.isObject(i)&&!d.isUndefined(i.length)?i:n.call(this,i)}}();var En=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],kn=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","ttclid","twclid","wbraid"];d.info={campaignParams:function(e){var t="",r={};return d.each(En,function(n){t=d.getQueryParam(G.URL,n),t.length?r[n]=t:e!==void 0&&(r[n]=e)}),r},clickParams:function(){var e="",t={};return d.each(kn,function(r){e=d.getQueryParam(G.URL,r),e.length&&(t[r]=e)}),t},marketingParams:function(){return d.extend(d.info.campaignParams(),d.info.clickParams())},searchEngine:function(e){return e.search("https?://(.*)google.([^/?]*)")===0?"google":e.search("https?://(.*)bing.com")===0?"bing":e.search("https?://(.*)yahoo.com")===0?"yahoo":e.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null},searchInfo:function(e){var t=d.info.searchEngine(e),r=t!="yahoo"?"q":"p",n={};if(t!==null){n.$search_engine=t;var i=d.getQueryParam(e,r);i.length&&(n.mp_keyword=i)}return n},browser:function(e,t,r){return t=t||"",r||d.includes(e," OPR/")?d.includes(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":d.includes(e,"IEMobile")||d.includes(e,"WPDesktop")?"Internet Explorer Mobile":d.includes(e,"SamsungBrowser/")?"Samsung Internet":d.includes(e,"Edge")||d.includes(e,"Edg/")?"Microsoft Edge":d.includes(e,"FBIOS")?"Facebook Mobile":d.includes(e,"Chrome")?"Chrome":d.includes(e,"CriOS")?"Chrome iOS":d.includes(e,"UCWEB")||d.includes(e,"UCBrowser")?"UC Browser":d.includes(e,"FxiOS")?"Firefox iOS":d.includes(t,"Apple")?d.includes(e,"Mobile")?"Mobile Safari":"Safari":d.includes(e,"Android")?"Android Mobile":d.includes(e,"Konqueror")?"Konqueror":d.includes(e,"Firefox")?"Firefox":d.includes(e,"MSIE")||d.includes(e,"Trident/")?"Internet Explorer":d.includes(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,r){var n=d.info.browser(e,t,r),i={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/},o=i[n];if(o===void 0)return null;var a=e.match(o);return a?parseFloat(a[a.length-2]):null},os:function(){var e=ie;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)?"Android":""},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},currentUrl:function(){return B.location.href},properties:function(e){return typeof e!="object"&&(e={}),d.extend(d.strip_empty_properties({$os:d.info.os(),$browser:d.info.browser(ie,Oe.vendor,He),$referrer:G.referrer,$referring_domain:d.info.referringDomain(G.referrer),$device:d.info.device(ie)}),{$current_url:d.info.currentUrl(),$browser_version:d.info.browserVersion(ie,Oe.vendor,He),$screen_height:ze.height,$screen_width:ze.width,mp_lib:"web",$lib_version:Mn.LIB_VERSION,$insert_id:er(),time:d.timestamp()/1e3},d.strip_empty_properties(e))},people_properties:function(){return d.extend(d.strip_empty_properties({$os:d.info.os(),$browser:d.info.browser(ie,Oe.vendor,He)}),{$browser_version:d.info.browserVersion(ie,Oe.vendor,He)})},mpPageViewProperties:function(){return d.strip_empty_properties({current_page_title:G.title,current_domain:B.location.hostname,current_url_path:B.location.pathname,current_url_protocol:B.location.protocol,current_url_search:B.location.search})}};var er=function(e){var t=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return e?t.substring(0,e):t},Tn=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,Rn=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,tr=function(e){var t=Rn,r=e.split("."),n=r[r.length-1];(n.length>4||n==="com"||n==="org")&&(t=Tn);var i=e.match(t);return i?i[0]:""},it=null,ot=null;typeof JSON<"u"&&(it=JSON.stringify,ot=JSON.parse),it=it||d.JSONEncode,ot=ot||d.JSONDecode,d.toArray=d.toArray,d.isObject=d.isObject,d.JSONEncode=d.JSONEncode,d.JSONDecode=d.JSONDecode,d.isBlockedUA=d.isBlockedUA,d.isEmptyObject=d.isEmptyObject,d.info=d.info,d.info.device=d.info.device,d.info.browser=d.info.browser,d.info.browserVersion=d.info.browserVersion,d.info.properties=d.info.properties;var Nn="__mp_opt_in_out_";function Dn(e,t){if(Bn(t))return J.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var r=Fn(e,t)==="0";return r&&J.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),r}function An(e){return Wn(e,function(t){return this.get_config(t)})}function Ln(e){return e=e||{},e.persistenceType==="localStorage"?d.localStorage:d.cookie}function Pn(e,t){return t=t||{},(t.persistencePrefix||Nn)+e}function Fn(e,t){return Ln(t).get(Pn(e,t))}function Bn(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||B,r=t.navigator||{},n=!1;return d.each([r.doNotTrack,r.msDoNotTrack,t.doNotTrack],function(i){d.includes([!0,1,"1","yes"],i)&&(n=!0)}),n}function Wn(e,t){return function(){var r=!1;try{var n=t.call(this,"token"),i=t.call(this,"ignore_dnt"),o=t.call(this,"opt_out_tracking_persistence_type"),a=t.call(this,"opt_out_tracking_cookie_prefix"),l=t.call(this,"window");n&&(r=Dn(n,{ignoreDnt:i,persistenceType:o,persistencePrefix:a,window:l}))}catch(c){J.error("Unexpected error when checking tracking opt-out status: "+c)}if(!r)return e.apply(this,arguments);var s=arguments[arguments.length-1];typeof s=="function"&&s(0)}}var st=On("recorder"),rr=window.CompressionStream,Q=function(e){this._mixpanel=e,this._stopRecording=null,this.recEvents=[],this.seqNo=0,this.replayId=null,this.replayStartTime=null,this.batchStartTime=null,this.replayLengthMs=0,this.sendBatchId=null,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=Be};Q.prototype.get_config=function(e){return this._mixpanel.get_config(e)},Q.prototype.startRecording=function(){if(this._stopRecording!==null){st.log("Recording already in progress, skipping startRecording.");return}this.recordMaxMs=this.get_config("record_max_ms"),this.recordMaxMs>Be&&(this.recordMaxMs=Be,st.critical("record_max_ms cannot be greater than "+Be+"ms. Capping value.")),this.recEvents=[],this.seqNo=0,this.startDate=new Date,this.replayStartTime=this.startDate.getTime(),this.batchStartTime=this.replayStartTime,this.replayId=d.UUID(),this.replayLengthMs=0;var e=d.bind(function(){clearTimeout(this.idleTimeoutId),this.idleTimeoutId=setTimeout(d.bind(function(){st.log("Idle timeout reached, restarting recording."),this.resetRecording()},this),this.get_config("record_idle_timeout_ms"))},this);this._stopRecording=Me({emit:d.bind(function(t){this.recEvents.push(t),this.replayLengthMs=new Date().getTime()-this.replayStartTime,e()},this),maskAllInputs:!0,maskTextSelector:this.get_config("record_mask_text_selector"),blockSelector:this.get_config("record_block_selector"),maskTextClass:this.get_config("record_mask_text_class"),blockClass:this.get_config("record_block_class")}),e(),this.sendBatchId=setInterval(d.bind(this.flushEventsWithOptOut,this),1e4),this.maxTimeoutId=setTimeout(d.bind(this.resetRecording,this),this.recordMaxMs)},Q.prototype.resetRecording=function(){this.stopRecording(),this.startRecording()},Q.prototype.stopRecording=function(){this._stopRecording!==null&&(this._stopRecording(),this._stopRecording=null),this._flushEvents(),this.replayId=null,clearInterval(this.sendBatchId),clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId)},Q.prototype.flushEventsWithOptOut=function(){this._flushEvents(d.bind(this._onOptOut,this))},Q.prototype._onOptOut=function(e){e===0&&(this.recEvents=[],this.stopRecording())},Q.prototype._sendRequest=function(e,t){window.fetch(this.get_config("api_host")+"/"+this.get_config("api_routes").record+"?"+new URLSearchParams(e),{method:"POST",headers:{Authorization:"Basic "+btoa(this.get_config("token")+":"),"Content-Type":"application/octet-stream"},body:t})},Q.prototype._flushEvents=An(function(){var e=this.recEvents.length;if(e>0){var t={distinct_id:String(this._mixpanel.get_distinct_id()),seq:this.seqNo++,batch_start_time:this.batchStartTime/1e3,replay_id:this.replayId,replay_length_ms:this.replayLengthMs,replay_start_time:this.replayStartTime/1e3},r=d.JSONEncode(this.recEvents),n=this._mixpanel.get_property("$device_id");n&&(t.$device_id=n);var i=this._mixpanel.get_property("$user_id");if(i&&(t.$user_id=i),this.recEvents=this.recEvents.slice(e),this.batchStartTime=new Date().getTime(),rr){var o=new Blob([r],{type:"application/json"}).stream(),a=o.pipeThrough(new rr("gzip"));new Response(a).blob().then(d.bind(function(l){t.format="gzip",this._sendRequest(t,l)},this))}else t.format="body",this._sendRequest(t,r)}}),window.__mp_recorder=Q})();
@@ -2,7 +2,7 @@ define((function () { 'use strict';
2
2
 
3
3
  var Config = {
4
4
  DEBUG: false,
5
- LIB_VERSION: '2.52.0'
5
+ LIB_VERSION: '2.53.0'
6
6
  };
7
7
 
8
8
  /* eslint camelcase: "off", eqeqeq: "off" */
@@ -2,7 +2,7 @@
2
2
 
3
3
  var Config = {
4
4
  DEBUG: false,
5
- LIB_VERSION: '2.52.0'
5
+ LIB_VERSION: '2.53.0'
6
6
  };
7
7
 
8
8
  /* eslint camelcase: "off", eqeqeq: "off" */
@@ -3,7 +3,7 @@
3
3
 
4
4
  var Config = {
5
5
  DEBUG: false,
6
- LIB_VERSION: '2.52.0'
6
+ LIB_VERSION: '2.53.0'
7
7
  };
8
8
 
9
9
  /* eslint camelcase: "off", eqeqeq: "off" */
@@ -39,7 +39,7 @@ ma:function(a,b,d){return d||c.i(a," OPR/")?c.i(a,"Mini")?"Opera Mini":"Opera":/
39
39
  c.i(a,"Android")?"Android Mobile":c.i(a,"Konqueror")?"Konqueror":c.i(a,"Firefox")?"Firefox":c.i(a,"MSIE")||c.i(a,"Trident/")?"Internet Explorer":c.i(a,"Gecko")?"Mozilla":""},Ia:function(a,b,d){b={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,
40
40
  Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[c.info.ma(a,b,d)];if(b===l)return r;a=a.match(b);return!a?r:parseFloat(a[a.length-2])},Nb:function(){return/Windows/i.test(z)?/Phone/.test(z)||/WPDesktop/.test(z)?"Windows Phone":"Windows":
41
41
  /(iPhone|iPad|iPod)/.test(z)?"iOS":/Android/.test(z)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(z)?"BlackBerry":/Mac/i.test(z)?"Mac OS X":/Linux/.test(z)?"Linux":/CrOS/.test(z)?"Chrome OS":""},Bb:function(a){return/Windows Phone/i.test(a)||/WPDesktop/.test(a)?"Windows Phone":/iPad/.test(a)?"iPad":/iPod/.test(a)?"iPod Touch":/iPhone/.test(a)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(a)?"BlackBerry":/Android/.test(a)?"Android":""},Sb:function(a){a=a.split("/");return 3<=a.length?a[2]:""},La:function(){return n.location.href},
42
- aa:function(a){"object"!==typeof a&&(a={});return c.extend(c.fa({$os:c.info.Nb(),$browser:c.info.ma(z,I.vendor,Y),$referrer:t.referrer,$referring_domain:c.info.Sb(t.referrer),$device:c.info.Bb(z)}),{$current_url:c.info.La(),$browser_version:c.info.Ia(z,I.vendor,Y),$screen_height:Z.height,$screen_width:Z.width,mp_lib:"web",$lib_version:"2.52.0",$insert_id:ea(),time:c.timestamp()/1E3},c.fa(a))},Sc:function(){return c.extend(c.fa({$os:c.info.Nb(),$browser:c.info.ma(z,I.vendor,Y)}),{$browser_version:c.info.Ia(z,
42
+ aa:function(a){"object"!==typeof a&&(a={});return c.extend(c.fa({$os:c.info.Nb(),$browser:c.info.ma(z,I.vendor,Y),$referrer:t.referrer,$referring_domain:c.info.Sb(t.referrer),$device:c.info.Bb(z)}),{$current_url:c.info.La(),$browser_version:c.info.Ia(z,I.vendor,Y),$screen_height:Z.height,$screen_width:Z.width,mp_lib:"web",$lib_version:"2.53.0",$insert_id:ea(),time:c.timestamp()/1E3},c.fa(a))},Sc:function(){return c.extend(c.fa({$os:c.info.Nb(),$browser:c.info.ma(z,I.vendor,Y)}),{$browser_version:c.info.Ia(z,
43
43
  I.vendor,Y)})},Pc:function(){return c.fa({current_page_title:t.title,current_domain:n.location.hostname,current_url_path:n.location.pathname,current_url_protocol:n.location.protocol,current_url_search:n.location.search})}};var Ga=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,Fa=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,$=r,aa=r;if("undefined"!==typeof JSON)$=JSON.stringify,aa=JSON.parse;$=$||c.ha;aa=aa||c.S;c.toArray=c.O;c.isObject=c.e;c.JSONEncode=c.ha;c.JSONDecode=c.S;c.isBlockedUA=c.Ib;c.isEmptyObject=c.ra;c.info=
44
44
  c.info;c.info.device=c.info.Bb;c.info.browser=c.info.ma;c.info.browserVersion=c.info.Ia;c.info.properties=c.info.aa;E.prototype.oa=function(){};E.prototype.Oa=function(){};E.prototype.Ga=function(){};E.prototype.Ua=function(a){this.Kb=a;return this};E.prototype.o=function(a,b,d,f){var h=this,g=c.Cc(a);if(0===g.length)o.error("The DOM query ("+a+") returned 0 elements");else return c.a(g,function(a){c.Tb(a,this.Ob,function(a){var c={},g=h.oa(d,this),e=h.Kb.c("track_links_timeout");h.Oa(a,this,c);window.setTimeout(h.gc(f,
45
45
  g,c,m),e);h.Kb.o(b,g,h.gc(f,g,c))})},this),m};E.prototype.gc=function(a,b,c,f){var f=f||D,h=this;return function(){if(!c.zc)c.zc=m,a&&a(f,b)===D||h.Ga(b,c,f)}};E.prototype.oa=function(a,b){return"function"===typeof a?a(b):c.extend({},a)};c.Hb(M,E);M.prototype.oa=function(a,b){var c=M.md.oa.apply(this,arguments);if(b.href)c.url=b.href;return c};M.prototype.Oa=function(a,b,c){c.Lb=2===a.which||a.metaKey||a.ctrlKey||"_blank"===b.target;c.href=b.href;c.Lb||a.preventDefault()};M.prototype.Ga=function(a,
@@ -50,7 +50,7 @@ a);d&&d(D)},this),this.ua)};G.prototype.Ec=function(a){var b=this.H.slice(0,a);i
50
50
  c[f];if(e.id&&d[e.id])return this.h("Item not removed from storage"),D}}catch(k){this.h("Error removing items",a),b=D}return b},this);this.Xa.hb(function(){var a=f();b&&b(a)},c.bind(function(a){var c=D;this.h("Error acquiring storage lock",a);if(!U(this.j,m)&&(c=f(),!c))try{this.j.removeItem(this.N)}catch(d){this.h("Error clearing queue",d)}b&&b(c)},this),this.ua)};G.prototype.vd=function(a){this.H=na(this.H,a);this.Xa.hb(c.bind(function(){try{var b=this.da(),b=na(b,a);this.$a(b)}catch(c){this.h("Error updating items",
51
51
  a)}},this),c.bind(function(a){this.h("Error acquiring storage lock",a)},this),this.ua)};G.prototype.da=function(){var a;try{if(a=this.j.getItem(this.N))a=aa(a),c.isArray(a)||(this.h("Invalid storage entry:",a),a=r)}catch(b){this.h("Error retrieving queue",b),a=r}return a||[]};G.prototype.$a=function(a){try{return this.j.setItem(this.N,$(a)),m}catch(b){return this.h("Error saving queue",b),D}};G.prototype.clear=function(){this.H=[];this.j.removeItem(this.N)};var R=ga("batch");C.prototype.Na=function(a,
52
52
  b){this.ba.Na(a,this.pa,b)};C.prototype.start=function(){this.va=D;this.Ja=0;this.flush()};C.prototype.stop=function(){this.va=m;if(this.cb)clearTimeout(this.cb),this.cb=r};C.prototype.clear=function(){this.ba.clear()};C.prototype.Wb=function(){this.D=this.B.batch_size};C.prototype.ea=function(){this.Xb(this.B.batch_flush_interval_ms)};C.prototype.Xb=function(a){this.pa=a;if(!this.va)this.cb=setTimeout(c.bind(this.flush,this),this.pa)};C.prototype.flush=function(a){try{if(this.Vb)R.log("Flush: Request already in progress");
53
- else{var a=a||{},b=this.B.batch_request_timeout_ms,d=(new Date).getTime(),f=this.D,h=this.ba.Ec(f),e=[],v={};c.a(h,function(a){var b=a.payload;this.la&&!a.Rc&&(b=this.la(b));if(b){b.event&&b.properties&&(b.properties=c.extend({},b.properties,{mp_sent_by_lib_version:"2.52.0"}));var d=m,f=a.id;if(f){if(5<(this.G[f]||0))this.h("[dupe] item ID sent too many times, not sending",{item:a,D:h.length,od:this.G[f]}),d=D}else this.h("[dupe] found item with no ID",{item:a});d&&e.push(b)}v[a.id]=b},this);if(1>
53
+ else{var a=a||{},b=this.B.batch_request_timeout_ms,d=(new Date).getTime(),f=this.D,h=this.ba.Ec(f),e=[],v={};c.a(h,function(a){var b=a.payload;this.la&&!a.Rc&&(b=this.la(b));if(b){b.event&&b.properties&&(b.properties=c.extend({},b.properties,{mp_sent_by_lib_version:"2.53.0"}));var d=m,f=a.id;if(f){if(5<(this.G[f]||0))this.h("[dupe] item ID sent too many times, not sending",{item:a,D:h.length,od:this.G[f]}),d=D}else this.h("[dupe] found item with no ID",{item:a});d&&e.push(b)}v[a.id]=b},this);if(1>
54
54
  e.length)this.ea();else{this.Vb=m;var i=c.bind(function(e){this.Vb=D;try{var g=D;if(a.ic)this.ba.vd(v);else if(c.e(e)&&"timeout"===e.error&&(new Date).getTime()-d>=b)this.h("Network timeout; retrying"),this.flush();else if(c.e(e)&&e.R&&(500<=e.R.status||429===e.R.status||"timeout"===e.error)){var i=2*this.pa,k=e.R.responseHeaders;if(k){var j=k["Retry-After"];j&&(i=1E3*parseInt(j,10)||i)}i=Math.min(6E5,i);this.h("Error; retry in "+i+" ms");this.Xb(i)}else if(c.e(e)&&e.R&&413===e.R.status)if(1<h.length){var p=
55
55
  Math.max(1,Math.floor(f/2));this.D=Math.min(this.D,p,h.length-1);this.h("413 response; reducing batch size to "+this.D);this.ea()}else this.h("Single-event request too large; dropping",h),this.Wb(),g=m;else g=m;g&&(this.ba.Tc(c.map(h,function(a){return a.id}),c.bind(function(a){a?(this.Ja=0,this.flush()):(this.h("Failed to remove items from queue"),5<++this.Ja?(this.h("Too many queue failures; disabling batching system."),this.jd()):this.ea())},this)),c.a(h,c.bind(function(a){var b=a.id;b?(this.G[b]=
56
56
  this.G[b]||0,this.G[b]++,5<this.G[b]&&this.h("[dupe] item ID sent too many times",{item:a,D:h.length,od:this.G[b]})):this.h("[dupe] found item with no ID while removing",{item:a})},this)))}catch(n){this.h("Error handling API response",n),this.ea()}},this),k={method:"POST",mc:m,Jc:m,fc:b};if(a.ic)k.fb="sendBeacon";R.log("MIXPANEL REQUEST:",e);this.Zc(e,k,i)}}}catch(j){this.h("Error flushing request queue",j),this.ea()}};C.prototype.h=function(a,b){R.error.apply(R.error,arguments);if(this.J)try{b instanceof
@@ -6,7 +6,7 @@
6
6
 
7
7
  var Config = {
8
8
  DEBUG: false,
9
- LIB_VERSION: '2.52.0'
9
+ LIB_VERSION: '2.53.0'
10
10
  };
11
11
 
12
12
  /* eslint camelcase: "off", eqeqeq: "off" */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mixpanel-browser",
3
- "version": "2.52.0",
3
+ "version": "2.53.0",
4
4
  "description": "The official Mixpanel JavaScript browser client library",
5
5
  "main": "dist/mixpanel.cjs.js",
6
6
  "directories": {
package/src/config.js CHANGED
@@ -1,6 +1,6 @@
1
1
  var Config = {
2
2
  DEBUG: false,
3
- LIB_VERSION: '2.52.0'
3
+ LIB_VERSION: '2.53.0'
4
4
  };
5
5
 
6
6
  export default Config;
@@ -37,6 +37,8 @@ import './mixpanel-jslib-snippet';
37
37
  'reset',
38
38
  'set_config',
39
39
  'set_group',
40
+ 'start_session_recording',
41
+ 'stop_session_recording',
40
42
  'time_event',
41
43
  'track',
42
44
  'track_forms',
@@ -4,6 +4,7 @@ import { MAX_RECORDING_MS, console_with_prefix, _ } from '../utils'; // eslint-d
4
4
  import { addOptOutCheckMixpanelLib } from '../gdpr-utils';
5
5
 
6
6
  var logger = console_with_prefix('recorder');
7
+ var CompressionStream = window['CompressionStream'];
7
8
 
8
9
  var MixpanelRecorder = function(mixpanelInstance) {
9
10
  this._mixpanel = mixpanelInstance;
@@ -113,6 +114,17 @@ MixpanelRecorder.prototype._onOptOut = function (code) {
113
114
  }
114
115
  };
115
116
 
117
+ MixpanelRecorder.prototype._sendRequest = function(reqParams, reqBody) {
118
+ window['fetch'](this.get_config('api_host') + '/' + this.get_config('api_routes')['record'] + '?' + new URLSearchParams(reqParams), {
119
+ 'method': 'POST',
120
+ 'headers': {
121
+ 'Authorization': 'Basic ' + btoa(this.get_config('token') + ':'),
122
+ 'Content-Type': 'application/octet-stream'
123
+ },
124
+ 'body': reqBody
125
+ });
126
+ };
127
+
116
128
  /**
117
129
  * @api private
118
130
  * Private method, flushes the current batch of events to the server.
@@ -120,36 +132,41 @@ MixpanelRecorder.prototype._onOptOut = function (code) {
120
132
  MixpanelRecorder.prototype._flushEvents = addOptOutCheckMixpanelLib(function() {
121
133
  var numEvents = this.recEvents.length;
122
134
  if (numEvents > 0) {
123
- var reqBody = {
135
+ var reqParams = {
124
136
  'distinct_id': String(this._mixpanel.get_distinct_id()),
125
- 'events': this.recEvents,
126
137
  'seq': this.seqNo++,
127
138
  'batch_start_time': this.batchStartTime / 1000,
128
139
  'replay_id': this.replayId,
129
140
  'replay_length_ms': this.replayLengthMs,
130
141
  'replay_start_time': this.replayStartTime / 1000
131
142
  };
143
+ var eventsJson = _.JSONEncode(this.recEvents);
132
144
 
133
145
  // send ID management props if they exist
134
146
  var deviceId = this._mixpanel.get_property('$device_id');
135
147
  if (deviceId) {
136
- reqBody['$device_id'] = deviceId;
148
+ reqParams['$device_id'] = deviceId;
137
149
  }
138
150
  var userId = this._mixpanel.get_property('$user_id');
139
151
  if (userId) {
140
- reqBody['$user_id'] = userId;
152
+ reqParams['$user_id'] = userId;
141
153
  }
142
154
 
143
- window['fetch'](this.get_config('api_host') + '/' + this.get_config('api_routes')['record'], {
144
- 'method': 'POST',
145
- 'headers': {
146
- 'Authorization': 'Basic ' + btoa(this.get_config('token') + ':'),
147
- 'Content-Type': 'application/json'
148
- },
149
- 'body': _.JSONEncode(reqBody)
150
- });
151
155
  this.recEvents = this.recEvents.slice(numEvents);
152
156
  this.batchStartTime = new Date().getTime();
157
+ if (CompressionStream) {
158
+ var jsonStream = new Blob([eventsJson], {type: 'application/json'}).stream();
159
+ var gzipStream = jsonStream.pipeThrough(new CompressionStream('gzip'));
160
+ new Response(gzipStream)
161
+ .blob()
162
+ .then(_.bind(function(compressedBlob) {
163
+ reqParams['format'] = 'gzip';
164
+ this._sendRequest(reqParams, compressedBlob);
165
+ }, this));
166
+ } else {
167
+ reqParams['format'] = 'body';
168
+ this._sendRequest(reqParams, eventsJson);
169
+ }
153
170
  }
154
171
  });
155
172