Socket
Socket
Sign inDemoInstall

rrweb

Package Overview
Dependencies
7
Maintainers
1
Versions
100
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0-alpha.0 to 2.0.0-alpha.1

5

dist/plugins/console-record.js

@@ -293,5 +293,6 @@ var rrwebConsoleRecord = (function (exports) {

}
if (value === null || value === void 0) {
if (value === null)
return value;
}
if (value === void 0)
return "undefined";
if (shouldIgnore(value)) {

@@ -298,0 +299,0 @@ return toString(value);

4

dist/plugins/console-record.min.js

@@ -11,4 +11,4 @@ var rrwebConsoleRecord=function(N){"use strict";var y;(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"})(y||(y={}));const m=`Please stop import mirror directly. Instead of that,\r

`),t=[];for(let o=0,c=n.length;o<c;o+=2){const s=r.exec(n[o]);s&&t.push(new p({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return t},parseOpera11:function(e){return e.stack.split(`
`).filter(function(r){return!!r.match(S)&&!r.match(/^Error created at/)},this).map(function(r){const n=r.split("@"),t=this.extractLocation(n.pop()),o=(n.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new p({functionName:o,fileName:t[0],lineNumber:t[1],columnNumber:t[2]})},this)}};function T(e){if(!e||!e.outerHTML)return"";let r="";for(;e.parentElement;){let n=e.localName;if(!n)break;n=n.toLowerCase();const t=e.parentElement,o=[];if(t.children&&t.children.length>0)for(let c=0;c<t.children.length;c++){const s=t.children[c];s.localName&&s.localName.toLowerCase&&s.localName.toLowerCase()===n&&o.push(s)}o.length>1&&(n+=`:eq(${o.indexOf(e)})`),r=n+(r?">"+r:""),e=t}return r}function w(e){return Object.prototype.toString.call(e)==="[object Object]"}function k(e,r){if(r===0)return!0;const n=Object.keys(e);for(const t of n)if(w(e[t])&&k(e[t],r-1))return!0;return!1}function O(e,r){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,r);const t=[],o=[];return JSON.stringify(e,function(l,i){if(t.length>0){const a=t.indexOf(this);~a?t.splice(a+1):t.push(this),~a?o.splice(a,1/0,l):o.push(l),~t.indexOf(i)&&(t[0]===i?i="[Circular ~]":i="[Circular ~."+o.slice(0,t.indexOf(i)).join(".")+"]")}else t.push(i);if(i==null)return i;if(c(i))return s(i);if(i instanceof Event){const a={};for(const u in i){const f=i[u];Array.isArray(f)?a[u]=T(f.length?f[0]:null):a[u]=f}return a}else{if(i instanceof Node)return i instanceof HTMLElement?i?i.outerHTML:"":i.nodeName;if(i instanceof Error)return i.stack?i.stack+`
End of stack for Error object`:i.name+": "+i.message}return i});function c(l){return!!(w(l)&&Object.keys(l).length>n.numOfKeysLimit||typeof l=="function"||w(l)&&k(l,n.depthOfLimit))}function s(l){let i=l.toString();return n.stringLengthLimit&&i.length>n.stringLengthLimit&&(i=`${i.slice(0,n.stringLengthLimit)}...`),i}}const x={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function P(e,r,n){const t=n?Object.assign({},x,n):x,o=t.logger;if(!o)return()=>{};let c;typeof o=="string"?c=r[o]:c=o;let s=0;const l=[];if(t.level.includes("error")&&window){const a=u=>{const f=u.message,d=u.error,h=E.parse(d).map(g=>g.toString()),v=[O(f,t.stringifyOptions)];e({level:"error",trace:h,payload:v})};window.addEventListener("error",a),l.push(()=>{window&&window.removeEventListener("error",a)})}for(const a of t.level)l.push(i(c,a));return()=>{l.forEach(a=>a())};function i(a,u){return a[u]?C(a,u,f=>(...d)=>{f.apply(this,d);try{const h=E.parse(new Error).map(g=>g.toString()).splice(1),v=d.map(g=>O(g,t.stringifyOptions));s++,s<t.lengthThreshold?e({level:u,trace:h,payload:v}):s===t.lengthThreshold&&e({level:"warn",trace:[],payload:[O("The number of log records reached the threshold.")]})}catch(h){f("rrweb logger error:",h,...d)}}):()=>{}}}const $="rrweb/console@1",_=e=>({name:$,observer:P,options:e});return N.PLUGIN_NAME=$,N.getRecordConsolePlugin=_,Object.defineProperty(N,"__esModule",{value:!0}),N}({});
`).filter(function(r){return!!r.match(S)&&!r.match(/^Error created at/)},this).map(function(r){const n=r.split("@"),t=this.extractLocation(n.pop()),o=(n.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new p({functionName:o,fileName:t[0],lineNumber:t[1],columnNumber:t[2]})},this)}};function T(e){if(!e||!e.outerHTML)return"";let r="";for(;e.parentElement;){let n=e.localName;if(!n)break;n=n.toLowerCase();const t=e.parentElement,o=[];if(t.children&&t.children.length>0)for(let c=0;c<t.children.length;c++){const s=t.children[c];s.localName&&s.localName.toLowerCase&&s.localName.toLowerCase()===n&&o.push(s)}o.length>1&&(n+=`:eq(${o.indexOf(e)})`),r=n+(r?">"+r:""),e=t}return r}function v(e){return Object.prototype.toString.call(e)==="[object Object]"}function k(e,r){if(r===0)return!0;const n=Object.keys(e);for(const t of n)if(v(e[t])&&k(e[t],r-1))return!0;return!1}function w(e,r){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,r);const t=[],o=[];return JSON.stringify(e,function(l,i){if(t.length>0){const a=t.indexOf(this);~a?t.splice(a+1):t.push(this),~a?o.splice(a,1/0,l):o.push(l),~t.indexOf(i)&&(t[0]===i?i="[Circular ~]":i="[Circular ~."+o.slice(0,t.indexOf(i)).join(".")+"]")}else t.push(i);if(i===null)return i;if(i===void 0)return"undefined";if(c(i))return s(i);if(i instanceof Event){const a={};for(const u in i){const f=i[u];Array.isArray(f)?a[u]=T(f.length?f[0]:null):a[u]=f}return a}else{if(i instanceof Node)return i instanceof HTMLElement?i?i.outerHTML:"":i.nodeName;if(i instanceof Error)return i.stack?i.stack+`
End of stack for Error object`:i.name+": "+i.message}return i});function c(l){return!!(v(l)&&Object.keys(l).length>n.numOfKeysLimit||typeof l=="function"||v(l)&&k(l,n.depthOfLimit))}function s(l){let i=l.toString();return n.stringLengthLimit&&i.length>n.stringLengthLimit&&(i=`${i.slice(0,n.stringLengthLimit)}...`),i}}const x={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function P(e,r,n){const t=n?Object.assign({},x,n):x,o=t.logger;if(!o)return()=>{};let c;typeof o=="string"?c=r[o]:c=o;let s=0;const l=[];if(t.level.includes("error")&&window){const a=u=>{const f=u.message,d=u.error,h=E.parse(d).map(g=>g.toString()),O=[w(f,t.stringifyOptions)];e({level:"error",trace:h,payload:O})};window.addEventListener("error",a),l.push(()=>{window&&window.removeEventListener("error",a)})}for(const a of t.level)l.push(i(c,a));return()=>{l.forEach(a=>a())};function i(a,u){return a[u]?C(a,u,f=>(...d)=>{f.apply(this,d);try{const h=E.parse(new Error).map(g=>g.toString()).splice(1),O=d.map(g=>w(g,t.stringifyOptions));s++,s<t.lengthThreshold?e({level:u,trace:h,payload:O}):s===t.lengthThreshold&&e({level:"warn",trace:[],payload:[w("The number of log records reached the threshold.")]})}catch(h){f("rrweb logger error:",h,...d)}}):()=>{}}}const $="rrweb/console@1",_=e=>({name:$,observer:P,options:e});return N.PLUGIN_NAME=$,N.getRecordConsolePlugin=_,Object.defineProperty(N,"__esModule",{value:!0}),N}({});
//# sourceMappingURL=console-record.min.js.map

@@ -1,5 +0,5 @@

var rrwebRecord=function(){"use strict";var N;(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"})(N||(N={}));function Ct(e){return e.nodeType===e.ELEMENT_NODE}function ce(e){var t=e?.host;return Boolean(t?.shadowRoot===e)}var Ne=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(o){return r.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,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function kt(){return new Ne}function Ie(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,s=e.maskInputFn,l=o||"";return(t[r.toLowerCase()]||t[n])&&(s?l=s(l):l="*".repeat(l.length)),l}var Le="__rrweb_original__";function It(e){var t=e.getContext("2d");if(!t)return!0;for(var r=50,n=0;n<e.width;n+=r)for(var o=0;o<e.height;o+=r){var s=t.getImageData,l=Le in s?s[Le]:s,a=new Uint32Array(l.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer);if(a.some(function(i){return i!==0}))return!1}return!0}var wt=1,Mt=new RegExp("[^a-z0-9-_:]"),ue=-2;function Tt(){return wt++}function xt(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return Mt.test(t)?"div":t}function we(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(Ot).join(""):null}catch{return null}}function Ot(e){var t=e.cssText;if(Et(e))try{t=we(e.styleSheet)||t}catch{}return t}function Et(e){return"styleSheet"in e}function Nt(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function Lt(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var re,Re,Rt=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Dt=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,Ft=/^(data:)([^,]*),(.*)/i;function ye(e,t){return(e||"").replace(Rt,function(r,n,o,s,l,a){var i=o||l||a,c=n||s||"";if(!i)return r;if(!Dt.test(i)||Ft.test(i))return"url(".concat(c).concat(i).concat(c,")");if(i[0]==="/")return"url(".concat(c).concat(Lt(t)+i).concat(c,")");var d=t.split("/"),p=i.split("/");d.pop();for(var f=0,u=p;f<u.length;f++){var h=u[f];h!=="."&&(h===".."?d.pop():d.push(h))}return"url(".concat(c).concat(d.join("/")).concat(c,")")})}var At=/^[^ \t\n\r\u000c]+/,Pt=/^[, \t\n\r\u000c]+/;function _t(e,t){if(t.trim()==="")return t;var r=0;function n(c){var d,p=c.exec(t.substring(r));return p?(d=p[0],r+=d.length,d):""}for(var o=[];n(Pt),!(r>=t.length);){var s=n(At);if(s.slice(-1)===",")s=ve(e,s.substring(0,s.length-1)),o.push(s);else{var l="";s=ve(e,s);for(var a=!1;;){var i=t.charAt(r);if(i===""){o.push((s+l).trim());break}else if(a)i===")"&&(a=!1);else if(i===","){r+=1,o.push((s+l).trim());break}else i==="("&&(a=!0);l+=i,r+=1}}}return o.join(", ")}function ve(e,t){if(!t||t.trim()==="")return t;var r=e.createElement("a");return r.href=t,r.href}function Wt(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function Me(){var e=document.createElement("a");return e.href="",e.href}function De(e,t,r,n){return r==="src"||r==="href"&&n||r==="xlink:href"&&n&&n[0]!=="#"||r==="background"&&n&&(t==="table"||t==="td"||t==="th")?ve(e,n):r==="srcset"&&n?_t(e,n):r==="style"&&n?ye(n,Me()):t==="object"&&r==="data"&&n?ve(e,n):n}function zt(e,t,r){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return r?e.matches(r):!1}function ge(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?ge(e.parentNode,t,r):!1;for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return r?ge(e.parentNode,t,r):!1}function Fe(e,t,r){var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(n===null)return!1;if(typeof t=="string"){if(n.classList.contains(t)||n.closest(".".concat(t)))return!0}else if(ge(n,t,!0))return!0;return!!(r&&(n.matches(r)||n.closest(r)))}function Gt(e,t,r){var n=e.contentWindow;if(n){var o=!1,s;try{s=n.document.readyState}catch{return}if(s!=="complete"){var l=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(l),o=!0,t()});return}var a="about:blank";if(n.location.href!==a||e.src===a||e.src===""){setTimeout(t,0);return}e.addEventListener("load",t)}}function Vt(e){return e.getAttribute("href")?e.sheet!==null:!0}function jt(e,t,r){var n=!1,o;try{o=e.sheet}catch{return}if(!o){var s=setTimeout(function(){n||(t(),n=!0)},r);e.addEventListener("load",function(){clearTimeout(s),n=!0,t()})}}function Zt(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,s=t.blockSelector,l=t.maskTextClass,a=t.maskTextSelector,i=t.inlineStylesheet,c=t.maskInputOptions,d=c===void 0?{}:c,p=t.maskTextFn,f=t.maskInputFn,u=t.dataURLOptions,h=u===void 0?{}:u,y=t.inlineImages,b=t.recordCanvas,C=t.keepIframeSrcFn,g=t.newlyAddedElement,m=g===void 0?!1:g,k=Ut(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:N.Document,childNodes:[],compatMode:e.compatMode,rootId:k}:{type:N.Document,childNodes:[],rootId:k};case e.DOCUMENT_TYPE_NODE:return{type:N.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:k};case e.ELEMENT_NODE:return Ht(e,{doc:r,blockClass:o,blockSelector:s,inlineStylesheet:i,maskInputOptions:d,maskInputFn:f,dataURLOptions:h,inlineImages:y,recordCanvas:b,keepIframeSrcFn:C,newlyAddedElement:m,rootId:k});case e.TEXT_NODE:return Yt(e,{maskTextClass:l,maskTextSelector:a,maskTextFn:p,rootId:k});case e.CDATA_SECTION_NODE:return{type:N.CDATA,textContent:"",rootId:k};case e.COMMENT_NODE:return{type:N.Comment,textContent:e.textContent||"",rootId:k};default:return!1}}function Ut(e,t){if(t.hasNode(e)){var r=t.getId(e);return r===1?void 0:r}}function Yt(e,t){var r,n=t.maskTextClass,o=t.maskTextSelector,s=t.maskTextFn,l=t.rootId,a=e.parentNode&&e.parentNode.tagName,i=e.textContent,c=a==="STYLE"?!0:void 0,d=a==="SCRIPT"?!0:void 0;if(c&&i){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(i=Nt(e.parentNode.sheet))}catch(p){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(p),e)}i=ye(i,Me())}return d&&(i="SCRIPT_PLACEHOLDER"),!c&&!d&&i&&Fe(e,n,o)&&(i=s?s(i):i.replace(/[\S]/g,"*")),{type:N.Text,textContent:i||"",isStyle:c,rootId:l}}function Ht(e,t){for(var r=t.doc,n=t.blockClass,o=t.blockSelector,s=t.inlineStylesheet,l=t.maskInputOptions,a=l===void 0?{}:l,i=t.maskInputFn,c=t.dataURLOptions,d=c===void 0?{}:c,p=t.inlineImages,f=t.recordCanvas,u=t.keepIframeSrcFn,h=t.newlyAddedElement,y=h===void 0?!1:h,b=t.rootId,C=zt(e,n,o),g=xt(e),m={},k=e.attributes.length,A=0;A<k;A++){var P=e.attributes[A];m[P.name]=De(r,g,P.name,P.value)}if(g==="link"&&s){var D=Array.from(r.styleSheets).find(function(W){return W.href===e.href}),x=null;D&&(x=we(D)),x&&(delete m.rel,delete m.href,m._cssText=ye(x,D.href))}if(g==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var x=we(e.sheet);x&&(m._cssText=ye(x,Me()))}if(g==="input"||g==="textarea"||g==="select"){var H=e.value;m.type!=="radio"&&m.type!=="checkbox"&&m.type!=="submit"&&m.type!=="button"&&H?m.value=Ie({type:m.type,tagName:g,value:H,maskInputOptions:a,maskInputFn:i}):e.checked&&(m.checked=e.checked)}if(g==="option"&&(e.selected&&!a.select?m.selected=!0:delete m.selected),g==="canvas"&&f){if(e.__context==="2d")It(e)||(m.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var G=e.toDataURL(d.type,d.quality),_=document.createElement("canvas");_.width=e.width,_.height=e.height;var q=_.toDataURL(d.type,d.quality);G!==q&&(m.rr_dataURL=G)}}if(g==="img"&&p){re||(re=r.createElement("canvas"),Re=re.getContext("2d"));var E=e,j=E.crossOrigin;E.crossOrigin="anonymous";var Z=function(){try{re.width=E.naturalWidth,re.height=E.naturalHeight,Re.drawImage(E,0,0),m.rr_dataURL=re.toDataURL(d.type,d.quality)}catch(W){console.warn("Cannot inline img src=".concat(E.currentSrc,"! Error: ").concat(W))}j?m.crossOrigin=j:E.removeAttribute("crossorigin")};E.complete&&E.naturalWidth!==0?Z():E.onload=Z}if((g==="audio"||g==="video")&&(m.rr_mediaState=e.paused?"paused":"played",m.rr_mediaCurrentTime=e.currentTime),y||(e.scrollLeft&&(m.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(m.rr_scrollTop=e.scrollTop)),C){var B=e.getBoundingClientRect(),X=B.width,K=B.height;m={class:m.class,rr_width:"".concat(X,"px"),rr_height:"".concat(K,"px")}}return g==="iframe"&&!u(m.src)&&(e.contentDocument||(m.rr_src=m.src),delete m.src),{type:N.Element,tagName:g,attributes:m,childNodes:[],isSVG:Wt(e)||void 0,needBlock:C,rootId:b}}function w(e){return e===void 0?"":e.toLowerCase()}function Bt(e,t){return!!(t.comment&&e.type===N.Comment||e.type===N.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"&&(w(e.attributes.name).match(/^msapplication-tile(image|color)$/)||w(e.attributes.name)==="application-name"||w(e.attributes.rel)==="icon"||w(e.attributes.rel)==="apple-touch-icon"||w(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&w(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(w(e.attributes.property).match(/^(og|twitter|fb):/)||w(e.attributes.name).match(/^(og|twitter):/)||w(e.attributes.name)==="pinterest")||t.headMetaRobots&&(w(e.attributes.name)==="robots"||w(e.attributes.name)==="googlebot"||w(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(w(e.attributes.name)==="author"||w(e.attributes.name)==="generator"||w(e.attributes.name)==="framework"||w(e.attributes.name)==="publisher"||w(e.attributes.name)==="progid"||w(e.attributes.property).match(/^article:/)||w(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(w(e.attributes.name)==="google-site-verification"||w(e.attributes.name)==="yandex-verification"||w(e.attributes.name)==="csrf-token"||w(e.attributes.name)==="p:domain_verify"||w(e.attributes.name)==="verify-v1"||w(e.attributes.name)==="verification"||w(e.attributes.name)==="shopify-checkout-api-token"))))}function ne(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,s=t.blockSelector,l=t.maskTextClass,a=t.maskTextSelector,i=t.skipChild,c=i===void 0?!1:i,d=t.inlineStylesheet,p=d===void 0?!0:d,f=t.maskInputOptions,u=f===void 0?{}:f,h=t.maskTextFn,y=t.maskInputFn,b=t.slimDOMOptions,C=t.dataURLOptions,g=C===void 0?{}:C,m=t.inlineImages,k=m===void 0?!1:m,A=t.recordCanvas,P=A===void 0?!1:A,D=t.onSerialize,x=t.onIframeLoad,H=t.iframeLoadTimeout,G=H===void 0?5e3:H,_=t.onStylesheetLoad,q=t.stylesheetLoadTimeout,E=q===void 0?5e3:q,j=t.keepIframeSrcFn,Z=j===void 0?function(){return!1}:j,B=t.newlyAddedElement,X=B===void 0?!1:B,K=t.preserveWhiteSpace,W=K===void 0?!0:K,Q=Zt(e,{doc:r,mirror:n,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,inlineStylesheet:p,maskInputOptions:u,maskTextFn:h,maskInputFn:y,dataURLOptions:g,inlineImages:k,recordCanvas:P,keepIframeSrcFn:Z,newlyAddedElement:X});if(!Q)return console.warn(e,"not serialized"),null;var v;if(n.hasNode(e)?v=n.getId(e):Bt(Q,b)||!W&&Q.type===N.Text&&!Q.isStyle&&!Q.textContent.replace(/^\s+|\s+$/gm,"").length?v=ue:v=Tt(),v===ue)return null;var S=Object.assign(Q,{id:v});n.add(e,S),D&&D(e);var U=!c;if(S.type===N.Element&&(U=U&&!S.needBlock,delete S.needBlock,e.shadowRoot&&(S.isShadowHost=!0)),(S.type===N.Document||S.type===N.Element)&&U){b.headWhitespace&&S.type===N.Element&&S.tagName==="head"&&(W=!1);for(var F={doc:r,mirror:n,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,skipChild:c,inlineStylesheet:p,maskInputOptions:u,maskTextFn:h,maskInputFn:y,slimDOMOptions:b,dataURLOptions:g,inlineImages:k,recordCanvas:P,preserveWhiteSpace:W,onSerialize:D,onIframeLoad:x,iframeLoadTimeout:G,onStylesheetLoad:_,stylesheetLoadTimeout:E,keepIframeSrcFn:Z},$=0,I=Array.from(e.childNodes);$<I.length;$++){var M=I[$],ee=ne(M,F);ee&&S.childNodes.push(ee)}if(Ct(e)&&e.shadowRoot)for(var Ee=0,bt=Array.from(e.shadowRoot.childNodes);Ee<bt.length;Ee++){var M=bt[Ee],ee=ne(M,F);ee&&(ee.isShadow=!0,S.childNodes.push(ee))}}return e.parentNode&&ce(e.parentNode)&&(S.isShadow=!0),S.type===N.Element&&S.tagName==="iframe"&&Gt(e,function(){var le=e.contentDocument;if(le&&x){var St=ne(le,{doc:le,mirror:n,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,skipChild:!1,inlineStylesheet:p,maskInputOptions:u,maskTextFn:h,maskInputFn:y,slimDOMOptions:b,dataURLOptions:g,inlineImages:k,recordCanvas:P,preserveWhiteSpace:W,onSerialize:D,onIframeLoad:x,iframeLoadTimeout:G,onStylesheetLoad:_,stylesheetLoadTimeout:E,keepIframeSrcFn:Z});St&&x(e,St)}},G),S.type===N.Element&&S.tagName==="link"&&S.attributes.rel==="stylesheet"&&(jt(e,function(){if(_){var le=ne(e,{doc:r,mirror:n,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,skipChild:!1,inlineStylesheet:p,maskInputOptions:u,maskTextFn:h,maskInputFn:y,slimDOMOptions:b,dataURLOptions:g,inlineImages:k,recordCanvas:P,preserveWhiteSpace:W,onSerialize:D,onIframeLoad:x,iframeLoadTimeout:G,onStylesheetLoad:_,stylesheetLoadTimeout:E,keepIframeSrcFn:Z});le&&_(e,le)}},E),Vt(e)===!1)?null:S}function Xt(e,t){var r=t||{},n=r.mirror,o=n===void 0?new Ne:n,s=r.blockClass,l=s===void 0?"rr-block":s,a=r.blockSelector,i=a===void 0?null:a,c=r.maskTextClass,d=c===void 0?"rr-mask":c,p=r.maskTextSelector,f=p===void 0?null:p,u=r.inlineStylesheet,h=u===void 0?!0:u,y=r.inlineImages,b=y===void 0?!1:y,C=r.recordCanvas,g=C===void 0?!1:C,m=r.maskAllInputs,k=m===void 0?!1:m,A=r.maskTextFn,P=r.maskInputFn,D=r.slimDOM,x=D===void 0?!1:D,H=r.dataURLOptions,G=r.preserveWhiteSpace,_=r.onSerialize,q=r.onIframeLoad,E=r.iframeLoadTimeout,j=r.onStylesheetLoad,Z=r.stylesheetLoadTimeout,B=r.keepIframeSrcFn,X=B===void 0?function(){return!1}:B,K=k===!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}:k===!1?{password:!0}:k,W=x===!0||x==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:x==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:x===!1?{}:x;return ne(e,{doc:e,mirror:o,blockClass:l,blockSelector:i,maskTextClass:d,maskTextSelector:f,skipChild:!1,inlineStylesheet:h,maskInputOptions:K,maskTextFn:A,maskInputFn:P,slimDOMOptions:W,dataURLOptions:H,inlineImages:b,recordCanvas:g,preserveWhiteSpace:G,onSerialize:_,onIframeLoad:q,iframeLoadTimeout:E,onStylesheetLoad:j,stylesheetLoadTimeout:Z,keepIframeSrcFn:X,newlyAddedElement:!1})}function z(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const oe=`Please stop import mirror directly. Instead of that,\r
var rrwebRecord=function(){"use strict";var N;(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"})(N||(N={}));function It(e){return e.nodeType===e.ELEMENT_NODE}function ue(e){var t=e?.host;return Boolean(t?.shadowRoot===e)}function de(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}var Re=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(o){return r.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,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function wt(){return new Re}function Me(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,s=e.maskInputFn,l=o||"";return(t[r.toLowerCase()]||t[n])&&(s?l=s(l):l="*".repeat(l.length)),l}var De="__rrweb_original__";function Mt(e){var t=e.getContext("2d");if(!t)return!0;for(var r=50,n=0;n<e.width;n+=r)for(var o=0;o<e.height;o+=r){var s=t.getImageData,l=De in s?s[De]:s,a=new Uint32Array(l.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer);if(a.some(function(i){return i!==0}))return!1}return!0}var Tt=1,xt=new RegExp("[^a-z0-9-_:]"),pe=-2;function Ot(){return Tt++}function Et(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return xt.test(t)?"div":t}function Te(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(Nt).join(""):null}catch{return null}}function Nt(e){var t=e.cssText;if(Lt(e))try{t=Te(e.styleSheet)||t}catch{}return t}function Lt(e){return"styleSheet"in e}function Rt(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function Dt(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var re,Fe,Ft=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,At=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,Pt=/^(data:)([^,]*),(.*)/i;function ge(e,t){return(e||"").replace(Ft,function(r,n,o,s,l,a){var i=o||l||a,c=n||s||"";if(!i)return r;if(!At.test(i)||Pt.test(i))return"url(".concat(c).concat(i).concat(c,")");if(i[0]==="/")return"url(".concat(c).concat(Dt(t)+i).concat(c,")");var d=t.split("/"),p=i.split("/");d.pop();for(var f=0,u=p;f<u.length;f++){var h=u[f];h!=="."&&(h===".."?d.pop():d.push(h))}return"url(".concat(c).concat(d.join("/")).concat(c,")")})}var _t=/^[^ \t\n\r\u000c]+/,Wt=/^[, \t\n\r\u000c]+/;function Gt(e,t){if(t.trim()==="")return t;var r=0;function n(c){var d,p=c.exec(t.substring(r));return p?(d=p[0],r+=d.length,d):""}for(var o=[];n(Wt),!(r>=t.length);){var s=n(_t);if(s.slice(-1)===",")s=be(e,s.substring(0,s.length-1)),o.push(s);else{var l="";s=be(e,s);for(var a=!1;;){var i=t.charAt(r);if(i===""){o.push((s+l).trim());break}else if(a)i===")"&&(a=!1);else if(i===","){r+=1,o.push((s+l).trim());break}else i==="("&&(a=!0);l+=i,r+=1}}}return o.join(", ")}function be(e,t){if(!t||t.trim()==="")return t;var r=e.createElement("a");return r.href=t,r.href}function zt(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function xe(){var e=document.createElement("a");return e.href="",e.href}function Ae(e,t,r,n){return r==="src"||r==="href"&&n&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n&&n[0]!=="#"||r==="background"&&n&&(t==="table"||t==="td"||t==="th")?be(e,n):r==="srcset"&&n?Gt(e,n):r==="style"&&n?ge(n,xe()):t==="object"&&r==="data"&&n?be(e,n):n}function Vt(e,t,r){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return r?e.matches(r):!1}function Se(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?Se(e.parentNode,t,r):!1;for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return r?Se(e.parentNode,t,r):!1}function Pe(e,t,r){var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(n===null)return!1;if(typeof t=="string"){if(n.classList.contains(t)||n.closest(".".concat(t)))return!0}else if(Se(n,t,!0))return!0;return!!(r&&(n.matches(r)||n.closest(r)))}function jt(e,t,r){var n=e.contentWindow;if(n){var o=!1,s;try{s=n.document.readyState}catch{return}if(s!=="complete"){var l=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(l),o=!0,t()});return}var a="about:blank";if(n.location.href!==a||e.src===a||e.src===""){setTimeout(t,0);return}e.addEventListener("load",t)}}function Zt(e){return e.getAttribute("href")?e.sheet!==null:!0}function Ut(e,t,r){var n=!1,o;try{o=e.sheet}catch{return}if(!o){var s=setTimeout(function(){n||(t(),n=!0)},r);e.addEventListener("load",function(){clearTimeout(s),n=!0,t()})}}function Yt(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,s=t.blockSelector,l=t.maskTextClass,a=t.maskTextSelector,i=t.inlineStylesheet,c=t.maskInputOptions,d=c===void 0?{}:c,p=t.maskTextFn,f=t.maskInputFn,u=t.dataURLOptions,h=u===void 0?{}:u,y=t.inlineImages,b=t.recordCanvas,k=t.keepIframeSrcFn,g=t.newlyAddedElement,m=g===void 0?!1:g,I=Ht(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:N.Document,childNodes:[],compatMode:e.compatMode,rootId:I}:{type:N.Document,childNodes:[],rootId:I};case e.DOCUMENT_TYPE_NODE:return{type:N.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:return Xt(e,{doc:r,blockClass:o,blockSelector:s,inlineStylesheet:i,maskInputOptions:d,maskInputFn:f,dataURLOptions:h,inlineImages:y,recordCanvas:b,keepIframeSrcFn:k,newlyAddedElement:m,rootId:I});case e.TEXT_NODE:return Bt(e,{maskTextClass:l,maskTextSelector:a,maskTextFn:p,rootId:I});case e.CDATA_SECTION_NODE:return{type:N.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return{type:N.Comment,textContent:e.textContent||"",rootId:I};default:return!1}}function Ht(e,t){if(t.hasNode(e)){var r=t.getId(e);return r===1?void 0:r}}function Bt(e,t){var r,n=t.maskTextClass,o=t.maskTextSelector,s=t.maskTextFn,l=t.rootId,a=e.parentNode&&e.parentNode.tagName,i=e.textContent,c=a==="STYLE"?!0:void 0,d=a==="SCRIPT"?!0:void 0;if(c&&i){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(i=Rt(e.parentNode.sheet))}catch(p){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(p),e)}i=ge(i,xe())}return d&&(i="SCRIPT_PLACEHOLDER"),!c&&!d&&i&&Pe(e,n,o)&&(i=s?s(i):i.replace(/[\S]/g,"*")),{type:N.Text,textContent:i||"",isStyle:c,rootId:l}}function Xt(e,t){for(var r=t.doc,n=t.blockClass,o=t.blockSelector,s=t.inlineStylesheet,l=t.maskInputOptions,a=l===void 0?{}:l,i=t.maskInputFn,c=t.dataURLOptions,d=c===void 0?{}:c,p=t.inlineImages,f=t.recordCanvas,u=t.keepIframeSrcFn,h=t.newlyAddedElement,y=h===void 0?!1:h,b=t.rootId,k=Vt(e,n,o),g=Et(e),m={},I=e.attributes.length,A=0;A<I;A++){var P=e.attributes[A];m[P.name]=Ae(r,g,P.name,P.value)}if(g==="link"&&s){var D=Array.from(r.styleSheets).find(function(W){return W.href===e.href}),x=null;D&&(x=Te(D)),x&&(delete m.rel,delete m.href,m._cssText=ge(x,D.href))}if(g==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var x=Te(e.sheet);x&&(m._cssText=ge(x,xe()))}if(g==="input"||g==="textarea"||g==="select"){var H=e.value;m.type!=="radio"&&m.type!=="checkbox"&&m.type!=="submit"&&m.type!=="button"&&H?m.value=Me({type:m.type,tagName:g,value:H,maskInputOptions:a,maskInputFn:i}):e.checked&&(m.checked=e.checked)}if(g==="option"&&(e.selected&&!a.select?m.selected=!0:delete m.selected),g==="canvas"&&f){if(e.__context==="2d")Mt(e)||(m.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var z=e.toDataURL(d.type,d.quality),_=document.createElement("canvas");_.width=e.width,_.height=e.height;var J=_.toDataURL(d.type,d.quality);z!==J&&(m.rr_dataURL=z)}}if(g==="img"&&p){re||(re=r.createElement("canvas"),Fe=re.getContext("2d"));var E=e,j=E.crossOrigin;E.crossOrigin="anonymous";var Z=function(){try{re.width=E.naturalWidth,re.height=E.naturalHeight,Fe.drawImage(E,0,0),m.rr_dataURL=re.toDataURL(d.type,d.quality)}catch(W){console.warn("Cannot inline img src=".concat(E.currentSrc,"! Error: ").concat(W))}j?m.crossOrigin=j:E.removeAttribute("crossorigin")};E.complete&&E.naturalWidth!==0?Z():E.onload=Z}if((g==="audio"||g==="video")&&(m.rr_mediaState=e.paused?"paused":"played",m.rr_mediaCurrentTime=e.currentTime),y||(e.scrollLeft&&(m.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(m.rr_scrollTop=e.scrollTop)),k){var B=e.getBoundingClientRect(),X=B.width,K=B.height;m={class:m.class,rr_width:"".concat(X,"px"),rr_height:"".concat(K,"px")}}return g==="iframe"&&!u(m.src)&&(e.contentDocument||(m.rr_src=m.src),delete m.src),{type:N.Element,tagName:g,attributes:m,childNodes:[],isSVG:zt(e)||void 0,needBlock:k,rootId:b}}function w(e){return e===void 0?"":e.toLowerCase()}function Kt(e,t){return!!(t.comment&&e.type===N.Comment||e.type===N.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"&&(w(e.attributes.name).match(/^msapplication-tile(image|color)$/)||w(e.attributes.name)==="application-name"||w(e.attributes.rel)==="icon"||w(e.attributes.rel)==="apple-touch-icon"||w(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&w(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(w(e.attributes.property).match(/^(og|twitter|fb):/)||w(e.attributes.name).match(/^(og|twitter):/)||w(e.attributes.name)==="pinterest")||t.headMetaRobots&&(w(e.attributes.name)==="robots"||w(e.attributes.name)==="googlebot"||w(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(w(e.attributes.name)==="author"||w(e.attributes.name)==="generator"||w(e.attributes.name)==="framework"||w(e.attributes.name)==="publisher"||w(e.attributes.name)==="progid"||w(e.attributes.property).match(/^article:/)||w(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(w(e.attributes.name)==="google-site-verification"||w(e.attributes.name)==="yandex-verification"||w(e.attributes.name)==="csrf-token"||w(e.attributes.name)==="p:domain_verify"||w(e.attributes.name)==="verify-v1"||w(e.attributes.name)==="verification"||w(e.attributes.name)==="shopify-checkout-api-token"))))}function ne(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,s=t.blockSelector,l=t.maskTextClass,a=t.maskTextSelector,i=t.skipChild,c=i===void 0?!1:i,d=t.inlineStylesheet,p=d===void 0?!0:d,f=t.maskInputOptions,u=f===void 0?{}:f,h=t.maskTextFn,y=t.maskInputFn,b=t.slimDOMOptions,k=t.dataURLOptions,g=k===void 0?{}:k,m=t.inlineImages,I=m===void 0?!1:m,A=t.recordCanvas,P=A===void 0?!1:A,D=t.onSerialize,x=t.onIframeLoad,H=t.iframeLoadTimeout,z=H===void 0?5e3:H,_=t.onStylesheetLoad,J=t.stylesheetLoadTimeout,E=J===void 0?5e3:J,j=t.keepIframeSrcFn,Z=j===void 0?function(){return!1}:j,B=t.newlyAddedElement,X=B===void 0?!1:B,K=t.preserveWhiteSpace,W=K===void 0?!0:K,q=Yt(e,{doc:r,mirror:n,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,inlineStylesheet:p,maskInputOptions:u,maskTextFn:h,maskInputFn:y,dataURLOptions:g,inlineImages:I,recordCanvas:P,keepIframeSrcFn:Z,newlyAddedElement:X});if(!q)return console.warn(e,"not serialized"),null;var v;if(n.hasNode(e)?v=n.getId(e):Kt(q,b)||!W&&q.type===N.Text&&!q.isStyle&&!q.textContent.replace(/^\s+|\s+$/gm,"").length?v=pe:v=Ot(),v===pe)return null;var S=Object.assign(q,{id:v});n.add(e,S),D&&D(e);var U=!c;if(S.type===N.Element){U=U&&!S.needBlock,delete S.needBlock;var F=e.shadowRoot;F&&de(F)&&(S.isShadowHost=!0)}if((S.type===N.Document||S.type===N.Element)&&U){b.headWhitespace&&S.type===N.Element&&S.tagName==="head"&&(W=!1);for(var Q={doc:r,mirror:n,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,skipChild:c,inlineStylesheet:p,maskInputOptions:u,maskTextFn:h,maskInputFn:y,slimDOMOptions:b,dataURLOptions:g,inlineImages:I,recordCanvas:P,preserveWhiteSpace:W,onSerialize:D,onIframeLoad:x,iframeLoadTimeout:z,onStylesheetLoad:_,stylesheetLoadTimeout:E,keepIframeSrcFn:Z},C=0,T=Array.from(e.childNodes);C<T.length;C++){var te=T[C],le=ne(te,Q);le&&S.childNodes.push(le)}if(It(e)&&e.shadowRoot)for(var Le=0,Ct=Array.from(e.shadowRoot.childNodes);Le<Ct.length;Le++){var te=Ct[Le],le=ne(te,Q);le&&(de(e.shadowRoot)&&(le.isShadow=!0),S.childNodes.push(le))}}return e.parentNode&&ue(e.parentNode)&&de(e.parentNode)&&(S.isShadow=!0),S.type===N.Element&&S.tagName==="iframe"&&jt(e,function(){var ce=e.contentDocument;if(ce&&x){var kt=ne(ce,{doc:ce,mirror:n,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,skipChild:!1,inlineStylesheet:p,maskInputOptions:u,maskTextFn:h,maskInputFn:y,slimDOMOptions:b,dataURLOptions:g,inlineImages:I,recordCanvas:P,preserveWhiteSpace:W,onSerialize:D,onIframeLoad:x,iframeLoadTimeout:z,onStylesheetLoad:_,stylesheetLoadTimeout:E,keepIframeSrcFn:Z});kt&&x(e,kt)}},z),S.type===N.Element&&S.tagName==="link"&&S.attributes.rel==="stylesheet"&&(Ut(e,function(){if(_){var ce=ne(e,{doc:r,mirror:n,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,skipChild:!1,inlineStylesheet:p,maskInputOptions:u,maskTextFn:h,maskInputFn:y,slimDOMOptions:b,dataURLOptions:g,inlineImages:I,recordCanvas:P,preserveWhiteSpace:W,onSerialize:D,onIframeLoad:x,iframeLoadTimeout:z,onStylesheetLoad:_,stylesheetLoadTimeout:E,keepIframeSrcFn:Z});ce&&_(e,ce)}},E),Zt(e)===!1)?null:S}function $t(e,t){var r=t||{},n=r.mirror,o=n===void 0?new Re:n,s=r.blockClass,l=s===void 0?"rr-block":s,a=r.blockSelector,i=a===void 0?null:a,c=r.maskTextClass,d=c===void 0?"rr-mask":c,p=r.maskTextSelector,f=p===void 0?null:p,u=r.inlineStylesheet,h=u===void 0?!0:u,y=r.inlineImages,b=y===void 0?!1:y,k=r.recordCanvas,g=k===void 0?!1:k,m=r.maskAllInputs,I=m===void 0?!1:m,A=r.maskTextFn,P=r.maskInputFn,D=r.slimDOM,x=D===void 0?!1:D,H=r.dataURLOptions,z=r.preserveWhiteSpace,_=r.onSerialize,J=r.onIframeLoad,E=r.iframeLoadTimeout,j=r.onStylesheetLoad,Z=r.stylesheetLoadTimeout,B=r.keepIframeSrcFn,X=B===void 0?function(){return!1}:B,K=I===!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}:I===!1?{password:!0}:I,W=x===!0||x==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:x==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:x===!1?{}:x;return ne(e,{doc:e,mirror:o,blockClass:l,blockSelector:i,maskTextClass:d,maskTextSelector:f,skipChild:!1,inlineStylesheet:h,maskInputOptions:K,maskTextFn:A,maskInputFn:P,slimDOMOptions:W,dataURLOptions:H,inlineImages:b,recordCanvas:g,preserveWhiteSpace:z,onSerialize:_,onIframeLoad:J,iframeLoadTimeout:E,onStylesheetLoad:j,stylesheetLoadTimeout:Z,keepIframeSrcFn:X,newlyAddedElement:!1})}function G(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const oe=`Please stop import mirror directly. Instead of that,\r
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
or you can use record.mirror to access the mirror instance during recording.`;let Ae={map:{},getId(){return console.error(oe),-1},getNode(){return console.error(oe),null},removeNodeFromMap(){console.error(oe)},has(){return console.error(oe),!1},reset(){console.error(oe)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Ae=new Proxy(Ae,{get(e,t,r){return t==="map"&&console.error(oe),Reflect.get(e,t,r)}}));function de(e,t,r={}){let n=null,o=0;return function(...s){const l=Date.now();!o&&r.leading===!1&&(o=l);const a=t-(l-o),i=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),o=l,e.apply(i,s)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(i,s)},a))}}function be(e,t,r,n,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(l){setTimeout(()=>{r.set.call(this,l)},0),s&&s.set&&s.set.call(this,l)}}),()=>be(e,t,s||{},!0)}function ae(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],o=r(n);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch{return()=>{}}}function Pe(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function _e(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function V(e,t,r){if(!e)return!1;const n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!n)return!1;if(typeof t=="string"){if(n.classList.contains(t)||r&&n.closest("."+t)!==null)return!0}else if(ge(n,t,r))return!0;return!1}function Kt(e,t){return t.getId(e)!==-1}function Te(e,t){return t.getId(e)===ue}function We(e,t){if(ce(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?We(e.parentNode,t):!0:!0}function ze(e){return Boolean(e.changedTouches)}function $t(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let r=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===r)return!0;while(r=r&&r.parentNode);return!1})}function Ge(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function Ve(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function je(e){return Boolean(e?.shadowRoot)}var T=(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))(T||{}),R=(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))(R||{}),xe=(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))(xe||{}),se=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(se||{}),pe=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(pe||{}),Jt=(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))(Jt||{});function Ze(e){return"__ln"in e}class qt{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){const r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&Ze(t.previousSibling)){const n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&Ze(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;this.length++}removeNode(t){const r=t.__ln;!this.head||(r.previous?(r.previous.next=r.next,r.next&&(r.next.previous=r.previous)):(this.head=r.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}}const Ue=(e,t)=>`${e}@${t}`;class Qt{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],r=new qt,n=a=>{let i=a,c=ue;for(;c===ue;)i=i&&i.nextSibling,c=i&&this.mirror.getId(i);return c},o=a=>{var i,c,d,p,f;const u=a.getRootNode?(i=a.getRootNode())==null?void 0:i.host:null;let h=u;for(;(d=(c=h?.getRootNode)==null?void 0:c.call(h))!=null&&d.host;)h=((f=(p=h?.getRootNode)==null?void 0:p.call(h))==null?void 0:f.host)||null;const y=!this.doc.contains(a)&&(!h||!this.doc.contains(h));if(!a.parentNode||y)return;const b=ce(a.parentNode)?this.mirror.getId(u):this.mirror.getId(a.parentNode),C=n(a);if(b===-1||C===-1)return r.addNode(a);const g=ne(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:m=>{Ge(m,this.mirror)&&this.iframeManager.addIframe(m),Ve(m,this.mirror)&&this.stylesheetManager.addStylesheet(m),je(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,document)},onIframeLoad:(m,k)=>{this.iframeManager.attachIframe(m,k,this.mirror),this.shadowDomManager.observeAttachShadow(m)},onStylesheetLoad:(m,k)=>{this.stylesheetManager.attachStylesheet(m,k,this.mirror)}});g&&t.push({parentId:b,nextId:C,node:g})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of Array.from(this.movedSet.values()))Ye(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||o(a);for(const a of Array.from(this.addedSet.values()))!Be(this.droppedSet,a)&&!Ye(this.removes,a,this.mirror)||Be(this.movedSet,a)?o(a):this.droppedSet.add(a);let s=null;for(;r.length;){let a=null;if(s){const i=this.mirror.getId(s.value.parentNode),c=n(s.value);i!==-1&&c!==-1&&(a=s)}if(!a)for(let i=r.length-1;i>=0;i--){const c=r.get(i);if(c){const d=this.mirror.getId(c.value.parentNode),p=n(c.value);if(d!==-1&&p!==-1){a=c;break}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}s=a.previous,r.removeNode(a.value),o(a.value)}const l={texts:this.texts.map(a=>({id:this.mirror.getId(a.node),value:a.value})).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>({id:this.mirror.getId(a.node),attributes:a.attributes})).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:t};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(l))},this.processMutation=t=>{if(!Te(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!V(t.target,this.blockClass,!1)&&r!==t.oldValue&&this.texts.push({value:Fe(t.target,this.maskTextClass,this.maskTextSelector)&&r?this.maskTextFn?this.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let n=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(n=Ie({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),V(t.target,this.blockClass,!1)||n===t.oldValue)return;let o=this.attributes.find(s=>s.node===t.target);if(o||(o={node:t.target,attributes:{}},this.attributes.push(o)),t.attributeName==="style"){const s=this.doc.createElement("span");t.oldValue&&s.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});const l=o.attributes.style;for(const a of Array.from(r.style)){const i=r.style.getPropertyValue(a),c=r.style.getPropertyPriority(a);(i!==s.style.getPropertyValue(a)||c!==s.style.getPropertyPriority(a))&&(c===""?l[a]=i:l[a]=[i,c])}for(const a of Array.from(s.style))r.style.getPropertyValue(a)===""&&(l[a]=!1)}else o.attributes[t.attributeName]=De(this.doc,t.target.tagName,t.attributeName,n);break}case"childList":{if(V(t.target,this.blockClass,!0))return;t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const n=this.mirror.getId(r),o=ce(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);V(t.target,this.blockClass,!1)||Te(r,this.mirror)||!Kt(r,this.mirror)||(this.addedSet.has(r)?(Oe(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||We(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Ue(n,o)]?Oe(this.movedSet,r):this.removes.push({parentId:o,id:n,isShadow:ce(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(this.mirror.hasNode(t)){if(Te(t,this.mirror))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[Ue(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);V(t,this.blockClass,!1)||t.childNodes.forEach(n=>this.genAdds(n))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Oe(e,t){e.delete(t),t.childNodes.forEach(r=>Oe(e,r))}function Ye(e,t,r){return e.length===0?!1:He(e,t,r)}function He(e,t,r){const{parentNode:n}=t;if(!n)return!1;const o=r.getId(n);return e.some(s=>s.id===o)?!0:He(e,n,r)}function Be(e,t){return e.size===0?!1:Xe(e,t)}function Xe(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:Xe(e,r):!1}var er=Object.defineProperty,tr=Object.defineProperties,rr=Object.getOwnPropertyDescriptors,Ke=Object.getOwnPropertySymbols,nr=Object.prototype.hasOwnProperty,or=Object.prototype.propertyIsEnumerable,$e=(e,t,r)=>t in e?er(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Je=(e,t)=>{for(var r in t||(t={}))nr.call(t,r)&&$e(e,r,t[r]);if(Ke)for(var r of Ke(t))or.call(t,r)&&$e(e,r,t[r]);return e},ar=(e,t)=>tr(e,rr(t));const te=[],qe=typeof CSSGroupingRule<"u",Qe=typeof CSSMediaRule<"u",et=typeof CSSSupportsRule<"u",tt=typeof CSSConditionRule<"u";function he(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch{return e.target}}function rt(e,t){var r,n;const o=new Qt;te.push(o),o.init(e);let s=window.MutationObserver||window.__rrMutationObserver;const l=(n=(r=window?.Zone)==null?void 0:r.__symbol__)==null?void 0:n.call(r,"MutationObserver");l&&window[l]&&(s=window[l]);const a=new s(o.processMutations.bind(o));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function sr({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,s=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let l=[],a;const i=de(p=>{const f=Date.now()-a;e(l.map(u=>(u.timeOffset-=f,u)),p),l=[],a=null},s),c=de(p=>{const f=he(p),{clientX:u,clientY:h}=ze(p)?p.changedTouches[0]:p;a||(a=Date.now()),l.push({x:u,y:h,id:n.getId(f),timeOffset:Date.now()-a}),i(typeof DragEvent<"u"&&p instanceof DragEvent?R.Drag:p instanceof MouseEvent?R.MouseMove:R.TouchMove)},o,{trailing:!1}),d=[z("mousemove",c,r),z("touchmove",c,r),z("drag",c,r)];return()=>{d.forEach(p=>p())}}function ir({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[],a=i=>c=>{const d=he(c);if(V(d,n,!0))return;const p=ze(c)?c.changedTouches[0]:c;if(!p)return;const f=r.getId(d),{clientX:u,clientY:h}=p;e({type:xe[i],id:f,x:u,y:h})};return Object.keys(xe).filter(i=>Number.isNaN(Number(i))&&!i.endsWith("_Departed")&&s[i]!==!1).forEach(i=>{const c=i.toLowerCase(),d=a(i);l.push(z(c,d,t))}),()=>{l.forEach(i=>i())}}function nt({scrollCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){const s=de(l=>{const a=he(l);if(!a||V(a,n,!0))return;const i=r.getId(a);if(a===t){const c=t.scrollingElement||t.documentElement;e({id:i,x:c.scrollLeft,y:c.scrollTop})}else e({id:i,x:a.scrollLeft,y:a.scrollTop})},o.scroll||100);return z("scroll",s,t)}function lr({viewportResizeCb:e}){let t=-1,r=-1;const n=de(()=>{const o=Pe(),s=_e();(t!==o||r!==s)&&(e({width:Number(s),height:Number(o)}),t=o,r=s)},200);return z("resize",n,window)}function ot(e,t){const r=Je({},e);return t||delete r.userTriggered,r}const cr=["INPUT","TEXTAREA","SELECT"],at=new WeakMap;function ur({inputCb:e,doc:t,mirror:r,blockClass:n,ignoreClass:o,maskInputOptions:s,maskInputFn:l,sampling:a,userTriggeredOnInput:i}){function c(h){let y=he(h);const b=h.isTrusted;if(y&&y.tagName==="OPTION"&&(y=y.parentElement),!y||!y.tagName||cr.indexOf(y.tagName)<0||V(y,n,!0))return;const C=y.type;if(y.classList.contains(o))return;let g=y.value,m=!1;C==="radio"||C==="checkbox"?m=y.checked:(s[y.tagName.toLowerCase()]||s[C])&&(g=Ie({maskInputOptions:s,tagName:y.tagName,type:C,value:g,maskInputFn:l})),d(y,ot({text:g,isChecked:m,userTriggered:b},i));const k=y.name;C==="radio"&&k&&m&&t.querySelectorAll(`input[type="radio"][name="${k}"]`).forEach(A=>{A!==y&&d(A,ot({text:A.value,isChecked:!m,userTriggered:!1},i))})}function d(h,y){const b=at.get(h);if(!b||b.text!==y.text||b.isChecked!==y.isChecked){at.set(h,y);const C=r.getId(h);e(ar(Je({},y),{id:C}))}}const p=(a.input==="last"?["change"]:["input","change"]).map(h=>z(h,c,t)),f=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),u=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return f&&f.set&&p.push(...u.map(h=>be(h[0],h[1],{set(){c({target:this})}}))),()=>{p.forEach(h=>h())}}function Se(e){const t=[];function r(n,o){if(qe&&n.parentRule instanceof CSSGroupingRule||Qe&&n.parentRule instanceof CSSMediaRule||et&&n.parentRule instanceof CSSSupportsRule||tt&&n.parentRule instanceof CSSConditionRule){const s=Array.from(n.parentRule.cssRules).indexOf(n);o.unshift(s)}else{const s=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(s)}return o}return r(e,t)}function dr({styleSheetRuleCb:e,mirror:t},{win:r}){const n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(a,i){const c=t.getId(this.ownerNode);return c!==-1&&e({id:c,adds:[{rule:a,index:i}]}),n.apply(this,[a,i])};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=function(a){const i=t.getId(this.ownerNode);return i!==-1&&e({id:i,removes:[{index:a}]}),o.apply(this,[a])};const s={};qe?s.CSSGroupingRule=r.CSSGroupingRule:(Qe&&(s.CSSMediaRule=r.CSSMediaRule),tt&&(s.CSSConditionRule=r.CSSConditionRule),et&&(s.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(s).forEach(([a,i])=>{l[a]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=function(c,d){const p=t.getId(this.parentStyleSheet.ownerNode);return p!==-1&&e({id:p,adds:[{rule:c,index:[...Se(this),d||0]}]}),l[a].insertRule.apply(this,[c,d])},i.prototype.deleteRule=function(c){const d=t.getId(this.parentStyleSheet.ownerNode);return d!==-1&&e({id:d,removes:[{index:[...Se(this),c]}]}),l[a].deleteRule.apply(this,[c])}}),()=>{r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=o,Object.entries(s).forEach(([a,i])=>{i.prototype.insertRule=l[a].insertRule,i.prototype.deleteRule=l[a].deleteRule})}}function pr({styleDeclarationCb:e,mirror:t},{win:r}){const n=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=function(s,l,a){var i,c;const d=t.getId((c=(i=this.parentRule)==null?void 0:i.parentStyleSheet)==null?void 0:c.ownerNode);return d!==-1&&e({id:d,set:{property:s,value:l,priority:a},index:Se(this.parentRule)}),n.apply(this,[s,l,a])};const o=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=function(s){var l,a;const i=t.getId((a=(l=this.parentRule)==null?void 0:l.parentStyleSheet)==null?void 0:a.ownerNode);return i!==-1&&e({id:i,remove:{property:s},index:Se(this.parentRule)}),o.apply(this,[s])},()=>{r.CSSStyleDeclaration.prototype.setProperty=n,r.CSSStyleDeclaration.prototype.removeProperty=o}}function hr({mediaInteractionCb:e,blockClass:t,mirror:r,sampling:n}){const o=l=>de(a=>{const i=he(a);if(!i||V(i,t,!0))return;const{currentTime:c,volume:d,muted:p}=i;e({type:l,id:r.getId(i),currentTime:c,volume:d,muted:p})},n.media||500),s=[z("play",o(pe.Play)),z("pause",o(pe.Pause)),z("seeked",o(pe.Seeked)),z("volumechange",o(pe.VolumeChange))];return()=>{s.forEach(l=>l())}}function mr({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,s=r.FontFace;r.FontFace=function(a,i,c){const d=new s(a,i,c);return o.set(d,{family:a,buffer:typeof i!="string",descriptors:c,fontSource:typeof i=="string"?i:JSON.stringify(Array.from(new Uint8Array(i)))}),d};const l=ae(t.fonts,"add",function(a){return function(i){return setTimeout(()=>{const c=o.get(i);c&&(e(c),o.delete(i))},0),a.apply(this,[i])}});return n.push(()=>{r.FontFace=s}),n.push(l),()=>{n.forEach(a=>a())}}function fr(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:s,viewportResizeCb:l,inputCb:a,mediaInteractionCb:i,styleSheetRuleCb:c,styleDeclarationCb:d,canvasMutationCb:p,fontCb:f}=e;e.mutationCb=(...u)=>{t.mutation&&t.mutation(...u),r(...u)},e.mousemoveCb=(...u)=>{t.mousemove&&t.mousemove(...u),n(...u)},e.mouseInteractionCb=(...u)=>{t.mouseInteraction&&t.mouseInteraction(...u),o(...u)},e.scrollCb=(...u)=>{t.scroll&&t.scroll(...u),s(...u)},e.viewportResizeCb=(...u)=>{t.viewportResize&&t.viewportResize(...u),l(...u)},e.inputCb=(...u)=>{t.input&&t.input(...u),a(...u)},e.mediaInteractionCb=(...u)=>{t.mediaInteaction&&t.mediaInteaction(...u),i(...u)},e.styleSheetRuleCb=(...u)=>{t.styleSheetRule&&t.styleSheetRule(...u),c(...u)},e.styleDeclarationCb=(...u)=>{t.styleDeclaration&&t.styleDeclaration(...u),d(...u)},e.canvasMutationCb=(...u)=>{t.canvasMutation&&t.canvasMutation(...u),p(...u)},e.fontCb=(...u)=>{t.font&&t.font(...u),f(...u)}}function yr(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};fr(e,t);const n=rt(e,e.doc),o=sr(e),s=ir(e),l=nt(e),a=lr(e),i=ur(e),c=hr(e),d=dr(e,{win:r}),p=pr(e,{win:r}),f=e.collectFonts?mr(e):()=>{},u=[];for(const h of e.plugins)u.push(h.observer(h.callback,r,h.options));return()=>{te.forEach(h=>h.reset()),n.disconnect(),o(),s(),l(),a(),i(),c(),d(),p(),f(),u.forEach(h=>h())}}class vr{constructor(t){this.iframes=new WeakMap,this.mutationCb=t.mutationCb}addIframe(t){this.iframes.set(t,!0)}addLoadListener(t){this.loadListener=t}attachIframe(t,r,n){var o;this.mutationCb({adds:[{parentId:n.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(o=this.loadListener)==null||o.call(this,t)}}var gr=Object.defineProperty,br=Object.defineProperties,Sr=Object.getOwnPropertyDescriptors,st=Object.getOwnPropertySymbols,Cr=Object.prototype.hasOwnProperty,kr=Object.prototype.propertyIsEnumerable,it=(e,t,r)=>t in e?gr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lt=(e,t)=>{for(var r in t||(t={}))Cr.call(t,r)&&it(e,r,t[r]);if(st)for(var r of st(t))kr.call(t,r)&&it(e,r,t[r]);return e},ct=(e,t)=>br(e,Sr(t));class Ir{constructor(t){this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;const r=this;this.restorePatches.push(ae(HTMLElement.prototype,"attachShadow",function(n){return function(o){const s=n.call(this,o);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),s}}))}addShadowRoot(t,r){rt(ct(lt({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),nt(ct(lt({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}observeAttachShadow(t){if(t.contentWindow){const r=this;this.restorePatches.push(ae(t.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(o){const s=n.call(this,o);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,t.contentDocument),s}}))}}reset(){this.restorePatches.forEach(t=>t())}}for(var ie="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",wr=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ce=0;Ce<ie.length;Ce++)wr[ie.charCodeAt(Ce)]=Ce;var Mr=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=ie[t[r]>>2],o+=ie[(t[r]&3)<<4|t[r+1]>>4],o+=ie[(t[r+1]&15)<<2|t[r+2]>>6],o+=ie[t[r+2]&63];return n%3===2?o=o.substring(0,o.length-1)+"=":n%3===1&&(o=o.substring(0,o.length-2)+"=="),o};const ut=new Map;function Tr(e,t){let r=ut.get(e);return r||(r=new Map,ut.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const dt=(e,t,r)=>{if(!e||!(ht(e,t)||typeof e=="object"))return;const n=e.constructor.name,o=Tr(r,n);let s=o.indexOf(e);return s===-1&&(s=o.length,o.push(e)),s};function ke(e,t,r){if(e instanceof Array)return e.map(n=>ke(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const n=e.constructor.name,o=Mr(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[ke(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const n=e.constructor.name,{src:o}=e;return{rr_type:n,src:o}}else if(e instanceof HTMLCanvasElement){const n="HTMLImageElement",o=e.toDataURL();return{rr_type:n,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[ke(e.data,t,r),e.width,e.height]};if(ht(e,t)||typeof e=="object"){const n=e.constructor.name,o=dt(e,t,r);return{rr_type:n,index:o}}}}return e}const pt=(e,t,r)=>[...e].map(n=>ke(n,t,r)),ht=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(n=>typeof t[n]=="function");return Boolean(r.find(n=>e instanceof t[n]))};function xr(e,t,r,n){const o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const l of s)try{if(typeof t.CanvasRenderingContext2D.prototype[l]!="function")continue;const a=ae(t.CanvasRenderingContext2D.prototype,l,function(i){return function(...c){return V(this.canvas,r,!0)||setTimeout(()=>{const d=pt([...c],t,this);e(this.canvas,{type:se["2D"],property:l,args:d})},0),i.apply(this,c)}});o.push(a)}catch{const i=be(t.CanvasRenderingContext2D.prototype,l,{set(c){e(this.canvas,{type:se["2D"],property:l,args:[c],setter:!0})}});o.push(i)}return()=>{o.forEach(l=>l())}}function mt(e,t){const r=[];try{const n=ae(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(s,...l){return V(this,t,!0)||"__context"in this||(this.__context=s),o.apply(this,[s,...l])}});r.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(n=>n())}}function ft(e,t,r,n,o,s){const l=[],a=Object.getOwnPropertyNames(e);for(const i of a)try{if(typeof e[i]!="function")continue;const c=ae(e,i,function(d){return function(...p){const f=d.apply(this,p);if(dt(f,s,e),!V(this.canvas,n,!0)){const u=pt([...p],s,e),h={type:t,property:i,args:u};r(this.canvas,h)}return f}});l.push(c)}catch{const d=be(e,i,{set(p){r(this.canvas,{type:t,property:i,args:[p],setter:!0})}});l.push(d)}return l}function Or(e,t,r,n){const o=[];return o.push(...ft(t.WebGLRenderingContext.prototype,se.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...ft(t.WebGL2RenderingContext.prototype,se.WebGL2,e,r,n,t)),()=>{o.forEach(s=>s())}}function Er(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),o=0,s=r.length;o<s;++o)n[o]=r.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}function Nr(e,t,r){var n=t===void 0?null:t,o=r===void 0?!1:r,s=Er(e,o),l=s.indexOf(`
`,10)+1,a=s.substring(l)+(n?"//# sourceMappingURL="+n:""),i=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(i)}function Lr(e,t,r){var n;return function(s){return n=n||Nr(e,t,r),new Worker(n,s)}}var Rr=Lr("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Zm9yKHZhciByPSJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvIixsPXR5cGVvZiBVaW50OEFycmF5PiJ1Ij9bXTpuZXcgVWludDhBcnJheSgyNTYpLGY9MDtmPHIubGVuZ3RoO2YrKylsW3IuY2hhckNvZGVBdChmKV09Zjt2YXIgZD1mdW5jdGlvbihzKXt2YXIgZT1uZXcgVWludDhBcnJheShzKSxuLGE9ZS5sZW5ndGgsdD0iIjtmb3Iobj0wO248YTtuKz0zKXQrPXJbZVtuXT4+Ml0sdCs9clsoZVtuXSYzKTw8NHxlW24rMV0+PjRdLHQrPXJbKGVbbisxXSYxNSk8PDJ8ZVtuKzJdPj42XSx0Kz1yW2VbbisyXSY2M107cmV0dXJuIGElMz09PTI/dD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTEpKyI9IjphJTM9PT0xJiYodD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTIpKyI9PSIpLHR9O2NvbnN0IGM9bmV3IE1hcCx1PW5ldyBNYXA7YXN5bmMgZnVuY3Rpb24gcChzLGUpe2NvbnN0IG49YCR7c30tJHtlfWA7aWYodS5oYXMobikpcmV0dXJuIHUuZ2V0KG4pO2NvbnN0IGE9bmV3IE9mZnNjcmVlbkNhbnZhcyhzLGUpO2EuZ2V0Q29udGV4dCgiMmQiKTtjb25zdCB0PWF3YWl0KGF3YWl0IGEuY29udmVydFRvQmxvYigpKS5hcnJheUJ1ZmZlcigpLGc9ZCh0KTtyZXR1cm4gdS5zZXQobixnKSxnfWNvbnN0IGk9c2VsZjtpLm9ubWVzc2FnZT1hc3luYyBmdW5jdGlvbihzKXtpZighKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcykpcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOnMuZGF0YS5pZH0pO2NvbnN0e2lkOmUsYml0bWFwOm4sd2lkdGg6YSxoZWlnaHQ6dH09cy5kYXRhLGc9cChhLHQpLGg9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2guZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCB3PWF3YWl0IGguY29udmVydFRvQmxvYigpLHk9dy50eXBlLGI9YXdhaXQgdy5hcnJheUJ1ZmZlcigpLG89ZChiKTtpZighYy5oYXMoZSkmJmF3YWl0IGc9PT1vKXJldHVybiBjLnNldChlLG8pLGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpZihjLmdldChlKT09PW8pcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpLnBvc3RNZXNzYWdlKHtpZDplLHR5cGU6eSxiYXNlNjQ6byx3aWR0aDphLGhlaWdodDp0fSksYy5zZXQoZSxvKX19KSgpOwoK",null,!1),yt=Object.getOwnPropertySymbols,Dr=Object.prototype.hasOwnProperty,Fr=Object.prototype.propertyIsEnumerable,Ar=(e,t)=>{var r={};for(var n in e)Dr.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&yt)for(var n of yt(e))t.indexOf(n)<0&&Fr.call(e,n)&&(r[n]=e[n]);return r},Pr=(e,t,r)=>new Promise((n,o)=>{var s=i=>{try{a(r.next(i))}catch(c){o(c)}},l=i=>{try{a(r.throw(i))}catch(c){o(c)}},a=i=>i.done?n(i.value):Promise.resolve(i.value).then(s,l);a((r=r.apply(e,t)).next())});class _r{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(l,a)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(a)};const{sampling:r="all",win:n,blockClass:o,recordCanvas:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&r==="all"&&this.initCanvasMutationObserver(n,o),s&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,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,r,n){const o=mt(r,n),s=new Map,l=new Rr;l.onmessage=p=>{const{id:f}=p.data;if(s.set(f,!1),!("base64"in p.data))return;const{base64:u,type:h,width:y,height:b}=p.data;this.mutationCb({id:f,type:se["2D"],commands:[{property:"clearRect",args:[0,0,y,b]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:u}],type:h}]},0,0]}]})};const a=1e3/t;let i=0,c;const d=p=>{if(i&&p-i<a){c=requestAnimationFrame(d);return}i=p,r.document.querySelectorAll(`canvas:not(.${n} *)`).forEach(f=>Pr(this,null,function*(){var u;const h=this.mirror.getId(f);if(s.get(h))return;if(s.set(h,!0),["webgl","webgl2"].includes(f.__context)){const b=f.getContext(f.__context);((u=b?.getContextAttributes())==null?void 0:u.preserveDrawingBuffer)===!1&&b?.clear(b.COLOR_BUFFER_BIT)}const y=yield createImageBitmap(f);l.postMessage({id:h,bitmap:y,width:f.width,height:f.height},[y])})),c=requestAnimationFrame(d)};c=requestAnimationFrame(d),this.resetObservers=()=>{o(),cancelAnimationFrame(c)}}initCanvasMutationObserver(t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=mt(t,r),o=xr(this.processMutation.bind(this),t,r,this.mirror),s=Or(this.processMutation.bind(this),t,r,this.mirror);this.resetObservers=()=>{n(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const o=n.map(l=>Ar(l,["type"])),{type:s}=n[0];this.mutationCb({id:r,type:s,commands:o}),this.pendingCanvasMutations.delete(t)}}class Wr{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,r,n){this.mutationCb({adds:[{parentId:n.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[]}),this.addStylesheet(t)}}var zr=Object.defineProperty,Gr=Object.defineProperties,Vr=Object.getOwnPropertyDescriptors,vt=Object.getOwnPropertySymbols,jr=Object.prototype.hasOwnProperty,Zr=Object.prototype.propertyIsEnumerable,gt=(e,t,r)=>t in e?zr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Y=(e,t)=>{for(var r in t||(t={}))jr.call(t,r)&&gt(e,r,t[r]);if(vt)for(var r of vt(t))Zr.call(t,r)&&gt(e,r,t[r]);return e},Ur=(e,t)=>Gr(e,Vr(t));function L(e){return Ur(Y({},e),{timestamp:Date.now()})}let O,me;const J=kt();function fe(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:l="rr-ignore",maskTextClass:a="rr-mask",maskTextSelector:i=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:p,slimDOMOptions:f,maskInputFn:u,maskTextFn:h,hooks:y,packFn:b,sampling:C={},mousemoveWait:g,recordCanvas:m=!1,userTriggeredOnInput:k=!1,collectFonts:A=!1,inlineImages:P=!1,plugins:D,keepIframeSrcFn:x=()=>!1}=e;if(!t)throw new Error("emit function is required");g!==void 0&&C.mousemove===void 0&&(C.mousemove=g),J.reset();const H=d===!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},G=f===!0||f==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:f==="all",headMetaDescKeywords:f==="all"}:f||{};$t();let _,q=0;const E=v=>{for(const S of D||[])S.eventProcessor&&(v=S.eventProcessor(v));return b&&(v=b(v)),v};O=(v,S)=>{var U;if(((U=te[0])==null?void 0:U.isFrozen())&&v.type!==T.FullSnapshot&&!(v.type===T.IncrementalSnapshot&&v.data.source===R.Mutation)&&te.forEach(F=>F.unfreeze()),t(E(v),S),v.type===T.FullSnapshot)_=v,q=0;else if(v.type===T.IncrementalSnapshot){if(v.data.source===R.Mutation&&v.data.isAttachIframe)return;q++;const F=n&&q>=n,$=r&&v.timestamp-_.timestamp>r;(F||$)&&me(!0)}};const j=v=>{O(L({type:T.IncrementalSnapshot,data:Y({source:R.Mutation},v)}))},Z=v=>O(L({type:T.IncrementalSnapshot,data:Y({source:R.Scroll},v)})),B=v=>O(L({type:T.IncrementalSnapshot,data:Y({source:R.CanvasMutation},v)})),X=new vr({mutationCb:j}),K=new Wr({mutationCb:j}),W=new _r({recordCanvas:m,mutationCb:B,win:window,blockClass:o,mirror:J,sampling:C.canvas}),Q=new Ir({mutationCb:j,scrollCb:Z,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:i,inlineStylesheet:c,maskInputOptions:H,maskTextFn:h,maskInputFn:u,recordCanvas:m,inlineImages:P,sampling:C,slimDOMOptions:G,iframeManager:X,stylesheetManager:K,canvasManager:W},mirror:J});me=(v=!1)=>{var S,U,F,$;O(L({type:T.Meta,data:{href:window.location.href,width:_e(),height:Pe()}}),v),te.forEach(M=>M.lock());const I=Xt(document,{mirror:J,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:i,inlineStylesheet:c,maskAllInputs:H,maskTextFn:h,slimDOM:G,recordCanvas:m,inlineImages:P,onSerialize:M=>{Ge(M,J)&&X.addIframe(M),Ve(M,J)&&K.addStylesheet(M),je(M)&&Q.addShadowRoot(M.shadowRoot,document)},onIframeLoad:(M,ee)=>{X.attachIframe(M,ee,J),Q.observeAttachShadow(M)},onStylesheetLoad:(M,ee)=>{K.attachStylesheet(M,ee,J)},keepIframeSrcFn:x});if(!I)return console.warn("Failed to snapshot the document");O(L({type:T.FullSnapshot,data:{node:I,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((U=(S=document?.body)==null?void 0:S.parentElement)==null?void 0:U.scrollLeft)||document?.body.scrollLeft||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||(($=(F=document?.body)==null?void 0:F.parentElement)==null?void 0:$.scrollTop)||document?.body.scrollTop||0}}})),te.forEach(M=>M.unlock())};try{const v=[];v.push(z("DOMContentLoaded",()=>{O(L({type:T.DomContentLoaded,data:{}}))}));const S=F=>{var $;return yr({mutationCb:j,mousemoveCb:(I,M)=>O(L({type:T.IncrementalSnapshot,data:{source:M,positions:I}})),mouseInteractionCb:I=>O(L({type:T.IncrementalSnapshot,data:Y({source:R.MouseInteraction},I)})),scrollCb:Z,viewportResizeCb:I=>O(L({type:T.IncrementalSnapshot,data:Y({source:R.ViewportResize},I)})),inputCb:I=>O(L({type:T.IncrementalSnapshot,data:Y({source:R.Input},I)})),mediaInteractionCb:I=>O(L({type:T.IncrementalSnapshot,data:Y({source:R.MediaInteraction},I)})),styleSheetRuleCb:I=>O(L({type:T.IncrementalSnapshot,data:Y({source:R.StyleSheetRule},I)})),styleDeclarationCb:I=>O(L({type:T.IncrementalSnapshot,data:Y({source:R.StyleDeclaration},I)})),canvasMutationCb:B,fontCb:I=>O(L({type:T.IncrementalSnapshot,data:Y({source:R.Font},I)})),blockClass:o,ignoreClass:l,maskTextClass:a,maskTextSelector:i,maskInputOptions:H,inlineStylesheet:c,sampling:C,recordCanvas:m,inlineImages:P,userTriggeredOnInput:k,collectFonts:A,doc:F,maskInputFn:u,maskTextFn:h,blockSelector:s,slimDOMOptions:G,mirror:J,iframeManager:X,stylesheetManager:K,shadowDomManager:Q,canvasManager:W,plugins:(($=D?.filter(I=>I.observer))==null?void 0:$.map(I=>({observer:I.observer,options:I.options,callback:M=>O(L({type:T.Plugin,data:{plugin:I.name,payload:M}}))})))||[]},y)};X.addLoadListener(F=>{v.push(S(F.contentDocument))});const U=()=>{me(),v.push(S(document))};return document.readyState==="interactive"||document.readyState==="complete"?U():v.push(z("load",()=>{O(L({type:T.Load,data:{}})),U()},window)),()=>{v.forEach(F=>F())}}catch(v){console.warn(v)}}return fe.addCustomEvent=(e,t)=>{if(!O)throw new Error("please add custom event after start recording");O(L({type:T.Custom,data:{tag:e,payload:t}}))},fe.freezePage=()=>{te.forEach(e=>e.freeze())},fe.takeFullSnapshot=e=>{if(!me)throw new Error("please take full snapshot after start recording");me(e)},fe.mirror=J,fe}();
or you can use record.mirror to access the mirror instance during recording.`;let _e={map:{},getId(){return console.error(oe),-1},getNode(){return console.error(oe),null},removeNodeFromMap(){console.error(oe)},has(){return console.error(oe),!1},reset(){console.error(oe)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(_e=new Proxy(_e,{get(e,t,r){return t==="map"&&console.error(oe),Reflect.get(e,t,r)}}));function he(e,t,r={}){let n=null,o=0;return function(...s){const l=Date.now();!o&&r.leading===!1&&(o=l);const a=t-(l-o),i=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),o=l,e.apply(i,s)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(i,s)},a))}}function Ce(e,t,r,n,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(l){setTimeout(()=>{r.set.call(this,l)},0),s&&s.set&&s.set.call(this,l)}}),()=>Ce(e,t,s||{},!0)}function ae(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],o=r(n);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch{return()=>{}}}function We(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ge(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function V(e,t,r){if(!e)return!1;const n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!n)return!1;if(typeof t=="string"){if(n.classList.contains(t)||r&&n.closest("."+t)!==null)return!0}else if(Se(n,t,r))return!0;return!1}function Jt(e,t){return t.getId(e)!==-1}function Oe(e,t){return t.getId(e)===pe}function ze(e,t){if(ue(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?ze(e.parentNode,t):!0:!0}function Ve(e){return Boolean(e.changedTouches)}function qt(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let r=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===r)return!0;while(r=r&&r.parentNode);return!1})}function je(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function Ze(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Ue(e){return Boolean(e?.shadowRoot)}var M=(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))(M||{}),R=(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))(R||{}),Ee=(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))(Ee||{}),se=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(se||{}),me=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(me||{}),Qt=(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))(Qt||{});function Ye(e){return"__ln"in e}class er{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){const r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&Ye(t.previousSibling)){const n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&Ye(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;this.length++}removeNode(t){const r=t.__ln;!this.head||(r.previous?(r.previous.next=r.next,r.next&&(r.next.previous=r.previous)):(this.head=r.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}}const He=(e,t)=>`${e}@${t}`;class tr{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],r=new er,n=a=>{let i=a,c=pe;for(;c===pe;)i=i&&i.nextSibling,c=i&&this.mirror.getId(i);return c},o=a=>{var i,c,d,p,f;const u=a.getRootNode?(i=a.getRootNode())==null?void 0:i.host:null;let h=u;for(;(d=(c=h?.getRootNode)==null?void 0:c.call(h))!=null&&d.host;)h=((f=(p=h?.getRootNode)==null?void 0:p.call(h))==null?void 0:f.host)||null;const y=!this.doc.contains(a)&&(!h||!this.doc.contains(h));if(!a.parentNode||y)return;const b=ue(a.parentNode)?this.mirror.getId(u):this.mirror.getId(a.parentNode),k=n(a);if(b===-1||k===-1)return r.addNode(a);const g=ne(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:m=>{je(m,this.mirror)&&this.iframeManager.addIframe(m),Ze(m,this.mirror)&&this.stylesheetManager.addStylesheet(m),Ue(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,document)},onIframeLoad:(m,I)=>{this.iframeManager.attachIframe(m,I,this.mirror),this.shadowDomManager.observeAttachShadow(m)},onStylesheetLoad:(m,I)=>{this.stylesheetManager.attachStylesheet(m,I,this.mirror)}});g&&t.push({parentId:b,nextId:k,node:g})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of Array.from(this.movedSet.values()))Be(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||o(a);for(const a of Array.from(this.addedSet.values()))!Ke(this.droppedSet,a)&&!Be(this.removes,a,this.mirror)||Ke(this.movedSet,a)?o(a):this.droppedSet.add(a);let s=null;for(;r.length;){let a=null;if(s){const i=this.mirror.getId(s.value.parentNode),c=n(s.value);i!==-1&&c!==-1&&(a=s)}if(!a)for(let i=r.length-1;i>=0;i--){const c=r.get(i);if(c){const d=this.mirror.getId(c.value.parentNode),p=n(c.value);if(d!==-1&&p!==-1){a=c;break}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}s=a.previous,r.removeNode(a.value),o(a.value)}const l={texts:this.texts.map(a=>({id:this.mirror.getId(a.node),value:a.value})).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>({id:this.mirror.getId(a.node),attributes:a.attributes})).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:t};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(l))},this.processMutation=t=>{if(!Oe(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!V(t.target,this.blockClass,!1)&&r!==t.oldValue&&this.texts.push({value:Pe(t.target,this.maskTextClass,this.maskTextSelector)&&r?this.maskTextFn?this.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let n=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(n=Me({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),V(t.target,this.blockClass,!1)||n===t.oldValue)return;let o=this.attributes.find(s=>s.node===t.target);if(o||(o={node:t.target,attributes:{}},this.attributes.push(o)),t.attributeName==="style"){const s=this.doc.createElement("span");t.oldValue&&s.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});const l=o.attributes.style;for(const a of Array.from(r.style)){const i=r.style.getPropertyValue(a),c=r.style.getPropertyPriority(a);(i!==s.style.getPropertyValue(a)||c!==s.style.getPropertyPriority(a))&&(c===""?l[a]=i:l[a]=[i,c])}for(const a of Array.from(s.style))r.style.getPropertyValue(a)===""&&(l[a]=!1)}else o.attributes[t.attributeName]=Ae(this.doc,t.target.tagName,t.attributeName,n);break}case"childList":{if(V(t.target,this.blockClass,!0))return;t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const n=this.mirror.getId(r),o=ue(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);V(t.target,this.blockClass,!1)||Oe(r,this.mirror)||!Jt(r,this.mirror)||(this.addedSet.has(r)?(Ne(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||ze(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[He(n,o)]?Ne(this.movedSet,r):this.removes.push({parentId:o,id:n,isShadow:ue(t.target)&&de(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(this.mirror.hasNode(t)){if(Oe(t,this.mirror))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[He(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);V(t,this.blockClass,!1)||t.childNodes.forEach(n=>this.genAdds(n))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Ne(e,t){e.delete(t),t.childNodes.forEach(r=>Ne(e,r))}function Be(e,t,r){return e.length===0?!1:Xe(e,t,r)}function Xe(e,t,r){const{parentNode:n}=t;if(!n)return!1;const o=r.getId(n);return e.some(s=>s.id===o)?!0:Xe(e,n,r)}function Ke(e,t){return e.size===0?!1:$e(e,t)}function $e(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:$e(e,r):!1}var rr=Object.defineProperty,nr=Object.defineProperties,or=Object.getOwnPropertyDescriptors,Je=Object.getOwnPropertySymbols,ar=Object.prototype.hasOwnProperty,sr=Object.prototype.propertyIsEnumerable,qe=(e,t,r)=>t in e?rr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Qe=(e,t)=>{for(var r in t||(t={}))ar.call(t,r)&&qe(e,r,t[r]);if(Je)for(var r of Je(t))sr.call(t,r)&&qe(e,r,t[r]);return e},ir=(e,t)=>nr(e,or(t));const ee=[],et=typeof CSSGroupingRule<"u",tt=typeof CSSMediaRule<"u",rt=typeof CSSSupportsRule<"u",nt=typeof CSSConditionRule<"u";function fe(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 ot(e,t){var r,n;const o=new tr;ee.push(o),o.init(e);let s=window.MutationObserver||window.__rrMutationObserver;const l=(n=(r=window?.Zone)==null?void 0:r.__symbol__)==null?void 0:n.call(r,"MutationObserver");l&&window[l]&&(s=window[l]);const a=new s(o.processMutations.bind(o));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function lr({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,s=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let l=[],a;const i=he(p=>{const f=Date.now()-a;e(l.map(u=>(u.timeOffset-=f,u)),p),l=[],a=null},s),c=he(p=>{const f=fe(p),{clientX:u,clientY:h}=Ve(p)?p.changedTouches[0]:p;a||(a=Date.now()),l.push({x:u,y:h,id:n.getId(f),timeOffset:Date.now()-a}),i(typeof DragEvent<"u"&&p instanceof DragEvent?R.Drag:p instanceof MouseEvent?R.MouseMove:R.TouchMove)},o,{trailing:!1}),d=[G("mousemove",c,r),G("touchmove",c,r),G("drag",c,r)];return()=>{d.forEach(p=>p())}}function cr({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[],a=i=>c=>{const d=fe(c);if(V(d,n,!0))return;const p=Ve(c)?c.changedTouches[0]:c;if(!p)return;const f=r.getId(d),{clientX:u,clientY:h}=p;e({type:Ee[i],id:f,x:u,y:h})};return Object.keys(Ee).filter(i=>Number.isNaN(Number(i))&&!i.endsWith("_Departed")&&s[i]!==!1).forEach(i=>{const c=i.toLowerCase(),d=a(i);l.push(G(c,d,t))}),()=>{l.forEach(i=>i())}}function at({scrollCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){const s=he(l=>{const a=fe(l);if(!a||V(a,n,!0))return;const i=r.getId(a);if(a===t){const c=t.scrollingElement||t.documentElement;e({id:i,x:c.scrollLeft,y:c.scrollTop})}else e({id:i,x:a.scrollLeft,y:a.scrollTop})},o.scroll||100);return G("scroll",s,t)}function ur({viewportResizeCb:e}){let t=-1,r=-1;const n=he(()=>{const o=We(),s=Ge();(t!==o||r!==s)&&(e({width:Number(s),height:Number(o)}),t=o,r=s)},200);return G("resize",n,window)}function st(e,t){const r=Qe({},e);return t||delete r.userTriggered,r}const dr=["INPUT","TEXTAREA","SELECT"],it=new WeakMap;function pr({inputCb:e,doc:t,mirror:r,blockClass:n,ignoreClass:o,maskInputOptions:s,maskInputFn:l,sampling:a,userTriggeredOnInput:i}){function c(h){let y=fe(h);const b=h.isTrusted;if(y&&y.tagName==="OPTION"&&(y=y.parentElement),!y||!y.tagName||dr.indexOf(y.tagName)<0||V(y,n,!0))return;const k=y.type;if(y.classList.contains(o))return;let g=y.value,m=!1;k==="radio"||k==="checkbox"?m=y.checked:(s[y.tagName.toLowerCase()]||s[k])&&(g=Me({maskInputOptions:s,tagName:y.tagName,type:k,value:g,maskInputFn:l})),d(y,st({text:g,isChecked:m,userTriggered:b},i));const I=y.name;k==="radio"&&I&&m&&t.querySelectorAll(`input[type="radio"][name="${I}"]`).forEach(A=>{A!==y&&d(A,st({text:A.value,isChecked:!m,userTriggered:!1},i))})}function d(h,y){const b=it.get(h);if(!b||b.text!==y.text||b.isChecked!==y.isChecked){it.set(h,y);const k=r.getId(h);e(ir(Qe({},y),{id:k}))}}const p=(a.input==="last"?["change"]:["input","change"]).map(h=>G(h,c,t)),f=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),u=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return f&&f.set&&p.push(...u.map(h=>Ce(h[0],h[1],{set(){c({target:this})}}))),()=>{p.forEach(h=>h())}}function ke(e){const t=[];function r(n,o){if(et&&n.parentRule instanceof CSSGroupingRule||tt&&n.parentRule instanceof CSSMediaRule||rt&&n.parentRule instanceof CSSSupportsRule||nt&&n.parentRule instanceof CSSConditionRule){const s=Array.from(n.parentRule.cssRules).indexOf(n);o.unshift(s)}else{const s=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(s)}return o}return r(e,t)}function hr({styleSheetRuleCb:e,mirror:t},{win:r}){const n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(a,i){const c=t.getId(this.ownerNode);return c!==-1&&e({id:c,adds:[{rule:a,index:i}]}),n.apply(this,[a,i])};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=function(a){const i=t.getId(this.ownerNode);return i!==-1&&e({id:i,removes:[{index:a}]}),o.apply(this,[a])};const s={};et?s.CSSGroupingRule=r.CSSGroupingRule:(tt&&(s.CSSMediaRule=r.CSSMediaRule),nt&&(s.CSSConditionRule=r.CSSConditionRule),rt&&(s.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(s).forEach(([a,i])=>{l[a]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=function(c,d){const p=t.getId(this.parentStyleSheet.ownerNode);return p!==-1&&e({id:p,adds:[{rule:c,index:[...ke(this),d||0]}]}),l[a].insertRule.apply(this,[c,d])},i.prototype.deleteRule=function(c){const d=t.getId(this.parentStyleSheet.ownerNode);return d!==-1&&e({id:d,removes:[{index:[...ke(this),c]}]}),l[a].deleteRule.apply(this,[c])}}),()=>{r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=o,Object.entries(s).forEach(([a,i])=>{i.prototype.insertRule=l[a].insertRule,i.prototype.deleteRule=l[a].deleteRule})}}function mr({styleDeclarationCb:e,mirror:t},{win:r}){const n=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=function(s,l,a){var i,c;const d=t.getId((c=(i=this.parentRule)==null?void 0:i.parentStyleSheet)==null?void 0:c.ownerNode);return d!==-1&&e({id:d,set:{property:s,value:l,priority:a},index:ke(this.parentRule)}),n.apply(this,[s,l,a])};const o=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=function(s){var l,a;const i=t.getId((a=(l=this.parentRule)==null?void 0:l.parentStyleSheet)==null?void 0:a.ownerNode);return i!==-1&&e({id:i,remove:{property:s},index:ke(this.parentRule)}),o.apply(this,[s])},()=>{r.CSSStyleDeclaration.prototype.setProperty=n,r.CSSStyleDeclaration.prototype.removeProperty=o}}function fr({mediaInteractionCb:e,blockClass:t,mirror:r,sampling:n}){const o=l=>he(a=>{const i=fe(a);if(!i||V(i,t,!0))return;const{currentTime:c,volume:d,muted:p}=i;e({type:l,id:r.getId(i),currentTime:c,volume:d,muted:p})},n.media||500),s=[G("play",o(me.Play)),G("pause",o(me.Pause)),G("seeked",o(me.Seeked)),G("volumechange",o(me.VolumeChange))];return()=>{s.forEach(l=>l())}}function yr({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,s=r.FontFace;r.FontFace=function(a,i,c){const d=new s(a,i,c);return o.set(d,{family:a,buffer:typeof i!="string",descriptors:c,fontSource:typeof i=="string"?i:JSON.stringify(Array.from(new Uint8Array(i)))}),d};const l=ae(t.fonts,"add",function(a){return function(i){return setTimeout(()=>{const c=o.get(i);c&&(e(c),o.delete(i))},0),a.apply(this,[i])}});return n.push(()=>{r.FontFace=s}),n.push(l),()=>{n.forEach(a=>a())}}function vr(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:s,viewportResizeCb:l,inputCb:a,mediaInteractionCb:i,styleSheetRuleCb:c,styleDeclarationCb:d,canvasMutationCb:p,fontCb:f}=e;e.mutationCb=(...u)=>{t.mutation&&t.mutation(...u),r(...u)},e.mousemoveCb=(...u)=>{t.mousemove&&t.mousemove(...u),n(...u)},e.mouseInteractionCb=(...u)=>{t.mouseInteraction&&t.mouseInteraction(...u),o(...u)},e.scrollCb=(...u)=>{t.scroll&&t.scroll(...u),s(...u)},e.viewportResizeCb=(...u)=>{t.viewportResize&&t.viewportResize(...u),l(...u)},e.inputCb=(...u)=>{t.input&&t.input(...u),a(...u)},e.mediaInteractionCb=(...u)=>{t.mediaInteaction&&t.mediaInteaction(...u),i(...u)},e.styleSheetRuleCb=(...u)=>{t.styleSheetRule&&t.styleSheetRule(...u),c(...u)},e.styleDeclarationCb=(...u)=>{t.styleDeclaration&&t.styleDeclaration(...u),d(...u)},e.canvasMutationCb=(...u)=>{t.canvasMutation&&t.canvasMutation(...u),p(...u)},e.fontCb=(...u)=>{t.font&&t.font(...u),f(...u)}}function gr(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};vr(e,t);const n=ot(e,e.doc),o=lr(e),s=cr(e),l=at(e),a=ur(e),i=pr(e),c=fr(e),d=hr(e,{win:r}),p=mr(e,{win:r}),f=e.collectFonts?yr(e):()=>{},u=[];for(const h of e.plugins)u.push(h.observer(h.callback,r,h.options));return()=>{ee.forEach(h=>h.reset()),n.disconnect(),o(),s(),l(),a(),i(),c(),d(),p(),f(),u.forEach(h=>h())}}class br{constructor(t){this.iframes=new WeakMap,this.mutationCb=t.mutationCb}addIframe(t){this.iframes.set(t,!0)}addLoadListener(t){this.loadListener=t}attachIframe(t,r,n){var o;this.mutationCb({adds:[{parentId:n.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(o=this.loadListener)==null||o.call(this,t)}}var Sr=Object.defineProperty,Cr=Object.defineProperties,kr=Object.getOwnPropertyDescriptors,lt=Object.getOwnPropertySymbols,Ir=Object.prototype.hasOwnProperty,wr=Object.prototype.propertyIsEnumerable,ct=(e,t,r)=>t in e?Sr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ut=(e,t)=>{for(var r in t||(t={}))Ir.call(t,r)&&ct(e,r,t[r]);if(lt)for(var r of lt(t))wr.call(t,r)&&ct(e,r,t[r]);return e},dt=(e,t)=>Cr(e,kr(t));class Mr{constructor(t){this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;const r=this;this.restorePatches.push(ae(HTMLElement.prototype,"attachShadow",function(n){return function(o){const s=n.call(this,o);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),s}}))}addShadowRoot(t,r){!de(t)||(ot(dt(ut({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),at(dt(ut({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})))}observeAttachShadow(t){if(t.contentWindow){const r=this;this.restorePatches.push(ae(t.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(o){const s=n.call(this,o);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,t.contentDocument),s}}))}}reset(){this.restorePatches.forEach(t=>t())}}for(var ie="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Tr=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ie=0;Ie<ie.length;Ie++)Tr[ie.charCodeAt(Ie)]=Ie;var xr=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=ie[t[r]>>2],o+=ie[(t[r]&3)<<4|t[r+1]>>4],o+=ie[(t[r+1]&15)<<2|t[r+2]>>6],o+=ie[t[r+2]&63];return n%3===2?o=o.substring(0,o.length-1)+"=":n%3===1&&(o=o.substring(0,o.length-2)+"=="),o};const pt=new Map;function Or(e,t){let r=pt.get(e);return r||(r=new Map,pt.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const ht=(e,t,r)=>{if(!e||!(ft(e,t)||typeof e=="object"))return;const n=e.constructor.name,o=Or(r,n);let s=o.indexOf(e);return s===-1&&(s=o.length,o.push(e)),s};function we(e,t,r){if(e instanceof Array)return e.map(n=>we(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const n=e.constructor.name,o=xr(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[we(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const n=e.constructor.name,{src:o}=e;return{rr_type:n,src:o}}else if(e instanceof HTMLCanvasElement){const n="HTMLImageElement",o=e.toDataURL();return{rr_type:n,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[we(e.data,t,r),e.width,e.height]};if(ft(e,t)||typeof e=="object"){const n=e.constructor.name,o=ht(e,t,r);return{rr_type:n,index:o}}}}return e}const mt=(e,t,r)=>[...e].map(n=>we(n,t,r)),ft=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(n=>typeof t[n]=="function");return Boolean(r.find(n=>e instanceof t[n]))};function Er(e,t,r,n){const o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const l of s)try{if(typeof t.CanvasRenderingContext2D.prototype[l]!="function")continue;const a=ae(t.CanvasRenderingContext2D.prototype,l,function(i){return function(...c){return V(this.canvas,r,!0)||setTimeout(()=>{const d=mt([...c],t,this);e(this.canvas,{type:se["2D"],property:l,args:d})},0),i.apply(this,c)}});o.push(a)}catch{const i=Ce(t.CanvasRenderingContext2D.prototype,l,{set(c){e(this.canvas,{type:se["2D"],property:l,args:[c],setter:!0})}});o.push(i)}return()=>{o.forEach(l=>l())}}function yt(e,t){const r=[];try{const n=ae(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(s,...l){return V(this,t,!0)||"__context"in this||(this.__context=s),o.apply(this,[s,...l])}});r.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(n=>n())}}function vt(e,t,r,n,o,s){const l=[],a=Object.getOwnPropertyNames(e);for(const i of a)try{if(typeof e[i]!="function")continue;const c=ae(e,i,function(d){return function(...p){const f=d.apply(this,p);if(ht(f,s,e),!V(this.canvas,n,!0)){const u=mt([...p],s,e),h={type:t,property:i,args:u};r(this.canvas,h)}return f}});l.push(c)}catch{const d=Ce(e,i,{set(p){r(this.canvas,{type:t,property:i,args:[p],setter:!0})}});l.push(d)}return l}function Nr(e,t,r,n){const o=[];return o.push(...vt(t.WebGLRenderingContext.prototype,se.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...vt(t.WebGL2RenderingContext.prototype,se.WebGL2,e,r,n,t)),()=>{o.forEach(s=>s())}}function Lr(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),o=0,s=r.length;o<s;++o)n[o]=r.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}function Rr(e,t,r){var n=t===void 0?null:t,o=r===void 0?!1:r,s=Lr(e,o),l=s.indexOf(`
`,10)+1,a=s.substring(l)+(n?"//# sourceMappingURL="+n:""),i=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(i)}function Dr(e,t,r){var n;return function(s){return n=n||Rr(e,t,r),new Worker(n,s)}}var Fr=Dr("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Zm9yKHZhciByPSJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvIixsPXR5cGVvZiBVaW50OEFycmF5PiJ1Ij9bXTpuZXcgVWludDhBcnJheSgyNTYpLGY9MDtmPHIubGVuZ3RoO2YrKylsW3IuY2hhckNvZGVBdChmKV09Zjt2YXIgZD1mdW5jdGlvbihzKXt2YXIgZT1uZXcgVWludDhBcnJheShzKSxuLGE9ZS5sZW5ndGgsdD0iIjtmb3Iobj0wO248YTtuKz0zKXQrPXJbZVtuXT4+Ml0sdCs9clsoZVtuXSYzKTw8NHxlW24rMV0+PjRdLHQrPXJbKGVbbisxXSYxNSk8PDJ8ZVtuKzJdPj42XSx0Kz1yW2VbbisyXSY2M107cmV0dXJuIGElMz09PTI/dD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTEpKyI9IjphJTM9PT0xJiYodD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTIpKyI9PSIpLHR9O2NvbnN0IGM9bmV3IE1hcCx1PW5ldyBNYXA7YXN5bmMgZnVuY3Rpb24gcChzLGUpe2NvbnN0IG49YCR7c30tJHtlfWA7aWYodS5oYXMobikpcmV0dXJuIHUuZ2V0KG4pO2NvbnN0IGE9bmV3IE9mZnNjcmVlbkNhbnZhcyhzLGUpO2EuZ2V0Q29udGV4dCgiMmQiKTtjb25zdCB0PWF3YWl0KGF3YWl0IGEuY29udmVydFRvQmxvYigpKS5hcnJheUJ1ZmZlcigpLGc9ZCh0KTtyZXR1cm4gdS5zZXQobixnKSxnfWNvbnN0IGk9c2VsZjtpLm9ubWVzc2FnZT1hc3luYyBmdW5jdGlvbihzKXtpZighKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcykpcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOnMuZGF0YS5pZH0pO2NvbnN0e2lkOmUsYml0bWFwOm4sd2lkdGg6YSxoZWlnaHQ6dH09cy5kYXRhLGc9cChhLHQpLGg9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2guZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCB3PWF3YWl0IGguY29udmVydFRvQmxvYigpLHk9dy50eXBlLGI9YXdhaXQgdy5hcnJheUJ1ZmZlcigpLG89ZChiKTtpZighYy5oYXMoZSkmJmF3YWl0IGc9PT1vKXJldHVybiBjLnNldChlLG8pLGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpZihjLmdldChlKT09PW8pcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpLnBvc3RNZXNzYWdlKHtpZDplLHR5cGU6eSxiYXNlNjQ6byx3aWR0aDphLGhlaWdodDp0fSksYy5zZXQoZSxvKX19KSgpOwoK",null,!1),gt=Object.getOwnPropertySymbols,Ar=Object.prototype.hasOwnProperty,Pr=Object.prototype.propertyIsEnumerable,_r=(e,t)=>{var r={};for(var n in e)Ar.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&gt)for(var n of gt(e))t.indexOf(n)<0&&Pr.call(e,n)&&(r[n]=e[n]);return r},Wr=(e,t,r)=>new Promise((n,o)=>{var s=i=>{try{a(r.next(i))}catch(c){o(c)}},l=i=>{try{a(r.throw(i))}catch(c){o(c)}},a=i=>i.done?n(i.value):Promise.resolve(i.value).then(s,l);a((r=r.apply(e,t)).next())});class Gr{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(l,a)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(a)};const{sampling:r="all",win:n,blockClass:o,recordCanvas:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&r==="all"&&this.initCanvasMutationObserver(n,o),s&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,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,r,n){const o=yt(r,n),s=new Map,l=new Fr;l.onmessage=p=>{const{id:f}=p.data;if(s.set(f,!1),!("base64"in p.data))return;const{base64:u,type:h,width:y,height:b}=p.data;this.mutationCb({id:f,type:se["2D"],commands:[{property:"clearRect",args:[0,0,y,b]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:u}],type:h}]},0,0]}]})};const a=1e3/t;let i=0,c;const d=p=>{if(i&&p-i<a){c=requestAnimationFrame(d);return}i=p,r.document.querySelectorAll(`canvas:not(.${n} *)`).forEach(f=>Wr(this,null,function*(){var u;const h=this.mirror.getId(f);if(s.get(h))return;if(s.set(h,!0),["webgl","webgl2"].includes(f.__context)){const b=f.getContext(f.__context);((u=b?.getContextAttributes())==null?void 0:u.preserveDrawingBuffer)===!1&&b?.clear(b.COLOR_BUFFER_BIT)}const y=yield createImageBitmap(f);l.postMessage({id:h,bitmap:y,width:f.width,height:f.height},[y])})),c=requestAnimationFrame(d)};c=requestAnimationFrame(d),this.resetObservers=()=>{o(),cancelAnimationFrame(c)}}initCanvasMutationObserver(t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=yt(t,r),o=Er(this.processMutation.bind(this),t,r,this.mirror),s=Nr(this.processMutation.bind(this),t,r,this.mirror);this.resetObservers=()=>{n(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const o=n.map(l=>_r(l,["type"])),{type:s}=n[0];this.mutationCb({id:r,type:s,commands:o}),this.pendingCanvasMutations.delete(t)}}class zr{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,r,n){this.mutationCb({adds:[{parentId:n.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[]}),this.addStylesheet(t)}}var Vr=Object.defineProperty,jr=Object.defineProperties,Zr=Object.getOwnPropertyDescriptors,bt=Object.getOwnPropertySymbols,Ur=Object.prototype.hasOwnProperty,Yr=Object.prototype.propertyIsEnumerable,St=(e,t,r)=>t in e?Vr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Y=(e,t)=>{for(var r in t||(t={}))Ur.call(t,r)&&St(e,r,t[r]);if(bt)for(var r of bt(t))Yr.call(t,r)&&St(e,r,t[r]);return e},Hr=(e,t)=>jr(e,Zr(t));function L(e){return Hr(Y({},e),{timestamp:Date.now()})}let O,ye;const $=wt();function ve(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:l="rr-ignore",maskTextClass:a="rr-mask",maskTextSelector:i=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:p,slimDOMOptions:f,maskInputFn:u,maskTextFn:h,hooks:y,packFn:b,sampling:k={},mousemoveWait:g,recordCanvas:m=!1,userTriggeredOnInput:I=!1,collectFonts:A=!1,inlineImages:P=!1,plugins:D,keepIframeSrcFn:x=()=>!1}=e;if(!t)throw new Error("emit function is required");g!==void 0&&k.mousemove===void 0&&(k.mousemove=g),$.reset();const H=d===!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},z=f===!0||f==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:f==="all",headMetaDescKeywords:f==="all"}:f||{};qt();let _,J=0;const E=v=>{for(const S of D||[])S.eventProcessor&&(v=S.eventProcessor(v));return b&&(v=b(v)),v};O=(v,S)=>{var U;if(((U=ee[0])==null?void 0:U.isFrozen())&&v.type!==M.FullSnapshot&&!(v.type===M.IncrementalSnapshot&&v.data.source===R.Mutation)&&ee.forEach(F=>F.unfreeze()),t(E(v),S),v.type===M.FullSnapshot)_=v,J=0;else if(v.type===M.IncrementalSnapshot){if(v.data.source===R.Mutation&&v.data.isAttachIframe)return;J++;const F=n&&J>=n,Q=r&&v.timestamp-_.timestamp>r;(F||Q)&&ye(!0)}};const j=v=>{O(L({type:M.IncrementalSnapshot,data:Y({source:R.Mutation},v)}))},Z=v=>O(L({type:M.IncrementalSnapshot,data:Y({source:R.Scroll},v)})),B=v=>O(L({type:M.IncrementalSnapshot,data:Y({source:R.CanvasMutation},v)})),X=new br({mutationCb:j}),K=new zr({mutationCb:j}),W=new Gr({recordCanvas:m,mutationCb:B,win:window,blockClass:o,mirror:$,sampling:k.canvas}),q=new Mr({mutationCb:j,scrollCb:Z,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:i,inlineStylesheet:c,maskInputOptions:H,maskTextFn:h,maskInputFn:u,recordCanvas:m,inlineImages:P,sampling:k,slimDOMOptions:z,iframeManager:X,stylesheetManager:K,canvasManager:W},mirror:$});ye=(v=!1)=>{var S,U,F,Q;O(L({type:M.Meta,data:{href:window.location.href,width:Ge(),height:We()}}),v),ee.forEach(T=>T.lock());const C=$t(document,{mirror:$,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:i,inlineStylesheet:c,maskAllInputs:H,maskTextFn:h,slimDOM:z,recordCanvas:m,inlineImages:P,onSerialize:T=>{je(T,$)&&X.addIframe(T),Ze(T,$)&&K.addStylesheet(T),Ue(T)&&q.addShadowRoot(T.shadowRoot,document)},onIframeLoad:(T,te)=>{X.attachIframe(T,te,$),q.observeAttachShadow(T)},onStylesheetLoad:(T,te)=>{K.attachStylesheet(T,te,$)},keepIframeSrcFn:x});if(!C)return console.warn("Failed to snapshot the document");O(L({type:M.FullSnapshot,data:{node:C,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((U=(S=document?.body)==null?void 0:S.parentElement)==null?void 0:U.scrollLeft)||document?.body.scrollLeft||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((Q=(F=document?.body)==null?void 0:F.parentElement)==null?void 0:Q.scrollTop)||document?.body.scrollTop||0}}})),ee.forEach(T=>T.unlock())};try{const v=[];v.push(G("DOMContentLoaded",()=>{O(L({type:M.DomContentLoaded,data:{}}))}));const S=F=>{var Q;return gr({mutationCb:j,mousemoveCb:(C,T)=>O(L({type:M.IncrementalSnapshot,data:{source:T,positions:C}})),mouseInteractionCb:C=>O(L({type:M.IncrementalSnapshot,data:Y({source:R.MouseInteraction},C)})),scrollCb:Z,viewportResizeCb:C=>O(L({type:M.IncrementalSnapshot,data:Y({source:R.ViewportResize},C)})),inputCb:C=>O(L({type:M.IncrementalSnapshot,data:Y({source:R.Input},C)})),mediaInteractionCb:C=>O(L({type:M.IncrementalSnapshot,data:Y({source:R.MediaInteraction},C)})),styleSheetRuleCb:C=>O(L({type:M.IncrementalSnapshot,data:Y({source:R.StyleSheetRule},C)})),styleDeclarationCb:C=>O(L({type:M.IncrementalSnapshot,data:Y({source:R.StyleDeclaration},C)})),canvasMutationCb:B,fontCb:C=>O(L({type:M.IncrementalSnapshot,data:Y({source:R.Font},C)})),blockClass:o,ignoreClass:l,maskTextClass:a,maskTextSelector:i,maskInputOptions:H,inlineStylesheet:c,sampling:k,recordCanvas:m,inlineImages:P,userTriggeredOnInput:I,collectFonts:A,doc:F,maskInputFn:u,maskTextFn:h,blockSelector:s,slimDOMOptions:z,mirror:$,iframeManager:X,stylesheetManager:K,shadowDomManager:q,canvasManager:W,plugins:((Q=D?.filter(C=>C.observer))==null?void 0:Q.map(C=>({observer:C.observer,options:C.options,callback:T=>O(L({type:M.Plugin,data:{plugin:C.name,payload:T}}))})))||[]},y)};X.addLoadListener(F=>{v.push(S(F.contentDocument))});const U=()=>{ye(),v.push(S(document))};return document.readyState==="interactive"||document.readyState==="complete"?U():v.push(G("load",()=>{O(L({type:M.Load,data:{}})),U()},window)),()=>{v.forEach(F=>F())}}catch(v){console.warn(v)}}return ve.addCustomEvent=(e,t)=>{if(!O)throw new Error("please add custom event after start recording");O(L({type:M.Custom,data:{tag:e,payload:t}}))},ve.freezePage=()=>{ee.forEach(e=>e.freeze())},ve.takeFullSnapshot=e=>{if(!ye)throw new Error("please take full snapshot after start recording");ye(e)},ve.mirror=$,ve}();
//# sourceMappingURL=rrweb-record.min.js.map

@@ -599,3 +599,16 @@ var NodeType$1;

case 'CANVAS':
newTree.canvasMutations.forEach((canvasMutation) => replayer.applyCanvas(canvasMutation.event, canvasMutation.mutation, oldTree));
{
const rrCanvasElement = newTree;
if (rrCanvasElement.rr_dataURL !== null) {
const image = document.createElement('img');
image.onload = () => {
const ctx = oldElement.getContext('2d');
if (ctx) {
ctx.drawImage(image, 0, 0, image.width, image.height);
}
};
image.src = rrCanvasElement.rr_dataURL;
}
rrCanvasElement.canvasMutations.forEach((canvasMutation) => replayer.applyCanvas(canvasMutation.event, canvasMutation.mutation, oldTree));
}
break;

@@ -936,2 +949,3 @@ case 'STYLE':

super(...arguments);
this.rr_dataURL = null;
this.canvasMutations = [];

@@ -938,0 +952,0 @@ }

@@ -76,5 +76,6 @@ function pathToSelector(node) {

}
if (value === null || value === undefined) {
if (value === null)
return value;
}
if (value === undefined)
return 'undefined';
if (shouldIgnore(value)) {

@@ -81,0 +82,0 @@ return toString(value);

@@ -1,2 +0,2 @@

import { isShadowRoot, maskInputValue, transformAttribute, needMaskingText, IGNORED_NODE, serializeNodeWithId } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';
import { isShadowRoot, isNativeShadowDom, maskInputValue, transformAttribute, needMaskingText, IGNORED_NODE, serializeNodeWithId } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';
import { isIgnored, isBlocked, isSerialized, isAncestorRemoved, isSerializedIframe, isSerializedStylesheet, hasShadowRoot } from '../utils.js';

@@ -370,3 +370,5 @@

id: nodeId,
isShadow: isShadowRoot(m.target) ? true : undefined,
isShadow: isShadowRoot(m.target) && isNativeShadowDom(m.target)
? true
: undefined,
});

@@ -373,0 +375,0 @@ }

@@ -462,4 +462,3 @@ import { maskInputValue } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';

? source
:
JSON.stringify(Array.from(new Uint8Array(source))),
: JSON.stringify(Array.from(new Uint8Array(source))),
});

@@ -466,0 +465,0 @@ return fontFace;

import { initMutationObserver, initScrollObserver } from './observer.js';
import { patch } from '../utils.js';
import { isNativeShadowDom } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';

@@ -22,2 +23,4 @@ class ShadowDomManager {

addShadowRoot(shadowRoot, doc) {
if (!isNativeShadowDom(shadowRoot))
return;
initMutationObserver(Object.assign(Object.assign({}, this.bypassOptions), { doc, mutationCb: this.mutationCb, mirror: this.mirror, shadowDomManager: this }), shadowRoot);

@@ -24,0 +27,0 @@ initScrollObserver(Object.assign(Object.assign({}, this.bypassOptions), { scrollCb: this.scrollCb, doc: shadowRoot, mirror: this.mirror }));

@@ -323,5 +323,6 @@ 'use strict';

}
if (value === null || value === undefined) {
if (value === null)
return value;
}
if (value === undefined)
return 'undefined';
if (shouldIgnore(value)) {

@@ -328,0 +329,0 @@ return toString(value);

{
"name": "rrweb",
"version": "2.0.0-alpha.0",
"version": "2.0.0-alpha.1",
"description": "record and replay the web",

@@ -8,4 +8,4 @@ "scripts": {

"prepack": "npm run bundle",
"test": "npm run bundle:browser && jest",
"test:headless": "npm run bundle:browser && PUPPETEER_HEADLESS=true jest",
"test": "npm run bundle:browser && jest --testPathIgnorePatterns test/benchmark",
"test:headless": "PUPPETEER_HEADLESS=true npm run test",
"test:watch": "PUPPETEER_HEADLESS=true npm run test -- --watch",

@@ -19,3 +19,4 @@ "repl": "npm run bundle:browser && node scripts/repl.js",

"prepublish": "npm run typings && npm run bundle",
"lint": "yarn eslint src"
"lint": "yarn eslint src",
"benchmark": "jest test/benchmark"
},

@@ -84,6 +85,6 @@ "repository": {

"mitt": "^3.0.0",
"rrdom": "^0.1.3",
"rrweb-snapshot": "^2.0.0-alpha.0"
"rrdom": "^0.1.4",
"rrweb-snapshot": "^2.0.0-alpha.1"
},
"gitHead": "2d4dd2296670387c7a7d652c1dd5e66fad8d64c1"
"gitHead": "abc035fd00972c3ffa1a9cf379b46f53cb74d394"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc