@highlight-run/rrweb 2.0.8 → 2.0.11

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.
Files changed (41) hide show
  1. package/dist/plugins/console-record.js +5 -5
  2. package/dist/plugins/console-record.min.js +5 -5
  3. package/dist/plugins/console-record.min.js.map +1 -1
  4. package/dist/plugins/console-replay.js +3 -3
  5. package/dist/plugins/console-replay.min.js +3 -3
  6. package/dist/plugins/console-replay.min.js.map +1 -1
  7. package/dist/record/rrweb-record-pack.js +2 -2
  8. package/dist/record/rrweb-record-pack.min.js +2 -2
  9. package/dist/record/rrweb-record-pack.min.js.map +1 -1
  10. package/dist/record/rrweb-record.js +3 -3
  11. package/dist/record/rrweb-record.min.js +3 -3
  12. package/dist/record/rrweb-record.min.js.map +1 -1
  13. package/dist/replay/rrweb-replay-unpack.js +3 -4
  14. package/dist/replay/rrweb-replay-unpack.min.js +3 -4
  15. package/dist/replay/rrweb-replay-unpack.min.js.map +1 -1
  16. package/dist/replay/rrweb-replay.js +3 -4
  17. package/dist/replay/rrweb-replay.min.js +3 -4
  18. package/dist/replay/rrweb-replay.min.js.map +1 -1
  19. package/dist/rrweb-all.js +24 -25
  20. package/dist/rrweb-all.min.js +24 -25
  21. package/dist/rrweb-all.min.js.map +1 -1
  22. package/dist/rrweb.js +14 -15
  23. package/dist/rrweb.min.js +14 -15
  24. package/dist/rrweb.min.js.map +1 -1
  25. package/es/rrweb/packages/rrdom/es/virtual-dom.js +51 -90
  26. package/es/rrweb/packages/rrweb/src/index.js +1 -1
  27. package/es/rrweb/packages/rrweb/src/record/index.js +6 -3
  28. package/es/rrweb/packages/rrweb/src/record/mutation.js +1 -1
  29. package/es/rrweb/packages/rrweb/src/record/observer.js +1 -1
  30. package/es/rrweb/packages/rrweb/src/replay/index.js +1 -1
  31. package/es/rrweb/packages/rrweb/src/utils.js +1 -1
  32. package/lib/plugins/console-record.js +1 -9
  33. package/lib/plugins/console-replay.js +1 -9
  34. package/lib/record/rrweb-record-pack.js +3 -9
  35. package/lib/record/rrweb-record.js +21 -1061
  36. package/lib/replay/rrweb-replay-unpack.js +96 -1015
  37. package/lib/replay/rrweb-replay.js +96 -1015
  38. package/lib/rrweb-all.js +141 -2034
  39. package/lib/rrweb.js +141 -2034
  40. package/package.json +4 -4
  41. package/es/rrweb/packages/rrweb-snapshot/es/rrweb-snapshot.js +0 -1858
package/dist/rrweb.min.js CHANGED
@@ -1,19 +1,18 @@
1
- var rrweb=function(J){"use strict";var R;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(R||(R={}));function Tt(e){return e.nodeType===e.ELEMENT_NODE}function De(e){var t,n=(t=e)===null||t===void 0?void 0:t.host;return Boolean(n?.shadowRoot===e)}var Ke=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var n=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(function(o){return n.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,n){var r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function Nt(){return new Ke}function Qe(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,s=e.maskInputFn,a=o||"";return(t[n.toLowerCase()]||t[r])&&(s?a=s(a):a="*".repeat(a.length)),a}var Et="__rrweb_original__";function Zn(e){var t=e.getContext("2d");if(!t)return!0;for(var n=50,r=0;r<e.width;r+=n)for(var o=0;o<e.height;o+=n){var s=t.getImageData,a=Et in s?s[Et]:s,l=new Uint32Array(a.call(t,r,o,Math.min(n,e.width-r),Math.min(n,e.height-o)).data.buffer);if(l.some(function(c){return c!==0}))return!1}return!0}function wt(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var Kn=1,Qn=new RegExp("[^a-z0-9-_:]"),Re=-2;function Jn(){return Kn++}function qn(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return Qn.test(t)?"div":t}function Je(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(er).join(""):null}catch{return null}}function er(e){var t=e.cssText;if(tr(e))try{t=Je(e.styleSheet)||t}catch{}return t}function tr(e){return"styleSheet"in e}function nr(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function rr(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var ye,Ct,or=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ir=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,sr=/^(data:)([^,]*),(.*)/i;function $e(e,t){return(e||"").replace(or,function(n,r,o,s,a,l){var c=o||a||l,i=r||s||"";if(!c)return n;if(!ir.test(c)||sr.test(c))return"url("+i+c+i+")";if(c[0]==="/")return"url("+i+(rr(t)+c)+i+")";var u=t.split("/"),d=c.split("/");u.pop();for(var m=0,h=d;m<h.length;m++){var f=h[m];f!=="."&&(f===".."?u.pop():u.push(f))}return"url("+i+u.join("/")+i+")"})}var ar=/^[^ \t\n\r\u000c]+/,lr=/^[, \t\n\r\u000c]+/;function cr(e,t){if(t.trim()==="")return t;var n=0;function r(i){var u,d=i.exec(t.substring(n));return d?(u=d[0],n+=u.length,u):""}for(var o=[];r(lr),!(n>=t.length);){var s=r(ar);if(s.slice(-1)===",")s=Ve(e,s.substring(0,s.length-1)),o.push(s);else{var a="";s=Ve(e,s);for(var l=!1;;){var c=t.charAt(n);if(c===""){o.push((s+a).trim());break}else if(l)c===")"&&(l=!1);else if(c===","){n+=1,o.push((s+a).trim());break}else c==="("&&(l=!0);a+=c,n+=1}}}return o.join(", ")}function Ve(e,t){if(!t||t.trim()==="")return t;var n=e.createElement("a");return n.href=t,n.href}function ur(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function qe(){var e=document.createElement("a");return e.href="",e.href}function It(e,t,n,r){return n==="src"||n==="href"&&r||n==="xlink:href"&&r&&r[0]!=="#"||n==="background"&&r&&(t==="table"||t==="td"||t==="th")?Ve(e,r):n==="srcset"&&r?cr(e,r):n==="style"&&r?$e(r,qe()):t==="object"&&n==="data"&&r?Ve(e,r):r}function dr(e,t,n){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?e.matches(n):!1}function Ue(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?Ue(e.parentNode,t,n):!1;for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?Ue(e.parentNode,t,n):!1}function xt(e,t,n){var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(r===null)return!1;if(typeof t=="string"){if(r.classList.contains(t)||r.closest("."+t))return!0}else if(Ue(r,t,!0))return!0;return!!(n&&(r.matches(n)||r.closest(n)))}function hr(e,t,n){var r=e.contentWindow;if(r){var o=!1,s;try{s=r.document.readyState}catch{return}if(s!=="complete"){var a=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()});return}var l="about:blank";if(r.location.href!==l||e.src===l||e.src===""){setTimeout(t,0);return}e.addEventListener("load",t)}}function mr(e){return e.getAttribute("href")?e.sheet!==null:!0}function pr(e,t,n){var r=!1,o;try{o=e.sheet}catch{return}if(!o){var s=setTimeout(function(){r||(t(),r=!0)},n);e.addEventListener("load",function(){clearTimeout(s),r=!0,t()})}}function fr(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,s=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,c=t.inlineStylesheet,i=t.maskInputOptions,u=i===void 0?{}:i,d=t.maskTextFn,m=t.maskInputFn,h=t.dataURLOptions,f=h===void 0?{}:h,g=t.inlineImages,N=t.recordCanvas,p=t.keepIframeSrcFn,S=t.newlyAddedElement,y=S===void 0?!1:S,T=t.enableStrictPrivacy,D=gr(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:R.Document,childNodes:[],compatMode:e.compatMode,rootId:D}:{type:R.Document,childNodes:[],rootId:D};case e.DOCUMENT_TYPE_NODE:return{type:R.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:D};case e.ELEMENT_NODE:return yr(e,{doc:n,blockClass:o,blockSelector:s,inlineStylesheet:c,maskInputOptions:u,maskInputFn:m,dataURLOptions:f,inlineImages:g,recordCanvas:N,keepIframeSrcFn:p,newlyAddedElement:y,enableStrictPrivacy:T,rootId:D});case e.TEXT_NODE:return vr(e,{maskTextClass:a,maskTextSelector:l,maskTextFn:d,enableStrictPrivacy:T,rootId:D});case e.CDATA_SECTION_NODE:return{type:R.CDATA,textContent:"",rootId:D};case e.COMMENT_NODE:return{type:R.Comment,textContent:e.textContent||"",rootId:D};default:return!1}}function gr(e,t){if(t.hasNode(e)){var n=t.getId(e);return n===1?void 0:n}}function vr(e,t){var n,r=t.maskTextClass,o=t.maskTextSelector,s=t.maskTextFn,a=t.enableStrictPrivacy,l=t.rootId,c=e.parentNode&&e.parentNode.tagName,i=e.textContent,u=c==="STYLE"?!0:void 0,d=c==="SCRIPT"?!0:void 0,m=!1;if(u&&i){try{e.nextSibling||e.previousSibling||!((n=e.parentNode.sheet)===null||n===void 0)&&n.cssRules&&(i=nr(e.parentNode.sheet))}catch(f){console.warn("Cannot get CSS styles from text's parentNode. Error: "+f,e)}i=$e(i,qe()),m=!0}if(d?(i="SCRIPT_PLACEHOLDER",m=!0):c==="NOSCRIPT"&&(i="",m=!0),!u&&!d&&i&&xt(e,r,o)&&(i=s?s(i):i.replace(/[\S]/g,"*")),a&&!m&&c){var h=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!h.has(c)&&i&&(i=wt(i))}return{type:R.Text,textContent:i||"",isStyle:u,rootId:l}}function yr(e,t){for(var n=t.doc,r=t.blockClass,o=t.blockSelector,s=t.inlineStylesheet,a=t.maskInputOptions,l=a===void 0?{}:a,c=t.maskInputFn,i=t.dataURLOptions,u=i===void 0?{}:i,d=t.inlineImages,m=t.recordCanvas,h=t.keepIframeSrcFn,f=t.newlyAddedElement,g=f===void 0?!1:f,N=t.enableStrictPrivacy,p=t.rootId,S=dr(e,r,o),y=qn(e),T={},D=e.attributes.length,A=0;A<D;A++){var M=e.attributes[A];T[M.name]=It(n,y,M.name,M.value)}if(y==="link"&&s){var F=Array.from(n.styleSheets).find(function(v){return v.href===e.href}),W=null;F&&(W=Je(F)),W&&(delete T.rel,delete T.href,T._cssText=$e(W,F.href))}if(y==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var W=Je(e.sheet);W&&(T._cssText=$e(W,qe()))}if(y==="input"||y==="textarea"||y==="select"){var X=e.value;T.type!=="radio"&&T.type!=="checkbox"&&T.type!=="submit"&&T.type!=="button"&&X?T.value=Qe({type:T.type,tagName:y,value:X,maskInputOptions:l,maskInputFn:c}):e.checked&&(T.checked=e.checked)}if(y==="option"&&(e.selected&&!l.select?T.selected=!0:delete T.selected),y==="canvas"&&m){if(e.__context==="2d")Zn(e)||(T.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var Z=e.toDataURL(u.type,u.quality),K=document.createElement("canvas");K.width=e.width,K.height=e.height;var q=K.toDataURL(u.type,u.quality);Z!==q&&(T.rr_dataURL=Z)}}if(y==="img"&&d){ye||(ye=n.createElement("canvas"),Ct=ye.getContext("2d"));var V=e,z=V.crossOrigin;V.crossOrigin="anonymous";var Y=function(){try{ye.width=V.naturalWidth,ye.height=V.naturalHeight,Ct.drawImage(V,0,0),T.rr_dataURL=ye.toDataURL(u.type,u.quality)}catch(v){console.warn("Cannot inline img src="+V.currentSrc+"! Error: "+v)}z?T.crossOrigin=z:V.removeAttribute("crossorigin")};V.complete&&V.naturalWidth!==0?Y():V.onload=Y}if((y==="audio"||y==="video")&&(T.rr_mediaState=e.paused?"paused":"played",T.rr_mediaCurrentTime=e.currentTime),g||(e.scrollLeft&&(T.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(T.rr_scrollTop=e.scrollTop)),S||y==="img"&&N){var L=e.getBoundingClientRect(),U=L.width,b=L.height;T={class:T.class,rr_width:U+"px",rr_height:b+"px"},S=!0}return y==="iframe"&&!h(T.src)&&(e.contentDocument||(T.rr_src=T.src),delete T.src),{type:R.Element,tagName:y,attributes:T,childNodes:[],isSVG:ur(e)||void 0,needBlock:S,rootId:p}}function _(e){return e===void 0?"":e.toLowerCase()}function br(e,t){return!!(t.comment&&e.type===R.Comment||e.type===R.Element&&(t.script&&(e.tagName==="script"||e.tagName==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js"))||t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(_(e.attributes.name).match(/^msapplication-tile(image|color)$/)||_(e.attributes.name)==="application-name"||_(e.attributes.rel)==="icon"||_(e.attributes.rel)==="apple-touch-icon"||_(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&_(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(_(e.attributes.property).match(/^(og|twitter|fb):/)||_(e.attributes.name).match(/^(og|twitter):/)||_(e.attributes.name)==="pinterest")||t.headMetaRobots&&(_(e.attributes.name)==="robots"||_(e.attributes.name)==="googlebot"||_(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(_(e.attributes.name)==="author"||_(e.attributes.name)==="generator"||_(e.attributes.name)==="framework"||_(e.attributes.name)==="publisher"||_(e.attributes.name)==="progid"||_(e.attributes.property).match(/^article:/)||_(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(_(e.attributes.name)==="google-site-verification"||_(e.attributes.name)==="yandex-verification"||_(e.attributes.name)==="csrf-token"||_(e.attributes.name)==="p:domain_verify"||_(e.attributes.name)==="verify-v1"||_(e.attributes.name)==="verification"||_(e.attributes.name)==="shopify-checkout-api-token"))))}function be(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,s=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,c=t.skipChild,i=c===void 0?!1:c,u=t.inlineStylesheet,d=u===void 0?!0:u,m=t.maskInputOptions,h=m===void 0?{}:m,f=t.maskTextFn,g=t.maskInputFn,N=t.slimDOMOptions,p=t.dataURLOptions,S=p===void 0?{}:p,y=t.inlineImages,T=y===void 0?!1:y,D=t.recordCanvas,A=D===void 0?!1:D,M=t.onSerialize,F=t.onIframeLoad,W=t.iframeLoadTimeout,X=W===void 0?5e3:W,Z=t.onStylesheetLoad,K=t.stylesheetLoadTimeout,q=K===void 0?5e3:K,V=t.keepIframeSrcFn,z=V===void 0?function(){return!1}:V,Y=t.newlyAddedElement,L=Y===void 0?!1:Y,U=t.enableStrictPrivacy,b=t.preserveWhiteSpace,v=b===void 0?!0:b,I=fr(e,{doc:n,mirror:r,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,inlineStylesheet:d,maskInputOptions:h,maskTextFn:f,maskInputFn:g,dataURLOptions:S,inlineImages:T,recordCanvas:A,keepIframeSrcFn:z,newlyAddedElement:L,enableStrictPrivacy:U});if(!I)return console.warn(e,"not serialized"),null;var E;if(r.hasNode(e)?E=r.getId(e):br(I,N)||!v&&I.type===R.Text&&!I.isStyle&&!I.textContent.replace(/^\s+|\s+$/gm,"").length?E=Re:E=Jn(),E===Re)return null;var C=Object.assign(I,{id:E});r.add(e,C),M&&M(e);var Q=!i;if(C.type===R.Element){if(Q=Q&&!C.needBlock,C.needBlock&&C.tagName==="img"){var ee=e.cloneNode();ee.src="",r.add(ee,C)}delete C.needBlock,e.shadowRoot&&(C.isShadowHost=!0)}if((C.type===R.Document||C.type===R.Element)&&Q){N.headWhitespace&&C.type===R.Element&&C.tagName==="head"&&(v=!1);for(var ae={doc:n,mirror:r,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,skipChild:i,inlineStylesheet:d,maskInputOptions:h,maskTextFn:f,maskInputFn:g,slimDOMOptions:N,dataURLOptions:S,inlineImages:T,recordCanvas:A,preserveWhiteSpace:v,onSerialize:M,onIframeLoad:F,iframeLoadTimeout:X,onStylesheetLoad:Z,stylesheetLoadTimeout:q,keepIframeSrcFn:z,enableStrictPrivacy:U},P=0,j=Array.from(e.childNodes);P<j.length;P++){var ve=j[P],Me=be(ve,ae);Me&&C.childNodes.push(Me)}if(Tt(e)&&e.shadowRoot)for(var St=0,Yn=Array.from(e.shadowRoot.childNodes);St<Yn.length;St++){var ve=Yn[St],Me=be(ve,ae);Me&&(Me.isShadow=!0,C.childNodes.push(Me))}}return e.parentNode&&De(e.parentNode)&&(C.isShadow=!0),C.type===R.Element&&C.tagName==="iframe"&&hr(e,function(){var ke=e.contentDocument;if(ke&&F){var Hn=be(ke,{doc:ke,mirror:r,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:f,maskInputFn:g,slimDOMOptions:N,dataURLOptions:S,inlineImages:T,recordCanvas:A,preserveWhiteSpace:v,onSerialize:M,onIframeLoad:F,iframeLoadTimeout:X,keepIframeSrcFn:z,enableStrictPrivacy:U});Hn&&F(e,Hn)}},X),C.type===R.Element&&C.tagName==="link"&&C.attributes.rel==="stylesheet"&&(pr(e,function(){if(Z){var ke=be(e,{doc:n,mirror:r,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:f,maskInputFn:g,slimDOMOptions:N,dataURLOptions:S,inlineImages:T,recordCanvas:A,preserveWhiteSpace:v,onSerialize:M,onIframeLoad:F,onStylesheetLoad:Z,iframeLoadTimeout:X,keepIframeSrcFn:z,enableStrictPrivacy:U});ke&&Z(e,ke)}},q),mr(e)===!1)?null:C}function Sr(e,t){var n=t||{},r=n.mirror,o=r===void 0?new Ke:r,s=n.blockClass,a=s===void 0?"highlight-block":s,l=n.blockSelector,c=l===void 0?null:l,i=n.maskTextClass,u=i===void 0?"highlight-mask":i,d=n.maskTextSelector,m=d===void 0?null:d,h=n.inlineStylesheet,f=h===void 0?!0:h,g=n.inlineImages,N=g===void 0?!1:g,p=n.recordCanvas,S=p===void 0?!1:p,y=n.maskAllInputs,T=y===void 0?!1:y,D=n.maskTextFn,A=n.maskInputFn,M=n.slimDOM,F=M===void 0?!1:M,W=n.dataURLOptions,X=n.preserveWhiteSpace,Z=n.onSerialize,K=n.onIframeLoad,q=n.iframeLoadTimeout,V=n.onStylesheetLoad,z=n.stylesheetLoadTimeout,Y=n.keepIframeSrcFn,L=Y===void 0?function(){return!1}:Y,U=n.enableStrictPrivacy,b=U===void 0?!1:U,v=T===!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}:T===!1?{password:!0}:T,I=F===!0||F==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:F==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:F===!1?{}:F;return be(e,{doc:e,mirror:o,blockClass:a,blockSelector:c,maskTextClass:u,maskTextSelector:m,skipChild:!1,inlineStylesheet:f,maskInputOptions:v,maskTextFn:D,maskInputFn:A,slimDOMOptions:I,dataURLOptions:W,inlineImages:N,recordCanvas:S,preserveWhiteSpace:X,onSerialize:Z,onIframeLoad:K,iframeLoadTimeout:q,onStylesheetLoad:V,stylesheetLoadTimeout:z,keepIframeSrcFn:L,newlyAddedElement:!1,enableStrictPrivacy:b})}var Mt=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Tr(e,t){t===void 0&&(t={});var n=1,r=1;function o(b){var v=b.match(/\n/g);v&&(n+=v.length);var I=b.lastIndexOf(`
2
- `);r=I===-1?r+b.length:b.length-I}function s(){var b={line:n,column:r};return function(v){return v.position=new a(b),f(),v}}var a=function(){function b(v){this.start=v,this.end={line:n,column:r},this.source=t.source}return b}();a.prototype.content=e;var l=[];function c(b){var v=new Error(t.source+":"+n+":"+r+": "+b);if(v.reason=b,v.filename=t.source,v.line=n,v.column=r,v.source=e,t.silent)l.push(v);else throw v}function i(){var b=m();return{type:"stylesheet",stylesheet:{source:t.source,rules:b,parsingErrors:l}}}function u(){return h(/^{\s*/)}function d(){return h(/^}/)}function m(){var b,v=[];for(f(),g(v);e.length&&e.charAt(0)!=="}"&&(b=L()||U());)b!==!1&&(v.push(b),g(v));return v}function h(b){var v=b.exec(e);if(v){var I=v[0];return o(I),e=e.slice(I.length),v}}function f(){h(/^\s*/)}function g(b){b===void 0&&(b=[]);for(var v;v=N();)v!==!1&&b.push(v),v=N();return b}function N(){var b=s();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var v=2;e.charAt(v)!==""&&(e.charAt(v)!=="*"||e.charAt(v+1)!=="/");)++v;if(v+=2,e.charAt(v-1)==="")return c("End of comment missing");var I=e.slice(2,v-2);return r+=2,o(I),e=e.slice(v),r+=2,b({type:"comment",comment:I})}}function p(){var b=h(/^([^{]+)/);if(b)return le(b[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(v){return v.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(v){return v.replace(/\u200C/g,",")})}function S(){var b=s(),v=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(v){var I=le(v[0]);if(!h(/^:\s*/))return c("property missing ':'");var E=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),C=b({type:"declaration",property:I.replace(Mt,""),value:E?le(E[0]).replace(Mt,""):""});return h(/^[;\s]*/),C}}function y(){var b=[];if(!u())return c("missing '{'");g(b);for(var v;v=S();)v!==!1&&(b.push(v),g(b)),v=S();return d()?b:c("missing '}'")}function T(){for(var b,v=[],I=s();b=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)v.push(b[1]),h(/^,\s*/);if(v.length)return I({type:"keyframe",values:v,declarations:y()})}function D(){var b=s(),v=h(/^@([-\w]+)?keyframes\s*/);if(v){var I=v[1];if(v=h(/^([-\w]+)\s*/),!v)return c("@keyframes missing name");var E=v[1];if(!u())return c("@keyframes missing '{'");for(var C,Q=g();C=T();)Q.push(C),Q=Q.concat(g());return d()?b({type:"keyframes",name:E,vendor:I,keyframes:Q}):c("@keyframes missing '}'")}}function A(){var b=s(),v=h(/^@supports *([^{]+)/);if(v){var I=le(v[1]);if(!u())return c("@supports missing '{'");var E=g().concat(m());return d()?b({type:"supports",supports:I,rules:E}):c("@supports missing '}'")}}function M(){var b=s(),v=h(/^@host\s*/);if(v){if(!u())return c("@host missing '{'");var I=g().concat(m());return d()?b({type:"host",rules:I}):c("@host missing '}'")}}function F(){var b=s(),v=h(/^@media *([^{]+)/);if(v){var I=le(v[1]);if(!u())return c("@media missing '{'");var E=g().concat(m());return d()?b({type:"media",media:I,rules:E}):c("@media missing '}'")}}function W(){var b=s(),v=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(v)return b({type:"custom-media",name:le(v[1]),media:le(v[2])})}function X(){var b=s(),v=h(/^@page */);if(v){var I=p()||[];if(!u())return c("@page missing '{'");for(var E=g(),C;C=S();)E.push(C),E=E.concat(g());return d()?b({type:"page",selectors:I,declarations:E}):c("@page missing '}'")}}function Z(){var b=s(),v=h(/^@([-\w]+)?document *([^{]+)/);if(v){var I=le(v[1]),E=le(v[2]);if(!u())return c("@document missing '{'");var C=g().concat(m());return d()?b({type:"document",document:E,vendor:I,rules:C}):c("@document missing '}'")}}function K(){var b=s(),v=h(/^@font-face\s*/);if(v){if(!u())return c("@font-face missing '{'");for(var I=g(),E;E=S();)I.push(E),I=I.concat(g());return d()?b({type:"font-face",declarations:I}):c("@font-face missing '}'")}}var q=Y("import"),V=Y("charset"),z=Y("namespace");function Y(b){var v=new RegExp("^@"+b+"\\s*([^;]+);");return function(){var I=s(),E=h(v);if(E){var C={type:b};return C[b]=E[1].trim(),I(C)}}}function L(){if(e[0]==="@")return D()||F()||W()||A()||q()||V()||z()||Z()||X()||M()||K()}function U(){var b=s(),v=p();return v?(g(),b({type:"rule",selectors:v,declarations:y()})):c("selector missing")}return et(i())}function le(e){return e?e.replace(/^\s+|\s+$/g,""):""}function et(e,t){for(var n=e&&typeof e.type=="string",r=n?e:t,o=0,s=Object.keys(e);o<s.length;o++){var a=s[o],l=e[a];Array.isArray(l)?l.forEach(function(c){et(c,r)}):l&&typeof l=="object"&&et(l,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var kt={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 Nr(e){var t=kt[e.tagName]?kt[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function Er(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Dt=/([^\\]):hover/,wr=new RegExp(Dt.source,"g");function Rt(e,t){var n;if(!(!((n=window?.HIG_CONFIGURATION)===null||n===void 0)&&n.enableOnHoverClass))return e;var r=t?.stylesWithHoverClass.get(e);if(r)return r;var o=Tr(e,{silent:!0});if(!o.stylesheet)return e;var s=[];if(o.stylesheet.rules.forEach(function(c){"selectors"in c&&(c.selectors||[]).forEach(function(i){Dt.test(i)&&s.push(i)})}),s.length===0)return e;var a=new RegExp(s.filter(function(c,i){return s.indexOf(c)===i}).sort(function(c,i){return i.length-c.length}).map(function(c){return Er(c)}).join("|"),"g"),l=e.replace(a,function(c){var i=c.replace(wr,"$1.\\:hover");return c+", "+i});return t?.stylesWithHoverClass.set(e,l),l}function Ot(){var e=new Map;return{stylesWithHoverClass:e}}function Cr(e,t){var n=t.doc,r=t.hackCss,o=t.cache;switch(e.type){case R.Document:return n.implementation.createDocument(null,"",null);case R.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case R.Element:var s=Nr(e),a;e.isSVG?a=n.createElementNS("http://www.w3.org/2000/svg",s):a=n.createElement(s);var l=function(i){if(!e.attributes.hasOwnProperty(i))return"continue";var u=e.attributes[i];if(s==="option"&&i==="selected"&&u===!1)return"continue";if(u=typeof u=="boolean"||typeof u=="number"?"":u,i.startsWith("rr_")){if(s==="canvas"&&i==="rr_dataURL"){var d=document.createElement("img");d.src=u,d.onload=function(){var M=a.getContext("2d");M&&M.drawImage(d,0,0,d.width,d.height)}}else if(s==="img"&&i==="rr_dataURL"){var m=a;m.currentSrc.startsWith("data:")||(m.setAttribute("rrweb-original-src",e.attributes.src),m.src=u)}if(i==="rr_width")a.style.width=u;else if(i==="rr_height")a.style.height=u;else if(i==="rr_mediaCurrentTime")a.currentTime=e.attributes.rr_mediaCurrentTime;else if(i==="rr_mediaState")switch(u){case"played":a.play().catch(function(M){return console.warn("media playback error",M)});break;case"paused":a.pause();break}}else{var h=s==="textarea"&&i==="value",f=s==="style"&&i==="_cssText";if(f&&r&&(u=Rt(u,o),typeof u=="string")){for(var g=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,N=void 0,p=[],S="https://replay-cors-proxy.highlightrun.workers.dev";(N=g.exec(u))!==null;)N.index===g.lastIndex&&g.lastIndex++,N.forEach(function(M,F){if(F===0){var W=M.slice(5,M.length-2);p.push({originalUrl:W,proxyUrl:W.replace(W,S+"?url="+W)})}});p.forEach(function(M){u=u.replace(M.originalUrl,M.proxyUrl)})}if(h||f){for(var y=n.createTextNode(u),T=0,D=Array.from(a.childNodes);T<D.length;T++){var A=D[T];A.nodeType===a.TEXT_NODE&&a.removeChild(A)}return a.appendChild(y),"continue"}try{if(e.isSVG&&i==="xlink:href")a.setAttributeNS("http://www.w3.org/1999/xlink",i,u);else if(i==="onload"||i==="onclick"||i.substring(0,7)==="onmouse")a.setAttribute("_"+i,u);else{if(s==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&i==="content")return a.setAttribute("csp-content",u),"continue";s==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||s==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")||(s==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?a.setAttribute("rrweb-original-srcset",e.attributes.srcset):a.setAttribute(i,u))}}catch{}}};for(var c in e.attributes)l(c);if(e.isShadowHost)if(!a.shadowRoot)a.attachShadow({mode:"open"});else for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);return a;case R.Text:return n.createTextNode(e.isStyle&&r?Rt(e.textContent,o):e.textContent);case R.CDATA:return n.createCDATASection(e.textContent);case R.Comment:return n.createComment(e.textContent);default:return null}}function je(e,t){var n=t.doc,r=t.mirror,o=t.skipChild,s=o===void 0?!1:o,a=t.hackCss,l=a===void 0?!0:a,c=t.afterAppend,i=t.cache,u=Cr(e,{doc:n,hackCss:l,cache:i});if(!u)return null;if(e.rootId&&console.assert(r.getNode(e.rootId)===n,"Target document should have the same root id."),e.type===R.Document&&(n.close(),n.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==R.DocumentType&&(e.childNodes[0].type===R.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=n),r.add(u,e),(e.type===R.Document||e.type===R.Element)&&!s)for(var d=0,m=e.childNodes;d<m.length;d++){var h=m[d],f=je(h,{doc:n,mirror:r,skipChild:!1,hackCss:l,afterAppend:c,cache:i});if(!f){console.warn("Failed to rebuild",h);continue}h.isShadow&&Tt(u)&&u.shadowRoot?u.shadowRoot.appendChild(f):u.appendChild(f),c&&c(f)}return u}function Ir(e,t){function n(a){t(a)}for(var r=0,o=e.getIds();r<o.length;r++){var s=o[r];e.has(s)&&n(e.getNode(s))}}function xr(e,t){var n=t.getMeta(e);if(n?.type===R.Element){var r=e;for(var o in n.attributes)if(n.attributes.hasOwnProperty(o)&&o.startsWith("rr_")){var s=n.attributes[o];o==="rr_scrollLeft"&&(r.scrollLeft=s),o==="rr_scrollTop"&&(r.scrollTop=s)}}}function Mr(e,t){var n=t.doc,r=t.onVisit,o=t.hackCss,s=o===void 0?!0:o,a=t.afterAppend,l=t.cache,c=t.mirror,i=c===void 0?new Ke:c,u=je(e,{doc:n,mirror:i,skipChild:!1,hackCss:s,afterAppend:a,cache:l});return Ir(i,function(d){r&&r(d),xr(d,i)}),u}function te(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const Se=`Please stop import mirror directly. Instead of that,\r
1
+ var rrweb=function(L,v){"use strict";function _(t,e,n=document){const o={capture:!0,passive:!0};return n.addEventListener(t,e,o),()=>n.removeEventListener(t,e,o)}const oe=`Please stop import mirror directly. Instead of that,\r
3
2
  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.`;J.mirror={map:{},getId(){return console.error(Se),-1},getNode(){return console.error(Se),null},removeNodeFromMap(){console.error(Se)},has(){return console.error(Se),!1},reset(){console.error(Se)}},typeof window<"u"&&window.Proxy&&window.Reflect&&(J.mirror=new Proxy(J.mirror,{get(e,t,n){return t==="map"&&console.error(Se),Reflect.get(e,t,n)}}));function Te(e,t,n={}){let r=null,o=0;return function(s){const a=Date.now();!o&&n.leading===!1&&(o=a);const l=t-(a-o),c=this,i=arguments;l<=0||l>t?(r&&(clearTimeout(r),r=null),o=a,e.apply(c,i)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(c,i)},l))}}function Oe(e,t,n,r,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(a){setTimeout(()=>{n.set.call(this,a)},0),s&&s.set&&s.set.call(this,a)}}),()=>Oe(e,t,s||{},!0)}function he(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}function tt(){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 At=e=>{try{if(e instanceof HTMLElement)return e.tagName==="CANVAS"}catch{return!1}return!1};function ne(e,t,n){if(!e)return!1;const r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!r)return!1;if(typeof t=="string"){if(r.classList.contains(t)||n&&r.closest("."+t)!==null)return!0}else if(Ue(r,t,n))return!0;return!1}function Lt(e,t){return t.getId(e)!==-1}function Be(e,t){return t.getId(e)===Re}function rt(e,t){if(De(e))return!1;const n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?rt(e.parentNode,t):!0:!0}function ot(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=function(t){if(!(0 in arguments))throw new TypeError("1 argument is required");do if(this===t)return!0;while(t=t&&t.parentNode);return!1})}function Pt(e){const t={},n=(o,s)=>{const a={value:o,parent:s,children:[]};return t[o.node.id]=a,a},r=[];for(const o of e){const{nextId:s,parentId:a}=o;if(s&&s in t){const l=t[s];if(l.parent){const c=l.parent.children.indexOf(l);l.parent.children.splice(c,0,n(o,l.parent))}else{const c=r.indexOf(l);r.splice(c,0,n(o,null))}continue}if(a in t){const l=t[a];l.children.push(n(o,l));continue}r.push(n(o,null))}return r}function st(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)st(e.children[n],t)}function Ne(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function _t(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function at(e,t){var n,r;const o=(r=(n=e.ownerDocument)==null?void 0:n.defaultView)==null?void 0:r.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=o.getBoundingClientRect(),a=at(o,t),l=s.height/o.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}}function Ae(e){return Boolean(e?.shadowRoot)}function Ee(e,t){const n=e[t[0]];return t.length===1?n:Ee(n.cssRules[t[1]].cssRules,t.slice(2))}function lt(e){const t=[...e],n=t.pop();return{positions:t,index:n}}function Ft(e){const t=new Set,n=[];for(let r=e.length;r--;){const o=e[r];t.has(o.id)||(n.push(o),t.add(o.id))}return n}var kr=Object.freeze({__proto__:null,on:te,get _mirror(){return J.mirror},throttle:Te,hookSetter:Oe,patch:he,getWindowHeight:tt,getWindowWidth:nt,isCanvasNode:At,isBlocked:ne,isSerialized:Lt,isIgnored:Be,isAncestorRemoved:rt,isTouchEvent:ot,polyfill:it,queueToResolveTrees:Pt,iterateResolveTree:st,isSerializedIframe:Ne,isSerializedStylesheet:_t,getBaseDimension:at,hasShadowRoot:Ae,getNestedRule:Ee,getPositionsAndIndex:lt,uniqueTextMutations:Ft}),w=(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))(w||{}),x=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e))(x||{}),G=(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))(G||{}),ce=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ce||{}),me=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(me||{}),O=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e))(O||{});function Wt(e){return"__ln"in e}class Dr{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=n?.next||null;return n}addNode(t){const n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&Wt(t.previousSibling)){const r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&Wt(t.nextSibling)&&t.nextSibling.__ln.previous){const r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;this.length++}removeNode(t){const n=t.__ln;!this.head||(n.previous?(n.previous.next=n.next,n.next&&(n.next.previous=n.previous)):(this.head=n.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}}const $t=(e,t)=>`${e}@${t}`;class Rr{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],n=new Dr,r=l=>{let c=l,i=Re;for(;i===Re;)c=c&&c.nextSibling,i=c&&this.mirror.getId(c);return i},o=l=>{var c,i,u,d,m;const h=l.getRootNode?(c=l.getRootNode())==null?void 0:c.host:null;let f=h;for(;(u=(i=f?.getRootNode)==null?void 0:i.call(f))!=null&&u.host;)f=((m=(d=f?.getRootNode)==null?void 0:d.call(f))==null?void 0:m.host)||null;const g=!this.doc.contains(l)&&(!f||!this.doc.contains(f));if(!l.parentNode||g)return;const N=De(l.parentNode)?this.mirror.getId(h):this.mirror.getId(l.parentNode),p=r(l);if(N===-1||p===-1)return n.addNode(l);const S=be(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!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:y=>{Ne(y,this.mirror)&&this.iframeManager.addIframe(y),_t(y,this.mirror)&&this.stylesheetManager.addStylesheet(y),Ae(l)&&this.shadowDomManager.addShadowRoot(l.shadowRoot,document)},onIframeLoad:(y,T)=>{this.iframeManager.attachIframe(y,T,this.mirror),this.shadowDomManager.observeAttachShadow(y)},onStylesheetLoad:(y,T)=>{this.stylesheetManager.attachStylesheet(y,T,this.mirror)},newlyAddedElement:!0});S&&t.push({parentId:N,nextId:p,node:S})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of Array.from(this.movedSet.values()))Vt(this.removes,l,this.mirror)&&!this.movedSet.has(l.parentNode)||o(l);for(const l of Array.from(this.addedSet.values()))!jt(this.droppedSet,l)&&!Vt(this.removes,l,this.mirror)||jt(this.movedSet,l)?o(l):this.droppedSet.add(l);let s=null;for(;n.length;){let l=null;if(s){const c=this.mirror.getId(s.value.parentNode),i=r(s.value);c!==-1&&i!==-1&&(l=s)}if(!l)for(let c=n.length-1;c>=0;c--){const i=n.get(c);if(i){const u=this.mirror.getId(i.value.parentNode),d=r(i.value);if(u!==-1&&d!==-1){l=i;break}}}if(!l){for(;n.head;)n.removeNode(n.head.value);break}s=l.previous,n.removeNode(l.value),o(l.value)}const a={texts:this.texts.map(l=>{let c=l.value;return this.enableStrictPrivacy&&c&&(c=wt(c)),{id:this.mirror.getId(l.node),value:c}}).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>({id:this.mirror.getId(l.node),attributes:l.attributes})).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=t=>{if(!Be(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!ne(t.target,this.blockClass,!1)&&n!==t.oldValue&&this.texts.push({value:xt(t.target,this.maskTextClass,this.maskTextSelector)&&n?this.maskTextFn?this.maskTextFn(n):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{const n=t.target;let r=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(r=Qe({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:r,maskInputFn:this.maskInputFn})),ne(t.target,this.blockClass,!1)||r===t.oldValue)return;let o=this.attributes.find(s=>s.node===t.target);if(o||(o={node:t.target,attributes:{}},this.attributes.push(o)),t.attributeName==="style"){const s=this.doc.createElement("span");t.oldValue&&s.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});const a=o.attributes.style;for(const l of Array.from(n.style)){const c=n.style.getPropertyValue(l),i=n.style.getPropertyPriority(l);(c!==s.style.getPropertyValue(l)||i!==s.style.getPropertyPriority(l))&&(i===""?a[l]=c:a[l]=[c,i])}for(const l of Array.from(s.style))n.style.getPropertyValue(l)===""&&(a[l]=!1)}else{if(t.target.tagName==="INPUT"){const s=t.target;if(s.type==="password"){o.attributes.value="*".repeat(s.value.length);break}}o.attributes[t.attributeName]=It(this.doc,t.target.tagName,t.attributeName,r)}break}case"childList":{if(ne(t.target,this.blockClass,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{const r=this.mirror.getId(n),o=De(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);ne(t.target,this.blockClass,!1)||Be(n,this.mirror)||!Lt(n,this.mirror)||(this.addedSet.has(n)?(ct(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||rt(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[$t(r,o)]?ct(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:De(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(this.mirror.hasNode(t)){if(Be(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[$t(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);ne(t,this.blockClass,!1)||t.childNodes.forEach(r=>this.genAdds(r))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","enableStrictPrivacy"].forEach(n=>{this[n]=t[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function ct(e,t){e.delete(t),t.childNodes.forEach(n=>ct(e,n))}function Vt(e,t,n){return e.length===0?!1:Ut(e,t,n)}function Ut(e,t,n){const{parentNode:r}=t;if(!r)return!1;const o=n.getId(r);return e.some(s=>s.id===o)?!0:Ut(e,r,n)}function jt(e,t){return e.size===0?!1:Bt(e,t)}function Bt(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:Bt(e,n):!1}var Or=Object.defineProperty,Ar=Object.defineProperties,Lr=Object.getOwnPropertyDescriptors,Gt=Object.getOwnPropertySymbols,Pr=Object.prototype.hasOwnProperty,_r=Object.prototype.propertyIsEnumerable,zt=(e,t,n)=>t in e?Or(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Yt=(e,t)=>{for(var n in t||(t={}))Pr.call(t,n)&&zt(e,n,t[n]);if(Gt)for(var n of Gt(t))_r.call(t,n)&&zt(e,n,t[n]);return e},Fr=(e,t)=>Ar(e,Lr(t));const pe=[],Ht=typeof CSSGroupingRule<"u",Xt=typeof CSSMediaRule<"u",Zt=typeof CSSSupportsRule<"u",Kt=typeof CSSConditionRule<"u";function Le(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 Qt(e,t){var n,r;const o=new Rr;pe.push(o),o.init(e);let s=window.MutationObserver||window.__rrMutationObserver;const a=(r=(n=window?.Zone)==null?void 0:n.__symbol__)==null?void 0:r.call(n,"MutationObserver");a&&window[a]&&(s=window[a]);const l=new s(o.processMutations.bind(o));return l.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),l}function Wr({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,s=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let a=[],l;const c=Te(d=>{const m=Date.now()-l;e(a.map(h=>(h.timeOffset-=m,h)),d),a=[],l=null},s),i=Te(d=>{const m=Le(d),{clientX:h,clientY:f}=ot(d)?d.changedTouches[0]:d;l||(l=Date.now()),a.push({x:h,y:f,id:r.getId(m),timeOffset:Date.now()-l}),c(typeof DragEvent<"u"&&d instanceof DragEvent?x.Drag:d instanceof MouseEvent?x.MouseMove:x.TouchMove)},o,{trailing:!1}),u=[te("mousemove",i,n),te("touchmove",i,n),te("drag",i,n)];return()=>{u.forEach(d=>d())}}function $r({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[],l=c=>i=>{const u=Le(i);if(ne(u,r,!0)||At(u))return;const d=ot(i)?i.changedTouches[0]:i;if(!d)return;const m=n.getId(u),{clientX:h,clientY:f}=d;e({type:G[c],id:m,x:h,y:f})};return Object.keys(G).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&s[c]!==!1).forEach(c=>{const i=c.toLowerCase(),u=l(c);a.push(te(i,u,t))}),()=>{a.forEach(c=>c())}}function Jt({scrollCb:e,doc:t,mirror:n,blockClass:r,sampling:o}){const s=Te(a=>{const l=Le(a);if(!l||ne(l,r,!0))return;const c=n.getId(l);if(l===t){const i=t.scrollingElement||t.documentElement;e({id:c,x:i.scrollLeft,y:i.scrollTop})}else e({id:c,x:l.scrollLeft,y:l.scrollTop})},o.scroll||100);return te("scroll",s,t)}function Vr({viewportResizeCb:e}){let t=-1,n=-1;const r=Te(()=>{const o=tt(),s=nt();(t!==o||n!==s)&&(e({width:Number(s),height:Number(o)}),t=o,n=s)},200);return te("resize",r,window)}function qt(e,t){const n=Yt({},e);return t||delete n.userTriggered,n}const Ur=["INPUT","TEXTAREA","SELECT"],en=new WeakMap;function jr({inputCb:e,doc:t,mirror:n,blockClass:r,ignoreClass:o,maskInputOptions:s,maskInputFn:a,sampling:l,userTriggeredOnInput:c}){function i(f){let g=Le(f);const N=f.isTrusted;if(g&&g.tagName==="OPTION"&&(g=g.parentElement),!g||!g.tagName||Ur.indexOf(g.tagName)<0||ne(g,r,!0))return;const p=g.type;if(g.classList.contains(o))return;let S=g.value,y=!1;p==="radio"||p==="checkbox"?y=g.checked:(s[g.tagName.toLowerCase()]||s[p])&&(S=Qe({maskInputOptions:s,tagName:g.tagName,type:p,value:S,maskInputFn:a})),u(g,qt({text:S,isChecked:y,userTriggered:N},c));const T=g.name;p==="radio"&&T&&y&&t.querySelectorAll(`input[type="radio"][name="${T}"]`).forEach(D=>{D!==g&&u(D,qt({text:D.value,isChecked:!y,userTriggered:!1},c))})}function u(f,g){const N=en.get(f);if(!N||N.text!==g.text||N.isChecked!==g.isChecked){en.set(f,g);const p=n.getId(f);e(Fr(Yt({},g),{id:p}))}}const d=(l.input==="last"?["change"]:["input","change"]).map(f=>te(f,i,t)),m=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),h=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return m&&m.set&&d.push(...h.map(f=>Oe(f[0],f[1],{set(){i({target:this})}}))),()=>{d.forEach(f=>f())}}function Ge(e){const t=[];function n(r,o){if(Ht&&r.parentRule instanceof CSSGroupingRule||Xt&&r.parentRule instanceof CSSMediaRule||Zt&&r.parentRule instanceof CSSSupportsRule||Kt&&r.parentRule instanceof CSSConditionRule){const s=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(s)}else{const s=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(s)}return o}return n(e,t)}function Br({styleSheetRuleCb:e,mirror:t},{win:n}){const r=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=function(l,c){const i=t.getId(this.ownerNode);return i!==-1&&e({id:i,adds:[{rule:l,index:c}]}),r.apply(this,arguments)};const o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=function(l){const c=t.getId(this.ownerNode);return c!==-1&&e({id:c,removes:[{index:l}]}),o.apply(this,arguments)};const s={};Ht?s.CSSGroupingRule=n.CSSGroupingRule:(Xt&&(s.CSSMediaRule=n.CSSMediaRule),Kt&&(s.CSSConditionRule=n.CSSConditionRule),Zt&&(s.CSSSupportsRule=n.CSSSupportsRule));const a={};return Object.entries(s).forEach(([l,c])=>{a[l]={insertRule:c.prototype.insertRule,deleteRule:c.prototype.deleteRule},c.prototype.insertRule=function(i,u){const d=t.getId(this.parentStyleSheet.ownerNode);return d!==-1&&e({id:d,adds:[{rule:i,index:[...Ge(this),u||0]}]}),a[l].insertRule.apply(this,arguments)},c.prototype.deleteRule=function(i){const u=t.getId(this.parentStyleSheet.ownerNode);return u!==-1&&e({id:u,removes:[{index:[...Ge(this),i]}]}),a[l].deleteRule.apply(this,arguments)}}),()=>{n.CSSStyleSheet.prototype.insertRule=r,n.CSSStyleSheet.prototype.deleteRule=o,Object.entries(s).forEach(([l,c])=>{c.prototype.insertRule=a[l].insertRule,c.prototype.deleteRule=a[l].deleteRule})}}function Gr({styleDeclarationCb:e,mirror:t},{win:n}){const r=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=function(s,a,l){var c,i;const u=t.getId((i=(c=this.parentRule)==null?void 0:c.parentStyleSheet)==null?void 0:i.ownerNode);return u!==-1&&e({id:u,set:{property:s,value:a,priority:l},index:Ge(this.parentRule)}),r.apply(this,arguments)};const o=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=function(s){var a,l;const c=t.getId((l=(a=this.parentRule)==null?void 0:a.parentStyleSheet)==null?void 0:l.ownerNode);return c!==-1&&e({id:c,remove:{property:s},index:Ge(this.parentRule)}),o.apply(this,arguments)},()=>{n.CSSStyleDeclaration.prototype.setProperty=r,n.CSSStyleDeclaration.prototype.removeProperty=o}}function zr({mediaInteractionCb:e,blockClass:t,mirror:n,sampling:r}){const o=a=>Te(l=>{const c=Le(l);if(!c||ne(c,t,!0))return;const{currentTime:i,volume:u,muted:d}=c;e({type:a,id:n.getId(c),currentTime:i,volume:u,muted:d})},r.media||500),s=[te("play",o(me.Play)),te("pause",o(me.Pause)),te("seeked",o(me.Seeked)),te("volumechange",o(me.VolumeChange))];return()=>{s.forEach(a=>a())}}function Yr({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,s=n.FontFace;n.FontFace=function(l,c,i){const u=new s(l,c,i);return o.set(u,{family:l,buffer:typeof c!="string",descriptors:i,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),u};const a=he(t.fonts,"add",function(l){return function(c){return setTimeout(()=>{const i=o.get(c);i&&(e(i),o.delete(c))},0),l.apply(this,[c])}});return r.push(()=>{n.FontFace=s}),r.push(a),()=>{r.forEach(l=>l())}}function Hr(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:s,viewportResizeCb:a,inputCb:l,mediaInteractionCb:c,styleSheetRuleCb:i,styleDeclarationCb:u,canvasMutationCb:d,fontCb:m}=e;e.mutationCb=(...h)=>{t.mutation&&t.mutation(...h),n(...h)},e.mousemoveCb=(...h)=>{t.mousemove&&t.mousemove(...h),r(...h)},e.mouseInteractionCb=(...h)=>{t.mouseInteraction&&t.mouseInteraction(...h),o(...h)},e.scrollCb=(...h)=>{t.scroll&&t.scroll(...h),s(...h)},e.viewportResizeCb=(...h)=>{t.viewportResize&&t.viewportResize(...h),a(...h)},e.inputCb=(...h)=>{t.input&&t.input(...h),l(...h)},e.mediaInteractionCb=(...h)=>{t.mediaInteaction&&t.mediaInteaction(...h),c(...h)},e.styleSheetRuleCb=(...h)=>{t.styleSheetRule&&t.styleSheetRule(...h),i(...h)},e.styleDeclarationCb=(...h)=>{t.styleDeclaration&&t.styleDeclaration(...h),u(...h)},e.canvasMutationCb=(...h)=>{t.canvasMutation&&t.canvasMutation(...h),d(...h)},e.fontCb=(...h)=>{t.font&&t.font(...h),m(...h)}}function Xr(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};Hr(e,t);const r=Qt(e,e.doc),o=Wr(e),s=$r(e),a=Jt(e),l=Vr(e),c=jr(e),i=zr(e),u=Br(e,{win:n}),d=Gr(e,{win:n}),m=e.collectFonts?Yr(e):()=>{},h=[];for(const f of e.plugins)h.push(f.observer(f.callback,n,f.options));return()=>{pe.forEach(f=>f.reset()),r.disconnect(),o(),s(),a(),l(),c(),i(),u(),d(),m(),h.forEach(f=>f())}}class Zr{constructor(t){this.iframes=new WeakMap,this.mutationCb=t.mutationCb}addIframe(t){this.iframes.set(t,!0)}addLoadListener(t){this.loadListener=t}attachIframe(t,n,r){var o;this.mutationCb({adds:[{parentId:r.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(o=this.loadListener)==null||o.call(this,t)}}var Kr=Object.defineProperty,Qr=Object.defineProperties,Jr=Object.getOwnPropertyDescriptors,tn=Object.getOwnPropertySymbols,qr=Object.prototype.hasOwnProperty,eo=Object.prototype.propertyIsEnumerable,nn=(e,t,n)=>t in e?Kr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rn=(e,t)=>{for(var n in t||(t={}))qr.call(t,n)&&nn(e,n,t[n]);if(tn)for(var n of tn(t))eo.call(t,n)&&nn(e,n,t[n]);return e},on=(e,t)=>Qr(e,Jr(t));class to{constructor(t){this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;const n=this;this.restorePatches.push(he(HTMLElement.prototype,"attachShadow",function(r){return function(){const o=r.apply(this,arguments);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,this.ownerDocument),o}}))}addShadowRoot(t,n){Qt(on(rn({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),Jt(on(rn({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}observeAttachShadow(t){if(t.contentWindow){const n=this;this.restorePatches.push(he(t.contentWindow.HTMLElement.prototype,"attachShadow",function(r){return function(){const o=r.apply(this,arguments);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,t.contentDocument),o}}))}}reset(){this.restorePatches.forEach(t=>t())}}for(var we="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Pe=typeof Uint8Array>"u"?[]:new Uint8Array(256),ze=0;ze<we.length;ze++)Pe[we.charCodeAt(ze)]=ze;var no=function(e){var t=new Uint8Array(e),n,r=t.length,o="";for(n=0;n<r;n+=3)o+=we[t[n]>>2],o+=we[(t[n]&3)<<4|t[n+1]>>4],o+=we[(t[n+1]&15)<<2|t[n+2]>>6],o+=we[t[n+2]&63];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o},ro=function(e){var t=e.length*.75,n=e.length,r,o=0,s,a,l,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var i=new ArrayBuffer(t),u=new Uint8Array(i);for(r=0;r<n;r+=4)s=Pe[e.charCodeAt(r)],a=Pe[e.charCodeAt(r+1)],l=Pe[e.charCodeAt(r+2)],c=Pe[e.charCodeAt(r+3)],u[o++]=s<<2|a>>4,u[o++]=(a&15)<<4|l>>2,u[o++]=(l&3)<<6|c&63;return i};const sn=new Map;function oo(e,t){let n=sn.get(e);return n||(n=new Map,sn.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}const an=(e,t,n)=>{if(!e||!(cn(e,t)||typeof e=="object"))return;const r=e.constructor.name,o=oo(n,r);let s=o.indexOf(e);return s===-1&&(s=o.length,o.push(e)),s};function Ye(e,t,n){if(e instanceof Array)return e.map(r=>Ye(r,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const r=e.constructor.name,o=no(e);return{rr_type:r,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Ye(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const r=e.constructor.name,{src:o}=e;return{rr_type:r,src:o}}else if(e instanceof HTMLCanvasElement){const r="HTMLImageElement",o=e.toDataURL();return{rr_type:r,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Ye(e.data,t,n),e.width,e.height]};if(cn(e,t)||typeof e=="object"){const r=e.constructor.name,o=an(e,t,n);return{rr_type:r,index:o}}}}return e}const ln=(e,t,n)=>[...e].map(r=>Ye(r,t,n)),cn=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(r=>typeof t[r]=="function");return Boolean(n.find(r=>e instanceof t[r]))};function io(e,t,n,r){const o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of s)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;const l=he(t.CanvasRenderingContext2D.prototype,a,function(c){return function(...i){return ne(this.canvas,n,!0)||setTimeout(()=>{const u=ln([...i],t,this);e(this.canvas,{type:ce["2D"],property:a,args:u})},0),c.apply(this,i)}});o.push(l)}catch{const c=Oe(t.CanvasRenderingContext2D.prototype,a,{set(i){e(this.canvas,{type:ce["2D"],property:a,args:[i],setter:!0})}});o.push(c)}return()=>{o.forEach(a=>a())}}function un(e,t){const n=[];try{const r=he(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(s,...a){return ne(this,t,!0)||"__context"in this||(this.__context=s),o.apply(this,[s,...a])}});n.push(r)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(r=>r())}}function dn(e,t,n,r,o,s){const a=[],l=Object.getOwnPropertyNames(e);for(const c of l)try{if(typeof e[c]!="function")continue;const i=he(e,c,function(u){return function(...d){const m=u.apply(this,d);if(an(m,s,e),!ne(this.canvas,r,!0)){const h=ln([...d],s,e),f={type:t,property:c,args:h};n(this.canvas,f)}return m}});a.push(i)}catch{const u=Oe(e,c,{set(d){n(this.canvas,{type:t,property:c,args:[d],setter:!0})}});a.push(u)}return a}function so(e,t,n,r){const o=[];return o.push(...dn(t.WebGLRenderingContext.prototype,ce.WebGL,e,n,r,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...dn(t.WebGL2RenderingContext.prototype,ce.WebGL2,e,n,r,t)),()=>{o.forEach(s=>s())}}function ao(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,s=n.length;o<s;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}function lo(e,t,n){var r=t===void 0?null:t,o=n===void 0?!1:n,s=ao(e,o),a=s.indexOf(`
5
- `,10)+1,l=s.substring(a)+(r?"//# sourceMappingURL="+r:""),c=new Blob([l],{type:"application/javascript"});return URL.createObjectURL(c)}function co(e,t,n){var r;return function(s){return r=r||lo(e,t,n),new Worker(r,s)}}var uo=co("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Zm9yKHZhciByPSJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvIixsPXR5cGVvZiBVaW50OEFycmF5PiJ1Ij9bXTpuZXcgVWludDhBcnJheSgyNTYpLGY9MDtmPHIubGVuZ3RoO2YrKylsW3IuY2hhckNvZGVBdChmKV09Zjt2YXIgZD1mdW5jdGlvbihzKXt2YXIgZT1uZXcgVWludDhBcnJheShzKSxuLGE9ZS5sZW5ndGgsdD0iIjtmb3Iobj0wO248YTtuKz0zKXQrPXJbZVtuXT4+Ml0sdCs9clsoZVtuXSYzKTw8NHxlW24rMV0+PjRdLHQrPXJbKGVbbisxXSYxNSk8PDJ8ZVtuKzJdPj42XSx0Kz1yW2VbbisyXSY2M107cmV0dXJuIGElMz09PTI/dD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTEpKyI9IjphJTM9PT0xJiYodD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTIpKyI9PSIpLHR9O2NvbnN0IGM9bmV3IE1hcCx1PW5ldyBNYXA7YXN5bmMgZnVuY3Rpb24gcChzLGUpe2NvbnN0IG49YCR7c30tJHtlfWA7aWYodS5oYXMobikpcmV0dXJuIHUuZ2V0KG4pO2NvbnN0IGE9bmV3IE9mZnNjcmVlbkNhbnZhcyhzLGUpO2EuZ2V0Q29udGV4dCgiMmQiKTtjb25zdCB0PWF3YWl0KGF3YWl0IGEuY29udmVydFRvQmxvYigpKS5hcnJheUJ1ZmZlcigpLGc9ZCh0KTtyZXR1cm4gdS5zZXQobixnKSxnfWNvbnN0IGk9c2VsZjtpLm9ubWVzc2FnZT1hc3luYyBmdW5jdGlvbihzKXtpZighKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcykpcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOnMuZGF0YS5pZH0pO2NvbnN0e2lkOmUsYml0bWFwOm4sd2lkdGg6YSxoZWlnaHQ6dH09cy5kYXRhLGc9cChhLHQpLGg9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2guZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCB3PWF3YWl0IGguY29udmVydFRvQmxvYigpLHk9dy50eXBlLGI9YXdhaXQgdy5hcnJheUJ1ZmZlcigpLG89ZChiKTtpZighYy5oYXMoZSkmJmF3YWl0IGc9PT1vKXJldHVybiBjLnNldChlLG8pLGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpZihjLmdldChlKT09PW8pcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpLnBvc3RNZXNzYWdlKHtpZDplLHR5cGU6eSxiYXNlNjQ6byx3aWR0aDphLGhlaWdodDp0fSksYy5zZXQoZSxvKX19KSgpOwoK",null,!1),hn=Object.getOwnPropertySymbols,ho=Object.prototype.hasOwnProperty,mo=Object.prototype.propertyIsEnumerable,po=(e,t)=>{var n={};for(var r in e)ho.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&hn)for(var r of hn(e))t.indexOf(r)<0&&mo.call(e,r)&&(n[r]=e[r]);return n},fo=(e,t,n)=>new Promise((r,o)=>{var s=c=>{try{l(n.next(c))}catch(i){o(i)}},a=c=>{try{l(n.throw(c))}catch(i){o(i)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,a);l((n=n.apply(e,t)).next())});class go{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(a,l){(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(l)};const{sampling:n="all",win:r,blockClass:o,recordCanvas:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&n==="all"&&this.initCanvasMutationObserver(r,o),s&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,o)}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,n,r){const o=un(n,r),s=new Map,a=new uo;a.onmessage=d=>{const{id:m}=d.data;if(s.set(m,!1),!("base64"in d.data))return;const{base64:h,type:f,width:g,height:N}=d.data;this.mutationCb({id:m,type:ce["2D"],commands:[{property:"clearRect",args:[0,0,g,N]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:h}],type:f}]},0,0]}]})};const l=1e3/t;let c=0,i;const u=d=>{if(c&&d-c<l){i=requestAnimationFrame(u);return}c=d,n.document.querySelectorAll(`canvas:not(.${r} *)`).forEach(m=>fo(this,null,function*(){var h;const f=this.mirror.getId(m);if(s.get(f))return;if(s.set(f,!0),["webgl","webgl2"].includes(m.__context)){const N=m.getContext(m.__context);((h=N?.getContextAttributes())==null?void 0:h.preserveDrawingBuffer)===!1&&N?.clear(N.COLOR_BUFFER_BIT)}const g=yield createImageBitmap(m);a.postMessage({id:f,bitmap:g,width:m.width,height:m.height},[g])})),i=requestAnimationFrame(u)};i=requestAnimationFrame(u),this.resetObservers=()=>{o(),cancelAnimationFrame(i)}}initCanvasMutationObserver(t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=un(t,n),o=io(this.processMutation.bind(this),t,n,this.mirror),s=so(this.processMutation.bind(this),t,n,this.mirror);this.resetObservers=()=>{r(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=n=>{this.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{const r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,n){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(t);if(!r||n===-1)return;const o=r.map(a=>po(a,["type"])),{type:s}=r[0];this.mutationCb({id:n,type:s,commands:o}),this.pendingCanvasMutations.delete(t)}}class vo{constructor(t){this.trackedStylesheets=new WeakSet,this.mutationCb=t.mutationCb}addStylesheet(t){this.trackedStylesheets.has(t)||(this.trackedStylesheets.add(t),this.trackStylesheet(t))}trackStylesheet(t){}attachStylesheet(t,n,r){this.mutationCb({adds:[{parentId:r.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[]}),this.addStylesheet(t)}}var yo=Object.defineProperty,bo=Object.defineProperties,So=Object.getOwnPropertyDescriptors,mn=Object.getOwnPropertySymbols,To=Object.prototype.hasOwnProperty,No=Object.prototype.propertyIsEnumerable,pn=(e,t,n)=>t in e?yo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,re=(e,t)=>{for(var n in t||(t={}))To.call(t,n)&&pn(e,n,t[n]);if(mn)for(var n of mn(t))No.call(t,n)&&pn(e,n,t[n]);return e},Eo=(e,t)=>bo(e,So(t));function H(e){return Eo(re({},e),{timestamp:Date.now()})}let B,_e;const ue=Nt();function fe(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="highlight-block",blockSelector:s=null,ignoreClass:a="highlight-ignore",maskTextClass:l="highlight-mask",maskTextSelector:c=null,inlineStylesheet:i=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:m,maskInputFn:h,maskTextFn:f,hooks:g,packFn:N,sampling:p={},mousemoveWait:S,recordCanvas:y=!1,userTriggeredOnInput:T=!1,collectFonts:D=!1,inlineImages:A=!1,plugins:M,keepIframeSrcFn:F=()=>!1,enableStrictPrivacy:W=!1}=e;if(!t)throw new Error("emit function is required");S!==void 0&&p.mousemove===void 0&&(p.mousemove=S),ue.reset();const X=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},Z=m===!0||m==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:m==="all",headMetaDescKeywords:m==="all"}:m||{};it();let K,q=0;const V=E=>{for(const C of M||[])C.eventProcessor&&(E=C.eventProcessor(E));return N&&(E=N(E)),E};B=(E,C)=>{var Q;if(((Q=pe[0])==null?void 0:Q.isFrozen())&&E.type!==w.FullSnapshot&&!(E.type===w.IncrementalSnapshot&&E.data.source===x.Mutation)&&pe.forEach(ee=>ee.unfreeze()),t(V(E),C),E.type===w.FullSnapshot)K=E,q=0;else if(E.type===w.IncrementalSnapshot){if(E.data.source===x.Mutation&&E.data.isAttachIframe)return;q++;const ee=r&&q>=r,ae=n&&E.timestamp-K.timestamp>n;(ee||ae)&&_e(!0)}};const z=E=>{B(H({type:w.IncrementalSnapshot,data:re({source:x.Mutation},E)}))},Y=E=>B(H({type:w.IncrementalSnapshot,data:re({source:x.Scroll},E)})),L=E=>B(H({type:w.IncrementalSnapshot,data:re({source:x.CanvasMutation},E)})),U=new Zr({mutationCb:z}),b=new vo({mutationCb:z}),v=new go({recordCanvas:y,mutationCb:L,win:window,blockClass:o,mirror:ue,sampling:p.canvas}),I=new to({mutationCb:z,scrollCb:Y,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:c,inlineStylesheet:i,maskInputOptions:X,maskTextFn:f,maskInputFn:h,recordCanvas:y,inlineImages:A,sampling:p,slimDOMOptions:Z,iframeManager:U,stylesheetManager:b,canvasManager:v,enableStrictPrivacy:W},mirror:ue});_e=(E=!1)=>{var C,Q,ee,ae;B(H({type:w.Meta,data:{href:window.location.href,width:nt(),height:tt()}}),E),pe.forEach(j=>j.lock());const P=Sr(document,{mirror:ue,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:c,inlineStylesheet:i,maskAllInputs:X,maskTextFn:f,slimDOM:Z,recordCanvas:y,inlineImages:A,enableStrictPrivacy:W,onSerialize:j=>{Ne(j,ue)&&U.addIframe(j),Ae(j)&&I.addShadowRoot(j.shadowRoot,document)},onIframeLoad:(j,ve)=>{U.attachIframe(j,ve,ue),I.observeAttachShadow(j)},onStylesheetLoad:(j,ve)=>{this.stylesheetManager.attachStylesheet(j,ve,this.mirror)},keepIframeSrcFn:F});if(!P)return console.warn("Failed to snapshot the document");B(H({type:w.FullSnapshot,data:{node:P,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((Q=(C=document?.body)==null?void 0:C.parentElement)==null?void 0:Q.scrollLeft)||document?.body.scrollLeft||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((ae=(ee=document?.body)==null?void 0:ee.parentElement)==null?void 0:ae.scrollTop)||document?.body.scrollTop||0}}})),pe.forEach(j=>j.unlock())};try{const E=[];E.push(te("DOMContentLoaded",()=>{B(H({type:w.DomContentLoaded,data:{}}))}));const C=ee=>{var ae;return Xr({mutationCb:z,mousemoveCb:(P,j)=>B(H({type:w.IncrementalSnapshot,data:{source:j,positions:P}})),mouseInteractionCb:P=>B(H({type:w.IncrementalSnapshot,data:re({source:x.MouseInteraction},P)})),scrollCb:Y,viewportResizeCb:P=>B(H({type:w.IncrementalSnapshot,data:re({source:x.ViewportResize},P)})),inputCb:P=>B(H({type:w.IncrementalSnapshot,data:re({source:x.Input},P)})),mediaInteractionCb:P=>B(H({type:w.IncrementalSnapshot,data:re({source:x.MediaInteraction},P)})),styleSheetRuleCb:P=>B(H({type:w.IncrementalSnapshot,data:re({source:x.StyleSheetRule},P)})),styleDeclarationCb:P=>B(H({type:w.IncrementalSnapshot,data:re({source:x.StyleDeclaration},P)})),canvasMutationCb:L,fontCb:P=>B(H({type:w.IncrementalSnapshot,data:re({source:x.Font},P)})),blockClass:o,ignoreClass:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:X,inlineStylesheet:i,sampling:p,recordCanvas:y,inlineImages:A,userTriggeredOnInput:T,collectFonts:D,doc:ee,maskInputFn:h,maskTextFn:f,blockSelector:s,slimDOMOptions:Z,mirror:ue,iframeManager:U,stylesheetManager:b,shadowDomManager:I,canvasManager:v,enableStrictPrivacy:W,plugins:((ae=M?.filter(P=>P.observer))==null?void 0:ae.map(P=>({observer:P.observer,options:P.options,callback:j=>B(H({type:w.Plugin,data:{plugin:P.name,payload:j}}))})))||[]},g)};U.addLoadListener(ee=>{E.push(C(ee.contentDocument))});const Q=()=>{_e(),E.push(C(document))};return document.readyState==="interactive"||document.readyState==="complete"?Q():E.push(te("load",()=>{B(H({type:w.Load,data:{}})),Q()},window)),()=>{E.forEach(ee=>ee())}}catch(E){console.warn(E)}}fe.addCustomEvent=(e,t)=>{!B||B(H({type:w.Custom,data:{tag:e,payload:t}}))},fe.freezePage=()=>{pe.forEach(e=>e.freeze())},fe.takeFullSnapshot=e=>{if(!_e)throw new Error("please take full snapshot after start recording");_e(e)},fe.mirror=ue;var k;(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"})(k||(k={}));var wo=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var n=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(function(o){return n.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,n){var r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function Co(){return new wo}function Io(e){const t={},n=/;(?![^(]*\))/g,r=/:(.+)/,o=/\/\*.*?\*\//g;return e.replace(o,"").split(n).forEach(function(s){if(s){const a=s.split(r);a.length>1&&(t[ut(a[0].trim())]=a[1].trim())}}),t}function fn(e){const t=[];for(const n in e){const r=e[n];if(typeof r!="string")continue;const o=Do(n);t.push(`${o}: ${r};`)}return t.join(" ")}const xo=/-([a-z])/g,Mo=/^--[a-zA-Z0-9-]+$/,ut=e=>Mo.test(e)?e:e.replace(xo,(t,n)=>n?n.toUpperCase():""),ko=/\B([A-Z])/g,Do=e=>e.replace(ko,"-$1").toLowerCase();class oe{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=$.ELEMENT_NODE,this.TEXT_NODE=$.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){const t=this.parentNode;if(!t)return null;const n=t.childNodes,r=n.indexOf(this);return n[r+1]||null}contains(t){if(t===this)return!0;for(const n of this.childNodes)if(n.contains(t))return!0;return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,n){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function Ro(e){return class Xn extends e{constructor(){super(...arguments),this.nodeType=$.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=k.Document,this.textContent=null}get documentElement(){return this.childNodes.find(n=>n.RRNodeType===k.Element&&n.tagName==="HTML")||null}get body(){var n;return((n=this.documentElement)===null||n===void 0?void 0:n.childNodes.find(r=>r.RRNodeType===k.Element&&r.tagName==="BODY"))||null}get head(){var n;return((n=this.documentElement)===null||n===void 0?void 0:n.childNodes.find(r=>r.RRNodeType===k.Element&&r.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(n){const r=n.RRNodeType;if((r===k.Element||r===k.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${r===k.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return n.parentElement=null,n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,r){const o=n.RRNodeType;if((o===k.Element||o===k.DocumentType)&&this.childNodes.some(a=>a.RRNodeType===o))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${o===k.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(r===null)return this.appendChild(n);const s=this.childNodes.indexOf(r);if(s==-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(s,0,n),n.parentElement=null,n.parentNode=this,n}removeChild(n){const r=this.childNodes.indexOf(n);if(r===-1)throw new Error("Failed to execute 'removeChild' on 'RRDocument': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(r,1),n.parentElement=null,n.parentNode=null,n}open(){this.childNodes=[]}close(){}write(n){let r;if(n==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?r="-//W3C//DTD XHTML 1.0 Transitional//EN":n==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(r="-//W3C//DTD HTML 4.0 Transitional//EN"),r){const o=this.createDocumentType("html",r,"");this.open(),this.appendChild(o)}}createDocument(n,r,o){return new Xn}createDocumentType(n,r,o){const s=new(gn(oe))(n,r,o);return s.ownerDocument=this,s}createElement(n){const r=new(vn(oe))(n);return r.ownerDocument=this,r}createElementNS(n,r){return this.createElement(r)}createTextNode(n){const r=new(yn(oe))(n);return r.ownerDocument=this,r}createComment(n){const r=new(bn(oe))(n);return r.ownerDocument=this,r}createCDATASection(n){const r=new(Sn(oe))(n);return r.ownerDocument=this,r}toString(){return"RRDocument"}}}function gn(e){return class extends e{constructor(t,n,r){super(),this.nodeType=$.DOCUMENT_TYPE_NODE,this.RRNodeType=k.DocumentType,this.textContent=null,this.name=t,this.publicId=n,this.systemId=r,this.nodeName=t}toString(){return"RRDocumentType"}}}function vn(e){return class extends e{constructor(t){super(),this.nodeType=$.ELEMENT_NODE,this.RRNodeType=k.Element,this.attributes={},this.shadowRoot=null,this.tagName=t.toUpperCase(),this.nodeName=t.toUpperCase()}get textContent(){let t="";return this.childNodes.forEach(n=>t+=n.textContent),t}set textContent(t){this.childNodes=[this.ownerDocument.createTextNode(t)]}get classList(){return new Ao(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?Io(this.attributes.style):{},n=/\B([A-Z])/g;return t.setProperty=(r,o,s)=>{if(n.test(r))return;const a=ut(r);o?t[a]=o:delete t[a],s==="important"&&(t[a]+=" !important"),this.attributes.style=fn(t)},t.removeProperty=r=>{if(n.test(r))return"";const o=ut(r),s=t[o]||"";return delete t[o],this.attributes.style=fn(t),s},t}getAttribute(t){return this.attributes[t]||null}setAttribute(t,n){this.attributes[t]=n}setAttributeNS(t,n,r){this.setAttribute(n,r)}removeAttribute(t){delete this.attributes[t]}appendChild(t){return this.childNodes.push(t),t.parentNode=this,t.parentElement=this,t}insertBefore(t,n){if(n===null)return this.appendChild(t);const r=this.childNodes.indexOf(n);if(r==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(r,0,t),t.parentElement=this,t.parentNode=this,t}removeChild(t){const n=this.childNodes.indexOf(t);if(n===-1)throw new Error("Failed to execute 'removeChild' on 'RRElement': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(n,1),t.parentElement=null,t.parentNode=null,t}attachShadow(t){const n=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=n,n}dispatchEvent(t){return!0}toString(){let t="";for(const n in this.attributes)t+=`${n}="${this.attributes[n]}" `;return`${this.tagName} ${t}`}}}function Oo(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 yn(e){return class extends e{constructor(t){super(),this.nodeType=$.TEXT_NODE,this.nodeName="#text",this.RRNodeType=k.Text,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function bn(e){return class extends e{constructor(t){super(),this.nodeType=$.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=k.Comment,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function Sn(e){return class extends e{constructor(t){super(),this.nodeName="#cdata-section",this.nodeType=$.CDATA_SECTION_NODE,this.RRNodeType=k.CDATA,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class Ao{constructor(t,n){if(this.classes=[],this.add=(...r)=>{for(const o of r){const s=String(o);this.classes.indexOf(s)>=0||this.classes.push(s)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...r)=>{this.classes=this.classes.filter(o=>r.indexOf(o)===-1),this.onChange&&this.onChange(this.classes.join(" "))},t){const r=t.trim().split(/\s+/);this.classes.push(...r)}this.onChange=n}}var $;(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"})($||($={}));const dt={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"};function se(e,t,n,r){const o=e.childNodes,s=t.childNodes;r=r||t.mirror||t.ownerDocument.mirror,(o.length>0||s.length>0)&&Tn(Array.from(o),s,e,n,r);let a=null,l=null;switch(t.RRNodeType){case k.Document:{l=t.scrollData;break}case k.Element:{const c=e,i=t;switch(Lo(c,i,r),l=i.scrollData,a=i.inputData,i.tagName){case"AUDIO":case"VIDEO":{const u=e,d=i;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":t.canvasMutations.forEach(u=>n.applyCanvas(u.event,u.mutation,e));break;case"STYLE":Po(c,t.rules);break}if(i.shadowRoot){c.shadowRoot||c.attachShadow({mode:"open"});const u=c.shadowRoot.childNodes,d=i.shadowRoot.childNodes;(u.length>0||d.length>0)&&Tn(Array.from(u),d,c.shadowRoot,n,r)}break}case k.Text:case k.Comment:case k.CDATA:e.textContent!==t.data&&(e.textContent=t.data);break}if(l&&n.applyScroll(l,!0),a&&n.applyInput(a),t.nodeName==="IFRAME"){const c=e.contentDocument,i=t;if(c){const u=r.getMeta(i.contentDocument);u&&n.mirror.add(c,Object.assign({},u)),se(c,i.contentDocument,n,r)}}}function Lo(e,t,n){const r=e.attributes,o=t.attributes;for(const s in o){const a=o[s],l=n.getMeta(t);if(l&&"isSVG"in l&&l.isSVG&&dt[s])e.setAttributeNS(dt[s],s,a);else if(t.tagName==="CANVAS"&&s==="rr_dataURL"){const c=document.createElement("img");c.src=a,c.onload=()=>{const i=e.getContext("2d");i&&i.drawImage(c,0,0,c.width,c.height)}}else e.setAttribute(s,a)}for(const{name:s}of Array.from(r))s in o||e.removeAttribute(s);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function Tn(e,t,n,r,o){var s,a;let l=0,c=e.length-1,i=0,u=t.length-1,d=e[l],m=e[c],h=t[i],f=t[u],g,N;for(;l<=c&&i<=u;)if(d===void 0)d=e[++l];else if(m===void 0)m=e[--c];else if(r.mirror.getId(d)===o.getId(h))se(d,h,r,o),d=e[++l],h=t[++i];else if(r.mirror.getId(m)===o.getId(f))se(m,f,r,o),m=e[--c],f=t[--u];else if(r.mirror.getId(d)===o.getId(f))n.insertBefore(d,m.nextSibling),se(d,f,r,o),d=e[++l],f=t[--u];else if(r.mirror.getId(m)===o.getId(h))n.insertBefore(m,d),se(m,h,r,o),m=e[--c],h=t[++i];else{if(!g){g={};for(let p=l;p<=c;p++){const S=e[p];S&&r.mirror.hasNode(S)&&(g[r.mirror.getId(S)]=p)}}if(N=g[o.getId(h)],N){const p=e[N];n.insertBefore(p,d),se(p,h,r,o),e[N]=void 0}else{const p=ht(h,r.mirror,o);((s=r.mirror.getMeta(n))===null||s===void 0?void 0:s.type)===k.Document&&((a=r.mirror.getMeta(p))===null||a===void 0?void 0:a.type)===k.Element&&n.documentElement&&(n.removeChild(n.documentElement),e[l]=void 0,d=void 0),n.insertBefore(p,d||null),se(p,h,r,o)}h=t[++i]}if(l>c){const p=t[u+1];let S=null;for(p&&n.childNodes.forEach(y=>{r.mirror.getId(y)===o.getId(p)&&(S=y)});i<=u;++i){const y=ht(t[i],r.mirror,o);n.insertBefore(y,S),se(y,t[i],r,o)}}else if(i>u)for(;l<=c;l++){const p=e[l];p&&(n.removeChild(p),r.mirror.removeNodeFromMap(p))}}function ht(e,t,n){let r=t.getNode(n.getId(e));const o=n.getMeta(e);if(r!==null)return r;switch(e.RRNodeType){case k.Document:r=new Document;break;case k.DocumentType:r=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case k.Element:{e.tagName.toLowerCase(),o&&"isSVG"in o&&o?.isSVG?r=document.createElementNS(dt.svg,e.tagName.toLowerCase()):r=document.createElement(e.tagName);break}case k.Text:r=document.createTextNode(e.data);break;case k.Comment:r=document.createComment(e.data);break;case k.CDATA:r=document.createCDATASection(e.data);break}return o&&t.add(r,Object.assign({},o)),r}function Fe(e,t){const n=e[t[0]];return t.length===1?n:Fe(n.cssRules[t[1]].cssRules,t.slice(2))}var ie;(function(e){e[e.Insert=0]="Insert",e[e.Remove=1]="Remove",e[e.Snapshot=2]="Snapshot",e[e.SetProperty=3]="SetProperty",e[e.RemoveProperty=4]="RemoveProperty"})(ie||(ie={}));function Nn(e){const t=[...e],n=t.pop();return{positions:t,index:n}}function Po(e,t){const n=e.sheet;t.forEach(r=>{if(r.type===ie.Insert)try{if(Array.isArray(r.index)){const{positions:o,index:s}=Nn(r.index);Fe(n.cssRules,o).insertRule(r.cssText,s)}else n.insertRule(r.cssText,r.index)}catch{}else if(r.type===ie.Remove)try{if(Array.isArray(r.index)){const{positions:o,index:s}=Nn(r.index);Fe(n.cssRules,o).deleteRule(s||0)}else n.deleteRule(r.index)}catch{}else r.type===ie.SetProperty?Fe(n.cssRules,r.index).style.setProperty(r.property,r.value,r.priority):r.type===ie.RemoveProperty&&Fe(n.cssRules,r.index).style.removeProperty(r.property)})}class Ce extends Ro(oe){constructor(t){super(),this._unserializedId=-1,this.mirror=Yo(),this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,n,r){return new Ce}createDocumentType(t,n,r){const o=new _o(t,n,r);return o.ownerDocument=this,o}createElement(t){const n=t.toUpperCase();let r;switch(n){case"AUDIO":case"VIDEO":r=new Fo(n);break;case"IFRAME":r=new Vo(n,this.mirror);break;case"CANVAS":r=new Wo(n);break;case"STYLE":r=new $o(n);break;default:r=new We(n);break}return r.ownerDocument=this,r}createComment(t){const n=new jo(t);return n.ownerDocument=this,n}createCDATASection(t){const n=new Bo(t);return n.ownerDocument=this,n}createTextNode(t){const n=new Uo(t);return n.ownerDocument=this,n}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=-1}}const _o=gn(oe);class We extends vn(oe){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class Fo extends Oo(We){}class Wo extends We{constructor(){super(...arguments),this.canvasMutations=[]}getContext(){return null}}class $o extends We{constructor(){super(...arguments),this.rules=[]}}class Vo extends We{constructor(t,n){super(t),this.contentDocument=new Ce,this.contentDocument.mirror=n}}const Uo=yn(oe),jo=bn(oe),Bo=Sn(oe);function Go(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function En(e,t,n,r){let o;switch(e.nodeType){case $.DOCUMENT_NODE:r&&r.nodeName==="IFRAME"?o=r.contentDocument:(o=t,o.compatMode=e.compatMode);break;case $.DOCUMENT_TYPE_NODE:const a=e;o=t.createDocumentType(a.name,a.publicId,a.systemId);break;case $.ELEMENT_NODE:const l=e,c=Go(l);o=t.createElement(c);const i=o;for(const{name:u,value:d}of Array.from(l.attributes))i.attributes[u]=d;l.scrollLeft&&(i.scrollLeft=l.scrollLeft),l.scrollTop&&(i.scrollTop=l.scrollTop);break;case $.TEXT_NODE:o=t.createTextNode(e.textContent||"");break;case $.CDATA_SECTION_NODE:o=t.createCDATASection(e.data);break;case $.COMMENT_NODE:o=t.createComment(e.textContent||"");break;case $.DOCUMENT_FRAGMENT_NODE:o=r.attachShadow({mode:"open"});break;default:return null}let s=n.getMeta(e);return t instanceof Ce&&(s||(s=wn(o,t.unserializedId),n.add(e,s)),t.mirror.add(o,Object.assign({},s))),o}function zo(e,t=Co(),n=new Ce){function r(o,s){const a=En(o,n,t,s);a!==null&&(s?.nodeName!=="IFRAME"&&o.nodeType!==$.DOCUMENT_FRAGMENT_NODE&&(s?.appendChild(a),a.parentNode=s,a.parentElement=s),o.nodeName==="IFRAME"?r(o.contentDocument,a):(o.nodeType===$.DOCUMENT_NODE||o.nodeType===$.ELEMENT_NODE||o.nodeType===$.DOCUMENT_FRAGMENT_NODE)&&(o.nodeType===$.ELEMENT_NODE&&o.shadowRoot&&r(o.shadowRoot,a),o.childNodes.forEach(l=>r(l,a))))}return r(e,null),n}function Yo(){return new Ho}class Ho{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var n;if(!t)return-1;const r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){const r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function wn(e,t){switch(e.RRNodeType){case k.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case k.DocumentType:const n=e;return{id:t,type:e.RRNodeType,name:n.name,publicId:n.publicId,systemId:n.systemId};case k.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case k.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case k.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case k.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}function Cn(e){return e=e||Object.create(null),{on:function(n,r){(e[n]||(e[n]=[])).push(r)},off:function(n,r){e[n]&&e[n].splice(e[n].indexOf(r)>>>0,1)},emit:function(n,r){(e[n]||[]).slice().map(function(o){o(r)}),(e["*"]||[]).slice().map(function(o){o(n,r)})}}}var Xo=Object.freeze({__proto__:null,default:Cn});function Zo(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const n=e.HTMLElement||e.Element,r=468,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||c,scrollIntoView:n.prototype.scrollIntoView},s=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function a(p){const S=["MSIE ","Trident/","Edge/"];return new RegExp(S.join("|")).test(p)}const l=a(e.navigator.userAgent)?1:0;function c(p,S){this.scrollLeft=p,this.scrollTop=S}function i(p){return .5*(1-Math.cos(Math.PI*p))}function u(p){if(p===null||typeof p!="object"||p.behavior===void 0||p.behavior==="auto"||p.behavior==="instant")return!0;if(typeof p=="object"&&p.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+p.behavior+" is not a valid value for enumeration ScrollBehavior.")}function d(p,S){if(S==="Y")return p.clientHeight+l<p.scrollHeight;if(S==="X")return p.clientWidth+l<p.scrollWidth}function m(p,S){const y=e.getComputedStyle(p,null)["overflow"+S];return y==="auto"||y==="scroll"}function h(p){const S=d(p,"Y")&&m(p,"Y"),y=d(p,"X")&&m(p,"X");return S||y}function f(p){for(;p!==t.body&&h(p)===!1;)p=p.parentNode||p.host;return p}function g(p){const S=s();let y,T,D,A=(S-p.startTime)/r;A=A>1?1:A,y=i(A),T=p.startX+(p.x-p.startX)*y,D=p.startY+(p.y-p.startY)*y,p.method.call(p.scrollable,T,D),(T!==p.x||D!==p.y)&&e.requestAnimationFrame(g.bind(e,p))}function N(p,S,y){let T,D,A,M;const F=s();p===t.body?(T=e,D=e.scrollX||e.pageXOffset,A=e.scrollY||e.pageYOffset,M=o.scroll):(T=p,D=p.scrollLeft,A=p.scrollTop,M=c),g({scrollable:T,method:M,startTime:F,startX:D,startY:A,x:S,y})}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}N.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}N.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},n.prototype.scroll=n.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const p=arguments[0].left,S=arguments[0].top;N.call(this,this,typeof p>"u"?this.scrollLeft:~~p,typeof S>"u"?this.scrollTop:~~S)},n.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},n.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){o.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const p=f(this),S=p.getBoundingClientRect(),y=this.getBoundingClientRect();p!==t.body?(N.call(this,p,p.scrollLeft+y.left-S.left,p.scrollTop+y.top-S.top),e.getComputedStyle(p).position!=="fixed"&&e.scrollBy({left:S.left,top:S.top,behavior:"smooth"})):e.scrollBy({left:y.left,top:y.top,behavior:"smooth"})}}class Ko{constructor(t=[],n){this.timeOffset=0,this.raf=null,this.actions=t,this.speed=n}addAction(t){const n=this.findActionIndex(t);this.actions.splice(n,0,t)}addActions(t){this.actions=this.actions.concat(t)}replaceActions(t){this.actions.length=0,this.actions.splice(0,0,...t)}start(){this.timeOffset=0;let t=performance.now();const{actions:n}=this,r=this;function o(){const s=performance.now();for(r.timeOffset+=(s-t)*r.speed,t=s;n.length;){const a=n[0];if(r.timeOffset>=a.delay)n.shift(),a.doAction();else break}(n.length>0||r.liveMode)&&(r.raf=requestAnimationFrame(o))}this.raf=requestAnimationFrame(o)}clear(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(t){this.speed=t}toggleLiveMode(t){this.liveMode=t}isActive(){return this.raf!==null}findActionIndex(t){let n=0,r=this.actions.length-1;for(;n<=r;){const o=Math.floor((n+r)/2);if(this.actions[o].delay<t.delay)n=o+1;else if(this.actions[o].delay>t.delay)r=o-1;else return o+1}return n}}function mt(e,t){if(e.type===w.IncrementalSnapshot&&e.data.source===x.MouseMove){const n=e.data.positions[0].timeOffset,r=e.timestamp+n;return e.delay=r-t,r-t}return e.delay=e.timestamp-t,e.delay}/*! *****************************************************************************
6
- Copyright (c) Microsoft Corporation.
3
+ or you can use record.mirror to access the mirror instance during recording.`;L.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&&(L.mirror=new Proxy(L.mirror,{get(t,e,n){return e==="map"&&console.error(oe),Reflect.get(t,e,n)}}));function se(t,e,n={}){let o=null,s=0;return function(r){const l=Date.now();!s&&n.leading===!1&&(s=l);const a=e-(l-s),c=this,i=arguments;a<=0||a>e?(o&&(clearTimeout(o),o=null),s=l,t.apply(c,i)):!o&&n.trailing!==!1&&(o=setTimeout(()=>{s=n.leading===!1?0:Date.now(),o=null,t.apply(c,i)},a))}}function pe(t,e,n,o,s=window){const r=s.Object.getOwnPropertyDescriptor(t,e);return s.Object.defineProperty(t,e,o?n:{set(l){setTimeout(()=>{n.set.call(this,l)},0),r&&r.set&&r.set.call(this,l)}}),()=>pe(t,e,r||{},!0)}function K(t,e,n){try{if(!(e in t))return()=>{};const o=t[e],s=n(o);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:o}})),t[e]=s,()=>{t[e]=o}}catch{return()=>{}}}function Le(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Pe(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}const ot=t=>{try{if(t instanceof HTMLElement)return t.tagName==="CANVAS"}catch{return!1}return!1};function F(t,e,n){if(!t)return!1;const o=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(!o)return!1;if(typeof e=="string"){if(o.classList.contains(e)||n&&o.closest("."+e)!==null)return!0}else if(v.classMatchesRegex(o,e,n))return!0;return!1}function st(t,e){return e.getId(t)!==-1}function Re(t,e){return e.getId(t)===v.IGNORED_NODE}function _e(t,e){if(v.isShadowRoot(t))return!1;const n=e.getId(t);return e.has(n)?t.parentNode&&t.parentNode.nodeType===t.DOCUMENT_NODE?!1:t.parentNode?_e(t.parentNode,e):!0:!0}function Fe(t){return Boolean(t.changedTouches)}function We(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do if(this===e)return!0;while(e=e&&e.parentNode);return!1})}function it(t){const e={},n=(s,r)=>{const l={value:s,parent:r,children:[]};return e[s.node.id]=l,l},o=[];for(const s of t){const{nextId:r,parentId:l}=s;if(r&&r in e){const a=e[r];if(a.parent){const c=a.parent.children.indexOf(a);a.parent.children.splice(c,0,n(s,a.parent))}else{const c=o.indexOf(a);o.splice(c,0,n(s,null))}continue}if(l in e){const a=e[l];a.children.push(n(s,a));continue}o.push(n(s,null))}return o}function Ve(t,e){e(t.value);for(let n=t.children.length-1;n>=0;n--)Ve(t.children[n],e)}function ie(t,e){return Boolean(t.nodeName==="IFRAME"&&e.getMeta(t))}function $e(t,e){return Boolean(t.nodeName==="LINK"&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&t.getAttribute("rel")==="stylesheet"&&e.getMeta(t))}function je(t,e){var n,o;const s=(o=(n=t.ownerDocument)==null?void 0:n.defaultView)==null?void 0:o.frameElement;if(!s||s===e)return{x:0,y:0,relativeScale:1,absoluteScale:1};const r=s.getBoundingClientRect(),l=je(s,e),a=r.height/s.clientHeight;return{x:r.x*l.relativeScale+l.x,y:r.y*l.relativeScale+l.y,relativeScale:a,absoluteScale:l.absoluteScale*a}}function fe(t){return Boolean(t?.shadowRoot)}function re(t,e){const n=t[e[0]];return e.length===1?n:re(n.cssRules[e[1]].cssRules,e.slice(2))}function Ge(t){const e=[...t],n=e.pop();return{positions:e,index:n}}function rt(t){const e=new Set,n=[];for(let o=t.length;o--;){const s=t[o];e.has(s.id)||(n.push(s),e.add(s.id))}return n}var yn=Object.freeze({__proto__:null,on:_,get _mirror(){return L.mirror},throttle:se,hookSetter:pe,patch:K,getWindowHeight:Le,getWindowWidth:Pe,isCanvasNode:ot,isBlocked:F,isSerialized:st,isIgnored:Re,isAncestorRemoved:_e,isTouchEvent:Fe,polyfill:We,queueToResolveTrees:it,iterateResolveTree:Ve,isSerializedIframe:ie,isSerializedStylesheet:$e,getBaseDimension:je,hasShadowRoot:fe,getNestedRule:re,getPositionsAndIndex:Ge,uniqueTextMutations:rt}),N=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(N||{}),E=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t))(E||{}),O=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(O||{}),Y=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(Y||{}),Q=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t))(Q||{}),C=(t=>(t.Start="start",t.Pause="pause",t.Resume="resume",t.Resize="resize",t.Finish="finish",t.FullsnapshotRebuilded="fullsnapshot-rebuilded",t.LoadStylesheetStart="load-stylesheet-start",t.LoadStylesheetEnd="load-stylesheet-end",t.SkipStart="skip-start",t.SkipEnd="skip-end",t.MouseInteraction="mouse-interaction",t.EventCast="event-cast",t.CustomEvent="custom-event",t.Flush="flush",t.StateChange="state-change",t.PlayBack="play-back",t))(C||{});function at(t){return"__ln"in t}class gn{constructor(){this.length=0,this.head=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let o=0;o<e;o++)n=n?.next||null;return n}addNode(e){const n={value:e,previous:null,next:null};if(e.__ln=n,e.previousSibling&&at(e.previousSibling)){const o=e.previousSibling.__ln.next;n.next=o,n.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=n,o&&(o.previous=n)}else if(e.nextSibling&&at(e.nextSibling)&&e.nextSibling.__ln.previous){const o=e.nextSibling.__ln.previous;n.previous=o,n.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=n,o&&(o.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;this.length++}removeNode(e){const n=e.__ln;!this.head||(n.previous?(n.previous.next=n.next,n.next&&(n.next.previous=n.previous)):(this.head=n.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)}}const lt=(t,e)=>`${t}@${e}`;class vn{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=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],n=new gn,o=a=>{let c=a,i=v.IGNORED_NODE;for(;i===v.IGNORED_NODE;)c=c&&c.nextSibling,i=c&&this.mirror.getId(c);return i},s=a=>{var c,i,u,d,h;const m=a.getRootNode?(c=a.getRootNode())==null?void 0:c.host:null;let f=m;for(;(u=(i=f?.getRootNode)==null?void 0:i.call(f))!=null&&u.host;)f=((h=(d=f?.getRootNode)==null?void 0:d.call(f))==null?void 0:h.host)||null;const y=!this.doc.contains(a)&&(!f||!this.doc.contains(f));if(!a.parentNode||y)return;const g=v.isShadowRoot(a.parentNode)?this.mirror.getId(m):this.mirror.getId(a.parentNode),p=o(a);if(g===-1||p===-1)return n.addNode(a);const b=v.serializeNodeWithId(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,enableStrictPrivacy:this.enableStrictPrivacy,onSerialize:T=>{ie(T,this.mirror)&&this.iframeManager.addIframe(T),$e(T,this.mirror)&&this.stylesheetManager.addStylesheet(T),fe(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,document)},onIframeLoad:(T,I)=>{this.iframeManager.attachIframe(T,I,this.mirror),this.shadowDomManager.observeAttachShadow(T)},onStylesheetLoad:(T,I)=>{this.stylesheetManager.attachStylesheet(T,I,this.mirror)},newlyAddedElement:!0});b&&e.push({parentId:g,nextId:p,node:b})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of Array.from(this.movedSet.values()))ct(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||s(a);for(const a of Array.from(this.addedSet.values()))!dt(this.droppedSet,a)&&!ct(this.removes,a,this.mirror)||dt(this.movedSet,a)?s(a):this.droppedSet.add(a);let r=null;for(;n.length;){let a=null;if(r){const c=this.mirror.getId(r.value.parentNode),i=o(r.value);c!==-1&&i!==-1&&(a=r)}if(!a)for(let c=n.length-1;c>=0;c--){const i=n.get(c);if(i){const u=this.mirror.getId(i.value.parentNode),d=o(i.value);if(u!==-1&&d!==-1){a=i;break}}}if(!a){for(;n.head;)n.removeNode(n.head.value);break}r=a.previous,n.removeNode(a.value),s(a.value)}const l={texts:this.texts.map(a=>{let c=a.value;return this.enableStrictPrivacy&&c&&(c=v.obfuscateText(c)),{id:this.mirror.getId(a.node),value:c}}).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>({id:this.mirror.getId(a.node),attributes:a.attributes})).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:e};!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=e=>{if(!Re(e.target,this.mirror))switch(e.type){case"characterData":{const n=e.target.textContent;!F(e.target,this.blockClass,!1)&&n!==e.oldValue&&this.texts.push({value:v.needMaskingText(e.target,this.maskTextClass,this.maskTextSelector)&&n?this.maskTextFn?this.maskTextFn(n):n.replace(/[\S]/g,"*"):n,node:e.target});break}case"attributes":{const n=e.target;let o=e.target.getAttribute(e.attributeName);if(e.attributeName==="value"&&(o=v.maskInputValue({maskInputOptions:this.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:o,maskInputFn:this.maskInputFn})),F(e.target,this.blockClass,!1)||o===e.oldValue)return;let s=this.attributes.find(r=>r.node===e.target);if(s||(s={node:e.target,attributes:{}},this.attributes.push(s)),e.attributeName==="style"){const r=this.doc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue),(s.attributes.style===void 0||s.attributes.style===null)&&(s.attributes.style={});const l=s.attributes.style;for(const a of Array.from(n.style)){const c=n.style.getPropertyValue(a),i=n.style.getPropertyPriority(a);(c!==r.style.getPropertyValue(a)||i!==r.style.getPropertyPriority(a))&&(i===""?l[a]=c:l[a]=[c,i])}for(const a of Array.from(r.style))n.style.getPropertyValue(a)===""&&(l[a]=!1)}else{if(e.target.tagName==="INPUT"){const r=e.target;if(r.type==="password"){s.attributes.value="*".repeat(r.value.length);break}}s.attributes[e.attributeName]=v.transformAttribute(this.doc,e.target.tagName,e.attributeName,o)}break}case"childList":{if(F(e.target,this.blockClass,!0))return;e.addedNodes.forEach(n=>this.genAdds(n,e.target)),e.removedNodes.forEach(n=>{const o=this.mirror.getId(n),s=v.isShadowRoot(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);F(e.target,this.blockClass,!1)||Re(n,this.mirror)||!st(n,this.mirror)||(this.addedSet.has(n)?(Be(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(e.target)&&o===-1||_e(e.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[lt(o,s)]?Be(this.movedSet,n):this.removes.push({parentId:s,id:o,isShadow:v.isShadowRoot(e.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(e,n)=>{if(this.mirror.hasNode(e)){if(Re(e,this.mirror))return;this.movedSet.add(e);let o=null;n&&this.mirror.hasNode(n)&&(o=this.mirror.getId(n)),o&&o!==-1&&(this.movedMap[lt(this.mirror.getId(e),o)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);F(e,this.blockClass,!1)||e.childNodes.forEach(o=>this.genAdds(o))}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","enableStrictPrivacy"].forEach(n=>{this[n]=e[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Be(t,e){t.delete(e),e.childNodes.forEach(n=>Be(t,n))}function ct(t,e,n){return t.length===0?!1:ut(t,e,n)}function ut(t,e,n){const{parentNode:o}=e;if(!o)return!1;const s=n.getId(o);return t.some(r=>r.id===s)?!0:ut(t,o,n)}function dt(t,e){return t.size===0?!1:ht(t,e)}function ht(t,e){const{parentNode:n}=e;return n?t.has(n)?!0:ht(t,n):!1}var bn=Object.defineProperty,Nn=Object.defineProperties,Tn=Object.getOwnPropertyDescriptors,mt=Object.getOwnPropertySymbols,En=Object.prototype.hasOwnProperty,Sn=Object.prototype.propertyIsEnumerable,pt=(t,e,n)=>e in t?bn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ft=(t,e)=>{for(var n in e||(e={}))En.call(e,n)&&pt(t,n,e[n]);if(mt)for(var n of mt(e))Sn.call(e,n)&&pt(t,n,e[n]);return t},Cn=(t,e)=>Nn(t,Tn(e));const J=[],yt=typeof CSSGroupingRule<"u",gt=typeof CSSMediaRule<"u",vt=typeof CSSSupportsRule<"u",bt=typeof CSSConditionRule<"u";function ye(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0];return t.target}catch{return t.target}}function Nt(t,e){var n,o;const s=new vn;J.push(s),s.init(t);let r=window.MutationObserver||window.__rrMutationObserver;const l=(o=(n=window?.Zone)==null?void 0:n.__symbol__)==null?void 0:o.call(n,"MutationObserver");l&&window[l]&&(r=window[l]);const a=new r(s.processMutations.bind(s));return a.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function wn({mousemoveCb:t,sampling:e,doc:n,mirror:o}){if(e.mousemove===!1)return()=>{};const s=typeof e.mousemove=="number"?e.mousemove:50,r=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let l=[],a;const c=se(d=>{const h=Date.now()-a;t(l.map(m=>(m.timeOffset-=h,m)),d),l=[],a=null},r),i=se(d=>{const h=ye(d),{clientX:m,clientY:f}=Fe(d)?d.changedTouches[0]:d;a||(a=Date.now()),l.push({x:m,y:f,id:o.getId(h),timeOffset:Date.now()-a}),c(typeof DragEvent<"u"&&d instanceof DragEvent?E.Drag:d instanceof MouseEvent?E.MouseMove:E.TouchMove)},s,{trailing:!1}),u=[_("mousemove",i,n),_("touchmove",i,n),_("drag",i,n)];return()=>{u.forEach(d=>d())}}function In({mouseInteractionCb:t,doc:e,mirror:n,blockClass:o,sampling:s}){if(s.mouseInteraction===!1)return()=>{};const r=s.mouseInteraction===!0||s.mouseInteraction===void 0?{}:s.mouseInteraction,l=[],a=c=>i=>{const u=ye(i);if(F(u,o,!0)||ot(u))return;const d=Fe(i)?i.changedTouches[0]:i;if(!d)return;const h=n.getId(u),{clientX:m,clientY:f}=d;t({type:O[c],id:h,x:m,y:f})};return Object.keys(O).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&r[c]!==!1).forEach(c=>{const i=c.toLowerCase(),u=a(c);l.push(_(i,u,e))}),()=>{l.forEach(c=>c())}}function Tt({scrollCb:t,doc:e,mirror:n,blockClass:o,sampling:s}){const r=se(l=>{const a=ye(l);if(!a||F(a,o,!0))return;const c=n.getId(a);if(a===e){const i=e.scrollingElement||e.documentElement;t({id:c,x:i.scrollLeft,y:i.scrollTop})}else t({id:c,x:a.scrollLeft,y:a.scrollTop})},s.scroll||100);return _("scroll",r,e)}function Rn({viewportResizeCb:t}){let e=-1,n=-1;const o=se(()=>{const s=Le(),r=Pe();(e!==s||n!==r)&&(t({width:Number(r),height:Number(s)}),e=s,n=r)},200);return _("resize",o,window)}function Et(t,e){const n=ft({},t);return e||delete n.userTriggered,n}const Dn=["INPUT","TEXTAREA","SELECT"],St=new WeakMap;function Mn({inputCb:t,doc:e,mirror:n,blockClass:o,ignoreClass:s,maskInputOptions:r,maskInputFn:l,sampling:a,userTriggeredOnInput:c}){function i(f){let y=ye(f);const g=f.isTrusted;if(y&&y.tagName==="OPTION"&&(y=y.parentElement),!y||!y.tagName||Dn.indexOf(y.tagName)<0||F(y,o,!0))return;const p=y.type;if(y.classList.contains(s))return;let b=y.value,T=!1;p==="radio"||p==="checkbox"?T=y.checked:(r[y.tagName.toLowerCase()]||r[p])&&(b=v.maskInputValue({maskInputOptions:r,tagName:y.tagName,type:p,value:b,maskInputFn:l})),u(y,Et({text:b,isChecked:T,userTriggered:g},c));const I=y.name;p==="radio"&&I&&T&&e.querySelectorAll(`input[type="radio"][name="${I}"]`).forEach(A=>{A!==y&&u(A,Et({text:A.value,isChecked:!T,userTriggered:!1},c))})}function u(f,y){const g=St.get(f);if(!g||g.text!==y.text||g.isChecked!==y.isChecked){St.set(f,y);const p=n.getId(f);t(Cn(ft({},y),{id:p}))}}const d=(a.input==="last"?["change"]:["input","change"]).map(f=>_(f,i,e)),h=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),m=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return h&&h.set&&d.push(...m.map(f=>pe(f[0],f[1],{set(){i({target:this})}}))),()=>{d.forEach(f=>f())}}function De(t){const e=[];function n(o,s){if(yt&&o.parentRule instanceof CSSGroupingRule||gt&&o.parentRule instanceof CSSMediaRule||vt&&o.parentRule instanceof CSSSupportsRule||bt&&o.parentRule instanceof CSSConditionRule){const r=Array.from(o.parentRule.cssRules).indexOf(o);s.unshift(r)}else{const r=Array.from(o.parentStyleSheet.cssRules).indexOf(o);s.unshift(r)}return s}return n(t,e)}function xn({styleSheetRuleCb:t,mirror:e},{win:n}){const o=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=function(a,c){const i=e.getId(this.ownerNode);return i!==-1&&t({id:i,adds:[{rule:a,index:c}]}),o.apply(this,arguments)};const s=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=function(a){const c=e.getId(this.ownerNode);return c!==-1&&t({id:c,removes:[{index:a}]}),s.apply(this,arguments)};const r={};yt?r.CSSGroupingRule=n.CSSGroupingRule:(gt&&(r.CSSMediaRule=n.CSSMediaRule),bt&&(r.CSSConditionRule=n.CSSConditionRule),vt&&(r.CSSSupportsRule=n.CSSSupportsRule));const l={};return Object.entries(r).forEach(([a,c])=>{l[a]={insertRule:c.prototype.insertRule,deleteRule:c.prototype.deleteRule},c.prototype.insertRule=function(i,u){const d=e.getId(this.parentStyleSheet.ownerNode);return d!==-1&&t({id:d,adds:[{rule:i,index:[...De(this),u||0]}]}),l[a].insertRule.apply(this,arguments)},c.prototype.deleteRule=function(i){const u=e.getId(this.parentStyleSheet.ownerNode);return u!==-1&&t({id:u,removes:[{index:[...De(this),i]}]}),l[a].deleteRule.apply(this,arguments)}}),()=>{n.CSSStyleSheet.prototype.insertRule=o,n.CSSStyleSheet.prototype.deleteRule=s,Object.entries(r).forEach(([a,c])=>{c.prototype.insertRule=l[a].insertRule,c.prototype.deleteRule=l[a].deleteRule})}}function On({styleDeclarationCb:t,mirror:e},{win:n}){const o=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=function(r,l,a){var c,i;const u=e.getId((i=(c=this.parentRule)==null?void 0:c.parentStyleSheet)==null?void 0:i.ownerNode);return u!==-1&&t({id:u,set:{property:r,value:l,priority:a},index:De(this.parentRule)}),o.apply(this,arguments)};const s=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=function(r){var l,a;const c=e.getId((a=(l=this.parentRule)==null?void 0:l.parentStyleSheet)==null?void 0:a.ownerNode);return c!==-1&&t({id:c,remove:{property:r},index:De(this.parentRule)}),s.apply(this,arguments)},()=>{n.CSSStyleDeclaration.prototype.setProperty=o,n.CSSStyleDeclaration.prototype.removeProperty=s}}function kn({mediaInteractionCb:t,blockClass:e,mirror:n,sampling:o}){const s=l=>se(a=>{const c=ye(a);if(!c||F(c,e,!0))return;const{currentTime:i,volume:u,muted:d}=c;t({type:l,id:n.getId(c),currentTime:i,volume:u,muted:d})},o.media||500),r=[_("play",s(Q.Play)),_("pause",s(Q.Pause)),_("seeked",s(Q.Seeked)),_("volumechange",s(Q.VolumeChange))];return()=>{r.forEach(l=>l())}}function An({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const o=[],s=new WeakMap,r=n.FontFace;n.FontFace=function(a,c,i){const u=new r(a,c,i);return s.set(u,{family:a,buffer:typeof c!="string",descriptors:i,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),u};const l=K(e.fonts,"add",function(a){return function(c){return setTimeout(()=>{const i=s.get(c);i&&(t(i),s.delete(c))},0),a.apply(this,[c])}});return o.push(()=>{n.FontFace=r}),o.push(l),()=>{o.forEach(a=>a())}}function Ln(t,e){const{mutationCb:n,mousemoveCb:o,mouseInteractionCb:s,scrollCb:r,viewportResizeCb:l,inputCb:a,mediaInteractionCb:c,styleSheetRuleCb:i,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h}=t;t.mutationCb=(...m)=>{e.mutation&&e.mutation(...m),n(...m)},t.mousemoveCb=(...m)=>{e.mousemove&&e.mousemove(...m),o(...m)},t.mouseInteractionCb=(...m)=>{e.mouseInteraction&&e.mouseInteraction(...m),s(...m)},t.scrollCb=(...m)=>{e.scroll&&e.scroll(...m),r(...m)},t.viewportResizeCb=(...m)=>{e.viewportResize&&e.viewportResize(...m),l(...m)},t.inputCb=(...m)=>{e.input&&e.input(...m),a(...m)},t.mediaInteractionCb=(...m)=>{e.mediaInteaction&&e.mediaInteaction(...m),c(...m)},t.styleSheetRuleCb=(...m)=>{e.styleSheetRule&&e.styleSheetRule(...m),i(...m)},t.styleDeclarationCb=(...m)=>{e.styleDeclaration&&e.styleDeclaration(...m),u(...m)},t.canvasMutationCb=(...m)=>{e.canvasMutation&&e.canvasMutation(...m),d(...m)},t.fontCb=(...m)=>{e.font&&e.font(...m),h(...m)}}function Pn(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};Ln(t,e);const o=Nt(t,t.doc),s=wn(t),r=In(t),l=Tt(t),a=Rn(t),c=Mn(t),i=kn(t),u=xn(t,{win:n}),d=On(t,{win:n}),h=t.collectFonts?An(t):()=>{},m=[];for(const f of t.plugins)m.push(f.observer(f.callback,n,f.options));return()=>{J.forEach(f=>f.reset()),o.disconnect(),s(),r(),l(),a(),c(),i(),u(),d(),h(),m.forEach(f=>f())}}class _n{constructor(e){this.iframes=new WeakMap,this.mutationCb=e.mutationCb}addIframe(e){this.iframes.set(e,!0)}addLoadListener(e){this.loadListener=e}attachIframe(e,n,o){var s;this.mutationCb({adds:[{parentId:o.getId(e),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(s=this.loadListener)==null||s.call(this,e)}}var Fn=Object.defineProperty,Wn=Object.defineProperties,Vn=Object.getOwnPropertyDescriptors,Ct=Object.getOwnPropertySymbols,$n=Object.prototype.hasOwnProperty,jn=Object.prototype.propertyIsEnumerable,wt=(t,e,n)=>e in t?Fn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,It=(t,e)=>{for(var n in e||(e={}))$n.call(e,n)&&wt(t,n,e[n]);if(Ct)for(var n of Ct(e))jn.call(e,n)&&wt(t,n,e[n]);return t},Rt=(t,e)=>Wn(t,Vn(e));class Gn{constructor(e){this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;const n=this;this.restorePatches.push(K(HTMLElement.prototype,"attachShadow",function(o){return function(){const s=o.apply(this,arguments);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,this.ownerDocument),s}}))}addShadowRoot(e,n){Nt(Rt(It({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),Tt(Rt(It({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))}observeAttachShadow(e){if(e.contentWindow){const n=this;this.restorePatches.push(K(e.contentWindow.HTMLElement.prototype,"attachShadow",function(o){return function(){const s=o.apply(this,arguments);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,e.contentDocument),s}}))}}reset(){this.restorePatches.forEach(e=>e())}}for(var ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ge=typeof Uint8Array>"u"?[]:new Uint8Array(256),Me=0;Me<ae.length;Me++)ge[ae.charCodeAt(Me)]=Me;var Bn=function(t){var e=new Uint8Array(t),n,o=e.length,s="";for(n=0;n<o;n+=3)s+=ae[e[n]>>2],s+=ae[(e[n]&3)<<4|e[n+1]>>4],s+=ae[(e[n+1]&15)<<2|e[n+2]>>6],s+=ae[e[n+2]&63];return o%3===2?s=s.substring(0,s.length-1)+"=":o%3===1&&(s=s.substring(0,s.length-2)+"=="),s},zn=function(t){var e=t.length*.75,n=t.length,o,s=0,r,l,a,c;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);var i=new ArrayBuffer(e),u=new Uint8Array(i);for(o=0;o<n;o+=4)r=ge[t.charCodeAt(o)],l=ge[t.charCodeAt(o+1)],a=ge[t.charCodeAt(o+2)],c=ge[t.charCodeAt(o+3)],u[s++]=r<<2|l>>4,u[s++]=(l&15)<<4|a>>2,u[s++]=(a&3)<<6|c&63;return i};const Dt=new Map;function Un(t,e){let n=Dt.get(t);return n||(n=new Map,Dt.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}const Mt=(t,e,n)=>{if(!t||!(Ot(t,e)||typeof t=="object"))return;const o=t.constructor.name,s=Un(n,o);let r=s.indexOf(t);return r===-1&&(r=s.length,s.push(t)),r};function xe(t,e,n){if(t instanceof Array)return t.map(o=>xe(o,e,n));if(t===null)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){const o=t.constructor.name,s=Bn(t);return{rr_type:o,base64:s}}else{if(t instanceof DataView)return{rr_type:t.constructor.name,args:[xe(t.buffer,e,n),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){const o=t.constructor.name,{src:s}=t;return{rr_type:o,src:s}}else if(t instanceof HTMLCanvasElement){const o="HTMLImageElement",s=t.toDataURL();return{rr_type:o,src:s}}else{if(t instanceof ImageData)return{rr_type:t.constructor.name,args:[xe(t.data,e,n),t.width,t.height]};if(Ot(t,e)||typeof t=="object"){const o=t.constructor.name,s=Mt(t,e,n);return{rr_type:o,index:s}}}}return t}const xt=(t,e,n)=>[...t].map(o=>xe(o,e,n)),Ot=(t,e)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(o=>typeof e[o]=="function");return Boolean(n.find(o=>t instanceof e[o]))};function Yn(t,e,n,o){const s=[],r=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const l of r)try{if(typeof e.CanvasRenderingContext2D.prototype[l]!="function")continue;const a=K(e.CanvasRenderingContext2D.prototype,l,function(c){return function(...i){return F(this.canvas,n,!0)||setTimeout(()=>{const u=xt([...i],e,this);t(this.canvas,{type:Y["2D"],property:l,args:u})},0),c.apply(this,i)}});s.push(a)}catch{const c=pe(e.CanvasRenderingContext2D.prototype,l,{set(i){t(this.canvas,{type:Y["2D"],property:l,args:[i],setter:!0})}});s.push(c)}return()=>{s.forEach(l=>l())}}function kt(t,e){const n=[];try{const o=K(t.HTMLCanvasElement.prototype,"getContext",function(s){return function(r,...l){return F(this,e,!0)||"__context"in this||(this.__context=r),s.apply(this,[r,...l])}});n.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(o=>o())}}function At(t,e,n,o,s,r){const l=[],a=Object.getOwnPropertyNames(t);for(const c of a)try{if(typeof t[c]!="function")continue;const i=K(t,c,function(u){return function(...d){const h=u.apply(this,d);if(Mt(h,r,t),!F(this.canvas,o,!0)){const m=xt([...d],r,t),f={type:e,property:c,args:m};n(this.canvas,f)}return h}});l.push(i)}catch{const u=pe(t,c,{set(d){n(this.canvas,{type:e,property:c,args:[d],setter:!0})}});l.push(u)}return l}function Hn(t,e,n,o){const s=[];return s.push(...At(e.WebGLRenderingContext.prototype,Y.WebGL,t,n,o,e)),typeof e.WebGL2RenderingContext<"u"&&s.push(...At(e.WebGL2RenderingContext.prototype,Y.WebGL2,t,n,o,e)),()=>{s.forEach(r=>r())}}function Xn(t,e){var n=atob(t);if(e){for(var o=new Uint8Array(n.length),s=0,r=n.length;s<r;++s)o[s]=n.charCodeAt(s);return String.fromCharCode.apply(null,new Uint16Array(o.buffer))}return n}function Zn(t,e,n){var o=e===void 0?null:e,s=n===void 0?!1:n,r=Xn(t,s),l=r.indexOf(`
4
+ `,10)+1,a=r.substring(l)+(o?"//# sourceMappingURL="+o:""),c=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(c)}function Kn(t,e,n){var o;return function(r){return o=o||Zn(t,e,n),new Worker(o,r)}}var Qn=Kn("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Zm9yKHZhciByPSJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvIixsPXR5cGVvZiBVaW50OEFycmF5PiJ1Ij9bXTpuZXcgVWludDhBcnJheSgyNTYpLGY9MDtmPHIubGVuZ3RoO2YrKylsW3IuY2hhckNvZGVBdChmKV09Zjt2YXIgZD1mdW5jdGlvbihzKXt2YXIgZT1uZXcgVWludDhBcnJheShzKSxuLGE9ZS5sZW5ndGgsdD0iIjtmb3Iobj0wO248YTtuKz0zKXQrPXJbZVtuXT4+Ml0sdCs9clsoZVtuXSYzKTw8NHxlW24rMV0+PjRdLHQrPXJbKGVbbisxXSYxNSk8PDJ8ZVtuKzJdPj42XSx0Kz1yW2VbbisyXSY2M107cmV0dXJuIGElMz09PTI/dD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTEpKyI9IjphJTM9PT0xJiYodD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTIpKyI9PSIpLHR9O2NvbnN0IGM9bmV3IE1hcCx1PW5ldyBNYXA7YXN5bmMgZnVuY3Rpb24gcChzLGUpe2NvbnN0IG49YCR7c30tJHtlfWA7aWYodS5oYXMobikpcmV0dXJuIHUuZ2V0KG4pO2NvbnN0IGE9bmV3IE9mZnNjcmVlbkNhbnZhcyhzLGUpO2EuZ2V0Q29udGV4dCgiMmQiKTtjb25zdCB0PWF3YWl0KGF3YWl0IGEuY29udmVydFRvQmxvYigpKS5hcnJheUJ1ZmZlcigpLGc9ZCh0KTtyZXR1cm4gdS5zZXQobixnKSxnfWNvbnN0IGk9c2VsZjtpLm9ubWVzc2FnZT1hc3luYyBmdW5jdGlvbihzKXtpZighKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcykpcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOnMuZGF0YS5pZH0pO2NvbnN0e2lkOmUsYml0bWFwOm4sd2lkdGg6YSxoZWlnaHQ6dH09cy5kYXRhLGc9cChhLHQpLGg9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2guZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCB3PWF3YWl0IGguY29udmVydFRvQmxvYigpLHk9dy50eXBlLGI9YXdhaXQgdy5hcnJheUJ1ZmZlcigpLG89ZChiKTtpZighYy5oYXMoZSkmJmF3YWl0IGc9PT1vKXJldHVybiBjLnNldChlLG8pLGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpZihjLmdldChlKT09PW8pcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpLnBvc3RNZXNzYWdlKHtpZDplLHR5cGU6eSxiYXNlNjQ6byx3aWR0aDphLGhlaWdodDp0fSksYy5zZXQoZSxvKX19KSgpOwoK",null,!1),Lt=Object.getOwnPropertySymbols,Jn=Object.prototype.hasOwnProperty,qn=Object.prototype.propertyIsEnumerable,eo=(t,e)=>{var n={};for(var o in t)Jn.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&Lt)for(var o of Lt(t))e.indexOf(o)<0&&qn.call(t,o)&&(n[o]=t[o]);return n},to=(t,e,n)=>new Promise((o,s)=>{var r=c=>{try{a(n.next(c))}catch(i){s(i)}},l=c=>{try{a(n.throw(c))}catch(i){s(i)}},a=c=>c.done?o(c.value):Promise.resolve(c.value).then(r,l);a((n=n.apply(t,e)).next())});class no{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(l,a){(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(a)};const{sampling:n="all",win:o,blockClass:s,recordCanvas:r}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,r&&n==="all"&&this.initCanvasMutationObserver(o,s),r&&typeof n=="number"&&this.initCanvasFPSObserver(n,o,s)}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(e,n,o){const s=kt(n,o),r=new Map,l=new Qn;l.onmessage=d=>{const{id:h}=d.data;if(r.set(h,!1),!("base64"in d.data))return;const{base64:m,type:f,width:y,height:g}=d.data;this.mutationCb({id:h,type:Y["2D"],commands:[{property:"clearRect",args:[0,0,y,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:m}],type:f}]},0,0]}]})};const a=1e3/e;let c=0,i;const u=d=>{if(c&&d-c<a){i=requestAnimationFrame(u);return}c=d,n.document.querySelectorAll(`canvas:not(.${o} *)`).forEach(h=>to(this,null,function*(){var m;const f=this.mirror.getId(h);if(r.get(f))return;if(r.set(f,!0),["webgl","webgl2"].includes(h.__context)){const g=h.getContext(h.__context);((m=g?.getContextAttributes())==null?void 0:m.preserveDrawingBuffer)===!1&&g?.clear(g.COLOR_BUFFER_BIT)}const y=yield createImageBitmap(h);l.postMessage({id:f,bitmap:y,width:h.width,height:h.height},[y])})),i=requestAnimationFrame(u)};i=requestAnimationFrame(u),this.resetObservers=()=>{s(),cancelAnimationFrame(i)}}initCanvasMutationObserver(e,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const o=kt(e,n),s=Yn(this.processMutation.bind(this),e,n,this.mirror),r=Hn(this.processMutation.bind(this),e,n,this.mirror);this.resetObservers=()=>{o(),s(),r()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=n=>{this.rafStamps.latestId=n,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,n)=>{const o=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,o)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,n){if(this.frozen||this.locked)return;const o=this.pendingCanvasMutations.get(e);if(!o||n===-1)return;const s=o.map(l=>eo(l,["type"])),{type:r}=o[0];this.mutationCb({id:n,type:r,commands:s}),this.pendingCanvasMutations.delete(e)}}class oo{constructor(e){this.trackedStylesheets=new WeakSet,this.mutationCb=e.mutationCb}addStylesheet(e){this.trackedStylesheets.has(e)||(this.trackedStylesheets.add(e),this.trackStylesheet(e))}trackStylesheet(e){}attachStylesheet(e,n,o){this.mutationCb({adds:[{parentId:o.getId(e),nextId:null,node:n}],removes:[],texts:[],attributes:[]}),this.addStylesheet(e)}}var so=Object.defineProperty,io=Object.defineProperties,ro=Object.getOwnPropertyDescriptors,Pt=Object.getOwnPropertySymbols,ao=Object.prototype.hasOwnProperty,lo=Object.prototype.propertyIsEnumerable,_t=(t,e,n)=>e in t?so(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,V=(t,e)=>{for(var n in e||(e={}))ao.call(e,n)&&_t(t,n,e[n]);if(Pt)for(var n of Pt(e))lo.call(e,n)&&_t(t,n,e[n]);return t},co=(t,e)=>io(t,ro(e));function k(t){return co(V({},t),{timestamp:Date.now()})}let D,ve;const G=v.createMirror();function q(t={}){const{emit:e,checkoutEveryNms:n,checkoutEveryNth:o,blockClass:s="highlight-block",blockSelector:r=null,ignoreClass:l="highlight-ignore",maskTextClass:a="highlight-mask",maskTextSelector:c=null,inlineStylesheet:i=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:h,maskInputFn:m,maskTextFn:f,hooks:y,packFn:g,sampling:p={},mousemoveWait:b,recordCanvas:T=!1,userTriggeredOnInput:I=!1,collectFonts:A=!1,inlineImages:P=!1,plugins:z,keepIframeSrcFn:Te=()=>!1,enableStrictPrivacy:Ee=!1}=t;if(!e)throw new Error("emit function is required");b!==void 0&&p.mousemove===void 0&&(p.mousemove=b),G.reset();const Se=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},Ce=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||{};We();let de,he=0;const et=S=>{for(const U of z||[])U.eventProcessor&&(S=U.eventProcessor(S));return g&&(S=g(S)),S};D=(S,U)=>{var Z;if(((Z=J[0])==null?void 0:Z.isFrozen())&&S.type!==N.FullSnapshot&&!(S.type===N.IncrementalSnapshot&&S.data.source===E.Mutation)&&J.forEach(W=>W.unfreeze()),e(et(S),U),S.type===N.FullSnapshot)de=S,he=0;else if(S.type===N.IncrementalSnapshot){if(S.data.source===E.Mutation&&S.data.isAttachIframe)return;he++;const W=o&&he>=o,ne=n&&S.timestamp-de.timestamp>n;(W||ne)&&ve(!0)}};const me=S=>{D(k({type:N.IncrementalSnapshot,data:V({source:E.Mutation},S)}))},we=S=>D(k({type:N.IncrementalSnapshot,data:V({source:E.Scroll},S)})),M=S=>D(k({type:N.IncrementalSnapshot,data:V({source:E.CanvasMutation},S)})),H=new _n({mutationCb:me}),te=new oo({mutationCb:me}),Ie=new no({recordCanvas:T,mutationCb:M,win:window,blockClass:s,mirror:G,sampling:p.canvas}),tt=new Gn({mutationCb:me,scrollCb:we,bypassOptions:{blockClass:s,blockSelector:r,maskTextClass:a,maskTextSelector:c,inlineStylesheet:i,maskInputOptions:Se,maskTextFn:f,maskInputFn:m,recordCanvas:T,inlineImages:P,sampling:p,slimDOMOptions:Ce,iframeManager:H,stylesheetManager:te,canvasManager:Ie,enableStrictPrivacy:Ee},mirror:G});ve=(S=!1)=>{var U,Z,W,ne;D(k({type:N.Meta,data:{href:window.location.href,width:Pe(),height:Le()}}),S),J.forEach(x=>x.lock());const w=v.snapshot(document,{mirror:G,blockClass:s,blockSelector:r,maskTextClass:a,maskTextSelector:c,inlineStylesheet:i,maskAllInputs:Se,maskTextFn:f,slimDOM:Ce,recordCanvas:T,inlineImages:P,enableStrictPrivacy:Ee,onSerialize:x=>{ie(x,G)&&H.addIframe(x),$e(x,G)&&te.addStylesheet(x),fe(x)&&tt.addShadowRoot(x.shadowRoot,document)},onIframeLoad:(x,nt)=>{H.attachIframe(x,nt,G),tt.observeAttachShadow(x)},onStylesheetLoad:(x,nt)=>{te.attachStylesheet(x,nt,G)},keepIframeSrcFn:Te});if(!w)return console.warn("Failed to snapshot the document");D(k({type:N.FullSnapshot,data:{node:w,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((Z=(U=document?.body)==null?void 0:U.parentElement)==null?void 0:Z.scrollLeft)||document?.body.scrollLeft||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((ne=(W=document?.body)==null?void 0:W.parentElement)==null?void 0:ne.scrollTop)||document?.body.scrollTop||0}}})),J.forEach(x=>x.unlock())};try{const S=[];S.push(_("DOMContentLoaded",()=>{D(k({type:N.DomContentLoaded,data:{}}))}));const U=W=>{var ne;return Pn({mutationCb:me,mousemoveCb:(w,x)=>D(k({type:N.IncrementalSnapshot,data:{source:x,positions:w}})),mouseInteractionCb:w=>D(k({type:N.IncrementalSnapshot,data:V({source:E.MouseInteraction},w)})),scrollCb:we,viewportResizeCb:w=>D(k({type:N.IncrementalSnapshot,data:V({source:E.ViewportResize},w)})),inputCb:w=>D(k({type:N.IncrementalSnapshot,data:V({source:E.Input},w)})),mediaInteractionCb:w=>D(k({type:N.IncrementalSnapshot,data:V({source:E.MediaInteraction},w)})),styleSheetRuleCb:w=>D(k({type:N.IncrementalSnapshot,data:V({source:E.StyleSheetRule},w)})),styleDeclarationCb:w=>D(k({type:N.IncrementalSnapshot,data:V({source:E.StyleDeclaration},w)})),canvasMutationCb:M,fontCb:w=>D(k({type:N.IncrementalSnapshot,data:V({source:E.Font},w)})),blockClass:s,ignoreClass:l,maskTextClass:a,maskTextSelector:c,maskInputOptions:Se,inlineStylesheet:i,sampling:p,recordCanvas:T,inlineImages:P,userTriggeredOnInput:I,collectFonts:A,doc:W,maskInputFn:m,maskTextFn:f,blockSelector:r,slimDOMOptions:Ce,mirror:G,iframeManager:H,stylesheetManager:te,shadowDomManager:tt,canvasManager:Ie,enableStrictPrivacy:Ee,plugins:((ne=z?.filter(w=>w.observer))==null?void 0:ne.map(w=>({observer:w.observer,options:w.options,callback:x=>D(k({type:N.Plugin,data:{plugin:w.name,payload:x}}))})))||[]},y)};H.addLoadListener(W=>{S.push(U(W.contentDocument))});const Z=()=>{ve(),S.push(U(document))};return document.readyState==="interactive"||document.readyState==="complete"?Z():S.push(_("load",()=>{D(k({type:N.Load,data:{}})),Z()},window)),()=>{S.forEach(W=>W())}}catch(S){console.warn(S)}}q.addCustomEvent=(t,e)=>{!D||D(k({type:N.Custom,data:{tag:t,payload:e}}))},q.freezePage=()=>{J.forEach(t=>t.freeze())},q.takeFullSnapshot=t=>{if(!ve)throw new Error("please take full snapshot after start recording");ve(t)},q.mirror=G;function uo(t){const e={},n=/;(?![^(]*\))/g,o=/:(.+)/,s=/\/\*.*?\*\//g;return t.replace(s,"").split(n).forEach(function(r){if(r){const l=r.split(o);l.length>1&&(e[ze(l[0].trim())]=l[1].trim())}}),e}function Ft(t){const e=[];for(const n in t){const o=t[n];if(typeof o!="string")continue;const s=fo(n);e.push(`${s}: ${o};`)}return e.join(" ")}const ho=/-([a-z])/g,mo=/^--[a-zA-Z0-9-]+$/,ze=t=>mo.test(t)?t:t.replace(ho,(e,n)=>n?n.toUpperCase():""),po=/\B([A-Z])/g,fo=t=>t.replace(po,"-$1").toLowerCase();class ${constructor(...e){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=R.ELEMENT_NODE,this.TEXT_NODE=R.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){const e=this.parentNode;if(!e)return null;const n=e.childNodes,o=n.indexOf(this);return n[o+1]||null}contains(e){if(e===this)return!0;for(const n of this.childNodes)if(n.contains(e))return!0;return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,n){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function yo(t){return class fn extends t{constructor(){super(...arguments),this.nodeType=R.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=v.NodeType.Document,this.textContent=null}get documentElement(){return this.childNodes.find(n=>n.RRNodeType===v.NodeType.Element&&n.tagName==="HTML")||null}get body(){var n;return((n=this.documentElement)===null||n===void 0?void 0:n.childNodes.find(o=>o.RRNodeType===v.NodeType.Element&&o.tagName==="BODY"))||null}get head(){var n;return((n=this.documentElement)===null||n===void 0?void 0:n.childNodes.find(o=>o.RRNodeType===v.NodeType.Element&&o.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(n){const o=n.RRNodeType;if((o===v.NodeType.Element||o===v.NodeType.DocumentType)&&this.childNodes.some(s=>s.RRNodeType===o))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${o===v.NodeType.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return n.parentElement=null,n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,o){const s=n.RRNodeType;if((s===v.NodeType.Element||s===v.NodeType.DocumentType)&&this.childNodes.some(l=>l.RRNodeType===s))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${s===v.NodeType.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(o===null)return this.appendChild(n);const r=this.childNodes.indexOf(o);if(r==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(r,0,n),n.parentElement=null,n.parentNode=this,n}removeChild(n){const o=this.childNodes.indexOf(n);if(o===-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(o,1),n.parentElement=null,n.parentNode=null,n}open(){this.childNodes=[]}close(){}write(n){let o;if(n==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?o="-//W3C//DTD XHTML 1.0 Transitional//EN":n==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(o="-//W3C//DTD HTML 4.0 Transitional//EN"),o){const s=this.createDocumentType("html",o,"");this.open(),this.appendChild(s)}}createDocument(n,o,s){return new fn}createDocumentType(n,o,s){const r=new(Wt($))(n,o,s);return r.ownerDocument=this,r}createElement(n){const o=new(Vt($))(n);return o.ownerDocument=this,o}createElementNS(n,o){return this.createElement(o)}createTextNode(n){const o=new($t($))(n);return o.ownerDocument=this,o}createComment(n){const o=new(jt($))(n);return o.ownerDocument=this,o}createCDATASection(n){const o=new(Gt($))(n);return o.ownerDocument=this,o}toString(){return"RRDocument"}}}function Wt(t){return class extends t{constructor(e,n,o){super(),this.nodeType=R.DOCUMENT_TYPE_NODE,this.RRNodeType=v.NodeType.DocumentType,this.textContent=null,this.name=e,this.publicId=n,this.systemId=o,this.nodeName=e}toString(){return"RRDocumentType"}}}function Vt(t){return class extends t{constructor(e){super(),this.nodeType=R.ELEMENT_NODE,this.RRNodeType=v.NodeType.Element,this.attributes={},this.shadowRoot=null,this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e="";return this.childNodes.forEach(n=>e+=n.textContent),e}set textContent(e){this.childNodes=[this.ownerDocument.createTextNode(e)]}get classList(){return new vo(this.attributes.class,e=>{this.attributes.class=e})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const e=this.attributes.style?uo(this.attributes.style):{},n=/\B([A-Z])/g;return e.setProperty=(o,s,r)=>{if(n.test(o))return;const l=ze(o);s?e[l]=s:delete e[l],r==="important"&&(e[l]+=" !important"),this.attributes.style=Ft(e)},e.removeProperty=o=>{if(n.test(o))return"";const s=ze(o),r=e[s]||"";return delete e[s],this.attributes.style=Ft(e),r},e}getAttribute(e){return this.attributes[e]||null}setAttribute(e,n){this.attributes[e]=n}setAttributeNS(e,n,o){this.setAttribute(n,o)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return this.childNodes.push(e),e.parentNode=this,e.parentElement=this,e}insertBefore(e,n){if(n===null)return this.appendChild(e);const o=this.childNodes.indexOf(n);if(o==-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(o,0,e),e.parentElement=this,e.parentNode=this,e}removeChild(e){const n=this.childNodes.indexOf(e);if(n===-1)throw new Error("Failed to execute 'removeChild' on 'RRElement': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(n,1),e.parentElement=null,e.parentNode=null,e}attachShadow(e){const n=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=n,n}dispatchEvent(e){return!0}toString(){let e="";for(const n in this.attributes)e+=`${n}="${this.attributes[n]}" `;return`${this.tagName} ${e}`}}}function go(t){return class extends t{attachShadow(e){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 $t(t){return class extends t{constructor(e){super(),this.nodeType=R.TEXT_NODE,this.nodeName="#text",this.RRNodeType=v.NodeType.Text,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function jt(t){return class extends t{constructor(e){super(),this.nodeType=R.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=v.NodeType.Comment,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function Gt(t){return class extends t{constructor(e){super(),this.nodeName="#cdata-section",this.nodeType=R.CDATA_SECTION_NODE,this.RRNodeType=v.NodeType.CDATA,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class vo{constructor(e,n){if(this.classes=[],this.add=(...o)=>{for(const s of o){const r=String(s);this.classes.indexOf(r)>=0||this.classes.push(r)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...o)=>{this.classes=this.classes.filter(s=>o.indexOf(s)===-1),this.onChange&&this.onChange(this.classes.join(" "))},e){const o=e.trim().split(/\s+/);this.classes.push(...o)}this.onChange=n}}var R;(function(t){t[t.PLACEHOLDER=0]="PLACEHOLDER",t[t.ELEMENT_NODE=1]="ELEMENT_NODE",t[t.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",t[t.TEXT_NODE=3]="TEXT_NODE",t[t.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",t[t.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",t[t.ENTITY_NODE=6]="ENTITY_NODE",t[t.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",t[t.COMMENT_NODE=8]="COMMENT_NODE",t[t.DOCUMENT_NODE=9]="DOCUMENT_NODE",t[t.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",t[t.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"})(R||(R={}));const Ue={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"};function B(t,e,n,o){const s=t.childNodes,r=e.childNodes;o=o||e.mirror||e.ownerDocument.mirror,(s.length>0||r.length>0)&&Bt(Array.from(s),r,t,n,o);let l=null,a=null;switch(e.RRNodeType){case v.NodeType.Document:{a=e.scrollData;break}case v.NodeType.Element:{const c=t,i=e;switch(bo(c,i,o),a=i.scrollData,l=i.inputData,i.tagName){case"AUDIO":case"VIDEO":{const u=t,d=i;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":e.canvasMutations.forEach(u=>n.applyCanvas(u.event,u.mutation,t));break;case"STYLE":No(c,e.rules);break}if(i.shadowRoot){c.shadowRoot||c.attachShadow({mode:"open"});const u=c.shadowRoot.childNodes,d=i.shadowRoot.childNodes;(u.length>0||d.length>0)&&Bt(Array.from(u),d,c.shadowRoot,n,o)}break}case v.NodeType.Text:case v.NodeType.Comment:case v.NodeType.CDATA:t.textContent!==e.data&&(t.textContent=e.data);break}if(a&&n.applyScroll(a,!0),l&&n.applyInput(l),e.nodeName==="IFRAME"){const c=t.contentDocument,i=e;if(c){const u=o.getMeta(i.contentDocument);u&&n.mirror.add(c,Object.assign({},u)),B(c,i.contentDocument,n,o)}}}function bo(t,e,n){const o=t.attributes,s=e.attributes;for(const r in s){const l=s[r],a=n.getMeta(e);if(a&&"isSVG"in a&&a.isSVG&&Ue[r])t.setAttributeNS(Ue[r],r,l);else if(e.tagName==="CANVAS"&&r==="rr_dataURL"){const c=document.createElement("img");c.src=l,c.onload=()=>{const i=t.getContext("2d");i&&i.drawImage(c,0,0,c.width,c.height)}}else t.setAttribute(r,l)}for(const{name:r}of Array.from(o))r in s||t.removeAttribute(r);e.scrollLeft&&(t.scrollLeft=e.scrollLeft),e.scrollTop&&(t.scrollTop=e.scrollTop)}function Bt(t,e,n,o,s){var r;let l=0,a=t.length-1,c=0,i=e.length-1,u=t[l],d=t[a],h=e[c],m=e[i],f,y;for(;l<=a&&c<=i;)if(u===void 0)u=t[++l];else if(d===void 0)d=t[--a];else if(o.mirror.getId(u)===s.getId(h))B(u,h,o,s),u=t[++l],h=e[++c];else if(o.mirror.getId(d)===s.getId(m))B(d,m,o,s),d=t[--a],m=e[--i];else if(o.mirror.getId(u)===s.getId(m))try{n.insertBefore(u,d.nextSibling),B(u,m,o,s),u=t[++l],m=e[--i]}catch(g){console.error(g,n,u,d)}else if(o.mirror.getId(d)===s.getId(h))try{n.insertBefore(d,u),B(d,h,o,s),d=t[--a],h=e[++c]}catch(g){console.error(g,n,d,u)}else{if(!f){f={};for(let g=l;g<=a;g++){const p=t[g];p&&o.mirror.hasNode(p)&&(f[o.mirror.getId(p)]=g)}}if(y=f[s.getId(h)],y){const g=t[y];try{n.insertBefore(g,u),B(g,h,o,s),t[y]=void 0}catch(p){console.error(p,n,g,u)}}else{const g=Ye(h,o.mirror,s);n.nodeName==="#document"&&((r=o.mirror.getMeta(g))===null||r===void 0?void 0:r.type)===v.NodeType.Element&&n.documentElement&&(n.removeChild(n.documentElement),t[l]=void 0,u=void 0);try{n.insertBefore(g,u||null),B(g,h,o,s)}catch(p){console.error(p,n,g,u||null)}}h=e[++c]}if(l>a){const g=e[i+1];let p=null;for(g&&n.childNodes.forEach(b=>{o.mirror.getId(b)===s.getId(g)&&(p=b)});c<=i;++c){const b=Ye(e[c],o.mirror,s);try{n.insertBefore(b,p),B(b,e[c],o,s)}catch(T){console.error(T,n,b,p)}}}else if(c>i)for(;l<=a;l++){const g=t[l];g&&(n.removeChild(g),o.mirror.removeNodeFromMap(g))}}function Ye(t,e,n){let o=e.getNode(n.getId(t));const s=n.getMeta(t);if(o!==null)return o;switch(t.RRNodeType){case v.NodeType.Document:o=new Document;break;case v.NodeType.DocumentType:o=document.implementation.createDocumentType(t.name,t.publicId,t.systemId);break;case v.NodeType.Element:{t.tagName.toLowerCase(),s&&"isSVG"in s&&s?.isSVG?o=document.createElementNS(Ue.svg,t.tagName.toLowerCase()):o=document.createElement(t.tagName);break}case v.NodeType.Text:o=document.createTextNode(t.data);break;case v.NodeType.Comment:o=document.createComment(t.data);break;case v.NodeType.CDATA:o=document.createCDATASection(t.data);break}return s&&e.add(o,Object.assign({},s)),o}function be(t,e){const n=t[e[0]];return e.length===1?n:be(n.cssRules[e[1]].cssRules,e.slice(2))}var j;(function(t){t[t.Insert=0]="Insert",t[t.Remove=1]="Remove",t[t.Snapshot=2]="Snapshot",t[t.SetProperty=3]="SetProperty",t[t.RemoveProperty=4]="RemoveProperty"})(j||(j={}));function zt(t){const e=[...t],n=e.pop();return{positions:e,index:n}}function No(t,e){const n=t.sheet;e.forEach(o=>{if(o.type===j.Insert)try{if(Array.isArray(o.index)){const{positions:s,index:r}=zt(o.index);be(n.cssRules,s).insertRule(o.cssText,r)}else n.insertRule(o.cssText,o.index)}catch{}else if(o.type===j.Remove)try{if(Array.isArray(o.index)){const{positions:s,index:r}=zt(o.index);be(n.cssRules,s).deleteRule(r||0)}else n.deleteRule(o.index)}catch{}else o.type===j.SetProperty?be(n.cssRules,o.index).style.setProperty(o.property,o.value,o.priority):o.type===j.RemoveProperty&&be(n.cssRules,o.index).style.removeProperty(o.property)})}class le extends yo($){constructor(e){super(),this._unserializedId=-1,this.mirror=Oo(),this.scrollData=null,e&&(this.mirror=e)}get unserializedId(){return this._unserializedId--}createDocument(e,n,o){return new le}createDocumentType(e,n,o){const s=new To(e,n,o);return s.ownerDocument=this,s}createElement(e){const n=e.toUpperCase();let o;switch(n){case"AUDIO":case"VIDEO":o=new Eo(n);break;case"IFRAME":o=new wo(n,this.mirror);break;case"CANVAS":o=new So(n);break;case"STYLE":o=new Co(n);break;default:o=new Ne(n);break}return o.ownerDocument=this,o}createComment(e){const n=new Ro(e);return n.ownerDocument=this,n}createCDATASection(e){const n=new Do(e);return n.ownerDocument=this,n}createTextNode(e){const n=new Io(e);return n.ownerDocument=this,n}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=-1}}const To=Wt($);class Ne extends Vt($){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class Eo extends go(Ne){}class So extends Ne{constructor(){super(...arguments),this.canvasMutations=[]}getContext(){return null}}class Co extends Ne{constructor(){super(...arguments),this.rules=[]}}class wo extends Ne{constructor(e,n){super(e),this.contentDocument=new le,this.contentDocument.mirror=n}}const Io=$t($),Ro=jt($),Do=Gt($);function Mo(t){return t instanceof HTMLFormElement?"FORM":t.tagName.toUpperCase()}function Ut(t,e,n,o){let s;switch(t.nodeType){case R.DOCUMENT_NODE:o&&o.nodeName==="IFRAME"?s=o.contentDocument:(s=e,s.compatMode=t.compatMode);break;case R.DOCUMENT_TYPE_NODE:const l=t;s=e.createDocumentType(l.name,l.publicId,l.systemId);break;case R.ELEMENT_NODE:const a=t,c=Mo(a);s=e.createElement(c);const i=s;for(const{name:u,value:d}of Array.from(a.attributes))i.attributes[u]=d;a.scrollLeft&&(i.scrollLeft=a.scrollLeft),a.scrollTop&&(i.scrollTop=a.scrollTop);break;case R.TEXT_NODE:s=e.createTextNode(t.textContent||"");break;case R.CDATA_SECTION_NODE:s=e.createCDATASection(t.data);break;case R.COMMENT_NODE:s=e.createComment(t.textContent||"");break;case R.DOCUMENT_FRAGMENT_NODE:s=o.attachShadow({mode:"open"});break;default:return null}let r=n.getMeta(t);return e instanceof le&&(r||(r=Yt(s,e.unserializedId),n.add(t,r)),e.mirror.add(s,Object.assign({},r))),s}function xo(t,e=v.createMirror(),n=new le){function o(s,r){const l=Ut(s,n,e,r);l!==null&&(r?.nodeName!=="IFRAME"&&s.nodeType!==R.DOCUMENT_FRAGMENT_NODE&&(r?.appendChild(l),l.parentNode=r,l.parentElement=r),s.nodeName==="IFRAME"?o(s.contentDocument,l):(s.nodeType===R.DOCUMENT_NODE||s.nodeType===R.ELEMENT_NODE||s.nodeType===R.DOCUMENT_FRAGMENT_NODE)&&(s.nodeType===R.ELEMENT_NODE&&s.shadowRoot&&o(s.shadowRoot,l),s.childNodes.forEach(a=>o(a,l))))}return o(t,null),n}function Oo(){return new ko}class ko{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var n;if(!e)return-1;const o=(n=this.getMeta(e))===null||n===void 0?void 0:n.id;return o??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(o=>this.removeNodeFromMap(o))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,n){const o=n.id;this.idNodeMap.set(o,e),this.nodeMetaMap.set(e,n)}replace(e,n){this.idNodeMap.set(e,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Yt(t,e){switch(t.RRNodeType){case v.NodeType.Document:return{id:e,type:t.RRNodeType,childNodes:[]};case v.NodeType.DocumentType:const n=t;return{id:e,type:t.RRNodeType,name:n.name,publicId:n.publicId,systemId:n.systemId};case v.NodeType.Element:return{id:e,type:t.RRNodeType,tagName:t.tagName.toLowerCase(),attributes:{},childNodes:[]};case v.NodeType.Text:return{id:e,type:t.RRNodeType,textContent:t.textContent||""};case v.NodeType.Comment:return{id:e,type:t.RRNodeType,textContent:t.textContent||""};case v.NodeType.CDATA:return{id:e,type:t.RRNodeType,textContent:""}}}function Ht(t){return t=t||Object.create(null),{on:function(n,o){(t[n]||(t[n]=[])).push(o)},off:function(n,o){t[n]&&t[n].splice(t[n].indexOf(o)>>>0,1)},emit:function(n,o){(t[n]||[]).slice().map(function(s){s(o)}),(t["*"]||[]).slice().map(function(s){s(n,o)})}}}var Ao=Object.freeze({__proto__:null,default:Ht});function Lo(t=window,e=document){if("scrollBehavior"in e.documentElement.style&&t.__forceSmoothScrollPolyfill__!==!0)return;const n=t.HTMLElement||t.Element,o=468,s={scroll:t.scroll||t.scrollTo,scrollBy:t.scrollBy,elementScroll:n.prototype.scroll||c,scrollIntoView:n.prototype.scrollIntoView},r=t.performance&&t.performance.now?t.performance.now.bind(t.performance):Date.now;function l(p){const b=["MSIE ","Trident/","Edge/"];return new RegExp(b.join("|")).test(p)}const a=l(t.navigator.userAgent)?1:0;function c(p,b){this.scrollLeft=p,this.scrollTop=b}function i(p){return .5*(1-Math.cos(Math.PI*p))}function u(p){if(p===null||typeof p!="object"||p.behavior===void 0||p.behavior==="auto"||p.behavior==="instant")return!0;if(typeof p=="object"&&p.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+p.behavior+" is not a valid value for enumeration ScrollBehavior.")}function d(p,b){if(b==="Y")return p.clientHeight+a<p.scrollHeight;if(b==="X")return p.clientWidth+a<p.scrollWidth}function h(p,b){const T=t.getComputedStyle(p,null)["overflow"+b];return T==="auto"||T==="scroll"}function m(p){const b=d(p,"Y")&&h(p,"Y"),T=d(p,"X")&&h(p,"X");return b||T}function f(p){for(;p!==e.body&&m(p)===!1;)p=p.parentNode||p.host;return p}function y(p){const b=r();let T,I,A,P=(b-p.startTime)/o;P=P>1?1:P,T=i(P),I=p.startX+(p.x-p.startX)*T,A=p.startY+(p.y-p.startY)*T,p.method.call(p.scrollable,I,A),(I!==p.x||A!==p.y)&&t.requestAnimationFrame(y.bind(t,p))}function g(p,b,T){let I,A,P,z;const Te=r();p===e.body?(I=t,A=t.scrollX||t.pageXOffset,P=t.scrollY||t.pageYOffset,z=s.scroll):(I=p,A=p.scrollLeft,P=p.scrollTop,z=c),y({scrollable:I,method:z,startTime:Te,startX:A,startY:P,x:b,y:T})}t.scroll=t.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){s.scroll.call(t,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:t.scrollX||t.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:t.scrollY||t.pageYOffset);return}g.call(t,e.body,arguments[0].left!==void 0?~~arguments[0].left:t.scrollX||t.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:t.scrollY||t.pageYOffset)}},t.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){s.scrollBy.call(t,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}g.call(t,e.body,~~arguments[0].left+(t.scrollX||t.pageXOffset),~~arguments[0].top+(t.scrollY||t.pageYOffset))}},n.prototype.scroll=n.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");s.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const p=arguments[0].left,b=arguments[0].top;g.call(this,this,typeof p>"u"?this.scrollLeft:~~p,typeof b>"u"?this.scrollTop:~~b)},n.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){s.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},n.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){s.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const p=f(this),b=p.getBoundingClientRect(),T=this.getBoundingClientRect();p!==e.body?(g.call(this,p,p.scrollLeft+T.left-b.left,p.scrollTop+T.top-b.top),t.getComputedStyle(p).position!=="fixed"&&t.scrollBy({left:b.left,top:b.top,behavior:"smooth"})):t.scrollBy({left:T.left,top:T.top,behavior:"smooth"})}}class Po{constructor(e=[],n){this.timeOffset=0,this.raf=null,this.actions=e,this.speed=n}addAction(e){const n=this.findActionIndex(e);this.actions.splice(n,0,e)}addActions(e){this.actions=this.actions.concat(e)}replaceActions(e){this.actions.length=0,this.actions.splice(0,0,...e)}start(){this.timeOffset=0;let e=performance.now();const{actions:n}=this,o=this;function s(){const r=performance.now();for(o.timeOffset+=(r-e)*o.speed,e=r;n.length;){const l=n[0];if(o.timeOffset>=l.delay)n.shift(),l.doAction();else break}(n.length>0||o.liveMode)&&(o.raf=requestAnimationFrame(s))}this.raf=requestAnimationFrame(s)}clear(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}toggleLiveMode(e){this.liveMode=e}isActive(){return this.raf!==null}findActionIndex(e){let n=0,o=this.actions.length-1;for(;n<=o;){const s=Math.floor((n+o)/2);if(this.actions[s].delay<e.delay)n=s+1;else if(this.actions[s].delay>e.delay)o=s-1;else return s+1}return n}}function He(t,e){if(t.type===N.IncrementalSnapshot&&t.data.source===E.MouseMove){const n=t.data.positions[0].timeOffset,o=t.timestamp+n;return t.delay=o-e,o-e}return t.delay=t.timestamp-e,t.delay}/*! *****************************************************************************
5
+ Copyright (c) Microsoft Corporation.
7
6
 
8
- Permission to use, copy, modify, and/or distribute this software for any
9
- purpose with or without fee is hereby granted.
7
+ Permission to use, copy, modify, and/or distribute this software for any
8
+ purpose with or without fee is hereby granted.
10
9
 
11
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
12
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
14
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17
- PERFORMANCE OF THIS SOFTWARE.
18
- ***************************************************************************** */function In(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r,o,s=n.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(r=s.next()).done;)a.push(r.value)}catch(l){o={error:l}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return a}var Ie;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Ie||(Ie={}));var xn={type:"xstate.init"};function pt(e){return e===void 0?[]:[].concat(e)}function ge(e){return{type:"xstate.assign",assignment:e}}function Mn(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 He(e){return function(t){return e===t}}function kn(e){return typeof e=="string"?{type:e}:e}function Dn(e,t){return{value:e,context:t,actions:[],changed:!1,matches:He(e)}}function Rn(e,t,n){var r=t,o=!1;return[e.filter(function(s){if(s.type==="xstate.assign"){o=!0;var a=Object.assign({},r);return typeof s.assignment=="function"?a=s.assignment(r,n):Object.keys(s.assignment).forEach(function(l){a[l]=typeof s.assignment[l]=="function"?s.assignment[l](r,n):s.assignment[l]}),r=a,!1}return!0}),r,o]}function On(e,t){t===void 0&&(t={});var n=In(Rn(pt(e.states[e.initial].entry).map(function(a){return Mn(a,t.actions)}),e.context,xn),2),r=n[0],o=n[1],s={config:e,_options:t,initialState:{value:e.initial,actions:r,context:o,matches:He(e.initial)},transition:function(a,l){var c,i,u=typeof a=="string"?{value:a,context:e.context}:a,d=u.value,m=u.context,h=kn(l),f=e.states[d];if(f.on){var g=pt(f.on[h.type]);try{for(var N=function(L){var U=typeof Symbol=="function"&&Symbol.iterator,b=U&&L[U],v=0;if(b)return b.call(L);if(L&&typeof L.length=="number")return{next:function(){return L&&v>=L.length&&(L=void 0),{value:L&&L[v++],done:!L}}};throw new TypeError(U?"Object is not iterable.":"Symbol.iterator is not defined.")}(g),p=N.next();!p.done;p=N.next()){var S=p.value;if(S===void 0)return Dn(d,m);var y=typeof S=="string"?{target:S}:S,T=y.target,D=y.actions,A=D===void 0?[]:D,M=y.cond,F=M===void 0?function(){return!0}:M,W=T===void 0,X=T??d,Z=e.states[X];if(F(m,h)){var K=In(Rn((W?pt(A):[].concat(f.exit,A,Z.entry).filter(function(L){return L})).map(function(L){return Mn(L,s._options.actions)}),m,h),3),q=K[0],V=K[1],z=K[2],Y=T??d;return{value:Y,context:V,actions:q,changed:T!==d||q.length>0||z,matches:He(Y)}}}}catch(L){c={error:L}}finally{try{p&&!p.done&&(i=N.return)&&i.call(N)}finally{if(c)throw c.error}}}return Dn(d,m)}};return s}var An=function(e,t){return e.actions.forEach(function(n){var r=n.exec;return r&&r(e.context,t)})};function Ln(e){var t=e.initialState,n=Ie.NotStarted,r=new Set,o={_machine:e,send:function(s){n===Ie.Running&&(t=e.transition(t,s),An(t,kn(s)),r.forEach(function(a){return a(t)}))},subscribe:function(s){return r.add(s),s(t),{unsubscribe:function(){return r.delete(s)}}},start:function(s){if(s){var a=typeof s=="object"?s:{context:e.config.context,value:s};t={value:a.value,actions:[],context:a.context,matches:He(a.value)}}return n=Ie.Running,An(t,xn),o},stop:function(){return n=Ie.Stopped,r.clear(),o},get state(){return t},get status(){return n}};return o}var Qo=Object.defineProperty,Jo=Object.defineProperties,qo=Object.getOwnPropertyDescriptors,Pn=Object.getOwnPropertySymbols,ei=Object.prototype.hasOwnProperty,ti=Object.prototype.propertyIsEnumerable,_n=(e,t,n)=>t in e?Qo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xe=(e,t)=>{for(var n in t||(t={}))ei.call(t,n)&&_n(e,n,t[n]);if(Pn)for(var n of Pn(t))ti.call(t,n)&&_n(e,n,t[n]);return e},Ze=(e,t)=>Jo(e,qo(t));function ni(e,t){for(let n=e.length-1;n>=0;n--){const r=e[n];if(r.type===w.Meta&&r.timestamp<=t)return e.slice(n)}return e}function ri(e,{getCastFn:t,applyEventsSynchronously:n,emitter:r}){const o=On({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:ge({lastPlayedEvent:(s,a)=>a.type==="CAST_EVENT"?a.payload.event:s.lastPlayedEvent}),recordTimeOffset:ge((s,a)=>{let l=s.timeOffset;return"payload"in a&&"timeOffset"in a.payload&&(l=a.payload.timeOffset),Ze(Xe({},s),{timeOffset:l,baselineTime:s.events[0].timestamp+l})}),play(s){var a;const{timer:l,events:c,baselineTime:i,lastPlayedEvent:u}=s;l.clear();for(const g of c)mt(g,i);const d=ni(c,i);let m=u?.timestamp;u?.type===w.IncrementalSnapshot&&u.data.source===x.MouseMove&&(m=u.timestamp+((a=u.data.positions[0])==null?void 0:a.timeOffset)),i<(m||0)&&r.emit(O.PlayBack);const h=new Array,f=new Array;for(const g of d)if(!(m&&m<i&&(g.timestamp<=m||g===u)))if(g.timestamp<i)h.push(g);else{const N=t(g,!1);f.push({doAction:()=>{N()},delay:g.delay})}n(h),r.emit(O.Flush),l.addActions(f),l.start()},pause(s){s.timer.clear()},resetLastPlayedEvent:ge(s=>Ze(Xe({},s),{lastPlayedEvent:null})),startLive:ge({baselineTime:(s,a)=>(s.timer.toggleLiveMode(!0),s.timer.start(),a.type==="TO_LIVE"&&a.payload.baselineTime?a.payload.baselineTime:Date.now())}),replaceEvents:ge((s,a)=>{const{events:l,timer:c,baselineTime:i}=s;if(a.type==="REPLACE_EVENTS"){const{events:u}=a.payload;l.length=0;const d=[];for(const m of u)if(mt(m,i),l.push(m),m.timestamp>=c.timeOffset+i){const h=t(m,!1);d.push({doAction:()=>{h()},delay:m.delay})}c.isActive()&&c.replaceActions(d)}return Ze(Xe({},s),{events:l})}),addEvent:ge((s,a)=>{const{baselineTime:l,timer:c,events:i}=s;if(a.type==="ADD_EVENT"){const{event:u}=a.payload;mt(u,l);let d=i.length-1;if(!i[d]||i[d].timestamp<=u.timestamp)i.push(u);else{let f=-1,g=0;for(;g<=d;){const N=Math.floor((g+d)/2);i[N].timestamp<=u.timestamp?g=N+1:d=N-1}f===-1&&(f=g),i.splice(f,0,u)}const m=u.timestamp<l,h=t(u,m);m?h():c.isActive()&&c.addAction({doAction:()=>{h()},delay:u.delay})}return Ze(Xe({},s),{events:i})})}});return Ln(o)}function oi(e){const t=On({id:"speed",context:e,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(n,r)=>{"payload"in r&&n.timer.setSpeed(r.payload.speed)},recordSpeed:ge({normalSpeed:n=>n.timer.speed}),restoreSpeed:n=>{n.timer.setSpeed(n.normalSpeed)}}});return Ln(t)}const ii=e=>[`.${e} { background: currentColor }`,"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 si=(e,t,n)=>new Promise((r,o)=>{var s=c=>{try{l(n.next(c))}catch(i){o(i)}},a=c=>{try{l(n.throw(c))}catch(i){o(i)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,a);l((n=n.apply(e,t)).next())});const Fn=new Map;function Wn(e,t){let n=Fn.get(e);return n||(n=new Map,Fn.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}function de(e,t,n){return r=>si(this,null,function*(){if(r&&typeof r=="object"&&"rr_type"in r)if(n&&(n.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){const o=yield de(e,t,n)(r.args);return yield createImageBitmap.apply(null,o)}else if("index"in r){if(n||t===null)return r;const{rr_type:o,index:s}=r;return Wn(t,o)[s]}else if("args"in r){const{rr_type:o,args:s}=r,a=window[o];return new a(...yield Promise.all(s.map(de(e,t,n))))}else{if("base64"in r)return ro(r.base64);if("src"in r){const o=e.get(r.src);if(o)return o;{const s=new Image;return s.src=r.src,e.set(r.src,s),s}}else if("data"in r&&r.rr_type==="Blob"){const o=yield Promise.all(r.data.map(de(e,t,n)));return new Blob(o,{type:r.type})}}else if(Array.isArray(r))return yield Promise.all(r.map(de(e,t,n)));return r})}var ai=(e,t,n)=>new Promise((r,o)=>{var s=c=>{try{l(n.next(c))}catch(i){o(i)}},a=c=>{try{l(n.throw(c))}catch(i){o(i)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,a);l((n=n.apply(e,t)).next())});function li(e,t){try{return t===ce.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}const ci=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function ui(e,t){if(!(t!=null&&t.constructor))return;const{name:n}=t.constructor;if(!ci.includes(n))return;const r=Wn(e,n);r.includes(t)||r.push(t)}function di(e){return ai(this,arguments,function*({mutation:t,target:n,type:r,imageMap:o,errorHandler:s}){try{const a=li(n,r);if(!a)return;if(t.setter){a[t.property]=t.args[0];return}const l=a[t.property],c=yield Promise.all(t.args.map(de(o,a))),i=l.apply(a,c);ui(a,i)}catch(a){s(t,a)}})}var hi=(e,t,n)=>new Promise((r,o)=>{var s=c=>{try{l(n.next(c))}catch(i){o(i)}},a=c=>{try{l(n.throw(c))}catch(i){o(i)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,a);l((n=n.apply(e,t)).next())});function mi(e){return hi(this,arguments,function*({event:t,mutation:n,target:r,imageMap:o,errorHandler:s}){try{const a=r.getContext("2d");if(n.setter){a[n.property]=n.args[0];return}const l=a[n.property];if(n.property==="drawImage"&&typeof n.args[0]=="string"){const c=o.get(t);l.apply(a,n.args)}else{const c=yield Promise.all(n.args.map(de(o,a)));l.apply(a,c)}}catch(a){s(n,a)}})}var pi=(e,t,n)=>new Promise((r,o)=>{var s=c=>{try{l(n.next(c))}catch(i){o(i)}},a=c=>{try{l(n.throw(c))}catch(i){o(i)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,a);l((n=n.apply(e,t)).next())});function $n(e){return pi(this,arguments,function*({event:t,mutation:n,target:r,imageMap:o,canvasEventMap:s,errorHandler:a}){try{const l=s.get(t)||n,c="commands"in l?l.commands:[l];if([ce.WebGL,ce.WebGL2].includes(n.type)){for(let i=0;i<c.length;i++){const u=c[i];yield di({mutation:u,type:n.type,target:r,imageMap:o,errorHandler:a})}return}for(let i=0;i<c.length;i++){const u=c[i];yield mi({event:t,mutation:u,target:r,imageMap:o,errorHandler:a})}}catch(l){a(n,l)}})}var fi=Object.defineProperty,gi=Object.defineProperties,vi=Object.getOwnPropertyDescriptors,Vn=Object.getOwnPropertySymbols,yi=Object.prototype.hasOwnProperty,bi=Object.prototype.propertyIsEnumerable,Un=(e,t,n)=>t in e?fi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xe=(e,t)=>{for(var n in t||(t={}))yi.call(t,n)&&Un(e,n,t[n]);if(Vn)for(var n of Vn(t))bi.call(t,n)&&Un(e,n,t[n]);return e},ft=(e,t)=>gi(e,vi(t)),gt=(e,t,n)=>new Promise((r,o)=>{var s=c=>{try{l(n.next(c))}catch(i){o(i)}},a=c=>{try{l(n.throw(c))}catch(i){o(i)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,a);l((n=n.apply(e,t)).next())});const jn=10*1e3,Bn=2*1e3,Gn=1*1e3,zn=60*60*1e3,Si=Cn||Xo,vt="[replayer]",yt={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function bt(e){return e.type==w.IncrementalSnapshot&&(e.data.source==x.TouchMove||e.data.source==x.MouseInteraction&&e.data.type==G.TouchStart)}class Ti{constructor(t,n){if(this.usingVirtualDom=!1,this.virtualDom=new Ce,this.mouseTail=null,this.tailPositions=[],this.emitter=Si(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=Ot(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=Nt(),this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,!(n!=null&&n.liveMode)&&t.length<2)throw new Error("Replayer need at least 2 events.");const r={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"highlight-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:yt,useVirtualDom:!0,inactiveThreshold:.02,inactiveSkipTime:Bn};this.config=Object.assign({},r,n),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(O.Resize,this.handleResize),this.setupDom(),this.emitter.on(O.Flush,()=>{if(this.usingVirtualDom){const l={mirror:this.mirror,applyCanvas:(c,i,u)=>{$n({event:c,mutation:i,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this)};if(se(this.iframe.contentDocument,this.virtualDom,l,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const c in this.legacy_missingNodeRetryMap)try{const i=this.legacy_missingNodeRetryMap[c],u=ht(i.node,this.mirror,this.virtualDom.mirror);se(u,i.node,l,this.virtualDom.mirror),i.node=u}catch(i){this.config.showWarning&&console.warn(i)}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null}),this.emitter.on(O.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset()});const o=new Ko([],n?.speed||r.speed);this.service=ri({events:t.map(l=>n&&n.unpackFn?n.unpackFn(l):l).sort((l,c)=>l.timestamp-c.timestamp),timer:o,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(l=>{this.emitter.emit(O.StateChange,{player:l})}),this.speedService=oi({normalSpeed:-1,timer:o}),this.speedService.start(),this.speedService.subscribe(l=>{this.emitter.emit(O.StateChange,{speed:l})});const s=this.service.state.context.events.find(l=>l.type===w.Meta),a=this.service.state.context.events.find(l=>l.type===w.FullSnapshot);if(s){const{width:l,height:c}=s.data;setTimeout(()=>{this.emitter.emit(O.Resize,{width:l,height:c})},0)}a&&setTimeout(()=>{this.firstFullSnapshot||(this.firstFullSnapshot=a,this.rebuildFullSnapshot(a),this.iframe.contentWindow.scrollTo(a.data.initialOffset))},1),this.service.state.context.events.find(bt)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,n){return this.emitter.on(t,n),this}off(t,n){return this.emitter.off(t,n),this}setConfig(t){Object.keys(t).forEach(n=>{this.config[n]=t[n]}),this.config.skipInactive||this.backToNormal(),typeof t.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail<"u"&&(t.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getActivityIntervals(){if(this.activityIntervals.length==0){const t=[],n=this.getMetaData(),r=[{timestamp:n.startTime},...this.service.state.context.events.filter(a=>this.isUserInteraction(a)),{timestamp:n.endTime}];for(let a=1;a<r.length;a++){const l=r[a-1],c=r[a];c.timestamp-l.timestamp>jn?t.push({startTime:l.timestamp,endTime:c.timestamp,duration:c.timestamp-l.timestamp,active:!1}):t.push({startTime:l.timestamp,endTime:c.timestamp,duration:c.timestamp-l.timestamp,active:!0})}const o=[];let s=t[0];for(let a=1;a<t.length;a++)t[a].active!=t[a-1].active&&(o.push({startTime:s.startTime,endTime:t[a-1].endTime,duration:t[a-1].endTime-s.startTime,active:t[a-1].active}),s=t[a]);s&&t.length>0&&o.push({startTime:s.startTime,endTime:t[t.length-1].endTime,duration:t[t.length-1].endTime-s.startTime,active:t[t.length-1].active}),s=o[0];for(let a=1;a<o.length;a++)(!o[a].active&&o[a].duration>this.config.inactiveThreshold*n.totalTime||!o[a-1].active&&o[a-1].duration>this.config.inactiveThreshold*n.totalTime)&&(this.activityIntervals.push({startTime:s.startTime,endTime:o[a-1].endTime,duration:o[a-1].endTime-s.startTime,active:o[a-1].active}),s=o[a]);s&&o.length>0&&this.activityIntervals.push({startTime:s.startTime,endTime:o[o.length-1].endTime,duration:o[o.length-1].endTime-s.startTime,active:o[o.length-1].active})}return this.activityIntervals}getMetaData(){const t=this.service.state.context.events[0],n=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:n.timestamp,totalTime:n.timestamp-t.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:t,events:n}=this.service.state.context;return t-n[0].timestamp}getMirror(){return this.mirror}play(t=0){var n,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(r=(n=this.iframe.contentDocument)==null?void 0:n.getElementsByTagName("html")[0])==null||r.classList.remove("rrweb-paused"),this.emitter.emit(O.Start),this.handleInactivity(this.getMetaData().startTime+t,!0)}pause(t){var n,r;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(r=(n=this.iframe.contentDocument)==null?void 0:n.getElementsByTagName("html")[0])==null||r.classList.add("rrweb-paused"),this.emitter.emit(O.Pause)}resume(t=0){console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(t),this.emitter.emit(O.Resume)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const n=this.config.unpackFn?this.config.unpackFn(t):t;bt(n)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:n}}))}replaceEvents(t){for(const n of t)if(bt(n)){this.mouse.classList.add("touch-device");break}this.service.send({type:"REPLACE_EVENTS",payload:{events:t}})}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=Ot()}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&&(Zo(this.iframe.contentWindow,this.iframe.contentDocument),it(this.iframe.contentWindow))}handleResize(t){this.iframe.style.display="inherit";for(const n of[this.mouseTail,this.iframe])!n||(n.setAttribute("width",String(t.width)),n.setAttribute("height",String(t.height)))}applyEventsSynchronously(t){for(const n of t){switch(n.type){case w.DomContentLoaded:case w.Load:case w.Custom:continue;case w.FullSnapshot:case w.Meta:case w.Plugin:case w.IncrementalSnapshot:break}this.getCastFn(n,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null}getCastFn(t,n=!1){let r;switch(t.type){case w.DomContentLoaded:case w.Load:break;case w.Custom:r=()=>{this.emitter.emit(O.CustomEvent,t)};break;case w.Meta:r=()=>this.emitter.emit(O.Resize,{width:t.data.width,height:t.data.height});break;case w.FullSnapshot:r=()=>{if(this.firstFullSnapshot){if(this.firstFullSnapshot===t){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(t,n),this.iframe.contentWindow.scrollTo(t.data.initialOffset)};break;case w.IncrementalSnapshot:r=()=>{if(this.applyIncremental(t,n),!n&&(this.handleInactivity(t.timestamp),t===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const o of this.service.state.context.events)if(!(o.timestamp<=t.timestamp)&&this.isUserInteraction(o)){o.delay-t.delay>jn*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=o);break}if(this.nextUserInteractionEvent){const o=this.nextUserInteractionEvent.delay-t.delay,s={speed:Math.min(Math.round(o/Bn),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:s}),this.emitter.emit(O.SkipStart,s)}}};break}return()=>{r&&r();for(const s of this.config.plugins||[])s.handler(t,n,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:t}});const o=this.service.state.context.events.length-1;if(t===this.service.state.context.events[o]){const s=()=>{o<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(O.Finish))};t.type===w.IncrementalSnapshot&&t.data.source===x.MouseMove&&t.data.positions.length?setTimeout(()=>{s()},Math.max(0,-t.data.positions[0].timeOffset+50)):s()}this.emitter.emit(O.EventCast,t)}}handleInactivity(t,n){if((t===this.inactiveEndTimestamp||n)&&(this.inactiveEndTimestamp=null,this.backToNormal()),this.config.skipInactive&&!this.inactiveEndTimestamp){for(const r of this.getActivityIntervals())if(t>=r.startTime&&t<r.endTime&&!r.active){this.inactiveEndTimestamp=r.endTime;break}if(this.inactiveEndTimestamp){const r=this.inactiveEndTimestamp-t,o={speed:r/zn*this.config.inactiveSkipTime<Gn?r/Gn:Math.round(Math.max(r,zn)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:o}),this.emitter.emit(O.SkipStart,o)}}}rebuildFullSnapshot(t,n=!1){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const r=[];Mr(t.data.node,{doc:this.iframe.contentDocument,afterAppend:a=>{this.collectIframeAndAttachDocument(r,a)},cache:this.cache,mirror:this.mirror});for(const{mutationInQueue:a,builtNode:l}of r)this.attachDocumentToIframe(a,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==a);const{documentElement:o,head:s}=this.iframe.contentDocument;this.insertStyleRules(o,s),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(O.FullsnapshotRebuilded,t),n||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,n){const r=ii(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&r.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,wn(o,this.virtualDom.unserializedId)),t.insertBefore(o,n);for(let s=0;s<r.length;s++)o.rules.push({cssText:r[s],type:ie.Insert,index:s})}else{const o=document.createElement("style");t.insertBefore(o,n);for(let s=0;s<r.length;s++)o.sheet.insertRule(r[s],s)}}attachDocumentToIframe(t,n){const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,o=[];je(t.node,{doc:n.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:s=>{this.collectIframeAndAttachDocument(o,s);const a=r.getMeta(s);if(a?.type===R.Element&&a?.tagName.toUpperCase()==="HTML"){const{documentElement:l,head:c}=n.contentDocument;this.insertStyleRules(l,c)}},cache:this.cache});for(const{mutationInQueue:s,builtNode:a}of o)this.attachDocumentToIframe(s,a),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==s)}collectIframeAndAttachDocument(t,n){if(Ne(n,this.mirror)){const r=this.newDocumentQueue.find(o=>o.parentId===this.mirror.getId(n));r&&t.push({mutationInQueue:r,builtNode:n})}}waitForStylesheetLoad(){var t;const n=(t=this.iframe.contentDocument)==null?void 0:t.head;if(n){const r=new Set;let o,s=this.service.state;const a=()=>{s=this.service.state};this.emitter.on(O.Start,a),this.emitter.on(O.Pause,a);const l=()=>{this.emitter.off(O.Start,a),this.emitter.off(O.Pause,a)};n.querySelectorAll('link[rel="stylesheet"]').forEach(c=>{c.sheet||(r.add(c),c.addEventListener("load",()=>{r.delete(c),r.size===0&&o!==-1&&(s.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(O.LoadStylesheetEnd),o&&clearTimeout(o),l())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(O.LoadStylesheetStart),o=setTimeout(()=>{s.matches("playing")&&this.play(this.getCurrentTime()),o=-1,l()},this.config.loadTimeout))}}hasImageArg(t){for(const n of t)if(!(!n||typeof n!="object")){if("rr_type"in n&&"args"in n){if(this.hasImageArg(n.args))return!0}else if("rr_type"in n&&n.rr_type==="HTMLImageElement"||n instanceof Array&&this.hasImageArg(n))return!0}return!1}getImageArgs(t){const n=[];for(const r of t)!r||typeof r!="object"||("rr_type"in r&&"args"in r?n.push(...this.getImageArgs(r.args)):"rr_type"in r&&r.rr_type==="HTMLImageElement"?n.push(r.src):r instanceof Array&&n.push(...this.getImageArgs(r)));return n}preloadAllImages(){return gt(this,null,function*(){this.service.state;const t=()=>{this.service.state};this.emitter.on(O.Start,t),this.emitter.on(O.Pause,t);const n=[];for(const r of this.service.state.context.events)r.type===w.IncrementalSnapshot&&r.data.source===x.CanvasMutation&&(n.push(this.deserializeAndPreloadCanvasEvents(r.data,r)),("commands"in r.data?r.data.commands:[r.data]).forEach(o=>{this.preloadImages(o,r)}));return Promise.all(n)})}preloadImages(t,n){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(n)){const r=document.createElement("canvas"),o=r.getContext("2d"),s=o?.createImageData(r.width,r.height);s?.data,JSON.parse(t.args[0]),o?.putImageData(s,0,0)}}deserializeAndPreloadCanvasEvents(t,n){return gt(this,null,function*(){if(!this.canvasEventMap.has(n)){const r={isUnchanged:!0};if("commands"in t){const o=yield Promise.all(t.commands.map(s=>gt(this,null,function*(){const a=yield Promise.all(s.args.map(de(this.imageMap,null,r)));return ft(xe({},s),{args:a})})));r.isUnchanged===!1&&this.canvasEventMap.set(n,ft(xe({},t),{commands:o}))}else{const o=yield Promise.all(t.args.map(de(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(n,ft(xe({},t),{args:o}))}}})}applyIncremental(t,n){var r,o,s,a,l,c;const{data:i}=t;switch(i.source){case x.Mutation:{try{this.applyMutation(i,n)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,i)}break}case x.Drag:case x.TouchMove:case x.MouseMove:if(n){const u=i.positions[i.positions.length-1];this.mousePos={x:u.x,y:u.y,id:u.id,debugData:i}}else i.positions.forEach(u=>{const d={doAction:()=>{this.moveAndHover(u.x,u.y,u.id,n,i)},delay:u.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(d)}),this.timer.addAction({doAction(){},delay:t.delay-((r=i.positions[0])==null?void 0:r.timeOffset)});break;case x.MouseInteraction:{if(i.id===-1||n)break;const u=new Event(G[i.type].toLowerCase()),d=this.mirror.getNode(i.id);if(!d)return this.debugNodeNotFound(i,i.id);this.emitter.emit(O.MouseInteraction,{type:i.type,target:d});const{triggerFocus:m}=this.config;switch(i.type){case G.Blur:"blur"in d&&d.blur();break;case G.Focus:m&&d.focus&&d.focus({preventScroll:!0});break;case G.Click:case G.TouchStart:case G.TouchEnd:n?(i.type===G.TouchStart?this.touchActive=!0:i.type===G.TouchEnd&&(this.touchActive=!1),this.mousePos={x:i.x,y:i.y,id:i.id,debugData:i}):(i.type===G.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(i.x,i.y,i.id,n,i),i.type===G.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):i.type===G.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):i.type===G.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case G.TouchCancel:n?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:d.dispatchEvent(u)}break}case x.Scroll:{if(i.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);u.scrollData=i;break}this.applyScroll(i,n);break}case x.ViewportResize:this.emitter.emit(O.Resize,{width:i.width,height:i.height});break;case x.Input:{if(i.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);u.inputData=i;break}this.applyInput(i);break}case x.MediaInteraction:{const u=this.usingVirtualDom?this.virtualDom.mirror.getNode(i.id):this.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u;try{i.currentTime&&(d.currentTime=i.currentTime),i.volume&&(d.volume=i.volume),i.muted&&(d.muted=i.muted),i.type===me.Pause&&d.pause(),i.type===me.Play&&d.play()}catch(m){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${m.message||m}`)}break}case x.StyleSheetRule:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u.rules;(o=i.adds)==null||o.forEach(({rule:m,index:h})=>d?.push({cssText:m,index:h,type:ie.Insert})),(s=i.removes)==null||s.forEach(({index:m})=>d?.push({index:m,type:ie.Remove}))}else{const u=this.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u.sheet;(a=i.adds)==null||a.forEach(({rule:m,index:h})=>{try{if(Array.isArray(h)){const{positions:f,index:g}=lt(h);Ee(d.cssRules,f).insertRule(m,g)}else{const f=h===void 0?void 0:Math.min(h,d.cssRules.length);d.insertRule(m,f)}}catch{}}),(l=i.removes)==null||l.forEach(({index:m})=>{try{if(Array.isArray(m)){const{positions:h,index:f}=lt(m);Ee(d.cssRules,h).deleteRule(f||0)}else d?.deleteRule(m)}catch{}})}break}case x.StyleDeclaration:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u.rules;i.set&&d.push(xe({type:ie.SetProperty,index:i.index},i.set)),i.remove&&d.push(xe({type:ie.RemoveProperty,index:i.index},i.remove))}else{const u=this.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u.sheet;i.set&&Ee(d.rules,i.index).style.setProperty(i.set.property,i.set.value,i.set.priority),i.remove&&Ee(d.rules,i.index).style.removeProperty(i.remove.property)}break}case x.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);u.canvasMutations.push({event:t,mutation:i})}else{const u=this.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);$n({event:t,mutation:i,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case x.Font:{try{const u=new FontFace(i.family,i.buffer?new Uint8Array(JSON.parse(i.fontSource)):i.fontSource,i.descriptors);(c=this.iframe.contentDocument)==null||c.fonts.add(u)}catch(u){this.config.showWarning&&console.warn(u)}break}}}applyMutation(t,n){if(this.config.useVirtualDom&&!this.usingVirtualDom&&n&&(this.usingVirtualDom=!0,zo(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const i in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[i],d=En(u.node,this.virtualDom,this.mirror);d&&(u.node=d)}catch(u){this.config.showWarning&&console.warn(u)}const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes.forEach(i=>{var u;const d=r.getNode(i.id);if(!d)return t.removes.find(h=>h.id===i.parentId)?void 0:this.warnNodeNotFound(t,i.id);let m=r.getNode(i.parentId);if(!m)return this.warnNodeNotFound(t,i.parentId);if(i.isShadow&&Ae(m)&&(m=m.shadowRoot),r.removeNodeFromMap(d),m)try{m.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&m.nodeName==="STYLE"&&((u=m.rules)==null?void 0:u.length)>0&&(m.rules=[])}catch(h){if(h instanceof DOMException)this.warn("parent could not remove child in mutation",m,d,t);else throw h}});const o=xe({},this.legacy_missingNodeRetryMap),s=[],a=i=>{let u=null;return i.nextId&&(u=r.getNode(i.nextId)),i.nextId!==null&&i.nextId!==void 0&&i.nextId!==-1&&!u},l=i=>{var u;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let d=r.getNode(i.parentId);if(!d)return i.node.type===R.Document?this.newDocumentQueue.push(i):s.push(i);i.node.isShadow&&(Ae(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let m=null,h=null;if(i.previousId&&(m=r.getNode(i.previousId)),i.nextId&&(h=r.getNode(i.nextId)),a(i))return s.push(i);if(i.node.rootId&&!r.getNode(i.node.rootId))return;const f=i.node.rootId?r.getNode(i.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Ne(d,r)){this.attachDocumentToIframe(i,d);return}const g=je(i.node,{doc:f,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache});if(i.previousId===-1||i.nextId===-1){o[i.node.id]={node:g,mutation:i};return}const N=r.getMeta(d);if(N&&N.type===R.Element&&N.tagName==="textarea"&&i.node.type===R.Text){const p=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const S of p)S.nodeType===d.TEXT_NODE&&d.removeChild(S)}if(m&&m.nextSibling&&m.nextSibling.parentNode)d.insertBefore(g,m.nextSibling);else if(h&&h.parentNode)d.contains(h)?d.insertBefore(g,h):d.insertBefore(g,null);else{if(d===f)for(;f.firstChild;)f.removeChild(f.firstChild);d.appendChild(g)}if(this.usingVirtualDom&&g.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[]),Ne(g,this.mirror)){const p=this.mirror.getId(g),S=this.newDocumentQueue.find(y=>y.parentId===p);S&&(this.attachDocumentToIframe(S,g),this.newDocumentQueue=this.newDocumentQueue.filter(y=>y!==S))}(i.previousId||i.nextId)&&this.legacy_resolveMissingNode(o,d,g,i)};t.adds.forEach(i=>{l(i)});const c=Date.now();for(;s.length;){const i=Pt(s);if(s.length=0,Date.now()-c>500){this.warn("Timeout in the loop, please check the resolve tree data:",i);break}for(const u of i)r.getNode(u.value.parentId)?st(u,d=>{l(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(o).length&&Object.assign(this.legacy_missingNodeRetryMap,o),Ft(t.texts).forEach(i=>{var u;const d=r.getNode(i.id);if(!d)return t.removes.find(m=>m.id===i.id)?void 0:this.warnNodeNotFound(t,i.id);if(d.textContent=i.value,this.usingVirtualDom){const m=d.parentNode;((u=m?.rules)==null?void 0:u.length)>0&&(m.rules=[])}}),t.attributes.forEach(i=>{const u=r.getNode(i.id);if(!u)return t.removes.find(d=>d.id===i.id)?void 0:this.warnNodeNotFound(t,i.id);for(const d in i.attributes)if(typeof d=="string"){const m=i.attributes[d];if(m===null)u.removeAttribute(d);else if(typeof m=="string")try{u.setAttribute(d,m)}catch(h){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",h)}else if(d==="style"){const h=m,f=u;for(const g in h)if(h[g]===!1)f.style.removeProperty(g);else if(h[g]instanceof Array){const N=h[g];f.style.setProperty(g,N[0],N[1])}else{const N=h[g];f.style.setProperty(g,N)}}}})}applyScroll(t,n){const r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);const o=this.mirror.getMeta(r);if(r===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:t.y,left:t.x,behavior:n?"auto":"smooth"});else if(o?.type===R.Document)r.defaultView.scrollTo({top:t.y,left:t.x,behavior:n?"auto":"smooth"});else try{r.scrollTop=t.y,r.scrollLeft=t.x}catch{}}applyInput(t){const n=this.mirror.getNode(t.id);if(!n)return this.debugNodeNotFound(t,t.id);try{n.checked=t.isChecked,n.value=t.text}catch{}}legacy_resolveMissingNode(t,n,r,o){const{previousId:s,nextId:a}=o,l=s&&t[s],c=a&&t[a];if(l){const{node:i,mutation:u}=l;n.insertBefore(i,r),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,n,i,u)}if(c){const{node:i,mutation:u}=c;n.insertBefore(i,r.nextSibling),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,n,i,u)}}moveAndHover(t,n,r,o,s){const a=this.mirror.getNode(r);if(!a)return this.debugNodeNotFound(s,r);const l=at(a,this.iframe),c=t*l.absoluteScale+l.x,i=n*l.absoluteScale+l.y;this.mouse.style.left=`${c}px`,this.mouse.style.top=`${i}px`,o||this.drawMouseTail({x:c,y:i}),this.hoverElements(a)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:n,lineWidth:r,strokeStyle:o,duration:s}=this.config.mouseTail===!0?yt:Object.assign({},yt,this.config.mouseTail),a=()=>{if(!this.mouseTail)return;const l=this.mouseTail.getContext("2d");!l||!this.tailPositions.length||(l.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),l.beginPath(),l.lineWidth=r,l.lineCap=n,l.strokeStyle=o,l.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(c=>l.lineTo(c.x,c.y)),l.stroke())};this.tailPositions.push(t),a(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(l=>l!==t),a()},s/this.speedService.state.context.timer.speed)}hoverElements(t){var n;(n=this.iframe.contentDocument)==null||n.querySelectorAll(".\\:hover").forEach(o=>{o.classList.remove(":hover")});let r=t;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(t){return t.type!==w.IncrementalSnapshot?!1:t.data.source>x.Mutation&&t.data.source<=x.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(O.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,n){this.warn(`Node with id '${n}' not found. `,t)}warnCanvasMutationFailed(t,n){this.warn("Has error on canvas update",n,"canvas mutation:",t)}debugNodeNotFound(t,n){this.debug(vt,`Node with id '${n}' not found. `,t)}warn(...t){!this.config.showWarning||console.warn(vt,...t)}debug(...t){!this.config.showDebug||console.log(vt,...t)}}const{addCustomEvent:Ni}=fe,{freezePage:Ei}=fe;return J.EventType=w,J.IncrementalSource=x,J.MouseInteractions=G,J.Replayer=Ti,J.ReplayerEvents=O,J.addCustomEvent=Ni,J.freezePage=Ei,J.record=fe,J.utils=kr,Object.defineProperty(J,"__esModule",{value:!0}),J}({});
10
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
15
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16
+ PERFORMANCE OF THIS SOFTWARE.
17
+ ***************************************************************************** */function Xt(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o,s,r=n.call(t),l=[];try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)l.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return l}var ce;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(ce||(ce={}));var Zt={type:"xstate.init"};function Xe(t){return t===void 0?[]:[].concat(t)}function ee(t){return{type:"xstate.assign",assignment:t}}function Kt(t,e){return typeof(t=typeof t=="string"&&e&&e[t]?e[t]:t)=="string"?{type:t}:typeof t=="function"?{type:t.name,exec:t}:t}function Oe(t){return function(e){return t===e}}function Qt(t){return typeof t=="string"?{type:t}:t}function Jt(t,e){return{value:t,context:e,actions:[],changed:!1,matches:Oe(t)}}function qt(t,e,n){var o=e,s=!1;return[t.filter(function(r){if(r.type==="xstate.assign"){s=!0;var l=Object.assign({},o);return typeof r.assignment=="function"?l=r.assignment(o,n):Object.keys(r.assignment).forEach(function(a){l[a]=typeof r.assignment[a]=="function"?r.assignment[a](o,n):r.assignment[a]}),o=l,!1}return!0}),o,s]}function en(t,e){e===void 0&&(e={});var n=Xt(qt(Xe(t.states[t.initial].entry).map(function(l){return Kt(l,e.actions)}),t.context,Zt),2),o=n[0],s=n[1],r={config:t,_options:e,initialState:{value:t.initial,actions:o,context:s,matches:Oe(t.initial)},transition:function(l,a){var c,i,u=typeof l=="string"?{value:l,context:t.context}:l,d=u.value,h=u.context,m=Qt(a),f=t.states[d];if(f.on){var y=Xe(f.on[m.type]);try{for(var g=function(M){var H=typeof Symbol=="function"&&Symbol.iterator,te=H&&M[H],Ie=0;if(te)return te.call(M);if(M&&typeof M.length=="number")return{next:function(){return M&&Ie>=M.length&&(M=void 0),{value:M&&M[Ie++],done:!M}}};throw new TypeError(H?"Object is not iterable.":"Symbol.iterator is not defined.")}(y),p=g.next();!p.done;p=g.next()){var b=p.value;if(b===void 0)return Jt(d,h);var T=typeof b=="string"?{target:b}:b,I=T.target,A=T.actions,P=A===void 0?[]:A,z=T.cond,Te=z===void 0?function(){return!0}:z,Ee=I===void 0,Se=I??d,Ce=t.states[Se];if(Te(h,m)){var de=Xt(qt((Ee?Xe(P):[].concat(f.exit,P,Ce.entry).filter(function(M){return M})).map(function(M){return Kt(M,r._options.actions)}),h,m),3),he=de[0],et=de[1],me=de[2],we=I??d;return{value:we,context:et,actions:he,changed:I!==d||he.length>0||me,matches:Oe(we)}}}}catch(M){c={error:M}}finally{try{p&&!p.done&&(i=g.return)&&i.call(g)}finally{if(c)throw c.error}}}return Jt(d,h)}};return r}var tn=function(t,e){return t.actions.forEach(function(n){var o=n.exec;return o&&o(t.context,e)})};function nn(t){var e=t.initialState,n=ce.NotStarted,o=new Set,s={_machine:t,send:function(r){n===ce.Running&&(e=t.transition(e,r),tn(e,Qt(r)),o.forEach(function(l){return l(e)}))},subscribe:function(r){return o.add(r),r(e),{unsubscribe:function(){return o.delete(r)}}},start:function(r){if(r){var l=typeof r=="object"?r:{context:t.config.context,value:r};e={value:l.value,actions:[],context:l.context,matches:Oe(l.value)}}return n=ce.Running,tn(e,Zt),s},stop:function(){return n=ce.Stopped,o.clear(),s},get state(){return e},get status(){return n}};return s}var _o=Object.defineProperty,Fo=Object.defineProperties,Wo=Object.getOwnPropertyDescriptors,on=Object.getOwnPropertySymbols,Vo=Object.prototype.hasOwnProperty,$o=Object.prototype.propertyIsEnumerable,sn=(t,e,n)=>e in t?_o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ke=(t,e)=>{for(var n in e||(e={}))Vo.call(e,n)&&sn(t,n,e[n]);if(on)for(var n of on(e))$o.call(e,n)&&sn(t,n,e[n]);return t},Ae=(t,e)=>Fo(t,Wo(e));function jo(t,e){for(let n=t.length-1;n>=0;n--){const o=t[n];if(o.type===N.Meta&&o.timestamp<=e)return t.slice(n)}return t}function Go(t,{getCastFn:e,applyEventsSynchronously:n,emitter:o}){const s=en({id:"player",context:t,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:ee({lastPlayedEvent:(r,l)=>l.type==="CAST_EVENT"?l.payload.event:r.lastPlayedEvent}),recordTimeOffset:ee((r,l)=>{let a=r.timeOffset;return"payload"in l&&"timeOffset"in l.payload&&(a=l.payload.timeOffset),Ae(ke({},r),{timeOffset:a,baselineTime:r.events[0].timestamp+a})}),play(r){var l;const{timer:a,events:c,baselineTime:i,lastPlayedEvent:u}=r;a.clear();for(const y of c)He(y,i);const d=jo(c,i);let h=u?.timestamp;u?.type===N.IncrementalSnapshot&&u.data.source===E.MouseMove&&(h=u.timestamp+((l=u.data.positions[0])==null?void 0:l.timeOffset)),i<(h||0)&&o.emit(C.PlayBack);const m=new Array,f=new Array;for(const y of d)if(!(h&&h<i&&(y.timestamp<=h||y===u)))if(y.timestamp<i)m.push(y);else{const g=e(y,!1);f.push({doAction:()=>{g()},delay:y.delay})}n(m),o.emit(C.Flush),a.addActions(f),a.start()},pause(r){r.timer.clear()},resetLastPlayedEvent:ee(r=>Ae(ke({},r),{lastPlayedEvent:null})),startLive:ee({baselineTime:(r,l)=>(r.timer.toggleLiveMode(!0),r.timer.start(),l.type==="TO_LIVE"&&l.payload.baselineTime?l.payload.baselineTime:Date.now())}),replaceEvents:ee((r,l)=>{const{events:a,timer:c,baselineTime:i}=r;if(l.type==="REPLACE_EVENTS"){const{events:u}=l.payload;a.length=0;const d=[];for(const h of u)if(He(h,i),a.push(h),h.timestamp>=c.timeOffset+i){const m=e(h,!1);d.push({doAction:()=>{m()},delay:h.delay})}c.isActive()&&c.replaceActions(d)}return Ae(ke({},r),{events:a})}),addEvent:ee((r,l)=>{const{baselineTime:a,timer:c,events:i}=r;if(l.type==="ADD_EVENT"){const{event:u}=l.payload;He(u,a);let d=i.length-1;if(!i[d]||i[d].timestamp<=u.timestamp)i.push(u);else{let f=-1,y=0;for(;y<=d;){const g=Math.floor((y+d)/2);i[g].timestamp<=u.timestamp?y=g+1:d=g-1}f===-1&&(f=y),i.splice(f,0,u)}const h=u.timestamp<a,m=e(u,h);h?m():c.isActive()&&c.addAction({doAction:()=>{m()},delay:u.delay})}return Ae(ke({},r),{events:i})})}});return nn(s)}function Bo(t){const e=en({id:"speed",context:t,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(n,o)=>{"payload"in o&&n.timer.setSpeed(o.payload.speed)},recordSpeed:ee({normalSpeed:n=>n.timer.speed}),restoreSpeed:n=>{n.timer.setSpeed(n.normalSpeed)}}});return nn(e)}const zo=t=>[`.${t} { background: currentColor }`,"noscript { display: none !important; }",`.${t} { background: currentColor; border-radius: 5px; }`,`.${t}:hover::after {content: 'Redacted'; color: white; background: black; text-align: center; width: 100%; display: block;}`];var Uo=(t,e,n)=>new Promise((o,s)=>{var r=c=>{try{a(n.next(c))}catch(i){s(i)}},l=c=>{try{a(n.throw(c))}catch(i){s(i)}},a=c=>c.done?o(c.value):Promise.resolve(c.value).then(r,l);a((n=n.apply(t,e)).next())});const rn=new Map;function an(t,e){let n=rn.get(t);return n||(n=new Map,rn.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}function X(t,e,n){return o=>Uo(this,null,function*(){if(o&&typeof o=="object"&&"rr_type"in o)if(n&&(n.isUnchanged=!1),o.rr_type==="ImageBitmap"&&"args"in o){const s=yield X(t,e,n)(o.args);return yield createImageBitmap.apply(null,s)}else if("index"in o){if(n||e===null)return o;const{rr_type:s,index:r}=o;return an(e,s)[r]}else if("args"in o){const{rr_type:s,args:r}=o,l=window[s];return new l(...yield Promise.all(r.map(X(t,e,n))))}else{if("base64"in o)return zn(o.base64);if("src"in o){const s=t.get(o.src);if(s)return s;{const r=new Image;return r.src=o.src,t.set(o.src,r),r}}else if("data"in o&&o.rr_type==="Blob"){const s=yield Promise.all(o.data.map(X(t,e,n)));return new Blob(s,{type:o.type})}}else if(Array.isArray(o))return yield Promise.all(o.map(X(t,e,n)));return o})}var Yo=(t,e,n)=>new Promise((o,s)=>{var r=c=>{try{a(n.next(c))}catch(i){s(i)}},l=c=>{try{a(n.throw(c))}catch(i){s(i)}},a=c=>c.done?o(c.value):Promise.resolve(c.value).then(r,l);a((n=n.apply(t,e)).next())});function Ho(t,e){try{return e===Y.WebGL?t.getContext("webgl")||t.getContext("experimental-webgl"):t.getContext("webgl2")}catch{return null}}const Xo=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Zo(t,e){if(!(e!=null&&e.constructor))return;const{name:n}=e.constructor;if(!Xo.includes(n))return;const o=an(t,n);o.includes(e)||o.push(e)}function Ko(t){return Yo(this,arguments,function*({mutation:e,target:n,type:o,imageMap:s,errorHandler:r}){try{const l=Ho(n,o);if(!l)return;if(e.setter){l[e.property]=e.args[0];return}const a=l[e.property],c=yield Promise.all(e.args.map(X(s,l))),i=a.apply(l,c);Zo(l,i)}catch(l){r(e,l)}})}var Qo=(t,e,n)=>new Promise((o,s)=>{var r=c=>{try{a(n.next(c))}catch(i){s(i)}},l=c=>{try{a(n.throw(c))}catch(i){s(i)}},a=c=>c.done?o(c.value):Promise.resolve(c.value).then(r,l);a((n=n.apply(t,e)).next())});function Jo(t){return Qo(this,arguments,function*({event:e,mutation:n,target:o,imageMap:s,errorHandler:r}){try{const l=o.getContext("2d");if(n.setter){l[n.property]=n.args[0];return}const a=l[n.property];if(n.property==="drawImage"&&typeof n.args[0]=="string"){const c=s.get(e);a.apply(l,n.args)}else{const c=yield Promise.all(n.args.map(X(s,l)));a.apply(l,c)}}catch(l){r(n,l)}})}var qo=(t,e,n)=>new Promise((o,s)=>{var r=c=>{try{a(n.next(c))}catch(i){s(i)}},l=c=>{try{a(n.throw(c))}catch(i){s(i)}},a=c=>c.done?o(c.value):Promise.resolve(c.value).then(r,l);a((n=n.apply(t,e)).next())});function ln(t){return qo(this,arguments,function*({event:e,mutation:n,target:o,imageMap:s,canvasEventMap:r,errorHandler:l}){try{const a=r.get(e)||n,c="commands"in a?a.commands:[a];if([Y.WebGL,Y.WebGL2].includes(n.type)){for(let i=0;i<c.length;i++){const u=c[i];yield Ko({mutation:u,type:n.type,target:o,imageMap:s,errorHandler:l})}return}for(let i=0;i<c.length;i++){const u=c[i];yield Jo({event:e,mutation:u,target:o,imageMap:s,errorHandler:l})}}catch(a){l(n,a)}})}var es=Object.defineProperty,ts=Object.defineProperties,ns=Object.getOwnPropertyDescriptors,cn=Object.getOwnPropertySymbols,os=Object.prototype.hasOwnProperty,ss=Object.prototype.propertyIsEnumerable,un=(t,e,n)=>e in t?es(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ue=(t,e)=>{for(var n in e||(e={}))os.call(e,n)&&un(t,n,e[n]);if(cn)for(var n of cn(e))ss.call(e,n)&&un(t,n,e[n]);return t},Ze=(t,e)=>ts(t,ns(e)),Ke=(t,e,n)=>new Promise((o,s)=>{var r=c=>{try{a(n.next(c))}catch(i){s(i)}},l=c=>{try{a(n.throw(c))}catch(i){s(i)}},a=c=>c.done?o(c.value):Promise.resolve(c.value).then(r,l);a((n=n.apply(t,e)).next())});const dn=10*1e3,hn=2*1e3,mn=1*1e3,pn=60*60*1e3,is=Ht||Ao,Qe="[replayer]",Je={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function qe(t){return t.type==N.IncrementalSnapshot&&(t.data.source==E.TouchMove||t.data.source==E.MouseInteraction&&t.data.type==O.TouchStart)}class rs{constructor(e,n){if(this.usingVirtualDom=!1,this.virtualDom=new le,this.mouseTail=null,this.tailPositions=[],this.emitter=is(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=v.createCache(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=v.createMirror(),this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,!(n!=null&&n.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const o={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:Je,useVirtualDom:!0,inactiveThreshold:.02,inactiveSkipTime:hn};this.config=Object.assign({},o,n),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(C.Resize,this.handleResize),this.setupDom(),this.emitter.on(C.Flush,()=>{if(this.usingVirtualDom){const a={mirror:this.mirror,applyCanvas:(c,i,u)=>{ln({event:c,mutation:i,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this)};if(B(this.iframe.contentDocument,this.virtualDom,a,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const c in this.legacy_missingNodeRetryMap)try{const i=this.legacy_missingNodeRetryMap[c],u=Ye(i.node,this.mirror,this.virtualDom.mirror);B(u,i.node,a,this.virtualDom.mirror),i.node=u}catch(i){this.config.showWarning&&console.warn(i)}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null}),this.emitter.on(C.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset()});const s=new Po([],n?.speed||o.speed);this.service=Go({events:e.map(a=>n&&n.unpackFn?n.unpackFn(a):a).sort((a,c)=>a.timestamp-c.timestamp),timer:s,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(a=>{this.emitter.emit(C.StateChange,{player:a})}),this.speedService=Bo({normalSpeed:-1,timer:s}),this.speedService.start(),this.speedService.subscribe(a=>{this.emitter.emit(C.StateChange,{speed:a})});const r=this.service.state.context.events.find(a=>a.type===N.Meta),l=this.service.state.context.events.find(a=>a.type===N.FullSnapshot);if(r){const{width:a,height:c}=r.data;setTimeout(()=>{this.emitter.emit(C.Resize,{width:a,height:c})},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(qe)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,n){return this.emitter.on(e,n),this}off(e,n){return this.emitter.off(e,n),this}setConfig(e){Object.keys(e).forEach(n=>{this.config[n]=e[n]}),this.config.skipInactive||this.backToNormal(),typeof e.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail<"u"&&(e.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 e=[],n=this.getMetaData(),o=[{timestamp:n.startTime},...this.service.state.context.events.filter(l=>this.isUserInteraction(l)),{timestamp:n.endTime}];for(let l=1;l<o.length;l++){const a=o[l-1],c=o[l];c.timestamp-a.timestamp>dn?e.push({startTime:a.timestamp,endTime:c.timestamp,duration:c.timestamp-a.timestamp,active:!1}):e.push({startTime:a.timestamp,endTime:c.timestamp,duration:c.timestamp-a.timestamp,active:!0})}const s=[];let r=e[0];for(let l=1;l<e.length;l++)e[l].active!=e[l-1].active&&(s.push({startTime:r.startTime,endTime:e[l-1].endTime,duration:e[l-1].endTime-r.startTime,active:e[l-1].active}),r=e[l]);r&&e.length>0&&s.push({startTime:r.startTime,endTime:e[e.length-1].endTime,duration:e[e.length-1].endTime-r.startTime,active:e[e.length-1].active}),r=s[0];for(let l=1;l<s.length;l++)(!s[l].active&&s[l].duration>this.config.inactiveThreshold*n.totalTime||!s[l-1].active&&s[l-1].duration>this.config.inactiveThreshold*n.totalTime)&&(this.activityIntervals.push({startTime:r.startTime,endTime:s[l-1].endTime,duration:s[l-1].endTime-r.startTime,active:s[l-1].active}),r=s[l]);r&&s.length>0&&this.activityIntervals.push({startTime:r.startTime,endTime:s[s.length-1].endTime,duration:s[s.length-1].endTime-r.startTime,active:s[s.length-1].active})}return this.activityIntervals}getMetaData(){const e=this.service.state.context.events[0],n=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:n.timestamp,totalTime:n.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:n}=this.service.state.context;return e-n[0].timestamp}getMirror(){return this.mirror}play(e=0){var n,o;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(o=(n=this.iframe.contentDocument)==null?void 0:n.getElementsByTagName("html")[0])==null||o.classList.remove("rrweb-paused"),this.emitter.emit(C.Start),this.handleInactivity(this.getMetaData().startTime+e,!0)}pause(e){var n,o;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(o=(n=this.iframe.contentDocument)==null?void 0:n.getElementsByTagName("html")[0])==null||o.classList.add("rrweb-paused"),this.emitter.emit(C.Pause)}resume(e=0){console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(C.Resume)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const n=this.config.unpackFn?this.config.unpackFn(e):e;qe(n)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:n}}))}replaceEvents(e){for(const n of e)if(qe(n)){this.mouse.classList.add("touch-device");break}this.service.send({type:"REPLACE_EVENTS",payload:{events:e}})}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=v.createCache()}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 e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(Lo(this.iframe.contentWindow,this.iframe.contentDocument),We(this.iframe.contentWindow))}handleResize(e){this.iframe.style.display="inherit";for(const n of[this.mouseTail,this.iframe])!n||(n.setAttribute("width",String(e.width)),n.setAttribute("height",String(e.height)))}applyEventsSynchronously(e){for(const n of e){switch(n.type){case N.DomContentLoaded:case N.Load:case N.Custom:continue;case N.FullSnapshot:case N.Meta:case N.Plugin:case N.IncrementalSnapshot:break}this.getCastFn(n,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null}getCastFn(e,n=!1){let o;switch(e.type){case N.DomContentLoaded:case N.Load:break;case N.Custom:o=()=>{this.emitter.emit(C.CustomEvent,e)};break;case N.Meta:o=()=>this.emitter.emit(C.Resize,{width:e.data.width,height:e.data.height});break;case N.FullSnapshot:o=()=>{if(this.firstFullSnapshot){if(this.firstFullSnapshot===e){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(e,n),this.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case N.IncrementalSnapshot:o=()=>{if(this.applyIncremental(e,n),!n&&(this.handleInactivity(e.timestamp),e===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const s of this.service.state.context.events)if(!(s.timestamp<=e.timestamp)&&this.isUserInteraction(s)){s.delay-e.delay>dn*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=s);break}if(this.nextUserInteractionEvent){const s=this.nextUserInteractionEvent.delay-e.delay,r={speed:Math.min(Math.round(s/hn),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:r}),this.emitter.emit(C.SkipStart,r)}}};break}return()=>{o&&o();for(const r of this.config.plugins||[])r.handler(e,n,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:e}});const s=this.service.state.context.events.length-1;if(e===this.service.state.context.events[s]){const r=()=>{s<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(C.Finish))};e.type===N.IncrementalSnapshot&&e.data.source===E.MouseMove&&e.data.positions.length?setTimeout(()=>{r()},Math.max(0,-e.data.positions[0].timeOffset+50)):r()}this.emitter.emit(C.EventCast,e)}}handleInactivity(e,n){if((e===this.inactiveEndTimestamp||n)&&(this.inactiveEndTimestamp=null,this.backToNormal()),this.config.skipInactive&&!this.inactiveEndTimestamp){for(const o of this.getActivityIntervals())if(e>=o.startTime&&e<o.endTime&&!o.active){this.inactiveEndTimestamp=o.endTime;break}if(this.inactiveEndTimestamp){const o=this.inactiveEndTimestamp-e,s={speed:o/pn*this.config.inactiveSkipTime<mn?o/mn:Math.round(Math.max(o,pn)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:s}),this.emitter.emit(C.SkipStart,s)}}}rebuildFullSnapshot(e,n=!1){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const o=[];v.rebuild(e.data.node,{doc:this.iframe.contentDocument,afterAppend:l=>{this.collectIframeAndAttachDocument(o,l)},cache:this.cache,mirror:this.mirror});for(const{mutationInQueue:l,builtNode:a}of o)this.attachDocumentToIframe(l,a),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==l);const{documentElement:s,head:r}=this.iframe.contentDocument;this.insertStyleRules(s,r),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(C.FullsnapshotRebuilded,e),n||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,n){const o=zo(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&o.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const s=this.virtualDom.createElement("style");this.virtualDom.mirror.add(s,Yt(s,this.virtualDom.unserializedId)),e.insertBefore(s,n);for(let r=0;r<o.length;r++)s.rules.push({cssText:o[r],type:j.Insert,index:r})}else{const s=document.createElement("style");e.insertBefore(s,n);for(let r=0;r<o.length;r++)s.sheet.insertRule(o[r],r)}}attachDocumentToIframe(e,n){const o=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,s=[];v.buildNodeWithSN(e.node,{doc:n.contentDocument,mirror:o,hackCss:!0,skipChild:!1,afterAppend:r=>{this.collectIframeAndAttachDocument(s,r);const l=o.getMeta(r);if(l?.type===v.NodeType.Element&&l?.tagName.toUpperCase()==="HTML"){const{documentElement:a,head:c}=n.contentDocument;this.insertStyleRules(a,c)}},cache:this.cache});for(const{mutationInQueue:r,builtNode:l}of s)this.attachDocumentToIframe(r,l),this.newDocumentQueue=this.newDocumentQueue.filter(a=>a!==r)}collectIframeAndAttachDocument(e,n){if(ie(n,this.mirror)){const o=this.newDocumentQueue.find(s=>s.parentId===this.mirror.getId(n));o&&e.push({mutationInQueue:o,builtNode:n})}}waitForStylesheetLoad(){var e;const n=(e=this.iframe.contentDocument)==null?void 0:e.head;if(n){const o=new Set;let s,r=this.service.state;const l=()=>{r=this.service.state};this.emitter.on(C.Start,l),this.emitter.on(C.Pause,l);const a=()=>{this.emitter.off(C.Start,l),this.emitter.off(C.Pause,l)};n.querySelectorAll('link[rel="stylesheet"]').forEach(c=>{c.sheet||(o.add(c),c.addEventListener("load",()=>{o.delete(c),o.size===0&&s!==-1&&(r.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(C.LoadStylesheetEnd),s&&clearTimeout(s),a())}))}),o.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(C.LoadStylesheetStart),s=setTimeout(()=>{r.matches("playing")&&this.play(this.getCurrentTime()),s=-1,a()},this.config.loadTimeout))}}hasImageArg(e){for(const n of e)if(!(!n||typeof n!="object")){if("rr_type"in n&&"args"in n){if(this.hasImageArg(n.args))return!0}else if("rr_type"in n&&n.rr_type==="HTMLImageElement"||n instanceof Array&&this.hasImageArg(n))return!0}return!1}getImageArgs(e){const n=[];for(const o of e)!o||typeof o!="object"||("rr_type"in o&&"args"in o?n.push(...this.getImageArgs(o.args)):"rr_type"in o&&o.rr_type==="HTMLImageElement"?n.push(o.src):o instanceof Array&&n.push(...this.getImageArgs(o)));return n}preloadAllImages(){return Ke(this,null,function*(){this.service.state;const e=()=>{this.service.state};this.emitter.on(C.Start,e),this.emitter.on(C.Pause,e);const n=[];for(const o of this.service.state.context.events)o.type===N.IncrementalSnapshot&&o.data.source===E.CanvasMutation&&(n.push(this.deserializeAndPreloadCanvasEvents(o.data,o)),("commands"in o.data?o.data.commands:[o.data]).forEach(s=>{this.preloadImages(s,o)}));return Promise.all(n)})}preloadImages(e,n){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(n)){const o=document.createElement("canvas"),s=o.getContext("2d"),r=s?.createImageData(o.width,o.height);r?.data,JSON.parse(e.args[0]),s?.putImageData(r,0,0)}}deserializeAndPreloadCanvasEvents(e,n){return Ke(this,null,function*(){if(!this.canvasEventMap.has(n)){const o={isUnchanged:!0};if("commands"in e){const s=yield Promise.all(e.commands.map(r=>Ke(this,null,function*(){const l=yield Promise.all(r.args.map(X(this.imageMap,null,o)));return Ze(ue({},r),{args:l})})));o.isUnchanged===!1&&this.canvasEventMap.set(n,Ze(ue({},e),{commands:s}))}else{const s=yield Promise.all(e.args.map(X(this.imageMap,null,o)));o.isUnchanged===!1&&this.canvasEventMap.set(n,Ze(ue({},e),{args:s}))}}})}applyIncremental(e,n){var o,s,r,l,a,c;const{data:i}=e;switch(i.source){case E.Mutation:{try{this.applyMutation(i,n)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,i)}break}case E.Drag:case E.TouchMove:case E.MouseMove:if(n){const u=i.positions[i.positions.length-1];this.mousePos={x:u.x,y:u.y,id:u.id,debugData:i}}else i.positions.forEach(u=>{const d={doAction:()=>{this.moveAndHover(u.x,u.y,u.id,n,i)},delay:u.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(d)}),this.timer.addAction({doAction(){},delay:e.delay-((o=i.positions[0])==null?void 0:o.timeOffset)});break;case E.MouseInteraction:{if(i.id===-1||n)break;const u=new Event(O[i.type].toLowerCase()),d=this.mirror.getNode(i.id);if(!d)return this.debugNodeNotFound(i,i.id);this.emitter.emit(C.MouseInteraction,{type:i.type,target:d});const{triggerFocus:h}=this.config;switch(i.type){case O.Blur:"blur"in d&&d.blur();break;case O.Focus:h&&d.focus&&d.focus({preventScroll:!0});break;case O.Click:case O.TouchStart:case O.TouchEnd:n?(i.type===O.TouchStart?this.touchActive=!0:i.type===O.TouchEnd&&(this.touchActive=!1),this.mousePos={x:i.x,y:i.y,id:i.id,debugData:i}):(i.type===O.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(i.x,i.y,i.id,n,i),i.type===O.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):i.type===O.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):i.type===O.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case O.TouchCancel:n?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:d.dispatchEvent(u)}break}case E.Scroll:{if(i.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);u.scrollData=i;break}this.applyScroll(i,n);break}case E.ViewportResize:this.emitter.emit(C.Resize,{width:i.width,height:i.height});break;case E.Input:{if(i.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);u.inputData=i;break}this.applyInput(i);break}case E.MediaInteraction:{const u=this.usingVirtualDom?this.virtualDom.mirror.getNode(i.id):this.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u;try{i.currentTime&&(d.currentTime=i.currentTime),i.volume&&(d.volume=i.volume),i.muted&&(d.muted=i.muted),i.type===Q.Pause&&d.pause(),i.type===Q.Play&&d.play()}catch(h){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${h.message||h}`)}break}case E.StyleSheetRule:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u.rules;(s=i.adds)==null||s.forEach(({rule:h,index:m})=>d?.push({cssText:h,index:m,type:j.Insert})),(r=i.removes)==null||r.forEach(({index:h})=>d?.push({index:h,type:j.Remove}))}else{const u=this.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u.sheet;(l=i.adds)==null||l.forEach(({rule:h,index:m})=>{try{if(Array.isArray(m)){const{positions:f,index:y}=Ge(m);re(d.cssRules,f).insertRule(h,y)}else{const f=m===void 0?void 0:Math.min(m,d.cssRules.length);d.insertRule(h,f)}}catch{}}),(a=i.removes)==null||a.forEach(({index:h})=>{try{if(Array.isArray(h)){const{positions:m,index:f}=Ge(h);re(d.cssRules,m).deleteRule(f||0)}else d?.deleteRule(h)}catch{}})}break}case E.StyleDeclaration:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u.rules;i.set&&d.push(ue({type:j.SetProperty,index:i.index},i.set)),i.remove&&d.push(ue({type:j.RemoveProperty,index:i.index},i.remove))}else{const u=this.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u.sheet;i.set&&re(d.rules,i.index).style.setProperty(i.set.property,i.set.value,i.set.priority),i.remove&&re(d.rules,i.index).style.removeProperty(i.remove.property)}break}case E.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);u.canvasMutations.push({event:e,mutation:i})}else{const u=this.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);ln({event:e,mutation:i,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case E.Font:{try{const u=new FontFace(i.family,i.buffer?new Uint8Array(JSON.parse(i.fontSource)):i.fontSource,i.descriptors);(c=this.iframe.contentDocument)==null||c.fonts.add(u)}catch(u){this.config.showWarning&&console.warn(u)}break}}}applyMutation(e,n){if(this.config.useVirtualDom&&!this.usingVirtualDom&&n&&(this.usingVirtualDom=!0,xo(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const i in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[i],d=Ut(u.node,this.virtualDom,this.mirror);d&&(u.node=d)}catch(u){this.config.showWarning&&console.warn(u)}const o=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes.forEach(i=>{var u;const d=o.getNode(i.id);if(!d)return e.removes.find(m=>m.id===i.parentId)?void 0:this.warnNodeNotFound(e,i.id);let h=o.getNode(i.parentId);if(!h)return this.warnNodeNotFound(e,i.parentId);if(i.isShadow&&fe(h)&&(h=h.shadowRoot),o.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,e);else throw m}});const s=ue({},this.legacy_missingNodeRetryMap),r=[],l=i=>{let u=null;return i.nextId&&(u=o.getNode(i.nextId)),i.nextId!==null&&i.nextId!==void 0&&i.nextId!==-1&&!u},a=i=>{var u;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let d=o.getNode(i.parentId);if(!d)return i.node.type===v.NodeType.Document?this.newDocumentQueue.push(i):r.push(i);i.node.isShadow&&(fe(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let h=null,m=null;if(i.previousId&&(h=o.getNode(i.previousId)),i.nextId&&(m=o.getNode(i.nextId)),l(i))return r.push(i);if(i.node.rootId&&!o.getNode(i.node.rootId))return;const f=i.node.rootId?o.getNode(i.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(ie(d,o)){this.attachDocumentToIframe(i,d);return}const y=v.buildNodeWithSN(i.node,{doc:f,mirror:o,skipChild:!0,hackCss:!0,cache:this.cache});if(i.previousId===-1||i.nextId===-1){s[i.node.id]={node:y,mutation:i};return}const g=o.getMeta(d);if(g&&g.type===v.NodeType.Element&&g.tagName==="textarea"&&i.node.type===v.NodeType.Text){const p=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const b of p)b.nodeType===d.TEXT_NODE&&d.removeChild(b)}if(h&&h.nextSibling&&h.nextSibling.parentNode)d.insertBefore(y,h.nextSibling);else if(m&&m.parentNode)d.contains(m)?d.insertBefore(y,m):d.insertBefore(y,null);else{if(d===f)for(;f.firstChild;)f.removeChild(f.firstChild);d.appendChild(y)}if(this.usingVirtualDom&&y.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[]),ie(y,this.mirror)){const p=this.mirror.getId(y),b=this.newDocumentQueue.find(T=>T.parentId===p);b&&(this.attachDocumentToIframe(b,y),this.newDocumentQueue=this.newDocumentQueue.filter(T=>T!==b))}(i.previousId||i.nextId)&&this.legacy_resolveMissingNode(s,d,y,i)};e.adds.forEach(i=>{a(i)});const c=Date.now();for(;r.length;){const i=it(r);if(r.length=0,Date.now()-c>500){this.warn("Timeout in the loop, please check the resolve tree data:",i);break}for(const u of i)o.getNode(u.value.parentId)?Ve(u,d=>{a(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(s).length&&Object.assign(this.legacy_missingNodeRetryMap,s),rt(e.texts).forEach(i=>{var u;const d=o.getNode(i.id);if(!d)return e.removes.find(h=>h.id===i.id)?void 0:this.warnNodeNotFound(e,i.id);if(d.textContent=i.value,this.usingVirtualDom){const h=d.parentNode;((u=h?.rules)==null?void 0:u.length)>0&&(h.rules=[])}}),e.attributes.forEach(i=>{const u=o.getNode(i.id);if(!u)return e.removes.find(d=>d.id===i.id)?void 0:this.warnNodeNotFound(e,i.id);for(const d in i.attributes)if(typeof d=="string"){const h=i.attributes[d];if(h===null)u.removeAttribute(d);else if(typeof h=="string")try{u.setAttribute(d,h)}catch(m){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",m)}else if(d==="style"){const m=h,f=u;for(const y in m)if(m[y]===!1)f.style.removeProperty(y);else if(m[y]instanceof Array){const g=m[y];f.style.setProperty(y,g[0],g[1])}else{const g=m[y];f.style.setProperty(y,g)}}}})}applyScroll(e,n){const o=this.mirror.getNode(e.id);if(!o)return this.debugNodeNotFound(e,e.id);const s=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:n?"auto":"smooth"});else if(s?.type===v.NodeType.Document)o.defaultView.scrollTo({top:e.y,left:e.x,behavior:n?"auto":"smooth"});else try{o.scrollTop=e.y,o.scrollLeft=e.x}catch{}}applyInput(e){const n=this.mirror.getNode(e.id);if(!n)return this.debugNodeNotFound(e,e.id);try{n.checked=e.isChecked,n.value=e.text}catch{}}legacy_resolveMissingNode(e,n,o,s){const{previousId:r,nextId:l}=s,a=r&&e[r],c=l&&e[l];if(a){const{node:i,mutation:u}=a;n.insertBefore(i,o),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,n,i,u)}if(c){const{node:i,mutation:u}=c;n.insertBefore(i,o.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,n,i,u)}}moveAndHover(e,n,o,s,r){const l=this.mirror.getNode(o);if(!l)return this.debugNodeNotFound(r,o);const a=je(l,this.iframe),c=e*a.absoluteScale+a.x,i=n*a.absoluteScale+a.y;this.mouse.style.left=`${c}px`,this.mouse.style.top=`${i}px`,s||this.drawMouseTail({x:c,y:i}),this.hoverElements(l)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:n,lineWidth:o,strokeStyle:s,duration:r}=this.config.mouseTail===!0?Je:Object.assign({},Je,this.config.mouseTail),l=()=>{if(!this.mouseTail)return;const a=this.mouseTail.getContext("2d");!a||!this.tailPositions.length||(a.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),a.beginPath(),a.lineWidth=o,a.lineCap=n,a.strokeStyle=s,a.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(c=>a.lineTo(c.x,c.y)),a.stroke())};this.tailPositions.push(e),l(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(a=>a!==e),l()},r/this.speedService.state.context.timer.speed)}hoverElements(e){var n;(n=this.iframe.contentDocument)==null||n.querySelectorAll(".\\:hover").forEach(s=>{s.classList.remove(":hover")});let o=e;for(;o;)o.classList&&o.classList.add(":hover"),o=o.parentElement}isUserInteraction(e){return e.type!==N.IncrementalSnapshot?!1:e.data.source>E.Mutation&&e.data.source<=E.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(C.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,n){this.warn(`Node with id '${n}' not found. `,e)}warnCanvasMutationFailed(e,n){this.warn("Has error on canvas update",n,"canvas mutation:",e)}debugNodeNotFound(e,n){this.debug(Qe,`Node with id '${n}' not found. `,e)}warn(...e){!this.config.showWarning||console.warn(Qe,...e)}debug(...e){!this.config.showDebug||console.log(Qe,...e)}}const{addCustomEvent:as}=q,{freezePage:ls}=q;return L.EventType=N,L.IncrementalSource=E,L.MouseInteractions=O,L.Replayer=rs,L.ReplayerEvents=C,L.addCustomEvent=as,L.freezePage=ls,L.record=q,L.utils=yn,Object.defineProperty(L,"__esModule",{value:!0}),L}({},rrwebSnapshot);
19
18
  //# sourceMappingURL=rrweb.min.js.map