@highlight-run/rrweb 2.1.7 → 2.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/rrweb.js CHANGED
@@ -1,8 +1,8 @@
1
- var rrweb=function(q){"use strict";var R;(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"})(R||(R={}));function Ct(e){return e.nodeType===e.ELEMENT_NODE}function Re(e){var t=e?.host;return Boolean(t?.shadowRoot===e)}function De(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}var Qe=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-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 n=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(function(o){return n.removeNodeFromMap(o)})},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,n){var r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function It(){return new Qe}function Je(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,i=e.maskInputFn,a=o||"";return(t[n.toLowerCase()]||t[r])&&(i?a=i(a):a="*".repeat(a.length)),a}var Mt="__rrweb_original__";function tr(e){var t=e.getContext("2d");if(!t)return!0;for(var n=50,r=0;r<e.width;r+=n)for(var o=0;o<e.height;o+=n){var i=t.getImageData,a=Mt in i?i[Mt]:i,l=new Uint32Array(a.call(t,r,o,Math.min(n,e.width-r),Math.min(n,e.height-o)).data.buffer);if(l.some(function(c){return c!==0}))return!1}return!0}function qe(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var nr=1,rr=new RegExp("[^a-z0-9-_:]"),Oe=-2;function or(){return nr++}function ir(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return rr.test(t)?"div":t}function et(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(sr).join(""):null}catch{return null}}function sr(e){var t=e.cssText;if(ar(e))try{t=et(e.styleSheet)||t}catch{}return t}function ar(e){return"styleSheet"in e}function lr(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function cr(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var Se,xt,ur=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,dr=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,hr=/^(data:)([^,]*),(.*)/i;function Ve(e,t){return(e||"").replace(ur,function(n,r,o,i,a,l){var c=o||a||l,s=r||i||"";if(!c)return n;if(!dr.test(c)||hr.test(c))return"url(".concat(s).concat(c).concat(s,")");if(c[0]==="/")return"url(".concat(s).concat(cr(t)+c).concat(s,")");var u=t.split("/"),d=c.split("/");u.pop();for(var h=0,m=d;h<m.length;h++){var f=m[h];f!=="."&&(f===".."?u.pop():u.push(f))}return"url(".concat(s).concat(u.join("/")).concat(s,")")})}var mr=/^[^ \t\n\r\u000c]+/,pr=/^[, \t\n\r\u000c]+/;function fr(e,t){if(t.trim()==="")return t;var n=0;function r(s){var u,d=s.exec(t.substring(n));return d?(u=d[0],n+=u.length,u):""}for(var o=[];r(pr),!(n>=t.length);){var i=r(mr);if(i.slice(-1)===",")i=Ue(e,i.substring(0,i.length-1)),o.push(i);else{var a="";i=Ue(e,i);for(var l=!1;;){var c=t.charAt(n);if(c===""){o.push((i+a).trim());break}else if(l)c===")"&&(l=!1);else if(c===","){n+=1,o.push((i+a).trim());break}else c==="("&&(l=!0);a+=c,n+=1}}}return o.join(", ")}function Ue(e,t){if(!t||t.trim()==="")return t;var n=e.createElement("a");return n.href=t,n.href}function gr(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function tt(){var e=document.createElement("a");return e.href="",e.href}function kt(e,t,n,r){return n==="src"||n==="href"&&r&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r&&r[0]!=="#"||n==="background"&&r&&(t==="table"||t==="td"||t==="th")?Ue(e,r):n==="srcset"&&r?fr(e,r):n==="style"&&r?Ve(r,tt()):t==="object"&&n==="data"&&r?Ue(e,r):r}function Rt(e,t,n){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?e.matches(n):!1}function Ge(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?Ge(e.parentNode,t,n):!1;for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?Ge(e.parentNode,t,n):!1}function Dt(e,t,n){var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(r===null)return!1;if(typeof t=="string"){if(r.classList.contains(t)||r.closest(".".concat(t)))return!0}else if(Ge(r,t,!0))return!0;return!!(n&&(r.matches(n)||r.closest(n)))}function yr(e,t,n){var r=e.contentWindow;if(r){var o=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){var a=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()});return}var l="about:blank";if(r.location.href!==l||e.src===l||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function Ot(e){return e.getAttribute("href")?e.sheet!==null:!0}function Lt(e,t,n){var r=!1,o;try{o=e.sheet}catch{return}if(!o){var i=setTimeout(function(){r||(t(),r=!0)},n);e.addEventListener("load",function(){clearTimeout(i),r=!0,t()})}}function vr(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,c=t.inlineStylesheet,s=t.maskInputOptions,u=s===void 0?{}:s,d=t.maskTextFn,h=t.maskInputFn,m=t.dataURLOptions,f=m===void 0?{}:m,g=t.inlineImages,b=t.recordCanvas,p=t.keepIframeSrcFn,S=t.newlyAddedElement,T=S===void 0?!1:S,w=t.enableStrictPrivacy,C=br(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:R.Document,childNodes:[],compatMode:e.compatMode,rootId:C}:{type:R.Document,childNodes:[],rootId:C};case e.DOCUMENT_TYPE_NODE:return{type:R.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:C};case e.ELEMENT_NODE:return Tr(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:c,maskInputOptions:u,maskInputFn:h,maskTextClass:a,dataURLOptions:f,inlineImages:g,recordCanvas:b,keepIframeSrcFn:p,newlyAddedElement:T,enableStrictPrivacy:w,rootId:C});case e.TEXT_NODE:return Sr(e,{maskTextClass:a,maskTextSelector:l,maskTextFn:d,enableStrictPrivacy:w,rootId:C});case e.CDATA_SECTION_NODE:return{type:R.CDATA,textContent:"",rootId:C};case e.COMMENT_NODE:return{type:R.Comment,textContent:e.textContent||"",rootId:C};default:return!1}}function br(e,t){if(t.hasNode(e)){var n=t.getId(e);return n===1?void 0:n}}function Sr(e,t){var n,r=t.maskTextClass,o=t.maskTextSelector,i=t.maskTextFn,a=t.enableStrictPrivacy,l=t.rootId,c=e.parentNode&&e.parentNode.tagName,s=e.textContent,u=c==="STYLE"?!0:void 0,d=c==="SCRIPT"?!0:void 0,h=!1;if(u&&s){try{e.nextSibling||e.previousSibling||!((n=e.parentNode.sheet)===null||n===void 0)&&n.cssRules&&(s=lr(e.parentNode.sheet))}catch(f){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(f),e)}s=Ve(s,tt()),h=!0}if(d?(s="SCRIPT_PLACEHOLDER",h=!0):c==="NOSCRIPT"&&(s="",h=!0),!u&&!d&&s&&Dt(e,r,o)&&(s=i?i(s):s.replace(/[\S]/g,"*")),a&&!h&&c){var m=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!m.has(c)&&s&&(s=qe(s))}return{type:R.Text,textContent:s||"",isStyle:u,rootId:l}}function Tr(e,t){for(var n=t.doc,r=t.blockClass,o=t.blockSelector,i=t.inlineStylesheet,a=t.maskInputOptions,l=a===void 0?{}:a,c=t.maskInputFn,s=t.maskTextClass,u=t.dataURLOptions,d=u===void 0?{}:u,h=t.inlineImages,m=t.recordCanvas,f=t.keepIframeSrcFn,g=t.newlyAddedElement,b=g===void 0?!1:g,p=t.enableStrictPrivacy,S=t.rootId,T=Rt(e,r,o),w=Rt(e,s,null),C=ir(e),E={},_=e.attributes.length,A=0;A<_;A++){var P=e.attributes[A];E[P.name]=kt(n,C,P.name,P.value)}if(C==="link"&&i){var B=Array.from(n.styleSheets).find(function(N){return N.href===e.href}),L=null;B&&(L=et(B)),L&&(delete E.rel,delete E.href,E._cssText=Ve(L,B.href))}if(C==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var L=et(e.sheet);L&&(E._cssText=Ve(L,tt()))}if(C==="input"||C==="textarea"||C==="select"){var Q=e.value;E.type!=="radio"&&E.type!=="checkbox"&&E.type!=="submit"&&E.type!=="button"&&Q?E.value=Je({type:E.type,tagName:C,value:Q,maskInputOptions:l,maskInputFn:c}):e.checked&&(E.checked=e.checked)}if(C==="option"&&(e.selected&&!l.select?E.selected=!0:delete E.selected),C==="canvas"&&m){if(e.__context==="2d")tr(e)||(E.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var z=e.toDataURL(d.type,d.quality),te=document.createElement("canvas");te.width=e.width,te.height=e.height;var X=te.toDataURL(d.type,d.quality);z!==X&&(E.rr_dataURL=z)}}if(C==="img"&&h&&!T&&!w&&!p){Se||(Se=n.createElement("canvas"),xt=Se.getContext("2d"));var V=e,F=V.crossOrigin;V.crossOrigin="anonymous";var U=function(){try{Se.width=V.naturalWidth,Se.height=V.naturalHeight,xt.drawImage(V,0,0),E.rr_dataURL=Se.toDataURL(d.type,d.quality)}catch(N){console.warn("Cannot inline img src=".concat(V.currentSrc,"! Error: ").concat(N))}F?E.crossOrigin=F:V.removeAttribute("crossorigin")};V.complete&&V.naturalWidth!==0?U():V.onload=U}if((C==="audio"||C==="video")&&(E.rr_mediaState=e.paused?"paused":"played",E.rr_mediaCurrentTime=e.currentTime),b||(e.scrollLeft&&(E.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(E.rr_scrollTop=e.scrollTop)),T||w||C==="img"&&p){var v=e.getBoundingClientRect(),y=v.width,M=v.height;E={class:E.class,rr_width:"".concat(y,"px"),rr_height:"".concat(M,"px")},p&&(T=!0)}return C==="iframe"&&!f(E.src)&&(e.contentDocument||(E.rr_src=E.src),delete E.src),{type:R.Element,tagName:C,attributes:E,childNodes:[],isSVG:gr(e)||void 0,needBlock:T,needMask:w,rootId:S}}function $(e){return e===void 0?"":e.toLowerCase()}function Nr(e,t){return!!(t.comment&&e.type===R.Comment||e.type===R.Element&&(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"))||t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&($(e.attributes.name).match(/^msapplication-tile(image|color)$/)||$(e.attributes.name)==="application-name"||$(e.attributes.rel)==="icon"||$(e.attributes.rel)==="apple-touch-icon"||$(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&$(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&($(e.attributes.property).match(/^(og|twitter|fb):/)||$(e.attributes.name).match(/^(og|twitter):/)||$(e.attributes.name)==="pinterest")||t.headMetaRobots&&($(e.attributes.name)==="robots"||$(e.attributes.name)==="googlebot"||$(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&($(e.attributes.name)==="author"||$(e.attributes.name)==="generator"||$(e.attributes.name)==="framework"||$(e.attributes.name)==="publisher"||$(e.attributes.name)==="progid"||$(e.attributes.property).match(/^article:/)||$(e.attributes.property).match(/^product:/))||t.headMetaVerification&&($(e.attributes.name)==="google-site-verification"||$(e.attributes.name)==="yandex-verification"||$(e.attributes.name)==="csrf-token"||$(e.attributes.name)==="p:domain_verify"||$(e.attributes.name)==="verify-v1"||$(e.attributes.name)==="verification"||$(e.attributes.name)==="shopify-checkout-api-token"))))}function me(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,c=t.skipChild,s=c===void 0?!1:c,u=t.inlineStylesheet,d=u===void 0?!0:u,h=t.maskInputOptions,m=h===void 0?{}:h,f=t.maskTextFn,g=t.maskInputFn,b=t.slimDOMOptions,p=t.dataURLOptions,S=p===void 0?{}:p,T=t.inlineImages,w=T===void 0?!1:T,C=t.recordCanvas,E=C===void 0?!1:C,_=t.onSerialize,A=t.onIframeLoad,P=t.iframeLoadTimeout,B=P===void 0?5e3:P,L=t.onStylesheetLoad,Q=t.stylesheetLoadTimeout,z=Q===void 0?5e3:Q,te=t.keepIframeSrcFn,X=te===void 0?function(){return!1}:te,V=t.newlyAddedElement,F=V===void 0?!1:V,U=t.enableStrictPrivacy,v=t.preserveWhiteSpace,y=v===void 0?!0:v,M=vr(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,inlineStylesheet:d,maskInputOptions:m,maskTextFn:f,maskInputFn:g,dataURLOptions:S,inlineImages:w,recordCanvas:E,keepIframeSrcFn:X,newlyAddedElement:F,enableStrictPrivacy:U});if(!M)return console.warn(e,"not serialized"),null;var N;if(r.hasNode(e)?N=r.getId(e):Nr(M,b)||!y&&M.type===R.Text&&!M.isStyle&&!M.textContent.replace(/^\s+|\s+$/gm,"").length?N=Oe:N=or(),N===Oe)return null;var I=Object.assign(M,{id:N});r.add(e,I),_&&_(e);var K=!s,J=U;if(I.type===R.Element){if(K=K&&!I.needBlock,J=U||!!I.needBlock||!!I.needMask,J&&I.tagName==="img"){var le=e.cloneNode();le.src="",r.add(le,I)}delete I.needBlock,delete I.needMask;var W=e.shadowRoot;W&&De(W)&&(I.isShadowHost=!0)}if((I.type===R.Document||I.type===R.Element)&&K){b.headWhitespace&&I.type===R.Element&&I.tagName==="head"&&(y=!1);for(var j={doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:s,inlineStylesheet:d,maskInputOptions:m,maskTextFn:f,maskInputFn:g,slimDOMOptions:b,dataURLOptions:S,inlineImages:w,recordCanvas:E,preserveWhiteSpace:y,onSerialize:_,onIframeLoad:A,iframeLoadTimeout:B,onStylesheetLoad:L,stylesheetLoadTimeout:z,keepIframeSrcFn:X,enableStrictPrivacy:J},be=0,Qn=Array.from(e.childNodes);be<Qn.length;be++){var Et=Qn[be],ke=me(Et,j);ke&&I.childNodes.push(ke)}if(Ct(e)&&e.shadowRoot)for(var wt=0,Jn=Array.from(e.shadowRoot.childNodes);wt<Jn.length;wt++){var Et=Jn[wt],ke=me(Et,j);ke&&(De(e.shadowRoot)&&(ke.isShadow=!0),I.childNodes.push(ke))}}return e.parentNode&&Re(e.parentNode)&&De(e.parentNode)&&(I.isShadow=!0),I.type===R.Element&&I.tagName==="iframe"&&yr(e,function(){var de=e.contentDocument;if(de&&A){var qn=me(de,{doc:de,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:f,maskInputFn:g,slimDOMOptions:b,dataURLOptions:S,inlineImages:w,recordCanvas:E,preserveWhiteSpace:y,onSerialize:_,onIframeLoad:A,iframeLoadTimeout:B,onStylesheetLoad:L,stylesheetLoadTimeout:z,keepIframeSrcFn:X,enableStrictPrivacy:U});qn&&A(e,qn)}},B),I.type===R.Element&&I.tagName==="link"&&I.attributes.rel==="stylesheet"&&(Lt(e,function(){if(L){var de=me(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:f,maskInputFn:g,slimDOMOptions:b,dataURLOptions:S,inlineImages:w,recordCanvas:E,preserveWhiteSpace:y,onSerialize:_,onIframeLoad:A,iframeLoadTimeout:B,onStylesheetLoad:L,stylesheetLoadTimeout:z,keepIframeSrcFn:X,enableStrictPrivacy:U});de&&L(e,de)}},z),Ot(e)===!1)||I.type===R.Element&&I.tagName==="link"&&I.attributes.rel==="stylesheet"&&(Lt(e,function(){if(L){var de=me(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:f,maskInputFn:g,slimDOMOptions:b,dataURLOptions:S,inlineImages:w,recordCanvas:E,preserveWhiteSpace:y,onSerialize:_,onIframeLoad:A,iframeLoadTimeout:B,enableStrictPrivacy:U,onStylesheetLoad:L,stylesheetLoadTimeout:z,keepIframeSrcFn:X});de&&L(e,de)}},z),Ot(e)===!1)?null:I}function Er(e,t){var n=t||{},r=n.mirror,o=r===void 0?new Qe:r,i=n.blockClass,a=i===void 0?"highlight-block":i,l=n.blockSelector,c=l===void 0?null:l,s=n.maskTextClass,u=s===void 0?"highlight-mask":s,d=n.maskTextSelector,h=d===void 0?null:d,m=n.inlineStylesheet,f=m===void 0?!0:m,g=n.inlineImages,b=g===void 0?!1:g,p=n.recordCanvas,S=p===void 0?!1:p,T=n.maskAllInputs,w=T===void 0?!1:T,C=n.maskTextFn,E=n.maskInputFn,_=n.slimDOM,A=_===void 0?!1:_,P=n.dataURLOptions,B=n.preserveWhiteSpace,L=n.onSerialize,Q=n.onIframeLoad,z=n.iframeLoadTimeout,te=n.onStylesheetLoad,X=n.stylesheetLoadTimeout,V=n.keepIframeSrcFn,F=V===void 0?function(){return!1}:V,U=n.enableStrictPrivacy,v=U===void 0?!1:U,y=w===!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}:w===!1?{password:!0}:w,M=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 me(e,{doc:e,mirror:o,blockClass:a,blockSelector:c,maskTextClass:u,maskTextSelector:h,skipChild:!1,inlineStylesheet:f,maskInputOptions:y,maskTextFn:C,maskInputFn:E,slimDOMOptions:M,dataURLOptions:P,inlineImages:b,recordCanvas:S,preserveWhiteSpace:B,onSerialize:L,onIframeLoad:Q,iframeLoadTimeout:z,onStylesheetLoad:te,stylesheetLoadTimeout:X,keepIframeSrcFn:F,newlyAddedElement:!1,enableStrictPrivacy:v})}var At=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function wr(e,t){t===void 0&&(t={});var n=1,r=1;function o(v){var y=v.match(/\n/g);y&&(n+=y.length);var M=v.lastIndexOf(`
2
- `);r=M===-1?r+v.length:v.length-M}function i(){var v={line:n,column:r};return function(y){return y.position=new a(v),f(),y}}var a=function(){function v(y){this.start=y,this.end={line:n,column:r},this.source=t.source}return v}();a.prototype.content=e;var l=[];function c(v){var y=new Error("".concat(t.source||"",":").concat(n,":").concat(r,": ").concat(v));if(y.reason=v,y.filename=t.source,y.line=n,y.column=r,y.source=e,t.silent)l.push(y);else throw y}function s(){var v=h();return{type:"stylesheet",stylesheet:{source:t.source,rules:v,parsingErrors:l}}}function u(){return m(/^{\s*/)}function d(){return m(/^}/)}function h(){var v,y=[];for(f(),g(y);e.length&&e.charAt(0)!=="}"&&(v=F()||U());)v!==!1&&(y.push(v),g(y));return y}function m(v){var y=v.exec(e);if(y){var M=y[0];return o(M),e=e.slice(M.length),y}}function f(){m(/^\s*/)}function g(v){v===void 0&&(v=[]);for(var y;y=b();)y!==!1&&v.push(y),y=b();return v}function b(){var v=i();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var y=2;e.charAt(y)!==""&&(e.charAt(y)!=="*"||e.charAt(y+1)!=="/");)++y;if(y+=2,e.charAt(y-1)==="")return c("End of comment missing");var M=e.slice(2,y-2);return r+=2,o(M),e=e.slice(y),r+=2,v({type:"comment",comment:M})}}function p(){var v=m(/^([^{]+)/);if(v)return ce(v[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(y){return y.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(y){return y.replace(/\u200C/g,",")})}function S(){var v=i(),y=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(y){var M=ce(y[0]);if(!m(/^:\s*/))return c("property missing ':'");var N=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),I=v({type:"declaration",property:M.replace(At,""),value:N?ce(N[0]).replace(At,""):""});return m(/^[;\s]*/),I}}function T(){var v=[];if(!u())return c("missing '{'");g(v);for(var y;y=S();)y!==!1&&(v.push(y),g(v)),y=S();return d()?v:c("missing '}'")}function w(){for(var v,y=[],M=i();v=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)y.push(v[1]),m(/^,\s*/);if(y.length)return M({type:"keyframe",values:y,declarations:T()})}function C(){var v=i(),y=m(/^@([-\w]+)?keyframes\s*/);if(y){var M=y[1];if(y=m(/^([-\w]+)\s*/),!y)return c("@keyframes missing name");var N=y[1];if(!u())return c("@keyframes missing '{'");for(var I,K=g();I=w();)K.push(I),K=K.concat(g());return d()?v({type:"keyframes",name:N,vendor:M,keyframes:K}):c("@keyframes missing '}'")}}function E(){var v=i(),y=m(/^@supports *([^{]+)/);if(y){var M=ce(y[1]);if(!u())return c("@supports missing '{'");var N=g().concat(h());return d()?v({type:"supports",supports:M,rules:N}):c("@supports missing '}'")}}function _(){var v=i(),y=m(/^@host\s*/);if(y){if(!u())return c("@host missing '{'");var M=g().concat(h());return d()?v({type:"host",rules:M}):c("@host missing '}'")}}function A(){var v=i(),y=m(/^@media *([^{]+)/);if(y){var M=ce(y[1]);if(!u())return c("@media missing '{'");var N=g().concat(h());return d()?v({type:"media",media:M,rules:N}):c("@media missing '}'")}}function P(){var v=i(),y=m(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(y)return v({type:"custom-media",name:ce(y[1]),media:ce(y[2])})}function B(){var v=i(),y=m(/^@page */);if(y){var M=p()||[];if(!u())return c("@page missing '{'");for(var N=g(),I;I=S();)N.push(I),N=N.concat(g());return d()?v({type:"page",selectors:M,declarations:N}):c("@page missing '}'")}}function L(){var v=i(),y=m(/^@([-\w]+)?document *([^{]+)/);if(y){var M=ce(y[1]),N=ce(y[2]);if(!u())return c("@document missing '{'");var I=g().concat(h());return d()?v({type:"document",document:N,vendor:M,rules:I}):c("@document missing '}'")}}function Q(){var v=i(),y=m(/^@font-face\s*/);if(y){if(!u())return c("@font-face missing '{'");for(var M=g(),N;N=S();)M.push(N),M=M.concat(g());return d()?v({type:"font-face",declarations:M}):c("@font-face missing '}'")}}var z=V("import"),te=V("charset"),X=V("namespace");function V(v){var y=new RegExp("^@"+v+"\\s*([^;]+);");return function(){var M=i(),N=m(y);if(N){var I={type:v};return I[v]=N[1].trim(),M(I)}}}function F(){if(e[0]==="@")return C()||A()||P()||E()||z()||te()||X()||L()||B()||_()||Q()}function U(){var v=i(),y=p();return y?(g(),v({type:"rule",selectors:y,declarations:T()})):c("selector missing")}return nt(s())}function ce(e){return e?e.replace(/^\s+|\s+$/g,""):""}function nt(e,t){for(var n=e&&typeof e.type=="string",r=n?e:t,o=0,i=Object.keys(e);o<i.length;o++){var a=i[o],l=e[a];Array.isArray(l)?l.forEach(function(c){nt(c,r)}):l&&typeof l=="object"&&nt(l,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Pt={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function Cr(e){var t=Pt[e.tagName]?Pt[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function Ir(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Ft=/([^\\]):hover/,Mr=new RegExp(Ft.source,"g");function _t(e,t){var n;if(!(!((n=window?.HIG_CONFIGURATION)===null||n===void 0)&&n.enableOnHoverClass))return e;var r=t?.stylesWithHoverClass.get(e);if(r)return r;var o=wr(e,{silent:!0});if(!o.stylesheet)return e;var i=[];if(o.stylesheet.rules.forEach(function(c){"selectors"in c&&(c.selectors||[]).forEach(function(s){Ft.test(s)&&i.push(s)})}),i.length===0)return e;var a=new RegExp(i.filter(function(c,s){return i.indexOf(c)===s}).sort(function(c,s){return s.length-c.length}).map(function(c){return Ir(c)}).join("|"),"g"),l=e.replace(a,function(c){var s=c.replace(Mr,"$1.\\:hover");return"".concat(c,", ").concat(s)});return t?.stylesWithHoverClass.set(e,l),l}function Wt(){var e=new Map;return{stylesWithHoverClass:e}}function xr(e,t){var n=t.doc,r=t.hackCss,o=t.cache;switch(e.type){case R.Document:return n.implementation.createDocument(null,"",null);case R.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case R.Element:{var i=Cr(e),a;e.isSVG?a=n.createElementNS("http://www.w3.org/2000/svg",i):a=n.createElement(i);var l=function(d){if(!Object.prototype.hasOwnProperty.call(e.attributes,d))return"continue";var h=e.attributes[d];if(i==="option"&&d==="selected"&&h===!1)return"continue";if(h=typeof h=="boolean"||typeof h=="number"?"":h,d.startsWith("rr_")){if(i==="canvas"&&d==="rr_dataURL"){var m=document.createElement("img");m.onload=function(){var P=a.getContext("2d");P&&P.drawImage(m,0,0,m.width,m.height)},m.src=h,a.RRNodeType&&(a.rr_dataURL=h)}else if(i==="img"&&d==="rr_dataURL"){var f=a;f.currentSrc.startsWith("data:")||(f.setAttribute("rrweb-original-src",e.attributes.src),f.src=h,f.setAttribute("rrweb-inline-src",h))}if(d==="rr_width")a.style.width=h;else if(d==="rr_height")a.style.height=h;else if(d==="rr_mediaCurrentTime")a.currentTime=e.attributes.rr_mediaCurrentTime;else if(d==="rr_mediaState")switch(h){case"played":a.play().catch(function(P){return console.warn("media playback error",P)});break;case"paused":a.pause();break}}else{var g=i==="textarea"&&d==="value",b=i==="style"&&d==="_cssText";if(b&&r&&(h=_t(h,o),typeof h=="string")){for(var p=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,S=void 0,T=[],w="https://replay-cors-proxy.highlightrun.workers.dev";(S=p.exec(h))!==null;)S.index===p.lastIndex&&p.lastIndex++,S.forEach(function(P,B){if(B===0){var L=P.slice(5,P.length-2);T.push({originalUrl:L,proxyUrl:L.replace(L,"".concat(w,"?url=").concat(L))})}});T.forEach(function(P){h=h.replace(P.originalUrl,P.proxyUrl)})}if(g||b){for(var C=n.createTextNode(h),E=0,_=Array.from(a.childNodes);E<_.length;E++){var A=_[E];A.nodeType===a.TEXT_NODE&&a.removeChild(A)}return a.appendChild(C),"continue"}try{if(e.isSVG&&d==="xlink:href")a.setAttributeNS("http://www.w3.org/1999/xlink",d,h);else if(d==="onload"||d==="onclick"||d.substring(0,7)==="onmouse")a.setAttribute("_"+d,h);else{if(i==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&d==="content")return a.setAttribute("csp-content",h),"continue";i==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||i==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")||(i==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?a.setAttribute("rrweb-original-srcset",e.attributes.srcset):a.setAttribute(d,h))}}catch{}}};for(var c in e.attributes)l(c);if(i==="img"){var s=a;if(!s.currentSrc.startsWith("data:")){var u=s.getAttribute("rrweb-inline-src");u!=null&&u.startsWith("data:")&&(s.src=u)}}if(e.isShadowHost)if(!a.shadowRoot)a.attachShadow({mode:"open"});else for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);return a}case R.Text:return n.createTextNode(e.isStyle&&r?_t(e.textContent,o):e.textContent);case R.CDATA:return n.createCDATASection(e.textContent);case R.Comment:return n.createComment(e.textContent);default:return null}}function je(e,t){var n=t.doc,r=t.mirror,o=t.skipChild,i=o===void 0?!1:o,a=t.hackCss,l=a===void 0?!0:a,c=t.afterAppend,s=t.cache,u=xr(e,{doc:n,hackCss:l,cache:s});if(!u)return null;if(e.rootId&&console.assert(r.getNode(e.rootId)===n,"Target document should have the same root id."),e.type===R.Document&&(n.close(),n.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==R.DocumentType&&(e.childNodes[0].type===R.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=n),r.add(u,e),(e.type===R.Document||e.type===R.Element)&&!i)for(var d=0,h=e.childNodes;d<h.length;d++){var m=h[d],f=je(m,{doc:n,mirror:r,skipChild:!1,hackCss:l,afterAppend:c,cache:s});if(!f){console.warn("Failed to rebuild",m);continue}m.isShadow&&Ct(u)&&u.shadowRoot?u.shadowRoot.appendChild(f):u.appendChild(f),c&&c(f)}return u}function kr(e,t){function n(a){t(a)}for(var r=0,o=e.getIds();r<o.length;r++){var i=o[r];e.has(i)&&n(e.getNode(i))}}function Rr(e,t){var n=t.getMeta(e);if(n?.type===R.Element){var r=e;for(var o in n.attributes)if(Object.prototype.hasOwnProperty.call(n.attributes,o)&&o.startsWith("rr_")){var i=n.attributes[o];o==="rr_scrollLeft"&&(r.scrollLeft=i),o==="rr_scrollTop"&&(r.scrollTop=i)}}}function Dr(e,t){var n=t.doc,r=t.onVisit,o=t.hackCss,i=o===void 0?!0:o,a=t.afterAppend,l=t.cache,c=t.mirror,s=c===void 0?new Qe:c,u=je(e,{doc:n,mirror:s,skipChild:!1,hackCss:i,afterAppend:a,cache:l});return kr(s,function(d){r&&r(d),Rr(d,s)}),u}function ee(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const Te=`Please stop import mirror directly. Instead of that,\r
1
+ var rrweb=function(ee){"use strict";var D;(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"})(D||(D={}));function It(e){return e.nodeType===e.ELEMENT_NODE}function Le(e){var t=e?.host;return Boolean(t?.shadowRoot===e)}function Ae(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}var et=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-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 n=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(function(o){return n.removeNodeFromMap(o)})},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,n){var r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function Mt(){return new et}function tt(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,i=e.maskInputFn,a=o||"";return(t[n.toLowerCase()]||t[r])&&(i?a=i(a):a="*".repeat(a.length)),a}var xt="__rrweb_original__";function tr(e){var t=e.getContext("2d");if(!t)return!0;for(var n=50,r=0;r<e.width;r+=n)for(var o=0;o<e.height;o+=n){var i=t.getImageData,a=xt in i?i[xt]:i,l=new Uint32Array(a.call(t,r,o,Math.min(n,e.width-r),Math.min(n,e.height-o)).data.buffer);if(l.some(function(c){return c!==0}))return!1}return!0}function nt(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var nr=1,rr=new RegExp("[^a-z0-9-_:]"),Fe=-2;function or(){return nr++}function ir(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return rr.test(t)?"div":t}function rt(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(sr).join(""):null}catch{return null}}function sr(e){var t=e.cssText;if(ar(e))try{t=rt(e.styleSheet)||t}catch{}return t}function ar(e){return"styleSheet"in e}function lr(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function cr(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var we,kt,ur=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,dr=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,hr=/^(data:)([^,]*),(.*)/i;function je(e,t){return(e||"").replace(ur,function(n,r,o,i,a,l){var c=o||a||l,s=r||i||"";if(!c)return n;if(!dr.test(c)||hr.test(c))return"url(".concat(s).concat(c).concat(s,")");if(c[0]==="/")return"url(".concat(s).concat(cr(t)+c).concat(s,")");var u=t.split("/"),d=c.split("/");u.pop();for(var h=0,m=d;h<m.length;h++){var g=m[h];g!=="."&&(g===".."?u.pop():u.push(g))}return"url(".concat(s).concat(u.join("/")).concat(s,")")})}var mr=/^[^ \t\n\r\u000c]+/,pr=/^[, \t\n\r\u000c]+/;function fr(e,t){if(t.trim()==="")return t;var n=0;function r(s){var u,d=s.exec(t.substring(n));return d?(u=d[0],n+=u.length,u):""}for(var o=[];r(pr),!(n>=t.length);){var i=r(mr);if(i.slice(-1)===",")i=ze(e,i.substring(0,i.length-1)),o.push(i);else{var a="";i=ze(e,i);for(var l=!1;;){var c=t.charAt(n);if(c===""){o.push((i+a).trim());break}else if(l)c===")"&&(l=!1);else if(c===","){n+=1,o.push((i+a).trim());break}else c==="("&&(l=!0);a+=c,n+=1}}}return o.join(", ")}function ze(e,t){if(!t||t.trim()==="")return t;var n=e.createElement("a");return n.href=t,n.href}function gr(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function ot(){var e=document.createElement("a");return e.href="",e.href}function Dt(e,t,n,r){return n==="src"||n==="href"&&r&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r&&r[0]!=="#"||n==="background"&&r&&(t==="table"||t==="td"||t==="th")?ze(e,r):n==="srcset"&&r?fr(e,r):n==="style"&&r?je(r,ot()):t==="object"&&n==="data"&&r?ze(e,r):r}function Rt(e,t,n){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?e.matches(n):!1}function Be(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?Be(e.parentNode,t,n):!1;for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?Be(e.parentNode,t,n):!1}function Ot(e,t,n){var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(r===null)return!1;if(typeof t=="string"){if(r.classList.contains(t)||r.closest(".".concat(t)))return!0}else if(Be(r,t,!0))return!0;return!!(n&&(r.matches(n)||r.closest(n)))}function vr(e,t,n){var r=e.contentWindow;if(r){var o=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){var a=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()});return}var l="about:blank";if(r.location.href!==l||e.src===l||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function Lt(e){return e.getAttribute("href")?e.sheet!==null:!0}function At(e,t,n){var r=!1,o;try{o=e.sheet}catch{return}if(!o){var i=setTimeout(function(){r||(t(),r=!0)},n);e.addEventListener("load",function(){clearTimeout(i),r=!0,t()})}}function yr(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,c=t.inlineStylesheet,s=t.maskInputOptions,u=s===void 0?{}:s,d=t.maskTextFn,h=t.maskInputFn,m=t.dataURLOptions,g=m===void 0?{}:m,p=t.inlineImages,S=t.recordCanvas,f=t.keepIframeSrcFn,y=t.newlyAddedElement,N=y===void 0?!1:y,E=t.enableStrictPrivacy,T=br(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:D.Document,childNodes:[],compatMode:e.compatMode,rootId:T}:{type:D.Document,childNodes:[],rootId:T};case e.DOCUMENT_TYPE_NODE:return{type:D.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:T};case e.ELEMENT_NODE:return Tr(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:c,maskInputOptions:u,maskInputFn:h,maskTextClass:a,dataURLOptions:g,inlineImages:p,recordCanvas:S,keepIframeSrcFn:f,newlyAddedElement:N,enableStrictPrivacy:E,rootId:T});case e.TEXT_NODE:return Sr(e,{maskTextClass:a,maskTextSelector:l,maskTextFn:d,enableStrictPrivacy:E,rootId:T});case e.CDATA_SECTION_NODE:return{type:D.CDATA,textContent:"",rootId:T};case e.COMMENT_NODE:return{type:D.Comment,textContent:e.textContent||"",rootId:T};default:return!1}}function br(e,t){if(t.hasNode(e)){var n=t.getId(e);return n===1?void 0:n}}function Sr(e,t){var n,r=t.maskTextClass,o=t.maskTextSelector,i=t.maskTextFn,a=t.enableStrictPrivacy,l=t.rootId,c=e.parentNode&&e.parentNode.tagName,s=e.textContent,u=c==="STYLE"?!0:void 0,d=c==="SCRIPT"?!0:void 0,h=!1;if(u&&s){try{e.nextSibling||e.previousSibling||!((n=e.parentNode.sheet)===null||n===void 0)&&n.cssRules&&(s=lr(e.parentNode.sheet))}catch(g){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(g),e)}s=je(s,ot()),h=!0}if(d?(s="SCRIPT_PLACEHOLDER",h=!0):c==="NOSCRIPT"&&(s="",h=!0),!u&&!d&&s&&Ot(e,r,o)&&(s=i?i(s):s.replace(/[\S]/g,"*")),a&&!h&&c){var m=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!m.has(c)&&s&&(s=nt(s))}return{type:D.Text,textContent:s||"",isStyle:u,rootId:l}}function Tr(e,t){for(var n=t.doc,r=t.blockClass,o=t.blockSelector,i=t.inlineStylesheet,a=t.maskInputOptions,l=a===void 0?{}:a,c=t.maskInputFn,s=t.maskTextClass,u=t.dataURLOptions,d=u===void 0?{}:u,h=t.inlineImages,m=t.recordCanvas,g=t.keepIframeSrcFn,p=t.newlyAddedElement,S=p===void 0?!1:p,f=t.enableStrictPrivacy,y=t.rootId,N=Rt(e,r,o),E=Rt(e,s,null),T=ir(e),w={},P=e.attributes.length,W=0;W<P;W++){var V=e.attributes[W];w[V.name]=Dt(n,T,V.name,V.value)}if(T==="link"&&i){var z=Array.from(n.styleSheets).find(function(k){return k.href===e.href}),A=null;z&&(A=rt(z)),A&&(delete w.rel,delete w.href,w._cssText=je(A,z.href))}if(T==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var A=rt(e.sheet);A&&(w._cssText=je(A,ot()))}if(T==="input"||T==="textarea"||T==="select"){var K=e.value;w.type!=="radio"&&w.type!=="checkbox"&&w.type!=="submit"&&w.type!=="button"&&K?w.value=tt({type:w.type,tagName:T,value:K,maskInputOptions:l,maskInputFn:c}):e.checked&&(w.checked=e.checked)}if(T==="option"&&(e.selected&&!l.select?w.selected=!0:delete w.selected),T==="canvas"&&m){if(e.__context==="2d")tr(e)||(w.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var B=e.toDataURL(d.type,d.quality),J=document.createElement("canvas");J.width=e.width,J.height=e.height;var Q=J.toDataURL(d.type,d.quality);B!==Q&&(w.rr_dataURL=B)}}if(T==="img"&&h&&!N&&!E&&!f){we||(we=n.createElement("canvas"),kt=we.getContext("2d"));var U=e,F=U.crossOrigin;U.crossOrigin="anonymous";var Y=function(){try{we.width=U.naturalWidth,we.height=U.naturalHeight,kt.drawImage(U,0,0),w.rr_dataURL=we.toDataURL(d.type,d.quality)}catch(k){console.warn("Cannot inline img src=".concat(U.currentSrc,"! Error: ").concat(k))}F?w.crossOrigin=F:U.removeAttribute("crossorigin")};U.complete&&U.naturalWidth!==0?Y():U.onload=Y}if((T==="audio"||T==="video")&&(w.rr_mediaState=e.paused?"paused":"played",w.rr_mediaCurrentTime=e.currentTime),S||(e.scrollLeft&&(w.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(w.rr_scrollTop=e.scrollTop)),N||E||T==="img"&&f){var b=e.getBoundingClientRect(),v=b.width,I=b.height;w={class:w.class,rr_width:"".concat(v,"px"),rr_height:"".concat(I,"px")},f&&(N=!0)}return T==="iframe"&&!g(w.src)&&(e.contentDocument||(w.rr_src=w.src),delete w.src),{type:D.Element,tagName:T,attributes:w,childNodes:[],isSVG:gr(e)||void 0,needBlock:N,needMask:E,rootId:y}}function $(e){return e===void 0?"":e.toLowerCase()}function Nr(e,t){return!!(t.comment&&e.type===D.Comment||e.type===D.Element&&(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"))||t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&($(e.attributes.name).match(/^msapplication-tile(image|color)$/)||$(e.attributes.name)==="application-name"||$(e.attributes.rel)==="icon"||$(e.attributes.rel)==="apple-touch-icon"||$(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&$(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&($(e.attributes.property).match(/^(og|twitter|fb):/)||$(e.attributes.name).match(/^(og|twitter):/)||$(e.attributes.name)==="pinterest")||t.headMetaRobots&&($(e.attributes.name)==="robots"||$(e.attributes.name)==="googlebot"||$(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&($(e.attributes.name)==="author"||$(e.attributes.name)==="generator"||$(e.attributes.name)==="framework"||$(e.attributes.name)==="publisher"||$(e.attributes.name)==="progid"||$(e.attributes.property).match(/^article:/)||$(e.attributes.property).match(/^product:/))||t.headMetaVerification&&($(e.attributes.name)==="google-site-verification"||$(e.attributes.name)==="yandex-verification"||$(e.attributes.name)==="csrf-token"||$(e.attributes.name)==="p:domain_verify"||$(e.attributes.name)==="verify-v1"||$(e.attributes.name)==="verification"||$(e.attributes.name)==="shopify-checkout-api-token"))))}function ge(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,c=t.skipChild,s=c===void 0?!1:c,u=t.inlineStylesheet,d=u===void 0?!0:u,h=t.maskInputOptions,m=h===void 0?{}:h,g=t.maskTextFn,p=t.maskInputFn,S=t.slimDOMOptions,f=t.dataURLOptions,y=f===void 0?{}:f,N=t.inlineImages,E=N===void 0?!1:N,T=t.recordCanvas,w=T===void 0?!1:T,P=t.onSerialize,W=t.onIframeLoad,V=t.iframeLoadTimeout,z=V===void 0?5e3:V,A=t.onStylesheetLoad,K=t.stylesheetLoadTimeout,B=K===void 0?5e3:K,J=t.keepIframeSrcFn,Q=J===void 0?function(){return!1}:J,U=t.newlyAddedElement,F=U===void 0?!1:U,Y=t.enableStrictPrivacy,b=t.preserveWhiteSpace,v=b===void 0?!0:b,I=yr(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,inlineStylesheet:d,maskInputOptions:m,maskTextFn:g,maskInputFn:p,dataURLOptions:y,inlineImages:E,recordCanvas:w,keepIframeSrcFn:Q,newlyAddedElement:F,enableStrictPrivacy:Y});if(!I)return console.warn(e,"not serialized"),null;var k;if(r.hasNode(e)?k=r.getId(e):Nr(I,S)||!v&&I.type===D.Text&&!I.isStyle&&!I.textContent.replace(/^\s+|\s+$/gm,"").length?k=Fe:k=or(),k===Fe)return null;var M=Object.assign(I,{id:k});r.add(e,M),P&&P(e);var ae=!s,Ne=Y;if(M.type===D.Element){if(ae=ae&&!M.needBlock,Ne=Y||!!M.needBlock||!!M.needMask,Ne&&M.tagName==="img"){var O=e.cloneNode();O.src="",r.add(O,M)}delete M.needBlock,delete M.needMask;var re=e.shadowRoot;re&&Ae(re)&&(M.isShadowHost=!0)}if((M.type===D.Document||M.type===D.Element)&&ae){S.headWhitespace&&M.type===D.Element&&M.tagName==="head"&&(v=!1);for(var le={doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:s,inlineStylesheet:d,maskInputOptions:m,maskTextFn:g,maskInputFn:p,slimDOMOptions:S,dataURLOptions:y,inlineImages:E,recordCanvas:w,preserveWhiteSpace:v,onSerialize:P,onIframeLoad:W,iframeLoadTimeout:z,onStylesheetLoad:A,stylesheetLoadTimeout:B,keepIframeSrcFn:Q,enableStrictPrivacy:Ne},q=0,de=Array.from(e.childNodes);q<de.length;q++){var _=de[q],G=ge(_,le);G&&M.childNodes.push(G)}if(It(e)&&e.shadowRoot)for(var Ee=0,Jn=Array.from(e.shadowRoot.childNodes);Ee<Jn.length;Ee++){var _=Jn[Ee],G=ge(_,le);G&&(Ae(e.shadowRoot)&&(G.isShadow=!0),M.childNodes.push(G))}}return e.parentNode&&Le(e.parentNode)&&Ae(e.parentNode)&&(M.isShadow=!0),M.type===D.Element&&M.tagName==="iframe"&&vr(e,function(){var pe=e.contentDocument;if(pe&&W){var qn=ge(pe,{doc:pe,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:g,maskInputFn:p,slimDOMOptions:S,dataURLOptions:y,inlineImages:E,recordCanvas:w,preserveWhiteSpace:v,onSerialize:P,onIframeLoad:W,iframeLoadTimeout:z,onStylesheetLoad:A,stylesheetLoadTimeout:B,keepIframeSrcFn:Q,enableStrictPrivacy:Y});qn&&W(e,qn)}},z),M.type===D.Element&&M.tagName==="link"&&M.attributes.rel==="stylesheet"&&(At(e,function(){if(A){var pe=ge(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:g,maskInputFn:p,slimDOMOptions:S,dataURLOptions:y,inlineImages:E,recordCanvas:w,preserveWhiteSpace:v,onSerialize:P,onIframeLoad:W,iframeLoadTimeout:z,onStylesheetLoad:A,stylesheetLoadTimeout:B,keepIframeSrcFn:Q,enableStrictPrivacy:Y});pe&&A(e,pe)}},B),Lt(e)===!1)||M.type===D.Element&&M.tagName==="link"&&M.attributes.rel==="stylesheet"&&(At(e,function(){if(A){var pe=ge(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:g,maskInputFn:p,slimDOMOptions:S,dataURLOptions:y,inlineImages:E,recordCanvas:w,preserveWhiteSpace:v,onSerialize:P,onIframeLoad:W,iframeLoadTimeout:z,enableStrictPrivacy:Y,onStylesheetLoad:A,stylesheetLoadTimeout:B,keepIframeSrcFn:Q});pe&&A(e,pe)}},B),Lt(e)===!1)?null:M}function Er(e,t){var n=t||{},r=n.mirror,o=r===void 0?new et:r,i=n.blockClass,a=i===void 0?"highlight-block":i,l=n.blockSelector,c=l===void 0?null:l,s=n.maskTextClass,u=s===void 0?"highlight-mask":s,d=n.maskTextSelector,h=d===void 0?null:d,m=n.inlineStylesheet,g=m===void 0?!0:m,p=n.inlineImages,S=p===void 0?!1:p,f=n.recordCanvas,y=f===void 0?!1:f,N=n.maskAllInputs,E=N===void 0?!1:N,T=n.maskTextFn,w=n.maskInputFn,P=n.slimDOM,W=P===void 0?!1:P,V=n.dataURLOptions,z=n.preserveWhiteSpace,A=n.onSerialize,K=n.onIframeLoad,B=n.iframeLoadTimeout,J=n.onStylesheetLoad,Q=n.stylesheetLoadTimeout,U=n.keepIframeSrcFn,F=U===void 0?function(){return!1}:U,Y=n.enableStrictPrivacy,b=Y===void 0?!1:Y,v=E===!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}:E===!1?{password:!0}:E,I=W===!0||W==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:W==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:W===!1?{}:W;return ge(e,{doc:e,mirror:o,blockClass:a,blockSelector:c,maskTextClass:u,maskTextSelector:h,skipChild:!1,inlineStylesheet:g,maskInputOptions:v,maskTextFn:T,maskInputFn:w,slimDOMOptions:I,dataURLOptions:V,inlineImages:S,recordCanvas:y,preserveWhiteSpace:z,onSerialize:A,onIframeLoad:K,iframeLoadTimeout:B,onStylesheetLoad:J,stylesheetLoadTimeout:Q,keepIframeSrcFn:F,newlyAddedElement:!1,enableStrictPrivacy:b})}var Ft=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function wr(e,t){t===void 0&&(t={});var n=1,r=1;function o(b){var v=b.match(/\n/g);v&&(n+=v.length);var I=b.lastIndexOf(`
2
+ `);r=I===-1?r+b.length:b.length-I}function i(){var b={line:n,column:r};return function(v){return v.position=new a(b),g(),v}}var a=function(){function b(v){this.start=v,this.end={line:n,column:r},this.source=t.source}return b}();a.prototype.content=e;var l=[];function c(b){var v=new Error("".concat(t.source||"",":").concat(n,":").concat(r,": ").concat(b));if(v.reason=b,v.filename=t.source,v.line=n,v.column=r,v.source=e,t.silent)l.push(v);else throw v}function s(){var b=h();return{type:"stylesheet",stylesheet:{source:t.source,rules:b,parsingErrors:l}}}function u(){return m(/^{\s*/)}function d(){return m(/^}/)}function h(){var b,v=[];for(g(),p(v);e.length&&e.charAt(0)!=="}"&&(b=F()||Y());)b!==!1&&(v.push(b),p(v));return v}function m(b){var v=b.exec(e);if(v){var I=v[0];return o(I),e=e.slice(I.length),v}}function g(){m(/^\s*/)}function p(b){b===void 0&&(b=[]);for(var v;v=S();)v!==!1&&b.push(v),v=S();return b}function S(){var b=i();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var v=2;e.charAt(v)!==""&&(e.charAt(v)!=="*"||e.charAt(v+1)!=="/");)++v;if(v+=2,e.charAt(v-1)==="")return c("End of comment missing");var I=e.slice(2,v-2);return r+=2,o(I),e=e.slice(v),r+=2,b({type:"comment",comment:I})}}function f(){var b=m(/^([^{]+)/);if(b)return he(b[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(v){return v.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(v){return v.replace(/\u200C/g,",")})}function y(){var b=i(),v=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(v){var I=he(v[0]);if(!m(/^:\s*/))return c("property missing ':'");var k=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),M=b({type:"declaration",property:I.replace(Ft,""),value:k?he(k[0]).replace(Ft,""):""});return m(/^[;\s]*/),M}}function N(){var b=[];if(!u())return c("missing '{'");p(b);for(var v;v=y();)v!==!1&&(b.push(v),p(b)),v=y();return d()?b:c("missing '}'")}function E(){for(var b,v=[],I=i();b=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)v.push(b[1]),m(/^,\s*/);if(v.length)return I({type:"keyframe",values:v,declarations:N()})}function T(){var b=i(),v=m(/^@([-\w]+)?keyframes\s*/);if(v){var I=v[1];if(v=m(/^([-\w]+)\s*/),!v)return c("@keyframes missing name");var k=v[1];if(!u())return c("@keyframes missing '{'");for(var M,ae=p();M=E();)ae.push(M),ae=ae.concat(p());return d()?b({type:"keyframes",name:k,vendor:I,keyframes:ae}):c("@keyframes missing '}'")}}function w(){var b=i(),v=m(/^@supports *([^{]+)/);if(v){var I=he(v[1]);if(!u())return c("@supports missing '{'");var k=p().concat(h());return d()?b({type:"supports",supports:I,rules:k}):c("@supports missing '}'")}}function P(){var b=i(),v=m(/^@host\s*/);if(v){if(!u())return c("@host missing '{'");var I=p().concat(h());return d()?b({type:"host",rules:I}):c("@host missing '}'")}}function W(){var b=i(),v=m(/^@media *([^{]+)/);if(v){var I=he(v[1]);if(!u())return c("@media missing '{'");var k=p().concat(h());return d()?b({type:"media",media:I,rules:k}):c("@media missing '}'")}}function V(){var b=i(),v=m(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(v)return b({type:"custom-media",name:he(v[1]),media:he(v[2])})}function z(){var b=i(),v=m(/^@page */);if(v){var I=f()||[];if(!u())return c("@page missing '{'");for(var k=p(),M;M=y();)k.push(M),k=k.concat(p());return d()?b({type:"page",selectors:I,declarations:k}):c("@page missing '}'")}}function A(){var b=i(),v=m(/^@([-\w]+)?document *([^{]+)/);if(v){var I=he(v[1]),k=he(v[2]);if(!u())return c("@document missing '{'");var M=p().concat(h());return d()?b({type:"document",document:k,vendor:I,rules:M}):c("@document missing '}'")}}function K(){var b=i(),v=m(/^@font-face\s*/);if(v){if(!u())return c("@font-face missing '{'");for(var I=p(),k;k=y();)I.push(k),I=I.concat(p());return d()?b({type:"font-face",declarations:I}):c("@font-face missing '}'")}}var B=U("import"),J=U("charset"),Q=U("namespace");function U(b){var v=new RegExp("^@"+b+"\\s*([^;]+);");return function(){var I=i(),k=m(v);if(k){var M={type:b};return M[b]=k[1].trim(),I(M)}}}function F(){if(e[0]==="@")return T()||W()||V()||w()||B()||J()||Q()||A()||z()||P()||K()}function Y(){var b=i(),v=f();return v?(p(),b({type:"rule",selectors:v,declarations:N()})):c("selector missing")}return it(s())}function he(e){return e?e.replace(/^\s+|\s+$/g,""):""}function it(e,t){for(var n=e&&typeof e.type=="string",r=n?e:t,o=0,i=Object.keys(e);o<i.length;o++){var a=i[o],l=e[a];Array.isArray(l)?l.forEach(function(c){it(c,r)}):l&&typeof l=="object"&&it(l,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Pt={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function Cr(e){var t=Pt[e.tagName]?Pt[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function Ir(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var _t=/([^\\]):hover/,Mr=new RegExp(_t.source,"g");function Wt(e,t){var n;if(!(!((n=window?.HIG_CONFIGURATION)===null||n===void 0)&&n.enableOnHoverClass))return e;var r=t?.stylesWithHoverClass.get(e);if(r)return r;var o=wr(e,{silent:!0});if(!o.stylesheet)return e;var i=[];if(o.stylesheet.rules.forEach(function(c){"selectors"in c&&(c.selectors||[]).forEach(function(s){_t.test(s)&&i.push(s)})}),i.length===0)return e;var a=new RegExp(i.filter(function(c,s){return i.indexOf(c)===s}).sort(function(c,s){return s.length-c.length}).map(function(c){return Ir(c)}).join("|"),"g"),l=e.replace(a,function(c){var s=c.replace(Mr,"$1.\\:hover");return"".concat(c,", ").concat(s)});return t?.stylesWithHoverClass.set(e,l),l}function $t(){var e=new Map;return{stylesWithHoverClass:e}}function xr(e,t){var n=t.doc,r=t.hackCss,o=t.cache;switch(e.type){case D.Document:return n.implementation.createDocument(null,"",null);case D.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case D.Element:{var i=Cr(e),a;e.isSVG?a=n.createElementNS("http://www.w3.org/2000/svg",i):a=n.createElement(i);var l=function(d){if(!Object.prototype.hasOwnProperty.call(e.attributes,d))return"continue";var h=e.attributes[d];if(i==="option"&&d==="selected"&&h===!1)return"continue";if(h=typeof h=="boolean"||typeof h=="number"?"":h,d.startsWith("rr_")){if(i==="canvas"&&d==="rr_dataURL"){var m=document.createElement("img");m.onload=function(){var V=a.getContext("2d");V&&V.drawImage(m,0,0,m.width,m.height)},m.src=h,a.RRNodeType&&(a.rr_dataURL=h)}else if(i==="img"&&d==="rr_dataURL"){var g=a;g.currentSrc.startsWith("data:")||(g.setAttribute("rrweb-original-src",e.attributes.src),g.src=h,g.setAttribute("rrweb-inline-src",h))}if(d==="rr_width")a.style.width=h;else if(d==="rr_height")a.style.height=h;else if(d==="rr_mediaCurrentTime")a.currentTime=e.attributes.rr_mediaCurrentTime;else if(d==="rr_mediaState")switch(h){case"played":a.play().catch(function(V){return console.warn("media playback error",V)});break;case"paused":a.pause();break}}else{var p=i==="textarea"&&d==="value",S=i==="style"&&d==="_cssText";if(S&&r&&(h=Wt(h,o),typeof h=="string")){for(var f=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,y=void 0,N=[],E="https://replay-cors-proxy.highlightrun.workers.dev";(y=f.exec(h))!==null;)y.index===f.lastIndex&&f.lastIndex++,y.forEach(function(V,z){if(z===0){var A=V.slice(5,V.length-2);N.push({originalUrl:A,proxyUrl:A.replace(A,"".concat(E,"?url=").concat(A))})}});N.forEach(function(V){h=h.replace(V.originalUrl,V.proxyUrl)})}if(p||S){for(var T=n.createTextNode(h),w=0,P=Array.from(a.childNodes);w<P.length;w++){var W=P[w];W.nodeType===a.TEXT_NODE&&a.removeChild(W)}return a.appendChild(T),"continue"}try{if(e.isSVG&&d==="xlink:href")a.setAttributeNS("http://www.w3.org/1999/xlink",d,h);else if(d==="onload"||d==="onclick"||d.substring(0,7)==="onmouse")a.setAttribute("_"+d,h);else{if(i==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&d==="content")return a.setAttribute("csp-content",h),"continue";i==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||i==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")||(i==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?a.setAttribute("rrweb-original-srcset",e.attributes.srcset):a.setAttribute(d,h))}}catch{}}};for(var c in e.attributes)l(c);if(i==="img"){var s=a;if(!s.currentSrc.startsWith("data:")){var u=s.getAttribute("rrweb-inline-src");u!=null&&u.startsWith("data:")&&(s.src=u)}}if(e.isShadowHost)if(!a.shadowRoot)a.attachShadow({mode:"open"});else for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);return a}case D.Text:return n.createTextNode(e.isStyle&&r?Wt(e.textContent,o):e.textContent);case D.CDATA:return n.createCDATASection(e.textContent);case D.Comment:return n.createComment(e.textContent);default:return null}}function Ye(e,t){var n=t.doc,r=t.mirror,o=t.skipChild,i=o===void 0?!1:o,a=t.hackCss,l=a===void 0?!0:a,c=t.afterAppend,s=t.cache,u=xr(e,{doc:n,hackCss:l,cache:s});if(!u)return null;if(e.rootId&&console.assert(r.getNode(e.rootId)===n,"Target document should have the same root id."),e.type===D.Document&&(n.close(),n.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==D.DocumentType&&(e.childNodes[0].type===D.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=n),r.add(u,e),(e.type===D.Document||e.type===D.Element)&&!i)for(var d=0,h=e.childNodes;d<h.length;d++){var m=h[d],g=Ye(m,{doc:n,mirror:r,skipChild:!1,hackCss:l,afterAppend:c,cache:s});if(!g){console.warn("Failed to rebuild",m);continue}m.isShadow&&It(u)&&u.shadowRoot?u.shadowRoot.appendChild(g):u.appendChild(g),c&&c(g)}return u}function kr(e,t){function n(a){t(a)}for(var r=0,o=e.getIds();r<o.length;r++){var i=o[r];e.has(i)&&n(e.getNode(i))}}function Dr(e,t){var n=t.getMeta(e);if(n?.type===D.Element){var r=e;for(var o in n.attributes)if(Object.prototype.hasOwnProperty.call(n.attributes,o)&&o.startsWith("rr_")){var i=n.attributes[o];o==="rr_scrollLeft"&&(r.scrollLeft=i),o==="rr_scrollTop"&&(r.scrollTop=i)}}}function Rr(e,t){var n=t.doc,r=t.onVisit,o=t.hackCss,i=o===void 0?!0:o,a=t.afterAppend,l=t.cache,c=t.mirror,s=c===void 0?new et:c,u=Ye(e,{doc:n,mirror:s,skipChild:!1,hackCss:i,afterAppend:a,cache:l});return kr(s,function(d){r&&r(d),Dr(d,s)}),u}function te(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const Ce=`Please stop import mirror directly. Instead of that,\r
3
3
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
4
- or you can use record.mirror to access the mirror instance during recording.`;q.mirror={map:{},getId(){return console.error(Te),-1},getNode(){return console.error(Te),null},removeNodeFromMap(){console.error(Te)},has(){return console.error(Te),!1},reset(){console.error(Te)}},typeof window<"u"&&window.Proxy&&window.Reflect&&(q.mirror=new Proxy(q.mirror,{get(e,t,n){return t==="map"&&console.error(Te),Reflect.get(e,t,n)}}));function Ne(e,t,n={}){let r=null,o=0;return function(...i){const a=Date.now();!o&&n.leading===!1&&(o=a);const l=t-(a-o),c=this;l<=0||l>t?(r&&(clearTimeout(r),r=null),o=a,e.apply(c,i)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(c,i)},l))}}function Le(e,t,n,r,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(a){setTimeout(()=>{n.set.call(this,a)},0),i&&i.set&&i.set.call(this,a)}}),()=>Le(e,t,i||{},!0)}function pe(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}function rt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ot(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}const $t=e=>{try{if(e instanceof HTMLElement)return e.tagName==="CANVAS"}catch{return!1}return!1};function ne(e,t,n){if(!e)return!1;const r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!r)return!1;if(typeof t=="string"){if(r.classList.contains(t)||n&&r.closest("."+t)!==null)return!0}else if(Ge(r,t,n))return!0;return!1}function Vt(e,t){return t.getId(e)!==-1}function Be(e,t){return t.getId(e)===Oe}function it(e,t){if(Re(e))return!1;const n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?it(e.parentNode,t):!0:!0}function st(e){return Boolean(e.changedTouches)}function at(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 n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function Ut(e){const t={},n=(o,i)=>{const a={value:o,parent:i,children:[]};return t[o.node.id]=a,a},r=[];for(const o of e){const{nextId:i,parentId:a}=o;if(i&&i in t){const l=t[i];if(l.parent){const c=l.parent.children.indexOf(l);l.parent.children.splice(c,0,n(o,l.parent))}else{const c=r.indexOf(l);r.splice(c,0,n(o,null))}continue}if(a in t){const l=t[a];l.children.push(n(o,l));continue}r.push(n(o,null))}return r}function lt(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)lt(e.children[n],t)}function Ee(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function ct(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function ut(e,t){var n,r;const o=(r=(n=e.ownerDocument)==null?void 0:n.defaultView)==null?void 0:r.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const i=o.getBoundingClientRect(),a=ut(o,t),l=i.height/o.clientHeight;return{x:i.x*a.relativeScale+a.x,y:i.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}}function Ae(e){return Boolean(e?.shadowRoot)}function we(e,t){const n=e[t[0]];return t.length===1?n:we(n.cssRules[t[1]].cssRules,t.slice(2))}function dt(e){const t=[...e],n=t.pop();return{positions:t,index:n}}function Gt(e){const t=new Set,n=[];for(let r=e.length;r--;){const o=e[r];t.has(o.id)||(n.push(o),t.add(o.id))}return n}var Or=Object.freeze({__proto__:null,on:ee,get _mirror(){return q.mirror},throttle:Ne,hookSetter:Le,patch:pe,getWindowHeight:rt,getWindowWidth:ot,isCanvasNode:$t,isBlocked:ne,isSerialized:Vt,isIgnored:Be,isAncestorRemoved:it,isTouchEvent:st,polyfill:at,queueToResolveTrees:Ut,iterateResolveTree:lt,isSerializedIframe:Ee,isSerializedStylesheet:ct,getBaseDimension:ut,hasShadowRoot:Ae,getNestedRule:we,getPositionsAndIndex:dt,uniqueTextMutations:Gt}),x=(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))(x||{}),k=(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))(k||{}),H=(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))(H||{}),ue=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ue||{}),fe=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(fe||{}),O=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e))(O||{});function jt(e){return"__ln"in e}class Lr{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=n?.next||null;return n}addNode(t){const n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&jt(t.previousSibling)){const r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&jt(t.nextSibling)&&t.nextSibling.__ln.previous){const r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;this.length++}removeNode(t){const n=t.__ln;!this.head||(n.previous?(n.previous.next=n.next,n.next&&(n.next.previous=n.previous)):(this.head=n.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}}const Bt=(e,t)=>`${e}@${t}`;class Ar{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=[],n=new Lr,r=l=>{let c=l,s=Oe;for(;s===Oe;)c=c&&c.nextSibling,s=c&&this.mirror.getId(c);return s},o=l=>{var c,s,u,d,h;const m=l.getRootNode?(c=l.getRootNode())==null?void 0:c.host:null;let f=m;for(;(u=(s=f?.getRootNode)==null?void 0:s.call(f))!=null&&u.host;)f=((h=(d=f?.getRootNode)==null?void 0:d.call(f))==null?void 0:h.host)||null;const g=!this.doc.contains(l)&&(!f||!this.doc.contains(f));if(!l.parentNode||g)return;const b=Re(l.parentNode)?this.mirror.getId(m):this.mirror.getId(l.parentNode),p=r(l);if(b===-1||p===-1)return n.addNode(l);const S=me(l,{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,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,enableStrictPrivacy:this.enableStrictPrivacy,onSerialize:T=>{Ee(T,this.mirror)&&this.iframeManager.addIframe(T),ct(T,this.mirror)&&this.stylesheetManager.addStylesheet(T),Ae(l)&&this.shadowDomManager.addShadowRoot(l.shadowRoot,document)},onIframeLoad:(T,w)=>{this.iframeManager.attachIframe(T,w,this.mirror),this.shadowDomManager.observeAttachShadow(T)},onStylesheetLoad:(T,w)=>{this.stylesheetManager.attachStylesheet(T,w,this.mirror)}});S&&t.push({parentId:b,nextId:p,node:S})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of Array.from(this.movedSet.values()))zt(this.removes,l,this.mirror)&&!this.movedSet.has(l.parentNode)||o(l);for(const l of Array.from(this.addedSet.values()))!Ht(this.droppedSet,l)&&!zt(this.removes,l,this.mirror)||Ht(this.movedSet,l)?o(l):this.droppedSet.add(l);let i=null;for(;n.length;){let l=null;if(i){const c=this.mirror.getId(i.value.parentNode),s=r(i.value);c!==-1&&s!==-1&&(l=i)}if(!l)for(let c=n.length-1;c>=0;c--){const s=n.get(c);if(s){const u=this.mirror.getId(s.value.parentNode),d=r(s.value);if(u!==-1&&d!==-1){l=s;break}}}if(!l){for(;n.head;)n.removeNode(n.head.value);break}i=l.previous,n.removeNode(l.value),o(l.value)}const a={texts:this.texts.map(l=>{let c=l.value;return this.enableStrictPrivacy&&c&&(c=qe(c)),{id:this.mirror.getId(l.node),value:c}}).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>({id:this.mirror.getId(l.node),attributes:l.attributes})).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=t=>{if(!Be(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!ne(t.target,this.blockClass,!1)&&n!==t.oldValue&&this.texts.push({value:Dt(t.target,this.maskTextClass,this.maskTextSelector)&&n?this.maskTextFn?this.maskTextFn(n):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{const n=t.target;let r=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(r=Je({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:r,maskInputFn:this.maskInputFn})),ne(t.target,this.blockClass,!1)||r===t.oldValue)return;let o=this.attributes.find(i=>i.node===t.target);if(n.tagName==="IFRAME"&&t.attributeName==="src"&&!this.keepIframeSrcFn(r))if(!n.contentDocument)t.attributeName="rr_src";else return;if(o||(o={node:t.target,attributes:{}},this.attributes.push(o)),t.attributeName==="style"){const i=this.doc.createElement("span");t.oldValue&&i.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});const a=o.attributes.style;for(const l of Array.from(n.style)){const c=n.style.getPropertyValue(l),s=n.style.getPropertyPriority(l);(c!==i.style.getPropertyValue(l)||s!==i.style.getPropertyPriority(l))&&(s===""?a[l]=c:a[l]=[c,s])}for(const l of Array.from(i.style))n.style.getPropertyValue(l)===""&&(a[l]=!1)}else{if(t.target.tagName==="INPUT"){const i=t.target;if(i.type==="password"){o.attributes.value="*".repeat(i.value.length);break}}o.attributes[t.attributeName]=kt(this.doc,n.tagName,t.attributeName,r)}break}case"childList":{if(ne(t.target,this.blockClass,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{const r=this.mirror.getId(n),o=Re(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);ne(t.target,this.blockClass,!1)||Be(n,this.mirror)||!Vt(n,this.mirror)||(this.addedSet.has(n)?(ht(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||it(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[Bt(r,o)]?ht(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:Re(t.target)&&De(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(this.mirror.hasNode(t)){if(Be(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[Bt(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);ne(t,this.blockClass,!1)||t.childNodes.forEach(r=>this.genAdds(r))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","enableStrictPrivacy"].forEach(n=>{this[n]=t[n]})}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 ht(e,t){e.delete(t),t.childNodes.forEach(n=>ht(e,n))}function zt(e,t,n){return e.length===0?!1:Yt(e,t,n)}function Yt(e,t,n){const{parentNode:r}=t;if(!r)return!1;const o=n.getId(r);return e.some(i=>i.id===o)?!0:Yt(e,r,n)}function Ht(e,t){return e.size===0?!1:Xt(e,t)}function Xt(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:Xt(e,n):!1}var Pr=Object.defineProperty,Fr=Object.defineProperties,_r=Object.getOwnPropertyDescriptors,Zt=Object.getOwnPropertySymbols,Wr=Object.prototype.hasOwnProperty,$r=Object.prototype.propertyIsEnumerable,Kt=(e,t,n)=>t in e?Pr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qt=(e,t)=>{for(var n in t||(t={}))Wr.call(t,n)&&Kt(e,n,t[n]);if(Zt)for(var n of Zt(t))$r.call(t,n)&&Kt(e,n,t[n]);return e},Vr=(e,t)=>Fr(e,_r(t));const ge=[],Jt=typeof CSSGroupingRule<"u",qt=typeof CSSMediaRule<"u",en=typeof CSSSupportsRule<"u",tn=typeof CSSConditionRule<"u";function Pe(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 nn(e,t){var n,r;const o=new Ar;ge.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver;const a=(r=(n=window?.Zone)==null?void 0:n.__symbol__)==null?void 0:r.call(n,"MutationObserver");a&&window[a]&&(i=window[a]);const l=new i(o.processMutations.bind(o));return l.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),l}function Ur({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let a=[],l;const c=Ne(d=>{const h=Date.now()-l;e(a.map(m=>(m.timeOffset-=h,m)),d),a=[],l=null},i),s=Ne(d=>{const h=Pe(d),{clientX:m,clientY:f}=st(d)?d.changedTouches[0]:d;l||(l=Date.now()),a.push({x:m,y:f,id:r.getId(h),timeOffset:Date.now()-l}),c(typeof DragEvent<"u"&&d instanceof DragEvent?k.Drag:d instanceof MouseEvent?k.MouseMove:k.TouchMove)},o,{trailing:!1}),u=[ee("mousemove",s,n),ee("touchmove",s,n),ee("drag",s,n)];return()=>{u.forEach(d=>d())}}function Gr({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const i=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[],l=c=>s=>{const u=Pe(s);if(ne(u,r,!0)||$t(u))return;const d=st(s)?s.changedTouches[0]:s;if(!d)return;const h=n.getId(u),{clientX:m,clientY:f}=d;e({type:H[c],id:h,x:m,y:f})};return Object.keys(H).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&i[c]!==!1).forEach(c=>{const s=c.toLowerCase(),u=l(c);a.push(ee(s,u,t))}),()=>{a.forEach(c=>c())}}function rn({scrollCb:e,doc:t,mirror:n,blockClass:r,sampling:o}){const i=Ne(a=>{const l=Pe(a);if(!l||ne(l,r,!0))return;const c=n.getId(l);if(l===t){const s=t.scrollingElement||t.documentElement;e({id:c,x:s.scrollLeft,y:s.scrollTop})}else e({id:c,x:l.scrollLeft,y:l.scrollTop})},o.scroll||100);return ee("scroll",i,t)}function jr({viewportResizeCb:e}){let t=-1,n=-1;const r=Ne(()=>{const o=rt(),i=ot();(t!==o||n!==i)&&(e({width:Number(i),height:Number(o)}),t=o,n=i)},200);return ee("resize",r,window)}function on(e,t){const n=Qt({},e);return t||delete n.userTriggered,n}const Br=["INPUT","TEXTAREA","SELECT"],sn=new WeakMap;function zr({inputCb:e,doc:t,mirror:n,blockClass:r,ignoreClass:o,maskInputOptions:i,maskInputFn:a,sampling:l,userTriggeredOnInput:c}){function s(f){let g=Pe(f);const b=f.isTrusted;if(g&&g.tagName==="OPTION"&&(g=g.parentElement),!g||!g.tagName||Br.indexOf(g.tagName)<0||ne(g,r,!0))return;const p=g.type;if(g.classList.contains(o))return;let S=g.value,T=!1;p==="radio"||p==="checkbox"?T=g.checked:(i[g.tagName.toLowerCase()]||i[p])&&(S=Je({maskInputOptions:i,tagName:g.tagName,type:p,value:S,maskInputFn:a})),u(g,on({text:S,isChecked:T,userTriggered:b},c));const w=g.name;p==="radio"&&w&&T&&t.querySelectorAll(`input[type="radio"][name="${w}"]`).forEach(C=>{C!==g&&u(C,on({text:C.value,isChecked:!T,userTriggered:!1},c))})}function u(f,g){const b=sn.get(f);if(!b||b.text!==g.text||b.isChecked!==g.isChecked){sn.set(f,g);const p=n.getId(f);e(Vr(Qt({},g),{id:p}))}}const d=(l.input==="last"?["change"]:["input","change"]).map(f=>ee(f,s,t)),h=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),m=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return h&&h.set&&d.push(...m.map(f=>Le(f[0],f[1],{set(){s({target:this})}}))),()=>{d.forEach(f=>f())}}function ze(e){const t=[];function n(r,o){if(Jt&&r.parentRule instanceof CSSGroupingRule||qt&&r.parentRule instanceof CSSMediaRule||en&&r.parentRule instanceof CSSSupportsRule||tn&&r.parentRule instanceof CSSConditionRule){const i=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(i)}else{const i=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(i)}return o}return n(e,t)}function Yr({styleSheetRuleCb:e,mirror:t},{win:n}){const r=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=function(l,c){const s=t.getId(this.ownerNode);return s!==-1&&e({id:s,adds:[{rule:l,index:c}]}),r.apply(this,[l,c])};const o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=function(l){const c=t.getId(this.ownerNode);return c!==-1&&e({id:c,removes:[{index:l}]}),o.apply(this,[l])};const i={};Jt?i.CSSGroupingRule=n.CSSGroupingRule:(qt&&(i.CSSMediaRule=n.CSSMediaRule),tn&&(i.CSSConditionRule=n.CSSConditionRule),en&&(i.CSSSupportsRule=n.CSSSupportsRule));const a={};return Object.entries(i).forEach(([l,c])=>{a[l]={insertRule:c.prototype.insertRule,deleteRule:c.prototype.deleteRule},c.prototype.insertRule=function(s,u){const d=t.getId(this.parentStyleSheet.ownerNode);return d!==-1&&e({id:d,adds:[{rule:s,index:[...ze(this),u||0]}]}),a[l].insertRule.apply(this,[s,u])},c.prototype.deleteRule=function(s){const u=t.getId(this.parentStyleSheet.ownerNode);return u!==-1&&e({id:u,removes:[{index:[...ze(this),s]}]}),a[l].deleteRule.apply(this,[s])}}),()=>{n.CSSStyleSheet.prototype.insertRule=r,n.CSSStyleSheet.prototype.deleteRule=o,Object.entries(i).forEach(([l,c])=>{c.prototype.insertRule=a[l].insertRule,c.prototype.deleteRule=a[l].deleteRule})}}function Hr({styleDeclarationCb:e,mirror:t},{win:n}){const r=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=function(i,a,l){var c,s;const u=t.getId((s=(c=this.parentRule)==null?void 0:c.parentStyleSheet)==null?void 0:s.ownerNode);return u!==-1&&e({id:u,set:{property:i,value:a,priority:l},index:ze(this.parentRule)}),r.apply(this,[i,a,l])};const o=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=function(i){var a,l;const c=t.getId((l=(a=this.parentRule)==null?void 0:a.parentStyleSheet)==null?void 0:l.ownerNode);return c!==-1&&e({id:c,remove:{property:i},index:ze(this.parentRule)}),o.apply(this,[i])},()=>{n.CSSStyleDeclaration.prototype.setProperty=r,n.CSSStyleDeclaration.prototype.removeProperty=o}}function Xr({mediaInteractionCb:e,blockClass:t,mirror:n,sampling:r}){const o=a=>Ne(l=>{const c=Pe(l);if(!c||ne(c,t,!0))return;const{currentTime:s,volume:u,muted:d}=c;e({type:a,id:n.getId(c),currentTime:s,volume:u,muted:d})},r.media||500),i=[ee("play",o(fe.Play)),ee("pause",o(fe.Pause)),ee("seeked",o(fe.Seeked)),ee("volumechange",o(fe.VolumeChange))];return()=>{i.forEach(a=>a())}}function Zr({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(l,c,s){const u=new i(l,c,s);return o.set(u,{family:l,buffer:typeof c!="string",descriptors:s,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),u};const a=pe(t.fonts,"add",function(l){return function(c){return setTimeout(()=>{const s=o.get(c);s&&(e(s),o.delete(c))},0),l.apply(this,[c])}});return r.push(()=>{n.FontFace=i}),r.push(a),()=>{r.forEach(l=>l())}}function Kr(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:a,inputCb:l,mediaInteractionCb:c,styleSheetRuleCb:s,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h}=e;e.mutationCb=(...m)=>{t.mutation&&t.mutation(...m),n(...m)},e.mousemoveCb=(...m)=>{t.mousemove&&t.mousemove(...m),r(...m)},e.mouseInteractionCb=(...m)=>{t.mouseInteraction&&t.mouseInteraction(...m),o(...m)},e.scrollCb=(...m)=>{t.scroll&&t.scroll(...m),i(...m)},e.viewportResizeCb=(...m)=>{t.viewportResize&&t.viewportResize(...m),a(...m)},e.inputCb=(...m)=>{t.input&&t.input(...m),l(...m)},e.mediaInteractionCb=(...m)=>{t.mediaInteaction&&t.mediaInteaction(...m),c(...m)},e.styleSheetRuleCb=(...m)=>{t.styleSheetRule&&t.styleSheetRule(...m),s(...m)},e.styleDeclarationCb=(...m)=>{t.styleDeclaration&&t.styleDeclaration(...m),u(...m)},e.canvasMutationCb=(...m)=>{t.canvasMutation&&t.canvasMutation(...m),d(...m)},e.fontCb=(...m)=>{t.font&&t.font(...m),h(...m)}}function Qr(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};Kr(e,t);const r=nn(e,e.doc),o=Ur(e),i=Gr(e),a=rn(e),l=jr(e),c=zr(e),s=Xr(e),u=Yr(e,{win:n}),d=Hr(e,{win:n}),h=e.collectFonts?Zr(e):()=>{},m=[];for(const f of e.plugins)m.push(f.observer(f.callback,n,f.options));return()=>{ge.forEach(f=>f.reset()),r.disconnect(),o(),i(),a(),l(),c(),s(),u(),d(),h(),m.forEach(f=>f())}}class Jr{constructor(t){this.iframes=new WeakMap,this.mutationCb=t.mutationCb}addIframe(t){this.iframes.set(t,!0)}addLoadListener(t){this.loadListener=t}attachIframe(t,n,r){var o;this.mutationCb({adds:[{parentId:r.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(o=this.loadListener)==null||o.call(this,t)}}var qr=Object.defineProperty,eo=Object.defineProperties,to=Object.getOwnPropertyDescriptors,an=Object.getOwnPropertySymbols,no=Object.prototype.hasOwnProperty,ro=Object.prototype.propertyIsEnumerable,ln=(e,t,n)=>t in e?qr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cn=(e,t)=>{for(var n in t||(t={}))no.call(t,n)&&ln(e,n,t[n]);if(an)for(var n of an(t))ro.call(t,n)&&ln(e,n,t[n]);return e},un=(e,t)=>eo(e,to(t));class oo{constructor(t){this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;const n=this;this.restorePatches.push(pe(HTMLElement.prototype,"attachShadow",function(r){return function(o){const i=r.call(this,o);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,this.ownerDocument),i}}))}addShadowRoot(t,n){!De(t)||(nn(un(cn({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),rn(un(cn({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})))}observeAttachShadow(t){if(t.contentWindow){const n=this;this.restorePatches.push(pe(t.contentWindow.HTMLElement.prototype,"attachShadow",function(r){return function(o){const i=r.call(this,o);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,t.contentDocument),i}}))}}reset(){this.restorePatches.forEach(t=>t())}}for(var Ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Fe=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ye=0;Ye<Ce.length;Ye++)Fe[Ce.charCodeAt(Ye)]=Ye;var io=function(e){var t=new Uint8Array(e),n,r=t.length,o="";for(n=0;n<r;n+=3)o+=Ce[t[n]>>2],o+=Ce[(t[n]&3)<<4|t[n+1]>>4],o+=Ce[(t[n+1]&15)<<2|t[n+2]>>6],o+=Ce[t[n+2]&63];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o},so=function(e){var t=e.length*.75,n=e.length,r,o=0,i,a,l,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var s=new ArrayBuffer(t),u=new Uint8Array(s);for(r=0;r<n;r+=4)i=Fe[e.charCodeAt(r)],a=Fe[e.charCodeAt(r+1)],l=Fe[e.charCodeAt(r+2)],c=Fe[e.charCodeAt(r+3)],u[o++]=i<<2|a>>4,u[o++]=(a&15)<<4|l>>2,u[o++]=(l&3)<<6|c&63;return s};const dn=new Map;function ao(e,t){let n=dn.get(e);return n||(n=new Map,dn.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}const hn=(e,t,n)=>{if(!e||!(pn(e,t)||typeof e=="object"))return;const r=e.constructor.name,o=ao(n,r);let i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function He(e,t,n){if(e instanceof Array)return e.map(r=>He(r,t,n));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 r=e.constructor.name,o=io(e);return{rr_type:r,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[He(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const r=e.constructor.name,{src:o}=e;return{rr_type:r,src:o}}else if(e instanceof HTMLCanvasElement){const r="HTMLImageElement",o=e.toDataURL();return{rr_type:r,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[He(e.data,t,n),e.width,e.height]};if(pn(e,t)||typeof e=="object"){const r=e.constructor.name,o=hn(e,t,n);return{rr_type:r,index:o}}}}return e}const mn=(e,t,n)=>[...e].map(r=>He(r,t,n)),pn=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(r=>typeof t[r]=="function");return Boolean(n.find(r=>e instanceof t[r]))};function lo(e,t,n,r){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of i)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;const l=pe(t.CanvasRenderingContext2D.prototype,a,function(c){return function(...s){return ne(this.canvas,n,!0)||setTimeout(()=>{const u=mn([...s],t,this);e(this.canvas,{type:ue["2D"],property:a,args:u})},0),c.apply(this,s)}});o.push(l)}catch{const c=Le(t.CanvasRenderingContext2D.prototype,a,{set(s){e(this.canvas,{type:ue["2D"],property:a,args:[s],setter:!0})}});o.push(c)}return()=>{o.forEach(a=>a())}}function fn(e,t){const n=[];try{const r=pe(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(i,...a){return ne(this,t,!0)||"__context"in this||(this.__context=i),o.apply(this,[i,...a])}});n.push(r)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(r=>r())}}function gn(e,t,n,r,o,i){const a=[],l=Object.getOwnPropertyNames(e);for(const c of l)try{if(typeof e[c]!="function")continue;const s=pe(e,c,function(u){return function(...d){const h=u.apply(this,d);if(hn(h,i,e),!ne(this.canvas,r,!0)){const m=mn([...d],i,e),f={type:t,property:c,args:m};n(this.canvas,f)}return h}});a.push(s)}catch{const u=Le(e,c,{set(d){n(this.canvas,{type:t,property:c,args:[d],setter:!0})}});a.push(u)}return a}function co(e,t,n,r){const o=[];return o.push(...gn(t.WebGLRenderingContext.prototype,ue.WebGL,e,n,r,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...gn(t.WebGL2RenderingContext.prototype,ue.WebGL2,e,n,r,t)),()=>{o.forEach(i=>i())}}function uo(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,i=n.length;o<i;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}function ho(e,t,n){var r=t===void 0?null:t,o=n===void 0?!1:n,i=uo(e,o),a=i.indexOf(`
5
- `,10)+1,l=i.substring(a)+(r?"//# sourceMappingURL="+r:""),c=new Blob([l],{type:"application/javascript"});return URL.createObjectURL(c)}function mo(e,t,n){var r;return function(i){return r=r||ho(e,t,n),new Worker(r,i)}}var po=mo("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Zm9yKHZhciByPSJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvIixsPXR5cGVvZiBVaW50OEFycmF5PiJ1Ij9bXTpuZXcgVWludDhBcnJheSgyNTYpLGY9MDtmPHIubGVuZ3RoO2YrKylsW3IuY2hhckNvZGVBdChmKV09Zjt2YXIgZD1mdW5jdGlvbihzKXt2YXIgZT1uZXcgVWludDhBcnJheShzKSxuLGE9ZS5sZW5ndGgsdD0iIjtmb3Iobj0wO248YTtuKz0zKXQrPXJbZVtuXT4+Ml0sdCs9clsoZVtuXSYzKTw8NHxlW24rMV0+PjRdLHQrPXJbKGVbbisxXSYxNSk8PDJ8ZVtuKzJdPj42XSx0Kz1yW2VbbisyXSY2M107cmV0dXJuIGElMz09PTI/dD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTEpKyI9IjphJTM9PT0xJiYodD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTIpKyI9PSIpLHR9O2NvbnN0IGM9bmV3IE1hcCx1PW5ldyBNYXA7YXN5bmMgZnVuY3Rpb24gcChzLGUpe2NvbnN0IG49YCR7c30tJHtlfWA7aWYodS5oYXMobikpcmV0dXJuIHUuZ2V0KG4pO2NvbnN0IGE9bmV3IE9mZnNjcmVlbkNhbnZhcyhzLGUpO2EuZ2V0Q29udGV4dCgiMmQiKTtjb25zdCB0PWF3YWl0KGF3YWl0IGEuY29udmVydFRvQmxvYigpKS5hcnJheUJ1ZmZlcigpLGc9ZCh0KTtyZXR1cm4gdS5zZXQobixnKSxnfWNvbnN0IGk9c2VsZjtpLm9ubWVzc2FnZT1hc3luYyBmdW5jdGlvbihzKXtpZighKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcykpcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOnMuZGF0YS5pZH0pO2NvbnN0e2lkOmUsYml0bWFwOm4sd2lkdGg6YSxoZWlnaHQ6dH09cy5kYXRhLGc9cChhLHQpLGg9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2guZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCB3PWF3YWl0IGguY29udmVydFRvQmxvYigpLHk9dy50eXBlLGI9YXdhaXQgdy5hcnJheUJ1ZmZlcigpLG89ZChiKTtpZighYy5oYXMoZSkmJmF3YWl0IGc9PT1vKXJldHVybiBjLnNldChlLG8pLGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpZihjLmdldChlKT09PW8pcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpLnBvc3RNZXNzYWdlKHtpZDplLHR5cGU6eSxiYXNlNjQ6byx3aWR0aDphLGhlaWdodDp0fSksYy5zZXQoZSxvKX19KSgpOwoK",null,!1),yn=Object.getOwnPropertySymbols,fo=Object.prototype.hasOwnProperty,go=Object.prototype.propertyIsEnumerable,yo=(e,t)=>{var n={};for(var r in e)fo.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&yn)for(var r of yn(e))t.indexOf(r)<0&&go.call(e,r)&&(n[r]=e[r]);return n},vo=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(s){o(s)}},a=c=>{try{l(n.throw(c))}catch(s){o(s)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});class bo{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(a,l)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(l)};const{sampling:n="all",win:r,blockClass:o,recordCanvas:i}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,i&&n==="all"&&this.initCanvasMutationObserver(r,o),i&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,o)}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,n,r){const o=fn(n,r),i=new Map,a=new po;a.onmessage=d=>{const{id:h}=d.data;if(i.set(h,!1),!("base64"in d.data))return;const{base64:m,type:f,width:g,height:b}=d.data;this.mutationCb({id:h,type:ue["2D"],commands:[{property:"clearRect",args:[0,0,g,b]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:m}],type:f}]},0,0]}]})};const l=1e3/t;let c=0,s;const u=d=>{if(c&&d-c<l){s=requestAnimationFrame(u);return}c=d,n.document.querySelectorAll(`canvas:not(.${r} *)`).forEach(h=>vo(this,null,function*(){var m;const f=this.mirror.getId(h);if(i.get(f))return;if(i.set(f,!0),["webgl","webgl2"].includes(h.__context)){const b=h.getContext(h.__context);((m=b?.getContextAttributes())==null?void 0:m.preserveDrawingBuffer)===!1&&b?.clear(b.COLOR_BUFFER_BIT)}if(h.width===0||h.height===0)return;const g=yield createImageBitmap(h);a.postMessage({id:f,bitmap:g,width:h.width,height:h.height},[g])})),s=requestAnimationFrame(u)};s=requestAnimationFrame(u),this.resetObservers=()=>{o(),cancelAnimationFrame(s)}}initCanvasMutationObserver(t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=fn(t,n),o=lo(this.processMutation.bind(this),t,n,this.mirror),i=co(this.processMutation.bind(this),t,n,this.mirror);this.resetObservers=()=>{r(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=n=>{this.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{const r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,n){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(t);if(!r||n===-1)return;const o=r.map(a=>yo(a,["type"])),{type:i}=r[0];this.mutationCb({id:n,type:i,commands:o}),this.pendingCanvasMutations.delete(t)}}class So{constructor(t){this.trackedStylesheets=new WeakSet,this.mutationCb=t.mutationCb}addStylesheet(t){this.trackedStylesheets.has(t)||(this.trackedStylesheets.add(t),this.trackStylesheet(t))}trackStylesheet(t){}attachStylesheet(t,n,r){this.mutationCb({adds:[{parentId:r.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[]}),this.addStylesheet(t)}}var To=Object.defineProperty,No=Object.defineProperties,Eo=Object.getOwnPropertyDescriptors,vn=Object.getOwnPropertySymbols,wo=Object.prototype.hasOwnProperty,Co=Object.prototype.propertyIsEnumerable,bn=(e,t,n)=>t in e?To(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,re=(e,t)=>{for(var n in t||(t={}))wo.call(t,n)&&bn(e,n,t[n]);if(vn)for(var n of vn(t))Co.call(t,n)&&bn(e,n,t[n]);return e},Io=(e,t)=>No(e,Eo(t));function Z(e){return Io(re({},e),{timestamp:Date.now()})}let Y,_e;const se=It();function ye(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="highlight-block",blockSelector:i=null,ignoreClass:a="highlight-ignore",maskTextClass:l="highlight-mask",maskTextSelector:c=null,inlineStylesheet:s=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:h,maskInputFn:m,maskTextFn:f=qe,hooks:g,packFn:b,sampling:p={},mousemoveWait:S,recordCanvas:T=!1,userTriggeredOnInput:w=!1,collectFonts:C=!1,inlineImages:E=!1,plugins:_,keepIframeSrcFn:A=()=>!1,enableStrictPrivacy:P=!1}=e;if(!t)throw new Error("emit function is required");S!==void 0&&p.mousemove===void 0&&(p.mousemove=S),se.reset();const B=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}:d!==void 0?d:{password:!0},L=h===!0||h==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:h==="all",headMetaDescKeywords:h==="all"}:h||{};at();let Q,z=0;const te=N=>{for(const I of _||[])I.eventProcessor&&(N=I.eventProcessor(N));return b&&(N=b(N)),N};Y=(N,I)=>{var K;if(((K=ge[0])==null?void 0:K.isFrozen())&&N.type!==x.FullSnapshot&&!(N.type===x.IncrementalSnapshot&&N.data.source===k.Mutation)&&ge.forEach(J=>J.unfreeze()),t(te(N),I),N.type===x.FullSnapshot)Q=N,z=0;else if(N.type===x.IncrementalSnapshot){if(N.data.source===k.Mutation&&N.data.isAttachIframe)return;z++;const J=r&&z>=r,le=n&&N.timestamp-Q.timestamp>n;(J||le)&&_e(!0)}};const X=N=>{Y(Z({type:x.IncrementalSnapshot,data:re({source:k.Mutation},N)}))},V=N=>Y(Z({type:x.IncrementalSnapshot,data:re({source:k.Scroll},N)})),F=N=>Y(Z({type:x.IncrementalSnapshot,data:re({source:k.CanvasMutation},N)})),U=new Jr({mutationCb:X}),v=new So({mutationCb:X}),y=new bo({recordCanvas:T,mutationCb:F,win:window,blockClass:o,mirror:se,sampling:p.canvas}),M=new oo({mutationCb:X,scrollCb:V,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:s,maskInputOptions:B,maskTextFn:f,maskInputFn:m,recordCanvas:T,inlineImages:E,sampling:p,slimDOMOptions:L,iframeManager:U,stylesheetManager:v,canvasManager:y,keepIframeSrcFn:A,enableStrictPrivacy:P},mirror:se});_e=(N=!1)=>{var I,K,J,le;Y(Z({type:x.Meta,data:{href:window.location.href,width:ot(),height:rt()}}),N),ge.forEach(j=>j.lock());const W=Er(document,{mirror:se,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:s,maskAllInputs:B,maskTextFn:f,slimDOM:L,recordCanvas:T,inlineImages:E,enableStrictPrivacy:P,onSerialize:j=>{Ee(j,se)&&U.addIframe(j),ct(j,se)&&v.addStylesheet(j),Ae(j)&&M.addShadowRoot(j.shadowRoot,document)},onIframeLoad:(j,be)=>{U.attachIframe(j,be,se),M.observeAttachShadow(j)},onStylesheetLoad:(j,be)=>{v.attachStylesheet(j,be,se)},keepIframeSrcFn:A});if(!W)return console.warn("Failed to snapshot the document");Y(Z({type:x.FullSnapshot,data:{node:W,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((K=(I=document?.body)==null?void 0:I.parentElement)==null?void 0:K.scrollLeft)||document?.body.scrollLeft||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((le=(J=document?.body)==null?void 0:J.parentElement)==null?void 0:le.scrollTop)||document?.body.scrollTop||0}}})),ge.forEach(j=>j.unlock())};try{const N=[];N.push(ee("DOMContentLoaded",()=>{Y(Z({type:x.DomContentLoaded,data:{}}))}));const I=J=>{var le;return Qr({mutationCb:X,mousemoveCb:(W,j)=>Y(Z({type:x.IncrementalSnapshot,data:{source:j,positions:W}})),mouseInteractionCb:W=>Y(Z({type:x.IncrementalSnapshot,data:re({source:k.MouseInteraction},W)})),scrollCb:V,viewportResizeCb:W=>Y(Z({type:x.IncrementalSnapshot,data:re({source:k.ViewportResize},W)})),inputCb:W=>Y(Z({type:x.IncrementalSnapshot,data:re({source:k.Input},W)})),mediaInteractionCb:W=>Y(Z({type:x.IncrementalSnapshot,data:re({source:k.MediaInteraction},W)})),styleSheetRuleCb:W=>Y(Z({type:x.IncrementalSnapshot,data:re({source:k.StyleSheetRule},W)})),styleDeclarationCb:W=>Y(Z({type:x.IncrementalSnapshot,data:re({source:k.StyleDeclaration},W)})),canvasMutationCb:F,fontCb:W=>Y(Z({type:x.IncrementalSnapshot,data:re({source:k.Font},W)})),blockClass:o,ignoreClass:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:B,inlineStylesheet:s,sampling:p,recordCanvas:T,inlineImages:E,userTriggeredOnInput:w,collectFonts:C,doc:J,maskInputFn:m,maskTextFn:f,keepIframeSrcFn:A,blockSelector:i,slimDOMOptions:L,mirror:se,iframeManager:U,stylesheetManager:v,shadowDomManager:M,canvasManager:y,enableStrictPrivacy:P,plugins:((le=_?.filter(W=>W.observer))==null?void 0:le.map(W=>({observer:W.observer,options:W.options,callback:j=>Y(Z({type:x.Plugin,data:{plugin:W.name,payload:j}}))})))||[]},g)};U.addLoadListener(J=>{N.push(I(J.contentDocument))});const K=()=>{_e(),N.push(I(document))};return document.readyState==="interactive"||document.readyState==="complete"?K():N.push(ee("load",()=>{Y(Z({type:x.Load,data:{}})),K()},window)),()=>{N.forEach(J=>J())}}catch(N){console.warn(N)}}ye.addCustomEvent=(e,t)=>{!Y||Y(Z({type:x.Custom,data:{tag:e,payload:t}}))},ye.freezePage=()=>{ge.forEach(e=>e.freeze())},ye.takeFullSnapshot=e=>{if(!_e)throw new Error("please take full snapshot after start recording");_e(e)},ye.mirror=se;var D;(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"})(D||(D={}));var Mo=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-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 n=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(function(o){return n.removeNodeFromMap(o)})},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,n){var r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function xo(){return new Mo}function ko(e){const t={},n=/;(?![^(]*\))/g,r=/:(.+)/,o=/\/\*.*?\*\//g;return e.replace(o,"").split(n).forEach(function(i){if(i){const a=i.split(r);a.length>1&&(t[mt(a[0].trim())]=a[1].trim())}}),t}function Sn(e){const t=[];for(const n in e){const r=e[n];if(typeof r!="string")continue;const o=Lo(n);t.push(`${o}: ${r};`)}return t.join(" ")}const Ro=/-([a-z])/g,Do=/^--[a-zA-Z0-9-]+$/,mt=e=>Do.test(e)?e:e.replace(Ro,(t,n)=>n?n.toUpperCase():""),Oo=/\B([A-Z])/g,Lo=e=>e.replace(Oo,"-$1").toLowerCase();class oe{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=G.ELEMENT_NODE,this.TEXT_NODE=G.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){const t=this.parentNode;if(!t)return null;const n=t.childNodes,r=n.indexOf(this);return n[r+1]||null}contains(t){if(t===this)return!0;for(const n of this.childNodes)if(n.contains(t))return!0;return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,n){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function Ao(e){return class er extends e{constructor(){super(...arguments),this.nodeType=G.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=D.Document,this.textContent=null}get documentElement(){return this.childNodes.find(n=>n.RRNodeType===D.Element&&n.tagName==="HTML")||null}get body(){var n;return((n=this.documentElement)===null||n===void 0?void 0:n.childNodes.find(r=>r.RRNodeType===D.Element&&r.tagName==="BODY"))||null}get head(){var n;return((n=this.documentElement)===null||n===void 0?void 0:n.childNodes.find(r=>r.RRNodeType===D.Element&&r.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(n){const r=n.RRNodeType;if((r===D.Element||r===D.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${r===D.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return n.parentElement=null,n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,r){const o=n.RRNodeType;if((o===D.Element||o===D.DocumentType)&&this.childNodes.some(a=>a.RRNodeType===o))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${o===D.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(r===null)return this.appendChild(n);const i=this.childNodes.indexOf(r);if(i==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(i,0,n),n.parentElement=null,n.parentNode=this,n}removeChild(n){const r=this.childNodes.indexOf(n);if(r===-1)throw new Error("Failed to execute 'removeChild' on 'RRDocument': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(r,1),n.parentElement=null,n.parentNode=null,n}open(){this.childNodes=[]}close(){}write(n){let r;if(n==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?r="-//W3C//DTD XHTML 1.0 Transitional//EN":n==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(r="-//W3C//DTD HTML 4.0 Transitional//EN"),r){const o=this.createDocumentType("html",r,"");this.open(),this.appendChild(o)}}createDocument(n,r,o){return new er}createDocumentType(n,r,o){const i=new(Tn(oe))(n,r,o);return i.ownerDocument=this,i}createElement(n){const r=new(Nn(oe))(n);return r.ownerDocument=this,r}createElementNS(n,r){return this.createElement(r)}createTextNode(n){const r=new(En(oe))(n);return r.ownerDocument=this,r}createComment(n){const r=new(wn(oe))(n);return r.ownerDocument=this,r}createCDATASection(n){const r=new(Cn(oe))(n);return r.ownerDocument=this,r}toString(){return"RRDocument"}}}function Tn(e){return class extends e{constructor(t,n,r){super(),this.nodeType=G.DOCUMENT_TYPE_NODE,this.RRNodeType=D.DocumentType,this.textContent=null,this.name=t,this.publicId=n,this.systemId=r,this.nodeName=t}toString(){return"RRDocumentType"}}}function Nn(e){return class extends e{constructor(t){super(),this.nodeType=G.ELEMENT_NODE,this.RRNodeType=D.Element,this.attributes={},this.shadowRoot=null,this.tagName=t.toUpperCase(),this.nodeName=t.toUpperCase()}get textContent(){let t="";return this.childNodes.forEach(n=>t+=n.textContent),t}set textContent(t){this.childNodes=[this.ownerDocument.createTextNode(t)]}get classList(){return new Fo(this.attributes.class,t=>{this.attributes.class=t})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const t=this.attributes.style?ko(this.attributes.style):{},n=/\B([A-Z])/g;return t.setProperty=(r,o,i)=>{if(n.test(r))return;const a=mt(r);o?t[a]=o:delete t[a],i==="important"&&(t[a]+=" !important"),this.attributes.style=Sn(t)},t.removeProperty=r=>{if(n.test(r))return"";const o=mt(r),i=t[o]||"";return delete t[o],this.attributes.style=Sn(t),i},t}getAttribute(t){return this.attributes[t]||null}setAttribute(t,n){this.attributes[t]=n}setAttributeNS(t,n,r){this.setAttribute(n,r)}removeAttribute(t){delete this.attributes[t]}appendChild(t){return this.childNodes.push(t),t.parentNode=this,t.parentElement=this,t}insertBefore(t,n){if(n===null)return this.appendChild(t);const r=this.childNodes.indexOf(n);if(r==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(r,0,t),t.parentElement=this,t.parentNode=this,t}removeChild(t){const n=this.childNodes.indexOf(t);if(n===-1)throw new Error("Failed to execute 'removeChild' on 'RRElement': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(n,1),t.parentElement=null,t.parentNode=null,t}attachShadow(t){const n=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=n,n}dispatchEvent(t){return!0}toString(){let t="";for(const n in this.attributes)t+=`${n}="${this.attributes[n]}" `;return`${this.tagName} ${t}`}}}function Po(e){return class extends e{attachShadow(t){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}function En(e){return class extends e{constructor(t){super(),this.nodeType=G.TEXT_NODE,this.nodeName="#text",this.RRNodeType=D.Text,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function wn(e){return class extends e{constructor(t){super(),this.nodeType=G.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=D.Comment,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function Cn(e){return class extends e{constructor(t){super(),this.nodeName="#cdata-section",this.nodeType=G.CDATA_SECTION_NODE,this.RRNodeType=D.CDATA,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class Fo{constructor(t,n){if(this.classes=[],this.add=(...r)=>{for(const o of r){const i=String(o);this.classes.indexOf(i)>=0||this.classes.push(i)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...r)=>{this.classes=this.classes.filter(o=>r.indexOf(o)===-1),this.onChange&&this.onChange(this.classes.join(" "))},t){const r=t.trim().split(/\s+/);this.classes.push(...r)}this.onChange=n}}var G;(function(e){e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"})(G||(G={}));const pt={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},_o={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function ae(e,t,n,r){const o=e.childNodes,i=t.childNodes;r=r||t.mirror||t.ownerDocument.mirror,(o.length>0||i.length>0)&&In(Array.from(o),i,e,n,r);let a=null,l=null;switch(t.RRNodeType){case D.Document:{l=t.scrollData;break}case D.Element:{const c=e,s=t;switch(Wo(c,s,r),l=s.scrollData,a=s.inputData,s.tagName){case"AUDIO":case"VIDEO":{const u=e,d=s;d.paused!==void 0&&(d.paused?u.pause():u.play()),d.muted!==void 0&&(u.muted=d.muted),d.volume!==void 0&&(u.volume=d.volume),d.currentTime!==void 0&&(u.currentTime=d.currentTime);break}case"CANVAS":{const u=t;if(u.rr_dataURL!==null){const d=document.createElement("img");d.onload=()=>{const h=c.getContext("2d");h&&h.drawImage(d,0,0,d.width,d.height)},d.src=u.rr_dataURL}u.canvasMutations.forEach(d=>n.applyCanvas(d.event,d.mutation,e))}break;case"STYLE":$o(c,t.rules);break}if(s.shadowRoot){c.shadowRoot||c.attachShadow({mode:"open"});const u=c.shadowRoot.childNodes,d=s.shadowRoot.childNodes;(u.length>0||d.length>0)&&In(Array.from(u),d,c.shadowRoot,n,r)}break}case D.Text:case D.Comment:case D.CDATA:e.textContent!==t.data&&(e.textContent=t.data);break}if(l&&n.applyScroll(l,!0),a&&n.applyInput(a),t.nodeName==="IFRAME"){const c=e.contentDocument,s=t;if(c){const u=r.getMeta(s.contentDocument);u&&n.mirror.add(c,Object.assign({},u)),ae(c,s.contentDocument,n,r)}}}function Wo(e,t,n){const r=e.attributes,o=t.attributes;for(const i in o){const a=o[i],l=n.getMeta(t);if(l&&"isSVG"in l&&l.isSVG&&pt[i])e.setAttributeNS(pt[i],i,a);else if(t.tagName==="CANVAS"&&i==="rr_dataURL"){const c=document.createElement("img");c.src=a,c.onload=()=>{const s=e.getContext("2d");s&&s.drawImage(c,0,0,c.width,c.height)}}else e.setAttribute(i,a)}for(const{name:i}of Array.from(r))i in o||e.removeAttribute(i);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function In(e,t,n,r,o){var i;let a=0,l=e.length-1,c=0,s=t.length-1,u=e[a],d=e[l],h=t[c],m=t[s],f,g;for(;a<=l&&c<=s;){const b=r.mirror.getId(u),p=r.mirror.getId(d),S=o.getId(h),T=o.getId(m);if(u===void 0)u=e[++a];else if(d===void 0)d=e[--l];else if(b!==-1&&b===S)ae(u,h,r,o),u=e[++a],h=t[++c];else if(p!==-1&&p===T)ae(d,m,r,o),d=e[--l],m=t[--s];else if(b!==-1&&b===T)n.insertBefore(u,d.nextSibling),ae(u,m,r,o),u=e[++a],m=t[--s];else if(p!==-1&&p===S)n.insertBefore(d,u),ae(d,h,r,o),d=e[--l],h=t[++c];else{if(!f){f={};for(let w=a;w<=l;w++){const C=e[w];C&&r.mirror.hasNode(C)&&(f[r.mirror.getId(C)]=w)}}if(g=f[o.getId(h)],g){const w=e[g];n.insertBefore(w,u),ae(w,h,r,o),e[g]=void 0}else{const w=ft(h,r.mirror,o);n.nodeName==="#document"&&((i=r.mirror.getMeta(w))===null||i===void 0?void 0:i.type)===D.Element&&n.documentElement&&(n.removeChild(n.documentElement),e[a]=void 0,u=void 0),n.insertBefore(w,u||null),ae(w,h,r,o)}h=t[++c]}}if(a>l){const b=t[s+1];let p=null;for(b&&n.childNodes.forEach(S=>{r.mirror.getId(S)===o.getId(b)&&(p=S)});c<=s;++c){const S=ft(t[c],r.mirror,o);n.insertBefore(S,p),ae(S,t[c],r,o)}}else if(c>s)for(;a<=l;a++){const b=e[a];b&&(n.removeChild(b),r.mirror.removeNodeFromMap(b))}}function ft(e,t,n){const r=n.getId(e),o=n.getMeta(e);let i=null;if(r>-1&&(i=t.getNode(r)),i!==null)return i;switch(e.RRNodeType){case D.Document:i=new Document;break;case D.DocumentType:i=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case D.Element:{let a=e.tagName.toLowerCase();a=_o[a]||a,o&&"isSVG"in o&&o?.isSVG?i=document.createElementNS(pt.svg,a):i=document.createElement(e.tagName);break}case D.Text:i=document.createTextNode(e.data);break;case D.Comment:i=document.createComment(e.data);break;case D.CDATA:i=document.createCDATASection(e.data);break}return o&&t.add(i,Object.assign({},o)),i}function We(e,t){const n=e[t[0]];return t.length===1?n:We(n.cssRules[t[1]].cssRules,t.slice(2))}var ie;(function(e){e[e.Insert=0]="Insert",e[e.Remove=1]="Remove",e[e.Snapshot=2]="Snapshot",e[e.SetProperty=3]="SetProperty",e[e.RemoveProperty=4]="RemoveProperty"})(ie||(ie={}));function Mn(e){const t=[...e],n=t.pop();return{positions:t,index:n}}function $o(e,t){const n=e.sheet;t.forEach(r=>{if(r.type===ie.Insert)try{if(Array.isArray(r.index)){const{positions:o,index:i}=Mn(r.index);We(n.cssRules,o).insertRule(r.cssText,i)}else n.insertRule(r.cssText,r.index)}catch{}else if(r.type===ie.Remove)try{if(Array.isArray(r.index)){const{positions:o,index:i}=Mn(r.index);We(n.cssRules,o).deleteRule(i||0)}else n.deleteRule(r.index)}catch{}else r.type===ie.SetProperty?We(n.cssRules,r.index).style.setProperty(r.property,r.value,r.priority):r.type===ie.RemoveProperty&&We(n.cssRules,r.index).style.removeProperty(r.property)})}class Ie extends Ao(oe){constructor(t){super(),this._unserializedId=-1,this.mirror=Ko(),this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,n,r){return new Ie}createDocumentType(t,n,r){const o=new Vo(t,n,r);return o.ownerDocument=this,o}createElement(t){const n=t.toUpperCase();let r;switch(n){case"AUDIO":case"VIDEO":r=new Uo(n);break;case"IFRAME":r=new Bo(n,this.mirror);break;case"CANVAS":r=new Go(n);break;case"STYLE":r=new jo(n);break;default:r=new $e(n);break}return r.ownerDocument=this,r}createComment(t){const n=new Yo(t);return n.ownerDocument=this,n}createCDATASection(t){const n=new Ho(t);return n.ownerDocument=this,n}createTextNode(t){const n=new zo(t);return n.ownerDocument=this,n}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=-1}}const Vo=Tn(oe);class $e extends Nn(oe){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class Uo extends Po($e){}class Go extends $e{constructor(){super(...arguments),this.rr_dataURL=null,this.canvasMutations=[]}getContext(){return null}}class jo extends $e{constructor(){super(...arguments),this.rules=[]}}class Bo extends $e{constructor(t,n){super(t),this.contentDocument=new Ie,this.contentDocument.mirror=n}}const zo=En(oe),Yo=wn(oe),Ho=Cn(oe);function Xo(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function xn(e,t,n,r){let o;switch(e.nodeType){case G.DOCUMENT_NODE:r&&r.nodeName==="IFRAME"?o=r.contentDocument:(o=t,o.compatMode=e.compatMode);break;case G.DOCUMENT_TYPE_NODE:{const a=e;o=t.createDocumentType(a.name,a.publicId,a.systemId);break}case G.ELEMENT_NODE:{const a=e,l=Xo(a);o=t.createElement(l);const c=o;for(const{name:s,value:u}of Array.from(a.attributes))c.attributes[s]=u;a.scrollLeft&&(c.scrollLeft=a.scrollLeft),a.scrollTop&&(c.scrollTop=a.scrollTop);break}case G.TEXT_NODE:o=t.createTextNode(e.textContent||"");break;case G.CDATA_SECTION_NODE:o=t.createCDATASection(e.data);break;case G.COMMENT_NODE:o=t.createComment(e.textContent||"");break;case G.DOCUMENT_FRAGMENT_NODE:o=r.attachShadow({mode:"open"});break;default:return null}let i=n.getMeta(e);return t instanceof Ie&&(i||(i=kn(o,t.unserializedId),n.add(e,i)),t.mirror.add(o,Object.assign({},i))),o}function Zo(e,t=xo(),n=new Ie){function r(o,i){const a=xn(o,n,t,i);a!==null&&(i?.nodeName!=="IFRAME"&&o.nodeType!==G.DOCUMENT_FRAGMENT_NODE&&(i?.appendChild(a),a.parentNode=i,a.parentElement=i),o.nodeName==="IFRAME"?r(o.contentDocument,a):(o.nodeType===G.DOCUMENT_NODE||o.nodeType===G.ELEMENT_NODE||o.nodeType===G.DOCUMENT_FRAGMENT_NODE)&&(o.nodeType===G.ELEMENT_NODE&&o.shadowRoot&&r(o.shadowRoot,a),o.childNodes.forEach(l=>r(l,a))))}return r(e,null),n}function Ko(){return new Qo}class Qo{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var n;if(!t)return-1;const r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-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 n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){const r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function kn(e,t){switch(e.RRNodeType){case D.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case D.DocumentType:{const n=e;return{id:t,type:e.RRNodeType,name:n.name,publicId:n.publicId,systemId:n.systemId}}case D.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case D.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case D.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case D.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}function Rn(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(o){o(n)}),(r=e.get("*"))&&r.slice().map(function(o){o(t,n)})}}}var Jo=Object.freeze({__proto__:null,default:Rn});function qo(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const n=e.HTMLElement||e.Element,r=468,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||c,scrollIntoView:n.prototype.scrollIntoView},i=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function a(p){const S=["MSIE ","Trident/","Edge/"];return new RegExp(S.join("|")).test(p)}const l=a(e.navigator.userAgent)?1:0;function c(p,S){this.scrollLeft=p,this.scrollTop=S}function s(p){return .5*(1-Math.cos(Math.PI*p))}function u(p){if(p===null||typeof p!="object"||p.behavior===void 0||p.behavior==="auto"||p.behavior==="instant")return!0;if(typeof p=="object"&&p.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+p.behavior+" is not a valid value for enumeration ScrollBehavior.")}function d(p,S){if(S==="Y")return p.clientHeight+l<p.scrollHeight;if(S==="X")return p.clientWidth+l<p.scrollWidth}function h(p,S){const T=e.getComputedStyle(p,null)["overflow"+S];return T==="auto"||T==="scroll"}function m(p){const S=d(p,"Y")&&h(p,"Y"),T=d(p,"X")&&h(p,"X");return S||T}function f(p){for(;p!==t.body&&m(p)===!1;)p=p.parentNode||p.host;return p}function g(p){const S=i();let T,w,C,E=(S-p.startTime)/r;E=E>1?1:E,T=s(E),w=p.startX+(p.x-p.startX)*T,C=p.startY+(p.y-p.startY)*T,p.method.call(p.scrollable,w,C),(w!==p.x||C!==p.y)&&e.requestAnimationFrame(g.bind(e,p))}function b(p,S,T){let w,C,E,_;const A=i();p===t.body?(w=e,C=e.scrollX||e.pageXOffset,E=e.scrollY||e.pageYOffset,_=o.scroll):(w=p,C=p.scrollLeft,E=p.scrollTop,_=c),g({scrollable:w,method:_,startTime:A,startX:C,startY:E,x:S,y:T})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}b.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){o.scrollBy.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}b.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},n.prototype.scroll=n.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const p=arguments[0].left,S=arguments[0].top;b.call(this,this,typeof p>"u"?this.scrollLeft:~~p,typeof S>"u"?this.scrollTop:~~S)},n.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},n.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){o.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const p=f(this),S=p.getBoundingClientRect(),T=this.getBoundingClientRect();p!==t.body?(b.call(this,p,p.scrollLeft+T.left-S.left,p.scrollTop+T.top-S.top),e.getComputedStyle(p).position!=="fixed"&&e.scrollBy({left:S.left,top:S.top,behavior:"smooth"})):e.scrollBy({left:T.left,top:T.top,behavior:"smooth"})}}class ei{constructor(t=[],n){this.timeOffset=0,this.raf=null,this.actions=t,this.speed=n}addAction(t){const n=this.findActionIndex(t);this.actions.splice(n,0,t)}addActions(t){this.actions=this.actions.concat(t)}replaceActions(t){this.actions.length=0,this.actions.splice(0,0,...t)}start(){this.timeOffset=0;let t=performance.now();const{actions:n}=this,r=()=>{const o=performance.now();for(this.timeOffset+=(o-t)*this.speed,t=o;n.length;){const i=n[0];if(this.timeOffset>=i.delay)n.shift(),i.doAction();else break}(n.length>0||this.liveMode)&&(this.raf=requestAnimationFrame(r))};this.raf=requestAnimationFrame(r)}clear(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(t){this.speed=t}toggleLiveMode(t){this.liveMode=t}isActive(){return this.raf!==null}findActionIndex(t){let n=0,r=this.actions.length-1;for(;n<=r;){const o=Math.floor((n+r)/2);if(this.actions[o].delay<t.delay)n=o+1;else if(this.actions[o].delay>t.delay)r=o-1;else return o+1}return n}}function gt(e,t){if(e.type===x.IncrementalSnapshot&&e.data.source===k.MouseMove){const n=e.data.positions[0].timeOffset,r=e.timestamp+n;return e.delay=r-t,r-t}return e.delay=e.timestamp-t,e.delay}/*! *****************************************************************************
4
+ or you can use record.mirror to access the mirror instance during recording.`;ee.mirror={map:{},getId(){return console.error(Ce),-1},getNode(){return console.error(Ce),null},removeNodeFromMap(){console.error(Ce)},has(){return console.error(Ce),!1},reset(){console.error(Ce)}},typeof window<"u"&&window.Proxy&&window.Reflect&&(ee.mirror=new Proxy(ee.mirror,{get(e,t,n){return t==="map"&&console.error(Ce),Reflect.get(e,t,n)}}));function Ie(e,t,n={}){let r=null,o=0;return function(...i){const a=Date.now();!o&&n.leading===!1&&(o=a);const l=t-(a-o),c=this;l<=0||l>t?(r&&(clearTimeout(r),r=null),o=a,e.apply(c,i)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(c,i)},l))}}function Pe(e,t,n,r,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(a){setTimeout(()=>{n.set.call(this,a)},0),i&&i.set&&i.set.call(this,a)}}),()=>Pe(e,t,i||{},!0)}function ve(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}function st(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function at(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}const Vt=e=>{try{if(e instanceof HTMLElement)return e.tagName==="CANVAS"}catch{return!1}return!1};function ne(e,t,n){if(!e)return!1;const r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!r)return!1;if(typeof t=="string"){if(r.classList.contains(t)||n&&r.closest("."+t)!==null)return!0}else if(Be(r,t,n))return!0;return!1}function Ut(e,t){return t.getId(e)!==-1}function He(e,t){return t.getId(e)===Fe}function lt(e,t){if(Le(e))return!1;const n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?lt(e.parentNode,t):!0:!0}function ct(e){return Boolean(e.changedTouches)}function ut(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 n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function Gt(e){const t={},n=(o,i)=>{const a={value:o,parent:i,children:[]};return t[o.node.id]=a,a},r=[];for(const o of e){const{nextId:i,parentId:a}=o;if(i&&i in t){const l=t[i];if(l.parent){const c=l.parent.children.indexOf(l);l.parent.children.splice(c,0,n(o,l.parent))}else{const c=r.indexOf(l);r.splice(c,0,n(o,null))}continue}if(a in t){const l=t[a];l.children.push(n(o,l));continue}r.push(n(o,null))}return r}function dt(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)dt(e.children[n],t)}function Me(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function ht(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function mt(e,t){var n,r;const o=(r=(n=e.ownerDocument)==null?void 0:n.defaultView)==null?void 0:r.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const i=o.getBoundingClientRect(),a=mt(o,t),l=i.height/o.clientHeight;return{x:i.x*a.relativeScale+a.x,y:i.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}}function _e(e){return Boolean(e?.shadowRoot)}function xe(e,t){const n=e[t[0]];return t.length===1?n:xe(n.cssRules[t[1]].cssRules,t.slice(2))}function pt(e){const t=[...e],n=t.pop();return{positions:t,index:n}}function jt(e){const t=new Set,n=[];for(let r=e.length;r--;){const o=e[r];t.has(o.id)||(n.push(o),t.add(o.id))}return n}var Or=Object.freeze({__proto__:null,on:te,get _mirror(){return ee.mirror},throttle:Ie,hookSetter:Pe,patch:ve,getWindowHeight:st,getWindowWidth:at,isCanvasNode:Vt,isBlocked:ne,isSerialized:Ut,isIgnored:He,isAncestorRemoved:lt,isTouchEvent:ct,polyfill:ut,queueToResolveTrees:Gt,iterateResolveTree:dt,isSerializedIframe:Me,isSerializedStylesheet:ht,getBaseDimension:mt,hasShadowRoot:_e,getNestedRule:xe,getPositionsAndIndex:pt,uniqueTextMutations:jt}),C=(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||{}),x=(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))(x||{}),X=(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))(X||{}),me=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(me||{}),ye=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(ye||{}),L=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e))(L||{});function zt(e){return"__ln"in e}class Lr{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=n?.next||null;return n}addNode(t){const n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&zt(t.previousSibling)){const r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&zt(t.nextSibling)&&t.nextSibling.__ln.previous){const r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;this.length++}removeNode(t){const n=t.__ln;!this.head||(n.previous?(n.previous.next=n.next,n.next&&(n.next.previous=n.previous)):(this.head=n.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}}const Bt=(e,t)=>`${e}@${t}`;class Ar{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=[],n=new Lr,r=l=>{let c=l,s=Fe;for(;s===Fe;)c=c&&c.nextSibling,s=c&&this.mirror.getId(c);return s},o=l=>{var c,s,u,d,h;const m=l.getRootNode?(c=l.getRootNode())==null?void 0:c.host:null;let g=m;for(;(u=(s=g?.getRootNode)==null?void 0:s.call(g))!=null&&u.host;)g=((h=(d=g?.getRootNode)==null?void 0:d.call(g))==null?void 0:h.host)||null;const p=!this.doc.contains(l)&&(!g||!this.doc.contains(g));if(!l.parentNode||p)return;const S=Le(l.parentNode)?this.mirror.getId(m):this.mirror.getId(l.parentNode),f=r(l);if(S===-1||f===-1)return n.addNode(l);const y=ge(l,{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,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,enableStrictPrivacy:this.enableStrictPrivacy,onSerialize:N=>{Me(N,this.mirror)&&this.iframeManager.addIframe(N),ht(N,this.mirror)&&this.stylesheetManager.addStylesheet(N),_e(l)&&this.shadowDomManager.addShadowRoot(l.shadowRoot,document)},onIframeLoad:(N,E)=>{this.iframeManager.attachIframe(N,E,this.mirror),this.shadowDomManager.observeAttachShadow(N)},onStylesheetLoad:(N,E)=>{this.stylesheetManager.attachStylesheet(N,E,this.mirror)}});y&&t.push({parentId:S,nextId:f,node:y})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of Array.from(this.movedSet.values()))Yt(this.removes,l,this.mirror)&&!this.movedSet.has(l.parentNode)||o(l);for(const l of Array.from(this.addedSet.values()))!Xt(this.droppedSet,l)&&!Yt(this.removes,l,this.mirror)||Xt(this.movedSet,l)?o(l):this.droppedSet.add(l);let i=null;for(;n.length;){let l=null;if(i){const c=this.mirror.getId(i.value.parentNode),s=r(i.value);c!==-1&&s!==-1&&(l=i)}if(!l)for(let c=n.length-1;c>=0;c--){const s=n.get(c);if(s){const u=this.mirror.getId(s.value.parentNode),d=r(s.value);if(u!==-1&&d!==-1){l=s;break}}}if(!l){for(;n.head;)n.removeNode(n.head.value);break}i=l.previous,n.removeNode(l.value),o(l.value)}const a={texts:this.texts.map(l=>{let c=l.value;return this.enableStrictPrivacy&&c&&(c=nt(c)),{id:this.mirror.getId(l.node),value:c}}).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>({id:this.mirror.getId(l.node),attributes:l.attributes})).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=t=>{if(!He(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!ne(t.target,this.blockClass,!1)&&n!==t.oldValue&&this.texts.push({value:Ot(t.target,this.maskTextClass,this.maskTextSelector)&&n?this.maskTextFn?this.maskTextFn(n):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{const n=t.target;let r=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(r=tt({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:r,maskInputFn:this.maskInputFn})),ne(t.target,this.blockClass,!1)||r===t.oldValue)return;let o=this.attributes.find(i=>i.node===t.target);if(n.tagName==="IFRAME"&&t.attributeName==="src"&&!this.keepIframeSrcFn(r))if(!n.contentDocument)t.attributeName="rr_src";else return;if(o||(o={node:t.target,attributes:{}},this.attributes.push(o)),t.attributeName==="style"){const i=this.doc.createElement("span");t.oldValue&&i.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});const a=o.attributes.style;for(const l of Array.from(n.style)){const c=n.style.getPropertyValue(l),s=n.style.getPropertyPriority(l);(c!==i.style.getPropertyValue(l)||s!==i.style.getPropertyPriority(l))&&(s===""?a[l]=c:a[l]=[c,s])}for(const l of Array.from(i.style))n.style.getPropertyValue(l)===""&&(a[l]=!1)}else{if(t.target.tagName==="INPUT"){const i=t.target;if(i.type==="password"){o.attributes.value="*".repeat(i.value.length);break}}o.attributes[t.attributeName]=Dt(this.doc,n.tagName,t.attributeName,r)}break}case"childList":{if(ne(t.target,this.blockClass,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{const r=this.mirror.getId(n),o=Le(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);ne(t.target,this.blockClass,!1)||He(n,this.mirror)||!Ut(n,this.mirror)||(this.addedSet.has(n)?(ft(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||lt(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[Bt(r,o)]?ft(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:Le(t.target)&&Ae(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(this.mirror.hasNode(t)){if(He(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[Bt(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);ne(t,this.blockClass,!1)||t.childNodes.forEach(r=>this.genAdds(r))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","enableStrictPrivacy"].forEach(n=>{this[n]=t[n]})}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 ft(e,t){e.delete(t),t.childNodes.forEach(n=>ft(e,n))}function Yt(e,t,n){return e.length===0?!1:Ht(e,t,n)}function Ht(e,t,n){const{parentNode:r}=t;if(!r)return!1;const o=n.getId(r);return e.some(i=>i.id===o)?!0:Ht(e,r,n)}function Xt(e,t){return e.size===0?!1:Zt(e,t)}function Zt(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:Zt(e,n):!1}var Fr=Object.defineProperty,Pr=Object.defineProperties,_r=Object.getOwnPropertyDescriptors,Kt=Object.getOwnPropertySymbols,Wr=Object.prototype.hasOwnProperty,$r=Object.prototype.propertyIsEnumerable,Qt=(e,t,n)=>t in e?Fr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jt=(e,t)=>{for(var n in t||(t={}))Wr.call(t,n)&&Qt(e,n,t[n]);if(Kt)for(var n of Kt(t))$r.call(t,n)&&Qt(e,n,t[n]);return e},Vr=(e,t)=>Pr(e,_r(t));const be=[],qt=typeof CSSGroupingRule<"u",en=typeof CSSMediaRule<"u",tn=typeof CSSSupportsRule<"u",nn=typeof CSSConditionRule<"u";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];return e.target}catch{return e.target}}function rn(e,t){var n,r;const o=new Ar;be.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver;const a=(r=(n=window?.Zone)==null?void 0:n.__symbol__)==null?void 0:r.call(n,"MutationObserver");a&&window[a]&&(i=window[a]);const l=new i(o.processMutations.bind(o));return l.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),l}function Ur({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let a=[],l;const c=Ie(d=>{const h=Date.now()-l;e(a.map(m=>(m.timeOffset-=h,m)),d),a=[],l=null},i),s=Ie(d=>{const h=We(d),{clientX:m,clientY:g}=ct(d)?d.changedTouches[0]:d;l||(l=Date.now()),a.push({x:m,y:g,id:r.getId(h),timeOffset:Date.now()-l}),c(typeof DragEvent<"u"&&d instanceof DragEvent?x.Drag:d instanceof MouseEvent?x.MouseMove:x.TouchMove)},o,{trailing:!1}),u=[te("mousemove",s,n),te("touchmove",s,n),te("drag",s,n)];return()=>{u.forEach(d=>d())}}function Gr({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const i=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[],l=c=>s=>{const u=We(s);if(ne(u,r,!0)||Vt(u))return;const d=ct(s)?s.changedTouches[0]:s;if(!d)return;const h=n.getId(u),{clientX:m,clientY:g}=d;e({type:X[c],id:h,x:m,y:g})};return Object.keys(X).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&i[c]!==!1).forEach(c=>{const s=c.toLowerCase(),u=l(c);a.push(te(s,u,t))}),()=>{a.forEach(c=>c())}}function on({scrollCb:e,doc:t,mirror:n,blockClass:r,sampling:o}){const i=Ie(a=>{const l=We(a);if(!l||ne(l,r,!0))return;const c=n.getId(l);if(l===t){const s=t.scrollingElement||t.documentElement;e({id:c,x:s.scrollLeft,y:s.scrollTop})}else e({id:c,x:l.scrollLeft,y:l.scrollTop})},o.scroll||100);return te("scroll",i,t)}function jr({viewportResizeCb:e}){let t=-1,n=-1;const r=Ie(()=>{const o=st(),i=at();(t!==o||n!==i)&&(e({width:Number(i),height:Number(o)}),t=o,n=i)},200);return te("resize",r,window)}function sn(e,t){const n=Jt({},e);return t||delete n.userTriggered,n}const zr=["INPUT","TEXTAREA","SELECT"],an=new WeakMap;function Br({inputCb:e,doc:t,mirror:n,blockClass:r,ignoreClass:o,maskInputOptions:i,maskInputFn:a,sampling:l,userTriggeredOnInput:c}){function s(g){let p=We(g);const S=g.isTrusted;if(p&&p.tagName==="OPTION"&&(p=p.parentElement),!p||!p.tagName||zr.indexOf(p.tagName)<0||ne(p,r,!0))return;const f=p.type;if(p.classList.contains(o))return;let y=p.value,N=!1;f==="radio"||f==="checkbox"?N=p.checked:(i[p.tagName.toLowerCase()]||i[f])&&(y=tt({maskInputOptions:i,tagName:p.tagName,type:f,value:y,maskInputFn:a})),u(p,sn({text:y,isChecked:N,userTriggered:S},c));const E=p.name;f==="radio"&&E&&N&&t.querySelectorAll(`input[type="radio"][name="${E}"]`).forEach(T=>{T!==p&&u(T,sn({text:T.value,isChecked:!N,userTriggered:!1},c))})}function u(g,p){const S=an.get(g);if(!S||S.text!==p.text||S.isChecked!==p.isChecked){an.set(g,p);const f=n.getId(g);e(Vr(Jt({},p),{id:f}))}}const d=(l.input==="last"?["change"]:["input","change"]).map(g=>te(g,s,t)),h=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),m=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return h&&h.set&&d.push(...m.map(g=>Pe(g[0],g[1],{set(){s({target:this})}}))),()=>{d.forEach(g=>g())}}function Xe(e){const t=[];function n(r,o){if(qt&&r.parentRule instanceof CSSGroupingRule||en&&r.parentRule instanceof CSSMediaRule||tn&&r.parentRule instanceof CSSSupportsRule||nn&&r.parentRule instanceof CSSConditionRule){const i=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(i)}else{const i=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(i)}return o}return n(e,t)}function Yr({styleSheetRuleCb:e,mirror:t},{win:n}){const r=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=function(l,c){const s=t.getId(this.ownerNode);return s!==-1&&e({id:s,adds:[{rule:l,index:c}]}),r.apply(this,[l,c])};const o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=function(l){const c=t.getId(this.ownerNode);return c!==-1&&e({id:c,removes:[{index:l}]}),o.apply(this,[l])};const i={};qt?i.CSSGroupingRule=n.CSSGroupingRule:(en&&(i.CSSMediaRule=n.CSSMediaRule),nn&&(i.CSSConditionRule=n.CSSConditionRule),tn&&(i.CSSSupportsRule=n.CSSSupportsRule));const a={};return Object.entries(i).forEach(([l,c])=>{a[l]={insertRule:c.prototype.insertRule,deleteRule:c.prototype.deleteRule},c.prototype.insertRule=function(s,u){const d=t.getId(this.parentStyleSheet.ownerNode);return d!==-1&&e({id:d,adds:[{rule:s,index:[...Xe(this),u||0]}]}),a[l].insertRule.apply(this,[s,u])},c.prototype.deleteRule=function(s){const u=t.getId(this.parentStyleSheet.ownerNode);return u!==-1&&e({id:u,removes:[{index:[...Xe(this),s]}]}),a[l].deleteRule.apply(this,[s])}}),()=>{n.CSSStyleSheet.prototype.insertRule=r,n.CSSStyleSheet.prototype.deleteRule=o,Object.entries(i).forEach(([l,c])=>{c.prototype.insertRule=a[l].insertRule,c.prototype.deleteRule=a[l].deleteRule})}}function Hr({styleDeclarationCb:e,mirror:t},{win:n}){const r=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=function(i,a,l){var c,s;const u=t.getId((s=(c=this.parentRule)==null?void 0:c.parentStyleSheet)==null?void 0:s.ownerNode);return u!==-1&&e({id:u,set:{property:i,value:a,priority:l},index:Xe(this.parentRule)}),r.apply(this,[i,a,l])};const o=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=function(i){var a,l;const c=t.getId((l=(a=this.parentRule)==null?void 0:a.parentStyleSheet)==null?void 0:l.ownerNode);return c!==-1&&e({id:c,remove:{property:i},index:Xe(this.parentRule)}),o.apply(this,[i])},()=>{n.CSSStyleDeclaration.prototype.setProperty=r,n.CSSStyleDeclaration.prototype.removeProperty=o}}function Xr({mediaInteractionCb:e,blockClass:t,mirror:n,sampling:r}){const o=a=>Ie(l=>{const c=We(l);if(!c||ne(c,t,!0))return;const{currentTime:s,volume:u,muted:d}=c;e({type:a,id:n.getId(c),currentTime:s,volume:u,muted:d})},r.media||500),i=[te("play",o(ye.Play)),te("pause",o(ye.Pause)),te("seeked",o(ye.Seeked)),te("volumechange",o(ye.VolumeChange))];return()=>{i.forEach(a=>a())}}function Zr({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(l,c,s){const u=new i(l,c,s);return o.set(u,{family:l,buffer:typeof c!="string",descriptors:s,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),u};const a=ve(t.fonts,"add",function(l){return function(c){return setTimeout(()=>{const s=o.get(c);s&&(e(s),o.delete(c))},0),l.apply(this,[c])}});return r.push(()=>{n.FontFace=i}),r.push(a),()=>{r.forEach(l=>l())}}function Kr(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:a,inputCb:l,mediaInteractionCb:c,styleSheetRuleCb:s,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h}=e;e.mutationCb=(...m)=>{t.mutation&&t.mutation(...m),n(...m)},e.mousemoveCb=(...m)=>{t.mousemove&&t.mousemove(...m),r(...m)},e.mouseInteractionCb=(...m)=>{t.mouseInteraction&&t.mouseInteraction(...m),o(...m)},e.scrollCb=(...m)=>{t.scroll&&t.scroll(...m),i(...m)},e.viewportResizeCb=(...m)=>{t.viewportResize&&t.viewportResize(...m),a(...m)},e.inputCb=(...m)=>{t.input&&t.input(...m),l(...m)},e.mediaInteractionCb=(...m)=>{t.mediaInteaction&&t.mediaInteaction(...m),c(...m)},e.styleSheetRuleCb=(...m)=>{t.styleSheetRule&&t.styleSheetRule(...m),s(...m)},e.styleDeclarationCb=(...m)=>{t.styleDeclaration&&t.styleDeclaration(...m),u(...m)},e.canvasMutationCb=(...m)=>{t.canvasMutation&&t.canvasMutation(...m),d(...m)},e.fontCb=(...m)=>{t.font&&t.font(...m),h(...m)}}function Qr(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};Kr(e,t);const r=rn(e,e.doc),o=Ur(e),i=Gr(e),a=on(e),l=jr(e),c=Br(e),s=Xr(e),u=Yr(e,{win:n}),d=Hr(e,{win:n}),h=e.collectFonts?Zr(e):()=>{},m=[];for(const g of e.plugins)m.push(g.observer(g.callback,n,g.options));return()=>{be.forEach(g=>g.reset()),r.disconnect(),o(),i(),a(),l(),c(),s(),u(),d(),h(),m.forEach(g=>g())}}class Jr{constructor(t){this.iframes=new WeakMap,this.mutationCb=t.mutationCb}addIframe(t){this.iframes.set(t,!0)}addLoadListener(t){this.loadListener=t}attachIframe(t,n,r){var o;this.mutationCb({adds:[{parentId:r.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(o=this.loadListener)==null||o.call(this,t)}}var qr=Object.defineProperty,eo=Object.defineProperties,to=Object.getOwnPropertyDescriptors,ln=Object.getOwnPropertySymbols,no=Object.prototype.hasOwnProperty,ro=Object.prototype.propertyIsEnumerable,cn=(e,t,n)=>t in e?qr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,un=(e,t)=>{for(var n in t||(t={}))no.call(t,n)&&cn(e,n,t[n]);if(ln)for(var n of ln(t))ro.call(t,n)&&cn(e,n,t[n]);return e},dn=(e,t)=>eo(e,to(t));class oo{constructor(t){this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;const n=this;this.restorePatches.push(ve(HTMLElement.prototype,"attachShadow",function(r){return function(o){const i=r.call(this,o);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,this.ownerDocument),i}}))}addShadowRoot(t,n){!Ae(t)||(rn(dn(un({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),on(dn(un({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})))}observeAttachShadow(t){if(t.contentWindow){const n=this;this.restorePatches.push(ve(t.contentWindow.HTMLElement.prototype,"attachShadow",function(r){return function(o){const i=r.call(this,o);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,t.contentDocument),i}}))}}reset(){this.restorePatches.forEach(t=>t())}}for(var ke="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$e=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ze=0;Ze<ke.length;Ze++)$e[ke.charCodeAt(Ze)]=Ze;var io=function(e){var t=new Uint8Array(e),n,r=t.length,o="";for(n=0;n<r;n+=3)o+=ke[t[n]>>2],o+=ke[(t[n]&3)<<4|t[n+1]>>4],o+=ke[(t[n+1]&15)<<2|t[n+2]>>6],o+=ke[t[n+2]&63];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o},so=function(e){var t=e.length*.75,n=e.length,r,o=0,i,a,l,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var s=new ArrayBuffer(t),u=new Uint8Array(s);for(r=0;r<n;r+=4)i=$e[e.charCodeAt(r)],a=$e[e.charCodeAt(r+1)],l=$e[e.charCodeAt(r+2)],c=$e[e.charCodeAt(r+3)],u[o++]=i<<2|a>>4,u[o++]=(a&15)<<4|l>>2,u[o++]=(l&3)<<6|c&63;return s};const hn=new Map;function ao(e,t){let n=hn.get(e);return n||(n=new Map,hn.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}const mn=(e,t,n)=>{if(!e||!(fn(e,t)||typeof e=="object"))return;const r=e.constructor.name,o=ao(n,r);let i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function Ke(e,t,n){if(e instanceof Array)return e.map(r=>Ke(r,t,n));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 r=e.constructor.name,o=io(e);return{rr_type:r,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Ke(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const r=e.constructor.name,{src:o}=e;return{rr_type:r,src:o}}else if(e instanceof HTMLCanvasElement){const r="HTMLImageElement",o=e.toDataURL();return{rr_type:r,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Ke(e.data,t,n),e.width,e.height]};if(fn(e,t)||typeof e=="object"){const r=e.constructor.name,o=mn(e,t,n);return{rr_type:r,index:o}}}}return e}const pn=(e,t,n)=>[...e].map(r=>Ke(r,t,n)),fn=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(r=>typeof t[r]=="function");return Boolean(n.find(r=>e instanceof t[r]))};function lo(e,t,n,r){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of i)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;const l=ve(t.CanvasRenderingContext2D.prototype,a,function(c){return function(...s){return ne(this.canvas,n,!0)||setTimeout(()=>{const u=pn([...s],t,this);e(this.canvas,{type:me["2D"],property:a,args:u})},0),c.apply(this,s)}});o.push(l)}catch{const c=Pe(t.CanvasRenderingContext2D.prototype,a,{set(s){e(this.canvas,{type:me["2D"],property:a,args:[s],setter:!0})}});o.push(c)}return()=>{o.forEach(a=>a())}}function gn(e,t){const n=[];try{const r=ve(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(i,...a){return ne(this,t,!0)||"__context"in this||(this.__context=i),o.apply(this,[i,...a])}});n.push(r)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(r=>r())}}function vn(e,t,n,r,o,i){const a=[],l=Object.getOwnPropertyNames(e);for(const c of l)try{if(typeof e[c]!="function")continue;const s=ve(e,c,function(u){return function(...d){const h=u.apply(this,d);if(mn(h,i,e),!ne(this.canvas,r,!0)){const m=pn([...d],i,e),g={type:t,property:c,args:m};n(this.canvas,g)}return h}});a.push(s)}catch{const u=Pe(e,c,{set(d){n(this.canvas,{type:t,property:c,args:[d],setter:!0})}});a.push(u)}return a}function co(e,t,n,r){const o=[];return o.push(...vn(t.WebGLRenderingContext.prototype,me.WebGL,e,n,r,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...vn(t.WebGL2RenderingContext.prototype,me.WebGL2,e,n,r,t)),()=>{o.forEach(i=>i())}}function uo(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,i=n.length;o<i;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}function ho(e,t,n){var r=t===void 0?null:t,o=n===void 0?!1:n,i=uo(e,o),a=i.indexOf(`
5
+ `,10)+1,l=i.substring(a)+(r?"//# sourceMappingURL="+r:""),c=new Blob([l],{type:"application/javascript"});return URL.createObjectURL(c)}function mo(e,t,n){var r;return function(i){return r=r||ho(e,t,n),new Worker(r,i)}}var po=mo("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Zm9yKHZhciByPSJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvIix2PXR5cGVvZiBVaW50OEFycmF5PiJ1Ij9bXTpuZXcgVWludDhBcnJheSgyNTYpLGM9MDtjPHIubGVuZ3RoO2MrKyl2W3IuY2hhckNvZGVBdChjKV09Yzt2YXIgaD1mdW5jdGlvbihzKXt2YXIgZT1uZXcgVWludDhBcnJheShzKSxhLG49ZS5sZW5ndGgsdD0iIjtmb3IoYT0wO2E8bjthKz0zKXQrPXJbZVthXT4+Ml0sdCs9clsoZVthXSYzKTw8NHxlW2ErMV0+PjRdLHQrPXJbKGVbYSsxXSYxNSk8PDJ8ZVthKzJdPj42XSx0Kz1yW2VbYSsyXSY2M107cmV0dXJuIG4lMz09PTI/dD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTEpKyI9IjpuJTM9PT0xJiYodD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTIpKyI9PSIpLHR9O2NvbnN0IGY9bmV3IE1hcCxkPW5ldyBNYXA7YXN5bmMgZnVuY3Rpb24gdyhzLGUpe2NvbnN0IGE9YCR7c30tJHtlfWA7aWYoZC5oYXMoYSkpcmV0dXJuIGQuZ2V0KGEpO2NvbnN0IG49bmV3IE9mZnNjcmVlbkNhbnZhcyhzLGUpO24uZ2V0Q29udGV4dCgiMmQiKTtjb25zdCB0PWF3YWl0KGF3YWl0IG4uY29udmVydFRvQmxvYigpKS5hcnJheUJ1ZmZlcigpLGc9aCh0KTtyZXR1cm4gZC5zZXQoYSxnKSxnfWNvbnN0IGk9c2VsZjtpLm9ubWVzc2FnZT1hc3luYyBmdW5jdGlvbihzKXtpZighKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcykpcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOnMuZGF0YS5pZH0pO2NvbnN0e2lkOmUsYml0bWFwOmEsd2lkdGg6bixoZWlnaHQ6dCxjYW52YXNXaWR0aDpnLGNhbnZhc0hlaWdodDpwfT1zLmRhdGEseT13KG4sdCksdT1uZXcgT2Zmc2NyZWVuQ2FudmFzKG4sdCk7dS5nZXRDb250ZXh0KCIyZCIpLmRyYXdJbWFnZShhLDAsMCxuLHQpLGEuY2xvc2UoKTtjb25zdCBsPWF3YWl0IHUuY29udmVydFRvQmxvYigpLGI9bC50eXBlLEM9YXdhaXQgbC5hcnJheUJ1ZmZlcigpLG89aChDKTtpZighZi5oYXMoZSkmJmF3YWl0IHk9PT1vKXJldHVybiBmLnNldChlLG8pLGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpZihmLmdldChlKT09PW8pcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpLnBvc3RNZXNzYWdlKHtpZDplLHR5cGU6YixiYXNlNjQ6byx3aWR0aDpuLGhlaWdodDp0LGNhbnZhc1dpZHRoOmcsY2FudmFzSGVpZ2h0OnB9KSxmLnNldChlLG8pfX0pKCk7Cgo=",null,!1),yn=Object.getOwnPropertySymbols,fo=Object.prototype.hasOwnProperty,go=Object.prototype.propertyIsEnumerable,vo=(e,t)=>{var n={};for(var r in e)fo.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&yn)for(var r of yn(e))t.indexOf(r)<0&&go.call(e,r)&&(n[r]=e[r]);return n},yo=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(s){o(s)}},a=c=>{try{l(n.throw(c))}catch(s){o(s)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});class bo{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(a,l)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(l)};const{sampling:n="all",win:r,blockClass:o,recordCanvas:i}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,i&&n==="all"&&this.initCanvasMutationObserver(r,o),i&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,o,t.resizeQuality,t.resizeFactor,t.maxSnapshotDimension)}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,n,r,o,i,a){const l=gn(n,r),c=new Map,s=new po;s.onmessage=g=>{const{id:p}=g.data;if(c.set(p,!1),!("base64"in g.data))return;const{base64:S,type:f,canvasWidth:y,canvasHeight:N}=g.data;this.mutationCb({id:p,type:me["2D"],commands:[{property:"clearRect",args:[0,0,y,N]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:S}],type:f}]},0,0,y,N]}]})};const u=1e3/t;let d=0,h;const m=g=>{if(d&&g-d<u){h=requestAnimationFrame(m);return}d=g,n.document.querySelectorAll(`canvas:not(.${r} *)`).forEach(p=>yo(this,null,function*(){var S;const f=this.mirror.getId(p);if(c.get(f))return;if(c.set(f,!0),["webgl","webgl2"].includes(p.__context)){const T=p.getContext(p.__context);((S=T?.getContextAttributes())==null?void 0:S.preserveDrawingBuffer)===!1&&T?.clear(T.COLOR_BUFFER_BIT)}if(p.width===0||p.height===0)return;if(a){const T=Math.max(p.width,p.height);i=Math.min(i||1,a/T)}const y=p.width*(i||1),N=p.height*(i||1),E=yield createImageBitmap(p,{resizeQuality:o||"low",resizeWidth:y,resizeHeight:N});s.postMessage({id:f,bitmap:E,width:y,height:N,canvasWidth:p.width,canvasHeight:p.height},[E])})),h=requestAnimationFrame(m)};h=requestAnimationFrame(m),this.resetObservers=()=>{l(),cancelAnimationFrame(h)}}initCanvasMutationObserver(t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=gn(t,n),o=lo(this.processMutation.bind(this),t,n,this.mirror),i=co(this.processMutation.bind(this),t,n,this.mirror);this.resetObservers=()=>{r(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=n=>{this.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{const r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,n){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(t);if(!r||n===-1)return;const o=r.map(a=>vo(a,["type"])),{type:i}=r[0];this.mutationCb({id:n,type:i,commands:o}),this.pendingCanvasMutations.delete(t)}}class So{constructor(t){this.trackedStylesheets=new WeakSet,this.mutationCb=t.mutationCb}addStylesheet(t){this.trackedStylesheets.has(t)||(this.trackedStylesheets.add(t),this.trackStylesheet(t))}trackStylesheet(t){}attachStylesheet(t,n,r){this.mutationCb({adds:[{parentId:r.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[]}),this.addStylesheet(t)}}var To=Object.defineProperty,No=Object.defineProperties,Eo=Object.getOwnPropertyDescriptors,bn=Object.getOwnPropertySymbols,wo=Object.prototype.hasOwnProperty,Co=Object.prototype.propertyIsEnumerable,Sn=(e,t,n)=>t in e?To(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oe=(e,t)=>{for(var n in t||(t={}))wo.call(t,n)&&Sn(e,n,t[n]);if(bn)for(var n of bn(t))Co.call(t,n)&&Sn(e,n,t[n]);return e},Io=(e,t)=>No(e,Eo(t));function Z(e){return Io(oe({},e),{timestamp:Date.now()})}let H,Ve;const ce=Mt();function Se(e={}){var t,n,r,o;const{emit:i,checkoutEveryNms:a,checkoutEveryNth:l,blockClass:c="highlight-block",blockSelector:s=null,ignoreClass:u="highlight-ignore",maskTextClass:d="highlight-mask",maskTextSelector:h=null,inlineStylesheet:m=!0,maskAllInputs:g,maskInputOptions:p,slimDOMOptions:S,maskInputFn:f,maskTextFn:y=nt,hooks:N,packFn:E,sampling:T={},mousemoveWait:w,recordCanvas:P=!1,userTriggeredOnInput:W=!1,collectFonts:V=!1,inlineImages:z=!1,plugins:A,keepIframeSrcFn:K=()=>!1,enableStrictPrivacy:B=!1}=e;if(!i)throw new Error("emit function is required");w!==void 0&&T.mousemove===void 0&&(T.mousemove=w),ce.reset();const J=g===!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}:p!==void 0?p:{password:!0},Q=S===!0||S==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:S==="all",headMetaDescKeywords:S==="all"}:S||{};ut();let U,F=0;const Y=O=>{for(const re of A||[])re.eventProcessor&&(O=re.eventProcessor(O));return E&&(O=E(O)),O};H=(O,re)=>{var le;if(((le=be[0])==null?void 0:le.isFrozen())&&O.type!==C.FullSnapshot&&!(O.type===C.IncrementalSnapshot&&O.data.source===x.Mutation)&&be.forEach(q=>q.unfreeze()),i(Y(O),re),O.type===C.FullSnapshot)U=O,F=0;else if(O.type===C.IncrementalSnapshot){if(O.data.source===x.Mutation&&O.data.isAttachIframe)return;F++;const q=l&&F>=l,de=a&&O.timestamp-U.timestamp>a;(q||de)&&Ve(!0)}};const b=O=>{H(Z({type:C.IncrementalSnapshot,data:oe({source:x.Mutation},O)}))},v=O=>H(Z({type:C.IncrementalSnapshot,data:oe({source:x.Scroll},O)})),I=O=>H(Z({type:C.IncrementalSnapshot,data:oe({source:x.CanvasMutation},O)})),k=new Jr({mutationCb:b}),M=new So({mutationCb:b}),ae=new bo({recordCanvas:P,mutationCb:I,win:window,blockClass:c,mirror:ce,sampling:(t=T?.canvas)==null?void 0:t.fps,resizeQuality:(n=T?.canvas)==null?void 0:n.resizeQuality,resizeFactor:(r=T?.canvas)==null?void 0:r.resizeFactor,maxSnapshotDimension:(o=T?.canvas)==null?void 0:o.maxSnapshotDimension}),Ne=new oo({mutationCb:b,scrollCb:v,bypassOptions:{blockClass:c,blockSelector:s,maskTextClass:d,maskTextSelector:h,inlineStylesheet:m,maskInputOptions:J,maskTextFn:y,maskInputFn:f,recordCanvas:P,inlineImages:z,sampling:T,slimDOMOptions:Q,iframeManager:k,stylesheetManager:M,canvasManager:ae,keepIframeSrcFn:K,enableStrictPrivacy:B},mirror:ce});Ve=(O=!1)=>{var re,le,q,de;H(Z({type:C.Meta,data:{href:window.location.href,width:at(),height:st()}}),O),be.forEach(G=>G.lock());const _=Er(document,{mirror:ce,blockClass:c,blockSelector:s,maskTextClass:d,maskTextSelector:h,inlineStylesheet:m,maskAllInputs:J,maskTextFn:y,slimDOM:Q,recordCanvas:P,inlineImages:z,enableStrictPrivacy:B,onSerialize:G=>{Me(G,ce)&&k.addIframe(G),ht(G,ce)&&M.addStylesheet(G),_e(G)&&Ne.addShadowRoot(G.shadowRoot,document)},onIframeLoad:(G,Ee)=>{k.attachIframe(G,Ee,ce),Ne.observeAttachShadow(G)},onStylesheetLoad:(G,Ee)=>{M.attachStylesheet(G,Ee,ce)},keepIframeSrcFn:K});if(!_)return console.warn("Failed to snapshot the document");H(Z({type:C.FullSnapshot,data:{node:_,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((le=(re=document?.body)==null?void 0:re.parentElement)==null?void 0:le.scrollLeft)||document?.body.scrollLeft||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((de=(q=document?.body)==null?void 0:q.parentElement)==null?void 0:de.scrollTop)||document?.body.scrollTop||0}}})),be.forEach(G=>G.unlock())};try{const O=[];O.push(te("DOMContentLoaded",()=>{H(Z({type:C.DomContentLoaded,data:{}}))}));const re=q=>{var de;return Qr({mutationCb:b,mousemoveCb:(_,G)=>H(Z({type:C.IncrementalSnapshot,data:{source:G,positions:_}})),mouseInteractionCb:_=>H(Z({type:C.IncrementalSnapshot,data:oe({source:x.MouseInteraction},_)})),scrollCb:v,viewportResizeCb:_=>H(Z({type:C.IncrementalSnapshot,data:oe({source:x.ViewportResize},_)})),inputCb:_=>H(Z({type:C.IncrementalSnapshot,data:oe({source:x.Input},_)})),mediaInteractionCb:_=>H(Z({type:C.IncrementalSnapshot,data:oe({source:x.MediaInteraction},_)})),styleSheetRuleCb:_=>H(Z({type:C.IncrementalSnapshot,data:oe({source:x.StyleSheetRule},_)})),styleDeclarationCb:_=>H(Z({type:C.IncrementalSnapshot,data:oe({source:x.StyleDeclaration},_)})),canvasMutationCb:I,fontCb:_=>H(Z({type:C.IncrementalSnapshot,data:oe({source:x.Font},_)})),blockClass:c,ignoreClass:u,maskTextClass:d,maskTextSelector:h,maskInputOptions:J,inlineStylesheet:m,sampling:T,recordCanvas:P,inlineImages:z,userTriggeredOnInput:W,collectFonts:V,doc:q,maskInputFn:f,maskTextFn:y,keepIframeSrcFn:K,blockSelector:s,slimDOMOptions:Q,mirror:ce,iframeManager:k,stylesheetManager:M,shadowDomManager:Ne,canvasManager:ae,enableStrictPrivacy:B,plugins:((de=A?.filter(_=>_.observer))==null?void 0:de.map(_=>({observer:_.observer,options:_.options,callback:G=>H(Z({type:C.Plugin,data:{plugin:_.name,payload:G}}))})))||[]},N)};k.addLoadListener(q=>{O.push(re(q.contentDocument))});const le=()=>{Ve(),O.push(re(document))};return document.readyState==="interactive"||document.readyState==="complete"?le():O.push(te("load",()=>{H(Z({type:C.Load,data:{}})),le()},window)),()=>{O.forEach(q=>q())}}catch(O){console.warn(O)}}Se.addCustomEvent=(e,t)=>{!H||H(Z({type:C.Custom,data:{tag:e,payload:t}}))},Se.freezePage=()=>{be.forEach(e=>e.freeze())},Se.takeFullSnapshot=e=>{if(!Ve)throw new Error("please take full snapshot after start recording");Ve(e)},Se.mirror=ce;var R;(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"})(R||(R={}));var Mo=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-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 n=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(function(o){return n.removeNodeFromMap(o)})},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,n){var r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function xo(){return new Mo}function ko(e){const t={},n=/;(?![^(]*\))/g,r=/:(.+)/,o=/\/\*.*?\*\//g;return e.replace(o,"").split(n).forEach(function(i){if(i){const a=i.split(r);a.length>1&&(t[gt(a[0].trim())]=a[1].trim())}}),t}function Tn(e){const t=[];for(const n in e){const r=e[n];if(typeof r!="string")continue;const o=Lo(n);t.push(`${o}: ${r};`)}return t.join(" ")}const Do=/-([a-z])/g,Ro=/^--[a-zA-Z0-9-]+$/,gt=e=>Ro.test(e)?e:e.replace(Do,(t,n)=>n?n.toUpperCase():""),Oo=/\B([A-Z])/g,Lo=e=>e.replace(Oo,"-$1").toLowerCase();class ie{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=j.ELEMENT_NODE,this.TEXT_NODE=j.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){const t=this.parentNode;if(!t)return null;const n=t.childNodes,r=n.indexOf(this);return n[r+1]||null}contains(t){if(t===this)return!0;for(const n of this.childNodes)if(n.contains(t))return!0;return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,n){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function Ao(e){return class er extends e{constructor(){super(...arguments),this.nodeType=j.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=R.Document,this.textContent=null}get documentElement(){return this.childNodes.find(n=>n.RRNodeType===R.Element&&n.tagName==="HTML")||null}get body(){var n;return((n=this.documentElement)===null||n===void 0?void 0:n.childNodes.find(r=>r.RRNodeType===R.Element&&r.tagName==="BODY"))||null}get head(){var n;return((n=this.documentElement)===null||n===void 0?void 0:n.childNodes.find(r=>r.RRNodeType===R.Element&&r.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(n){const r=n.RRNodeType;if((r===R.Element||r===R.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${r===R.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return n.parentElement=null,n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,r){const o=n.RRNodeType;if((o===R.Element||o===R.DocumentType)&&this.childNodes.some(a=>a.RRNodeType===o))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${o===R.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(r===null)return this.appendChild(n);const i=this.childNodes.indexOf(r);if(i==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(i,0,n),n.parentElement=null,n.parentNode=this,n}removeChild(n){const r=this.childNodes.indexOf(n);if(r===-1)throw new Error("Failed to execute 'removeChild' on 'RRDocument': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(r,1),n.parentElement=null,n.parentNode=null,n}open(){this.childNodes=[]}close(){}write(n){let r;if(n==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?r="-//W3C//DTD XHTML 1.0 Transitional//EN":n==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(r="-//W3C//DTD HTML 4.0 Transitional//EN"),r){const o=this.createDocumentType("html",r,"");this.open(),this.appendChild(o)}}createDocument(n,r,o){return new er}createDocumentType(n,r,o){const i=new(Nn(ie))(n,r,o);return i.ownerDocument=this,i}createElement(n){const r=new(En(ie))(n);return r.ownerDocument=this,r}createElementNS(n,r){return this.createElement(r)}createTextNode(n){const r=new(wn(ie))(n);return r.ownerDocument=this,r}createComment(n){const r=new(Cn(ie))(n);return r.ownerDocument=this,r}createCDATASection(n){const r=new(In(ie))(n);return r.ownerDocument=this,r}toString(){return"RRDocument"}}}function Nn(e){return class extends e{constructor(t,n,r){super(),this.nodeType=j.DOCUMENT_TYPE_NODE,this.RRNodeType=R.DocumentType,this.textContent=null,this.name=t,this.publicId=n,this.systemId=r,this.nodeName=t}toString(){return"RRDocumentType"}}}function En(e){return class extends e{constructor(t){super(),this.nodeType=j.ELEMENT_NODE,this.RRNodeType=R.Element,this.attributes={},this.shadowRoot=null,this.tagName=t.toUpperCase(),this.nodeName=t.toUpperCase()}get textContent(){let t="";return this.childNodes.forEach(n=>t+=n.textContent),t}set textContent(t){this.childNodes=[this.ownerDocument.createTextNode(t)]}get classList(){return new Po(this.attributes.class,t=>{this.attributes.class=t})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const t=this.attributes.style?ko(this.attributes.style):{},n=/\B([A-Z])/g;return t.setProperty=(r,o,i)=>{if(n.test(r))return;const a=gt(r);o?t[a]=o:delete t[a],i==="important"&&(t[a]+=" !important"),this.attributes.style=Tn(t)},t.removeProperty=r=>{if(n.test(r))return"";const o=gt(r),i=t[o]||"";return delete t[o],this.attributes.style=Tn(t),i},t}getAttribute(t){return this.attributes[t]||null}setAttribute(t,n){this.attributes[t]=n}setAttributeNS(t,n,r){this.setAttribute(n,r)}removeAttribute(t){delete this.attributes[t]}appendChild(t){return this.childNodes.push(t),t.parentNode=this,t.parentElement=this,t}insertBefore(t,n){if(n===null)return this.appendChild(t);const r=this.childNodes.indexOf(n);if(r==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(r,0,t),t.parentElement=this,t.parentNode=this,t}removeChild(t){const n=this.childNodes.indexOf(t);if(n===-1)throw new Error("Failed to execute 'removeChild' on 'RRElement': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(n,1),t.parentElement=null,t.parentNode=null,t}attachShadow(t){const n=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=n,n}dispatchEvent(t){return!0}toString(){let t="";for(const n in this.attributes)t+=`${n}="${this.attributes[n]}" `;return`${this.tagName} ${t}`}}}function Fo(e){return class extends e{attachShadow(t){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}function wn(e){return class extends e{constructor(t){super(),this.nodeType=j.TEXT_NODE,this.nodeName="#text",this.RRNodeType=R.Text,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function Cn(e){return class extends e{constructor(t){super(),this.nodeType=j.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=R.Comment,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function In(e){return class extends e{constructor(t){super(),this.nodeName="#cdata-section",this.nodeType=j.CDATA_SECTION_NODE,this.RRNodeType=R.CDATA,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class Po{constructor(t,n){if(this.classes=[],this.add=(...r)=>{for(const o of r){const i=String(o);this.classes.indexOf(i)>=0||this.classes.push(i)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...r)=>{this.classes=this.classes.filter(o=>r.indexOf(o)===-1),this.onChange&&this.onChange(this.classes.join(" "))},t){const r=t.trim().split(/\s+/);this.classes.push(...r)}this.onChange=n}}var j;(function(e){e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"})(j||(j={}));const vt={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},_o={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function ue(e,t,n,r){const o=e.childNodes,i=t.childNodes;r=r||t.mirror||t.ownerDocument.mirror,(o.length>0||i.length>0)&&Mn(Array.from(o),i,e,n,r);let a=null,l=null;switch(t.RRNodeType){case R.Document:{l=t.scrollData;break}case R.Element:{const c=e,s=t;switch(Wo(c,s,r),l=s.scrollData,a=s.inputData,s.tagName){case"AUDIO":case"VIDEO":{const u=e,d=s;d.paused!==void 0&&(d.paused?u.pause():u.play()),d.muted!==void 0&&(u.muted=d.muted),d.volume!==void 0&&(u.volume=d.volume),d.currentTime!==void 0&&(u.currentTime=d.currentTime);break}case"CANVAS":{const u=t;if(u.rr_dataURL!==null){const d=document.createElement("img");d.onload=()=>{const h=c.getContext("2d");h&&h.drawImage(d,0,0,d.width,d.height)},d.src=u.rr_dataURL}u.canvasMutations.forEach(d=>n.applyCanvas(d.event,d.mutation,e))}break;case"STYLE":$o(c,t.rules);break}if(s.shadowRoot){c.shadowRoot||c.attachShadow({mode:"open"});const u=c.shadowRoot.childNodes,d=s.shadowRoot.childNodes;(u.length>0||d.length>0)&&Mn(Array.from(u),d,c.shadowRoot,n,r)}break}case R.Text:case R.Comment:case R.CDATA:e.textContent!==t.data&&(e.textContent=t.data);break}if(l&&n.applyScroll(l,!0),a&&n.applyInput(a),t.nodeName==="IFRAME"){const c=e.contentDocument,s=t;if(c){const u=r.getMeta(s.contentDocument);u&&n.mirror.add(c,Object.assign({},u)),ue(c,s.contentDocument,n,r)}}}function Wo(e,t,n){const r=e.attributes,o=t.attributes;for(const i in o){const a=o[i],l=n.getMeta(t);if(l&&"isSVG"in l&&l.isSVG&&vt[i])e.setAttributeNS(vt[i],i,a);else if(t.tagName==="CANVAS"&&i==="rr_dataURL"){const c=document.createElement("img");c.src=a,c.onload=()=>{const s=e.getContext("2d");s&&s.drawImage(c,0,0,c.width,c.height)}}else e.setAttribute(i,a)}for(const{name:i}of Array.from(r))i in o||e.removeAttribute(i);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function Mn(e,t,n,r,o){var i;let a=0,l=e.length-1,c=0,s=t.length-1,u=e[a],d=e[l],h=t[c],m=t[s],g,p;for(;a<=l&&c<=s;){const S=r.mirror.getId(u),f=r.mirror.getId(d),y=o.getId(h),N=o.getId(m);if(u===void 0)u=e[++a];else if(d===void 0)d=e[--l];else if(S!==-1&&S===y)ue(u,h,r,o),u=e[++a],h=t[++c];else if(f!==-1&&f===N)ue(d,m,r,o),d=e[--l],m=t[--s];else if(S!==-1&&S===N)n.insertBefore(u,d.nextSibling),ue(u,m,r,o),u=e[++a],m=t[--s];else if(f!==-1&&f===y)n.insertBefore(d,u),ue(d,h,r,o),d=e[--l],h=t[++c];else{if(!g){g={};for(let E=a;E<=l;E++){const T=e[E];T&&r.mirror.hasNode(T)&&(g[r.mirror.getId(T)]=E)}}if(p=g[o.getId(h)],p){const E=e[p];n.insertBefore(E,u),ue(E,h,r,o),e[p]=void 0}else{const E=yt(h,r.mirror,o);n.nodeName==="#document"&&((i=r.mirror.getMeta(E))===null||i===void 0?void 0:i.type)===R.Element&&n.documentElement&&(n.removeChild(n.documentElement),e[a]=void 0,u=void 0),n.insertBefore(E,u||null),ue(E,h,r,o)}h=t[++c]}}if(a>l){const S=t[s+1];let f=null;for(S&&n.childNodes.forEach(y=>{r.mirror.getId(y)===o.getId(S)&&(f=y)});c<=s;++c){const y=yt(t[c],r.mirror,o);n.insertBefore(y,f),ue(y,t[c],r,o)}}else if(c>s)for(;a<=l;a++){const S=e[a];S&&(n.removeChild(S),r.mirror.removeNodeFromMap(S))}}function yt(e,t,n){const r=n.getId(e),o=n.getMeta(e);let i=null;if(r>-1&&(i=t.getNode(r)),i!==null)return i;switch(e.RRNodeType){case R.Document:i=new Document;break;case R.DocumentType:i=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case R.Element:{let a=e.tagName.toLowerCase();a=_o[a]||a,o&&"isSVG"in o&&o?.isSVG?i=document.createElementNS(vt.svg,a):i=document.createElement(e.tagName);break}case R.Text:i=document.createTextNode(e.data);break;case R.Comment:i=document.createComment(e.data);break;case R.CDATA:i=document.createCDATASection(e.data);break}return o&&t.add(i,Object.assign({},o)),i}function Ue(e,t){const n=e[t[0]];return t.length===1?n:Ue(n.cssRules[t[1]].cssRules,t.slice(2))}var se;(function(e){e[e.Insert=0]="Insert",e[e.Remove=1]="Remove",e[e.Snapshot=2]="Snapshot",e[e.SetProperty=3]="SetProperty",e[e.RemoveProperty=4]="RemoveProperty"})(se||(se={}));function xn(e){const t=[...e],n=t.pop();return{positions:t,index:n}}function $o(e,t){const n=e.sheet;t.forEach(r=>{if(r.type===se.Insert)try{if(Array.isArray(r.index)){const{positions:o,index:i}=xn(r.index);Ue(n.cssRules,o).insertRule(r.cssText,i)}else n.insertRule(r.cssText,r.index)}catch{}else if(r.type===se.Remove)try{if(Array.isArray(r.index)){const{positions:o,index:i}=xn(r.index);Ue(n.cssRules,o).deleteRule(i||0)}else n.deleteRule(r.index)}catch{}else r.type===se.SetProperty?Ue(n.cssRules,r.index).style.setProperty(r.property,r.value,r.priority):r.type===se.RemoveProperty&&Ue(n.cssRules,r.index).style.removeProperty(r.property)})}class De extends Ao(ie){constructor(t){super(),this._unserializedId=-1,this.mirror=Ko(),this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,n,r){return new De}createDocumentType(t,n,r){const o=new Vo(t,n,r);return o.ownerDocument=this,o}createElement(t){const n=t.toUpperCase();let r;switch(n){case"AUDIO":case"VIDEO":r=new Uo(n);break;case"IFRAME":r=new zo(n,this.mirror);break;case"CANVAS":r=new Go(n);break;case"STYLE":r=new jo(n);break;default:r=new Ge(n);break}return r.ownerDocument=this,r}createComment(t){const n=new Yo(t);return n.ownerDocument=this,n}createCDATASection(t){const n=new Ho(t);return n.ownerDocument=this,n}createTextNode(t){const n=new Bo(t);return n.ownerDocument=this,n}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=-1}}const Vo=Nn(ie);class Ge extends En(ie){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class Uo extends Fo(Ge){}class Go extends Ge{constructor(){super(...arguments),this.rr_dataURL=null,this.canvasMutations=[]}getContext(){return null}}class jo extends Ge{constructor(){super(...arguments),this.rules=[]}}class zo extends Ge{constructor(t,n){super(t),this.contentDocument=new De,this.contentDocument.mirror=n}}const Bo=wn(ie),Yo=Cn(ie),Ho=In(ie);function Xo(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function kn(e,t,n,r){let o;switch(e.nodeType){case j.DOCUMENT_NODE:r&&r.nodeName==="IFRAME"?o=r.contentDocument:(o=t,o.compatMode=e.compatMode);break;case j.DOCUMENT_TYPE_NODE:{const a=e;o=t.createDocumentType(a.name,a.publicId,a.systemId);break}case j.ELEMENT_NODE:{const a=e,l=Xo(a);o=t.createElement(l);const c=o;for(const{name:s,value:u}of Array.from(a.attributes))c.attributes[s]=u;a.scrollLeft&&(c.scrollLeft=a.scrollLeft),a.scrollTop&&(c.scrollTop=a.scrollTop);break}case j.TEXT_NODE:o=t.createTextNode(e.textContent||"");break;case j.CDATA_SECTION_NODE:o=t.createCDATASection(e.data);break;case j.COMMENT_NODE:o=t.createComment(e.textContent||"");break;case j.DOCUMENT_FRAGMENT_NODE:o=r.attachShadow({mode:"open"});break;default:return null}let i=n.getMeta(e);return t instanceof De&&(i||(i=Dn(o,t.unserializedId),n.add(e,i)),t.mirror.add(o,Object.assign({},i))),o}function Zo(e,t=xo(),n=new De){function r(o,i){const a=kn(o,n,t,i);a!==null&&(i?.nodeName!=="IFRAME"&&o.nodeType!==j.DOCUMENT_FRAGMENT_NODE&&(i?.appendChild(a),a.parentNode=i,a.parentElement=i),o.nodeName==="IFRAME"?r(o.contentDocument,a):(o.nodeType===j.DOCUMENT_NODE||o.nodeType===j.ELEMENT_NODE||o.nodeType===j.DOCUMENT_FRAGMENT_NODE)&&(o.nodeType===j.ELEMENT_NODE&&o.shadowRoot&&r(o.shadowRoot,a),o.childNodes.forEach(l=>r(l,a))))}return r(e,null),n}function Ko(){return new Qo}class Qo{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var n;if(!t)return-1;const r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-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 n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){const r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Dn(e,t){switch(e.RRNodeType){case R.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case R.DocumentType:{const n=e;return{id:t,type:e.RRNodeType,name:n.name,publicId:n.publicId,systemId:n.systemId}}case R.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case R.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case R.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case R.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}function Rn(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(o){o(n)}),(r=e.get("*"))&&r.slice().map(function(o){o(t,n)})}}}var Jo=Object.freeze({__proto__:null,default:Rn});function qo(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const n=e.HTMLElement||e.Element,r=468,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||c,scrollIntoView:n.prototype.scrollIntoView},i=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function a(f){const y=["MSIE ","Trident/","Edge/"];return new RegExp(y.join("|")).test(f)}const l=a(e.navigator.userAgent)?1:0;function c(f,y){this.scrollLeft=f,this.scrollTop=y}function s(f){return .5*(1-Math.cos(Math.PI*f))}function u(f){if(f===null||typeof f!="object"||f.behavior===void 0||f.behavior==="auto"||f.behavior==="instant")return!0;if(typeof f=="object"&&f.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+f.behavior+" is not a valid value for enumeration ScrollBehavior.")}function d(f,y){if(y==="Y")return f.clientHeight+l<f.scrollHeight;if(y==="X")return f.clientWidth+l<f.scrollWidth}function h(f,y){const N=e.getComputedStyle(f,null)["overflow"+y];return N==="auto"||N==="scroll"}function m(f){const y=d(f,"Y")&&h(f,"Y"),N=d(f,"X")&&h(f,"X");return y||N}function g(f){for(;f!==t.body&&m(f)===!1;)f=f.parentNode||f.host;return f}function p(f){const y=i();let N,E,T,w=(y-f.startTime)/r;w=w>1?1:w,N=s(w),E=f.startX+(f.x-f.startX)*N,T=f.startY+(f.y-f.startY)*N,f.method.call(f.scrollable,E,T),(E!==f.x||T!==f.y)&&e.requestAnimationFrame(p.bind(e,f))}function S(f,y,N){let E,T,w,P;const W=i();f===t.body?(E=e,T=e.scrollX||e.pageXOffset,w=e.scrollY||e.pageYOffset,P=o.scroll):(E=f,T=f.scrollLeft,w=f.scrollTop,P=c),p({scrollable:E,method:P,startTime:W,startX:T,startY:w,x:y,y:N})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}S.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){o.scrollBy.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}S.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},n.prototype.scroll=n.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const f=arguments[0].left,y=arguments[0].top;S.call(this,this,typeof f>"u"?this.scrollLeft:~~f,typeof y>"u"?this.scrollTop:~~y)},n.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},n.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){o.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const f=g(this),y=f.getBoundingClientRect(),N=this.getBoundingClientRect();f!==t.body?(S.call(this,f,f.scrollLeft+N.left-y.left,f.scrollTop+N.top-y.top),e.getComputedStyle(f).position!=="fixed"&&e.scrollBy({left:y.left,top:y.top,behavior:"smooth"})):e.scrollBy({left:N.left,top:N.top,behavior:"smooth"})}}class ei{constructor(t=[],n){this.timeOffset=0,this.raf=null,this.actions=t,this.speed=n}addAction(t){const n=this.findActionIndex(t);this.actions.splice(n,0,t)}addActions(t){this.actions=this.actions.concat(t)}replaceActions(t){this.actions.length=0,this.actions.splice(0,0,...t)}start(){this.timeOffset=0;let t=performance.now();const{actions:n}=this,r=()=>{const o=performance.now();for(this.timeOffset+=(o-t)*this.speed,t=o;n.length;){const i=n[0];if(this.timeOffset>=i.delay)n.shift(),i.doAction();else break}(n.length>0||this.liveMode)&&(this.raf=requestAnimationFrame(r))};this.raf=requestAnimationFrame(r)}clear(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(t){this.speed=t}toggleLiveMode(t){this.liveMode=t}isActive(){return this.raf!==null}findActionIndex(t){let n=0,r=this.actions.length-1;for(;n<=r;){const o=Math.floor((n+r)/2);if(this.actions[o].delay<t.delay)n=o+1;else if(this.actions[o].delay>t.delay)r=o-1;else return o+1}return n}}function bt(e,t){if(e.type===C.IncrementalSnapshot&&e.data.source===x.MouseMove){const n=e.data.positions[0].timeOffset,r=e.timestamp+n;return e.delay=r-t,r-t}return e.delay=e.timestamp-t,e.delay}/*! *****************************************************************************
6
6
  Copyright (c) Microsoft Corporation.
7
7
 
8
8
  Permission to use, copy, modify, and/or distribute this software for any
@@ -15,4 +15,4 @@ or you can use record.mirror to access the mirror instance during recording.`;q.
15
15
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16
16
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17
17
  PERFORMANCE OF THIS SOFTWARE.
18
- ***************************************************************************** */function Dn(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(l){o={error:l}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}var Me;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Me||(Me={}));var On={type:"xstate.init"};function yt(e){return e===void 0?[]:[].concat(e)}function ve(e){return{type:"xstate.assign",assignment:e}}function Ln(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function Xe(e){return function(t){return e===t}}function An(e){return typeof e=="string"?{type:e}:e}function Pn(e,t){return{value:e,context:t,actions:[],changed:!1,matches:Xe(e)}}function Fn(e,t,n){var r=t,o=!1;return[e.filter(function(i){if(i.type==="xstate.assign"){o=!0;var a=Object.assign({},r);return typeof i.assignment=="function"?a=i.assignment(r,n):Object.keys(i.assignment).forEach(function(l){a[l]=typeof i.assignment[l]=="function"?i.assignment[l](r,n):i.assignment[l]}),r=a,!1}return!0}),r,o]}function _n(e,t){t===void 0&&(t={});var n=Dn(Fn(yt(e.states[e.initial].entry).map(function(a){return Ln(a,t.actions)}),e.context,On),2),r=n[0],o=n[1],i={config:e,_options:t,initialState:{value:e.initial,actions:r,context:o,matches:Xe(e.initial)},transition:function(a,l){var c,s,u=typeof a=="string"?{value:a,context:e.context}:a,d=u.value,h=u.context,m=An(l),f=e.states[d];if(f.on){var g=yt(f.on[m.type]);try{for(var b=function(F){var U=typeof Symbol=="function"&&Symbol.iterator,v=U&&F[U],y=0;if(v)return v.call(F);if(F&&typeof F.length=="number")return{next:function(){return F&&y>=F.length&&(F=void 0),{value:F&&F[y++],done:!F}}};throw new TypeError(U?"Object is not iterable.":"Symbol.iterator is not defined.")}(g),p=b.next();!p.done;p=b.next()){var S=p.value;if(S===void 0)return Pn(d,h);var T=typeof S=="string"?{target:S}:S,w=T.target,C=T.actions,E=C===void 0?[]:C,_=T.cond,A=_===void 0?function(){return!0}:_,P=w===void 0,B=w??d,L=e.states[B];if(A(h,m)){var Q=Dn(Fn((P?yt(E):[].concat(f.exit,E,L.entry).filter(function(F){return F})).map(function(F){return Ln(F,i._options.actions)}),h,m),3),z=Q[0],te=Q[1],X=Q[2],V=w??d;return{value:V,context:te,actions:z,changed:w!==d||z.length>0||X,matches:Xe(V)}}}}catch(F){c={error:F}}finally{try{p&&!p.done&&(s=b.return)&&s.call(b)}finally{if(c)throw c.error}}}return Pn(d,h)}};return i}var Wn=function(e,t){return e.actions.forEach(function(n){var r=n.exec;return r&&r(e.context,t)})};function $n(e){var t=e.initialState,n=Me.NotStarted,r=new Set,o={_machine:e,send:function(i){n===Me.Running&&(t=e.transition(t,i),Wn(t,An(i)),r.forEach(function(a){return a(t)}))},subscribe:function(i){return r.add(i),i(t),{unsubscribe:function(){return r.delete(i)}}},start:function(i){if(i){var a=typeof i=="object"?i:{context:e.config.context,value:i};t={value:a.value,actions:[],context:a.context,matches:Xe(a.value)}}return n=Me.Running,Wn(t,On),o},stop:function(){return n=Me.Stopped,r.clear(),o},get state(){return t},get status(){return n}};return o}var ti=Object.defineProperty,ni=Object.defineProperties,ri=Object.getOwnPropertyDescriptors,Vn=Object.getOwnPropertySymbols,oi=Object.prototype.hasOwnProperty,ii=Object.prototype.propertyIsEnumerable,Un=(e,t,n)=>t in e?ti(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ze=(e,t)=>{for(var n in t||(t={}))oi.call(t,n)&&Un(e,n,t[n]);if(Vn)for(var n of Vn(t))ii.call(t,n)&&Un(e,n,t[n]);return e},Ke=(e,t)=>ni(e,ri(t));function si(e,t){for(let n=e.length-1;n>=0;n--){const r=e[n];if(r.type===x.Meta&&r.timestamp<=t)return e.slice(n)}return e}function ai(e,{getCastFn:t,applyEventsSynchronously:n,emitter:r}){const o=_n({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]},REPLACE_EVENTS:{target:"playing",actions:["replaceEvents"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]},REPLACE_EVENTS:{target:"paused",actions:["replaceEvents"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:ve({lastPlayedEvent:(i,a)=>a.type==="CAST_EVENT"?a.payload.event:i.lastPlayedEvent}),recordTimeOffset:ve((i,a)=>{let l=i.timeOffset;return"payload"in a&&"timeOffset"in a.payload&&(l=a.payload.timeOffset),Ke(Ze({},i),{timeOffset:l,baselineTime:i.events[0].timestamp+l})}),play(i){var a;const{timer:l,events:c,baselineTime:s,lastPlayedEvent:u}=i;l.clear();for(const g of c)gt(g,s);const d=si(c,s);let h=u?.timestamp;u?.type===x.IncrementalSnapshot&&u.data.source===k.MouseMove&&(h=u.timestamp+((a=u.data.positions[0])==null?void 0:a.timeOffset)),s<(h||0)&&r.emit(O.PlayBack);const m=new Array,f=new Array;for(const g of d)if(!(h&&h<s&&(g.timestamp<=h||g===u)))if(g.timestamp<s)m.push(g);else{const b=t(g,!1);f.push({doAction:()=>{b()},delay:g.delay})}n(m),r.emit(O.Flush),l.addActions(f),l.start()},pause(i){i.timer.clear()},resetLastPlayedEvent:ve(i=>Ke(Ze({},i),{lastPlayedEvent:null})),startLive:ve({baselineTime:(i,a)=>(i.timer.toggleLiveMode(!0),i.timer.start(),a.type==="TO_LIVE"&&a.payload.baselineTime?a.payload.baselineTime:Date.now())}),replaceEvents:ve((i,a)=>{const{events:l,timer:c,baselineTime:s}=i;if(a.type==="REPLACE_EVENTS"){const{events:u}=a.payload;l.length=0;const d=[];for(const h of u)if(gt(h,s),l.push(h),h.timestamp>=c.timeOffset+s){const m=t(h,!1);d.push({doAction:()=>{m()},delay:h.delay})}c.isActive()&&c.replaceActions(d)}return Ke(Ze({},i),{events:l})}),addEvent:ve((i,a)=>{const{baselineTime:l,timer:c,events:s}=i;if(a.type==="ADD_EVENT"){const{event:u}=a.payload;gt(u,l);let d=s.length-1;if(!s[d]||s[d].timestamp<=u.timestamp)s.push(u);else{let f=-1,g=0;for(;g<=d;){const b=Math.floor((g+d)/2);s[b].timestamp<=u.timestamp?g=b+1:d=b-1}f===-1&&(f=g),s.splice(f,0,u)}const h=u.timestamp<l,m=t(u,h);h?m():c.isActive()&&c.addAction({doAction:()=>{m()},delay:u.delay})}return Ke(Ze({},i),{events:s})})}});return $n(o)}function li(e){const t=_n({id:"speed",context:e,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(n,r)=>{"payload"in r&&n.timer.setSpeed(r.payload.speed)},recordSpeed:ve({normalSpeed:n=>n.timer.speed}),restoreSpeed:n=>{n.timer.setSpeed(n.normalSpeed)}}});return $n(t)}const ci=e=>["noscript { display: none !important; }",`.${e} { background: currentColor; border-radius: 5px; }`,`.${e}:hover::after {content: 'Redacted'; color: white; background: black; text-align: center; width: 100%; display: block;}`];var ui=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(s){o(s)}},a=c=>{try{l(n.throw(c))}catch(s){o(s)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});const Gn=new Map;function jn(e,t){let n=Gn.get(e);return n||(n=new Map,Gn.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}function he(e,t,n){return r=>ui(this,null,function*(){if(r&&typeof r=="object"&&"rr_type"in r)if(n&&(n.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){const o=yield he(e,t,n)(r.args);return yield createImageBitmap.apply(null,o)}else if("index"in r){if(n||t===null)return r;const{rr_type:o,index:i}=r;return jn(t,o)[i]}else if("args"in r){const{rr_type:o,args:i}=r,a=window[o];return new a(...yield Promise.all(i.map(he(e,t,n))))}else{if("base64"in r)return so(r.base64);if("src"in r){const o=e.get(r.src);if(o)return o;{const i=new Image;return i.src=r.src,e.set(r.src,i),i}}else if("data"in r&&r.rr_type==="Blob"){const o=yield Promise.all(r.data.map(he(e,t,n)));return new Blob(o,{type:r.type})}}else if(Array.isArray(r))return yield Promise.all(r.map(he(e,t,n)));return r})}var di=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(s){o(s)}},a=c=>{try{l(n.throw(c))}catch(s){o(s)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});function hi(e,t){try{return t===ue.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}const mi=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function pi(e,t){if(!(t!=null&&t.constructor))return;const{name:n}=t.constructor;if(!mi.includes(n))return;const r=jn(e,n);r.includes(t)||r.push(t)}function fi(e){return di(this,arguments,function*({mutation:t,target:n,type:r,imageMap:o,errorHandler:i}){try{const a=hi(n,r);if(!a)return;if(t.setter){a[t.property]=t.args[0];return}const l=a[t.property],c=yield Promise.all(t.args.map(he(o,a))),s=l.apply(a,c);pi(a,s)}catch(a){i(t,a)}})}var gi=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(s){o(s)}},a=c=>{try{l(n.throw(c))}catch(s){o(s)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});function yi(e){return gi(this,arguments,function*({event:t,mutation:n,target:r,imageMap:o,errorHandler:i}){try{const a=r.getContext("2d");if(n.setter){a[n.property]=n.args[0];return}const l=a[n.property];if(n.property==="drawImage"&&typeof n.args[0]=="string")o.get(t),l.apply(a,n.args);else{const c=yield Promise.all(n.args.map(he(o,a)));l.apply(a,c)}}catch(a){i(n,a)}})}var vi=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(s){o(s)}},a=c=>{try{l(n.throw(c))}catch(s){o(s)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});function Bn(e){return vi(this,arguments,function*({event:t,mutation:n,target:r,imageMap:o,canvasEventMap:i,errorHandler:a}){try{const l=i.get(t)||n,c="commands"in l?l.commands:[l];if([ue.WebGL,ue.WebGL2].includes(n.type)){for(let s=0;s<c.length;s++){const u=c[s];yield fi({mutation:u,type:n.type,target:r,imageMap:o,errorHandler:a})}return}for(let s=0;s<c.length;s++){const u=c[s];yield yi({event:t,mutation:u,target:r,imageMap:o,errorHandler:a})}}catch(l){a(n,l)}})}var bi=Object.defineProperty,Si=Object.defineProperties,Ti=Object.getOwnPropertyDescriptors,zn=Object.getOwnPropertySymbols,Ni=Object.prototype.hasOwnProperty,Ei=Object.prototype.propertyIsEnumerable,Yn=(e,t,n)=>t in e?bi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xe=(e,t)=>{for(var n in t||(t={}))Ni.call(t,n)&&Yn(e,n,t[n]);if(zn)for(var n of zn(t))Ei.call(t,n)&&Yn(e,n,t[n]);return e},vt=(e,t)=>Si(e,Ti(t)),bt=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(s){o(s)}},a=c=>{try{l(n.throw(c))}catch(s){o(s)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});const Hn=10*1e3,Xn=2*1e3,Zn=1*1e3,Kn=60*60*1e3,wi=Rn||Jo,St="[replayer]",Tt={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Nt(e){return e.type==x.IncrementalSnapshot&&(e.data.source==k.TouchMove||e.data.source==k.MouseInteraction&&e.data.type==H.TouchStart)}class Ci{constructor(t,n){if(this.usingVirtualDom=!1,this.virtualDom=new Ie,this.mouseTail=null,this.tailPositions=[],this.emitter=wi(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=Wt(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=It(),this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,this.handleResize=l=>{this.iframe.style.display="inherit";for(const c of[this.mouseTail,this.iframe])!c||(c.setAttribute("width",String(l.width)),c.setAttribute("height",String(l.height)))},this.applyEventsSynchronously=l=>{for(const c of l){switch(c.type){case x.DomContentLoaded:case x.Load:case x.Custom:continue;case x.FullSnapshot:case x.Meta:case x.Plugin:case x.IncrementalSnapshot:break}this.getCastFn(c,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null},this.getCastFn=(l,c=!1)=>{let s;switch(l.type){case x.DomContentLoaded:case x.Load:break;case x.Custom:s=()=>{this.emitter.emit(O.CustomEvent,l)};break;case x.Meta:s=()=>this.emitter.emit(O.Resize,{width:l.data.width,height:l.data.height});break;case x.FullSnapshot:s=()=>{if(this.firstFullSnapshot){if(this.firstFullSnapshot===l){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(l,c),this.iframe.contentWindow.scrollTo(l.data.initialOffset)};break;case x.IncrementalSnapshot:s=()=>{if(this.applyIncremental(l,c),!c&&(this.handleInactivity(l.timestamp),l===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const u of this.service.state.context.events)if(!(u.timestamp<=l.timestamp)&&this.isUserInteraction(u)){u.delay-l.delay>Hn*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=u);break}if(this.nextUserInteractionEvent){const u=this.nextUserInteractionEvent.delay-l.delay,d={speed:Math.min(Math.round(u/Xn),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:d}),this.emitter.emit(O.SkipStart,d)}}};break}return()=>{s&&s();for(const d of this.config.plugins||[])d.handler(l,c,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:l}});const u=this.service.state.context.events.length-1;if(l===this.service.state.context.events[u]){const d=()=>{u<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(O.Finish))};l.type===x.IncrementalSnapshot&&l.data.source===k.MouseMove&&l.data.positions.length?setTimeout(()=>{d()},Math.max(0,-l.data.positions[0].timeOffset+50)):d()}this.emitter.emit(O.EventCast,l)}},!(n!=null&&n.liveMode)&&t.length<2)throw new Error("Replayer need at least 2 events.");const r={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"highlight-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:Tt,useVirtualDom:!0,inactiveThreshold:.02,inactiveSkipTime:Xn};this.config=Object.assign({},r,n),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(O.Resize,this.handleResize),this.setupDom(),this.emitter.on(O.Flush,()=>{if(this.usingVirtualDom){const l={mirror:this.mirror,applyCanvas:(c,s,u)=>{Bn({event:c,mutation:s,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this)};if(ae(this.iframe.contentDocument,this.virtualDom,l,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const c in this.legacy_missingNodeRetryMap)try{const s=this.legacy_missingNodeRetryMap[c],u=ft(s.node,this.mirror,this.virtualDom.mirror);ae(u,s.node,l,this.virtualDom.mirror),s.node=u}catch(s){this.config.showWarning&&console.warn(s)}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null}),this.emitter.on(O.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset()});const o=new ei([],n?.speed||r.speed);this.service=ai({events:t.map(l=>n&&n.unpackFn?n.unpackFn(l):l).sort((l,c)=>l.timestamp-c.timestamp),timer:o,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(l=>{this.emitter.emit(O.StateChange,{player:l})}),this.speedService=li({normalSpeed:-1,timer:o}),this.speedService.start(),this.speedService.subscribe(l=>{this.emitter.emit(O.StateChange,{speed:l})});const i=this.service.state.context.events.find(l=>l.type===x.Meta),a=this.service.state.context.events.find(l=>l.type===x.FullSnapshot);if(i){const{width:l,height:c}=i.data;setTimeout(()=>{this.emitter.emit(O.Resize,{width:l,height:c})},0)}a&&setTimeout(()=>{this.firstFullSnapshot||(this.firstFullSnapshot=a,this.rebuildFullSnapshot(a),this.iframe.contentWindow.scrollTo(a.data.initialOffset))},1),this.service.state.context.events.find(Nt)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,n){return this.emitter.on(t,n),this}off(t,n){return this.emitter.off(t,n),this}setConfig(t){Object.keys(t).forEach(n=>{t[n],this.config[n]=t[n]}),this.config.skipInactive||this.backToNormal(),typeof t.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail<"u"&&(t.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getActivityIntervals(){if(this.activityIntervals.length==0){const t=[],n=this.getMetaData(),r=[{timestamp:n.startTime},...this.service.state.context.events.filter(a=>this.isUserInteraction(a)),{timestamp:n.endTime}];for(let a=1;a<r.length;a++){const l=r[a-1],c=r[a];c.timestamp-l.timestamp>Hn?t.push({startTime:l.timestamp,endTime:c.timestamp,duration:c.timestamp-l.timestamp,active:!1}):t.push({startTime:l.timestamp,endTime:c.timestamp,duration:c.timestamp-l.timestamp,active:!0})}const o=[];let i=t[0];for(let a=1;a<t.length;a++)t[a].active!=t[a-1].active&&(o.push({startTime:i.startTime,endTime:t[a-1].endTime,duration:t[a-1].endTime-i.startTime,active:t[a-1].active}),i=t[a]);i&&t.length>0&&o.push({startTime:i.startTime,endTime:t[t.length-1].endTime,duration:t[t.length-1].endTime-i.startTime,active:t[t.length-1].active}),i=o[0];for(let a=1;a<o.length;a++)(!o[a].active&&o[a].duration>this.config.inactiveThreshold*n.totalTime||!o[a-1].active&&o[a-1].duration>this.config.inactiveThreshold*n.totalTime)&&(this.activityIntervals.push({startTime:i.startTime,endTime:o[a-1].endTime,duration:o[a-1].endTime-i.startTime,active:o[a-1].active}),i=o[a]);i&&o.length>0&&this.activityIntervals.push({startTime:i.startTime,endTime:o[o.length-1].endTime,duration:o[o.length-1].endTime-i.startTime,active:o[o.length-1].active})}return this.activityIntervals}getMetaData(){const t=this.service.state.context.events[0],n=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:n.timestamp,totalTime:n.timestamp-t.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:t,events:n}=this.service.state.context;return t-n[0].timestamp}getMirror(){return this.mirror}play(t=0){var n,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(r=(n=this.iframe.contentDocument)==null?void 0:n.getElementsByTagName("html")[0])==null||r.classList.remove("rrweb-paused"),this.emitter.emit(O.Start),this.handleInactivity(this.getMetaData().startTime+t,!0)}pause(t){var n,r;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(r=(n=this.iframe.contentDocument)==null?void 0:n.getElementsByTagName("html")[0])==null||r.classList.add("rrweb-paused"),this.emitter.emit(O.Pause)}resume(t=0){console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(t),this.emitter.emit(O.Resume)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const n=this.config.unpackFn?this.config.unpackFn(t):t;Nt(n)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:n}}))}replaceEvents(t){for(const n of t)if(Nt(n)){this.mouse.classList.add("touch-device");break}this.service.send({type:"REPLACE_EVENTS",payload:{events:t}})}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=Wt()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const t=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&t.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",t.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(qo(this.iframe.contentWindow,this.iframe.contentDocument),at(this.iframe.contentWindow))}handleInactivity(t,n){if((t===this.inactiveEndTimestamp||n)&&(this.inactiveEndTimestamp=null,this.backToNormal()),this.config.skipInactive&&!this.inactiveEndTimestamp){for(const r of this.getActivityIntervals())if(t>=r.startTime&&t<r.endTime&&!r.active){this.inactiveEndTimestamp=r.endTime;break}if(this.inactiveEndTimestamp){const r=this.inactiveEndTimestamp-t,o={speed:r/Kn*this.config.inactiveSkipTime<Zn?r/Zn:Math.round(Math.max(r,Kn)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:o}),this.emitter.emit(O.SkipStart,o)}}}rebuildFullSnapshot(t,n=!1){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const r=[];Dr(t.data.node,{doc:this.iframe.contentDocument,afterAppend:a=>{this.collectIframeAndAttachDocument(r,a)},cache:this.cache,mirror:this.mirror});for(const{mutationInQueue:a,builtNode:l}of r)this.attachDocumentToIframe(a,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==a);const{documentElement:o,head:i}=this.iframe.contentDocument;this.insertStyleRules(o,i),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(O.FullsnapshotRebuilded,t),n||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,n){const r=ci(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&r.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,kn(o,this.virtualDom.unserializedId)),t.insertBefore(o,n);for(let i=0;i<r.length;i++)o.rules.push({cssText:r[i],type:ie.Insert,index:i})}else{const o=document.createElement("style");t.insertBefore(o,n);for(let i=0;i<r.length;i++)o.sheet.insertRule(r[i],i)}}attachDocumentToIframe(t,n){const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,o=[];je(t.node,{doc:n.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:i=>{this.collectIframeAndAttachDocument(o,i);const a=r.getMeta(i);if(a?.type===R.Element&&a?.tagName.toUpperCase()==="HTML"){const{documentElement:l,head:c}=n.contentDocument;this.insertStyleRules(l,c)}},cache:this.cache});for(const{mutationInQueue:i,builtNode:a}of o)this.attachDocumentToIframe(i,a),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==i)}collectIframeAndAttachDocument(t,n){if(Ee(n,this.mirror)){const r=this.newDocumentQueue.find(o=>o.parentId===this.mirror.getId(n));r&&t.push({mutationInQueue:r,builtNode:n})}}waitForStylesheetLoad(){var t;const n=(t=this.iframe.contentDocument)==null?void 0:t.head;if(n){const r=new Set;let o,i=this.service.state;const a=()=>{i=this.service.state};this.emitter.on(O.Start,a),this.emitter.on(O.Pause,a);const l=()=>{this.emitter.off(O.Start,a),this.emitter.off(O.Pause,a)};n.querySelectorAll('link[rel="stylesheet"]').forEach(c=>{c.sheet||(r.add(c),c.addEventListener("load",()=>{r.delete(c),r.size===0&&o!==-1&&(i.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(O.LoadStylesheetEnd),o&&clearTimeout(o),l())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(O.LoadStylesheetStart),o=setTimeout(()=>{i.matches("playing")&&this.play(this.getCurrentTime()),o=-1,l()},this.config.loadTimeout))}}preloadAllImages(){return bt(this,null,function*(){this.service.state;const t=()=>{this.service.state};this.emitter.on(O.Start,t),this.emitter.on(O.Pause,t);const n=[];for(const r of this.service.state.context.events)r.type===x.IncrementalSnapshot&&r.data.source===k.CanvasMutation&&(n.push(this.deserializeAndPreloadCanvasEvents(r.data,r)),("commands"in r.data?r.data.commands:[r.data]).forEach(o=>{this.preloadImages(o,r)}));return Promise.all(n)})}preloadImages(t,n){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(n)){const r=document.createElement("canvas"),o=r.getContext("2d"),i=o?.createImageData(r.width,r.height);i?.data,JSON.parse(t.args[0]),o?.putImageData(i,0,0)}}deserializeAndPreloadCanvasEvents(t,n){return bt(this,null,function*(){if(!this.canvasEventMap.has(n)){const r={isUnchanged:!0};if("commands"in t){const o=yield Promise.all(t.commands.map(i=>bt(this,null,function*(){const a=yield Promise.all(i.args.map(he(this.imageMap,null,r)));return vt(xe({},i),{args:a})})));r.isUnchanged===!1&&this.canvasEventMap.set(n,vt(xe({},t),{commands:o}))}else{const o=yield Promise.all(t.args.map(he(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(n,vt(xe({},t),{args:o}))}}})}applyIncremental(t,n){var r,o,i,a,l,c;const{data:s}=t;switch(s.source){case k.Mutation:{try{this.applyMutation(s,n)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,s)}break}case k.Drag:case k.TouchMove:case k.MouseMove:if(n){const u=s.positions[s.positions.length-1];this.mousePos={x:u.x,y:u.y,id:u.id,debugData:s}}else s.positions.forEach(u=>{const d={doAction:()=>{this.moveAndHover(u.x,u.y,u.id,n,s)},delay:u.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(d)}),this.timer.addAction({doAction(){},delay:t.delay-((r=s.positions[0])==null?void 0:r.timeOffset)});break;case k.MouseInteraction:{if(s.id===-1||n)break;const u=new Event(H[s.type].toLowerCase()),d=this.mirror.getNode(s.id);if(!d)return this.debugNodeNotFound(s,s.id);this.emitter.emit(O.MouseInteraction,{type:s.type,target:d});const{triggerFocus:h}=this.config;switch(s.type){case H.Blur:"blur"in d&&d.blur();break;case H.Focus:h&&d.focus&&d.focus({preventScroll:!0});break;case H.Click:case H.TouchStart:case H.TouchEnd:n?(s.type===H.TouchStart?this.touchActive=!0:s.type===H.TouchEnd&&(this.touchActive=!1),this.mousePos={x:s.x,y:s.y,id:s.id,debugData:s}):(s.type===H.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(s.x,s.y,s.id,n,s),s.type===H.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):s.type===H.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):s.type===H.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case H.TouchCancel:n?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:d.dispatchEvent(u)}break}case k.Scroll:{if(s.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.scrollData=s;break}this.applyScroll(s,n);break}case k.ViewportResize:this.emitter.emit(O.Resize,{width:s.width,height:s.height});break;case k.Input:{if(s.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.inputData=s;break}this.applyInput(s);break}case k.MediaInteraction:{const u=this.usingVirtualDom?this.virtualDom.mirror.getNode(s.id):this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u;try{s.currentTime&&(d.currentTime=s.currentTime),s.volume&&(d.volume=s.volume),s.muted&&(d.muted=s.muted),s.type===fe.Pause&&d.pause(),s.type===fe.Play&&d.play()}catch(h){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${h.message||h}`)}break}case k.StyleSheetRule:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.rules;(o=s.adds)==null||o.forEach(({rule:h,index:m})=>d?.push({cssText:h,index:m,type:ie.Insert})),(i=s.removes)==null||i.forEach(({index:h})=>d?.push({index:h,type:ie.Remove}))}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.sheet;(a=s.adds)==null||a.forEach(({rule:h,index:m})=>{try{if(Array.isArray(m)){const{positions:f,index:g}=dt(m);we(d.cssRules,f).insertRule(h,g)}else{const f=m===void 0?void 0:Math.min(m,d.cssRules.length);d.insertRule(h,f)}}catch{}}),(l=s.removes)==null||l.forEach(({index:h})=>{try{if(Array.isArray(h)){const{positions:m,index:f}=dt(h);we(d.cssRules,m).deleteRule(f||0)}else d?.deleteRule(h)}catch{}})}break}case k.StyleDeclaration:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.rules;s.set&&d.push(xe({type:ie.SetProperty,index:s.index},s.set)),s.remove&&d.push(xe({type:ie.RemoveProperty,index:s.index},s.remove))}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.sheet;s.set&&we(d.rules,s.index).style.setProperty(s.set.property,s.set.value,s.set.priority),s.remove&&we(d.rules,s.index).style.removeProperty(s.remove.property)}break}case k.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.canvasMutations.push({event:t,mutation:s})}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);Bn({event:t,mutation:s,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case k.Font:{try{const u=new FontFace(s.family,s.buffer?new Uint8Array(JSON.parse(s.fontSource)):s.fontSource,s.descriptors);(c=this.iframe.contentDocument)==null||c.fonts.add(u)}catch(u){this.config.showWarning&&console.warn(u)}break}}}applyMutation(t,n){if(this.config.useVirtualDom&&!this.usingVirtualDom&&n&&(this.usingVirtualDom=!0,Zo(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const s in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[s],d=xn(u.node,this.virtualDom,this.mirror);d&&(u.node=d)}catch(u){this.config.showWarning&&console.warn(u)}const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes.forEach(s=>{var u;const d=r.getNode(s.id);if(!d)return t.removes.find(m=>m.id===s.parentId)?void 0:this.warnNodeNotFound(t,s.id);let h=r.getNode(s.parentId);if(!h)return this.warnNodeNotFound(t,s.parentId);if(s.isShadow&&Ae(h)&&(h=h.shadowRoot),r.removeNodeFromMap(d),h)try{h.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&h.nodeName==="STYLE"&&((u=h.rules)==null?void 0:u.length)>0&&(h.rules=[])}catch(m){if(m instanceof DOMException)this.warn("parent could not remove child in mutation",h,d,t);else throw m}});const o=xe({},this.legacy_missingNodeRetryMap),i=[],a=s=>{let u=null;return s.nextId&&(u=r.getNode(s.nextId)),s.nextId!==null&&s.nextId!==void 0&&s.nextId!==-1&&!u},l=s=>{var u;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let d=r.getNode(s.parentId);if(!d)return s.node.type===R.Document?this.newDocumentQueue.push(s):i.push(s);s.node.isShadow&&(Ae(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let h=null,m=null;if(s.previousId&&(h=r.getNode(s.previousId)),s.nextId&&(m=r.getNode(s.nextId)),a(s))return i.push(s);if(s.node.rootId&&!r.getNode(s.node.rootId))return;const f=s.node.rootId?r.getNode(s.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Ee(d,r)){this.attachDocumentToIframe(s,d);return}const g=je(s.node,{doc:f,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache});if(s.previousId===-1||s.nextId===-1){o[s.node.id]={node:g,mutation:s};return}const b=r.getMeta(d);if(b&&b.type===R.Element&&b.tagName==="textarea"&&s.node.type===R.Text){const p=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const S of p)S.nodeType===d.TEXT_NODE&&d.removeChild(S)}if(h&&h.nextSibling&&h.nextSibling.parentNode)d.insertBefore(g,h.nextSibling);else if(m&&m.parentNode)d.contains(m)?d.insertBefore(g,m):d.insertBefore(g,null);else{if(d===f)for(;f.firstChild;)f.removeChild(f.firstChild);d.appendChild(g)}if(this.usingVirtualDom&&g.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[]),Ee(g,this.mirror)){const p=this.mirror.getId(g),S=this.newDocumentQueue.find(T=>T.parentId===p);S&&(this.attachDocumentToIframe(S,g),this.newDocumentQueue=this.newDocumentQueue.filter(T=>T!==S))}(s.previousId||s.nextId)&&this.legacy_resolveMissingNode(o,d,g,s)};t.adds.forEach(s=>{l(s)});const c=Date.now();for(;i.length;){const s=Ut(i);if(i.length=0,Date.now()-c>500){this.warn("Timeout in the loop, please check the resolve tree data:",s);break}for(const u of s)r.getNode(u.value.parentId)?lt(u,d=>{l(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(o).length&&Object.assign(this.legacy_missingNodeRetryMap,o),Gt(t.texts).forEach(s=>{var u;const d=r.getNode(s.id);if(!d)return t.removes.find(h=>h.id===s.id)?void 0:this.warnNodeNotFound(t,s.id);if(d.textContent=s.value,this.usingVirtualDom){const h=d.parentNode;((u=h?.rules)==null?void 0:u.length)>0&&(h.rules=[])}}),t.attributes.forEach(s=>{const u=r.getNode(s.id);if(!u)return t.removes.find(d=>d.id===s.id)?void 0:this.warnNodeNotFound(t,s.id);for(const d in s.attributes)if(typeof d=="string"){const h=s.attributes[d];if(h===null)u.removeAttribute(d);else if(typeof h=="string")try{u.setAttribute(d,h)}catch(m){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",m)}else if(d==="style"){const m=h,f=u;for(const g in m)if(m[g]===!1)f.style.removeProperty(g);else if(m[g]instanceof Array){const b=m[g];f.style.setProperty(g,b[0],b[1])}else{const b=m[g];f.style.setProperty(g,b)}}}})}applyScroll(t,n){const r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);const o=this.mirror.getMeta(r);if(r===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:t.y,left:t.x,behavior:n?"auto":"smooth"});else if(o?.type===R.Document)r.defaultView.scrollTo({top:t.y,left:t.x,behavior:n?"auto":"smooth"});else try{r.scrollTop=t.y,r.scrollLeft=t.x}catch{}}applyInput(t){const n=this.mirror.getNode(t.id);if(!n)return this.debugNodeNotFound(t,t.id);try{n.checked=t.isChecked,n.value=t.text}catch{}}legacy_resolveMissingNode(t,n,r,o){const{previousId:i,nextId:a}=o,l=i&&t[i],c=a&&t[a];if(l){const{node:s,mutation:u}=l;n.insertBefore(s,r),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,n,s,u)}if(c){const{node:s,mutation:u}=c;n.insertBefore(s,r.nextSibling),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,n,s,u)}}moveAndHover(t,n,r,o,i){const a=this.mirror.getNode(r);if(!a)return this.debugNodeNotFound(i,r);const l=ut(a,this.iframe),c=t*l.absoluteScale+l.x,s=n*l.absoluteScale+l.y;this.mouse.style.left=`${c}px`,this.mouse.style.top=`${s}px`,o||this.drawMouseTail({x:c,y:s}),this.hoverElements(a)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:n,lineWidth:r,strokeStyle:o,duration:i}=this.config.mouseTail===!0?Tt:Object.assign({},Tt,this.config.mouseTail),a=()=>{if(!this.mouseTail)return;const l=this.mouseTail.getContext("2d");!l||!this.tailPositions.length||(l.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),l.beginPath(),l.lineWidth=r,l.lineCap=n,l.strokeStyle=o,l.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(c=>l.lineTo(c.x,c.y)),l.stroke())};this.tailPositions.push(t),a(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(l=>l!==t),a()},i/this.speedService.state.context.timer.speed)}hoverElements(t){var n;(n=this.iframe.contentDocument)==null||n.querySelectorAll(".\\:hover").forEach(o=>{o.classList.remove(":hover")});let r=t;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(t){return t.type!==x.IncrementalSnapshot?!1:t.data.source>k.Mutation&&t.data.source<=k.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(O.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,n){this.warn(`Node with id '${n}' not found. `,t)}warnCanvasMutationFailed(t,n){this.warn("Has error on canvas update",n,"canvas mutation:",t)}debugNodeNotFound(t,n){this.debug(St,`Node with id '${n}' not found. `,t)}warn(...t){!this.config.showWarning||console.warn(St,...t)}debug(...t){!this.config.showDebug||console.log(St,...t)}}const{addCustomEvent:Ii}=ye,{freezePage:Mi}=ye;return q.EventType=x,q.IncrementalSource=k,q.MouseInteractions=H,q.Replayer=Ci,q.ReplayerEvents=O,q.addCustomEvent=Ii,q.freezePage=Mi,q.record=ye,q.utils=Or,Object.defineProperty(q,"__esModule",{value:!0}),q}({});
18
+ ***************************************************************************** */function On(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(l){o={error:l}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}var Re;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Re||(Re={}));var Ln={type:"xstate.init"};function St(e){return e===void 0?[]:[].concat(e)}function Te(e){return{type:"xstate.assign",assignment:e}}function An(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function Qe(e){return function(t){return e===t}}function Fn(e){return typeof e=="string"?{type:e}:e}function Pn(e,t){return{value:e,context:t,actions:[],changed:!1,matches:Qe(e)}}function _n(e,t,n){var r=t,o=!1;return[e.filter(function(i){if(i.type==="xstate.assign"){o=!0;var a=Object.assign({},r);return typeof i.assignment=="function"?a=i.assignment(r,n):Object.keys(i.assignment).forEach(function(l){a[l]=typeof i.assignment[l]=="function"?i.assignment[l](r,n):i.assignment[l]}),r=a,!1}return!0}),r,o]}function Wn(e,t){t===void 0&&(t={});var n=On(_n(St(e.states[e.initial].entry).map(function(a){return An(a,t.actions)}),e.context,Ln),2),r=n[0],o=n[1],i={config:e,_options:t,initialState:{value:e.initial,actions:r,context:o,matches:Qe(e.initial)},transition:function(a,l){var c,s,u=typeof a=="string"?{value:a,context:e.context}:a,d=u.value,h=u.context,m=Fn(l),g=e.states[d];if(g.on){var p=St(g.on[m.type]);try{for(var S=function(F){var Y=typeof Symbol=="function"&&Symbol.iterator,b=Y&&F[Y],v=0;if(b)return b.call(F);if(F&&typeof F.length=="number")return{next:function(){return F&&v>=F.length&&(F=void 0),{value:F&&F[v++],done:!F}}};throw new TypeError(Y?"Object is not iterable.":"Symbol.iterator is not defined.")}(p),f=S.next();!f.done;f=S.next()){var y=f.value;if(y===void 0)return Pn(d,h);var N=typeof y=="string"?{target:y}:y,E=N.target,T=N.actions,w=T===void 0?[]:T,P=N.cond,W=P===void 0?function(){return!0}:P,V=E===void 0,z=E??d,A=e.states[z];if(W(h,m)){var K=On(_n((V?St(w):[].concat(g.exit,w,A.entry).filter(function(F){return F})).map(function(F){return An(F,i._options.actions)}),h,m),3),B=K[0],J=K[1],Q=K[2],U=E??d;return{value:U,context:J,actions:B,changed:E!==d||B.length>0||Q,matches:Qe(U)}}}}catch(F){c={error:F}}finally{try{f&&!f.done&&(s=S.return)&&s.call(S)}finally{if(c)throw c.error}}}return Pn(d,h)}};return i}var $n=function(e,t){return e.actions.forEach(function(n){var r=n.exec;return r&&r(e.context,t)})};function Vn(e){var t=e.initialState,n=Re.NotStarted,r=new Set,o={_machine:e,send:function(i){n===Re.Running&&(t=e.transition(t,i),$n(t,Fn(i)),r.forEach(function(a){return a(t)}))},subscribe:function(i){return r.add(i),i(t),{unsubscribe:function(){return r.delete(i)}}},start:function(i){if(i){var a=typeof i=="object"?i:{context:e.config.context,value:i};t={value:a.value,actions:[],context:a.context,matches:Qe(a.value)}}return n=Re.Running,$n(t,Ln),o},stop:function(){return n=Re.Stopped,r.clear(),o},get state(){return t},get status(){return n}};return o}var ti=Object.defineProperty,ni=Object.defineProperties,ri=Object.getOwnPropertyDescriptors,Un=Object.getOwnPropertySymbols,oi=Object.prototype.hasOwnProperty,ii=Object.prototype.propertyIsEnumerable,Gn=(e,t,n)=>t in e?ti(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Je=(e,t)=>{for(var n in t||(t={}))oi.call(t,n)&&Gn(e,n,t[n]);if(Un)for(var n of Un(t))ii.call(t,n)&&Gn(e,n,t[n]);return e},qe=(e,t)=>ni(e,ri(t));function si(e,t){for(let n=e.length-1;n>=0;n--){const r=e[n];if(r.type===C.Meta&&r.timestamp<=t)return e.slice(n)}return e}function ai(e,{getCastFn:t,applyEventsSynchronously:n,emitter:r}){const o=Wn({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]},REPLACE_EVENTS:{target:"playing",actions:["replaceEvents"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]},REPLACE_EVENTS:{target:"paused",actions:["replaceEvents"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:Te({lastPlayedEvent:(i,a)=>a.type==="CAST_EVENT"?a.payload.event:i.lastPlayedEvent}),recordTimeOffset:Te((i,a)=>{let l=i.timeOffset;return"payload"in a&&"timeOffset"in a.payload&&(l=a.payload.timeOffset),qe(Je({},i),{timeOffset:l,baselineTime:i.events[0].timestamp+l})}),play(i){var a;const{timer:l,events:c,baselineTime:s,lastPlayedEvent:u}=i;l.clear();for(const p of c)bt(p,s);const d=si(c,s);let h=u?.timestamp;u?.type===C.IncrementalSnapshot&&u.data.source===x.MouseMove&&(h=u.timestamp+((a=u.data.positions[0])==null?void 0:a.timeOffset)),s<(h||0)&&r.emit(L.PlayBack);const m=new Array,g=new Array;for(const p of d)if(!(h&&h<s&&(p.timestamp<=h||p===u)))if(p.timestamp<s)m.push(p);else{const S=t(p,!1);g.push({doAction:()=>{S()},delay:p.delay})}n(m),r.emit(L.Flush),l.addActions(g),l.start()},pause(i){i.timer.clear()},resetLastPlayedEvent:Te(i=>qe(Je({},i),{lastPlayedEvent:null})),startLive:Te({baselineTime:(i,a)=>(i.timer.toggleLiveMode(!0),i.timer.start(),a.type==="TO_LIVE"&&a.payload.baselineTime?a.payload.baselineTime:Date.now())}),replaceEvents:Te((i,a)=>{const{events:l,timer:c,baselineTime:s}=i;if(a.type==="REPLACE_EVENTS"){const{events:u}=a.payload;l.length=0;const d=[];for(const h of u)if(bt(h,s),l.push(h),h.timestamp>=c.timeOffset+s){const m=t(h,!1);d.push({doAction:()=>{m()},delay:h.delay})}c.isActive()&&c.replaceActions(d)}return qe(Je({},i),{events:l})}),addEvent:Te((i,a)=>{const{baselineTime:l,timer:c,events:s}=i;if(a.type==="ADD_EVENT"){const{event:u}=a.payload;bt(u,l);let d=s.length-1;if(!s[d]||s[d].timestamp<=u.timestamp)s.push(u);else{let g=-1,p=0;for(;p<=d;){const S=Math.floor((p+d)/2);s[S].timestamp<=u.timestamp?p=S+1:d=S-1}g===-1&&(g=p),s.splice(g,0,u)}const h=u.timestamp<l,m=t(u,h);h?m():c.isActive()&&c.addAction({doAction:()=>{m()},delay:u.delay})}return qe(Je({},i),{events:s})})}});return Vn(o)}function li(e){const t=Wn({id:"speed",context:e,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(n,r)=>{"payload"in r&&n.timer.setSpeed(r.payload.speed)},recordSpeed:Te({normalSpeed:n=>n.timer.speed}),restoreSpeed:n=>{n.timer.setSpeed(n.normalSpeed)}}});return Vn(t)}const ci=e=>["noscript { display: none !important; }",`.${e} { background: currentColor; border-radius: 5px; }`,`.${e}:hover::after {content: 'Redacted'; color: white; background: black; text-align: center; width: 100%; display: block;}`];var ui=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(s){o(s)}},a=c=>{try{l(n.throw(c))}catch(s){o(s)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});const jn=new Map;function zn(e,t){let n=jn.get(e);return n||(n=new Map,jn.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}function fe(e,t,n){return r=>ui(this,null,function*(){if(r&&typeof r=="object"&&"rr_type"in r)if(n&&(n.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){const o=yield fe(e,t,n)(r.args);return yield createImageBitmap.apply(null,o)}else if("index"in r){if(n||t===null)return r;const{rr_type:o,index:i}=r;return zn(t,o)[i]}else if("args"in r){const{rr_type:o,args:i}=r,a=window[o];return new a(...yield Promise.all(i.map(fe(e,t,n))))}else{if("base64"in r)return so(r.base64);if("src"in r){const o=e.get(r.src);if(o)return o;{const i=new Image;return i.src=r.src,e.set(r.src,i),i}}else if("data"in r&&r.rr_type==="Blob"){const o=yield Promise.all(r.data.map(fe(e,t,n)));return new Blob(o,{type:r.type})}}else if(Array.isArray(r))return yield Promise.all(r.map(fe(e,t,n)));return r})}var di=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(s){o(s)}},a=c=>{try{l(n.throw(c))}catch(s){o(s)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});function hi(e,t){try{return t===me.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}const mi=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function pi(e,t){if(!(t!=null&&t.constructor))return;const{name:n}=t.constructor;if(!mi.includes(n))return;const r=zn(e,n);r.includes(t)||r.push(t)}function fi(e){return di(this,arguments,function*({mutation:t,target:n,type:r,imageMap:o,errorHandler:i}){try{const a=hi(n,r);if(!a)return;if(t.setter){a[t.property]=t.args[0];return}const l=a[t.property],c=yield Promise.all(t.args.map(fe(o,a))),s=l.apply(a,c);pi(a,s)}catch(a){i(t,a)}})}var gi=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(s){o(s)}},a=c=>{try{l(n.throw(c))}catch(s){o(s)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});function vi(e){return gi(this,arguments,function*({event:t,mutation:n,target:r,imageMap:o,errorHandler:i}){try{const a=r.getContext("2d");if(n.setter){a[n.property]=n.args[0];return}const l=a[n.property];if(n.property==="drawImage"&&typeof n.args[0]=="string")o.get(t),l.apply(a,n.args);else{const c=yield Promise.all(n.args.map(fe(o,a)));l.apply(a,c)}}catch(a){i(n,a)}})}var yi=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(s){o(s)}},a=c=>{try{l(n.throw(c))}catch(s){o(s)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});function Bn(e){return yi(this,arguments,function*({event:t,mutation:n,target:r,imageMap:o,canvasEventMap:i,errorHandler:a}){try{const l=i.get(t)||n,c="commands"in l?l.commands:[l];if([me.WebGL,me.WebGL2].includes(n.type)){for(let s=0;s<c.length;s++){const u=c[s];yield fi({mutation:u,type:n.type,target:r,imageMap:o,errorHandler:a})}return}for(let s=0;s<c.length;s++){const u=c[s];yield vi({event:t,mutation:u,target:r,imageMap:o,errorHandler:a})}}catch(l){a(n,l)}})}var bi=Object.defineProperty,Si=Object.defineProperties,Ti=Object.getOwnPropertyDescriptors,Yn=Object.getOwnPropertySymbols,Ni=Object.prototype.hasOwnProperty,Ei=Object.prototype.propertyIsEnumerable,Hn=(e,t,n)=>t in e?bi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Oe=(e,t)=>{for(var n in t||(t={}))Ni.call(t,n)&&Hn(e,n,t[n]);if(Yn)for(var n of Yn(t))Ei.call(t,n)&&Hn(e,n,t[n]);return e},Tt=(e,t)=>Si(e,Ti(t)),Nt=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(s){o(s)}},a=c=>{try{l(n.throw(c))}catch(s){o(s)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});const Xn=10*1e3,Zn=2*1e3,Kn=1*1e3,Qn=60*60*1e3,wi=Rn||Jo,Et="[replayer]",wt={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Ct(e){return e.type==C.IncrementalSnapshot&&(e.data.source==x.TouchMove||e.data.source==x.MouseInteraction&&e.data.type==X.TouchStart)}class Ci{constructor(t,n){if(this.usingVirtualDom=!1,this.virtualDom=new De,this.mouseTail=null,this.tailPositions=[],this.emitter=wi(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=$t(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=Mt(),this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,this.handleResize=l=>{this.iframe.style.display="inherit";for(const c of[this.mouseTail,this.iframe])!c||(c.setAttribute("width",String(l.width)),c.setAttribute("height",String(l.height)))},this.applyEventsSynchronously=l=>{for(const c of l){switch(c.type){case C.DomContentLoaded:case C.Load:case C.Custom:continue;case C.FullSnapshot:case C.Meta:case C.Plugin:case C.IncrementalSnapshot:break}this.getCastFn(c,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null},this.getCastFn=(l,c=!1)=>{let s;switch(l.type){case C.DomContentLoaded:case C.Load:break;case C.Custom:s=()=>{this.emitter.emit(L.CustomEvent,l)};break;case C.Meta:s=()=>this.emitter.emit(L.Resize,{width:l.data.width,height:l.data.height});break;case C.FullSnapshot:s=()=>{if(this.firstFullSnapshot){if(this.firstFullSnapshot===l){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(l,c),this.iframe.contentWindow.scrollTo(l.data.initialOffset)};break;case C.IncrementalSnapshot:s=()=>{if(this.applyIncremental(l,c),!c&&(this.handleInactivity(l.timestamp),l===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const u of this.service.state.context.events)if(!(u.timestamp<=l.timestamp)&&this.isUserInteraction(u)){u.delay-l.delay>Xn*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=u);break}if(this.nextUserInteractionEvent){const u=this.nextUserInteractionEvent.delay-l.delay,d={speed:Math.min(Math.round(u/Zn),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:d}),this.emitter.emit(L.SkipStart,d)}}};break}return()=>{s&&s();for(const d of this.config.plugins||[])d.handler(l,c,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:l}});const u=this.service.state.context.events.length-1;if(l===this.service.state.context.events[u]){const d=()=>{u<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(L.Finish))};l.type===C.IncrementalSnapshot&&l.data.source===x.MouseMove&&l.data.positions.length?setTimeout(()=>{d()},Math.max(0,-l.data.positions[0].timeOffset+50)):d()}this.emitter.emit(L.EventCast,l)}},!(n!=null&&n.liveMode)&&t.length<2)throw new Error("Replayer need at least 2 events.");const r={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"highlight-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:wt,useVirtualDom:!0,inactiveThreshold:.02,inactiveSkipTime:Zn};this.config=Object.assign({},r,n),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(L.Resize,this.handleResize),this.setupDom(),this.emitter.on(L.Flush,()=>{if(this.usingVirtualDom){const l={mirror:this.mirror,applyCanvas:(c,s,u)=>{Bn({event:c,mutation:s,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this)};if(ue(this.iframe.contentDocument,this.virtualDom,l,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const c in this.legacy_missingNodeRetryMap)try{const s=this.legacy_missingNodeRetryMap[c],u=yt(s.node,this.mirror,this.virtualDom.mirror);ue(u,s.node,l,this.virtualDom.mirror),s.node=u}catch(s){this.config.showWarning&&console.warn(s)}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null}),this.emitter.on(L.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset()});const o=new ei([],n?.speed||r.speed);this.service=ai({events:t.map(l=>n&&n.unpackFn?n.unpackFn(l):l).sort((l,c)=>l.timestamp-c.timestamp),timer:o,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(l=>{this.emitter.emit(L.StateChange,{player:l})}),this.speedService=li({normalSpeed:-1,timer:o}),this.speedService.start(),this.speedService.subscribe(l=>{this.emitter.emit(L.StateChange,{speed:l})});const i=this.service.state.context.events.find(l=>l.type===C.Meta),a=this.service.state.context.events.find(l=>l.type===C.FullSnapshot);if(i){const{width:l,height:c}=i.data;setTimeout(()=>{this.emitter.emit(L.Resize,{width:l,height:c})},0)}a&&setTimeout(()=>{this.firstFullSnapshot||(this.firstFullSnapshot=a,this.rebuildFullSnapshot(a),this.iframe.contentWindow.scrollTo(a.data.initialOffset))},1),this.service.state.context.events.find(Ct)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,n){return this.emitter.on(t,n),this}off(t,n){return this.emitter.off(t,n),this}setConfig(t){Object.keys(t).forEach(n=>{t[n],this.config[n]=t[n]}),this.config.skipInactive||this.backToNormal(),typeof t.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail<"u"&&(t.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getActivityIntervals(){if(this.activityIntervals.length==0){const t=[],n=this.getMetaData(),r=[{timestamp:n.startTime},...this.service.state.context.events.filter(a=>this.isUserInteraction(a)),{timestamp:n.endTime}];for(let a=1;a<r.length;a++){const l=r[a-1],c=r[a];c.timestamp-l.timestamp>Xn?t.push({startTime:l.timestamp,endTime:c.timestamp,duration:c.timestamp-l.timestamp,active:!1}):t.push({startTime:l.timestamp,endTime:c.timestamp,duration:c.timestamp-l.timestamp,active:!0})}const o=[];let i=t[0];for(let a=1;a<t.length;a++)t[a].active!=t[a-1].active&&(o.push({startTime:i.startTime,endTime:t[a-1].endTime,duration:t[a-1].endTime-i.startTime,active:t[a-1].active}),i=t[a]);i&&t.length>0&&o.push({startTime:i.startTime,endTime:t[t.length-1].endTime,duration:t[t.length-1].endTime-i.startTime,active:t[t.length-1].active}),i=o[0];for(let a=1;a<o.length;a++)(!o[a].active&&o[a].duration>this.config.inactiveThreshold*n.totalTime||!o[a-1].active&&o[a-1].duration>this.config.inactiveThreshold*n.totalTime)&&(this.activityIntervals.push({startTime:i.startTime,endTime:o[a-1].endTime,duration:o[a-1].endTime-i.startTime,active:o[a-1].active}),i=o[a]);i&&o.length>0&&this.activityIntervals.push({startTime:i.startTime,endTime:o[o.length-1].endTime,duration:o[o.length-1].endTime-i.startTime,active:o[o.length-1].active})}return this.activityIntervals}getMetaData(){const t=this.service.state.context.events[0],n=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:n.timestamp,totalTime:n.timestamp-t.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:t,events:n}=this.service.state.context;return t-n[0].timestamp}getMirror(){return this.mirror}play(t=0){var n,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(r=(n=this.iframe.contentDocument)==null?void 0:n.getElementsByTagName("html")[0])==null||r.classList.remove("rrweb-paused"),this.emitter.emit(L.Start),this.handleInactivity(this.getMetaData().startTime+t,!0)}pause(t){var n,r;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(r=(n=this.iframe.contentDocument)==null?void 0:n.getElementsByTagName("html")[0])==null||r.classList.add("rrweb-paused"),this.emitter.emit(L.Pause)}resume(t=0){console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(t),this.emitter.emit(L.Resume)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const n=this.config.unpackFn?this.config.unpackFn(t):t;Ct(n)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:n}}))}replaceEvents(t){for(const n of t)if(Ct(n)){this.mouse.classList.add("touch-device");break}this.service.send({type:"REPLACE_EVENTS",payload:{events:t}})}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=$t()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const t=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&t.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",t.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(qo(this.iframe.contentWindow,this.iframe.contentDocument),ut(this.iframe.contentWindow))}handleInactivity(t,n){if((t===this.inactiveEndTimestamp||n)&&(this.inactiveEndTimestamp=null,this.backToNormal()),this.config.skipInactive&&!this.inactiveEndTimestamp){for(const r of this.getActivityIntervals())if(t>=r.startTime&&t<r.endTime&&!r.active){this.inactiveEndTimestamp=r.endTime;break}if(this.inactiveEndTimestamp){const r=this.inactiveEndTimestamp-t,o={speed:r/Qn*this.config.inactiveSkipTime<Kn?r/Kn:Math.round(Math.max(r,Qn)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:o}),this.emitter.emit(L.SkipStart,o)}}}rebuildFullSnapshot(t,n=!1){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const r=[];Rr(t.data.node,{doc:this.iframe.contentDocument,afterAppend:a=>{this.collectIframeAndAttachDocument(r,a)},cache:this.cache,mirror:this.mirror});for(const{mutationInQueue:a,builtNode:l}of r)this.attachDocumentToIframe(a,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==a);const{documentElement:o,head:i}=this.iframe.contentDocument;this.insertStyleRules(o,i),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(L.FullsnapshotRebuilded,t),n||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,n){const r=ci(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&r.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,Dn(o,this.virtualDom.unserializedId)),t.insertBefore(o,n);for(let i=0;i<r.length;i++)o.rules.push({cssText:r[i],type:se.Insert,index:i})}else{const o=document.createElement("style");t.insertBefore(o,n);for(let i=0;i<r.length;i++)o.sheet.insertRule(r[i],i)}}attachDocumentToIframe(t,n){const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,o=[];Ye(t.node,{doc:n.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:i=>{this.collectIframeAndAttachDocument(o,i);const a=r.getMeta(i);if(a?.type===D.Element&&a?.tagName.toUpperCase()==="HTML"){const{documentElement:l,head:c}=n.contentDocument;this.insertStyleRules(l,c)}},cache:this.cache});for(const{mutationInQueue:i,builtNode:a}of o)this.attachDocumentToIframe(i,a),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==i)}collectIframeAndAttachDocument(t,n){if(Me(n,this.mirror)){const r=this.newDocumentQueue.find(o=>o.parentId===this.mirror.getId(n));r&&t.push({mutationInQueue:r,builtNode:n})}}waitForStylesheetLoad(){var t;const n=(t=this.iframe.contentDocument)==null?void 0:t.head;if(n){const r=new Set;let o,i=this.service.state;const a=()=>{i=this.service.state};this.emitter.on(L.Start,a),this.emitter.on(L.Pause,a);const l=()=>{this.emitter.off(L.Start,a),this.emitter.off(L.Pause,a)};n.querySelectorAll('link[rel="stylesheet"]').forEach(c=>{c.sheet||(r.add(c),c.addEventListener("load",()=>{r.delete(c),r.size===0&&o!==-1&&(i.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(L.LoadStylesheetEnd),o&&clearTimeout(o),l())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(L.LoadStylesheetStart),o=setTimeout(()=>{i.matches("playing")&&this.play(this.getCurrentTime()),o=-1,l()},this.config.loadTimeout))}}preloadAllImages(){return Nt(this,null,function*(){this.service.state;const t=()=>{this.service.state};this.emitter.on(L.Start,t),this.emitter.on(L.Pause,t);const n=[];for(const r of this.service.state.context.events)r.type===C.IncrementalSnapshot&&r.data.source===x.CanvasMutation&&(n.push(this.deserializeAndPreloadCanvasEvents(r.data,r)),("commands"in r.data?r.data.commands:[r.data]).forEach(o=>{this.preloadImages(o,r)}));return Promise.all(n)})}preloadImages(t,n){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(n)){const r=document.createElement("canvas"),o=r.getContext("2d"),i=o?.createImageData(r.width,r.height);i?.data,JSON.parse(t.args[0]),o?.putImageData(i,0,0)}}deserializeAndPreloadCanvasEvents(t,n){return Nt(this,null,function*(){if(!this.canvasEventMap.has(n)){const r={isUnchanged:!0};if("commands"in t){const o=yield Promise.all(t.commands.map(i=>Nt(this,null,function*(){const a=yield Promise.all(i.args.map(fe(this.imageMap,null,r)));return Tt(Oe({},i),{args:a})})));r.isUnchanged===!1&&this.canvasEventMap.set(n,Tt(Oe({},t),{commands:o}))}else{const o=yield Promise.all(t.args.map(fe(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(n,Tt(Oe({},t),{args:o}))}}})}applyIncremental(t,n){var r,o,i,a,l,c;const{data:s}=t;switch(s.source){case x.Mutation:{try{this.applyMutation(s,n)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,s)}break}case x.Drag:case x.TouchMove:case x.MouseMove:if(n){const u=s.positions[s.positions.length-1];this.mousePos={x:u.x,y:u.y,id:u.id,debugData:s}}else s.positions.forEach(u=>{const d={doAction:()=>{this.moveAndHover(u.x,u.y,u.id,n,s)},delay:u.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(d)}),this.timer.addAction({doAction(){},delay:t.delay-((r=s.positions[0])==null?void 0:r.timeOffset)});break;case x.MouseInteraction:{if(s.id===-1||n)break;const u=new Event(X[s.type].toLowerCase()),d=this.mirror.getNode(s.id);if(!d)return this.debugNodeNotFound(s,s.id);this.emitter.emit(L.MouseInteraction,{type:s.type,target:d});const{triggerFocus:h}=this.config;switch(s.type){case X.Blur:"blur"in d&&d.blur();break;case X.Focus:h&&d.focus&&d.focus({preventScroll:!0});break;case X.Click:case X.TouchStart:case X.TouchEnd:n?(s.type===X.TouchStart?this.touchActive=!0:s.type===X.TouchEnd&&(this.touchActive=!1),this.mousePos={x:s.x,y:s.y,id:s.id,debugData:s}):(s.type===X.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(s.x,s.y,s.id,n,s),s.type===X.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):s.type===X.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):s.type===X.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case X.TouchCancel:n?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:d.dispatchEvent(u)}break}case x.Scroll:{if(s.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.scrollData=s;break}this.applyScroll(s,n);break}case x.ViewportResize:this.emitter.emit(L.Resize,{width:s.width,height:s.height});break;case x.Input:{if(s.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.inputData=s;break}this.applyInput(s);break}case x.MediaInteraction:{const u=this.usingVirtualDom?this.virtualDom.mirror.getNode(s.id):this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u;try{s.currentTime&&(d.currentTime=s.currentTime),s.volume&&(d.volume=s.volume),s.muted&&(d.muted=s.muted),s.type===ye.Pause&&d.pause(),s.type===ye.Play&&d.play()}catch(h){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${h.message||h}`)}break}case x.StyleSheetRule:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.rules;(o=s.adds)==null||o.forEach(({rule:h,index:m})=>d?.push({cssText:h,index:m,type:se.Insert})),(i=s.removes)==null||i.forEach(({index:h})=>d?.push({index:h,type:se.Remove}))}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.sheet;(a=s.adds)==null||a.forEach(({rule:h,index:m})=>{try{if(Array.isArray(m)){const{positions:g,index:p}=pt(m);xe(d.cssRules,g).insertRule(h,p)}else{const g=m===void 0?void 0:Math.min(m,d.cssRules.length);d.insertRule(h,g)}}catch{}}),(l=s.removes)==null||l.forEach(({index:h})=>{try{if(Array.isArray(h)){const{positions:m,index:g}=pt(h);xe(d.cssRules,m).deleteRule(g||0)}else d?.deleteRule(h)}catch{}})}break}case x.StyleDeclaration:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.rules;s.set&&d.push(Oe({type:se.SetProperty,index:s.index},s.set)),s.remove&&d.push(Oe({type:se.RemoveProperty,index:s.index},s.remove))}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.sheet;s.set&&xe(d.rules,s.index).style.setProperty(s.set.property,s.set.value,s.set.priority),s.remove&&xe(d.rules,s.index).style.removeProperty(s.remove.property)}break}case x.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.canvasMutations.push({event:t,mutation:s})}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);Bn({event:t,mutation:s,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case x.Font:{try{const u=new FontFace(s.family,s.buffer?new Uint8Array(JSON.parse(s.fontSource)):s.fontSource,s.descriptors);(c=this.iframe.contentDocument)==null||c.fonts.add(u)}catch(u){this.config.showWarning&&console.warn(u)}break}}}applyMutation(t,n){if(this.config.useVirtualDom&&!this.usingVirtualDom&&n&&(this.usingVirtualDom=!0,Zo(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const s in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[s],d=kn(u.node,this.virtualDom,this.mirror);d&&(u.node=d)}catch(u){this.config.showWarning&&console.warn(u)}const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes.forEach(s=>{var u;const d=r.getNode(s.id);if(!d)return t.removes.find(m=>m.id===s.parentId)?void 0:this.warnNodeNotFound(t,s.id);let h=r.getNode(s.parentId);if(!h)return this.warnNodeNotFound(t,s.parentId);if(s.isShadow&&_e(h)&&(h=h.shadowRoot),r.removeNodeFromMap(d),h)try{h.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&h.nodeName==="STYLE"&&((u=h.rules)==null?void 0:u.length)>0&&(h.rules=[])}catch(m){if(m instanceof DOMException)this.warn("parent could not remove child in mutation",h,d,t);else throw m}});const o=Oe({},this.legacy_missingNodeRetryMap),i=[],a=s=>{let u=null;return s.nextId&&(u=r.getNode(s.nextId)),s.nextId!==null&&s.nextId!==void 0&&s.nextId!==-1&&!u},l=s=>{var u;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let d=r.getNode(s.parentId);if(!d)return s.node.type===D.Document?this.newDocumentQueue.push(s):i.push(s);s.node.isShadow&&(_e(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let h=null,m=null;if(s.previousId&&(h=r.getNode(s.previousId)),s.nextId&&(m=r.getNode(s.nextId)),a(s))return i.push(s);if(s.node.rootId&&!r.getNode(s.node.rootId))return;const g=s.node.rootId?r.getNode(s.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Me(d,r)){this.attachDocumentToIframe(s,d);return}const p=Ye(s.node,{doc:g,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache});if(s.previousId===-1||s.nextId===-1){o[s.node.id]={node:p,mutation:s};return}const S=r.getMeta(d);if(S&&S.type===D.Element&&S.tagName==="textarea"&&s.node.type===D.Text){const f=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const y of f)y.nodeType===d.TEXT_NODE&&d.removeChild(y)}if(h&&h.nextSibling&&h.nextSibling.parentNode)d.insertBefore(p,h.nextSibling);else if(m&&m.parentNode)d.contains(m)?d.insertBefore(p,m):d.insertBefore(p,null);else{if(d===g)for(;g.firstChild;)g.removeChild(g.firstChild);d.appendChild(p)}if(this.usingVirtualDom&&p.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[]),Me(p,this.mirror)){const f=this.mirror.getId(p),y=this.newDocumentQueue.find(N=>N.parentId===f);y&&(this.attachDocumentToIframe(y,p),this.newDocumentQueue=this.newDocumentQueue.filter(N=>N!==y))}(s.previousId||s.nextId)&&this.legacy_resolveMissingNode(o,d,p,s)};t.adds.forEach(s=>{l(s)});const c=Date.now();for(;i.length;){const s=Gt(i);if(i.length=0,Date.now()-c>500){this.warn("Timeout in the loop, please check the resolve tree data:",s);break}for(const u of s)r.getNode(u.value.parentId)?dt(u,d=>{l(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(o).length&&Object.assign(this.legacy_missingNodeRetryMap,o),jt(t.texts).forEach(s=>{var u;const d=r.getNode(s.id);if(!d)return t.removes.find(h=>h.id===s.id)?void 0:this.warnNodeNotFound(t,s.id);if(d.textContent=s.value,this.usingVirtualDom){const h=d.parentNode;((u=h?.rules)==null?void 0:u.length)>0&&(h.rules=[])}}),t.attributes.forEach(s=>{const u=r.getNode(s.id);if(!u)return t.removes.find(d=>d.id===s.id)?void 0:this.warnNodeNotFound(t,s.id);for(const d in s.attributes)if(typeof d=="string"){const h=s.attributes[d];if(h===null)u.removeAttribute(d);else if(typeof h=="string")try{u.setAttribute(d,h)}catch(m){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",m)}else if(d==="style"){const m=h,g=u;for(const p in m)if(m[p]===!1)g.style.removeProperty(p);else if(m[p]instanceof Array){const S=m[p];g.style.setProperty(p,S[0],S[1])}else{const S=m[p];g.style.setProperty(p,S)}}}})}applyScroll(t,n){const r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);const o=this.mirror.getMeta(r);if(r===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:t.y,left:t.x,behavior:n?"auto":"smooth"});else if(o?.type===D.Document)r.defaultView.scrollTo({top:t.y,left:t.x,behavior:n?"auto":"smooth"});else try{r.scrollTop=t.y,r.scrollLeft=t.x}catch{}}applyInput(t){const n=this.mirror.getNode(t.id);if(!n)return this.debugNodeNotFound(t,t.id);try{n.checked=t.isChecked,n.value=t.text}catch{}}legacy_resolveMissingNode(t,n,r,o){const{previousId:i,nextId:a}=o,l=i&&t[i],c=a&&t[a];if(l){const{node:s,mutation:u}=l;n.insertBefore(s,r),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,n,s,u)}if(c){const{node:s,mutation:u}=c;n.insertBefore(s,r.nextSibling),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,n,s,u)}}moveAndHover(t,n,r,o,i){const a=this.mirror.getNode(r);if(!a)return this.debugNodeNotFound(i,r);const l=mt(a,this.iframe),c=t*l.absoluteScale+l.x,s=n*l.absoluteScale+l.y;this.mouse.style.left=`${c}px`,this.mouse.style.top=`${s}px`,o||this.drawMouseTail({x:c,y:s}),this.hoverElements(a)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:n,lineWidth:r,strokeStyle:o,duration:i}=this.config.mouseTail===!0?wt:Object.assign({},wt,this.config.mouseTail),a=()=>{if(!this.mouseTail)return;const l=this.mouseTail.getContext("2d");!l||!this.tailPositions.length||(l.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),l.beginPath(),l.lineWidth=r,l.lineCap=n,l.strokeStyle=o,l.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(c=>l.lineTo(c.x,c.y)),l.stroke())};this.tailPositions.push(t),a(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(l=>l!==t),a()},i/this.speedService.state.context.timer.speed)}hoverElements(t){var n;(n=this.iframe.contentDocument)==null||n.querySelectorAll(".\\:hover").forEach(o=>{o.classList.remove(":hover")});let r=t;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(t){return t.type!==C.IncrementalSnapshot?!1:t.data.source>x.Mutation&&t.data.source<=x.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(L.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,n){this.warn(`Node with id '${n}' not found. `,t)}warnCanvasMutationFailed(t,n){this.warn("Has error on canvas update",n,"canvas mutation:",t)}debugNodeNotFound(t,n){this.debug(Et,`Node with id '${n}' not found. `,t)}warn(...t){!this.config.showWarning||console.warn(Et,...t)}debug(...t){!this.config.showDebug||console.log(Et,...t)}}const{addCustomEvent:Ii}=Se,{freezePage:Mi}=Se;return ee.EventType=C,ee.IncrementalSource=x,ee.MouseInteractions=X,ee.Replayer=Ci,ee.ReplayerEvents=L,ee.addCustomEvent=Ii,ee.freezePage=Mi,ee.record=Se,ee.utils=Or,Object.defineProperty(ee,"__esModule",{value:!0}),ee}({});