@highlight-run/rrweb 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/record/rrweb-record.js +3 -3
- package/dist/record/rrweb-record.min.js +3 -3
- package/dist/record/rrweb-record.min.js.map +1 -1
- package/dist/rrweb-all.js +8 -8
- package/dist/rrweb-all.min.js +8 -8
- package/dist/rrweb-all.min.js.map +1 -1
- package/dist/rrweb.js +5 -5
- package/dist/rrweb.min.js +5 -5
- package/dist/rrweb.min.js.map +1 -1
- package/es/rrweb/packages/rrweb/src/record/index.js +3 -3
- package/lib/record/rrweb-record.js +2 -2
- package/lib/rrweb-all.js +2 -2
- package/lib/rrweb.js +2 -2
- package/package.json +2 -2
- package/typings/entries/all.d.ts +0 -0
- package/typings/entries/record-pack.d.ts +0 -0
- package/typings/entries/replay-unpack.d.ts +0 -0
- package/typings/index.d.ts +0 -0
- package/typings/packer/base.d.ts +0 -0
- package/typings/packer/index.d.ts +0 -0
- package/typings/packer/pack.d.ts +0 -0
- package/typings/packer/unpack.d.ts +0 -0
- package/typings/plugins/console/record/error-stack-parser.d.ts +0 -0
- package/typings/plugins/console/record/index.d.ts +0 -0
- package/typings/plugins/console/record/stringify.d.ts +0 -0
- package/typings/plugins/console/replay/index.d.ts +0 -0
- package/typings/plugins/sequential-id/record/index.d.ts +0 -0
- package/typings/plugins/sequential-id/replay/index.d.ts +0 -0
- package/typings/record/iframe-manager.d.ts +0 -0
- package/typings/record/index.d.ts +0 -0
- package/typings/record/mutation.d.ts +0 -0
- package/typings/record/observer.d.ts +0 -0
- package/typings/record/observers/canvas/2d.d.ts +0 -0
- package/typings/record/observers/canvas/canvas-manager.d.ts +0 -0
- package/typings/record/observers/canvas/canvas.d.ts +0 -0
- package/typings/record/observers/canvas/serialize-args.d.ts +0 -0
- package/typings/record/observers/canvas/webgl.d.ts +0 -0
- package/typings/record/shadow-dom-manager.d.ts +0 -0
- package/typings/record/stylesheet-manager.d.ts +0 -0
- package/typings/record/workers/image-bitmap-data-url-worker.d.ts +0 -0
- package/typings/replay/canvas/2d.d.ts +0 -0
- package/typings/replay/canvas/deserialize-args.d.ts +0 -0
- package/typings/replay/canvas/index.d.ts +0 -0
- package/typings/replay/canvas/webgl.d.ts +0 -0
- package/typings/replay/index.d.ts +0 -0
- package/typings/replay/machine.d.ts +0 -0
- package/typings/replay/smoothscroll.d.ts +0 -0
- package/typings/replay/styles/inject-style.d.ts +0 -0
- package/typings/replay/timer.d.ts +0 -0
- package/typings/rrdom/index.d.ts +0 -0
- package/typings/rrdom/tree-node.d.ts +0 -0
- package/typings/types.d.ts +0 -0
- package/typings/utils.d.ts +0 -0
package/dist/rrweb-all.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var rrweb=function(q){"use strict";var P;(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"})(P||(P={}));function er(e){return e.nodeType===e.ELEMENT_NODE}function je(e){var t=e?.host;return Boolean(t?.shadowRoot===e)}function Ve(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}var vt=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 tr(){return new vt}function gt(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,i=e.maskInputFn,l=o||"";return(t[r.toLowerCase()]||t[n])&&(i?l=i(l):l="*".repeat(l.length)),l}var rr="__rrweb_original__";function Hn(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 i=t.getImageData,l=rr in i?i[rr]:i,c=new Uint32Array(l.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer);if(c.some(function(a){return a!==0}))return!1}return!0}function nr(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var Yn=1,Xn=new RegExp("[^a-z0-9-_:]"),Ge=-2;function Zn(){return Yn++}function Kn(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return Xn.test(t)?"div":t}function yt(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(qn).join(""):null}catch{return null}}function qn(e){var t=e.cssText;if(Jn(e))try{t=yt(e.styleSheet)||t}catch{}return t}function Jn(e){return"styleSheet"in e}function Qn(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function eo(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var xe,or,to=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ro=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,no=/^(data:)([^,]*),(.*)/i;function tt(e,t){return(e||"").replace(to,function(r,n,o,i,l,c){var a=o||l||c,s=n||i||"";if(!a)return r;if(!ro.test(a)||no.test(a))return"url(".concat(s).concat(a).concat(s,")");if(a[0]==="/")return"url(".concat(s).concat(eo(t)+a).concat(s,")");var u=t.split("/"),d=a.split("/");u.pop();for(var h=0,m=d;h<m.length;h++){var p=m[h];p!=="."&&(p===".."?u.pop():u.push(p))}return"url(".concat(s).concat(u.join("/")).concat(s,")")})}var oo=/^[^ \t\n\r\u000c]+/,io=/^[, \t\n\r\u000c]+/;function so(e,t){if(t.trim()==="")return t;var r=0;function n(s){var u,d=s.exec(t.substring(r));return d?(u=d[0],r+=u.length,u):""}for(var o=[];n(io),!(r>=t.length);){var i=n(oo);if(i.slice(-1)===",")i=rt(e,i.substring(0,i.length-1)),o.push(i);else{var l="";i=rt(e,i);for(var c=!1;;){var a=t.charAt(r);if(a===""){o.push((i+l).trim());break}else if(c)a===")"&&(c=!1);else if(a===","){r+=1,o.push((i+l).trim());break}else a==="("&&(c=!0);l+=a,r+=1}}}return o.join(", ")}function rt(e,t){if(!t||t.trim()==="")return t;var r=e.createElement("a");return r.href=t,r.href}function ao(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function bt(){var e=document.createElement("a");return e.href="",e.href}function ir(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")?rt(e,n):r==="srcset"&&n?so(e,n):r==="style"&&n?tt(n,bt()):t==="object"&&r==="data"&&n?rt(e,n):n}function lo(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 nt(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?nt(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?nt(e.parentNode,t,r):!1}function sr(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(nt(n,t,!0))return!0;return!!(r&&(n.matches(r)||n.closest(r)))}function co(e,t,r){var n=e.contentWindow;if(n){var o=!1,i;try{i=n.document.readyState}catch{return}if(i!=="complete"){var l=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(l),o=!0,t()});return}var c="about:blank";if(n.location.href!==c||e.src===c||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function ar(e){return e.getAttribute("href")?e.sheet!==null:!0}function lr(e,t,r){var n=!1,o;try{o=e.sheet}catch{return}if(!o){var i=setTimeout(function(){n||(t(),n=!0)},r);e.addEventListener("load",function(){clearTimeout(i),n=!0,t()})}}function uo(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector,l=t.maskTextClass,c=t.maskTextSelector,a=t.inlineStylesheet,s=t.maskInputOptions,u=s===void 0?{}:s,d=t.maskTextFn,h=t.maskInputFn,m=t.dataURLOptions,p=m===void 0?{}:m,f=t.inlineImages,y=t.recordCanvas,v=t.keepIframeSrcFn,S=t.newlyAddedElement,w=S===void 0?!1:S,b=t.enableStrictPrivacy,k=ho(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:P.Document,childNodes:[],compatMode:e.compatMode,rootId:k}:{type:P.Document,childNodes:[],rootId:k};case e.DOCUMENT_TYPE_NODE:return{type:P.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:k};case e.ELEMENT_NODE:return po(e,{doc:r,blockClass:o,blockSelector:i,inlineStylesheet:a,maskInputOptions:u,maskInputFn:h,dataURLOptions:p,inlineImages:f,recordCanvas:y,keepIframeSrcFn:v,newlyAddedElement:w,enableStrictPrivacy:b,rootId:k});case e.TEXT_NODE:return mo(e,{maskTextClass:l,maskTextSelector:c,maskTextFn:d,enableStrictPrivacy:b,rootId:k});case e.CDATA_SECTION_NODE:return{type:P.CDATA,textContent:"",rootId:k};case e.COMMENT_NODE:return{type:P.Comment,textContent:e.textContent||"",rootId:k};default:return!1}}function ho(e,t){if(t.hasNode(e)){var r=t.getId(e);return r===1?void 0:r}}function mo(e,t){var r,n=t.maskTextClass,o=t.maskTextSelector,i=t.maskTextFn,l=t.enableStrictPrivacy,c=t.rootId,a=e.parentNode&&e.parentNode.tagName,s=e.textContent,u=a==="STYLE"?!0:void 0,d=a==="SCRIPT"?!0:void 0,h=!1;if(u&&s){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(s=Qn(e.parentNode.sheet))}catch(p){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(p),e)}s=tt(s,bt()),h=!0}if(d?(s="SCRIPT_PLACEHOLDER",h=!0):a==="NOSCRIPT"&&(s="",h=!0),!u&&!d&&s&&sr(e,n,o)&&(s=i?i(s):s.replace(/[\S]/g,"*")),l&&!h&&a){var m=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!m.has(a)&&s&&(s=nr(s))}return{type:P.Text,textContent:s||"",isStyle:u,rootId:c}}function po(e,t){for(var r=t.doc,n=t.blockClass,o=t.blockSelector,i=t.inlineStylesheet,l=t.maskInputOptions,c=l===void 0?{}:l,a=t.maskInputFn,s=t.dataURLOptions,u=s===void 0?{}:s,d=t.inlineImages,h=t.recordCanvas,m=t.keepIframeSrcFn,p=t.newlyAddedElement,f=p===void 0?!1:p,y=t.enableStrictPrivacy,v=t.rootId,S=lo(e,n,o),w=Kn(e),b={},k=e.attributes.length,M=0;M<k;M++){var x=e.attributes[M];b[x.name]=ir(r,w,x.name,x.value)}if(w==="link"&&i){var T=Array.from(r.styleSheets).find(function(g){return g.href===e.href}),D=null;T&&(D=yt(T)),D&&(delete b.rel,delete b.href,b._cssText=tt(D,T.href))}if(w==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var D=yt(e.sheet);D&&(b._cssText=tt(D,bt()))}if(w==="input"||w==="textarea"||w==="select"){var W=e.value;b.type!=="radio"&&b.type!=="checkbox"&&b.type!=="submit"&&b.type!=="button"&&W?b.value=gt({type:b.type,tagName:w,value:W,maskInputOptions:c,maskInputFn:a}):e.checked&&(b.checked=e.checked)}if(w==="option"&&(e.selected&&!c.select?b.selected=!0:delete b.selected),w==="canvas"&&h){if(e.__context==="2d")Hn(e)||(b.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var V=e.toDataURL(u.type,u.quality),U=document.createElement("canvas");U.width=e.width,U.height=e.height;var G=U.toDataURL(u.type,u.quality);V!==G&&(b.rr_dataURL=V)}}if(w==="img"&&d){xe||(xe=r.createElement("canvas"),or=xe.getContext("2d"));var A=e,j=A.crossOrigin;A.crossOrigin="anonymous";var F=function(){try{xe.width=A.naturalWidth,xe.height=A.naturalHeight,or.drawImage(A,0,0),b.rr_dataURL=xe.toDataURL(u.type,u.quality)}catch(g){console.warn("Cannot inline img src=".concat(A.currentSrc,"! Error: ").concat(g))}j?b.crossOrigin=j:A.removeAttribute("crossorigin")};A.complete&&A.naturalWidth!==0?F():A.onload=F}if((w==="audio"||w==="video")&&(b.rr_mediaState=e.paused?"paused":"played",b.rr_mediaCurrentTime=e.currentTime),f||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop)),S||w==="img"&&y){var O=e.getBoundingClientRect(),_=O.width,N=O.height;b={class:b.class,rr_width:"".concat(_,"px"),rr_height:"".concat(N,"px")},S=!0}return w==="iframe"&&!m(b.src)&&(e.contentDocument||(b.rr_src=b.src),delete b.src),{type:P.Element,tagName:w,attributes:b,childNodes:[],isSVG:ao(e)||void 0,needBlock:S,rootId:v}}function Z(e){return e===void 0?"":e.toLowerCase()}function fo(e,t){return!!(t.comment&&e.type===P.Comment||e.type===P.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"&&(Z(e.attributes.name).match(/^msapplication-tile(image|color)$/)||Z(e.attributes.name)==="application-name"||Z(e.attributes.rel)==="icon"||Z(e.attributes.rel)==="apple-touch-icon"||Z(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&Z(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(Z(e.attributes.property).match(/^(og|twitter|fb):/)||Z(e.attributes.name).match(/^(og|twitter):/)||Z(e.attributes.name)==="pinterest")||t.headMetaRobots&&(Z(e.attributes.name)==="robots"||Z(e.attributes.name)==="googlebot"||Z(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(Z(e.attributes.name)==="author"||Z(e.attributes.name)==="generator"||Z(e.attributes.name)==="framework"||Z(e.attributes.name)==="publisher"||Z(e.attributes.name)==="progid"||Z(e.attributes.property).match(/^article:/)||Z(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(Z(e.attributes.name)==="google-site-verification"||Z(e.attributes.name)==="yandex-verification"||Z(e.attributes.name)==="csrf-token"||Z(e.attributes.name)==="p:domain_verify"||Z(e.attributes.name)==="verify-v1"||Z(e.attributes.name)==="verification"||Z(e.attributes.name)==="shopify-checkout-api-token"))))}function Ee(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector,l=t.maskTextClass,c=t.maskTextSelector,a=t.skipChild,s=a===void 0?!1:a,u=t.inlineStylesheet,d=u===void 0?!0:u,h=t.maskInputOptions,m=h===void 0?{}:h,p=t.maskTextFn,f=t.maskInputFn,y=t.slimDOMOptions,v=t.dataURLOptions,S=v===void 0?{}:v,w=t.inlineImages,b=w===void 0?!1:w,k=t.recordCanvas,M=k===void 0?!1:k,x=t.onSerialize,T=t.onIframeLoad,D=t.iframeLoadTimeout,W=D===void 0?5e3:D,V=t.onStylesheetLoad,U=t.stylesheetLoadTimeout,G=U===void 0?5e3:U,A=t.keepIframeSrcFn,j=A===void 0?function(){return!1}:A,F=t.newlyAddedElement,O=F===void 0?!1:F,_=t.enableStrictPrivacy,N=t.preserveWhiteSpace,g=N===void 0?!0:N,I=uo(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,dataURLOptions:S,inlineImages:b,recordCanvas:M,keepIframeSrcFn:j,newlyAddedElement:O,enableStrictPrivacy:_});if(!I)return console.warn(e,"not serialized"),null;var E;if(n.hasNode(e)?E=n.getId(e):fo(I,y)||!g&&I.type===P.Text&&!I.isStyle&&!I.textContent.replace(/^\s+|\s+$/gm,"").length?E=Ge:E=Zn(),E===Ge)return null;var C=Object.assign(I,{id:E});n.add(e,C),x&&x(e);var z=!s;if(C.type===P.Element){if(z=z&&!C.needBlock,C.needBlock&&C.tagName==="img"){var H=e.cloneNode();H.src="",n.add(H,C)}delete C.needBlock;var oe=e.shadowRoot;oe&&Ve(oe)&&(C.isShadowHost=!0)}if((C.type===P.Document||C.type===P.Element)&&z){y.headWhitespace&&C.type===P.Element&&C.tagName==="head"&&(g=!1);for(var B={doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:s,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:S,inlineImages:b,recordCanvas:M,preserveWhiteSpace:g,onSerialize:x,onIframeLoad:T,iframeLoadTimeout:W,onStylesheetLoad:V,stylesheetLoadTimeout:G,keepIframeSrcFn:j,enableStrictPrivacy:_},X=0,Te=Array.from(e.childNodes);X<Te.length;X++){var We=Te[X],ye=Ee(We,B);ye&&C.childNodes.push(ye)}if(er(e)&&e.shadowRoot)for(var Ue=0,Gn=Array.from(e.shadowRoot.childNodes);Ue<Gn.length;Ue++){var We=Gn[Ue],ye=Ee(We,B);ye&&(Ve(e.shadowRoot)&&(ye.isShadow=!0),C.childNodes.push(ye))}}return e.parentNode&&je(e.parentNode)&&Ve(e.parentNode)&&(C.isShadow=!0),C.type===P.Element&&C.tagName==="iframe"&&co(e,function(){var ae=e.contentDocument;if(ae&&T){var Bn=Ee(ae,{doc:ae,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:S,inlineImages:b,recordCanvas:M,preserveWhiteSpace:g,onSerialize:x,onIframeLoad:T,iframeLoadTimeout:W,onStylesheetLoad:V,stylesheetLoadTimeout:G,keepIframeSrcFn:j,enableStrictPrivacy:_});Bn&&T(e,Bn)}},W),C.type===P.Element&&C.tagName==="link"&&C.attributes.rel==="stylesheet"&&(lr(e,function(){if(V){var ae=Ee(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:S,inlineImages:b,recordCanvas:M,preserveWhiteSpace:g,onSerialize:x,onIframeLoad:T,iframeLoadTimeout:W,onStylesheetLoad:V,stylesheetLoadTimeout:G,keepIframeSrcFn:j,enableStrictPrivacy:_});ae&&V(e,ae)}},G),ar(e)===!1)||C.type===P.Element&&C.tagName==="link"&&C.attributes.rel==="stylesheet"&&(lr(e,function(){if(V){var ae=Ee(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:S,inlineImages:b,recordCanvas:M,preserveWhiteSpace:g,onSerialize:x,onIframeLoad:T,iframeLoadTimeout:W,enableStrictPrivacy:_,onStylesheetLoad:V,stylesheetLoadTimeout:G,keepIframeSrcFn:j});ae&&V(e,ae)}},G),ar(e)===!1)?null:C}function vo(e,t){var r=t||{},n=r.mirror,o=n===void 0?new vt:n,i=r.blockClass,l=i===void 0?"highlight-block":i,c=r.blockSelector,a=c===void 0?null:c,s=r.maskTextClass,u=s===void 0?"highlight-mask":s,d=r.maskTextSelector,h=d===void 0?null:d,m=r.inlineStylesheet,p=m===void 0?!0:m,f=r.inlineImages,y=f===void 0?!1:f,v=r.recordCanvas,S=v===void 0?!1:v,w=r.maskAllInputs,b=w===void 0?!1:w,k=r.maskTextFn,M=r.maskInputFn,x=r.slimDOM,T=x===void 0?!1:x,D=r.dataURLOptions,W=r.preserveWhiteSpace,V=r.onSerialize,U=r.onIframeLoad,G=r.iframeLoadTimeout,A=r.onStylesheetLoad,j=r.stylesheetLoadTimeout,F=r.keepIframeSrcFn,O=F===void 0?function(){return!1}:F,_=r.enableStrictPrivacy,N=_===void 0?!1:_,g=b===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:b===!1?{password:!0}:b,I=T===!0||T==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:T==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:T===!1?{}:T;return Ee(e,{doc:e,mirror:o,blockClass:l,blockSelector:a,maskTextClass:u,maskTextSelector:h,skipChild:!1,inlineStylesheet:p,maskInputOptions:g,maskTextFn:k,maskInputFn:M,slimDOMOptions:I,dataURLOptions:D,inlineImages:y,recordCanvas:S,preserveWhiteSpace:W,onSerialize:V,onIframeLoad:U,iframeLoadTimeout:G,onStylesheetLoad:A,stylesheetLoadTimeout:j,keepIframeSrcFn:O,newlyAddedElement:!1,enableStrictPrivacy:N})}var cr=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function go(e,t){t===void 0&&(t={});var r=1,n=1;function o(N){var g=N.match(/\n/g);g&&(r+=g.length);var I=N.lastIndexOf(`
|
|
2
|
-
`);n=I===-1?n+N.length:N.length-I}function i(){var N={line:r,column:n};return function(g){return g.position=new l(N),p(),g}}var l=function(){function N(g){this.start=g,this.end={line:r,column:n},this.source=t.source}return N}();l.prototype.content=e;var c=[];function a(N){var g=new Error("".concat(t.source||"",":").concat(r,":").concat(n,": ").concat(N));if(g.reason=N,g.filename=t.source,g.line=r,g.column=n,g.source=e,t.silent)c.push(g);else throw g}function s(){var N=h();return{type:"stylesheet",stylesheet:{source:t.source,rules:N,parsingErrors:c}}}function u(){return m(/^{\s*/)}function d(){return m(/^}/)}function h(){var N,g=[];for(p(),f(g);e.length&&e.charAt(0)!=="}"&&(N=O()||_());)N!==!1&&(g.push(N),f(g));return g}function m(N){var g=N.exec(e);if(g){var I=g[0];return o(I),e=e.slice(I.length),g}}function p(){m(/^\s*/)}function f(N){N===void 0&&(N=[]);for(var g;g=y();)g!==!1&&N.push(g),g=y();return N}function y(){var N=i();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var g=2;e.charAt(g)!==""&&(e.charAt(g)!=="*"||e.charAt(g+1)!=="/");)++g;if(g+=2,e.charAt(g-1)==="")return a("End of comment missing");var I=e.slice(2,g-2);return n+=2,o(I),e=e.slice(g),n+=2,N({type:"comment",comment:I})}}function v(){var N=m(/^([^{]+)/);if(N)return fe(N[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(g){return g.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(g){return g.replace(/\u200C/g,",")})}function S(){var N=i(),g=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(g){var I=fe(g[0]);if(!m(/^:\s*/))return a("property missing ':'");var E=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),C=N({type:"declaration",property:I.replace(cr,""),value:E?fe(E[0]).replace(cr,""):""});return m(/^[;\s]*/),C}}function w(){var N=[];if(!u())return a("missing '{'");f(N);for(var g;g=S();)g!==!1&&(N.push(g),f(N)),g=S();return d()?N:a("missing '}'")}function b(){for(var N,g=[],I=i();N=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)g.push(N[1]),m(/^,\s*/);if(g.length)return I({type:"keyframe",values:g,declarations:w()})}function k(){var N=i(),g=m(/^@([-\w]+)?keyframes\s*/);if(g){var I=g[1];if(g=m(/^([-\w]+)\s*/),!g)return a("@keyframes missing name");var E=g[1];if(!u())return a("@keyframes missing '{'");for(var C,z=f();C=b();)z.push(C),z=z.concat(f());return d()?N({type:"keyframes",name:E,vendor:I,keyframes:z}):a("@keyframes missing '}'")}}function M(){var N=i(),g=m(/^@supports *([^{]+)/);if(g){var I=fe(g[1]);if(!u())return a("@supports missing '{'");var E=f().concat(h());return d()?N({type:"supports",supports:I,rules:E}):a("@supports missing '}'")}}function x(){var N=i(),g=m(/^@host\s*/);if(g){if(!u())return a("@host missing '{'");var I=f().concat(h());return d()?N({type:"host",rules:I}):a("@host missing '}'")}}function T(){var N=i(),g=m(/^@media *([^{]+)/);if(g){var I=fe(g[1]);if(!u())return a("@media missing '{'");var E=f().concat(h());return d()?N({type:"media",media:I,rules:E}):a("@media missing '}'")}}function D(){var N=i(),g=m(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(g)return N({type:"custom-media",name:fe(g[1]),media:fe(g[2])})}function W(){var N=i(),g=m(/^@page */);if(g){var I=v()||[];if(!u())return a("@page missing '{'");for(var E=f(),C;C=S();)E.push(C),E=E.concat(f());return d()?N({type:"page",selectors:I,declarations:E}):a("@page missing '}'")}}function V(){var N=i(),g=m(/^@([-\w]+)?document *([^{]+)/);if(g){var I=fe(g[1]),E=fe(g[2]);if(!u())return a("@document missing '{'");var C=f().concat(h());return d()?N({type:"document",document:E,vendor:I,rules:C}):a("@document missing '}'")}}function U(){var N=i(),g=m(/^@font-face\s*/);if(g){if(!u())return a("@font-face missing '{'");for(var I=f(),E;E=S();)I.push(E),I=I.concat(f());return d()?N({type:"font-face",declarations:I}):a("@font-face missing '}'")}}var G=F("import"),A=F("charset"),j=F("namespace");function F(N){var g=new RegExp("^@"+N+"\\s*([^;]+);");return function(){var I=i(),E=m(g);if(E){var C={type:N};return C[N]=E[1].trim(),I(C)}}}function O(){if(e[0]==="@")return k()||T()||D()||M()||G()||A()||j()||V()||W()||x()||U()}function _(){var N=i(),g=v();return g?(f(),N({type:"rule",selectors:g,declarations:w()})):a("selector missing")}return St(s())}function fe(e){return e?e.replace(/^\s+|\s+$/g,""):""}function St(e,t){for(var r=e&&typeof e.type=="string",n=r?e:t,o=0,i=Object.keys(e);o<i.length;o++){var l=i[o],c=e[l];Array.isArray(c)?c.forEach(function(a){St(a,n)}):c&&typeof c=="object"&&St(c,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var ur={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function yo(e){var t=ur[e.tagName]?ur[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function bo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var dr=/([^\\]):hover/,So=new RegExp(dr.source,"g");function hr(e,t){var r;if(!(!((r=window?.HIG_CONFIGURATION)===null||r===void 0)&&r.enableOnHoverClass))return e;var n=t?.stylesWithHoverClass.get(e);if(n)return n;var o=go(e,{silent:!0});if(!o.stylesheet)return e;var i=[];if(o.stylesheet.rules.forEach(function(a){"selectors"in a&&(a.selectors||[]).forEach(function(s){dr.test(s)&&i.push(s)})}),i.length===0)return e;var l=new RegExp(i.filter(function(a,s){return i.indexOf(a)===s}).sort(function(a,s){return s.length-a.length}).map(function(a){return bo(a)}).join("|"),"g"),c=e.replace(l,function(a){var s=a.replace(So,"$1.\\:hover");return"".concat(a,", ").concat(s)});return t?.stylesWithHoverClass.set(e,c),c}function mr(){var e=new Map;return{stylesWithHoverClass:e}}function wo(e,t){var r=t.doc,n=t.hackCss,o=t.cache;switch(e.type){case P.Document:return r.implementation.createDocument(null,"",null);case P.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case P.Element:{var i=yo(e),l;e.isSVG?l=r.createElementNS("http://www.w3.org/2000/svg",i):l=r.createElement(i);var c=function(d){if(!Object.prototype.hasOwnProperty.call(e.attributes,d))return"continue";var h=e.attributes[d];if(i==="option"&&d==="selected"&&h===!1)return"continue";if(h=typeof h=="boolean"||typeof h=="number"?"":h,d.startsWith("rr_")){if(i==="canvas"&&d==="rr_dataURL"){var m=document.createElement("img");m.onload=function(){var D=l.getContext("2d");D&&D.drawImage(m,0,0,m.width,m.height)},m.src=h,l.RRNodeType&&(l.rr_dataURL=h)}else if(i==="img"&&d==="rr_dataURL"){var p=l;p.currentSrc.startsWith("data:")||(p.setAttribute("rrweb-original-src",e.attributes.src),p.src=h,p.setAttribute("rrweb-inline-src",h))}if(d==="rr_width")l.style.width=h;else if(d==="rr_height")l.style.height=h;else if(d==="rr_mediaCurrentTime")l.currentTime=e.attributes.rr_mediaCurrentTime;else if(d==="rr_mediaState")switch(h){case"played":l.play().catch(function(D){return console.warn("media playback error",D)});break;case"paused":l.pause();break}}else{var f=i==="textarea"&&d==="value",y=i==="style"&&d==="_cssText";if(y&&n&&(h=hr(h,o),typeof h=="string")){for(var v=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,S=void 0,w=[],b="https://replay-cors-proxy.highlightrun.workers.dev";(S=v.exec(h))!==null;)S.index===v.lastIndex&&v.lastIndex++,S.forEach(function(D,W){if(W===0){var V=D.slice(5,D.length-2);w.push({originalUrl:V,proxyUrl:V.replace(V,"".concat(b,"?url=").concat(V))})}});w.forEach(function(D){h=h.replace(D.originalUrl,D.proxyUrl)})}if(f||y){for(var k=r.createTextNode(h),M=0,x=Array.from(l.childNodes);M<x.length;M++){var T=x[M];T.nodeType===l.TEXT_NODE&&l.removeChild(T)}return l.appendChild(k),"continue"}try{if(e.isSVG&&d==="xlink:href")l.setAttributeNS("http://www.w3.org/1999/xlink",d,h);else if(d==="onload"||d==="onclick"||d.substring(0,7)==="onmouse")l.setAttribute("_"+d,h);else{if(i==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&d==="content")return l.setAttribute("csp-content",h),"continue";i==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||i==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")||(i==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?l.setAttribute("rrweb-original-srcset",e.attributes.srcset):l.setAttribute(d,h))}}catch{}}};for(var a in e.attributes)c(a);if(i==="img"){var s=l;if(!s.currentSrc.startsWith("data:")){var u=s.getAttribute("rrweb-inline-src");u!=null&&u.startsWith("data:")&&(s.src=u)}}if(e.isShadowHost)if(!l.shadowRoot)l.attachShadow({mode:"open"});else for(;l.shadowRoot.firstChild;)l.shadowRoot.removeChild(l.shadowRoot.firstChild);return l}case P.Text:return r.createTextNode(e.isStyle&&n?hr(e.textContent,o):e.textContent);case P.CDATA:return r.createCDATASection(e.textContent);case P.Comment:return r.createComment(e.textContent);default:return null}}function ot(e,t){var r=t.doc,n=t.mirror,o=t.skipChild,i=o===void 0?!1:o,l=t.hackCss,c=l===void 0?!0:l,a=t.afterAppend,s=t.cache,u=wo(e,{doc:r,hackCss:c,cache:s});if(!u)return null;if(e.rootId&&console.assert(n.getNode(e.rootId)===r,"Target document should have the same root id."),e.type===P.Document&&(r.close(),r.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==P.DocumentType&&(e.childNodes[0].type===P.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=r),n.add(u,e),(e.type===P.Document||e.type===P.Element)&&!i)for(var d=0,h=e.childNodes;d<h.length;d++){var m=h[d],p=ot(m,{doc:r,mirror:n,skipChild:!1,hackCss:c,afterAppend:a,cache:s});if(!p){console.warn("Failed to rebuild",m);continue}m.isShadow&&er(u)&&u.shadowRoot?u.shadowRoot.appendChild(p):u.appendChild(p),a&&a(p)}return u}function No(e,t){function r(l){t(l)}for(var n=0,o=e.getIds();n<o.length;n++){var i=o[n];e.has(i)&&r(e.getNode(i))}}function To(e,t){var r=t.getMeta(e);if(r?.type===P.Element){var n=e;for(var o in r.attributes)if(Object.prototype.hasOwnProperty.call(r.attributes,o)&&o.startsWith("rr_")){var i=r.attributes[o];o==="rr_scrollLeft"&&(n.scrollLeft=i),o==="rr_scrollTop"&&(n.scrollTop=i)}}}function Eo(e,t){var r=t.doc,n=t.onVisit,o=t.hackCss,i=o===void 0?!0:o,l=t.afterAppend,c=t.cache,a=t.mirror,s=a===void 0?new vt:a,u=ot(e,{doc:r,mirror:s,skipChild:!1,hackCss:i,afterAppend:l,cache:c});return No(s,function(d){n&&n(d),To(d,s)}),u}function ie(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
|
|
1
|
+
var rrweb=function(q){"use strict";var P;(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"})(P||(P={}));function tr(e){return e.nodeType===e.ELEMENT_NODE}function je(e){var t=e?.host;return Boolean(t?.shadowRoot===e)}function Ve(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}var vt=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 rr(){return new vt}function gt(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,i=e.maskInputFn,l=o||"";return(t[r.toLowerCase()]||t[n])&&(i?l=i(l):l="*".repeat(l.length)),l}var nr="__rrweb_original__";function Hn(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 i=t.getImageData,l=nr in i?i[nr]:i,c=new Uint32Array(l.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer);if(c.some(function(a){return a!==0}))return!1}return!0}function yt(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var Yn=1,Xn=new RegExp("[^a-z0-9-_:]"),Ge=-2;function Zn(){return Yn++}function Kn(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return Xn.test(t)?"div":t}function bt(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(qn).join(""):null}catch{return null}}function qn(e){var t=e.cssText;if(Jn(e))try{t=bt(e.styleSheet)||t}catch{}return t}function Jn(e){return"styleSheet"in e}function Qn(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function eo(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var xe,or,to=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ro=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,no=/^(data:)([^,]*),(.*)/i;function tt(e,t){return(e||"").replace(to,function(r,n,o,i,l,c){var a=o||l||c,s=n||i||"";if(!a)return r;if(!ro.test(a)||no.test(a))return"url(".concat(s).concat(a).concat(s,")");if(a[0]==="/")return"url(".concat(s).concat(eo(t)+a).concat(s,")");var u=t.split("/"),d=a.split("/");u.pop();for(var h=0,m=d;h<m.length;h++){var p=m[h];p!=="."&&(p===".."?u.pop():u.push(p))}return"url(".concat(s).concat(u.join("/")).concat(s,")")})}var oo=/^[^ \t\n\r\u000c]+/,io=/^[, \t\n\r\u000c]+/;function so(e,t){if(t.trim()==="")return t;var r=0;function n(s){var u,d=s.exec(t.substring(r));return d?(u=d[0],r+=u.length,u):""}for(var o=[];n(io),!(r>=t.length);){var i=n(oo);if(i.slice(-1)===",")i=rt(e,i.substring(0,i.length-1)),o.push(i);else{var l="";i=rt(e,i);for(var c=!1;;){var a=t.charAt(r);if(a===""){o.push((i+l).trim());break}else if(c)a===")"&&(c=!1);else if(a===","){r+=1,o.push((i+l).trim());break}else a==="("&&(c=!0);l+=a,r+=1}}}return o.join(", ")}function rt(e,t){if(!t||t.trim()==="")return t;var r=e.createElement("a");return r.href=t,r.href}function ao(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function St(){var e=document.createElement("a");return e.href="",e.href}function ir(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")?rt(e,n):r==="srcset"&&n?so(e,n):r==="style"&&n?tt(n,St()):t==="object"&&r==="data"&&n?rt(e,n):n}function lo(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 nt(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?nt(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?nt(e.parentNode,t,r):!1}function sr(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(nt(n,t,!0))return!0;return!!(r&&(n.matches(r)||n.closest(r)))}function co(e,t,r){var n=e.contentWindow;if(n){var o=!1,i;try{i=n.document.readyState}catch{return}if(i!=="complete"){var l=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(l),o=!0,t()});return}var c="about:blank";if(n.location.href!==c||e.src===c||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function ar(e){return e.getAttribute("href")?e.sheet!==null:!0}function lr(e,t,r){var n=!1,o;try{o=e.sheet}catch{return}if(!o){var i=setTimeout(function(){n||(t(),n=!0)},r);e.addEventListener("load",function(){clearTimeout(i),n=!0,t()})}}function uo(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector,l=t.maskTextClass,c=t.maskTextSelector,a=t.inlineStylesheet,s=t.maskInputOptions,u=s===void 0?{}:s,d=t.maskTextFn,h=t.maskInputFn,m=t.dataURLOptions,p=m===void 0?{}:m,f=t.inlineImages,y=t.recordCanvas,v=t.keepIframeSrcFn,S=t.newlyAddedElement,w=S===void 0?!1:S,b=t.enableStrictPrivacy,k=ho(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:P.Document,childNodes:[],compatMode:e.compatMode,rootId:k}:{type:P.Document,childNodes:[],rootId:k};case e.DOCUMENT_TYPE_NODE:return{type:P.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:k};case e.ELEMENT_NODE:return po(e,{doc:r,blockClass:o,blockSelector:i,inlineStylesheet:a,maskInputOptions:u,maskInputFn:h,dataURLOptions:p,inlineImages:f,recordCanvas:y,keepIframeSrcFn:v,newlyAddedElement:w,enableStrictPrivacy:b,rootId:k});case e.TEXT_NODE:return mo(e,{maskTextClass:l,maskTextSelector:c,maskTextFn:d,enableStrictPrivacy:b,rootId:k});case e.CDATA_SECTION_NODE:return{type:P.CDATA,textContent:"",rootId:k};case e.COMMENT_NODE:return{type:P.Comment,textContent:e.textContent||"",rootId:k};default:return!1}}function ho(e,t){if(t.hasNode(e)){var r=t.getId(e);return r===1?void 0:r}}function mo(e,t){var r,n=t.maskTextClass,o=t.maskTextSelector,i=t.maskTextFn,l=t.enableStrictPrivacy,c=t.rootId,a=e.parentNode&&e.parentNode.tagName,s=e.textContent,u=a==="STYLE"?!0:void 0,d=a==="SCRIPT"?!0:void 0,h=!1;if(u&&s){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(s=Qn(e.parentNode.sheet))}catch(p){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(p),e)}s=tt(s,St()),h=!0}if(d?(s="SCRIPT_PLACEHOLDER",h=!0):a==="NOSCRIPT"&&(s="",h=!0),!u&&!d&&s&&sr(e,n,o)&&(s=i?i(s):s.replace(/[\S]/g,"*")),l&&!h&&a){var m=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!m.has(a)&&s&&(s=yt(s))}return{type:P.Text,textContent:s||"",isStyle:u,rootId:c}}function po(e,t){for(var r=t.doc,n=t.blockClass,o=t.blockSelector,i=t.inlineStylesheet,l=t.maskInputOptions,c=l===void 0?{}:l,a=t.maskInputFn,s=t.dataURLOptions,u=s===void 0?{}:s,d=t.inlineImages,h=t.recordCanvas,m=t.keepIframeSrcFn,p=t.newlyAddedElement,f=p===void 0?!1:p,y=t.enableStrictPrivacy,v=t.rootId,S=lo(e,n,o),w=Kn(e),b={},k=e.attributes.length,M=0;M<k;M++){var x=e.attributes[M];b[x.name]=ir(r,w,x.name,x.value)}if(w==="link"&&i){var T=Array.from(r.styleSheets).find(function(g){return g.href===e.href}),D=null;T&&(D=bt(T)),D&&(delete b.rel,delete b.href,b._cssText=tt(D,T.href))}if(w==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var D=bt(e.sheet);D&&(b._cssText=tt(D,St()))}if(w==="input"||w==="textarea"||w==="select"){var W=e.value;b.type!=="radio"&&b.type!=="checkbox"&&b.type!=="submit"&&b.type!=="button"&&W?b.value=gt({type:b.type,tagName:w,value:W,maskInputOptions:c,maskInputFn:a}):e.checked&&(b.checked=e.checked)}if(w==="option"&&(e.selected&&!c.select?b.selected=!0:delete b.selected),w==="canvas"&&h){if(e.__context==="2d")Hn(e)||(b.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var V=e.toDataURL(u.type,u.quality),U=document.createElement("canvas");U.width=e.width,U.height=e.height;var G=U.toDataURL(u.type,u.quality);V!==G&&(b.rr_dataURL=V)}}if(w==="img"&&d){xe||(xe=r.createElement("canvas"),or=xe.getContext("2d"));var A=e,j=A.crossOrigin;A.crossOrigin="anonymous";var F=function(){try{xe.width=A.naturalWidth,xe.height=A.naturalHeight,or.drawImage(A,0,0),b.rr_dataURL=xe.toDataURL(u.type,u.quality)}catch(g){console.warn("Cannot inline img src=".concat(A.currentSrc,"! Error: ").concat(g))}j?b.crossOrigin=j:A.removeAttribute("crossorigin")};A.complete&&A.naturalWidth!==0?F():A.onload=F}if((w==="audio"||w==="video")&&(b.rr_mediaState=e.paused?"paused":"played",b.rr_mediaCurrentTime=e.currentTime),f||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop)),S||w==="img"&&y){var O=e.getBoundingClientRect(),_=O.width,N=O.height;b={class:b.class,rr_width:"".concat(_,"px"),rr_height:"".concat(N,"px")},S=!0}return w==="iframe"&&!m(b.src)&&(e.contentDocument||(b.rr_src=b.src),delete b.src),{type:P.Element,tagName:w,attributes:b,childNodes:[],isSVG:ao(e)||void 0,needBlock:S,rootId:v}}function Z(e){return e===void 0?"":e.toLowerCase()}function fo(e,t){return!!(t.comment&&e.type===P.Comment||e.type===P.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"&&(Z(e.attributes.name).match(/^msapplication-tile(image|color)$/)||Z(e.attributes.name)==="application-name"||Z(e.attributes.rel)==="icon"||Z(e.attributes.rel)==="apple-touch-icon"||Z(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&Z(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(Z(e.attributes.property).match(/^(og|twitter|fb):/)||Z(e.attributes.name).match(/^(og|twitter):/)||Z(e.attributes.name)==="pinterest")||t.headMetaRobots&&(Z(e.attributes.name)==="robots"||Z(e.attributes.name)==="googlebot"||Z(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(Z(e.attributes.name)==="author"||Z(e.attributes.name)==="generator"||Z(e.attributes.name)==="framework"||Z(e.attributes.name)==="publisher"||Z(e.attributes.name)==="progid"||Z(e.attributes.property).match(/^article:/)||Z(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(Z(e.attributes.name)==="google-site-verification"||Z(e.attributes.name)==="yandex-verification"||Z(e.attributes.name)==="csrf-token"||Z(e.attributes.name)==="p:domain_verify"||Z(e.attributes.name)==="verify-v1"||Z(e.attributes.name)==="verification"||Z(e.attributes.name)==="shopify-checkout-api-token"))))}function Ee(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector,l=t.maskTextClass,c=t.maskTextSelector,a=t.skipChild,s=a===void 0?!1:a,u=t.inlineStylesheet,d=u===void 0?!0:u,h=t.maskInputOptions,m=h===void 0?{}:h,p=t.maskTextFn,f=t.maskInputFn,y=t.slimDOMOptions,v=t.dataURLOptions,S=v===void 0?{}:v,w=t.inlineImages,b=w===void 0?!1:w,k=t.recordCanvas,M=k===void 0?!1:k,x=t.onSerialize,T=t.onIframeLoad,D=t.iframeLoadTimeout,W=D===void 0?5e3:D,V=t.onStylesheetLoad,U=t.stylesheetLoadTimeout,G=U===void 0?5e3:U,A=t.keepIframeSrcFn,j=A===void 0?function(){return!1}:A,F=t.newlyAddedElement,O=F===void 0?!1:F,_=t.enableStrictPrivacy,N=t.preserveWhiteSpace,g=N===void 0?!0:N,I=uo(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,dataURLOptions:S,inlineImages:b,recordCanvas:M,keepIframeSrcFn:j,newlyAddedElement:O,enableStrictPrivacy:_});if(!I)return console.warn(e,"not serialized"),null;var E;if(n.hasNode(e)?E=n.getId(e):fo(I,y)||!g&&I.type===P.Text&&!I.isStyle&&!I.textContent.replace(/^\s+|\s+$/gm,"").length?E=Ge:E=Zn(),E===Ge)return null;var C=Object.assign(I,{id:E});n.add(e,C),x&&x(e);var z=!s;if(C.type===P.Element){if(z=z&&!C.needBlock,C.needBlock&&C.tagName==="img"){var H=e.cloneNode();H.src="",n.add(H,C)}delete C.needBlock;var oe=e.shadowRoot;oe&&Ve(oe)&&(C.isShadowHost=!0)}if((C.type===P.Document||C.type===P.Element)&&z){y.headWhitespace&&C.type===P.Element&&C.tagName==="head"&&(g=!1);for(var B={doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:s,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:S,inlineImages:b,recordCanvas:M,preserveWhiteSpace:g,onSerialize:x,onIframeLoad:T,iframeLoadTimeout:W,onStylesheetLoad:V,stylesheetLoadTimeout:G,keepIframeSrcFn:j,enableStrictPrivacy:_},X=0,Te=Array.from(e.childNodes);X<Te.length;X++){var We=Te[X],ye=Ee(We,B);ye&&C.childNodes.push(ye)}if(tr(e)&&e.shadowRoot)for(var Ue=0,Gn=Array.from(e.shadowRoot.childNodes);Ue<Gn.length;Ue++){var We=Gn[Ue],ye=Ee(We,B);ye&&(Ve(e.shadowRoot)&&(ye.isShadow=!0),C.childNodes.push(ye))}}return e.parentNode&&je(e.parentNode)&&Ve(e.parentNode)&&(C.isShadow=!0),C.type===P.Element&&C.tagName==="iframe"&&co(e,function(){var ae=e.contentDocument;if(ae&&T){var Bn=Ee(ae,{doc:ae,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:S,inlineImages:b,recordCanvas:M,preserveWhiteSpace:g,onSerialize:x,onIframeLoad:T,iframeLoadTimeout:W,onStylesheetLoad:V,stylesheetLoadTimeout:G,keepIframeSrcFn:j,enableStrictPrivacy:_});Bn&&T(e,Bn)}},W),C.type===P.Element&&C.tagName==="link"&&C.attributes.rel==="stylesheet"&&(lr(e,function(){if(V){var ae=Ee(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:S,inlineImages:b,recordCanvas:M,preserveWhiteSpace:g,onSerialize:x,onIframeLoad:T,iframeLoadTimeout:W,onStylesheetLoad:V,stylesheetLoadTimeout:G,keepIframeSrcFn:j,enableStrictPrivacy:_});ae&&V(e,ae)}},G),ar(e)===!1)||C.type===P.Element&&C.tagName==="link"&&C.attributes.rel==="stylesheet"&&(lr(e,function(){if(V){var ae=Ee(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:S,inlineImages:b,recordCanvas:M,preserveWhiteSpace:g,onSerialize:x,onIframeLoad:T,iframeLoadTimeout:W,enableStrictPrivacy:_,onStylesheetLoad:V,stylesheetLoadTimeout:G,keepIframeSrcFn:j});ae&&V(e,ae)}},G),ar(e)===!1)?null:C}function vo(e,t){var r=t||{},n=r.mirror,o=n===void 0?new vt:n,i=r.blockClass,l=i===void 0?"highlight-block":i,c=r.blockSelector,a=c===void 0?null:c,s=r.maskTextClass,u=s===void 0?"highlight-mask":s,d=r.maskTextSelector,h=d===void 0?null:d,m=r.inlineStylesheet,p=m===void 0?!0:m,f=r.inlineImages,y=f===void 0?!1:f,v=r.recordCanvas,S=v===void 0?!1:v,w=r.maskAllInputs,b=w===void 0?!1:w,k=r.maskTextFn,M=r.maskInputFn,x=r.slimDOM,T=x===void 0?!1:x,D=r.dataURLOptions,W=r.preserveWhiteSpace,V=r.onSerialize,U=r.onIframeLoad,G=r.iframeLoadTimeout,A=r.onStylesheetLoad,j=r.stylesheetLoadTimeout,F=r.keepIframeSrcFn,O=F===void 0?function(){return!1}:F,_=r.enableStrictPrivacy,N=_===void 0?!1:_,g=b===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:b===!1?{password:!0}:b,I=T===!0||T==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:T==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:T===!1?{}:T;return Ee(e,{doc:e,mirror:o,blockClass:l,blockSelector:a,maskTextClass:u,maskTextSelector:h,skipChild:!1,inlineStylesheet:p,maskInputOptions:g,maskTextFn:k,maskInputFn:M,slimDOMOptions:I,dataURLOptions:D,inlineImages:y,recordCanvas:S,preserveWhiteSpace:W,onSerialize:V,onIframeLoad:U,iframeLoadTimeout:G,onStylesheetLoad:A,stylesheetLoadTimeout:j,keepIframeSrcFn:O,newlyAddedElement:!1,enableStrictPrivacy:N})}var cr=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function go(e,t){t===void 0&&(t={});var r=1,n=1;function o(N){var g=N.match(/\n/g);g&&(r+=g.length);var I=N.lastIndexOf(`
|
|
2
|
+
`);n=I===-1?n+N.length:N.length-I}function i(){var N={line:r,column:n};return function(g){return g.position=new l(N),p(),g}}var l=function(){function N(g){this.start=g,this.end={line:r,column:n},this.source=t.source}return N}();l.prototype.content=e;var c=[];function a(N){var g=new Error("".concat(t.source||"",":").concat(r,":").concat(n,": ").concat(N));if(g.reason=N,g.filename=t.source,g.line=r,g.column=n,g.source=e,t.silent)c.push(g);else throw g}function s(){var N=h();return{type:"stylesheet",stylesheet:{source:t.source,rules:N,parsingErrors:c}}}function u(){return m(/^{\s*/)}function d(){return m(/^}/)}function h(){var N,g=[];for(p(),f(g);e.length&&e.charAt(0)!=="}"&&(N=O()||_());)N!==!1&&(g.push(N),f(g));return g}function m(N){var g=N.exec(e);if(g){var I=g[0];return o(I),e=e.slice(I.length),g}}function p(){m(/^\s*/)}function f(N){N===void 0&&(N=[]);for(var g;g=y();)g!==!1&&N.push(g),g=y();return N}function y(){var N=i();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var g=2;e.charAt(g)!==""&&(e.charAt(g)!=="*"||e.charAt(g+1)!=="/");)++g;if(g+=2,e.charAt(g-1)==="")return a("End of comment missing");var I=e.slice(2,g-2);return n+=2,o(I),e=e.slice(g),n+=2,N({type:"comment",comment:I})}}function v(){var N=m(/^([^{]+)/);if(N)return fe(N[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(g){return g.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(g){return g.replace(/\u200C/g,",")})}function S(){var N=i(),g=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(g){var I=fe(g[0]);if(!m(/^:\s*/))return a("property missing ':'");var E=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),C=N({type:"declaration",property:I.replace(cr,""),value:E?fe(E[0]).replace(cr,""):""});return m(/^[;\s]*/),C}}function w(){var N=[];if(!u())return a("missing '{'");f(N);for(var g;g=S();)g!==!1&&(N.push(g),f(N)),g=S();return d()?N:a("missing '}'")}function b(){for(var N,g=[],I=i();N=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)g.push(N[1]),m(/^,\s*/);if(g.length)return I({type:"keyframe",values:g,declarations:w()})}function k(){var N=i(),g=m(/^@([-\w]+)?keyframes\s*/);if(g){var I=g[1];if(g=m(/^([-\w]+)\s*/),!g)return a("@keyframes missing name");var E=g[1];if(!u())return a("@keyframes missing '{'");for(var C,z=f();C=b();)z.push(C),z=z.concat(f());return d()?N({type:"keyframes",name:E,vendor:I,keyframes:z}):a("@keyframes missing '}'")}}function M(){var N=i(),g=m(/^@supports *([^{]+)/);if(g){var I=fe(g[1]);if(!u())return a("@supports missing '{'");var E=f().concat(h());return d()?N({type:"supports",supports:I,rules:E}):a("@supports missing '}'")}}function x(){var N=i(),g=m(/^@host\s*/);if(g){if(!u())return a("@host missing '{'");var I=f().concat(h());return d()?N({type:"host",rules:I}):a("@host missing '}'")}}function T(){var N=i(),g=m(/^@media *([^{]+)/);if(g){var I=fe(g[1]);if(!u())return a("@media missing '{'");var E=f().concat(h());return d()?N({type:"media",media:I,rules:E}):a("@media missing '}'")}}function D(){var N=i(),g=m(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(g)return N({type:"custom-media",name:fe(g[1]),media:fe(g[2])})}function W(){var N=i(),g=m(/^@page */);if(g){var I=v()||[];if(!u())return a("@page missing '{'");for(var E=f(),C;C=S();)E.push(C),E=E.concat(f());return d()?N({type:"page",selectors:I,declarations:E}):a("@page missing '}'")}}function V(){var N=i(),g=m(/^@([-\w]+)?document *([^{]+)/);if(g){var I=fe(g[1]),E=fe(g[2]);if(!u())return a("@document missing '{'");var C=f().concat(h());return d()?N({type:"document",document:E,vendor:I,rules:C}):a("@document missing '}'")}}function U(){var N=i(),g=m(/^@font-face\s*/);if(g){if(!u())return a("@font-face missing '{'");for(var I=f(),E;E=S();)I.push(E),I=I.concat(f());return d()?N({type:"font-face",declarations:I}):a("@font-face missing '}'")}}var G=F("import"),A=F("charset"),j=F("namespace");function F(N){var g=new RegExp("^@"+N+"\\s*([^;]+);");return function(){var I=i(),E=m(g);if(E){var C={type:N};return C[N]=E[1].trim(),I(C)}}}function O(){if(e[0]==="@")return k()||T()||D()||M()||G()||A()||j()||V()||W()||x()||U()}function _(){var N=i(),g=v();return g?(f(),N({type:"rule",selectors:g,declarations:w()})):a("selector missing")}return wt(s())}function fe(e){return e?e.replace(/^\s+|\s+$/g,""):""}function wt(e,t){for(var r=e&&typeof e.type=="string",n=r?e:t,o=0,i=Object.keys(e);o<i.length;o++){var l=i[o],c=e[l];Array.isArray(c)?c.forEach(function(a){wt(a,n)}):c&&typeof c=="object"&&wt(c,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var ur={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function yo(e){var t=ur[e.tagName]?ur[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function bo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var dr=/([^\\]):hover/,So=new RegExp(dr.source,"g");function hr(e,t){var r;if(!(!((r=window?.HIG_CONFIGURATION)===null||r===void 0)&&r.enableOnHoverClass))return e;var n=t?.stylesWithHoverClass.get(e);if(n)return n;var o=go(e,{silent:!0});if(!o.stylesheet)return e;var i=[];if(o.stylesheet.rules.forEach(function(a){"selectors"in a&&(a.selectors||[]).forEach(function(s){dr.test(s)&&i.push(s)})}),i.length===0)return e;var l=new RegExp(i.filter(function(a,s){return i.indexOf(a)===s}).sort(function(a,s){return s.length-a.length}).map(function(a){return bo(a)}).join("|"),"g"),c=e.replace(l,function(a){var s=a.replace(So,"$1.\\:hover");return"".concat(a,", ").concat(s)});return t?.stylesWithHoverClass.set(e,c),c}function mr(){var e=new Map;return{stylesWithHoverClass:e}}function wo(e,t){var r=t.doc,n=t.hackCss,o=t.cache;switch(e.type){case P.Document:return r.implementation.createDocument(null,"",null);case P.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case P.Element:{var i=yo(e),l;e.isSVG?l=r.createElementNS("http://www.w3.org/2000/svg",i):l=r.createElement(i);var c=function(d){if(!Object.prototype.hasOwnProperty.call(e.attributes,d))return"continue";var h=e.attributes[d];if(i==="option"&&d==="selected"&&h===!1)return"continue";if(h=typeof h=="boolean"||typeof h=="number"?"":h,d.startsWith("rr_")){if(i==="canvas"&&d==="rr_dataURL"){var m=document.createElement("img");m.onload=function(){var D=l.getContext("2d");D&&D.drawImage(m,0,0,m.width,m.height)},m.src=h,l.RRNodeType&&(l.rr_dataURL=h)}else if(i==="img"&&d==="rr_dataURL"){var p=l;p.currentSrc.startsWith("data:")||(p.setAttribute("rrweb-original-src",e.attributes.src),p.src=h,p.setAttribute("rrweb-inline-src",h))}if(d==="rr_width")l.style.width=h;else if(d==="rr_height")l.style.height=h;else if(d==="rr_mediaCurrentTime")l.currentTime=e.attributes.rr_mediaCurrentTime;else if(d==="rr_mediaState")switch(h){case"played":l.play().catch(function(D){return console.warn("media playback error",D)});break;case"paused":l.pause();break}}else{var f=i==="textarea"&&d==="value",y=i==="style"&&d==="_cssText";if(y&&n&&(h=hr(h,o),typeof h=="string")){for(var v=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,S=void 0,w=[],b="https://replay-cors-proxy.highlightrun.workers.dev";(S=v.exec(h))!==null;)S.index===v.lastIndex&&v.lastIndex++,S.forEach(function(D,W){if(W===0){var V=D.slice(5,D.length-2);w.push({originalUrl:V,proxyUrl:V.replace(V,"".concat(b,"?url=").concat(V))})}});w.forEach(function(D){h=h.replace(D.originalUrl,D.proxyUrl)})}if(f||y){for(var k=r.createTextNode(h),M=0,x=Array.from(l.childNodes);M<x.length;M++){var T=x[M];T.nodeType===l.TEXT_NODE&&l.removeChild(T)}return l.appendChild(k),"continue"}try{if(e.isSVG&&d==="xlink:href")l.setAttributeNS("http://www.w3.org/1999/xlink",d,h);else if(d==="onload"||d==="onclick"||d.substring(0,7)==="onmouse")l.setAttribute("_"+d,h);else{if(i==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&d==="content")return l.setAttribute("csp-content",h),"continue";i==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||i==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")||(i==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?l.setAttribute("rrweb-original-srcset",e.attributes.srcset):l.setAttribute(d,h))}}catch{}}};for(var a in e.attributes)c(a);if(i==="img"){var s=l;if(!s.currentSrc.startsWith("data:")){var u=s.getAttribute("rrweb-inline-src");u!=null&&u.startsWith("data:")&&(s.src=u)}}if(e.isShadowHost)if(!l.shadowRoot)l.attachShadow({mode:"open"});else for(;l.shadowRoot.firstChild;)l.shadowRoot.removeChild(l.shadowRoot.firstChild);return l}case P.Text:return r.createTextNode(e.isStyle&&n?hr(e.textContent,o):e.textContent);case P.CDATA:return r.createCDATASection(e.textContent);case P.Comment:return r.createComment(e.textContent);default:return null}}function ot(e,t){var r=t.doc,n=t.mirror,o=t.skipChild,i=o===void 0?!1:o,l=t.hackCss,c=l===void 0?!0:l,a=t.afterAppend,s=t.cache,u=wo(e,{doc:r,hackCss:c,cache:s});if(!u)return null;if(e.rootId&&console.assert(n.getNode(e.rootId)===r,"Target document should have the same root id."),e.type===P.Document&&(r.close(),r.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==P.DocumentType&&(e.childNodes[0].type===P.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=r),n.add(u,e),(e.type===P.Document||e.type===P.Element)&&!i)for(var d=0,h=e.childNodes;d<h.length;d++){var m=h[d],p=ot(m,{doc:r,mirror:n,skipChild:!1,hackCss:c,afterAppend:a,cache:s});if(!p){console.warn("Failed to rebuild",m);continue}m.isShadow&&tr(u)&&u.shadowRoot?u.shadowRoot.appendChild(p):u.appendChild(p),a&&a(p)}return u}function No(e,t){function r(l){t(l)}for(var n=0,o=e.getIds();n<o.length;n++){var i=o[n];e.has(i)&&r(e.getNode(i))}}function To(e,t){var r=t.getMeta(e);if(r?.type===P.Element){var n=e;for(var o in r.attributes)if(Object.prototype.hasOwnProperty.call(r.attributes,o)&&o.startsWith("rr_")){var i=r.attributes[o];o==="rr_scrollLeft"&&(n.scrollLeft=i),o==="rr_scrollTop"&&(n.scrollTop=i)}}}function Eo(e,t){var r=t.doc,n=t.onVisit,o=t.hackCss,i=o===void 0?!0:o,l=t.afterAppend,c=t.cache,a=t.mirror,s=a===void 0?new vt:a,u=ot(e,{doc:r,mirror:s,skipChild:!1,hackCss:i,afterAppend:l,cache:c});return No(s,function(d){n&&n(d),To(d,s)}),u}function ie(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
|
|
3
3
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
4
|
-
or you can use record.mirror to access the mirror instance during recording.`;q.mirror={map:{},getId(){return console.error(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&&(q.mirror=new Proxy(q.mirror,{get(e,t,r){return t==="map"&&console.error(Oe),Reflect.get(e,t,r)}}));function Re(e,t,r={}){let n=null,o=0;return function(...i){const l=Date.now();!o&&r.leading===!1&&(o=l);const c=t-(l-o),a=this;c<=0||c>t?(n&&(clearTimeout(n),n=null),o=l,e.apply(a,i)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(a,i)},c))}}function Be(e,t,r,n,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(l){setTimeout(()=>{r.set.call(this,l)},0),i&&i.set&&i.set.call(this,l)}}),()=>Be(e,t,i||{},!0)}function be(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 wt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Nt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}const pr=e=>{try{if(e instanceof HTMLElement)return e.tagName==="CANVAS"}catch{return!1}return!1};function se(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(nt(n,t,r))return!0;return!1}function fr(e,t){return t.getId(e)!==-1}function it(e,t){return t.getId(e)===Ge}function Tt(e,t){if(je(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?Tt(e.parentNode,t):!0:!0}function Et(e){return Boolean(e.changedTouches)}function Ct(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 vr(e){const t={},r=(o,i)=>{const l={value:o,parent:i,children:[]};return t[o.node.id]=l,l},n=[];for(const o of e){const{nextId:i,parentId:l}=o;if(i&&i in t){const c=t[i];if(c.parent){const a=c.parent.children.indexOf(c);c.parent.children.splice(a,0,r(o,c.parent))}else{const a=n.indexOf(c);n.splice(a,0,r(o,null))}continue}if(l in t){const c=t[l];c.children.push(r(o,c));continue}n.push(r(o,null))}return n}function It(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)It(e.children[r],t)}function De(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function kt(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Mt(e,t){var r,n;const o=(n=(r=e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:n.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const i=o.getBoundingClientRect(),l=Mt(o,t),c=i.height/o.clientHeight;return{x:i.x*l.relativeScale+l.x,y:i.y*l.relativeScale+l.y,relativeScale:c,absoluteScale:l.absoluteScale*c}}function ze(e){return Boolean(e?.shadowRoot)}function Le(e,t){const r=e[t[0]];return t.length===1?r:Le(r.cssRules[t[1]].cssRules,t.slice(2))}function xt(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function gr(e){const t=new Set,r=[];for(let n=e.length;n--;){const o=e[n];t.has(o.id)||(r.push(o),t.add(o.id))}return r}var Co=Object.freeze({__proto__:null,on:ie,get _mirror(){return q.mirror},throttle:Re,hookSetter:Be,patch:be,getWindowHeight:wt,getWindowWidth:Nt,isCanvasNode:pr,isBlocked:se,isSerialized:fr,isIgnored:it,isAncestorRemoved:Tt,isTouchEvent:Et,polyfill:Ct,queueToResolveTrees:vr,iterateResolveTree:It,isSerializedIframe:De,isSerializedStylesheet:kt,getBaseDimension:Mt,hasShadowRoot:ze,getNestedRule:Le,getPositionsAndIndex:xt,uniqueTextMutations:gr}),R=(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))(R||{}),L=(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))(L||{}),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||{}),ve=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ve||{}),Ce=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(Ce||{}),Y=(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))(Y||{});function yr(e){return"__ln"in e}class Io{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&&yr(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&&yr(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 br=(e,t)=>`${e}@${t}`;class ko{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 Io,n=c=>{let a=c,s=Ge;for(;s===Ge;)a=a&&a.nextSibling,s=a&&this.mirror.getId(a);return s},o=c=>{var a,s,u,d,h;const m=c.getRootNode?(a=c.getRootNode())==null?void 0:a.host:null;let p=m;for(;(u=(s=p?.getRootNode)==null?void 0:s.call(p))!=null&&u.host;)p=((h=(d=p?.getRootNode)==null?void 0:d.call(p))==null?void 0:h.host)||null;const f=!this.doc.contains(c)&&(!p||!this.doc.contains(p));if(!c.parentNode||f)return;const y=je(c.parentNode)?this.mirror.getId(m):this.mirror.getId(c.parentNode),v=n(c);if(y===-1||v===-1)return r.addNode(c);const S=Ee(c,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,enableStrictPrivacy:this.enableStrictPrivacy,onSerialize:w=>{De(w,this.mirror)&&this.iframeManager.addIframe(w),kt(w,this.mirror)&&this.stylesheetManager.addStylesheet(w),ze(c)&&this.shadowDomManager.addShadowRoot(c.shadowRoot,document)},onIframeLoad:(w,b)=>{this.iframeManager.attachIframe(w,b,this.mirror),this.shadowDomManager.observeAttachShadow(w)},onStylesheetLoad:(w,b)=>{this.stylesheetManager.attachStylesheet(w,b,this.mirror)}});S&&t.push({parentId:y,nextId:v,node:S})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const c of Array.from(this.movedSet.values()))Sr(this.removes,c,this.mirror)&&!this.movedSet.has(c.parentNode)||o(c);for(const c of Array.from(this.addedSet.values()))!Nr(this.droppedSet,c)&&!Sr(this.removes,c,this.mirror)||Nr(this.movedSet,c)?o(c):this.droppedSet.add(c);let i=null;for(;r.length;){let c=null;if(i){const a=this.mirror.getId(i.value.parentNode),s=n(i.value);a!==-1&&s!==-1&&(c=i)}if(!c)for(let a=r.length-1;a>=0;a--){const s=r.get(a);if(s){const u=this.mirror.getId(s.value.parentNode),d=n(s.value);if(u!==-1&&d!==-1){c=s;break}}}if(!c){for(;r.head;)r.removeNode(r.head.value);break}i=c.previous,r.removeNode(c.value),o(c.value)}const l={texts:this.texts.map(c=>{let a=c.value;return this.enableStrictPrivacy&&a&&(a=nr(a)),{id:this.mirror.getId(c.node),value:a}}).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>({id:this.mirror.getId(c.node),attributes:c.attributes})).filter(c=>this.mirror.has(c.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(!it(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!se(t.target,this.blockClass,!1)&&r!==t.oldValue&&this.texts.push({value:sr(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=gt({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),se(t.target,this.blockClass,!1)||n===t.oldValue)return;let o=this.attributes.find(i=>i.node===t.target);if(r.tagName==="IFRAME"&&t.attributeName==="src"&&!this.keepIframeSrcFn(n))if(!r.contentDocument)t.attributeName="rr_src";else return;if(o||(o={node:t.target,attributes:{}},this.attributes.push(o)),t.attributeName==="style"){const i=this.doc.createElement("span");t.oldValue&&i.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});const l=o.attributes.style;for(const c of Array.from(r.style)){const a=r.style.getPropertyValue(c),s=r.style.getPropertyPriority(c);(a!==i.style.getPropertyValue(c)||s!==i.style.getPropertyPriority(c))&&(s===""?l[c]=a:l[c]=[a,s])}for(const c of Array.from(i.style))r.style.getPropertyValue(c)===""&&(l[c]=!1)}else{if(t.target.tagName==="INPUT"){const i=t.target;if(i.type==="password"){o.attributes.value="*".repeat(i.value.length);break}}o.attributes[t.attributeName]=ir(this.doc,r.tagName,t.attributeName,n)}break}case"childList":{if(se(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=je(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);se(t.target,this.blockClass,!1)||it(r,this.mirror)||!fr(r,this.mirror)||(this.addedSet.has(r)?(Ot(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||Tt(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[br(n,o)]?Ot(this.movedSet,r):this.removes.push({parentId:o,id:n,isShadow:je(t.target)&&Ve(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(this.mirror.hasNode(t)){if(it(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[br(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);se(t,this.blockClass,!1)||t.childNodes.forEach(n=>this.genAdds(n))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","enableStrictPrivacy"].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 Ot(e,t){e.delete(t),t.childNodes.forEach(r=>Ot(e,r))}function Sr(e,t,r){return e.length===0?!1:wr(e,t,r)}function wr(e,t,r){const{parentNode:n}=t;if(!n)return!1;const o=r.getId(n);return e.some(i=>i.id===o)?!0:wr(e,n,r)}function Nr(e,t){return e.size===0?!1:Tr(e,t)}function Tr(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:Tr(e,r):!1}var Mo=Object.defineProperty,xo=Object.defineProperties,Oo=Object.getOwnPropertyDescriptors,Er=Object.getOwnPropertySymbols,Ro=Object.prototype.hasOwnProperty,Do=Object.prototype.propertyIsEnumerable,Cr=(e,t,r)=>t in e?Mo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ir=(e,t)=>{for(var r in t||(t={}))Ro.call(t,r)&&Cr(e,r,t[r]);if(Er)for(var r of Er(t))Do.call(t,r)&&Cr(e,r,t[r]);return e},Lo=(e,t)=>xo(e,Oo(t));const Ie=[],kr=typeof CSSGroupingRule<"u",Mr=typeof CSSMediaRule<"u",xr=typeof CSSSupportsRule<"u",Or=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 Rr(e,t){var r,n;const o=new ko;Ie.push(o),o.init(e);let i=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]&&(i=window[l]);const c=new i(o.processMutations.bind(o));return c.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),c}function Ao({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let l=[],c;const a=Re(d=>{const h=Date.now()-c;e(l.map(m=>(m.timeOffset-=h,m)),d),l=[],c=null},i),s=Re(d=>{const h=He(d),{clientX:m,clientY:p}=Et(d)?d.changedTouches[0]:d;c||(c=Date.now()),l.push({x:m,y:p,id:n.getId(h),timeOffset:Date.now()-c}),a(typeof DragEvent<"u"&&d instanceof DragEvent?L.Drag:d instanceof MouseEvent?L.MouseMove:L.TouchMove)},o,{trailing:!1}),u=[ie("mousemove",s,r),ie("touchmove",s,r),ie("drag",s,r)];return()=>{u.forEach(d=>d())}}function Fo({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const i=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[],c=a=>s=>{const u=He(s);if(se(u,n,!0)||pr(u))return;const d=Et(s)?s.changedTouches[0]:s;if(!d)return;const h=r.getId(u),{clientX:m,clientY:p}=d;e({type:ee[a],id:h,x:m,y:p})};return Object.keys(ee).filter(a=>Number.isNaN(Number(a))&&!a.endsWith("_Departed")&&i[a]!==!1).forEach(a=>{const s=a.toLowerCase(),u=c(a);l.push(ie(s,u,t))}),()=>{l.forEach(a=>a())}}function Dr({scrollCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){const i=Re(l=>{const c=He(l);if(!c||se(c,n,!0))return;const a=r.getId(c);if(c===t){const s=t.scrollingElement||t.documentElement;e({id:a,x:s.scrollLeft,y:s.scrollTop})}else e({id:a,x:c.scrollLeft,y:c.scrollTop})},o.scroll||100);return ie("scroll",i,t)}function Po({viewportResizeCb:e}){let t=-1,r=-1;const n=Re(()=>{const o=wt(),i=Nt();(t!==o||r!==i)&&(e({width:Number(i),height:Number(o)}),t=o,r=i)},200);return ie("resize",n,window)}function Lr(e,t){const r=Ir({},e);return t||delete r.userTriggered,r}const _o=["INPUT","TEXTAREA","SELECT"],Ar=new WeakMap;function $o({inputCb:e,doc:t,mirror:r,blockClass:n,ignoreClass:o,maskInputOptions:i,maskInputFn:l,sampling:c,userTriggeredOnInput:a}){function s(p){let f=He(p);const y=p.isTrusted;if(f&&f.tagName==="OPTION"&&(f=f.parentElement),!f||!f.tagName||_o.indexOf(f.tagName)<0||se(f,n,!0))return;const v=f.type;if(f.classList.contains(o))return;let S=f.value,w=!1;v==="radio"||v==="checkbox"?w=f.checked:(i[f.tagName.toLowerCase()]||i[v])&&(S=gt({maskInputOptions:i,tagName:f.tagName,type:v,value:S,maskInputFn:l})),u(f,Lr({text:S,isChecked:w,userTriggered:y},a));const b=f.name;v==="radio"&&b&&w&&t.querySelectorAll(`input[type="radio"][name="${b}"]`).forEach(k=>{k!==f&&u(k,Lr({text:k.value,isChecked:!w,userTriggered:!1},a))})}function u(p,f){const y=Ar.get(p);if(!y||y.text!==f.text||y.isChecked!==f.isChecked){Ar.set(p,f);const v=r.getId(p);e(Lo(Ir({},f),{id:v}))}}const d=(c.input==="last"?["change"]:["input","change"]).map(p=>ie(p,s,t)),h=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),m=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return h&&h.set&&d.push(...m.map(p=>Be(p[0],p[1],{set(){s({target:this})}}))),()=>{d.forEach(p=>p())}}function st(e){const t=[];function r(n,o){if(kr&&n.parentRule instanceof CSSGroupingRule||Mr&&n.parentRule instanceof CSSMediaRule||xr&&n.parentRule instanceof CSSSupportsRule||Or&&n.parentRule instanceof CSSConditionRule){const i=Array.from(n.parentRule.cssRules).indexOf(n);o.unshift(i)}else{const i=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(i)}return o}return r(e,t)}function Wo({styleSheetRuleCb:e,mirror:t},{win:r}){const n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(c,a){const s=t.getId(this.ownerNode);return s!==-1&&e({id:s,adds:[{rule:c,index:a}]}),n.apply(this,[c,a])};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=function(c){const a=t.getId(this.ownerNode);return a!==-1&&e({id:a,removes:[{index:c}]}),o.apply(this,[c])};const i={};kr?i.CSSGroupingRule=r.CSSGroupingRule:(Mr&&(i.CSSMediaRule=r.CSSMediaRule),Or&&(i.CSSConditionRule=r.CSSConditionRule),xr&&(i.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(i).forEach(([c,a])=>{l[c]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=function(s,u){const d=t.getId(this.parentStyleSheet.ownerNode);return d!==-1&&e({id:d,adds:[{rule:s,index:[...st(this),u||0]}]}),l[c].insertRule.apply(this,[s,u])},a.prototype.deleteRule=function(s){const u=t.getId(this.parentStyleSheet.ownerNode);return u!==-1&&e({id:u,removes:[{index:[...st(this),s]}]}),l[c].deleteRule.apply(this,[s])}}),()=>{r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=o,Object.entries(i).forEach(([c,a])=>{a.prototype.insertRule=l[c].insertRule,a.prototype.deleteRule=l[c].deleteRule})}}function Uo({styleDeclarationCb:e,mirror:t},{win:r}){const n=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=function(i,l,c){var a,s;const u=t.getId((s=(a=this.parentRule)==null?void 0:a.parentStyleSheet)==null?void 0:s.ownerNode);return u!==-1&&e({id:u,set:{property:i,value:l,priority:c},index:st(this.parentRule)}),n.apply(this,[i,l,c])};const o=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=function(i){var l,c;const a=t.getId((c=(l=this.parentRule)==null?void 0:l.parentStyleSheet)==null?void 0:c.ownerNode);return a!==-1&&e({id:a,remove:{property:i},index:st(this.parentRule)}),o.apply(this,[i])},()=>{r.CSSStyleDeclaration.prototype.setProperty=n,r.CSSStyleDeclaration.prototype.removeProperty=o}}function jo({mediaInteractionCb:e,blockClass:t,mirror:r,sampling:n}){const o=l=>Re(c=>{const a=He(c);if(!a||se(a,t,!0))return;const{currentTime:s,volume:u,muted:d}=a;e({type:l,id:r.getId(a),currentTime:s,volume:u,muted:d})},n.media||500),i=[ie("play",o(Ce.Play)),ie("pause",o(Ce.Pause)),ie("seeked",o(Ce.Seeked)),ie("volumechange",o(Ce.VolumeChange))];return()=>{i.forEach(l=>l())}}function Vo({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,i=r.FontFace;r.FontFace=function(c,a,s){const u=new i(c,a,s);return o.set(u,{family:c,buffer:typeof a!="string",descriptors:s,fontSource:typeof a=="string"?a:JSON.stringify(Array.from(new Uint8Array(a)))}),u};const l=be(t.fonts,"add",function(c){return function(a){return setTimeout(()=>{const s=o.get(a);s&&(e(s),o.delete(a))},0),c.apply(this,[a])}});return n.push(()=>{r.FontFace=i}),n.push(l),()=>{n.forEach(c=>c())}}function Go(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:l,inputCb:c,mediaInteractionCb:a,styleSheetRuleCb:s,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h}=e;e.mutationCb=(...m)=>{t.mutation&&t.mutation(...m),r(...m)},e.mousemoveCb=(...m)=>{t.mousemove&&t.mousemove(...m),n(...m)},e.mouseInteractionCb=(...m)=>{t.mouseInteraction&&t.mouseInteraction(...m),o(...m)},e.scrollCb=(...m)=>{t.scroll&&t.scroll(...m),i(...m)},e.viewportResizeCb=(...m)=>{t.viewportResize&&t.viewportResize(...m),l(...m)},e.inputCb=(...m)=>{t.input&&t.input(...m),c(...m)},e.mediaInteractionCb=(...m)=>{t.mediaInteaction&&t.mediaInteaction(...m),a(...m)},e.styleSheetRuleCb=(...m)=>{t.styleSheetRule&&t.styleSheetRule(...m),s(...m)},e.styleDeclarationCb=(...m)=>{t.styleDeclaration&&t.styleDeclaration(...m),u(...m)},e.canvasMutationCb=(...m)=>{t.canvasMutation&&t.canvasMutation(...m),d(...m)},e.fontCb=(...m)=>{t.font&&t.font(...m),h(...m)}}function Bo(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};Go(e,t);const n=Rr(e,e.doc),o=Ao(e),i=Fo(e),l=Dr(e),c=Po(e),a=$o(e),s=jo(e),u=Wo(e,{win:r}),d=Uo(e,{win:r}),h=e.collectFonts?Vo(e):()=>{},m=[];for(const p of e.plugins)m.push(p.observer(p.callback,r,p.options));return()=>{Ie.forEach(p=>p.reset()),n.disconnect(),o(),i(),l(),c(),a(),s(),u(),d(),h(),m.forEach(p=>p())}}class zo{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 Ho=Object.defineProperty,Yo=Object.defineProperties,Xo=Object.getOwnPropertyDescriptors,Fr=Object.getOwnPropertySymbols,Zo=Object.prototype.hasOwnProperty,Ko=Object.prototype.propertyIsEnumerable,Pr=(e,t,r)=>t in e?Ho(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_r=(e,t)=>{for(var r in t||(t={}))Zo.call(t,r)&&Pr(e,r,t[r]);if(Fr)for(var r of Fr(t))Ko.call(t,r)&&Pr(e,r,t[r]);return e},$r=(e,t)=>Yo(e,Xo(t));class qo{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(be(HTMLElement.prototype,"attachShadow",function(n){return function(o){const i=n.call(this,o);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),i}}))}addShadowRoot(t,r){!Ve(t)||(Rr($r(_r({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),Dr($r(_r({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})))}observeAttachShadow(t){if(t.contentWindow){const r=this;this.restorePatches.push(be(t.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(o){const i=n.call(this,o);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,t.contentDocument),i}}))}}reset(){this.restorePatches.forEach(t=>t())}}for(var Ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ye=typeof Uint8Array>"u"?[]:new Uint8Array(256),at=0;at<Ae.length;at++)Ye[Ae.charCodeAt(at)]=at;var Jo=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=Ae[t[r]>>2],o+=Ae[(t[r]&3)<<4|t[r+1]>>4],o+=Ae[(t[r+1]&15)<<2|t[r+2]>>6],o+=Ae[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},Qo=function(e){var t=e.length*.75,r=e.length,n,o=0,i,l,c,a;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var s=new ArrayBuffer(t),u=new Uint8Array(s);for(n=0;n<r;n+=4)i=Ye[e.charCodeAt(n)],l=Ye[e.charCodeAt(n+1)],c=Ye[e.charCodeAt(n+2)],a=Ye[e.charCodeAt(n+3)],u[o++]=i<<2|l>>4,u[o++]=(l&15)<<4|c>>2,u[o++]=(c&3)<<6|a&63;return s};const Wr=new Map;function ei(e,t){let r=Wr.get(e);return r||(r=new Map,Wr.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const Ur=(e,t,r)=>{if(!e||!(Vr(e,t)||typeof e=="object"))return;const n=e.constructor.name,o=ei(r,n);let i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function lt(e,t,r){if(e instanceof Array)return e.map(n=>lt(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=Jo(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[lt(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:[lt(e.data,t,r),e.width,e.height]};if(Vr(e,t)||typeof e=="object"){const n=e.constructor.name,o=Ur(e,t,r);return{rr_type:n,index:o}}}}return e}const jr=(e,t,r)=>[...e].map(n=>lt(n,t,r)),Vr=(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 ti(e,t,r,n){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const l of i)try{if(typeof t.CanvasRenderingContext2D.prototype[l]!="function")continue;const c=be(t.CanvasRenderingContext2D.prototype,l,function(a){return function(...s){return se(this.canvas,r,!0)||setTimeout(()=>{const u=jr([...s],t,this);e(this.canvas,{type:ve["2D"],property:l,args:u})},0),a.apply(this,s)}});o.push(c)}catch{const a=Be(t.CanvasRenderingContext2D.prototype,l,{set(s){e(this.canvas,{type:ve["2D"],property:l,args:[s],setter:!0})}});o.push(a)}return()=>{o.forEach(l=>l())}}function Gr(e,t){const r=[];try{const n=be(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(i,...l){return se(this,t,!0)||"__context"in this||(this.__context=i),o.apply(this,[i,...l])}});r.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(n=>n())}}function Br(e,t,r,n,o,i){const l=[],c=Object.getOwnPropertyNames(e);for(const a of c)try{if(typeof e[a]!="function")continue;const s=be(e,a,function(u){return function(...d){const h=u.apply(this,d);if(Ur(h,i,e),!se(this.canvas,n,!0)){const m=jr([...d],i,e),p={type:t,property:a,args:m};r(this.canvas,p)}return h}});l.push(s)}catch{const u=Be(e,a,{set(d){r(this.canvas,{type:t,property:a,args:[d],setter:!0})}});l.push(u)}return l}function ri(e,t,r,n){const o=[];return o.push(...Br(t.WebGLRenderingContext.prototype,ve.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...Br(t.WebGL2RenderingContext.prototype,ve.WebGL2,e,r,n,t)),()=>{o.forEach(i=>i())}}function ni(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),o=0,i=r.length;o<i;++o)n[o]=r.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}function oi(e,t,r){var n=t===void 0?null:t,o=r===void 0?!1:r,i=ni(e,o),l=i.indexOf(`
|
|
5
|
-
`,10)+1,c=i.substring(l)+(n?"//# sourceMappingURL="+n:""),a=new Blob([c],{type:"application/javascript"});return URL.createObjectURL(a)}function ii(e,t,r){var n;return function(i){return n=n||oi(e,t,r),new Worker(n,i)}}var si=ii("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Zm9yKHZhciByPSJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvIixsPXR5cGVvZiBVaW50OEFycmF5PiJ1Ij9bXTpuZXcgVWludDhBcnJheSgyNTYpLGY9MDtmPHIubGVuZ3RoO2YrKylsW3IuY2hhckNvZGVBdChmKV09Zjt2YXIgZD1mdW5jdGlvbihzKXt2YXIgZT1uZXcgVWludDhBcnJheShzKSxuLGE9ZS5sZW5ndGgsdD0iIjtmb3Iobj0wO248YTtuKz0zKXQrPXJbZVtuXT4+Ml0sdCs9clsoZVtuXSYzKTw8NHxlW24rMV0+PjRdLHQrPXJbKGVbbisxXSYxNSk8PDJ8ZVtuKzJdPj42XSx0Kz1yW2VbbisyXSY2M107cmV0dXJuIGElMz09PTI/dD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTEpKyI9IjphJTM9PT0xJiYodD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTIpKyI9PSIpLHR9O2NvbnN0IGM9bmV3IE1hcCx1PW5ldyBNYXA7YXN5bmMgZnVuY3Rpb24gcChzLGUpe2NvbnN0IG49YCR7c30tJHtlfWA7aWYodS5oYXMobikpcmV0dXJuIHUuZ2V0KG4pO2NvbnN0IGE9bmV3IE9mZnNjcmVlbkNhbnZhcyhzLGUpO2EuZ2V0Q29udGV4dCgiMmQiKTtjb25zdCB0PWF3YWl0KGF3YWl0IGEuY29udmVydFRvQmxvYigpKS5hcnJheUJ1ZmZlcigpLGc9ZCh0KTtyZXR1cm4gdS5zZXQobixnKSxnfWNvbnN0IGk9c2VsZjtpLm9ubWVzc2FnZT1hc3luYyBmdW5jdGlvbihzKXtpZighKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcykpcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOnMuZGF0YS5pZH0pO2NvbnN0e2lkOmUsYml0bWFwOm4sd2lkdGg6YSxoZWlnaHQ6dH09cy5kYXRhLGc9cChhLHQpLGg9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2guZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCB3PWF3YWl0IGguY29udmVydFRvQmxvYigpLHk9dy50eXBlLGI9YXdhaXQgdy5hcnJheUJ1ZmZlcigpLG89ZChiKTtpZighYy5oYXMoZSkmJmF3YWl0IGc9PT1vKXJldHVybiBjLnNldChlLG8pLGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpZihjLmdldChlKT09PW8pcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpLnBvc3RNZXNzYWdlKHtpZDplLHR5cGU6eSxiYXNlNjQ6byx3aWR0aDphLGhlaWdodDp0fSksYy5zZXQoZSxvKX19KSgpOwoK",null,!1),zr=Object.getOwnPropertySymbols,ai=Object.prototype.hasOwnProperty,li=Object.prototype.propertyIsEnumerable,ci=(e,t)=>{var r={};for(var n in e)ai.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&zr)for(var n of zr(e))t.indexOf(n)<0&&li.call(e,n)&&(r[n]=e[n]);return r},ui=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});class di{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(l,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(c)};const{sampling:r="all",win:n,blockClass:o,recordCanvas:i}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,i&&r==="all"&&this.initCanvasMutationObserver(n,o),i&&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=Gr(r,n),i=new Map,l=new si;l.onmessage=d=>{const{id:h}=d.data;if(i.set(h,!1),!("base64"in d.data))return;const{base64:m,type:p,width:f,height:y}=d.data;this.mutationCb({id:h,type:ve["2D"],commands:[{property:"clearRect",args:[0,0,f,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:m}],type:p}]},0,0]}]})};const c=1e3/t;let a=0,s;const u=d=>{if(a&&d-a<c){s=requestAnimationFrame(u);return}a=d,r.document.querySelectorAll(`canvas:not(.${n} *)`).forEach(h=>ui(this,null,function*(){var m;const p=this.mirror.getId(h);if(i.get(p))return;if(i.set(p,!0),["webgl","webgl2"].includes(h.__context)){const y=h.getContext(h.__context);((m=y?.getContextAttributes())==null?void 0:m.preserveDrawingBuffer)===!1&&y?.clear(y.COLOR_BUFFER_BIT)}if(h.width===0||h.height===0)return;const f=yield createImageBitmap(h);l.postMessage({id:p,bitmap:f,width:h.width,height:h.height},[f])})),s=requestAnimationFrame(u)};s=requestAnimationFrame(u),this.resetObservers=()=>{o(),cancelAnimationFrame(s)}}initCanvasMutationObserver(t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=Gr(t,r),o=ti(this.processMutation.bind(this),t,r,this.mirror),i=ri(this.processMutation.bind(this),t,r,this.mirror);this.resetObservers=()=>{n(),o(),i()}}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=>ci(l,["type"])),{type:i}=n[0];this.mutationCb({id:r,type:i,commands:o}),this.pendingCanvasMutations.delete(t)}}class hi{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 mi=Object.defineProperty,pi=Object.defineProperties,fi=Object.getOwnPropertyDescriptors,Hr=Object.getOwnPropertySymbols,vi=Object.prototype.hasOwnProperty,gi=Object.prototype.propertyIsEnumerable,Yr=(e,t,r)=>t in e?mi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,le=(e,t)=>{for(var r in t||(t={}))vi.call(t,r)&&Yr(e,r,t[r]);if(Hr)for(var r of Hr(t))gi.call(t,r)&&Yr(e,r,t[r]);return e},yi=(e,t)=>pi(e,fi(t));function te(e){return yi(le({},e),{timestamp:Date.now()})}let Q,Xe;const he=tr();function ke(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="highlight-block",blockSelector:i=null,ignoreClass:l="highlight-ignore",maskTextClass:c="highlight-mask",maskTextSelector:a=null,inlineStylesheet:s=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:h,maskInputFn:m,maskTextFn:p,hooks:f,packFn:y,sampling:v={},mousemoveWait:S,recordCanvas:w=!1,userTriggeredOnInput:b=!1,collectFonts:k=!1,inlineImages:M=!1,plugins:x,keepIframeSrcFn:T=()=>!1,enableStrictPrivacy:D=!1}=e;if(!t)throw new Error("emit function is required");S!==void 0&&v.mousemove===void 0&&(v.mousemove=S),he.reset();const W=u===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:d!==void 0?d:{password:!0},V=h===!0||h==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:h==="all",headMetaDescKeywords:h==="all"}:h||{};Ct();let U,G=0;const A=E=>{for(const C of x||[])C.eventProcessor&&(E=C.eventProcessor(E));return y&&(E=y(E)),E};Q=(E,C)=>{var z;if(((z=Ie[0])==null?void 0:z.isFrozen())&&E.type!==R.FullSnapshot&&!(E.type===R.IncrementalSnapshot&&E.data.source===L.Mutation)&&Ie.forEach(H=>H.unfreeze()),t(A(E),C),E.type===R.FullSnapshot)U=E,G=0;else if(E.type===R.IncrementalSnapshot){if(E.data.source===L.Mutation&&E.data.isAttachIframe)return;G++;const H=n&&G>=n,oe=r&&E.timestamp-U.timestamp>r;(H||oe)&&Xe(!0)}};const j=E=>{Q(te({type:R.IncrementalSnapshot,data:le({source:L.Mutation},E)}))},F=E=>Q(te({type:R.IncrementalSnapshot,data:le({source:L.Scroll},E)})),O=E=>Q(te({type:R.IncrementalSnapshot,data:le({source:L.CanvasMutation},E)})),_=new zo({mutationCb:j}),N=new hi({mutationCb:j}),g=new di({recordCanvas:w,mutationCb:O,win:window,blockClass:o,mirror:he,sampling:v.canvas}),I=new qo({mutationCb:j,scrollCb:F,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:a,inlineStylesheet:s,maskInputOptions:W,maskTextFn:p,maskInputFn:m,recordCanvas:w,inlineImages:M,sampling:v,slimDOMOptions:V,iframeManager:_,stylesheetManager:N,canvasManager:g,keepIframeSrcFn:T,enableStrictPrivacy:D},mirror:he});Xe=(E=!1)=>{var C,z,H,oe;Q(te({type:R.Meta,data:{href:window.location.href,width:Nt(),height:wt()}}),E),Ie.forEach(X=>X.lock());const B=vo(document,{mirror:he,blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:a,inlineStylesheet:s,maskAllInputs:W,maskTextFn:p,slimDOM:V,recordCanvas:w,inlineImages:M,enableStrictPrivacy:D,onSerialize:X=>{De(X,he)&&_.addIframe(X),kt(X,he)&&N.addStylesheet(X),ze(X)&&I.addShadowRoot(X.shadowRoot,document)},onIframeLoad:(X,Te)=>{_.attachIframe(X,Te,he),I.observeAttachShadow(X)},onStylesheetLoad:(X,Te)=>{N.attachStylesheet(X,Te,he)},keepIframeSrcFn:T});if(!B)return console.warn("Failed to snapshot the document");Q(te({type:R.FullSnapshot,data:{node:B,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((z=(C=document?.body)==null?void 0:C.parentElement)==null?void 0:z.scrollLeft)||document?.body.scrollLeft||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((oe=(H=document?.body)==null?void 0:H.parentElement)==null?void 0:oe.scrollTop)||document?.body.scrollTop||0}}})),Ie.forEach(X=>X.unlock())};try{const E=[];E.push(ie("DOMContentLoaded",()=>{Q(te({type:R.DomContentLoaded,data:{}}))}));const C=H=>{var oe;return Bo({mutationCb:j,mousemoveCb:(B,X)=>Q(te({type:R.IncrementalSnapshot,data:{source:X,positions:B}})),mouseInteractionCb:B=>Q(te({type:R.IncrementalSnapshot,data:le({source:L.MouseInteraction},B)})),scrollCb:F,viewportResizeCb:B=>Q(te({type:R.IncrementalSnapshot,data:le({source:L.ViewportResize},B)})),inputCb:B=>Q(te({type:R.IncrementalSnapshot,data:le({source:L.Input},B)})),mediaInteractionCb:B=>Q(te({type:R.IncrementalSnapshot,data:le({source:L.MediaInteraction},B)})),styleSheetRuleCb:B=>Q(te({type:R.IncrementalSnapshot,data:le({source:L.StyleSheetRule},B)})),styleDeclarationCb:B=>Q(te({type:R.IncrementalSnapshot,data:le({source:L.StyleDeclaration},B)})),canvasMutationCb:O,fontCb:B=>Q(te({type:R.IncrementalSnapshot,data:le({source:L.Font},B)})),blockClass:o,ignoreClass:l,maskTextClass:c,maskTextSelector:a,maskInputOptions:W,inlineStylesheet:s,sampling:v,recordCanvas:w,inlineImages:M,userTriggeredOnInput:b,collectFonts:k,doc:H,maskInputFn:m,maskTextFn:p,keepIframeSrcFn:T,blockSelector:i,slimDOMOptions:V,mirror:he,iframeManager:_,stylesheetManager:N,shadowDomManager:I,canvasManager:g,enableStrictPrivacy:D,plugins:((oe=x?.filter(B=>B.observer))==null?void 0:oe.map(B=>({observer:B.observer,options:B.options,callback:X=>Q(te({type:R.Plugin,data:{plugin:B.name,payload:X}}))})))||[]},f)};_.addLoadListener(H=>{E.push(C(H.contentDocument))});const z=()=>{Xe(),E.push(C(document))};return document.readyState==="interactive"||document.readyState==="complete"?z():E.push(ie("load",()=>{Q(te({type:R.Load,data:{}})),z()},window)),()=>{E.forEach(H=>H())}}catch(E){console.warn(E)}}ke.addCustomEvent=(e,t)=>{!Q||Q(te({type:R.Custom,data:{tag:e,payload:t}}))},ke.freezePage=()=>{Ie.forEach(e=>e.freeze())},ke.takeFullSnapshot=e=>{if(!Xe)throw new Error("please take full snapshot after start recording");Xe(e)},ke.mirror=he;var $;(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"})($||($={}));var bi=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 Si(){return new bi}function wi(e){const t={},r=/;(?![^(]*\))/g,n=/:(.+)/,o=/\/\*.*?\*\//g;return e.replace(o,"").split(r).forEach(function(i){if(i){const l=i.split(n);l.length>1&&(t[Rt(l[0].trim())]=l[1].trim())}}),t}function Xr(e){const t=[];for(const r in e){const n=e[r];if(typeof n!="string")continue;const o=Ci(r);t.push(`${o}: ${n};`)}return t.join(" ")}const Ni=/-([a-z])/g,Ti=/^--[a-zA-Z0-9-]+$/,Rt=e=>Ti.test(e)?e:e.replace(Ni,(t,r)=>r?r.toUpperCase():""),Ei=/\B([A-Z])/g,Ci=e=>e.replace(Ei,"-$1").toLowerCase();class ce{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=J.ELEMENT_NODE,this.TEXT_NODE=J.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){const t=this.parentNode;if(!t)return null;const r=t.childNodes,n=r.indexOf(this);return r[n+1]||null}contains(t){if(t===this)return!0;for(const r of this.childNodes)if(r.contains(t))return!0;return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function Ii(e){return class zn extends e{constructor(){super(...arguments),this.nodeType=J.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=$.Document,this.textContent=null}get documentElement(){return this.childNodes.find(r=>r.RRNodeType===$.Element&&r.tagName==="HTML")||null}get body(){var r;return((r=this.documentElement)===null||r===void 0?void 0:r.childNodes.find(n=>n.RRNodeType===$.Element&&n.tagName==="BODY"))||null}get head(){var r;return((r=this.documentElement)===null||r===void 0?void 0:r.childNodes.find(n=>n.RRNodeType===$.Element&&n.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(r){const n=r.RRNodeType;if((n===$.Element||n===$.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===n))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${n===$.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return r.parentElement=null,r.parentNode=this,this.childNodes.push(r),r}insertBefore(r,n){const o=r.RRNodeType;if((o===$.Element||o===$.DocumentType)&&this.childNodes.some(l=>l.RRNodeType===o))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${o===$.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(n===null)return this.appendChild(r);const i=this.childNodes.indexOf(n);if(i==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(i,0,r),r.parentElement=null,r.parentNode=this,r}removeChild(r){const n=this.childNodes.indexOf(r);if(n===-1)throw new Error("Failed to execute 'removeChild' on 'RRDocument': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(n,1),r.parentElement=null,r.parentNode=null,r}open(){this.childNodes=[]}close(){}write(r){let n;if(r==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?n="-//W3C//DTD XHTML 1.0 Transitional//EN":r==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(n="-//W3C//DTD HTML 4.0 Transitional//EN"),n){const o=this.createDocumentType("html",n,"");this.open(),this.appendChild(o)}}createDocument(r,n,o){return new zn}createDocumentType(r,n,o){const i=new(Zr(ce))(r,n,o);return i.ownerDocument=this,i}createElement(r){const n=new(Kr(ce))(r);return n.ownerDocument=this,n}createElementNS(r,n){return this.createElement(n)}createTextNode(r){const n=new(qr(ce))(r);return n.ownerDocument=this,n}createComment(r){const n=new(Jr(ce))(r);return n.ownerDocument=this,n}createCDATASection(r){const n=new(Qr(ce))(r);return n.ownerDocument=this,n}toString(){return"RRDocument"}}}function Zr(e){return class extends e{constructor(t,r,n){super(),this.nodeType=J.DOCUMENT_TYPE_NODE,this.RRNodeType=$.DocumentType,this.textContent=null,this.name=t,this.publicId=r,this.systemId=n,this.nodeName=t}toString(){return"RRDocumentType"}}}function Kr(e){return class extends e{constructor(t){super(),this.nodeType=J.ELEMENT_NODE,this.RRNodeType=$.Element,this.attributes={},this.shadowRoot=null,this.tagName=t.toUpperCase(),this.nodeName=t.toUpperCase()}get textContent(){let t="";return this.childNodes.forEach(r=>t+=r.textContent),t}set textContent(t){this.childNodes=[this.ownerDocument.createTextNode(t)]}get classList(){return new Mi(this.attributes.class,t=>{this.attributes.class=t})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const t=this.attributes.style?wi(this.attributes.style):{},r=/\B([A-Z])/g;return t.setProperty=(n,o,i)=>{if(r.test(n))return;const l=Rt(n);o?t[l]=o:delete t[l],i==="important"&&(t[l]+=" !important"),this.attributes.style=Xr(t)},t.removeProperty=n=>{if(r.test(n))return"";const o=Rt(n),i=t[o]||"";return delete t[o],this.attributes.style=Xr(t),i},t}getAttribute(t){return this.attributes[t]||null}setAttribute(t,r){this.attributes[t]=r}setAttributeNS(t,r,n){this.setAttribute(r,n)}removeAttribute(t){delete this.attributes[t]}appendChild(t){return this.childNodes.push(t),t.parentNode=this,t.parentElement=this,t}insertBefore(t,r){if(r===null)return this.appendChild(t);const n=this.childNodes.indexOf(r);if(n==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(n,0,t),t.parentElement=this,t.parentNode=this,t}removeChild(t){const r=this.childNodes.indexOf(t);if(r===-1)throw new Error("Failed to execute 'removeChild' on 'RRElement': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(r,1),t.parentElement=null,t.parentNode=null,t}attachShadow(t){const r=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=r,r}dispatchEvent(t){return!0}toString(){let t="";for(const r in this.attributes)t+=`${r}="${this.attributes[r]}" `;return`${this.tagName} ${t}`}}}function ki(e){return class extends e{attachShadow(t){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}function qr(e){return class extends e{constructor(t){super(),this.nodeType=J.TEXT_NODE,this.nodeName="#text",this.RRNodeType=$.Text,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function Jr(e){return class extends e{constructor(t){super(),this.nodeType=J.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=$.Comment,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function Qr(e){return class extends e{constructor(t){super(),this.nodeName="#cdata-section",this.nodeType=J.CDATA_SECTION_NODE,this.RRNodeType=$.CDATA,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class Mi{constructor(t,r){if(this.classes=[],this.add=(...n)=>{for(const o of n){const i=String(o);this.classes.indexOf(i)>=0||this.classes.push(i)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...n)=>{this.classes=this.classes.filter(o=>n.indexOf(o)===-1),this.onChange&&this.onChange(this.classes.join(" "))},t){const n=t.trim().split(/\s+/);this.classes.push(...n)}this.onChange=r}}var J;(function(e){e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"})(J||(J={}));const Dt={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},xi={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function me(e,t,r,n){const o=e.childNodes,i=t.childNodes;n=n||t.mirror||t.ownerDocument.mirror,(o.length>0||i.length>0)&&en(Array.from(o),i,e,r,n);let l=null,c=null;switch(t.RRNodeType){case $.Document:{c=t.scrollData;break}case $.Element:{const a=e,s=t;switch(Oi(a,s,n),c=s.scrollData,l=s.inputData,s.tagName){case"AUDIO":case"VIDEO":{const u=e,d=s;d.paused!==void 0&&(d.paused?u.pause():u.play()),d.muted!==void 0&&(u.muted=d.muted),d.volume!==void 0&&(u.volume=d.volume),d.currentTime!==void 0&&(u.currentTime=d.currentTime);break}case"CANVAS":{const u=t;if(u.rr_dataURL!==null){const d=document.createElement("img");d.onload=()=>{const h=a.getContext("2d");h&&h.drawImage(d,0,0,d.width,d.height)},d.src=u.rr_dataURL}u.canvasMutations.forEach(d=>r.applyCanvas(d.event,d.mutation,e))}break;case"STYLE":Ri(a,t.rules);break}if(s.shadowRoot){a.shadowRoot||a.attachShadow({mode:"open"});const u=a.shadowRoot.childNodes,d=s.shadowRoot.childNodes;(u.length>0||d.length>0)&&en(Array.from(u),d,a.shadowRoot,r,n)}break}case $.Text:case $.Comment:case $.CDATA:e.textContent!==t.data&&(e.textContent=t.data);break}if(c&&r.applyScroll(c,!0),l&&r.applyInput(l),t.nodeName==="IFRAME"){const a=e.contentDocument,s=t;if(a){const u=n.getMeta(s.contentDocument);u&&r.mirror.add(a,Object.assign({},u)),me(a,s.contentDocument,r,n)}}}function Oi(e,t,r){const n=e.attributes,o=t.attributes;for(const i in o){const l=o[i],c=r.getMeta(t);if(c&&"isSVG"in c&&c.isSVG&&Dt[i])e.setAttributeNS(Dt[i],i,l);else if(t.tagName==="CANVAS"&&i==="rr_dataURL"){const a=document.createElement("img");a.src=l,a.onload=()=>{const s=e.getContext("2d");s&&s.drawImage(a,0,0,a.width,a.height)}}else e.setAttribute(i,l)}for(const{name:i}of Array.from(n))i in o||e.removeAttribute(i);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function en(e,t,r,n,o){var i;let l=0,c=e.length-1,a=0,s=t.length-1,u=e[l],d=e[c],h=t[a],m=t[s],p,f;for(;l<=c&&a<=s;){const y=n.mirror.getId(u),v=n.mirror.getId(d),S=o.getId(h),w=o.getId(m);if(u===void 0)u=e[++l];else if(d===void 0)d=e[--c];else if(y!==-1&&y===S)me(u,h,n,o),u=e[++l],h=t[++a];else if(v!==-1&&v===w)me(d,m,n,o),d=e[--c],m=t[--s];else if(y!==-1&&y===w)r.insertBefore(u,d.nextSibling),me(u,m,n,o),u=e[++l],m=t[--s];else if(v!==-1&&v===S)r.insertBefore(d,u),me(d,h,n,o),d=e[--c],h=t[++a];else{if(!p){p={};for(let b=l;b<=c;b++){const k=e[b];k&&n.mirror.hasNode(k)&&(p[n.mirror.getId(k)]=b)}}if(f=p[o.getId(h)],f){const b=e[f];r.insertBefore(b,u),me(b,h,n,o),e[f]=void 0}else{const b=Lt(h,n.mirror,o);r.nodeName==="#document"&&((i=n.mirror.getMeta(b))===null||i===void 0?void 0:i.type)===$.Element&&r.documentElement&&(r.removeChild(r.documentElement),e[l]=void 0,u=void 0),r.insertBefore(b,u||null),me(b,h,n,o)}h=t[++a]}}if(l>c){const y=t[s+1];let v=null;for(y&&r.childNodes.forEach(S=>{n.mirror.getId(S)===o.getId(y)&&(v=S)});a<=s;++a){const S=Lt(t[a],n.mirror,o);r.insertBefore(S,v),me(S,t[a],n,o)}}else if(a>s)for(;l<=c;l++){const y=e[l];y&&(r.removeChild(y),n.mirror.removeNodeFromMap(y))}}function Lt(e,t,r){const n=r.getId(e),o=r.getMeta(e);let i=null;if(n>-1&&(i=t.getNode(n)),i!==null)return i;switch(e.RRNodeType){case $.Document:i=new Document;break;case $.DocumentType:i=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case $.Element:{let l=e.tagName.toLowerCase();l=xi[l]||l,o&&"isSVG"in o&&o?.isSVG?i=document.createElementNS(Dt.svg,l):i=document.createElement(e.tagName);break}case $.Text:i=document.createTextNode(e.data);break;case $.Comment:i=document.createComment(e.data);break;case $.CDATA:i=document.createCDATASection(e.data);break}return o&&t.add(i,Object.assign({},o)),i}function Ze(e,t){const r=e[t[0]];return t.length===1?r:Ze(r.cssRules[t[1]].cssRules,t.slice(2))}var ue;(function(e){e[e.Insert=0]="Insert",e[e.Remove=1]="Remove",e[e.Snapshot=2]="Snapshot",e[e.SetProperty=3]="SetProperty",e[e.RemoveProperty=4]="RemoveProperty"})(ue||(ue={}));function tn(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function Ri(e,t){const r=e.sheet;t.forEach(n=>{if(n.type===ue.Insert)try{if(Array.isArray(n.index)){const{positions:o,index:i}=tn(n.index);Ze(r.cssRules,o).insertRule(n.cssText,i)}else r.insertRule(n.cssText,n.index)}catch{}else if(n.type===ue.Remove)try{if(Array.isArray(n.index)){const{positions:o,index:i}=tn(n.index);Ze(r.cssRules,o).deleteRule(i||0)}else r.deleteRule(n.index)}catch{}else n.type===ue.SetProperty?Ze(r.cssRules,n.index).style.setProperty(n.property,n.value,n.priority):n.type===ue.RemoveProperty&&Ze(r.cssRules,n.index).style.removeProperty(n.property)})}class Fe extends Ii(ce){constructor(t){super(),this._unserializedId=-1,this.mirror=Vi(),this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,r,n){return new Fe}createDocumentType(t,r,n){const o=new Di(t,r,n);return o.ownerDocument=this,o}createElement(t){const r=t.toUpperCase();let n;switch(r){case"AUDIO":case"VIDEO":n=new Li(r);break;case"IFRAME":n=new Pi(r,this.mirror);break;case"CANVAS":n=new Ai(r);break;case"STYLE":n=new Fi(r);break;default:n=new Ke(r);break}return n.ownerDocument=this,n}createComment(t){const r=new $i(t);return r.ownerDocument=this,r}createCDATASection(t){const r=new Wi(t);return r.ownerDocument=this,r}createTextNode(t){const r=new _i(t);return r.ownerDocument=this,r}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=-1}}const Di=Zr(ce);class Ke extends Kr(ce){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class Li extends ki(Ke){}class Ai extends Ke{constructor(){super(...arguments),this.rr_dataURL=null,this.canvasMutations=[]}getContext(){return null}}class Fi extends Ke{constructor(){super(...arguments),this.rules=[]}}class Pi extends Ke{constructor(t,r){super(t),this.contentDocument=new Fe,this.contentDocument.mirror=r}}const _i=qr(ce),$i=Jr(ce),Wi=Qr(ce);function Ui(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function rn(e,t,r,n){let o;switch(e.nodeType){case J.DOCUMENT_NODE:n&&n.nodeName==="IFRAME"?o=n.contentDocument:(o=t,o.compatMode=e.compatMode);break;case J.DOCUMENT_TYPE_NODE:{const l=e;o=t.createDocumentType(l.name,l.publicId,l.systemId);break}case J.ELEMENT_NODE:{const l=e,c=Ui(l);o=t.createElement(c);const a=o;for(const{name:s,value:u}of Array.from(l.attributes))a.attributes[s]=u;l.scrollLeft&&(a.scrollLeft=l.scrollLeft),l.scrollTop&&(a.scrollTop=l.scrollTop);break}case J.TEXT_NODE:o=t.createTextNode(e.textContent||"");break;case J.CDATA_SECTION_NODE:o=t.createCDATASection(e.data);break;case J.COMMENT_NODE:o=t.createComment(e.textContent||"");break;case J.DOCUMENT_FRAGMENT_NODE:o=n.attachShadow({mode:"open"});break;default:return null}let i=r.getMeta(e);return t instanceof Fe&&(i||(i=nn(o,t.unserializedId),r.add(e,i)),t.mirror.add(o,Object.assign({},i))),o}function ji(e,t=Si(),r=new Fe){function n(o,i){const l=rn(o,r,t,i);l!==null&&(i?.nodeName!=="IFRAME"&&o.nodeType!==J.DOCUMENT_FRAGMENT_NODE&&(i?.appendChild(l),l.parentNode=i,l.parentElement=i),o.nodeName==="IFRAME"?n(o.contentDocument,l):(o.nodeType===J.DOCUMENT_NODE||o.nodeType===J.ELEMENT_NODE||o.nodeType===J.DOCUMENT_FRAGMENT_NODE)&&(o.nodeType===J.ELEMENT_NODE&&o.shadowRoot&&n(o.shadowRoot,l),o.childNodes.forEach(c=>n(c,l))))}return n(e,null),r}function Vi(){return new Gi}class Gi{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var r;if(!t)return-1;const n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){const n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function nn(e,t){switch(e.RRNodeType){case $.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case $.DocumentType:{const r=e;return{id:t,type:e.RRNodeType,name:r.name,publicId:r.publicId,systemId:r.systemId}}case $.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case $.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case $.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case $.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}function on(e){return{all:e=e||new Map,on:function(t,r){var n=e.get(t);n?n.push(r):e.set(t,[r])},off:function(t,r){var n=e.get(t);n&&(r?n.splice(n.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var n=e.get(t);n&&n.slice().map(function(o){o(r)}),(n=e.get("*"))&&n.slice().map(function(o){o(t,r)})}}}var Bi=Object.freeze({__proto__:null,default:on});function zi(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const r=e.HTMLElement||e.Element,n=468,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||a,scrollIntoView:r.prototype.scrollIntoView},i=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function l(v){const S=["MSIE ","Trident/","Edge/"];return new RegExp(S.join("|")).test(v)}const c=l(e.navigator.userAgent)?1:0;function a(v,S){this.scrollLeft=v,this.scrollTop=S}function s(v){return .5*(1-Math.cos(Math.PI*v))}function u(v){if(v===null||typeof v!="object"||v.behavior===void 0||v.behavior==="auto"||v.behavior==="instant")return!0;if(typeof v=="object"&&v.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+v.behavior+" is not a valid value for enumeration ScrollBehavior.")}function d(v,S){if(S==="Y")return v.clientHeight+c<v.scrollHeight;if(S==="X")return v.clientWidth+c<v.scrollWidth}function h(v,S){const w=e.getComputedStyle(v,null)["overflow"+S];return w==="auto"||w==="scroll"}function m(v){const S=d(v,"Y")&&h(v,"Y"),w=d(v,"X")&&h(v,"X");return S||w}function p(v){for(;v!==t.body&&m(v)===!1;)v=v.parentNode||v.host;return v}function f(v){const S=i();let w,b,k,M=(S-v.startTime)/n;M=M>1?1:M,w=s(M),b=v.startX+(v.x-v.startX)*w,k=v.startY+(v.y-v.startY)*w,v.method.call(v.scrollable,b,k),(b!==v.x||k!==v.y)&&e.requestAnimationFrame(f.bind(e,v))}function y(v,S,w){let b,k,M,x;const T=i();v===t.body?(b=e,k=e.scrollX||e.pageXOffset,M=e.scrollY||e.pageYOffset,x=o.scroll):(b=v,k=v.scrollLeft,M=v.scrollTop,x=a),f({scrollable:b,method:x,startTime:T,startX:k,startY:M,x:S,y:w})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}y.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){o.scrollBy.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}y.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},r.prototype.scroll=r.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const v=arguments[0].left,S=arguments[0].top;y.call(this,this,typeof v>"u"?this.scrollLeft:~~v,typeof S>"u"?this.scrollTop:~~S)},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},r.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){o.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const v=p(this),S=v.getBoundingClientRect(),w=this.getBoundingClientRect();v!==t.body?(y.call(this,v,v.scrollLeft+w.left-S.left,v.scrollTop+w.top-S.top),e.getComputedStyle(v).position!=="fixed"&&e.scrollBy({left:S.left,top:S.top,behavior:"smooth"})):e.scrollBy({left:w.left,top:w.top,behavior:"smooth"})}}class Hi{constructor(t=[],r){this.timeOffset=0,this.raf=null,this.actions=t,this.speed=r}addAction(t){const r=this.findActionIndex(t);this.actions.splice(r,0,t)}addActions(t){this.actions=this.actions.concat(t)}replaceActions(t){this.actions.length=0,this.actions.splice(0,0,...t)}start(){this.timeOffset=0;let t=performance.now();const{actions:r}=this,n=()=>{const o=performance.now();for(this.timeOffset+=(o-t)*this.speed,t=o;r.length;){const i=r[0];if(this.timeOffset>=i.delay)r.shift(),i.doAction();else break}(r.length>0||this.liveMode)&&(this.raf=requestAnimationFrame(n))};this.raf=requestAnimationFrame(n)}clear(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(t){this.speed=t}toggleLiveMode(t){this.liveMode=t}isActive(){return this.raf!==null}findActionIndex(t){let r=0,n=this.actions.length-1;for(;r<=n;){const o=Math.floor((r+n)/2);if(this.actions[o].delay<t.delay)r=o+1;else if(this.actions[o].delay>t.delay)n=o-1;else return o+1}return r}}function At(e,t){if(e.type===R.IncrementalSnapshot&&e.data.source===L.MouseMove){const r=e.data.positions[0].timeOffset,n=e.timestamp+r;return e.delay=n-t,n-t}return e.delay=e.timestamp-t,e.delay}/*! *****************************************************************************
|
|
4
|
+
or you can use record.mirror to access the mirror instance during recording.`;q.mirror={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&&(q.mirror=new Proxy(q.mirror,{get(e,t,r){return t==="map"&&console.error(Oe),Reflect.get(e,t,r)}}));function Re(e,t,r={}){let n=null,o=0;return function(...i){const l=Date.now();!o&&r.leading===!1&&(o=l);const c=t-(l-o),a=this;c<=0||c>t?(n&&(clearTimeout(n),n=null),o=l,e.apply(a,i)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(a,i)},c))}}function Be(e,t,r,n,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(l){setTimeout(()=>{r.set.call(this,l)},0),i&&i.set&&i.set.call(this,l)}}),()=>Be(e,t,i||{},!0)}function be(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 Nt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Tt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}const pr=e=>{try{if(e instanceof HTMLElement)return e.tagName==="CANVAS"}catch{return!1}return!1};function se(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(nt(n,t,r))return!0;return!1}function fr(e,t){return t.getId(e)!==-1}function it(e,t){return t.getId(e)===Ge}function Et(e,t){if(je(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?Et(e.parentNode,t):!0:!0}function Ct(e){return Boolean(e.changedTouches)}function It(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 vr(e){const t={},r=(o,i)=>{const l={value:o,parent:i,children:[]};return t[o.node.id]=l,l},n=[];for(const o of e){const{nextId:i,parentId:l}=o;if(i&&i in t){const c=t[i];if(c.parent){const a=c.parent.children.indexOf(c);c.parent.children.splice(a,0,r(o,c.parent))}else{const a=n.indexOf(c);n.splice(a,0,r(o,null))}continue}if(l in t){const c=t[l];c.children.push(r(o,c));continue}n.push(r(o,null))}return n}function kt(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)kt(e.children[r],t)}function De(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function Mt(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function xt(e,t){var r,n;const o=(n=(r=e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:n.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const i=o.getBoundingClientRect(),l=xt(o,t),c=i.height/o.clientHeight;return{x:i.x*l.relativeScale+l.x,y:i.y*l.relativeScale+l.y,relativeScale:c,absoluteScale:l.absoluteScale*c}}function ze(e){return Boolean(e?.shadowRoot)}function Le(e,t){const r=e[t[0]];return t.length===1?r:Le(r.cssRules[t[1]].cssRules,t.slice(2))}function Ot(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function gr(e){const t=new Set,r=[];for(let n=e.length;n--;){const o=e[n];t.has(o.id)||(r.push(o),t.add(o.id))}return r}var Co=Object.freeze({__proto__:null,on:ie,get _mirror(){return q.mirror},throttle:Re,hookSetter:Be,patch:be,getWindowHeight:Nt,getWindowWidth:Tt,isCanvasNode:pr,isBlocked:se,isSerialized:fr,isIgnored:it,isAncestorRemoved:Et,isTouchEvent:Ct,polyfill:It,queueToResolveTrees:vr,iterateResolveTree:kt,isSerializedIframe:De,isSerializedStylesheet:Mt,getBaseDimension:xt,hasShadowRoot:ze,getNestedRule:Le,getPositionsAndIndex:Ot,uniqueTextMutations:gr}),R=(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))(R||{}),L=(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))(L||{}),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||{}),ve=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ve||{}),Ce=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(Ce||{}),Y=(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))(Y||{});function yr(e){return"__ln"in e}class Io{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&&yr(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&&yr(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 br=(e,t)=>`${e}@${t}`;class ko{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 Io,n=c=>{let a=c,s=Ge;for(;s===Ge;)a=a&&a.nextSibling,s=a&&this.mirror.getId(a);return s},o=c=>{var a,s,u,d,h;const m=c.getRootNode?(a=c.getRootNode())==null?void 0:a.host:null;let p=m;for(;(u=(s=p?.getRootNode)==null?void 0:s.call(p))!=null&&u.host;)p=((h=(d=p?.getRootNode)==null?void 0:d.call(p))==null?void 0:h.host)||null;const f=!this.doc.contains(c)&&(!p||!this.doc.contains(p));if(!c.parentNode||f)return;const y=je(c.parentNode)?this.mirror.getId(m):this.mirror.getId(c.parentNode),v=n(c);if(y===-1||v===-1)return r.addNode(c);const S=Ee(c,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,enableStrictPrivacy:this.enableStrictPrivacy,onSerialize:w=>{De(w,this.mirror)&&this.iframeManager.addIframe(w),Mt(w,this.mirror)&&this.stylesheetManager.addStylesheet(w),ze(c)&&this.shadowDomManager.addShadowRoot(c.shadowRoot,document)},onIframeLoad:(w,b)=>{this.iframeManager.attachIframe(w,b,this.mirror),this.shadowDomManager.observeAttachShadow(w)},onStylesheetLoad:(w,b)=>{this.stylesheetManager.attachStylesheet(w,b,this.mirror)}});S&&t.push({parentId:y,nextId:v,node:S})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const c of Array.from(this.movedSet.values()))Sr(this.removes,c,this.mirror)&&!this.movedSet.has(c.parentNode)||o(c);for(const c of Array.from(this.addedSet.values()))!Nr(this.droppedSet,c)&&!Sr(this.removes,c,this.mirror)||Nr(this.movedSet,c)?o(c):this.droppedSet.add(c);let i=null;for(;r.length;){let c=null;if(i){const a=this.mirror.getId(i.value.parentNode),s=n(i.value);a!==-1&&s!==-1&&(c=i)}if(!c)for(let a=r.length-1;a>=0;a--){const s=r.get(a);if(s){const u=this.mirror.getId(s.value.parentNode),d=n(s.value);if(u!==-1&&d!==-1){c=s;break}}}if(!c){for(;r.head;)r.removeNode(r.head.value);break}i=c.previous,r.removeNode(c.value),o(c.value)}const l={texts:this.texts.map(c=>{let a=c.value;return this.enableStrictPrivacy&&a&&(a=yt(a)),{id:this.mirror.getId(c.node),value:a}}).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>({id:this.mirror.getId(c.node),attributes:c.attributes})).filter(c=>this.mirror.has(c.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(!it(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!se(t.target,this.blockClass,!1)&&r!==t.oldValue&&this.texts.push({value:sr(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=gt({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),se(t.target,this.blockClass,!1)||n===t.oldValue)return;let o=this.attributes.find(i=>i.node===t.target);if(r.tagName==="IFRAME"&&t.attributeName==="src"&&!this.keepIframeSrcFn(n))if(!r.contentDocument)t.attributeName="rr_src";else return;if(o||(o={node:t.target,attributes:{}},this.attributes.push(o)),t.attributeName==="style"){const i=this.doc.createElement("span");t.oldValue&&i.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});const l=o.attributes.style;for(const c of Array.from(r.style)){const a=r.style.getPropertyValue(c),s=r.style.getPropertyPriority(c);(a!==i.style.getPropertyValue(c)||s!==i.style.getPropertyPriority(c))&&(s===""?l[c]=a:l[c]=[a,s])}for(const c of Array.from(i.style))r.style.getPropertyValue(c)===""&&(l[c]=!1)}else{if(t.target.tagName==="INPUT"){const i=t.target;if(i.type==="password"){o.attributes.value="*".repeat(i.value.length);break}}o.attributes[t.attributeName]=ir(this.doc,r.tagName,t.attributeName,n)}break}case"childList":{if(se(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=je(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);se(t.target,this.blockClass,!1)||it(r,this.mirror)||!fr(r,this.mirror)||(this.addedSet.has(r)?(Rt(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||Et(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[br(n,o)]?Rt(this.movedSet,r):this.removes.push({parentId:o,id:n,isShadow:je(t.target)&&Ve(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(this.mirror.hasNode(t)){if(it(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[br(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);se(t,this.blockClass,!1)||t.childNodes.forEach(n=>this.genAdds(n))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","enableStrictPrivacy"].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 Rt(e,t){e.delete(t),t.childNodes.forEach(r=>Rt(e,r))}function Sr(e,t,r){return e.length===0?!1:wr(e,t,r)}function wr(e,t,r){const{parentNode:n}=t;if(!n)return!1;const o=r.getId(n);return e.some(i=>i.id===o)?!0:wr(e,n,r)}function Nr(e,t){return e.size===0?!1:Tr(e,t)}function Tr(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:Tr(e,r):!1}var Mo=Object.defineProperty,xo=Object.defineProperties,Oo=Object.getOwnPropertyDescriptors,Er=Object.getOwnPropertySymbols,Ro=Object.prototype.hasOwnProperty,Do=Object.prototype.propertyIsEnumerable,Cr=(e,t,r)=>t in e?Mo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ir=(e,t)=>{for(var r in t||(t={}))Ro.call(t,r)&&Cr(e,r,t[r]);if(Er)for(var r of Er(t))Do.call(t,r)&&Cr(e,r,t[r]);return e},Lo=(e,t)=>xo(e,Oo(t));const Ie=[],kr=typeof CSSGroupingRule<"u",Mr=typeof CSSMediaRule<"u",xr=typeof CSSSupportsRule<"u",Or=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 Rr(e,t){var r,n;const o=new ko;Ie.push(o),o.init(e);let i=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]&&(i=window[l]);const c=new i(o.processMutations.bind(o));return c.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),c}function Ao({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let l=[],c;const a=Re(d=>{const h=Date.now()-c;e(l.map(m=>(m.timeOffset-=h,m)),d),l=[],c=null},i),s=Re(d=>{const h=He(d),{clientX:m,clientY:p}=Ct(d)?d.changedTouches[0]:d;c||(c=Date.now()),l.push({x:m,y:p,id:n.getId(h),timeOffset:Date.now()-c}),a(typeof DragEvent<"u"&&d instanceof DragEvent?L.Drag:d instanceof MouseEvent?L.MouseMove:L.TouchMove)},o,{trailing:!1}),u=[ie("mousemove",s,r),ie("touchmove",s,r),ie("drag",s,r)];return()=>{u.forEach(d=>d())}}function Fo({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const i=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[],c=a=>s=>{const u=He(s);if(se(u,n,!0)||pr(u))return;const d=Ct(s)?s.changedTouches[0]:s;if(!d)return;const h=r.getId(u),{clientX:m,clientY:p}=d;e({type:ee[a],id:h,x:m,y:p})};return Object.keys(ee).filter(a=>Number.isNaN(Number(a))&&!a.endsWith("_Departed")&&i[a]!==!1).forEach(a=>{const s=a.toLowerCase(),u=c(a);l.push(ie(s,u,t))}),()=>{l.forEach(a=>a())}}function Dr({scrollCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){const i=Re(l=>{const c=He(l);if(!c||se(c,n,!0))return;const a=r.getId(c);if(c===t){const s=t.scrollingElement||t.documentElement;e({id:a,x:s.scrollLeft,y:s.scrollTop})}else e({id:a,x:c.scrollLeft,y:c.scrollTop})},o.scroll||100);return ie("scroll",i,t)}function Po({viewportResizeCb:e}){let t=-1,r=-1;const n=Re(()=>{const o=Nt(),i=Tt();(t!==o||r!==i)&&(e({width:Number(i),height:Number(o)}),t=o,r=i)},200);return ie("resize",n,window)}function Lr(e,t){const r=Ir({},e);return t||delete r.userTriggered,r}const _o=["INPUT","TEXTAREA","SELECT"],Ar=new WeakMap;function $o({inputCb:e,doc:t,mirror:r,blockClass:n,ignoreClass:o,maskInputOptions:i,maskInputFn:l,sampling:c,userTriggeredOnInput:a}){function s(p){let f=He(p);const y=p.isTrusted;if(f&&f.tagName==="OPTION"&&(f=f.parentElement),!f||!f.tagName||_o.indexOf(f.tagName)<0||se(f,n,!0))return;const v=f.type;if(f.classList.contains(o))return;let S=f.value,w=!1;v==="radio"||v==="checkbox"?w=f.checked:(i[f.tagName.toLowerCase()]||i[v])&&(S=gt({maskInputOptions:i,tagName:f.tagName,type:v,value:S,maskInputFn:l})),u(f,Lr({text:S,isChecked:w,userTriggered:y},a));const b=f.name;v==="radio"&&b&&w&&t.querySelectorAll(`input[type="radio"][name="${b}"]`).forEach(k=>{k!==f&&u(k,Lr({text:k.value,isChecked:!w,userTriggered:!1},a))})}function u(p,f){const y=Ar.get(p);if(!y||y.text!==f.text||y.isChecked!==f.isChecked){Ar.set(p,f);const v=r.getId(p);e(Lo(Ir({},f),{id:v}))}}const d=(c.input==="last"?["change"]:["input","change"]).map(p=>ie(p,s,t)),h=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),m=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return h&&h.set&&d.push(...m.map(p=>Be(p[0],p[1],{set(){s({target:this})}}))),()=>{d.forEach(p=>p())}}function st(e){const t=[];function r(n,o){if(kr&&n.parentRule instanceof CSSGroupingRule||Mr&&n.parentRule instanceof CSSMediaRule||xr&&n.parentRule instanceof CSSSupportsRule||Or&&n.parentRule instanceof CSSConditionRule){const i=Array.from(n.parentRule.cssRules).indexOf(n);o.unshift(i)}else{const i=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(i)}return o}return r(e,t)}function Wo({styleSheetRuleCb:e,mirror:t},{win:r}){const n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(c,a){const s=t.getId(this.ownerNode);return s!==-1&&e({id:s,adds:[{rule:c,index:a}]}),n.apply(this,[c,a])};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=function(c){const a=t.getId(this.ownerNode);return a!==-1&&e({id:a,removes:[{index:c}]}),o.apply(this,[c])};const i={};kr?i.CSSGroupingRule=r.CSSGroupingRule:(Mr&&(i.CSSMediaRule=r.CSSMediaRule),Or&&(i.CSSConditionRule=r.CSSConditionRule),xr&&(i.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(i).forEach(([c,a])=>{l[c]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=function(s,u){const d=t.getId(this.parentStyleSheet.ownerNode);return d!==-1&&e({id:d,adds:[{rule:s,index:[...st(this),u||0]}]}),l[c].insertRule.apply(this,[s,u])},a.prototype.deleteRule=function(s){const u=t.getId(this.parentStyleSheet.ownerNode);return u!==-1&&e({id:u,removes:[{index:[...st(this),s]}]}),l[c].deleteRule.apply(this,[s])}}),()=>{r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=o,Object.entries(i).forEach(([c,a])=>{a.prototype.insertRule=l[c].insertRule,a.prototype.deleteRule=l[c].deleteRule})}}function Uo({styleDeclarationCb:e,mirror:t},{win:r}){const n=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=function(i,l,c){var a,s;const u=t.getId((s=(a=this.parentRule)==null?void 0:a.parentStyleSheet)==null?void 0:s.ownerNode);return u!==-1&&e({id:u,set:{property:i,value:l,priority:c},index:st(this.parentRule)}),n.apply(this,[i,l,c])};const o=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=function(i){var l,c;const a=t.getId((c=(l=this.parentRule)==null?void 0:l.parentStyleSheet)==null?void 0:c.ownerNode);return a!==-1&&e({id:a,remove:{property:i},index:st(this.parentRule)}),o.apply(this,[i])},()=>{r.CSSStyleDeclaration.prototype.setProperty=n,r.CSSStyleDeclaration.prototype.removeProperty=o}}function jo({mediaInteractionCb:e,blockClass:t,mirror:r,sampling:n}){const o=l=>Re(c=>{const a=He(c);if(!a||se(a,t,!0))return;const{currentTime:s,volume:u,muted:d}=a;e({type:l,id:r.getId(a),currentTime:s,volume:u,muted:d})},n.media||500),i=[ie("play",o(Ce.Play)),ie("pause",o(Ce.Pause)),ie("seeked",o(Ce.Seeked)),ie("volumechange",o(Ce.VolumeChange))];return()=>{i.forEach(l=>l())}}function Vo({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,i=r.FontFace;r.FontFace=function(c,a,s){const u=new i(c,a,s);return o.set(u,{family:c,buffer:typeof a!="string",descriptors:s,fontSource:typeof a=="string"?a:JSON.stringify(Array.from(new Uint8Array(a)))}),u};const l=be(t.fonts,"add",function(c){return function(a){return setTimeout(()=>{const s=o.get(a);s&&(e(s),o.delete(a))},0),c.apply(this,[a])}});return n.push(()=>{r.FontFace=i}),n.push(l),()=>{n.forEach(c=>c())}}function Go(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:l,inputCb:c,mediaInteractionCb:a,styleSheetRuleCb:s,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h}=e;e.mutationCb=(...m)=>{t.mutation&&t.mutation(...m),r(...m)},e.mousemoveCb=(...m)=>{t.mousemove&&t.mousemove(...m),n(...m)},e.mouseInteractionCb=(...m)=>{t.mouseInteraction&&t.mouseInteraction(...m),o(...m)},e.scrollCb=(...m)=>{t.scroll&&t.scroll(...m),i(...m)},e.viewportResizeCb=(...m)=>{t.viewportResize&&t.viewportResize(...m),l(...m)},e.inputCb=(...m)=>{t.input&&t.input(...m),c(...m)},e.mediaInteractionCb=(...m)=>{t.mediaInteaction&&t.mediaInteaction(...m),a(...m)},e.styleSheetRuleCb=(...m)=>{t.styleSheetRule&&t.styleSheetRule(...m),s(...m)},e.styleDeclarationCb=(...m)=>{t.styleDeclaration&&t.styleDeclaration(...m),u(...m)},e.canvasMutationCb=(...m)=>{t.canvasMutation&&t.canvasMutation(...m),d(...m)},e.fontCb=(...m)=>{t.font&&t.font(...m),h(...m)}}function Bo(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};Go(e,t);const n=Rr(e,e.doc),o=Ao(e),i=Fo(e),l=Dr(e),c=Po(e),a=$o(e),s=jo(e),u=Wo(e,{win:r}),d=Uo(e,{win:r}),h=e.collectFonts?Vo(e):()=>{},m=[];for(const p of e.plugins)m.push(p.observer(p.callback,r,p.options));return()=>{Ie.forEach(p=>p.reset()),n.disconnect(),o(),i(),l(),c(),a(),s(),u(),d(),h(),m.forEach(p=>p())}}class zo{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 Ho=Object.defineProperty,Yo=Object.defineProperties,Xo=Object.getOwnPropertyDescriptors,Fr=Object.getOwnPropertySymbols,Zo=Object.prototype.hasOwnProperty,Ko=Object.prototype.propertyIsEnumerable,Pr=(e,t,r)=>t in e?Ho(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_r=(e,t)=>{for(var r in t||(t={}))Zo.call(t,r)&&Pr(e,r,t[r]);if(Fr)for(var r of Fr(t))Ko.call(t,r)&&Pr(e,r,t[r]);return e},$r=(e,t)=>Yo(e,Xo(t));class qo{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(be(HTMLElement.prototype,"attachShadow",function(n){return function(o){const i=n.call(this,o);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),i}}))}addShadowRoot(t,r){!Ve(t)||(Rr($r(_r({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),Dr($r(_r({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})))}observeAttachShadow(t){if(t.contentWindow){const r=this;this.restorePatches.push(be(t.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(o){const i=n.call(this,o);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,t.contentDocument),i}}))}}reset(){this.restorePatches.forEach(t=>t())}}for(var Ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ye=typeof Uint8Array>"u"?[]:new Uint8Array(256),at=0;at<Ae.length;at++)Ye[Ae.charCodeAt(at)]=at;var Jo=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=Ae[t[r]>>2],o+=Ae[(t[r]&3)<<4|t[r+1]>>4],o+=Ae[(t[r+1]&15)<<2|t[r+2]>>6],o+=Ae[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},Qo=function(e){var t=e.length*.75,r=e.length,n,o=0,i,l,c,a;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var s=new ArrayBuffer(t),u=new Uint8Array(s);for(n=0;n<r;n+=4)i=Ye[e.charCodeAt(n)],l=Ye[e.charCodeAt(n+1)],c=Ye[e.charCodeAt(n+2)],a=Ye[e.charCodeAt(n+3)],u[o++]=i<<2|l>>4,u[o++]=(l&15)<<4|c>>2,u[o++]=(c&3)<<6|a&63;return s};const Wr=new Map;function ei(e,t){let r=Wr.get(e);return r||(r=new Map,Wr.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const Ur=(e,t,r)=>{if(!e||!(Vr(e,t)||typeof e=="object"))return;const n=e.constructor.name,o=ei(r,n);let i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function lt(e,t,r){if(e instanceof Array)return e.map(n=>lt(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=Jo(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[lt(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:[lt(e.data,t,r),e.width,e.height]};if(Vr(e,t)||typeof e=="object"){const n=e.constructor.name,o=Ur(e,t,r);return{rr_type:n,index:o}}}}return e}const jr=(e,t,r)=>[...e].map(n=>lt(n,t,r)),Vr=(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 ti(e,t,r,n){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const l of i)try{if(typeof t.CanvasRenderingContext2D.prototype[l]!="function")continue;const c=be(t.CanvasRenderingContext2D.prototype,l,function(a){return function(...s){return se(this.canvas,r,!0)||setTimeout(()=>{const u=jr([...s],t,this);e(this.canvas,{type:ve["2D"],property:l,args:u})},0),a.apply(this,s)}});o.push(c)}catch{const a=Be(t.CanvasRenderingContext2D.prototype,l,{set(s){e(this.canvas,{type:ve["2D"],property:l,args:[s],setter:!0})}});o.push(a)}return()=>{o.forEach(l=>l())}}function Gr(e,t){const r=[];try{const n=be(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(i,...l){return se(this,t,!0)||"__context"in this||(this.__context=i),o.apply(this,[i,...l])}});r.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(n=>n())}}function Br(e,t,r,n,o,i){const l=[],c=Object.getOwnPropertyNames(e);for(const a of c)try{if(typeof e[a]!="function")continue;const s=be(e,a,function(u){return function(...d){const h=u.apply(this,d);if(Ur(h,i,e),!se(this.canvas,n,!0)){const m=jr([...d],i,e),p={type:t,property:a,args:m};r(this.canvas,p)}return h}});l.push(s)}catch{const u=Be(e,a,{set(d){r(this.canvas,{type:t,property:a,args:[d],setter:!0})}});l.push(u)}return l}function ri(e,t,r,n){const o=[];return o.push(...Br(t.WebGLRenderingContext.prototype,ve.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...Br(t.WebGL2RenderingContext.prototype,ve.WebGL2,e,r,n,t)),()=>{o.forEach(i=>i())}}function ni(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),o=0,i=r.length;o<i;++o)n[o]=r.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}function oi(e,t,r){var n=t===void 0?null:t,o=r===void 0?!1:r,i=ni(e,o),l=i.indexOf(`
|
|
5
|
+
`,10)+1,c=i.substring(l)+(n?"//# sourceMappingURL="+n:""),a=new Blob([c],{type:"application/javascript"});return URL.createObjectURL(a)}function ii(e,t,r){var n;return function(i){return n=n||oi(e,t,r),new Worker(n,i)}}var si=ii("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Zm9yKHZhciByPSJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvIixsPXR5cGVvZiBVaW50OEFycmF5PiJ1Ij9bXTpuZXcgVWludDhBcnJheSgyNTYpLGY9MDtmPHIubGVuZ3RoO2YrKylsW3IuY2hhckNvZGVBdChmKV09Zjt2YXIgZD1mdW5jdGlvbihzKXt2YXIgZT1uZXcgVWludDhBcnJheShzKSxuLGE9ZS5sZW5ndGgsdD0iIjtmb3Iobj0wO248YTtuKz0zKXQrPXJbZVtuXT4+Ml0sdCs9clsoZVtuXSYzKTw8NHxlW24rMV0+PjRdLHQrPXJbKGVbbisxXSYxNSk8PDJ8ZVtuKzJdPj42XSx0Kz1yW2VbbisyXSY2M107cmV0dXJuIGElMz09PTI/dD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTEpKyI9IjphJTM9PT0xJiYodD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTIpKyI9PSIpLHR9O2NvbnN0IGM9bmV3IE1hcCx1PW5ldyBNYXA7YXN5bmMgZnVuY3Rpb24gcChzLGUpe2NvbnN0IG49YCR7c30tJHtlfWA7aWYodS5oYXMobikpcmV0dXJuIHUuZ2V0KG4pO2NvbnN0IGE9bmV3IE9mZnNjcmVlbkNhbnZhcyhzLGUpO2EuZ2V0Q29udGV4dCgiMmQiKTtjb25zdCB0PWF3YWl0KGF3YWl0IGEuY29udmVydFRvQmxvYigpKS5hcnJheUJ1ZmZlcigpLGc9ZCh0KTtyZXR1cm4gdS5zZXQobixnKSxnfWNvbnN0IGk9c2VsZjtpLm9ubWVzc2FnZT1hc3luYyBmdW5jdGlvbihzKXtpZighKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcykpcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOnMuZGF0YS5pZH0pO2NvbnN0e2lkOmUsYml0bWFwOm4sd2lkdGg6YSxoZWlnaHQ6dH09cy5kYXRhLGc9cChhLHQpLGg9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2guZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCB3PWF3YWl0IGguY29udmVydFRvQmxvYigpLHk9dy50eXBlLGI9YXdhaXQgdy5hcnJheUJ1ZmZlcigpLG89ZChiKTtpZighYy5oYXMoZSkmJmF3YWl0IGc9PT1vKXJldHVybiBjLnNldChlLG8pLGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpZihjLmdldChlKT09PW8pcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpLnBvc3RNZXNzYWdlKHtpZDplLHR5cGU6eSxiYXNlNjQ6byx3aWR0aDphLGhlaWdodDp0fSksYy5zZXQoZSxvKX19KSgpOwoK",null,!1),zr=Object.getOwnPropertySymbols,ai=Object.prototype.hasOwnProperty,li=Object.prototype.propertyIsEnumerable,ci=(e,t)=>{var r={};for(var n in e)ai.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&zr)for(var n of zr(e))t.indexOf(n)<0&&li.call(e,n)&&(r[n]=e[n]);return r},ui=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});class di{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(l,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(c)};const{sampling:r="all",win:n,blockClass:o,recordCanvas:i}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,i&&r==="all"&&this.initCanvasMutationObserver(n,o),i&&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=Gr(r,n),i=new Map,l=new si;l.onmessage=d=>{const{id:h}=d.data;if(i.set(h,!1),!("base64"in d.data))return;const{base64:m,type:p,width:f,height:y}=d.data;this.mutationCb({id:h,type:ve["2D"],commands:[{property:"clearRect",args:[0,0,f,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:m}],type:p}]},0,0]}]})};const c=1e3/t;let a=0,s;const u=d=>{if(a&&d-a<c){s=requestAnimationFrame(u);return}a=d,r.document.querySelectorAll(`canvas:not(.${n} *)`).forEach(h=>ui(this,null,function*(){var m;const p=this.mirror.getId(h);if(i.get(p))return;if(i.set(p,!0),["webgl","webgl2"].includes(h.__context)){const y=h.getContext(h.__context);((m=y?.getContextAttributes())==null?void 0:m.preserveDrawingBuffer)===!1&&y?.clear(y.COLOR_BUFFER_BIT)}if(h.width===0||h.height===0)return;const f=yield createImageBitmap(h);l.postMessage({id:p,bitmap:f,width:h.width,height:h.height},[f])})),s=requestAnimationFrame(u)};s=requestAnimationFrame(u),this.resetObservers=()=>{o(),cancelAnimationFrame(s)}}initCanvasMutationObserver(t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=Gr(t,r),o=ti(this.processMutation.bind(this),t,r,this.mirror),i=ri(this.processMutation.bind(this),t,r,this.mirror);this.resetObservers=()=>{n(),o(),i()}}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=>ci(l,["type"])),{type:i}=n[0];this.mutationCb({id:r,type:i,commands:o}),this.pendingCanvasMutations.delete(t)}}class hi{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 mi=Object.defineProperty,pi=Object.defineProperties,fi=Object.getOwnPropertyDescriptors,Hr=Object.getOwnPropertySymbols,vi=Object.prototype.hasOwnProperty,gi=Object.prototype.propertyIsEnumerable,Yr=(e,t,r)=>t in e?mi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,le=(e,t)=>{for(var r in t||(t={}))vi.call(t,r)&&Yr(e,r,t[r]);if(Hr)for(var r of Hr(t))gi.call(t,r)&&Yr(e,r,t[r]);return e},yi=(e,t)=>pi(e,fi(t));function te(e){return yi(le({},e),{timestamp:Date.now()})}let Q,Xe;const he=rr();function ke(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="highlight-block",blockSelector:i=null,ignoreClass:l="highlight-ignore",maskTextClass:c="highlight-mask",maskTextSelector:a=null,inlineStylesheet:s=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:h,maskInputFn:m,maskTextFn:p=yt,hooks:f,packFn:y,sampling:v={},mousemoveWait:S,recordCanvas:w=!1,userTriggeredOnInput:b=!1,collectFonts:k=!1,inlineImages:M=!1,plugins:x,keepIframeSrcFn:T=()=>!1,enableStrictPrivacy:D=!1}=e;if(!t)throw new Error("emit function is required");S!==void 0&&v.mousemove===void 0&&(v.mousemove=S),he.reset();const W=u===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:d!==void 0?d:{password:!0},V=h===!0||h==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:h==="all",headMetaDescKeywords:h==="all"}:h||{};It();let U,G=0;const A=E=>{for(const C of x||[])C.eventProcessor&&(E=C.eventProcessor(E));return y&&(E=y(E)),E};Q=(E,C)=>{var z;if(((z=Ie[0])==null?void 0:z.isFrozen())&&E.type!==R.FullSnapshot&&!(E.type===R.IncrementalSnapshot&&E.data.source===L.Mutation)&&Ie.forEach(H=>H.unfreeze()),t(A(E),C),E.type===R.FullSnapshot)U=E,G=0;else if(E.type===R.IncrementalSnapshot){if(E.data.source===L.Mutation&&E.data.isAttachIframe)return;G++;const H=n&&G>=n,oe=r&&E.timestamp-U.timestamp>r;(H||oe)&&Xe(!0)}};const j=E=>{Q(te({type:R.IncrementalSnapshot,data:le({source:L.Mutation},E)}))},F=E=>Q(te({type:R.IncrementalSnapshot,data:le({source:L.Scroll},E)})),O=E=>Q(te({type:R.IncrementalSnapshot,data:le({source:L.CanvasMutation},E)})),_=new zo({mutationCb:j}),N=new hi({mutationCb:j}),g=new di({recordCanvas:w,mutationCb:O,win:window,blockClass:o,mirror:he,sampling:v.canvas}),I=new qo({mutationCb:j,scrollCb:F,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:a,inlineStylesheet:s,maskInputOptions:W,maskTextFn:p,maskInputFn:m,recordCanvas:w,inlineImages:M,sampling:v,slimDOMOptions:V,iframeManager:_,stylesheetManager:N,canvasManager:g,keepIframeSrcFn:T,enableStrictPrivacy:D},mirror:he});Xe=(E=!1)=>{var C,z,H,oe;Q(te({type:R.Meta,data:{href:window.location.href,width:Tt(),height:Nt()}}),E),Ie.forEach(X=>X.lock());const B=vo(document,{mirror:he,blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:a,inlineStylesheet:s,maskAllInputs:W,maskTextFn:p,slimDOM:V,recordCanvas:w,inlineImages:M,enableStrictPrivacy:D,onSerialize:X=>{De(X,he)&&_.addIframe(X),Mt(X,he)&&N.addStylesheet(X),ze(X)&&I.addShadowRoot(X.shadowRoot,document)},onIframeLoad:(X,Te)=>{_.attachIframe(X,Te,he),I.observeAttachShadow(X)},onStylesheetLoad:(X,Te)=>{N.attachStylesheet(X,Te,he)},keepIframeSrcFn:T});if(!B)return console.warn("Failed to snapshot the document");Q(te({type:R.FullSnapshot,data:{node:B,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((z=(C=document?.body)==null?void 0:C.parentElement)==null?void 0:z.scrollLeft)||document?.body.scrollLeft||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((oe=(H=document?.body)==null?void 0:H.parentElement)==null?void 0:oe.scrollTop)||document?.body.scrollTop||0}}})),Ie.forEach(X=>X.unlock())};try{const E=[];E.push(ie("DOMContentLoaded",()=>{Q(te({type:R.DomContentLoaded,data:{}}))}));const C=H=>{var oe;return Bo({mutationCb:j,mousemoveCb:(B,X)=>Q(te({type:R.IncrementalSnapshot,data:{source:X,positions:B}})),mouseInteractionCb:B=>Q(te({type:R.IncrementalSnapshot,data:le({source:L.MouseInteraction},B)})),scrollCb:F,viewportResizeCb:B=>Q(te({type:R.IncrementalSnapshot,data:le({source:L.ViewportResize},B)})),inputCb:B=>Q(te({type:R.IncrementalSnapshot,data:le({source:L.Input},B)})),mediaInteractionCb:B=>Q(te({type:R.IncrementalSnapshot,data:le({source:L.MediaInteraction},B)})),styleSheetRuleCb:B=>Q(te({type:R.IncrementalSnapshot,data:le({source:L.StyleSheetRule},B)})),styleDeclarationCb:B=>Q(te({type:R.IncrementalSnapshot,data:le({source:L.StyleDeclaration},B)})),canvasMutationCb:O,fontCb:B=>Q(te({type:R.IncrementalSnapshot,data:le({source:L.Font},B)})),blockClass:o,ignoreClass:l,maskTextClass:c,maskTextSelector:a,maskInputOptions:W,inlineStylesheet:s,sampling:v,recordCanvas:w,inlineImages:M,userTriggeredOnInput:b,collectFonts:k,doc:H,maskInputFn:m,maskTextFn:p,keepIframeSrcFn:T,blockSelector:i,slimDOMOptions:V,mirror:he,iframeManager:_,stylesheetManager:N,shadowDomManager:I,canvasManager:g,enableStrictPrivacy:D,plugins:((oe=x?.filter(B=>B.observer))==null?void 0:oe.map(B=>({observer:B.observer,options:B.options,callback:X=>Q(te({type:R.Plugin,data:{plugin:B.name,payload:X}}))})))||[]},f)};_.addLoadListener(H=>{E.push(C(H.contentDocument))});const z=()=>{Xe(),E.push(C(document))};return document.readyState==="interactive"||document.readyState==="complete"?z():E.push(ie("load",()=>{Q(te({type:R.Load,data:{}})),z()},window)),()=>{E.forEach(H=>H())}}catch(E){console.warn(E)}}ke.addCustomEvent=(e,t)=>{!Q||Q(te({type:R.Custom,data:{tag:e,payload:t}}))},ke.freezePage=()=>{Ie.forEach(e=>e.freeze())},ke.takeFullSnapshot=e=>{if(!Xe)throw new Error("please take full snapshot after start recording");Xe(e)},ke.mirror=he;var $;(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"})($||($={}));var bi=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 Si(){return new bi}function wi(e){const t={},r=/;(?![^(]*\))/g,n=/:(.+)/,o=/\/\*.*?\*\//g;return e.replace(o,"").split(r).forEach(function(i){if(i){const l=i.split(n);l.length>1&&(t[Dt(l[0].trim())]=l[1].trim())}}),t}function Xr(e){const t=[];for(const r in e){const n=e[r];if(typeof n!="string")continue;const o=Ci(r);t.push(`${o}: ${n};`)}return t.join(" ")}const Ni=/-([a-z])/g,Ti=/^--[a-zA-Z0-9-]+$/,Dt=e=>Ti.test(e)?e:e.replace(Ni,(t,r)=>r?r.toUpperCase():""),Ei=/\B([A-Z])/g,Ci=e=>e.replace(Ei,"-$1").toLowerCase();class ce{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=J.ELEMENT_NODE,this.TEXT_NODE=J.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){const t=this.parentNode;if(!t)return null;const r=t.childNodes,n=r.indexOf(this);return r[n+1]||null}contains(t){if(t===this)return!0;for(const r of this.childNodes)if(r.contains(t))return!0;return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function Ii(e){return class zn extends e{constructor(){super(...arguments),this.nodeType=J.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=$.Document,this.textContent=null}get documentElement(){return this.childNodes.find(r=>r.RRNodeType===$.Element&&r.tagName==="HTML")||null}get body(){var r;return((r=this.documentElement)===null||r===void 0?void 0:r.childNodes.find(n=>n.RRNodeType===$.Element&&n.tagName==="BODY"))||null}get head(){var r;return((r=this.documentElement)===null||r===void 0?void 0:r.childNodes.find(n=>n.RRNodeType===$.Element&&n.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(r){const n=r.RRNodeType;if((n===$.Element||n===$.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===n))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${n===$.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return r.parentElement=null,r.parentNode=this,this.childNodes.push(r),r}insertBefore(r,n){const o=r.RRNodeType;if((o===$.Element||o===$.DocumentType)&&this.childNodes.some(l=>l.RRNodeType===o))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${o===$.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(n===null)return this.appendChild(r);const i=this.childNodes.indexOf(n);if(i==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(i,0,r),r.parentElement=null,r.parentNode=this,r}removeChild(r){const n=this.childNodes.indexOf(r);if(n===-1)throw new Error("Failed to execute 'removeChild' on 'RRDocument': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(n,1),r.parentElement=null,r.parentNode=null,r}open(){this.childNodes=[]}close(){}write(r){let n;if(r==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?n="-//W3C//DTD XHTML 1.0 Transitional//EN":r==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(n="-//W3C//DTD HTML 4.0 Transitional//EN"),n){const o=this.createDocumentType("html",n,"");this.open(),this.appendChild(o)}}createDocument(r,n,o){return new zn}createDocumentType(r,n,o){const i=new(Zr(ce))(r,n,o);return i.ownerDocument=this,i}createElement(r){const n=new(Kr(ce))(r);return n.ownerDocument=this,n}createElementNS(r,n){return this.createElement(n)}createTextNode(r){const n=new(qr(ce))(r);return n.ownerDocument=this,n}createComment(r){const n=new(Jr(ce))(r);return n.ownerDocument=this,n}createCDATASection(r){const n=new(Qr(ce))(r);return n.ownerDocument=this,n}toString(){return"RRDocument"}}}function Zr(e){return class extends e{constructor(t,r,n){super(),this.nodeType=J.DOCUMENT_TYPE_NODE,this.RRNodeType=$.DocumentType,this.textContent=null,this.name=t,this.publicId=r,this.systemId=n,this.nodeName=t}toString(){return"RRDocumentType"}}}function Kr(e){return class extends e{constructor(t){super(),this.nodeType=J.ELEMENT_NODE,this.RRNodeType=$.Element,this.attributes={},this.shadowRoot=null,this.tagName=t.toUpperCase(),this.nodeName=t.toUpperCase()}get textContent(){let t="";return this.childNodes.forEach(r=>t+=r.textContent),t}set textContent(t){this.childNodes=[this.ownerDocument.createTextNode(t)]}get classList(){return new Mi(this.attributes.class,t=>{this.attributes.class=t})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const t=this.attributes.style?wi(this.attributes.style):{},r=/\B([A-Z])/g;return t.setProperty=(n,o,i)=>{if(r.test(n))return;const l=Dt(n);o?t[l]=o:delete t[l],i==="important"&&(t[l]+=" !important"),this.attributes.style=Xr(t)},t.removeProperty=n=>{if(r.test(n))return"";const o=Dt(n),i=t[o]||"";return delete t[o],this.attributes.style=Xr(t),i},t}getAttribute(t){return this.attributes[t]||null}setAttribute(t,r){this.attributes[t]=r}setAttributeNS(t,r,n){this.setAttribute(r,n)}removeAttribute(t){delete this.attributes[t]}appendChild(t){return this.childNodes.push(t),t.parentNode=this,t.parentElement=this,t}insertBefore(t,r){if(r===null)return this.appendChild(t);const n=this.childNodes.indexOf(r);if(n==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(n,0,t),t.parentElement=this,t.parentNode=this,t}removeChild(t){const r=this.childNodes.indexOf(t);if(r===-1)throw new Error("Failed to execute 'removeChild' on 'RRElement': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(r,1),t.parentElement=null,t.parentNode=null,t}attachShadow(t){const r=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=r,r}dispatchEvent(t){return!0}toString(){let t="";for(const r in this.attributes)t+=`${r}="${this.attributes[r]}" `;return`${this.tagName} ${t}`}}}function ki(e){return class extends e{attachShadow(t){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}function qr(e){return class extends e{constructor(t){super(),this.nodeType=J.TEXT_NODE,this.nodeName="#text",this.RRNodeType=$.Text,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function Jr(e){return class extends e{constructor(t){super(),this.nodeType=J.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=$.Comment,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function Qr(e){return class extends e{constructor(t){super(),this.nodeName="#cdata-section",this.nodeType=J.CDATA_SECTION_NODE,this.RRNodeType=$.CDATA,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class Mi{constructor(t,r){if(this.classes=[],this.add=(...n)=>{for(const o of n){const i=String(o);this.classes.indexOf(i)>=0||this.classes.push(i)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...n)=>{this.classes=this.classes.filter(o=>n.indexOf(o)===-1),this.onChange&&this.onChange(this.classes.join(" "))},t){const n=t.trim().split(/\s+/);this.classes.push(...n)}this.onChange=r}}var J;(function(e){e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"})(J||(J={}));const Lt={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},xi={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function me(e,t,r,n){const o=e.childNodes,i=t.childNodes;n=n||t.mirror||t.ownerDocument.mirror,(o.length>0||i.length>0)&&en(Array.from(o),i,e,r,n);let l=null,c=null;switch(t.RRNodeType){case $.Document:{c=t.scrollData;break}case $.Element:{const a=e,s=t;switch(Oi(a,s,n),c=s.scrollData,l=s.inputData,s.tagName){case"AUDIO":case"VIDEO":{const u=e,d=s;d.paused!==void 0&&(d.paused?u.pause():u.play()),d.muted!==void 0&&(u.muted=d.muted),d.volume!==void 0&&(u.volume=d.volume),d.currentTime!==void 0&&(u.currentTime=d.currentTime);break}case"CANVAS":{const u=t;if(u.rr_dataURL!==null){const d=document.createElement("img");d.onload=()=>{const h=a.getContext("2d");h&&h.drawImage(d,0,0,d.width,d.height)},d.src=u.rr_dataURL}u.canvasMutations.forEach(d=>r.applyCanvas(d.event,d.mutation,e))}break;case"STYLE":Ri(a,t.rules);break}if(s.shadowRoot){a.shadowRoot||a.attachShadow({mode:"open"});const u=a.shadowRoot.childNodes,d=s.shadowRoot.childNodes;(u.length>0||d.length>0)&&en(Array.from(u),d,a.shadowRoot,r,n)}break}case $.Text:case $.Comment:case $.CDATA:e.textContent!==t.data&&(e.textContent=t.data);break}if(c&&r.applyScroll(c,!0),l&&r.applyInput(l),t.nodeName==="IFRAME"){const a=e.contentDocument,s=t;if(a){const u=n.getMeta(s.contentDocument);u&&r.mirror.add(a,Object.assign({},u)),me(a,s.contentDocument,r,n)}}}function Oi(e,t,r){const n=e.attributes,o=t.attributes;for(const i in o){const l=o[i],c=r.getMeta(t);if(c&&"isSVG"in c&&c.isSVG&&Lt[i])e.setAttributeNS(Lt[i],i,l);else if(t.tagName==="CANVAS"&&i==="rr_dataURL"){const a=document.createElement("img");a.src=l,a.onload=()=>{const s=e.getContext("2d");s&&s.drawImage(a,0,0,a.width,a.height)}}else e.setAttribute(i,l)}for(const{name:i}of Array.from(n))i in o||e.removeAttribute(i);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function en(e,t,r,n,o){var i;let l=0,c=e.length-1,a=0,s=t.length-1,u=e[l],d=e[c],h=t[a],m=t[s],p,f;for(;l<=c&&a<=s;){const y=n.mirror.getId(u),v=n.mirror.getId(d),S=o.getId(h),w=o.getId(m);if(u===void 0)u=e[++l];else if(d===void 0)d=e[--c];else if(y!==-1&&y===S)me(u,h,n,o),u=e[++l],h=t[++a];else if(v!==-1&&v===w)me(d,m,n,o),d=e[--c],m=t[--s];else if(y!==-1&&y===w)r.insertBefore(u,d.nextSibling),me(u,m,n,o),u=e[++l],m=t[--s];else if(v!==-1&&v===S)r.insertBefore(d,u),me(d,h,n,o),d=e[--c],h=t[++a];else{if(!p){p={};for(let b=l;b<=c;b++){const k=e[b];k&&n.mirror.hasNode(k)&&(p[n.mirror.getId(k)]=b)}}if(f=p[o.getId(h)],f){const b=e[f];r.insertBefore(b,u),me(b,h,n,o),e[f]=void 0}else{const b=At(h,n.mirror,o);r.nodeName==="#document"&&((i=n.mirror.getMeta(b))===null||i===void 0?void 0:i.type)===$.Element&&r.documentElement&&(r.removeChild(r.documentElement),e[l]=void 0,u=void 0),r.insertBefore(b,u||null),me(b,h,n,o)}h=t[++a]}}if(l>c){const y=t[s+1];let v=null;for(y&&r.childNodes.forEach(S=>{n.mirror.getId(S)===o.getId(y)&&(v=S)});a<=s;++a){const S=At(t[a],n.mirror,o);r.insertBefore(S,v),me(S,t[a],n,o)}}else if(a>s)for(;l<=c;l++){const y=e[l];y&&(r.removeChild(y),n.mirror.removeNodeFromMap(y))}}function At(e,t,r){const n=r.getId(e),o=r.getMeta(e);let i=null;if(n>-1&&(i=t.getNode(n)),i!==null)return i;switch(e.RRNodeType){case $.Document:i=new Document;break;case $.DocumentType:i=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case $.Element:{let l=e.tagName.toLowerCase();l=xi[l]||l,o&&"isSVG"in o&&o?.isSVG?i=document.createElementNS(Lt.svg,l):i=document.createElement(e.tagName);break}case $.Text:i=document.createTextNode(e.data);break;case $.Comment:i=document.createComment(e.data);break;case $.CDATA:i=document.createCDATASection(e.data);break}return o&&t.add(i,Object.assign({},o)),i}function Ze(e,t){const r=e[t[0]];return t.length===1?r:Ze(r.cssRules[t[1]].cssRules,t.slice(2))}var ue;(function(e){e[e.Insert=0]="Insert",e[e.Remove=1]="Remove",e[e.Snapshot=2]="Snapshot",e[e.SetProperty=3]="SetProperty",e[e.RemoveProperty=4]="RemoveProperty"})(ue||(ue={}));function tn(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function Ri(e,t){const r=e.sheet;t.forEach(n=>{if(n.type===ue.Insert)try{if(Array.isArray(n.index)){const{positions:o,index:i}=tn(n.index);Ze(r.cssRules,o).insertRule(n.cssText,i)}else r.insertRule(n.cssText,n.index)}catch{}else if(n.type===ue.Remove)try{if(Array.isArray(n.index)){const{positions:o,index:i}=tn(n.index);Ze(r.cssRules,o).deleteRule(i||0)}else r.deleteRule(n.index)}catch{}else n.type===ue.SetProperty?Ze(r.cssRules,n.index).style.setProperty(n.property,n.value,n.priority):n.type===ue.RemoveProperty&&Ze(r.cssRules,n.index).style.removeProperty(n.property)})}class Fe extends Ii(ce){constructor(t){super(),this._unserializedId=-1,this.mirror=Vi(),this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,r,n){return new Fe}createDocumentType(t,r,n){const o=new Di(t,r,n);return o.ownerDocument=this,o}createElement(t){const r=t.toUpperCase();let n;switch(r){case"AUDIO":case"VIDEO":n=new Li(r);break;case"IFRAME":n=new Pi(r,this.mirror);break;case"CANVAS":n=new Ai(r);break;case"STYLE":n=new Fi(r);break;default:n=new Ke(r);break}return n.ownerDocument=this,n}createComment(t){const r=new $i(t);return r.ownerDocument=this,r}createCDATASection(t){const r=new Wi(t);return r.ownerDocument=this,r}createTextNode(t){const r=new _i(t);return r.ownerDocument=this,r}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=-1}}const Di=Zr(ce);class Ke extends Kr(ce){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class Li extends ki(Ke){}class Ai extends Ke{constructor(){super(...arguments),this.rr_dataURL=null,this.canvasMutations=[]}getContext(){return null}}class Fi extends Ke{constructor(){super(...arguments),this.rules=[]}}class Pi extends Ke{constructor(t,r){super(t),this.contentDocument=new Fe,this.contentDocument.mirror=r}}const _i=qr(ce),$i=Jr(ce),Wi=Qr(ce);function Ui(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function rn(e,t,r,n){let o;switch(e.nodeType){case J.DOCUMENT_NODE:n&&n.nodeName==="IFRAME"?o=n.contentDocument:(o=t,o.compatMode=e.compatMode);break;case J.DOCUMENT_TYPE_NODE:{const l=e;o=t.createDocumentType(l.name,l.publicId,l.systemId);break}case J.ELEMENT_NODE:{const l=e,c=Ui(l);o=t.createElement(c);const a=o;for(const{name:s,value:u}of Array.from(l.attributes))a.attributes[s]=u;l.scrollLeft&&(a.scrollLeft=l.scrollLeft),l.scrollTop&&(a.scrollTop=l.scrollTop);break}case J.TEXT_NODE:o=t.createTextNode(e.textContent||"");break;case J.CDATA_SECTION_NODE:o=t.createCDATASection(e.data);break;case J.COMMENT_NODE:o=t.createComment(e.textContent||"");break;case J.DOCUMENT_FRAGMENT_NODE:o=n.attachShadow({mode:"open"});break;default:return null}let i=r.getMeta(e);return t instanceof Fe&&(i||(i=nn(o,t.unserializedId),r.add(e,i)),t.mirror.add(o,Object.assign({},i))),o}function ji(e,t=Si(),r=new Fe){function n(o,i){const l=rn(o,r,t,i);l!==null&&(i?.nodeName!=="IFRAME"&&o.nodeType!==J.DOCUMENT_FRAGMENT_NODE&&(i?.appendChild(l),l.parentNode=i,l.parentElement=i),o.nodeName==="IFRAME"?n(o.contentDocument,l):(o.nodeType===J.DOCUMENT_NODE||o.nodeType===J.ELEMENT_NODE||o.nodeType===J.DOCUMENT_FRAGMENT_NODE)&&(o.nodeType===J.ELEMENT_NODE&&o.shadowRoot&&n(o.shadowRoot,l),o.childNodes.forEach(c=>n(c,l))))}return n(e,null),r}function Vi(){return new Gi}class Gi{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var r;if(!t)return-1;const n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){const n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function nn(e,t){switch(e.RRNodeType){case $.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case $.DocumentType:{const r=e;return{id:t,type:e.RRNodeType,name:r.name,publicId:r.publicId,systemId:r.systemId}}case $.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case $.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case $.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case $.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}function on(e){return{all:e=e||new Map,on:function(t,r){var n=e.get(t);n?n.push(r):e.set(t,[r])},off:function(t,r){var n=e.get(t);n&&(r?n.splice(n.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var n=e.get(t);n&&n.slice().map(function(o){o(r)}),(n=e.get("*"))&&n.slice().map(function(o){o(t,r)})}}}var Bi=Object.freeze({__proto__:null,default:on});function zi(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const r=e.HTMLElement||e.Element,n=468,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||a,scrollIntoView:r.prototype.scrollIntoView},i=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function l(v){const S=["MSIE ","Trident/","Edge/"];return new RegExp(S.join("|")).test(v)}const c=l(e.navigator.userAgent)?1:0;function a(v,S){this.scrollLeft=v,this.scrollTop=S}function s(v){return .5*(1-Math.cos(Math.PI*v))}function u(v){if(v===null||typeof v!="object"||v.behavior===void 0||v.behavior==="auto"||v.behavior==="instant")return!0;if(typeof v=="object"&&v.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+v.behavior+" is not a valid value for enumeration ScrollBehavior.")}function d(v,S){if(S==="Y")return v.clientHeight+c<v.scrollHeight;if(S==="X")return v.clientWidth+c<v.scrollWidth}function h(v,S){const w=e.getComputedStyle(v,null)["overflow"+S];return w==="auto"||w==="scroll"}function m(v){const S=d(v,"Y")&&h(v,"Y"),w=d(v,"X")&&h(v,"X");return S||w}function p(v){for(;v!==t.body&&m(v)===!1;)v=v.parentNode||v.host;return v}function f(v){const S=i();let w,b,k,M=(S-v.startTime)/n;M=M>1?1:M,w=s(M),b=v.startX+(v.x-v.startX)*w,k=v.startY+(v.y-v.startY)*w,v.method.call(v.scrollable,b,k),(b!==v.x||k!==v.y)&&e.requestAnimationFrame(f.bind(e,v))}function y(v,S,w){let b,k,M,x;const T=i();v===t.body?(b=e,k=e.scrollX||e.pageXOffset,M=e.scrollY||e.pageYOffset,x=o.scroll):(b=v,k=v.scrollLeft,M=v.scrollTop,x=a),f({scrollable:b,method:x,startTime:T,startX:k,startY:M,x:S,y:w})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}y.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){o.scrollBy.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}y.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},r.prototype.scroll=r.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const v=arguments[0].left,S=arguments[0].top;y.call(this,this,typeof v>"u"?this.scrollLeft:~~v,typeof S>"u"?this.scrollTop:~~S)},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},r.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){o.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const v=p(this),S=v.getBoundingClientRect(),w=this.getBoundingClientRect();v!==t.body?(y.call(this,v,v.scrollLeft+w.left-S.left,v.scrollTop+w.top-S.top),e.getComputedStyle(v).position!=="fixed"&&e.scrollBy({left:S.left,top:S.top,behavior:"smooth"})):e.scrollBy({left:w.left,top:w.top,behavior:"smooth"})}}class Hi{constructor(t=[],r){this.timeOffset=0,this.raf=null,this.actions=t,this.speed=r}addAction(t){const r=this.findActionIndex(t);this.actions.splice(r,0,t)}addActions(t){this.actions=this.actions.concat(t)}replaceActions(t){this.actions.length=0,this.actions.splice(0,0,...t)}start(){this.timeOffset=0;let t=performance.now();const{actions:r}=this,n=()=>{const o=performance.now();for(this.timeOffset+=(o-t)*this.speed,t=o;r.length;){const i=r[0];if(this.timeOffset>=i.delay)r.shift(),i.doAction();else break}(r.length>0||this.liveMode)&&(this.raf=requestAnimationFrame(n))};this.raf=requestAnimationFrame(n)}clear(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(t){this.speed=t}toggleLiveMode(t){this.liveMode=t}isActive(){return this.raf!==null}findActionIndex(t){let r=0,n=this.actions.length-1;for(;r<=n;){const o=Math.floor((r+n)/2);if(this.actions[o].delay<t.delay)r=o+1;else if(this.actions[o].delay>t.delay)n=o-1;else return o+1}return r}}function Ft(e,t){if(e.type===R.IncrementalSnapshot&&e.data.source===L.MouseMove){const r=e.data.positions[0].timeOffset,n=e.timestamp+r;return e.delay=n-t,n-t}return e.delay=e.timestamp-t,e.delay}/*! *****************************************************************************
|
|
6
6
|
Copyright (c) Microsoft Corporation.
|
|
7
7
|
|
|
8
8
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -15,7 +15,7 @@ or you can use record.mirror to access the mirror instance during recording.`;q.
|
|
|
15
15
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
16
16
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
17
17
|
PERFORMANCE OF THIS SOFTWARE.
|
|
18
|
-
***************************************************************************** */function sn(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),l=[];try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)l.push(n.value)}catch(c){o={error:c}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return l}var Pe;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Pe||(Pe={}));var an={type:"xstate.init"};function Ft(e){return e===void 0?[]:[].concat(e)}function Me(e){return{type:"xstate.assign",assignment:e}}function ln(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function ct(e){return function(t){return e===t}}function cn(e){return typeof e=="string"?{type:e}:e}function un(e,t){return{value:e,context:t,actions:[],changed:!1,matches:ct(e)}}function dn(e,t,r){var n=t,o=!1;return[e.filter(function(i){if(i.type==="xstate.assign"){o=!0;var l=Object.assign({},n);return typeof i.assignment=="function"?l=i.assignment(n,r):Object.keys(i.assignment).forEach(function(c){l[c]=typeof i.assignment[c]=="function"?i.assignment[c](n,r):i.assignment[c]}),n=l,!1}return!0}),n,o]}function hn(e,t){t===void 0&&(t={});var r=sn(dn(Ft(e.states[e.initial].entry).map(function(l){return ln(l,t.actions)}),e.context,an),2),n=r[0],o=r[1],i={config:e,_options:t,initialState:{value:e.initial,actions:n,context:o,matches:ct(e.initial)},transition:function(l,c){var a,s,u=typeof l=="string"?{value:l,context:e.context}:l,d=u.value,h=u.context,m=cn(c),p=e.states[d];if(p.on){var f=Ft(p.on[m.type]);try{for(var y=function(O){var _=typeof Symbol=="function"&&Symbol.iterator,N=_&&O[_],g=0;if(N)return N.call(O);if(O&&typeof O.length=="number")return{next:function(){return O&&g>=O.length&&(O=void 0),{value:O&&O[g++],done:!O}}};throw new TypeError(_?"Object is not iterable.":"Symbol.iterator is not defined.")}(f),v=y.next();!v.done;v=y.next()){var S=v.value;if(S===void 0)return un(d,h);var w=typeof S=="string"?{target:S}:S,b=w.target,k=w.actions,M=k===void 0?[]:k,x=w.cond,T=x===void 0?function(){return!0}:x,D=b===void 0,W=b??d,V=e.states[W];if(T(h,m)){var U=sn(dn((D?Ft(M):[].concat(p.exit,M,V.entry).filter(function(O){return O})).map(function(O){return ln(O,i._options.actions)}),h,m),3),G=U[0],A=U[1],j=U[2],F=b??d;return{value:F,context:A,actions:G,changed:b!==d||G.length>0||j,matches:ct(F)}}}}catch(O){a={error:O}}finally{try{v&&!v.done&&(s=y.return)&&s.call(y)}finally{if(a)throw a.error}}}return un(d,h)}};return i}var mn=function(e,t){return e.actions.forEach(function(r){var n=r.exec;return n&&n(e.context,t)})};function pn(e){var t=e.initialState,r=Pe.NotStarted,n=new Set,o={_machine:e,send:function(i){r===Pe.Running&&(t=e.transition(t,i),mn(t,cn(i)),n.forEach(function(l){return l(t)}))},subscribe:function(i){return n.add(i),i(t),{unsubscribe:function(){return n.delete(i)}}},start:function(i){if(i){var l=typeof i=="object"?i:{context:e.config.context,value:i};t={value:l.value,actions:[],context:l.context,matches:ct(l.value)}}return r=Pe.Running,mn(t,an),o},stop:function(){return r=Pe.Stopped,n.clear(),o},get state(){return t},get status(){return r}};return o}var Yi=Object.defineProperty,Xi=Object.defineProperties,Zi=Object.getOwnPropertyDescriptors,fn=Object.getOwnPropertySymbols,Ki=Object.prototype.hasOwnProperty,qi=Object.prototype.propertyIsEnumerable,vn=(e,t,r)=>t in e?Yi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ut=(e,t)=>{for(var r in t||(t={}))Ki.call(t,r)&&vn(e,r,t[r]);if(fn)for(var r of fn(t))qi.call(t,r)&&vn(e,r,t[r]);return e},dt=(e,t)=>Xi(e,Zi(t));function Ji(e,t){for(let r=e.length-1;r>=0;r--){const n=e[r];if(n.type===R.Meta&&n.timestamp<=t)return e.slice(r)}return e}function Qi(e,{getCastFn:t,applyEventsSynchronously:r,emitter:n}){const o=hn({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]},REPLACE_EVENTS:{target:"playing",actions:["replaceEvents"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]},REPLACE_EVENTS:{target:"paused",actions:["replaceEvents"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:Me({lastPlayedEvent:(i,l)=>l.type==="CAST_EVENT"?l.payload.event:i.lastPlayedEvent}),recordTimeOffset:Me((i,l)=>{let c=i.timeOffset;return"payload"in l&&"timeOffset"in l.payload&&(c=l.payload.timeOffset),dt(ut({},i),{timeOffset:c,baselineTime:i.events[0].timestamp+c})}),play(i){var l;const{timer:c,events:a,baselineTime:s,lastPlayedEvent:u}=i;c.clear();for(const f of a)At(f,s);const d=Ji(a,s);let h=u?.timestamp;u?.type===R.IncrementalSnapshot&&u.data.source===L.MouseMove&&(h=u.timestamp+((l=u.data.positions[0])==null?void 0:l.timeOffset)),s<(h||0)&&n.emit(Y.PlayBack);const m=new Array,p=new Array;for(const f of d)if(!(h&&h<s&&(f.timestamp<=h||f===u)))if(f.timestamp<s)m.push(f);else{const y=t(f,!1);p.push({doAction:()=>{y()},delay:f.delay})}r(m),n.emit(Y.Flush),c.addActions(p),c.start()},pause(i){i.timer.clear()},resetLastPlayedEvent:Me(i=>dt(ut({},i),{lastPlayedEvent:null})),startLive:Me({baselineTime:(i,l)=>(i.timer.toggleLiveMode(!0),i.timer.start(),l.type==="TO_LIVE"&&l.payload.baselineTime?l.payload.baselineTime:Date.now())}),replaceEvents:Me((i,l)=>{const{events:c,timer:a,baselineTime:s}=i;if(l.type==="REPLACE_EVENTS"){const{events:u}=l.payload;c.length=0;const d=[];for(const h of u)if(At(h,s),c.push(h),h.timestamp>=a.timeOffset+s){const m=t(h,!1);d.push({doAction:()=>{m()},delay:h.delay})}a.isActive()&&a.replaceActions(d)}return dt(ut({},i),{events:c})}),addEvent:Me((i,l)=>{const{baselineTime:c,timer:a,events:s}=i;if(l.type==="ADD_EVENT"){const{event:u}=l.payload;At(u,c);let d=s.length-1;if(!s[d]||s[d].timestamp<=u.timestamp)s.push(u);else{let p=-1,f=0;for(;f<=d;){const y=Math.floor((f+d)/2);s[y].timestamp<=u.timestamp?f=y+1:d=y-1}p===-1&&(p=f),s.splice(p,0,u)}const h=u.timestamp<c,m=t(u,h);h?m():a.isActive()&&a.addAction({doAction:()=>{m()},delay:u.delay})}return dt(ut({},i),{events:s})})}});return pn(o)}function es(e){const t=hn({id:"speed",context:e,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(r,n)=>{"payload"in n&&r.timer.setSpeed(n.payload.speed)},recordSpeed:Me({normalSpeed:r=>r.timer.speed}),restoreSpeed:r=>{r.timer.setSpeed(r.normalSpeed)}}});return pn(t)}const ts=e=>["noscript { display: none !important; }",`.${e} { background: currentColor; border-radius: 5px; }`,`.${e}:hover::after {content: 'Redacted'; color: white; background: black; text-align: center; width: 100%; display: block;}`];var rs=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});const gn=new Map;function yn(e,t){let r=gn.get(e);return r||(r=new Map,gn.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function Se(e,t,r){return n=>rs(this,null,function*(){if(n&&typeof n=="object"&&"rr_type"in n)if(r&&(r.isUnchanged=!1),n.rr_type==="ImageBitmap"&&"args"in n){const o=yield Se(e,t,r)(n.args);return yield createImageBitmap.apply(null,o)}else if("index"in n){if(r||t===null)return n;const{rr_type:o,index:i}=n;return yn(t,o)[i]}else if("args"in n){const{rr_type:o,args:i}=n,l=window[o];return new l(...yield Promise.all(i.map(Se(e,t,r))))}else{if("base64"in n)return Qo(n.base64);if("src"in n){const o=e.get(n.src);if(o)return o;{const i=new Image;return i.src=n.src,e.set(n.src,i),i}}else if("data"in n&&n.rr_type==="Blob"){const o=yield Promise.all(n.data.map(Se(e,t,r)));return new Blob(o,{type:n.type})}}else if(Array.isArray(n))return yield Promise.all(n.map(Se(e,t,r)));return n})}var ns=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});function os(e,t){try{return t===ve.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}const is=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function ss(e,t){if(!(t!=null&&t.constructor))return;const{name:r}=t.constructor;if(!is.includes(r))return;const n=yn(e,r);n.includes(t)||n.push(t)}function as(e){return ns(this,arguments,function*({mutation:t,target:r,type:n,imageMap:o,errorHandler:i}){try{const l=os(r,n);if(!l)return;if(t.setter){l[t.property]=t.args[0];return}const c=l[t.property],a=yield Promise.all(t.args.map(Se(o,l))),s=c.apply(l,a);ss(l,s)}catch(l){i(t,l)}})}var ls=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});function cs(e){return ls(this,arguments,function*({event:t,mutation:r,target:n,imageMap:o,errorHandler:i}){try{const l=n.getContext("2d");if(r.setter){l[r.property]=r.args[0];return}const c=l[r.property];if(r.property==="drawImage"&&typeof r.args[0]=="string")o.get(t),c.apply(l,r.args);else{const a=yield Promise.all(r.args.map(Se(o,l)));c.apply(l,a)}}catch(l){i(r,l)}})}var us=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});function bn(e){return us(this,arguments,function*({event:t,mutation:r,target:n,imageMap:o,canvasEventMap:i,errorHandler:l}){try{const c=i.get(t)||r,a="commands"in c?c.commands:[c];if([ve.WebGL,ve.WebGL2].includes(r.type)){for(let s=0;s<a.length;s++){const u=a[s];yield as({mutation:u,type:r.type,target:n,imageMap:o,errorHandler:l})}return}for(let s=0;s<a.length;s++){const u=a[s];yield cs({event:t,mutation:u,target:n,imageMap:o,errorHandler:l})}}catch(c){l(r,c)}})}var ds=Object.defineProperty,hs=Object.defineProperties,ms=Object.getOwnPropertyDescriptors,Sn=Object.getOwnPropertySymbols,ps=Object.prototype.hasOwnProperty,fs=Object.prototype.propertyIsEnumerable,wn=(e,t,r)=>t in e?ds(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_e=(e,t)=>{for(var r in t||(t={}))ps.call(t,r)&&wn(e,r,t[r]);if(Sn)for(var r of Sn(t))fs.call(t,r)&&wn(e,r,t[r]);return e},Pt=(e,t)=>hs(e,ms(t)),_t=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});const Nn=10*1e3,Tn=2*1e3,En=1*1e3,Cn=60*60*1e3,vs=on||Bi,$t="[replayer]",Wt={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Ut(e){return e.type==R.IncrementalSnapshot&&(e.data.source==L.TouchMove||e.data.source==L.MouseInteraction&&e.data.type==ee.TouchStart)}class gs{constructor(t,r){if(this.usingVirtualDom=!1,this.virtualDom=new Fe,this.mouseTail=null,this.tailPositions=[],this.emitter=vs(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=mr(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=tr(),this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,this.handleResize=c=>{this.iframe.style.display="inherit";for(const a of[this.mouseTail,this.iframe])!a||(a.setAttribute("width",String(c.width)),a.setAttribute("height",String(c.height)))},this.applyEventsSynchronously=c=>{for(const a of c){switch(a.type){case R.DomContentLoaded:case R.Load:case R.Custom:continue;case R.FullSnapshot:case R.Meta:case R.Plugin:case R.IncrementalSnapshot:break}this.getCastFn(a,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null},this.getCastFn=(c,a=!1)=>{let s;switch(c.type){case R.DomContentLoaded:case R.Load:break;case R.Custom:s=()=>{this.emitter.emit(Y.CustomEvent,c)};break;case R.Meta:s=()=>this.emitter.emit(Y.Resize,{width:c.data.width,height:c.data.height});break;case R.FullSnapshot:s=()=>{if(this.firstFullSnapshot){if(this.firstFullSnapshot===c){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(c,a),this.iframe.contentWindow.scrollTo(c.data.initialOffset)};break;case R.IncrementalSnapshot:s=()=>{if(this.applyIncremental(c,a),!a&&(this.handleInactivity(c.timestamp),c===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const u of this.service.state.context.events)if(!(u.timestamp<=c.timestamp)&&this.isUserInteraction(u)){u.delay-c.delay>Nn*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=u);break}if(this.nextUserInteractionEvent){const u=this.nextUserInteractionEvent.delay-c.delay,d={speed:Math.min(Math.round(u/Tn),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:d}),this.emitter.emit(Y.SkipStart,d)}}};break}return()=>{s&&s();for(const d of this.config.plugins||[])d.handler(c,a,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:c}});const u=this.service.state.context.events.length-1;if(c===this.service.state.context.events[u]){const d=()=>{u<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(Y.Finish))};c.type===R.IncrementalSnapshot&&c.data.source===L.MouseMove&&c.data.positions.length?setTimeout(()=>{d()},Math.max(0,-c.data.positions[0].timeOffset+50)):d()}this.emitter.emit(Y.EventCast,c)}},!(r!=null&&r.liveMode)&&t.length<2)throw new Error("Replayer need at least 2 events.");const n={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"highlight-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:Wt,useVirtualDom:!0,inactiveThreshold:.02,inactiveSkipTime:Tn};this.config=Object.assign({},n,r),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(Y.Resize,this.handleResize),this.setupDom(),this.emitter.on(Y.Flush,()=>{if(this.usingVirtualDom){const c={mirror:this.mirror,applyCanvas:(a,s,u)=>{bn({event:a,mutation:s,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this)};if(me(this.iframe.contentDocument,this.virtualDom,c,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const a in this.legacy_missingNodeRetryMap)try{const s=this.legacy_missingNodeRetryMap[a],u=Lt(s.node,this.mirror,this.virtualDom.mirror);me(u,s.node,c,this.virtualDom.mirror),s.node=u}catch(s){this.config.showWarning&&console.warn(s)}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null}),this.emitter.on(Y.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset()});const o=new Hi([],r?.speed||n.speed);this.service=Qi({events:t.map(c=>r&&r.unpackFn?r.unpackFn(c):c).sort((c,a)=>c.timestamp-a.timestamp),timer:o,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(c=>{this.emitter.emit(Y.StateChange,{player:c})}),this.speedService=es({normalSpeed:-1,timer:o}),this.speedService.start(),this.speedService.subscribe(c=>{this.emitter.emit(Y.StateChange,{speed:c})});const i=this.service.state.context.events.find(c=>c.type===R.Meta),l=this.service.state.context.events.find(c=>c.type===R.FullSnapshot);if(i){const{width:c,height:a}=i.data;setTimeout(()=>{this.emitter.emit(Y.Resize,{width:c,height:a})},0)}l&&setTimeout(()=>{this.firstFullSnapshot||(this.firstFullSnapshot=l,this.rebuildFullSnapshot(l),this.iframe.contentWindow.scrollTo(l.data.initialOffset))},1),this.service.state.context.events.find(Ut)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,r){return this.emitter.on(t,r),this}off(t,r){return this.emitter.off(t,r),this}setConfig(t){Object.keys(t).forEach(r=>{t[r],this.config[r]=t[r]}),this.config.skipInactive||this.backToNormal(),typeof t.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail<"u"&&(t.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getActivityIntervals(){if(this.activityIntervals.length==0){const t=[],r=this.getMetaData(),n=[{timestamp:r.startTime},...this.service.state.context.events.filter(l=>this.isUserInteraction(l)),{timestamp:r.endTime}];for(let l=1;l<n.length;l++){const c=n[l-1],a=n[l];a.timestamp-c.timestamp>Nn?t.push({startTime:c.timestamp,endTime:a.timestamp,duration:a.timestamp-c.timestamp,active:!1}):t.push({startTime:c.timestamp,endTime:a.timestamp,duration:a.timestamp-c.timestamp,active:!0})}const o=[];let i=t[0];for(let l=1;l<t.length;l++)t[l].active!=t[l-1].active&&(o.push({startTime:i.startTime,endTime:t[l-1].endTime,duration:t[l-1].endTime-i.startTime,active:t[l-1].active}),i=t[l]);i&&t.length>0&&o.push({startTime:i.startTime,endTime:t[t.length-1].endTime,duration:t[t.length-1].endTime-i.startTime,active:t[t.length-1].active}),i=o[0];for(let l=1;l<o.length;l++)(!o[l].active&&o[l].duration>this.config.inactiveThreshold*r.totalTime||!o[l-1].active&&o[l-1].duration>this.config.inactiveThreshold*r.totalTime)&&(this.activityIntervals.push({startTime:i.startTime,endTime:o[l-1].endTime,duration:o[l-1].endTime-i.startTime,active:o[l-1].active}),i=o[l]);i&&o.length>0&&this.activityIntervals.push({startTime:i.startTime,endTime:o[o.length-1].endTime,duration:o[o.length-1].endTime-i.startTime,active:o[o.length-1].active})}return this.activityIntervals}getMetaData(){const t=this.service.state.context.events[0],r=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:r.timestamp,totalTime:r.timestamp-t.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:t,events:r}=this.service.state.context;return t-r[0].timestamp}getMirror(){return this.mirror}play(t=0){var r,n;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(n=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||n.classList.remove("rrweb-paused"),this.emitter.emit(Y.Start),this.handleInactivity(this.getMetaData().startTime+t,!0)}pause(t){var r,n;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(n=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||n.classList.add("rrweb-paused"),this.emitter.emit(Y.Pause)}resume(t=0){console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(t),this.emitter.emit(Y.Resume)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const r=this.config.unpackFn?this.config.unpackFn(t):t;Ut(r)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:r}}))}replaceEvents(t){for(const r of t)if(Ut(r)){this.mouse.classList.add("touch-device");break}this.service.send({type:"REPLACE_EVENTS",payload:{events:t}})}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=mr()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const t=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&t.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",t.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(zi(this.iframe.contentWindow,this.iframe.contentDocument),Ct(this.iframe.contentWindow))}handleInactivity(t,r){if((t===this.inactiveEndTimestamp||r)&&(this.inactiveEndTimestamp=null,this.backToNormal()),this.config.skipInactive&&!this.inactiveEndTimestamp){for(const n of this.getActivityIntervals())if(t>=n.startTime&&t<n.endTime&&!n.active){this.inactiveEndTimestamp=n.endTime;break}if(this.inactiveEndTimestamp){const n=this.inactiveEndTimestamp-t,o={speed:n/Cn*this.config.inactiveSkipTime<En?n/En:Math.round(Math.max(n,Cn)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:o}),this.emitter.emit(Y.SkipStart,o)}}}rebuildFullSnapshot(t,r=!1){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const n=[];Eo(t.data.node,{doc:this.iframe.contentDocument,afterAppend:l=>{this.collectIframeAndAttachDocument(n,l)},cache:this.cache,mirror:this.mirror});for(const{mutationInQueue:l,builtNode:c}of n)this.attachDocumentToIframe(l,c),this.newDocumentQueue=this.newDocumentQueue.filter(a=>a!==l);const{documentElement:o,head:i}=this.iframe.contentDocument;this.insertStyleRules(o,i),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(Y.FullsnapshotRebuilded,t),r||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,r){const n=ts(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&n.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,nn(o,this.virtualDom.unserializedId)),t.insertBefore(o,r);for(let i=0;i<n.length;i++)o.rules.push({cssText:n[i],type:ue.Insert,index:i})}else{const o=document.createElement("style");t.insertBefore(o,r);for(let i=0;i<n.length;i++)o.sheet.insertRule(n[i],i)}}attachDocumentToIframe(t,r){const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,o=[];ot(t.node,{doc:r.contentDocument,mirror:n,hackCss:!0,skipChild:!1,afterAppend:i=>{this.collectIframeAndAttachDocument(o,i);const l=n.getMeta(i);if(l?.type===P.Element&&l?.tagName.toUpperCase()==="HTML"){const{documentElement:c,head:a}=r.contentDocument;this.insertStyleRules(c,a)}},cache:this.cache});for(const{mutationInQueue:i,builtNode:l}of o)this.attachDocumentToIframe(i,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==i)}collectIframeAndAttachDocument(t,r){if(De(r,this.mirror)){const n=this.newDocumentQueue.find(o=>o.parentId===this.mirror.getId(r));n&&t.push({mutationInQueue:n,builtNode:r})}}waitForStylesheetLoad(){var t;const r=(t=this.iframe.contentDocument)==null?void 0:t.head;if(r){const n=new Set;let o,i=this.service.state;const l=()=>{i=this.service.state};this.emitter.on(Y.Start,l),this.emitter.on(Y.Pause,l);const c=()=>{this.emitter.off(Y.Start,l),this.emitter.off(Y.Pause,l)};r.querySelectorAll('link[rel="stylesheet"]').forEach(a=>{a.sheet||(n.add(a),a.addEventListener("load",()=>{n.delete(a),n.size===0&&o!==-1&&(i.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(Y.LoadStylesheetEnd),o&&clearTimeout(o),c())}))}),n.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(Y.LoadStylesheetStart),o=setTimeout(()=>{i.matches("playing")&&this.play(this.getCurrentTime()),o=-1,c()},this.config.loadTimeout))}}preloadAllImages(){return _t(this,null,function*(){this.service.state;const t=()=>{this.service.state};this.emitter.on(Y.Start,t),this.emitter.on(Y.Pause,t);const r=[];for(const n of this.service.state.context.events)n.type===R.IncrementalSnapshot&&n.data.source===L.CanvasMutation&&(r.push(this.deserializeAndPreloadCanvasEvents(n.data,n)),("commands"in n.data?n.data.commands:[n.data]).forEach(o=>{this.preloadImages(o,n)}));return Promise.all(r)})}preloadImages(t,r){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(r)){const n=document.createElement("canvas"),o=n.getContext("2d"),i=o?.createImageData(n.width,n.height);i?.data,JSON.parse(t.args[0]),o?.putImageData(i,0,0)}}deserializeAndPreloadCanvasEvents(t,r){return _t(this,null,function*(){if(!this.canvasEventMap.has(r)){const n={isUnchanged:!0};if("commands"in t){const o=yield Promise.all(t.commands.map(i=>_t(this,null,function*(){const l=yield Promise.all(i.args.map(Se(this.imageMap,null,n)));return Pt(_e({},i),{args:l})})));n.isUnchanged===!1&&this.canvasEventMap.set(r,Pt(_e({},t),{commands:o}))}else{const o=yield Promise.all(t.args.map(Se(this.imageMap,null,n)));n.isUnchanged===!1&&this.canvasEventMap.set(r,Pt(_e({},t),{args:o}))}}})}applyIncremental(t,r){var n,o,i,l,c,a;const{data:s}=t;switch(s.source){case L.Mutation:{try{this.applyMutation(s,r)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,s)}break}case L.Drag:case L.TouchMove:case L.MouseMove:if(r){const u=s.positions[s.positions.length-1];this.mousePos={x:u.x,y:u.y,id:u.id,debugData:s}}else s.positions.forEach(u=>{const d={doAction:()=>{this.moveAndHover(u.x,u.y,u.id,r,s)},delay:u.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(d)}),this.timer.addAction({doAction(){},delay:t.delay-((n=s.positions[0])==null?void 0:n.timeOffset)});break;case L.MouseInteraction:{if(s.id===-1||r)break;const u=new Event(ee[s.type].toLowerCase()),d=this.mirror.getNode(s.id);if(!d)return this.debugNodeNotFound(s,s.id);this.emitter.emit(Y.MouseInteraction,{type:s.type,target:d});const{triggerFocus:h}=this.config;switch(s.type){case ee.Blur:"blur"in d&&d.blur();break;case ee.Focus:h&&d.focus&&d.focus({preventScroll:!0});break;case ee.Click:case ee.TouchStart:case ee.TouchEnd:r?(s.type===ee.TouchStart?this.touchActive=!0:s.type===ee.TouchEnd&&(this.touchActive=!1),this.mousePos={x:s.x,y:s.y,id:s.id,debugData:s}):(s.type===ee.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(s.x,s.y,s.id,r,s),s.type===ee.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):s.type===ee.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):s.type===ee.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case ee.TouchCancel:r?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:d.dispatchEvent(u)}break}case L.Scroll:{if(s.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.scrollData=s;break}this.applyScroll(s,r);break}case L.ViewportResize:this.emitter.emit(Y.Resize,{width:s.width,height:s.height});break;case L.Input:{if(s.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.inputData=s;break}this.applyInput(s);break}case L.MediaInteraction:{const u=this.usingVirtualDom?this.virtualDom.mirror.getNode(s.id):this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u;try{s.currentTime&&(d.currentTime=s.currentTime),s.volume&&(d.volume=s.volume),s.muted&&(d.muted=s.muted),s.type===Ce.Pause&&d.pause(),s.type===Ce.Play&&d.play()}catch(h){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${h.message||h}`)}break}case L.StyleSheetRule:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.rules;(o=s.adds)==null||o.forEach(({rule:h,index:m})=>d?.push({cssText:h,index:m,type:ue.Insert})),(i=s.removes)==null||i.forEach(({index:h})=>d?.push({index:h,type:ue.Remove}))}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.sheet;(l=s.adds)==null||l.forEach(({rule:h,index:m})=>{try{if(Array.isArray(m)){const{positions:p,index:f}=xt(m);Le(d.cssRules,p).insertRule(h,f)}else{const p=m===void 0?void 0:Math.min(m,d.cssRules.length);d.insertRule(h,p)}}catch{}}),(c=s.removes)==null||c.forEach(({index:h})=>{try{if(Array.isArray(h)){const{positions:m,index:p}=xt(h);Le(d.cssRules,m).deleteRule(p||0)}else d?.deleteRule(h)}catch{}})}break}case L.StyleDeclaration:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.rules;s.set&&d.push(_e({type:ue.SetProperty,index:s.index},s.set)),s.remove&&d.push(_e({type:ue.RemoveProperty,index:s.index},s.remove))}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.sheet;s.set&&Le(d.rules,s.index).style.setProperty(s.set.property,s.set.value,s.set.priority),s.remove&&Le(d.rules,s.index).style.removeProperty(s.remove.property)}break}case L.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.canvasMutations.push({event:t,mutation:s})}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);bn({event:t,mutation:s,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case L.Font:{try{const u=new FontFace(s.family,s.buffer?new Uint8Array(JSON.parse(s.fontSource)):s.fontSource,s.descriptors);(a=this.iframe.contentDocument)==null||a.fonts.add(u)}catch(u){this.config.showWarning&&console.warn(u)}break}}}applyMutation(t,r){if(this.config.useVirtualDom&&!this.usingVirtualDom&&r&&(this.usingVirtualDom=!0,ji(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const s in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[s],d=rn(u.node,this.virtualDom,this.mirror);d&&(u.node=d)}catch(u){this.config.showWarning&&console.warn(u)}const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes.forEach(s=>{var u;const d=n.getNode(s.id);if(!d)return t.removes.find(m=>m.id===s.parentId)?void 0:this.warnNodeNotFound(t,s.id);let h=n.getNode(s.parentId);if(!h)return this.warnNodeNotFound(t,s.parentId);if(s.isShadow&&ze(h)&&(h=h.shadowRoot),n.removeNodeFromMap(d),h)try{h.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&h.nodeName==="STYLE"&&((u=h.rules)==null?void 0:u.length)>0&&(h.rules=[])}catch(m){if(m instanceof DOMException)this.warn("parent could not remove child in mutation",h,d,t);else throw m}});const o=_e({},this.legacy_missingNodeRetryMap),i=[],l=s=>{let u=null;return s.nextId&&(u=n.getNode(s.nextId)),s.nextId!==null&&s.nextId!==void 0&&s.nextId!==-1&&!u},c=s=>{var u;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let d=n.getNode(s.parentId);if(!d)return s.node.type===P.Document?this.newDocumentQueue.push(s):i.push(s);s.node.isShadow&&(ze(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let h=null,m=null;if(s.previousId&&(h=n.getNode(s.previousId)),s.nextId&&(m=n.getNode(s.nextId)),l(s))return i.push(s);if(s.node.rootId&&!n.getNode(s.node.rootId))return;const p=s.node.rootId?n.getNode(s.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(De(d,n)){this.attachDocumentToIframe(s,d);return}const f=ot(s.node,{doc:p,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache});if(s.previousId===-1||s.nextId===-1){o[s.node.id]={node:f,mutation:s};return}const y=n.getMeta(d);if(y&&y.type===P.Element&&y.tagName==="textarea"&&s.node.type===P.Text){const v=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const S of v)S.nodeType===d.TEXT_NODE&&d.removeChild(S)}if(h&&h.nextSibling&&h.nextSibling.parentNode)d.insertBefore(f,h.nextSibling);else if(m&&m.parentNode)d.contains(m)?d.insertBefore(f,m):d.insertBefore(f,null);else{if(d===p)for(;p.firstChild;)p.removeChild(p.firstChild);d.appendChild(f)}if(this.usingVirtualDom&&f.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[]),De(f,this.mirror)){const v=this.mirror.getId(f),S=this.newDocumentQueue.find(w=>w.parentId===v);S&&(this.attachDocumentToIframe(S,f),this.newDocumentQueue=this.newDocumentQueue.filter(w=>w!==S))}(s.previousId||s.nextId)&&this.legacy_resolveMissingNode(o,d,f,s)};t.adds.forEach(s=>{c(s)});const a=Date.now();for(;i.length;){const s=vr(i);if(i.length=0,Date.now()-a>500){this.warn("Timeout in the loop, please check the resolve tree data:",s);break}for(const u of s)n.getNode(u.value.parentId)?It(u,d=>{c(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(o).length&&Object.assign(this.legacy_missingNodeRetryMap,o),gr(t.texts).forEach(s=>{var u;const d=n.getNode(s.id);if(!d)return t.removes.find(h=>h.id===s.id)?void 0:this.warnNodeNotFound(t,s.id);if(d.textContent=s.value,this.usingVirtualDom){const h=d.parentNode;((u=h?.rules)==null?void 0:u.length)>0&&(h.rules=[])}}),t.attributes.forEach(s=>{const u=n.getNode(s.id);if(!u)return t.removes.find(d=>d.id===s.id)?void 0:this.warnNodeNotFound(t,s.id);for(const d in s.attributes)if(typeof d=="string"){const h=s.attributes[d];if(h===null)u.removeAttribute(d);else if(typeof h=="string")try{u.setAttribute(d,h)}catch(m){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",m)}else if(d==="style"){const m=h,p=u;for(const f in m)if(m[f]===!1)p.style.removeProperty(f);else if(m[f]instanceof Array){const y=m[f];p.style.setProperty(f,y[0],y[1])}else{const y=m[f];p.style.setProperty(f,y)}}}})}applyScroll(t,r){const n=this.mirror.getNode(t.id);if(!n)return this.debugNodeNotFound(t,t.id);const o=this.mirror.getMeta(n);if(n===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else if(o?.type===P.Document)n.defaultView.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else try{n.scrollTop=t.y,n.scrollLeft=t.x}catch{}}applyInput(t){const r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);try{r.checked=t.isChecked,r.value=t.text}catch{}}legacy_resolveMissingNode(t,r,n,o){const{previousId:i,nextId:l}=o,c=i&&t[i],a=l&&t[l];if(c){const{node:s,mutation:u}=c;r.insertBefore(s,n),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,s,u)}if(a){const{node:s,mutation:u}=a;r.insertBefore(s,n.nextSibling),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,s,u)}}moveAndHover(t,r,n,o,i){const l=this.mirror.getNode(n);if(!l)return this.debugNodeNotFound(i,n);const c=Mt(l,this.iframe),a=t*c.absoluteScale+c.x,s=r*c.absoluteScale+c.y;this.mouse.style.left=`${a}px`,this.mouse.style.top=`${s}px`,o||this.drawMouseTail({x:a,y:s}),this.hoverElements(l)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:r,lineWidth:n,strokeStyle:o,duration:i}=this.config.mouseTail===!0?Wt:Object.assign({},Wt,this.config.mouseTail),l=()=>{if(!this.mouseTail)return;const c=this.mouseTail.getContext("2d");!c||!this.tailPositions.length||(c.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),c.beginPath(),c.lineWidth=n,c.lineCap=r,c.strokeStyle=o,c.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(a=>c.lineTo(a.x,a.y)),c.stroke())};this.tailPositions.push(t),l(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(c=>c!==t),l()},i/this.speedService.state.context.timer.speed)}hoverElements(t){var r;(r=this.iframe.contentDocument)==null||r.querySelectorAll(".\\:hover").forEach(o=>{o.classList.remove(":hover")});let n=t;for(;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement}isUserInteraction(t){return t.type!==R.IncrementalSnapshot?!1:t.data.source>L.Mutation&&t.data.source<=L.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(Y.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,r){this.warn(`Node with id '${r}' not found. `,t)}warnCanvasMutationFailed(t,r){this.warn("Has error on canvas update",r,"canvas mutation:",t)}debugNodeNotFound(t,r){this.debug($t,`Node with id '${r}' not found. `,t)}warn(...t){!this.config.showWarning||console.warn($t,...t)}debug(...t){!this.config.showDebug||console.log($t,...t)}}const{addCustomEvent:ys}=ke,{freezePage:bs}=ke;var re=Uint8Array,ne=Uint16Array,qe=Uint32Array,ht=new re([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),mt=new re([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),jt=new re([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),In=function(e,t){for(var r=new ne(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var o=new qe(r[30]),n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return[r,o]},kn=In(ht,2),Mn=kn[0],Vt=kn[1];Mn[28]=258,Vt[258]=28;for(var xn=In(mt,0),Ss=xn[0],On=xn[1],Gt=new ne(32768),K=0;K<32768;++K){var we=(K&43690)>>>1|(K&21845)<<1;we=(we&52428)>>>2|(we&13107)<<2,we=(we&61680)>>>4|(we&3855)<<4,Gt[K]=((we&65280)>>>8|(we&255)<<8)>>>1}for(var pe=function(e,t,r){for(var n=e.length,o=0,i=new ne(t);o<n;++o)++i[e[o]-1];var l=new ne(t);for(o=0;o<t;++o)l[o]=l[o-1]+i[o-1]<<1;var c;if(r){c=new ne(1<<t);var a=15-t;for(o=0;o<n;++o)if(e[o])for(var s=o<<4|e[o],u=t-e[o],d=l[e[o]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)c[Gt[d]>>>a]=s}else for(c=new ne(n),o=0;o<n;++o)c[o]=Gt[l[e[o]-1]++]>>>15-e[o];return c},Ne=new re(288),K=0;K<144;++K)Ne[K]=8;for(var K=144;K<256;++K)Ne[K]=9;for(var K=256;K<280;++K)Ne[K]=7;for(var K=280;K<288;++K)Ne[K]=8;for(var Je=new re(32),K=0;K<32;++K)Je[K]=5;var ws=pe(Ne,9,0),Ns=pe(Ne,9,1),Ts=pe(Je,5,0),Es=pe(Je,5,1),Bt=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},de=function(e,t,r){var n=t/8>>0;return(e[n]|e[n+1]<<8)>>>(t&7)&r},zt=function(e,t){var r=t/8>>0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>>(t&7)},Ht=function(e){return(e/8>>0)+(e&7&&1)},Yt=function(e,t,r){(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length);var n=new(e instanceof ne?ne:e instanceof qe?qe:re)(r-t);return n.set(e.subarray(t,r)),n},Cs=function(e,t,r){var n=e.length,o=!t||r,i=!r||r.i;r||(r={}),t||(t=new re(n*3));var l=function(oe){var B=t.length;if(oe>B){var X=new re(Math.max(B*2,oe));X.set(t),t=X}},c=r.f||0,a=r.p||0,s=r.b||0,u=r.l,d=r.d,h=r.m,m=r.n,p=n*8;do{if(!u){r.f=c=de(e,a,1);var f=de(e,a+1,3);if(a+=3,f)if(f==1)u=Ns,d=Es,h=9,m=5;else if(f==2){var w=de(e,a,31)+257,b=de(e,a+10,15)+4,k=w+de(e,a+5,31)+1;a+=14;for(var M=new re(k),x=new re(19),T=0;T<b;++T)x[jt[T]]=de(e,a+T*3,7);a+=b*3;var D=Bt(x),W=(1<<D)-1;if(!i&&a+k*(D+7)>p)break;for(var V=pe(x,D,1),T=0;T<k;){var U=V[de(e,a,W)];a+=U&15;var y=U>>>4;if(y<16)M[T++]=y;else{var G=0,A=0;for(y==16?(A=3+de(e,a,3),a+=2,G=M[T-1]):y==17?(A=3+de(e,a,7),a+=3):y==18&&(A=11+de(e,a,127),a+=7);A--;)M[T++]=G}}var j=M.subarray(0,w),F=M.subarray(w);h=Bt(j),m=Bt(F),u=pe(j,h,1),d=pe(F,m,1)}else throw"invalid block type";else{var y=Ht(a)+4,v=e[y-4]|e[y-3]<<8,S=y+v;if(S>n){if(i)throw"unexpected EOF";break}o&&l(s+v),t.set(e.subarray(y,S),s),r.b=s+=v,r.p=a=S*8;continue}if(a>p)throw"unexpected EOF"}o&&l(s+131072);for(var O=(1<<h)-1,_=(1<<m)-1,N=h+m+18;i||a+N<p;){var G=u[zt(e,a)&O],g=G>>>4;if(a+=G&15,a>p)throw"unexpected EOF";if(!G)throw"invalid length/literal";if(g<256)t[s++]=g;else if(g==256){u=null;break}else{var I=g-254;if(g>264){var T=g-257,E=ht[T];I=de(e,a,(1<<E)-1)+Mn[T],a+=E}var C=d[zt(e,a)&_],z=C>>>4;if(!C)throw"invalid distance";a+=C&15;var F=Ss[z];if(z>3){var E=mt[z];F+=zt(e,a)&(1<<E)-1,a+=E}if(a>p)throw"unexpected EOF";o&&l(s+131072);for(var H=s+I;s<H;s+=4)t[s]=t[s-F],t[s+1]=t[s+1-F],t[s+2]=t[s+2-F],t[s+3]=t[s+3-F];s=H}}r.l=u,r.p=a,r.b=s,u&&(c=1,r.m=h,r.d=d,r.n=m)}while(!c);return s==t.length?t:Yt(t,0,s)},ge=function(e,t,r){r<<=t&7;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8},Qe=function(e,t,r){r<<=t&7;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},Xt=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,i=r.slice();if(!o)return[new re(0),0];if(o==1){var l=new re(r[0].s+1);return l[r[0].s]=1,[l,1]}r.sort(function(k,M){return k.f-M.f}),r.push({s:-1,f:25001});var c=r[0],a=r[1],s=0,u=1,d=2;for(r[0]={s:-1,f:c.f+a.f,l:c,r:a};u!=o-1;)c=r[r[s].f<r[d].f?s++:d++],a=r[s!=u&&r[s].f<r[d].f?s++:d++],r[u++]={s:-1,f:c.f+a.f,l:c,r:a};for(var h=i[0].s,n=1;n<o;++n)i[n].s>h&&(h=i[n].s);var m=new ne(h+1),p=Zt(r[u-1],m,0);if(p>t){var n=0,f=0,y=p-t,v=1<<y;for(i.sort(function(M,x){return m[x.s]-m[M.s]||M.f-x.f});n<o;++n){var S=i[n].s;if(m[S]>t)f+=v-(1<<p-m[S]),m[S]=t;else break}for(f>>>=y;f>0;){var w=i[n].s;m[w]<t?f-=1<<t-m[w]++-1:++n}for(;n>=0&&f;--n){var b=i[n].s;m[b]==t&&(--m[b],++f)}p=t}return[new re(m),p]},Zt=function(e,t,r){return e.s==-1?Math.max(Zt(e.l,t,r+1),Zt(e.r,t,r+1)):t[e.s]=r},Rn=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new ne(++t),n=0,o=e[0],i=1,l=function(a){r[n++]=a},c=1;c<=t;++c)if(e[c]==o&&c!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)l(32754);i>2&&(l(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(l(o),--i;i>6;i-=6)l(8304);i>2&&(l(i-3<<5|8208),i=0)}for(;i--;)l(o);i=1,o=e[c]}return[r.subarray(0,n),t]},et=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},pt=function(e,t,r){var n=r.length,o=Ht(t+2);e[o]=n&255,e[o+1]=n>>>8,e[o+2]=e[o]^255,e[o+3]=e[o+1]^255;for(var i=0;i<n;++i)e[o+i+4]=r[i];return(o+4+n)*8},Dn=function(e,t,r,n,o,i,l,c,a,s,u){ge(t,u++,r),++o[256];for(var d=Xt(o,15),h=d[0],m=d[1],p=Xt(i,15),f=p[0],y=p[1],v=Rn(h),S=v[0],w=v[1],b=Rn(f),k=b[0],M=b[1],x=new ne(19),T=0;T<S.length;++T)x[S[T]&31]++;for(var T=0;T<k.length;++T)x[k[T]&31]++;for(var D=Xt(x,7),W=D[0],V=D[1],U=19;U>4&&!W[jt[U-1]];--U);var G=s+5<<3,A=et(o,Ne)+et(i,Je)+l,j=et(o,h)+et(i,f)+l+14+3*U+et(x,W)+(2*x[16]+3*x[17]+7*x[18]);if(G<=A&&G<=j)return pt(t,u,e.subarray(a,a+s));var F,O,_,N;if(ge(t,u,1+(j<A)),u+=2,j<A){F=pe(h,m,0),O=h,_=pe(f,y,0),N=f;var g=pe(W,V,0);ge(t,u,w-257),ge(t,u+5,M-1),ge(t,u+10,U-4),u+=14;for(var T=0;T<U;++T)ge(t,u+3*T,W[jt[T]]);u+=3*U;for(var I=[S,k],E=0;E<2;++E)for(var C=I[E],T=0;T<C.length;++T){var z=C[T]&31;ge(t,u,g[z]),u+=W[z],z>15&&(ge(t,u,C[T]>>>5&127),u+=C[T]>>>12)}}else F=ws,O=Ne,_=Ts,N=Je;for(var T=0;T<c;++T)if(n[T]>255){var z=n[T]>>>18&31;Qe(t,u,F[z+257]),u+=O[z+257],z>7&&(ge(t,u,n[T]>>>23&31),u+=ht[z]);var H=n[T]&31;Qe(t,u,_[H]),u+=N[H],H>3&&(Qe(t,u,n[T]>>>5&8191),u+=mt[H])}else Qe(t,u,F[n[T]]),u+=O[n[T]];return Qe(t,u,F[256]),u+O[256]},Is=new qe([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ks=new re(0),Ms=function(e,t,r,n,o,i){var l=e.length,c=new re(n+l+5*(1+Math.floor(l/7e3))+o),a=c.subarray(n,c.length-o),s=0;if(!t||l<8)for(var u=0;u<=l;u+=65535){var d=u+65535;d<l?s=pt(a,s,e.subarray(u,d)):(a[u]=i,s=pt(a,s,e.subarray(u,l)))}else{for(var h=Is[t-1],m=h>>>13,p=h&8191,f=(1<<r)-1,y=new ne(32768),v=new ne(f+1),S=Math.ceil(r/3),w=2*S,b=function(ae){return(e[ae]^e[ae+1]<<S^e[ae+2]<<w)&f},k=new qe(25e3),M=new ne(288),x=new ne(32),T=0,D=0,u=0,W=0,V=0,U=0;u<l;++u){var G=b(u),A=u&32767,j=v[G];if(y[A]=j,v[G]=A,V<=u){var F=l-u;if((T>7e3||W>24576)&&F>423){s=Dn(e,a,0,k,M,x,D,W,U,u-U,s),W=T=D=0,U=u;for(var O=0;O<286;++O)M[O]=0;for(var O=0;O<30;++O)x[O]=0}var _=2,N=0,g=p,I=A-j&32767;if(F>2&&G==b(u-I))for(var E=Math.min(m,F)-1,C=Math.min(32767,u),z=Math.min(258,F);I<=C&&--g&&A!=j;){if(e[u+_]==e[u+_-I]){for(var H=0;H<z&&e[u+H]==e[u+H-I];++H);if(H>_){if(_=H,N=I,H>E)break;for(var oe=Math.min(I,H-2),B=0,O=0;O<oe;++O){var X=u-I+O+32768&32767,Te=y[X],We=X-Te+32768&32767;We>B&&(B=We,j=X)}}}A=j,j=y[A],I+=A-j+32768&32767}if(N){k[W++]=268435456|Vt[_]<<18|On[N];var ye=Vt[_]&31,Ue=On[N]&31;D+=ht[ye]+mt[Ue],++M[257+ye],++x[Ue],V=u+_,++T}else k[W++]=e[u],++M[e[u]]}}s=Dn(e,a,i,k,M,x,D,W,U,u-U,s),i||(s=pt(a,s,ks))}return Yt(c,0,n+Ht(s)+o)},xs=function(){var e=1,t=0;return{p:function(r){for(var n=e,o=t,i=r.length,l=0;l!=i;){for(var c=Math.min(l+5552,i);l<c;++l)n+=r[l],o+=n;n%=65521,o%=65521}e=n,t=o},d:function(){return(e>>>8<<16|(t&255)<<8|t>>>8)+((e&255)<<23)*2}}},Os=function(e,t,r,n,o){return Ms(e,t.level==null?6:t.level,t.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):12+t.mem,r,n,!o)},Rs=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},Ds=function(e,t){var r=t.level,n=r==0?0:r<6?1:r==9?3:2;e[0]=120,e[1]=n<<6|(n?32-2*n:1)},Ls=function(e){if((e[0]&15)!=8||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(e[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function As(e,t){t===void 0&&(t={});var r=xs();r.p(e);var n=Os(e,t,2,4);return Ds(n,t),Rs(n,n.length-4,r.d()),n}function Fs(e,t){return Cs((Ls(e),e.subarray(2,-4)),t)}function Ln(e,t){var r=e.length;if(!t&&typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var n=new re(e.length+(e.length>>>1)),o=0,i=function(s){n[o++]=s},l=0;l<r;++l){if(o+5>n.length){var c=new re(o+8+(r-l<<1));c.set(n),n=c}var a=e.charCodeAt(l);a<128||t?i(a):a<2048?(i(192|a>>>6),i(128|a&63)):a>55295&&a<57344?(a=65536+(a&1047552)|e.charCodeAt(++l)&1023,i(240|a>>>18),i(128|a>>>12&63),i(128|a>>>6&63),i(128|a&63)):(i(224|a>>>12),i(128|a>>>6&63),i(128|a&63))}return Yt(n,0,o)}function An(e,t){var r="";if(!t&&typeof TextDecoder<"u")return new TextDecoder().decode(e);for(var n=0;n<e.length;){var o=e[n++];o<128||t?r+=String.fromCharCode(o):o<224?r+=String.fromCharCode((o&31)<<6|e[n++]&63):o<240?r+=String.fromCharCode((o&15)<<12|(e[n++]&63)<<6|e[n++]&63):(o=((o&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,r+=String.fromCharCode(55296|o>>10,56320|o&1023))}return r}const Kt="v1";var Ps=Object.defineProperty,_s=Object.defineProperties,$s=Object.getOwnPropertyDescriptors,Fn=Object.getOwnPropertySymbols,Ws=Object.prototype.hasOwnProperty,Us=Object.prototype.propertyIsEnumerable,Pn=(e,t,r)=>t in e?Ps(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,js=(e,t)=>{for(var r in t||(t={}))Ws.call(t,r)&&Pn(e,r,t[r]);if(Fn)for(var r of Fn(t))Us.call(t,r)&&Pn(e,r,t[r]);return e},Vs=(e,t)=>_s(e,$s(t));const Gs=e=>{const t=Vs(js({},e),{v:Kt});return An(As(Ln(JSON.stringify(t))),!0)},Bs=e=>{if(typeof e!="string")return e;try{const t=JSON.parse(e);if(t.timestamp)return t}catch{}try{const t=JSON.parse(An(Fs(Ln(e,!0))));if(t.v===Kt)return t;throw new Error(`These events were packed with packer ${t.v} which is incompatible with current packer ${Kt}.`)}catch(t){throw console.error(t),new Error("Unknown data format.")}};class $e{constructor(t){this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){const t=this.lineNumber||"",r=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${t}:${r})`:`${this.fileName}:${t}:${r}`}}const zs=/(^|@)\S+:\d+/,_n=/^\s*at .*(\S+:\d+|\(native\))/m,Hs=/^(eval@)?(\[native code])?$/,$n={parse:function(e){if(!e)return[];if(typeof e.stacktrace<"u"||typeof e["opera#sourceloc"]<"u")return this.parseOpera(e);if(e.stack&&e.stack.match(_n))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(e.indexOf(":")===-1)return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split(`
|
|
18
|
+
***************************************************************************** */function sn(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),l=[];try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)l.push(n.value)}catch(c){o={error:c}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return l}var Pe;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Pe||(Pe={}));var an={type:"xstate.init"};function Pt(e){return e===void 0?[]:[].concat(e)}function Me(e){return{type:"xstate.assign",assignment:e}}function ln(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function ct(e){return function(t){return e===t}}function cn(e){return typeof e=="string"?{type:e}:e}function un(e,t){return{value:e,context:t,actions:[],changed:!1,matches:ct(e)}}function dn(e,t,r){var n=t,o=!1;return[e.filter(function(i){if(i.type==="xstate.assign"){o=!0;var l=Object.assign({},n);return typeof i.assignment=="function"?l=i.assignment(n,r):Object.keys(i.assignment).forEach(function(c){l[c]=typeof i.assignment[c]=="function"?i.assignment[c](n,r):i.assignment[c]}),n=l,!1}return!0}),n,o]}function hn(e,t){t===void 0&&(t={});var r=sn(dn(Pt(e.states[e.initial].entry).map(function(l){return ln(l,t.actions)}),e.context,an),2),n=r[0],o=r[1],i={config:e,_options:t,initialState:{value:e.initial,actions:n,context:o,matches:ct(e.initial)},transition:function(l,c){var a,s,u=typeof l=="string"?{value:l,context:e.context}:l,d=u.value,h=u.context,m=cn(c),p=e.states[d];if(p.on){var f=Pt(p.on[m.type]);try{for(var y=function(O){var _=typeof Symbol=="function"&&Symbol.iterator,N=_&&O[_],g=0;if(N)return N.call(O);if(O&&typeof O.length=="number")return{next:function(){return O&&g>=O.length&&(O=void 0),{value:O&&O[g++],done:!O}}};throw new TypeError(_?"Object is not iterable.":"Symbol.iterator is not defined.")}(f),v=y.next();!v.done;v=y.next()){var S=v.value;if(S===void 0)return un(d,h);var w=typeof S=="string"?{target:S}:S,b=w.target,k=w.actions,M=k===void 0?[]:k,x=w.cond,T=x===void 0?function(){return!0}:x,D=b===void 0,W=b??d,V=e.states[W];if(T(h,m)){var U=sn(dn((D?Pt(M):[].concat(p.exit,M,V.entry).filter(function(O){return O})).map(function(O){return ln(O,i._options.actions)}),h,m),3),G=U[0],A=U[1],j=U[2],F=b??d;return{value:F,context:A,actions:G,changed:b!==d||G.length>0||j,matches:ct(F)}}}}catch(O){a={error:O}}finally{try{v&&!v.done&&(s=y.return)&&s.call(y)}finally{if(a)throw a.error}}}return un(d,h)}};return i}var mn=function(e,t){return e.actions.forEach(function(r){var n=r.exec;return n&&n(e.context,t)})};function pn(e){var t=e.initialState,r=Pe.NotStarted,n=new Set,o={_machine:e,send:function(i){r===Pe.Running&&(t=e.transition(t,i),mn(t,cn(i)),n.forEach(function(l){return l(t)}))},subscribe:function(i){return n.add(i),i(t),{unsubscribe:function(){return n.delete(i)}}},start:function(i){if(i){var l=typeof i=="object"?i:{context:e.config.context,value:i};t={value:l.value,actions:[],context:l.context,matches:ct(l.value)}}return r=Pe.Running,mn(t,an),o},stop:function(){return r=Pe.Stopped,n.clear(),o},get state(){return t},get status(){return r}};return o}var Yi=Object.defineProperty,Xi=Object.defineProperties,Zi=Object.getOwnPropertyDescriptors,fn=Object.getOwnPropertySymbols,Ki=Object.prototype.hasOwnProperty,qi=Object.prototype.propertyIsEnumerable,vn=(e,t,r)=>t in e?Yi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ut=(e,t)=>{for(var r in t||(t={}))Ki.call(t,r)&&vn(e,r,t[r]);if(fn)for(var r of fn(t))qi.call(t,r)&&vn(e,r,t[r]);return e},dt=(e,t)=>Xi(e,Zi(t));function Ji(e,t){for(let r=e.length-1;r>=0;r--){const n=e[r];if(n.type===R.Meta&&n.timestamp<=t)return e.slice(r)}return e}function Qi(e,{getCastFn:t,applyEventsSynchronously:r,emitter:n}){const o=hn({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]},REPLACE_EVENTS:{target:"playing",actions:["replaceEvents"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]},REPLACE_EVENTS:{target:"paused",actions:["replaceEvents"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:Me({lastPlayedEvent:(i,l)=>l.type==="CAST_EVENT"?l.payload.event:i.lastPlayedEvent}),recordTimeOffset:Me((i,l)=>{let c=i.timeOffset;return"payload"in l&&"timeOffset"in l.payload&&(c=l.payload.timeOffset),dt(ut({},i),{timeOffset:c,baselineTime:i.events[0].timestamp+c})}),play(i){var l;const{timer:c,events:a,baselineTime:s,lastPlayedEvent:u}=i;c.clear();for(const f of a)Ft(f,s);const d=Ji(a,s);let h=u?.timestamp;u?.type===R.IncrementalSnapshot&&u.data.source===L.MouseMove&&(h=u.timestamp+((l=u.data.positions[0])==null?void 0:l.timeOffset)),s<(h||0)&&n.emit(Y.PlayBack);const m=new Array,p=new Array;for(const f of d)if(!(h&&h<s&&(f.timestamp<=h||f===u)))if(f.timestamp<s)m.push(f);else{const y=t(f,!1);p.push({doAction:()=>{y()},delay:f.delay})}r(m),n.emit(Y.Flush),c.addActions(p),c.start()},pause(i){i.timer.clear()},resetLastPlayedEvent:Me(i=>dt(ut({},i),{lastPlayedEvent:null})),startLive:Me({baselineTime:(i,l)=>(i.timer.toggleLiveMode(!0),i.timer.start(),l.type==="TO_LIVE"&&l.payload.baselineTime?l.payload.baselineTime:Date.now())}),replaceEvents:Me((i,l)=>{const{events:c,timer:a,baselineTime:s}=i;if(l.type==="REPLACE_EVENTS"){const{events:u}=l.payload;c.length=0;const d=[];for(const h of u)if(Ft(h,s),c.push(h),h.timestamp>=a.timeOffset+s){const m=t(h,!1);d.push({doAction:()=>{m()},delay:h.delay})}a.isActive()&&a.replaceActions(d)}return dt(ut({},i),{events:c})}),addEvent:Me((i,l)=>{const{baselineTime:c,timer:a,events:s}=i;if(l.type==="ADD_EVENT"){const{event:u}=l.payload;Ft(u,c);let d=s.length-1;if(!s[d]||s[d].timestamp<=u.timestamp)s.push(u);else{let p=-1,f=0;for(;f<=d;){const y=Math.floor((f+d)/2);s[y].timestamp<=u.timestamp?f=y+1:d=y-1}p===-1&&(p=f),s.splice(p,0,u)}const h=u.timestamp<c,m=t(u,h);h?m():a.isActive()&&a.addAction({doAction:()=>{m()},delay:u.delay})}return dt(ut({},i),{events:s})})}});return pn(o)}function es(e){const t=hn({id:"speed",context:e,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(r,n)=>{"payload"in n&&r.timer.setSpeed(n.payload.speed)},recordSpeed:Me({normalSpeed:r=>r.timer.speed}),restoreSpeed:r=>{r.timer.setSpeed(r.normalSpeed)}}});return pn(t)}const ts=e=>["noscript { display: none !important; }",`.${e} { background: currentColor; border-radius: 5px; }`,`.${e}:hover::after {content: 'Redacted'; color: white; background: black; text-align: center; width: 100%; display: block;}`];var rs=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});const gn=new Map;function yn(e,t){let r=gn.get(e);return r||(r=new Map,gn.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function Se(e,t,r){return n=>rs(this,null,function*(){if(n&&typeof n=="object"&&"rr_type"in n)if(r&&(r.isUnchanged=!1),n.rr_type==="ImageBitmap"&&"args"in n){const o=yield Se(e,t,r)(n.args);return yield createImageBitmap.apply(null,o)}else if("index"in n){if(r||t===null)return n;const{rr_type:o,index:i}=n;return yn(t,o)[i]}else if("args"in n){const{rr_type:o,args:i}=n,l=window[o];return new l(...yield Promise.all(i.map(Se(e,t,r))))}else{if("base64"in n)return Qo(n.base64);if("src"in n){const o=e.get(n.src);if(o)return o;{const i=new Image;return i.src=n.src,e.set(n.src,i),i}}else if("data"in n&&n.rr_type==="Blob"){const o=yield Promise.all(n.data.map(Se(e,t,r)));return new Blob(o,{type:n.type})}}else if(Array.isArray(n))return yield Promise.all(n.map(Se(e,t,r)));return n})}var ns=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});function os(e,t){try{return t===ve.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}const is=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function ss(e,t){if(!(t!=null&&t.constructor))return;const{name:r}=t.constructor;if(!is.includes(r))return;const n=yn(e,r);n.includes(t)||n.push(t)}function as(e){return ns(this,arguments,function*({mutation:t,target:r,type:n,imageMap:o,errorHandler:i}){try{const l=os(r,n);if(!l)return;if(t.setter){l[t.property]=t.args[0];return}const c=l[t.property],a=yield Promise.all(t.args.map(Se(o,l))),s=c.apply(l,a);ss(l,s)}catch(l){i(t,l)}})}var ls=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});function cs(e){return ls(this,arguments,function*({event:t,mutation:r,target:n,imageMap:o,errorHandler:i}){try{const l=n.getContext("2d");if(r.setter){l[r.property]=r.args[0];return}const c=l[r.property];if(r.property==="drawImage"&&typeof r.args[0]=="string")o.get(t),c.apply(l,r.args);else{const a=yield Promise.all(r.args.map(Se(o,l)));c.apply(l,a)}}catch(l){i(r,l)}})}var us=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});function bn(e){return us(this,arguments,function*({event:t,mutation:r,target:n,imageMap:o,canvasEventMap:i,errorHandler:l}){try{const c=i.get(t)||r,a="commands"in c?c.commands:[c];if([ve.WebGL,ve.WebGL2].includes(r.type)){for(let s=0;s<a.length;s++){const u=a[s];yield as({mutation:u,type:r.type,target:n,imageMap:o,errorHandler:l})}return}for(let s=0;s<a.length;s++){const u=a[s];yield cs({event:t,mutation:u,target:n,imageMap:o,errorHandler:l})}}catch(c){l(r,c)}})}var ds=Object.defineProperty,hs=Object.defineProperties,ms=Object.getOwnPropertyDescriptors,Sn=Object.getOwnPropertySymbols,ps=Object.prototype.hasOwnProperty,fs=Object.prototype.propertyIsEnumerable,wn=(e,t,r)=>t in e?ds(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_e=(e,t)=>{for(var r in t||(t={}))ps.call(t,r)&&wn(e,r,t[r]);if(Sn)for(var r of Sn(t))fs.call(t,r)&&wn(e,r,t[r]);return e},_t=(e,t)=>hs(e,ms(t)),$t=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});const Nn=10*1e3,Tn=2*1e3,En=1*1e3,Cn=60*60*1e3,vs=on||Bi,Wt="[replayer]",Ut={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function jt(e){return e.type==R.IncrementalSnapshot&&(e.data.source==L.TouchMove||e.data.source==L.MouseInteraction&&e.data.type==ee.TouchStart)}class gs{constructor(t,r){if(this.usingVirtualDom=!1,this.virtualDom=new Fe,this.mouseTail=null,this.tailPositions=[],this.emitter=vs(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=mr(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=rr(),this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,this.handleResize=c=>{this.iframe.style.display="inherit";for(const a of[this.mouseTail,this.iframe])!a||(a.setAttribute("width",String(c.width)),a.setAttribute("height",String(c.height)))},this.applyEventsSynchronously=c=>{for(const a of c){switch(a.type){case R.DomContentLoaded:case R.Load:case R.Custom:continue;case R.FullSnapshot:case R.Meta:case R.Plugin:case R.IncrementalSnapshot:break}this.getCastFn(a,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null},this.getCastFn=(c,a=!1)=>{let s;switch(c.type){case R.DomContentLoaded:case R.Load:break;case R.Custom:s=()=>{this.emitter.emit(Y.CustomEvent,c)};break;case R.Meta:s=()=>this.emitter.emit(Y.Resize,{width:c.data.width,height:c.data.height});break;case R.FullSnapshot:s=()=>{if(this.firstFullSnapshot){if(this.firstFullSnapshot===c){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(c,a),this.iframe.contentWindow.scrollTo(c.data.initialOffset)};break;case R.IncrementalSnapshot:s=()=>{if(this.applyIncremental(c,a),!a&&(this.handleInactivity(c.timestamp),c===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const u of this.service.state.context.events)if(!(u.timestamp<=c.timestamp)&&this.isUserInteraction(u)){u.delay-c.delay>Nn*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=u);break}if(this.nextUserInteractionEvent){const u=this.nextUserInteractionEvent.delay-c.delay,d={speed:Math.min(Math.round(u/Tn),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:d}),this.emitter.emit(Y.SkipStart,d)}}};break}return()=>{s&&s();for(const d of this.config.plugins||[])d.handler(c,a,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:c}});const u=this.service.state.context.events.length-1;if(c===this.service.state.context.events[u]){const d=()=>{u<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(Y.Finish))};c.type===R.IncrementalSnapshot&&c.data.source===L.MouseMove&&c.data.positions.length?setTimeout(()=>{d()},Math.max(0,-c.data.positions[0].timeOffset+50)):d()}this.emitter.emit(Y.EventCast,c)}},!(r!=null&&r.liveMode)&&t.length<2)throw new Error("Replayer need at least 2 events.");const n={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"highlight-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:Ut,useVirtualDom:!0,inactiveThreshold:.02,inactiveSkipTime:Tn};this.config=Object.assign({},n,r),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(Y.Resize,this.handleResize),this.setupDom(),this.emitter.on(Y.Flush,()=>{if(this.usingVirtualDom){const c={mirror:this.mirror,applyCanvas:(a,s,u)=>{bn({event:a,mutation:s,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this)};if(me(this.iframe.contentDocument,this.virtualDom,c,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const a in this.legacy_missingNodeRetryMap)try{const s=this.legacy_missingNodeRetryMap[a],u=At(s.node,this.mirror,this.virtualDom.mirror);me(u,s.node,c,this.virtualDom.mirror),s.node=u}catch(s){this.config.showWarning&&console.warn(s)}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null}),this.emitter.on(Y.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset()});const o=new Hi([],r?.speed||n.speed);this.service=Qi({events:t.map(c=>r&&r.unpackFn?r.unpackFn(c):c).sort((c,a)=>c.timestamp-a.timestamp),timer:o,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(c=>{this.emitter.emit(Y.StateChange,{player:c})}),this.speedService=es({normalSpeed:-1,timer:o}),this.speedService.start(),this.speedService.subscribe(c=>{this.emitter.emit(Y.StateChange,{speed:c})});const i=this.service.state.context.events.find(c=>c.type===R.Meta),l=this.service.state.context.events.find(c=>c.type===R.FullSnapshot);if(i){const{width:c,height:a}=i.data;setTimeout(()=>{this.emitter.emit(Y.Resize,{width:c,height:a})},0)}l&&setTimeout(()=>{this.firstFullSnapshot||(this.firstFullSnapshot=l,this.rebuildFullSnapshot(l),this.iframe.contentWindow.scrollTo(l.data.initialOffset))},1),this.service.state.context.events.find(jt)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,r){return this.emitter.on(t,r),this}off(t,r){return this.emitter.off(t,r),this}setConfig(t){Object.keys(t).forEach(r=>{t[r],this.config[r]=t[r]}),this.config.skipInactive||this.backToNormal(),typeof t.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail<"u"&&(t.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getActivityIntervals(){if(this.activityIntervals.length==0){const t=[],r=this.getMetaData(),n=[{timestamp:r.startTime},...this.service.state.context.events.filter(l=>this.isUserInteraction(l)),{timestamp:r.endTime}];for(let l=1;l<n.length;l++){const c=n[l-1],a=n[l];a.timestamp-c.timestamp>Nn?t.push({startTime:c.timestamp,endTime:a.timestamp,duration:a.timestamp-c.timestamp,active:!1}):t.push({startTime:c.timestamp,endTime:a.timestamp,duration:a.timestamp-c.timestamp,active:!0})}const o=[];let i=t[0];for(let l=1;l<t.length;l++)t[l].active!=t[l-1].active&&(o.push({startTime:i.startTime,endTime:t[l-1].endTime,duration:t[l-1].endTime-i.startTime,active:t[l-1].active}),i=t[l]);i&&t.length>0&&o.push({startTime:i.startTime,endTime:t[t.length-1].endTime,duration:t[t.length-1].endTime-i.startTime,active:t[t.length-1].active}),i=o[0];for(let l=1;l<o.length;l++)(!o[l].active&&o[l].duration>this.config.inactiveThreshold*r.totalTime||!o[l-1].active&&o[l-1].duration>this.config.inactiveThreshold*r.totalTime)&&(this.activityIntervals.push({startTime:i.startTime,endTime:o[l-1].endTime,duration:o[l-1].endTime-i.startTime,active:o[l-1].active}),i=o[l]);i&&o.length>0&&this.activityIntervals.push({startTime:i.startTime,endTime:o[o.length-1].endTime,duration:o[o.length-1].endTime-i.startTime,active:o[o.length-1].active})}return this.activityIntervals}getMetaData(){const t=this.service.state.context.events[0],r=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:r.timestamp,totalTime:r.timestamp-t.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:t,events:r}=this.service.state.context;return t-r[0].timestamp}getMirror(){return this.mirror}play(t=0){var r,n;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(n=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||n.classList.remove("rrweb-paused"),this.emitter.emit(Y.Start),this.handleInactivity(this.getMetaData().startTime+t,!0)}pause(t){var r,n;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(n=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||n.classList.add("rrweb-paused"),this.emitter.emit(Y.Pause)}resume(t=0){console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(t),this.emitter.emit(Y.Resume)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const r=this.config.unpackFn?this.config.unpackFn(t):t;jt(r)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:r}}))}replaceEvents(t){for(const r of t)if(jt(r)){this.mouse.classList.add("touch-device");break}this.service.send({type:"REPLACE_EVENTS",payload:{events:t}})}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=mr()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const t=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&t.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",t.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(zi(this.iframe.contentWindow,this.iframe.contentDocument),It(this.iframe.contentWindow))}handleInactivity(t,r){if((t===this.inactiveEndTimestamp||r)&&(this.inactiveEndTimestamp=null,this.backToNormal()),this.config.skipInactive&&!this.inactiveEndTimestamp){for(const n of this.getActivityIntervals())if(t>=n.startTime&&t<n.endTime&&!n.active){this.inactiveEndTimestamp=n.endTime;break}if(this.inactiveEndTimestamp){const n=this.inactiveEndTimestamp-t,o={speed:n/Cn*this.config.inactiveSkipTime<En?n/En:Math.round(Math.max(n,Cn)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:o}),this.emitter.emit(Y.SkipStart,o)}}}rebuildFullSnapshot(t,r=!1){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const n=[];Eo(t.data.node,{doc:this.iframe.contentDocument,afterAppend:l=>{this.collectIframeAndAttachDocument(n,l)},cache:this.cache,mirror:this.mirror});for(const{mutationInQueue:l,builtNode:c}of n)this.attachDocumentToIframe(l,c),this.newDocumentQueue=this.newDocumentQueue.filter(a=>a!==l);const{documentElement:o,head:i}=this.iframe.contentDocument;this.insertStyleRules(o,i),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(Y.FullsnapshotRebuilded,t),r||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,r){const n=ts(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&n.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,nn(o,this.virtualDom.unserializedId)),t.insertBefore(o,r);for(let i=0;i<n.length;i++)o.rules.push({cssText:n[i],type:ue.Insert,index:i})}else{const o=document.createElement("style");t.insertBefore(o,r);for(let i=0;i<n.length;i++)o.sheet.insertRule(n[i],i)}}attachDocumentToIframe(t,r){const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,o=[];ot(t.node,{doc:r.contentDocument,mirror:n,hackCss:!0,skipChild:!1,afterAppend:i=>{this.collectIframeAndAttachDocument(o,i);const l=n.getMeta(i);if(l?.type===P.Element&&l?.tagName.toUpperCase()==="HTML"){const{documentElement:c,head:a}=r.contentDocument;this.insertStyleRules(c,a)}},cache:this.cache});for(const{mutationInQueue:i,builtNode:l}of o)this.attachDocumentToIframe(i,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==i)}collectIframeAndAttachDocument(t,r){if(De(r,this.mirror)){const n=this.newDocumentQueue.find(o=>o.parentId===this.mirror.getId(r));n&&t.push({mutationInQueue:n,builtNode:r})}}waitForStylesheetLoad(){var t;const r=(t=this.iframe.contentDocument)==null?void 0:t.head;if(r){const n=new Set;let o,i=this.service.state;const l=()=>{i=this.service.state};this.emitter.on(Y.Start,l),this.emitter.on(Y.Pause,l);const c=()=>{this.emitter.off(Y.Start,l),this.emitter.off(Y.Pause,l)};r.querySelectorAll('link[rel="stylesheet"]').forEach(a=>{a.sheet||(n.add(a),a.addEventListener("load",()=>{n.delete(a),n.size===0&&o!==-1&&(i.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(Y.LoadStylesheetEnd),o&&clearTimeout(o),c())}))}),n.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(Y.LoadStylesheetStart),o=setTimeout(()=>{i.matches("playing")&&this.play(this.getCurrentTime()),o=-1,c()},this.config.loadTimeout))}}preloadAllImages(){return $t(this,null,function*(){this.service.state;const t=()=>{this.service.state};this.emitter.on(Y.Start,t),this.emitter.on(Y.Pause,t);const r=[];for(const n of this.service.state.context.events)n.type===R.IncrementalSnapshot&&n.data.source===L.CanvasMutation&&(r.push(this.deserializeAndPreloadCanvasEvents(n.data,n)),("commands"in n.data?n.data.commands:[n.data]).forEach(o=>{this.preloadImages(o,n)}));return Promise.all(r)})}preloadImages(t,r){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(r)){const n=document.createElement("canvas"),o=n.getContext("2d"),i=o?.createImageData(n.width,n.height);i?.data,JSON.parse(t.args[0]),o?.putImageData(i,0,0)}}deserializeAndPreloadCanvasEvents(t,r){return $t(this,null,function*(){if(!this.canvasEventMap.has(r)){const n={isUnchanged:!0};if("commands"in t){const o=yield Promise.all(t.commands.map(i=>$t(this,null,function*(){const l=yield Promise.all(i.args.map(Se(this.imageMap,null,n)));return _t(_e({},i),{args:l})})));n.isUnchanged===!1&&this.canvasEventMap.set(r,_t(_e({},t),{commands:o}))}else{const o=yield Promise.all(t.args.map(Se(this.imageMap,null,n)));n.isUnchanged===!1&&this.canvasEventMap.set(r,_t(_e({},t),{args:o}))}}})}applyIncremental(t,r){var n,o,i,l,c,a;const{data:s}=t;switch(s.source){case L.Mutation:{try{this.applyMutation(s,r)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,s)}break}case L.Drag:case L.TouchMove:case L.MouseMove:if(r){const u=s.positions[s.positions.length-1];this.mousePos={x:u.x,y:u.y,id:u.id,debugData:s}}else s.positions.forEach(u=>{const d={doAction:()=>{this.moveAndHover(u.x,u.y,u.id,r,s)},delay:u.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(d)}),this.timer.addAction({doAction(){},delay:t.delay-((n=s.positions[0])==null?void 0:n.timeOffset)});break;case L.MouseInteraction:{if(s.id===-1||r)break;const u=new Event(ee[s.type].toLowerCase()),d=this.mirror.getNode(s.id);if(!d)return this.debugNodeNotFound(s,s.id);this.emitter.emit(Y.MouseInteraction,{type:s.type,target:d});const{triggerFocus:h}=this.config;switch(s.type){case ee.Blur:"blur"in d&&d.blur();break;case ee.Focus:h&&d.focus&&d.focus({preventScroll:!0});break;case ee.Click:case ee.TouchStart:case ee.TouchEnd:r?(s.type===ee.TouchStart?this.touchActive=!0:s.type===ee.TouchEnd&&(this.touchActive=!1),this.mousePos={x:s.x,y:s.y,id:s.id,debugData:s}):(s.type===ee.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(s.x,s.y,s.id,r,s),s.type===ee.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):s.type===ee.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):s.type===ee.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case ee.TouchCancel:r?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:d.dispatchEvent(u)}break}case L.Scroll:{if(s.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.scrollData=s;break}this.applyScroll(s,r);break}case L.ViewportResize:this.emitter.emit(Y.Resize,{width:s.width,height:s.height});break;case L.Input:{if(s.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.inputData=s;break}this.applyInput(s);break}case L.MediaInteraction:{const u=this.usingVirtualDom?this.virtualDom.mirror.getNode(s.id):this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u;try{s.currentTime&&(d.currentTime=s.currentTime),s.volume&&(d.volume=s.volume),s.muted&&(d.muted=s.muted),s.type===Ce.Pause&&d.pause(),s.type===Ce.Play&&d.play()}catch(h){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${h.message||h}`)}break}case L.StyleSheetRule:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.rules;(o=s.adds)==null||o.forEach(({rule:h,index:m})=>d?.push({cssText:h,index:m,type:ue.Insert})),(i=s.removes)==null||i.forEach(({index:h})=>d?.push({index:h,type:ue.Remove}))}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.sheet;(l=s.adds)==null||l.forEach(({rule:h,index:m})=>{try{if(Array.isArray(m)){const{positions:p,index:f}=Ot(m);Le(d.cssRules,p).insertRule(h,f)}else{const p=m===void 0?void 0:Math.min(m,d.cssRules.length);d.insertRule(h,p)}}catch{}}),(c=s.removes)==null||c.forEach(({index:h})=>{try{if(Array.isArray(h)){const{positions:m,index:p}=Ot(h);Le(d.cssRules,m).deleteRule(p||0)}else d?.deleteRule(h)}catch{}})}break}case L.StyleDeclaration:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.rules;s.set&&d.push(_e({type:ue.SetProperty,index:s.index},s.set)),s.remove&&d.push(_e({type:ue.RemoveProperty,index:s.index},s.remove))}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.sheet;s.set&&Le(d.rules,s.index).style.setProperty(s.set.property,s.set.value,s.set.priority),s.remove&&Le(d.rules,s.index).style.removeProperty(s.remove.property)}break}case L.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.canvasMutations.push({event:t,mutation:s})}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);bn({event:t,mutation:s,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case L.Font:{try{const u=new FontFace(s.family,s.buffer?new Uint8Array(JSON.parse(s.fontSource)):s.fontSource,s.descriptors);(a=this.iframe.contentDocument)==null||a.fonts.add(u)}catch(u){this.config.showWarning&&console.warn(u)}break}}}applyMutation(t,r){if(this.config.useVirtualDom&&!this.usingVirtualDom&&r&&(this.usingVirtualDom=!0,ji(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const s in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[s],d=rn(u.node,this.virtualDom,this.mirror);d&&(u.node=d)}catch(u){this.config.showWarning&&console.warn(u)}const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes.forEach(s=>{var u;const d=n.getNode(s.id);if(!d)return t.removes.find(m=>m.id===s.parentId)?void 0:this.warnNodeNotFound(t,s.id);let h=n.getNode(s.parentId);if(!h)return this.warnNodeNotFound(t,s.parentId);if(s.isShadow&&ze(h)&&(h=h.shadowRoot),n.removeNodeFromMap(d),h)try{h.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&h.nodeName==="STYLE"&&((u=h.rules)==null?void 0:u.length)>0&&(h.rules=[])}catch(m){if(m instanceof DOMException)this.warn("parent could not remove child in mutation",h,d,t);else throw m}});const o=_e({},this.legacy_missingNodeRetryMap),i=[],l=s=>{let u=null;return s.nextId&&(u=n.getNode(s.nextId)),s.nextId!==null&&s.nextId!==void 0&&s.nextId!==-1&&!u},c=s=>{var u;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let d=n.getNode(s.parentId);if(!d)return s.node.type===P.Document?this.newDocumentQueue.push(s):i.push(s);s.node.isShadow&&(ze(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let h=null,m=null;if(s.previousId&&(h=n.getNode(s.previousId)),s.nextId&&(m=n.getNode(s.nextId)),l(s))return i.push(s);if(s.node.rootId&&!n.getNode(s.node.rootId))return;const p=s.node.rootId?n.getNode(s.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(De(d,n)){this.attachDocumentToIframe(s,d);return}const f=ot(s.node,{doc:p,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache});if(s.previousId===-1||s.nextId===-1){o[s.node.id]={node:f,mutation:s};return}const y=n.getMeta(d);if(y&&y.type===P.Element&&y.tagName==="textarea"&&s.node.type===P.Text){const v=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const S of v)S.nodeType===d.TEXT_NODE&&d.removeChild(S)}if(h&&h.nextSibling&&h.nextSibling.parentNode)d.insertBefore(f,h.nextSibling);else if(m&&m.parentNode)d.contains(m)?d.insertBefore(f,m):d.insertBefore(f,null);else{if(d===p)for(;p.firstChild;)p.removeChild(p.firstChild);d.appendChild(f)}if(this.usingVirtualDom&&f.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[]),De(f,this.mirror)){const v=this.mirror.getId(f),S=this.newDocumentQueue.find(w=>w.parentId===v);S&&(this.attachDocumentToIframe(S,f),this.newDocumentQueue=this.newDocumentQueue.filter(w=>w!==S))}(s.previousId||s.nextId)&&this.legacy_resolveMissingNode(o,d,f,s)};t.adds.forEach(s=>{c(s)});const a=Date.now();for(;i.length;){const s=vr(i);if(i.length=0,Date.now()-a>500){this.warn("Timeout in the loop, please check the resolve tree data:",s);break}for(const u of s)n.getNode(u.value.parentId)?kt(u,d=>{c(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(o).length&&Object.assign(this.legacy_missingNodeRetryMap,o),gr(t.texts).forEach(s=>{var u;const d=n.getNode(s.id);if(!d)return t.removes.find(h=>h.id===s.id)?void 0:this.warnNodeNotFound(t,s.id);if(d.textContent=s.value,this.usingVirtualDom){const h=d.parentNode;((u=h?.rules)==null?void 0:u.length)>0&&(h.rules=[])}}),t.attributes.forEach(s=>{const u=n.getNode(s.id);if(!u)return t.removes.find(d=>d.id===s.id)?void 0:this.warnNodeNotFound(t,s.id);for(const d in s.attributes)if(typeof d=="string"){const h=s.attributes[d];if(h===null)u.removeAttribute(d);else if(typeof h=="string")try{u.setAttribute(d,h)}catch(m){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",m)}else if(d==="style"){const m=h,p=u;for(const f in m)if(m[f]===!1)p.style.removeProperty(f);else if(m[f]instanceof Array){const y=m[f];p.style.setProperty(f,y[0],y[1])}else{const y=m[f];p.style.setProperty(f,y)}}}})}applyScroll(t,r){const n=this.mirror.getNode(t.id);if(!n)return this.debugNodeNotFound(t,t.id);const o=this.mirror.getMeta(n);if(n===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else if(o?.type===P.Document)n.defaultView.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else try{n.scrollTop=t.y,n.scrollLeft=t.x}catch{}}applyInput(t){const r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);try{r.checked=t.isChecked,r.value=t.text}catch{}}legacy_resolveMissingNode(t,r,n,o){const{previousId:i,nextId:l}=o,c=i&&t[i],a=l&&t[l];if(c){const{node:s,mutation:u}=c;r.insertBefore(s,n),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,s,u)}if(a){const{node:s,mutation:u}=a;r.insertBefore(s,n.nextSibling),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,s,u)}}moveAndHover(t,r,n,o,i){const l=this.mirror.getNode(n);if(!l)return this.debugNodeNotFound(i,n);const c=xt(l,this.iframe),a=t*c.absoluteScale+c.x,s=r*c.absoluteScale+c.y;this.mouse.style.left=`${a}px`,this.mouse.style.top=`${s}px`,o||this.drawMouseTail({x:a,y:s}),this.hoverElements(l)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:r,lineWidth:n,strokeStyle:o,duration:i}=this.config.mouseTail===!0?Ut:Object.assign({},Ut,this.config.mouseTail),l=()=>{if(!this.mouseTail)return;const c=this.mouseTail.getContext("2d");!c||!this.tailPositions.length||(c.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),c.beginPath(),c.lineWidth=n,c.lineCap=r,c.strokeStyle=o,c.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(a=>c.lineTo(a.x,a.y)),c.stroke())};this.tailPositions.push(t),l(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(c=>c!==t),l()},i/this.speedService.state.context.timer.speed)}hoverElements(t){var r;(r=this.iframe.contentDocument)==null||r.querySelectorAll(".\\:hover").forEach(o=>{o.classList.remove(":hover")});let n=t;for(;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement}isUserInteraction(t){return t.type!==R.IncrementalSnapshot?!1:t.data.source>L.Mutation&&t.data.source<=L.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(Y.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,r){this.warn(`Node with id '${r}' not found. `,t)}warnCanvasMutationFailed(t,r){this.warn("Has error on canvas update",r,"canvas mutation:",t)}debugNodeNotFound(t,r){this.debug(Wt,`Node with id '${r}' not found. `,t)}warn(...t){!this.config.showWarning||console.warn(Wt,...t)}debug(...t){!this.config.showDebug||console.log(Wt,...t)}}const{addCustomEvent:ys}=ke,{freezePage:bs}=ke;var re=Uint8Array,ne=Uint16Array,qe=Uint32Array,ht=new re([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),mt=new re([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Vt=new re([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),In=function(e,t){for(var r=new ne(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var o=new qe(r[30]),n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return[r,o]},kn=In(ht,2),Mn=kn[0],Gt=kn[1];Mn[28]=258,Gt[258]=28;for(var xn=In(mt,0),Ss=xn[0],On=xn[1],Bt=new ne(32768),K=0;K<32768;++K){var we=(K&43690)>>>1|(K&21845)<<1;we=(we&52428)>>>2|(we&13107)<<2,we=(we&61680)>>>4|(we&3855)<<4,Bt[K]=((we&65280)>>>8|(we&255)<<8)>>>1}for(var pe=function(e,t,r){for(var n=e.length,o=0,i=new ne(t);o<n;++o)++i[e[o]-1];var l=new ne(t);for(o=0;o<t;++o)l[o]=l[o-1]+i[o-1]<<1;var c;if(r){c=new ne(1<<t);var a=15-t;for(o=0;o<n;++o)if(e[o])for(var s=o<<4|e[o],u=t-e[o],d=l[e[o]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)c[Bt[d]>>>a]=s}else for(c=new ne(n),o=0;o<n;++o)c[o]=Bt[l[e[o]-1]++]>>>15-e[o];return c},Ne=new re(288),K=0;K<144;++K)Ne[K]=8;for(var K=144;K<256;++K)Ne[K]=9;for(var K=256;K<280;++K)Ne[K]=7;for(var K=280;K<288;++K)Ne[K]=8;for(var Je=new re(32),K=0;K<32;++K)Je[K]=5;var ws=pe(Ne,9,0),Ns=pe(Ne,9,1),Ts=pe(Je,5,0),Es=pe(Je,5,1),zt=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},de=function(e,t,r){var n=t/8>>0;return(e[n]|e[n+1]<<8)>>>(t&7)&r},Ht=function(e,t){var r=t/8>>0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>>(t&7)},Yt=function(e){return(e/8>>0)+(e&7&&1)},Xt=function(e,t,r){(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length);var n=new(e instanceof ne?ne:e instanceof qe?qe:re)(r-t);return n.set(e.subarray(t,r)),n},Cs=function(e,t,r){var n=e.length,o=!t||r,i=!r||r.i;r||(r={}),t||(t=new re(n*3));var l=function(oe){var B=t.length;if(oe>B){var X=new re(Math.max(B*2,oe));X.set(t),t=X}},c=r.f||0,a=r.p||0,s=r.b||0,u=r.l,d=r.d,h=r.m,m=r.n,p=n*8;do{if(!u){r.f=c=de(e,a,1);var f=de(e,a+1,3);if(a+=3,f)if(f==1)u=Ns,d=Es,h=9,m=5;else if(f==2){var w=de(e,a,31)+257,b=de(e,a+10,15)+4,k=w+de(e,a+5,31)+1;a+=14;for(var M=new re(k),x=new re(19),T=0;T<b;++T)x[Vt[T]]=de(e,a+T*3,7);a+=b*3;var D=zt(x),W=(1<<D)-1;if(!i&&a+k*(D+7)>p)break;for(var V=pe(x,D,1),T=0;T<k;){var U=V[de(e,a,W)];a+=U&15;var y=U>>>4;if(y<16)M[T++]=y;else{var G=0,A=0;for(y==16?(A=3+de(e,a,3),a+=2,G=M[T-1]):y==17?(A=3+de(e,a,7),a+=3):y==18&&(A=11+de(e,a,127),a+=7);A--;)M[T++]=G}}var j=M.subarray(0,w),F=M.subarray(w);h=zt(j),m=zt(F),u=pe(j,h,1),d=pe(F,m,1)}else throw"invalid block type";else{var y=Yt(a)+4,v=e[y-4]|e[y-3]<<8,S=y+v;if(S>n){if(i)throw"unexpected EOF";break}o&&l(s+v),t.set(e.subarray(y,S),s),r.b=s+=v,r.p=a=S*8;continue}if(a>p)throw"unexpected EOF"}o&&l(s+131072);for(var O=(1<<h)-1,_=(1<<m)-1,N=h+m+18;i||a+N<p;){var G=u[Ht(e,a)&O],g=G>>>4;if(a+=G&15,a>p)throw"unexpected EOF";if(!G)throw"invalid length/literal";if(g<256)t[s++]=g;else if(g==256){u=null;break}else{var I=g-254;if(g>264){var T=g-257,E=ht[T];I=de(e,a,(1<<E)-1)+Mn[T],a+=E}var C=d[Ht(e,a)&_],z=C>>>4;if(!C)throw"invalid distance";a+=C&15;var F=Ss[z];if(z>3){var E=mt[z];F+=Ht(e,a)&(1<<E)-1,a+=E}if(a>p)throw"unexpected EOF";o&&l(s+131072);for(var H=s+I;s<H;s+=4)t[s]=t[s-F],t[s+1]=t[s+1-F],t[s+2]=t[s+2-F],t[s+3]=t[s+3-F];s=H}}r.l=u,r.p=a,r.b=s,u&&(c=1,r.m=h,r.d=d,r.n=m)}while(!c);return s==t.length?t:Xt(t,0,s)},ge=function(e,t,r){r<<=t&7;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8},Qe=function(e,t,r){r<<=t&7;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},Zt=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,i=r.slice();if(!o)return[new re(0),0];if(o==1){var l=new re(r[0].s+1);return l[r[0].s]=1,[l,1]}r.sort(function(k,M){return k.f-M.f}),r.push({s:-1,f:25001});var c=r[0],a=r[1],s=0,u=1,d=2;for(r[0]={s:-1,f:c.f+a.f,l:c,r:a};u!=o-1;)c=r[r[s].f<r[d].f?s++:d++],a=r[s!=u&&r[s].f<r[d].f?s++:d++],r[u++]={s:-1,f:c.f+a.f,l:c,r:a};for(var h=i[0].s,n=1;n<o;++n)i[n].s>h&&(h=i[n].s);var m=new ne(h+1),p=Kt(r[u-1],m,0);if(p>t){var n=0,f=0,y=p-t,v=1<<y;for(i.sort(function(M,x){return m[x.s]-m[M.s]||M.f-x.f});n<o;++n){var S=i[n].s;if(m[S]>t)f+=v-(1<<p-m[S]),m[S]=t;else break}for(f>>>=y;f>0;){var w=i[n].s;m[w]<t?f-=1<<t-m[w]++-1:++n}for(;n>=0&&f;--n){var b=i[n].s;m[b]==t&&(--m[b],++f)}p=t}return[new re(m),p]},Kt=function(e,t,r){return e.s==-1?Math.max(Kt(e.l,t,r+1),Kt(e.r,t,r+1)):t[e.s]=r},Rn=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new ne(++t),n=0,o=e[0],i=1,l=function(a){r[n++]=a},c=1;c<=t;++c)if(e[c]==o&&c!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)l(32754);i>2&&(l(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(l(o),--i;i>6;i-=6)l(8304);i>2&&(l(i-3<<5|8208),i=0)}for(;i--;)l(o);i=1,o=e[c]}return[r.subarray(0,n),t]},et=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},pt=function(e,t,r){var n=r.length,o=Yt(t+2);e[o]=n&255,e[o+1]=n>>>8,e[o+2]=e[o]^255,e[o+3]=e[o+1]^255;for(var i=0;i<n;++i)e[o+i+4]=r[i];return(o+4+n)*8},Dn=function(e,t,r,n,o,i,l,c,a,s,u){ge(t,u++,r),++o[256];for(var d=Zt(o,15),h=d[0],m=d[1],p=Zt(i,15),f=p[0],y=p[1],v=Rn(h),S=v[0],w=v[1],b=Rn(f),k=b[0],M=b[1],x=new ne(19),T=0;T<S.length;++T)x[S[T]&31]++;for(var T=0;T<k.length;++T)x[k[T]&31]++;for(var D=Zt(x,7),W=D[0],V=D[1],U=19;U>4&&!W[Vt[U-1]];--U);var G=s+5<<3,A=et(o,Ne)+et(i,Je)+l,j=et(o,h)+et(i,f)+l+14+3*U+et(x,W)+(2*x[16]+3*x[17]+7*x[18]);if(G<=A&&G<=j)return pt(t,u,e.subarray(a,a+s));var F,O,_,N;if(ge(t,u,1+(j<A)),u+=2,j<A){F=pe(h,m,0),O=h,_=pe(f,y,0),N=f;var g=pe(W,V,0);ge(t,u,w-257),ge(t,u+5,M-1),ge(t,u+10,U-4),u+=14;for(var T=0;T<U;++T)ge(t,u+3*T,W[Vt[T]]);u+=3*U;for(var I=[S,k],E=0;E<2;++E)for(var C=I[E],T=0;T<C.length;++T){var z=C[T]&31;ge(t,u,g[z]),u+=W[z],z>15&&(ge(t,u,C[T]>>>5&127),u+=C[T]>>>12)}}else F=ws,O=Ne,_=Ts,N=Je;for(var T=0;T<c;++T)if(n[T]>255){var z=n[T]>>>18&31;Qe(t,u,F[z+257]),u+=O[z+257],z>7&&(ge(t,u,n[T]>>>23&31),u+=ht[z]);var H=n[T]&31;Qe(t,u,_[H]),u+=N[H],H>3&&(Qe(t,u,n[T]>>>5&8191),u+=mt[H])}else Qe(t,u,F[n[T]]),u+=O[n[T]];return Qe(t,u,F[256]),u+O[256]},Is=new qe([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ks=new re(0),Ms=function(e,t,r,n,o,i){var l=e.length,c=new re(n+l+5*(1+Math.floor(l/7e3))+o),a=c.subarray(n,c.length-o),s=0;if(!t||l<8)for(var u=0;u<=l;u+=65535){var d=u+65535;d<l?s=pt(a,s,e.subarray(u,d)):(a[u]=i,s=pt(a,s,e.subarray(u,l)))}else{for(var h=Is[t-1],m=h>>>13,p=h&8191,f=(1<<r)-1,y=new ne(32768),v=new ne(f+1),S=Math.ceil(r/3),w=2*S,b=function(ae){return(e[ae]^e[ae+1]<<S^e[ae+2]<<w)&f},k=new qe(25e3),M=new ne(288),x=new ne(32),T=0,D=0,u=0,W=0,V=0,U=0;u<l;++u){var G=b(u),A=u&32767,j=v[G];if(y[A]=j,v[G]=A,V<=u){var F=l-u;if((T>7e3||W>24576)&&F>423){s=Dn(e,a,0,k,M,x,D,W,U,u-U,s),W=T=D=0,U=u;for(var O=0;O<286;++O)M[O]=0;for(var O=0;O<30;++O)x[O]=0}var _=2,N=0,g=p,I=A-j&32767;if(F>2&&G==b(u-I))for(var E=Math.min(m,F)-1,C=Math.min(32767,u),z=Math.min(258,F);I<=C&&--g&&A!=j;){if(e[u+_]==e[u+_-I]){for(var H=0;H<z&&e[u+H]==e[u+H-I];++H);if(H>_){if(_=H,N=I,H>E)break;for(var oe=Math.min(I,H-2),B=0,O=0;O<oe;++O){var X=u-I+O+32768&32767,Te=y[X],We=X-Te+32768&32767;We>B&&(B=We,j=X)}}}A=j,j=y[A],I+=A-j+32768&32767}if(N){k[W++]=268435456|Gt[_]<<18|On[N];var ye=Gt[_]&31,Ue=On[N]&31;D+=ht[ye]+mt[Ue],++M[257+ye],++x[Ue],V=u+_,++T}else k[W++]=e[u],++M[e[u]]}}s=Dn(e,a,i,k,M,x,D,W,U,u-U,s),i||(s=pt(a,s,ks))}return Xt(c,0,n+Yt(s)+o)},xs=function(){var e=1,t=0;return{p:function(r){for(var n=e,o=t,i=r.length,l=0;l!=i;){for(var c=Math.min(l+5552,i);l<c;++l)n+=r[l],o+=n;n%=65521,o%=65521}e=n,t=o},d:function(){return(e>>>8<<16|(t&255)<<8|t>>>8)+((e&255)<<23)*2}}},Os=function(e,t,r,n,o){return Ms(e,t.level==null?6:t.level,t.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):12+t.mem,r,n,!o)},Rs=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},Ds=function(e,t){var r=t.level,n=r==0?0:r<6?1:r==9?3:2;e[0]=120,e[1]=n<<6|(n?32-2*n:1)},Ls=function(e){if((e[0]&15)!=8||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(e[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function As(e,t){t===void 0&&(t={});var r=xs();r.p(e);var n=Os(e,t,2,4);return Ds(n,t),Rs(n,n.length-4,r.d()),n}function Fs(e,t){return Cs((Ls(e),e.subarray(2,-4)),t)}function Ln(e,t){var r=e.length;if(!t&&typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var n=new re(e.length+(e.length>>>1)),o=0,i=function(s){n[o++]=s},l=0;l<r;++l){if(o+5>n.length){var c=new re(o+8+(r-l<<1));c.set(n),n=c}var a=e.charCodeAt(l);a<128||t?i(a):a<2048?(i(192|a>>>6),i(128|a&63)):a>55295&&a<57344?(a=65536+(a&1047552)|e.charCodeAt(++l)&1023,i(240|a>>>18),i(128|a>>>12&63),i(128|a>>>6&63),i(128|a&63)):(i(224|a>>>12),i(128|a>>>6&63),i(128|a&63))}return Xt(n,0,o)}function An(e,t){var r="";if(!t&&typeof TextDecoder<"u")return new TextDecoder().decode(e);for(var n=0;n<e.length;){var o=e[n++];o<128||t?r+=String.fromCharCode(o):o<224?r+=String.fromCharCode((o&31)<<6|e[n++]&63):o<240?r+=String.fromCharCode((o&15)<<12|(e[n++]&63)<<6|e[n++]&63):(o=((o&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,r+=String.fromCharCode(55296|o>>10,56320|o&1023))}return r}const qt="v1";var Ps=Object.defineProperty,_s=Object.defineProperties,$s=Object.getOwnPropertyDescriptors,Fn=Object.getOwnPropertySymbols,Ws=Object.prototype.hasOwnProperty,Us=Object.prototype.propertyIsEnumerable,Pn=(e,t,r)=>t in e?Ps(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,js=(e,t)=>{for(var r in t||(t={}))Ws.call(t,r)&&Pn(e,r,t[r]);if(Fn)for(var r of Fn(t))Us.call(t,r)&&Pn(e,r,t[r]);return e},Vs=(e,t)=>_s(e,$s(t));const Gs=e=>{const t=Vs(js({},e),{v:qt});return An(As(Ln(JSON.stringify(t))),!0)},Bs=e=>{if(typeof e!="string")return e;try{const t=JSON.parse(e);if(t.timestamp)return t}catch{}try{const t=JSON.parse(An(Fs(Ln(e,!0))));if(t.v===qt)return t;throw new Error(`These events were packed with packer ${t.v} which is incompatible with current packer ${qt}.`)}catch(t){throw console.error(t),new Error("Unknown data format.")}};class $e{constructor(t){this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){const t=this.lineNumber||"",r=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${t}:${r})`:`${this.fileName}:${t}:${r}`}}const zs=/(^|@)\S+:\d+/,_n=/^\s*at .*(\S+:\d+|\(native\))/m,Hs=/^(eval@)?(\[native code])?$/,$n={parse:function(e){if(!e)return[];if(typeof e.stacktrace<"u"||typeof e["opera#sourceloc"]<"u")return this.parseOpera(e);if(e.stack&&e.stack.match(_n))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(e.indexOf(":")===-1)return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split(`
|
|
19
19
|
`).filter(function(t){return!!t.match(_n)},this).map(function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let r=t.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=r.match(/ (\((.+):(\d+):(\d+)\)$)/);r=n?r.replace(n[0],""):r;const o=r.split(/\s+/).slice(1),i=this.extractLocation(n?n[1]:o.pop()),l=o.join(" ")||void 0,c=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new $e({functionName:l,fileName:c,lineNumber:i[1],columnNumber:i[2]})},this)},parseFFOrSafari:function(e){return e.stack.split(`
|
|
20
20
|
`).filter(function(t){return!t.match(Hs)},this).map(function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),t.indexOf("@")===-1&&t.indexOf(":")===-1)return new $e({functionName:t});{const r=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(r),o=n&&n[1]?n[1]:void 0,i=this.extractLocation(t.replace(r,""));return new $e({functionName:o,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf(`
|
|
21
21
|
`)>-1&&e.message.split(`
|
|
@@ -23,6 +23,6 @@ or you can use record.mirror to access the mirror instance during recording.`;q.
|
|
|
23
23
|
`).length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split(`
|
|
24
24
|
`),n=[];for(let o=2,i=r.length;o<i;o+=2){const l=t.exec(r[o]);l&&n.push(new $e({fileName:l[2],lineNumber:parseFloat(l[1])}))}return n},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split(`
|
|
25
25
|
`),n=[];for(let o=0,i=r.length;o<i;o+=2){const l=t.exec(r[o]);l&&n.push(new $e({functionName:l[3]||void 0,fileName:l[2],lineNumber:parseFloat(l[1])}))}return n},parseOpera11:function(e){return e.stack.split(`
|
|
26
|
-
`).filter(function(t){return!!t.match(zs)&&!t.match(/^Error created at/)},this).map(function(t){const r=t.split("@"),n=this.extractLocation(r.pop()),o=(r.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new $e({functionName:o,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function Ys(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let r=e.localName;if(!r)break;r=r.toLowerCase();const n=e.parentElement,o=[];if(n.children&&n.children.length>0)for(let i=0;i<n.children.length;i++){const l=n.children[i];l.localName&&l.localName.toLowerCase&&l.localName.toLowerCase()===r&&o.push(l)}o.length>1&&(r+=`:eq(${o.indexOf(e)})`),t=r+(t?">"+t:""),e=n}return t}function
|
|
27
|
-
End of stack for Error object`:a.name+": "+a.message}return a});function i(c){return!!(
|
|
28
|
-
at `;let n=r;return n+=t.trace.join(r),n}}const Js=e=>{const t=e?.replayLogger||new qs(e).getConsoleLogger();return{handler(r,n,o){let i=null;if(r.type===R.IncrementalSnapshot&&r.data.source===L.Log?i=r.data:r.type===R.Plugin&&r.data.plugin===
|
|
26
|
+
`).filter(function(t){return!!t.match(zs)&&!t.match(/^Error created at/)},this).map(function(t){const r=t.split("@"),n=this.extractLocation(r.pop()),o=(r.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new $e({functionName:o,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function Ys(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let r=e.localName;if(!r)break;r=r.toLowerCase();const n=e.parentElement,o=[];if(n.children&&n.children.length>0)for(let i=0;i<n.children.length;i++){const l=n.children[i];l.localName&&l.localName.toLowerCase&&l.localName.toLowerCase()===r&&o.push(l)}o.length>1&&(r+=`:eq(${o.indexOf(e)})`),t=r+(t?">"+t:""),e=n}return t}function Jt(e){return Object.prototype.toString.call(e)==="[object Object]"}function Wn(e,t){if(t===0)return!0;const r=Object.keys(e);for(const n of r)if(Jt(e[n])&&Wn(e[n],t-1))return!0;return!1}function Qt(e,t){const r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);const n=[],o=[];return JSON.stringify(e,function(c,a){if(n.length>0){const s=n.indexOf(this);~s?n.splice(s+1):n.push(this),~s?o.splice(s,1/0,c):o.push(c),~n.indexOf(a)&&(n[0]===a?a="[Circular ~]":a="[Circular ~."+o.slice(0,n.indexOf(a)).join(".")+"]")}else n.push(a);if(a===null)return a;if(a===void 0)return"undefined";if(i(a))return l(a);if(a instanceof Event){const s={};for(const u in a){const d=a[u];Array.isArray(d)?s[u]=Ys(d.length?d[0]:null):s[u]=d}return s}else{if(a instanceof Node)return a instanceof HTMLElement?a?a.outerHTML:"":a.nodeName;if(a instanceof Error)return a.stack?a.stack+`
|
|
27
|
+
End of stack for Error object`:a.name+": "+a.message}return a});function i(c){return!!(Jt(c)&&Object.keys(c).length>r.numOfKeysLimit||typeof c=="function"||Jt(c)&&Wn(c,r.depthOfLimit))}function l(c){let a=c.toString();return r.stringLengthLimit&&a.length>r.stringLengthLimit&&(a=`${a.slice(0,r.stringLengthLimit)}...`),a}}const Un={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 Xs(e,t,r){const n=r?Object.assign({},Un,r):Un,o=n.logger;if(!o)return()=>{};let i;typeof o=="string"?i=t[o]:i=o;let l=0;const c=[];if(n.level.includes("error")&&window){const s=u=>{const d=u.message,h=u.error,m=$n.parse(h).map(f=>f.toString()),p=[Qt(d,n.stringifyOptions)];e({level:"error",trace:m,payload:p})};window.addEventListener("error",s),c.push(()=>{window&&window.removeEventListener("error",s)})}for(const s of n.level)c.push(a(i,s));return()=>{c.forEach(s=>s())};function a(s,u){return s[u]?be(s,u,d=>(...h)=>{d.apply(this,h);try{const m=$n.parse(new Error).map(f=>f.toString()).splice(1),p=h.map(f=>Qt(f,n.stringifyOptions));l++,l<n.lengthThreshold?e({level:u,trace:m,payload:p}):l===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Qt("The number of log records reached the threshold.")]})}catch(m){d("rrweb logger error:",m,...h)}}):()=>{}}}const er="rrweb/console@1",Zs=e=>({name:er,observer:Xs,options:e}),ft="__rrweb_original__",Ks={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],replayLogger:void 0};class qs{constructor(t){this.config=Object.assign(Ks,t)}getConsoleLogger(){const t={};for(const r of this.config.level)r==="trace"?t[r]=n=>{(console.log[ft]?console.log[ft]:console.log)(...n.payload.map(o=>JSON.parse(o)),this.formatMessage(n))}:t[r]=n=>{(console[r][ft]?console[r][ft]:console[r])(...n.payload.map(o=>JSON.parse(o)),this.formatMessage(n))};return t}formatMessage(t){if(t.trace.length===0)return"";const r=`
|
|
28
|
+
at `;let n=r;return n+=t.trace.join(r),n}}const Js=e=>{const t=e?.replayLogger||new qs(e).getConsoleLogger();return{handler(r,n,o){let i=null;if(r.type===R.IncrementalSnapshot&&r.data.source===L.Log?i=r.data:r.type===R.Plugin&&r.data.plugin===er&&(i=r.data.payload),i)try{typeof t[i.level]=="function"&&t[i.level](i)}catch(l){o.replayer.config.showWarning&&console.warn(l)}}}},jn={key:"_sid"},Qs="rrweb/sequential-id@1",ea=e=>{const t=e?Object.assign({},jn,e):jn;let r=0;return{name:Qs,eventProcessor(n){return Object.assign(n,{[t.key]:++r}),n},options:t}},Vn={key:"_sid",warnOnMissingId:!0},ta=e=>{const{key:t,warnOnMissingId:r}=e?Object.assign({},Vn,e):Vn;let n=1;return{handler(o){if(t in o){const i=o[t];i!==n?console.error(`[sequential-id-plugin]: expect to get an id with value "${n}", but got "${i}"`):n++}else r&&console.warn(`[sequential-id-plugin]: failed to get id in key: "${t}"`)}}};return q.EventType=R,q.IncrementalSource=L,q.MouseInteractions=ee,q.PLUGIN_NAME=er,q.Replayer=gs,q.ReplayerEvents=Y,q.addCustomEvent=ys,q.freezePage=bs,q.getRecordConsolePlugin=Zs,q.getRecordSequentialIdPlugin=ea,q.getReplayConsolePlugin=Js,q.getReplaySequentialIdPlugin=ta,q.pack=Gs,q.record=ke,q.unpack=Bs,q.utils=Co,Object.defineProperty(q,"__esModule",{value:!0}),q}({});
|