@highlight-run/rrweb 2.1.4 → 2.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plugins/console-record.js +3 -3
- package/dist/plugins/console-record.min.js +3 -3
- package/dist/plugins/console-record.min.js.map +1 -1
- package/dist/plugins/console-replay.js +0 -0
- package/dist/plugins/console-replay.min.js +0 -0
- package/dist/plugins/console-replay.min.js.map +1 -1
- package/dist/plugins/sequential-id-record.js +0 -0
- package/dist/plugins/sequential-id-record.min.js +0 -0
- package/dist/plugins/sequential-id-record.min.js.map +0 -0
- package/dist/plugins/sequential-id-replay.js +0 -0
- package/dist/plugins/sequential-id-replay.min.js +0 -0
- package/dist/plugins/sequential-id-replay.min.js.map +0 -0
- package/dist/record/rrweb-record-pack.js +0 -0
- package/dist/record/rrweb-record-pack.min.js +0 -0
- package/dist/record/rrweb-record-pack.min.js.map +1 -1
- package/dist/record/rrweb-record.js +3 -3
- package/dist/record/rrweb-record.min.js +3 -3
- package/dist/record/rrweb-record.min.js.map +1 -1
- package/dist/replay/rrweb-replay-unpack.css +0 -0
- package/dist/replay/rrweb-replay-unpack.js +3 -3
- package/dist/replay/rrweb-replay-unpack.min.css +0 -0
- package/dist/replay/rrweb-replay-unpack.min.css.map +0 -0
- package/dist/replay/rrweb-replay-unpack.min.js +3 -3
- package/dist/replay/rrweb-replay-unpack.min.js.map +1 -1
- package/dist/replay/rrweb-replay.css +0 -0
- package/dist/replay/rrweb-replay.js +4 -4
- package/dist/replay/rrweb-replay.min.css +0 -0
- package/dist/replay/rrweb-replay.min.css.map +0 -0
- package/dist/replay/rrweb-replay.min.js +4 -4
- package/dist/replay/rrweb-replay.min.js.map +1 -1
- package/dist/rrweb-all.css +0 -0
- package/dist/rrweb-all.js +6 -6
- package/dist/rrweb-all.min.css +0 -0
- package/dist/rrweb-all.min.css.map +0 -0
- package/dist/rrweb-all.min.js +6 -6
- package/dist/rrweb-all.min.js.map +1 -1
- package/dist/rrweb.css +0 -0
- package/dist/rrweb.js +5 -5
- package/dist/rrweb.min.css +0 -0
- package/dist/rrweb.min.css.map +0 -0
- package/dist/rrweb.min.js +5 -5
- package/dist/rrweb.min.js.map +1 -1
- package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__auto__createBase64WorkerFactory.js +0 -0
- package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__auto__isNodeJS.js +0 -0
- package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +0 -0
- package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__node__WorkerClass.js +0 -0
- package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__node__createBase64WorkerFactory.js +0 -0
- package/es/rrweb/_virtual/image-bitmap-data-url-worker.js +0 -0
- package/es/rrweb/all.css +0 -0
- package/es/rrweb/ext/@xstate/fsm/es/index.js +0 -0
- package/es/rrweb/ext/base64-arraybuffer/dist/base64-arraybuffer.es5.js +0 -0
- package/es/rrweb/ext/fflate/esm/browser.js +0 -0
- package/es/rrweb/ext/mitt/dist/mitt.mjs.js +0 -0
- package/es/rrweb/ext/tslib/tslib.es6.js +0 -0
- package/es/rrweb/packages/rrdom/es/rrdom.js +0 -0
- package/es/rrweb/packages/rrweb/src/entries/all.js +0 -0
- package/es/rrweb/packages/rrweb/src/index.js +0 -0
- package/es/rrweb/packages/rrweb/src/packer/base.js +0 -0
- package/es/rrweb/packages/rrweb/src/packer/pack.js +0 -0
- package/es/rrweb/packages/rrweb/src/packer/unpack.js +0 -0
- package/es/rrweb/packages/rrweb/src/plugins/console/record/error-stack-parser.js +0 -0
- package/es/rrweb/packages/rrweb/src/plugins/console/record/index.js +0 -0
- package/es/rrweb/packages/rrweb/src/plugins/console/record/stringify.js +0 -0
- package/es/rrweb/packages/rrweb/src/plugins/console/replay/index.js +0 -0
- package/es/rrweb/packages/rrweb/src/plugins/sequential-id/record/index.js +0 -0
- package/es/rrweb/packages/rrweb/src/plugins/sequential-id/replay/index.js +0 -0
- package/es/rrweb/packages/rrweb/src/record/iframe-manager.js +0 -0
- package/es/rrweb/packages/rrweb/src/record/index.js +0 -0
- package/es/rrweb/packages/rrweb/src/record/mutation.js +0 -0
- package/es/rrweb/packages/rrweb/src/record/observer.js +0 -0
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/2d.js +0 -0
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas-manager.js +0 -0
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas.js +0 -0
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/serialize-args.js +0 -0
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/webgl.js +0 -0
- package/es/rrweb/packages/rrweb/src/record/shadow-dom-manager.js +0 -0
- package/es/rrweb/packages/rrweb/src/record/stylesheet-manager.js +0 -0
- package/es/rrweb/packages/rrweb/src/replay/canvas/2d.js +0 -0
- package/es/rrweb/packages/rrweb/src/replay/canvas/deserialize-args.js +0 -0
- package/es/rrweb/packages/rrweb/src/replay/canvas/index.js +0 -0
- package/es/rrweb/packages/rrweb/src/replay/canvas/webgl.js +0 -0
- package/es/rrweb/packages/rrweb/src/replay/index.js +0 -0
- package/es/rrweb/packages/rrweb/src/replay/machine.js +0 -0
- package/es/rrweb/packages/rrweb/src/replay/smoothscroll.js +0 -0
- package/es/rrweb/packages/rrweb/src/replay/styles/inject-style.js +0 -0
- package/es/rrweb/packages/rrweb/src/replay/timer.js +0 -0
- package/es/rrweb/packages/rrweb/src/types.js +0 -0
- package/es/rrweb/packages/rrweb/src/utils.js +0 -0
- package/es/rrweb/packages/rrweb-snapshot/es/rrweb-snapshot.js +17 -10
- package/lib/plugins/console-record.js +0 -0
- package/lib/plugins/console-replay.js +0 -0
- package/lib/plugins/sequential-id-record.js +0 -0
- package/lib/plugins/sequential-id-replay.js +0 -0
- package/lib/record/rrweb-record-pack.js +0 -0
- package/lib/record/rrweb-record.js +17 -10
- package/lib/replay/rrweb-replay-unpack.css +0 -0
- package/lib/replay/rrweb-replay-unpack.js +0 -0
- package/lib/replay/rrweb-replay.css +0 -0
- package/lib/replay/rrweb-replay.js +0 -0
- package/lib/rrweb-all.css +0 -0
- package/lib/rrweb-all.js +17 -10
- package/lib/rrweb.css +0 -0
- package/lib/rrweb.js +17 -10
- package/package.json +3 -3
package/dist/rrweb-all.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var rrweb=function(q){"use strict";var $;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})($||($={}));function nr(e){return e.nodeType===e.ELEMENT_NODE}function je(e){var t=e?.host;return Boolean(t?.shadowRoot===e)}function Ve(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}var gt=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(o){return r.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function or(){return new gt}function yt(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,i=e.maskInputFn,l=o||"";return(t[r.toLowerCase()]||t[n])&&(i?l=i(l):l="*".repeat(l.length)),l}var ir="__rrweb_original__";function Xn(e){var t=e.getContext("2d");if(!t)return!0;for(var r=50,n=0;n<e.width;n+=r)for(var o=0;o<e.height;o+=r){var i=t.getImageData,l=ir in i?i[ir]:i,c=new Uint32Array(l.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer);if(c.some(function(a){return a!==0}))return!1}return!0}function bt(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var Zn=1,Kn=new RegExp("[^a-z0-9-_:]"),Ge=-2;function qn(){return Zn++}function Jn(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return Kn.test(t)?"div":t}function St(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(Qn).join(""):null}catch{return null}}function Qn(e){var t=e.cssText;if(eo(e))try{t=St(e.styleSheet)||t}catch{}return t}function eo(e){return"styleSheet"in e}function to(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function ro(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var ke,sr,no=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,oo=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,io=/^(data:)([^,]*),(.*)/i;function rt(e,t){return(e||"").replace(no,function(r,n,o,i,l,c){var a=o||l||c,s=n||i||"";if(!a)return r;if(!oo.test(a)||io.test(a))return"url(".concat(s).concat(a).concat(s,")");if(a[0]==="/")return"url(".concat(s).concat(ro(t)+a).concat(s,")");var u=t.split("/"),d=a.split("/");u.pop();for(var h=0,m=d;h<m.length;h++){var p=m[h];p!=="."&&(p===".."?u.pop():u.push(p))}return"url(".concat(s).concat(u.join("/")).concat(s,")")})}var so=/^[^ \t\n\r\u000c]+/,ao=/^[, \t\n\r\u000c]+/;function lo(e,t){if(t.trim()==="")return t;var r=0;function n(s){var u,d=s.exec(t.substring(r));return d?(u=d[0],r+=u.length,u):""}for(var o=[];n(ao),!(r>=t.length);){var i=n(so);if(i.slice(-1)===",")i=nt(e,i.substring(0,i.length-1)),o.push(i);else{var l="";i=nt(e,i);for(var c=!1;;){var a=t.charAt(r);if(a===""){o.push((i+l).trim());break}else if(c)a===")"&&(c=!1);else if(a===","){r+=1,o.push((i+l).trim());break}else a==="("&&(c=!0);l+=a,r+=1}}}return o.join(", ")}function nt(e,t){if(!t||t.trim()==="")return t;var r=e.createElement("a");return r.href=t,r.href}function co(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function wt(){var e=document.createElement("a");return e.href="",e.href}function ar(e,t,r,n){return r==="src"||r==="href"&&n&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n&&n[0]!=="#"||r==="background"&&n&&(t==="table"||t==="td"||t==="th")?nt(e,n):r==="srcset"&&n?lo(e,n):r==="style"&&n?rt(n,wt()):t==="object"&&r==="data"&&n?nt(e,n):n}function lr(e,t,r){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return r?e.matches(r):!1}function ot(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?ot(e.parentNode,t,r):!1;for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return r?ot(e.parentNode,t,r):!1}function cr(e,t,r){var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(n===null)return!1;if(typeof t=="string"){if(n.classList.contains(t)||n.closest(".".concat(t)))return!0}else if(ot(n,t,!0))return!0;return!!(r&&(n.matches(r)||n.closest(r)))}function uo(e,t,r){var n=e.contentWindow;if(n){var o=!1,i;try{i=n.document.readyState}catch{return}if(i!=="complete"){var l=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(l),o=!0,t()});return}var c="about:blank";if(n.location.href!==c||e.src===c||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function ur(e){return e.getAttribute("href")?e.sheet!==null:!0}function dr(e,t,r){var n=!1,o;try{o=e.sheet}catch{return}if(!o){var i=setTimeout(function(){n||(t(),n=!0)},r);e.addEventListener("load",function(){clearTimeout(i),n=!0,t()})}}function ho(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector,l=t.maskTextClass,c=t.maskTextSelector,a=t.inlineStylesheet,s=t.maskInputOptions,u=s===void 0?{}:s,d=t.maskTextFn,h=t.maskInputFn,m=t.dataURLOptions,p=m===void 0?{}:m,f=t.inlineImages,y=t.recordCanvas,v=t.keepIframeSrcFn,b=t.newlyAddedElement,N=b===void 0?!1:b,T=t.enableStrictPrivacy,w=mo(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:$.Document,childNodes:[],compatMode:e.compatMode,rootId:w}:{type:$.Document,childNodes:[],rootId:w};case e.DOCUMENT_TYPE_NODE:return{type:$.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:w};case e.ELEMENT_NODE:return fo(e,{doc:r,blockClass:o,blockSelector:i,inlineStylesheet:a,maskInputOptions:u,maskInputFn:h,maskTextClass:l,dataURLOptions:p,inlineImages:f,recordCanvas:y,keepIframeSrcFn:v,newlyAddedElement:N,enableStrictPrivacy:T,rootId:w});case e.TEXT_NODE:return po(e,{maskTextClass:l,maskTextSelector:c,maskTextFn:d,enableStrictPrivacy:T,rootId:w});case e.CDATA_SECTION_NODE:return{type:$.CDATA,textContent:"",rootId:w};case e.COMMENT_NODE:return{type:$.Comment,textContent:e.textContent||"",rootId:w};default:return!1}}function mo(e,t){if(t.hasNode(e)){var r=t.getId(e);return r===1?void 0:r}}function po(e,t){var r,n=t.maskTextClass,o=t.maskTextSelector,i=t.maskTextFn,l=t.enableStrictPrivacy,c=t.rootId,a=e.parentNode&&e.parentNode.tagName,s=e.textContent,u=a==="STYLE"?!0:void 0,d=a==="SCRIPT"?!0:void 0,h=!1;if(u&&s){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(s=to(e.parentNode.sheet))}catch(p){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(p),e)}s=rt(s,wt()),h=!0}if(d?(s="SCRIPT_PLACEHOLDER",h=!0):a==="NOSCRIPT"&&(s="",h=!0),!u&&!d&&s&&cr(e,n,o)&&(s=i?i(s):s.replace(/[\S]/g,"*")),l&&!h&&a){var m=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!m.has(a)&&s&&(s=bt(s))}return{type:$.Text,textContent:s||"",isStyle:u,rootId:c}}function fo(e,t){for(var r=t.doc,n=t.blockClass,o=t.blockSelector,i=t.inlineStylesheet,l=t.maskInputOptions,c=l===void 0?{}:l,a=t.maskInputFn,s=t.maskTextClass,u=t.dataURLOptions,d=u===void 0?{}:u,h=t.inlineImages,m=t.recordCanvas,p=t.keepIframeSrcFn,f=t.newlyAddedElement,y=f===void 0?!1:f,v=t.enableStrictPrivacy,b=t.rootId,N=lr(e,n,o)||lr(e,s,null),T=Jn(e),w={},x=e.attributes.length,k=0;k<x;k++){var E=e.attributes[k];w[E.name]=ar(r,T,E.name,E.value)}if(T==="link"&&i){var L=Array.from(r.styleSheets).find(function(I){return I.href===e.href}),P=null;L&&(P=St(L)),P&&(delete w.rel,delete w.href,w._cssText=rt(P,L.href))}if(T==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var P=St(e.sheet);P&&(w._cssText=rt(P,wt()))}if(T==="input"||T==="textarea"||T==="select"){var V=e.value;w.type!=="radio"&&w.type!=="checkbox"&&w.type!=="submit"&&w.type!=="button"&&V?w.value=yt({type:w.type,tagName:T,value:V,maskInputOptions:c,maskInputFn:a}):e.checked&&(w.checked=e.checked)}if(T==="option"&&(e.selected&&!c.select?w.selected=!0:delete w.selected),T==="canvas"&&m){if(e.__context==="2d")Xn(e)||(w.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var G=e.toDataURL(d.type,d.quality),U=document.createElement("canvas");U.width=e.width,U.height=e.height;var Y=U.toDataURL(d.type,d.quality);G!==Y&&(w.rr_dataURL=G)}}if(T==="img"&&h&&!N){ke||(ke=r.createElement("canvas"),sr=ke.getContext("2d"));var D=e,F=D.crossOrigin;D.crossOrigin="anonymous";var O=function(){try{ke.width=D.naturalWidth,ke.height=D.naturalHeight,sr.drawImage(D,0,0),w.rr_dataURL=ke.toDataURL(d.type,d.quality)}catch(I){console.warn("Cannot inline img src=".concat(D.currentSrc,"! Error: ").concat(I))}F?w.crossOrigin=F:D.removeAttribute("crossorigin")};D.complete&&D.naturalWidth!==0?O():D.onload=O}if((T==="audio"||T==="video")&&(w.rr_mediaState=e.paused?"paused":"played",w.rr_mediaCurrentTime=e.currentTime),y||(e.scrollLeft&&(w.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(w.rr_scrollTop=e.scrollTop)),N||T==="img"&&v){var _=e.getBoundingClientRect(),S=_.width,g=_.height;w={class:w.class,rr_width:"".concat(S,"px"),rr_height:"".concat(g,"px")},N=!0}return T==="iframe"&&!p(w.src)&&(e.contentDocument||(w.rr_src=w.src),delete w.src),N&&T==="img"&&delete w.src,{type:$.Element,tagName:T,attributes:w,childNodes:[],isSVG:co(e)||void 0,needBlock:N,rootId:b}}function Z(e){return e===void 0?"":e.toLowerCase()}function vo(e,t){return!!(t.comment&&e.type===$.Comment||e.type===$.Element&&(t.script&&(e.tagName==="script"||e.tagName==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js"))||t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(Z(e.attributes.name).match(/^msapplication-tile(image|color)$/)||Z(e.attributes.name)==="application-name"||Z(e.attributes.rel)==="icon"||Z(e.attributes.rel)==="apple-touch-icon"||Z(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&Z(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(Z(e.attributes.property).match(/^(og|twitter|fb):/)||Z(e.attributes.name).match(/^(og|twitter):/)||Z(e.attributes.name)==="pinterest")||t.headMetaRobots&&(Z(e.attributes.name)==="robots"||Z(e.attributes.name)==="googlebot"||Z(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(Z(e.attributes.name)==="author"||Z(e.attributes.name)==="generator"||Z(e.attributes.name)==="framework"||Z(e.attributes.name)==="publisher"||Z(e.attributes.name)==="progid"||Z(e.attributes.property).match(/^article:/)||Z(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(Z(e.attributes.name)==="google-site-verification"||Z(e.attributes.name)==="yandex-verification"||Z(e.attributes.name)==="csrf-token"||Z(e.attributes.name)==="p:domain_verify"||Z(e.attributes.name)==="verify-v1"||Z(e.attributes.name)==="verification"||Z(e.attributes.name)==="shopify-checkout-api-token"))))}function Ee(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector,l=t.maskTextClass,c=t.maskTextSelector,a=t.skipChild,s=a===void 0?!1:a,u=t.inlineStylesheet,d=u===void 0?!0:u,h=t.maskInputOptions,m=h===void 0?{}:h,p=t.maskTextFn,f=t.maskInputFn,y=t.slimDOMOptions,v=t.dataURLOptions,b=v===void 0?{}:v,N=t.inlineImages,T=N===void 0?!1:N,w=t.recordCanvas,x=w===void 0?!1:w,k=t.onSerialize,E=t.onIframeLoad,L=t.iframeLoadTimeout,P=L===void 0?5e3:L,V=t.onStylesheetLoad,G=t.stylesheetLoadTimeout,U=G===void 0?5e3:G,Y=t.keepIframeSrcFn,D=Y===void 0?function(){return!1}:Y,F=t.newlyAddedElement,O=F===void 0?!1:F,_=t.enableStrictPrivacy,S=t.preserveWhiteSpace,g=S===void 0?!0:S,I=ho(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,dataURLOptions:b,inlineImages:T,recordCanvas:x,keepIframeSrcFn:D,newlyAddedElement:O,enableStrictPrivacy:_});if(!I)return console.warn(e,"not serialized"),null;var C;if(n.hasNode(e)?C=n.getId(e):vo(I,y)||!g&&I.type===$.Text&&!I.isStyle&&!I.textContent.replace(/^\s+|\s+$/gm,"").length?C=Ge:C=qn(),C===Ge)return null;var M=Object.assign(I,{id:C});n.add(e,M),k&&k(e);var z=!s,j=_;if(M.type===$.Element){if(z=z&&!M.needBlock,j=!!M.needBlock,console.log("vadim strictPrivacy",{strictPrivacy:j,enableStrictPrivacy:_}),j&&M.tagName==="img"){var oe=e.cloneNode();oe.src="",n.add(oe,M)}delete M.needBlock;var B=e.shadowRoot;B&&Ve(B)&&(M.isShadowHost=!0)}if((M.type===$.Document||M.type===$.Element)&&z){y.headWhitespace&&M.type===$.Element&&M.tagName==="head"&&(g=!1);for(var X={doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:s,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:b,inlineImages:T,recordCanvas:x,preserveWhiteSpace:g,onSerialize:k,onIframeLoad:E,iframeLoadTimeout:P,onStylesheetLoad:V,stylesheetLoadTimeout:U,keepIframeSrcFn:D,enableStrictPrivacy:j},ge=0,tt=Array.from(e.childNodes);ge<tt.length;ge++){var We=tt[ge],ye=Ee(We,X);ye&&M.childNodes.push(ye)}if(nr(e)&&e.shadowRoot)for(var rr=0,Ue=Array.from(e.shadowRoot.childNodes);rr<Ue.length;rr++){var We=Ue[rr],ye=Ee(We,X);ye&&(Ve(e.shadowRoot)&&(ye.isShadow=!0),M.childNodes.push(ye))}}return e.parentNode&&je(e.parentNode)&&Ve(e.parentNode)&&(M.isShadow=!0),M.type===$.Element&&M.tagName==="iframe"&&uo(e,function(){var be=e.contentDocument;if(be&&E){var Hn=Ee(be,{doc:be,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:b,inlineImages:T,recordCanvas:x,preserveWhiteSpace:g,onSerialize:k,onIframeLoad:E,iframeLoadTimeout:P,onStylesheetLoad:V,stylesheetLoadTimeout:U,keepIframeSrcFn:D,enableStrictPrivacy:_});Hn&&E(e,Hn)}},P),M.type===$.Element&&M.tagName==="link"&&M.attributes.rel==="stylesheet"&&(dr(e,function(){if(V){var be=Ee(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:b,inlineImages:T,recordCanvas:x,preserveWhiteSpace:g,onSerialize:k,onIframeLoad:E,iframeLoadTimeout:P,onStylesheetLoad:V,stylesheetLoadTimeout:U,keepIframeSrcFn:D,enableStrictPrivacy:_});be&&V(e,be)}},U),ur(e)===!1)||M.type===$.Element&&M.tagName==="link"&&M.attributes.rel==="stylesheet"&&(dr(e,function(){if(V){var be=Ee(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:b,inlineImages:T,recordCanvas:x,preserveWhiteSpace:g,onSerialize:k,onIframeLoad:E,iframeLoadTimeout:P,enableStrictPrivacy:_,onStylesheetLoad:V,stylesheetLoadTimeout:U,keepIframeSrcFn:D});be&&V(e,be)}},U),ur(e)===!1)?null:M}function go(e,t){var r=t||{},n=r.mirror,o=n===void 0?new gt:n,i=r.blockClass,l=i===void 0?"highlight-block":i,c=r.blockSelector,a=c===void 0?null:c,s=r.maskTextClass,u=s===void 0?"highlight-mask":s,d=r.maskTextSelector,h=d===void 0?null:d,m=r.inlineStylesheet,p=m===void 0?!0:m,f=r.inlineImages,y=f===void 0?!1:f,v=r.recordCanvas,b=v===void 0?!1:v,N=r.maskAllInputs,T=N===void 0?!1:N,w=r.maskTextFn,x=r.maskInputFn,k=r.slimDOM,E=k===void 0?!1:k,L=r.dataURLOptions,P=r.preserveWhiteSpace,V=r.onSerialize,G=r.onIframeLoad,U=r.iframeLoadTimeout,Y=r.onStylesheetLoad,D=r.stylesheetLoadTimeout,F=r.keepIframeSrcFn,O=F===void 0?function(){return!1}:F,_=r.enableStrictPrivacy,S=_===void 0?!1:_,g=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=E===!0||E==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:E==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:E===!1?{}:E;return Ee(e,{doc:e,mirror:o,blockClass:l,blockSelector:a,maskTextClass:u,maskTextSelector:h,skipChild:!1,inlineStylesheet:p,maskInputOptions:g,maskTextFn:w,maskInputFn:x,slimDOMOptions:I,dataURLOptions:L,inlineImages:y,recordCanvas:b,preserveWhiteSpace:P,onSerialize:V,onIframeLoad:G,iframeLoadTimeout:U,onStylesheetLoad:Y,stylesheetLoadTimeout:D,keepIframeSrcFn:O,newlyAddedElement:!1,enableStrictPrivacy:S})}var hr=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function yo(e,t){t===void 0&&(t={});var r=1,n=1;function o(S){var g=S.match(/\n/g);g&&(r+=g.length);var I=S.lastIndexOf(`
|
|
2
|
-
`);n=I===-1?n+S.length:S.length-I}function i(){var S={line:r,column:n};return function(g){return g.position=new l(S),p(),g}}var l=function(){function S(g){this.start=g,this.end={line:r,column:n},this.source=t.source}return S}();l.prototype.content=e;var c=[];function a(S){var g=new Error("".concat(t.source||"",":").concat(r,":").concat(n,": ").concat(S));if(g.reason=S,g.filename=t.source,g.line=r,g.column=n,g.source=e,t.silent)c.push(g);else throw g}function s(){var S=h();return{type:"stylesheet",stylesheet:{source:t.source,rules:S,parsingErrors:c}}}function u(){return m(/^{\s*/)}function d(){return m(/^}/)}function h(){var S,g=[];for(p(),f(g);e.length&&e.charAt(0)!=="}"&&(S=O()||_());)S!==!1&&(g.push(S),f(g));return g}function m(S){var g=S.exec(e);if(g){var I=g[0];return o(I),e=e.slice(I.length),g}}function p(){m(/^\s*/)}function f(S){S===void 0&&(S=[]);for(var g;g=y();)g!==!1&&S.push(g),g=y();return S}function y(){var S=i();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var g=2;e.charAt(g)!==""&&(e.charAt(g)!=="*"||e.charAt(g+1)!=="/");)++g;if(g+=2,e.charAt(g-1)==="")return a("End of comment missing");var I=e.slice(2,g-2);return n+=2,o(I),e=e.slice(g),n+=2,S({type:"comment",comment:I})}}function v(){var S=m(/^([^{]+)/);if(S)return pe(S[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(g){return g.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(g){return g.replace(/\u200C/g,",")})}function b(){var S=i(),g=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(g){var I=pe(g[0]);if(!m(/^:\s*/))return a("property missing ':'");var C=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),M=S({type:"declaration",property:I.replace(hr,""),value:C?pe(C[0]).replace(hr,""):""});return m(/^[;\s]*/),M}}function N(){var S=[];if(!u())return a("missing '{'");f(S);for(var g;g=b();)g!==!1&&(S.push(g),f(S)),g=b();return d()?S:a("missing '}'")}function T(){for(var S,g=[],I=i();S=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)g.push(S[1]),m(/^,\s*/);if(g.length)return I({type:"keyframe",values:g,declarations:N()})}function w(){var S=i(),g=m(/^@([-\w]+)?keyframes\s*/);if(g){var I=g[1];if(g=m(/^([-\w]+)\s*/),!g)return a("@keyframes missing name");var C=g[1];if(!u())return a("@keyframes missing '{'");for(var M,z=f();M=T();)z.push(M),z=z.concat(f());return d()?S({type:"keyframes",name:C,vendor:I,keyframes:z}):a("@keyframes missing '}'")}}function x(){var S=i(),g=m(/^@supports *([^{]+)/);if(g){var I=pe(g[1]);if(!u())return a("@supports missing '{'");var C=f().concat(h());return d()?S({type:"supports",supports:I,rules:C}):a("@supports missing '}'")}}function k(){var S=i(),g=m(/^@host\s*/);if(g){if(!u())return a("@host missing '{'");var I=f().concat(h());return d()?S({type:"host",rules:I}):a("@host missing '}'")}}function E(){var S=i(),g=m(/^@media *([^{]+)/);if(g){var I=pe(g[1]);if(!u())return a("@media missing '{'");var C=f().concat(h());return d()?S({type:"media",media:I,rules:C}):a("@media missing '}'")}}function L(){var S=i(),g=m(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(g)return S({type:"custom-media",name:pe(g[1]),media:pe(g[2])})}function P(){var S=i(),g=m(/^@page */);if(g){var I=v()||[];if(!u())return a("@page missing '{'");for(var C=f(),M;M=b();)C.push(M),C=C.concat(f());return d()?S({type:"page",selectors:I,declarations:C}):a("@page missing '}'")}}function V(){var S=i(),g=m(/^@([-\w]+)?document *([^{]+)/);if(g){var I=pe(g[1]),C=pe(g[2]);if(!u())return a("@document missing '{'");var M=f().concat(h());return d()?S({type:"document",document:C,vendor:I,rules:M}):a("@document missing '}'")}}function G(){var S=i(),g=m(/^@font-face\s*/);if(g){if(!u())return a("@font-face missing '{'");for(var I=f(),C;C=b();)I.push(C),I=I.concat(f());return d()?S({type:"font-face",declarations:I}):a("@font-face missing '}'")}}var U=F("import"),Y=F("charset"),D=F("namespace");function F(S){var g=new RegExp("^@"+S+"\\s*([^;]+);");return function(){var I=i(),C=m(g);if(C){var M={type:S};return M[S]=C[1].trim(),I(M)}}}function O(){if(e[0]==="@")return w()||E()||L()||x()||U()||Y()||D()||V()||P()||k()||G()}function _(){var S=i(),g=v();return g?(f(),S({type:"rule",selectors:g,declarations:N()})):a("selector missing")}return Tt(s())}function pe(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Tt(e,t){for(var r=e&&typeof e.type=="string",n=r?e:t,o=0,i=Object.keys(e);o<i.length;o++){var l=i[o],c=e[l];Array.isArray(c)?c.forEach(function(a){Tt(a,n)}):c&&typeof c=="object"&&Tt(c,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var mr={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 bo(e){var t=mr[e.tagName]?mr[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function So(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var pr=/([^\\]):hover/,wo=new RegExp(pr.source,"g");function fr(e,t){var r;if(!(!((r=window?.HIG_CONFIGURATION)===null||r===void 0)&&r.enableOnHoverClass))return e;var n=t?.stylesWithHoverClass.get(e);if(n)return n;var o=yo(e,{silent:!0});if(!o.stylesheet)return e;var i=[];if(o.stylesheet.rules.forEach(function(a){"selectors"in a&&(a.selectors||[]).forEach(function(s){pr.test(s)&&i.push(s)})}),i.length===0)return e;var l=new RegExp(i.filter(function(a,s){return i.indexOf(a)===s}).sort(function(a,s){return s.length-a.length}).map(function(a){return So(a)}).join("|"),"g"),c=e.replace(l,function(a){var s=a.replace(wo,"$1.\\:hover");return"".concat(a,", ").concat(s)});return t?.stylesWithHoverClass.set(e,c),c}function vr(){var e=new Map;return{stylesWithHoverClass:e}}function To(e,t){var r=t.doc,n=t.hackCss,o=t.cache;switch(e.type){case $.Document:return r.implementation.createDocument(null,"",null);case $.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case $.Element:{var i=bo(e),l;e.isSVG?l=r.createElementNS("http://www.w3.org/2000/svg",i):l=r.createElement(i);var c=function(d){if(!Object.prototype.hasOwnProperty.call(e.attributes,d))return"continue";var h=e.attributes[d];if(i==="option"&&d==="selected"&&h===!1)return"continue";if(h=typeof h=="boolean"||typeof h=="number"?"":h,d.startsWith("rr_")){if(i==="canvas"&&d==="rr_dataURL"){var m=document.createElement("img");m.onload=function(){var L=l.getContext("2d");L&&L.drawImage(m,0,0,m.width,m.height)},m.src=h,l.RRNodeType&&(l.rr_dataURL=h)}else if(i==="img"&&d==="rr_dataURL"){var p=l;p.currentSrc.startsWith("data:")||(p.setAttribute("rrweb-original-src",e.attributes.src),p.src=h,p.setAttribute("rrweb-inline-src",h))}if(d==="rr_width")l.style.width=h;else if(d==="rr_height")l.style.height=h;else if(d==="rr_mediaCurrentTime")l.currentTime=e.attributes.rr_mediaCurrentTime;else if(d==="rr_mediaState")switch(h){case"played":l.play().catch(function(L){return console.warn("media playback error",L)});break;case"paused":l.pause();break}}else{var f=i==="textarea"&&d==="value",y=i==="style"&&d==="_cssText";if(y&&n&&(h=fr(h,o),typeof h=="string")){for(var v=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,b=void 0,N=[],T="https://replay-cors-proxy.highlightrun.workers.dev";(b=v.exec(h))!==null;)b.index===v.lastIndex&&v.lastIndex++,b.forEach(function(L,P){if(P===0){var V=L.slice(5,L.length-2);N.push({originalUrl:V,proxyUrl:V.replace(V,"".concat(T,"?url=").concat(V))})}});N.forEach(function(L){h=h.replace(L.originalUrl,L.proxyUrl)})}if(f||y){for(var w=r.createTextNode(h),x=0,k=Array.from(l.childNodes);x<k.length;x++){var E=k[x];E.nodeType===l.TEXT_NODE&&l.removeChild(E)}return l.appendChild(w),"continue"}try{if(e.isSVG&&d==="xlink:href")l.setAttributeNS("http://www.w3.org/1999/xlink",d,h);else if(d==="onload"||d==="onclick"||d.substring(0,7)==="onmouse")l.setAttribute("_"+d,h);else{if(i==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&d==="content")return l.setAttribute("csp-content",h),"continue";i==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||i==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")||(i==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?l.setAttribute("rrweb-original-srcset",e.attributes.srcset):l.setAttribute(d,h))}}catch{}}};for(var a in e.attributes)c(a);if(i==="img"){var s=l;if(!s.currentSrc.startsWith("data:")){var u=s.getAttribute("rrweb-inline-src");u!=null&&u.startsWith("data:")&&(s.src=u)}}if(e.isShadowHost)if(!l.shadowRoot)l.attachShadow({mode:"open"});else for(;l.shadowRoot.firstChild;)l.shadowRoot.removeChild(l.shadowRoot.firstChild);return l}case $.Text:return r.createTextNode(e.isStyle&&n?fr(e.textContent,o):e.textContent);case $.CDATA:return r.createCDATASection(e.textContent);case $.Comment:return r.createComment(e.textContent);default:return null}}function it(e,t){var r=t.doc,n=t.mirror,o=t.skipChild,i=o===void 0?!1:o,l=t.hackCss,c=l===void 0?!0:l,a=t.afterAppend,s=t.cache,u=To(e,{doc:r,hackCss:c,cache:s});if(!u)return null;if(e.rootId&&console.assert(n.getNode(e.rootId)===r,"Target document should have the same root id."),e.type===$.Document&&(r.close(),r.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==$.DocumentType&&(e.childNodes[0].type===$.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=r),n.add(u,e),(e.type===$.Document||e.type===$.Element)&&!i)for(var d=0,h=e.childNodes;d<h.length;d++){var m=h[d],p=it(m,{doc:r,mirror:n,skipChild:!1,hackCss:c,afterAppend:a,cache:s});if(!p){console.warn("Failed to rebuild",m);continue}m.isShadow&&nr(u)&&u.shadowRoot?u.shadowRoot.appendChild(p):u.appendChild(p),a&&a(p)}return u}function No(e,t){function r(l){t(l)}for(var n=0,o=e.getIds();n<o.length;n++){var i=o[n];e.has(i)&&r(e.getNode(i))}}function Eo(e,t){var r=t.getMeta(e);if(r?.type===$.Element){var n=e;for(var o in r.attributes)if(Object.prototype.hasOwnProperty.call(r.attributes,o)&&o.startsWith("rr_")){var i=r.attributes[o];o==="rr_scrollLeft"&&(n.scrollLeft=i),o==="rr_scrollTop"&&(n.scrollTop=i)}}}function Co(e,t){var r=t.doc,n=t.onVisit,o=t.hackCss,i=o===void 0?!0:o,l=t.afterAppend,c=t.cache,a=t.mirror,s=a===void 0?new gt:a,u=it(e,{doc:r,mirror:s,skipChild:!1,hackCss:i,afterAppend:l,cache:c});return No(s,function(d){n&&n(d),Eo(d,s)}),u}function ie(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Oe=`Please stop import mirror directly. Instead of that,\r
|
|
1
|
+
var rrweb=function(q){"use strict";var _;(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"})(_||(_={}));function nr(e){return e.nodeType===e.ELEMENT_NODE}function je(e){var t=e?.host;return Boolean(t?.shadowRoot===e)}function Ve(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}var gt=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(o){return r.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function or(){return new gt}function yt(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,i=e.maskInputFn,l=o||"";return(t[r.toLowerCase()]||t[n])&&(i?l=i(l):l="*".repeat(l.length)),l}var ir="__rrweb_original__";function Xn(e){var t=e.getContext("2d");if(!t)return!0;for(var r=50,n=0;n<e.width;n+=r)for(var o=0;o<e.height;o+=r){var i=t.getImageData,l=ir in i?i[ir]:i,c=new Uint32Array(l.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer);if(c.some(function(a){return a!==0}))return!1}return!0}function bt(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var Zn=1,Kn=new RegExp("[^a-z0-9-_:]"),Ge=-2;function qn(){return Zn++}function Jn(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return Kn.test(t)?"div":t}function St(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(Qn).join(""):null}catch{return null}}function Qn(e){var t=e.cssText;if(eo(e))try{t=St(e.styleSheet)||t}catch{}return t}function eo(e){return"styleSheet"in e}function to(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function ro(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var xe,sr,no=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,oo=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,io=/^(data:)([^,]*),(.*)/i;function rt(e,t){return(e||"").replace(no,function(r,n,o,i,l,c){var a=o||l||c,s=n||i||"";if(!a)return r;if(!oo.test(a)||io.test(a))return"url(".concat(s).concat(a).concat(s,")");if(a[0]==="/")return"url(".concat(s).concat(ro(t)+a).concat(s,")");var u=t.split("/"),d=a.split("/");u.pop();for(var h=0,m=d;h<m.length;h++){var p=m[h];p!=="."&&(p===".."?u.pop():u.push(p))}return"url(".concat(s).concat(u.join("/")).concat(s,")")})}var so=/^[^ \t\n\r\u000c]+/,ao=/^[, \t\n\r\u000c]+/;function lo(e,t){if(t.trim()==="")return t;var r=0;function n(s){var u,d=s.exec(t.substring(r));return d?(u=d[0],r+=u.length,u):""}for(var o=[];n(ao),!(r>=t.length);){var i=n(so);if(i.slice(-1)===",")i=nt(e,i.substring(0,i.length-1)),o.push(i);else{var l="";i=nt(e,i);for(var c=!1;;){var a=t.charAt(r);if(a===""){o.push((i+l).trim());break}else if(c)a===")"&&(c=!1);else if(a===","){r+=1,o.push((i+l).trim());break}else a==="("&&(c=!0);l+=a,r+=1}}}return o.join(", ")}function nt(e,t){if(!t||t.trim()==="")return t;var r=e.createElement("a");return r.href=t,r.href}function co(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function wt(){var e=document.createElement("a");return e.href="",e.href}function ar(e,t,r,n){return r==="src"||r==="href"&&n&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n&&n[0]!=="#"||r==="background"&&n&&(t==="table"||t==="td"||t==="th")?nt(e,n):r==="srcset"&&n?lo(e,n):r==="style"&&n?rt(n,wt()):t==="object"&&r==="data"&&n?nt(e,n):n}function lr(e,t,r){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return r?e.matches(r):!1}function ot(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?ot(e.parentNode,t,r):!1;for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return r?ot(e.parentNode,t,r):!1}function cr(e,t,r){var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(n===null)return!1;if(typeof t=="string"){if(n.classList.contains(t)||n.closest(".".concat(t)))return!0}else if(ot(n,t,!0))return!0;return!!(r&&(n.matches(r)||n.closest(r)))}function uo(e,t,r){var n=e.contentWindow;if(n){var o=!1,i;try{i=n.document.readyState}catch{return}if(i!=="complete"){var l=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(l),o=!0,t()});return}var c="about:blank";if(n.location.href!==c||e.src===c||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function ur(e){return e.getAttribute("href")?e.sheet!==null:!0}function dr(e,t,r){var n=!1,o;try{o=e.sheet}catch{return}if(!o){var i=setTimeout(function(){n||(t(),n=!0)},r);e.addEventListener("load",function(){clearTimeout(i),n=!0,t()})}}function ho(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector,l=t.maskTextClass,c=t.maskTextSelector,a=t.inlineStylesheet,s=t.maskInputOptions,u=s===void 0?{}:s,d=t.maskTextFn,h=t.maskInputFn,m=t.dataURLOptions,p=m===void 0?{}:m,f=t.inlineImages,y=t.recordCanvas,v=t.keepIframeSrcFn,b=t.newlyAddedElement,T=b===void 0?!1:b,C=t.enableStrictPrivacy,I=mo(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:_.Document,childNodes:[],compatMode:e.compatMode,rootId:I}:{type:_.Document,childNodes:[],rootId:I};case e.DOCUMENT_TYPE_NODE:return{type:_.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:return fo(e,{doc:r,blockClass:o,blockSelector:i,inlineStylesheet:a,maskInputOptions:u,maskInputFn:h,maskTextClass:l,dataURLOptions:p,inlineImages:f,recordCanvas:y,keepIframeSrcFn:v,newlyAddedElement:T,enableStrictPrivacy:C,rootId:I});case e.TEXT_NODE:return po(e,{maskTextClass:l,maskTextSelector:c,maskTextFn:d,enableStrictPrivacy:C,rootId:I});case e.CDATA_SECTION_NODE:return{type:_.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return{type:_.Comment,textContent:e.textContent||"",rootId:I};default:return!1}}function mo(e,t){if(t.hasNode(e)){var r=t.getId(e);return r===1?void 0:r}}function po(e,t){var r,n=t.maskTextClass,o=t.maskTextSelector,i=t.maskTextFn,l=t.enableStrictPrivacy,c=t.rootId,a=e.parentNode&&e.parentNode.tagName,s=e.textContent,u=a==="STYLE"?!0:void 0,d=a==="SCRIPT"?!0:void 0,h=!1;if(u&&s){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(s=to(e.parentNode.sheet))}catch(p){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(p),e)}s=rt(s,wt()),h=!0}if(d?(s="SCRIPT_PLACEHOLDER",h=!0):a==="NOSCRIPT"&&(s="",h=!0),!u&&!d&&s&&cr(e,n,o)&&(s=i?i(s):s.replace(/[\S]/g,"*")),l&&!h&&a){var m=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!m.has(a)&&s&&(s=bt(s))}return{type:_.Text,textContent:s||"",isStyle:u,rootId:c}}function fo(e,t){for(var r=t.doc,n=t.blockClass,o=t.blockSelector,i=t.inlineStylesheet,l=t.maskInputOptions,c=l===void 0?{}:l,a=t.maskInputFn,s=t.maskTextClass,u=t.dataURLOptions,d=u===void 0?{}:u,h=t.inlineImages,m=t.recordCanvas,p=t.keepIframeSrcFn,f=t.newlyAddedElement,y=f===void 0?!1:f,v=t.enableStrictPrivacy,b=t.rootId,T=lr(e,n,o),C=lr(e,s,null),I=Jn(e),w={},R=e.attributes.length,E=0;E<R;E++){var L=e.attributes[E];w[L.name]=ar(r,I,L.name,L.value)}if(I==="link"&&i){var $=Array.from(r.styleSheets).find(function(N){return N.href===e.href}),P=null;$&&(P=St($)),P&&(delete w.rel,delete w.href,w._cssText=rt(P,$.href))}if(I==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var P=St(e.sheet);P&&(w._cssText=rt(P,wt()))}if(I==="input"||I==="textarea"||I==="select"){var j=e.value;w.type!=="radio"&&w.type!=="checkbox"&&w.type!=="submit"&&w.type!=="button"&&j?w.value=yt({type:w.type,tagName:I,value:j,maskInputOptions:c,maskInputFn:a}):e.checked&&(w.checked=e.checked)}if(I==="option"&&(e.selected&&!c.select?w.selected=!0:delete w.selected),I==="canvas"&&m){if(e.__context==="2d")Xn(e)||(w.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var U=e.toDataURL(d.type,d.quality),Y=document.createElement("canvas");Y.width=e.width,Y.height=e.height;var V=Y.toDataURL(d.type,d.quality);U!==V&&(w.rr_dataURL=U)}}if(I==="img"&&h&&!T&&!C&&!v){xe||(xe=r.createElement("canvas"),sr=xe.getContext("2d"));var D=e,x=D.crossOrigin;D.crossOrigin="anonymous";var F=function(){try{xe.width=D.naturalWidth,xe.height=D.naturalHeight,sr.drawImage(D,0,0),w.rr_dataURL=xe.toDataURL(d.type,d.quality)}catch(N){console.warn("Cannot inline img src=".concat(D.currentSrc,"! Error: ").concat(N))}x?w.crossOrigin=x:D.removeAttribute("crossorigin")};D.complete&&D.naturalWidth!==0?F():D.onload=F}if((I==="audio"||I==="video")&&(w.rr_mediaState=e.paused?"paused":"played",w.rr_mediaCurrentTime=e.currentTime),y||(e.scrollLeft&&(w.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(w.rr_scrollTop=e.scrollTop)),T||C||I==="img"&&v){var S=e.getBoundingClientRect(),g=S.width,M=S.height;w={class:w.class,rr_width:"".concat(g,"px"),rr_height:"".concat(M,"px")},v&&(T=!0)}return I==="iframe"&&!p(w.src)&&(e.contentDocument||(w.rr_src=w.src),delete w.src),{type:_.Element,tagName:I,attributes:w,childNodes:[],isSVG:co(e)||void 0,needBlock:T,needMask:C,rootId:b}}function Z(e){return e===void 0?"":e.toLowerCase()}function vo(e,t){return!!(t.comment&&e.type===_.Comment||e.type===_.Element&&(t.script&&(e.tagName==="script"||e.tagName==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js"))||t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(Z(e.attributes.name).match(/^msapplication-tile(image|color)$/)||Z(e.attributes.name)==="application-name"||Z(e.attributes.rel)==="icon"||Z(e.attributes.rel)==="apple-touch-icon"||Z(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&Z(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(Z(e.attributes.property).match(/^(og|twitter|fb):/)||Z(e.attributes.name).match(/^(og|twitter):/)||Z(e.attributes.name)==="pinterest")||t.headMetaRobots&&(Z(e.attributes.name)==="robots"||Z(e.attributes.name)==="googlebot"||Z(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(Z(e.attributes.name)==="author"||Z(e.attributes.name)==="generator"||Z(e.attributes.name)==="framework"||Z(e.attributes.name)==="publisher"||Z(e.attributes.name)==="progid"||Z(e.attributes.property).match(/^article:/)||Z(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(Z(e.attributes.name)==="google-site-verification"||Z(e.attributes.name)==="yandex-verification"||Z(e.attributes.name)==="csrf-token"||Z(e.attributes.name)==="p:domain_verify"||Z(e.attributes.name)==="verify-v1"||Z(e.attributes.name)==="verification"||Z(e.attributes.name)==="shopify-checkout-api-token"))))}function Ee(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector,l=t.maskTextClass,c=t.maskTextSelector,a=t.skipChild,s=a===void 0?!1:a,u=t.inlineStylesheet,d=u===void 0?!0:u,h=t.maskInputOptions,m=h===void 0?{}:h,p=t.maskTextFn,f=t.maskInputFn,y=t.slimDOMOptions,v=t.dataURLOptions,b=v===void 0?{}:v,T=t.inlineImages,C=T===void 0?!1:T,I=t.recordCanvas,w=I===void 0?!1:I,R=t.onSerialize,E=t.onIframeLoad,L=t.iframeLoadTimeout,$=L===void 0?5e3:L,P=t.onStylesheetLoad,j=t.stylesheetLoadTimeout,U=j===void 0?5e3:j,Y=t.keepIframeSrcFn,V=Y===void 0?function(){return!1}:Y,D=t.newlyAddedElement,x=D===void 0?!1:D,F=t.enableStrictPrivacy,S=t.preserveWhiteSpace,g=S===void 0?!0:S,M=ho(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,dataURLOptions:b,inlineImages:C,recordCanvas:w,keepIframeSrcFn:V,newlyAddedElement:x,enableStrictPrivacy:F});if(!M)return console.warn(e,"not serialized"),null;var N;if(n.hasNode(e)?N=n.getId(e):vo(M,y)||!g&&M.type===_.Text&&!M.isStyle&&!M.textContent.replace(/^\s+|\s+$/gm,"").length?N=Ge:N=qn(),N===Ge)return null;var k=Object.assign(M,{id:N});n.add(e,k),R&&R(e);var z=!s,G=F;if(k.type===_.Element){if(z=z&&!k.needBlock,G=F||!!k.needBlock||!!k.needMask,G&&k.tagName==="img"){var oe=e.cloneNode();oe.src="",n.add(oe,k)}delete k.needBlock,delete k.needMask;var B=e.shadowRoot;B&&Ve(B)&&(k.isShadowHost=!0)}if((k.type===_.Document||k.type===_.Element)&&z){y.headWhitespace&&k.type===_.Element&&k.tagName==="head"&&(g=!1);for(var X={doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:s,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:w,preserveWhiteSpace:g,onSerialize:R,onIframeLoad:E,iframeLoadTimeout:$,onStylesheetLoad:P,stylesheetLoadTimeout:U,keepIframeSrcFn:V,enableStrictPrivacy:G},ge=0,tt=Array.from(e.childNodes);ge<tt.length;ge++){var We=tt[ge],ye=Ee(We,X);ye&&k.childNodes.push(ye)}if(nr(e)&&e.shadowRoot)for(var rr=0,Ue=Array.from(e.shadowRoot.childNodes);rr<Ue.length;rr++){var We=Ue[rr],ye=Ee(We,X);ye&&(Ve(e.shadowRoot)&&(ye.isShadow=!0),k.childNodes.push(ye))}}return e.parentNode&&je(e.parentNode)&&Ve(e.parentNode)&&(k.isShadow=!0),k.type===_.Element&&k.tagName==="iframe"&&uo(e,function(){var be=e.contentDocument;if(be&&E){var Hn=Ee(be,{doc:be,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:w,preserveWhiteSpace:g,onSerialize:R,onIframeLoad:E,iframeLoadTimeout:$,onStylesheetLoad:P,stylesheetLoadTimeout:U,keepIframeSrcFn:V,enableStrictPrivacy:F});Hn&&E(e,Hn)}},$),k.type===_.Element&&k.tagName==="link"&&k.attributes.rel==="stylesheet"&&(dr(e,function(){if(P){var be=Ee(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:w,preserveWhiteSpace:g,onSerialize:R,onIframeLoad:E,iframeLoadTimeout:$,onStylesheetLoad:P,stylesheetLoadTimeout:U,keepIframeSrcFn:V,enableStrictPrivacy:F});be&&P(e,be)}},U),ur(e)===!1)||k.type===_.Element&&k.tagName==="link"&&k.attributes.rel==="stylesheet"&&(dr(e,function(){if(P){var be=Ee(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:w,preserveWhiteSpace:g,onSerialize:R,onIframeLoad:E,iframeLoadTimeout:$,enableStrictPrivacy:F,onStylesheetLoad:P,stylesheetLoadTimeout:U,keepIframeSrcFn:V});be&&P(e,be)}},U),ur(e)===!1)?null:k}function go(e,t){var r=t||{},n=r.mirror,o=n===void 0?new gt:n,i=r.blockClass,l=i===void 0?"highlight-block":i,c=r.blockSelector,a=c===void 0?null:c,s=r.maskTextClass,u=s===void 0?"highlight-mask":s,d=r.maskTextSelector,h=d===void 0?null:d,m=r.inlineStylesheet,p=m===void 0?!0:m,f=r.inlineImages,y=f===void 0?!1:f,v=r.recordCanvas,b=v===void 0?!1:v,T=r.maskAllInputs,C=T===void 0?!1:T,I=r.maskTextFn,w=r.maskInputFn,R=r.slimDOM,E=R===void 0?!1:R,L=r.dataURLOptions,$=r.preserveWhiteSpace,P=r.onSerialize,j=r.onIframeLoad,U=r.iframeLoadTimeout,Y=r.onStylesheetLoad,V=r.stylesheetLoadTimeout,D=r.keepIframeSrcFn,x=D===void 0?function(){return!1}:D,F=r.enableStrictPrivacy,S=F===void 0?!1:F,g=C===!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}:C===!1?{password:!0}:C,M=E===!0||E==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:E==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:E===!1?{}:E;return Ee(e,{doc:e,mirror:o,blockClass:l,blockSelector:a,maskTextClass:u,maskTextSelector:h,skipChild:!1,inlineStylesheet:p,maskInputOptions:g,maskTextFn:I,maskInputFn:w,slimDOMOptions:M,dataURLOptions:L,inlineImages:y,recordCanvas:b,preserveWhiteSpace:$,onSerialize:P,onIframeLoad:j,iframeLoadTimeout:U,onStylesheetLoad:Y,stylesheetLoadTimeout:V,keepIframeSrcFn:x,newlyAddedElement:!1,enableStrictPrivacy:S})}var hr=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function yo(e,t){t===void 0&&(t={});var r=1,n=1;function o(S){var g=S.match(/\n/g);g&&(r+=g.length);var M=S.lastIndexOf(`
|
|
2
|
+
`);n=M===-1?n+S.length:S.length-M}function i(){var S={line:r,column:n};return function(g){return g.position=new l(S),p(),g}}var l=function(){function S(g){this.start=g,this.end={line:r,column:n},this.source=t.source}return S}();l.prototype.content=e;var c=[];function a(S){var g=new Error("".concat(t.source||"",":").concat(r,":").concat(n,": ").concat(S));if(g.reason=S,g.filename=t.source,g.line=r,g.column=n,g.source=e,t.silent)c.push(g);else throw g}function s(){var S=h();return{type:"stylesheet",stylesheet:{source:t.source,rules:S,parsingErrors:c}}}function u(){return m(/^{\s*/)}function d(){return m(/^}/)}function h(){var S,g=[];for(p(),f(g);e.length&&e.charAt(0)!=="}"&&(S=x()||F());)S!==!1&&(g.push(S),f(g));return g}function m(S){var g=S.exec(e);if(g){var M=g[0];return o(M),e=e.slice(M.length),g}}function p(){m(/^\s*/)}function f(S){S===void 0&&(S=[]);for(var g;g=y();)g!==!1&&S.push(g),g=y();return S}function y(){var S=i();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var g=2;e.charAt(g)!==""&&(e.charAt(g)!=="*"||e.charAt(g+1)!=="/");)++g;if(g+=2,e.charAt(g-1)==="")return a("End of comment missing");var M=e.slice(2,g-2);return n+=2,o(M),e=e.slice(g),n+=2,S({type:"comment",comment:M})}}function v(){var S=m(/^([^{]+)/);if(S)return pe(S[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(g){return g.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(g){return g.replace(/\u200C/g,",")})}function b(){var S=i(),g=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(g){var M=pe(g[0]);if(!m(/^:\s*/))return a("property missing ':'");var N=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),k=S({type:"declaration",property:M.replace(hr,""),value:N?pe(N[0]).replace(hr,""):""});return m(/^[;\s]*/),k}}function T(){var S=[];if(!u())return a("missing '{'");f(S);for(var g;g=b();)g!==!1&&(S.push(g),f(S)),g=b();return d()?S:a("missing '}'")}function C(){for(var S,g=[],M=i();S=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)g.push(S[1]),m(/^,\s*/);if(g.length)return M({type:"keyframe",values:g,declarations:T()})}function I(){var S=i(),g=m(/^@([-\w]+)?keyframes\s*/);if(g){var M=g[1];if(g=m(/^([-\w]+)\s*/),!g)return a("@keyframes missing name");var N=g[1];if(!u())return a("@keyframes missing '{'");for(var k,z=f();k=C();)z.push(k),z=z.concat(f());return d()?S({type:"keyframes",name:N,vendor:M,keyframes:z}):a("@keyframes missing '}'")}}function w(){var S=i(),g=m(/^@supports *([^{]+)/);if(g){var M=pe(g[1]);if(!u())return a("@supports missing '{'");var N=f().concat(h());return d()?S({type:"supports",supports:M,rules:N}):a("@supports missing '}'")}}function R(){var S=i(),g=m(/^@host\s*/);if(g){if(!u())return a("@host missing '{'");var M=f().concat(h());return d()?S({type:"host",rules:M}):a("@host missing '}'")}}function E(){var S=i(),g=m(/^@media *([^{]+)/);if(g){var M=pe(g[1]);if(!u())return a("@media missing '{'");var N=f().concat(h());return d()?S({type:"media",media:M,rules:N}):a("@media missing '}'")}}function L(){var S=i(),g=m(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(g)return S({type:"custom-media",name:pe(g[1]),media:pe(g[2])})}function $(){var S=i(),g=m(/^@page */);if(g){var M=v()||[];if(!u())return a("@page missing '{'");for(var N=f(),k;k=b();)N.push(k),N=N.concat(f());return d()?S({type:"page",selectors:M,declarations:N}):a("@page missing '}'")}}function P(){var S=i(),g=m(/^@([-\w]+)?document *([^{]+)/);if(g){var M=pe(g[1]),N=pe(g[2]);if(!u())return a("@document missing '{'");var k=f().concat(h());return d()?S({type:"document",document:N,vendor:M,rules:k}):a("@document missing '}'")}}function j(){var S=i(),g=m(/^@font-face\s*/);if(g){if(!u())return a("@font-face missing '{'");for(var M=f(),N;N=b();)M.push(N),M=M.concat(f());return d()?S({type:"font-face",declarations:M}):a("@font-face missing '}'")}}var U=D("import"),Y=D("charset"),V=D("namespace");function D(S){var g=new RegExp("^@"+S+"\\s*([^;]+);");return function(){var M=i(),N=m(g);if(N){var k={type:S};return k[S]=N[1].trim(),M(k)}}}function x(){if(e[0]==="@")return I()||E()||L()||w()||U()||Y()||V()||P()||$()||R()||j()}function F(){var S=i(),g=v();return g?(f(),S({type:"rule",selectors:g,declarations:T()})):a("selector missing")}return Tt(s())}function pe(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Tt(e,t){for(var r=e&&typeof e.type=="string",n=r?e:t,o=0,i=Object.keys(e);o<i.length;o++){var l=i[o],c=e[l];Array.isArray(c)?c.forEach(function(a){Tt(a,n)}):c&&typeof c=="object"&&Tt(c,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var mr={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 bo(e){var t=mr[e.tagName]?mr[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function So(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var pr=/([^\\]):hover/,wo=new RegExp(pr.source,"g");function fr(e,t){var r;if(!(!((r=window?.HIG_CONFIGURATION)===null||r===void 0)&&r.enableOnHoverClass))return e;var n=t?.stylesWithHoverClass.get(e);if(n)return n;var o=yo(e,{silent:!0});if(!o.stylesheet)return e;var i=[];if(o.stylesheet.rules.forEach(function(a){"selectors"in a&&(a.selectors||[]).forEach(function(s){pr.test(s)&&i.push(s)})}),i.length===0)return e;var l=new RegExp(i.filter(function(a,s){return i.indexOf(a)===s}).sort(function(a,s){return s.length-a.length}).map(function(a){return So(a)}).join("|"),"g"),c=e.replace(l,function(a){var s=a.replace(wo,"$1.\\:hover");return"".concat(a,", ").concat(s)});return t?.stylesWithHoverClass.set(e,c),c}function vr(){var e=new Map;return{stylesWithHoverClass:e}}function To(e,t){var r=t.doc,n=t.hackCss,o=t.cache;switch(e.type){case _.Document:return r.implementation.createDocument(null,"",null);case _.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case _.Element:{var i=bo(e),l;e.isSVG?l=r.createElementNS("http://www.w3.org/2000/svg",i):l=r.createElement(i);var c=function(d){if(!Object.prototype.hasOwnProperty.call(e.attributes,d))return"continue";var h=e.attributes[d];if(i==="option"&&d==="selected"&&h===!1)return"continue";if(h=typeof h=="boolean"||typeof h=="number"?"":h,d.startsWith("rr_")){if(i==="canvas"&&d==="rr_dataURL"){var m=document.createElement("img");m.onload=function(){var L=l.getContext("2d");L&&L.drawImage(m,0,0,m.width,m.height)},m.src=h,l.RRNodeType&&(l.rr_dataURL=h)}else if(i==="img"&&d==="rr_dataURL"){var p=l;p.currentSrc.startsWith("data:")||(p.setAttribute("rrweb-original-src",e.attributes.src),p.src=h,p.setAttribute("rrweb-inline-src",h))}if(d==="rr_width")l.style.width=h;else if(d==="rr_height")l.style.height=h;else if(d==="rr_mediaCurrentTime")l.currentTime=e.attributes.rr_mediaCurrentTime;else if(d==="rr_mediaState")switch(h){case"played":l.play().catch(function(L){return console.warn("media playback error",L)});break;case"paused":l.pause();break}}else{var f=i==="textarea"&&d==="value",y=i==="style"&&d==="_cssText";if(y&&n&&(h=fr(h,o),typeof h=="string")){for(var v=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,b=void 0,T=[],C="https://replay-cors-proxy.highlightrun.workers.dev";(b=v.exec(h))!==null;)b.index===v.lastIndex&&v.lastIndex++,b.forEach(function(L,$){if($===0){var P=L.slice(5,L.length-2);T.push({originalUrl:P,proxyUrl:P.replace(P,"".concat(C,"?url=").concat(P))})}});T.forEach(function(L){h=h.replace(L.originalUrl,L.proxyUrl)})}if(f||y){for(var I=r.createTextNode(h),w=0,R=Array.from(l.childNodes);w<R.length;w++){var E=R[w];E.nodeType===l.TEXT_NODE&&l.removeChild(E)}return l.appendChild(I),"continue"}try{if(e.isSVG&&d==="xlink:href")l.setAttributeNS("http://www.w3.org/1999/xlink",d,h);else if(d==="onload"||d==="onclick"||d.substring(0,7)==="onmouse")l.setAttribute("_"+d,h);else{if(i==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&d==="content")return l.setAttribute("csp-content",h),"continue";i==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||i==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")||(i==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?l.setAttribute("rrweb-original-srcset",e.attributes.srcset):l.setAttribute(d,h))}}catch{}}};for(var a in e.attributes)c(a);if(i==="img"){var s=l;if(!s.currentSrc.startsWith("data:")){var u=s.getAttribute("rrweb-inline-src");u!=null&&u.startsWith("data:")&&(s.src=u)}}if(e.isShadowHost)if(!l.shadowRoot)l.attachShadow({mode:"open"});else for(;l.shadowRoot.firstChild;)l.shadowRoot.removeChild(l.shadowRoot.firstChild);return l}case _.Text:return r.createTextNode(e.isStyle&&n?fr(e.textContent,o):e.textContent);case _.CDATA:return r.createCDATASection(e.textContent);case _.Comment:return r.createComment(e.textContent);default:return null}}function it(e,t){var r=t.doc,n=t.mirror,o=t.skipChild,i=o===void 0?!1:o,l=t.hackCss,c=l===void 0?!0:l,a=t.afterAppend,s=t.cache,u=To(e,{doc:r,hackCss:c,cache:s});if(!u)return null;if(e.rootId&&console.assert(n.getNode(e.rootId)===r,"Target document should have the same root id."),e.type===_.Document&&(r.close(),r.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==_.DocumentType&&(e.childNodes[0].type===_.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=r),n.add(u,e),(e.type===_.Document||e.type===_.Element)&&!i)for(var d=0,h=e.childNodes;d<h.length;d++){var m=h[d],p=it(m,{doc:r,mirror:n,skipChild:!1,hackCss:c,afterAppend:a,cache:s});if(!p){console.warn("Failed to rebuild",m);continue}m.isShadow&&nr(u)&&u.shadowRoot?u.shadowRoot.appendChild(p):u.appendChild(p),a&&a(p)}return u}function No(e,t){function r(l){t(l)}for(var n=0,o=e.getIds();n<o.length;n++){var i=o[n];e.has(i)&&r(e.getNode(i))}}function Eo(e,t){var r=t.getMeta(e);if(r?.type===_.Element){var n=e;for(var o in r.attributes)if(Object.prototype.hasOwnProperty.call(r.attributes,o)&&o.startsWith("rr_")){var i=r.attributes[o];o==="rr_scrollLeft"&&(n.scrollLeft=i),o==="rr_scrollTop"&&(n.scrollTop=i)}}}function Co(e,t){var r=t.doc,n=t.onVisit,o=t.hackCss,i=o===void 0?!0:o,l=t.afterAppend,c=t.cache,a=t.mirror,s=a===void 0?new gt:a,u=it(e,{doc:r,mirror:s,skipChild:!1,hackCss:i,afterAppend:l,cache:c});return No(s,function(d){n&&n(d),Eo(d,s)}),u}function ie(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Oe=`Please stop import mirror directly. Instead of that,\r
|
|
3
3
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
4
|
-
or you can use record.mirror to access the mirror instance during recording.`;q.mirror={map:{},getId(){return console.error(Oe),-1},getNode(){return console.error(Oe),null},removeNodeFromMap(){console.error(Oe)},has(){return console.error(Oe),!1},reset(){console.error(Oe)}},typeof window<"u"&&window.Proxy&&window.Reflect&&(q.mirror=new Proxy(q.mirror,{get(e,t,r){return t==="map"&&console.error(Oe),Reflect.get(e,t,r)}}));function Re(e,t,r={}){let n=null,o=0;return function(...i){const l=Date.now();!o&&r.leading===!1&&(o=l);const c=t-(l-o),a=this;c<=0||c>t?(n&&(clearTimeout(n),n=null),o=l,e.apply(a,i)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(a,i)},c))}}function Be(e,t,r,n,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(l){setTimeout(()=>{r.set.call(this,l)},0),i&&i.set&&i.set.call(this,l)}}),()=>Be(e,t,i||{},!0)}function Se(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],o=r(n);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch{return()=>{}}}function Nt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Et(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}const gr=e=>{try{if(e instanceof HTMLElement)return e.tagName==="CANVAS"}catch{return!1}return!1};function se(e,t,r){if(!e)return!1;const n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!n)return!1;if(typeof t=="string"){if(n.classList.contains(t)||r&&n.closest("."+t)!==null)return!0}else if(ot(n,t,r))return!0;return!1}function yr(e,t){return t.getId(e)!==-1}function st(e,t){return t.getId(e)===Ge}function Ct(e,t){if(je(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?Ct(e.parentNode,t):!0:!0}function It(e){return Boolean(e.changedTouches)}function Mt(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let r=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===r)return!0;while(r=r&&r.parentNode);return!1})}function br(e){const t={},r=(o,i)=>{const l={value:o,parent:i,children:[]};return t[o.node.id]=l,l},n=[];for(const o of e){const{nextId:i,parentId:l}=o;if(i&&i in t){const c=t[i];if(c.parent){const a=c.parent.children.indexOf(c);c.parent.children.splice(a,0,r(o,c.parent))}else{const a=n.indexOf(c);n.splice(a,0,r(o,null))}continue}if(l in t){const c=t[l];c.children.push(r(o,c));continue}n.push(r(o,null))}return n}function xt(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)xt(e.children[r],t)}function De(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function kt(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Ot(e,t){var r,n;const o=(n=(r=e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:n.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const i=o.getBoundingClientRect(),l=Ot(o,t),c=i.height/o.clientHeight;return{x:i.x*l.relativeScale+l.x,y:i.y*l.relativeScale+l.y,relativeScale:c,absoluteScale:l.absoluteScale*c}}function ze(e){return Boolean(e?.shadowRoot)}function Le(e,t){const r=e[t[0]];return t.length===1?r:Le(r.cssRules[t[1]].cssRules,t.slice(2))}function Rt(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function Sr(e){const t=new Set,r=[];for(let n=e.length;n--;){const o=e[n];t.has(o.id)||(r.push(o),t.add(o.id))}return r}var Io=Object.freeze({__proto__:null,on:ie,get _mirror(){return q.mirror},throttle:Re,hookSetter:Be,patch:Se,getWindowHeight:Nt,getWindowWidth:Et,isCanvasNode:gr,isBlocked:se,isSerialized:yr,isIgnored:st,isAncestorRemoved:Ct,isTouchEvent:It,polyfill:Mt,queueToResolveTrees:br,iterateResolveTree:xt,isSerializedIframe:De,isSerializedStylesheet:kt,getBaseDimension:Ot,hasShadowRoot:ze,getNestedRule:Le,getPositionsAndIndex:Rt,uniqueTextMutations:Sr}),R=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(R||{}),A=(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))(A||{}),ee=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(ee||{}),fe=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(fe||{}),Ce=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(Ce||{}),H=(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))(H||{});function wr(e){return"__ln"in e}class Mo{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){const r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&wr(t.previousSibling)){const n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&wr(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;this.length++}removeNode(t){const r=t.__ln;!this.head||(r.previous?(r.previous.next=r.next,r.next&&(r.next.previous=r.previous)):(this.head=r.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}}const Tr=(e,t)=>`${e}@${t}`;class xo{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],r=new Mo,n=c=>{let a=c,s=Ge;for(;s===Ge;)a=a&&a.nextSibling,s=a&&this.mirror.getId(a);return s},o=c=>{var a,s,u,d,h;const m=c.getRootNode?(a=c.getRootNode())==null?void 0:a.host:null;let p=m;for(;(u=(s=p?.getRootNode)==null?void 0:s.call(p))!=null&&u.host;)p=((h=(d=p?.getRootNode)==null?void 0:d.call(p))==null?void 0:h.host)||null;const f=!this.doc.contains(c)&&(!p||!this.doc.contains(p));if(!c.parentNode||f)return;const y=je(c.parentNode)?this.mirror.getId(m):this.mirror.getId(c.parentNode),v=n(c);if(y===-1||v===-1)return r.addNode(c);const b=Ee(c,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,enableStrictPrivacy:this.enableStrictPrivacy,onSerialize:N=>{De(N,this.mirror)&&this.iframeManager.addIframe(N),kt(N,this.mirror)&&this.stylesheetManager.addStylesheet(N),ze(c)&&this.shadowDomManager.addShadowRoot(c.shadowRoot,document)},onIframeLoad:(N,T)=>{this.iframeManager.attachIframe(N,T,this.mirror),this.shadowDomManager.observeAttachShadow(N)},onStylesheetLoad:(N,T)=>{this.stylesheetManager.attachStylesheet(N,T,this.mirror)}});b&&t.push({parentId:y,nextId:v,node:b})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const c of Array.from(this.movedSet.values()))Nr(this.removes,c,this.mirror)&&!this.movedSet.has(c.parentNode)||o(c);for(const c of Array.from(this.addedSet.values()))!Cr(this.droppedSet,c)&&!Nr(this.removes,c,this.mirror)||Cr(this.movedSet,c)?o(c):this.droppedSet.add(c);let i=null;for(;r.length;){let c=null;if(i){const a=this.mirror.getId(i.value.parentNode),s=n(i.value);a!==-1&&s!==-1&&(c=i)}if(!c)for(let a=r.length-1;a>=0;a--){const s=r.get(a);if(s){const u=this.mirror.getId(s.value.parentNode),d=n(s.value);if(u!==-1&&d!==-1){c=s;break}}}if(!c){for(;r.head;)r.removeNode(r.head.value);break}i=c.previous,r.removeNode(c.value),o(c.value)}const l={texts:this.texts.map(c=>{let a=c.value;return this.enableStrictPrivacy&&a&&(a=bt(a)),{id:this.mirror.getId(c.node),value:a}}).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>({id:this.mirror.getId(c.node),attributes:c.attributes})).filter(c=>this.mirror.has(c.id)),removes:this.removes,adds:t};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(l))},this.processMutation=t=>{if(!st(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!se(t.target,this.blockClass,!1)&&r!==t.oldValue&&this.texts.push({value:cr(t.target,this.maskTextClass,this.maskTextSelector)&&r?this.maskTextFn?this.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let n=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(n=yt({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),se(t.target,this.blockClass,!1)||n===t.oldValue)return;let o=this.attributes.find(i=>i.node===t.target);if(r.tagName==="IFRAME"&&t.attributeName==="src"&&!this.keepIframeSrcFn(n))if(!r.contentDocument)t.attributeName="rr_src";else return;if(o||(o={node:t.target,attributes:{}},this.attributes.push(o)),t.attributeName==="style"){const i=this.doc.createElement("span");t.oldValue&&i.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});const l=o.attributes.style;for(const c of Array.from(r.style)){const a=r.style.getPropertyValue(c),s=r.style.getPropertyPriority(c);(a!==i.style.getPropertyValue(c)||s!==i.style.getPropertyPriority(c))&&(s===""?l[c]=a:l[c]=[a,s])}for(const c of Array.from(i.style))r.style.getPropertyValue(c)===""&&(l[c]=!1)}else{if(t.target.tagName==="INPUT"){const i=t.target;if(i.type==="password"){o.attributes.value="*".repeat(i.value.length);break}}o.attributes[t.attributeName]=ar(this.doc,r.tagName,t.attributeName,n)}break}case"childList":{if(se(t.target,this.blockClass,!0))return;t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const n=this.mirror.getId(r),o=je(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);se(t.target,this.blockClass,!1)||st(r,this.mirror)||!yr(r,this.mirror)||(this.addedSet.has(r)?(Dt(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||Ct(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Tr(n,o)]?Dt(this.movedSet,r):this.removes.push({parentId:o,id:n,isShadow:je(t.target)&&Ve(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(this.mirror.hasNode(t)){if(st(t,this.mirror))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[Tr(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);se(t,this.blockClass,!1)||t.childNodes.forEach(n=>this.genAdds(n))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","enableStrictPrivacy"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Dt(e,t){e.delete(t),t.childNodes.forEach(r=>Dt(e,r))}function Nr(e,t,r){return e.length===0?!1:Er(e,t,r)}function Er(e,t,r){const{parentNode:n}=t;if(!n)return!1;const o=r.getId(n);return e.some(i=>i.id===o)?!0:Er(e,n,r)}function Cr(e,t){return e.size===0?!1:Ir(e,t)}function Ir(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:Ir(e,r):!1}var ko=Object.defineProperty,Oo=Object.defineProperties,Ro=Object.getOwnPropertyDescriptors,Mr=Object.getOwnPropertySymbols,Do=Object.prototype.hasOwnProperty,Lo=Object.prototype.propertyIsEnumerable,xr=(e,t,r)=>t in e?ko(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kr=(e,t)=>{for(var r in t||(t={}))Do.call(t,r)&&xr(e,r,t[r]);if(Mr)for(var r of Mr(t))Lo.call(t,r)&&xr(e,r,t[r]);return e},Ao=(e,t)=>Oo(e,Ro(t));const Ie=[],Or=typeof CSSGroupingRule<"u",Rr=typeof CSSMediaRule<"u",Dr=typeof CSSSupportsRule<"u",Lr=typeof CSSConditionRule<"u";function He(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch{return e.target}}function Ar(e,t){var r,n;const o=new xo;Ie.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver;const l=(n=(r=window?.Zone)==null?void 0:r.__symbol__)==null?void 0:n.call(r,"MutationObserver");l&&window[l]&&(i=window[l]);const c=new i(o.processMutations.bind(o));return c.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),c}function Po({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let l=[],c;const a=Re(d=>{const h=Date.now()-c;e(l.map(m=>(m.timeOffset-=h,m)),d),l=[],c=null},i),s=Re(d=>{const h=He(d),{clientX:m,clientY:p}=It(d)?d.changedTouches[0]:d;c||(c=Date.now()),l.push({x:m,y:p,id:n.getId(h),timeOffset:Date.now()-c}),a(typeof DragEvent<"u"&&d instanceof DragEvent?A.Drag:d instanceof MouseEvent?A.MouseMove:A.TouchMove)},o,{trailing:!1}),u=[ie("mousemove",s,r),ie("touchmove",s,r),ie("drag",s,r)];return()=>{u.forEach(d=>d())}}function Fo({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const i=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[],c=a=>s=>{const u=He(s);if(se(u,n,!0)||gr(u))return;const d=It(s)?s.changedTouches[0]:s;if(!d)return;const h=r.getId(u),{clientX:m,clientY:p}=d;e({type:ee[a],id:h,x:m,y:p})};return Object.keys(ee).filter(a=>Number.isNaN(Number(a))&&!a.endsWith("_Departed")&&i[a]!==!1).forEach(a=>{const s=a.toLowerCase(),u=c(a);l.push(ie(s,u,t))}),()=>{l.forEach(a=>a())}}function Pr({scrollCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){const i=Re(l=>{const c=He(l);if(!c||se(c,n,!0))return;const a=r.getId(c);if(c===t){const s=t.scrollingElement||t.documentElement;e({id:a,x:s.scrollLeft,y:s.scrollTop})}else e({id:a,x:c.scrollLeft,y:c.scrollTop})},o.scroll||100);return ie("scroll",i,t)}function _o({viewportResizeCb:e}){let t=-1,r=-1;const n=Re(()=>{const o=Nt(),i=Et();(t!==o||r!==i)&&(e({width:Number(i),height:Number(o)}),t=o,r=i)},200);return ie("resize",n,window)}function Fr(e,t){const r=kr({},e);return t||delete r.userTriggered,r}const $o=["INPUT","TEXTAREA","SELECT"],_r=new WeakMap;function Wo({inputCb:e,doc:t,mirror:r,blockClass:n,ignoreClass:o,maskInputOptions:i,maskInputFn:l,sampling:c,userTriggeredOnInput:a}){function s(p){let f=He(p);const y=p.isTrusted;if(f&&f.tagName==="OPTION"&&(f=f.parentElement),!f||!f.tagName||$o.indexOf(f.tagName)<0||se(f,n,!0))return;const v=f.type;if(f.classList.contains(o))return;let b=f.value,N=!1;v==="radio"||v==="checkbox"?N=f.checked:(i[f.tagName.toLowerCase()]||i[v])&&(b=yt({maskInputOptions:i,tagName:f.tagName,type:v,value:b,maskInputFn:l})),u(f,Fr({text:b,isChecked:N,userTriggered:y},a));const T=f.name;v==="radio"&&T&&N&&t.querySelectorAll(`input[type="radio"][name="${T}"]`).forEach(w=>{w!==f&&u(w,Fr({text:w.value,isChecked:!N,userTriggered:!1},a))})}function u(p,f){const y=_r.get(p);if(!y||y.text!==f.text||y.isChecked!==f.isChecked){_r.set(p,f);const v=r.getId(p);e(Ao(kr({},f),{id:v}))}}const d=(c.input==="last"?["change"]:["input","change"]).map(p=>ie(p,s,t)),h=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),m=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return h&&h.set&&d.push(...m.map(p=>Be(p[0],p[1],{set(){s({target:this})}}))),()=>{d.forEach(p=>p())}}function at(e){const t=[];function r(n,o){if(Or&&n.parentRule instanceof CSSGroupingRule||Rr&&n.parentRule instanceof CSSMediaRule||Dr&&n.parentRule instanceof CSSSupportsRule||Lr&&n.parentRule instanceof CSSConditionRule){const i=Array.from(n.parentRule.cssRules).indexOf(n);o.unshift(i)}else{const i=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(i)}return o}return r(e,t)}function Uo({styleSheetRuleCb:e,mirror:t},{win:r}){const n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(c,a){const s=t.getId(this.ownerNode);return s!==-1&&e({id:s,adds:[{rule:c,index:a}]}),n.apply(this,[c,a])};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=function(c){const a=t.getId(this.ownerNode);return a!==-1&&e({id:a,removes:[{index:c}]}),o.apply(this,[c])};const i={};Or?i.CSSGroupingRule=r.CSSGroupingRule:(Rr&&(i.CSSMediaRule=r.CSSMediaRule),Lr&&(i.CSSConditionRule=r.CSSConditionRule),Dr&&(i.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(i).forEach(([c,a])=>{l[c]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=function(s,u){const d=t.getId(this.parentStyleSheet.ownerNode);return d!==-1&&e({id:d,adds:[{rule:s,index:[...at(this),u||0]}]}),l[c].insertRule.apply(this,[s,u])},a.prototype.deleteRule=function(s){const u=t.getId(this.parentStyleSheet.ownerNode);return u!==-1&&e({id:u,removes:[{index:[...at(this),s]}]}),l[c].deleteRule.apply(this,[s])}}),()=>{r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=o,Object.entries(i).forEach(([c,a])=>{a.prototype.insertRule=l[c].insertRule,a.prototype.deleteRule=l[c].deleteRule})}}function jo({styleDeclarationCb:e,mirror:t},{win:r}){const n=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=function(i,l,c){var a,s;const u=t.getId((s=(a=this.parentRule)==null?void 0:a.parentStyleSheet)==null?void 0:s.ownerNode);return u!==-1&&e({id:u,set:{property:i,value:l,priority:c},index:at(this.parentRule)}),n.apply(this,[i,l,c])};const o=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=function(i){var l,c;const a=t.getId((c=(l=this.parentRule)==null?void 0:l.parentStyleSheet)==null?void 0:c.ownerNode);return a!==-1&&e({id:a,remove:{property:i},index:at(this.parentRule)}),o.apply(this,[i])},()=>{r.CSSStyleDeclaration.prototype.setProperty=n,r.CSSStyleDeclaration.prototype.removeProperty=o}}function Vo({mediaInteractionCb:e,blockClass:t,mirror:r,sampling:n}){const o=l=>Re(c=>{const a=He(c);if(!a||se(a,t,!0))return;const{currentTime:s,volume:u,muted:d}=a;e({type:l,id:r.getId(a),currentTime:s,volume:u,muted:d})},n.media||500),i=[ie("play",o(Ce.Play)),ie("pause",o(Ce.Pause)),ie("seeked",o(Ce.Seeked)),ie("volumechange",o(Ce.VolumeChange))];return()=>{i.forEach(l=>l())}}function Go({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,i=r.FontFace;r.FontFace=function(c,a,s){const u=new i(c,a,s);return o.set(u,{family:c,buffer:typeof a!="string",descriptors:s,fontSource:typeof a=="string"?a:JSON.stringify(Array.from(new Uint8Array(a)))}),u};const l=Se(t.fonts,"add",function(c){return function(a){return setTimeout(()=>{const s=o.get(a);s&&(e(s),o.delete(a))},0),c.apply(this,[a])}});return n.push(()=>{r.FontFace=i}),n.push(l),()=>{n.forEach(c=>c())}}function Bo(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:l,inputCb:c,mediaInteractionCb:a,styleSheetRuleCb:s,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h}=e;e.mutationCb=(...m)=>{t.mutation&&t.mutation(...m),r(...m)},e.mousemoveCb=(...m)=>{t.mousemove&&t.mousemove(...m),n(...m)},e.mouseInteractionCb=(...m)=>{t.mouseInteraction&&t.mouseInteraction(...m),o(...m)},e.scrollCb=(...m)=>{t.scroll&&t.scroll(...m),i(...m)},e.viewportResizeCb=(...m)=>{t.viewportResize&&t.viewportResize(...m),l(...m)},e.inputCb=(...m)=>{t.input&&t.input(...m),c(...m)},e.mediaInteractionCb=(...m)=>{t.mediaInteaction&&t.mediaInteaction(...m),a(...m)},e.styleSheetRuleCb=(...m)=>{t.styleSheetRule&&t.styleSheetRule(...m),s(...m)},e.styleDeclarationCb=(...m)=>{t.styleDeclaration&&t.styleDeclaration(...m),u(...m)},e.canvasMutationCb=(...m)=>{t.canvasMutation&&t.canvasMutation(...m),d(...m)},e.fontCb=(...m)=>{t.font&&t.font(...m),h(...m)}}function zo(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};Bo(e,t);const n=Ar(e,e.doc),o=Po(e),i=Fo(e),l=Pr(e),c=_o(e),a=Wo(e),s=Vo(e),u=Uo(e,{win:r}),d=jo(e,{win:r}),h=e.collectFonts?Go(e):()=>{},m=[];for(const p of e.plugins)m.push(p.observer(p.callback,r,p.options));return()=>{Ie.forEach(p=>p.reset()),n.disconnect(),o(),i(),l(),c(),a(),s(),u(),d(),h(),m.forEach(p=>p())}}class Ho{constructor(t){this.iframes=new WeakMap,this.mutationCb=t.mutationCb}addIframe(t){this.iframes.set(t,!0)}addLoadListener(t){this.loadListener=t}attachIframe(t,r,n){var o;this.mutationCb({adds:[{parentId:n.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(o=this.loadListener)==null||o.call(this,t)}}var Yo=Object.defineProperty,Xo=Object.defineProperties,Zo=Object.getOwnPropertyDescriptors,$r=Object.getOwnPropertySymbols,Ko=Object.prototype.hasOwnProperty,qo=Object.prototype.propertyIsEnumerable,Wr=(e,t,r)=>t in e?Yo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ur=(e,t)=>{for(var r in t||(t={}))Ko.call(t,r)&&Wr(e,r,t[r]);if($r)for(var r of $r(t))qo.call(t,r)&&Wr(e,r,t[r]);return e},jr=(e,t)=>Xo(e,Zo(t));class Jo{constructor(t){this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;const r=this;this.restorePatches.push(Se(HTMLElement.prototype,"attachShadow",function(n){return function(o){const i=n.call(this,o);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),i}}))}addShadowRoot(t,r){!Ve(t)||(Ar(jr(Ur({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),Pr(jr(Ur({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})))}observeAttachShadow(t){if(t.contentWindow){const r=this;this.restorePatches.push(Se(t.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(o){const i=n.call(this,o);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,t.contentDocument),i}}))}}reset(){this.restorePatches.forEach(t=>t())}}for(var Ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ye=typeof Uint8Array>"u"?[]:new Uint8Array(256),lt=0;lt<Ae.length;lt++)Ye[Ae.charCodeAt(lt)]=lt;var Qo=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=Ae[t[r]>>2],o+=Ae[(t[r]&3)<<4|t[r+1]>>4],o+=Ae[(t[r+1]&15)<<2|t[r+2]>>6],o+=Ae[t[r+2]&63];return n%3===2?o=o.substring(0,o.length-1)+"=":n%3===1&&(o=o.substring(0,o.length-2)+"=="),o},ei=function(e){var t=e.length*.75,r=e.length,n,o=0,i,l,c,a;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var s=new ArrayBuffer(t),u=new Uint8Array(s);for(n=0;n<r;n+=4)i=Ye[e.charCodeAt(n)],l=Ye[e.charCodeAt(n+1)],c=Ye[e.charCodeAt(n+2)],a=Ye[e.charCodeAt(n+3)],u[o++]=i<<2|l>>4,u[o++]=(l&15)<<4|c>>2,u[o++]=(c&3)<<6|a&63;return s};const Vr=new Map;function ti(e,t){let r=Vr.get(e);return r||(r=new Map,Vr.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const Gr=(e,t,r)=>{if(!e||!(zr(e,t)||typeof e=="object"))return;const n=e.constructor.name,o=ti(r,n);let i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function ct(e,t,r){if(e instanceof Array)return e.map(n=>ct(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const n=e.constructor.name,o=Qo(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[ct(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const n=e.constructor.name,{src:o}=e;return{rr_type:n,src:o}}else if(e instanceof HTMLCanvasElement){const n="HTMLImageElement",o=e.toDataURL();return{rr_type:n,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[ct(e.data,t,r),e.width,e.height]};if(zr(e,t)||typeof e=="object"){const n=e.constructor.name,o=Gr(e,t,r);return{rr_type:n,index:o}}}}return e}const Br=(e,t,r)=>[...e].map(n=>ct(n,t,r)),zr=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(n=>typeof t[n]=="function");return Boolean(r.find(n=>e instanceof t[n]))};function ri(e,t,r,n){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const l of i)try{if(typeof t.CanvasRenderingContext2D.prototype[l]!="function")continue;const c=Se(t.CanvasRenderingContext2D.prototype,l,function(a){return function(...s){return se(this.canvas,r,!0)||setTimeout(()=>{const u=Br([...s],t,this);e(this.canvas,{type:fe["2D"],property:l,args:u})},0),a.apply(this,s)}});o.push(c)}catch{const a=Be(t.CanvasRenderingContext2D.prototype,l,{set(s){e(this.canvas,{type:fe["2D"],property:l,args:[s],setter:!0})}});o.push(a)}return()=>{o.forEach(l=>l())}}function Hr(e,t){const r=[];try{const n=Se(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(i,...l){return se(this,t,!0)||"__context"in this||(this.__context=i),o.apply(this,[i,...l])}});r.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(n=>n())}}function Yr(e,t,r,n,o,i){const l=[],c=Object.getOwnPropertyNames(e);for(const a of c)try{if(typeof e[a]!="function")continue;const s=Se(e,a,function(u){return function(...d){const h=u.apply(this,d);if(Gr(h,i,e),!se(this.canvas,n,!0)){const m=Br([...d],i,e),p={type:t,property:a,args:m};r(this.canvas,p)}return h}});l.push(s)}catch{const u=Be(e,a,{set(d){r(this.canvas,{type:t,property:a,args:[d],setter:!0})}});l.push(u)}return l}function ni(e,t,r,n){const o=[];return o.push(...Yr(t.WebGLRenderingContext.prototype,fe.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...Yr(t.WebGL2RenderingContext.prototype,fe.WebGL2,e,r,n,t)),()=>{o.forEach(i=>i())}}function oi(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),o=0,i=r.length;o<i;++o)n[o]=r.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}function ii(e,t,r){var n=t===void 0?null:t,o=r===void 0?!1:r,i=oi(e,o),l=i.indexOf(`
|
|
5
|
-
`,10)+1,c=i.substring(l)+(n?"//# sourceMappingURL="+n:""),a=new Blob([c],{type:"application/javascript"});return URL.createObjectURL(a)}function si(e,t,r){var n;return function(i){return n=n||ii(e,t,r),new Worker(n,i)}}var ai=si("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Zm9yKHZhciByPSJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvIixsPXR5cGVvZiBVaW50OEFycmF5PiJ1Ij9bXTpuZXcgVWludDhBcnJheSgyNTYpLGY9MDtmPHIubGVuZ3RoO2YrKylsW3IuY2hhckNvZGVBdChmKV09Zjt2YXIgZD1mdW5jdGlvbihzKXt2YXIgZT1uZXcgVWludDhBcnJheShzKSxuLGE9ZS5sZW5ndGgsdD0iIjtmb3Iobj0wO248YTtuKz0zKXQrPXJbZVtuXT4+Ml0sdCs9clsoZVtuXSYzKTw8NHxlW24rMV0+PjRdLHQrPXJbKGVbbisxXSYxNSk8PDJ8ZVtuKzJdPj42XSx0Kz1yW2VbbisyXSY2M107cmV0dXJuIGElMz09PTI/dD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTEpKyI9IjphJTM9PT0xJiYodD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTIpKyI9PSIpLHR9O2NvbnN0IGM9bmV3IE1hcCx1PW5ldyBNYXA7YXN5bmMgZnVuY3Rpb24gcChzLGUpe2NvbnN0IG49YCR7c30tJHtlfWA7aWYodS5oYXMobikpcmV0dXJuIHUuZ2V0KG4pO2NvbnN0IGE9bmV3IE9mZnNjcmVlbkNhbnZhcyhzLGUpO2EuZ2V0Q29udGV4dCgiMmQiKTtjb25zdCB0PWF3YWl0KGF3YWl0IGEuY29udmVydFRvQmxvYigpKS5hcnJheUJ1ZmZlcigpLGc9ZCh0KTtyZXR1cm4gdS5zZXQobixnKSxnfWNvbnN0IGk9c2VsZjtpLm9ubWVzc2FnZT1hc3luYyBmdW5jdGlvbihzKXtpZighKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcykpcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOnMuZGF0YS5pZH0pO2NvbnN0e2lkOmUsYml0bWFwOm4sd2lkdGg6YSxoZWlnaHQ6dH09cy5kYXRhLGc9cChhLHQpLGg9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2guZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCB3PWF3YWl0IGguY29udmVydFRvQmxvYigpLHk9dy50eXBlLGI9YXdhaXQgdy5hcnJheUJ1ZmZlcigpLG89ZChiKTtpZighYy5oYXMoZSkmJmF3YWl0IGc9PT1vKXJldHVybiBjLnNldChlLG8pLGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpZihjLmdldChlKT09PW8pcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpLnBvc3RNZXNzYWdlKHtpZDplLHR5cGU6eSxiYXNlNjQ6byx3aWR0aDphLGhlaWdodDp0fSksYy5zZXQoZSxvKX19KSgpOwoK",null,!1),Xr=Object.getOwnPropertySymbols,li=Object.prototype.hasOwnProperty,ci=Object.prototype.propertyIsEnumerable,ui=(e,t)=>{var r={};for(var n in e)li.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Xr)for(var n of Xr(e))t.indexOf(n)<0&&ci.call(e,n)&&(r[n]=e[n]);return r},di=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});class hi{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(l,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(c)};const{sampling:r="all",win:n,blockClass:o,recordCanvas:i}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,i&&r==="all"&&this.initCanvasMutationObserver(n,o),i&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,o)}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n){const o=Hr(r,n),i=new Map,l=new ai;l.onmessage=d=>{const{id:h}=d.data;if(i.set(h,!1),!("base64"in d.data))return;const{base64:m,type:p,width:f,height:y}=d.data;this.mutationCb({id:h,type:fe["2D"],commands:[{property:"clearRect",args:[0,0,f,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:m}],type:p}]},0,0]}]})};const c=1e3/t;let a=0,s;const u=d=>{if(a&&d-a<c){s=requestAnimationFrame(u);return}a=d,r.document.querySelectorAll(`canvas:not(.${n} *)`).forEach(h=>di(this,null,function*(){var m;const p=this.mirror.getId(h);if(i.get(p))return;if(i.set(p,!0),["webgl","webgl2"].includes(h.__context)){const y=h.getContext(h.__context);((m=y?.getContextAttributes())==null?void 0:m.preserveDrawingBuffer)===!1&&y?.clear(y.COLOR_BUFFER_BIT)}if(h.width===0||h.height===0)return;const f=yield createImageBitmap(h);l.postMessage({id:p,bitmap:f,width:h.width,height:h.height},[f])})),s=requestAnimationFrame(u)};s=requestAnimationFrame(u),this.resetObservers=()=>{o(),cancelAnimationFrame(s)}}initCanvasMutationObserver(t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=Hr(t,r),o=ri(this.processMutation.bind(this),t,r,this.mirror),i=ni(this.processMutation.bind(this),t,r,this.mirror);this.resetObservers=()=>{n(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const o=n.map(l=>ui(l,["type"])),{type:i}=n[0];this.mutationCb({id:r,type:i,commands:o}),this.pendingCanvasMutations.delete(t)}}class mi{constructor(t){this.trackedStylesheets=new WeakSet,this.mutationCb=t.mutationCb}addStylesheet(t){this.trackedStylesheets.has(t)||(this.trackedStylesheets.add(t),this.trackStylesheet(t))}trackStylesheet(t){}attachStylesheet(t,r,n){this.mutationCb({adds:[{parentId:n.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[]}),this.addStylesheet(t)}}var pi=Object.defineProperty,fi=Object.defineProperties,vi=Object.getOwnPropertyDescriptors,Zr=Object.getOwnPropertySymbols,gi=Object.prototype.hasOwnProperty,yi=Object.prototype.propertyIsEnumerable,Kr=(e,t,r)=>t in e?pi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ae=(e,t)=>{for(var r in t||(t={}))gi.call(t,r)&&Kr(e,r,t[r]);if(Zr)for(var r of Zr(t))yi.call(t,r)&&Kr(e,r,t[r]);return e},bi=(e,t)=>fi(e,vi(t));function te(e){return bi(ae({},e),{timestamp:Date.now()})}let Q,Xe;const de=or();function Me(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="highlight-block",blockSelector:i=null,ignoreClass:l="highlight-ignore",maskTextClass:c="highlight-mask",maskTextSelector:a=null,inlineStylesheet:s=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:h,maskInputFn:m,maskTextFn:p=bt,hooks:f,packFn:y,sampling:v={},mousemoveWait:b,recordCanvas:N=!1,userTriggeredOnInput:T=!1,collectFonts:w=!1,inlineImages:x=!1,plugins:k,keepIframeSrcFn:E=()=>!1,enableStrictPrivacy:L=!1}=e;if(!t)throw new Error("emit function is required");b!==void 0&&v.mousemove===void 0&&(v.mousemove=b),de.reset();const P=u===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:d!==void 0?d:{password:!0},V=h===!0||h==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:h==="all",headMetaDescKeywords:h==="all"}:h||{};Mt();let G,U=0;const Y=C=>{for(const M of k||[])M.eventProcessor&&(C=M.eventProcessor(C));return y&&(C=y(C)),C};Q=(C,M)=>{var z;if(((z=Ie[0])==null?void 0:z.isFrozen())&&C.type!==R.FullSnapshot&&!(C.type===R.IncrementalSnapshot&&C.data.source===A.Mutation)&&Ie.forEach(j=>j.unfreeze()),t(Y(C),M),C.type===R.FullSnapshot)G=C,U=0;else if(C.type===R.IncrementalSnapshot){if(C.data.source===A.Mutation&&C.data.isAttachIframe)return;U++;const j=n&&U>=n,oe=r&&C.timestamp-G.timestamp>r;(j||oe)&&Xe(!0)}};const D=C=>{Q(te({type:R.IncrementalSnapshot,data:ae({source:A.Mutation},C)}))},F=C=>Q(te({type:R.IncrementalSnapshot,data:ae({source:A.Scroll},C)})),O=C=>Q(te({type:R.IncrementalSnapshot,data:ae({source:A.CanvasMutation},C)})),_=new Ho({mutationCb:D}),S=new mi({mutationCb:D}),g=new hi({recordCanvas:N,mutationCb:O,win:window,blockClass:o,mirror:de,sampling:v.canvas}),I=new Jo({mutationCb:D,scrollCb:F,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:a,inlineStylesheet:s,maskInputOptions:P,maskTextFn:p,maskInputFn:m,recordCanvas:N,inlineImages:x,sampling:v,slimDOMOptions:V,iframeManager:_,stylesheetManager:S,canvasManager:g,keepIframeSrcFn:E,enableStrictPrivacy:L},mirror:de});Xe=(C=!1)=>{var M,z,j,oe;Q(te({type:R.Meta,data:{href:window.location.href,width:Et(),height:Nt()}}),C),Ie.forEach(X=>X.lock());const B=go(document,{mirror:de,blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:a,inlineStylesheet:s,maskAllInputs:P,maskTextFn:p,slimDOM:V,recordCanvas:N,inlineImages:x,enableStrictPrivacy:L,onSerialize:X=>{De(X,de)&&_.addIframe(X),kt(X,de)&&S.addStylesheet(X),ze(X)&&I.addShadowRoot(X.shadowRoot,document)},onIframeLoad:(X,ge)=>{_.attachIframe(X,ge,de),I.observeAttachShadow(X)},onStylesheetLoad:(X,ge)=>{S.attachStylesheet(X,ge,de)},keepIframeSrcFn:E});if(!B)return console.warn("Failed to snapshot the document");Q(te({type:R.FullSnapshot,data:{node:B,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((z=(M=document?.body)==null?void 0:M.parentElement)==null?void 0:z.scrollLeft)||document?.body.scrollLeft||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((oe=(j=document?.body)==null?void 0:j.parentElement)==null?void 0:oe.scrollTop)||document?.body.scrollTop||0}}})),Ie.forEach(X=>X.unlock())};try{const C=[];C.push(ie("DOMContentLoaded",()=>{Q(te({type:R.DomContentLoaded,data:{}}))}));const M=j=>{var oe;return zo({mutationCb:D,mousemoveCb:(B,X)=>Q(te({type:R.IncrementalSnapshot,data:{source:X,positions:B}})),mouseInteractionCb:B=>Q(te({type:R.IncrementalSnapshot,data:ae({source:A.MouseInteraction},B)})),scrollCb:F,viewportResizeCb:B=>Q(te({type:R.IncrementalSnapshot,data:ae({source:A.ViewportResize},B)})),inputCb:B=>Q(te({type:R.IncrementalSnapshot,data:ae({source:A.Input},B)})),mediaInteractionCb:B=>Q(te({type:R.IncrementalSnapshot,data:ae({source:A.MediaInteraction},B)})),styleSheetRuleCb:B=>Q(te({type:R.IncrementalSnapshot,data:ae({source:A.StyleSheetRule},B)})),styleDeclarationCb:B=>Q(te({type:R.IncrementalSnapshot,data:ae({source:A.StyleDeclaration},B)})),canvasMutationCb:O,fontCb:B=>Q(te({type:R.IncrementalSnapshot,data:ae({source:A.Font},B)})),blockClass:o,ignoreClass:l,maskTextClass:c,maskTextSelector:a,maskInputOptions:P,inlineStylesheet:s,sampling:v,recordCanvas:N,inlineImages:x,userTriggeredOnInput:T,collectFonts:w,doc:j,maskInputFn:m,maskTextFn:p,keepIframeSrcFn:E,blockSelector:i,slimDOMOptions:V,mirror:de,iframeManager:_,stylesheetManager:S,shadowDomManager:I,canvasManager:g,enableStrictPrivacy:L,plugins:((oe=k?.filter(B=>B.observer))==null?void 0:oe.map(B=>({observer:B.observer,options:B.options,callback:X=>Q(te({type:R.Plugin,data:{plugin:B.name,payload:X}}))})))||[]},f)};_.addLoadListener(j=>{C.push(M(j.contentDocument))});const z=()=>{Xe(),C.push(M(document))};return document.readyState==="interactive"||document.readyState==="complete"?z():C.push(ie("load",()=>{Q(te({type:R.Load,data:{}})),z()},window)),()=>{C.forEach(j=>j())}}catch(C){console.warn(C)}}Me.addCustomEvent=(e,t)=>{!Q||Q(te({type:R.Custom,data:{tag:e,payload:t}}))},Me.freezePage=()=>{Ie.forEach(e=>e.freeze())},Me.takeFullSnapshot=e=>{if(!Xe)throw new Error("please take full snapshot after start recording");Xe(e)},Me.mirror=de;var W;(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"})(W||(W={}));var Si=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(o){return r.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function wi(){return new Si}function Ti(e){const t={},r=/;(?![^(]*\))/g,n=/:(.+)/,o=/\/\*.*?\*\//g;return e.replace(o,"").split(r).forEach(function(i){if(i){const l=i.split(n);l.length>1&&(t[Lt(l[0].trim())]=l[1].trim())}}),t}function qr(e){const t=[];for(const r in e){const n=e[r];if(typeof n!="string")continue;const o=Ii(r);t.push(`${o}: ${n};`)}return t.join(" ")}const Ni=/-([a-z])/g,Ei=/^--[a-zA-Z0-9-]+$/,Lt=e=>Ei.test(e)?e:e.replace(Ni,(t,r)=>r?r.toUpperCase():""),Ci=/\B([A-Z])/g,Ii=e=>e.replace(Ci,"-$1").toLowerCase();class le{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=J.ELEMENT_NODE,this.TEXT_NODE=J.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){const t=this.parentNode;if(!t)return null;const r=t.childNodes,n=r.indexOf(this);return r[n+1]||null}contains(t){if(t===this)return!0;for(const r of this.childNodes)if(r.contains(t))return!0;return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function Mi(e){return class Yn extends e{constructor(){super(...arguments),this.nodeType=J.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=W.Document,this.textContent=null}get documentElement(){return this.childNodes.find(r=>r.RRNodeType===W.Element&&r.tagName==="HTML")||null}get body(){var r;return((r=this.documentElement)===null||r===void 0?void 0:r.childNodes.find(n=>n.RRNodeType===W.Element&&n.tagName==="BODY"))||null}get head(){var r;return((r=this.documentElement)===null||r===void 0?void 0:r.childNodes.find(n=>n.RRNodeType===W.Element&&n.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(r){const n=r.RRNodeType;if((n===W.Element||n===W.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===n))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${n===W.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return r.parentElement=null,r.parentNode=this,this.childNodes.push(r),r}insertBefore(r,n){const o=r.RRNodeType;if((o===W.Element||o===W.DocumentType)&&this.childNodes.some(l=>l.RRNodeType===o))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${o===W.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(n===null)return this.appendChild(r);const i=this.childNodes.indexOf(n);if(i==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(i,0,r),r.parentElement=null,r.parentNode=this,r}removeChild(r){const n=this.childNodes.indexOf(r);if(n===-1)throw new Error("Failed to execute 'removeChild' on 'RRDocument': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(n,1),r.parentElement=null,r.parentNode=null,r}open(){this.childNodes=[]}close(){}write(r){let n;if(r==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?n="-//W3C//DTD XHTML 1.0 Transitional//EN":r==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(n="-//W3C//DTD HTML 4.0 Transitional//EN"),n){const o=this.createDocumentType("html",n,"");this.open(),this.appendChild(o)}}createDocument(r,n,o){return new Yn}createDocumentType(r,n,o){const i=new(Jr(le))(r,n,o);return i.ownerDocument=this,i}createElement(r){const n=new(Qr(le))(r);return n.ownerDocument=this,n}createElementNS(r,n){return this.createElement(n)}createTextNode(r){const n=new(en(le))(r);return n.ownerDocument=this,n}createComment(r){const n=new(tn(le))(r);return n.ownerDocument=this,n}createCDATASection(r){const n=new(rn(le))(r);return n.ownerDocument=this,n}toString(){return"RRDocument"}}}function Jr(e){return class extends e{constructor(t,r,n){super(),this.nodeType=J.DOCUMENT_TYPE_NODE,this.RRNodeType=W.DocumentType,this.textContent=null,this.name=t,this.publicId=r,this.systemId=n,this.nodeName=t}toString(){return"RRDocumentType"}}}function Qr(e){return class extends e{constructor(t){super(),this.nodeType=J.ELEMENT_NODE,this.RRNodeType=W.Element,this.attributes={},this.shadowRoot=null,this.tagName=t.toUpperCase(),this.nodeName=t.toUpperCase()}get textContent(){let t="";return this.childNodes.forEach(r=>t+=r.textContent),t}set textContent(t){this.childNodes=[this.ownerDocument.createTextNode(t)]}get classList(){return new ki(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?Ti(this.attributes.style):{},r=/\B([A-Z])/g;return t.setProperty=(n,o,i)=>{if(r.test(n))return;const l=Lt(n);o?t[l]=o:delete t[l],i==="important"&&(t[l]+=" !important"),this.attributes.style=qr(t)},t.removeProperty=n=>{if(r.test(n))return"";const o=Lt(n),i=t[o]||"";return delete t[o],this.attributes.style=qr(t),i},t}getAttribute(t){return this.attributes[t]||null}setAttribute(t,r){this.attributes[t]=r}setAttributeNS(t,r,n){this.setAttribute(r,n)}removeAttribute(t){delete this.attributes[t]}appendChild(t){return this.childNodes.push(t),t.parentNode=this,t.parentElement=this,t}insertBefore(t,r){if(r===null)return this.appendChild(t);const n=this.childNodes.indexOf(r);if(n==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(n,0,t),t.parentElement=this,t.parentNode=this,t}removeChild(t){const r=this.childNodes.indexOf(t);if(r===-1)throw new Error("Failed to execute 'removeChild' on 'RRElement': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(r,1),t.parentElement=null,t.parentNode=null,t}attachShadow(t){const r=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=r,r}dispatchEvent(t){return!0}toString(){let t="";for(const r in this.attributes)t+=`${r}="${this.attributes[r]}" `;return`${this.tagName} ${t}`}}}function xi(e){return class extends e{attachShadow(t){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}function en(e){return class extends e{constructor(t){super(),this.nodeType=J.TEXT_NODE,this.nodeName="#text",this.RRNodeType=W.Text,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function tn(e){return class extends e{constructor(t){super(),this.nodeType=J.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=W.Comment,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function rn(e){return class extends e{constructor(t){super(),this.nodeName="#cdata-section",this.nodeType=J.CDATA_SECTION_NODE,this.RRNodeType=W.CDATA,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class ki{constructor(t,r){if(this.classes=[],this.add=(...n)=>{for(const o of n){const i=String(o);this.classes.indexOf(i)>=0||this.classes.push(i)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...n)=>{this.classes=this.classes.filter(o=>n.indexOf(o)===-1),this.onChange&&this.onChange(this.classes.join(" "))},t){const n=t.trim().split(/\s+/);this.classes.push(...n)}this.onChange=r}}var J;(function(e){e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"})(J||(J={}));const At={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},Oi={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 he(e,t,r,n){const o=e.childNodes,i=t.childNodes;n=n||t.mirror||t.ownerDocument.mirror,(o.length>0||i.length>0)&&nn(Array.from(o),i,e,r,n);let l=null,c=null;switch(t.RRNodeType){case W.Document:{c=t.scrollData;break}case W.Element:{const a=e,s=t;switch(Ri(a,s,n),c=s.scrollData,l=s.inputData,s.tagName){case"AUDIO":case"VIDEO":{const u=e,d=s;d.paused!==void 0&&(d.paused?u.pause():u.play()),d.muted!==void 0&&(u.muted=d.muted),d.volume!==void 0&&(u.volume=d.volume),d.currentTime!==void 0&&(u.currentTime=d.currentTime);break}case"CANVAS":{const u=t;if(u.rr_dataURL!==null){const d=document.createElement("img");d.onload=()=>{const h=a.getContext("2d");h&&h.drawImage(d,0,0,d.width,d.height)},d.src=u.rr_dataURL}u.canvasMutations.forEach(d=>r.applyCanvas(d.event,d.mutation,e))}break;case"STYLE":Di(a,t.rules);break}if(s.shadowRoot){a.shadowRoot||a.attachShadow({mode:"open"});const u=a.shadowRoot.childNodes,d=s.shadowRoot.childNodes;(u.length>0||d.length>0)&&nn(Array.from(u),d,a.shadowRoot,r,n)}break}case W.Text:case W.Comment:case W.CDATA:e.textContent!==t.data&&(e.textContent=t.data);break}if(c&&r.applyScroll(c,!0),l&&r.applyInput(l),t.nodeName==="IFRAME"){const a=e.contentDocument,s=t;if(a){const u=n.getMeta(s.contentDocument);u&&r.mirror.add(a,Object.assign({},u)),he(a,s.contentDocument,r,n)}}}function Ri(e,t,r){const n=e.attributes,o=t.attributes;for(const i in o){const l=o[i],c=r.getMeta(t);if(c&&"isSVG"in c&&c.isSVG&&At[i])e.setAttributeNS(At[i],i,l);else if(t.tagName==="CANVAS"&&i==="rr_dataURL"){const a=document.createElement("img");a.src=l,a.onload=()=>{const s=e.getContext("2d");s&&s.drawImage(a,0,0,a.width,a.height)}}else e.setAttribute(i,l)}for(const{name:i}of Array.from(n))i in o||e.removeAttribute(i);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function nn(e,t,r,n,o){var i;let l=0,c=e.length-1,a=0,s=t.length-1,u=e[l],d=e[c],h=t[a],m=t[s],p,f;for(;l<=c&&a<=s;){const y=n.mirror.getId(u),v=n.mirror.getId(d),b=o.getId(h),N=o.getId(m);if(u===void 0)u=e[++l];else if(d===void 0)d=e[--c];else if(y!==-1&&y===b)he(u,h,n,o),u=e[++l],h=t[++a];else if(v!==-1&&v===N)he(d,m,n,o),d=e[--c],m=t[--s];else if(y!==-1&&y===N)r.insertBefore(u,d.nextSibling),he(u,m,n,o),u=e[++l],m=t[--s];else if(v!==-1&&v===b)r.insertBefore(d,u),he(d,h,n,o),d=e[--c],h=t[++a];else{if(!p){p={};for(let T=l;T<=c;T++){const w=e[T];w&&n.mirror.hasNode(w)&&(p[n.mirror.getId(w)]=T)}}if(f=p[o.getId(h)],f){const T=e[f];r.insertBefore(T,u),he(T,h,n,o),e[f]=void 0}else{const T=Pt(h,n.mirror,o);r.nodeName==="#document"&&((i=n.mirror.getMeta(T))===null||i===void 0?void 0:i.type)===W.Element&&r.documentElement&&(r.removeChild(r.documentElement),e[l]=void 0,u=void 0),r.insertBefore(T,u||null),he(T,h,n,o)}h=t[++a]}}if(l>c){const y=t[s+1];let v=null;for(y&&r.childNodes.forEach(b=>{n.mirror.getId(b)===o.getId(y)&&(v=b)});a<=s;++a){const b=Pt(t[a],n.mirror,o);r.insertBefore(b,v),he(b,t[a],n,o)}}else if(a>s)for(;l<=c;l++){const y=e[l];y&&(r.removeChild(y),n.mirror.removeNodeFromMap(y))}}function Pt(e,t,r){const n=r.getId(e),o=r.getMeta(e);let i=null;if(n>-1&&(i=t.getNode(n)),i!==null)return i;switch(e.RRNodeType){case W.Document:i=new Document;break;case W.DocumentType:i=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case W.Element:{let l=e.tagName.toLowerCase();l=Oi[l]||l,o&&"isSVG"in o&&o?.isSVG?i=document.createElementNS(At.svg,l):i=document.createElement(e.tagName);break}case W.Text:i=document.createTextNode(e.data);break;case W.Comment:i=document.createComment(e.data);break;case W.CDATA:i=document.createCDATASection(e.data);break}return o&&t.add(i,Object.assign({},o)),i}function Ze(e,t){const r=e[t[0]];return t.length===1?r:Ze(r.cssRules[t[1]].cssRules,t.slice(2))}var ce;(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"})(ce||(ce={}));function on(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function Di(e,t){const r=e.sheet;t.forEach(n=>{if(n.type===ce.Insert)try{if(Array.isArray(n.index)){const{positions:o,index:i}=on(n.index);Ze(r.cssRules,o).insertRule(n.cssText,i)}else r.insertRule(n.cssText,n.index)}catch{}else if(n.type===ce.Remove)try{if(Array.isArray(n.index)){const{positions:o,index:i}=on(n.index);Ze(r.cssRules,o).deleteRule(i||0)}else r.deleteRule(n.index)}catch{}else n.type===ce.SetProperty?Ze(r.cssRules,n.index).style.setProperty(n.property,n.value,n.priority):n.type===ce.RemoveProperty&&Ze(r.cssRules,n.index).style.removeProperty(n.property)})}class Pe extends Mi(le){constructor(t){super(),this._unserializedId=-1,this.mirror=Gi(),this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,r,n){return new Pe}createDocumentType(t,r,n){const o=new Li(t,r,n);return o.ownerDocument=this,o}createElement(t){const r=t.toUpperCase();let n;switch(r){case"AUDIO":case"VIDEO":n=new Ai(r);break;case"IFRAME":n=new _i(r,this.mirror);break;case"CANVAS":n=new Pi(r);break;case"STYLE":n=new Fi(r);break;default:n=new Ke(r);break}return n.ownerDocument=this,n}createComment(t){const r=new Wi(t);return r.ownerDocument=this,r}createCDATASection(t){const r=new Ui(t);return r.ownerDocument=this,r}createTextNode(t){const r=new $i(t);return r.ownerDocument=this,r}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=-1}}const Li=Jr(le);class Ke extends Qr(le){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class Ai extends xi(Ke){}class Pi extends Ke{constructor(){super(...arguments),this.rr_dataURL=null,this.canvasMutations=[]}getContext(){return null}}class Fi extends Ke{constructor(){super(...arguments),this.rules=[]}}class _i extends Ke{constructor(t,r){super(t),this.contentDocument=new Pe,this.contentDocument.mirror=r}}const $i=en(le),Wi=tn(le),Ui=rn(le);function ji(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function sn(e,t,r,n){let o;switch(e.nodeType){case J.DOCUMENT_NODE:n&&n.nodeName==="IFRAME"?o=n.contentDocument:(o=t,o.compatMode=e.compatMode);break;case J.DOCUMENT_TYPE_NODE:{const l=e;o=t.createDocumentType(l.name,l.publicId,l.systemId);break}case J.ELEMENT_NODE:{const l=e,c=ji(l);o=t.createElement(c);const a=o;for(const{name:s,value:u}of Array.from(l.attributes))a.attributes[s]=u;l.scrollLeft&&(a.scrollLeft=l.scrollLeft),l.scrollTop&&(a.scrollTop=l.scrollTop);break}case J.TEXT_NODE:o=t.createTextNode(e.textContent||"");break;case J.CDATA_SECTION_NODE:o=t.createCDATASection(e.data);break;case J.COMMENT_NODE:o=t.createComment(e.textContent||"");break;case J.DOCUMENT_FRAGMENT_NODE:o=n.attachShadow({mode:"open"});break;default:return null}let i=r.getMeta(e);return t instanceof Pe&&(i||(i=an(o,t.unserializedId),r.add(e,i)),t.mirror.add(o,Object.assign({},i))),o}function Vi(e,t=wi(),r=new Pe){function n(o,i){const l=sn(o,r,t,i);l!==null&&(i?.nodeName!=="IFRAME"&&o.nodeType!==J.DOCUMENT_FRAGMENT_NODE&&(i?.appendChild(l),l.parentNode=i,l.parentElement=i),o.nodeName==="IFRAME"?n(o.contentDocument,l):(o.nodeType===J.DOCUMENT_NODE||o.nodeType===J.ELEMENT_NODE||o.nodeType===J.DOCUMENT_FRAGMENT_NODE)&&(o.nodeType===J.ELEMENT_NODE&&o.shadowRoot&&n(o.shadowRoot,l),o.childNodes.forEach(c=>n(c,l))))}return n(e,null),r}function Gi(){return new Bi}class Bi{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var r;if(!t)return-1;const n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){const n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function an(e,t){switch(e.RRNodeType){case W.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case W.DocumentType:{const r=e;return{id:t,type:e.RRNodeType,name:r.name,publicId:r.publicId,systemId:r.systemId}}case W.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case W.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case W.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case W.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}function ln(e){return{all:e=e||new Map,on:function(t,r){var n=e.get(t);n?n.push(r):e.set(t,[r])},off:function(t,r){var n=e.get(t);n&&(r?n.splice(n.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var n=e.get(t);n&&n.slice().map(function(o){o(r)}),(n=e.get("*"))&&n.slice().map(function(o){o(t,r)})}}}var zi=Object.freeze({__proto__:null,default:ln});function Hi(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const r=e.HTMLElement||e.Element,n=468,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||a,scrollIntoView:r.prototype.scrollIntoView},i=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function l(v){const b=["MSIE ","Trident/","Edge/"];return new RegExp(b.join("|")).test(v)}const c=l(e.navigator.userAgent)?1:0;function a(v,b){this.scrollLeft=v,this.scrollTop=b}function s(v){return .5*(1-Math.cos(Math.PI*v))}function u(v){if(v===null||typeof v!="object"||v.behavior===void 0||v.behavior==="auto"||v.behavior==="instant")return!0;if(typeof v=="object"&&v.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+v.behavior+" is not a valid value for enumeration ScrollBehavior.")}function d(v,b){if(b==="Y")return v.clientHeight+c<v.scrollHeight;if(b==="X")return v.clientWidth+c<v.scrollWidth}function h(v,b){const N=e.getComputedStyle(v,null)["overflow"+b];return N==="auto"||N==="scroll"}function m(v){const b=d(v,"Y")&&h(v,"Y"),N=d(v,"X")&&h(v,"X");return b||N}function p(v){for(;v!==t.body&&m(v)===!1;)v=v.parentNode||v.host;return v}function f(v){const b=i();let N,T,w,x=(b-v.startTime)/n;x=x>1?1:x,N=s(x),T=v.startX+(v.x-v.startX)*N,w=v.startY+(v.y-v.startY)*N,v.method.call(v.scrollable,T,w),(T!==v.x||w!==v.y)&&e.requestAnimationFrame(f.bind(e,v))}function y(v,b,N){let T,w,x,k;const E=i();v===t.body?(T=e,w=e.scrollX||e.pageXOffset,x=e.scrollY||e.pageYOffset,k=o.scroll):(T=v,w=v.scrollLeft,x=v.scrollTop,k=a),f({scrollable:T,method:k,startTime:E,startX:w,startY:x,x:b,y:N})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}y.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){o.scrollBy.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}y.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},r.prototype.scroll=r.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const v=arguments[0].left,b=arguments[0].top;y.call(this,this,typeof v>"u"?this.scrollLeft:~~v,typeof b>"u"?this.scrollTop:~~b)},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},r.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){o.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const v=p(this),b=v.getBoundingClientRect(),N=this.getBoundingClientRect();v!==t.body?(y.call(this,v,v.scrollLeft+N.left-b.left,v.scrollTop+N.top-b.top),e.getComputedStyle(v).position!=="fixed"&&e.scrollBy({left:b.left,top:b.top,behavior:"smooth"})):e.scrollBy({left:N.left,top:N.top,behavior:"smooth"})}}class Yi{constructor(t=[],r){this.timeOffset=0,this.raf=null,this.actions=t,this.speed=r}addAction(t){const r=this.findActionIndex(t);this.actions.splice(r,0,t)}addActions(t){this.actions=this.actions.concat(t)}replaceActions(t){this.actions.length=0,this.actions.splice(0,0,...t)}start(){this.timeOffset=0;let t=performance.now();const{actions:r}=this,n=()=>{const o=performance.now();for(this.timeOffset+=(o-t)*this.speed,t=o;r.length;){const i=r[0];if(this.timeOffset>=i.delay)r.shift(),i.doAction();else break}(r.length>0||this.liveMode)&&(this.raf=requestAnimationFrame(n))};this.raf=requestAnimationFrame(n)}clear(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(t){this.speed=t}toggleLiveMode(t){this.liveMode=t}isActive(){return this.raf!==null}findActionIndex(t){let r=0,n=this.actions.length-1;for(;r<=n;){const o=Math.floor((r+n)/2);if(this.actions[o].delay<t.delay)r=o+1;else if(this.actions[o].delay>t.delay)n=o-1;else return o+1}return r}}function Ft(e,t){if(e.type===R.IncrementalSnapshot&&e.data.source===A.MouseMove){const r=e.data.positions[0].timeOffset,n=e.timestamp+r;return e.delay=n-t,n-t}return e.delay=e.timestamp-t,e.delay}/*! *****************************************************************************
|
|
4
|
+
or you can use record.mirror to access the mirror instance during recording.`;q.mirror={map:{},getId(){return console.error(Oe),-1},getNode(){return console.error(Oe),null},removeNodeFromMap(){console.error(Oe)},has(){return console.error(Oe),!1},reset(){console.error(Oe)}},typeof window<"u"&&window.Proxy&&window.Reflect&&(q.mirror=new Proxy(q.mirror,{get(e,t,r){return t==="map"&&console.error(Oe),Reflect.get(e,t,r)}}));function Re(e,t,r={}){let n=null,o=0;return function(...i){const l=Date.now();!o&&r.leading===!1&&(o=l);const c=t-(l-o),a=this;c<=0||c>t?(n&&(clearTimeout(n),n=null),o=l,e.apply(a,i)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(a,i)},c))}}function Be(e,t,r,n,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(l){setTimeout(()=>{r.set.call(this,l)},0),i&&i.set&&i.set.call(this,l)}}),()=>Be(e,t,i||{},!0)}function Se(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],o=r(n);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch{return()=>{}}}function Nt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Et(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}const gr=e=>{try{if(e instanceof HTMLElement)return e.tagName==="CANVAS"}catch{return!1}return!1};function se(e,t,r){if(!e)return!1;const n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!n)return!1;if(typeof t=="string"){if(n.classList.contains(t)||r&&n.closest("."+t)!==null)return!0}else if(ot(n,t,r))return!0;return!1}function yr(e,t){return t.getId(e)!==-1}function st(e,t){return t.getId(e)===Ge}function Ct(e,t){if(je(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?Ct(e.parentNode,t):!0:!0}function It(e){return Boolean(e.changedTouches)}function kt(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let r=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===r)return!0;while(r=r&&r.parentNode);return!1})}function br(e){const t={},r=(o,i)=>{const l={value:o,parent:i,children:[]};return t[o.node.id]=l,l},n=[];for(const o of e){const{nextId:i,parentId:l}=o;if(i&&i in t){const c=t[i];if(c.parent){const a=c.parent.children.indexOf(c);c.parent.children.splice(a,0,r(o,c.parent))}else{const a=n.indexOf(c);n.splice(a,0,r(o,null))}continue}if(l in t){const c=t[l];c.children.push(r(o,c));continue}n.push(r(o,null))}return n}function Mt(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)Mt(e.children[r],t)}function De(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function xt(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Ot(e,t){var r,n;const o=(n=(r=e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:n.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const i=o.getBoundingClientRect(),l=Ot(o,t),c=i.height/o.clientHeight;return{x:i.x*l.relativeScale+l.x,y:i.y*l.relativeScale+l.y,relativeScale:c,absoluteScale:l.absoluteScale*c}}function ze(e){return Boolean(e?.shadowRoot)}function Le(e,t){const r=e[t[0]];return t.length===1?r:Le(r.cssRules[t[1]].cssRules,t.slice(2))}function Rt(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function Sr(e){const t=new Set,r=[];for(let n=e.length;n--;){const o=e[n];t.has(o.id)||(r.push(o),t.add(o.id))}return r}var Io=Object.freeze({__proto__:null,on:ie,get _mirror(){return q.mirror},throttle:Re,hookSetter:Be,patch:Se,getWindowHeight:Nt,getWindowWidth:Et,isCanvasNode:gr,isBlocked:se,isSerialized:yr,isIgnored:st,isAncestorRemoved:Ct,isTouchEvent:It,polyfill:kt,queueToResolveTrees:br,iterateResolveTree:Mt,isSerializedIframe:De,isSerializedStylesheet:xt,getBaseDimension:Ot,hasShadowRoot:ze,getNestedRule:Le,getPositionsAndIndex:Rt,uniqueTextMutations:Sr}),O=(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))(O||{}),A=(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))(A||{}),ee=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(ee||{}),fe=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(fe||{}),Ce=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(Ce||{}),H=(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))(H||{});function wr(e){return"__ln"in e}class ko{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){const r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&wr(t.previousSibling)){const n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&wr(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;this.length++}removeNode(t){const r=t.__ln;!this.head||(r.previous?(r.previous.next=r.next,r.next&&(r.next.previous=r.previous)):(this.head=r.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}}const Tr=(e,t)=>`${e}@${t}`;class Mo{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],r=new ko,n=c=>{let a=c,s=Ge;for(;s===Ge;)a=a&&a.nextSibling,s=a&&this.mirror.getId(a);return s},o=c=>{var a,s,u,d,h;const m=c.getRootNode?(a=c.getRootNode())==null?void 0:a.host:null;let p=m;for(;(u=(s=p?.getRootNode)==null?void 0:s.call(p))!=null&&u.host;)p=((h=(d=p?.getRootNode)==null?void 0:d.call(p))==null?void 0:h.host)||null;const f=!this.doc.contains(c)&&(!p||!this.doc.contains(p));if(!c.parentNode||f)return;const y=je(c.parentNode)?this.mirror.getId(m):this.mirror.getId(c.parentNode),v=n(c);if(y===-1||v===-1)return r.addNode(c);const b=Ee(c,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,enableStrictPrivacy:this.enableStrictPrivacy,onSerialize:T=>{De(T,this.mirror)&&this.iframeManager.addIframe(T),xt(T,this.mirror)&&this.stylesheetManager.addStylesheet(T),ze(c)&&this.shadowDomManager.addShadowRoot(c.shadowRoot,document)},onIframeLoad:(T,C)=>{this.iframeManager.attachIframe(T,C,this.mirror),this.shadowDomManager.observeAttachShadow(T)},onStylesheetLoad:(T,C)=>{this.stylesheetManager.attachStylesheet(T,C,this.mirror)}});b&&t.push({parentId:y,nextId:v,node:b})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const c of Array.from(this.movedSet.values()))Nr(this.removes,c,this.mirror)&&!this.movedSet.has(c.parentNode)||o(c);for(const c of Array.from(this.addedSet.values()))!Cr(this.droppedSet,c)&&!Nr(this.removes,c,this.mirror)||Cr(this.movedSet,c)?o(c):this.droppedSet.add(c);let i=null;for(;r.length;){let c=null;if(i){const a=this.mirror.getId(i.value.parentNode),s=n(i.value);a!==-1&&s!==-1&&(c=i)}if(!c)for(let a=r.length-1;a>=0;a--){const s=r.get(a);if(s){const u=this.mirror.getId(s.value.parentNode),d=n(s.value);if(u!==-1&&d!==-1){c=s;break}}}if(!c){for(;r.head;)r.removeNode(r.head.value);break}i=c.previous,r.removeNode(c.value),o(c.value)}const l={texts:this.texts.map(c=>{let a=c.value;return this.enableStrictPrivacy&&a&&(a=bt(a)),{id:this.mirror.getId(c.node),value:a}}).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>({id:this.mirror.getId(c.node),attributes:c.attributes})).filter(c=>this.mirror.has(c.id)),removes:this.removes,adds:t};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(l))},this.processMutation=t=>{if(!st(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!se(t.target,this.blockClass,!1)&&r!==t.oldValue&&this.texts.push({value:cr(t.target,this.maskTextClass,this.maskTextSelector)&&r?this.maskTextFn?this.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let n=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(n=yt({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),se(t.target,this.blockClass,!1)||n===t.oldValue)return;let o=this.attributes.find(i=>i.node===t.target);if(r.tagName==="IFRAME"&&t.attributeName==="src"&&!this.keepIframeSrcFn(n))if(!r.contentDocument)t.attributeName="rr_src";else return;if(o||(o={node:t.target,attributes:{}},this.attributes.push(o)),t.attributeName==="style"){const i=this.doc.createElement("span");t.oldValue&&i.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});const l=o.attributes.style;for(const c of Array.from(r.style)){const a=r.style.getPropertyValue(c),s=r.style.getPropertyPriority(c);(a!==i.style.getPropertyValue(c)||s!==i.style.getPropertyPriority(c))&&(s===""?l[c]=a:l[c]=[a,s])}for(const c of Array.from(i.style))r.style.getPropertyValue(c)===""&&(l[c]=!1)}else{if(t.target.tagName==="INPUT"){const i=t.target;if(i.type==="password"){o.attributes.value="*".repeat(i.value.length);break}}o.attributes[t.attributeName]=ar(this.doc,r.tagName,t.attributeName,n)}break}case"childList":{if(se(t.target,this.blockClass,!0))return;t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const n=this.mirror.getId(r),o=je(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);se(t.target,this.blockClass,!1)||st(r,this.mirror)||!yr(r,this.mirror)||(this.addedSet.has(r)?(Dt(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||Ct(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Tr(n,o)]?Dt(this.movedSet,r):this.removes.push({parentId:o,id:n,isShadow:je(t.target)&&Ve(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(this.mirror.hasNode(t)){if(st(t,this.mirror))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[Tr(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);se(t,this.blockClass,!1)||t.childNodes.forEach(n=>this.genAdds(n))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","enableStrictPrivacy"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Dt(e,t){e.delete(t),t.childNodes.forEach(r=>Dt(e,r))}function Nr(e,t,r){return e.length===0?!1:Er(e,t,r)}function Er(e,t,r){const{parentNode:n}=t;if(!n)return!1;const o=r.getId(n);return e.some(i=>i.id===o)?!0:Er(e,n,r)}function Cr(e,t){return e.size===0?!1:Ir(e,t)}function Ir(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:Ir(e,r):!1}var xo=Object.defineProperty,Oo=Object.defineProperties,Ro=Object.getOwnPropertyDescriptors,kr=Object.getOwnPropertySymbols,Do=Object.prototype.hasOwnProperty,Lo=Object.prototype.propertyIsEnumerable,Mr=(e,t,r)=>t in e?xo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xr=(e,t)=>{for(var r in t||(t={}))Do.call(t,r)&&Mr(e,r,t[r]);if(kr)for(var r of kr(t))Lo.call(t,r)&&Mr(e,r,t[r]);return e},Ao=(e,t)=>Oo(e,Ro(t));const Ie=[],Or=typeof CSSGroupingRule<"u",Rr=typeof CSSMediaRule<"u",Dr=typeof CSSSupportsRule<"u",Lr=typeof CSSConditionRule<"u";function He(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch{return e.target}}function Ar(e,t){var r,n;const o=new Mo;Ie.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver;const l=(n=(r=window?.Zone)==null?void 0:r.__symbol__)==null?void 0:n.call(r,"MutationObserver");l&&window[l]&&(i=window[l]);const c=new i(o.processMutations.bind(o));return c.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),c}function Fo({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let l=[],c;const a=Re(d=>{const h=Date.now()-c;e(l.map(m=>(m.timeOffset-=h,m)),d),l=[],c=null},i),s=Re(d=>{const h=He(d),{clientX:m,clientY:p}=It(d)?d.changedTouches[0]:d;c||(c=Date.now()),l.push({x:m,y:p,id:n.getId(h),timeOffset:Date.now()-c}),a(typeof DragEvent<"u"&&d instanceof DragEvent?A.Drag:d instanceof MouseEvent?A.MouseMove:A.TouchMove)},o,{trailing:!1}),u=[ie("mousemove",s,r),ie("touchmove",s,r),ie("drag",s,r)];return()=>{u.forEach(d=>d())}}function Po({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const i=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[],c=a=>s=>{const u=He(s);if(se(u,n,!0)||gr(u))return;const d=It(s)?s.changedTouches[0]:s;if(!d)return;const h=r.getId(u),{clientX:m,clientY:p}=d;e({type:ee[a],id:h,x:m,y:p})};return Object.keys(ee).filter(a=>Number.isNaN(Number(a))&&!a.endsWith("_Departed")&&i[a]!==!1).forEach(a=>{const s=a.toLowerCase(),u=c(a);l.push(ie(s,u,t))}),()=>{l.forEach(a=>a())}}function Fr({scrollCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){const i=Re(l=>{const c=He(l);if(!c||se(c,n,!0))return;const a=r.getId(c);if(c===t){const s=t.scrollingElement||t.documentElement;e({id:a,x:s.scrollLeft,y:s.scrollTop})}else e({id:a,x:c.scrollLeft,y:c.scrollTop})},o.scroll||100);return ie("scroll",i,t)}function _o({viewportResizeCb:e}){let t=-1,r=-1;const n=Re(()=>{const o=Nt(),i=Et();(t!==o||r!==i)&&(e({width:Number(i),height:Number(o)}),t=o,r=i)},200);return ie("resize",n,window)}function Pr(e,t){const r=xr({},e);return t||delete r.userTriggered,r}const $o=["INPUT","TEXTAREA","SELECT"],_r=new WeakMap;function Wo({inputCb:e,doc:t,mirror:r,blockClass:n,ignoreClass:o,maskInputOptions:i,maskInputFn:l,sampling:c,userTriggeredOnInput:a}){function s(p){let f=He(p);const y=p.isTrusted;if(f&&f.tagName==="OPTION"&&(f=f.parentElement),!f||!f.tagName||$o.indexOf(f.tagName)<0||se(f,n,!0))return;const v=f.type;if(f.classList.contains(o))return;let b=f.value,T=!1;v==="radio"||v==="checkbox"?T=f.checked:(i[f.tagName.toLowerCase()]||i[v])&&(b=yt({maskInputOptions:i,tagName:f.tagName,type:v,value:b,maskInputFn:l})),u(f,Pr({text:b,isChecked:T,userTriggered:y},a));const C=f.name;v==="radio"&&C&&T&&t.querySelectorAll(`input[type="radio"][name="${C}"]`).forEach(I=>{I!==f&&u(I,Pr({text:I.value,isChecked:!T,userTriggered:!1},a))})}function u(p,f){const y=_r.get(p);if(!y||y.text!==f.text||y.isChecked!==f.isChecked){_r.set(p,f);const v=r.getId(p);e(Ao(xr({},f),{id:v}))}}const d=(c.input==="last"?["change"]:["input","change"]).map(p=>ie(p,s,t)),h=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),m=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return h&&h.set&&d.push(...m.map(p=>Be(p[0],p[1],{set(){s({target:this})}}))),()=>{d.forEach(p=>p())}}function at(e){const t=[];function r(n,o){if(Or&&n.parentRule instanceof CSSGroupingRule||Rr&&n.parentRule instanceof CSSMediaRule||Dr&&n.parentRule instanceof CSSSupportsRule||Lr&&n.parentRule instanceof CSSConditionRule){const i=Array.from(n.parentRule.cssRules).indexOf(n);o.unshift(i)}else{const i=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(i)}return o}return r(e,t)}function Uo({styleSheetRuleCb:e,mirror:t},{win:r}){const n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(c,a){const s=t.getId(this.ownerNode);return s!==-1&&e({id:s,adds:[{rule:c,index:a}]}),n.apply(this,[c,a])};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=function(c){const a=t.getId(this.ownerNode);return a!==-1&&e({id:a,removes:[{index:c}]}),o.apply(this,[c])};const i={};Or?i.CSSGroupingRule=r.CSSGroupingRule:(Rr&&(i.CSSMediaRule=r.CSSMediaRule),Lr&&(i.CSSConditionRule=r.CSSConditionRule),Dr&&(i.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(i).forEach(([c,a])=>{l[c]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=function(s,u){const d=t.getId(this.parentStyleSheet.ownerNode);return d!==-1&&e({id:d,adds:[{rule:s,index:[...at(this),u||0]}]}),l[c].insertRule.apply(this,[s,u])},a.prototype.deleteRule=function(s){const u=t.getId(this.parentStyleSheet.ownerNode);return u!==-1&&e({id:u,removes:[{index:[...at(this),s]}]}),l[c].deleteRule.apply(this,[s])}}),()=>{r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=o,Object.entries(i).forEach(([c,a])=>{a.prototype.insertRule=l[c].insertRule,a.prototype.deleteRule=l[c].deleteRule})}}function jo({styleDeclarationCb:e,mirror:t},{win:r}){const n=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=function(i,l,c){var a,s;const u=t.getId((s=(a=this.parentRule)==null?void 0:a.parentStyleSheet)==null?void 0:s.ownerNode);return u!==-1&&e({id:u,set:{property:i,value:l,priority:c},index:at(this.parentRule)}),n.apply(this,[i,l,c])};const o=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=function(i){var l,c;const a=t.getId((c=(l=this.parentRule)==null?void 0:l.parentStyleSheet)==null?void 0:c.ownerNode);return a!==-1&&e({id:a,remove:{property:i},index:at(this.parentRule)}),o.apply(this,[i])},()=>{r.CSSStyleDeclaration.prototype.setProperty=n,r.CSSStyleDeclaration.prototype.removeProperty=o}}function Vo({mediaInteractionCb:e,blockClass:t,mirror:r,sampling:n}){const o=l=>Re(c=>{const a=He(c);if(!a||se(a,t,!0))return;const{currentTime:s,volume:u,muted:d}=a;e({type:l,id:r.getId(a),currentTime:s,volume:u,muted:d})},n.media||500),i=[ie("play",o(Ce.Play)),ie("pause",o(Ce.Pause)),ie("seeked",o(Ce.Seeked)),ie("volumechange",o(Ce.VolumeChange))];return()=>{i.forEach(l=>l())}}function Go({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,i=r.FontFace;r.FontFace=function(c,a,s){const u=new i(c,a,s);return o.set(u,{family:c,buffer:typeof a!="string",descriptors:s,fontSource:typeof a=="string"?a:JSON.stringify(Array.from(new Uint8Array(a)))}),u};const l=Se(t.fonts,"add",function(c){return function(a){return setTimeout(()=>{const s=o.get(a);s&&(e(s),o.delete(a))},0),c.apply(this,[a])}});return n.push(()=>{r.FontFace=i}),n.push(l),()=>{n.forEach(c=>c())}}function Bo(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:l,inputCb:c,mediaInteractionCb:a,styleSheetRuleCb:s,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h}=e;e.mutationCb=(...m)=>{t.mutation&&t.mutation(...m),r(...m)},e.mousemoveCb=(...m)=>{t.mousemove&&t.mousemove(...m),n(...m)},e.mouseInteractionCb=(...m)=>{t.mouseInteraction&&t.mouseInteraction(...m),o(...m)},e.scrollCb=(...m)=>{t.scroll&&t.scroll(...m),i(...m)},e.viewportResizeCb=(...m)=>{t.viewportResize&&t.viewportResize(...m),l(...m)},e.inputCb=(...m)=>{t.input&&t.input(...m),c(...m)},e.mediaInteractionCb=(...m)=>{t.mediaInteaction&&t.mediaInteaction(...m),a(...m)},e.styleSheetRuleCb=(...m)=>{t.styleSheetRule&&t.styleSheetRule(...m),s(...m)},e.styleDeclarationCb=(...m)=>{t.styleDeclaration&&t.styleDeclaration(...m),u(...m)},e.canvasMutationCb=(...m)=>{t.canvasMutation&&t.canvasMutation(...m),d(...m)},e.fontCb=(...m)=>{t.font&&t.font(...m),h(...m)}}function zo(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};Bo(e,t);const n=Ar(e,e.doc),o=Fo(e),i=Po(e),l=Fr(e),c=_o(e),a=Wo(e),s=Vo(e),u=Uo(e,{win:r}),d=jo(e,{win:r}),h=e.collectFonts?Go(e):()=>{},m=[];for(const p of e.plugins)m.push(p.observer(p.callback,r,p.options));return()=>{Ie.forEach(p=>p.reset()),n.disconnect(),o(),i(),l(),c(),a(),s(),u(),d(),h(),m.forEach(p=>p())}}class Ho{constructor(t){this.iframes=new WeakMap,this.mutationCb=t.mutationCb}addIframe(t){this.iframes.set(t,!0)}addLoadListener(t){this.loadListener=t}attachIframe(t,r,n){var o;this.mutationCb({adds:[{parentId:n.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(o=this.loadListener)==null||o.call(this,t)}}var Yo=Object.defineProperty,Xo=Object.defineProperties,Zo=Object.getOwnPropertyDescriptors,$r=Object.getOwnPropertySymbols,Ko=Object.prototype.hasOwnProperty,qo=Object.prototype.propertyIsEnumerable,Wr=(e,t,r)=>t in e?Yo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ur=(e,t)=>{for(var r in t||(t={}))Ko.call(t,r)&&Wr(e,r,t[r]);if($r)for(var r of $r(t))qo.call(t,r)&&Wr(e,r,t[r]);return e},jr=(e,t)=>Xo(e,Zo(t));class Jo{constructor(t){this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;const r=this;this.restorePatches.push(Se(HTMLElement.prototype,"attachShadow",function(n){return function(o){const i=n.call(this,o);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),i}}))}addShadowRoot(t,r){!Ve(t)||(Ar(jr(Ur({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),Fr(jr(Ur({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})))}observeAttachShadow(t){if(t.contentWindow){const r=this;this.restorePatches.push(Se(t.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(o){const i=n.call(this,o);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,t.contentDocument),i}}))}}reset(){this.restorePatches.forEach(t=>t())}}for(var Ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ye=typeof Uint8Array>"u"?[]:new Uint8Array(256),lt=0;lt<Ae.length;lt++)Ye[Ae.charCodeAt(lt)]=lt;var Qo=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=Ae[t[r]>>2],o+=Ae[(t[r]&3)<<4|t[r+1]>>4],o+=Ae[(t[r+1]&15)<<2|t[r+2]>>6],o+=Ae[t[r+2]&63];return n%3===2?o=o.substring(0,o.length-1)+"=":n%3===1&&(o=o.substring(0,o.length-2)+"=="),o},ei=function(e){var t=e.length*.75,r=e.length,n,o=0,i,l,c,a;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var s=new ArrayBuffer(t),u=new Uint8Array(s);for(n=0;n<r;n+=4)i=Ye[e.charCodeAt(n)],l=Ye[e.charCodeAt(n+1)],c=Ye[e.charCodeAt(n+2)],a=Ye[e.charCodeAt(n+3)],u[o++]=i<<2|l>>4,u[o++]=(l&15)<<4|c>>2,u[o++]=(c&3)<<6|a&63;return s};const Vr=new Map;function ti(e,t){let r=Vr.get(e);return r||(r=new Map,Vr.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const Gr=(e,t,r)=>{if(!e||!(zr(e,t)||typeof e=="object"))return;const n=e.constructor.name,o=ti(r,n);let i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function ct(e,t,r){if(e instanceof Array)return e.map(n=>ct(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const n=e.constructor.name,o=Qo(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[ct(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const n=e.constructor.name,{src:o}=e;return{rr_type:n,src:o}}else if(e instanceof HTMLCanvasElement){const n="HTMLImageElement",o=e.toDataURL();return{rr_type:n,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[ct(e.data,t,r),e.width,e.height]};if(zr(e,t)||typeof e=="object"){const n=e.constructor.name,o=Gr(e,t,r);return{rr_type:n,index:o}}}}return e}const Br=(e,t,r)=>[...e].map(n=>ct(n,t,r)),zr=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(n=>typeof t[n]=="function");return Boolean(r.find(n=>e instanceof t[n]))};function ri(e,t,r,n){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const l of i)try{if(typeof t.CanvasRenderingContext2D.prototype[l]!="function")continue;const c=Se(t.CanvasRenderingContext2D.prototype,l,function(a){return function(...s){return se(this.canvas,r,!0)||setTimeout(()=>{const u=Br([...s],t,this);e(this.canvas,{type:fe["2D"],property:l,args:u})},0),a.apply(this,s)}});o.push(c)}catch{const a=Be(t.CanvasRenderingContext2D.prototype,l,{set(s){e(this.canvas,{type:fe["2D"],property:l,args:[s],setter:!0})}});o.push(a)}return()=>{o.forEach(l=>l())}}function Hr(e,t){const r=[];try{const n=Se(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(i,...l){return se(this,t,!0)||"__context"in this||(this.__context=i),o.apply(this,[i,...l])}});r.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(n=>n())}}function Yr(e,t,r,n,o,i){const l=[],c=Object.getOwnPropertyNames(e);for(const a of c)try{if(typeof e[a]!="function")continue;const s=Se(e,a,function(u){return function(...d){const h=u.apply(this,d);if(Gr(h,i,e),!se(this.canvas,n,!0)){const m=Br([...d],i,e),p={type:t,property:a,args:m};r(this.canvas,p)}return h}});l.push(s)}catch{const u=Be(e,a,{set(d){r(this.canvas,{type:t,property:a,args:[d],setter:!0})}});l.push(u)}return l}function ni(e,t,r,n){const o=[];return o.push(...Yr(t.WebGLRenderingContext.prototype,fe.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...Yr(t.WebGL2RenderingContext.prototype,fe.WebGL2,e,r,n,t)),()=>{o.forEach(i=>i())}}function oi(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),o=0,i=r.length;o<i;++o)n[o]=r.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}function ii(e,t,r){var n=t===void 0?null:t,o=r===void 0?!1:r,i=oi(e,o),l=i.indexOf(`
|
|
5
|
+
`,10)+1,c=i.substring(l)+(n?"//# sourceMappingURL="+n:""),a=new Blob([c],{type:"application/javascript"});return URL.createObjectURL(a)}function si(e,t,r){var n;return function(i){return n=n||ii(e,t,r),new Worker(n,i)}}var ai=si("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Zm9yKHZhciByPSJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvIixsPXR5cGVvZiBVaW50OEFycmF5PiJ1Ij9bXTpuZXcgVWludDhBcnJheSgyNTYpLGY9MDtmPHIubGVuZ3RoO2YrKylsW3IuY2hhckNvZGVBdChmKV09Zjt2YXIgZD1mdW5jdGlvbihzKXt2YXIgZT1uZXcgVWludDhBcnJheShzKSxuLGE9ZS5sZW5ndGgsdD0iIjtmb3Iobj0wO248YTtuKz0zKXQrPXJbZVtuXT4+Ml0sdCs9clsoZVtuXSYzKTw8NHxlW24rMV0+PjRdLHQrPXJbKGVbbisxXSYxNSk8PDJ8ZVtuKzJdPj42XSx0Kz1yW2VbbisyXSY2M107cmV0dXJuIGElMz09PTI/dD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTEpKyI9IjphJTM9PT0xJiYodD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTIpKyI9PSIpLHR9O2NvbnN0IGM9bmV3IE1hcCx1PW5ldyBNYXA7YXN5bmMgZnVuY3Rpb24gcChzLGUpe2NvbnN0IG49YCR7c30tJHtlfWA7aWYodS5oYXMobikpcmV0dXJuIHUuZ2V0KG4pO2NvbnN0IGE9bmV3IE9mZnNjcmVlbkNhbnZhcyhzLGUpO2EuZ2V0Q29udGV4dCgiMmQiKTtjb25zdCB0PWF3YWl0KGF3YWl0IGEuY29udmVydFRvQmxvYigpKS5hcnJheUJ1ZmZlcigpLGc9ZCh0KTtyZXR1cm4gdS5zZXQobixnKSxnfWNvbnN0IGk9c2VsZjtpLm9ubWVzc2FnZT1hc3luYyBmdW5jdGlvbihzKXtpZighKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcykpcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOnMuZGF0YS5pZH0pO2NvbnN0e2lkOmUsYml0bWFwOm4sd2lkdGg6YSxoZWlnaHQ6dH09cy5kYXRhLGc9cChhLHQpLGg9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2guZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCB3PWF3YWl0IGguY29udmVydFRvQmxvYigpLHk9dy50eXBlLGI9YXdhaXQgdy5hcnJheUJ1ZmZlcigpLG89ZChiKTtpZighYy5oYXMoZSkmJmF3YWl0IGc9PT1vKXJldHVybiBjLnNldChlLG8pLGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpZihjLmdldChlKT09PW8pcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpLnBvc3RNZXNzYWdlKHtpZDplLHR5cGU6eSxiYXNlNjQ6byx3aWR0aDphLGhlaWdodDp0fSksYy5zZXQoZSxvKX19KSgpOwoK",null,!1),Xr=Object.getOwnPropertySymbols,li=Object.prototype.hasOwnProperty,ci=Object.prototype.propertyIsEnumerable,ui=(e,t)=>{var r={};for(var n in e)li.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Xr)for(var n of Xr(e))t.indexOf(n)<0&&ci.call(e,n)&&(r[n]=e[n]);return r},di=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});class hi{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(l,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(c)};const{sampling:r="all",win:n,blockClass:o,recordCanvas:i}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,i&&r==="all"&&this.initCanvasMutationObserver(n,o),i&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,o)}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n){const o=Hr(r,n),i=new Map,l=new ai;l.onmessage=d=>{const{id:h}=d.data;if(i.set(h,!1),!("base64"in d.data))return;const{base64:m,type:p,width:f,height:y}=d.data;this.mutationCb({id:h,type:fe["2D"],commands:[{property:"clearRect",args:[0,0,f,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:m}],type:p}]},0,0]}]})};const c=1e3/t;let a=0,s;const u=d=>{if(a&&d-a<c){s=requestAnimationFrame(u);return}a=d,r.document.querySelectorAll(`canvas:not(.${n} *)`).forEach(h=>di(this,null,function*(){var m;const p=this.mirror.getId(h);if(i.get(p))return;if(i.set(p,!0),["webgl","webgl2"].includes(h.__context)){const y=h.getContext(h.__context);((m=y?.getContextAttributes())==null?void 0:m.preserveDrawingBuffer)===!1&&y?.clear(y.COLOR_BUFFER_BIT)}if(h.width===0||h.height===0)return;const f=yield createImageBitmap(h);l.postMessage({id:p,bitmap:f,width:h.width,height:h.height},[f])})),s=requestAnimationFrame(u)};s=requestAnimationFrame(u),this.resetObservers=()=>{o(),cancelAnimationFrame(s)}}initCanvasMutationObserver(t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=Hr(t,r),o=ri(this.processMutation.bind(this),t,r,this.mirror),i=ni(this.processMutation.bind(this),t,r,this.mirror);this.resetObservers=()=>{n(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const o=n.map(l=>ui(l,["type"])),{type:i}=n[0];this.mutationCb({id:r,type:i,commands:o}),this.pendingCanvasMutations.delete(t)}}class mi{constructor(t){this.trackedStylesheets=new WeakSet,this.mutationCb=t.mutationCb}addStylesheet(t){this.trackedStylesheets.has(t)||(this.trackedStylesheets.add(t),this.trackStylesheet(t))}trackStylesheet(t){}attachStylesheet(t,r,n){this.mutationCb({adds:[{parentId:n.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[]}),this.addStylesheet(t)}}var pi=Object.defineProperty,fi=Object.defineProperties,vi=Object.getOwnPropertyDescriptors,Zr=Object.getOwnPropertySymbols,gi=Object.prototype.hasOwnProperty,yi=Object.prototype.propertyIsEnumerable,Kr=(e,t,r)=>t in e?pi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ae=(e,t)=>{for(var r in t||(t={}))gi.call(t,r)&&Kr(e,r,t[r]);if(Zr)for(var r of Zr(t))yi.call(t,r)&&Kr(e,r,t[r]);return e},bi=(e,t)=>fi(e,vi(t));function te(e){return bi(ae({},e),{timestamp:Date.now()})}let Q,Xe;const de=or();function ke(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="highlight-block",blockSelector:i=null,ignoreClass:l="highlight-ignore",maskTextClass:c="highlight-mask",maskTextSelector:a=null,inlineStylesheet:s=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:h,maskInputFn:m,maskTextFn:p=bt,hooks:f,packFn:y,sampling:v={},mousemoveWait:b,recordCanvas:T=!1,userTriggeredOnInput:C=!1,collectFonts:I=!1,inlineImages:w=!1,plugins:R,keepIframeSrcFn:E=()=>!1,enableStrictPrivacy:L=!1}=e;if(!t)throw new Error("emit function is required");b!==void 0&&v.mousemove===void 0&&(v.mousemove=b),de.reset();const $=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},P=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||{};kt();let j,U=0;const Y=N=>{for(const k of R||[])k.eventProcessor&&(N=k.eventProcessor(N));return y&&(N=y(N)),N};Q=(N,k)=>{var z;if(((z=Ie[0])==null?void 0:z.isFrozen())&&N.type!==O.FullSnapshot&&!(N.type===O.IncrementalSnapshot&&N.data.source===A.Mutation)&&Ie.forEach(G=>G.unfreeze()),t(Y(N),k),N.type===O.FullSnapshot)j=N,U=0;else if(N.type===O.IncrementalSnapshot){if(N.data.source===A.Mutation&&N.data.isAttachIframe)return;U++;const G=n&&U>=n,oe=r&&N.timestamp-j.timestamp>r;(G||oe)&&Xe(!0)}};const V=N=>{Q(te({type:O.IncrementalSnapshot,data:ae({source:A.Mutation},N)}))},D=N=>Q(te({type:O.IncrementalSnapshot,data:ae({source:A.Scroll},N)})),x=N=>Q(te({type:O.IncrementalSnapshot,data:ae({source:A.CanvasMutation},N)})),F=new Ho({mutationCb:V}),S=new mi({mutationCb:V}),g=new hi({recordCanvas:T,mutationCb:x,win:window,blockClass:o,mirror:de,sampling:v.canvas}),M=new Jo({mutationCb:V,scrollCb:D,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:a,inlineStylesheet:s,maskInputOptions:$,maskTextFn:p,maskInputFn:m,recordCanvas:T,inlineImages:w,sampling:v,slimDOMOptions:P,iframeManager:F,stylesheetManager:S,canvasManager:g,keepIframeSrcFn:E,enableStrictPrivacy:L},mirror:de});Xe=(N=!1)=>{var k,z,G,oe;Q(te({type:O.Meta,data:{href:window.location.href,width:Et(),height:Nt()}}),N),Ie.forEach(X=>X.lock());const B=go(document,{mirror:de,blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:a,inlineStylesheet:s,maskAllInputs:$,maskTextFn:p,slimDOM:P,recordCanvas:T,inlineImages:w,enableStrictPrivacy:L,onSerialize:X=>{De(X,de)&&F.addIframe(X),xt(X,de)&&S.addStylesheet(X),ze(X)&&M.addShadowRoot(X.shadowRoot,document)},onIframeLoad:(X,ge)=>{F.attachIframe(X,ge,de),M.observeAttachShadow(X)},onStylesheetLoad:(X,ge)=>{S.attachStylesheet(X,ge,de)},keepIframeSrcFn:E});if(!B)return console.warn("Failed to snapshot the document");Q(te({type:O.FullSnapshot,data:{node:B,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((z=(k=document?.body)==null?void 0:k.parentElement)==null?void 0:z.scrollLeft)||document?.body.scrollLeft||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((oe=(G=document?.body)==null?void 0:G.parentElement)==null?void 0:oe.scrollTop)||document?.body.scrollTop||0}}})),Ie.forEach(X=>X.unlock())};try{const N=[];N.push(ie("DOMContentLoaded",()=>{Q(te({type:O.DomContentLoaded,data:{}}))}));const k=G=>{var oe;return zo({mutationCb:V,mousemoveCb:(B,X)=>Q(te({type:O.IncrementalSnapshot,data:{source:X,positions:B}})),mouseInteractionCb:B=>Q(te({type:O.IncrementalSnapshot,data:ae({source:A.MouseInteraction},B)})),scrollCb:D,viewportResizeCb:B=>Q(te({type:O.IncrementalSnapshot,data:ae({source:A.ViewportResize},B)})),inputCb:B=>Q(te({type:O.IncrementalSnapshot,data:ae({source:A.Input},B)})),mediaInteractionCb:B=>Q(te({type:O.IncrementalSnapshot,data:ae({source:A.MediaInteraction},B)})),styleSheetRuleCb:B=>Q(te({type:O.IncrementalSnapshot,data:ae({source:A.StyleSheetRule},B)})),styleDeclarationCb:B=>Q(te({type:O.IncrementalSnapshot,data:ae({source:A.StyleDeclaration},B)})),canvasMutationCb:x,fontCb:B=>Q(te({type:O.IncrementalSnapshot,data:ae({source:A.Font},B)})),blockClass:o,ignoreClass:l,maskTextClass:c,maskTextSelector:a,maskInputOptions:$,inlineStylesheet:s,sampling:v,recordCanvas:T,inlineImages:w,userTriggeredOnInput:C,collectFonts:I,doc:G,maskInputFn:m,maskTextFn:p,keepIframeSrcFn:E,blockSelector:i,slimDOMOptions:P,mirror:de,iframeManager:F,stylesheetManager:S,shadowDomManager:M,canvasManager:g,enableStrictPrivacy:L,plugins:((oe=R?.filter(B=>B.observer))==null?void 0:oe.map(B=>({observer:B.observer,options:B.options,callback:X=>Q(te({type:O.Plugin,data:{plugin:B.name,payload:X}}))})))||[]},f)};F.addLoadListener(G=>{N.push(k(G.contentDocument))});const z=()=>{Xe(),N.push(k(document))};return document.readyState==="interactive"||document.readyState==="complete"?z():N.push(ie("load",()=>{Q(te({type:O.Load,data:{}})),z()},window)),()=>{N.forEach(G=>G())}}catch(N){console.warn(N)}}ke.addCustomEvent=(e,t)=>{!Q||Q(te({type:O.Custom,data:{tag:e,payload:t}}))},ke.freezePage=()=>{Ie.forEach(e=>e.freeze())},ke.takeFullSnapshot=e=>{if(!Xe)throw new Error("please take full snapshot after start recording");Xe(e)},ke.mirror=de;var W;(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"})(W||(W={}));var Si=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(o){return r.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function wi(){return new Si}function Ti(e){const t={},r=/;(?![^(]*\))/g,n=/:(.+)/,o=/\/\*.*?\*\//g;return e.replace(o,"").split(r).forEach(function(i){if(i){const l=i.split(n);l.length>1&&(t[Lt(l[0].trim())]=l[1].trim())}}),t}function qr(e){const t=[];for(const r in e){const n=e[r];if(typeof n!="string")continue;const o=Ii(r);t.push(`${o}: ${n};`)}return t.join(" ")}const Ni=/-([a-z])/g,Ei=/^--[a-zA-Z0-9-]+$/,Lt=e=>Ei.test(e)?e:e.replace(Ni,(t,r)=>r?r.toUpperCase():""),Ci=/\B([A-Z])/g,Ii=e=>e.replace(Ci,"-$1").toLowerCase();class le{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=J.ELEMENT_NODE,this.TEXT_NODE=J.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){const t=this.parentNode;if(!t)return null;const r=t.childNodes,n=r.indexOf(this);return r[n+1]||null}contains(t){if(t===this)return!0;for(const r of this.childNodes)if(r.contains(t))return!0;return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function ki(e){return class Yn extends e{constructor(){super(...arguments),this.nodeType=J.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=W.Document,this.textContent=null}get documentElement(){return this.childNodes.find(r=>r.RRNodeType===W.Element&&r.tagName==="HTML")||null}get body(){var r;return((r=this.documentElement)===null||r===void 0?void 0:r.childNodes.find(n=>n.RRNodeType===W.Element&&n.tagName==="BODY"))||null}get head(){var r;return((r=this.documentElement)===null||r===void 0?void 0:r.childNodes.find(n=>n.RRNodeType===W.Element&&n.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(r){const n=r.RRNodeType;if((n===W.Element||n===W.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===n))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${n===W.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return r.parentElement=null,r.parentNode=this,this.childNodes.push(r),r}insertBefore(r,n){const o=r.RRNodeType;if((o===W.Element||o===W.DocumentType)&&this.childNodes.some(l=>l.RRNodeType===o))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${o===W.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(n===null)return this.appendChild(r);const i=this.childNodes.indexOf(n);if(i==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(i,0,r),r.parentElement=null,r.parentNode=this,r}removeChild(r){const n=this.childNodes.indexOf(r);if(n===-1)throw new Error("Failed to execute 'removeChild' on 'RRDocument': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(n,1),r.parentElement=null,r.parentNode=null,r}open(){this.childNodes=[]}close(){}write(r){let n;if(r==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?n="-//W3C//DTD XHTML 1.0 Transitional//EN":r==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(n="-//W3C//DTD HTML 4.0 Transitional//EN"),n){const o=this.createDocumentType("html",n,"");this.open(),this.appendChild(o)}}createDocument(r,n,o){return new Yn}createDocumentType(r,n,o){const i=new(Jr(le))(r,n,o);return i.ownerDocument=this,i}createElement(r){const n=new(Qr(le))(r);return n.ownerDocument=this,n}createElementNS(r,n){return this.createElement(n)}createTextNode(r){const n=new(en(le))(r);return n.ownerDocument=this,n}createComment(r){const n=new(tn(le))(r);return n.ownerDocument=this,n}createCDATASection(r){const n=new(rn(le))(r);return n.ownerDocument=this,n}toString(){return"RRDocument"}}}function Jr(e){return class extends e{constructor(t,r,n){super(),this.nodeType=J.DOCUMENT_TYPE_NODE,this.RRNodeType=W.DocumentType,this.textContent=null,this.name=t,this.publicId=r,this.systemId=n,this.nodeName=t}toString(){return"RRDocumentType"}}}function Qr(e){return class extends e{constructor(t){super(),this.nodeType=J.ELEMENT_NODE,this.RRNodeType=W.Element,this.attributes={},this.shadowRoot=null,this.tagName=t.toUpperCase(),this.nodeName=t.toUpperCase()}get textContent(){let t="";return this.childNodes.forEach(r=>t+=r.textContent),t}set textContent(t){this.childNodes=[this.ownerDocument.createTextNode(t)]}get classList(){return new xi(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?Ti(this.attributes.style):{},r=/\B([A-Z])/g;return t.setProperty=(n,o,i)=>{if(r.test(n))return;const l=Lt(n);o?t[l]=o:delete t[l],i==="important"&&(t[l]+=" !important"),this.attributes.style=qr(t)},t.removeProperty=n=>{if(r.test(n))return"";const o=Lt(n),i=t[o]||"";return delete t[o],this.attributes.style=qr(t),i},t}getAttribute(t){return this.attributes[t]||null}setAttribute(t,r){this.attributes[t]=r}setAttributeNS(t,r,n){this.setAttribute(r,n)}removeAttribute(t){delete this.attributes[t]}appendChild(t){return this.childNodes.push(t),t.parentNode=this,t.parentElement=this,t}insertBefore(t,r){if(r===null)return this.appendChild(t);const n=this.childNodes.indexOf(r);if(n==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(n,0,t),t.parentElement=this,t.parentNode=this,t}removeChild(t){const r=this.childNodes.indexOf(t);if(r===-1)throw new Error("Failed to execute 'removeChild' on 'RRElement': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(r,1),t.parentElement=null,t.parentNode=null,t}attachShadow(t){const r=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=r,r}dispatchEvent(t){return!0}toString(){let t="";for(const r in this.attributes)t+=`${r}="${this.attributes[r]}" `;return`${this.tagName} ${t}`}}}function Mi(e){return class extends e{attachShadow(t){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}function en(e){return class extends e{constructor(t){super(),this.nodeType=J.TEXT_NODE,this.nodeName="#text",this.RRNodeType=W.Text,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function tn(e){return class extends e{constructor(t){super(),this.nodeType=J.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=W.Comment,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function rn(e){return class extends e{constructor(t){super(),this.nodeName="#cdata-section",this.nodeType=J.CDATA_SECTION_NODE,this.RRNodeType=W.CDATA,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class xi{constructor(t,r){if(this.classes=[],this.add=(...n)=>{for(const o of n){const i=String(o);this.classes.indexOf(i)>=0||this.classes.push(i)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...n)=>{this.classes=this.classes.filter(o=>n.indexOf(o)===-1),this.onChange&&this.onChange(this.classes.join(" "))},t){const n=t.trim().split(/\s+/);this.classes.push(...n)}this.onChange=r}}var J;(function(e){e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"})(J||(J={}));const At={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},Oi={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 he(e,t,r,n){const o=e.childNodes,i=t.childNodes;n=n||t.mirror||t.ownerDocument.mirror,(o.length>0||i.length>0)&&nn(Array.from(o),i,e,r,n);let l=null,c=null;switch(t.RRNodeType){case W.Document:{c=t.scrollData;break}case W.Element:{const a=e,s=t;switch(Ri(a,s,n),c=s.scrollData,l=s.inputData,s.tagName){case"AUDIO":case"VIDEO":{const u=e,d=s;d.paused!==void 0&&(d.paused?u.pause():u.play()),d.muted!==void 0&&(u.muted=d.muted),d.volume!==void 0&&(u.volume=d.volume),d.currentTime!==void 0&&(u.currentTime=d.currentTime);break}case"CANVAS":{const u=t;if(u.rr_dataURL!==null){const d=document.createElement("img");d.onload=()=>{const h=a.getContext("2d");h&&h.drawImage(d,0,0,d.width,d.height)},d.src=u.rr_dataURL}u.canvasMutations.forEach(d=>r.applyCanvas(d.event,d.mutation,e))}break;case"STYLE":Di(a,t.rules);break}if(s.shadowRoot){a.shadowRoot||a.attachShadow({mode:"open"});const u=a.shadowRoot.childNodes,d=s.shadowRoot.childNodes;(u.length>0||d.length>0)&&nn(Array.from(u),d,a.shadowRoot,r,n)}break}case W.Text:case W.Comment:case W.CDATA:e.textContent!==t.data&&(e.textContent=t.data);break}if(c&&r.applyScroll(c,!0),l&&r.applyInput(l),t.nodeName==="IFRAME"){const a=e.contentDocument,s=t;if(a){const u=n.getMeta(s.contentDocument);u&&r.mirror.add(a,Object.assign({},u)),he(a,s.contentDocument,r,n)}}}function Ri(e,t,r){const n=e.attributes,o=t.attributes;for(const i in o){const l=o[i],c=r.getMeta(t);if(c&&"isSVG"in c&&c.isSVG&&At[i])e.setAttributeNS(At[i],i,l);else if(t.tagName==="CANVAS"&&i==="rr_dataURL"){const a=document.createElement("img");a.src=l,a.onload=()=>{const s=e.getContext("2d");s&&s.drawImage(a,0,0,a.width,a.height)}}else e.setAttribute(i,l)}for(const{name:i}of Array.from(n))i in o||e.removeAttribute(i);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function nn(e,t,r,n,o){var i;let l=0,c=e.length-1,a=0,s=t.length-1,u=e[l],d=e[c],h=t[a],m=t[s],p,f;for(;l<=c&&a<=s;){const y=n.mirror.getId(u),v=n.mirror.getId(d),b=o.getId(h),T=o.getId(m);if(u===void 0)u=e[++l];else if(d===void 0)d=e[--c];else if(y!==-1&&y===b)he(u,h,n,o),u=e[++l],h=t[++a];else if(v!==-1&&v===T)he(d,m,n,o),d=e[--c],m=t[--s];else if(y!==-1&&y===T)r.insertBefore(u,d.nextSibling),he(u,m,n,o),u=e[++l],m=t[--s];else if(v!==-1&&v===b)r.insertBefore(d,u),he(d,h,n,o),d=e[--c],h=t[++a];else{if(!p){p={};for(let C=l;C<=c;C++){const I=e[C];I&&n.mirror.hasNode(I)&&(p[n.mirror.getId(I)]=C)}}if(f=p[o.getId(h)],f){const C=e[f];r.insertBefore(C,u),he(C,h,n,o),e[f]=void 0}else{const C=Ft(h,n.mirror,o);r.nodeName==="#document"&&((i=n.mirror.getMeta(C))===null||i===void 0?void 0:i.type)===W.Element&&r.documentElement&&(r.removeChild(r.documentElement),e[l]=void 0,u=void 0),r.insertBefore(C,u||null),he(C,h,n,o)}h=t[++a]}}if(l>c){const y=t[s+1];let v=null;for(y&&r.childNodes.forEach(b=>{n.mirror.getId(b)===o.getId(y)&&(v=b)});a<=s;++a){const b=Ft(t[a],n.mirror,o);r.insertBefore(b,v),he(b,t[a],n,o)}}else if(a>s)for(;l<=c;l++){const y=e[l];y&&(r.removeChild(y),n.mirror.removeNodeFromMap(y))}}function Ft(e,t,r){const n=r.getId(e),o=r.getMeta(e);let i=null;if(n>-1&&(i=t.getNode(n)),i!==null)return i;switch(e.RRNodeType){case W.Document:i=new Document;break;case W.DocumentType:i=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case W.Element:{let l=e.tagName.toLowerCase();l=Oi[l]||l,o&&"isSVG"in o&&o?.isSVG?i=document.createElementNS(At.svg,l):i=document.createElement(e.tagName);break}case W.Text:i=document.createTextNode(e.data);break;case W.Comment:i=document.createComment(e.data);break;case W.CDATA:i=document.createCDATASection(e.data);break}return o&&t.add(i,Object.assign({},o)),i}function Ze(e,t){const r=e[t[0]];return t.length===1?r:Ze(r.cssRules[t[1]].cssRules,t.slice(2))}var ce;(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"})(ce||(ce={}));function on(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function Di(e,t){const r=e.sheet;t.forEach(n=>{if(n.type===ce.Insert)try{if(Array.isArray(n.index)){const{positions:o,index:i}=on(n.index);Ze(r.cssRules,o).insertRule(n.cssText,i)}else r.insertRule(n.cssText,n.index)}catch{}else if(n.type===ce.Remove)try{if(Array.isArray(n.index)){const{positions:o,index:i}=on(n.index);Ze(r.cssRules,o).deleteRule(i||0)}else r.deleteRule(n.index)}catch{}else n.type===ce.SetProperty?Ze(r.cssRules,n.index).style.setProperty(n.property,n.value,n.priority):n.type===ce.RemoveProperty&&Ze(r.cssRules,n.index).style.removeProperty(n.property)})}class Fe extends ki(le){constructor(t){super(),this._unserializedId=-1,this.mirror=Gi(),this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,r,n){return new Fe}createDocumentType(t,r,n){const o=new Li(t,r,n);return o.ownerDocument=this,o}createElement(t){const r=t.toUpperCase();let n;switch(r){case"AUDIO":case"VIDEO":n=new Ai(r);break;case"IFRAME":n=new _i(r,this.mirror);break;case"CANVAS":n=new Fi(r);break;case"STYLE":n=new Pi(r);break;default:n=new Ke(r);break}return n.ownerDocument=this,n}createComment(t){const r=new Wi(t);return r.ownerDocument=this,r}createCDATASection(t){const r=new Ui(t);return r.ownerDocument=this,r}createTextNode(t){const r=new $i(t);return r.ownerDocument=this,r}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=-1}}const Li=Jr(le);class Ke extends Qr(le){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class Ai extends Mi(Ke){}class Fi extends Ke{constructor(){super(...arguments),this.rr_dataURL=null,this.canvasMutations=[]}getContext(){return null}}class Pi extends Ke{constructor(){super(...arguments),this.rules=[]}}class _i extends Ke{constructor(t,r){super(t),this.contentDocument=new Fe,this.contentDocument.mirror=r}}const $i=en(le),Wi=tn(le),Ui=rn(le);function ji(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function sn(e,t,r,n){let o;switch(e.nodeType){case J.DOCUMENT_NODE:n&&n.nodeName==="IFRAME"?o=n.contentDocument:(o=t,o.compatMode=e.compatMode);break;case J.DOCUMENT_TYPE_NODE:{const l=e;o=t.createDocumentType(l.name,l.publicId,l.systemId);break}case J.ELEMENT_NODE:{const l=e,c=ji(l);o=t.createElement(c);const a=o;for(const{name:s,value:u}of Array.from(l.attributes))a.attributes[s]=u;l.scrollLeft&&(a.scrollLeft=l.scrollLeft),l.scrollTop&&(a.scrollTop=l.scrollTop);break}case J.TEXT_NODE:o=t.createTextNode(e.textContent||"");break;case J.CDATA_SECTION_NODE:o=t.createCDATASection(e.data);break;case J.COMMENT_NODE:o=t.createComment(e.textContent||"");break;case J.DOCUMENT_FRAGMENT_NODE:o=n.attachShadow({mode:"open"});break;default:return null}let i=r.getMeta(e);return t instanceof Fe&&(i||(i=an(o,t.unserializedId),r.add(e,i)),t.mirror.add(o,Object.assign({},i))),o}function Vi(e,t=wi(),r=new Fe){function n(o,i){const l=sn(o,r,t,i);l!==null&&(i?.nodeName!=="IFRAME"&&o.nodeType!==J.DOCUMENT_FRAGMENT_NODE&&(i?.appendChild(l),l.parentNode=i,l.parentElement=i),o.nodeName==="IFRAME"?n(o.contentDocument,l):(o.nodeType===J.DOCUMENT_NODE||o.nodeType===J.ELEMENT_NODE||o.nodeType===J.DOCUMENT_FRAGMENT_NODE)&&(o.nodeType===J.ELEMENT_NODE&&o.shadowRoot&&n(o.shadowRoot,l),o.childNodes.forEach(c=>n(c,l))))}return n(e,null),r}function Gi(){return new Bi}class Bi{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var r;if(!t)return-1;const n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){const n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function an(e,t){switch(e.RRNodeType){case W.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case W.DocumentType:{const r=e;return{id:t,type:e.RRNodeType,name:r.name,publicId:r.publicId,systemId:r.systemId}}case W.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case W.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case W.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case W.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}function ln(e){return{all:e=e||new Map,on:function(t,r){var n=e.get(t);n?n.push(r):e.set(t,[r])},off:function(t,r){var n=e.get(t);n&&(r?n.splice(n.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var n=e.get(t);n&&n.slice().map(function(o){o(r)}),(n=e.get("*"))&&n.slice().map(function(o){o(t,r)})}}}var zi=Object.freeze({__proto__:null,default:ln});function Hi(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const r=e.HTMLElement||e.Element,n=468,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||a,scrollIntoView:r.prototype.scrollIntoView},i=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function l(v){const b=["MSIE ","Trident/","Edge/"];return new RegExp(b.join("|")).test(v)}const c=l(e.navigator.userAgent)?1:0;function a(v,b){this.scrollLeft=v,this.scrollTop=b}function s(v){return .5*(1-Math.cos(Math.PI*v))}function u(v){if(v===null||typeof v!="object"||v.behavior===void 0||v.behavior==="auto"||v.behavior==="instant")return!0;if(typeof v=="object"&&v.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+v.behavior+" is not a valid value for enumeration ScrollBehavior.")}function d(v,b){if(b==="Y")return v.clientHeight+c<v.scrollHeight;if(b==="X")return v.clientWidth+c<v.scrollWidth}function h(v,b){const T=e.getComputedStyle(v,null)["overflow"+b];return T==="auto"||T==="scroll"}function m(v){const b=d(v,"Y")&&h(v,"Y"),T=d(v,"X")&&h(v,"X");return b||T}function p(v){for(;v!==t.body&&m(v)===!1;)v=v.parentNode||v.host;return v}function f(v){const b=i();let T,C,I,w=(b-v.startTime)/n;w=w>1?1:w,T=s(w),C=v.startX+(v.x-v.startX)*T,I=v.startY+(v.y-v.startY)*T,v.method.call(v.scrollable,C,I),(C!==v.x||I!==v.y)&&e.requestAnimationFrame(f.bind(e,v))}function y(v,b,T){let C,I,w,R;const E=i();v===t.body?(C=e,I=e.scrollX||e.pageXOffset,w=e.scrollY||e.pageYOffset,R=o.scroll):(C=v,I=v.scrollLeft,w=v.scrollTop,R=a),f({scrollable:C,method:R,startTime:E,startX:I,startY:w,x:b,y:T})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}y.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){o.scrollBy.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}y.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},r.prototype.scroll=r.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const v=arguments[0].left,b=arguments[0].top;y.call(this,this,typeof v>"u"?this.scrollLeft:~~v,typeof b>"u"?this.scrollTop:~~b)},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},r.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){o.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const v=p(this),b=v.getBoundingClientRect(),T=this.getBoundingClientRect();v!==t.body?(y.call(this,v,v.scrollLeft+T.left-b.left,v.scrollTop+T.top-b.top),e.getComputedStyle(v).position!=="fixed"&&e.scrollBy({left:b.left,top:b.top,behavior:"smooth"})):e.scrollBy({left:T.left,top:T.top,behavior:"smooth"})}}class Yi{constructor(t=[],r){this.timeOffset=0,this.raf=null,this.actions=t,this.speed=r}addAction(t){const r=this.findActionIndex(t);this.actions.splice(r,0,t)}addActions(t){this.actions=this.actions.concat(t)}replaceActions(t){this.actions.length=0,this.actions.splice(0,0,...t)}start(){this.timeOffset=0;let t=performance.now();const{actions:r}=this,n=()=>{const o=performance.now();for(this.timeOffset+=(o-t)*this.speed,t=o;r.length;){const i=r[0];if(this.timeOffset>=i.delay)r.shift(),i.doAction();else break}(r.length>0||this.liveMode)&&(this.raf=requestAnimationFrame(n))};this.raf=requestAnimationFrame(n)}clear(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(t){this.speed=t}toggleLiveMode(t){this.liveMode=t}isActive(){return this.raf!==null}findActionIndex(t){let r=0,n=this.actions.length-1;for(;r<=n;){const o=Math.floor((r+n)/2);if(this.actions[o].delay<t.delay)r=o+1;else if(this.actions[o].delay>t.delay)n=o-1;else return o+1}return r}}function Pt(e,t){if(e.type===O.IncrementalSnapshot&&e.data.source===A.MouseMove){const r=e.data.positions[0].timeOffset,n=e.timestamp+r;return e.delay=n-t,n-t}return e.delay=e.timestamp-t,e.delay}/*! *****************************************************************************
|
|
6
6
|
Copyright (c) Microsoft Corporation.
|
|
7
7
|
|
|
8
8
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -15,7 +15,7 @@ or you can use record.mirror to access the mirror instance during recording.`;q.
|
|
|
15
15
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
16
16
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
17
17
|
PERFORMANCE OF THIS SOFTWARE.
|
|
18
|
-
***************************************************************************** */function cn(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),l=[];try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)l.push(n.value)}catch(c){o={error:c}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return l}var Fe;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Fe||(Fe={}));var un={type:"xstate.init"};function _t(e){return e===void 0?[]:[].concat(e)}function xe(e){return{type:"xstate.assign",assignment:e}}function dn(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 ut(e){return function(t){return e===t}}function hn(e){return typeof e=="string"?{type:e}:e}function mn(e,t){return{value:e,context:t,actions:[],changed:!1,matches:ut(e)}}function pn(e,t,r){var n=t,o=!1;return[e.filter(function(i){if(i.type==="xstate.assign"){o=!0;var l=Object.assign({},n);return typeof i.assignment=="function"?l=i.assignment(n,r):Object.keys(i.assignment).forEach(function(c){l[c]=typeof i.assignment[c]=="function"?i.assignment[c](n,r):i.assignment[c]}),n=l,!1}return!0}),n,o]}function fn(e,t){t===void 0&&(t={});var r=cn(pn(_t(e.states[e.initial].entry).map(function(l){return dn(l,t.actions)}),e.context,un),2),n=r[0],o=r[1],i={config:e,_options:t,initialState:{value:e.initial,actions:n,context:o,matches:ut(e.initial)},transition:function(l,c){var a,s,u=typeof l=="string"?{value:l,context:e.context}:l,d=u.value,h=u.context,m=hn(c),p=e.states[d];if(p.on){var f=_t(p.on[m.type]);try{for(var y=function(O){var _=typeof Symbol=="function"&&Symbol.iterator,S=_&&O[_],g=0;if(S)return S.call(O);if(O&&typeof O.length=="number")return{next:function(){return O&&g>=O.length&&(O=void 0),{value:O&&O[g++],done:!O}}};throw new TypeError(_?"Object is not iterable.":"Symbol.iterator is not defined.")}(f),v=y.next();!v.done;v=y.next()){var b=v.value;if(b===void 0)return mn(d,h);var N=typeof b=="string"?{target:b}:b,T=N.target,w=N.actions,x=w===void 0?[]:w,k=N.cond,E=k===void 0?function(){return!0}:k,L=T===void 0,P=T??d,V=e.states[P];if(E(h,m)){var G=cn(pn((L?_t(x):[].concat(p.exit,x,V.entry).filter(function(O){return O})).map(function(O){return dn(O,i._options.actions)}),h,m),3),U=G[0],Y=G[1],D=G[2],F=T??d;return{value:F,context:Y,actions:U,changed:T!==d||U.length>0||D,matches:ut(F)}}}}catch(O){a={error:O}}finally{try{v&&!v.done&&(s=y.return)&&s.call(y)}finally{if(a)throw a.error}}}return mn(d,h)}};return i}var vn=function(e,t){return e.actions.forEach(function(r){var n=r.exec;return n&&n(e.context,t)})};function gn(e){var t=e.initialState,r=Fe.NotStarted,n=new Set,o={_machine:e,send:function(i){r===Fe.Running&&(t=e.transition(t,i),vn(t,hn(i)),n.forEach(function(l){return l(t)}))},subscribe:function(i){return n.add(i),i(t),{unsubscribe:function(){return n.delete(i)}}},start:function(i){if(i){var l=typeof i=="object"?i:{context:e.config.context,value:i};t={value:l.value,actions:[],context:l.context,matches:ut(l.value)}}return r=Fe.Running,vn(t,un),o},stop:function(){return r=Fe.Stopped,n.clear(),o},get state(){return t},get status(){return r}};return o}var Xi=Object.defineProperty,Zi=Object.defineProperties,Ki=Object.getOwnPropertyDescriptors,yn=Object.getOwnPropertySymbols,qi=Object.prototype.hasOwnProperty,Ji=Object.prototype.propertyIsEnumerable,bn=(e,t,r)=>t in e?Xi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dt=(e,t)=>{for(var r in t||(t={}))qi.call(t,r)&&bn(e,r,t[r]);if(yn)for(var r of yn(t))Ji.call(t,r)&&bn(e,r,t[r]);return e},ht=(e,t)=>Zi(e,Ki(t));function Qi(e,t){for(let r=e.length-1;r>=0;r--){const n=e[r];if(n.type===R.Meta&&n.timestamp<=t)return e.slice(r)}return e}function es(e,{getCastFn:t,applyEventsSynchronously:r,emitter:n}){const o=fn({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:xe({lastPlayedEvent:(i,l)=>l.type==="CAST_EVENT"?l.payload.event:i.lastPlayedEvent}),recordTimeOffset:xe((i,l)=>{let c=i.timeOffset;return"payload"in l&&"timeOffset"in l.payload&&(c=l.payload.timeOffset),ht(dt({},i),{timeOffset:c,baselineTime:i.events[0].timestamp+c})}),play(i){var l;const{timer:c,events:a,baselineTime:s,lastPlayedEvent:u}=i;c.clear();for(const f of a)Ft(f,s);const d=Qi(a,s);let h=u?.timestamp;u?.type===R.IncrementalSnapshot&&u.data.source===A.MouseMove&&(h=u.timestamp+((l=u.data.positions[0])==null?void 0:l.timeOffset)),s<(h||0)&&n.emit(H.PlayBack);const m=new Array,p=new Array;for(const f of d)if(!(h&&h<s&&(f.timestamp<=h||f===u)))if(f.timestamp<s)m.push(f);else{const y=t(f,!1);p.push({doAction:()=>{y()},delay:f.delay})}r(m),n.emit(H.Flush),c.addActions(p),c.start()},pause(i){i.timer.clear()},resetLastPlayedEvent:xe(i=>ht(dt({},i),{lastPlayedEvent:null})),startLive:xe({baselineTime:(i,l)=>(i.timer.toggleLiveMode(!0),i.timer.start(),l.type==="TO_LIVE"&&l.payload.baselineTime?l.payload.baselineTime:Date.now())}),replaceEvents:xe((i,l)=>{const{events:c,timer:a,baselineTime:s}=i;if(l.type==="REPLACE_EVENTS"){const{events:u}=l.payload;c.length=0;const d=[];for(const h of u)if(Ft(h,s),c.push(h),h.timestamp>=a.timeOffset+s){const m=t(h,!1);d.push({doAction:()=>{m()},delay:h.delay})}a.isActive()&&a.replaceActions(d)}return ht(dt({},i),{events:c})}),addEvent:xe((i,l)=>{const{baselineTime:c,timer:a,events:s}=i;if(l.type==="ADD_EVENT"){const{event:u}=l.payload;Ft(u,c);let d=s.length-1;if(!s[d]||s[d].timestamp<=u.timestamp)s.push(u);else{let p=-1,f=0;for(;f<=d;){const y=Math.floor((f+d)/2);s[y].timestamp<=u.timestamp?f=y+1:d=y-1}p===-1&&(p=f),s.splice(p,0,u)}const h=u.timestamp<c,m=t(u,h);h?m():a.isActive()&&a.addAction({doAction:()=>{m()},delay:u.delay})}return ht(dt({},i),{events:s})})}});return gn(o)}function ts(e){const t=fn({id:"speed",context:e,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(r,n)=>{"payload"in n&&r.timer.setSpeed(n.payload.speed)},recordSpeed:xe({normalSpeed:r=>r.timer.speed}),restoreSpeed:r=>{r.timer.setSpeed(r.normalSpeed)}}});return gn(t)}const rs=e=>["noscript { display: none !important; }",`.${e} { background: currentColor; border-radius: 5px; }`,`.${e}:hover::after {content: 'Redacted'; color: white; background: black; text-align: center; width: 100%; display: block;}`];var ns=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});const Sn=new Map;function wn(e,t){let r=Sn.get(e);return r||(r=new Map,Sn.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function we(e,t,r){return n=>ns(this,null,function*(){if(n&&typeof n=="object"&&"rr_type"in n)if(r&&(r.isUnchanged=!1),n.rr_type==="ImageBitmap"&&"args"in n){const o=yield we(e,t,r)(n.args);return yield createImageBitmap.apply(null,o)}else if("index"in n){if(r||t===null)return n;const{rr_type:o,index:i}=n;return wn(t,o)[i]}else if("args"in n){const{rr_type:o,args:i}=n,l=window[o];return new l(...yield Promise.all(i.map(we(e,t,r))))}else{if("base64"in n)return ei(n.base64);if("src"in n){const o=e.get(n.src);if(o)return o;{const i=new Image;return i.src=n.src,e.set(n.src,i),i}}else if("data"in n&&n.rr_type==="Blob"){const o=yield Promise.all(n.data.map(we(e,t,r)));return new Blob(o,{type:n.type})}}else if(Array.isArray(n))return yield Promise.all(n.map(we(e,t,r)));return n})}var os=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});function is(e,t){try{return t===fe.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}const ss=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function as(e,t){if(!(t!=null&&t.constructor))return;const{name:r}=t.constructor;if(!ss.includes(r))return;const n=wn(e,r);n.includes(t)||n.push(t)}function ls(e){return os(this,arguments,function*({mutation:t,target:r,type:n,imageMap:o,errorHandler:i}){try{const l=is(r,n);if(!l)return;if(t.setter){l[t.property]=t.args[0];return}const c=l[t.property],a=yield Promise.all(t.args.map(we(o,l))),s=c.apply(l,a);as(l,s)}catch(l){i(t,l)}})}var cs=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});function us(e){return cs(this,arguments,function*({event:t,mutation:r,target:n,imageMap:o,errorHandler:i}){try{const l=n.getContext("2d");if(r.setter){l[r.property]=r.args[0];return}const c=l[r.property];if(r.property==="drawImage"&&typeof r.args[0]=="string")o.get(t),c.apply(l,r.args);else{const a=yield Promise.all(r.args.map(we(o,l)));c.apply(l,a)}}catch(l){i(r,l)}})}var ds=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});function Tn(e){return ds(this,arguments,function*({event:t,mutation:r,target:n,imageMap:o,canvasEventMap:i,errorHandler:l}){try{const c=i.get(t)||r,a="commands"in c?c.commands:[c];if([fe.WebGL,fe.WebGL2].includes(r.type)){for(let s=0;s<a.length;s++){const u=a[s];yield ls({mutation:u,type:r.type,target:n,imageMap:o,errorHandler:l})}return}for(let s=0;s<a.length;s++){const u=a[s];yield us({event:t,mutation:u,target:n,imageMap:o,errorHandler:l})}}catch(c){l(r,c)}})}var hs=Object.defineProperty,ms=Object.defineProperties,ps=Object.getOwnPropertyDescriptors,Nn=Object.getOwnPropertySymbols,fs=Object.prototype.hasOwnProperty,vs=Object.prototype.propertyIsEnumerable,En=(e,t,r)=>t in e?hs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_e=(e,t)=>{for(var r in t||(t={}))fs.call(t,r)&&En(e,r,t[r]);if(Nn)for(var r of Nn(t))vs.call(t,r)&&En(e,r,t[r]);return e},$t=(e,t)=>ms(e,ps(t)),Wt=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});const Cn=10*1e3,In=2*1e3,Mn=1*1e3,xn=60*60*1e3,gs=ln||zi,Ut="[replayer]",jt={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Vt(e){return e.type==R.IncrementalSnapshot&&(e.data.source==A.TouchMove||e.data.source==A.MouseInteraction&&e.data.type==ee.TouchStart)}class ys{constructor(t,r){if(this.usingVirtualDom=!1,this.virtualDom=new Pe,this.mouseTail=null,this.tailPositions=[],this.emitter=gs(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=vr(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=or(),this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,this.handleResize=c=>{this.iframe.style.display="inherit";for(const a of[this.mouseTail,this.iframe])!a||(a.setAttribute("width",String(c.width)),a.setAttribute("height",String(c.height)))},this.applyEventsSynchronously=c=>{for(const a of c){switch(a.type){case R.DomContentLoaded:case R.Load:case R.Custom:continue;case R.FullSnapshot:case R.Meta:case R.Plugin:case R.IncrementalSnapshot:break}this.getCastFn(a,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null},this.getCastFn=(c,a=!1)=>{let s;switch(c.type){case R.DomContentLoaded:case R.Load:break;case R.Custom:s=()=>{this.emitter.emit(H.CustomEvent,c)};break;case R.Meta:s=()=>this.emitter.emit(H.Resize,{width:c.data.width,height:c.data.height});break;case R.FullSnapshot:s=()=>{if(this.firstFullSnapshot){if(this.firstFullSnapshot===c){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(c,a),this.iframe.contentWindow.scrollTo(c.data.initialOffset)};break;case R.IncrementalSnapshot:s=()=>{if(this.applyIncremental(c,a),!a&&(this.handleInactivity(c.timestamp),c===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const u of this.service.state.context.events)if(!(u.timestamp<=c.timestamp)&&this.isUserInteraction(u)){u.delay-c.delay>Cn*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=u);break}if(this.nextUserInteractionEvent){const u=this.nextUserInteractionEvent.delay-c.delay,d={speed:Math.min(Math.round(u/In),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:d}),this.emitter.emit(H.SkipStart,d)}}};break}return()=>{s&&s();for(const d of this.config.plugins||[])d.handler(c,a,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:c}});const u=this.service.state.context.events.length-1;if(c===this.service.state.context.events[u]){const d=()=>{u<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(H.Finish))};c.type===R.IncrementalSnapshot&&c.data.source===A.MouseMove&&c.data.positions.length?setTimeout(()=>{d()},Math.max(0,-c.data.positions[0].timeOffset+50)):d()}this.emitter.emit(H.EventCast,c)}},!(r!=null&&r.liveMode)&&t.length<2)throw new Error("Replayer need at least 2 events.");const n={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"highlight-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:jt,useVirtualDom:!0,inactiveThreshold:.02,inactiveSkipTime:In};this.config=Object.assign({},n,r),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(H.Resize,this.handleResize),this.setupDom(),this.emitter.on(H.Flush,()=>{if(this.usingVirtualDom){const c={mirror:this.mirror,applyCanvas:(a,s,u)=>{Tn({event:a,mutation:s,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this)};if(he(this.iframe.contentDocument,this.virtualDom,c,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const a in this.legacy_missingNodeRetryMap)try{const s=this.legacy_missingNodeRetryMap[a],u=Pt(s.node,this.mirror,this.virtualDom.mirror);he(u,s.node,c,this.virtualDom.mirror),s.node=u}catch(s){this.config.showWarning&&console.warn(s)}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null}),this.emitter.on(H.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset()});const o=new Yi([],r?.speed||n.speed);this.service=es({events:t.map(c=>r&&r.unpackFn?r.unpackFn(c):c).sort((c,a)=>c.timestamp-a.timestamp),timer:o,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(c=>{this.emitter.emit(H.StateChange,{player:c})}),this.speedService=ts({normalSpeed:-1,timer:o}),this.speedService.start(),this.speedService.subscribe(c=>{this.emitter.emit(H.StateChange,{speed:c})});const i=this.service.state.context.events.find(c=>c.type===R.Meta),l=this.service.state.context.events.find(c=>c.type===R.FullSnapshot);if(i){const{width:c,height:a}=i.data;setTimeout(()=>{this.emitter.emit(H.Resize,{width:c,height:a})},0)}l&&setTimeout(()=>{this.firstFullSnapshot||(this.firstFullSnapshot=l,this.rebuildFullSnapshot(l),this.iframe.contentWindow.scrollTo(l.data.initialOffset))},1),this.service.state.context.events.find(Vt)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,r){return this.emitter.on(t,r),this}off(t,r){return this.emitter.off(t,r),this}setConfig(t){Object.keys(t).forEach(r=>{t[r],this.config[r]=t[r]}),this.config.skipInactive||this.backToNormal(),typeof t.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail<"u"&&(t.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getActivityIntervals(){if(this.activityIntervals.length==0){const t=[],r=this.getMetaData(),n=[{timestamp:r.startTime},...this.service.state.context.events.filter(l=>this.isUserInteraction(l)),{timestamp:r.endTime}];for(let l=1;l<n.length;l++){const c=n[l-1],a=n[l];a.timestamp-c.timestamp>Cn?t.push({startTime:c.timestamp,endTime:a.timestamp,duration:a.timestamp-c.timestamp,active:!1}):t.push({startTime:c.timestamp,endTime:a.timestamp,duration:a.timestamp-c.timestamp,active:!0})}const o=[];let i=t[0];for(let l=1;l<t.length;l++)t[l].active!=t[l-1].active&&(o.push({startTime:i.startTime,endTime:t[l-1].endTime,duration:t[l-1].endTime-i.startTime,active:t[l-1].active}),i=t[l]);i&&t.length>0&&o.push({startTime:i.startTime,endTime:t[t.length-1].endTime,duration:t[t.length-1].endTime-i.startTime,active:t[t.length-1].active}),i=o[0];for(let l=1;l<o.length;l++)(!o[l].active&&o[l].duration>this.config.inactiveThreshold*r.totalTime||!o[l-1].active&&o[l-1].duration>this.config.inactiveThreshold*r.totalTime)&&(this.activityIntervals.push({startTime:i.startTime,endTime:o[l-1].endTime,duration:o[l-1].endTime-i.startTime,active:o[l-1].active}),i=o[l]);i&&o.length>0&&this.activityIntervals.push({startTime:i.startTime,endTime:o[o.length-1].endTime,duration:o[o.length-1].endTime-i.startTime,active:o[o.length-1].active})}return this.activityIntervals}getMetaData(){const t=this.service.state.context.events[0],r=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:r.timestamp,totalTime:r.timestamp-t.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:t,events:r}=this.service.state.context;return t-r[0].timestamp}getMirror(){return this.mirror}play(t=0){var r,n;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(n=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||n.classList.remove("rrweb-paused"),this.emitter.emit(H.Start),this.handleInactivity(this.getMetaData().startTime+t,!0)}pause(t){var r,n;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(n=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||n.classList.add("rrweb-paused"),this.emitter.emit(H.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(H.Resume)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const r=this.config.unpackFn?this.config.unpackFn(t):t;Vt(r)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:r}}))}replaceEvents(t){for(const r of t)if(Vt(r)){this.mouse.classList.add("touch-device");break}this.service.send({type:"REPLACE_EVENTS",payload:{events:t}})}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=vr()}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&&(Hi(this.iframe.contentWindow,this.iframe.contentDocument),Mt(this.iframe.contentWindow))}handleInactivity(t,r){if((t===this.inactiveEndTimestamp||r)&&(this.inactiveEndTimestamp=null,this.backToNormal()),this.config.skipInactive&&!this.inactiveEndTimestamp){for(const n of this.getActivityIntervals())if(t>=n.startTime&&t<n.endTime&&!n.active){this.inactiveEndTimestamp=n.endTime;break}if(this.inactiveEndTimestamp){const n=this.inactiveEndTimestamp-t,o={speed:n/xn*this.config.inactiveSkipTime<Mn?n/Mn:Math.round(Math.max(n,xn)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:o}),this.emitter.emit(H.SkipStart,o)}}}rebuildFullSnapshot(t,r=!1){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const n=[];Co(t.data.node,{doc:this.iframe.contentDocument,afterAppend:l=>{this.collectIframeAndAttachDocument(n,l)},cache:this.cache,mirror:this.mirror});for(const{mutationInQueue:l,builtNode:c}of n)this.attachDocumentToIframe(l,c),this.newDocumentQueue=this.newDocumentQueue.filter(a=>a!==l);const{documentElement:o,head:i}=this.iframe.contentDocument;this.insertStyleRules(o,i),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(H.FullsnapshotRebuilded,t),r||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,r){const n=rs(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&n.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,an(o,this.virtualDom.unserializedId)),t.insertBefore(o,r);for(let i=0;i<n.length;i++)o.rules.push({cssText:n[i],type:ce.Insert,index:i})}else{const o=document.createElement("style");t.insertBefore(o,r);for(let i=0;i<n.length;i++)o.sheet.insertRule(n[i],i)}}attachDocumentToIframe(t,r){const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,o=[];it(t.node,{doc:r.contentDocument,mirror:n,hackCss:!0,skipChild:!1,afterAppend:i=>{this.collectIframeAndAttachDocument(o,i);const l=n.getMeta(i);if(l?.type===$.Element&&l?.tagName.toUpperCase()==="HTML"){const{documentElement:c,head:a}=r.contentDocument;this.insertStyleRules(c,a)}},cache:this.cache});for(const{mutationInQueue:i,builtNode:l}of o)this.attachDocumentToIframe(i,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==i)}collectIframeAndAttachDocument(t,r){if(De(r,this.mirror)){const n=this.newDocumentQueue.find(o=>o.parentId===this.mirror.getId(r));n&&t.push({mutationInQueue:n,builtNode:r})}}waitForStylesheetLoad(){var t;const r=(t=this.iframe.contentDocument)==null?void 0:t.head;if(r){const n=new Set;let o,i=this.service.state;const l=()=>{i=this.service.state};this.emitter.on(H.Start,l),this.emitter.on(H.Pause,l);const c=()=>{this.emitter.off(H.Start,l),this.emitter.off(H.Pause,l)};r.querySelectorAll('link[rel="stylesheet"]').forEach(a=>{a.sheet||(n.add(a),a.addEventListener("load",()=>{n.delete(a),n.size===0&&o!==-1&&(i.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(H.LoadStylesheetEnd),o&&clearTimeout(o),c())}))}),n.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(H.LoadStylesheetStart),o=setTimeout(()=>{i.matches("playing")&&this.play(this.getCurrentTime()),o=-1,c()},this.config.loadTimeout))}}preloadAllImages(){return Wt(this,null,function*(){this.service.state;const t=()=>{this.service.state};this.emitter.on(H.Start,t),this.emitter.on(H.Pause,t);const r=[];for(const n of this.service.state.context.events)n.type===R.IncrementalSnapshot&&n.data.source===A.CanvasMutation&&(r.push(this.deserializeAndPreloadCanvasEvents(n.data,n)),("commands"in n.data?n.data.commands:[n.data]).forEach(o=>{this.preloadImages(o,n)}));return Promise.all(r)})}preloadImages(t,r){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(r)){const n=document.createElement("canvas"),o=n.getContext("2d"),i=o?.createImageData(n.width,n.height);i?.data,JSON.parse(t.args[0]),o?.putImageData(i,0,0)}}deserializeAndPreloadCanvasEvents(t,r){return Wt(this,null,function*(){if(!this.canvasEventMap.has(r)){const n={isUnchanged:!0};if("commands"in t){const o=yield Promise.all(t.commands.map(i=>Wt(this,null,function*(){const l=yield Promise.all(i.args.map(we(this.imageMap,null,n)));return $t(_e({},i),{args:l})})));n.isUnchanged===!1&&this.canvasEventMap.set(r,$t(_e({},t),{commands:o}))}else{const o=yield Promise.all(t.args.map(we(this.imageMap,null,n)));n.isUnchanged===!1&&this.canvasEventMap.set(r,$t(_e({},t),{args:o}))}}})}applyIncremental(t,r){var n,o,i,l,c,a;const{data:s}=t;switch(s.source){case A.Mutation:{try{this.applyMutation(s,r)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,s)}break}case A.Drag:case A.TouchMove:case A.MouseMove:if(r){const u=s.positions[s.positions.length-1];this.mousePos={x:u.x,y:u.y,id:u.id,debugData:s}}else s.positions.forEach(u=>{const d={doAction:()=>{this.moveAndHover(u.x,u.y,u.id,r,s)},delay:u.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(d)}),this.timer.addAction({doAction(){},delay:t.delay-((n=s.positions[0])==null?void 0:n.timeOffset)});break;case A.MouseInteraction:{if(s.id===-1||r)break;const u=new Event(ee[s.type].toLowerCase()),d=this.mirror.getNode(s.id);if(!d)return this.debugNodeNotFound(s,s.id);this.emitter.emit(H.MouseInteraction,{type:s.type,target:d});const{triggerFocus:h}=this.config;switch(s.type){case ee.Blur:"blur"in d&&d.blur();break;case ee.Focus:h&&d.focus&&d.focus({preventScroll:!0});break;case ee.Click:case ee.TouchStart:case ee.TouchEnd:r?(s.type===ee.TouchStart?this.touchActive=!0:s.type===ee.TouchEnd&&(this.touchActive=!1),this.mousePos={x:s.x,y:s.y,id:s.id,debugData:s}):(s.type===ee.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(s.x,s.y,s.id,r,s),s.type===ee.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):s.type===ee.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):s.type===ee.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case ee.TouchCancel:r?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:d.dispatchEvent(u)}break}case A.Scroll:{if(s.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.scrollData=s;break}this.applyScroll(s,r);break}case A.ViewportResize:this.emitter.emit(H.Resize,{width:s.width,height:s.height});break;case A.Input:{if(s.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.inputData=s;break}this.applyInput(s);break}case A.MediaInteraction:{const u=this.usingVirtualDom?this.virtualDom.mirror.getNode(s.id):this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u;try{s.currentTime&&(d.currentTime=s.currentTime),s.volume&&(d.volume=s.volume),s.muted&&(d.muted=s.muted),s.type===Ce.Pause&&d.pause(),s.type===Ce.Play&&d.play()}catch(h){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${h.message||h}`)}break}case A.StyleSheetRule:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.rules;(o=s.adds)==null||o.forEach(({rule:h,index:m})=>d?.push({cssText:h,index:m,type:ce.Insert})),(i=s.removes)==null||i.forEach(({index:h})=>d?.push({index:h,type:ce.Remove}))}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.sheet;(l=s.adds)==null||l.forEach(({rule:h,index:m})=>{try{if(Array.isArray(m)){const{positions:p,index:f}=Rt(m);Le(d.cssRules,p).insertRule(h,f)}else{const p=m===void 0?void 0:Math.min(m,d.cssRules.length);d.insertRule(h,p)}}catch{}}),(c=s.removes)==null||c.forEach(({index:h})=>{try{if(Array.isArray(h)){const{positions:m,index:p}=Rt(h);Le(d.cssRules,m).deleteRule(p||0)}else d?.deleteRule(h)}catch{}})}break}case A.StyleDeclaration:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.rules;s.set&&d.push(_e({type:ce.SetProperty,index:s.index},s.set)),s.remove&&d.push(_e({type:ce.RemoveProperty,index:s.index},s.remove))}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.sheet;s.set&&Le(d.rules,s.index).style.setProperty(s.set.property,s.set.value,s.set.priority),s.remove&&Le(d.rules,s.index).style.removeProperty(s.remove.property)}break}case A.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.canvasMutations.push({event:t,mutation:s})}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);Tn({event:t,mutation:s,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case A.Font:{try{const u=new FontFace(s.family,s.buffer?new Uint8Array(JSON.parse(s.fontSource)):s.fontSource,s.descriptors);(a=this.iframe.contentDocument)==null||a.fonts.add(u)}catch(u){this.config.showWarning&&console.warn(u)}break}}}applyMutation(t,r){if(this.config.useVirtualDom&&!this.usingVirtualDom&&r&&(this.usingVirtualDom=!0,Vi(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const s in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[s],d=sn(u.node,this.virtualDom,this.mirror);d&&(u.node=d)}catch(u){this.config.showWarning&&console.warn(u)}const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes.forEach(s=>{var u;const d=n.getNode(s.id);if(!d)return t.removes.find(m=>m.id===s.parentId)?void 0:this.warnNodeNotFound(t,s.id);let h=n.getNode(s.parentId);if(!h)return this.warnNodeNotFound(t,s.parentId);if(s.isShadow&&ze(h)&&(h=h.shadowRoot),n.removeNodeFromMap(d),h)try{h.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&h.nodeName==="STYLE"&&((u=h.rules)==null?void 0:u.length)>0&&(h.rules=[])}catch(m){if(m instanceof DOMException)this.warn("parent could not remove child in mutation",h,d,t);else throw m}});const o=_e({},this.legacy_missingNodeRetryMap),i=[],l=s=>{let u=null;return s.nextId&&(u=n.getNode(s.nextId)),s.nextId!==null&&s.nextId!==void 0&&s.nextId!==-1&&!u},c=s=>{var u;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let d=n.getNode(s.parentId);if(!d)return s.node.type===$.Document?this.newDocumentQueue.push(s):i.push(s);s.node.isShadow&&(ze(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let h=null,m=null;if(s.previousId&&(h=n.getNode(s.previousId)),s.nextId&&(m=n.getNode(s.nextId)),l(s))return i.push(s);if(s.node.rootId&&!n.getNode(s.node.rootId))return;const p=s.node.rootId?n.getNode(s.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(De(d,n)){this.attachDocumentToIframe(s,d);return}const f=it(s.node,{doc:p,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache});if(s.previousId===-1||s.nextId===-1){o[s.node.id]={node:f,mutation:s};return}const y=n.getMeta(d);if(y&&y.type===$.Element&&y.tagName==="textarea"&&s.node.type===$.Text){const v=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const b of v)b.nodeType===d.TEXT_NODE&&d.removeChild(b)}if(h&&h.nextSibling&&h.nextSibling.parentNode)d.insertBefore(f,h.nextSibling);else if(m&&m.parentNode)d.contains(m)?d.insertBefore(f,m):d.insertBefore(f,null);else{if(d===p)for(;p.firstChild;)p.removeChild(p.firstChild);d.appendChild(f)}if(this.usingVirtualDom&&f.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[]),De(f,this.mirror)){const v=this.mirror.getId(f),b=this.newDocumentQueue.find(N=>N.parentId===v);b&&(this.attachDocumentToIframe(b,f),this.newDocumentQueue=this.newDocumentQueue.filter(N=>N!==b))}(s.previousId||s.nextId)&&this.legacy_resolveMissingNode(o,d,f,s)};t.adds.forEach(s=>{c(s)});const a=Date.now();for(;i.length;){const s=br(i);if(i.length=0,Date.now()-a>500){this.warn("Timeout in the loop, please check the resolve tree data:",s);break}for(const u of s)n.getNode(u.value.parentId)?xt(u,d=>{c(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(o).length&&Object.assign(this.legacy_missingNodeRetryMap,o),Sr(t.texts).forEach(s=>{var u;const d=n.getNode(s.id);if(!d)return t.removes.find(h=>h.id===s.id)?void 0:this.warnNodeNotFound(t,s.id);if(d.textContent=s.value,this.usingVirtualDom){const h=d.parentNode;((u=h?.rules)==null?void 0:u.length)>0&&(h.rules=[])}}),t.attributes.forEach(s=>{const u=n.getNode(s.id);if(!u)return t.removes.find(d=>d.id===s.id)?void 0:this.warnNodeNotFound(t,s.id);for(const d in s.attributes)if(typeof d=="string"){const h=s.attributes[d];if(h===null)u.removeAttribute(d);else if(typeof h=="string")try{u.setAttribute(d,h)}catch(m){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",m)}else if(d==="style"){const m=h,p=u;for(const f in m)if(m[f]===!1)p.style.removeProperty(f);else if(m[f]instanceof Array){const y=m[f];p.style.setProperty(f,y[0],y[1])}else{const y=m[f];p.style.setProperty(f,y)}}}})}applyScroll(t,r){const n=this.mirror.getNode(t.id);if(!n)return this.debugNodeNotFound(t,t.id);const o=this.mirror.getMeta(n);if(n===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else if(o?.type===$.Document)n.defaultView.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else try{n.scrollTop=t.y,n.scrollLeft=t.x}catch{}}applyInput(t){const r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);try{r.checked=t.isChecked,r.value=t.text}catch{}}legacy_resolveMissingNode(t,r,n,o){const{previousId:i,nextId:l}=o,c=i&&t[i],a=l&&t[l];if(c){const{node:s,mutation:u}=c;r.insertBefore(s,n),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,s,u)}if(a){const{node:s,mutation:u}=a;r.insertBefore(s,n.nextSibling),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,s,u)}}moveAndHover(t,r,n,o,i){const l=this.mirror.getNode(n);if(!l)return this.debugNodeNotFound(i,n);const c=Ot(l,this.iframe),a=t*c.absoluteScale+c.x,s=r*c.absoluteScale+c.y;this.mouse.style.left=`${a}px`,this.mouse.style.top=`${s}px`,o||this.drawMouseTail({x:a,y:s}),this.hoverElements(l)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:r,lineWidth:n,strokeStyle:o,duration:i}=this.config.mouseTail===!0?jt:Object.assign({},jt,this.config.mouseTail),l=()=>{if(!this.mouseTail)return;const c=this.mouseTail.getContext("2d");!c||!this.tailPositions.length||(c.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),c.beginPath(),c.lineWidth=n,c.lineCap=r,c.strokeStyle=o,c.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(a=>c.lineTo(a.x,a.y)),c.stroke())};this.tailPositions.push(t),l(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(c=>c!==t),l()},i/this.speedService.state.context.timer.speed)}hoverElements(t){var r;(r=this.iframe.contentDocument)==null||r.querySelectorAll(".\\:hover").forEach(o=>{o.classList.remove(":hover")});let n=t;for(;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement}isUserInteraction(t){return t.type!==R.IncrementalSnapshot?!1:t.data.source>A.Mutation&&t.data.source<=A.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(H.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,r){this.warn(`Node with id '${r}' not found. `,t)}warnCanvasMutationFailed(t,r){this.warn("Has error on canvas update",r,"canvas mutation:",t)}debugNodeNotFound(t,r){this.debug(Ut,`Node with id '${r}' not found. `,t)}warn(...t){!this.config.showWarning||console.warn(Ut,...t)}debug(...t){!this.config.showDebug||console.log(Ut,...t)}}const{addCustomEvent:bs}=Me,{freezePage:Ss}=Me;var re=Uint8Array,ne=Uint16Array,qe=Uint32Array,mt=new re([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),pt=new re([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Gt=new re([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),kn=function(e,t){for(var r=new ne(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var o=new qe(r[30]),n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return[r,o]},On=kn(mt,2),Rn=On[0],Bt=On[1];Rn[28]=258,Bt[258]=28;for(var Dn=kn(pt,0),ws=Dn[0],Ln=Dn[1],zt=new ne(32768),K=0;K<32768;++K){var Te=(K&43690)>>>1|(K&21845)<<1;Te=(Te&52428)>>>2|(Te&13107)<<2,Te=(Te&61680)>>>4|(Te&3855)<<4,zt[K]=((Te&65280)>>>8|(Te&255)<<8)>>>1}for(var me=function(e,t,r){for(var n=e.length,o=0,i=new ne(t);o<n;++o)++i[e[o]-1];var l=new ne(t);for(o=0;o<t;++o)l[o]=l[o-1]+i[o-1]<<1;var c;if(r){c=new ne(1<<t);var a=15-t;for(o=0;o<n;++o)if(e[o])for(var s=o<<4|e[o],u=t-e[o],d=l[e[o]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)c[zt[d]>>>a]=s}else for(c=new ne(n),o=0;o<n;++o)c[o]=zt[l[e[o]-1]++]>>>15-e[o];return c},Ne=new re(288),K=0;K<144;++K)Ne[K]=8;for(var K=144;K<256;++K)Ne[K]=9;for(var K=256;K<280;++K)Ne[K]=7;for(var K=280;K<288;++K)Ne[K]=8;for(var Je=new re(32),K=0;K<32;++K)Je[K]=5;var Ts=me(Ne,9,0),Ns=me(Ne,9,1),Es=me(Je,5,0),Cs=me(Je,5,1),Ht=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},ue=function(e,t,r){var n=t/8>>0;return(e[n]|e[n+1]<<8)>>>(t&7)&r},Yt=function(e,t){var r=t/8>>0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>>(t&7)},Xt=function(e){return(e/8>>0)+(e&7&&1)},Zt=function(e,t,r){(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length);var n=new(e instanceof ne?ne:e instanceof qe?qe:re)(r-t);return n.set(e.subarray(t,r)),n},Is=function(e,t,r){var n=e.length,o=!t||r,i=!r||r.i;r||(r={}),t||(t=new re(n*3));var l=function(oe){var B=t.length;if(oe>B){var X=new re(Math.max(B*2,oe));X.set(t),t=X}},c=r.f||0,a=r.p||0,s=r.b||0,u=r.l,d=r.d,h=r.m,m=r.n,p=n*8;do{if(!u){r.f=c=ue(e,a,1);var f=ue(e,a+1,3);if(a+=3,f)if(f==1)u=Ns,d=Cs,h=9,m=5;else if(f==2){var N=ue(e,a,31)+257,T=ue(e,a+10,15)+4,w=N+ue(e,a+5,31)+1;a+=14;for(var x=new re(w),k=new re(19),E=0;E<T;++E)k[Gt[E]]=ue(e,a+E*3,7);a+=T*3;var L=Ht(k),P=(1<<L)-1;if(!i&&a+w*(L+7)>p)break;for(var V=me(k,L,1),E=0;E<w;){var G=V[ue(e,a,P)];a+=G&15;var y=G>>>4;if(y<16)x[E++]=y;else{var U=0,Y=0;for(y==16?(Y=3+ue(e,a,3),a+=2,U=x[E-1]):y==17?(Y=3+ue(e,a,7),a+=3):y==18&&(Y=11+ue(e,a,127),a+=7);Y--;)x[E++]=U}}var D=x.subarray(0,N),F=x.subarray(N);h=Ht(D),m=Ht(F),u=me(D,h,1),d=me(F,m,1)}else throw"invalid block type";else{var y=Xt(a)+4,v=e[y-4]|e[y-3]<<8,b=y+v;if(b>n){if(i)throw"unexpected EOF";break}o&&l(s+v),t.set(e.subarray(y,b),s),r.b=s+=v,r.p=a=b*8;continue}if(a>p)throw"unexpected EOF"}o&&l(s+131072);for(var O=(1<<h)-1,_=(1<<m)-1,S=h+m+18;i||a+S<p;){var U=u[Yt(e,a)&O],g=U>>>4;if(a+=U&15,a>p)throw"unexpected EOF";if(!U)throw"invalid length/literal";if(g<256)t[s++]=g;else if(g==256){u=null;break}else{var I=g-254;if(g>264){var E=g-257,C=mt[E];I=ue(e,a,(1<<C)-1)+Rn[E],a+=C}var M=d[Yt(e,a)&_],z=M>>>4;if(!M)throw"invalid distance";a+=M&15;var F=ws[z];if(z>3){var C=pt[z];F+=Yt(e,a)&(1<<C)-1,a+=C}if(a>p)throw"unexpected EOF";o&&l(s+131072);for(var j=s+I;s<j;s+=4)t[s]=t[s-F],t[s+1]=t[s+1-F],t[s+2]=t[s+2-F],t[s+3]=t[s+3-F];s=j}}r.l=u,r.p=a,r.b=s,u&&(c=1,r.m=h,r.d=d,r.n=m)}while(!c);return s==t.length?t:Zt(t,0,s)},ve=function(e,t,r){r<<=t&7;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8},Qe=function(e,t,r){r<<=t&7;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},Kt=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,i=r.slice();if(!o)return[new re(0),0];if(o==1){var l=new re(r[0].s+1);return l[r[0].s]=1,[l,1]}r.sort(function(w,x){return w.f-x.f}),r.push({s:-1,f:25001});var c=r[0],a=r[1],s=0,u=1,d=2;for(r[0]={s:-1,f:c.f+a.f,l:c,r:a};u!=o-1;)c=r[r[s].f<r[d].f?s++:d++],a=r[s!=u&&r[s].f<r[d].f?s++:d++],r[u++]={s:-1,f:c.f+a.f,l:c,r:a};for(var h=i[0].s,n=1;n<o;++n)i[n].s>h&&(h=i[n].s);var m=new ne(h+1),p=qt(r[u-1],m,0);if(p>t){var n=0,f=0,y=p-t,v=1<<y;for(i.sort(function(x,k){return m[k.s]-m[x.s]||x.f-k.f});n<o;++n){var b=i[n].s;if(m[b]>t)f+=v-(1<<p-m[b]),m[b]=t;else break}for(f>>>=y;f>0;){var N=i[n].s;m[N]<t?f-=1<<t-m[N]++-1:++n}for(;n>=0&&f;--n){var T=i[n].s;m[T]==t&&(--m[T],++f)}p=t}return[new re(m),p]},qt=function(e,t,r){return e.s==-1?Math.max(qt(e.l,t,r+1),qt(e.r,t,r+1)):t[e.s]=r},An=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new ne(++t),n=0,o=e[0],i=1,l=function(a){r[n++]=a},c=1;c<=t;++c)if(e[c]==o&&c!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)l(32754);i>2&&(l(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(l(o),--i;i>6;i-=6)l(8304);i>2&&(l(i-3<<5|8208),i=0)}for(;i--;)l(o);i=1,o=e[c]}return[r.subarray(0,n),t]},et=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},ft=function(e,t,r){var n=r.length,o=Xt(t+2);e[o]=n&255,e[o+1]=n>>>8,e[o+2]=e[o]^255,e[o+3]=e[o+1]^255;for(var i=0;i<n;++i)e[o+i+4]=r[i];return(o+4+n)*8},Pn=function(e,t,r,n,o,i,l,c,a,s,u){ve(t,u++,r),++o[256];for(var d=Kt(o,15),h=d[0],m=d[1],p=Kt(i,15),f=p[0],y=p[1],v=An(h),b=v[0],N=v[1],T=An(f),w=T[0],x=T[1],k=new ne(19),E=0;E<b.length;++E)k[b[E]&31]++;for(var E=0;E<w.length;++E)k[w[E]&31]++;for(var L=Kt(k,7),P=L[0],V=L[1],G=19;G>4&&!P[Gt[G-1]];--G);var U=s+5<<3,Y=et(o,Ne)+et(i,Je)+l,D=et(o,h)+et(i,f)+l+14+3*G+et(k,P)+(2*k[16]+3*k[17]+7*k[18]);if(U<=Y&&U<=D)return ft(t,u,e.subarray(a,a+s));var F,O,_,S;if(ve(t,u,1+(D<Y)),u+=2,D<Y){F=me(h,m,0),O=h,_=me(f,y,0),S=f;var g=me(P,V,0);ve(t,u,N-257),ve(t,u+5,x-1),ve(t,u+10,G-4),u+=14;for(var E=0;E<G;++E)ve(t,u+3*E,P[Gt[E]]);u+=3*G;for(var I=[b,w],C=0;C<2;++C)for(var M=I[C],E=0;E<M.length;++E){var z=M[E]&31;ve(t,u,g[z]),u+=P[z],z>15&&(ve(t,u,M[E]>>>5&127),u+=M[E]>>>12)}}else F=Ts,O=Ne,_=Es,S=Je;for(var E=0;E<c;++E)if(n[E]>255){var z=n[E]>>>18&31;Qe(t,u,F[z+257]),u+=O[z+257],z>7&&(ve(t,u,n[E]>>>23&31),u+=mt[z]);var j=n[E]&31;Qe(t,u,_[j]),u+=S[j],j>3&&(Qe(t,u,n[E]>>>5&8191),u+=pt[j])}else Qe(t,u,F[n[E]]),u+=O[n[E]];return Qe(t,u,F[256]),u+O[256]},Ms=new qe([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),xs=new re(0),ks=function(e,t,r,n,o,i){var l=e.length,c=new re(n+l+5*(1+Math.floor(l/7e3))+o),a=c.subarray(n,c.length-o),s=0;if(!t||l<8)for(var u=0;u<=l;u+=65535){var d=u+65535;d<l?s=ft(a,s,e.subarray(u,d)):(a[u]=i,s=ft(a,s,e.subarray(u,l)))}else{for(var h=Ms[t-1],m=h>>>13,p=h&8191,f=(1<<r)-1,y=new ne(32768),v=new ne(f+1),b=Math.ceil(r/3),N=2*b,T=function(Ue){return(e[Ue]^e[Ue+1]<<b^e[Ue+2]<<N)&f},w=new qe(25e3),x=new ne(288),k=new ne(32),E=0,L=0,u=0,P=0,V=0,G=0;u<l;++u){var U=T(u),Y=u&32767,D=v[U];if(y[Y]=D,v[U]=Y,V<=u){var F=l-u;if((E>7e3||P>24576)&&F>423){s=Pn(e,a,0,w,x,k,L,P,G,u-G,s),P=E=L=0,G=u;for(var O=0;O<286;++O)x[O]=0;for(var O=0;O<30;++O)k[O]=0}var _=2,S=0,g=p,I=Y-D&32767;if(F>2&&U==T(u-I))for(var C=Math.min(m,F)-1,M=Math.min(32767,u),z=Math.min(258,F);I<=M&&--g&&Y!=D;){if(e[u+_]==e[u+_-I]){for(var j=0;j<z&&e[u+j]==e[u+j-I];++j);if(j>_){if(_=j,S=I,j>C)break;for(var oe=Math.min(I,j-2),B=0,O=0;O<oe;++O){var X=u-I+O+32768&32767,ge=y[X],tt=X-ge+32768&32767;tt>B&&(B=tt,D=X)}}}Y=D,D=y[Y],I+=Y-D+32768&32767}if(S){w[P++]=268435456|Bt[_]<<18|Ln[S];var We=Bt[_]&31,ye=Ln[S]&31;L+=mt[We]+pt[ye],++x[257+We],++k[ye],V=u+_,++E}else w[P++]=e[u],++x[e[u]]}}s=Pn(e,a,i,w,x,k,L,P,G,u-G,s),i||(s=ft(a,s,xs))}return Zt(c,0,n+Xt(s)+o)},Os=function(){var e=1,t=0;return{p:function(r){for(var n=e,o=t,i=r.length,l=0;l!=i;){for(var c=Math.min(l+5552,i);l<c;++l)n+=r[l],o+=n;n%=65521,o%=65521}e=n,t=o},d:function(){return(e>>>8<<16|(t&255)<<8|t>>>8)+((e&255)<<23)*2}}},Rs=function(e,t,r,n,o){return ks(e,t.level==null?6:t.level,t.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):12+t.mem,r,n,!o)},Ds=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},Ls=function(e,t){var r=t.level,n=r==0?0:r<6?1:r==9?3:2;e[0]=120,e[1]=n<<6|(n?32-2*n:1)},As=function(e){if((e[0]&15)!=8||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(e[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function Ps(e,t){t===void 0&&(t={});var r=Os();r.p(e);var n=Rs(e,t,2,4);return Ls(n,t),Ds(n,n.length-4,r.d()),n}function Fs(e,t){return Is((As(e),e.subarray(2,-4)),t)}function Fn(e,t){var r=e.length;if(!t&&typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var n=new re(e.length+(e.length>>>1)),o=0,i=function(s){n[o++]=s},l=0;l<r;++l){if(o+5>n.length){var c=new re(o+8+(r-l<<1));c.set(n),n=c}var a=e.charCodeAt(l);a<128||t?i(a):a<2048?(i(192|a>>>6),i(128|a&63)):a>55295&&a<57344?(a=65536+(a&1047552)|e.charCodeAt(++l)&1023,i(240|a>>>18),i(128|a>>>12&63),i(128|a>>>6&63),i(128|a&63)):(i(224|a>>>12),i(128|a>>>6&63),i(128|a&63))}return Zt(n,0,o)}function _n(e,t){var r="";if(!t&&typeof TextDecoder<"u")return new TextDecoder().decode(e);for(var n=0;n<e.length;){var o=e[n++];o<128||t?r+=String.fromCharCode(o):o<224?r+=String.fromCharCode((o&31)<<6|e[n++]&63):o<240?r+=String.fromCharCode((o&15)<<12|(e[n++]&63)<<6|e[n++]&63):(o=((o&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,r+=String.fromCharCode(55296|o>>10,56320|o&1023))}return r}const Jt="v1";var _s=Object.defineProperty,$s=Object.defineProperties,Ws=Object.getOwnPropertyDescriptors,$n=Object.getOwnPropertySymbols,Us=Object.prototype.hasOwnProperty,js=Object.prototype.propertyIsEnumerable,Wn=(e,t,r)=>t in e?_s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vs=(e,t)=>{for(var r in t||(t={}))Us.call(t,r)&&Wn(e,r,t[r]);if($n)for(var r of $n(t))js.call(t,r)&&Wn(e,r,t[r]);return e},Gs=(e,t)=>$s(e,Ws(t));const Bs=e=>{const t=Gs(Vs({},e),{v:Jt});return _n(Ps(Fn(JSON.stringify(t))),!0)},zs=e=>{if(typeof e!="string")return e;try{const t=JSON.parse(e);if(t.timestamp)return t}catch{}try{const t=JSON.parse(_n(Fs(Fn(e,!0))));if(t.v===Jt)return t;throw new Error(`These events were packed with packer ${t.v} which is incompatible with current packer ${Jt}.`)}catch(t){throw console.error(t),new Error("Unknown data format.")}};class $e{constructor(t){this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){const t=this.lineNumber||"",r=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${t}:${r})`:`${this.fileName}:${t}:${r}`}}const Hs=/(^|@)\S+:\d+/,Un=/^\s*at .*(\S+:\d+|\(native\))/m,Ys=/^(eval@)?(\[native code])?$/,jn={parse:function(e){if(!e)return[];if(typeof e.stacktrace<"u"||typeof e["opera#sourceloc"]<"u")return this.parseOpera(e);if(e.stack&&e.stack.match(Un))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(e.indexOf(":")===-1)return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split(`
|
|
18
|
+
***************************************************************************** */function cn(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),l=[];try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)l.push(n.value)}catch(c){o={error:c}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return l}var Pe;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Pe||(Pe={}));var un={type:"xstate.init"};function _t(e){return e===void 0?[]:[].concat(e)}function Me(e){return{type:"xstate.assign",assignment:e}}function dn(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 ut(e){return function(t){return e===t}}function hn(e){return typeof e=="string"?{type:e}:e}function mn(e,t){return{value:e,context:t,actions:[],changed:!1,matches:ut(e)}}function pn(e,t,r){var n=t,o=!1;return[e.filter(function(i){if(i.type==="xstate.assign"){o=!0;var l=Object.assign({},n);return typeof i.assignment=="function"?l=i.assignment(n,r):Object.keys(i.assignment).forEach(function(c){l[c]=typeof i.assignment[c]=="function"?i.assignment[c](n,r):i.assignment[c]}),n=l,!1}return!0}),n,o]}function fn(e,t){t===void 0&&(t={});var r=cn(pn(_t(e.states[e.initial].entry).map(function(l){return dn(l,t.actions)}),e.context,un),2),n=r[0],o=r[1],i={config:e,_options:t,initialState:{value:e.initial,actions:n,context:o,matches:ut(e.initial)},transition:function(l,c){var a,s,u=typeof l=="string"?{value:l,context:e.context}:l,d=u.value,h=u.context,m=hn(c),p=e.states[d];if(p.on){var f=_t(p.on[m.type]);try{for(var y=function(x){var F=typeof Symbol=="function"&&Symbol.iterator,S=F&&x[F],g=0;if(S)return S.call(x);if(x&&typeof x.length=="number")return{next:function(){return x&&g>=x.length&&(x=void 0),{value:x&&x[g++],done:!x}}};throw new TypeError(F?"Object is not iterable.":"Symbol.iterator is not defined.")}(f),v=y.next();!v.done;v=y.next()){var b=v.value;if(b===void 0)return mn(d,h);var T=typeof b=="string"?{target:b}:b,C=T.target,I=T.actions,w=I===void 0?[]:I,R=T.cond,E=R===void 0?function(){return!0}:R,L=C===void 0,$=C??d,P=e.states[$];if(E(h,m)){var j=cn(pn((L?_t(w):[].concat(p.exit,w,P.entry).filter(function(x){return x})).map(function(x){return dn(x,i._options.actions)}),h,m),3),U=j[0],Y=j[1],V=j[2],D=C??d;return{value:D,context:Y,actions:U,changed:C!==d||U.length>0||V,matches:ut(D)}}}}catch(x){a={error:x}}finally{try{v&&!v.done&&(s=y.return)&&s.call(y)}finally{if(a)throw a.error}}}return mn(d,h)}};return i}var vn=function(e,t){return e.actions.forEach(function(r){var n=r.exec;return n&&n(e.context,t)})};function gn(e){var t=e.initialState,r=Pe.NotStarted,n=new Set,o={_machine:e,send:function(i){r===Pe.Running&&(t=e.transition(t,i),vn(t,hn(i)),n.forEach(function(l){return l(t)}))},subscribe:function(i){return n.add(i),i(t),{unsubscribe:function(){return n.delete(i)}}},start:function(i){if(i){var l=typeof i=="object"?i:{context:e.config.context,value:i};t={value:l.value,actions:[],context:l.context,matches:ut(l.value)}}return r=Pe.Running,vn(t,un),o},stop:function(){return r=Pe.Stopped,n.clear(),o},get state(){return t},get status(){return r}};return o}var Xi=Object.defineProperty,Zi=Object.defineProperties,Ki=Object.getOwnPropertyDescriptors,yn=Object.getOwnPropertySymbols,qi=Object.prototype.hasOwnProperty,Ji=Object.prototype.propertyIsEnumerable,bn=(e,t,r)=>t in e?Xi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dt=(e,t)=>{for(var r in t||(t={}))qi.call(t,r)&&bn(e,r,t[r]);if(yn)for(var r of yn(t))Ji.call(t,r)&&bn(e,r,t[r]);return e},ht=(e,t)=>Zi(e,Ki(t));function Qi(e,t){for(let r=e.length-1;r>=0;r--){const n=e[r];if(n.type===O.Meta&&n.timestamp<=t)return e.slice(r)}return e}function es(e,{getCastFn:t,applyEventsSynchronously:r,emitter:n}){const o=fn({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]},REPLACE_EVENTS:{target:"playing",actions:["replaceEvents"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]},REPLACE_EVENTS:{target:"paused",actions:["replaceEvents"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:Me({lastPlayedEvent:(i,l)=>l.type==="CAST_EVENT"?l.payload.event:i.lastPlayedEvent}),recordTimeOffset:Me((i,l)=>{let c=i.timeOffset;return"payload"in l&&"timeOffset"in l.payload&&(c=l.payload.timeOffset),ht(dt({},i),{timeOffset:c,baselineTime:i.events[0].timestamp+c})}),play(i){var l;const{timer:c,events:a,baselineTime:s,lastPlayedEvent:u}=i;c.clear();for(const f of a)Pt(f,s);const d=Qi(a,s);let h=u?.timestamp;u?.type===O.IncrementalSnapshot&&u.data.source===A.MouseMove&&(h=u.timestamp+((l=u.data.positions[0])==null?void 0:l.timeOffset)),s<(h||0)&&n.emit(H.PlayBack);const m=new Array,p=new Array;for(const f of d)if(!(h&&h<s&&(f.timestamp<=h||f===u)))if(f.timestamp<s)m.push(f);else{const y=t(f,!1);p.push({doAction:()=>{y()},delay:f.delay})}r(m),n.emit(H.Flush),c.addActions(p),c.start()},pause(i){i.timer.clear()},resetLastPlayedEvent:Me(i=>ht(dt({},i),{lastPlayedEvent:null})),startLive:Me({baselineTime:(i,l)=>(i.timer.toggleLiveMode(!0),i.timer.start(),l.type==="TO_LIVE"&&l.payload.baselineTime?l.payload.baselineTime:Date.now())}),replaceEvents:Me((i,l)=>{const{events:c,timer:a,baselineTime:s}=i;if(l.type==="REPLACE_EVENTS"){const{events:u}=l.payload;c.length=0;const d=[];for(const h of u)if(Pt(h,s),c.push(h),h.timestamp>=a.timeOffset+s){const m=t(h,!1);d.push({doAction:()=>{m()},delay:h.delay})}a.isActive()&&a.replaceActions(d)}return ht(dt({},i),{events:c})}),addEvent:Me((i,l)=>{const{baselineTime:c,timer:a,events:s}=i;if(l.type==="ADD_EVENT"){const{event:u}=l.payload;Pt(u,c);let d=s.length-1;if(!s[d]||s[d].timestamp<=u.timestamp)s.push(u);else{let p=-1,f=0;for(;f<=d;){const y=Math.floor((f+d)/2);s[y].timestamp<=u.timestamp?f=y+1:d=y-1}p===-1&&(p=f),s.splice(p,0,u)}const h=u.timestamp<c,m=t(u,h);h?m():a.isActive()&&a.addAction({doAction:()=>{m()},delay:u.delay})}return ht(dt({},i),{events:s})})}});return gn(o)}function ts(e){const t=fn({id:"speed",context:e,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(r,n)=>{"payload"in n&&r.timer.setSpeed(n.payload.speed)},recordSpeed:Me({normalSpeed:r=>r.timer.speed}),restoreSpeed:r=>{r.timer.setSpeed(r.normalSpeed)}}});return gn(t)}const rs=e=>["noscript { display: none !important; }",`.${e} { background: currentColor; border-radius: 5px; }`,`.${e}:hover::after {content: 'Redacted'; color: white; background: black; text-align: center; width: 100%; display: block;}`];var ns=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});const Sn=new Map;function wn(e,t){let r=Sn.get(e);return r||(r=new Map,Sn.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function we(e,t,r){return n=>ns(this,null,function*(){if(n&&typeof n=="object"&&"rr_type"in n)if(r&&(r.isUnchanged=!1),n.rr_type==="ImageBitmap"&&"args"in n){const o=yield we(e,t,r)(n.args);return yield createImageBitmap.apply(null,o)}else if("index"in n){if(r||t===null)return n;const{rr_type:o,index:i}=n;return wn(t,o)[i]}else if("args"in n){const{rr_type:o,args:i}=n,l=window[o];return new l(...yield Promise.all(i.map(we(e,t,r))))}else{if("base64"in n)return ei(n.base64);if("src"in n){const o=e.get(n.src);if(o)return o;{const i=new Image;return i.src=n.src,e.set(n.src,i),i}}else if("data"in n&&n.rr_type==="Blob"){const o=yield Promise.all(n.data.map(we(e,t,r)));return new Blob(o,{type:n.type})}}else if(Array.isArray(n))return yield Promise.all(n.map(we(e,t,r)));return n})}var os=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});function is(e,t){try{return t===fe.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}const ss=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function as(e,t){if(!(t!=null&&t.constructor))return;const{name:r}=t.constructor;if(!ss.includes(r))return;const n=wn(e,r);n.includes(t)||n.push(t)}function ls(e){return os(this,arguments,function*({mutation:t,target:r,type:n,imageMap:o,errorHandler:i}){try{const l=is(r,n);if(!l)return;if(t.setter){l[t.property]=t.args[0];return}const c=l[t.property],a=yield Promise.all(t.args.map(we(o,l))),s=c.apply(l,a);as(l,s)}catch(l){i(t,l)}})}var cs=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});function us(e){return cs(this,arguments,function*({event:t,mutation:r,target:n,imageMap:o,errorHandler:i}){try{const l=n.getContext("2d");if(r.setter){l[r.property]=r.args[0];return}const c=l[r.property];if(r.property==="drawImage"&&typeof r.args[0]=="string")o.get(t),c.apply(l,r.args);else{const a=yield Promise.all(r.args.map(we(o,l)));c.apply(l,a)}}catch(l){i(r,l)}})}var ds=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});function Tn(e){return ds(this,arguments,function*({event:t,mutation:r,target:n,imageMap:o,canvasEventMap:i,errorHandler:l}){try{const c=i.get(t)||r,a="commands"in c?c.commands:[c];if([fe.WebGL,fe.WebGL2].includes(r.type)){for(let s=0;s<a.length;s++){const u=a[s];yield ls({mutation:u,type:r.type,target:n,imageMap:o,errorHandler:l})}return}for(let s=0;s<a.length;s++){const u=a[s];yield us({event:t,mutation:u,target:n,imageMap:o,errorHandler:l})}}catch(c){l(r,c)}})}var hs=Object.defineProperty,ms=Object.defineProperties,ps=Object.getOwnPropertyDescriptors,Nn=Object.getOwnPropertySymbols,fs=Object.prototype.hasOwnProperty,vs=Object.prototype.propertyIsEnumerable,En=(e,t,r)=>t in e?hs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_e=(e,t)=>{for(var r in t||(t={}))fs.call(t,r)&&En(e,r,t[r]);if(Nn)for(var r of Nn(t))vs.call(t,r)&&En(e,r,t[r]);return e},$t=(e,t)=>ms(e,ps(t)),Wt=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});const Cn=10*1e3,In=2*1e3,kn=1*1e3,Mn=60*60*1e3,gs=ln||zi,Ut="[replayer]",jt={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Vt(e){return e.type==O.IncrementalSnapshot&&(e.data.source==A.TouchMove||e.data.source==A.MouseInteraction&&e.data.type==ee.TouchStart)}class ys{constructor(t,r){if(this.usingVirtualDom=!1,this.virtualDom=new Fe,this.mouseTail=null,this.tailPositions=[],this.emitter=gs(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=vr(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=or(),this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,this.handleResize=c=>{this.iframe.style.display="inherit";for(const a of[this.mouseTail,this.iframe])!a||(a.setAttribute("width",String(c.width)),a.setAttribute("height",String(c.height)))},this.applyEventsSynchronously=c=>{for(const a of c){switch(a.type){case O.DomContentLoaded:case O.Load:case O.Custom:continue;case O.FullSnapshot:case O.Meta:case O.Plugin:case O.IncrementalSnapshot:break}this.getCastFn(a,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null},this.getCastFn=(c,a=!1)=>{let s;switch(c.type){case O.DomContentLoaded:case O.Load:break;case O.Custom:s=()=>{this.emitter.emit(H.CustomEvent,c)};break;case O.Meta:s=()=>this.emitter.emit(H.Resize,{width:c.data.width,height:c.data.height});break;case O.FullSnapshot:s=()=>{if(this.firstFullSnapshot){if(this.firstFullSnapshot===c){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(c,a),this.iframe.contentWindow.scrollTo(c.data.initialOffset)};break;case O.IncrementalSnapshot:s=()=>{if(this.applyIncremental(c,a),!a&&(this.handleInactivity(c.timestamp),c===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const u of this.service.state.context.events)if(!(u.timestamp<=c.timestamp)&&this.isUserInteraction(u)){u.delay-c.delay>Cn*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=u);break}if(this.nextUserInteractionEvent){const u=this.nextUserInteractionEvent.delay-c.delay,d={speed:Math.min(Math.round(u/In),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:d}),this.emitter.emit(H.SkipStart,d)}}};break}return()=>{s&&s();for(const d of this.config.plugins||[])d.handler(c,a,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:c}});const u=this.service.state.context.events.length-1;if(c===this.service.state.context.events[u]){const d=()=>{u<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(H.Finish))};c.type===O.IncrementalSnapshot&&c.data.source===A.MouseMove&&c.data.positions.length?setTimeout(()=>{d()},Math.max(0,-c.data.positions[0].timeOffset+50)):d()}this.emitter.emit(H.EventCast,c)}},!(r!=null&&r.liveMode)&&t.length<2)throw new Error("Replayer need at least 2 events.");const n={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"highlight-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:jt,useVirtualDom:!0,inactiveThreshold:.02,inactiveSkipTime:In};this.config=Object.assign({},n,r),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(H.Resize,this.handleResize),this.setupDom(),this.emitter.on(H.Flush,()=>{if(this.usingVirtualDom){const c={mirror:this.mirror,applyCanvas:(a,s,u)=>{Tn({event:a,mutation:s,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this)};if(he(this.iframe.contentDocument,this.virtualDom,c,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const a in this.legacy_missingNodeRetryMap)try{const s=this.legacy_missingNodeRetryMap[a],u=Ft(s.node,this.mirror,this.virtualDom.mirror);he(u,s.node,c,this.virtualDom.mirror),s.node=u}catch(s){this.config.showWarning&&console.warn(s)}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null}),this.emitter.on(H.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset()});const o=new Yi([],r?.speed||n.speed);this.service=es({events:t.map(c=>r&&r.unpackFn?r.unpackFn(c):c).sort((c,a)=>c.timestamp-a.timestamp),timer:o,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(c=>{this.emitter.emit(H.StateChange,{player:c})}),this.speedService=ts({normalSpeed:-1,timer:o}),this.speedService.start(),this.speedService.subscribe(c=>{this.emitter.emit(H.StateChange,{speed:c})});const i=this.service.state.context.events.find(c=>c.type===O.Meta),l=this.service.state.context.events.find(c=>c.type===O.FullSnapshot);if(i){const{width:c,height:a}=i.data;setTimeout(()=>{this.emitter.emit(H.Resize,{width:c,height:a})},0)}l&&setTimeout(()=>{this.firstFullSnapshot||(this.firstFullSnapshot=l,this.rebuildFullSnapshot(l),this.iframe.contentWindow.scrollTo(l.data.initialOffset))},1),this.service.state.context.events.find(Vt)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,r){return this.emitter.on(t,r),this}off(t,r){return this.emitter.off(t,r),this}setConfig(t){Object.keys(t).forEach(r=>{t[r],this.config[r]=t[r]}),this.config.skipInactive||this.backToNormal(),typeof t.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail<"u"&&(t.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getActivityIntervals(){if(this.activityIntervals.length==0){const t=[],r=this.getMetaData(),n=[{timestamp:r.startTime},...this.service.state.context.events.filter(l=>this.isUserInteraction(l)),{timestamp:r.endTime}];for(let l=1;l<n.length;l++){const c=n[l-1],a=n[l];a.timestamp-c.timestamp>Cn?t.push({startTime:c.timestamp,endTime:a.timestamp,duration:a.timestamp-c.timestamp,active:!1}):t.push({startTime:c.timestamp,endTime:a.timestamp,duration:a.timestamp-c.timestamp,active:!0})}const o=[];let i=t[0];for(let l=1;l<t.length;l++)t[l].active!=t[l-1].active&&(o.push({startTime:i.startTime,endTime:t[l-1].endTime,duration:t[l-1].endTime-i.startTime,active:t[l-1].active}),i=t[l]);i&&t.length>0&&o.push({startTime:i.startTime,endTime:t[t.length-1].endTime,duration:t[t.length-1].endTime-i.startTime,active:t[t.length-1].active}),i=o[0];for(let l=1;l<o.length;l++)(!o[l].active&&o[l].duration>this.config.inactiveThreshold*r.totalTime||!o[l-1].active&&o[l-1].duration>this.config.inactiveThreshold*r.totalTime)&&(this.activityIntervals.push({startTime:i.startTime,endTime:o[l-1].endTime,duration:o[l-1].endTime-i.startTime,active:o[l-1].active}),i=o[l]);i&&o.length>0&&this.activityIntervals.push({startTime:i.startTime,endTime:o[o.length-1].endTime,duration:o[o.length-1].endTime-i.startTime,active:o[o.length-1].active})}return this.activityIntervals}getMetaData(){const t=this.service.state.context.events[0],r=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:r.timestamp,totalTime:r.timestamp-t.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:t,events:r}=this.service.state.context;return t-r[0].timestamp}getMirror(){return this.mirror}play(t=0){var r,n;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(n=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||n.classList.remove("rrweb-paused"),this.emitter.emit(H.Start),this.handleInactivity(this.getMetaData().startTime+t,!0)}pause(t){var r,n;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(n=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||n.classList.add("rrweb-paused"),this.emitter.emit(H.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(H.Resume)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const r=this.config.unpackFn?this.config.unpackFn(t):t;Vt(r)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:r}}))}replaceEvents(t){for(const r of t)if(Vt(r)){this.mouse.classList.add("touch-device");break}this.service.send({type:"REPLACE_EVENTS",payload:{events:t}})}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=vr()}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&&(Hi(this.iframe.contentWindow,this.iframe.contentDocument),kt(this.iframe.contentWindow))}handleInactivity(t,r){if((t===this.inactiveEndTimestamp||r)&&(this.inactiveEndTimestamp=null,this.backToNormal()),this.config.skipInactive&&!this.inactiveEndTimestamp){for(const n of this.getActivityIntervals())if(t>=n.startTime&&t<n.endTime&&!n.active){this.inactiveEndTimestamp=n.endTime;break}if(this.inactiveEndTimestamp){const n=this.inactiveEndTimestamp-t,o={speed:n/Mn*this.config.inactiveSkipTime<kn?n/kn:Math.round(Math.max(n,Mn)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:o}),this.emitter.emit(H.SkipStart,o)}}}rebuildFullSnapshot(t,r=!1){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const n=[];Co(t.data.node,{doc:this.iframe.contentDocument,afterAppend:l=>{this.collectIframeAndAttachDocument(n,l)},cache:this.cache,mirror:this.mirror});for(const{mutationInQueue:l,builtNode:c}of n)this.attachDocumentToIframe(l,c),this.newDocumentQueue=this.newDocumentQueue.filter(a=>a!==l);const{documentElement:o,head:i}=this.iframe.contentDocument;this.insertStyleRules(o,i),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(H.FullsnapshotRebuilded,t),r||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,r){const n=rs(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&n.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,an(o,this.virtualDom.unserializedId)),t.insertBefore(o,r);for(let i=0;i<n.length;i++)o.rules.push({cssText:n[i],type:ce.Insert,index:i})}else{const o=document.createElement("style");t.insertBefore(o,r);for(let i=0;i<n.length;i++)o.sheet.insertRule(n[i],i)}}attachDocumentToIframe(t,r){const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,o=[];it(t.node,{doc:r.contentDocument,mirror:n,hackCss:!0,skipChild:!1,afterAppend:i=>{this.collectIframeAndAttachDocument(o,i);const l=n.getMeta(i);if(l?.type===_.Element&&l?.tagName.toUpperCase()==="HTML"){const{documentElement:c,head:a}=r.contentDocument;this.insertStyleRules(c,a)}},cache:this.cache});for(const{mutationInQueue:i,builtNode:l}of o)this.attachDocumentToIframe(i,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==i)}collectIframeAndAttachDocument(t,r){if(De(r,this.mirror)){const n=this.newDocumentQueue.find(o=>o.parentId===this.mirror.getId(r));n&&t.push({mutationInQueue:n,builtNode:r})}}waitForStylesheetLoad(){var t;const r=(t=this.iframe.contentDocument)==null?void 0:t.head;if(r){const n=new Set;let o,i=this.service.state;const l=()=>{i=this.service.state};this.emitter.on(H.Start,l),this.emitter.on(H.Pause,l);const c=()=>{this.emitter.off(H.Start,l),this.emitter.off(H.Pause,l)};r.querySelectorAll('link[rel="stylesheet"]').forEach(a=>{a.sheet||(n.add(a),a.addEventListener("load",()=>{n.delete(a),n.size===0&&o!==-1&&(i.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(H.LoadStylesheetEnd),o&&clearTimeout(o),c())}))}),n.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(H.LoadStylesheetStart),o=setTimeout(()=>{i.matches("playing")&&this.play(this.getCurrentTime()),o=-1,c()},this.config.loadTimeout))}}preloadAllImages(){return Wt(this,null,function*(){this.service.state;const t=()=>{this.service.state};this.emitter.on(H.Start,t),this.emitter.on(H.Pause,t);const r=[];for(const n of this.service.state.context.events)n.type===O.IncrementalSnapshot&&n.data.source===A.CanvasMutation&&(r.push(this.deserializeAndPreloadCanvasEvents(n.data,n)),("commands"in n.data?n.data.commands:[n.data]).forEach(o=>{this.preloadImages(o,n)}));return Promise.all(r)})}preloadImages(t,r){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(r)){const n=document.createElement("canvas"),o=n.getContext("2d"),i=o?.createImageData(n.width,n.height);i?.data,JSON.parse(t.args[0]),o?.putImageData(i,0,0)}}deserializeAndPreloadCanvasEvents(t,r){return Wt(this,null,function*(){if(!this.canvasEventMap.has(r)){const n={isUnchanged:!0};if("commands"in t){const o=yield Promise.all(t.commands.map(i=>Wt(this,null,function*(){const l=yield Promise.all(i.args.map(we(this.imageMap,null,n)));return $t(_e({},i),{args:l})})));n.isUnchanged===!1&&this.canvasEventMap.set(r,$t(_e({},t),{commands:o}))}else{const o=yield Promise.all(t.args.map(we(this.imageMap,null,n)));n.isUnchanged===!1&&this.canvasEventMap.set(r,$t(_e({},t),{args:o}))}}})}applyIncremental(t,r){var n,o,i,l,c,a;const{data:s}=t;switch(s.source){case A.Mutation:{try{this.applyMutation(s,r)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,s)}break}case A.Drag:case A.TouchMove:case A.MouseMove:if(r){const u=s.positions[s.positions.length-1];this.mousePos={x:u.x,y:u.y,id:u.id,debugData:s}}else s.positions.forEach(u=>{const d={doAction:()=>{this.moveAndHover(u.x,u.y,u.id,r,s)},delay:u.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(d)}),this.timer.addAction({doAction(){},delay:t.delay-((n=s.positions[0])==null?void 0:n.timeOffset)});break;case A.MouseInteraction:{if(s.id===-1||r)break;const u=new Event(ee[s.type].toLowerCase()),d=this.mirror.getNode(s.id);if(!d)return this.debugNodeNotFound(s,s.id);this.emitter.emit(H.MouseInteraction,{type:s.type,target:d});const{triggerFocus:h}=this.config;switch(s.type){case ee.Blur:"blur"in d&&d.blur();break;case ee.Focus:h&&d.focus&&d.focus({preventScroll:!0});break;case ee.Click:case ee.TouchStart:case ee.TouchEnd:r?(s.type===ee.TouchStart?this.touchActive=!0:s.type===ee.TouchEnd&&(this.touchActive=!1),this.mousePos={x:s.x,y:s.y,id:s.id,debugData:s}):(s.type===ee.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(s.x,s.y,s.id,r,s),s.type===ee.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):s.type===ee.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):s.type===ee.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case ee.TouchCancel:r?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:d.dispatchEvent(u)}break}case A.Scroll:{if(s.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.scrollData=s;break}this.applyScroll(s,r);break}case A.ViewportResize:this.emitter.emit(H.Resize,{width:s.width,height:s.height});break;case A.Input:{if(s.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.inputData=s;break}this.applyInput(s);break}case A.MediaInteraction:{const u=this.usingVirtualDom?this.virtualDom.mirror.getNode(s.id):this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u;try{s.currentTime&&(d.currentTime=s.currentTime),s.volume&&(d.volume=s.volume),s.muted&&(d.muted=s.muted),s.type===Ce.Pause&&d.pause(),s.type===Ce.Play&&d.play()}catch(h){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${h.message||h}`)}break}case A.StyleSheetRule:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.rules;(o=s.adds)==null||o.forEach(({rule:h,index:m})=>d?.push({cssText:h,index:m,type:ce.Insert})),(i=s.removes)==null||i.forEach(({index:h})=>d?.push({index:h,type:ce.Remove}))}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.sheet;(l=s.adds)==null||l.forEach(({rule:h,index:m})=>{try{if(Array.isArray(m)){const{positions:p,index:f}=Rt(m);Le(d.cssRules,p).insertRule(h,f)}else{const p=m===void 0?void 0:Math.min(m,d.cssRules.length);d.insertRule(h,p)}}catch{}}),(c=s.removes)==null||c.forEach(({index:h})=>{try{if(Array.isArray(h)){const{positions:m,index:p}=Rt(h);Le(d.cssRules,m).deleteRule(p||0)}else d?.deleteRule(h)}catch{}})}break}case A.StyleDeclaration:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.rules;s.set&&d.push(_e({type:ce.SetProperty,index:s.index},s.set)),s.remove&&d.push(_e({type:ce.RemoveProperty,index:s.index},s.remove))}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.sheet;s.set&&Le(d.rules,s.index).style.setProperty(s.set.property,s.set.value,s.set.priority),s.remove&&Le(d.rules,s.index).style.removeProperty(s.remove.property)}break}case A.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.canvasMutations.push({event:t,mutation:s})}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);Tn({event:t,mutation:s,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case A.Font:{try{const u=new FontFace(s.family,s.buffer?new Uint8Array(JSON.parse(s.fontSource)):s.fontSource,s.descriptors);(a=this.iframe.contentDocument)==null||a.fonts.add(u)}catch(u){this.config.showWarning&&console.warn(u)}break}}}applyMutation(t,r){if(this.config.useVirtualDom&&!this.usingVirtualDom&&r&&(this.usingVirtualDom=!0,Vi(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const s in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[s],d=sn(u.node,this.virtualDom,this.mirror);d&&(u.node=d)}catch(u){this.config.showWarning&&console.warn(u)}const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes.forEach(s=>{var u;const d=n.getNode(s.id);if(!d)return t.removes.find(m=>m.id===s.parentId)?void 0:this.warnNodeNotFound(t,s.id);let h=n.getNode(s.parentId);if(!h)return this.warnNodeNotFound(t,s.parentId);if(s.isShadow&&ze(h)&&(h=h.shadowRoot),n.removeNodeFromMap(d),h)try{h.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&h.nodeName==="STYLE"&&((u=h.rules)==null?void 0:u.length)>0&&(h.rules=[])}catch(m){if(m instanceof DOMException)this.warn("parent could not remove child in mutation",h,d,t);else throw m}});const o=_e({},this.legacy_missingNodeRetryMap),i=[],l=s=>{let u=null;return s.nextId&&(u=n.getNode(s.nextId)),s.nextId!==null&&s.nextId!==void 0&&s.nextId!==-1&&!u},c=s=>{var u;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let d=n.getNode(s.parentId);if(!d)return s.node.type===_.Document?this.newDocumentQueue.push(s):i.push(s);s.node.isShadow&&(ze(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let h=null,m=null;if(s.previousId&&(h=n.getNode(s.previousId)),s.nextId&&(m=n.getNode(s.nextId)),l(s))return i.push(s);if(s.node.rootId&&!n.getNode(s.node.rootId))return;const p=s.node.rootId?n.getNode(s.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(De(d,n)){this.attachDocumentToIframe(s,d);return}const f=it(s.node,{doc:p,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache});if(s.previousId===-1||s.nextId===-1){o[s.node.id]={node:f,mutation:s};return}const y=n.getMeta(d);if(y&&y.type===_.Element&&y.tagName==="textarea"&&s.node.type===_.Text){const v=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const b of v)b.nodeType===d.TEXT_NODE&&d.removeChild(b)}if(h&&h.nextSibling&&h.nextSibling.parentNode)d.insertBefore(f,h.nextSibling);else if(m&&m.parentNode)d.contains(m)?d.insertBefore(f,m):d.insertBefore(f,null);else{if(d===p)for(;p.firstChild;)p.removeChild(p.firstChild);d.appendChild(f)}if(this.usingVirtualDom&&f.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[]),De(f,this.mirror)){const v=this.mirror.getId(f),b=this.newDocumentQueue.find(T=>T.parentId===v);b&&(this.attachDocumentToIframe(b,f),this.newDocumentQueue=this.newDocumentQueue.filter(T=>T!==b))}(s.previousId||s.nextId)&&this.legacy_resolveMissingNode(o,d,f,s)};t.adds.forEach(s=>{c(s)});const a=Date.now();for(;i.length;){const s=br(i);if(i.length=0,Date.now()-a>500){this.warn("Timeout in the loop, please check the resolve tree data:",s);break}for(const u of s)n.getNode(u.value.parentId)?Mt(u,d=>{c(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(o).length&&Object.assign(this.legacy_missingNodeRetryMap,o),Sr(t.texts).forEach(s=>{var u;const d=n.getNode(s.id);if(!d)return t.removes.find(h=>h.id===s.id)?void 0:this.warnNodeNotFound(t,s.id);if(d.textContent=s.value,this.usingVirtualDom){const h=d.parentNode;((u=h?.rules)==null?void 0:u.length)>0&&(h.rules=[])}}),t.attributes.forEach(s=>{const u=n.getNode(s.id);if(!u)return t.removes.find(d=>d.id===s.id)?void 0:this.warnNodeNotFound(t,s.id);for(const d in s.attributes)if(typeof d=="string"){const h=s.attributes[d];if(h===null)u.removeAttribute(d);else if(typeof h=="string")try{u.setAttribute(d,h)}catch(m){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",m)}else if(d==="style"){const m=h,p=u;for(const f in m)if(m[f]===!1)p.style.removeProperty(f);else if(m[f]instanceof Array){const y=m[f];p.style.setProperty(f,y[0],y[1])}else{const y=m[f];p.style.setProperty(f,y)}}}})}applyScroll(t,r){const n=this.mirror.getNode(t.id);if(!n)return this.debugNodeNotFound(t,t.id);const o=this.mirror.getMeta(n);if(n===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else if(o?.type===_.Document)n.defaultView.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else try{n.scrollTop=t.y,n.scrollLeft=t.x}catch{}}applyInput(t){const r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);try{r.checked=t.isChecked,r.value=t.text}catch{}}legacy_resolveMissingNode(t,r,n,o){const{previousId:i,nextId:l}=o,c=i&&t[i],a=l&&t[l];if(c){const{node:s,mutation:u}=c;r.insertBefore(s,n),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,s,u)}if(a){const{node:s,mutation:u}=a;r.insertBefore(s,n.nextSibling),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,s,u)}}moveAndHover(t,r,n,o,i){const l=this.mirror.getNode(n);if(!l)return this.debugNodeNotFound(i,n);const c=Ot(l,this.iframe),a=t*c.absoluteScale+c.x,s=r*c.absoluteScale+c.y;this.mouse.style.left=`${a}px`,this.mouse.style.top=`${s}px`,o||this.drawMouseTail({x:a,y:s}),this.hoverElements(l)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:r,lineWidth:n,strokeStyle:o,duration:i}=this.config.mouseTail===!0?jt:Object.assign({},jt,this.config.mouseTail),l=()=>{if(!this.mouseTail)return;const c=this.mouseTail.getContext("2d");!c||!this.tailPositions.length||(c.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),c.beginPath(),c.lineWidth=n,c.lineCap=r,c.strokeStyle=o,c.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(a=>c.lineTo(a.x,a.y)),c.stroke())};this.tailPositions.push(t),l(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(c=>c!==t),l()},i/this.speedService.state.context.timer.speed)}hoverElements(t){var r;(r=this.iframe.contentDocument)==null||r.querySelectorAll(".\\:hover").forEach(o=>{o.classList.remove(":hover")});let n=t;for(;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement}isUserInteraction(t){return t.type!==O.IncrementalSnapshot?!1:t.data.source>A.Mutation&&t.data.source<=A.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(H.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,r){this.warn(`Node with id '${r}' not found. `,t)}warnCanvasMutationFailed(t,r){this.warn("Has error on canvas update",r,"canvas mutation:",t)}debugNodeNotFound(t,r){this.debug(Ut,`Node with id '${r}' not found. `,t)}warn(...t){!this.config.showWarning||console.warn(Ut,...t)}debug(...t){!this.config.showDebug||console.log(Ut,...t)}}const{addCustomEvent:bs}=ke,{freezePage:Ss}=ke;var re=Uint8Array,ne=Uint16Array,qe=Uint32Array,mt=new re([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),pt=new re([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Gt=new re([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),xn=function(e,t){for(var r=new ne(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var o=new qe(r[30]),n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return[r,o]},On=xn(mt,2),Rn=On[0],Bt=On[1];Rn[28]=258,Bt[258]=28;for(var Dn=xn(pt,0),ws=Dn[0],Ln=Dn[1],zt=new ne(32768),K=0;K<32768;++K){var Te=(K&43690)>>>1|(K&21845)<<1;Te=(Te&52428)>>>2|(Te&13107)<<2,Te=(Te&61680)>>>4|(Te&3855)<<4,zt[K]=((Te&65280)>>>8|(Te&255)<<8)>>>1}for(var me=function(e,t,r){for(var n=e.length,o=0,i=new ne(t);o<n;++o)++i[e[o]-1];var l=new ne(t);for(o=0;o<t;++o)l[o]=l[o-1]+i[o-1]<<1;var c;if(r){c=new ne(1<<t);var a=15-t;for(o=0;o<n;++o)if(e[o])for(var s=o<<4|e[o],u=t-e[o],d=l[e[o]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)c[zt[d]>>>a]=s}else for(c=new ne(n),o=0;o<n;++o)c[o]=zt[l[e[o]-1]++]>>>15-e[o];return c},Ne=new re(288),K=0;K<144;++K)Ne[K]=8;for(var K=144;K<256;++K)Ne[K]=9;for(var K=256;K<280;++K)Ne[K]=7;for(var K=280;K<288;++K)Ne[K]=8;for(var Je=new re(32),K=0;K<32;++K)Je[K]=5;var Ts=me(Ne,9,0),Ns=me(Ne,9,1),Es=me(Je,5,0),Cs=me(Je,5,1),Ht=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},ue=function(e,t,r){var n=t/8>>0;return(e[n]|e[n+1]<<8)>>>(t&7)&r},Yt=function(e,t){var r=t/8>>0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>>(t&7)},Xt=function(e){return(e/8>>0)+(e&7&&1)},Zt=function(e,t,r){(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length);var n=new(e instanceof ne?ne:e instanceof qe?qe:re)(r-t);return n.set(e.subarray(t,r)),n},Is=function(e,t,r){var n=e.length,o=!t||r,i=!r||r.i;r||(r={}),t||(t=new re(n*3));var l=function(oe){var B=t.length;if(oe>B){var X=new re(Math.max(B*2,oe));X.set(t),t=X}},c=r.f||0,a=r.p||0,s=r.b||0,u=r.l,d=r.d,h=r.m,m=r.n,p=n*8;do{if(!u){r.f=c=ue(e,a,1);var f=ue(e,a+1,3);if(a+=3,f)if(f==1)u=Ns,d=Cs,h=9,m=5;else if(f==2){var T=ue(e,a,31)+257,C=ue(e,a+10,15)+4,I=T+ue(e,a+5,31)+1;a+=14;for(var w=new re(I),R=new re(19),E=0;E<C;++E)R[Gt[E]]=ue(e,a+E*3,7);a+=C*3;var L=Ht(R),$=(1<<L)-1;if(!i&&a+I*(L+7)>p)break;for(var P=me(R,L,1),E=0;E<I;){var j=P[ue(e,a,$)];a+=j&15;var y=j>>>4;if(y<16)w[E++]=y;else{var U=0,Y=0;for(y==16?(Y=3+ue(e,a,3),a+=2,U=w[E-1]):y==17?(Y=3+ue(e,a,7),a+=3):y==18&&(Y=11+ue(e,a,127),a+=7);Y--;)w[E++]=U}}var V=w.subarray(0,T),D=w.subarray(T);h=Ht(V),m=Ht(D),u=me(V,h,1),d=me(D,m,1)}else throw"invalid block type";else{var y=Xt(a)+4,v=e[y-4]|e[y-3]<<8,b=y+v;if(b>n){if(i)throw"unexpected EOF";break}o&&l(s+v),t.set(e.subarray(y,b),s),r.b=s+=v,r.p=a=b*8;continue}if(a>p)throw"unexpected EOF"}o&&l(s+131072);for(var x=(1<<h)-1,F=(1<<m)-1,S=h+m+18;i||a+S<p;){var U=u[Yt(e,a)&x],g=U>>>4;if(a+=U&15,a>p)throw"unexpected EOF";if(!U)throw"invalid length/literal";if(g<256)t[s++]=g;else if(g==256){u=null;break}else{var M=g-254;if(g>264){var E=g-257,N=mt[E];M=ue(e,a,(1<<N)-1)+Rn[E],a+=N}var k=d[Yt(e,a)&F],z=k>>>4;if(!k)throw"invalid distance";a+=k&15;var D=ws[z];if(z>3){var N=pt[z];D+=Yt(e,a)&(1<<N)-1,a+=N}if(a>p)throw"unexpected EOF";o&&l(s+131072);for(var G=s+M;s<G;s+=4)t[s]=t[s-D],t[s+1]=t[s+1-D],t[s+2]=t[s+2-D],t[s+3]=t[s+3-D];s=G}}r.l=u,r.p=a,r.b=s,u&&(c=1,r.m=h,r.d=d,r.n=m)}while(!c);return s==t.length?t:Zt(t,0,s)},ve=function(e,t,r){r<<=t&7;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8},Qe=function(e,t,r){r<<=t&7;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},Kt=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,i=r.slice();if(!o)return[new re(0),0];if(o==1){var l=new re(r[0].s+1);return l[r[0].s]=1,[l,1]}r.sort(function(I,w){return I.f-w.f}),r.push({s:-1,f:25001});var c=r[0],a=r[1],s=0,u=1,d=2;for(r[0]={s:-1,f:c.f+a.f,l:c,r:a};u!=o-1;)c=r[r[s].f<r[d].f?s++:d++],a=r[s!=u&&r[s].f<r[d].f?s++:d++],r[u++]={s:-1,f:c.f+a.f,l:c,r:a};for(var h=i[0].s,n=1;n<o;++n)i[n].s>h&&(h=i[n].s);var m=new ne(h+1),p=qt(r[u-1],m,0);if(p>t){var n=0,f=0,y=p-t,v=1<<y;for(i.sort(function(w,R){return m[R.s]-m[w.s]||w.f-R.f});n<o;++n){var b=i[n].s;if(m[b]>t)f+=v-(1<<p-m[b]),m[b]=t;else break}for(f>>>=y;f>0;){var T=i[n].s;m[T]<t?f-=1<<t-m[T]++-1:++n}for(;n>=0&&f;--n){var C=i[n].s;m[C]==t&&(--m[C],++f)}p=t}return[new re(m),p]},qt=function(e,t,r){return e.s==-1?Math.max(qt(e.l,t,r+1),qt(e.r,t,r+1)):t[e.s]=r},An=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new ne(++t),n=0,o=e[0],i=1,l=function(a){r[n++]=a},c=1;c<=t;++c)if(e[c]==o&&c!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)l(32754);i>2&&(l(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(l(o),--i;i>6;i-=6)l(8304);i>2&&(l(i-3<<5|8208),i=0)}for(;i--;)l(o);i=1,o=e[c]}return[r.subarray(0,n),t]},et=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},ft=function(e,t,r){var n=r.length,o=Xt(t+2);e[o]=n&255,e[o+1]=n>>>8,e[o+2]=e[o]^255,e[o+3]=e[o+1]^255;for(var i=0;i<n;++i)e[o+i+4]=r[i];return(o+4+n)*8},Fn=function(e,t,r,n,o,i,l,c,a,s,u){ve(t,u++,r),++o[256];for(var d=Kt(o,15),h=d[0],m=d[1],p=Kt(i,15),f=p[0],y=p[1],v=An(h),b=v[0],T=v[1],C=An(f),I=C[0],w=C[1],R=new ne(19),E=0;E<b.length;++E)R[b[E]&31]++;for(var E=0;E<I.length;++E)R[I[E]&31]++;for(var L=Kt(R,7),$=L[0],P=L[1],j=19;j>4&&!$[Gt[j-1]];--j);var U=s+5<<3,Y=et(o,Ne)+et(i,Je)+l,V=et(o,h)+et(i,f)+l+14+3*j+et(R,$)+(2*R[16]+3*R[17]+7*R[18]);if(U<=Y&&U<=V)return ft(t,u,e.subarray(a,a+s));var D,x,F,S;if(ve(t,u,1+(V<Y)),u+=2,V<Y){D=me(h,m,0),x=h,F=me(f,y,0),S=f;var g=me($,P,0);ve(t,u,T-257),ve(t,u+5,w-1),ve(t,u+10,j-4),u+=14;for(var E=0;E<j;++E)ve(t,u+3*E,$[Gt[E]]);u+=3*j;for(var M=[b,I],N=0;N<2;++N)for(var k=M[N],E=0;E<k.length;++E){var z=k[E]&31;ve(t,u,g[z]),u+=$[z],z>15&&(ve(t,u,k[E]>>>5&127),u+=k[E]>>>12)}}else D=Ts,x=Ne,F=Es,S=Je;for(var E=0;E<c;++E)if(n[E]>255){var z=n[E]>>>18&31;Qe(t,u,D[z+257]),u+=x[z+257],z>7&&(ve(t,u,n[E]>>>23&31),u+=mt[z]);var G=n[E]&31;Qe(t,u,F[G]),u+=S[G],G>3&&(Qe(t,u,n[E]>>>5&8191),u+=pt[G])}else Qe(t,u,D[n[E]]),u+=x[n[E]];return Qe(t,u,D[256]),u+x[256]},ks=new qe([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ms=new re(0),xs=function(e,t,r,n,o,i){var l=e.length,c=new re(n+l+5*(1+Math.floor(l/7e3))+o),a=c.subarray(n,c.length-o),s=0;if(!t||l<8)for(var u=0;u<=l;u+=65535){var d=u+65535;d<l?s=ft(a,s,e.subarray(u,d)):(a[u]=i,s=ft(a,s,e.subarray(u,l)))}else{for(var h=ks[t-1],m=h>>>13,p=h&8191,f=(1<<r)-1,y=new ne(32768),v=new ne(f+1),b=Math.ceil(r/3),T=2*b,C=function(Ue){return(e[Ue]^e[Ue+1]<<b^e[Ue+2]<<T)&f},I=new qe(25e3),w=new ne(288),R=new ne(32),E=0,L=0,u=0,$=0,P=0,j=0;u<l;++u){var U=C(u),Y=u&32767,V=v[U];if(y[Y]=V,v[U]=Y,P<=u){var D=l-u;if((E>7e3||$>24576)&&D>423){s=Fn(e,a,0,I,w,R,L,$,j,u-j,s),$=E=L=0,j=u;for(var x=0;x<286;++x)w[x]=0;for(var x=0;x<30;++x)R[x]=0}var F=2,S=0,g=p,M=Y-V&32767;if(D>2&&U==C(u-M))for(var N=Math.min(m,D)-1,k=Math.min(32767,u),z=Math.min(258,D);M<=k&&--g&&Y!=V;){if(e[u+F]==e[u+F-M]){for(var G=0;G<z&&e[u+G]==e[u+G-M];++G);if(G>F){if(F=G,S=M,G>N)break;for(var oe=Math.min(M,G-2),B=0,x=0;x<oe;++x){var X=u-M+x+32768&32767,ge=y[X],tt=X-ge+32768&32767;tt>B&&(B=tt,V=X)}}}Y=V,V=y[Y],M+=Y-V+32768&32767}if(S){I[$++]=268435456|Bt[F]<<18|Ln[S];var We=Bt[F]&31,ye=Ln[S]&31;L+=mt[We]+pt[ye],++w[257+We],++R[ye],P=u+F,++E}else I[$++]=e[u],++w[e[u]]}}s=Fn(e,a,i,I,w,R,L,$,j,u-j,s),i||(s=ft(a,s,Ms))}return Zt(c,0,n+Xt(s)+o)},Os=function(){var e=1,t=0;return{p:function(r){for(var n=e,o=t,i=r.length,l=0;l!=i;){for(var c=Math.min(l+5552,i);l<c;++l)n+=r[l],o+=n;n%=65521,o%=65521}e=n,t=o},d:function(){return(e>>>8<<16|(t&255)<<8|t>>>8)+((e&255)<<23)*2}}},Rs=function(e,t,r,n,o){return xs(e,t.level==null?6:t.level,t.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):12+t.mem,r,n,!o)},Ds=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},Ls=function(e,t){var r=t.level,n=r==0?0:r<6?1:r==9?3:2;e[0]=120,e[1]=n<<6|(n?32-2*n:1)},As=function(e){if((e[0]&15)!=8||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(e[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function Fs(e,t){t===void 0&&(t={});var r=Os();r.p(e);var n=Rs(e,t,2,4);return Ls(n,t),Ds(n,n.length-4,r.d()),n}function Ps(e,t){return Is((As(e),e.subarray(2,-4)),t)}function Pn(e,t){var r=e.length;if(!t&&typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var n=new re(e.length+(e.length>>>1)),o=0,i=function(s){n[o++]=s},l=0;l<r;++l){if(o+5>n.length){var c=new re(o+8+(r-l<<1));c.set(n),n=c}var a=e.charCodeAt(l);a<128||t?i(a):a<2048?(i(192|a>>>6),i(128|a&63)):a>55295&&a<57344?(a=65536+(a&1047552)|e.charCodeAt(++l)&1023,i(240|a>>>18),i(128|a>>>12&63),i(128|a>>>6&63),i(128|a&63)):(i(224|a>>>12),i(128|a>>>6&63),i(128|a&63))}return Zt(n,0,o)}function _n(e,t){var r="";if(!t&&typeof TextDecoder<"u")return new TextDecoder().decode(e);for(var n=0;n<e.length;){var o=e[n++];o<128||t?r+=String.fromCharCode(o):o<224?r+=String.fromCharCode((o&31)<<6|e[n++]&63):o<240?r+=String.fromCharCode((o&15)<<12|(e[n++]&63)<<6|e[n++]&63):(o=((o&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,r+=String.fromCharCode(55296|o>>10,56320|o&1023))}return r}const Jt="v1";var _s=Object.defineProperty,$s=Object.defineProperties,Ws=Object.getOwnPropertyDescriptors,$n=Object.getOwnPropertySymbols,Us=Object.prototype.hasOwnProperty,js=Object.prototype.propertyIsEnumerable,Wn=(e,t,r)=>t in e?_s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vs=(e,t)=>{for(var r in t||(t={}))Us.call(t,r)&&Wn(e,r,t[r]);if($n)for(var r of $n(t))js.call(t,r)&&Wn(e,r,t[r]);return e},Gs=(e,t)=>$s(e,Ws(t));const Bs=e=>{const t=Gs(Vs({},e),{v:Jt});return _n(Fs(Pn(JSON.stringify(t))),!0)},zs=e=>{if(typeof e!="string")return e;try{const t=JSON.parse(e);if(t.timestamp)return t}catch{}try{const t=JSON.parse(_n(Ps(Pn(e,!0))));if(t.v===Jt)return t;throw new Error(`These events were packed with packer ${t.v} which is incompatible with current packer ${Jt}.`)}catch(t){throw console.error(t),new Error("Unknown data format.")}};class $e{constructor(t){this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){const t=this.lineNumber||"",r=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${t}:${r})`:`${this.fileName}:${t}:${r}`}}const Hs=/(^|@)\S+:\d+/,Un=/^\s*at .*(\S+:\d+|\(native\))/m,Ys=/^(eval@)?(\[native code])?$/,jn={parse:function(e){if(!e)return[];if(typeof e.stacktrace<"u"||typeof e["opera#sourceloc"]<"u")return this.parseOpera(e);if(e.stack&&e.stack.match(Un))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(e.indexOf(":")===-1)return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split(`
|
|
19
19
|
`).filter(function(t){return!!t.match(Un)},this).map(function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let r=t.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=r.match(/ (\((.+):(\d+):(\d+)\)$)/);r=n?r.replace(n[0],""):r;const o=r.split(/\s+/).slice(1),i=this.extractLocation(n?n[1]:o.pop()),l=o.join(" ")||void 0,c=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new $e({functionName:l,fileName:c,lineNumber:i[1],columnNumber:i[2]})},this)},parseFFOrSafari:function(e){return e.stack.split(`
|
|
20
20
|
`).filter(function(t){return!t.match(Ys)},this).map(function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),t.indexOf("@")===-1&&t.indexOf(":")===-1)return new $e({functionName:t});{const r=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(r),o=n&&n[1]?n[1]:void 0,i=this.extractLocation(t.replace(r,""));return new $e({functionName:o,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf(`
|
|
21
21
|
`)>-1&&e.message.split(`
|
|
@@ -25,4 +25,4 @@ or you can use record.mirror to access the mirror instance during recording.`;q.
|
|
|
25
25
|
`),n=[];for(let o=0,i=r.length;o<i;o+=2){const l=t.exec(r[o]);l&&n.push(new $e({functionName:l[3]||void 0,fileName:l[2],lineNumber:parseFloat(l[1])}))}return n},parseOpera11:function(e){return e.stack.split(`
|
|
26
26
|
`).filter(function(t){return!!t.match(Hs)&&!t.match(/^Error created at/)},this).map(function(t){const r=t.split("@"),n=this.extractLocation(r.pop()),o=(r.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new $e({functionName:o,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function Xs(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let r=e.localName;if(!r)break;r=r.toLowerCase();const n=e.parentElement,o=[];if(n.children&&n.children.length>0)for(let i=0;i<n.children.length;i++){const l=n.children[i];l.localName&&l.localName.toLowerCase&&l.localName.toLowerCase()===r&&o.push(l)}o.length>1&&(r+=`:eq(${o.indexOf(e)})`),t=r+(t?">"+t:""),e=n}return t}function Qt(e){return Object.prototype.toString.call(e)==="[object Object]"}function Vn(e,t){if(t===0)return!0;const r=Object.keys(e);for(const n of r)if(Qt(e[n])&&Vn(e[n],t-1))return!0;return!1}function er(e,t){const r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);const n=[],o=[];return JSON.stringify(e,function(c,a){if(n.length>0){const s=n.indexOf(this);~s?n.splice(s+1):n.push(this),~s?o.splice(s,1/0,c):o.push(c),~n.indexOf(a)&&(n[0]===a?a="[Circular ~]":a="[Circular ~."+o.slice(0,n.indexOf(a)).join(".")+"]")}else n.push(a);if(a===null)return a;if(a===void 0)return"undefined";if(i(a))return l(a);if(a instanceof Event){const s={};for(const u in a){const d=a[u];Array.isArray(d)?s[u]=Xs(d.length?d[0]:null):s[u]=d}return s}else{if(a instanceof Node)return a instanceof HTMLElement?a?a.outerHTML:"":a.nodeName;if(a instanceof Error)return a.stack?a.stack+`
|
|
27
27
|
End of stack for Error object`:a.name+": "+a.message}return a});function i(c){return!!(Qt(c)&&Object.keys(c).length>r.numOfKeysLimit||typeof c=="function"||Qt(c)&&Vn(c,r.depthOfLimit))}function l(c){let a=c.toString();return r.stringLengthLimit&&a.length>r.stringLengthLimit&&(a=`${a.slice(0,r.stringLengthLimit)}...`),a}}const Gn={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Zs(e,t,r){const n=r?Object.assign({},Gn,r):Gn,o=n.logger;if(!o)return()=>{};let i;typeof o=="string"?i=t[o]:i=o;let l=0;const c=[];if(n.level.includes("error")&&window){const s=u=>{const d=u.message,h=u.error,m=jn.parse(h).map(f=>f.toString()),p=[er(d,n.stringifyOptions)];e({level:"error",trace:m,payload:p})};window.addEventListener("error",s),c.push(()=>{window&&window.removeEventListener("error",s)})}for(const s of n.level)c.push(a(i,s));return()=>{c.forEach(s=>s())};function a(s,u){return s[u]?Se(s,u,d=>(...h)=>{d.apply(this,h);try{const m=jn.parse(new Error).map(f=>f.toString()).splice(1),p=h.map(f=>er(f,n.stringifyOptions));l++,l<n.lengthThreshold?e({level:u,trace:m,payload:p}):l===n.lengthThreshold&&e({level:"warn",trace:[],payload:[er("The number of log records reached the threshold.")]})}catch(m){d("rrweb logger error:",m,...h)}}):()=>{}}}const tr="rrweb/console@1",Ks=e=>({name:tr,observer:Zs,options:e}),vt="__rrweb_original__",qs={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],replayLogger:void 0};class Js{constructor(t){this.config=Object.assign(qs,t)}getConsoleLogger(){const t={};for(const r of this.config.level)r==="trace"?t[r]=n=>{(console.log[vt]?console.log[vt]:console.log)(...n.payload.map(o=>JSON.parse(o)),this.formatMessage(n))}:t[r]=n=>{(console[r][vt]?console[r][vt]:console[r])(...n.payload.map(o=>JSON.parse(o)),this.formatMessage(n))};return t}formatMessage(t){if(t.trace.length===0)return"";const r=`
|
|
28
|
-
at `;let n=r;return n+=t.trace.join(r),n}}const Qs=e=>{const t=e?.replayLogger||new Js(e).getConsoleLogger();return{handler(r,n,o){let i=null;if(r.type===
|
|
28
|
+
at `;let n=r;return n+=t.trace.join(r),n}}const Qs=e=>{const t=e?.replayLogger||new Js(e).getConsoleLogger();return{handler(r,n,o){let i=null;if(r.type===O.IncrementalSnapshot&&r.data.source===A.Log?i=r.data:r.type===O.Plugin&&r.data.plugin===tr&&(i=r.data.payload),i)try{typeof t[i.level]=="function"&&t[i.level](i)}catch(l){o.replayer.config.showWarning&&console.warn(l)}}}},Bn={key:"_sid"},ea="rrweb/sequential-id@1",ta=e=>{const t=e?Object.assign({},Bn,e):Bn;let r=0;return{name:ea,eventProcessor(n){return Object.assign(n,{[t.key]:++r}),n},options:t}},zn={key:"_sid",warnOnMissingId:!0},ra=e=>{const{key:t,warnOnMissingId:r}=e?Object.assign({},zn,e):zn;let n=1;return{handler(o){if(t in o){const i=o[t];i!==n?console.error(`[sequential-id-plugin]: expect to get an id with value "${n}", but got "${i}"`):n++}else r&&console.warn(`[sequential-id-plugin]: failed to get id in key: "${t}"`)}}};return q.EventType=O,q.IncrementalSource=A,q.MouseInteractions=ee,q.PLUGIN_NAME=tr,q.Replayer=ys,q.ReplayerEvents=H,q.addCustomEvent=bs,q.freezePage=Ss,q.getRecordConsolePlugin=Ks,q.getRecordSequentialIdPlugin=ta,q.getReplayConsolePlugin=Qs,q.getReplaySequentialIdPlugin=ra,q.pack=Bs,q.record=ke,q.unpack=zs,q.utils=Io,Object.defineProperty(q,"__esModule",{value:!0}),q}({});
|