mixpanel-browser 2.50.0 → 2.52.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.
@@ -1,6 +1,6 @@
1
- (function(){"use strict";var B;(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"})(B||(B={}));function qt(e){return e.nodeType===e.ELEMENT_NODE}function Se(e){var t=e?.host;return t?.shadowRoot===e}function be(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function jt(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 Pe(e){try{var t=e.rules||e.cssRules;return t?jt(Array.from(t).map(ot).join("")):null}catch{return null}}function ot(e){var t=e.cssText;if($t(e))try{t=Pe(e.styleSheet)||t}catch{}return t}function $t(e){return"styleSheet"in e}var at=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(i){return r.removeNodeFromMap(i)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){var n=this.getNode(t);if(n){var i=this.nodeMetaMap.get(n);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function er(){return new at}function ze(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,i=e.value,o=e.maskInputFn,s=i||"";return(t[r.toLowerCase()]||t[n])&&(o?s=o(s):s="*".repeat(s.length)),s}var st="__rrweb_original__";function tr(e){var t=e.getContext("2d");if(!t)return!0;for(var r=50,n=0;n<e.width;n+=r)for(var i=0;i<e.height;i+=r){var o=t.getImageData,s=st in o?o[st]:o,a=new Uint32Array(s.call(t,n,i,Math.min(r,e.width-n),Math.min(r,e.height-i)).data.buffer);if(a.some(function(l){return l!==0}))return!1}return!0}var rr=1,nr=new RegExp("[^a-z0-9-_:]"),Ae=-2;function lt(){return rr++}function ir(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return nr.test(t)?"div":t}function or(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function ar(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var he,ct,sr=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,lr=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,cr=/^(data:)([^,]*),(.*)/i;function Ee(e,t){return(e||"").replace(sr,function(r,n,i,o,s,a){var l=i||s||a,c=n||o||"";if(!l)return r;if(!lr.test(l)||cr.test(l))return"url(".concat(c).concat(l).concat(c,")");if(l[0]==="/")return"url(".concat(c).concat(ar(t)+l).concat(c,")");var f=t.split("/"),h=l.split("/");f.pop();for(var g=0,p=h;g<p.length;g++){var d=p[g];d!=="."&&(d===".."?f.pop():f.push(d))}return"url(".concat(c).concat(f.join("/")).concat(c,")")})}var ur=/^[^ \t\n\r\u000c]+/,dr=/^[, \t\n\r\u000c]+/;function fr(e,t){if(t.trim()==="")return t;var r=0;function n(c){var f,h=c.exec(t.substring(r));return h?(f=h[0],r+=f.length,f):""}for(var i=[];n(dr),!(r>=t.length);){var o=n(ur);if(o.slice(-1)===",")o=ge(e,o.substring(0,o.length-1)),i.push(o);else{var s="";o=ge(e,o);for(var a=!1;;){var l=t.charAt(r);if(l===""){i.push((o+s).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){r+=1,i.push((o+s).trim());break}else l==="("&&(a=!0);s+=l,r+=1}}}return i.join(", ")}function ge(e,t){if(!t||t.trim()==="")return t;var r=e.createElement("a");return r.href=t,r.href}function hr(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Je(){var e=document.createElement("a");return e.href="",e.href}function ut(e,t,r,n){return r==="src"||r==="href"&&n&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n&&n[0]!=="#"||r==="background"&&n&&(t==="table"||t==="td"||t==="th")?ge(e,n):r==="srcset"&&n?fr(e,n):r==="style"&&n?Ee(n,Je()):t==="object"&&r==="data"&&n?ge(e,n):n}function gr(e,t,r){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var i=e.classList[n];if(t.test(i))return!0}return r?e.matches(r):!1}function xe(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?xe(e.parentNode,t,r):!1;for(var n=e.classList.length;n--;){var i=e.classList[n];if(t.test(i))return!0}return r?xe(e.parentNode,t,r):!1}function dt(e,t,r){var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(n===null)return!1;if(typeof t=="string"){if(n.classList.contains(t)||n.closest(".".concat(t)))return!0}else if(xe(n,t,!0))return!0;return!!(r&&(n.matches(r)||n.closest(r)))}function pr(e,t,r){var n=e.contentWindow;if(n){var i=!1,o;try{o=n.document.readyState}catch{return}if(o!=="complete"){var s=setTimeout(function(){i||(t(),i=!0)},r);e.addEventListener("load",function(){clearTimeout(s),i=!0,t()});return}var 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 mr(e,t,r){var n=!1,i;try{i=e.sheet}catch{return}if(!i){var o=setTimeout(function(){n||(t(),n=!0)},r);e.addEventListener("load",function(){clearTimeout(o),n=!0,t()})}}function Ir(e,t){var r=t.doc,n=t.mirror,i=t.blockClass,o=t.blockSelector,s=t.maskTextClass,a=t.maskTextSelector,l=t.inlineStylesheet,c=t.maskInputOptions,f=c===void 0?{}:c,h=t.maskTextFn,g=t.maskInputFn,p=t.dataURLOptions,d=p===void 0?{}:p,C=t.inlineImages,y=t.recordCanvas,v=t.keepIframeSrcFn,m=t.newlyAddedElement,I=m===void 0?!1:m,b=Cr(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:B.Document,childNodes:[],compatMode:e.compatMode}:{type:B.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:B.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:b};case e.ELEMENT_NODE:return vr(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:l,maskInputOptions:f,maskInputFn:g,dataURLOptions:d,inlineImages:C,recordCanvas:y,keepIframeSrcFn:v,newlyAddedElement:I,rootId:b});case e.TEXT_NODE:return yr(e,{maskTextClass:s,maskTextSelector:a,maskTextFn:h,rootId:b});case e.CDATA_SECTION_NODE:return{type:B.CDATA,textContent:"",rootId:b};case e.COMMENT_NODE:return{type:B.Comment,textContent:e.textContent||"",rootId:b};default:return!1}}function Cr(e,t){if(t.hasNode(e)){var r=t.getId(e);return r===1?void 0:r}}function yr(e,t){var r,n=t.maskTextClass,i=t.maskTextSelector,o=t.maskTextFn,s=t.rootId,a=e.parentNode&&e.parentNode.tagName,l=e.textContent,c=a==="STYLE"?!0:void 0,f=a==="SCRIPT"?!0:void 0;if(c&&l){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(l=or(e.parentNode.sheet))}catch(h){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(h),e)}l=Ee(l,Je())}return f&&(l="SCRIPT_PLACEHOLDER"),!c&&!f&&l&&dt(e,n,i)&&(l=o?o(l):l.replace(/[\S]/g,"*")),{type:B.Text,textContent:l||"",isStyle:c,rootId:s}}function vr(e,t){for(var r=t.doc,n=t.blockClass,i=t.blockSelector,o=t.inlineStylesheet,s=t.maskInputOptions,a=s===void 0?{}:s,l=t.maskInputFn,c=t.dataURLOptions,f=c===void 0?{}:c,h=t.inlineImages,g=t.recordCanvas,p=t.keepIframeSrcFn,d=t.newlyAddedElement,C=d===void 0?!1:d,y=t.rootId,v=gr(e,n,i),m=ir(e),I={},b=e.attributes.length,R=0;R<b;R++){var D=e.attributes[R];I[D.name]=ut(r,m,D.name,D.value)}if(m==="link"&&o){var N=Array.from(r.styleSheets).find(function(Q){return Q.href===e.href}),A=null;N&&(A=Pe(N)),A&&(delete I.rel,delete I.href,I._cssText=Ee(A,N.href))}if(m==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var A=Pe(e.sheet);A&&(I._cssText=Ee(A,Je()))}if(m==="input"||m==="textarea"||m==="select"){var T=e.value,H=e.checked;I.type!=="radio"&&I.type!=="checkbox"&&I.type!=="submit"&&I.type!=="button"&&T?I.value=ze({type:I.type,tagName:m,value:T,maskInputOptions:a,maskInputFn:l}):H&&(I.checked=H)}if(m==="option"&&(e.selected&&!a.select?I.selected=!0:delete I.selected),m==="canvas"&&g){if(e.__context==="2d")tr(e)||(I.rr_dataURL=e.toDataURL(f.type,f.quality));else if(!("__context"in e)){var q=e.toDataURL(f.type,f.quality),j=document.createElement("canvas");j.width=e.width,j.height=e.height;var $=j.toDataURL(f.type,f.quality);q!==$&&(I.rr_dataURL=q)}}if(m==="img"&&h){he||(he=r.createElement("canvas"),ct=he.getContext("2d"));var L=e,Y=L.crossOrigin;L.crossOrigin="anonymous";var re=function(){try{he.width=L.naturalWidth,he.height=L.naturalHeight,ct.drawImage(L,0,0),I.rr_dataURL=he.toDataURL(f.type,f.quality)}catch(Q){console.warn("Cannot inline img src=".concat(L.currentSrc,"! Error: ").concat(Q))}Y?I.crossOrigin=Y:L.removeAttribute("crossorigin")};L.complete&&L.naturalWidth!==0?re():L.onload=re}if((m==="audio"||m==="video")&&(I.rr_mediaState=e.paused?"paused":"played",I.rr_mediaCurrentTime=e.currentTime),C||(e.scrollLeft&&(I.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(I.rr_scrollTop=e.scrollTop)),v){var ie=e.getBoundingClientRect(),ae=ie.width,K=ie.height;I={class:I.class,rr_width:"".concat(ae,"px"),rr_height:"".concat(K,"px")}}return m==="iframe"&&!p(I.src)&&(e.contentDocument||(I.rr_src=I.src),delete I.src),{type:B.Element,tagName:m,attributes:I,childNodes:[],isSVG:hr(e)||void 0,needBlock:v,rootId:y}}function O(e){return e===void 0?"":e.toLowerCase()}function Sr(e,t){if(t.comment&&e.type===B.Comment)return!0;if(e.type===B.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(O(e.attributes.name).match(/^msapplication-tile(image|color)$/)||O(e.attributes.name)==="application-name"||O(e.attributes.rel)==="icon"||O(e.attributes.rel)==="apple-touch-icon"||O(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&O(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(O(e.attributes.property).match(/^(og|twitter|fb):/)||O(e.attributes.name).match(/^(og|twitter):/)||O(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(O(e.attributes.name)==="robots"||O(e.attributes.name)==="googlebot"||O(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(O(e.attributes.name)==="author"||O(e.attributes.name)==="generator"||O(e.attributes.name)==="framework"||O(e.attributes.name)==="publisher"||O(e.attributes.name)==="progid"||O(e.attributes.property).match(/^article:/)||O(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(O(e.attributes.name)==="google-site-verification"||O(e.attributes.name)==="yandex-verification"||O(e.attributes.name)==="csrf-token"||O(e.attributes.name)==="p:domain_verify"||O(e.attributes.name)==="verify-v1"||O(e.attributes.name)==="verification"||O(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function pe(e,t){var r=t.doc,n=t.mirror,i=t.blockClass,o=t.blockSelector,s=t.maskTextClass,a=t.maskTextSelector,l=t.skipChild,c=l===void 0?!1:l,f=t.inlineStylesheet,h=f===void 0?!0:f,g=t.maskInputOptions,p=g===void 0?{}:g,d=t.maskTextFn,C=t.maskInputFn,y=t.slimDOMOptions,v=t.dataURLOptions,m=v===void 0?{}:v,I=t.inlineImages,b=I===void 0?!1:I,R=t.recordCanvas,D=R===void 0?!1:R,N=t.onSerialize,A=t.onIframeLoad,T=t.iframeLoadTimeout,H=T===void 0?5e3:T,q=t.onStylesheetLoad,j=t.stylesheetLoadTimeout,$=j===void 0?5e3:j,L=t.keepIframeSrcFn,Y=L===void 0?function(){return!1}:L,re=t.newlyAddedElement,ie=re===void 0?!1:re,ae=t.preserveWhiteSpace,K=ae===void 0?!0:ae,Q=Ir(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,inlineStylesheet:h,maskInputOptions:p,maskTextFn:d,maskInputFn:C,dataURLOptions:m,inlineImages:b,recordCanvas:D,keepIframeSrcFn:Y,newlyAddedElement:ie});if(!Q)return console.warn(e,"not serialized"),null;var ce;n.hasNode(e)?ce=n.getId(e):Sr(Q,y)||!K&&Q.type===B.Text&&!Q.isStyle&&!Q.textContent.replace(/^\s+|\s+$/gm,"").length?ce=Ae:ce=lt();var _=Object.assign(Q,{id:ce});if(n.add(e,_),ce===Ae)return null;N&&N(e);var ne=!c;if(_.type===B.Element){ne=ne&&!_.needBlock,delete _.needBlock;var oe=e.shadowRoot;oe&&be(oe)&&(_.isShadowHost=!0)}if((_.type===B.Document||_.type===B.Element)&&ne){y.headWhitespace&&_.type===B.Element&&_.tagName==="head"&&(K=!1);for(var ve={doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:c,inlineStylesheet:h,maskInputOptions:p,maskTextFn:d,maskInputFn:C,slimDOMOptions:y,dataURLOptions:m,inlineImages:b,recordCanvas:D,preserveWhiteSpace:K,onSerialize:N,onIframeLoad:A,iframeLoadTimeout:H,onStylesheetLoad:q,stylesheetLoadTimeout:$,keepIframeSrcFn:Y},S=0,Z=Array.from(e.childNodes);S<Z.length;S++){var P=Z[S],E=pe(P,ve);E&&_.childNodes.push(E)}if(qt(e)&&e.shadowRoot)for(var X=0,M=Array.from(e.shadowRoot.childNodes);X<M.length;X++){var P=M[X],E=pe(P,ve);E&&(be(e.shadowRoot)&&(E.isShadow=!0),_.childNodes.push(E))}}return e.parentNode&&Se(e.parentNode)&&be(e.parentNode)&&(_.isShadow=!0),_.type===B.Element&&_.tagName==="iframe"&&pr(e,function(){var z=e.contentDocument;if(z&&A){var Re=pe(z,{doc:z,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:h,maskInputOptions:p,maskTextFn:d,maskInputFn:C,slimDOMOptions:y,dataURLOptions:m,inlineImages:b,recordCanvas:D,preserveWhiteSpace:K,onSerialize:N,onIframeLoad:A,iframeLoadTimeout:H,onStylesheetLoad:q,stylesheetLoadTimeout:$,keepIframeSrcFn:Y});Re&&A(e,Re)}},H),_.type===B.Element&&_.tagName==="link"&&_.attributes.rel==="stylesheet"&&mr(e,function(){if(q){var z=pe(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:h,maskInputOptions:p,maskTextFn:d,maskInputFn:C,slimDOMOptions:y,dataURLOptions:m,inlineImages:b,recordCanvas:D,preserveWhiteSpace:K,onSerialize:N,onIframeLoad:A,iframeLoadTimeout:H,onStylesheetLoad:q,stylesheetLoadTimeout:$,keepIframeSrcFn:Y});z&&q(e,z)}},$),_}function br(e,t){var r=t||{},n=r.mirror,i=n===void 0?new at:n,o=r.blockClass,s=o===void 0?"rr-block":o,a=r.blockSelector,l=a===void 0?null:a,c=r.maskTextClass,f=c===void 0?"rr-mask":c,h=r.maskTextSelector,g=h===void 0?null:h,p=r.inlineStylesheet,d=p===void 0?!0:p,C=r.inlineImages,y=C===void 0?!1:C,v=r.recordCanvas,m=v===void 0?!1:v,I=r.maskAllInputs,b=I===void 0?!1:I,R=r.maskTextFn,D=r.maskInputFn,N=r.slimDOM,A=N===void 0?!1:N,T=r.dataURLOptions,H=r.preserveWhiteSpace,q=r.onSerialize,j=r.onIframeLoad,$=r.iframeLoadTimeout,L=r.onStylesheetLoad,Y=r.stylesheetLoadTimeout,re=r.keepIframeSrcFn,ie=re===void 0?function(){return!1}:re,ae=b===!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}:b===!1?{password:!0}:b,K=A===!0||A==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:A==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:A===!1?{}:A;return pe(e,{doc:e,mirror:i,blockClass:s,blockSelector:l,maskTextClass:f,maskTextSelector:g,skipChild:!1,inlineStylesheet:d,maskInputOptions:ae,maskTextFn:R,maskInputFn:D,slimDOMOptions:K,dataURLOptions:T,inlineImages:y,recordCanvas:m,preserveWhiteSpace:H,onSerialize:q,onIframeLoad:j,iframeLoadTimeout:$,onStylesheetLoad:L,stylesheetLoadTimeout:Y,keepIframeSrcFn:ie,newlyAddedElement:!1})}function U(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const me=`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 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
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 ft={map:{},getId(){return console.error(me),-1},getNode(){return console.error(me),null},removeNodeFromMap(){console.error(me)},has(){return console.error(me),!1},reset(){console.error(me)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(ft=new Proxy(ft,{get(e,t,r){return t==="map"&&console.error(me),Reflect.get(e,t,r)}}));function we(e,t,r={}){let n=null,i=0;return function(...o){const s=Date.now();!i&&r.leading===!1&&(i=s);const a=t-(s-i),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),i=s,e.apply(l,o)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{i=r.leading===!1?0:Date.now(),n=null,e.apply(l,o)},a))}}function _e(e,t,r,n,i=window){const o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(s){setTimeout(()=>{r.set.call(this,s)},0),o&&o.set&&o.set.call(this,s)}}),()=>_e(e,t,o||{},!0)}function Ie(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()=>{}}}function ht(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function gt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function G(e,t,r,n){if(!e)return!1;const i=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!i)return!1;if(typeof t=="string"){if(i.classList.contains(t)||n&&i.closest("."+t)!==null)return!0}else if(xe(i,t,n))return!0;return!!(r&&(e.matches(r)||n&&i.closest(r)!==null))}function Ar(e,t){return t.getId(e)!==-1}function He(e,t){return t.getId(e)===Ae}function pt(e,t){if(Se(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?pt(e.parentNode,t):!0:!0}function mt(e){return!!e.changedTouches}function wr(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 It(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Ct(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function yt(e){return!!e?.shadowRoot}class kr{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++}}var k=(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))(k||{}),w=(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))(w||{}),Ye=(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))(Ye||{}),Ce=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Ce||{});function vt(e){return"__ln"in e}class Mr{constructor(){this.length=0,this.head=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&&vt(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&&vt(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;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.head=r.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}}const St=(e,t)=>`${e}@${t}`;class Tr{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],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 Mr,n=a=>{let l=a,c=Ae;for(;c===Ae;)l=l&&l.nextSibling,c=l&&this.mirror.getId(l);return c},i=a=>{var l,c,f,h;let g=null;((c=(l=a.getRootNode)===null||l===void 0?void 0:l.call(a))===null||c===void 0?void 0:c.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&a.getRootNode().host&&(g=a.getRootNode().host);let p=g;for(;((h=(f=p?.getRootNode)===null||f===void 0?void 0:f.call(p))===null||h===void 0?void 0:h.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&p.getRootNode().host;)p=p.getRootNode().host;const d=!this.doc.contains(a)&&(!p||!this.doc.contains(p));if(!a.parentNode||d)return;const C=Se(a.parentNode)?this.mirror.getId(g):this.mirror.getId(a.parentNode),y=n(a);if(C===-1||y===-1)return r.addNode(a);const v=pe(a,{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=>{It(m,this.mirror)&&this.iframeManager.addIframe(m),Ct(m,this.mirror)&&this.stylesheetManager.trackLinkElement(m),yt(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,this.doc)},onIframeLoad:(m,I)=>{this.iframeManager.attachIframe(m,I),this.shadowDomManager.observeAttachShadow(m)},onStylesheetLoad:(m,I)=>{this.stylesheetManager.attachLinkElement(m,I)}});v&&t.push({parentId:C,nextId:y,node:v})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of Array.from(this.movedSet.values()))bt(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||i(a);for(const a of Array.from(this.addedSet.values()))!wt(this.droppedSet,a)&&!bt(this.removes,a,this.mirror)||wt(this.movedSet,a)?i(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){const l=this.mirror.getId(o.value.parentNode),c=n(o.value);l!==-1&&c!==-1&&(a=o)}if(!a)for(let l=r.length-1;l>=0;l--){const c=r.get(l);if(c){const f=this.mirror.getId(c.value.parentNode);if(n(c.value)===-1)continue;if(f!==-1){a=c;break}else{const g=c.value;if(g.parentNode&&g.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const p=g.parentNode.host;if(this.mirror.getId(p)!==-1){a=c;break}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),i(a.value)}const s={texts:this.texts.map(a=>({id:this.mirror.getId(a.node),value:a.value})).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>({id:this.mirror.getId(a.node),attributes:a.attributes})).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:t};!s.texts.length&&!s.attributes.length&&!s.removes.length&&!s.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(s))},this.processMutation=t=>{if(!He(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!G(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:dt(t.target,this.maskTextClass,this.maskTextSelector)&&r?this.maskTextFn?this.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let n=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(n=ze({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),G(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;let i=this.attributes.find(o=>o.node===t.target);if(r.tagName==="IFRAME"&&t.attributeName==="src"&&!this.keepIframeSrcFn(n))if(!r.contentDocument)t.attributeName="rr_src";else return;if(i||(i={node:t.target,attributes:{}},this.attributes.push(i)),t.attributeName==="style"){const o=this.doc.createElement("span");t.oldValue&&o.setAttribute("style",t.oldValue),(i.attributes.style===void 0||i.attributes.style===null)&&(i.attributes.style={});const s=i.attributes.style;for(const a of Array.from(r.style)){const l=r.style.getPropertyValue(a),c=r.style.getPropertyPriority(a);(l!==o.style.getPropertyValue(a)||c!==o.style.getPropertyPriority(a))&&(c===""?s[a]=l:s[a]=[l,c])}for(const a of Array.from(o.style))r.style.getPropertyValue(a)===""&&(s[a]=!1)}else i.attributes[t.attributeName]=ut(this.doc,r.tagName,t.attributeName,n);break}case"childList":{if(G(t.target,this.blockClass,this.blockSelector,!0))return;t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const n=this.mirror.getId(r),i=Se(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);G(t.target,this.blockClass,this.blockSelector,!1)||He(r,this.mirror)||!Ar(r,this.mirror)||(this.addedSet.has(r)?(Qe(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||pt(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[St(n,i)]?Qe(this.movedSet,r):this.removes.push({parentId:i,id:n,isShadow:Se(t.target)&&be(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(this.mirror.hasNode(t)){if(He(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[St(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);G(t,this.blockClass,this.blockSelector,!1)||t.childNodes.forEach(n=>this.genAdds(n))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].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 bt(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 wt(e,t){return e.size===0?!1:kt(e,t)}function kt(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:kt(e,r):!1}const ue=[],Mt=typeof CSSGroupingRule<"u",Tt=typeof CSSMediaRule<"u",Ot=typeof CSSSupportsRule<"u",Nt=typeof CSSConditionRule<"u";function ke(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];return e.target}catch{return e.target}}function Rt(e,t){var r,n;const i=new Tr;ue.push(i),i.init(e);let o=window.MutationObserver||window.__rrMutationObserver;const s=(n=(r=window?.Zone)===null||r===void 0?void 0:r.__symbol__)===null||n===void 0?void 0:n.call(r,"MutationObserver");s&&window[s]&&(o=window[s]);const a=new o(i.processMutations.bind(i));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function Or({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 s=[],a;const l=we(h=>{const g=Date.now()-a;e(s.map(p=>(p.timeOffset-=g,p)),h),s=[],a=null},o),c=we(h=>{const g=ke(h),{clientX:p,clientY:d}=mt(h)?h.changedTouches[0]:h;a||(a=Date.now()),s.push({x:p,y:d,id:n.getId(g),timeOffset:Date.now()-a}),l(typeof DragEvent<"u"&&h instanceof DragEvent?w.Drag:h instanceof MouseEvent?w.MouseMove:w.TouchMove)},i,{trailing:!1}),f=[U("mousemove",c,r),U("touchmove",c,r),U("drag",c,r)];return()=>{f.forEach(h=>h())}}function Nr({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[],l=c=>f=>{const h=ke(f);if(G(h,n,i,!0))return;const g=mt(f)?f.changedTouches[0]:f;if(!g)return;const p=r.getId(h),{clientX:d,clientY:C}=g;e({type:Ye[c],id:p,x:d,y:C})};return Object.keys(Ye).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&s[c]!==!1).forEach(c=>{const f=c.toLowerCase(),h=l(c);a.push(U(f,h,t))}),()=>{a.forEach(c=>c())}}function Et({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){const s=we(a=>{const l=ke(a);if(!l||G(l,n,i,!0))return;const c=r.getId(l);if(l===t){const f=t.scrollingElement||t.documentElement;e({id:c,x:f.scrollLeft,y:f.scrollTop})}else e({id:c,x:l.scrollLeft,y:l.scrollTop})},o.scroll||100);return U("scroll",s,t)}function Rr({viewportResizeCb:e}){let t=-1,r=-1;const n=we(()=>{const i=ht(),o=gt();(t!==i||r!==o)&&(e({width:Number(o),height:Number(i)}),t=i,r=o)},200);return U("resize",n,window)}function xt(e,t){const r=Object.assign({},e);return t||delete r.userTriggered,r}const Er=["INPUT","TEXTAREA","SELECT"],_t=new WeakMap;function xr({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,ignoreClass:o,maskInputOptions:s,maskInputFn:a,sampling:l,userTriggeredOnInput:c}){function f(v){let m=ke(v);const I=v.isTrusted;if(m&&m.tagName==="OPTION"&&(m=m.parentElement),!m||!m.tagName||Er.indexOf(m.tagName)<0||G(m,n,i,!0))return;const b=m.type;if(m.classList.contains(o))return;let R=m.value,D=!1;b==="radio"||b==="checkbox"?D=m.checked:(s[m.tagName.toLowerCase()]||s[b])&&(R=ze({maskInputOptions:s,tagName:m.tagName,type:b,value:R,maskInputFn:a})),h(m,xt({text:R,isChecked:D,userTriggered:I},c));const N=m.name;b==="radio"&&N&&D&&t.querySelectorAll(`input[type="radio"][name="${N}"]`).forEach(A=>{A!==m&&h(A,xt({text:A.value,isChecked:!D,userTriggered:!1},c))})}function h(v,m){const I=_t.get(v);if(!I||I.text!==m.text||I.isChecked!==m.isChecked){_t.set(v,m);const b=r.getId(v);e(Object.assign(Object.assign({},m),{id:b}))}}const p=(l.input==="last"?["change"]:["input","change"]).map(v=>U(v,f,t)),d=t.defaultView;if(!d)return()=>{p.forEach(v=>v())};const C=d.Object.getOwnPropertyDescriptor(d.HTMLInputElement.prototype,"value"),y=[[d.HTMLInputElement.prototype,"value"],[d.HTMLInputElement.prototype,"checked"],[d.HTMLSelectElement.prototype,"value"],[d.HTMLTextAreaElement.prototype,"value"],[d.HTMLSelectElement.prototype,"selectedIndex"],[d.HTMLOptionElement.prototype,"selected"]];return C&&C.set&&p.push(...y.map(v=>_e(v[0],v[1],{set(){f({target:this})}},!1,d))),()=>{p.forEach(v=>v())}}function Fe(e){const t=[];function r(n,i){if(Mt&&n.parentRule instanceof CSSGroupingRule||Tt&&n.parentRule instanceof CSSMediaRule||Ot&&n.parentRule instanceof CSSSupportsRule||Nt&&n.parentRule instanceof CSSConditionRule){const s=Array.from(n.parentRule.cssRules).indexOf(n);i.unshift(s)}else if(n.parentStyleSheet){const s=Array.from(n.parentStyleSheet.cssRules).indexOf(n);i.unshift(s)}return i}return r(e,t)}function se(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function _r({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){const i=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=function(f,h){const{id:g,styleId:p}=se(this,t,r.styleMirror);return(g&&g!==-1||p&&p!==-1)&&e({id:g,styleId:p,adds:[{rule:f,index:h}]}),i.apply(this,[f,h])};const o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=function(f){const{id:h,styleId:g}=se(this,t,r.styleMirror);return(h&&h!==-1||g&&g!==-1)&&e({id:h,styleId:g,removes:[{index:f}]}),o.apply(this,[f])};let s;n.CSSStyleSheet.prototype.replace&&(s=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=function(f){const{id:h,styleId:g}=se(this,t,r.styleMirror);return(h&&h!==-1||g&&g!==-1)&&e({id:h,styleId:g,replace:f}),s.apply(this,[f])});let a;n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=function(f){const{id:h,styleId:g}=se(this,t,r.styleMirror);return(h&&h!==-1||g&&g!==-1)&&e({id:h,styleId:g,replaceSync:f}),a.apply(this,[f])});const l={};Mt?l.CSSGroupingRule=n.CSSGroupingRule:(Tt&&(l.CSSMediaRule=n.CSSMediaRule),Nt&&(l.CSSConditionRule=n.CSSConditionRule),Ot&&(l.CSSSupportsRule=n.CSSSupportsRule));const c={};return Object.entries(l).forEach(([f,h])=>{c[f]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=function(g,p){const{id:d,styleId:C}=se(this.parentStyleSheet,t,r.styleMirror);return(d&&d!==-1||C&&C!==-1)&&e({id:d,styleId:C,adds:[{rule:g,index:[...Fe(this),p||0]}]}),c[f].insertRule.apply(this,[g,p])},h.prototype.deleteRule=function(g){const{id:p,styleId:d}=se(this.parentStyleSheet,t,r.styleMirror);return(p&&p!==-1||d&&d!==-1)&&e({id:p,styleId:d,removes:[{index:[...Fe(this),g]}]}),c[f].deleteRule.apply(this,[g])}}),()=>{n.CSSStyleSheet.prototype.insertRule=i,n.CSSStyleSheet.prototype.deleteRule=o,s&&(n.CSSStyleSheet.prototype.replace=s),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([f,h])=>{h.prototype.insertRule=c[f].insertRule,h.prototype.deleteRule=c[f].deleteRule})}}function Ft({mirror:e,stylesheetManager:t},r){var n,i,o;let s=null;r.nodeName==="#document"?s=e.getId(r):s=e.getId(r.host);const a=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,l=Object.getOwnPropertyDescriptor(a?.prototype,"adoptedStyleSheets");return s===null||s===-1||!a||!l?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var c;return(c=l.get)===null||c===void 0?void 0:c.call(this)},set(c){var f;const h=(f=l.set)===null||f===void 0?void 0:f.call(this,c);if(s!==null&&s!==-1)try{t.adoptStyleSheets(c,s)}catch{}return h}}),()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})}function Fr({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=function(a,l,c){var f;if(r.has(a))return o.apply(this,[a,l,c]);const{id:h,styleId:g}=se((f=this.parentRule)===null||f===void 0?void 0:f.parentStyleSheet,t,n.styleMirror);return(h&&h!==-1||g&&g!==-1)&&e({id:h,styleId:g,set:{property:a,value:l,priority:c},index:Fe(this.parentRule)}),o.apply(this,[a,l,c])};const s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=function(a){var l;if(r.has(a))return s.apply(this,[a]);const{id:c,styleId:f}=se((l=this.parentRule)===null||l===void 0?void 0:l.parentStyleSheet,t,n.styleMirror);return(c&&c!==-1||f&&f!==-1)&&e({id:c,styleId:f,remove:{property:a},index:Fe(this.parentRule)}),s.apply(this,[a])},()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s}}function Dr({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i}){const o=a=>we(l=>{const c=ke(l);if(!c||G(c,t,r,!0))return;const{currentTime:f,volume:h,muted:g,playbackRate:p}=c;e({type:a,id:n.getId(c),currentTime:f,volume:h,muted:g,playbackRate:p})},i.media||500),s=[U("play",o(0)),U("pause",o(1)),U("seeked",o(2)),U("volumechange",o(3)),U("ratechange",o(4))];return()=>{s.forEach(a=>a())}}function Lr({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],i=new WeakMap,o=r.FontFace;r.FontFace=function(l,c,f){const h=new o(l,c,f);return i.set(h,{family:l,buffer:typeof c!="string",descriptors:f,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),h};const s=Ie(t.fonts,"add",function(a){return function(l){return setTimeout(()=>{const c=i.get(l);c&&(e(c),i.delete(l))},0),a.apply(this,[l])}});return n.push(()=>{r.FontFace=o}),n.push(s),()=>{n.forEach(a=>a())}}function Br(e){const{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=e;let s=!0;const a=()=>{const l=t.getSelection();if(!l||s&&l?.isCollapsed)return;s=l.isCollapsed||!1;const c=[],f=l.rangeCount||0;for(let h=0;h<f;h++){const g=l.getRangeAt(h),{startContainer:p,startOffset:d,endContainer:C,endOffset:y}=g;G(p,n,i,!0)||G(C,n,i,!0)||c.push({start:r.getId(p),startOffset:d,end:r.getId(C),endOffset:y})}o({ranges:c})};return a(),U("selectionchange",a)}function Wr(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:f,canvasMutationCb:h,fontCb:g,selectionCb:p}=e;e.mutationCb=(...d)=>{t.mutation&&t.mutation(...d),r(...d)},e.mousemoveCb=(...d)=>{t.mousemove&&t.mousemove(...d),n(...d)},e.mouseInteractionCb=(...d)=>{t.mouseInteraction&&t.mouseInteraction(...d),i(...d)},e.scrollCb=(...d)=>{t.scroll&&t.scroll(...d),o(...d)},e.viewportResizeCb=(...d)=>{t.viewportResize&&t.viewportResize(...d),s(...d)},e.inputCb=(...d)=>{t.input&&t.input(...d),a(...d)},e.mediaInteractionCb=(...d)=>{t.mediaInteaction&&t.mediaInteaction(...d),l(...d)},e.styleSheetRuleCb=(...d)=>{t.styleSheetRule&&t.styleSheetRule(...d),c(...d)},e.styleDeclarationCb=(...d)=>{t.styleDeclaration&&t.styleDeclaration(...d),f(...d)},e.canvasMutationCb=(...d)=>{t.canvasMutation&&t.canvasMutation(...d),h(...d)},e.fontCb=(...d)=>{t.font&&t.font(...d),g(...d)},e.selectionCb=(...d)=>{t.selection&&t.selection(...d),p(...d)}}function Ur(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};Wr(e,t);const n=Rt(e,e.doc),i=Or(e),o=Nr(e),s=Et(e),a=Rr(e),l=xr(e),c=Dr(e),f=_r(e,{win:r}),h=Ft(e,e.doc),g=Fr(e,{win:r}),p=e.collectFonts?Lr(e):()=>{},d=Br(e),C=[];for(const y of e.plugins)C.push(y.observer(y.callback,r,y.options));return()=>{ue.forEach(y=>y.reset()),n.disconnect(),i(),o(),s(),a(),l(),c(),f(),h(),g(),p(),d(),C.forEach(y=>y())}}class Dt{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,r,n,i){const o=n||this.getIdToRemoteIdMap(t),s=i||this.getRemoteIdToIdMap(t);let a=o.get(r);return a||(a=this.generateIdFn(),o.set(r,a),s.set(a,r)),a}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 Gr{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Dt(lt),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Dt(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){if(t.data.type==="rrweb"){if(!t.source)return;const n=this.crossOriginIframeMap.get(t.source);if(!n)return;const i=this.transformCrossOriginEvent(n,t.data.event);i&&this.wrappedEmit(i,t.data.isCheckout)}}transformCrossOriginEvent(t,r){var n;switch(r.type){case k.FullSnapshot:return this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t),{timestamp:r.timestamp,type:k.IncrementalSnapshot,data:{source:w.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case k.Meta:case k.Load:case k.DomContentLoaded:return!1;case k.Plugin:return r;case k.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case k.IncrementalSnapshot:switch(r.data.source){case w.Mutation:return r.data.adds.forEach(i=>{this.replaceIds(i,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,t)}),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 w.Drag:case w.TouchMove:case w.MouseMove:return r.data.positions.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case w.ViewportResize:return!1;case w.MediaInteraction:case w.MouseInteraction:case w.Scroll:case w.CanvasMutation:case w.Input:return this.replaceIds(r.data,t,["id"]),r;case w.StyleSheetRule:case w.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case w.Font:return r;case w.Selection:return r.data.ranges.forEach(i=>{this.replaceIds(i,t,["start","end"])}),r;case w.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}}}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"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}}class Zr{constructor(t){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;const r=this;this.restorePatches.push(Ie(Element.prototype,"attachShadow",function(n){return function(i){const o=n.call(this,i);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),o}}))}addShadowRoot(t,r){be(t)&&(this.shadowDoms.has(t)||(this.shadowDoms.add(t),Rt(Object.assign(Object.assign({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),Et(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)),Ft({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)},0)))}observeAttachShadow(t){if(t.contentWindow){const r=this;this.restorePatches.push(Ie(t.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(i){const o=n.call(this,i);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,t.contentDocument),o}}))}}reset(){this.restorePatches.forEach(t=>t()),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 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}}/*! *****************************************************************************
4
4
  Copyright (c) Microsoft Corporation.
5
5
 
6
6
  Permission to use, copy, modify, and/or distribute this software for any
@@ -13,12 +13,26 @@ 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 Vr(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 Kr(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(f){try{c(n.next(f))}catch(h){s(h)}}function l(f){try{c(n.throw(f))}catch(h){s(h)}}function c(f){f.done?o(f.value):i(f.value).then(a,l)}c((n=n.apply(e,t||[])).next())})}for(var ye="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Pr=typeof Uint8Array>"u"?[]:new Uint8Array(256),De=0;De<ye.length;De++)Pr[ye.charCodeAt(De)]=De;var zr=function(e){var t=new Uint8Array(e),r,n=t.length,i="";for(r=0;r<n;r+=3)i+=ye[t[r]>>2],i+=ye[(t[r]&3)<<4|t[r+1]>>4],i+=ye[(t[r+1]&15)<<2|t[r+2]>>6],i+=ye[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 Lt=new Map;function Jr(e,t){let r=Lt.get(e);return r||(r=new Map,Lt.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const Bt=(e,t,r)=>{if(!e||!(Ut(e,t)||typeof e=="object"))return;const n=e.constructor.name,i=Jr(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=zr(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(Ut(e,t)||typeof e=="object"){const n=e.constructor.name,i=Bt(e,t,r);return{rr_type:n,index:i}}}}return e}const Wt=(e,t,r)=>[...e].map(n=>Le(n,t,r)),Ut=(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 Hr(e,t,r,n){const i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of o)try{if(typeof t.CanvasRenderingContext2D.prototype[s]!="function")continue;const a=Ie(t.CanvasRenderingContext2D.prototype,s,function(l){return function(...c){return G(this.canvas,r,n,!0)||setTimeout(()=>{const f=Wt([...c],t,this);e(this.canvas,{type:Ce["2D"],property:s,args:f})},0),l.apply(this,c)}});i.push(a)}catch{const l=_e(t.CanvasRenderingContext2D.prototype,s,{set(c){e(this.canvas,{type:Ce["2D"],property:s,args:[c],setter:!0})}});i.push(l)}return()=>{i.forEach(s=>s())}}function Gt(e,t,r){const n=[];try{const i=Ie(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(s,...a){return G(this,t,r,!0)||"__context"in this||(this.__context=s),o.apply(this,[s,...a])}});n.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(i=>i())}}function Zt(e,t,r,n,i,o,s){const a=[],l=Object.getOwnPropertyNames(e);for(const c of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{if(typeof e[c]!="function")continue;const f=Ie(e,c,function(h){return function(...g){const p=h.apply(this,g);if(Bt(p,s,this),!G(this.canvas,n,i,!0)){const d=Wt([...g],s,this),C={type:t,property:c,args:d};r(this.canvas,C)}return p}});a.push(f)}catch{const h=_e(e,c,{set(g){r(this.canvas,{type:t,property:c,args:[g],setter:!0})}});a.push(h)}return a}function Yr(e,t,r,n,i){const o=[];return o.push(...Zt(t.WebGLRenderingContext.prototype,Ce.WebGL,e,r,n,i,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...Zt(t.WebGL2RenderingContext.prototype,Ce.WebGL2,e,r,n,i,t)),()=>{o.forEach(s=>s())}}var Vt=null;try{var Qr=typeof module<"u"&&typeof module.require=="function"&&module.require("worker_threads")||typeof __non_webpack_require__=="function"&&__non_webpack_require__("worker_threads")||typeof require=="function"&&require("worker_threads");Vt=Qr.Worker}catch{}function Xr(e,t){return Buffer.from(e,"base64").toString(t?"utf16":"utf8")}function qr(e,t,r){var n=t===void 0?null:t,i=r===void 0?!1:r,o=Xr(e,i),s=o.indexOf(`
17
- `,10)+1,a=o.substring(s)+(n?"//# sourceMappingURL="+n:"");return function(c){return new Vt(a,Object.assign({},c,{eval:!0}))}}function jr(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),i=0,o=r.length;i<o;++i)n[i]=r.charCodeAt(i);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}function $r(e,t,r){var n=t===void 0?null:t,i=r===void 0?!1:r,o=jr(e,i),s=o.indexOf(`
18
- `,10)+1,a=o.substring(s)+(n?"//# sourceMappingURL="+n:""),l=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(l)}function en(e,t,r){var n;return function(o){return n=n||$r(e,t,r),new Worker(n,o)}}var tn=Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";function rn(){return tn}function nn(e,t,r){return rn()?qr(e,t,r):en(e,t,r)}var on=nn("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",null,!1);class an{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(l,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(c)};const{sampling:r="all",win:n,blockClass:i,blockSelector:o,recordCanvas:s,dataURLOptions:a}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&r==="all"&&this.initCanvasMutationObserver(n,i,o),s&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,i,o,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n,i,o){const s=Gt(r,n,i),a=new Map,l=new on;l.onmessage=d=>{const{id:C}=d.data;if(a.set(C,!1),!("base64"in d.data))return;const{base64:y,type:v,width:m,height:I}=d.data;this.mutationCb({id:C,type:Ce["2D"],commands:[{property:"clearRect",args:[0,0,m,I]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:y}],type:v}]},0,0]}]})};const c=1e3/t;let f=0,h;const g=()=>{const d=[];return r.document.querySelectorAll("canvas").forEach(C=>{G(C,n,i,!0)||d.push(C)}),d},p=d=>{if(f&&d-f<c){h=requestAnimationFrame(p);return}f=d,g().forEach(C=>Kr(this,void 0,void 0,function*(){var y;const v=this.mirror.getId(C);if(a.get(v))return;if(a.set(v,!0),["webgl","webgl2"].includes(C.__context)){const I=C.getContext(C.__context);((y=I?.getContextAttributes())===null||y===void 0?void 0:y.preserveDrawingBuffer)===!1&&I?.clear(I.COLOR_BUFFER_BIT)}const m=yield createImageBitmap(C);l.postMessage({id:v,bitmap:m,width:C.width,height:C.height,dataURLOptions:o.dataURLOptions},[m])})),h=requestAnimationFrame(p)};h=requestAnimationFrame(p),this.resetObservers=()=>{s(),cancelAnimationFrame(h)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=Gt(t,r,n),o=Hr(this.processMutation.bind(this),t,r,n),s=Yr(this.processMutation.bind(this),t,r,n,this.mirror);this.resetObservers=()=>{i(),o(),s()}}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(s=>Vr(s,["type"])),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}}class sn{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new kr,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 s;if(this.styleMirror.has(o))s=this.styleMirror.getId(o);else{s=this.styleMirror.add(o);const a=Array.from(o.rules||CSSRule);i.push({styleId:s,rules:a.map((l,c)=>({rule:ot(l),index:c}))})}n.styleIds.push(s)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}function F(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}let x,Be,Xe,We=!1;const ee=er();function Me(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",maskTextClass:a="rr-mask",maskTextSelector:l=null,inlineStylesheet:c=!0,maskAllInputs:f,maskInputOptions:h,slimDOMOptions:g,maskInputFn:p,maskTextFn:d,hooks:C,packFn:y,sampling:v={},dataURLOptions:m={},mousemoveWait:I,recordCanvas:b=!1,recordCrossOriginIframes:R=!1,userTriggeredOnInput:D=!1,collectFonts:N=!1,inlineImages:A=!1,plugins:T,keepIframeSrcFn:H=()=>!1,ignoreCSSAttributes:q=new Set([])}=e,j=R?window.parent===window:!0;let $=!1;if(!j)try{window.parent.document,$=!1}catch{$=!0}if(j&&!t)throw new Error("emit function is required");I!==void 0&&v.mousemove===void 0&&(v.mousemove=I),ee.reset();const L=f===!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}:h!==void 0?h:{password:!0},Y=g===!0||g==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:g==="all",headMetaDescKeywords:g==="all"}:g||{};wr();let re,ie=0;const ae=S=>{for(const Z of T||[])Z.eventProcessor&&(S=Z.eventProcessor(S));return y&&(S=y(S)),S};x=(S,Z)=>{var P;if(!((P=ue[0])===null||P===void 0)&&P.isFrozen()&&S.type!==k.FullSnapshot&&!(S.type===k.IncrementalSnapshot&&S.data.source===w.Mutation)&&ue.forEach(E=>E.unfreeze()),j)t?.(ae(S),Z);else if($){const E={type:"rrweb",event:ae(S),isCheckout:Z};window.parent.postMessage(E,"*")}if(S.type===k.FullSnapshot)re=S,ie=0;else if(S.type===k.IncrementalSnapshot){if(S.data.source===w.Mutation&&S.data.isAttachIframe)return;ie++;const E=n&&ie>=n,X=r&&S.timestamp-re.timestamp>r;(E||X)&&Be(!0)}};const K=S=>{x(F({type:k.IncrementalSnapshot,data:Object.assign({source:w.Mutation},S)}))},Q=S=>x(F({type:k.IncrementalSnapshot,data:Object.assign({source:w.Scroll},S)})),ce=S=>x(F({type:k.IncrementalSnapshot,data:Object.assign({source:w.CanvasMutation},S)})),_=S=>x(F({type:k.IncrementalSnapshot,data:Object.assign({source:w.AdoptedStyleSheet},S)})),ne=new sn({mutationCb:K,adoptedStyleSheetCb:_}),oe=new Gr({mirror:ee,mutationCb:K,stylesheetManager:ne,recordCrossOriginIframes:R,wrappedEmit:x});for(const S of T||[])S.getMirror&&S.getMirror({nodeMirror:ee,crossOriginIframeMirror:oe.crossOriginIframeMirror,crossOriginIframeStyleMirror:oe.crossOriginIframeStyleMirror});Xe=new an({recordCanvas:b,mutationCb:ce,win:window,blockClass:i,blockSelector:o,mirror:ee,sampling:v.canvas,dataURLOptions:m});const ve=new Zr({mutationCb:K,scrollCb:Q,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:l,inlineStylesheet:c,maskInputOptions:L,dataURLOptions:m,maskTextFn:d,maskInputFn:p,recordCanvas:b,inlineImages:A,sampling:v,slimDOMOptions:Y,iframeManager:oe,stylesheetManager:ne,canvasManager:Xe,keepIframeSrcFn:H},mirror:ee});Be=(S=!1)=>{var Z,P,E,X,M,z;x(F({type:k.Meta,data:{href:window.location.href,width:gt(),height:ht()}}),S),ne.reset(),ue.forEach(V=>V.lock());const Re=br(document,{mirror:ee,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:l,inlineStylesheet:c,maskAllInputs:L,maskTextFn:d,slimDOM:Y,dataURLOptions:m,recordCanvas:b,inlineImages:A,onSerialize:V=>{It(V,ee)&&oe.addIframe(V),Ct(V,ee)&&ne.trackLinkElement(V),yt(V)&&ve.addShadowRoot(V.shadowRoot,document)},onIframeLoad:(V,it)=>{oe.attachIframe(V,it),ve.observeAttachShadow(V)},onStylesheetLoad:(V,it)=>{ne.attachLinkElement(V,it)},keepIframeSrcFn:H});if(!Re)return console.warn("Failed to snapshot the document");x(F({type:k.FullSnapshot,data:{node:Re,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((P=(Z=document?.body)===null||Z===void 0?void 0:Z.parentElement)===null||P===void 0?void 0:P.scrollLeft)||((E=document?.body)===null||E===void 0?void 0:E.scrollLeft)||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((M=(X=document?.body)===null||X===void 0?void 0:X.parentElement)===null||M===void 0?void 0:M.scrollTop)||((z=document?.body)===null||z===void 0?void 0:z.scrollTop)||0}}})),ue.forEach(V=>V.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ne.adoptStyleSheets(document.adoptedStyleSheets,ee.getId(document))};try{const S=[];S.push(U("DOMContentLoaded",()=>{x(F({type:k.DomContentLoaded,data:{}}))}));const Z=E=>{var X;return Ur({mutationCb:K,mousemoveCb:(M,z)=>x(F({type:k.IncrementalSnapshot,data:{source:z,positions:M}})),mouseInteractionCb:M=>x(F({type:k.IncrementalSnapshot,data:Object.assign({source:w.MouseInteraction},M)})),scrollCb:Q,viewportResizeCb:M=>x(F({type:k.IncrementalSnapshot,data:Object.assign({source:w.ViewportResize},M)})),inputCb:M=>x(F({type:k.IncrementalSnapshot,data:Object.assign({source:w.Input},M)})),mediaInteractionCb:M=>x(F({type:k.IncrementalSnapshot,data:Object.assign({source:w.MediaInteraction},M)})),styleSheetRuleCb:M=>x(F({type:k.IncrementalSnapshot,data:Object.assign({source:w.StyleSheetRule},M)})),styleDeclarationCb:M=>x(F({type:k.IncrementalSnapshot,data:Object.assign({source:w.StyleDeclaration},M)})),canvasMutationCb:ce,fontCb:M=>x(F({type:k.IncrementalSnapshot,data:Object.assign({source:w.Font},M)})),selectionCb:M=>{x(F({type:k.IncrementalSnapshot,data:Object.assign({source:w.Selection},M)}))},blockClass:i,ignoreClass:s,maskTextClass:a,maskTextSelector:l,maskInputOptions:L,inlineStylesheet:c,sampling:v,recordCanvas:b,inlineImages:A,userTriggeredOnInput:D,collectFonts:N,doc:E,maskInputFn:p,maskTextFn:d,keepIframeSrcFn:H,blockSelector:o,slimDOMOptions:Y,dataURLOptions:m,mirror:ee,iframeManager:oe,stylesheetManager:ne,shadowDomManager:ve,canvasManager:Xe,ignoreCSSAttributes:q,plugins:((X=T?.filter(M=>M.observer))===null||X===void 0?void 0:X.map(M=>({observer:M.observer,options:M.options,callback:z=>x(F({type:k.Plugin,data:{plugin:M.name,payload:z}}))})))||[]},C)};oe.addLoadListener(E=>{S.push(Z(E.contentDocument))});const P=()=>{Be(),S.push(Z(document)),We=!0};return document.readyState==="interactive"||document.readyState==="complete"?P():S.push(U("load",()=>{x(F({type:k.Load,data:{}})),P()},window)),()=>{S.forEach(E=>E()),We=!1}}catch(S){console.warn(S)}}Me.addCustomEvent=(e,t)=>{if(!We)throw new Error("please add custom event after start recording");x(F({type:k.Custom,data:{tag:e,payload:t}}))},Me.freezePage=()=>{ue.forEach(e=>e.freeze())},Me.takeFullSnapshot=e=>{if(!We)throw new Error("please take full snapshot after start recording");Be(e)},Me.mirror=ee;var ln={DEBUG:!1,LIB_VERSION:"2.50.0"},W;if(typeof window>"u"){var Kt={hostname:""};W={navigator:{userAgent:""},document:{location:Kt,referrer:""},screen:{width:0,height:0},location:Kt}}else W=window;var Ue=24*60*60*1e3,Ge=Array.prototype,cn=Function.prototype,Pt=Object.prototype,de=Ge.slice,Te=Pt.toString,Ze=Pt.hasOwnProperty,Oe=W.console,Ne=W.navigator,J=W.document,Ve=W.opera,Ke=W.screen,fe=Ne.userAgent,qe=cn.bind,zt=Ge.forEach,Jt=Ge.indexOf,Ht=Ge.map,un=Array.isArray,je={},u={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},te={log:function(){},warn:function(){},error:function(){},critical:function(){if(!u.isUndefined(Oe)&&Oe){var e=["Mixpanel error:"].concat(u.toArray(arguments));try{Oe.error.apply(Oe,e)}catch{u.each(e,function(r){Oe.error(r)})}}}},$e=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(te,arguments)}},dn=function(e){return{log:$e(te.log,e),error:$e(te.error,e),critical:$e(te.critical,e)}};u.bind=function(e,t){var r,n;if(qe&&e.bind===qe)return qe.apply(e,de.call(arguments,1));if(!u.isFunction(e))throw new TypeError;return r=de.call(arguments,2),n=function(){if(!(this instanceof n))return e.apply(t,r.concat(de.call(arguments)));var i={};i.prototype=e.prototype;var o=new i;i.prototype=null;var s=e.apply(o,r.concat(de.call(arguments)));return Object(s)===s?s:o},n},u.each=function(e,t,r){if(e!=null){if(zt&&e.forEach===zt)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)===je)return}else for(var o in e)if(Ze.call(e,o)&&t.call(r,e[o],o,e)===je)return}},u.extend=function(e){return u.each(de.call(arguments,1),function(t){for(var r in t)t[r]!==void 0&&(e[r]=t[r])}),e},u.isArray=un||function(e){return Te.call(e)==="[object Array]"},u.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch{return!1}},u.isArguments=function(e){return!!(e&&Ze.call(e,"callee"))},u.toArray=function(e){return e?e.toArray?e.toArray():u.isArray(e)||u.isArguments(e)?de.call(e):u.values(e):[]},u.map=function(e,t,r){if(Ht&&e.map===Ht)return e.map(t,r);var n=[];return u.each(e,function(i){n.push(t.call(r,i))}),n},u.keys=function(e){var t=[];return e===null||u.each(e,function(r,n){t[t.length]=n}),t},u.values=function(e){var t=[];return e===null||u.each(e,function(r){t[t.length]=r}),t},u.include=function(e,t){var r=!1;return e===null?r:Jt&&e.indexOf===Jt?e.indexOf(t)!=-1:(u.each(e,function(n){if(r||(r=n===t))return je}),r)},u.includes=function(e,t){return e.indexOf(t)!==-1},u.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},u.isObject=function(e){return e===Object(e)&&!u.isArray(e)},u.isEmptyObject=function(e){if(u.isObject(e)){for(var t in e)if(Ze.call(e,t))return!1;return!0}return!1},u.isUndefined=function(e){return e===void 0},u.isString=function(e){return Te.call(e)=="[object String]"},u.isDate=function(e){return Te.call(e)=="[object Date]"},u.isNumber=function(e){return Te.call(e)=="[object Number]"},u.isElement=function(e){return!!(e&&e.nodeType===1)},u.encodeDates=function(e){return u.each(e,function(t,r){u.isDate(t)?e[r]=u.formatDate(t):u.isObject(t)&&(e[r]=u.encodeDates(t))}),e},u.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},u.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())},u.strip_empty_properties=function(e){var t={};return u.each(e,function(r,n){u.isString(r)&&r.length>0&&(t[n]=r)}),t},u.truncate=function(e,t){var r;return typeof e=="string"?r=e.slice(0,t):u.isArray(e)?(r=[],u.each(e,function(n){r.push(u.truncate(n,t))})):u.isObject(e)?(r={},u.each(e,function(n,i){r[i]=u.truncate(n,t)})):r=e,r},u.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,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return o.lastIndex=0,o.test(i)?'"'+i.replace(o,function(a){var l=s[a];return typeof l=="string"?l:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+i+'"'},n=function(i,o){var s="",a=" ",l=0,c="",f="",h=0,g=s,p=[],d=o[i];switch(d&&typeof d=="object"&&typeof d.toJSON=="function"&&(d=d.toJSON(i)),typeof d){case"string":return r(d);case"number":return isFinite(d)?String(d):"null";case"boolean":case"null":return String(d);case"object":if(!d)return"null";if(s+=a,p=[],Te.apply(d)==="[object Array]"){for(h=d.length,l=0;l<h;l+=1)p[l]=n(l,d)||"null";return f=p.length===0?"[]":s?`[
19
- `+s+p.join(`,
20
- `+s)+`
21
- `+g+"]":"["+p.join(",")+"]",s=g,f}for(c in d)Ze.call(d,c)&&(f=n(c,d),f&&p.push(r(c)+(s?": ":":")+f));return f=p.length===0?"{}":s?"{"+p.join(",")+g+"}":"{"+p.join(",")+"}",s=g,f}};return n("",{"":t})}}(),u.JSONDecode=function(){var e,t,r={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
22
- `,r:"\r",t:" "},n,i=function(p){var d=new SyntaxError(p);throw d.at=e,d.text=n,d},o=function(p){return p&&p!==t&&i("Expected '"+p+"' instead of '"+t+"'"),t=n.charAt(e),e+=1,t},s=function(){var p,d="";for(t==="-"&&(d="-",o("-"));t>="0"&&t<="9";)d+=t,o();if(t===".")for(d+=".";o()&&t>="0"&&t<="9";)d+=t;if(t==="e"||t==="E")for(d+=t,o(),(t==="-"||t==="+")&&(d+=t,o());t>="0"&&t<="9";)d+=t,o();if(p=+d,!isFinite(p))i("Bad number");else return p},a=function(){var p,d,C="",y;if(t==='"')for(;o();){if(t==='"')return o(),C;if(t==="\\")if(o(),t==="u"){for(y=0,d=0;d<4&&(p=parseInt(o(),16),!!isFinite(p));d+=1)y=y*16+p;C+=String.fromCharCode(y)}else if(typeof r[t]=="string")C+=r[t];else break;else C+=t}i("Bad string")},l=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+'"')},f,h=function(){var p=[];if(t==="["){if(o("["),l(),t==="]")return o("]"),p;for(;t;){if(p.push(f()),l(),t==="]")return o("]"),p;o(","),l()}}i("Bad array")},g=function(){var p,d={};if(t==="{"){if(o("{"),l(),t==="}")return o("}"),d;for(;t;){if(p=a(),l(),o(":"),Object.hasOwnProperty.call(d,p)&&i('Duplicate key "'+p+'"'),d[p]=f(),l(),t==="}")return o("}"),d;o(","),l()}}i("Bad object")};return f=function(){switch(l(),t){case"{":return g();case"[":return h();case'"':return a();case"-":return s();default:return t>="0"&&t<="9"?s():c()}},function(p){var d;return n=p,e=0,t=" ",d=f(),l(),t&&i("Syntax error"),d}}(),u.base64Encode=function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r,n,i,o,s,a,l,c,f=0,h=0,g="",p=[];if(!e)return e;e=u.utf8Encode(e);do r=e.charCodeAt(f++),n=e.charCodeAt(f++),i=e.charCodeAt(f++),c=r<<16|n<<8|i,o=c>>18&63,s=c>>12&63,a=c>>6&63,l=c&63,p[h++]=t.charAt(o)+t.charAt(s)+t.charAt(a)+t.charAt(l);while(f<e.length);switch(g=p.join(""),e.length%3){case 1:g=g.slice(0,-2)+"==";break;case 2:g=g.slice(0,-1)+"=";break}return g},u.utf8Encode=function(e){e=(e+"").replace(/\r\n/g,`
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(`
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
+ `;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__";/*! *****************************************************************************
20
+ Copyright (c) Microsoft Corporation.
21
+
22
+ Permission to use, copy, modify, and/or distribute this software for any
23
+ purpose with or without fee is hereby granted.
24
+
25
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
26
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
27
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
28
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
29
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
30
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
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?`[
33
+ `+a+f.join(`,
34
+ `+a)+`
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
+ `,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,`
23
37
  `).replace(/\r/g,`
24
- `);var t="",r,n,i=0,o;for(r=n=0,i=e.length,o=0;o<i;o++){var s=e.charCodeAt(o),a=null;s<128?n++:s>127&&s<2048?a=String.fromCharCode(s>>6|192,s&63|128):a=String.fromCharCode(s>>12|224,s>>6&63|128,s&63|128),a!==null&&(n>r&&(t+=e.substring(r,n)),t+=a,r=n=o+1)}return n>r&&(t+=e.substring(r,e.length)),t},u.UUID=function(){var e=function(){var n=1*new Date,i;if(W.performance&&W.performance.now)i=W.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=fe,i,o,s=[],a=0;function l(c,f){var h,g=0;for(h=0;h<f.length;h++)g|=s[h]<<h*8;return c^g}for(i=0;i<n.length;i++)o=n.charCodeAt(i),s.unshift(o&255),s.length>=4&&(a=l(a,s),s=[]);return s.length>0&&(a=l(a,s)),a.toString(16)};return function(){var n=(Ke.height*Ke.width).toString(16);return e()+"-"+t()+"-"+r()+"-"+n+"-"+e()}}();var Yt=["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"];u.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t<Yt.length;t++)if(e.indexOf(Yt[t])!==-1)return!0;return!1},u.HTTPBuildQuery=function(e,t){var r,n,i=[];return u.isUndefined(t)&&(t="&"),u.each(e,function(o,s){r=encodeURIComponent(o.toString()),n=encodeURIComponent(s),i[i.length]=n+"="+r}),i.join(t)},u.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{te.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},u.cookie={get:function(e){for(var t=e+"=",r=J.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=u.JSONDecode(u.cookie.get(e))||{}}catch{}return t},set_seconds:function(e,t,r,n,i,o,s){var a="",l="",c="";if(s)a="; domain="+s;else if(n){var f=Xt(J.location.hostname);a=f?"; domain=."+f:""}if(r){var h=new Date;h.setTime(h.getTime()+r*1e3),l="; expires="+h.toGMTString()}o&&(i=!0,c="; SameSite=None"),i&&(c+="; secure"),J.cookie=e+"="+encodeURIComponent(t)+l+"; path=/"+a+c},set:function(e,t,r,n,i,o,s){var a="",l="",c="";if(s)a="; domain="+s;else if(n){var f=Xt(J.location.hostname);a=f?"; domain=."+f:""}if(r){var h=new Date;h.setTime(h.getTime()+r*24*60*60*1e3),l="; expires="+h.toGMTString()}o&&(i=!0,c="; SameSite=None"),i&&(c+="; secure");var g=e+"="+encodeURIComponent(t)+l+"; path=/"+a+c;return J.cookie=g,g},remove:function(e,t,r){u.cookie.set(e,"",-1,t,!1,!1,r)}};var et=null,fn=function(e,t){if(et!==null&&!t)return et;var r=!0;try{e=e||window.localStorage;var n="__mplss_"+Qt(8),i="xyz";e.setItem(n,i),e.getItem(n)!==i&&(r=!1),e.removeItem(n)}catch{r=!1}return et=r,r};u.localStorage={is_supported:function(e){var t=fn(null,e);return t||te.error("localStorage unsupported; falling back to cookie store"),t},error:function(e){te.error("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(t){u.localStorage.error(t)}return null},parse:function(e){try{return u.JSONDecode(u.localStorage.get(e))||{}}catch{}return null},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){u.localStorage.error(r)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(t){u.localStorage.error(t)}}},u.register_event=function(){var e=function(n,i,o,s,a){if(!n){te.error("No valid element provided to register_event");return}if(n.addEventListener&&!s)n.addEventListener(i,o,!!a);else{var l="on"+i,c=n[l];n[l]=t(n,o,c)}};function t(n,i,o){var s=function(a){if(a=a||r(window.event),!!a){var l=!0,c,f;return u.isFunction(o)&&(c=o(a)),f=i.call(n,a),(c===!1||f===!1)&&(l=!1),l}};return s}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 hn=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');u.dom_query=function(){function e(i){return i.all?i.all:i.getElementsByTagName("*")}var t=/[\t\r\n]/g;function r(i,o){var s=" "+o+" ";return(" "+i.className+" ").replace(t," ").indexOf(s)>=0}function n(i){if(!J.getElementsByTagName)return[];var o=i.split(" "),s,a,l,c,f,h,g,p,d,C,y=[J];for(h=0;h<o.length;h++){if(s=o[h].replace(/^\s+/,"").replace(/\s+$/,""),s.indexOf("#")>-1){a=s.split("#"),l=a[0];var v=a[1],m=J.getElementById(v);if(!m||l&&m.nodeName.toLowerCase()!=l)return[];y=[m];continue}if(s.indexOf(".")>-1){a=s.split("."),l=a[0];var I=a[1];for(l||(l="*"),c=[],f=0,g=0;g<y.length;g++)for(l=="*"?d=e(y[g]):d=y[g].getElementsByTagName(l),p=0;p<d.length;p++)c[f++]=d[p];for(y=[],C=0,g=0;g<c.length;g++)c[g].className&&u.isString(c[g].className)&&r(c[g],I)&&(y[C++]=c[g]);continue}var b=s.match(hn);if(b){l=b[1];var R=b[2],D=b[3],N=b[4];for(l||(l="*"),c=[],f=0,g=0;g<y.length;g++)for(l=="*"?d=e(y[g]):d=y[g].getElementsByTagName(l),p=0;p<d.length;p++)c[f++]=d[p];y=[],C=0;var A;switch(D){case"=":A=function(T){return T.getAttribute(R)==N};break;case"~":A=function(T){return T.getAttribute(R).match(new RegExp("\\b"+N+"\\b"))};break;case"|":A=function(T){return T.getAttribute(R).match(new RegExp("^"+N+"-?"))};break;case"^":A=function(T){return T.getAttribute(R).indexOf(N)===0};break;case"$":A=function(T){return T.getAttribute(R).lastIndexOf(N)==T.getAttribute(R).length-N.length};break;case"*":A=function(T){return T.getAttribute(R).indexOf(N)>-1};break;default:A=function(T){return T.getAttribute(R)}}for(y=[],C=0,g=0;g<c.length;g++)A(c[g])&&(y[C++]=c[g]);continue}for(l=s,c=[],f=0,g=0;g<y.length;g++)for(d=y[g].getElementsByTagName(l),p=0;p<d.length;p++)c[f++]=d[p];y=c}return y}return function(i){return u.isElement(i)?[i]:u.isObject(i)&&!u.isUndefined(i.length)?i:n.call(this,i)}}();var gn=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],pn=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","ttclid","twclid","wbraid"];u.info={campaignParams:function(e){var t="",r={};return u.each(gn,function(n){t=u.getQueryParam(J.URL,n),t.length?r[n]=t:e!==void 0&&(r[n]=e)}),r},clickParams:function(){var e="",t={};return u.each(pn,function(r){e=u.getQueryParam(J.URL,r),e.length&&(t[r]=e)}),t},marketingParams:function(){return u.extend(u.info.campaignParams(),u.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=u.info.searchEngine(e),r=t!="yahoo"?"q":"p",n={};if(t!==null){n.$search_engine=t;var i=u.getQueryParam(e,r);i.length&&(n.mp_keyword=i)}return n},browser:function(e,t,r){return t=t||"",r||u.includes(e," OPR/")?u.includes(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":u.includes(e,"IEMobile")||u.includes(e,"WPDesktop")?"Internet Explorer Mobile":u.includes(e,"SamsungBrowser/")?"Samsung Internet":u.includes(e,"Edge")||u.includes(e,"Edg/")?"Microsoft Edge":u.includes(e,"FBIOS")?"Facebook Mobile":u.includes(e,"Chrome")?"Chrome":u.includes(e,"CriOS")?"Chrome iOS":u.includes(e,"UCWEB")||u.includes(e,"UCBrowser")?"UC Browser":u.includes(e,"FxiOS")?"Firefox iOS":u.includes(t,"Apple")?u.includes(e,"Mobile")?"Mobile Safari":"Safari":u.includes(e,"Android")?"Android Mobile":u.includes(e,"Konqueror")?"Konqueror":u.includes(e,"Firefox")?"Firefox":u.includes(e,"MSIE")||u.includes(e,"Trident/")?"Internet Explorer":u.includes(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,r){var n=u.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 s=e.match(o);return s?parseFloat(s[s.length-2]):null},os:function(){var e=fe;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 W.location.href},properties:function(e){return typeof e!="object"&&(e={}),u.extend(u.strip_empty_properties({$os:u.info.os(),$browser:u.info.browser(fe,Ne.vendor,Ve),$referrer:J.referrer,$referring_domain:u.info.referringDomain(J.referrer),$device:u.info.device(fe)}),{$current_url:u.info.currentUrl(),$browser_version:u.info.browserVersion(fe,Ne.vendor,Ve),$screen_height:Ke.height,$screen_width:Ke.width,mp_lib:"web",$lib_version:ln.LIB_VERSION,$insert_id:Qt(),time:u.timestamp()/1e3},u.strip_empty_properties(e))},people_properties:function(){return u.extend(u.strip_empty_properties({$os:u.info.os(),$browser:u.info.browser(fe,Ne.vendor,Ve)}),{$browser_version:u.info.browserVersion(fe,Ne.vendor,Ve)})},mpPageViewProperties:function(){return u.strip_empty_properties({current_page_title:J.title,current_domain:W.location.hostname,current_url_path:W.location.pathname,current_url_protocol:W.location.protocol,current_url_search:W.location.search})}};var Qt=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},mn=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,In=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,Xt=function(e){var t=In,r=e.split("."),n=r[r.length-1];(n.length>4||n==="com"||n==="org")&&(t=mn);var i=e.match(t);return i?i[0]:""},tt=null,rt=null;typeof JSON<"u"&&(tt=JSON.stringify,rt=JSON.parse),tt=tt||u.JSONEncode,rt=rt||u.JSONDecode,u.toArray=u.toArray,u.isObject=u.isObject,u.JSONEncode=u.JSONEncode,u.JSONDecode=u.JSONDecode,u.isBlockedUA=u.isBlockedUA,u.isEmptyObject=u.isEmptyObject,u.info=u.info,u.info.device=u.info.device,u.info.browser=u.info.browser,u.info.browserVersion=u.info.browserVersion,u.info.properties=u.info.properties;var Cn="__mp_opt_in_out_";function yn(e,t){if(wn(t))return te.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=An(e,t)==="0";return r&&te.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),r}function vn(e){return kn(e,function(t){return this.get_config(t)})}function Sn(e){return e=e||{},e.persistenceType==="localStorage"?u.localStorage:u.cookie}function bn(e,t){return t=t||{},(t.persistencePrefix||Cn)+e}function An(e,t){return Sn(t).get(bn(e,t))}function wn(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||W,r=t.navigator||{},n=!1;return u.each([r.doNotTrack,r.msDoNotTrack,t.doNotTrack],function(i){u.includes([!0,1,"1","yes"],i)&&(n=!0)}),n}function kn(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"),s=t.call(this,"opt_out_tracking_cookie_prefix"),a=t.call(this,"window");n&&(r=yn(n,{ignoreDnt:i,persistenceType:o,persistencePrefix:s,window:a}))}catch(c){te.error("Unexpected error when checking tracking opt-out status: "+c)}if(!r)return e.apply(this,arguments);var l=arguments[arguments.length-1];typeof l=="function"&&l(0)}}var nt=dn("recorder"),le=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=Ue};le.prototype.get_config=function(e){return this._mixpanel.get_config(e)},le.prototype.startRecording=function(){if(this._stopRecording!==null){nt.log("Recording already in progress, skipping startRecording.");return}this.recordMaxMs=this.get_config("record_max_ms"),this.recordMaxMs>Ue&&(this.recordMaxMs=Ue,nt.critical("record_max_ms cannot be greater than "+Ue+"ms. Capping value.")),this.recEvents=[],this.seqNo=0,this.startDate=new Date,this.replayStartTime=this.startDate.getTime(),this.batchStartTime=this.replayStartTime,this.replayId=u.UUID(),this.replayLengthMs=0;var e=u.bind(function(){clearTimeout(this.idleTimeoutId),this.idleTimeoutId=setTimeout(u.bind(function(){nt.log("Idle timeout reached, restarting recording."),this.resetRecording()},this),this.get_config("record_idle_timeout_ms"))},this);this._stopRecording=Me({emit:u.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")}),e(),this.sendBatchId=setInterval(u.bind(this.flushEventsWithOptOut,this),1e4),this.maxTimeoutId=setTimeout(u.bind(this.resetRecording,this),this.recordMaxMs)},le.prototype.resetRecording=function(){this.stopRecording(),this.startRecording()},le.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)},le.prototype.flushEventsWithOptOut=function(){this._flushEvents(u.bind(this._onOptOut,this))},le.prototype._onOptOut=function(e){e===0&&(this.recEvents=[],this.stopRecording())},le.prototype._flushEvents=vn(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:u.JSONEncode(t)}),this.recEvents=this.recEvents.slice(e),this.batchStartTime=new Date().getTime()}}),window.__mp_recorder=le})();
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})();