@highlight-run/rrweb 2.0.15 → 2.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/record/rrweb-record.js +1 -1
  2. package/dist/record/rrweb-record.min.js +1 -1
  3. package/dist/record/rrweb-record.min.js.map +1 -1
  4. package/dist/replay/rrweb-replay-unpack.css +1 -1
  5. package/dist/replay/rrweb-replay-unpack.js +4 -4
  6. package/dist/replay/rrweb-replay-unpack.min.css +1 -1
  7. package/dist/replay/rrweb-replay-unpack.min.css.map +1 -1
  8. package/dist/replay/rrweb-replay-unpack.min.js +4 -4
  9. package/dist/replay/rrweb-replay-unpack.min.js.map +1 -1
  10. package/dist/replay/rrweb-replay.css +1 -1
  11. package/dist/replay/rrweb-replay.js +4 -4
  12. package/dist/replay/rrweb-replay.min.css +1 -1
  13. package/dist/replay/rrweb-replay.min.css.map +1 -1
  14. package/dist/replay/rrweb-replay.min.js +4 -4
  15. package/dist/replay/rrweb-replay.min.js.map +1 -1
  16. package/dist/rrweb-all.css +1 -1
  17. package/dist/rrweb-all.js +5 -5
  18. package/dist/rrweb-all.min.css +1 -1
  19. package/dist/rrweb-all.min.css.map +1 -1
  20. package/dist/rrweb-all.min.js +5 -5
  21. package/dist/rrweb-all.min.js.map +1 -1
  22. package/dist/rrweb.css +1 -1
  23. package/dist/rrweb.js +5 -5
  24. package/dist/rrweb.min.css +1 -1
  25. package/dist/rrweb.min.css.map +1 -1
  26. package/dist/rrweb.min.js +5 -5
  27. package/dist/rrweb.min.js.map +1 -1
  28. package/es/rrweb/all.css +1 -1
  29. package/es/rrweb/packages/rrdom/es/rrdom.js +16 -5
  30. package/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas-manager.js +3 -0
  31. package/es/rrweb/packages/rrweb/src/replay/styles/inject-style.js +0 -1
  32. package/lib/record/rrweb-record.js +3 -0
  33. package/lib/replay/rrweb-replay-unpack.css +1 -1
  34. package/lib/replay/rrweb-replay-unpack.js +16 -6
  35. package/lib/replay/rrweb-replay.css +1 -1
  36. package/lib/replay/rrweb-replay.js +16 -6
  37. package/lib/rrweb-all.css +1 -1
  38. package/lib/rrweb-all.js +19 -6
  39. package/lib/rrweb.css +1 -1
  40. package/lib/rrweb.js +19 -6
  41. package/package.json +3 -3
@@ -1 +1 @@
1
- .replayer-wrapper{position:relative}.replayer-mouse{position:absolute;width:20px;height:20px;transition:left .05s linear,top .05s linear;background-size:contain;background-position:50%;background-repeat:no-repeat;background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjcgNSAxOCAxOCIgaGVpZ2h0PSIzMDAiIHdpZHRoPSIzMDAiPjxwYXRoIGZpbGw9IiNGRkYiIGQ9Ik04LjIgMjAuOXYtMTZsMTEuNiAxMS42SDEzbC0uNC4xeiIvPjxwYXRoIGZpbGw9IiNGRkYiIGQ9Ik0xNy4zIDIxLjZsLTMuNiAxLjVMOSAxMmwzLjctMS41eiIvPjxwYXRoIGQ9Ik0xMS4wMyAxNC4yOTNsMS44NDUtLjc3NCAzLjA5NiA3LjM3Ni0xLjg0NC43NzV6Ii8+PHBhdGggZD0iTTkuMiA3LjN2MTEuMmwzLTIuOS40LS4xaDQuOHoiLz48L3N2Zz4=");border-color:transparent}.replayer-mouse:after{background:transparent}.replayer-mouse.active:after{animation:click .2s ease-in-out 1}.replayer-mouse.touch-device{background-image:none;width:70px;height:70px;border-radius:100%;margin-left:-37px;margin-top:-37px;border:4px solid rgba(73,80,246,0);transition:left 0s linear,top 0s linear,border-color .2s ease-in-out}.replayer-mouse.touch-device.touch-active{border-color:#4950f6;transition:left .25s linear,top .25s linear,border-color .2s ease-in-out}.replayer-mouse.touch-device:after{opacity:0}.replayer-mouse.touch-device.active:after{animation:touch-click .2s ease-in-out 1}.replayer-mouse-tail{position:absolute;pointer-events:none}@keyframes click{0%{opacity:.3;width:20px;height:20px;background:transparent}75%{width:24px;height:24px;opacity:.8;background:#dc2626}to{background:transparent}}@keyframes touch-click{0%{opacity:0;width:20px;height:20px}50%{opacity:.5;width:10px;height:10px}}
1
+ .replayer-wrapper{position:relative}.replayer-mouse{position:absolute;width:20px;height:20px;transition:left .05s linear,top .05s linear;background-size:contain;background-position:50%;background-repeat:no-repeat;background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjcgNSAxOCAxOCIgaGVpZ2h0PSIzMDAiIHdpZHRoPSIzMDAiPjxwYXRoIGZpbGw9IiNGRkYiIGQ9Ik04LjIgMjAuOXYtMTZsMTEuNiAxMS42SDEzbC0uNC4xeiIvPjxwYXRoIGZpbGw9IiNGRkYiIGQ9Ik0xNy4zIDIxLjZsLTMuNiAxLjVMOSAxMmwzLjctMS41eiIvPjxwYXRoIGQ9Ik0xMS4wMyAxNC4yOTNsMS44NDUtLjc3NCAzLjA5NiA3LjM3Ni0xLjg0NC43NzV6Ii8+PHBhdGggZD0iTTkuMiA3LjN2MTEuMmwzLTIuOS40LS4xaDQuOHoiLz48L3N2Zz4=");border-color:transparent}.replayer-mouse:after{background:transparent}.replayer-mouse.active:after{animation:click .2s ease-in-out 1}.replayer-mouse.touch-device{background-image:none;width:70px;height:70px;border-radius:100%;margin-left:-37px;margin-top:-37px;border:4px solid rgba(73,80,246,0);transition:left 0s linear,top 0s linear,border-color .2s ease-in-out}.replayer-mouse.touch-device.touch-active{border-color:#4950f6;transition:left .25s linear,top .25s linear,border-color .2s ease-in-out}.replayer-mouse.touch-device:after{opacity:0}.replayer-mouse.touch-device.active:after{animation:touch-click .2s ease-in-out 1}.replayer-mouse-tail{position:absolute;pointer-events:none}@keyframes click{0%{opacity:.3;width:20px;height:20px;background:transparent}75%{width:24px;height:24px;opacity:.8;background:#dc2626}to{background:transparent}}@keyframes touch-click{0%{opacity:0;width:20px;height:20px}50%{opacity:.5;width:10px;height:10px}}.rr-player{position:relative;background:#fff;float:left;border-radius:5px;box-shadow:0 24px 48px rgba(17,16,62,.12)}.rr-player__frame{overflow:hidden}
@@ -1,5 +1,5 @@
1
- var rrwebReplay=function(fe){"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 Vt(e){return e.nodeType===e.ELEMENT_NODE}var $e=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(i){return r.removeNodeFromMap(i)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function Wt(){return new $e}var Be=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function jt(e,t){t===void 0&&(t={});var r=1,n=1;function i(g){var m=g.match(/\n/g);m&&(r+=m.length);var w=g.lastIndexOf(`
2
- `);n=w===-1?n+g.length:g.length-w}function s(){var g={line:r,column:n};return function(m){return m.position=new a(g),T(),m}}var a=function(){function g(m){this.start=m,this.end={line:r,column:n},this.source=t.source}return g}();a.prototype.content=e;var l=[];function c(g){var m=new Error(t.source+":"+r+":"+n+": "+g);if(m.reason=g,m.filename=t.source,m.line=r,m.column=n,m.source=e,t.silent)l.push(m);else throw m}function o(){var g=h();return{type:"stylesheet",stylesheet:{source:t.source,rules:g,parsingErrors:l}}}function u(){return f(/^{\s*/)}function d(){return f(/^}/)}function h(){var g,m=[];for(T(),v(m);e.length&&e.charAt(0)!=="}"&&(g=k()||ne());)g!==!1&&(m.push(g),v(m));return m}function f(g){var m=g.exec(e);if(m){var w=m[0];return i(w),e=e.slice(w.length),m}}function T(){f(/^\s*/)}function v(g){g===void 0&&(g=[]);for(var m;m=y();)m!==!1&&g.push(m),m=y();return g}function y(){var g=s();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var m=2;e.charAt(m)!==""&&(e.charAt(m)!=="*"||e.charAt(m+1)!=="/");)++m;if(m+=2,e.charAt(m-1)==="")return c("End of comment missing");var w=e.slice(2,m-2);return n+=2,i(w),e=e.slice(m),n+=2,g({type:"comment",comment:w})}}function p(){var g=f(/^([^{]+)/);if(g)return X(g[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(m){return m.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(m){return m.replace(/\u200C/g,",")})}function E(){var g=s(),m=f(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(m){var w=X(m[0]);if(!f(/^:\s*/))return c("property missing ':'");var C=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),P=g({type:"declaration",property:w.replace(Be,""),value:C?X(C[0]).replace(Be,""):""});return f(/^[;\s]*/),P}}function b(){var g=[];if(!u())return c("missing '{'");v(g);for(var m;m=E();)m!==!1&&(g.push(m),v(g)),m=E();return d()?g:c("missing '}'")}function I(){for(var g,m=[],w=s();g=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)m.push(g[1]),f(/^,\s*/);if(m.length)return w({type:"keyframe",values:m,declarations:b()})}function F(){var g=s(),m=f(/^@([-\w]+)?keyframes\s*/);if(m){var w=m[1];if(m=f(/^([-\w]+)\s*/),!m)return c("@keyframes missing name");var C=m[1];if(!u())return c("@keyframes missing '{'");for(var P,ee=v();P=I();)ee.push(P),ee=ee.concat(v());return d()?g({type:"keyframes",name:C,vendor:w,keyframes:ee}):c("@keyframes missing '}'")}}function x(){var g=s(),m=f(/^@supports *([^{]+)/);if(m){var w=X(m[1]);if(!u())return c("@supports missing '{'");var C=v().concat(h());return d()?g({type:"supports",supports:w,rules:C}):c("@supports missing '}'")}}function $(){var g=s(),m=f(/^@host\s*/);if(m){if(!u())return c("@host missing '{'");var w=v().concat(h());return d()?g({type:"host",rules:w}):c("@host missing '}'")}}function O(){var g=s(),m=f(/^@media *([^{]+)/);if(m){var w=X(m[1]);if(!u())return c("@media missing '{'");var C=v().concat(h());return d()?g({type:"media",media:w,rules:C}):c("@media missing '}'")}}function L(){var g=s(),m=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(m)return g({type:"custom-media",name:X(m[1]),media:X(m[2])})}function re(){var g=s(),m=f(/^@page */);if(m){var w=p()||[];if(!u())return c("@page missing '{'");for(var C=v(),P;P=E();)C.push(P),C=C.concat(v());return d()?g({type:"page",selectors:w,declarations:C}):c("@page missing '}'")}}function z(){var g=s(),m=f(/^@([-\w]+)?document *([^{]+)/);if(m){var w=X(m[1]),C=X(m[2]);if(!u())return c("@document missing '{'");var P=v().concat(h());return d()?g({type:"document",document:C,vendor:w,rules:P}):c("@document missing '}'")}}function Z(){var g=s(),m=f(/^@font-face\s*/);if(m){if(!u())return c("@font-face missing '{'");for(var w=v(),C;C=E();)w.push(C),w=w.concat(v());return d()?g({type:"font-face",declarations:w}):c("@font-face missing '}'")}}var G=B("import"),K=B("charset"),ce=B("namespace");function B(g){var m=new RegExp("^@"+g+"\\s*([^;]+);");return function(){var w=s(),C=f(m);if(C){var P={type:g};return P[g]=C[1].trim(),w(P)}}}function k(){if(e[0]==="@")return F()||O()||L()||x()||G()||K()||ce()||z()||re()||$()||Z()}function ne(){var g=s(),m=p();return m?(v(),g({type:"rule",selectors:m,declarations:b()})):c("selector missing")}return we(o())}function X(e){return e?e.replace(/^\s+|\s+$/g,""):""}function we(e,t){for(var r=e&&typeof e.type=="string",n=r?e:t,i=0,s=Object.keys(e);i<s.length;i++){var a=s[i],l=e[a];Array.isArray(l)?l.forEach(function(c){we(c,n)}):l&&typeof l=="object"&&we(l,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Ve={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 Ht(e){var t=Ve[e.tagName]?Ve[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function Gt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var We=/([^\\]):hover/,Yt=new RegExp(We.source,"g");function je(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 i=jt(e,{silent:!0});if(!i.stylesheet)return e;var s=[];if(i.stylesheet.rules.forEach(function(c){"selectors"in c&&(c.selectors||[]).forEach(function(o){We.test(o)&&s.push(o)})}),s.length===0)return e;var a=new RegExp(s.filter(function(c,o){return s.indexOf(c)===o}).sort(function(c,o){return o.length-c.length}).map(function(c){return Gt(c)}).join("|"),"g"),l=e.replace(a,function(c){var o=c.replace(Yt,"$1.\\:hover");return"".concat(c,", ").concat(o)});return t?.stylesWithHoverClass.set(e,l),l}function He(){var e=new Map;return{stylesWithHoverClass:e}}function zt(e,t){var r=t.doc,n=t.hackCss,i=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 s=Ht(e),a;e.isSVG?a=r.createElementNS("http://www.w3.org/2000/svg",s):a=r.createElement(s);var l=function(d){if(!e.attributes.hasOwnProperty(d))return"continue";var h=e.attributes[d];if(s==="option"&&d==="selected"&&h===!1)return"continue";if(h=typeof h=="boolean"||typeof h=="number"?"":h,d.startsWith("rr_")){if(s==="canvas"&&d==="rr_dataURL"){var f=document.createElement("img");f.src=h,f.onload=function(){var L=a.getContext("2d");L&&L.drawImage(f,0,0,f.width,f.height)}}else if(s==="img"&&d==="rr_dataURL"){var T=a;T.currentSrc.startsWith("data:")||(T.setAttribute("rrweb-original-src",e.attributes.src),T.src=h,T.setAttribute("rrweb-inline-src",h))}if(d==="rr_width")a.style.width=h;else if(d==="rr_height")a.style.height=h;else if(d==="rr_mediaCurrentTime")a.currentTime=e.attributes.rr_mediaCurrentTime;else if(d==="rr_mediaState")switch(h){case"played":a.play().catch(function(L){return console.warn("media playback error",L)});break;case"paused":a.pause();break}}else{var v=s==="textarea"&&d==="value",y=s==="style"&&d==="_cssText";if(y&&n&&(h=je(h,i),typeof h=="string")){for(var p=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,E=void 0,b=[],I="https://replay-cors-proxy.highlightrun.workers.dev";(E=p.exec(h))!==null;)E.index===p.lastIndex&&p.lastIndex++,E.forEach(function(L,re){if(re===0){var z=L.slice(5,L.length-2);b.push({originalUrl:z,proxyUrl:z.replace(z,"".concat(I,"?url=").concat(z))})}});b.forEach(function(L){h=h.replace(L.originalUrl,L.proxyUrl)})}if(v||y){for(var F=r.createTextNode(h),x=0,$=Array.from(a.childNodes);x<$.length;x++){var O=$[x];O.nodeType===a.TEXT_NODE&&a.removeChild(O)}return a.appendChild(F),"continue"}try{if(e.isSVG&&d==="xlink:href")a.setAttributeNS("http://www.w3.org/1999/xlink",d,h);else if(d==="onload"||d==="onclick"||d.substring(0,7)==="onmouse")a.setAttribute("_"+d,h);else{if(s==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&d==="content")return a.setAttribute("csp-content",h),"continue";s==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||s==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")||(s==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?a.setAttribute("rrweb-original-srcset",e.attributes.srcset):a.setAttribute(d,h))}}catch{}}};for(var c in e.attributes)l(c);if(s==="img"){var o=a;if(!o.currentSrc.startsWith("data:")){var u=o.getAttribute("rrweb-inline-src");u!=null&&u.startsWith("data:")&&(o.src=u)}}if(e.isShadowHost)if(!a.shadowRoot)a.attachShadow({mode:"open"});else for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);return a;case _.Text:return r.createTextNode(e.isStyle&&n?je(e.textContent,i):e.textContent);case _.CDATA:return r.createCDATASection(e.textContent);case _.Comment:return r.createComment(e.textContent);default:return null}}function ve(e,t){var r=t.doc,n=t.mirror,i=t.skipChild,s=i===void 0?!1:i,a=t.hackCss,l=a===void 0?!0:a,c=t.afterAppend,o=t.cache,u=zt(e,{doc:r,hackCss:l,cache:o});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)&&!s)for(var d=0,h=e.childNodes;d<h.length;d++){var f=h[d],T=ve(f,{doc:r,mirror:n,skipChild:!1,hackCss:l,afterAppend:c,cache:o});if(!T){console.warn("Failed to rebuild",f);continue}f.isShadow&&Vt(u)&&u.shadowRoot?u.shadowRoot.appendChild(T):u.appendChild(T),c&&c(T)}return u}function Xt(e,t){function r(a){t(a)}for(var n=0,i=e.getIds();n<i.length;n++){var s=i[n];e.has(s)&&r(e.getNode(s))}}function Qt(e,t){var r=t.getMeta(e);if(r?.type===_.Element){var n=e;for(var i in r.attributes)if(r.attributes.hasOwnProperty(i)&&i.startsWith("rr_")){var s=r.attributes[i];i==="rr_scrollLeft"&&(n.scrollLeft=s),i==="rr_scrollTop"&&(n.scrollTop=s)}}}function Jt(e,t){var r=t.doc,n=t.onVisit,i=t.hackCss,s=i===void 0?!0:i,a=t.afterAppend,l=t.cache,c=t.mirror,o=c===void 0?new $e:c,u=ve(e,{doc:r,mirror:o,skipChild:!1,hackCss:s,afterAppend:a,cache:l});return Xt(o,function(d){n&&n(d),Qt(d,o)}),u}var N;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(N||(N={}));var qt=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(i){return r.removeNodeFromMap(i)})},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 Zt(){return new qt}function Kt(e){const t={},r=/;(?![^(]*\))/g,n=/:(.+)/,i=/\/\*.*?\*\//g;return e.replace(i,"").split(r).forEach(function(s){if(s){const a=s.split(n);a.length>1&&(t[be(a[0].trim())]=a[1].trim())}}),t}function Ge(e){const t=[];for(const r in e){const n=e[r];if(typeof n!="string")continue;const i=nr(r);t.push(`${i}: ${n};`)}return t.join(" ")}const er=/-([a-z])/g,tr=/^--[a-zA-Z0-9-]+$/,be=e=>tr.test(e)?e:e.replace(er,(t,r)=>r?r.toUpperCase():""),rr=/\B([A-Z])/g,nr=e=>e.replace(rr,"-$1").toLowerCase();class W{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=R.ELEMENT_NODE,this.TEXT_NODE=R.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){const 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 ir(e){return class Bt extends e{constructor(){super(...arguments),this.nodeType=R.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=N.Document,this.textContent=null}get documentElement(){return this.childNodes.find(r=>r.RRNodeType===N.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===N.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===N.Element&&n.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(r){const n=r.RRNodeType;if((n===N.Element||n===N.DocumentType)&&this.childNodes.some(i=>i.RRNodeType===n))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${n===N.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return r.parentElement=null,r.parentNode=this,this.childNodes.push(r),r}insertBefore(r,n){const i=r.RRNodeType;if((i===N.Element||i===N.DocumentType)&&this.childNodes.some(a=>a.RRNodeType===i))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${i===N.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(n===null)return this.appendChild(r);const s=this.childNodes.indexOf(n);if(s==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(s,0,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 i=this.createDocumentType("html",n,"");this.open(),this.appendChild(i)}}createDocument(r,n,i){return new Bt}createDocumentType(r,n,i){const s=new(Ye(W))(r,n,i);return s.ownerDocument=this,s}createElement(r){const n=new(ze(W))(r);return n.ownerDocument=this,n}createElementNS(r,n){return this.createElement(n)}createTextNode(r){const n=new(Xe(W))(r);return n.ownerDocument=this,n}createComment(r){const n=new(Qe(W))(r);return n.ownerDocument=this,n}createCDATASection(r){const n=new(Je(W))(r);return n.ownerDocument=this,n}toString(){return"RRDocument"}}}function Ye(e){return class extends e{constructor(t,r,n){super(),this.nodeType=R.DOCUMENT_TYPE_NODE,this.RRNodeType=N.DocumentType,this.textContent=null,this.name=t,this.publicId=r,this.systemId=n,this.nodeName=t}toString(){return"RRDocumentType"}}}function ze(e){return class extends e{constructor(t){super(),this.nodeType=R.ELEMENT_NODE,this.RRNodeType=N.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 sr(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?Kt(this.attributes.style):{},r=/\B([A-Z])/g;return t.setProperty=(n,i,s)=>{if(r.test(n))return;const a=be(n);i?t[a]=i:delete t[a],s==="important"&&(t[a]+=" !important"),this.attributes.style=Ge(t)},t.removeProperty=n=>{if(r.test(n))return"";const i=be(n),s=t[i]||"";return delete t[i],this.attributes.style=Ge(t),s},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 or(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 Xe(e){return class extends e{constructor(t){super(),this.nodeType=R.TEXT_NODE,this.nodeName="#text",this.RRNodeType=N.Text,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function Qe(e){return class extends e{constructor(t){super(),this.nodeType=R.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=N.Comment,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function Je(e){return class extends e{constructor(t){super(),this.nodeName="#cdata-section",this.nodeType=R.CDATA_SECTION_NODE,this.RRNodeType=N.CDATA,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class sr{constructor(t,r){if(this.classes=[],this.add=(...n)=>{for(const i of n){const s=String(i);this.classes.indexOf(s)>=0||this.classes.push(s)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...n)=>{this.classes=this.classes.filter(i=>n.indexOf(i)===-1),this.onChange&&this.onChange(this.classes.join(" "))},t){const n=t.trim().split(/\s+/);this.classes.push(...n)}this.onChange=r}}var R;(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"})(R||(R={}));const De={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"};function Y(e,t,r,n){const i=e.childNodes,s=t.childNodes;n=n||t.mirror||t.ownerDocument.mirror,(i.length>0||s.length>0)&&qe(Array.from(i),s,e,r,n);let a=null,l=null;switch(t.RRNodeType){case N.Document:{l=t.scrollData;break}case N.Element:{const c=e,o=t;switch(ar(c,o,n),l=o.scrollData,a=o.inputData,o.tagName){case"AUDIO":case"VIDEO":{const u=e,d=o;d.paused!==void 0&&(d.paused?u.pause():u.play()),d.muted!==void 0&&(u.muted=d.muted),d.volume!==void 0&&(u.volume=d.volume),d.currentTime!==void 0&&(u.currentTime=d.currentTime);break}case"CANVAS":t.canvasMutations.forEach(u=>r.applyCanvas(u.event,u.mutation,e));break;case"STYLE":cr(c,t.rules);break}if(o.shadowRoot){c.shadowRoot||c.attachShadow({mode:"open"});const u=c.shadowRoot.childNodes,d=o.shadowRoot.childNodes;(u.length>0||d.length>0)&&qe(Array.from(u),d,c.shadowRoot,r,n)}break}case N.Text:case N.Comment:case N.CDATA:e.textContent!==t.data&&(e.textContent=t.data);break}if(l&&r.applyScroll(l,!0),a&&r.applyInput(a),t.nodeName==="IFRAME"){const c=e.contentDocument,o=t;if(c){const u=n.getMeta(o.contentDocument);u&&r.mirror.add(c,Object.assign({},u)),Y(c,o.contentDocument,r,n)}}}function ar(e,t,r){const n=e.attributes,i=t.attributes;for(const s in i){const a=i[s],l=r.getMeta(t);if(l&&"isSVG"in l&&l.isSVG&&De[s])e.setAttributeNS(De[s],s,a);else if(t.tagName==="CANVAS"&&s==="rr_dataURL"){const c=document.createElement("img");c.src=a,c.onload=()=>{const o=e.getContext("2d");o&&o.drawImage(c,0,0,c.width,c.height)}}else e.setAttribute(s,a)}for(const{name:s}of Array.from(n))s in i||e.removeAttribute(s);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function qe(e,t,r,n,i){var s;let a=0,l=e.length-1,c=0,o=t.length-1,u=e[a],d=e[l],h=t[c],f=t[o],T,v;for(;a<=l&&c<=o;)if(u===void 0)u=e[++a];else if(d===void 0)d=e[--l];else if(n.mirror.getId(u)===i.getId(h))Y(u,h,n,i),u=e[++a],h=t[++c];else if(n.mirror.getId(d)===i.getId(f))Y(d,f,n,i),d=e[--l],f=t[--o];else if(n.mirror.getId(u)===i.getId(f))r.insertBefore(u,d.nextSibling),Y(u,f,n,i),u=e[++a],f=t[--o];else if(n.mirror.getId(d)===i.getId(h))r.insertBefore(d,u),Y(d,h,n,i),d=e[--l],h=t[++c];else{if(!T){T={};for(let y=a;y<=l;y++){const p=e[y];p&&n.mirror.hasNode(p)&&(T[n.mirror.getId(p)]=y)}}if(v=T[i.getId(h)],v){const y=e[v];r.insertBefore(y,u),Y(y,h,n,i),e[v]=void 0}else{const y=Ce(h,n.mirror,i);r.nodeName==="#document"&&((s=n.mirror.getMeta(y))===null||s===void 0?void 0:s.type)===N.Element&&r.documentElement&&(r.removeChild(r.documentElement),e[a]=void 0,u=void 0),r.insertBefore(y,u||null),Y(y,h,n,i)}h=t[++c]}if(a>l){const y=t[o+1];let p=null;for(y&&r.childNodes.forEach(E=>{n.mirror.getId(E)===i.getId(y)&&(p=E)});c<=o;++c){const E=Ce(t[c],n.mirror,i);r.insertBefore(E,p),Y(E,t[c],n,i)}}else if(c>o)for(;a<=l;a++){const y=e[a];y&&(r.removeChild(y),n.mirror.removeNodeFromMap(y))}}function Ce(e,t,r){let n=t.getNode(r.getId(e));const i=r.getMeta(e);if(n!==null)return n;switch(e.RRNodeType){case N.Document:n=new Document;break;case N.DocumentType:n=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case N.Element:{e.tagName.toLowerCase(),i&&"isSVG"in i&&i?.isSVG?n=document.createElementNS(De.svg,e.tagName.toLowerCase()):n=document.createElement(e.tagName);break}case N.Text:n=document.createTextNode(e.data);break;case N.Comment:n=document.createComment(e.data);break;case N.CDATA:n=document.createCDATASection(e.data);break}return i&&t.add(n,Object.assign({},i)),n}function le(e,t){const r=e[t[0]];return t.length===1?r:le(r.cssRules[t[1]].cssRules,t.slice(2))}var j;(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"})(j||(j={}));function Ze(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function cr(e,t){const r=e.sheet;t.forEach(n=>{if(n.type===j.Insert)try{if(Array.isArray(n.index)){const{positions:i,index:s}=Ze(n.index);le(r.cssRules,i).insertRule(n.cssText,s)}else r.insertRule(n.cssText,n.index)}catch{}else if(n.type===j.Remove)try{if(Array.isArray(n.index)){const{positions:i,index:s}=Ze(n.index);le(r.cssRules,i).deleteRule(s||0)}else r.deleteRule(n.index)}catch{}else n.type===j.SetProperty?le(r.cssRules,n.index).style.setProperty(n.property,n.value,n.priority):n.type===j.RemoveProperty&&le(r.cssRules,n.index).style.removeProperty(n.property)})}class ie extends ir(W){constructor(t){super(),this._unserializedId=-1,this.mirror=Tr(),this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,r,n){return new ie}createDocumentType(t,r,n){const i=new lr(t,r,n);return i.ownerDocument=this,i}createElement(t){const r=t.toUpperCase();let n;switch(r){case"AUDIO":case"VIDEO":n=new ur(r);break;case"IFRAME":n=new mr(r,this.mirror);break;case"CANVAS":n=new dr(r);break;case"STYLE":n=new hr(r);break;default:n=new ue(r);break}return n.ownerDocument=this,n}createComment(t){const r=new fr(t);return r.ownerDocument=this,r}createCDATASection(t){const r=new vr(t);return r.ownerDocument=this,r}createTextNode(t){const r=new pr(t);return r.ownerDocument=this,r}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=-1}}const lr=Ye(W);class ue extends ze(W){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class ur extends or(ue){}class dr extends ue{constructor(){super(...arguments),this.canvasMutations=[]}getContext(){return null}}class hr extends ue{constructor(){super(...arguments),this.rules=[]}}class mr extends ue{constructor(t,r){super(t),this.contentDocument=new ie,this.contentDocument.mirror=r}}const pr=Xe(W),fr=Qe(W),vr=Je(W);function gr(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function Ke(e,t,r,n){let i;switch(e.nodeType){case R.DOCUMENT_NODE:n&&n.nodeName==="IFRAME"?i=n.contentDocument:(i=t,i.compatMode=e.compatMode);break;case R.DOCUMENT_TYPE_NODE:const a=e;i=t.createDocumentType(a.name,a.publicId,a.systemId);break;case R.ELEMENT_NODE:const l=e,c=gr(l);i=t.createElement(c);const o=i;for(const{name:u,value:d}of Array.from(l.attributes))o.attributes[u]=d;l.scrollLeft&&(o.scrollLeft=l.scrollLeft),l.scrollTop&&(o.scrollTop=l.scrollTop);break;case R.TEXT_NODE:i=t.createTextNode(e.textContent||"");break;case R.CDATA_SECTION_NODE:i=t.createCDATASection(e.data);break;case R.COMMENT_NODE:i=t.createComment(e.textContent||"");break;case R.DOCUMENT_FRAGMENT_NODE:i=n.attachShadow({mode:"open"});break;default:return null}let s=r.getMeta(e);return t instanceof ie&&(s||(s=et(i,t.unserializedId),r.add(e,s)),t.mirror.add(i,Object.assign({},s))),i}function yr(e,t=Zt(),r=new ie){function n(i,s){const a=Ke(i,r,t,s);a!==null&&(s?.nodeName!=="IFRAME"&&i.nodeType!==R.DOCUMENT_FRAGMENT_NODE&&(s?.appendChild(a),a.parentNode=s,a.parentElement=s),i.nodeName==="IFRAME"?n(i.contentDocument,a):(i.nodeType===R.DOCUMENT_NODE||i.nodeType===R.ELEMENT_NODE||i.nodeType===R.DOCUMENT_FRAGMENT_NODE)&&(i.nodeType===R.ELEMENT_NODE&&i.shadowRoot&&n(i.shadowRoot,a),i.childNodes.forEach(l=>n(l,a))))}return n(e,null),r}function Tr(){return new Er}class Er{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 et(e,t){switch(e.RRNodeType){case N.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case N.DocumentType:const r=e;return{id:t,type:e.RRNodeType,name:r.name,publicId:r.publicId,systemId:r.systemId};case N.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case N.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case N.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case N.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}function tt(e){return e=e||Object.create(null),{on:function(r,n){(e[r]||(e[r]=[])).push(n)},off:function(r,n){e[r]&&e[r].splice(e[r].indexOf(n)>>>0,1)},emit:function(r,n){(e[r]||[]).slice().map(function(i){i(n)}),(e["*"]||[]).slice().map(function(i){i(r,n)})}}}var Nr=Object.freeze({__proto__:null,default:tt});function wr(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const r=e.HTMLElement||e.Element,n=468,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||c,scrollIntoView:r.prototype.scrollIntoView},s=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function a(p){const E=["MSIE ","Trident/","Edge/"];return new RegExp(E.join("|")).test(p)}const l=a(e.navigator.userAgent)?1:0;function c(p,E){this.scrollLeft=p,this.scrollTop=E}function o(p){return .5*(1-Math.cos(Math.PI*p))}function u(p){if(p===null||typeof p!="object"||p.behavior===void 0||p.behavior==="auto"||p.behavior==="instant")return!0;if(typeof p=="object"&&p.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+p.behavior+" is not a valid value for enumeration ScrollBehavior.")}function d(p,E){if(E==="Y")return p.clientHeight+l<p.scrollHeight;if(E==="X")return p.clientWidth+l<p.scrollWidth}function h(p,E){const b=e.getComputedStyle(p,null)["overflow"+E];return b==="auto"||b==="scroll"}function f(p){const E=d(p,"Y")&&h(p,"Y"),b=d(p,"X")&&h(p,"X");return E||b}function T(p){for(;p!==t.body&&f(p)===!1;)p=p.parentNode||p.host;return p}function v(p){const E=s();let b,I,F,x=(E-p.startTime)/n;x=x>1?1:x,b=o(x),I=p.startX+(p.x-p.startX)*b,F=p.startY+(p.y-p.startY)*b,p.method.call(p.scrollable,I,F),(I!==p.x||F!==p.y)&&e.requestAnimationFrame(v.bind(e,p))}function y(p,E,b){let I,F,x,$;const O=s();p===t.body?(I=e,F=e.scrollX||e.pageXOffset,x=e.scrollY||e.pageYOffset,$=i.scroll):(I=p,F=p.scrollLeft,x=p.scrollTop,$=c),v({scrollable:I,method:$,startTime:O,startX:F,startY:x,x:E,y:b})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){i.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])){i.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");i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const p=arguments[0].left,E=arguments[0].top;y.call(this,this,typeof p>"u"?this.scrollLeft:~~p,typeof E>"u"?this.scrollTop:~~E)},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){i.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){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const p=T(this),E=p.getBoundingClientRect(),b=this.getBoundingClientRect();p!==t.body?(y.call(this,p,p.scrollLeft+b.left-E.left,p.scrollTop+b.top-E.top),e.getComputedStyle(p).position!=="fixed"&&e.scrollBy({left:E.left,top:E.top,behavior:"smooth"})):e.scrollBy({left:b.left,top:b.top,behavior:"smooth"})}}var M=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(M||{}),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||{}),U=(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))(U||{}),ge=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ge||{}),Se=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(Se||{}),D=(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))(D||{});class br{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=this;function i(){const s=performance.now();for(n.timeOffset+=(s-t)*n.speed,t=s;r.length;){const a=r[0];if(n.timeOffset>=a.delay)r.shift(),a.doAction();else break}(r.length>0||n.liveMode)&&(n.raf=requestAnimationFrame(i))}this.raf=requestAnimationFrame(i)}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 i=Math.floor((r+n)/2);if(this.actions[i].delay<t.delay)r=i+1;else if(this.actions[i].delay>t.delay)n=i-1;else return i+1}return r}}function Me(e,t){if(e.type===M.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}/*! *****************************************************************************
1
+ var rrwebReplay=function(fe){"use strict";var L;(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"})(L||(L={}));function Vt(e){return e.nodeType===e.ELEMENT_NODE}var $e=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(i){return r.removeNodeFromMap(i)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function Wt(){return new $e}var Be=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function jt(e,t){t===void 0&&(t={});var r=1,n=1;function i(g){var m=g.match(/\n/g);m&&(r+=m.length);var b=g.lastIndexOf(`
2
+ `);n=b===-1?n+g.length:g.length-b}function s(){var g={line:r,column:n};return function(m){return m.position=new a(g),T(),m}}var a=function(){function g(m){this.start=m,this.end={line:r,column:n},this.source=t.source}return g}();a.prototype.content=e;var l=[];function c(g){var m=new Error(t.source+":"+r+":"+n+": "+g);if(m.reason=g,m.filename=t.source,m.line=r,m.column=n,m.source=e,t.silent)l.push(m);else throw m}function o(){var g=h();return{type:"stylesheet",stylesheet:{source:t.source,rules:g,parsingErrors:l}}}function u(){return f(/^{\s*/)}function d(){return f(/^}/)}function h(){var g,m=[];for(T(),v(m);e.length&&e.charAt(0)!=="}"&&(g=_()||ne());)g!==!1&&(m.push(g),v(m));return m}function f(g){var m=g.exec(e);if(m){var b=m[0];return i(b),e=e.slice(b.length),m}}function T(){f(/^\s*/)}function v(g){g===void 0&&(g=[]);for(var m;m=E();)m!==!1&&g.push(m),m=E();return g}function E(){var g=s();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var m=2;e.charAt(m)!==""&&(e.charAt(m)!=="*"||e.charAt(m+1)!=="/");)++m;if(m+=2,e.charAt(m-1)==="")return c("End of comment missing");var b=e.slice(2,m-2);return n+=2,i(b),e=e.slice(m),n+=2,g({type:"comment",comment:b})}}function p(){var g=f(/^([^{]+)/);if(g)return X(g[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(m){return m.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(m){return m.replace(/\u200C/g,",")})}function y(){var g=s(),m=f(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(m){var b=X(m[0]);if(!f(/^:\s*/))return c("property missing ':'");var S=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),P=g({type:"declaration",property:b.replace(Be,""),value:S?X(S[0]).replace(Be,""):""});return f(/^[;\s]*/),P}}function N(){var g=[];if(!u())return c("missing '{'");v(g);for(var m;m=y();)m!==!1&&(g.push(m),v(g)),m=y();return d()?g:c("missing '}'")}function D(){for(var g,m=[],b=s();g=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)m.push(g[1]),f(/^,\s*/);if(m.length)return b({type:"keyframe",values:m,declarations:N()})}function O(){var g=s(),m=f(/^@([-\w]+)?keyframes\s*/);if(m){var b=m[1];if(m=f(/^([-\w]+)\s*/),!m)return c("@keyframes missing name");var S=m[1];if(!u())return c("@keyframes missing '{'");for(var P,ee=v();P=D();)ee.push(P),ee=ee.concat(v());return d()?g({type:"keyframes",name:S,vendor:b,keyframes:ee}):c("@keyframes missing '}'")}}function R(){var g=s(),m=f(/^@supports *([^{]+)/);if(m){var b=X(m[1]);if(!u())return c("@supports missing '{'");var S=v().concat(h());return d()?g({type:"supports",supports:b,rules:S}):c("@supports missing '}'")}}function $(){var g=s(),m=f(/^@host\s*/);if(m){if(!u())return c("@host missing '{'");var b=v().concat(h());return d()?g({type:"host",rules:b}):c("@host missing '}'")}}function k(){var g=s(),m=f(/^@media *([^{]+)/);if(m){var b=X(m[1]);if(!u())return c("@media missing '{'");var S=v().concat(h());return d()?g({type:"media",media:b,rules:S}):c("@media missing '}'")}}function F(){var g=s(),m=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(m)return g({type:"custom-media",name:X(m[1]),media:X(m[2])})}function re(){var g=s(),m=f(/^@page */);if(m){var b=p()||[];if(!u())return c("@page missing '{'");for(var S=v(),P;P=y();)S.push(P),S=S.concat(v());return d()?g({type:"page",selectors:b,declarations:S}):c("@page missing '}'")}}function z(){var g=s(),m=f(/^@([-\w]+)?document *([^{]+)/);if(m){var b=X(m[1]),S=X(m[2]);if(!u())return c("@document missing '{'");var P=v().concat(h());return d()?g({type:"document",document:S,vendor:b,rules:P}):c("@document missing '}'")}}function Z(){var g=s(),m=f(/^@font-face\s*/);if(m){if(!u())return c("@font-face missing '{'");for(var b=v(),S;S=y();)b.push(S),b=b.concat(v());return d()?g({type:"font-face",declarations:b}):c("@font-face missing '}'")}}var G=B("import"),K=B("charset"),ce=B("namespace");function B(g){var m=new RegExp("^@"+g+"\\s*([^;]+);");return function(){var b=s(),S=f(m);if(S){var P={type:g};return P[g]=S[1].trim(),b(P)}}}function _(){if(e[0]==="@")return O()||k()||F()||R()||G()||K()||ce()||z()||re()||$()||Z()}function ne(){var g=s(),m=p();return m?(v(),g({type:"rule",selectors:m,declarations:N()})):c("selector missing")}return we(o())}function X(e){return e?e.replace(/^\s+|\s+$/g,""):""}function we(e,t){for(var r=e&&typeof e.type=="string",n=r?e:t,i=0,s=Object.keys(e);i<s.length;i++){var a=s[i],l=e[a];Array.isArray(l)?l.forEach(function(c){we(c,n)}):l&&typeof l=="object"&&we(l,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Ve={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 Ht(e){var t=Ve[e.tagName]?Ve[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function Gt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var We=/([^\\]):hover/,Yt=new RegExp(We.source,"g");function je(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 i=jt(e,{silent:!0});if(!i.stylesheet)return e;var s=[];if(i.stylesheet.rules.forEach(function(c){"selectors"in c&&(c.selectors||[]).forEach(function(o){We.test(o)&&s.push(o)})}),s.length===0)return e;var a=new RegExp(s.filter(function(c,o){return s.indexOf(c)===o}).sort(function(c,o){return o.length-c.length}).map(function(c){return Gt(c)}).join("|"),"g"),l=e.replace(a,function(c){var o=c.replace(Yt,"$1.\\:hover");return"".concat(c,", ").concat(o)});return t?.stylesWithHoverClass.set(e,l),l}function He(){var e=new Map;return{stylesWithHoverClass:e}}function zt(e,t){var r=t.doc,n=t.hackCss,i=t.cache;switch(e.type){case L.Document:return r.implementation.createDocument(null,"",null);case L.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case L.Element:var s=Ht(e),a;e.isSVG?a=r.createElementNS("http://www.w3.org/2000/svg",s):a=r.createElement(s);var l=function(d){if(!e.attributes.hasOwnProperty(d))return"continue";var h=e.attributes[d];if(s==="option"&&d==="selected"&&h===!1)return"continue";if(h=typeof h=="boolean"||typeof h=="number"?"":h,d.startsWith("rr_")){if(s==="canvas"&&d==="rr_dataURL"){var f=document.createElement("img");f.src=h,f.onload=function(){var F=a.getContext("2d");F&&F.drawImage(f,0,0,f.width,f.height)}}else if(s==="img"&&d==="rr_dataURL"){var T=a;T.currentSrc.startsWith("data:")||(T.setAttribute("rrweb-original-src",e.attributes.src),T.src=h,T.setAttribute("rrweb-inline-src",h))}if(d==="rr_width")a.style.width=h;else if(d==="rr_height")a.style.height=h;else if(d==="rr_mediaCurrentTime")a.currentTime=e.attributes.rr_mediaCurrentTime;else if(d==="rr_mediaState")switch(h){case"played":a.play().catch(function(F){return console.warn("media playback error",F)});break;case"paused":a.pause();break}}else{var v=s==="textarea"&&d==="value",E=s==="style"&&d==="_cssText";if(E&&n&&(h=je(h,i),typeof h=="string")){for(var p=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,y=void 0,N=[],D="https://replay-cors-proxy.highlightrun.workers.dev";(y=p.exec(h))!==null;)y.index===p.lastIndex&&p.lastIndex++,y.forEach(function(F,re){if(re===0){var z=F.slice(5,F.length-2);N.push({originalUrl:z,proxyUrl:z.replace(z,"".concat(D,"?url=").concat(z))})}});N.forEach(function(F){h=h.replace(F.originalUrl,F.proxyUrl)})}if(v||E){for(var O=r.createTextNode(h),R=0,$=Array.from(a.childNodes);R<$.length;R++){var k=$[R];k.nodeType===a.TEXT_NODE&&a.removeChild(k)}return a.appendChild(O),"continue"}try{if(e.isSVG&&d==="xlink:href")a.setAttributeNS("http://www.w3.org/1999/xlink",d,h);else if(d==="onload"||d==="onclick"||d.substring(0,7)==="onmouse")a.setAttribute("_"+d,h);else{if(s==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&d==="content")return a.setAttribute("csp-content",h),"continue";s==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||s==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")||(s==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?a.setAttribute("rrweb-original-srcset",e.attributes.srcset):a.setAttribute(d,h))}}catch{}}};for(var c in e.attributes)l(c);if(s==="img"){var o=a;if(!o.currentSrc.startsWith("data:")){var u=o.getAttribute("rrweb-inline-src");u!=null&&u.startsWith("data:")&&(o.src=u)}}if(e.isShadowHost)if(!a.shadowRoot)a.attachShadow({mode:"open"});else for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);return a;case L.Text:return r.createTextNode(e.isStyle&&n?je(e.textContent,i):e.textContent);case L.CDATA:return r.createCDATASection(e.textContent);case L.Comment:return r.createComment(e.textContent);default:return null}}function ve(e,t){var r=t.doc,n=t.mirror,i=t.skipChild,s=i===void 0?!1:i,a=t.hackCss,l=a===void 0?!0:a,c=t.afterAppend,o=t.cache,u=zt(e,{doc:r,hackCss:l,cache:o});if(!u)return null;if(e.rootId&&console.assert(n.getNode(e.rootId)===r,"Target document should have the same root id."),e.type===L.Document&&(r.close(),r.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==L.DocumentType&&(e.childNodes[0].type===L.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===L.Document||e.type===L.Element)&&!s)for(var d=0,h=e.childNodes;d<h.length;d++){var f=h[d],T=ve(f,{doc:r,mirror:n,skipChild:!1,hackCss:l,afterAppend:c,cache:o});if(!T){console.warn("Failed to rebuild",f);continue}f.isShadow&&Vt(u)&&u.shadowRoot?u.shadowRoot.appendChild(T):u.appendChild(T),c&&c(T)}return u}function Xt(e,t){function r(a){t(a)}for(var n=0,i=e.getIds();n<i.length;n++){var s=i[n];e.has(s)&&r(e.getNode(s))}}function Qt(e,t){var r=t.getMeta(e);if(r?.type===L.Element){var n=e;for(var i in r.attributes)if(r.attributes.hasOwnProperty(i)&&i.startsWith("rr_")){var s=r.attributes[i];i==="rr_scrollLeft"&&(n.scrollLeft=s),i==="rr_scrollTop"&&(n.scrollTop=s)}}}function Jt(e,t){var r=t.doc,n=t.onVisit,i=t.hackCss,s=i===void 0?!0:i,a=t.afterAppend,l=t.cache,c=t.mirror,o=c===void 0?new $e:c,u=ve(e,{doc:r,mirror:o,skipChild:!1,hackCss:s,afterAppend:a,cache:l});return Xt(o,function(d){n&&n(d),Qt(d,o)}),u}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 qt=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(i){return r.removeNodeFromMap(i)})},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 Zt(){return new qt}function Kt(e){const t={},r=/;(?![^(]*\))/g,n=/:(.+)/,i=/\/\*.*?\*\//g;return e.replace(i,"").split(r).forEach(function(s){if(s){const a=s.split(n);a.length>1&&(t[be(a[0].trim())]=a[1].trim())}}),t}function Ge(e){const t=[];for(const r in e){const n=e[r];if(typeof n!="string")continue;const i=nr(r);t.push(`${i}: ${n};`)}return t.join(" ")}const er=/-([a-z])/g,tr=/^--[a-zA-Z0-9-]+$/,be=e=>tr.test(e)?e:e.replace(er,(t,r)=>r?r.toUpperCase():""),rr=/\B([A-Z])/g,nr=e=>e.replace(rr,"-$1").toLowerCase();class W{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=A.ELEMENT_NODE,this.TEXT_NODE=A.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 ir(e){return class Bt extends e{constructor(){super(...arguments),this.nodeType=A.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(i=>i.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 i=r.RRNodeType;if((i===w.Element||i===w.DocumentType)&&this.childNodes.some(a=>a.RRNodeType===i))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${i===w.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(n===null)return this.appendChild(r);const s=this.childNodes.indexOf(n);if(s==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(s,0,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 i=this.createDocumentType("html",n,"");this.open(),this.appendChild(i)}}createDocument(r,n,i){return new Bt}createDocumentType(r,n,i){const s=new(Ye(W))(r,n,i);return s.ownerDocument=this,s}createElement(r){const n=new(ze(W))(r);return n.ownerDocument=this,n}createElementNS(r,n){return this.createElement(n)}createTextNode(r){const n=new(Xe(W))(r);return n.ownerDocument=this,n}createComment(r){const n=new(Qe(W))(r);return n.ownerDocument=this,n}createCDATASection(r){const n=new(Je(W))(r);return n.ownerDocument=this,n}toString(){return"RRDocument"}}}function Ye(e){return class extends e{constructor(t,r,n){super(),this.nodeType=A.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 ze(e){return class extends e{constructor(t){super(),this.nodeType=A.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 sr(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?Kt(this.attributes.style):{},r=/\B([A-Z])/g;return t.setProperty=(n,i,s)=>{if(r.test(n))return;const a=be(n);i?t[a]=i:delete t[a],s==="important"&&(t[a]+=" !important"),this.attributes.style=Ge(t)},t.removeProperty=n=>{if(r.test(n))return"";const i=be(n),s=t[i]||"";return delete t[i],this.attributes.style=Ge(t),s},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 or(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 Xe(e){return class extends e{constructor(t){super(),this.nodeType=A.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 Qe(e){return class extends e{constructor(t){super(),this.nodeType=A.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 Je(e){return class extends e{constructor(t){super(),this.nodeName="#cdata-section",this.nodeType=A.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 sr{constructor(t,r){if(this.classes=[],this.add=(...n)=>{for(const i of n){const s=String(i);this.classes.indexOf(s)>=0||this.classes.push(s)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...n)=>{this.classes=this.classes.filter(i=>n.indexOf(i)===-1),this.onChange&&this.onChange(this.classes.join(" "))},t){const n=t.trim().split(/\s+/);this.classes.push(...n)}this.onChange=r}}var A;(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"})(A||(A={}));const De={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"};function Y(e,t,r,n){const i=e.childNodes,s=t.childNodes;n=n||t.mirror||t.ownerDocument.mirror,(i.length>0||s.length>0)&&qe(Array.from(i),s,e,r,n);let a=null,l=null;switch(t.RRNodeType){case w.Document:{l=t.scrollData;break}case w.Element:{const c=e,o=t;switch(ar(c,o,n),l=o.scrollData,a=o.inputData,o.tagName){case"AUDIO":case"VIDEO":{const u=e,d=o;d.paused!==void 0&&(d.paused?u.pause():u.play()),d.muted!==void 0&&(u.muted=d.muted),d.volume!==void 0&&(u.volume=d.volume),d.currentTime!==void 0&&(u.currentTime=d.currentTime);break}case"CANVAS":t.canvasMutations.forEach(u=>r.applyCanvas(u.event,u.mutation,e));break;case"STYLE":cr(c,t.rules);break}if(o.shadowRoot){c.shadowRoot||c.attachShadow({mode:"open"});const u=c.shadowRoot.childNodes,d=o.shadowRoot.childNodes;(u.length>0||d.length>0)&&qe(Array.from(u),d,c.shadowRoot,r,n)}break}case w.Text:case w.Comment:case w.CDATA:e.textContent!==t.data&&(e.textContent=t.data);break}if(l&&r.applyScroll(l,!0),a&&r.applyInput(a),t.nodeName==="IFRAME"){const c=e.contentDocument,o=t;if(c){const u=n.getMeta(o.contentDocument);u&&r.mirror.add(c,Object.assign({},u)),Y(c,o.contentDocument,r,n)}}}function ar(e,t,r){const n=e.attributes,i=t.attributes;for(const s in i){const a=i[s],l=r.getMeta(t);if(l&&"isSVG"in l&&l.isSVG&&De[s])e.setAttributeNS(De[s],s,a);else if(t.tagName==="CANVAS"&&s==="rr_dataURL"){const c=document.createElement("img");c.src=a,c.onload=()=>{const o=e.getContext("2d");o&&o.drawImage(c,0,0,c.width,c.height)}}else e.setAttribute(s,a)}for(const{name:s}of Array.from(n))s in i||e.removeAttribute(s);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function qe(e,t,r,n,i){var s;let a=0,l=e.length-1,c=0,o=t.length-1,u=e[a],d=e[l],h=t[c],f=t[o],T,v;for(;a<=l&&c<=o;){const E=n.mirror.getId(u),p=n.mirror.getId(d),y=i.getId(h),N=i.getId(f);if(u===void 0)u=e[++a];else if(d===void 0)d=e[--l];else if(E!==-1&&E===y)Y(u,h,n,i),u=e[++a],h=t[++c];else if(p!==-1&&p===N)Y(d,f,n,i),d=e[--l],f=t[--o];else if(E!==-1&&E===N)r.insertBefore(u,d.nextSibling),Y(u,f,n,i),u=e[++a],f=t[--o];else if(p!==-1&&p===y)r.insertBefore(d,u),Y(d,h,n,i),d=e[--l],h=t[++c];else{if(!T){T={};for(let D=a;D<=l;D++){const O=e[D];O&&n.mirror.hasNode(O)&&(T[n.mirror.getId(O)]=D)}}if(v=T[i.getId(h)],v){const D=e[v];r.insertBefore(D,u),Y(D,h,n,i),e[v]=void 0}else{const D=Ce(h,n.mirror,i);r.nodeName==="#document"&&((s=n.mirror.getMeta(D))===null||s===void 0?void 0:s.type)===w.Element&&r.documentElement&&(r.removeChild(r.documentElement),e[a]=void 0,u=void 0),r.insertBefore(D,u||null),Y(D,h,n,i)}h=t[++c]}}if(a>l){const E=t[o+1];let p=null;for(E&&r.childNodes.forEach(y=>{n.mirror.getId(y)===i.getId(E)&&(p=y)});c<=o;++c){const y=Ce(t[c],n.mirror,i);r.insertBefore(y,p),Y(y,t[c],n,i)}}else if(c>o)for(;a<=l;a++){const E=e[a];E&&(r.removeChild(E),n.mirror.removeNodeFromMap(E))}}function Ce(e,t,r){const n=r.getId(e),i=r.getMeta(e);let s=null;if(n>-1&&(s=t.getNode(n)),s!==null)return s;switch(e.RRNodeType){case w.Document:s=new Document;break;case w.DocumentType:s=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case w.Element:{e.tagName.toLowerCase(),i&&"isSVG"in i&&i?.isSVG?s=document.createElementNS(De.svg,e.tagName.toLowerCase()):s=document.createElement(e.tagName);break}case w.Text:s=document.createTextNode(e.data);break;case w.Comment:s=document.createComment(e.data);break;case w.CDATA:s=document.createCDATASection(e.data);break}return i&&t.add(s,Object.assign({},i)),s}function le(e,t){const r=e[t[0]];return t.length===1?r:le(r.cssRules[t[1]].cssRules,t.slice(2))}var j;(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"})(j||(j={}));function Ze(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function cr(e,t){const r=e.sheet;t.forEach(n=>{if(n.type===j.Insert)try{if(Array.isArray(n.index)){const{positions:i,index:s}=Ze(n.index);le(r.cssRules,i).insertRule(n.cssText,s)}else r.insertRule(n.cssText,n.index)}catch{}else if(n.type===j.Remove)try{if(Array.isArray(n.index)){const{positions:i,index:s}=Ze(n.index);le(r.cssRules,i).deleteRule(s||0)}else r.deleteRule(n.index)}catch{}else n.type===j.SetProperty?le(r.cssRules,n.index).style.setProperty(n.property,n.value,n.priority):n.type===j.RemoveProperty&&le(r.cssRules,n.index).style.removeProperty(n.property)})}class ie extends ir(W){constructor(t){super(),this._unserializedId=-1,this.mirror=Tr(),this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,r,n){return new ie}createDocumentType(t,r,n){const i=new lr(t,r,n);return i.ownerDocument=this,i}createElement(t){const r=t.toUpperCase();let n;switch(r){case"AUDIO":case"VIDEO":n=new ur(r);break;case"IFRAME":n=new mr(r,this.mirror);break;case"CANVAS":n=new dr(r);break;case"STYLE":n=new hr(r);break;default:n=new ue(r);break}return n.ownerDocument=this,n}createComment(t){const r=new fr(t);return r.ownerDocument=this,r}createCDATASection(t){const r=new vr(t);return r.ownerDocument=this,r}createTextNode(t){const r=new pr(t);return r.ownerDocument=this,r}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=-1}}const lr=Ye(W);class ue extends ze(W){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class ur extends or(ue){}class dr extends ue{constructor(){super(...arguments),this.canvasMutations=[]}getContext(){return null}}class hr extends ue{constructor(){super(...arguments),this.rules=[]}}class mr extends ue{constructor(t,r){super(t),this.contentDocument=new ie,this.contentDocument.mirror=r}}const pr=Xe(W),fr=Qe(W),vr=Je(W);function gr(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function Ke(e,t,r,n){let i;switch(e.nodeType){case A.DOCUMENT_NODE:n&&n.nodeName==="IFRAME"?i=n.contentDocument:(i=t,i.compatMode=e.compatMode);break;case A.DOCUMENT_TYPE_NODE:const a=e;i=t.createDocumentType(a.name,a.publicId,a.systemId);break;case A.ELEMENT_NODE:const l=e,c=gr(l);i=t.createElement(c);const o=i;for(const{name:u,value:d}of Array.from(l.attributes))o.attributes[u]=d;l.scrollLeft&&(o.scrollLeft=l.scrollLeft),l.scrollTop&&(o.scrollTop=l.scrollTop);break;case A.TEXT_NODE:i=t.createTextNode(e.textContent||"");break;case A.CDATA_SECTION_NODE:i=t.createCDATASection(e.data);break;case A.COMMENT_NODE:i=t.createComment(e.textContent||"");break;case A.DOCUMENT_FRAGMENT_NODE:i=n.attachShadow({mode:"open"});break;default:return null}let s=r.getMeta(e);return t instanceof ie&&(s||(s=et(i,t.unserializedId),r.add(e,s)),t.mirror.add(i,Object.assign({},s))),i}function yr(e,t=Zt(),r=new ie){function n(i,s){const a=Ke(i,r,t,s);a!==null&&(s?.nodeName!=="IFRAME"&&i.nodeType!==A.DOCUMENT_FRAGMENT_NODE&&(s?.appendChild(a),a.parentNode=s,a.parentElement=s),i.nodeName==="IFRAME"?n(i.contentDocument,a):(i.nodeType===A.DOCUMENT_NODE||i.nodeType===A.ELEMENT_NODE||i.nodeType===A.DOCUMENT_FRAGMENT_NODE)&&(i.nodeType===A.ELEMENT_NODE&&i.shadowRoot&&n(i.shadowRoot,a),i.childNodes.forEach(l=>n(l,a))))}return n(e,null),r}function Tr(){return new Er}class Er{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 et(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 tt(e){return e=e||Object.create(null),{on:function(r,n){(e[r]||(e[r]=[])).push(n)},off:function(r,n){e[r]&&e[r].splice(e[r].indexOf(n)>>>0,1)},emit:function(r,n){(e[r]||[]).slice().map(function(i){i(n)}),(e["*"]||[]).slice().map(function(i){i(r,n)})}}}var Nr=Object.freeze({__proto__:null,default:tt});function wr(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const r=e.HTMLElement||e.Element,n=468,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||c,scrollIntoView:r.prototype.scrollIntoView},s=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function a(p){const y=["MSIE ","Trident/","Edge/"];return new RegExp(y.join("|")).test(p)}const l=a(e.navigator.userAgent)?1:0;function c(p,y){this.scrollLeft=p,this.scrollTop=y}function o(p){return .5*(1-Math.cos(Math.PI*p))}function u(p){if(p===null||typeof p!="object"||p.behavior===void 0||p.behavior==="auto"||p.behavior==="instant")return!0;if(typeof p=="object"&&p.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+p.behavior+" is not a valid value for enumeration ScrollBehavior.")}function d(p,y){if(y==="Y")return p.clientHeight+l<p.scrollHeight;if(y==="X")return p.clientWidth+l<p.scrollWidth}function h(p,y){const N=e.getComputedStyle(p,null)["overflow"+y];return N==="auto"||N==="scroll"}function f(p){const y=d(p,"Y")&&h(p,"Y"),N=d(p,"X")&&h(p,"X");return y||N}function T(p){for(;p!==t.body&&f(p)===!1;)p=p.parentNode||p.host;return p}function v(p){const y=s();let N,D,O,R=(y-p.startTime)/n;R=R>1?1:R,N=o(R),D=p.startX+(p.x-p.startX)*N,O=p.startY+(p.y-p.startY)*N,p.method.call(p.scrollable,D,O),(D!==p.x||O!==p.y)&&e.requestAnimationFrame(v.bind(e,p))}function E(p,y,N){let D,O,R,$;const k=s();p===t.body?(D=e,O=e.scrollX||e.pageXOffset,R=e.scrollY||e.pageYOffset,$=i.scroll):(D=p,O=p.scrollLeft,R=p.scrollTop,$=c),v({scrollable:D,method:$,startTime:k,startX:O,startY:R,x:y,y:N})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){i.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}E.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])){i.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}E.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");i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const p=arguments[0].left,y=arguments[0].top;E.call(this,this,typeof p>"u"?this.scrollLeft:~~p,typeof y>"u"?this.scrollTop:~~y)},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){i.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){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const p=T(this),y=p.getBoundingClientRect(),N=this.getBoundingClientRect();p!==t.body?(E.call(this,p,p.scrollLeft+N.left-y.left,p.scrollTop+N.top-y.top),e.getComputedStyle(p).position!=="fixed"&&e.scrollBy({left:y.left,top:y.top,behavior:"smooth"})):e.scrollBy({left:N.left,top:N.top,behavior:"smooth"})}}var x=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(x||{}),I=(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))(I||{}),U=(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))(U||{}),ge=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ge||{}),Se=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(Se||{}),C=(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))(C||{});class br{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=this;function i(){const s=performance.now();for(n.timeOffset+=(s-t)*n.speed,t=s;r.length;){const a=r[0];if(n.timeOffset>=a.delay)r.shift(),a.doAction();else break}(r.length>0||n.liveMode)&&(n.raf=requestAnimationFrame(i))}this.raf=requestAnimationFrame(i)}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 i=Math.floor((r+n)/2);if(this.actions[i].delay<t.delay)r=i+1;else if(this.actions[i].delay>t.delay)n=i-1;else return i+1}return r}}function Me(e,t){if(e.type===x.IncrementalSnapshot&&e.data.source===I.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}/*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
5
5
  Permission to use, copy, modify, and/or distribute this software for any
@@ -12,6 +12,6 @@ var rrwebReplay=function(fe){"use strict";var _;(function(e){e[e.Document=0]="Do
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function rt(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(n=s.next()).done;)a.push(n.value)}catch(l){i={error:l}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return a}var oe;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(oe||(oe={}));var nt={type:"xstate.init"};function xe(e){return e===void 0?[]:[].concat(e)}function te(e){return{type:"xstate.assign",assignment:e}}function it(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 ye(e){return function(t){return e===t}}function ot(e){return typeof e=="string"?{type:e}:e}function st(e,t){return{value:e,context:t,actions:[],changed:!1,matches:ye(e)}}function at(e,t,r){var n=t,i=!1;return[e.filter(function(s){if(s.type==="xstate.assign"){i=!0;var a=Object.assign({},n);return typeof s.assignment=="function"?a=s.assignment(n,r):Object.keys(s.assignment).forEach(function(l){a[l]=typeof s.assignment[l]=="function"?s.assignment[l](n,r):s.assignment[l]}),n=a,!1}return!0}),n,i]}function ct(e,t){t===void 0&&(t={});var r=rt(at(xe(e.states[e.initial].entry).map(function(a){return it(a,t.actions)}),e.context,nt),2),n=r[0],i=r[1],s={config:e,_options:t,initialState:{value:e.initial,actions:n,context:i,matches:ye(e.initial)},transition:function(a,l){var c,o,u=typeof a=="string"?{value:a,context:e.context}:a,d=u.value,h=u.context,f=ot(l),T=e.states[d];if(T.on){var v=xe(T.on[f.type]);try{for(var y=function(k){var ne=typeof Symbol=="function"&&Symbol.iterator,g=ne&&k[ne],m=0;if(g)return g.call(k);if(k&&typeof k.length=="number")return{next:function(){return k&&m>=k.length&&(k=void 0),{value:k&&k[m++],done:!k}}};throw new TypeError(ne?"Object is not iterable.":"Symbol.iterator is not defined.")}(v),p=y.next();!p.done;p=y.next()){var E=p.value;if(E===void 0)return st(d,h);var b=typeof E=="string"?{target:E}:E,I=b.target,F=b.actions,x=F===void 0?[]:F,$=b.cond,O=$===void 0?function(){return!0}:$,L=I===void 0,re=I??d,z=e.states[re];if(O(h,f)){var Z=rt(at((L?xe(x):[].concat(T.exit,x,z.entry).filter(function(k){return k})).map(function(k){return it(k,s._options.actions)}),h,f),3),G=Z[0],K=Z[1],ce=Z[2],B=I??d;return{value:B,context:K,actions:G,changed:I!==d||G.length>0||ce,matches:ye(B)}}}}catch(k){c={error:k}}finally{try{p&&!p.done&&(o=y.return)&&o.call(y)}finally{if(c)throw c.error}}}return st(d,h)}};return s}var lt=function(e,t){return e.actions.forEach(function(r){var n=r.exec;return n&&n(e.context,t)})};function ut(e){var t=e.initialState,r=oe.NotStarted,n=new Set,i={_machine:e,send:function(s){r===oe.Running&&(t=e.transition(t,s),lt(t,ot(s)),n.forEach(function(a){return a(t)}))},subscribe:function(s){return n.add(s),s(t),{unsubscribe:function(){return n.delete(s)}}},start:function(s){if(s){var a=typeof s=="object"?s:{context:e.config.context,value:s};t={value:a.value,actions:[],context:a.context,matches:ye(a.value)}}return r=oe.Running,lt(t,nt),i},stop:function(){return r=oe.Stopped,n.clear(),i},get state(){return t},get status(){return r}};return i}var Dr=Object.defineProperty,Cr=Object.defineProperties,Sr=Object.getOwnPropertyDescriptors,dt=Object.getOwnPropertySymbols,Mr=Object.prototype.hasOwnProperty,xr=Object.prototype.propertyIsEnumerable,ht=(e,t,r)=>t in e?Dr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Te=(e,t)=>{for(var r in t||(t={}))Mr.call(t,r)&&ht(e,r,t[r]);if(dt)for(var r of dt(t))xr.call(t,r)&&ht(e,r,t[r]);return e},Ee=(e,t)=>Cr(e,Sr(t));function Rr(e,t){for(let r=e.length-1;r>=0;r--){const n=e[r];if(n.type===M.Meta&&n.timestamp<=t)return e.slice(r)}return e}function Ar(e,{getCastFn:t,applyEventsSynchronously:r,emitter:n}){const i=ct({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]},REPLACE_EVENTS:{target:"playing",actions:["replaceEvents"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]},REPLACE_EVENTS:{target:"paused",actions:["replaceEvents"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:te({lastPlayedEvent:(s,a)=>a.type==="CAST_EVENT"?a.payload.event:s.lastPlayedEvent}),recordTimeOffset:te((s,a)=>{let l=s.timeOffset;return"payload"in a&&"timeOffset"in a.payload&&(l=a.payload.timeOffset),Ee(Te({},s),{timeOffset:l,baselineTime:s.events[0].timestamp+l})}),play(s){var a;const{timer:l,events:c,baselineTime:o,lastPlayedEvent:u}=s;l.clear();for(const v of c)Me(v,o);const d=Rr(c,o);let h=u?.timestamp;u?.type===M.IncrementalSnapshot&&u.data.source===A.MouseMove&&(h=u.timestamp+((a=u.data.positions[0])==null?void 0:a.timeOffset)),o<(h||0)&&n.emit(D.PlayBack);const f=new Array,T=new Array;for(const v of d)if(!(h&&h<o&&(v.timestamp<=h||v===u)))if(v.timestamp<o)f.push(v);else{const y=t(v,!1);T.push({doAction:()=>{y()},delay:v.delay})}r(f),n.emit(D.Flush),l.addActions(T),l.start()},pause(s){s.timer.clear()},resetLastPlayedEvent:te(s=>Ee(Te({},s),{lastPlayedEvent:null})),startLive:te({baselineTime:(s,a)=>(s.timer.toggleLiveMode(!0),s.timer.start(),a.type==="TO_LIVE"&&a.payload.baselineTime?a.payload.baselineTime:Date.now())}),replaceEvents:te((s,a)=>{const{events:l,timer:c,baselineTime:o}=s;if(a.type==="REPLACE_EVENTS"){const{events:u}=a.payload;l.length=0;const d=[];for(const h of u)if(Me(h,o),l.push(h),h.timestamp>=c.timeOffset+o){const f=t(h,!1);d.push({doAction:()=>{f()},delay:h.delay})}c.isActive()&&c.replaceActions(d)}return Ee(Te({},s),{events:l})}),addEvent:te((s,a)=>{const{baselineTime:l,timer:c,events:o}=s;if(a.type==="ADD_EVENT"){const{event:u}=a.payload;Me(u,l);let d=o.length-1;if(!o[d]||o[d].timestamp<=u.timestamp)o.push(u);else{let T=-1,v=0;for(;v<=d;){const y=Math.floor((v+d)/2);o[y].timestamp<=u.timestamp?v=y+1:d=y-1}T===-1&&(T=v),o.splice(T,0,u)}const h=u.timestamp<l,f=t(u,h);h?f():c.isActive()&&c.addAction({doAction:()=>{f()},delay:u.delay})}return Ee(Te({},s),{events:o})})}});return ut(i)}function Ir(e){const t=ct({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:te({normalSpeed:r=>r.timer.speed}),restoreSpeed:r=>{r.timer.setSpeed(r.normalSpeed)}}});return ut(t)}const se=`Please stop import mirror directly. Instead of that,\r
15
+ ***************************************************************************** */function rt(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(n=s.next()).done;)a.push(n.value)}catch(l){i={error:l}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return a}var oe;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(oe||(oe={}));var nt={type:"xstate.init"};function xe(e){return e===void 0?[]:[].concat(e)}function te(e){return{type:"xstate.assign",assignment:e}}function it(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 ye(e){return function(t){return e===t}}function ot(e){return typeof e=="string"?{type:e}:e}function st(e,t){return{value:e,context:t,actions:[],changed:!1,matches:ye(e)}}function at(e,t,r){var n=t,i=!1;return[e.filter(function(s){if(s.type==="xstate.assign"){i=!0;var a=Object.assign({},n);return typeof s.assignment=="function"?a=s.assignment(n,r):Object.keys(s.assignment).forEach(function(l){a[l]=typeof s.assignment[l]=="function"?s.assignment[l](n,r):s.assignment[l]}),n=a,!1}return!0}),n,i]}function ct(e,t){t===void 0&&(t={});var r=rt(at(xe(e.states[e.initial].entry).map(function(a){return it(a,t.actions)}),e.context,nt),2),n=r[0],i=r[1],s={config:e,_options:t,initialState:{value:e.initial,actions:n,context:i,matches:ye(e.initial)},transition:function(a,l){var c,o,u=typeof a=="string"?{value:a,context:e.context}:a,d=u.value,h=u.context,f=ot(l),T=e.states[d];if(T.on){var v=xe(T.on[f.type]);try{for(var E=function(_){var ne=typeof Symbol=="function"&&Symbol.iterator,g=ne&&_[ne],m=0;if(g)return g.call(_);if(_&&typeof _.length=="number")return{next:function(){return _&&m>=_.length&&(_=void 0),{value:_&&_[m++],done:!_}}};throw new TypeError(ne?"Object is not iterable.":"Symbol.iterator is not defined.")}(v),p=E.next();!p.done;p=E.next()){var y=p.value;if(y===void 0)return st(d,h);var N=typeof y=="string"?{target:y}:y,D=N.target,O=N.actions,R=O===void 0?[]:O,$=N.cond,k=$===void 0?function(){return!0}:$,F=D===void 0,re=D??d,z=e.states[re];if(k(h,f)){var Z=rt(at((F?xe(R):[].concat(T.exit,R,z.entry).filter(function(_){return _})).map(function(_){return it(_,s._options.actions)}),h,f),3),G=Z[0],K=Z[1],ce=Z[2],B=D??d;return{value:B,context:K,actions:G,changed:D!==d||G.length>0||ce,matches:ye(B)}}}}catch(_){c={error:_}}finally{try{p&&!p.done&&(o=E.return)&&o.call(E)}finally{if(c)throw c.error}}}return st(d,h)}};return s}var lt=function(e,t){return e.actions.forEach(function(r){var n=r.exec;return n&&n(e.context,t)})};function ut(e){var t=e.initialState,r=oe.NotStarted,n=new Set,i={_machine:e,send:function(s){r===oe.Running&&(t=e.transition(t,s),lt(t,ot(s)),n.forEach(function(a){return a(t)}))},subscribe:function(s){return n.add(s),s(t),{unsubscribe:function(){return n.delete(s)}}},start:function(s){if(s){var a=typeof s=="object"?s:{context:e.config.context,value:s};t={value:a.value,actions:[],context:a.context,matches:ye(a.value)}}return r=oe.Running,lt(t,nt),i},stop:function(){return r=oe.Stopped,n.clear(),i},get state(){return t},get status(){return r}};return i}var Dr=Object.defineProperty,Cr=Object.defineProperties,Sr=Object.getOwnPropertyDescriptors,dt=Object.getOwnPropertySymbols,Mr=Object.prototype.hasOwnProperty,xr=Object.prototype.propertyIsEnumerable,ht=(e,t,r)=>t in e?Dr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Te=(e,t)=>{for(var r in t||(t={}))Mr.call(t,r)&&ht(e,r,t[r]);if(dt)for(var r of dt(t))xr.call(t,r)&&ht(e,r,t[r]);return e},Ee=(e,t)=>Cr(e,Sr(t));function Rr(e,t){for(let r=e.length-1;r>=0;r--){const n=e[r];if(n.type===x.Meta&&n.timestamp<=t)return e.slice(r)}return e}function Ar(e,{getCastFn:t,applyEventsSynchronously:r,emitter:n}){const i=ct({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]},REPLACE_EVENTS:{target:"playing",actions:["replaceEvents"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]},REPLACE_EVENTS:{target:"paused",actions:["replaceEvents"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:te({lastPlayedEvent:(s,a)=>a.type==="CAST_EVENT"?a.payload.event:s.lastPlayedEvent}),recordTimeOffset:te((s,a)=>{let l=s.timeOffset;return"payload"in a&&"timeOffset"in a.payload&&(l=a.payload.timeOffset),Ee(Te({},s),{timeOffset:l,baselineTime:s.events[0].timestamp+l})}),play(s){var a;const{timer:l,events:c,baselineTime:o,lastPlayedEvent:u}=s;l.clear();for(const v of c)Me(v,o);const d=Rr(c,o);let h=u?.timestamp;u?.type===x.IncrementalSnapshot&&u.data.source===I.MouseMove&&(h=u.timestamp+((a=u.data.positions[0])==null?void 0:a.timeOffset)),o<(h||0)&&n.emit(C.PlayBack);const f=new Array,T=new Array;for(const v of d)if(!(h&&h<o&&(v.timestamp<=h||v===u)))if(v.timestamp<o)f.push(v);else{const E=t(v,!1);T.push({doAction:()=>{E()},delay:v.delay})}r(f),n.emit(C.Flush),l.addActions(T),l.start()},pause(s){s.timer.clear()},resetLastPlayedEvent:te(s=>Ee(Te({},s),{lastPlayedEvent:null})),startLive:te({baselineTime:(s,a)=>(s.timer.toggleLiveMode(!0),s.timer.start(),a.type==="TO_LIVE"&&a.payload.baselineTime?a.payload.baselineTime:Date.now())}),replaceEvents:te((s,a)=>{const{events:l,timer:c,baselineTime:o}=s;if(a.type==="REPLACE_EVENTS"){const{events:u}=a.payload;l.length=0;const d=[];for(const h of u)if(Me(h,o),l.push(h),h.timestamp>=c.timeOffset+o){const f=t(h,!1);d.push({doAction:()=>{f()},delay:h.delay})}c.isActive()&&c.replaceActions(d)}return Ee(Te({},s),{events:l})}),addEvent:te((s,a)=>{const{baselineTime:l,timer:c,events:o}=s;if(a.type==="ADD_EVENT"){const{event:u}=a.payload;Me(u,l);let d=o.length-1;if(!o[d]||o[d].timestamp<=u.timestamp)o.push(u);else{let T=-1,v=0;for(;v<=d;){const E=Math.floor((v+d)/2);o[E].timestamp<=u.timestamp?v=E+1:d=E-1}T===-1&&(T=v),o.splice(T,0,u)}const h=u.timestamp<l,f=t(u,h);h?f():c.isActive()&&c.addAction({doAction:()=>{f()},delay:u.delay})}return Ee(Te({},s),{events:o})})}});return ut(i)}function Ir(e){const t=ct({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:te({normalSpeed:r=>r.timer.speed}),restoreSpeed:r=>{r.timer.setSpeed(r.normalSpeed)}}});return ut(t)}const se=`Please stop import mirror directly. Instead of that,\r
16
16
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
17
- or you can use record.mirror to access the mirror instance during recording.`;let mt={map:{},getId(){return console.error(se),-1},getNode(){return console.error(se),null},removeNodeFromMap(){console.error(se)},has(){return console.error(se),!1},reset(){console.error(se)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(mt=new Proxy(mt,{get(e,t,r){return t==="map"&&console.error(se),Reflect.get(e,t,r)}}));function Or(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(t){if(!(0 in arguments))throw new TypeError("1 argument is required");do if(this===t)return!0;while(t=t&&t.parentNode);return!1})}function kr(e){const t={},r=(i,s)=>{const a={value:i,parent:s,children:[]};return t[i.node.id]=a,a},n=[];for(const i of e){const{nextId:s,parentId:a}=i;if(s&&s in t){const l=t[s];if(l.parent){const c=l.parent.children.indexOf(l);l.parent.children.splice(c,0,r(i,l.parent))}else{const c=n.indexOf(l);n.splice(c,0,r(i,null))}continue}if(a in t){const l=t[a];l.children.push(r(i,l));continue}n.push(r(i,null))}return n}function pt(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)pt(e.children[r],t)}function Re(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function ft(e,t){var r,n;const i=(n=(r=e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:n.frameElement;if(!i||i===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=i.getBoundingClientRect(),a=ft(i,t),l=s.height/i.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}}function vt(e){return Boolean(e?.shadowRoot)}function de(e,t){const r=e[t[0]];return t.length===1?r:de(r.cssRules[t[1]].cssRules,t.slice(2))}function gt(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function _r(e){const t=new Set,r=[];for(let n=e.length;n--;){const i=e[n];t.has(i.id)||(r.push(i),t.add(i.id))}return r}const Lr=e=>[`.${e} { background: currentColor }`,"noscript { display: none !important; }",`.${e} { background: currentColor; border-radius: 5px; }`,`.${e}:hover::after {content: 'Redacted'; color: white; background: black; text-align: center; width: 100%; display: block;}`];for(var yt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",he=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ne=0;Ne<yt.length;Ne++)he[yt.charCodeAt(Ne)]=Ne;var Fr=function(e){var t=e.length*.75,r=e.length,n,i=0,s,a,l,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var o=new ArrayBuffer(t),u=new Uint8Array(o);for(n=0;n<r;n+=4)s=he[e.charCodeAt(n)],a=he[e.charCodeAt(n+1)],l=he[e.charCodeAt(n+2)],c=he[e.charCodeAt(n+3)],u[i++]=s<<2|a>>4,u[i++]=(a&15)<<4|l>>2,u[i++]=(l&3)<<6|c&63;return o},Pr=(e,t,r)=>new Promise((n,i)=>{var s=c=>{try{l(r.next(c))}catch(o){i(o)}},a=c=>{try{l(r.throw(c))}catch(o){i(o)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);l((r=r.apply(e,t)).next())});const Tt=new Map;function Et(e,t){let r=Tt.get(e);return r||(r=new Map,Tt.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function Q(e,t,r){return n=>Pr(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 i=yield Q(e,t,r)(n.args);return yield createImageBitmap.apply(null,i)}else if("index"in n){if(r||t===null)return n;const{rr_type:i,index:s}=n;return Et(t,i)[s]}else if("args"in n){const{rr_type:i,args:s}=n,a=window[i];return new a(...yield Promise.all(s.map(Q(e,t,r))))}else{if("base64"in n)return Fr(n.base64);if("src"in n){const i=e.get(n.src);if(i)return i;{const s=new Image;return s.src=n.src,e.set(n.src,s),s}}else if("data"in n&&n.rr_type==="Blob"){const i=yield Promise.all(n.data.map(Q(e,t,r)));return new Blob(i,{type:n.type})}}else if(Array.isArray(n))return yield Promise.all(n.map(Q(e,t,r)));return n})}var Ur=(e,t,r)=>new Promise((n,i)=>{var s=c=>{try{l(r.next(c))}catch(o){i(o)}},a=c=>{try{l(r.throw(c))}catch(o){i(o)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);l((r=r.apply(e,t)).next())});function $r(e,t){try{return t===ge.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}const Br=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Vr(e,t){if(!(t!=null&&t.constructor))return;const{name:r}=t.constructor;if(!Br.includes(r))return;const n=Et(e,r);n.includes(t)||n.push(t)}function Wr(e){return Ur(this,arguments,function*({mutation:t,target:r,type:n,imageMap:i,errorHandler:s}){try{const a=$r(r,n);if(!a)return;if(t.setter){a[t.property]=t.args[0];return}const l=a[t.property],c=yield Promise.all(t.args.map(Q(i,a))),o=l.apply(a,c);Vr(a,o)}catch(a){s(t,a)}})}var jr=(e,t,r)=>new Promise((n,i)=>{var s=c=>{try{l(r.next(c))}catch(o){i(o)}},a=c=>{try{l(r.throw(c))}catch(o){i(o)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);l((r=r.apply(e,t)).next())});function Hr(e){return jr(this,arguments,function*({event:t,mutation:r,target:n,imageMap:i,errorHandler:s}){try{const a=n.getContext("2d");if(r.setter){a[r.property]=r.args[0];return}const l=a[r.property];if(r.property==="drawImage"&&typeof r.args[0]=="string"){const c=i.get(t);l.apply(a,r.args)}else{const c=yield Promise.all(r.args.map(Q(i,a)));l.apply(a,c)}}catch(a){s(r,a)}})}var Gr=(e,t,r)=>new Promise((n,i)=>{var s=c=>{try{l(r.next(c))}catch(o){i(o)}},a=c=>{try{l(r.throw(c))}catch(o){i(o)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);l((r=r.apply(e,t)).next())});function Nt(e){return Gr(this,arguments,function*({event:t,mutation:r,target:n,imageMap:i,canvasEventMap:s,errorHandler:a}){try{const l=s.get(t)||r,c="commands"in l?l.commands:[l];if([ge.WebGL,ge.WebGL2].includes(r.type)){for(let o=0;o<c.length;o++){const u=c[o];yield Wr({mutation:u,type:r.type,target:n,imageMap:i,errorHandler:a})}return}for(let o=0;o<c.length;o++){const u=c[o];yield Hr({event:t,mutation:u,target:n,imageMap:i,errorHandler:a})}}catch(l){a(r,l)}})}var Yr=Object.defineProperty,zr=Object.defineProperties,Xr=Object.getOwnPropertyDescriptors,wt=Object.getOwnPropertySymbols,Qr=Object.prototype.hasOwnProperty,Jr=Object.prototype.propertyIsEnumerable,bt=(e,t,r)=>t in e?Yr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ae=(e,t)=>{for(var r in t||(t={}))Qr.call(t,r)&&bt(e,r,t[r]);if(wt)for(var r of wt(t))Jr.call(t,r)&&bt(e,r,t[r]);return e},Ae=(e,t)=>zr(e,Xr(t)),Ie=(e,t,r)=>new Promise((n,i)=>{var s=c=>{try{l(r.next(c))}catch(o){i(o)}},a=c=>{try{l(r.throw(c))}catch(o){i(o)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);l((r=r.apply(e,t)).next())});const Dt=10*1e3,Ct=2*1e3,St=1*1e3,Mt=60*60*1e3,qr=tt||Nr,Oe="[replayer]",ke={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function _e(e){return e.type==M.IncrementalSnapshot&&(e.data.source==A.TouchMove||e.data.source==A.MouseInteraction&&e.data.type==U.TouchStart)}class Zr{constructor(t,r){if(this.usingVirtualDom=!1,this.virtualDom=new ie,this.mouseTail=null,this.tailPositions=[],this.emitter=qr(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=He(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=Wt(),this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,!(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:ke,useVirtualDom:!0,inactiveThreshold:.02,inactiveSkipTime:Ct};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(D.Resize,this.handleResize),this.setupDom(),this.emitter.on(D.Flush,()=>{if(this.usingVirtualDom){const l={mirror:this.mirror,applyCanvas:(c,o,u)=>{Nt({event:c,mutation:o,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this)};if(Y(this.iframe.contentDocument,this.virtualDom,l,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const c in this.legacy_missingNodeRetryMap)try{const o=this.legacy_missingNodeRetryMap[c],u=Ce(o.node,this.mirror,this.virtualDom.mirror);Y(u,o.node,l,this.virtualDom.mirror),o.node=u}catch(o){this.config.showWarning&&console.warn(o)}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null}),this.emitter.on(D.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset()});const i=new br([],r?.speed||n.speed);this.service=Ar({events:t.map(l=>r&&r.unpackFn?r.unpackFn(l):l).sort((l,c)=>l.timestamp-c.timestamp),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(l=>{this.emitter.emit(D.StateChange,{player:l})}),this.speedService=Ir({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(l=>{this.emitter.emit(D.StateChange,{speed:l})});const s=this.service.state.context.events.find(l=>l.type===M.Meta),a=this.service.state.context.events.find(l=>l.type===M.FullSnapshot);if(s){const{width:l,height:c}=s.data;setTimeout(()=>{this.emitter.emit(D.Resize,{width:l,height:c})},0)}a&&setTimeout(()=>{this.firstFullSnapshot||(this.firstFullSnapshot=a,this.rebuildFullSnapshot(a),this.iframe.contentWindow.scrollTo(a.data.initialOffset))},1),this.service.state.context.events.find(_e)&&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=>{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(a=>this.isUserInteraction(a)),{timestamp:r.endTime}];for(let a=1;a<n.length;a++){const l=n[a-1],c=n[a];c.timestamp-l.timestamp>Dt?t.push({startTime:l.timestamp,endTime:c.timestamp,duration:c.timestamp-l.timestamp,active:!1}):t.push({startTime:l.timestamp,endTime:c.timestamp,duration:c.timestamp-l.timestamp,active:!0})}const i=[];let s=t[0];for(let a=1;a<t.length;a++)t[a].active!=t[a-1].active&&(i.push({startTime:s.startTime,endTime:t[a-1].endTime,duration:t[a-1].endTime-s.startTime,active:t[a-1].active}),s=t[a]);s&&t.length>0&&i.push({startTime:s.startTime,endTime:t[t.length-1].endTime,duration:t[t.length-1].endTime-s.startTime,active:t[t.length-1].active}),s=i[0];for(let a=1;a<i.length;a++)(!i[a].active&&i[a].duration>this.config.inactiveThreshold*r.totalTime||!i[a-1].active&&i[a-1].duration>this.config.inactiveThreshold*r.totalTime)&&(this.activityIntervals.push({startTime:s.startTime,endTime:i[a-1].endTime,duration:i[a-1].endTime-s.startTime,active:i[a-1].active}),s=i[a]);s&&i.length>0&&this.activityIntervals.push({startTime:s.startTime,endTime:i[i.length-1].endTime,duration:i[i.length-1].endTime-s.startTime,active:i[i.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(D.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(D.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(D.Resume)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const r=this.config.unpackFn?this.config.unpackFn(t):t;_e(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(_e(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=He()}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&&(wr(this.iframe.contentWindow,this.iframe.contentDocument),Or(this.iframe.contentWindow))}handleResize(t){this.iframe.style.display="inherit";for(const r of[this.mouseTail,this.iframe])!r||(r.setAttribute("width",String(t.width)),r.setAttribute("height",String(t.height)))}applyEventsSynchronously(t){for(const r of t){switch(r.type){case M.DomContentLoaded:case M.Load:case M.Custom:continue;case M.FullSnapshot:case M.Meta:case M.Plugin:case M.IncrementalSnapshot:break}this.getCastFn(r,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null}getCastFn(t,r=!1){let n;switch(t.type){case M.DomContentLoaded:case M.Load:break;case M.Custom:n=()=>{this.emitter.emit(D.CustomEvent,t)};break;case M.Meta:n=()=>this.emitter.emit(D.Resize,{width:t.data.width,height:t.data.height});break;case M.FullSnapshot:n=()=>{if(this.firstFullSnapshot){if(this.firstFullSnapshot===t){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(t,r),this.iframe.contentWindow.scrollTo(t.data.initialOffset)};break;case M.IncrementalSnapshot:n=()=>{if(this.applyIncremental(t,r),!r&&(this.handleInactivity(t.timestamp),t===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const i of this.service.state.context.events)if(!(i.timestamp<=t.timestamp)&&this.isUserInteraction(i)){i.delay-t.delay>Dt*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=i);break}if(this.nextUserInteractionEvent){const i=this.nextUserInteractionEvent.delay-t.delay,s={speed:Math.min(Math.round(i/Ct),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:s}),this.emitter.emit(D.SkipStart,s)}}};break}return()=>{n&&n();for(const s of this.config.plugins||[])s.handler(t,r,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:t}});const i=this.service.state.context.events.length-1;if(t===this.service.state.context.events[i]){const s=()=>{i<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(D.Finish))};t.type===M.IncrementalSnapshot&&t.data.source===A.MouseMove&&t.data.positions.length?setTimeout(()=>{s()},Math.max(0,-t.data.positions[0].timeOffset+50)):s()}this.emitter.emit(D.EventCast,t)}}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,i={speed:n/Mt*this.config.inactiveSkipTime<St?n/St:Math.round(Math.max(n,Mt)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:i}),this.emitter.emit(D.SkipStart,i)}}}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=[];Jt(t.data.node,{doc:this.iframe.contentDocument,afterAppend:a=>{this.collectIframeAndAttachDocument(n,a)},cache:this.cache,mirror:this.mirror});for(const{mutationInQueue:a,builtNode:l}of n)this.attachDocumentToIframe(a,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==a);const{documentElement:i,head:s}=this.iframe.contentDocument;this.insertStyleRules(i,s),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(D.FullsnapshotRebuilded,t),r||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,r){const n=Lr(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 i=this.virtualDom.createElement("style");this.virtualDom.mirror.add(i,et(i,this.virtualDom.unserializedId)),t.insertBefore(i,r);for(let s=0;s<n.length;s++)i.rules.push({cssText:n[s],type:j.Insert,index:s})}else{const i=document.createElement("style");t.insertBefore(i,r);for(let s=0;s<n.length;s++)i.sheet.insertRule(n[s],s)}}attachDocumentToIframe(t,r){const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[];ve(t.node,{doc:r.contentDocument,mirror:n,hackCss:!0,skipChild:!1,afterAppend:s=>{this.collectIframeAndAttachDocument(i,s);const a=n.getMeta(s);if(a?.type===_.Element&&a?.tagName.toUpperCase()==="HTML"){const{documentElement:l,head:c}=r.contentDocument;this.insertStyleRules(l,c)}},cache:this.cache});for(const{mutationInQueue:s,builtNode:a}of i)this.attachDocumentToIframe(s,a),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==s)}collectIframeAndAttachDocument(t,r){if(Re(r,this.mirror)){const n=this.newDocumentQueue.find(i=>i.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 i,s=this.service.state;const a=()=>{s=this.service.state};this.emitter.on(D.Start,a),this.emitter.on(D.Pause,a);const l=()=>{this.emitter.off(D.Start,a),this.emitter.off(D.Pause,a)};r.querySelectorAll('link[rel="stylesheet"]').forEach(c=>{c.sheet||(n.add(c),c.addEventListener("load",()=>{n.delete(c),n.size===0&&i!==-1&&(s.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(D.LoadStylesheetEnd),i&&clearTimeout(i),l())}))}),n.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(D.LoadStylesheetStart),i=setTimeout(()=>{s.matches("playing")&&this.play(this.getCurrentTime()),i=-1,l()},this.config.loadTimeout))}}hasImageArg(t){for(const r of t)if(!(!r||typeof r!="object")){if("rr_type"in r&&"args"in r){if(this.hasImageArg(r.args))return!0}else if("rr_type"in r&&r.rr_type==="HTMLImageElement"||r instanceof Array&&this.hasImageArg(r))return!0}return!1}getImageArgs(t){const r=[];for(const n of t)!n||typeof n!="object"||("rr_type"in n&&"args"in n?r.push(...this.getImageArgs(n.args)):"rr_type"in n&&n.rr_type==="HTMLImageElement"?r.push(n.src):n instanceof Array&&r.push(...this.getImageArgs(n)));return r}preloadAllImages(){return Ie(this,null,function*(){this.service.state;const t=()=>{this.service.state};this.emitter.on(D.Start,t),this.emitter.on(D.Pause,t);const r=[];for(const n of this.service.state.context.events)n.type===M.IncrementalSnapshot&&n.data.source===A.CanvasMutation&&(r.push(this.deserializeAndPreloadCanvasEvents(n.data,n)),("commands"in n.data?n.data.commands:[n.data]).forEach(i=>{this.preloadImages(i,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"),i=n.getContext("2d"),s=i?.createImageData(n.width,n.height);s?.data,JSON.parse(t.args[0]),i?.putImageData(s,0,0)}}deserializeAndPreloadCanvasEvents(t,r){return Ie(this,null,function*(){if(!this.canvasEventMap.has(r)){const n={isUnchanged:!0};if("commands"in t){const i=yield Promise.all(t.commands.map(s=>Ie(this,null,function*(){const a=yield Promise.all(s.args.map(Q(this.imageMap,null,n)));return Ae(ae({},s),{args:a})})));n.isUnchanged===!1&&this.canvasEventMap.set(r,Ae(ae({},t),{commands:i}))}else{const i=yield Promise.all(t.args.map(Q(this.imageMap,null,n)));n.isUnchanged===!1&&this.canvasEventMap.set(r,Ae(ae({},t),{args:i}))}}})}applyIncremental(t,r){var n,i,s,a,l,c;const{data:o}=t;switch(o.source){case A.Mutation:{try{this.applyMutation(o,r)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,o)}break}case A.Drag:case A.TouchMove:case A.MouseMove:if(r){const u=o.positions[o.positions.length-1];this.mousePos={x:u.x,y:u.y,id:u.id,debugData:o}}else o.positions.forEach(u=>{const d={doAction:()=>{this.moveAndHover(u.x,u.y,u.id,r,o)},delay:u.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(d)}),this.timer.addAction({doAction(){},delay:t.delay-((n=o.positions[0])==null?void 0:n.timeOffset)});break;case A.MouseInteraction:{if(o.id===-1||r)break;const u=new Event(U[o.type].toLowerCase()),d=this.mirror.getNode(o.id);if(!d)return this.debugNodeNotFound(o,o.id);this.emitter.emit(D.MouseInteraction,{type:o.type,target:d});const{triggerFocus:h}=this.config;switch(o.type){case U.Blur:"blur"in d&&d.blur();break;case U.Focus:h&&d.focus&&d.focus({preventScroll:!0});break;case U.Click:case U.TouchStart:case U.TouchEnd:r?(o.type===U.TouchStart?this.touchActive=!0:o.type===U.TouchEnd&&(this.touchActive=!1),this.mousePos={x:o.x,y:o.y,id:o.id,debugData:o}):(o.type===U.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(o.x,o.y,o.id,r,o),o.type===U.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):o.type===U.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):o.type===U.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case U.TouchCancel:r?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:d.dispatchEvent(u)}break}case A.Scroll:{if(o.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);u.scrollData=o;break}this.applyScroll(o,r);break}case A.ViewportResize:this.emitter.emit(D.Resize,{width:o.width,height:o.height});break;case A.Input:{if(o.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);u.inputData=o;break}this.applyInput(o);break}case A.MediaInteraction:{const u=this.usingVirtualDom?this.virtualDom.mirror.getNode(o.id):this.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);const d=u;try{o.currentTime&&(d.currentTime=o.currentTime),o.volume&&(d.volume=o.volume),o.muted&&(d.muted=o.muted),o.type===Se.Pause&&d.pause(),o.type===Se.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(o.id);if(!u)return this.debugNodeNotFound(o,o.id);const d=u.rules;(i=o.adds)==null||i.forEach(({rule:h,index:f})=>d?.push({cssText:h,index:f,type:j.Insert})),(s=o.removes)==null||s.forEach(({index:h})=>d?.push({index:h,type:j.Remove}))}else{const u=this.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);const d=u.sheet;(a=o.adds)==null||a.forEach(({rule:h,index:f})=>{try{if(Array.isArray(f)){const{positions:T,index:v}=gt(f);de(d.cssRules,T).insertRule(h,v)}else{const T=f===void 0?void 0:Math.min(f,d.cssRules.length);d.insertRule(h,T)}}catch{}}),(l=o.removes)==null||l.forEach(({index:h})=>{try{if(Array.isArray(h)){const{positions:f,index:T}=gt(h);de(d.cssRules,f).deleteRule(T||0)}else d?.deleteRule(h)}catch{}})}break}case A.StyleDeclaration:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);const d=u.rules;o.set&&d.push(ae({type:j.SetProperty,index:o.index},o.set)),o.remove&&d.push(ae({type:j.RemoveProperty,index:o.index},o.remove))}else{const u=this.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);const d=u.sheet;o.set&&de(d.rules,o.index).style.setProperty(o.set.property,o.set.value,o.set.priority),o.remove&&de(d.rules,o.index).style.removeProperty(o.remove.property)}break}case A.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);u.canvasMutations.push({event:t,mutation:o})}else{const u=this.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);Nt({event:t,mutation:o,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case A.Font:{try{const u=new FontFace(o.family,o.buffer?new Uint8Array(JSON.parse(o.fontSource)):o.fontSource,o.descriptors);(c=this.iframe.contentDocument)==null||c.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,yr(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const o in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[o],d=Ke(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(o=>{var u;const d=n.getNode(o.id);if(!d)return t.removes.find(f=>f.id===o.parentId)?void 0:this.warnNodeNotFound(t,o.id);let h=n.getNode(o.parentId);if(!h)return this.warnNodeNotFound(t,o.parentId);if(o.isShadow&&vt(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(f){if(f instanceof DOMException)this.warn("parent could not remove child in mutation",h,d,t);else throw f}});const i=ae({},this.legacy_missingNodeRetryMap),s=[],a=o=>{let u=null;return o.nextId&&(u=n.getNode(o.nextId)),o.nextId!==null&&o.nextId!==void 0&&o.nextId!==-1&&!u},l=o=>{var u;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let d=n.getNode(o.parentId);if(!d)return o.node.type===_.Document?this.newDocumentQueue.push(o):s.push(o);o.node.isShadow&&(vt(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let h=null,f=null;if(o.previousId&&(h=n.getNode(o.previousId)),o.nextId&&(f=n.getNode(o.nextId)),a(o))return s.push(o);if(o.node.rootId&&!n.getNode(o.node.rootId))return;const T=o.node.rootId?n.getNode(o.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Re(d,n)){this.attachDocumentToIframe(o,d);return}const v=ve(o.node,{doc:T,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache});if(o.previousId===-1||o.nextId===-1){i[o.node.id]={node:v,mutation:o};return}const y=n.getMeta(d);if(y&&y.type===_.Element&&y.tagName==="textarea"&&o.node.type===_.Text){const p=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const E of p)E.nodeType===d.TEXT_NODE&&d.removeChild(E)}if(h&&h.nextSibling&&h.nextSibling.parentNode)d.insertBefore(v,h.nextSibling);else if(f&&f.parentNode)d.contains(f)?d.insertBefore(v,f):d.insertBefore(v,null);else{if(d===T)for(;T.firstChild;)T.removeChild(T.firstChild);d.appendChild(v)}if(this.usingVirtualDom&&v.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[]),Re(v,this.mirror)){const p=this.mirror.getId(v),E=this.newDocumentQueue.find(b=>b.parentId===p);E&&(this.attachDocumentToIframe(E,v),this.newDocumentQueue=this.newDocumentQueue.filter(b=>b!==E))}(o.previousId||o.nextId)&&this.legacy_resolveMissingNode(i,d,v,o)};t.adds.forEach(o=>{l(o)});const c=Date.now();for(;s.length;){const o=kr(s);if(s.length=0,Date.now()-c>500){this.warn("Timeout in the loop, please check the resolve tree data:",o);break}for(const u of o)n.getNode(u.value.parentId)?pt(u,d=>{l(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),_r(t.texts).forEach(o=>{var u;const d=n.getNode(o.id);if(!d)return t.removes.find(h=>h.id===o.id)?void 0:this.warnNodeNotFound(t,o.id);if(d.textContent=o.value,this.usingVirtualDom){const h=d.parentNode;((u=h?.rules)==null?void 0:u.length)>0&&(h.rules=[])}}),t.attributes.forEach(o=>{const u=n.getNode(o.id);if(!u)return t.removes.find(d=>d.id===o.id)?void 0:this.warnNodeNotFound(t,o.id);for(const d in o.attributes)if(typeof d=="string"){const h=o.attributes[d];if(h===null)u.removeAttribute(d);else if(typeof h=="string")try{u.setAttribute(d,h)}catch(f){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",f)}else if(d==="style"){const f=h,T=u;for(const v in f)if(f[v]===!1)T.style.removeProperty(v);else if(f[v]instanceof Array){const y=f[v];T.style.setProperty(v,y[0],y[1])}else{const y=f[v];T.style.setProperty(v,y)}}}})}applyScroll(t,r){const n=this.mirror.getNode(t.id);if(!n)return this.debugNodeNotFound(t,t.id);const i=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(i?.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,i){const{previousId:s,nextId:a}=i,l=s&&t[s],c=a&&t[a];if(l){const{node:o,mutation:u}=l;r.insertBefore(o,n),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,o,u)}if(c){const{node:o,mutation:u}=c;r.insertBefore(o,n.nextSibling),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,o,u)}}moveAndHover(t,r,n,i,s){const a=this.mirror.getNode(n);if(!a)return this.debugNodeNotFound(s,n);const l=ft(a,this.iframe),c=t*l.absoluteScale+l.x,o=r*l.absoluteScale+l.y;this.mouse.style.left=`${c}px`,this.mouse.style.top=`${o}px`,i||this.drawMouseTail({x:c,y:o}),this.hoverElements(a)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:r,lineWidth:n,strokeStyle:i,duration:s}=this.config.mouseTail===!0?ke:Object.assign({},ke,this.config.mouseTail),a=()=>{if(!this.mouseTail)return;const l=this.mouseTail.getContext("2d");!l||!this.tailPositions.length||(l.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),l.beginPath(),l.lineWidth=n,l.lineCap=r,l.strokeStyle=i,l.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(c=>l.lineTo(c.x,c.y)),l.stroke())};this.tailPositions.push(t),a(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(l=>l!==t),a()},s/this.speedService.state.context.timer.speed)}hoverElements(t){var r;(r=this.iframe.contentDocument)==null||r.querySelectorAll(".\\:hover").forEach(i=>{i.classList.remove(":hover")});let n=t;for(;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement}isUserInteraction(t){return t.type!==M.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(D.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(Oe,`Node with id '${r}' not found. `,t)}warn(...t){!this.config.showWarning||console.warn(Oe,...t)}debug(...t){!this.config.showDebug||console.log(Oe,...t)}}var V=Uint8Array,J=Uint16Array,Le=Uint32Array,xt=new V([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]),Rt=new V([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]),Kr=new V([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),At=function(e,t){for(var r=new J(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var i=new Le(r[30]),n=1;n<30;++n)for(var s=r[n];s<r[n+1];++s)i[s]=s-r[n]<<5|n;return[r,i]},It=At(xt,2),Ot=It[0],en=It[1];Ot[28]=258,en[258]=28;for(var tn=At(Rt,0),rn=tn[0],Fe=new J(32768),S=0;S<32768;++S){var q=(S&43690)>>>1|(S&21845)<<1;q=(q&52428)>>>2|(q&13107)<<2,q=(q&61680)>>>4|(q&3855)<<4,Fe[S]=((q&65280)>>>8|(q&255)<<8)>>>1}for(var me=function(e,t,r){for(var n=e.length,i=0,s=new J(t);i<n;++i)++s[e[i]-1];var a=new J(t);for(i=0;i<t;++i)a[i]=a[i-1]+s[i-1]<<1;var l;if(r){l=new J(1<<t);var c=15-t;for(i=0;i<n;++i)if(e[i])for(var o=i<<4|e[i],u=t-e[i],d=a[e[i]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)l[Fe[d]>>>c]=o}else for(l=new J(n),i=0;i<n;++i)l[i]=Fe[a[e[i]-1]++]>>>15-e[i];return l},pe=new V(288),S=0;S<144;++S)pe[S]=8;for(var S=144;S<256;++S)pe[S]=9;for(var S=256;S<280;++S)pe[S]=7;for(var S=280;S<288;++S)pe[S]=8;for(var kt=new V(32),S=0;S<32;++S)kt[S]=5;var nn=me(pe,9,1),on=me(kt,5,1),Pe=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},H=function(e,t,r){var n=t/8>>0;return(e[n]|e[n+1]<<8)>>>(t&7)&r},Ue=function(e,t){var r=t/8>>0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>>(t&7)},sn=function(e){return(e/8>>0)+(e&7&&1)},_t=function(e,t,r){(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length);var n=new(e instanceof J?J:e instanceof Le?Le:V)(r-t);return n.set(e.subarray(t,r)),n},an=function(e,t,r){var n=e.length,i=!t||r,s=!r||r.i;r||(r={}),t||(t=new V(n*3));var a=function(Pt){var Ut=t.length;if(Pt>Ut){var $t=new V(Math.max(Ut*2,Pt));$t.set(t),t=$t}},l=r.f||0,c=r.p||0,o=r.b||0,u=r.l,d=r.d,h=r.m,f=r.n,T=n*8;do{if(!u){r.f=l=H(e,c,1);var v=H(e,c+1,3);if(c+=3,v)if(v==1)u=nn,d=on,h=9,f=5;else if(v==2){var b=H(e,c,31)+257,I=H(e,c+10,15)+4,F=b+H(e,c+5,31)+1;c+=14;for(var x=new V(F),$=new V(19),O=0;O<I;++O)$[Kr[O]]=H(e,c+O*3,7);c+=I*3;var L=Pe($),re=(1<<L)-1;if(!s&&c+F*(L+7)>T)break;for(var z=me($,L,1),O=0;O<F;){var Z=z[H(e,c,re)];c+=Z&15;var y=Z>>>4;if(y<16)x[O++]=y;else{var G=0,K=0;for(y==16?(K=3+H(e,c,3),c+=2,G=x[O-1]):y==17?(K=3+H(e,c,7),c+=3):y==18&&(K=11+H(e,c,127),c+=7);K--;)x[O++]=G}}var ce=x.subarray(0,b),B=x.subarray(b);h=Pe(ce),f=Pe(B),u=me(ce,h,1),d=me(B,f,1)}else throw"invalid block type";else{var y=sn(c)+4,p=e[y-4]|e[y-3]<<8,E=y+p;if(E>n){if(s)throw"unexpected EOF";break}i&&a(o+p),t.set(e.subarray(y,E),o),r.b=o+=p,r.p=c=E*8;continue}if(c>T)throw"unexpected EOF"}i&&a(o+131072);for(var k=(1<<h)-1,ne=(1<<f)-1,g=h+f+18;s||c+g<T;){var G=u[Ue(e,c)&k],m=G>>>4;if(c+=G&15,c>T)throw"unexpected EOF";if(!G)throw"invalid length/literal";if(m<256)t[o++]=m;else if(m==256){u=null;break}else{var w=m-254;if(m>264){var O=m-257,C=xt[O];w=H(e,c,(1<<C)-1)+Ot[O],c+=C}var P=d[Ue(e,c)&ne],ee=P>>>4;if(!P)throw"invalid distance";c+=P&15;var B=rn[ee];if(ee>3){var C=Rt[ee];B+=Ue(e,c)&(1<<C)-1,c+=C}if(c>T)throw"unexpected EOF";i&&a(o+131072);for(var Ft=o+w;o<Ft;o+=4)t[o]=t[o-B],t[o+1]=t[o+1-B],t[o+2]=t[o+2-B],t[o+3]=t[o+3-B];o=Ft}}r.l=u,r.p=c,r.b=o,u&&(l=1,r.m=h,r.d=d,r.n=f)}while(!l);return o==t.length?t:_t(t,0,o)},cn=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 ln(e,t){return an((cn(e),e.subarray(2,-4)),t)}function un(e,t){var r=e.length;if(!t&&typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var n=new V(e.length+(e.length>>>1)),i=0,s=function(o){n[i++]=o},a=0;a<r;++a){if(i+5>n.length){var l=new V(i+8+(r-a<<1));l.set(n),n=l}var c=e.charCodeAt(a);c<128||t?s(c):c<2048?(s(192|c>>>6),s(128|c&63)):c>55295&&c<57344?(c=65536+(c&1047552)|e.charCodeAt(++a)&1023,s(240|c>>>18),s(128|c>>>12&63),s(128|c>>>6&63),s(128|c&63)):(s(224|c>>>12),s(128|c>>>6&63),s(128|c&63))}return _t(n,0,i)}function dn(e,t){var r="";if(!t&&typeof TextDecoder<"u")return new TextDecoder().decode(e);for(var n=0;n<e.length;){var i=e[n++];i<128||t?r+=String.fromCharCode(i):i<224?r+=String.fromCharCode((i&31)<<6|e[n++]&63):i<240?r+=String.fromCharCode((i&15)<<12|(e[n++]&63)<<6|e[n++]&63):(i=((i&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,r+=String.fromCharCode(55296|i>>10,56320|i&1023))}return r}const Lt="v1",hn=e=>{if(typeof e!="string")return e;try{const t=JSON.parse(e);if(t.timestamp)return t}catch{}try{const t=JSON.parse(dn(ln(un(e,!0))));if(t.v===Lt)return t;throw new Error(`These events were packed with packer ${t.v} which is incompatible with current packer ${Lt}.`)}catch(t){throw console.error(t),new Error("Unknown data format.")}};return fe.Replayer=Zr,fe.unpack=hn,Object.defineProperty(fe,"__esModule",{value:!0}),fe}({});
17
+ or you can use record.mirror to access the mirror instance during recording.`;let mt={map:{},getId(){return console.error(se),-1},getNode(){return console.error(se),null},removeNodeFromMap(){console.error(se)},has(){return console.error(se),!1},reset(){console.error(se)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(mt=new Proxy(mt,{get(e,t,r){return t==="map"&&console.error(se),Reflect.get(e,t,r)}}));function Or(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(t){if(!(0 in arguments))throw new TypeError("1 argument is required");do if(this===t)return!0;while(t=t&&t.parentNode);return!1})}function kr(e){const t={},r=(i,s)=>{const a={value:i,parent:s,children:[]};return t[i.node.id]=a,a},n=[];for(const i of e){const{nextId:s,parentId:a}=i;if(s&&s in t){const l=t[s];if(l.parent){const c=l.parent.children.indexOf(l);l.parent.children.splice(c,0,r(i,l.parent))}else{const c=n.indexOf(l);n.splice(c,0,r(i,null))}continue}if(a in t){const l=t[a];l.children.push(r(i,l));continue}n.push(r(i,null))}return n}function pt(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)pt(e.children[r],t)}function Re(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function ft(e,t){var r,n;const i=(n=(r=e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:n.frameElement;if(!i||i===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=i.getBoundingClientRect(),a=ft(i,t),l=s.height/i.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}}function vt(e){return Boolean(e?.shadowRoot)}function de(e,t){const r=e[t[0]];return t.length===1?r:de(r.cssRules[t[1]].cssRules,t.slice(2))}function gt(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function _r(e){const t=new Set,r=[];for(let n=e.length;n--;){const i=e[n];t.has(i.id)||(r.push(i),t.add(i.id))}return r}const Lr=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;}`];for(var yt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",he=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ne=0;Ne<yt.length;Ne++)he[yt.charCodeAt(Ne)]=Ne;var Fr=function(e){var t=e.length*.75,r=e.length,n,i=0,s,a,l,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var o=new ArrayBuffer(t),u=new Uint8Array(o);for(n=0;n<r;n+=4)s=he[e.charCodeAt(n)],a=he[e.charCodeAt(n+1)],l=he[e.charCodeAt(n+2)],c=he[e.charCodeAt(n+3)],u[i++]=s<<2|a>>4,u[i++]=(a&15)<<4|l>>2,u[i++]=(l&3)<<6|c&63;return o},Pr=(e,t,r)=>new Promise((n,i)=>{var s=c=>{try{l(r.next(c))}catch(o){i(o)}},a=c=>{try{l(r.throw(c))}catch(o){i(o)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);l((r=r.apply(e,t)).next())});const Tt=new Map;function Et(e,t){let r=Tt.get(e);return r||(r=new Map,Tt.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function Q(e,t,r){return n=>Pr(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 i=yield Q(e,t,r)(n.args);return yield createImageBitmap.apply(null,i)}else if("index"in n){if(r||t===null)return n;const{rr_type:i,index:s}=n;return Et(t,i)[s]}else if("args"in n){const{rr_type:i,args:s}=n,a=window[i];return new a(...yield Promise.all(s.map(Q(e,t,r))))}else{if("base64"in n)return Fr(n.base64);if("src"in n){const i=e.get(n.src);if(i)return i;{const s=new Image;return s.src=n.src,e.set(n.src,s),s}}else if("data"in n&&n.rr_type==="Blob"){const i=yield Promise.all(n.data.map(Q(e,t,r)));return new Blob(i,{type:n.type})}}else if(Array.isArray(n))return yield Promise.all(n.map(Q(e,t,r)));return n})}var Ur=(e,t,r)=>new Promise((n,i)=>{var s=c=>{try{l(r.next(c))}catch(o){i(o)}},a=c=>{try{l(r.throw(c))}catch(o){i(o)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);l((r=r.apply(e,t)).next())});function $r(e,t){try{return t===ge.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}const Br=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Vr(e,t){if(!(t!=null&&t.constructor))return;const{name:r}=t.constructor;if(!Br.includes(r))return;const n=Et(e,r);n.includes(t)||n.push(t)}function Wr(e){return Ur(this,arguments,function*({mutation:t,target:r,type:n,imageMap:i,errorHandler:s}){try{const a=$r(r,n);if(!a)return;if(t.setter){a[t.property]=t.args[0];return}const l=a[t.property],c=yield Promise.all(t.args.map(Q(i,a))),o=l.apply(a,c);Vr(a,o)}catch(a){s(t,a)}})}var jr=(e,t,r)=>new Promise((n,i)=>{var s=c=>{try{l(r.next(c))}catch(o){i(o)}},a=c=>{try{l(r.throw(c))}catch(o){i(o)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);l((r=r.apply(e,t)).next())});function Hr(e){return jr(this,arguments,function*({event:t,mutation:r,target:n,imageMap:i,errorHandler:s}){try{const a=n.getContext("2d");if(r.setter){a[r.property]=r.args[0];return}const l=a[r.property];if(r.property==="drawImage"&&typeof r.args[0]=="string"){const c=i.get(t);l.apply(a,r.args)}else{const c=yield Promise.all(r.args.map(Q(i,a)));l.apply(a,c)}}catch(a){s(r,a)}})}var Gr=(e,t,r)=>new Promise((n,i)=>{var s=c=>{try{l(r.next(c))}catch(o){i(o)}},a=c=>{try{l(r.throw(c))}catch(o){i(o)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);l((r=r.apply(e,t)).next())});function Nt(e){return Gr(this,arguments,function*({event:t,mutation:r,target:n,imageMap:i,canvasEventMap:s,errorHandler:a}){try{const l=s.get(t)||r,c="commands"in l?l.commands:[l];if([ge.WebGL,ge.WebGL2].includes(r.type)){for(let o=0;o<c.length;o++){const u=c[o];yield Wr({mutation:u,type:r.type,target:n,imageMap:i,errorHandler:a})}return}for(let o=0;o<c.length;o++){const u=c[o];yield Hr({event:t,mutation:u,target:n,imageMap:i,errorHandler:a})}}catch(l){a(r,l)}})}var Yr=Object.defineProperty,zr=Object.defineProperties,Xr=Object.getOwnPropertyDescriptors,wt=Object.getOwnPropertySymbols,Qr=Object.prototype.hasOwnProperty,Jr=Object.prototype.propertyIsEnumerable,bt=(e,t,r)=>t in e?Yr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ae=(e,t)=>{for(var r in t||(t={}))Qr.call(t,r)&&bt(e,r,t[r]);if(wt)for(var r of wt(t))Jr.call(t,r)&&bt(e,r,t[r]);return e},Ae=(e,t)=>zr(e,Xr(t)),Ie=(e,t,r)=>new Promise((n,i)=>{var s=c=>{try{l(r.next(c))}catch(o){i(o)}},a=c=>{try{l(r.throw(c))}catch(o){i(o)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);l((r=r.apply(e,t)).next())});const Dt=10*1e3,Ct=2*1e3,St=1*1e3,Mt=60*60*1e3,qr=tt||Nr,Oe="[replayer]",ke={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function _e(e){return e.type==x.IncrementalSnapshot&&(e.data.source==I.TouchMove||e.data.source==I.MouseInteraction&&e.data.type==U.TouchStart)}class Zr{constructor(t,r){if(this.usingVirtualDom=!1,this.virtualDom=new ie,this.mouseTail=null,this.tailPositions=[],this.emitter=qr(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=He(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=Wt(),this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,!(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:ke,useVirtualDom:!0,inactiveThreshold:.02,inactiveSkipTime:Ct};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(C.Resize,this.handleResize),this.setupDom(),this.emitter.on(C.Flush,()=>{if(this.usingVirtualDom){const l={mirror:this.mirror,applyCanvas:(c,o,u)=>{Nt({event:c,mutation:o,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this)};if(Y(this.iframe.contentDocument,this.virtualDom,l,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const c in this.legacy_missingNodeRetryMap)try{const o=this.legacy_missingNodeRetryMap[c],u=Ce(o.node,this.mirror,this.virtualDom.mirror);Y(u,o.node,l,this.virtualDom.mirror),o.node=u}catch(o){this.config.showWarning&&console.warn(o)}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null}),this.emitter.on(C.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset()});const i=new br([],r?.speed||n.speed);this.service=Ar({events:t.map(l=>r&&r.unpackFn?r.unpackFn(l):l).sort((l,c)=>l.timestamp-c.timestamp),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(l=>{this.emitter.emit(C.StateChange,{player:l})}),this.speedService=Ir({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(l=>{this.emitter.emit(C.StateChange,{speed:l})});const s=this.service.state.context.events.find(l=>l.type===x.Meta),a=this.service.state.context.events.find(l=>l.type===x.FullSnapshot);if(s){const{width:l,height:c}=s.data;setTimeout(()=>{this.emitter.emit(C.Resize,{width:l,height:c})},0)}a&&setTimeout(()=>{this.firstFullSnapshot||(this.firstFullSnapshot=a,this.rebuildFullSnapshot(a),this.iframe.contentWindow.scrollTo(a.data.initialOffset))},1),this.service.state.context.events.find(_e)&&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=>{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(a=>this.isUserInteraction(a)),{timestamp:r.endTime}];for(let a=1;a<n.length;a++){const l=n[a-1],c=n[a];c.timestamp-l.timestamp>Dt?t.push({startTime:l.timestamp,endTime:c.timestamp,duration:c.timestamp-l.timestamp,active:!1}):t.push({startTime:l.timestamp,endTime:c.timestamp,duration:c.timestamp-l.timestamp,active:!0})}const i=[];let s=t[0];for(let a=1;a<t.length;a++)t[a].active!=t[a-1].active&&(i.push({startTime:s.startTime,endTime:t[a-1].endTime,duration:t[a-1].endTime-s.startTime,active:t[a-1].active}),s=t[a]);s&&t.length>0&&i.push({startTime:s.startTime,endTime:t[t.length-1].endTime,duration:t[t.length-1].endTime-s.startTime,active:t[t.length-1].active}),s=i[0];for(let a=1;a<i.length;a++)(!i[a].active&&i[a].duration>this.config.inactiveThreshold*r.totalTime||!i[a-1].active&&i[a-1].duration>this.config.inactiveThreshold*r.totalTime)&&(this.activityIntervals.push({startTime:s.startTime,endTime:i[a-1].endTime,duration:i[a-1].endTime-s.startTime,active:i[a-1].active}),s=i[a]);s&&i.length>0&&this.activityIntervals.push({startTime:s.startTime,endTime:i[i.length-1].endTime,duration:i[i.length-1].endTime-s.startTime,active:i[i.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(C.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(C.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(C.Resume)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const r=this.config.unpackFn?this.config.unpackFn(t):t;_e(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(_e(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=He()}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&&(wr(this.iframe.contentWindow,this.iframe.contentDocument),Or(this.iframe.contentWindow))}handleResize(t){this.iframe.style.display="inherit";for(const r of[this.mouseTail,this.iframe])!r||(r.setAttribute("width",String(t.width)),r.setAttribute("height",String(t.height)))}applyEventsSynchronously(t){for(const r of t){switch(r.type){case x.DomContentLoaded:case x.Load:case x.Custom:continue;case x.FullSnapshot:case x.Meta:case x.Plugin:case x.IncrementalSnapshot:break}this.getCastFn(r,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null}getCastFn(t,r=!1){let n;switch(t.type){case x.DomContentLoaded:case x.Load:break;case x.Custom:n=()=>{this.emitter.emit(C.CustomEvent,t)};break;case x.Meta:n=()=>this.emitter.emit(C.Resize,{width:t.data.width,height:t.data.height});break;case x.FullSnapshot:n=()=>{if(this.firstFullSnapshot){if(this.firstFullSnapshot===t){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(t,r),this.iframe.contentWindow.scrollTo(t.data.initialOffset)};break;case x.IncrementalSnapshot:n=()=>{if(this.applyIncremental(t,r),!r&&(this.handleInactivity(t.timestamp),t===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const i of this.service.state.context.events)if(!(i.timestamp<=t.timestamp)&&this.isUserInteraction(i)){i.delay-t.delay>Dt*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=i);break}if(this.nextUserInteractionEvent){const i=this.nextUserInteractionEvent.delay-t.delay,s={speed:Math.min(Math.round(i/Ct),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:s}),this.emitter.emit(C.SkipStart,s)}}};break}return()=>{n&&n();for(const s of this.config.plugins||[])s.handler(t,r,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:t}});const i=this.service.state.context.events.length-1;if(t===this.service.state.context.events[i]){const s=()=>{i<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(C.Finish))};t.type===x.IncrementalSnapshot&&t.data.source===I.MouseMove&&t.data.positions.length?setTimeout(()=>{s()},Math.max(0,-t.data.positions[0].timeOffset+50)):s()}this.emitter.emit(C.EventCast,t)}}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,i={speed:n/Mt*this.config.inactiveSkipTime<St?n/St:Math.round(Math.max(n,Mt)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:i}),this.emitter.emit(C.SkipStart,i)}}}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=[];Jt(t.data.node,{doc:this.iframe.contentDocument,afterAppend:a=>{this.collectIframeAndAttachDocument(n,a)},cache:this.cache,mirror:this.mirror});for(const{mutationInQueue:a,builtNode:l}of n)this.attachDocumentToIframe(a,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==a);const{documentElement:i,head:s}=this.iframe.contentDocument;this.insertStyleRules(i,s),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(C.FullsnapshotRebuilded,t),r||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,r){const n=Lr(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 i=this.virtualDom.createElement("style");this.virtualDom.mirror.add(i,et(i,this.virtualDom.unserializedId)),t.insertBefore(i,r);for(let s=0;s<n.length;s++)i.rules.push({cssText:n[s],type:j.Insert,index:s})}else{const i=document.createElement("style");t.insertBefore(i,r);for(let s=0;s<n.length;s++)i.sheet.insertRule(n[s],s)}}attachDocumentToIframe(t,r){const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[];ve(t.node,{doc:r.contentDocument,mirror:n,hackCss:!0,skipChild:!1,afterAppend:s=>{this.collectIframeAndAttachDocument(i,s);const a=n.getMeta(s);if(a?.type===L.Element&&a?.tagName.toUpperCase()==="HTML"){const{documentElement:l,head:c}=r.contentDocument;this.insertStyleRules(l,c)}},cache:this.cache});for(const{mutationInQueue:s,builtNode:a}of i)this.attachDocumentToIframe(s,a),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==s)}collectIframeAndAttachDocument(t,r){if(Re(r,this.mirror)){const n=this.newDocumentQueue.find(i=>i.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 i,s=this.service.state;const a=()=>{s=this.service.state};this.emitter.on(C.Start,a),this.emitter.on(C.Pause,a);const l=()=>{this.emitter.off(C.Start,a),this.emitter.off(C.Pause,a)};r.querySelectorAll('link[rel="stylesheet"]').forEach(c=>{c.sheet||(n.add(c),c.addEventListener("load",()=>{n.delete(c),n.size===0&&i!==-1&&(s.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(C.LoadStylesheetEnd),i&&clearTimeout(i),l())}))}),n.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(C.LoadStylesheetStart),i=setTimeout(()=>{s.matches("playing")&&this.play(this.getCurrentTime()),i=-1,l()},this.config.loadTimeout))}}hasImageArg(t){for(const r of t)if(!(!r||typeof r!="object")){if("rr_type"in r&&"args"in r){if(this.hasImageArg(r.args))return!0}else if("rr_type"in r&&r.rr_type==="HTMLImageElement"||r instanceof Array&&this.hasImageArg(r))return!0}return!1}getImageArgs(t){const r=[];for(const n of t)!n||typeof n!="object"||("rr_type"in n&&"args"in n?r.push(...this.getImageArgs(n.args)):"rr_type"in n&&n.rr_type==="HTMLImageElement"?r.push(n.src):n instanceof Array&&r.push(...this.getImageArgs(n)));return r}preloadAllImages(){return Ie(this,null,function*(){this.service.state;const t=()=>{this.service.state};this.emitter.on(C.Start,t),this.emitter.on(C.Pause,t);const r=[];for(const n of this.service.state.context.events)n.type===x.IncrementalSnapshot&&n.data.source===I.CanvasMutation&&(r.push(this.deserializeAndPreloadCanvasEvents(n.data,n)),("commands"in n.data?n.data.commands:[n.data]).forEach(i=>{this.preloadImages(i,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"),i=n.getContext("2d"),s=i?.createImageData(n.width,n.height);s?.data,JSON.parse(t.args[0]),i?.putImageData(s,0,0)}}deserializeAndPreloadCanvasEvents(t,r){return Ie(this,null,function*(){if(!this.canvasEventMap.has(r)){const n={isUnchanged:!0};if("commands"in t){const i=yield Promise.all(t.commands.map(s=>Ie(this,null,function*(){const a=yield Promise.all(s.args.map(Q(this.imageMap,null,n)));return Ae(ae({},s),{args:a})})));n.isUnchanged===!1&&this.canvasEventMap.set(r,Ae(ae({},t),{commands:i}))}else{const i=yield Promise.all(t.args.map(Q(this.imageMap,null,n)));n.isUnchanged===!1&&this.canvasEventMap.set(r,Ae(ae({},t),{args:i}))}}})}applyIncremental(t,r){var n,i,s,a,l,c;const{data:o}=t;switch(o.source){case I.Mutation:{try{this.applyMutation(o,r)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,o)}break}case I.Drag:case I.TouchMove:case I.MouseMove:if(r){const u=o.positions[o.positions.length-1];this.mousePos={x:u.x,y:u.y,id:u.id,debugData:o}}else o.positions.forEach(u=>{const d={doAction:()=>{this.moveAndHover(u.x,u.y,u.id,r,o)},delay:u.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(d)}),this.timer.addAction({doAction(){},delay:t.delay-((n=o.positions[0])==null?void 0:n.timeOffset)});break;case I.MouseInteraction:{if(o.id===-1||r)break;const u=new Event(U[o.type].toLowerCase()),d=this.mirror.getNode(o.id);if(!d)return this.debugNodeNotFound(o,o.id);this.emitter.emit(C.MouseInteraction,{type:o.type,target:d});const{triggerFocus:h}=this.config;switch(o.type){case U.Blur:"blur"in d&&d.blur();break;case U.Focus:h&&d.focus&&d.focus({preventScroll:!0});break;case U.Click:case U.TouchStart:case U.TouchEnd:r?(o.type===U.TouchStart?this.touchActive=!0:o.type===U.TouchEnd&&(this.touchActive=!1),this.mousePos={x:o.x,y:o.y,id:o.id,debugData:o}):(o.type===U.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(o.x,o.y,o.id,r,o),o.type===U.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):o.type===U.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):o.type===U.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case U.TouchCancel:r?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:d.dispatchEvent(u)}break}case I.Scroll:{if(o.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);u.scrollData=o;break}this.applyScroll(o,r);break}case I.ViewportResize:this.emitter.emit(C.Resize,{width:o.width,height:o.height});break;case I.Input:{if(o.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);u.inputData=o;break}this.applyInput(o);break}case I.MediaInteraction:{const u=this.usingVirtualDom?this.virtualDom.mirror.getNode(o.id):this.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);const d=u;try{o.currentTime&&(d.currentTime=o.currentTime),o.volume&&(d.volume=o.volume),o.muted&&(d.muted=o.muted),o.type===Se.Pause&&d.pause(),o.type===Se.Play&&d.play()}catch(h){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${h.message||h}`)}break}case I.StyleSheetRule:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);const d=u.rules;(i=o.adds)==null||i.forEach(({rule:h,index:f})=>d?.push({cssText:h,index:f,type:j.Insert})),(s=o.removes)==null||s.forEach(({index:h})=>d?.push({index:h,type:j.Remove}))}else{const u=this.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);const d=u.sheet;(a=o.adds)==null||a.forEach(({rule:h,index:f})=>{try{if(Array.isArray(f)){const{positions:T,index:v}=gt(f);de(d.cssRules,T).insertRule(h,v)}else{const T=f===void 0?void 0:Math.min(f,d.cssRules.length);d.insertRule(h,T)}}catch{}}),(l=o.removes)==null||l.forEach(({index:h})=>{try{if(Array.isArray(h)){const{positions:f,index:T}=gt(h);de(d.cssRules,f).deleteRule(T||0)}else d?.deleteRule(h)}catch{}})}break}case I.StyleDeclaration:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);const d=u.rules;o.set&&d.push(ae({type:j.SetProperty,index:o.index},o.set)),o.remove&&d.push(ae({type:j.RemoveProperty,index:o.index},o.remove))}else{const u=this.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);const d=u.sheet;o.set&&de(d.rules,o.index).style.setProperty(o.set.property,o.set.value,o.set.priority),o.remove&&de(d.rules,o.index).style.removeProperty(o.remove.property)}break}case I.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);u.canvasMutations.push({event:t,mutation:o})}else{const u=this.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);Nt({event:t,mutation:o,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case I.Font:{try{const u=new FontFace(o.family,o.buffer?new Uint8Array(JSON.parse(o.fontSource)):o.fontSource,o.descriptors);(c=this.iframe.contentDocument)==null||c.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,yr(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const o in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[o],d=Ke(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(o=>{var u;const d=n.getNode(o.id);if(!d)return t.removes.find(f=>f.id===o.parentId)?void 0:this.warnNodeNotFound(t,o.id);let h=n.getNode(o.parentId);if(!h)return this.warnNodeNotFound(t,o.parentId);if(o.isShadow&&vt(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(f){if(f instanceof DOMException)this.warn("parent could not remove child in mutation",h,d,t);else throw f}});const i=ae({},this.legacy_missingNodeRetryMap),s=[],a=o=>{let u=null;return o.nextId&&(u=n.getNode(o.nextId)),o.nextId!==null&&o.nextId!==void 0&&o.nextId!==-1&&!u},l=o=>{var u;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let d=n.getNode(o.parentId);if(!d)return o.node.type===L.Document?this.newDocumentQueue.push(o):s.push(o);o.node.isShadow&&(vt(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let h=null,f=null;if(o.previousId&&(h=n.getNode(o.previousId)),o.nextId&&(f=n.getNode(o.nextId)),a(o))return s.push(o);if(o.node.rootId&&!n.getNode(o.node.rootId))return;const T=o.node.rootId?n.getNode(o.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Re(d,n)){this.attachDocumentToIframe(o,d);return}const v=ve(o.node,{doc:T,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache});if(o.previousId===-1||o.nextId===-1){i[o.node.id]={node:v,mutation:o};return}const E=n.getMeta(d);if(E&&E.type===L.Element&&E.tagName==="textarea"&&o.node.type===L.Text){const p=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const y of p)y.nodeType===d.TEXT_NODE&&d.removeChild(y)}if(h&&h.nextSibling&&h.nextSibling.parentNode)d.insertBefore(v,h.nextSibling);else if(f&&f.parentNode)d.contains(f)?d.insertBefore(v,f):d.insertBefore(v,null);else{if(d===T)for(;T.firstChild;)T.removeChild(T.firstChild);d.appendChild(v)}if(this.usingVirtualDom&&v.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[]),Re(v,this.mirror)){const p=this.mirror.getId(v),y=this.newDocumentQueue.find(N=>N.parentId===p);y&&(this.attachDocumentToIframe(y,v),this.newDocumentQueue=this.newDocumentQueue.filter(N=>N!==y))}(o.previousId||o.nextId)&&this.legacy_resolveMissingNode(i,d,v,o)};t.adds.forEach(o=>{l(o)});const c=Date.now();for(;s.length;){const o=kr(s);if(s.length=0,Date.now()-c>500){this.warn("Timeout in the loop, please check the resolve tree data:",o);break}for(const u of o)n.getNode(u.value.parentId)?pt(u,d=>{l(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),_r(t.texts).forEach(o=>{var u;const d=n.getNode(o.id);if(!d)return t.removes.find(h=>h.id===o.id)?void 0:this.warnNodeNotFound(t,o.id);if(d.textContent=o.value,this.usingVirtualDom){const h=d.parentNode;((u=h?.rules)==null?void 0:u.length)>0&&(h.rules=[])}}),t.attributes.forEach(o=>{const u=n.getNode(o.id);if(!u)return t.removes.find(d=>d.id===o.id)?void 0:this.warnNodeNotFound(t,o.id);for(const d in o.attributes)if(typeof d=="string"){const h=o.attributes[d];if(h===null)u.removeAttribute(d);else if(typeof h=="string")try{u.setAttribute(d,h)}catch(f){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",f)}else if(d==="style"){const f=h,T=u;for(const v in f)if(f[v]===!1)T.style.removeProperty(v);else if(f[v]instanceof Array){const E=f[v];T.style.setProperty(v,E[0],E[1])}else{const E=f[v];T.style.setProperty(v,E)}}}})}applyScroll(t,r){const n=this.mirror.getNode(t.id);if(!n)return this.debugNodeNotFound(t,t.id);const i=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(i?.type===L.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,i){const{previousId:s,nextId:a}=i,l=s&&t[s],c=a&&t[a];if(l){const{node:o,mutation:u}=l;r.insertBefore(o,n),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,o,u)}if(c){const{node:o,mutation:u}=c;r.insertBefore(o,n.nextSibling),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,o,u)}}moveAndHover(t,r,n,i,s){const a=this.mirror.getNode(n);if(!a)return this.debugNodeNotFound(s,n);const l=ft(a,this.iframe),c=t*l.absoluteScale+l.x,o=r*l.absoluteScale+l.y;this.mouse.style.left=`${c}px`,this.mouse.style.top=`${o}px`,i||this.drawMouseTail({x:c,y:o}),this.hoverElements(a)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:r,lineWidth:n,strokeStyle:i,duration:s}=this.config.mouseTail===!0?ke:Object.assign({},ke,this.config.mouseTail),a=()=>{if(!this.mouseTail)return;const l=this.mouseTail.getContext("2d");!l||!this.tailPositions.length||(l.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),l.beginPath(),l.lineWidth=n,l.lineCap=r,l.strokeStyle=i,l.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(c=>l.lineTo(c.x,c.y)),l.stroke())};this.tailPositions.push(t),a(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(l=>l!==t),a()},s/this.speedService.state.context.timer.speed)}hoverElements(t){var r;(r=this.iframe.contentDocument)==null||r.querySelectorAll(".\\:hover").forEach(i=>{i.classList.remove(":hover")});let n=t;for(;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement}isUserInteraction(t){return t.type!==x.IncrementalSnapshot?!1:t.data.source>I.Mutation&&t.data.source<=I.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(C.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(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(Oe,`Node with id '${r}' not found. `,t)}warn(...t){!this.config.showWarning||console.warn(Oe,...t)}debug(...t){!this.config.showDebug||console.log(Oe,...t)}}var V=Uint8Array,J=Uint16Array,Le=Uint32Array,xt=new V([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]),Rt=new V([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]),Kr=new V([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),At=function(e,t){for(var r=new J(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var i=new Le(r[30]),n=1;n<30;++n)for(var s=r[n];s<r[n+1];++s)i[s]=s-r[n]<<5|n;return[r,i]},It=At(xt,2),Ot=It[0],en=It[1];Ot[28]=258,en[258]=28;for(var tn=At(Rt,0),rn=tn[0],Fe=new J(32768),M=0;M<32768;++M){var q=(M&43690)>>>1|(M&21845)<<1;q=(q&52428)>>>2|(q&13107)<<2,q=(q&61680)>>>4|(q&3855)<<4,Fe[M]=((q&65280)>>>8|(q&255)<<8)>>>1}for(var me=function(e,t,r){for(var n=e.length,i=0,s=new J(t);i<n;++i)++s[e[i]-1];var a=new J(t);for(i=0;i<t;++i)a[i]=a[i-1]+s[i-1]<<1;var l;if(r){l=new J(1<<t);var c=15-t;for(i=0;i<n;++i)if(e[i])for(var o=i<<4|e[i],u=t-e[i],d=a[e[i]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)l[Fe[d]>>>c]=o}else for(l=new J(n),i=0;i<n;++i)l[i]=Fe[a[e[i]-1]++]>>>15-e[i];return l},pe=new V(288),M=0;M<144;++M)pe[M]=8;for(var M=144;M<256;++M)pe[M]=9;for(var M=256;M<280;++M)pe[M]=7;for(var M=280;M<288;++M)pe[M]=8;for(var kt=new V(32),M=0;M<32;++M)kt[M]=5;var nn=me(pe,9,1),on=me(kt,5,1),Pe=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},H=function(e,t,r){var n=t/8>>0;return(e[n]|e[n+1]<<8)>>>(t&7)&r},Ue=function(e,t){var r=t/8>>0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>>(t&7)},sn=function(e){return(e/8>>0)+(e&7&&1)},_t=function(e,t,r){(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length);var n=new(e instanceof J?J:e instanceof Le?Le:V)(r-t);return n.set(e.subarray(t,r)),n},an=function(e,t,r){var n=e.length,i=!t||r,s=!r||r.i;r||(r={}),t||(t=new V(n*3));var a=function(Pt){var Ut=t.length;if(Pt>Ut){var $t=new V(Math.max(Ut*2,Pt));$t.set(t),t=$t}},l=r.f||0,c=r.p||0,o=r.b||0,u=r.l,d=r.d,h=r.m,f=r.n,T=n*8;do{if(!u){r.f=l=H(e,c,1);var v=H(e,c+1,3);if(c+=3,v)if(v==1)u=nn,d=on,h=9,f=5;else if(v==2){var N=H(e,c,31)+257,D=H(e,c+10,15)+4,O=N+H(e,c+5,31)+1;c+=14;for(var R=new V(O),$=new V(19),k=0;k<D;++k)$[Kr[k]]=H(e,c+k*3,7);c+=D*3;var F=Pe($),re=(1<<F)-1;if(!s&&c+O*(F+7)>T)break;for(var z=me($,F,1),k=0;k<O;){var Z=z[H(e,c,re)];c+=Z&15;var E=Z>>>4;if(E<16)R[k++]=E;else{var G=0,K=0;for(E==16?(K=3+H(e,c,3),c+=2,G=R[k-1]):E==17?(K=3+H(e,c,7),c+=3):E==18&&(K=11+H(e,c,127),c+=7);K--;)R[k++]=G}}var ce=R.subarray(0,N),B=R.subarray(N);h=Pe(ce),f=Pe(B),u=me(ce,h,1),d=me(B,f,1)}else throw"invalid block type";else{var E=sn(c)+4,p=e[E-4]|e[E-3]<<8,y=E+p;if(y>n){if(s)throw"unexpected EOF";break}i&&a(o+p),t.set(e.subarray(E,y),o),r.b=o+=p,r.p=c=y*8;continue}if(c>T)throw"unexpected EOF"}i&&a(o+131072);for(var _=(1<<h)-1,ne=(1<<f)-1,g=h+f+18;s||c+g<T;){var G=u[Ue(e,c)&_],m=G>>>4;if(c+=G&15,c>T)throw"unexpected EOF";if(!G)throw"invalid length/literal";if(m<256)t[o++]=m;else if(m==256){u=null;break}else{var b=m-254;if(m>264){var k=m-257,S=xt[k];b=H(e,c,(1<<S)-1)+Ot[k],c+=S}var P=d[Ue(e,c)&ne],ee=P>>>4;if(!P)throw"invalid distance";c+=P&15;var B=rn[ee];if(ee>3){var S=Rt[ee];B+=Ue(e,c)&(1<<S)-1,c+=S}if(c>T)throw"unexpected EOF";i&&a(o+131072);for(var Ft=o+b;o<Ft;o+=4)t[o]=t[o-B],t[o+1]=t[o+1-B],t[o+2]=t[o+2-B],t[o+3]=t[o+3-B];o=Ft}}r.l=u,r.p=c,r.b=o,u&&(l=1,r.m=h,r.d=d,r.n=f)}while(!l);return o==t.length?t:_t(t,0,o)},cn=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 ln(e,t){return an((cn(e),e.subarray(2,-4)),t)}function un(e,t){var r=e.length;if(!t&&typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var n=new V(e.length+(e.length>>>1)),i=0,s=function(o){n[i++]=o},a=0;a<r;++a){if(i+5>n.length){var l=new V(i+8+(r-a<<1));l.set(n),n=l}var c=e.charCodeAt(a);c<128||t?s(c):c<2048?(s(192|c>>>6),s(128|c&63)):c>55295&&c<57344?(c=65536+(c&1047552)|e.charCodeAt(++a)&1023,s(240|c>>>18),s(128|c>>>12&63),s(128|c>>>6&63),s(128|c&63)):(s(224|c>>>12),s(128|c>>>6&63),s(128|c&63))}return _t(n,0,i)}function dn(e,t){var r="";if(!t&&typeof TextDecoder<"u")return new TextDecoder().decode(e);for(var n=0;n<e.length;){var i=e[n++];i<128||t?r+=String.fromCharCode(i):i<224?r+=String.fromCharCode((i&31)<<6|e[n++]&63):i<240?r+=String.fromCharCode((i&15)<<12|(e[n++]&63)<<6|e[n++]&63):(i=((i&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,r+=String.fromCharCode(55296|i>>10,56320|i&1023))}return r}const Lt="v1",hn=e=>{if(typeof e!="string")return e;try{const t=JSON.parse(e);if(t.timestamp)return t}catch{}try{const t=JSON.parse(dn(ln(un(e,!0))));if(t.v===Lt)return t;throw new Error(`These events were packed with packer ${t.v} which is incompatible with current packer ${Lt}.`)}catch(t){throw console.error(t),new Error("Unknown data format.")}};return fe.Replayer=Zr,fe.unpack=hn,Object.defineProperty(fe,"__esModule",{value:!0}),fe}({});
@@ -1,2 +1,2 @@
1
- .replayer-wrapper{position:relative}.replayer-mouse{position:absolute;width:20px;height:20px;transition:left .05s linear,top .05s linear;background-size:contain;background-position:50%;background-repeat:no-repeat;background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjcgNSAxOCAxOCIgaGVpZ2h0PSIzMDAiIHdpZHRoPSIzMDAiPjxwYXRoIGZpbGw9IiNGRkYiIGQ9Ik04LjIgMjAuOXYtMTZsMTEuNiAxMS42SDEzbC0uNC4xeiIvPjxwYXRoIGZpbGw9IiNGRkYiIGQ9Ik0xNy4zIDIxLjZsLTMuNiAxLjVMOSAxMmwzLjctMS41eiIvPjxwYXRoIGQ9Ik0xMS4wMyAxNC4yOTNsMS44NDUtLjc3NCAzLjA5NiA3LjM3Ni0xLjg0NC43NzV6Ii8+PHBhdGggZD0iTTkuMiA3LjN2MTEuMmwzLTIuOS40LS4xaDQuOHoiLz48L3N2Zz4=");border-color:transparent}.replayer-mouse:after{background:transparent}.replayer-mouse.active:after{animation:click .2s ease-in-out 1}.replayer-mouse.touch-device{background-image:none;width:70px;height:70px;border-radius:100%;margin-left:-37px;margin-top:-37px;border:4px solid rgba(73,80,246,0);transition:left 0s linear,top 0s linear,border-color .2s ease-in-out}.replayer-mouse.touch-device.touch-active{border-color:#4950f6;transition:left .25s linear,top .25s linear,border-color .2s ease-in-out}.replayer-mouse.touch-device:after{opacity:0}.replayer-mouse.touch-device.active:after{animation:touch-click .2s ease-in-out 1}.replayer-mouse-tail{position:absolute;pointer-events:none}@keyframes click{0%{opacity:.3;width:20px;height:20px;background:transparent}75%{width:24px;height:24px;opacity:.8;background:#dc2626}to{background:transparent}}@keyframes touch-click{0%{opacity:0;width:20px;height:20px}50%{opacity:.5;width:10px;height:10px}}
1
+ .replayer-wrapper{position:relative}.replayer-mouse{position:absolute;width:20px;height:20px;transition:left .05s linear,top .05s linear;background-size:contain;background-position:50%;background-repeat:no-repeat;background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjcgNSAxOCAxOCIgaGVpZ2h0PSIzMDAiIHdpZHRoPSIzMDAiPjxwYXRoIGZpbGw9IiNGRkYiIGQ9Ik04LjIgMjAuOXYtMTZsMTEuNiAxMS42SDEzbC0uNC4xeiIvPjxwYXRoIGZpbGw9IiNGRkYiIGQ9Ik0xNy4zIDIxLjZsLTMuNiAxLjVMOSAxMmwzLjctMS41eiIvPjxwYXRoIGQ9Ik0xMS4wMyAxNC4yOTNsMS44NDUtLjc3NCAzLjA5NiA3LjM3Ni0xLjg0NC43NzV6Ii8+PHBhdGggZD0iTTkuMiA3LjN2MTEuMmwzLTIuOS40LS4xaDQuOHoiLz48L3N2Zz4=");border-color:transparent}.replayer-mouse:after{background:transparent}.replayer-mouse.active:after{animation:click .2s ease-in-out 1}.replayer-mouse.touch-device{background-image:none;width:70px;height:70px;border-radius:100%;margin-left:-37px;margin-top:-37px;border:4px solid rgba(73,80,246,0);transition:left 0s linear,top 0s linear,border-color .2s ease-in-out}.replayer-mouse.touch-device.touch-active{border-color:#4950f6;transition:left .25s linear,top .25s linear,border-color .2s ease-in-out}.replayer-mouse.touch-device:after{opacity:0}.replayer-mouse.touch-device.active:after{animation:touch-click .2s ease-in-out 1}.replayer-mouse-tail{position:absolute;pointer-events:none}@keyframes click{0%{opacity:.3;width:20px;height:20px;background:transparent}75%{width:24px;height:24px;opacity:.8;background:#dc2626}to{background:transparent}}@keyframes touch-click{0%{opacity:0;width:20px;height:20px}50%{opacity:.5;width:10px;height:10px}}.rr-player{position:relative;background:#fff;float:left;border-radius:5px;box-shadow:0 24px 48px rgba(17,16,62,.12)}.rr-player__frame{overflow:hidden}
2
2
  /*# sourceMappingURL=rrweb-replay-unpack.min.css.map */
@@ -1 +1 @@
1
- {"version":3,"sources":["style.css"],"names":[],"mappings":"AAAA,kBACE,iBACF,CACA,gBACE,iBAAkB,CAClB,UAAW,CACX,WAAY,CACZ,2CAA+C,CAC/C,uBAAwB,CACxB,uBAAkC,CAClC,2BAA4B,CAC5B,0cAAuzB,CACvzB,wBACF,CAEA,sBACE,sBACF,CAEA,6BACE,iCACF,CACA,6BACE,qBAAsB,CACtB,UAAW,CACX,WAAY,CAGZ,kBAAmB,CACnB,iBAAkB,CAClB,gBAAiB,CACjB,kCAAkC,CAClC,oEACF,CACA,0CACE,oBAAkC,CAClC,wEACF,CACA,mCACE,SACF,CACA,0CACE,uCACF,CACA,qBACE,iBAAkB,CAClB,mBACF,CAEA,iBACE,GACE,UAAY,CACZ,UAAW,CACX,WAAY,CACZ,sBACF,CACA,IACE,UAAW,CACX,WAAY,CACZ,UAAY,CACZ,kBACF,CACA,GACE,sBACF,CACF,CAEA,uBACE,GACE,SAAU,CACV,UAAW,CACX,WACF,CACA,IACE,UAAY,CACZ,UAAW,CACX,WACF,CACF","file":"rrweb-replay-unpack.min.css","sourcesContent":[".replayer-wrapper {\n position: relative;\n}\n.replayer-mouse {\n position: absolute;\n width: 20px;\n height: 20px;\n transition: left 0.05s linear, top 0.05s linear;\n background-size: contain;\n background-position: center center;\n background-repeat: no-repeat;\n background-image: url('data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCINCgkgdmlld0JveD0iNyA1IDE4IDE4IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAyOCAyOCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgaGVpZ2h0PSIzMDBweCIgd2lkdGg9IjMwMHB4Ij4NCjxwb2x5Z29uIGZpbGw9IiNGRkZGRkYiIHBvaW50cz0iOC4yLDIwLjkgOC4yLDQuOSAxOS44LDE2LjUgMTMsMTYuNSAxMi42LDE2LjYgIi8+DQo8cG9seWdvbiBmaWxsPSIjRkZGRkZGIiBwb2ludHM9IjE3LjMsMjEuNiAxMy43LDIzLjEgOSwxMiAxMi43LDEwLjUgIi8+DQo8cmVjdCB4PSIxMi41IiB5PSIxMy42IiB0cmFuc2Zvcm09Im1hdHJpeCgwLjkyMjEgLTAuMzg3MSAwLjM4NzEgMC45MjIxIC01Ljc2MDUgNi41OTA5KSIgd2lkdGg9IjIiIGhlaWdodD0iOCIvPg0KPHBvbHlnb24gcG9pbnRzPSI5LjIsNy4zIDkuMiwxOC41IDEyLjIsMTUuNiAxMi42LDE1LjUgMTcuNCwxNS41ICIvPg0KPC9zdmc+DQo=');\n border-color: transparent; /* otherwise we transition from black when .touch-device class is added */\n}\n\n.replayer-mouse::after {\n background: transparent;\n}\n\n.replayer-mouse.active::after {\n animation: click 0.2s ease-in-out 1;\n}\n.replayer-mouse.touch-device {\n background-image: none; /* there's no passive cursor on touch-only screens */\n width: 70px;\n height: 70px;\n border-width: 4px;\n border-style: solid;\n border-radius: 100%;\n margin-left: -37px;\n margin-top: -37px;\n border-color: rgba(73, 80, 246, 0);\n transition: left 0s linear, top 0s linear, border-color 0.2s ease-in-out;\n}\n.replayer-mouse.touch-device.touch-active {\n border-color: rgba(73, 80, 246, 1);\n transition: left 0.25s linear, top 0.25s linear, border-color 0.2s ease-in-out;\n}\n.replayer-mouse.touch-device::after {\n opacity: 0; /* there's no passive cursor on touch-only screens */\n}\n.replayer-mouse.touch-device.active::after {\n animation: touch-click 0.2s ease-in-out 1;\n}\n.replayer-mouse-tail {\n position: absolute;\n pointer-events: none;\n}\n\n@keyframes click {\n 0% {\n opacity: 0.3;\n width: 20px;\n height: 20px;\n background: transparent;\n }\n 75% {\n width: 24px;\n height: 24px;\n opacity: 0.8;\n background: #dc2626;\n }\n 100% {\n background: transparent;\n }\n}\n\n@keyframes touch-click {\n 0% {\n opacity: 0;\n width: 20px;\n height: 20px;\n }\n 50% {\n opacity: 0.5;\n width: 10px;\n height: 10px;\n }\n}\n"]}
1
+ {"version":3,"sources":["style.css"],"names":[],"mappings":"AAAA,kBACE,iBACF,CACA,gBACE,iBAAkB,CAClB,UAAW,CACX,WAAY,CACZ,2CAA+C,CAC/C,uBAAwB,CACxB,uBAAkC,CAClC,2BAA4B,CAC5B,0cAAuzB,CACvzB,wBACF,CAEA,sBACE,sBACF,CAEA,6BACE,iCACF,CACA,6BACE,qBAAsB,CACtB,UAAW,CACX,WAAY,CAGZ,kBAAmB,CACnB,iBAAkB,CAClB,gBAAiB,CACjB,kCAAkC,CAClC,oEACF,CACA,0CACE,oBAAkC,CAClC,wEACF,CACA,mCACE,SACF,CACA,0CACE,uCACF,CACA,qBACE,iBAAkB,CAClB,mBACF,CAEA,iBACE,GACE,UAAY,CACZ,UAAW,CACX,WAAY,CACZ,sBACF,CACA,IACE,UAAW,CACX,WAAY,CACZ,UAAY,CACZ,kBACF,CACA,GACE,sBACF,CACF,CAEA,uBACE,GACE,SAAU,CACV,UAAW,CACX,WACF,CACA,IACE,UAAY,CACZ,UAAW,CACX,WACF,CACF,CAEA,WACE,iBAAkB,CAClB,eAAiB,CACjB,UAAW,CACX,iBAAkB,CAClB,yCACF,CAEA,kBACE,eACF","file":"rrweb-replay-unpack.min.css","sourcesContent":[".replayer-wrapper {\n position: relative;\n}\n.replayer-mouse {\n position: absolute;\n width: 20px;\n height: 20px;\n transition: left 0.05s linear, top 0.05s linear;\n background-size: contain;\n background-position: center center;\n background-repeat: no-repeat;\n background-image: url('data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCINCgkgdmlld0JveD0iNyA1IDE4IDE4IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAyOCAyOCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgaGVpZ2h0PSIzMDBweCIgd2lkdGg9IjMwMHB4Ij4NCjxwb2x5Z29uIGZpbGw9IiNGRkZGRkYiIHBvaW50cz0iOC4yLDIwLjkgOC4yLDQuOSAxOS44LDE2LjUgMTMsMTYuNSAxMi42LDE2LjYgIi8+DQo8cG9seWdvbiBmaWxsPSIjRkZGRkZGIiBwb2ludHM9IjE3LjMsMjEuNiAxMy43LDIzLjEgOSwxMiAxMi43LDEwLjUgIi8+DQo8cmVjdCB4PSIxMi41IiB5PSIxMy42IiB0cmFuc2Zvcm09Im1hdHJpeCgwLjkyMjEgLTAuMzg3MSAwLjM4NzEgMC45MjIxIC01Ljc2MDUgNi41OTA5KSIgd2lkdGg9IjIiIGhlaWdodD0iOCIvPg0KPHBvbHlnb24gcG9pbnRzPSI5LjIsNy4zIDkuMiwxOC41IDEyLjIsMTUuNiAxMi42LDE1LjUgMTcuNCwxNS41ICIvPg0KPC9zdmc+DQo=');\n border-color: transparent; /* otherwise we transition from black when .touch-device class is added */\n}\n\n.replayer-mouse::after {\n background: transparent;\n}\n\n.replayer-mouse.active::after {\n animation: click 0.2s ease-in-out 1;\n}\n.replayer-mouse.touch-device {\n background-image: none; /* there's no passive cursor on touch-only screens */\n width: 70px;\n height: 70px;\n border-width: 4px;\n border-style: solid;\n border-radius: 100%;\n margin-left: -37px;\n margin-top: -37px;\n border-color: rgba(73, 80, 246, 0);\n transition: left 0s linear, top 0s linear, border-color 0.2s ease-in-out;\n}\n.replayer-mouse.touch-device.touch-active {\n border-color: rgba(73, 80, 246, 1);\n transition: left 0.25s linear, top 0.25s linear, border-color 0.2s ease-in-out;\n}\n.replayer-mouse.touch-device::after {\n opacity: 0; /* there's no passive cursor on touch-only screens */\n}\n.replayer-mouse.touch-device.active::after {\n animation: touch-click 0.2s ease-in-out 1;\n}\n.replayer-mouse-tail {\n position: absolute;\n pointer-events: none;\n}\n\n@keyframes click {\n 0% {\n opacity: 0.3;\n width: 20px;\n height: 20px;\n background: transparent;\n }\n 75% {\n width: 24px;\n height: 24px;\n opacity: 0.8;\n background: #dc2626;\n }\n 100% {\n background: transparent;\n }\n}\n\n@keyframes touch-click {\n 0% {\n opacity: 0;\n width: 20px;\n height: 20px;\n }\n 50% {\n opacity: 0.5;\n width: 10px;\n height: 10px;\n }\n}\n\n.rr-player {\n position: relative;\n background: white;\n float: left;\n border-radius: 5px;\n box-shadow: 0 24px 48px rgba(17, 16, 62, 0.12);\n}\n\n.rr-player__frame {\n overflow: hidden;\n}\n"]}