@highlight-run/rrweb 2.0.8 → 2.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plugins/console-record.js +5 -5
- package/dist/plugins/console-record.min.js +5 -5
- package/dist/plugins/console-record.min.js.map +1 -1
- package/dist/plugins/console-replay.js +3 -3
- package/dist/plugins/console-replay.min.js +3 -3
- package/dist/plugins/console-replay.min.js.map +1 -1
- package/dist/record/rrweb-record-pack.js +2 -2
- package/dist/record/rrweb-record-pack.min.js +2 -2
- package/dist/record/rrweb-record-pack.min.js.map +1 -1
- package/dist/record/rrweb-record.js +3 -3
- package/dist/record/rrweb-record.min.js +3 -3
- package/dist/record/rrweb-record.min.js.map +1 -1
- package/dist/replay/rrweb-replay-unpack.js +3 -4
- package/dist/replay/rrweb-replay-unpack.min.js +3 -4
- package/dist/replay/rrweb-replay-unpack.min.js.map +1 -1
- package/dist/replay/rrweb-replay.js +3 -4
- package/dist/replay/rrweb-replay.min.js +3 -4
- package/dist/replay/rrweb-replay.min.js.map +1 -1
- package/dist/rrweb-all.js +24 -25
- package/dist/rrweb-all.min.js +24 -25
- package/dist/rrweb-all.min.js.map +1 -1
- package/dist/rrweb.js +14 -15
- package/dist/rrweb.min.js +14 -15
- package/dist/rrweb.min.js.map +1 -1
- package/es/rrweb/packages/rrdom/es/virtual-dom.js +51 -90
- package/es/rrweb/packages/rrweb/src/index.js +1 -1
- package/es/rrweb/packages/rrweb/src/record/index.js +6 -3
- package/es/rrweb/packages/rrweb/src/record/mutation.js +1 -1
- package/es/rrweb/packages/rrweb/src/record/observer.js +1 -1
- package/es/rrweb/packages/rrweb/src/replay/index.js +1 -1
- package/es/rrweb/packages/rrweb/src/utils.js +1 -1
- package/lib/plugins/console-record.js +1 -9
- package/lib/plugins/console-replay.js +1 -9
- package/lib/record/rrweb-record-pack.js +3 -9
- package/lib/record/rrweb-record.js +21 -1061
- package/lib/replay/rrweb-replay-unpack.js +96 -1015
- package/lib/replay/rrweb-replay.js +96 -1015
- package/lib/rrweb-all.js +141 -2034
- package/lib/rrweb.js +141 -2034
- package/package.json +4 -4
- package/es/rrweb/packages/rrweb-snapshot/es/rrweb-snapshot.js +0 -1858
|
@@ -1,5 +1,4 @@
|
|
|
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 p=g.match(/\n/g);p&&(r+=p.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(p){return p.position=new a(g),y(),p}}var a=function(){function g(p){this.start=p,this.end={line:r,column:n},this.source=t.source}return g}();a.prototype.content=e;var u=[];function c(g){var p=new Error(t.source+":"+r+":"+n+": "+g);if(p.reason=g,p.filename=t.source,p.line=r,p.column=n,p.source=e,t.silent)u.push(p);else throw p}function o(){var g=m();return{type:"stylesheet",stylesheet:{source:t.source,rules:g,parsingErrors:u}}}function l(){return f(/^{\s*/)}function d(){return f(/^}/)}function m(){var g,p=[];for(y(),v(p);e.length&&e.charAt(0)!=="}"&&(g=_()||te());)g!==!1&&(p.push(g),v(p));return p}function f(g){var p=g.exec(e);if(p){var b=p[0];return i(b),e=e.slice(b.length),p}}function y(){f(/^\s*/)}function v(g){g===void 0&&(g=[]);for(var p;p=E();)p!==!1&&g.push(p),p=E();return g}function E(){var g=s();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var p=2;e.charAt(p)!==""&&(e.charAt(p)!=="*"||e.charAt(p+1)!=="/");)++p;if(p+=2,e.charAt(p-1)==="")return c("End of comment missing");var b=e.slice(2,p-2);return n+=2,i(b),e=e.slice(p),n+=2,g({type:"comment",comment:b})}}function h(){var g=f(/^([^{]+)/);if(g)return z(g[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(p){return p.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(p){return p.replace(/\u200C/g,",")})}function T(){var g=s(),p=f(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(p){var b=z(p[0]);if(!f(/^:\s*/))return c("property missing ':'");var C=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),P=g({type:"declaration",property:b.replace(Be,""),value:C?z(C[0]).replace(Be,""):""});return f(/^[;\s]*/),P}}function N(){var g=[];if(!l())return c("missing '{'");v(g);for(var p;p=T();)p!==!1&&(g.push(p),v(g)),p=T();return d()?g:c("missing '}'")}function R(){for(var g,p=[],b=s();g=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)p.push(g[1]),f(/^,\s*/);if(p.length)return b({type:"keyframe",values:p,declarations:N()})}function F(){var g=s(),p=f(/^@([-\w]+)?keyframes\s*/);if(p){var b=p[1];if(p=f(/^([-\w]+)\s*/),!p)return c("@keyframes missing name");var C=p[1];if(!l())return c("@keyframes missing '{'");for(var P,K=v();P=R();)K.push(P),K=K.concat(v());return d()?g({type:"keyframes",name:C,vendor:b,keyframes:K}):c("@keyframes missing '}'")}}function O(){var g=s(),p=f(/^@supports *([^{]+)/);if(p){var b=z(p[1]);if(!l())return c("@supports missing '{'");var C=v().concat(m());return d()?g({type:"supports",supports:b,rules:C}):c("@supports missing '}'")}}function M(){var g=s(),p=f(/^@host\s*/);if(p){if(!l())return c("@host missing '{'");var b=v().concat(m());return d()?g({type:"host",rules:b}):c("@host missing '}'")}}function k(){var g=s(),p=f(/^@media *([^{]+)/);if(p){var b=z(p[1]);if(!l())return c("@media missing '{'");var C=v().concat(m());return d()?g({type:"media",media:b,rules:C}):c("@media missing '}'")}}function V(){var g=s(),p=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(p)return g({type:"custom-media",name:z(p[1]),media:z(p[2])})}function me(){var g=s(),p=f(/^@page */);if(p){var b=h()||[];if(!l())return c("@page missing '{'");for(var C=v(),P;P=T();)C.push(P),C=C.concat(v());return d()?g({type:"page",selectors:b,declarations:C}):c("@page missing '}'")}}function pe(){var g=s(),p=f(/^@([-\w]+)?document *([^{]+)/);if(p){var b=z(p[1]),C=z(p[2]);if(!l())return c("@document missing '{'");var P=v().concat(m());return d()?g({type:"document",document:C,vendor:b,rules:P}):c("@document missing '}'")}}function q(){var g=s(),p=f(/^@font-face\s*/);if(p){if(!l())return c("@font-face missing '{'");for(var b=v(),C;C=T();)b.push(C),b=b.concat(v());return d()?g({type:"font-face",declarations:b}):c("@font-face missing '}'")}}var G=$("import"),Z=$("charset"),se=$("namespace");function $(g){var p=new RegExp("^@"+g+"\\s*([^;]+);");return function(){var b=s(),C=f(p);if(C){var P={type:g};return P[g]=C[1].trim(),b(P)}}}function _(){if(e[0]==="@")return F()||k()||V()||O()||G()||Z()||se()||pe()||me()||M()||q()}function te(){var g=s(),p=h();return p?(v(),g({type:"rule",selectors:p,declarations:N()})):c("selector missing")}return we(o())}function z(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],u=e[a];Array.isArray(u)?u.forEach(function(c){we(c,n)}):u&&typeof u=="object"&&we(u,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"),u=e.replace(a,function(c){var o=c.replace(Yt,"$1.\\:hover");return c+", "+o});return t?.stylesWithHoverClass.set(e,u),u}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 u=function(o){if(!e.attributes.hasOwnProperty(o))return"continue";var l=e.attributes[o];if(s==="option"&&o==="selected"&&l===!1)return"continue";if(l=typeof l=="boolean"||typeof l=="number"?"":l,o.startsWith("rr_")){if(s==="canvas"&&o==="rr_dataURL"){var d=document.createElement("img");d.src=l,d.onload=function(){var M=a.getContext("2d");M&&M.drawImage(d,0,0,d.width,d.height)}}else if(s==="img"&&o==="rr_dataURL"){var m=a;m.currentSrc.startsWith("data:")||(m.setAttribute("rrweb-original-src",e.attributes.src),m.src=l)}if(o==="rr_width")a.style.width=l;else if(o==="rr_height")a.style.height=l;else if(o==="rr_mediaCurrentTime")a.currentTime=e.attributes.rr_mediaCurrentTime;else if(o==="rr_mediaState")switch(l){case"played":a.play().catch(function(M){return console.warn("media playback error",M)});break;case"paused":a.pause();break}}else{var f=s==="textarea"&&o==="value",y=s==="style"&&o==="_cssText";if(y&&n&&(l=je(l,i),typeof l=="string")){for(var v=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,E=void 0,h=[],T="https://replay-cors-proxy.highlightrun.workers.dev";(E=v.exec(l))!==null;)E.index===v.lastIndex&&v.lastIndex++,E.forEach(function(M,k){if(k===0){var V=M.slice(5,M.length-2);h.push({originalUrl:V,proxyUrl:V.replace(V,T+"?url="+V)})}});h.forEach(function(M){l=l.replace(M.originalUrl,M.proxyUrl)})}if(f||y){for(var N=r.createTextNode(l),R=0,F=Array.from(a.childNodes);R<F.length;R++){var O=F[R];O.nodeType===a.TEXT_NODE&&a.removeChild(O)}return a.appendChild(N),"continue"}try{if(e.isSVG&&o==="xlink:href")a.setAttributeNS("http://www.w3.org/1999/xlink",o,l);else if(o==="onload"||o==="onclick"||o.substring(0,7)==="onmouse")a.setAttribute("_"+o,l);else{if(s==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&o==="content")return a.setAttribute("csp-content",l),"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(o,l))}}catch{}}};for(var c in e.attributes)u(c);if(e.isShadowHost)if(!a.shadowRoot)a.attachShadow({mode:"open"});else for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);return a;case 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,u=a===void 0?!0:a,c=t.afterAppend,o=t.cache,l=zt(e,{doc:r,hackCss:u,cache:o});if(!l)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" "">')),l=r),n.add(l,e),(e.type===L.Document||e.type===L.Element)&&!s)for(var d=0,m=e.childNodes;d<m.length;d++){var f=m[d],y=ve(f,{doc:r,mirror:n,skipChild:!1,hackCss:u,afterAppend:c,cache:o});if(!y){console.warn("Failed to rebuild",f);continue}f.isShadow&&Vt(l)&&l.shadowRoot?l.shadowRoot.appendChild(y):l.appendChild(y),c&&c(y)}return l}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,u=t.cache,c=t.mirror,o=c===void 0?new $e:c,l=ve(e,{doc:r,mirror:o,skipChild:!1,hackCss:s,afterAppend:a,cache:u});return Xt(o,function(d){n&&n(d),Qt(d,o)}),l}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,u=null;switch(t.RRNodeType){case w.Document:{u=t.scrollData;break}case w.Element:{const c=e,o=t;switch(ar(c,o,n),u=o.scrollData,a=o.inputData,o.tagName){case"AUDIO":case"VIDEO":{const l=e,d=o;d.paused!==void 0&&(d.paused?l.pause():l.play()),d.muted!==void 0&&(l.muted=d.muted),d.volume!==void 0&&(l.volume=d.volume),d.currentTime!==void 0&&(l.currentTime=d.currentTime);break}case"CANVAS":t.canvasMutations.forEach(l=>r.applyCanvas(l.event,l.mutation,e));break;case"STYLE":cr(c,t.rules);break}if(o.shadowRoot){c.shadowRoot||c.attachShadow({mode:"open"});const l=c.shadowRoot.childNodes,d=o.shadowRoot.childNodes;(l.length>0||d.length>0)&&qe(Array.from(l),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(u&&r.applyScroll(u,!0),a&&r.applyInput(a),t.nodeName==="IFRAME"){const c=e.contentDocument,o=t;if(c){const l=n.getMeta(o.contentDocument);l&&r.mirror.add(c,Object.assign({},l)),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],u=r.getMeta(t);if(u&&"isSVG"in u&&u.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,a;let u=0,c=e.length-1,o=0,l=t.length-1,d=e[u],m=e[c],f=t[o],y=t[l],v,E;for(;u<=c&&o<=l;)if(d===void 0)d=e[++u];else if(m===void 0)m=e[--c];else if(n.mirror.getId(d)===i.getId(f))Y(d,f,n,i),d=e[++u],f=t[++o];else if(n.mirror.getId(m)===i.getId(y))Y(m,y,n,i),m=e[--c],y=t[--l];else if(n.mirror.getId(d)===i.getId(y))r.insertBefore(d,m.nextSibling),Y(d,y,n,i),d=e[++u],y=t[--l];else if(n.mirror.getId(m)===i.getId(f))r.insertBefore(m,d),Y(m,f,n,i),m=e[--c],f=t[++o];else{if(!v){v={};for(let h=u;h<=c;h++){const T=e[h];T&&n.mirror.hasNode(T)&&(v[n.mirror.getId(T)]=h)}}if(E=v[i.getId(f)],E){const h=e[E];r.insertBefore(h,d),Y(h,f,n,i),e[E]=void 0}else{const h=Ce(f,n.mirror,i);((s=n.mirror.getMeta(r))===null||s===void 0?void 0:s.type)===w.Document&&((a=n.mirror.getMeta(h))===null||a===void 0?void 0:a.type)===w.Element&&r.documentElement&&(r.removeChild(r.documentElement),e[u]=void 0,d=void 0),r.insertBefore(h,d||null),Y(h,f,n,i)}f=t[++o]}if(u>c){const h=t[l+1];let T=null;for(h&&r.childNodes.forEach(N=>{n.mirror.getId(N)===i.getId(h)&&(T=N)});o<=l;++o){const N=Ce(t[o],n.mirror,i);r.insertBefore(N,T),Y(N,t[o],n,i)}}else if(o>l)for(;u<=c;u++){const h=e[u];h&&(r.removeChild(h),n.mirror.removeNodeFromMap(h))}}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 w.Document:n=new Document;break;case w.DocumentType:n=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case w.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 w.Text:n=document.createTextNode(e.data);break;case w.Comment:n=document.createComment(e.data);break;case w.CDATA:n=document.createCDATASection(e.data);break}return i&&t.add(n,Object.assign({},i)),n}function ae(e,t){const r=e[t[0]];return t.length===1?r:ae(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);ae(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);ae(r.cssRules,i).deleteRule(s||0)}else r.deleteRule(n.index)}catch{}else n.type===j.SetProperty?ae(r.cssRules,n.index).style.setProperty(n.property,n.value,n.priority):n.type===j.RemoveProperty&&ae(r.cssRules,n.index).style.removeProperty(n.property)})}class re 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 re}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 ce(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 ce extends ze(W){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class ur extends or(ce){}class dr extends ce{constructor(){super(...arguments),this.canvasMutations=[]}getContext(){return null}}class hr extends ce{constructor(){super(...arguments),this.rules=[]}}class mr extends ce{constructor(t,r){super(t),this.contentDocument=new re,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 u=e,c=gr(u);i=t.createElement(c);const o=i;for(const{name:l,value:d}of Array.from(u.attributes))o.attributes[l]=d;u.scrollLeft&&(o.scrollLeft=u.scrollLeft),u.scrollTop&&(o.scrollTop=u.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 re&&(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 re){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(u=>n(u,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(h){const T=["MSIE ","Trident/","Edge/"];return new RegExp(T.join("|")).test(h)}const u=a(e.navigator.userAgent)?1:0;function c(h,T){this.scrollLeft=h,this.scrollTop=T}function o(h){return .5*(1-Math.cos(Math.PI*h))}function l(h){if(h===null||typeof h!="object"||h.behavior===void 0||h.behavior==="auto"||h.behavior==="instant")return!0;if(typeof h=="object"&&h.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+h.behavior+" is not a valid value for enumeration ScrollBehavior.")}function d(h,T){if(T==="Y")return h.clientHeight+u<h.scrollHeight;if(T==="X")return h.clientWidth+u<h.scrollWidth}function m(h,T){const N=e.getComputedStyle(h,null)["overflow"+T];return N==="auto"||N==="scroll"}function f(h){const T=d(h,"Y")&&m(h,"Y"),N=d(h,"X")&&m(h,"X");return T||N}function y(h){for(;h!==t.body&&f(h)===!1;)h=h.parentNode||h.host;return h}function v(h){const T=s();let N,R,F,O=(T-h.startTime)/n;O=O>1?1:O,N=o(O),R=h.startX+(h.x-h.startX)*N,F=h.startY+(h.y-h.startY)*N,h.method.call(h.scrollable,R,F),(R!==h.x||F!==h.y)&&e.requestAnimationFrame(v.bind(e,h))}function E(h,T,N){let R,F,O,M;const k=s();h===t.body?(R=e,F=e.scrollX||e.pageXOffset,O=e.scrollY||e.pageYOffset,M=i.scroll):(R=h,F=h.scrollLeft,O=h.scrollTop,M=c),v({scrollable:R,method:M,startTime:k,startX:F,startY:O,x:T,y:N})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(l(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(l(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(l(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 h=arguments[0].left,T=arguments[0].top;E.call(this,this,typeof h>"u"?this.scrollLeft:~~h,typeof T>"u"?this.scrollTop:~~T)},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(l(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(l(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const h=y(this),T=h.getBoundingClientRect(),N=this.getBoundingClientRect();h!==t.body?(E.call(this,h,h.scrollLeft+N.left-T.left,h.scrollTop+N.top-T.top),e.getComputedStyle(h).position!=="fixed"&&e.scrollBy({left:T.left,top:T.top,behavior:"smooth"})):e.scrollBy({left:N.left,top:N.top,behavior:"smooth"})}}var S=(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))(S||{}),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||{}),xe=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(xe||{}),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===S.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}/*! *****************************************************************************
|
|
1
|
+
var rrwebReplay=function(se,y){"use strict";function It(t){const e={},i=/;(?![^(]*\))/g,o=/:(.+)/,n=/\/\*.*?\*\//g;return t.replace(n,"").split(i).forEach(function(s){if(s){const a=s.split(o);a.length>1&&(e[pe(a[0].trim())]=a[1].trim())}}),e}function _e(t){const e=[];for(const i in t){const o=t[i];if(typeof o!="string")continue;const n=Lt(i);e.push(`${n}: ${o};`)}return e.join(" ")}const Ot=/-([a-z])/g,kt=/^--[a-zA-Z0-9-]+$/,pe=t=>kt.test(t)?t:t.replace(Ot,(e,i)=>i?i.toUpperCase():""),_t=/\B([A-Z])/g,Lt=t=>t.replace(_t,"-$1").toLowerCase();class k{constructor(...e){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=b.ELEMENT_NODE,this.TEXT_NODE=b.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){const e=this.parentNode;if(!e)return null;const i=e.childNodes,o=i.indexOf(this);return i[o+1]||null}contains(e){if(e===this)return!0;for(const i of this.childNodes)if(i.contains(e))return!0;return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,i){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function Ft(t){return class At extends t{constructor(){super(...arguments),this.nodeType=b.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=y.NodeType.Document,this.textContent=null}get documentElement(){return this.childNodes.find(i=>i.RRNodeType===y.NodeType.Element&&i.tagName==="HTML")||null}get body(){var i;return((i=this.documentElement)===null||i===void 0?void 0:i.childNodes.find(o=>o.RRNodeType===y.NodeType.Element&&o.tagName==="BODY"))||null}get head(){var i;return((i=this.documentElement)===null||i===void 0?void 0:i.childNodes.find(o=>o.RRNodeType===y.NodeType.Element&&o.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(i){const o=i.RRNodeType;if((o===y.NodeType.Element||o===y.NodeType.DocumentType)&&this.childNodes.some(n=>n.RRNodeType===o))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${o===y.NodeType.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return i.parentElement=null,i.parentNode=this,this.childNodes.push(i),i}insertBefore(i,o){const n=i.RRNodeType;if((n===y.NodeType.Element||n===y.NodeType.DocumentType)&&this.childNodes.some(a=>a.RRNodeType===n))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${n===y.NodeType.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(o===null)return this.appendChild(i);const s=this.childNodes.indexOf(o);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,i),i.parentElement=null,i.parentNode=this,i}removeChild(i){const o=this.childNodes.indexOf(i);if(o===-1)throw new Error("Failed to execute 'removeChild' on 'RRDocument': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(o,1),i.parentElement=null,i.parentNode=null,i}open(){this.childNodes=[]}close(){}write(i){let o;if(i==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?o="-//W3C//DTD XHTML 1.0 Transitional//EN":i==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(o="-//W3C//DTD HTML 4.0 Transitional//EN"),o){const n=this.createDocumentType("html",o,"");this.open(),this.appendChild(n)}}createDocument(i,o,n){return new At}createDocumentType(i,o,n){const s=new(Le(k))(i,o,n);return s.ownerDocument=this,s}createElement(i){const o=new(Fe(k))(i);return o.ownerDocument=this,o}createElementNS(i,o){return this.createElement(o)}createTextNode(i){const o=new(Pe(k))(i);return o.ownerDocument=this,o}createComment(i){const o=new(Ue(k))(i);return o.ownerDocument=this,o}createCDATASection(i){const o=new(Ve(k))(i);return o.ownerDocument=this,o}toString(){return"RRDocument"}}}function Le(t){return class extends t{constructor(e,i,o){super(),this.nodeType=b.DOCUMENT_TYPE_NODE,this.RRNodeType=y.NodeType.DocumentType,this.textContent=null,this.name=e,this.publicId=i,this.systemId=o,this.nodeName=e}toString(){return"RRDocumentType"}}}function Fe(t){return class extends t{constructor(e){super(),this.nodeType=b.ELEMENT_NODE,this.RRNodeType=y.NodeType.Element,this.attributes={},this.shadowRoot=null,this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e="";return this.childNodes.forEach(i=>e+=i.textContent),e}set textContent(e){this.childNodes=[this.ownerDocument.createTextNode(e)]}get classList(){return new Ut(this.attributes.class,e=>{this.attributes.class=e})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const e=this.attributes.style?It(this.attributes.style):{},i=/\B([A-Z])/g;return e.setProperty=(o,n,s)=>{if(i.test(o))return;const a=pe(o);n?e[a]=n:delete e[a],s==="important"&&(e[a]+=" !important"),this.attributes.style=_e(e)},e.removeProperty=o=>{if(i.test(o))return"";const n=pe(o),s=e[n]||"";return delete e[n],this.attributes.style=_e(e),s},e}getAttribute(e){return this.attributes[e]||null}setAttribute(e,i){this.attributes[e]=i}setAttributeNS(e,i,o){this.setAttribute(i,o)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return this.childNodes.push(e),e.parentNode=this,e.parentElement=this,e}insertBefore(e,i){if(i===null)return this.appendChild(e);const o=this.childNodes.indexOf(i);if(o==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(o,0,e),e.parentElement=this,e.parentNode=this,e}removeChild(e){const i=this.childNodes.indexOf(e);if(i===-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(i,1),e.parentElement=null,e.parentNode=null,e}attachShadow(e){const i=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=i,i}dispatchEvent(e){return!0}toString(){let e="";for(const i in this.attributes)e+=`${i}="${this.attributes[i]}" `;return`${this.tagName} ${e}`}}}function Pt(t){return class extends t{attachShadow(e){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}function Pe(t){return class extends t{constructor(e){super(),this.nodeType=b.TEXT_NODE,this.nodeName="#text",this.RRNodeType=y.NodeType.Text,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function Ue(t){return class extends t{constructor(e){super(),this.nodeType=b.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=y.NodeType.Comment,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function Ve(t){return class extends t{constructor(e){super(),this.nodeName="#cdata-section",this.nodeType=b.CDATA_SECTION_NODE,this.RRNodeType=y.NodeType.CDATA,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class Ut{constructor(e,i){if(this.classes=[],this.add=(...o)=>{for(const n of o){const s=String(n);this.classes.indexOf(s)>=0||this.classes.push(s)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...o)=>{this.classes=this.classes.filter(n=>o.indexOf(n)===-1),this.onChange&&this.onChange(this.classes.join(" "))},e){const o=e.trim().split(/\s+/);this.classes.push(...o)}this.onChange=i}}var b;(function(t){t[t.PLACEHOLDER=0]="PLACEHOLDER",t[t.ELEMENT_NODE=1]="ELEMENT_NODE",t[t.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",t[t.TEXT_NODE=3]="TEXT_NODE",t[t.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",t[t.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",t[t.ENTITY_NODE=6]="ENTITY_NODE",t[t.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",t[t.COMMENT_NODE=8]="COMMENT_NODE",t[t.DOCUMENT_NODE=9]="DOCUMENT_NODE",t[t.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",t[t.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"})(b||(b={}));const fe={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"};function P(t,e,i,o){const n=t.childNodes,s=e.childNodes;o=o||e.mirror||e.ownerDocument.mirror,(n.length>0||s.length>0)&&Be(Array.from(n),s,t,i,o);let a=null,c=null;switch(e.RRNodeType){case y.NodeType.Document:{c=e.scrollData;break}case y.NodeType.Element:{const l=t,r=e;switch(Vt(l,r,o),c=r.scrollData,a=r.inputData,r.tagName){case"AUDIO":case"VIDEO":{const u=t,d=r;d.paused!==void 0&&(d.paused?u.pause():u.play()),d.muted!==void 0&&(u.muted=d.muted),d.volume!==void 0&&(u.volume=d.volume),d.currentTime!==void 0&&(u.currentTime=d.currentTime);break}case"CANVAS":e.canvasMutations.forEach(u=>i.applyCanvas(u.event,u.mutation,t));break;case"STYLE":Bt(l,e.rules);break}if(r.shadowRoot){l.shadowRoot||l.attachShadow({mode:"open"});const u=l.shadowRoot.childNodes,d=r.shadowRoot.childNodes;(u.length>0||d.length>0)&&Be(Array.from(u),d,l.shadowRoot,i,o)}break}case y.NodeType.Text:case y.NodeType.Comment:case y.NodeType.CDATA:t.textContent!==e.data&&(t.textContent=e.data);break}if(c&&i.applyScroll(c,!0),a&&i.applyInput(a),e.nodeName==="IFRAME"){const l=t.contentDocument,r=e;if(l){const u=o.getMeta(r.contentDocument);u&&i.mirror.add(l,Object.assign({},u)),P(l,r.contentDocument,i,o)}}}function Vt(t,e,i){const o=t.attributes,n=e.attributes;for(const s in n){const a=n[s],c=i.getMeta(e);if(c&&"isSVG"in c&&c.isSVG&&fe[s])t.setAttributeNS(fe[s],s,a);else if(e.tagName==="CANVAS"&&s==="rr_dataURL"){const l=document.createElement("img");l.src=a,l.onload=()=>{const r=t.getContext("2d");r&&r.drawImage(l,0,0,l.width,l.height)}}else t.setAttribute(s,a)}for(const{name:s}of Array.from(o))s in n||t.removeAttribute(s);e.scrollLeft&&(t.scrollLeft=e.scrollLeft),e.scrollTop&&(t.scrollTop=e.scrollTop)}function Be(t,e,i,o,n){var s;let a=0,c=t.length-1,l=0,r=e.length-1,u=t[a],d=t[c],h=e[l],f=e[r],T,v;for(;a<=c&&l<=r;)if(u===void 0)u=t[++a];else if(d===void 0)d=t[--c];else if(o.mirror.getId(u)===n.getId(h))P(u,h,o,n),u=t[++a],h=e[++l];else if(o.mirror.getId(d)===n.getId(f))P(d,f,o,n),d=t[--c],f=e[--r];else if(o.mirror.getId(u)===n.getId(f))try{i.insertBefore(u,d.nextSibling),P(u,f,o,n),u=t[++a],f=e[--r]}catch(p){console.error(p,i,u,d)}else if(o.mirror.getId(d)===n.getId(h))try{i.insertBefore(d,u),P(d,h,o,n),d=t[--c],h=e[++l]}catch(p){console.error(p,i,d,u)}else{if(!T){T={};for(let p=a;p<=c;p++){const m=t[p];m&&o.mirror.hasNode(m)&&(T[o.mirror.getId(m)]=p)}}if(v=T[n.getId(h)],v){const p=t[v];try{i.insertBefore(p,u),P(p,h,o,n),t[v]=void 0}catch(m){console.error(m,i,p,u)}}else{const p=ve(h,o.mirror,n);i.nodeName==="#document"&&((s=o.mirror.getMeta(p))===null||s===void 0?void 0:s.type)===y.NodeType.Element&&i.documentElement&&(i.removeChild(i.documentElement),t[a]=void 0,u=void 0);try{i.insertBefore(p,u||null),P(p,h,o,n)}catch(m){console.error(m,i,p,u||null)}}h=e[++l]}if(a>c){const p=e[r+1];let m=null;for(p&&i.childNodes.forEach(g=>{o.mirror.getId(g)===n.getId(p)&&(m=g)});l<=r;++l){const g=ve(e[l],o.mirror,n);try{i.insertBefore(g,m),P(g,e[l],o,n)}catch(E){console.error(E,i,g,m)}}}else if(l>r)for(;a<=c;a++){const p=t[a];p&&(i.removeChild(p),o.mirror.removeNodeFromMap(p))}}function ve(t,e,i){let o=e.getNode(i.getId(t));const n=i.getMeta(t);if(o!==null)return o;switch(t.RRNodeType){case y.NodeType.Document:o=new Document;break;case y.NodeType.DocumentType:o=document.implementation.createDocumentType(t.name,t.publicId,t.systemId);break;case y.NodeType.Element:{t.tagName.toLowerCase(),n&&"isSVG"in n&&n?.isSVG?o=document.createElementNS(fe.svg,t.tagName.toLowerCase()):o=document.createElement(t.tagName);break}case y.NodeType.Text:o=document.createTextNode(t.data);break;case y.NodeType.Comment:o=document.createComment(t.data);break;case y.NodeType.CDATA:o=document.createCDATASection(t.data);break}return n&&e.add(o,Object.assign({},n)),o}function q(t,e){const i=t[e[0]];return e.length===1?i:q(i.cssRules[e[1]].cssRules,e.slice(2))}var _;(function(t){t[t.Insert=0]="Insert",t[t.Remove=1]="Remove",t[t.Snapshot=2]="Snapshot",t[t.SetProperty=3]="SetProperty",t[t.RemoveProperty=4]="RemoveProperty"})(_||(_={}));function $e(t){const e=[...t],i=e.pop();return{positions:e,index:i}}function Bt(t,e){const i=t.sheet;e.forEach(o=>{if(o.type===_.Insert)try{if(Array.isArray(o.index)){const{positions:n,index:s}=$e(o.index);q(i.cssRules,n).insertRule(o.cssText,s)}else i.insertRule(o.cssText,o.index)}catch{}else if(o.type===_.Remove)try{if(Array.isArray(o.index)){const{positions:n,index:s}=$e(o.index);q(i.cssRules,n).deleteRule(s||0)}else i.deleteRule(o.index)}catch{}else o.type===_.SetProperty?q(i.cssRules,o.index).style.setProperty(o.property,o.value,o.priority):o.type===_.RemoveProperty&&q(i.cssRules,o.index).style.removeProperty(o.property)})}class z extends Ft(k){constructor(e){super(),this._unserializedId=-1,this.mirror=qt(),this.scrollData=null,e&&(this.mirror=e)}get unserializedId(){return this._unserializedId--}createDocument(e,i,o){return new z}createDocumentType(e,i,o){const n=new $t(e,i,o);return n.ownerDocument=this,n}createElement(e){const i=e.toUpperCase();let o;switch(i){case"AUDIO":case"VIDEO":o=new Wt(i);break;case"IFRAME":o=new zt(i,this.mirror);break;case"CANVAS":o=new jt(i);break;case"STYLE":o=new Yt(i);break;default:o=new Z(i);break}return o.ownerDocument=this,o}createComment(e){const i=new Ht(e);return i.ownerDocument=this,i}createCDATASection(e){const i=new Xt(e);return i.ownerDocument=this,i}createTextNode(e){const i=new Gt(e);return i.ownerDocument=this,i}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=-1}}const $t=Le(k);class Z extends Fe(k){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class Wt extends Pt(Z){}class jt extends Z{constructor(){super(...arguments),this.canvasMutations=[]}getContext(){return null}}class Yt extends Z{constructor(){super(...arguments),this.rules=[]}}class zt extends Z{constructor(e,i){super(e),this.contentDocument=new z,this.contentDocument.mirror=i}}const Gt=Pe(k),Ht=Ue(k),Xt=Ve(k);function Qt(t){return t instanceof HTMLFormElement?"FORM":t.tagName.toUpperCase()}function We(t,e,i,o){let n;switch(t.nodeType){case b.DOCUMENT_NODE:o&&o.nodeName==="IFRAME"?n=o.contentDocument:(n=e,n.compatMode=t.compatMode);break;case b.DOCUMENT_TYPE_NODE:const a=t;n=e.createDocumentType(a.name,a.publicId,a.systemId);break;case b.ELEMENT_NODE:const c=t,l=Qt(c);n=e.createElement(l);const r=n;for(const{name:u,value:d}of Array.from(c.attributes))r.attributes[u]=d;c.scrollLeft&&(r.scrollLeft=c.scrollLeft),c.scrollTop&&(r.scrollTop=c.scrollTop);break;case b.TEXT_NODE:n=e.createTextNode(t.textContent||"");break;case b.CDATA_SECTION_NODE:n=e.createCDATASection(t.data);break;case b.COMMENT_NODE:n=e.createComment(t.textContent||"");break;case b.DOCUMENT_FRAGMENT_NODE:n=o.attachShadow({mode:"open"});break;default:return null}let s=i.getMeta(t);return e instanceof z&&(s||(s=je(n,e.unserializedId),i.add(t,s)),e.mirror.add(n,Object.assign({},s))),n}function Jt(t,e=y.createMirror(),i=new z){function o(n,s){const a=We(n,i,e,s);a!==null&&(s?.nodeName!=="IFRAME"&&n.nodeType!==b.DOCUMENT_FRAGMENT_NODE&&(s?.appendChild(a),a.parentNode=s,a.parentElement=s),n.nodeName==="IFRAME"?o(n.contentDocument,a):(n.nodeType===b.DOCUMENT_NODE||n.nodeType===b.ELEMENT_NODE||n.nodeType===b.DOCUMENT_FRAGMENT_NODE)&&(n.nodeType===b.ELEMENT_NODE&&n.shadowRoot&&o(n.shadowRoot,a),n.childNodes.forEach(c=>o(c,a))))}return o(t,null),i}function qt(){return new Zt}class Zt{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var i;if(!e)return-1;const o=(i=this.getMeta(e))===null||i===void 0?void 0:i.id;return o??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const i=this.getId(e);this.idNodeMap.delete(i),e.childNodes&&e.childNodes.forEach(o=>this.removeNodeFromMap(o))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,i){const o=i.id;this.idNodeMap.set(o,e),this.nodeMetaMap.set(e,i)}replace(e,i){this.idNodeMap.set(e,i)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function je(t,e){switch(t.RRNodeType){case y.NodeType.Document:return{id:e,type:t.RRNodeType,childNodes:[]};case y.NodeType.DocumentType:const i=t;return{id:e,type:t.RRNodeType,name:i.name,publicId:i.publicId,systemId:i.systemId};case y.NodeType.Element:return{id:e,type:t.RRNodeType,tagName:t.tagName.toLowerCase(),attributes:{},childNodes:[]};case y.NodeType.Text:return{id:e,type:t.RRNodeType,textContent:t.textContent||""};case y.NodeType.Comment:return{id:e,type:t.RRNodeType,textContent:t.textContent||""};case y.NodeType.CDATA:return{id:e,type:t.RRNodeType,textContent:""}}}function Ye(t){return t=t||Object.create(null),{on:function(i,o){(t[i]||(t[i]=[])).push(o)},off:function(i,o){t[i]&&t[i].splice(t[i].indexOf(o)>>>0,1)},emit:function(i,o){(t[i]||[]).slice().map(function(n){n(o)}),(t["*"]||[]).slice().map(function(n){n(i,o)})}}}var Kt=Object.freeze({__proto__:null,default:Ye});function ei(t=window,e=document){if("scrollBehavior"in e.documentElement.style&&t.__forceSmoothScrollPolyfill__!==!0)return;const i=t.HTMLElement||t.Element,o=468,n={scroll:t.scroll||t.scrollTo,scrollBy:t.scrollBy,elementScroll:i.prototype.scroll||l,scrollIntoView:i.prototype.scrollIntoView},s=t.performance&&t.performance.now?t.performance.now.bind(t.performance):Date.now;function a(m){const g=["MSIE ","Trident/","Edge/"];return new RegExp(g.join("|")).test(m)}const c=a(t.navigator.userAgent)?1:0;function l(m,g){this.scrollLeft=m,this.scrollTop=g}function r(m){return .5*(1-Math.cos(Math.PI*m))}function u(m){if(m===null||typeof m!="object"||m.behavior===void 0||m.behavior==="auto"||m.behavior==="instant")return!0;if(typeof m=="object"&&m.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+m.behavior+" is not a valid value for enumeration ScrollBehavior.")}function d(m,g){if(g==="Y")return m.clientHeight+c<m.scrollHeight;if(g==="X")return m.clientWidth+c<m.scrollWidth}function h(m,g){const E=t.getComputedStyle(m,null)["overflow"+g];return E==="auto"||E==="scroll"}function f(m){const g=d(m,"Y")&&h(m,"Y"),E=d(m,"X")&&h(m,"X");return g||E}function T(m){for(;m!==e.body&&f(m)===!1;)m=m.parentNode||m.host;return m}function v(m){const g=s();let E,C,I,S=(g-m.startTime)/o;S=S>1?1:S,E=r(S),C=m.startX+(m.x-m.startX)*E,I=m.startY+(m.y-m.startY)*E,m.method.call(m.scrollable,C,I),(C!==m.x||I!==m.y)&&t.requestAnimationFrame(v.bind(t,m))}function p(m,g,E){let C,I,S,U;const M=s();m===e.body?(C=t,I=t.scrollX||t.pageXOffset,S=t.scrollY||t.pageYOffset,U=n.scroll):(C=m,I=m.scrollLeft,S=m.scrollTop,U=l),v({scrollable:C,method:U,startTime:M,startX:I,startY:S,x:g,y:E})}t.scroll=t.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){n.scroll.call(t,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:t.scrollX||t.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:t.scrollY||t.pageYOffset);return}p.call(t,e.body,arguments[0].left!==void 0?~~arguments[0].left:t.scrollX||t.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:t.scrollY||t.pageYOffset)}},t.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){n.scrollBy.call(t,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}p.call(t,e.body,~~arguments[0].left+(t.scrollX||t.pageXOffset),~~arguments[0].top+(t.scrollY||t.pageYOffset))}},i.prototype.scroll=i.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");n.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 m=arguments[0].left,g=arguments[0].top;p.call(this,this,typeof m>"u"?this.scrollLeft:~~m,typeof g>"u"?this.scrollTop:~~g)},i.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){n.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})}},i.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){n.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const m=T(this),g=m.getBoundingClientRect(),E=this.getBoundingClientRect();m!==e.body?(p.call(this,m,m.scrollLeft+E.left-g.left,m.scrollTop+E.top-g.top),t.getComputedStyle(m).position!=="fixed"&&t.scrollBy({left:g.left,top:g.top,behavior:"smooth"})):t.scrollBy({left:E.left,top:E.top,behavior:"smooth"})}}var D=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(D||{}),R=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t))(R||{}),A=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(A||{}),ae=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(ae||{}),ye=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t))(ye||{}),N=(t=>(t.Start="start",t.Pause="pause",t.Resume="resume",t.Resize="resize",t.Finish="finish",t.FullsnapshotRebuilded="fullsnapshot-rebuilded",t.LoadStylesheetStart="load-stylesheet-start",t.LoadStylesheetEnd="load-stylesheet-end",t.SkipStart="skip-start",t.SkipEnd="skip-end",t.MouseInteraction="mouse-interaction",t.EventCast="event-cast",t.CustomEvent="custom-event",t.Flush="flush",t.StateChange="state-change",t.PlayBack="play-back",t))(N||{});class ti{constructor(e=[],i){this.timeOffset=0,this.raf=null,this.actions=e,this.speed=i}addAction(e){const i=this.findActionIndex(e);this.actions.splice(i,0,e)}addActions(e){this.actions=this.actions.concat(e)}replaceActions(e){this.actions.length=0,this.actions.splice(0,0,...e)}start(){this.timeOffset=0;let e=performance.now();const{actions:i}=this,o=this;function n(){const s=performance.now();for(o.timeOffset+=(s-e)*o.speed,e=s;i.length;){const a=i[0];if(o.timeOffset>=a.delay)i.shift(),a.doAction();else break}(i.length>0||o.liveMode)&&(o.raf=requestAnimationFrame(n))}this.raf=requestAnimationFrame(n)}clear(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}toggleLiveMode(e){this.liveMode=e}isActive(){return this.raf!==null}findActionIndex(e){let i=0,o=this.actions.length-1;for(;i<=o;){const n=Math.floor((i+o)/2);if(this.actions[n].delay<e.delay)i=n+1;else if(this.actions[n].delay>e.delay)o=n-1;else return n+1}return i}}function ge(t,e){if(t.type===D.IncrementalSnapshot&&t.data.source===R.MouseMove){const i=t.data.positions[0].timeOffset,o=t.timestamp+i;return t.delay=o-e,o-e}return t.delay=t.timestamp-e,t.delay}/*! *****************************************************************************
|
|
3
2
|
Copyright (c) Microsoft Corporation.
|
|
4
3
|
|
|
5
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -12,7 +11,7 @@ var rrwebReplay=function(fe){"use strict";var L;(function(e){e[e.Document=0]="Do
|
|
|
12
11
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
12
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
13
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function
|
|
14
|
+
***************************************************************************** */function ze(t,e){var i=typeof Symbol=="function"&&t[Symbol.iterator];if(!i)return t;var o,n,s=i.call(t),a=[];try{for(;(e===void 0||e-- >0)&&!(o=s.next()).done;)a.push(o.value)}catch(c){n={error:c}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return a}var G;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(G||(G={}));var Ge={type:"xstate.init"};function Te(t){return t===void 0?[]:[].concat(t)}function Y(t){return{type:"xstate.assign",assignment:t}}function He(t,e){return typeof(t=typeof t=="string"&&e&&e[t]?e[t]:t)=="string"?{type:t}:typeof t=="function"?{type:t.name,exec:t}:t}function le(t){return function(e){return t===e}}function Xe(t){return typeof t=="string"?{type:t}:t}function Qe(t,e){return{value:t,context:e,actions:[],changed:!1,matches:le(t)}}function Je(t,e,i){var o=e,n=!1;return[t.filter(function(s){if(s.type==="xstate.assign"){n=!0;var a=Object.assign({},o);return typeof s.assignment=="function"?a=s.assignment(o,i):Object.keys(s.assignment).forEach(function(c){a[c]=typeof s.assignment[c]=="function"?s.assignment[c](o,i):s.assignment[c]}),o=a,!1}return!0}),o,n]}function qe(t,e){e===void 0&&(e={});var i=ze(Je(Te(t.states[t.initial].entry).map(function(a){return He(a,e.actions)}),t.context,Ge),2),o=i[0],n=i[1],s={config:t,_options:e,initialState:{value:t.initial,actions:o,context:n,matches:le(t.initial)},transition:function(a,c){var l,r,u=typeof a=="string"?{value:a,context:t.context}:a,d=u.value,h=u.context,f=Xe(c),T=t.states[d];if(T.on){var v=Te(T.on[f.type]);try{for(var p=function(x){var ne=typeof Symbol=="function"&&Symbol.iterator,me=ne&&x[ne],B=0;if(me)return me.call(x);if(x&&typeof x.length=="number")return{next:function(){return x&&B>=x.length&&(x=void 0),{value:x&&x[B++],done:!x}}};throw new TypeError(ne?"Object is not iterable.":"Symbol.iterator is not defined.")}(v),m=p.next();!m.done;m=p.next()){var g=m.value;if(g===void 0)return Qe(d,h);var E=typeof g=="string"?{target:g}:g,C=E.target,I=E.actions,S=I===void 0?[]:I,U=E.cond,M=U===void 0?function(){return!0}:U,oe=C===void 0,Ae=C??d,Ie=t.states[Ae];if(M(h,f)){var Q=ze(Je((oe?Te(S):[].concat(T.exit,S,Ie.entry).filter(function(x){return x})).map(function(x){return He(x,s._options.actions)}),h,f),3),V=Q[0],J=Q[1],he=Q[2],F=C??d;return{value:F,context:J,actions:V,changed:C!==d||V.length>0||he,matches:le(F)}}}}catch(x){l={error:x}}finally{try{m&&!m.done&&(r=p.return)&&r.call(p)}finally{if(l)throw l.error}}}return Qe(d,h)}};return s}var Ze=function(t,e){return t.actions.forEach(function(i){var o=i.exec;return o&&o(t.context,e)})};function Ke(t){var e=t.initialState,i=G.NotStarted,o=new Set,n={_machine:t,send:function(s){i===G.Running&&(e=t.transition(e,s),Ze(e,Xe(s)),o.forEach(function(a){return a(e)}))},subscribe:function(s){return o.add(s),s(e),{unsubscribe:function(){return o.delete(s)}}},start:function(s){if(s){var a=typeof s=="object"?s:{context:t.config.context,value:s};e={value:a.value,actions:[],context:a.context,matches:le(a.value)}}return i=G.Running,Ze(e,Ge),n},stop:function(){return i=G.Stopped,o.clear(),n},get state(){return e},get status(){return i}};return n}var ii=Object.defineProperty,oi=Object.defineProperties,ni=Object.getOwnPropertyDescriptors,et=Object.getOwnPropertySymbols,ri=Object.prototype.hasOwnProperty,si=Object.prototype.propertyIsEnumerable,tt=(t,e,i)=>e in t?ii(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,ce=(t,e)=>{for(var i in e||(e={}))ri.call(e,i)&&tt(t,i,e[i]);if(et)for(var i of et(e))si.call(e,i)&&tt(t,i,e[i]);return t},ue=(t,e)=>oi(t,ni(e));function ai(t,e){for(let i=t.length-1;i>=0;i--){const o=t[i];if(o.type===D.Meta&&o.timestamp<=e)return t.slice(i)}return t}function li(t,{getCastFn:e,applyEventsSynchronously:i,emitter:o}){const n=qe({id:"player",context:t,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]},REPLACE_EVENTS:{target:"playing",actions:["replaceEvents"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]},REPLACE_EVENTS:{target:"paused",actions:["replaceEvents"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:Y({lastPlayedEvent:(s,a)=>a.type==="CAST_EVENT"?a.payload.event:s.lastPlayedEvent}),recordTimeOffset:Y((s,a)=>{let c=s.timeOffset;return"payload"in a&&"timeOffset"in a.payload&&(c=a.payload.timeOffset),ue(ce({},s),{timeOffset:c,baselineTime:s.events[0].timestamp+c})}),play(s){var a;const{timer:c,events:l,baselineTime:r,lastPlayedEvent:u}=s;c.clear();for(const v of l)ge(v,r);const d=ai(l,r);let h=u?.timestamp;u?.type===D.IncrementalSnapshot&&u.data.source===R.MouseMove&&(h=u.timestamp+((a=u.data.positions[0])==null?void 0:a.timeOffset)),r<(h||0)&&o.emit(N.PlayBack);const f=new Array,T=new Array;for(const v of d)if(!(h&&h<r&&(v.timestamp<=h||v===u)))if(v.timestamp<r)f.push(v);else{const p=e(v,!1);T.push({doAction:()=>{p()},delay:v.delay})}i(f),o.emit(N.Flush),c.addActions(T),c.start()},pause(s){s.timer.clear()},resetLastPlayedEvent:Y(s=>ue(ce({},s),{lastPlayedEvent:null})),startLive:Y({baselineTime:(s,a)=>(s.timer.toggleLiveMode(!0),s.timer.start(),a.type==="TO_LIVE"&&a.payload.baselineTime?a.payload.baselineTime:Date.now())}),replaceEvents:Y((s,a)=>{const{events:c,timer:l,baselineTime:r}=s;if(a.type==="REPLACE_EVENTS"){const{events:u}=a.payload;c.length=0;const d=[];for(const h of u)if(ge(h,r),c.push(h),h.timestamp>=l.timeOffset+r){const f=e(h,!1);d.push({doAction:()=>{f()},delay:h.delay})}l.isActive()&&l.replaceActions(d)}return ue(ce({},s),{events:c})}),addEvent:Y((s,a)=>{const{baselineTime:c,timer:l,events:r}=s;if(a.type==="ADD_EVENT"){const{event:u}=a.payload;ge(u,c);let d=r.length-1;if(!r[d]||r[d].timestamp<=u.timestamp)r.push(u);else{let T=-1,v=0;for(;v<=d;){const p=Math.floor((v+d)/2);r[p].timestamp<=u.timestamp?v=p+1:d=p-1}T===-1&&(T=v),r.splice(T,0,u)}const h=u.timestamp<c,f=e(u,h);h?f():l.isActive()&&l.addAction({doAction:()=>{f()},delay:u.delay})}return ue(ce({},s),{events:r})})}});return Ke(n)}function ci(t){const e=qe({id:"speed",context:t,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(i,o)=>{"payload"in o&&i.timer.setSpeed(o.payload.speed)},recordSpeed:Y({normalSpeed:i=>i.timer.speed}),restoreSpeed:i=>{i.timer.setSpeed(i.normalSpeed)}}});return Ke(e)}const H=`Please stop import mirror directly. Instead of that,\r
|
|
16
15
|
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(ie),-1},getNode(){return console.error(ie),null},removeNodeFromMap(){console.error(ie)},has(){return console.error(ie),!1},reset(){console.error(ie)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(mt=new Proxy(mt,{get(e,t,r){return t==="map"&&console.error(ie),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 u=t[s];if(u.parent){const c=u.parent.children.indexOf(u);u.parent.children.splice(c,0,r(i,u.parent))}else{const c=n.indexOf(u);n.splice(c,0,r(i,null))}continue}if(a in t){const u=t[a];u.children.push(r(i,u));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),u=s.height/i.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:u,absoluteScale:a.absoluteScale*u}}function vt(e){return Boolean(e?.shadowRoot)}function le(e,t){const r=e[t[0]];return t.length===1?r:le(r.cssRules[t[1]].cssRules,t.slice(2))}function 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+/",ue=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ne=0;Ne<yt.length;Ne++)ue[yt.charCodeAt(Ne)]=Ne;var Fr=function(e){var t=e.length*.75,r=e.length,n,i=0,s,a,u,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var o=new ArrayBuffer(t),l=new Uint8Array(o);for(n=0;n<r;n+=4)s=ue[e.charCodeAt(n)],a=ue[e.charCodeAt(n+1)],u=ue[e.charCodeAt(n+2)],c=ue[e.charCodeAt(n+3)],l[i++]=s<<2|a>>4,l[i++]=(a&15)<<4|u>>2,l[i++]=(u&3)<<6|c&63;return o},Pr=(e,t,r)=>new Promise((n,i)=>{var s=c=>{try{u(r.next(c))}catch(o){i(o)}},a=c=>{try{u(r.throw(c))}catch(o){i(o)}},u=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);u((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 X(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 X(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(X(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(X(e,t,r)));return new Blob(i,{type:n.type})}}else if(Array.isArray(n))return yield Promise.all(n.map(X(e,t,r)));return n})}var Ur=(e,t,r)=>new Promise((n,i)=>{var s=c=>{try{u(r.next(c))}catch(o){i(o)}},a=c=>{try{u(r.throw(c))}catch(o){i(o)}},u=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);u((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 u=a[t.property],c=yield Promise.all(t.args.map(X(i,a))),o=u.apply(a,c);Vr(a,o)}catch(a){s(t,a)}})}var jr=(e,t,r)=>new Promise((n,i)=>{var s=c=>{try{u(r.next(c))}catch(o){i(o)}},a=c=>{try{u(r.throw(c))}catch(o){i(o)}},u=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);u((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 u=a[r.property];if(r.property==="drawImage"&&typeof r.args[0]=="string"){const c=i.get(t);u.apply(a,r.args)}else{const c=yield Promise.all(r.args.map(X(i,a)));u.apply(a,c)}}catch(a){s(r,a)}})}var Gr=(e,t,r)=>new Promise((n,i)=>{var s=c=>{try{u(r.next(c))}catch(o){i(o)}},a=c=>{try{u(r.throw(c))}catch(o){i(o)}},u=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);u((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 u=s.get(t)||r,c="commands"in u?u.commands:[u];if([ge.WebGL,ge.WebGL2].includes(r.type)){for(let o=0;o<c.length;o++){const l=c[o];yield Wr({mutation:l,type:r.type,target:n,imageMap:i,errorHandler:a})}return}for(let o=0;o<c.length;o++){const l=c[o];yield Hr({event:t,mutation:l,target:n,imageMap:i,errorHandler:a})}}catch(u){a(r,u)}})}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,oe=(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{u(r.next(c))}catch(o){i(o)}},a=c=>{try{u(r.throw(c))}catch(o){i(o)}},u=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);u((r=r.apply(e,t)).next())});const Dt=10*1e3,Ct=2*1e3,xt=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==S.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 re,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 u={mirror:this.mirror,applyCanvas:(c,o,l)=>{Nt({event:c,mutation:o,target:l,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,u,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],l=Ce(o.node,this.mirror,this.virtualDom.mirror);Y(l,o.node,u,this.virtualDom.mirror),o.node=l}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(u=>r&&r.unpackFn?r.unpackFn(u):u).sort((u,c)=>u.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(u=>{this.emitter.emit(D.StateChange,{player:u})}),this.speedService=Ir({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(u=>{this.emitter.emit(D.StateChange,{speed:u})});const s=this.service.state.context.events.find(u=>u.type===S.Meta),a=this.service.state.context.events.find(u=>u.type===S.FullSnapshot);if(s){const{width:u,height:c}=s.data;setTimeout(()=>{this.emitter.emit(D.Resize,{width:u,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 u=n[a-1],c=n[a];c.timestamp-u.timestamp>Dt?t.push({startTime:u.timestamp,endTime:c.timestamp,duration:c.timestamp-u.timestamp,active:!1}):t.push({startTime:u.timestamp,endTime:c.timestamp,duration:c.timestamp-u.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 S.DomContentLoaded:case S.Load:case S.Custom:continue;case S.FullSnapshot:case S.Meta:case S.Plugin:case S.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 S.DomContentLoaded:case S.Load:break;case S.Custom:n=()=>{this.emitter.emit(D.CustomEvent,t)};break;case S.Meta:n=()=>this.emitter.emit(D.Resize,{width:t.data.width,height:t.data.height});break;case S.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 S.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===S.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(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<xt?n/xt: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:u}of n)this.attachDocumentToIframe(a,u),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===L.Element&&a?.tagName.toUpperCase()==="HTML"){const{documentElement:u,head:c}=r.contentDocument;this.insertStyleRules(u,c)}},cache:this.cache});for(const{mutationInQueue:s,builtNode:a}of i)this.attachDocumentToIframe(s,a),this.newDocumentQueue=this.newDocumentQueue.filter(u=>u!==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 u=()=>{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),u())}))}),n.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(D.LoadStylesheetStart),i=setTimeout(()=>{s.matches("playing")&&this.play(this.getCurrentTime()),i=-1,u()},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===S.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(X(this.imageMap,null,n)));return Ae(oe({},s),{args:a})})));n.isUnchanged===!1&&this.canvasEventMap.set(r,Ae(oe({},t),{commands:i}))}else{const i=yield Promise.all(t.args.map(X(this.imageMap,null,n)));n.isUnchanged===!1&&this.canvasEventMap.set(r,Ae(oe({},t),{args:i}))}}})}applyIncremental(t,r){var n,i,s,a,u,c;const{data:o}=t;switch(o.source){case I.Mutation:{try{this.applyMutation(o,r)}catch(l){this.warn(`Exception in mutation ${l.message||l}`,o)}break}case I.Drag:case I.TouchMove:case I.MouseMove:if(r){const l=o.positions[o.positions.length-1];this.mousePos={x:l.x,y:l.y,id:l.id,debugData:o}}else o.positions.forEach(l=>{const d={doAction:()=>{this.moveAndHover(l.x,l.y,l.id,r,o)},delay:l.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 l=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:m}=this.config;switch(o.type){case U.Blur:"blur"in d&&d.blur();break;case U.Focus:m&&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(l)}break}case I.Scroll:{if(o.id===-1)break;if(this.usingVirtualDom){const l=this.virtualDom.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);l.scrollData=o;break}this.applyScroll(o,r);break}case I.ViewportResize:this.emitter.emit(D.Resize,{width:o.width,height:o.height});break;case I.Input:{if(o.id===-1)break;if(this.usingVirtualDom){const l=this.virtualDom.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);l.inputData=o;break}this.applyInput(o);break}case I.MediaInteraction:{const l=this.usingVirtualDom?this.virtualDom.mirror.getNode(o.id):this.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);const d=l;try{o.currentTime&&(d.currentTime=o.currentTime),o.volume&&(d.volume=o.volume),o.muted&&(d.muted=o.muted),o.type===xe.Pause&&d.pause(),o.type===xe.Play&&d.play()}catch(m){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${m.message||m}`)}break}case I.StyleSheetRule:{if(this.usingVirtualDom){const l=this.virtualDom.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);const d=l.rules;(i=o.adds)==null||i.forEach(({rule:m,index:f})=>d?.push({cssText:m,index:f,type:j.Insert})),(s=o.removes)==null||s.forEach(({index:m})=>d?.push({index:m,type:j.Remove}))}else{const l=this.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);const d=l.sheet;(a=o.adds)==null||a.forEach(({rule:m,index:f})=>{try{if(Array.isArray(f)){const{positions:y,index:v}=gt(f);le(d.cssRules,y).insertRule(m,v)}else{const y=f===void 0?void 0:Math.min(f,d.cssRules.length);d.insertRule(m,y)}}catch{}}),(u=o.removes)==null||u.forEach(({index:m})=>{try{if(Array.isArray(m)){const{positions:f,index:y}=gt(m);le(d.cssRules,f).deleteRule(y||0)}else d?.deleteRule(m)}catch{}})}break}case I.StyleDeclaration:{if(this.usingVirtualDom){const l=this.virtualDom.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);const d=l.rules;o.set&&d.push(oe({type:j.SetProperty,index:o.index},o.set)),o.remove&&d.push(oe({type:j.RemoveProperty,index:o.index},o.remove))}else{const l=this.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);const d=l.sheet;o.set&&le(d.rules,o.index).style.setProperty(o.set.property,o.set.value,o.set.priority),o.remove&&le(d.rules,o.index).style.removeProperty(o.remove.property)}break}case I.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const l=this.virtualDom.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);l.canvasMutations.push({event:t,mutation:o})}else{const l=this.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);Nt({event:t,mutation:o,target:l,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case I.Font:{try{const l=new FontFace(o.family,o.buffer?new Uint8Array(JSON.parse(o.fontSource)):o.fontSource,o.descriptors);(c=this.iframe.contentDocument)==null||c.fonts.add(l)}catch(l){this.config.showWarning&&console.warn(l)}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 l=this.legacy_missingNodeRetryMap[o],d=Ke(l.node,this.virtualDom,this.mirror);d&&(l.node=d)}catch(l){this.config.showWarning&&console.warn(l)}const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes.forEach(o=>{var l;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 m=n.getNode(o.parentId);if(!m)return this.warnNodeNotFound(t,o.parentId);if(o.isShadow&&vt(m)&&(m=m.shadowRoot),n.removeNodeFromMap(d),m)try{m.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&m.nodeName==="STYLE"&&((l=m.rules)==null?void 0:l.length)>0&&(m.rules=[])}catch(f){if(f instanceof DOMException)this.warn("parent could not remove child in mutation",m,d,t);else throw f}});const i=oe({},this.legacy_missingNodeRetryMap),s=[],a=o=>{let l=null;return o.nextId&&(l=n.getNode(o.nextId)),o.nextId!==null&&o.nextId!==void 0&&o.nextId!==-1&&!l},u=o=>{var l;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 m=null,f=null;if(o.previousId&&(m=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 y=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:y,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 h=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const T of h)T.nodeType===d.TEXT_NODE&&d.removeChild(T)}if(m&&m.nextSibling&&m.nextSibling.parentNode)d.insertBefore(v,m.nextSibling);else if(f&&f.parentNode)d.contains(f)?d.insertBefore(v,f):d.insertBefore(v,null);else{if(d===y)for(;y.firstChild;)y.removeChild(y.firstChild);d.appendChild(v)}if(this.usingVirtualDom&&v.nodeName==="#text"&&d.nodeName==="STYLE"&&((l=d.rules)==null?void 0:l.length)>0&&(d.rules=[]),Re(v,this.mirror)){const h=this.mirror.getId(v),T=this.newDocumentQueue.find(N=>N.parentId===h);T&&(this.attachDocumentToIframe(T,v),this.newDocumentQueue=this.newDocumentQueue.filter(N=>N!==T))}(o.previousId||o.nextId)&&this.legacy_resolveMissingNode(i,d,v,o)};t.adds.forEach(o=>{u(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 l of o)n.getNode(l.value.parentId)?pt(l,d=>{u(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",l)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),_r(t.texts).forEach(o=>{var l;const d=n.getNode(o.id);if(!d)return t.removes.find(m=>m.id===o.id)?void 0:this.warnNodeNotFound(t,o.id);if(d.textContent=o.value,this.usingVirtualDom){const m=d.parentNode;((l=m?.rules)==null?void 0:l.length)>0&&(m.rules=[])}}),t.attributes.forEach(o=>{const l=n.getNode(o.id);if(!l)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 m=o.attributes[d];if(m===null)l.removeAttribute(d);else if(typeof m=="string")try{l.setAttribute(d,m)}catch(f){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",f)}else if(d==="style"){const f=m,y=l;for(const v in f)if(f[v]===!1)y.style.removeProperty(v);else if(f[v]instanceof Array){const E=f[v];y.style.setProperty(v,E[0],E[1])}else{const E=f[v];y.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,u=s&&t[s],c=a&&t[a];if(u){const{node:o,mutation:l}=u;r.insertBefore(o,n),delete t[l.node.id],delete this.legacy_missingNodeRetryMap[l.node.id],(l.previousId||l.nextId)&&this.legacy_resolveMissingNode(t,r,o,l)}if(c){const{node:o,mutation:l}=c;r.insertBefore(o,n.nextSibling),delete t[l.node.id],delete this.legacy_missingNodeRetryMap[l.node.id],(l.previousId||l.nextId)&&this.legacy_resolveMissingNode(t,r,o,l)}}moveAndHover(t,r,n,i,s){const a=this.mirror.getNode(n);if(!a)return this.debugNodeNotFound(s,n);const u=ft(a,this.iframe),c=t*u.absoluteScale+u.x,o=r*u.absoluteScale+u.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 u=this.mouseTail.getContext("2d");!u||!this.tailPositions.length||(u.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),u.beginPath(),u.lineWidth=n,u.lineCap=r,u.strokeStyle=i,u.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(c=>u.lineTo(c.x,c.y)),u.stroke())};this.tailPositions.push(t),a(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(u=>u!==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!==S.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(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 B=Uint8Array,Q=Uint16Array,Le=Uint32Array,St=new B([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 B([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 B([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 Q(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(St,2),Ot=It[0],en=It[1];Ot[28]=258,en[258]=28;for(var tn=At(Rt,0),rn=tn[0],Fe=new Q(32768),x=0;x<32768;++x){var J=(x&43690)>>>1|(x&21845)<<1;J=(J&52428)>>>2|(J&13107)<<2,J=(J&61680)>>>4|(J&3855)<<4,Fe[x]=((J&65280)>>>8|(J&255)<<8)>>>1}for(var de=function(e,t,r){for(var n=e.length,i=0,s=new Q(t);i<n;++i)++s[e[i]-1];var a=new Q(t);for(i=0;i<t;++i)a[i]=a[i-1]+s[i-1]<<1;var u;if(r){u=new Q(1<<t);var c=15-t;for(i=0;i<n;++i)if(e[i])for(var o=i<<4|e[i],l=t-e[i],d=a[e[i]-1]++<<l,m=d|(1<<l)-1;d<=m;++d)u[Fe[d]>>>c]=o}else for(u=new Q(n),i=0;i<n;++i)u[i]=Fe[a[e[i]-1]++]>>>15-e[i];return u},he=new B(288),x=0;x<144;++x)he[x]=8;for(var x=144;x<256;++x)he[x]=9;for(var x=256;x<280;++x)he[x]=7;for(var x=280;x<288;++x)he[x]=8;for(var kt=new B(32),x=0;x<32;++x)kt[x]=5;var nn=de(he,9,1),on=de(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 Q?Q:e instanceof Le?Le:B)(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 B(n*3));var a=function(Pt){var Ut=t.length;if(Pt>Ut){var $t=new B(Math.max(Ut*2,Pt));$t.set(t),t=$t}},u=r.f||0,c=r.p||0,o=r.b||0,l=r.l,d=r.d,m=r.m,f=r.n,y=n*8;do{if(!l){r.f=u=H(e,c,1);var v=H(e,c+1,3);if(c+=3,v)if(v==1)l=nn,d=on,m=9,f=5;else if(v==2){var N=H(e,c,31)+257,R=H(e,c+10,15)+4,F=N+H(e,c+5,31)+1;c+=14;for(var O=new B(F),M=new B(19),k=0;k<R;++k)M[Kr[k]]=H(e,c+k*3,7);c+=R*3;var V=Pe(M),me=(1<<V)-1;if(!s&&c+F*(V+7)>y)break;for(var pe=de(M,V,1),k=0;k<F;){var q=pe[H(e,c,me)];c+=q&15;var E=q>>>4;if(E<16)O[k++]=E;else{var G=0,Z=0;for(E==16?(Z=3+H(e,c,3),c+=2,G=O[k-1]):E==17?(Z=3+H(e,c,7),c+=3):E==18&&(Z=11+H(e,c,127),c+=7);Z--;)O[k++]=G}}var se=O.subarray(0,N),$=O.subarray(N);m=Pe(se),f=Pe($),l=de(se,m,1),d=de($,f,1)}else throw"invalid block type";else{var E=sn(c)+4,h=e[E-4]|e[E-3]<<8,T=E+h;if(T>n){if(s)throw"unexpected EOF";break}i&&a(o+h),t.set(e.subarray(E,T),o),r.b=o+=h,r.p=c=T*8;continue}if(c>y)throw"unexpected EOF"}i&&a(o+131072);for(var _=(1<<m)-1,te=(1<<f)-1,g=m+f+18;s||c+g<y;){var G=l[Ue(e,c)&_],p=G>>>4;if(c+=G&15,c>y)throw"unexpected EOF";if(!G)throw"invalid length/literal";if(p<256)t[o++]=p;else if(p==256){l=null;break}else{var b=p-254;if(p>264){var k=p-257,C=St[k];b=H(e,c,(1<<C)-1)+Ot[k],c+=C}var P=d[Ue(e,c)&te],K=P>>>4;if(!P)throw"invalid distance";c+=P&15;var $=rn[K];if(K>3){var C=Rt[K];$+=Ue(e,c)&(1<<C)-1,c+=C}if(c>y)throw"unexpected EOF";i&&a(o+131072);for(var Ft=o+b;o<Ft;o+=4)t[o]=t[o-$],t[o+1]=t[o+1-$],t[o+2]=t[o+2-$],t[o+3]=t[o+3-$];o=Ft}}r.l=l,r.p=c,r.b=o,l&&(u=1,r.m=m,r.d=d,r.n=f)}while(!u);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 B(e.length+(e.length>>>1)),i=0,s=function(o){n[i++]=o},a=0;a<r;++a){if(i+5>n.length){var u=new B(i+8+(r-a<<1));u.set(n),n=u}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}({});
|
|
16
|
+
or you can use record.mirror to access the mirror instance during recording.`;let it={map:{},getId(){return console.error(H),-1},getNode(){return console.error(H),null},removeNodeFromMap(){console.error(H)},has(){return console.error(H),!1},reset(){console.error(H)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(it=new Proxy(it,{get(t,e,i){return e==="map"&&console.error(H),Reflect.get(t,e,i)}}));function ui(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do if(this===e)return!0;while(e=e&&e.parentNode);return!1})}function di(t){const e={},i=(n,s)=>{const a={value:n,parent:s,children:[]};return e[n.node.id]=a,a},o=[];for(const n of t){const{nextId:s,parentId:a}=n;if(s&&s in e){const c=e[s];if(c.parent){const l=c.parent.children.indexOf(c);c.parent.children.splice(l,0,i(n,c.parent))}else{const l=o.indexOf(c);o.splice(l,0,i(n,null))}continue}if(a in e){const c=e[a];c.children.push(i(n,c));continue}o.push(i(n,null))}return o}function ot(t,e){e(t.value);for(let i=t.children.length-1;i>=0;i--)ot(t.children[i],e)}function Ne(t,e){return Boolean(t.nodeName==="IFRAME"&&e.getMeta(t))}function nt(t,e){var i,o;const n=(o=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:o.frameElement;if(!n||n===e)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=n.getBoundingClientRect(),a=nt(n,e),c=s.height/n.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:c,absoluteScale:a.absoluteScale*c}}function rt(t){return Boolean(t?.shadowRoot)}function K(t,e){const i=t[e[0]];return e.length===1?i:K(i.cssRules[e[1]].cssRules,e.slice(2))}function st(t){const e=[...t],i=e.pop();return{positions:e,index:i}}function hi(t){const e=new Set,i=[];for(let o=t.length;o--;){const n=t[o];e.has(n.id)||(i.push(n),e.add(n.id))}return i}const mi=t=>[`.${t} { background: currentColor }`,"noscript { display: none !important; }",`.${t} { background: currentColor; border-radius: 5px; }`,`.${t}:hover::after {content: 'Redacted'; color: white; background: black; text-align: center; width: 100%; display: block;}`];for(var at="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ee=typeof Uint8Array>"u"?[]:new Uint8Array(256),de=0;de<at.length;de++)ee[at.charCodeAt(de)]=de;var pi=function(t){var e=t.length*.75,i=t.length,o,n=0,s,a,c,l;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);var r=new ArrayBuffer(e),u=new Uint8Array(r);for(o=0;o<i;o+=4)s=ee[t.charCodeAt(o)],a=ee[t.charCodeAt(o+1)],c=ee[t.charCodeAt(o+2)],l=ee[t.charCodeAt(o+3)],u[n++]=s<<2|a>>4,u[n++]=(a&15)<<4|c>>2,u[n++]=(c&3)<<6|l&63;return r},fi=(t,e,i)=>new Promise((o,n)=>{var s=l=>{try{c(i.next(l))}catch(r){n(r)}},a=l=>{try{c(i.throw(l))}catch(r){n(r)}},c=l=>l.done?o(l.value):Promise.resolve(l.value).then(s,a);c((i=i.apply(t,e)).next())});const lt=new Map;function ct(t,e){let i=lt.get(t);return i||(i=new Map,lt.set(t,i)),i.has(e)||i.set(e,[]),i.get(e)}function $(t,e,i){return o=>fi(this,null,function*(){if(o&&typeof o=="object"&&"rr_type"in o)if(i&&(i.isUnchanged=!1),o.rr_type==="ImageBitmap"&&"args"in o){const n=yield $(t,e,i)(o.args);return yield createImageBitmap.apply(null,n)}else if("index"in o){if(i||e===null)return o;const{rr_type:n,index:s}=o;return ct(e,n)[s]}else if("args"in o){const{rr_type:n,args:s}=o,a=window[n];return new a(...yield Promise.all(s.map($(t,e,i))))}else{if("base64"in o)return pi(o.base64);if("src"in o){const n=t.get(o.src);if(n)return n;{const s=new Image;return s.src=o.src,t.set(o.src,s),s}}else if("data"in o&&o.rr_type==="Blob"){const n=yield Promise.all(o.data.map($(t,e,i)));return new Blob(n,{type:o.type})}}else if(Array.isArray(o))return yield Promise.all(o.map($(t,e,i)));return o})}var vi=(t,e,i)=>new Promise((o,n)=>{var s=l=>{try{c(i.next(l))}catch(r){n(r)}},a=l=>{try{c(i.throw(l))}catch(r){n(r)}},c=l=>l.done?o(l.value):Promise.resolve(l.value).then(s,a);c((i=i.apply(t,e)).next())});function yi(t,e){try{return e===ae.WebGL?t.getContext("webgl")||t.getContext("experimental-webgl"):t.getContext("webgl2")}catch{return null}}const gi=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Ti(t,e){if(!(e!=null&&e.constructor))return;const{name:i}=e.constructor;if(!gi.includes(i))return;const o=ct(t,i);o.includes(e)||o.push(e)}function Ni(t){return vi(this,arguments,function*({mutation:e,target:i,type:o,imageMap:n,errorHandler:s}){try{const a=yi(i,o);if(!a)return;if(e.setter){a[e.property]=e.args[0];return}const c=a[e.property],l=yield Promise.all(e.args.map($(n,a))),r=c.apply(a,l);Ti(a,r)}catch(a){s(e,a)}})}var Ei=(t,e,i)=>new Promise((o,n)=>{var s=l=>{try{c(i.next(l))}catch(r){n(r)}},a=l=>{try{c(i.throw(l))}catch(r){n(r)}},c=l=>l.done?o(l.value):Promise.resolve(l.value).then(s,a);c((i=i.apply(t,e)).next())});function wi(t){return Ei(this,arguments,function*({event:e,mutation:i,target:o,imageMap:n,errorHandler:s}){try{const a=o.getContext("2d");if(i.setter){a[i.property]=i.args[0];return}const c=a[i.property];if(i.property==="drawImage"&&typeof i.args[0]=="string"){const l=n.get(e);c.apply(a,i.args)}else{const l=yield Promise.all(i.args.map($(n,a)));c.apply(a,l)}}catch(a){s(i,a)}})}var Di=(t,e,i)=>new Promise((o,n)=>{var s=l=>{try{c(i.next(l))}catch(r){n(r)}},a=l=>{try{c(i.throw(l))}catch(r){n(r)}},c=l=>l.done?o(l.value):Promise.resolve(l.value).then(s,a);c((i=i.apply(t,e)).next())});function ut(t){return Di(this,arguments,function*({event:e,mutation:i,target:o,imageMap:n,canvasEventMap:s,errorHandler:a}){try{const c=s.get(e)||i,l="commands"in c?c.commands:[c];if([ae.WebGL,ae.WebGL2].includes(i.type)){for(let r=0;r<l.length;r++){const u=l[r];yield Ni({mutation:u,type:i.type,target:o,imageMap:n,errorHandler:a})}return}for(let r=0;r<l.length;r++){const u=l[r];yield wi({event:e,mutation:u,target:o,imageMap:n,errorHandler:a})}}catch(c){a(i,c)}})}var bi=Object.defineProperty,Ri=Object.defineProperties,xi=Object.getOwnPropertyDescriptors,dt=Object.getOwnPropertySymbols,Ci=Object.prototype.hasOwnProperty,Si=Object.prototype.propertyIsEnumerable,ht=(t,e,i)=>e in t?bi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,X=(t,e)=>{for(var i in e||(e={}))Ci.call(e,i)&&ht(t,i,e[i]);if(dt)for(var i of dt(e))Si.call(e,i)&&ht(t,i,e[i]);return t},Ee=(t,e)=>Ri(t,xi(e)),we=(t,e,i)=>new Promise((o,n)=>{var s=l=>{try{c(i.next(l))}catch(r){n(r)}},a=l=>{try{c(i.throw(l))}catch(r){n(r)}},c=l=>l.done?o(l.value):Promise.resolve(l.value).then(s,a);c((i=i.apply(t,e)).next())});const mt=10*1e3,pt=2*1e3,ft=1*1e3,vt=60*60*1e3,Mi=Ye||Kt,De="[replayer]",be={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Re(t){return t.type==D.IncrementalSnapshot&&(t.data.source==R.TouchMove||t.data.source==R.MouseInteraction&&t.data.type==A.TouchStart)}class Ai{constructor(e,i){if(this.usingVirtualDom=!1,this.virtualDom=new z,this.mouseTail=null,this.tailPositions=[],this.emitter=Mi(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=y.createCache(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=y.createMirror(),this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,!(i!=null&&i.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const o={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"highlight-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:be,useVirtualDom:!0,inactiveThreshold:.02,inactiveSkipTime:pt};this.config=Object.assign({},o,i),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(N.Resize,this.handleResize),this.setupDom(),this.emitter.on(N.Flush,()=>{if(this.usingVirtualDom){const c={mirror:this.mirror,applyCanvas:(l,r,u)=>{ut({event:l,mutation:r,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this)};if(P(this.iframe.contentDocument,this.virtualDom,c,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const l in this.legacy_missingNodeRetryMap)try{const r=this.legacy_missingNodeRetryMap[l],u=ve(r.node,this.mirror,this.virtualDom.mirror);P(u,r.node,c,this.virtualDom.mirror),r.node=u}catch(r){this.config.showWarning&&console.warn(r)}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null}),this.emitter.on(N.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset()});const n=new ti([],i?.speed||o.speed);this.service=li({events:e.map(c=>i&&i.unpackFn?i.unpackFn(c):c).sort((c,l)=>c.timestamp-l.timestamp),timer:n,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(c=>{this.emitter.emit(N.StateChange,{player:c})}),this.speedService=ci({normalSpeed:-1,timer:n}),this.speedService.start(),this.speedService.subscribe(c=>{this.emitter.emit(N.StateChange,{speed:c})});const s=this.service.state.context.events.find(c=>c.type===D.Meta),a=this.service.state.context.events.find(c=>c.type===D.FullSnapshot);if(s){const{width:c,height:l}=s.data;setTimeout(()=>{this.emitter.emit(N.Resize,{width:c,height:l})},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(Re)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,i){return this.emitter.on(e,i),this}off(e,i){return this.emitter.off(e,i),this}setConfig(e){Object.keys(e).forEach(i=>{this.config[i]=e[i]}),this.config.skipInactive||this.backToNormal(),typeof e.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail<"u"&&(e.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getActivityIntervals(){if(this.activityIntervals.length==0){const e=[],i=this.getMetaData(),o=[{timestamp:i.startTime},...this.service.state.context.events.filter(a=>this.isUserInteraction(a)),{timestamp:i.endTime}];for(let a=1;a<o.length;a++){const c=o[a-1],l=o[a];l.timestamp-c.timestamp>mt?e.push({startTime:c.timestamp,endTime:l.timestamp,duration:l.timestamp-c.timestamp,active:!1}):e.push({startTime:c.timestamp,endTime:l.timestamp,duration:l.timestamp-c.timestamp,active:!0})}const n=[];let s=e[0];for(let a=1;a<e.length;a++)e[a].active!=e[a-1].active&&(n.push({startTime:s.startTime,endTime:e[a-1].endTime,duration:e[a-1].endTime-s.startTime,active:e[a-1].active}),s=e[a]);s&&e.length>0&&n.push({startTime:s.startTime,endTime:e[e.length-1].endTime,duration:e[e.length-1].endTime-s.startTime,active:e[e.length-1].active}),s=n[0];for(let a=1;a<n.length;a++)(!n[a].active&&n[a].duration>this.config.inactiveThreshold*i.totalTime||!n[a-1].active&&n[a-1].duration>this.config.inactiveThreshold*i.totalTime)&&(this.activityIntervals.push({startTime:s.startTime,endTime:n[a-1].endTime,duration:n[a-1].endTime-s.startTime,active:n[a-1].active}),s=n[a]);s&&n.length>0&&this.activityIntervals.push({startTime:s.startTime,endTime:n[n.length-1].endTime,duration:n[n.length-1].endTime-s.startTime,active:n[n.length-1].active})}return this.activityIntervals}getMetaData(){const e=this.service.state.context.events[0],i=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:i.timestamp,totalTime:i.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:i}=this.service.state.context;return e-i[0].timestamp}getMirror(){return this.mirror}play(e=0){var i,o;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(o=(i=this.iframe.contentDocument)==null?void 0:i.getElementsByTagName("html")[0])==null||o.classList.remove("rrweb-paused"),this.emitter.emit(N.Start),this.handleInactivity(this.getMetaData().startTime+e,!0)}pause(e){var i,o;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(o=(i=this.iframe.contentDocument)==null?void 0:i.getElementsByTagName("html")[0])==null||o.classList.add("rrweb-paused"),this.emitter.emit(N.Pause)}resume(e=0){console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(N.Resume)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const i=this.config.unpackFn?this.config.unpackFn(e):e;Re(i)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:i}}))}replaceEvents(e){for(const i of e)if(Re(i)){this.mouse.classList.add("touch-device");break}this.service.send({type:"REPLACE_EVENTS",payload:{events:e}})}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=y.createCache()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(ei(this.iframe.contentWindow,this.iframe.contentDocument),ui(this.iframe.contentWindow))}handleResize(e){this.iframe.style.display="inherit";for(const i of[this.mouseTail,this.iframe])!i||(i.setAttribute("width",String(e.width)),i.setAttribute("height",String(e.height)))}applyEventsSynchronously(e){for(const i of e){switch(i.type){case D.DomContentLoaded:case D.Load:case D.Custom:continue;case D.FullSnapshot:case D.Meta:case D.Plugin:case D.IncrementalSnapshot:break}this.getCastFn(i,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null}getCastFn(e,i=!1){let o;switch(e.type){case D.DomContentLoaded:case D.Load:break;case D.Custom:o=()=>{this.emitter.emit(N.CustomEvent,e)};break;case D.Meta:o=()=>this.emitter.emit(N.Resize,{width:e.data.width,height:e.data.height});break;case D.FullSnapshot:o=()=>{if(this.firstFullSnapshot){if(this.firstFullSnapshot===e){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(e,i),this.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case D.IncrementalSnapshot:o=()=>{if(this.applyIncremental(e,i),!i&&(this.handleInactivity(e.timestamp),e===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const n of this.service.state.context.events)if(!(n.timestamp<=e.timestamp)&&this.isUserInteraction(n)){n.delay-e.delay>mt*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=n);break}if(this.nextUserInteractionEvent){const n=this.nextUserInteractionEvent.delay-e.delay,s={speed:Math.min(Math.round(n/pt),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:s}),this.emitter.emit(N.SkipStart,s)}}};break}return()=>{o&&o();for(const s of this.config.plugins||[])s.handler(e,i,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:e}});const n=this.service.state.context.events.length-1;if(e===this.service.state.context.events[n]){const s=()=>{n<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(N.Finish))};e.type===D.IncrementalSnapshot&&e.data.source===R.MouseMove&&e.data.positions.length?setTimeout(()=>{s()},Math.max(0,-e.data.positions[0].timeOffset+50)):s()}this.emitter.emit(N.EventCast,e)}}handleInactivity(e,i){if((e===this.inactiveEndTimestamp||i)&&(this.inactiveEndTimestamp=null,this.backToNormal()),this.config.skipInactive&&!this.inactiveEndTimestamp){for(const o of this.getActivityIntervals())if(e>=o.startTime&&e<o.endTime&&!o.active){this.inactiveEndTimestamp=o.endTime;break}if(this.inactiveEndTimestamp){const o=this.inactiveEndTimestamp-e,n={speed:o/vt*this.config.inactiveSkipTime<ft?o/ft:Math.round(Math.max(o,vt)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:n}),this.emitter.emit(N.SkipStart,n)}}}rebuildFullSnapshot(e,i=!1){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const o=[];y.rebuild(e.data.node,{doc:this.iframe.contentDocument,afterAppend:a=>{this.collectIframeAndAttachDocument(o,a)},cache:this.cache,mirror:this.mirror});for(const{mutationInQueue:a,builtNode:c}of o)this.attachDocumentToIframe(a,c),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==a);const{documentElement:n,head:s}=this.iframe.contentDocument;this.insertStyleRules(n,s),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(N.FullsnapshotRebuilded,e),i||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,i){const o=mi(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&o.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const n=this.virtualDom.createElement("style");this.virtualDom.mirror.add(n,je(n,this.virtualDom.unserializedId)),e.insertBefore(n,i);for(let s=0;s<o.length;s++)n.rules.push({cssText:o[s],type:_.Insert,index:s})}else{const n=document.createElement("style");e.insertBefore(n,i);for(let s=0;s<o.length;s++)n.sheet.insertRule(o[s],s)}}attachDocumentToIframe(e,i){const o=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,n=[];y.buildNodeWithSN(e.node,{doc:i.contentDocument,mirror:o,hackCss:!0,skipChild:!1,afterAppend:s=>{this.collectIframeAndAttachDocument(n,s);const a=o.getMeta(s);if(a?.type===y.NodeType.Element&&a?.tagName.toUpperCase()==="HTML"){const{documentElement:c,head:l}=i.contentDocument;this.insertStyleRules(c,l)}},cache:this.cache});for(const{mutationInQueue:s,builtNode:a}of n)this.attachDocumentToIframe(s,a),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==s)}collectIframeAndAttachDocument(e,i){if(Ne(i,this.mirror)){const o=this.newDocumentQueue.find(n=>n.parentId===this.mirror.getId(i));o&&e.push({mutationInQueue:o,builtNode:i})}}waitForStylesheetLoad(){var e;const i=(e=this.iframe.contentDocument)==null?void 0:e.head;if(i){const o=new Set;let n,s=this.service.state;const a=()=>{s=this.service.state};this.emitter.on(N.Start,a),this.emitter.on(N.Pause,a);const c=()=>{this.emitter.off(N.Start,a),this.emitter.off(N.Pause,a)};i.querySelectorAll('link[rel="stylesheet"]').forEach(l=>{l.sheet||(o.add(l),l.addEventListener("load",()=>{o.delete(l),o.size===0&&n!==-1&&(s.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(N.LoadStylesheetEnd),n&&clearTimeout(n),c())}))}),o.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(N.LoadStylesheetStart),n=setTimeout(()=>{s.matches("playing")&&this.play(this.getCurrentTime()),n=-1,c()},this.config.loadTimeout))}}hasImageArg(e){for(const i of e)if(!(!i||typeof i!="object")){if("rr_type"in i&&"args"in i){if(this.hasImageArg(i.args))return!0}else if("rr_type"in i&&i.rr_type==="HTMLImageElement"||i instanceof Array&&this.hasImageArg(i))return!0}return!1}getImageArgs(e){const i=[];for(const o of e)!o||typeof o!="object"||("rr_type"in o&&"args"in o?i.push(...this.getImageArgs(o.args)):"rr_type"in o&&o.rr_type==="HTMLImageElement"?i.push(o.src):o instanceof Array&&i.push(...this.getImageArgs(o)));return i}preloadAllImages(){return we(this,null,function*(){this.service.state;const e=()=>{this.service.state};this.emitter.on(N.Start,e),this.emitter.on(N.Pause,e);const i=[];for(const o of this.service.state.context.events)o.type===D.IncrementalSnapshot&&o.data.source===R.CanvasMutation&&(i.push(this.deserializeAndPreloadCanvasEvents(o.data,o)),("commands"in o.data?o.data.commands:[o.data]).forEach(n=>{this.preloadImages(n,o)}));return Promise.all(i)})}preloadImages(e,i){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(i)){const o=document.createElement("canvas"),n=o.getContext("2d"),s=n?.createImageData(o.width,o.height);s?.data,JSON.parse(e.args[0]),n?.putImageData(s,0,0)}}deserializeAndPreloadCanvasEvents(e,i){return we(this,null,function*(){if(!this.canvasEventMap.has(i)){const o={isUnchanged:!0};if("commands"in e){const n=yield Promise.all(e.commands.map(s=>we(this,null,function*(){const a=yield Promise.all(s.args.map($(this.imageMap,null,o)));return Ee(X({},s),{args:a})})));o.isUnchanged===!1&&this.canvasEventMap.set(i,Ee(X({},e),{commands:n}))}else{const n=yield Promise.all(e.args.map($(this.imageMap,null,o)));o.isUnchanged===!1&&this.canvasEventMap.set(i,Ee(X({},e),{args:n}))}}})}applyIncremental(e,i){var o,n,s,a,c,l;const{data:r}=e;switch(r.source){case R.Mutation:{try{this.applyMutation(r,i)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,r)}break}case R.Drag:case R.TouchMove:case R.MouseMove:if(i){const u=r.positions[r.positions.length-1];this.mousePos={x:u.x,y:u.y,id:u.id,debugData:r}}else r.positions.forEach(u=>{const d={doAction:()=>{this.moveAndHover(u.x,u.y,u.id,i,r)},delay:u.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(d)}),this.timer.addAction({doAction(){},delay:e.delay-((o=r.positions[0])==null?void 0:o.timeOffset)});break;case R.MouseInteraction:{if(r.id===-1||i)break;const u=new Event(A[r.type].toLowerCase()),d=this.mirror.getNode(r.id);if(!d)return this.debugNodeNotFound(r,r.id);this.emitter.emit(N.MouseInteraction,{type:r.type,target:d});const{triggerFocus:h}=this.config;switch(r.type){case A.Blur:"blur"in d&&d.blur();break;case A.Focus:h&&d.focus&&d.focus({preventScroll:!0});break;case A.Click:case A.TouchStart:case A.TouchEnd:i?(r.type===A.TouchStart?this.touchActive=!0:r.type===A.TouchEnd&&(this.touchActive=!1),this.mousePos={x:r.x,y:r.y,id:r.id,debugData:r}):(r.type===A.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(r.x,r.y,r.id,i,r),r.type===A.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):r.type===A.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):r.type===A.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case A.TouchCancel:i?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:d.dispatchEvent(u)}break}case R.Scroll:{if(r.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(r.id);if(!u)return this.debugNodeNotFound(r,r.id);u.scrollData=r;break}this.applyScroll(r,i);break}case R.ViewportResize:this.emitter.emit(N.Resize,{width:r.width,height:r.height});break;case R.Input:{if(r.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(r.id);if(!u)return this.debugNodeNotFound(r,r.id);u.inputData=r;break}this.applyInput(r);break}case R.MediaInteraction:{const u=this.usingVirtualDom?this.virtualDom.mirror.getNode(r.id):this.mirror.getNode(r.id);if(!u)return this.debugNodeNotFound(r,r.id);const d=u;try{r.currentTime&&(d.currentTime=r.currentTime),r.volume&&(d.volume=r.volume),r.muted&&(d.muted=r.muted),r.type===ye.Pause&&d.pause(),r.type===ye.Play&&d.play()}catch(h){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${h.message||h}`)}break}case R.StyleSheetRule:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(r.id);if(!u)return this.debugNodeNotFound(r,r.id);const d=u.rules;(n=r.adds)==null||n.forEach(({rule:h,index:f})=>d?.push({cssText:h,index:f,type:_.Insert})),(s=r.removes)==null||s.forEach(({index:h})=>d?.push({index:h,type:_.Remove}))}else{const u=this.mirror.getNode(r.id);if(!u)return this.debugNodeNotFound(r,r.id);const d=u.sheet;(a=r.adds)==null||a.forEach(({rule:h,index:f})=>{try{if(Array.isArray(f)){const{positions:T,index:v}=st(f);K(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{}}),(c=r.removes)==null||c.forEach(({index:h})=>{try{if(Array.isArray(h)){const{positions:f,index:T}=st(h);K(d.cssRules,f).deleteRule(T||0)}else d?.deleteRule(h)}catch{}})}break}case R.StyleDeclaration:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(r.id);if(!u)return this.debugNodeNotFound(r,r.id);const d=u.rules;r.set&&d.push(X({type:_.SetProperty,index:r.index},r.set)),r.remove&&d.push(X({type:_.RemoveProperty,index:r.index},r.remove))}else{const u=this.mirror.getNode(r.id);if(!u)return this.debugNodeNotFound(r,r.id);const d=u.sheet;r.set&&K(d.rules,r.index).style.setProperty(r.set.property,r.set.value,r.set.priority),r.remove&&K(d.rules,r.index).style.removeProperty(r.remove.property)}break}case R.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(r.id);if(!u)return this.debugNodeNotFound(r,r.id);u.canvasMutations.push({event:e,mutation:r})}else{const u=this.mirror.getNode(r.id);if(!u)return this.debugNodeNotFound(r,r.id);ut({event:e,mutation:r,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case R.Font:{try{const u=new FontFace(r.family,r.buffer?new Uint8Array(JSON.parse(r.fontSource)):r.fontSource,r.descriptors);(l=this.iframe.contentDocument)==null||l.fonts.add(u)}catch(u){this.config.showWarning&&console.warn(u)}break}}}applyMutation(e,i){if(this.config.useVirtualDom&&!this.usingVirtualDom&&i&&(this.usingVirtualDom=!0,Jt(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const r in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[r],d=We(u.node,this.virtualDom,this.mirror);d&&(u.node=d)}catch(u){this.config.showWarning&&console.warn(u)}const o=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes.forEach(r=>{var u;const d=o.getNode(r.id);if(!d)return e.removes.find(f=>f.id===r.parentId)?void 0:this.warnNodeNotFound(e,r.id);let h=o.getNode(r.parentId);if(!h)return this.warnNodeNotFound(e,r.parentId);if(r.isShadow&&rt(h)&&(h=h.shadowRoot),o.removeNodeFromMap(d),h)try{h.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&h.nodeName==="STYLE"&&((u=h.rules)==null?void 0:u.length)>0&&(h.rules=[])}catch(f){if(f instanceof DOMException)this.warn("parent could not remove child in mutation",h,d,e);else throw f}});const n=X({},this.legacy_missingNodeRetryMap),s=[],a=r=>{let u=null;return r.nextId&&(u=o.getNode(r.nextId)),r.nextId!==null&&r.nextId!==void 0&&r.nextId!==-1&&!u},c=r=>{var u;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let d=o.getNode(r.parentId);if(!d)return r.node.type===y.NodeType.Document?this.newDocumentQueue.push(r):s.push(r);r.node.isShadow&&(rt(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let h=null,f=null;if(r.previousId&&(h=o.getNode(r.previousId)),r.nextId&&(f=o.getNode(r.nextId)),a(r))return s.push(r);if(r.node.rootId&&!o.getNode(r.node.rootId))return;const T=r.node.rootId?o.getNode(r.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Ne(d,o)){this.attachDocumentToIframe(r,d);return}const v=y.buildNodeWithSN(r.node,{doc:T,mirror:o,skipChild:!0,hackCss:!0,cache:this.cache});if(r.previousId===-1||r.nextId===-1){n[r.node.id]={node:v,mutation:r};return}const p=o.getMeta(d);if(p&&p.type===y.NodeType.Element&&p.tagName==="textarea"&&r.node.type===y.NodeType.Text){const m=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const g of m)g.nodeType===d.TEXT_NODE&&d.removeChild(g)}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=[]),Ne(v,this.mirror)){const m=this.mirror.getId(v),g=this.newDocumentQueue.find(E=>E.parentId===m);g&&(this.attachDocumentToIframe(g,v),this.newDocumentQueue=this.newDocumentQueue.filter(E=>E!==g))}(r.previousId||r.nextId)&&this.legacy_resolveMissingNode(n,d,v,r)};e.adds.forEach(r=>{c(r)});const l=Date.now();for(;s.length;){const r=di(s);if(s.length=0,Date.now()-l>500){this.warn("Timeout in the loop, please check the resolve tree data:",r);break}for(const u of r)o.getNode(u.value.parentId)?ot(u,d=>{c(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(n).length&&Object.assign(this.legacy_missingNodeRetryMap,n),hi(e.texts).forEach(r=>{var u;const d=o.getNode(r.id);if(!d)return e.removes.find(h=>h.id===r.id)?void 0:this.warnNodeNotFound(e,r.id);if(d.textContent=r.value,this.usingVirtualDom){const h=d.parentNode;((u=h?.rules)==null?void 0:u.length)>0&&(h.rules=[])}}),e.attributes.forEach(r=>{const u=o.getNode(r.id);if(!u)return e.removes.find(d=>d.id===r.id)?void 0:this.warnNodeNotFound(e,r.id);for(const d in r.attributes)if(typeof d=="string"){const h=r.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 p=f[v];T.style.setProperty(v,p[0],p[1])}else{const p=f[v];T.style.setProperty(v,p)}}}})}applyScroll(e,i){const o=this.mirror.getNode(e.id);if(!o)return this.debugNodeNotFound(e,e.id);const n=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:i?"auto":"smooth"});else if(n?.type===y.NodeType.Document)o.defaultView.scrollTo({top:e.y,left:e.x,behavior:i?"auto":"smooth"});else try{o.scrollTop=e.y,o.scrollLeft=e.x}catch{}}applyInput(e){const i=this.mirror.getNode(e.id);if(!i)return this.debugNodeNotFound(e,e.id);try{i.checked=e.isChecked,i.value=e.text}catch{}}legacy_resolveMissingNode(e,i,o,n){const{previousId:s,nextId:a}=n,c=s&&e[s],l=a&&e[a];if(c){const{node:r,mutation:u}=c;i.insertBefore(r,o),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,i,r,u)}if(l){const{node:r,mutation:u}=l;i.insertBefore(r,o.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,i,r,u)}}moveAndHover(e,i,o,n,s){const a=this.mirror.getNode(o);if(!a)return this.debugNodeNotFound(s,o);const c=nt(a,this.iframe),l=e*c.absoluteScale+c.x,r=i*c.absoluteScale+c.y;this.mouse.style.left=`${l}px`,this.mouse.style.top=`${r}px`,n||this.drawMouseTail({x:l,y:r}),this.hoverElements(a)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:i,lineWidth:o,strokeStyle:n,duration:s}=this.config.mouseTail===!0?be:Object.assign({},be,this.config.mouseTail),a=()=>{if(!this.mouseTail)return;const c=this.mouseTail.getContext("2d");!c||!this.tailPositions.length||(c.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),c.beginPath(),c.lineWidth=o,c.lineCap=i,c.strokeStyle=n,c.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(l=>c.lineTo(l.x,l.y)),c.stroke())};this.tailPositions.push(e),a(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(c=>c!==e),a()},s/this.speedService.state.context.timer.speed)}hoverElements(e){var i;(i=this.iframe.contentDocument)==null||i.querySelectorAll(".\\:hover").forEach(n=>{n.classList.remove(":hover")});let o=e;for(;o;)o.classList&&o.classList.add(":hover"),o=o.parentElement}isUserInteraction(e){return e.type!==D.IncrementalSnapshot?!1:e.data.source>R.Mutation&&e.data.source<=R.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(N.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,i){this.warn(`Node with id '${i}' not found. `,e)}warnCanvasMutationFailed(e,i){this.warn("Has error on canvas update",i,"canvas mutation:",e)}debugNodeNotFound(e,i){this.debug(De,`Node with id '${i}' not found. `,e)}warn(...e){!this.config.showWarning||console.warn(De,...e)}debug(...e){!this.config.showDebug||console.log(De,...e)}}var O=Uint8Array,W=Uint16Array,xe=Uint32Array,yt=new O([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]),gt=new O([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]),Ii=new O([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Tt=function(t,e){for(var i=new W(31),o=0;o<31;++o)i[o]=e+=1<<t[o-1];for(var n=new xe(i[30]),o=1;o<30;++o)for(var s=i[o];s<i[o+1];++s)n[s]=s-i[o]<<5|o;return[i,n]},Nt=Tt(yt,2),Et=Nt[0],Oi=Nt[1];Et[28]=258,Oi[258]=28;for(var ki=Tt(gt,0),_i=ki[0],Ce=new W(32768),w=0;w<32768;++w){var j=(w&43690)>>>1|(w&21845)<<1;j=(j&52428)>>>2|(j&13107)<<2,j=(j&61680)>>>4|(j&3855)<<4,Ce[w]=((j&65280)>>>8|(j&255)<<8)>>>1}for(var te=function(t,e,i){for(var o=t.length,n=0,s=new W(e);n<o;++n)++s[t[n]-1];var a=new W(e);for(n=0;n<e;++n)a[n]=a[n-1]+s[n-1]<<1;var c;if(i){c=new W(1<<e);var l=15-e;for(n=0;n<o;++n)if(t[n])for(var r=n<<4|t[n],u=e-t[n],d=a[t[n]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)c[Ce[d]>>>l]=r}else for(c=new W(o),n=0;n<o;++n)c[n]=Ce[a[t[n]-1]++]>>>15-t[n];return c},ie=new O(288),w=0;w<144;++w)ie[w]=8;for(var w=144;w<256;++w)ie[w]=9;for(var w=256;w<280;++w)ie[w]=7;for(var w=280;w<288;++w)ie[w]=8;for(var wt=new O(32),w=0;w<32;++w)wt[w]=5;var Li=te(ie,9,1),Fi=te(wt,5,1),Se=function(t){for(var e=t[0],i=1;i<t.length;++i)t[i]>e&&(e=t[i]);return e},L=function(t,e,i){var o=e/8>>0;return(t[o]|t[o+1]<<8)>>>(e&7)&i},Me=function(t,e){var i=e/8>>0;return(t[i]|t[i+1]<<8|t[i+2]<<16)>>>(e&7)},Pi=function(t){return(t/8>>0)+(t&7&&1)},Dt=function(t,e,i){(e==null||e<0)&&(e=0),(i==null||i>t.length)&&(i=t.length);var o=new(t instanceof W?W:t instanceof xe?xe:O)(i-e);return o.set(t.subarray(e,i)),o},Ui=function(t,e,i){var o=t.length,n=!e||i,s=!i||i.i;i||(i={}),e||(e=new O(o*3));var a=function(Ct){var St=e.length;if(Ct>St){var Mt=new O(Math.max(St*2,Ct));Mt.set(e),e=Mt}},c=i.f||0,l=i.p||0,r=i.b||0,u=i.l,d=i.d,h=i.m,f=i.n,T=o*8;do{if(!u){i.f=c=L(t,l,1);var v=L(t,l+1,3);if(l+=3,v)if(v==1)u=Li,d=Fi,h=9,f=5;else if(v==2){var E=L(t,l,31)+257,C=L(t,l+10,15)+4,I=E+L(t,l+5,31)+1;l+=14;for(var S=new O(I),U=new O(19),M=0;M<C;++M)U[Ii[M]]=L(t,l+M*3,7);l+=C*3;var oe=Se(U),Ae=(1<<oe)-1;if(!s&&l+I*(oe+7)>T)break;for(var Ie=te(U,oe,1),M=0;M<I;){var Q=Ie[L(t,l,Ae)];l+=Q&15;var p=Q>>>4;if(p<16)S[M++]=p;else{var V=0,J=0;for(p==16?(J=3+L(t,l,3),l+=2,V=S[M-1]):p==17?(J=3+L(t,l,7),l+=3):p==18&&(J=11+L(t,l,127),l+=7);J--;)S[M++]=V}}var he=S.subarray(0,E),F=S.subarray(E);h=Se(he),f=Se(F),u=te(he,h,1),d=te(F,f,1)}else throw"invalid block type";else{var p=Pi(l)+4,m=t[p-4]|t[p-3]<<8,g=p+m;if(g>o){if(s)throw"unexpected EOF";break}n&&a(r+m),e.set(t.subarray(p,g),r),i.b=r+=m,i.p=l=g*8;continue}if(l>T)throw"unexpected EOF"}n&&a(r+131072);for(var x=(1<<h)-1,ne=(1<<f)-1,me=h+f+18;s||l+me<T;){var V=u[Me(t,l)&x],B=V>>>4;if(l+=V&15,l>T)throw"unexpected EOF";if(!V)throw"invalid length/literal";if(B<256)e[r++]=B;else if(B==256){u=null;break}else{var Rt=B-254;if(B>264){var M=B-257,re=yt[M];Rt=L(t,l,(1<<re)-1)+Et[M],l+=re}var Oe=d[Me(t,l)&ne],ke=Oe>>>4;if(!Oe)throw"invalid distance";l+=Oe&15;var F=_i[ke];if(ke>3){var re=gt[ke];F+=Me(t,l)&(1<<re)-1,l+=re}if(l>T)throw"unexpected EOF";n&&a(r+131072);for(var xt=r+Rt;r<xt;r+=4)e[r]=e[r-F],e[r+1]=e[r+1-F],e[r+2]=e[r+2-F],e[r+3]=e[r+3-F];r=xt}}i.l=u,i.p=l,i.b=r,u&&(c=1,i.m=h,i.d=d,i.n=f)}while(!c);return r==e.length?e:Dt(e,0,r)},Vi=function(t){if((t[0]&15)!=8||t[0]>>>4>7||(t[0]<<8|t[1])%31)throw"invalid zlib data";if(t[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function Bi(t,e){return Ui((Vi(t),t.subarray(2,-4)),e)}function $i(t,e){var i=t.length;if(!e&&typeof TextEncoder<"u")return new TextEncoder().encode(t);for(var o=new O(t.length+(t.length>>>1)),n=0,s=function(r){o[n++]=r},a=0;a<i;++a){if(n+5>o.length){var c=new O(n+8+(i-a<<1));c.set(o),o=c}var l=t.charCodeAt(a);l<128||e?s(l):l<2048?(s(192|l>>>6),s(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|t.charCodeAt(++a)&1023,s(240|l>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|l&63)):(s(224|l>>>12),s(128|l>>>6&63),s(128|l&63))}return Dt(o,0,n)}function Wi(t,e){var i="";if(!e&&typeof TextDecoder<"u")return new TextDecoder().decode(t);for(var o=0;o<t.length;){var n=t[o++];n<128||e?i+=String.fromCharCode(n):n<224?i+=String.fromCharCode((n&31)<<6|t[o++]&63):n<240?i+=String.fromCharCode((n&15)<<12|(t[o++]&63)<<6|t[o++]&63):(n=((n&15)<<18|(t[o++]&63)<<12|(t[o++]&63)<<6|t[o++]&63)-65536,i+=String.fromCharCode(55296|n>>10,56320|n&1023))}return i}const bt="v1",ji=t=>{if(typeof t!="string")return t;try{const e=JSON.parse(t);if(e.timestamp)return e}catch{}try{const e=JSON.parse(Wi(Bi($i(t,!0))));if(e.v===bt)return e;throw new Error(`These events were packed with packer ${e.v} which is incompatible with current packer ${bt}.`)}catch(e){throw console.error(e),new Error("Unknown data format.")}};return se.Replayer=Ai,se.unpack=ji,Object.defineProperty(se,"__esModule",{value:!0}),se}({},rrwebSnapshot);
|
|
18
17
|
//# sourceMappingURL=rrweb-replay-unpack.min.js.map
|