@amplitude/rrweb-player 2.0.0-alpha.23 → 2.0.0-alpha.24
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/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.cjs.map +1 -1
- package/package.json +3 -3
package/lib/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";function e(){}function t(e,t){for(const n in t)e[n]=t[n];return e}function n(e){return e()}function i(){return Object.create(null)}function o(e){e.forEach(n)}function s(e){return"function"==typeof e}function r(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function a(e){const t={};for(const n in e)"$"!==n[0]&&(t[n]=e[n]);return t}function l(e,t){e.appendChild(t)}function c(e,t,n){e.insertBefore(t,n||null)}function u(e){e.parentNode&&e.parentNode.removeChild(e)}function d(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function h(e){return document.createElement(e)}function p(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function m(e){return document.createTextNode(e)}function f(){return m(" ")}function g(e,t,n,i){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}function y(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function v(e,t){t=""+t,e.data!==t&&(e.data=t)}function b(e,t,n,i){null==n?e.style.removeProperty(t):e.style.setProperty(t,n,i?"important":"")}function w(e,t,n){e.classList[n?"add":"remove"](t)}let E;function N(e){E=e}function T(){if(!E)throw new Error("Function called outside component initialization");return E}function S(e){T().$$.on_mount.push(e)}function M(e){T().$$.on_destroy.push(e)}function D(){const e=T();return(t,n,{cancelable:i=!1}={})=>{const o=e.$$.callbacks[t];if(o){const s=function(e,t,{bubbles:n=!1,cancelable:i=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(e,n,i,t),o}(t,n,{cancelable:i});return o.slice().forEach((t=>{t.call(e,s)})),!s.defaultPrevented}return!0}}const C=[],x=[];let R=[];const k=[],A=Promise.resolve();let I=!1;function O(e){R.push(e)}const _=new Set;let $=0;function L(){if(0!==$)return;const e=E;do{try{for(;$<C.length;){const e=C[$];$++,N(e),F(e.$$)}}catch(e){throw C.length=0,$=0,e}for(N(null),C.length=0,$=0;x.length;)x.pop()();for(let e=0;e<R.length;e+=1){const t=R[e];_.has(t)||(_.add(t),t())}R.length=0}while(C.length);for(;k.length;)k.pop()();I=!1,_.clear(),N(e)}function F(e){if(null!==e.fragment){e.update(),o(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(O)}}const P=new Set;let U;function B(){U={r:0,c:[],p:U}}function j(){U.r||o(U.c),U=U.p}function V(e,t){e&&e.i&&(P.delete(e),e.i(t))}function W(e,t,n,i){if(e&&e.o){if(P.has(e))return;P.add(e),U.c.push((()=>{P.delete(e),i&&(n&&e.d(1),i())})),e.o(t)}else i&&i()}function z(e){e&&e.c()}function G(e,t,i,r){const{fragment:a,after_update:l}=e.$$;a&&a.m(t,i),r||O((()=>{const t=e.$$.on_mount.map(n).filter(s);e.$$.on_destroy?e.$$.on_destroy.push(...t):o(t),e.$$.on_mount=[]})),l.forEach(O)}function H(e,t){const n=e.$$;null!==n.fragment&&(!function(e){const t=[],n=[];R.forEach((i=>-1===e.indexOf(i)?t.push(i):n.push(i))),n.forEach((e=>e())),R=t}(n.after_update),o(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Y(e,t){-1===e.$$.dirty[0]&&(C.push(e),I||(I=!0,A.then(L)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function q(t,n,s,r,a,l,c,d=[-1]){const h=E;N(t);const p=t.$$={fragment:null,ctx:[],props:l,update:e,not_equal:a,bound:i(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(h?h.$$.context:[])),callbacks:i(),dirty:d,skip_bound:!1,root:n.target||h.$$.root};c&&c(p.root);let m=!1;if(p.ctx=s?s(t,n.props||{},((e,n,...i)=>{const o=i.length?i[0]:n;return p.ctx&&a(p.ctx[e],p.ctx[e]=o)&&(!p.skip_bound&&p.bound[e]&&p.bound[e](o),m&&Y(t,e)),n})):[],p.update(),m=!0,o(p.before_update),p.fragment=!!r&&r(p.ctx),n.target){if(n.hydrate){const e=function(e){return Array.from(e.childNodes)}(n.target);p.fragment&&p.fragment.l(e),e.forEach(u)}else p.fragment&&p.fragment.c();n.intro&&V(t.$$.fragment),G(t,n.target,n.anchor,n.customElement),L()}N(h)}class X{$destroy(){H(this,1),this.$destroy=e}$on(t,n){if(!s(n))return e;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const e=i.indexOf(n);-1!==e&&i.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}var Q;function J(e){return e.nodeType===e.ELEMENT_NODE}!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"}(Q||(Q={}));class Z{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-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 t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function K(){return new Z}const ee=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function te(e,t={}){let n=1,i=1;function o(e){const t=e.match(/\n/g);t&&(n+=t.length);const o=e.lastIndexOf("\n");i=-1===o?i+e.length:e.length-o}function s(){const e={line:n,column:i};return t=>(t.position=new r(e),p(),t)}class r{constructor(e){this.start=e,this.end={line:n,column:i},this.source=t.source}}r.prototype.content=e;const a=[];function l(o){const s=new Error(`${t.source||""}:${n}:${i}: ${o}`);if(s.reason=o,s.filename=t.source,s.line=n,s.column=i,s.source=e,!t.silent)throw s;a.push(s)}function c(){return h(/^{\s*/)}function u(){return h(/^}/)}function d(){let t;const n=[];for(p(),m(n);e.length&&"}"!==e.charAt(0)&&(t=M()||D());)t&&(n.push(t),m(n));return n}function h(t){const n=t.exec(e);if(!n)return;const i=n[0];return o(i),e=e.slice(i.length),n}function p(){h(/^\s*/)}function m(e=[]){let t;for(;t=f();)t&&e.push(t),t=f();return e}function f(){const t=s();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return l("End of comment missing");const r=e.slice(2,n-2);return i+=2,o(r),e=e.slice(n),i+=2,t({type:"comment",comment:r})}const g=new RegExp("^(("+[/[^\\]"(?:\\"|[^"])*"/.source,/[^\\]'(?:\\'|[^'])*'/.source,"[^{]"].join("|")+")+)");function y(){for(p();"}"==e[0];)l("extra closing bracket"),e=e.slice(1),p();const t=h(g);if(!t)return;const n=t[0].trim().replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(e=>e.replace(/,/g,"")));return function(e){const t=[];let n="",i=0,o=0,s=null;for(const r of e){const e=n.endsWith("\\");s?s!==r||e||(s=null):"("===r?i++:")"===r?i--:"["===r?o++:"]"===r?o--:"'\"".includes(r)&&(s=r),","===r&&0===i&&0===o?(t.push(n),n=""):n+=r}n&&t.push(n);return t}(n).map((e=>e.replace(/\u200C/g,",").trim()))}function v(){const e=s(),t=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;const n=ne(t[0]);if(!h(/^:\s*/))return l("property missing ':'");const i=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:n.replace(ee,""),value:i?ne(i[0]).replace(ee,""):""});return h(/^[;\s]*/),o}function b(){const e=[];if(!c())return l("missing '{'");let t;for(m(e);t=v();)!1!==t&&(e.push(t),m(e)),t=v();return u()?e:l("missing '}'")}function w(){let e;const t=[],n=s();for(;e=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),h(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const E=S("import"),N=S("charset"),T=S("namespace");function S(e){const t=new RegExp("^@"+e+"\\s*((?:"+[/[^\\]"(?:\\"|[^"])*"/.source,/[^\\]'(?:\\'|[^'])*'/.source,"[^;]"].join("|")+")+);");return()=>{const n=s(),i=h(t);if(!i)return;const o={type:e};return o[e]=i[1].trim(),n(o)}}function M(){if("@"===e[0])return function(){const e=s();let t=h(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=h(/^([-\w]+)\s*/),!t)return l("@keyframes missing name");const i=t[1];if(!c())return l("@keyframes missing '{'");let o,r=m();for(;o=w();)r.push(o),r=r.concat(m());return u()?e({type:"keyframes",name:i,vendor:n,keyframes:r}):l("@keyframes missing '}'")}()||function(){const e=s(),t=h(/^@media *([^{]+)/);if(!t)return;const n=ne(t[1]);if(!c())return l("@media missing '{'");const i=m().concat(d());return u()?e({type:"media",media:n,rules:i}):l("@media missing '}'")}()||function(){const e=s(),t=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:ne(t[1]),media:ne(t[2])})}()||function(){const e=s(),t=h(/^@supports *([^{]+)/);if(!t)return;const n=ne(t[1]);if(!c())return l("@supports missing '{'");const i=m().concat(d());return u()?e({type:"supports",supports:n,rules:i}):l("@supports missing '}'")}()||E()||N()||T()||function(){const e=s(),t=h(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=ne(t[1]),i=ne(t[2]);if(!c())return l("@document missing '{'");const o=m().concat(d());return u()?e({type:"document",document:i,vendor:n,rules:o}):l("@document missing '}'")}()||function(){const e=s();if(!h(/^@page */))return;const t=y()||[];if(!c())return l("@page missing '{'");let n,i=m();for(;n=v();)i.push(n),i=i.concat(m());return u()?e({type:"page",selectors:t,declarations:i}):l("@page missing '}'")}()||function(){const e=s();if(!h(/^@host\s*/))return;if(!c())return l("@host missing '{'");const t=m().concat(d());return u()?e({type:"host",rules:t}):l("@host missing '}'")}()||function(){const e=s();if(!h(/^@font-face\s*/))return;if(!c())return l("@font-face missing '{'");let t,n=m();for(;t=v();)n.push(t),n=n.concat(m());return u()?e({type:"font-face",declarations:n}):l("@font-face missing '}'")}()}function D(){const e=s(),t=y();return t?(m(),e({type:"rule",selectors:t,declarations:b()})):l("selector missing")}return ie(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function ne(e){return e?e.replace(/^\s+|\s+$/g,""):""}function ie(e,t){const n=e&&"string"==typeof e.type,i=n?e:t;for(const t of Object.keys(e)){const n=e[t];Array.isArray(n)?n.forEach((e=>{ie(e,i)})):n&&"object"==typeof n&&ie(n,i)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}const oe={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 se(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const re=/(max|min)-device-(width|height)/,ae=new RegExp(re.source,"g"),le=/([^\\]):hover/,ce=new RegExp(le.source,"g");function ue(e,t){const n=null==t?void 0:t.stylesWithHoverClass.get(e);if(n)return n;const i=te(e,{silent:!0});if(!i.stylesheet)return e;const o=[],s=[];!function e(t){"selectors"in t&&t.selectors&&t.selectors.forEach((e=>{le.test(e)&&o.push(e)})),"media"in t&&t.media&&re.test(t.media)&&s.push(t.media),"rules"in t&&t.rules&&t.rules.forEach(e)}(i.stylesheet);let r=e;if(o.length>0){const e=new RegExp(o.filter(((e,t)=>o.indexOf(e)===t)).sort(((e,t)=>t.length-e.length)).map((e=>se(e))).join("|"),"g");r=r.replace(e,(e=>{const t=e.replace(ce,"$1.\\:hover");return`${e}, ${t}`}))}if(s.length>0){const e=new RegExp(s.filter(((e,t)=>s.indexOf(e)===t)).sort(((e,t)=>t.length-e.length)).map((e=>se(e))).join("|"),"g");r=r.replace(e,(e=>e.replace(ae,"$1-$2")))}return null==t||t.stylesWithHoverClass.set(e,r),r}function de(){return{stylesWithHoverClass:new Map}}function he(e,t){var n;const{doc:i,hackCss:o,cache:s}=t;switch(e.type){case Q.Document:return i.implementation.createDocument(null,"",null);case Q.DocumentType:return i.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case Q.Element:{const t=function(e){let t=oe[e.tagName]?oe[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);let r;e.isSVG?r=i.createElementNS("http://www.w3.org/2000/svg",t):(e.isCustom&&(null===(n=i.defaultView)||void 0===n?void 0:n.customElements)&&!i.defaultView.customElements.get(e.tagName)&&i.defaultView.customElements.define(e.tagName,class extends i.defaultView.HTMLElement{}),r=i.createElement(t));const a={};for(const n in e.attributes){if(!Object.prototype.hasOwnProperty.call(e.attributes,n))continue;let l=e.attributes[n];if("option"===t&&"selected"===n&&!1===l)continue;if(null===l)continue;if(!0===l&&(l=""),n.startsWith("rr_")){a[n]=l;continue}const c="textarea"===t&&"value"===n,u="style"===t&&"_cssText"===n;if(u&&o&&"string"==typeof l&&(l=ue(l,s)),!c&&!u||"string"!=typeof l)try{if(e.isSVG&&"xlink:href"===n)r.setAttributeNS("http://www.w3.org/1999/xlink",n,l.toString());else if("onload"===n||"onclick"===n||"onmouse"===n.substring(0,7))r.setAttribute("_"+n,l.toString());else{if("meta"===t&&"Content-Security-Policy"===e.attributes["http-equiv"]&&"content"===n){r.setAttribute("csp-content",l.toString());continue}("link"!==t||"preload"!==e.attributes.rel&&"modulepreload"!==e.attributes.rel||"script"!==e.attributes.as)&&("link"===t&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")||("img"===t&&e.attributes.srcset&&e.attributes.rr_dataURL?r.setAttribute("rrweb-original-srcset",e.attributes.srcset):r.setAttribute(n,l.toString())))}}catch(e){}else r.appendChild(i.createTextNode(l)),e.childNodes=[]}for(const n in a){const i=a[n];if("canvas"===t&&"rr_dataURL"===n){const e=document.createElement("img");e.onload=()=>{const t=r.getContext("2d");t&&t.drawImage(e,0,0,e.width,e.height)},e.src=i.toString(),r.RRNodeType&&(r.rr_dataURL=i.toString())}else if("img"===t&&"rr_dataURL"===n){const t=r;t.currentSrc.startsWith("data:")||(t.setAttribute("rrweb-original-src",e.attributes.src),t.src=i.toString())}if("rr_width"===n)r.style.width=i.toString();else if("rr_height"===n)r.style.height=i.toString();else if("rr_mediaCurrentTime"===n&&"number"==typeof i)r.currentTime=i;else if("rr_mediaState"===n)switch(i){case"played":r.play().catch((e=>console.warn("media playback error",e)));break;case"paused":r.pause()}else"rr_mediaPlaybackRate"===n&&"number"==typeof i?r.playbackRate=i:"rr_mediaMuted"===n&&"boolean"==typeof i?r.muted=i:"rr_mediaLoop"===n&&"boolean"==typeof i?r.loop=i:"rr_mediaVolume"===n&&"number"==typeof i&&(r.volume=i)}if(e.isShadowHost)if(r.shadowRoot)for(;r.shadowRoot.firstChild;)r.shadowRoot.removeChild(r.shadowRoot.firstChild);else r.attachShadow({mode:"open"});return r}case Q.Text:return i.createTextNode(e.isStyle&&o?ue(e.textContent,s):e.textContent);case Q.CDATA:return i.createCDATASection(e.textContent);case Q.Comment:return i.createComment(e.textContent);default:return null}}function pe(e,t){const{doc:n,mirror:i,skipChild:o=!1,hackCss:s=!0,afterAppend:r,cache:a}=t;if(i.has(e.id)){const t=i.getNode(e.id);if(function(e,t){return!(!e||!t||e.type!==t.type)&&(e.type===Q.Document?e.compatMode===t.compatMode:e.type===Q.DocumentType?e.name===t.name&&e.publicId===t.publicId&&e.systemId===t.systemId:e.type===Q.Comment||e.type===Q.Text||e.type===Q.CDATA?e.textContent===t.textContent:e.type===Q.Element&&e.tagName===t.tagName&&JSON.stringify(e.attributes)===JSON.stringify(t.attributes)&&e.isSVG===t.isSVG&&e.needBlock===t.needBlock)}(i.getMeta(t),e))return i.getNode(e.id)}let l=he(e,{doc:n,hackCss:s,cache:a});if(!l)return null;if(e.rootId&&i.getNode(e.rootId)!==n&&i.replace(e.rootId,n),e.type===Q.Document&&(n.close(),n.open(),"BackCompat"===e.compatMode&&e.childNodes&&e.childNodes[0].type!==Q.DocumentType&&(e.childNodes[0].type===Q.Element&&"xmlns"in e.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===e.childNodes[0].attributes.xmlns?n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),l=n),i.add(l,e),(e.type===Q.Document||e.type===Q.Element)&&!o)for(const t of e.childNodes){const o=pe(t,{doc:n,mirror:i,skipChild:!1,hackCss:s,afterAppend:r,cache:a});if(o){if(t.isShadow&&J(l)&&l.shadowRoot)l.shadowRoot.appendChild(o);else if(e.type===Q.Document&&t.type==Q.Element){const e=o;let t=null;e.childNodes.forEach((e=>{"BODY"===e.nodeName&&(t=e)})),t?(e.removeChild(t),l.appendChild(o),e.appendChild(t)):l.appendChild(o)}else l.appendChild(o);r&&r(o,t.id)}else console.warn("Failed to rebuild",t)}return l}function me(e,t){const{doc:n,onVisit:i,hackCss:o=!0,afterAppend:s,cache:r,mirror:a=new Z}=t,l=pe(e,{doc:n,mirror:a,skipChild:!1,hackCss:o,afterAppend:s,cache:r});return function(e,t){for(const i of e.getIds())e.has(i)&&(n=e.getNode(i),t(n));var n}(a,(e=>{i&&i(e),function(e,t){const n=t.getMeta(e);if((null==n?void 0:n.type)!==Q.Element)return;const i=e;for(const e in n.attributes){if(!Object.prototype.hasOwnProperty.call(n.attributes,e)||!e.startsWith("rr_"))continue;const t=n.attributes[e];"rr_scrollLeft"===e&&(i.scrollLeft=t),"rr_scrollTop"===e&&(i.scrollTop=t)}}(e,a)})),l}var fe=(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))(fe||{}),ge=(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[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(ge||{}),ye=(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))(ye||{}),ve=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ve||{}),be=(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.Destroy="destroy",e))(be||{});const we="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let Ee={map:{},getId:()=>(console.error(we),-1),getNode:()=>(console.error(we),null),removeNodeFromMap(){console.error(we)},has:()=>(console.error(we),!1),reset(){console.error(we)}};function Ne(e){const t={},n=(e,n)=>{const i={value:e,parent:n,children:[]};return t[e.node.id]=i,i},i=[];for(const o of e){const{nextId:e,parentId:s}=o;if(e&&e in t){const s=t[e];if(s.parent){const e=s.parent.children.indexOf(s);s.parent.children.splice(e,0,n(o,s.parent))}else{const e=i.indexOf(s);i.splice(e,0,n(o,null))}}else if(s in t){const e=t[s];e.children.push(n(o,e))}else i.push(n(o,null))}return i}function Te(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)Te(e.children[n],t)}function Se(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Me(e,t){var n,i;const o=null===(i=null===(n=e.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===i?void 0:i.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=o.getBoundingClientRect(),r=Me(o,t),a=s.height/o.clientHeight;return{x:s.x*r.relativeScale+r.x,y:s.y*r.relativeScale+r.y,relativeScale:a,absoluteScale:r.absoluteScale*a}}function De(e){return Boolean(null==e?void 0:e.shadowRoot)}function Ce(e,t){const n=e[t[0]];return 1===t.length?n:Ce(n.cssRules[t[1]].cssRules,t.slice(2))}function xe(e){const t=[...e],n=t.pop();return{positions:t,index:n}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Ee=new Proxy(Ee,{get:(e,t,n)=>("map"===t&&console.error(we),Reflect.get(e,t,n))})),/[1-9][0-9]{12}/.test(Date.now().toString());class Re{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}
|
|
1
|
+
"use strict";function e(){}function t(e,t){for(const n in t)e[n]=t[n];return e}function n(e){return e()}function i(){return Object.create(null)}function o(e){e.forEach(n)}function s(e){return"function"==typeof e}function r(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function a(e){const t={};for(const n in e)"$"!==n[0]&&(t[n]=e[n]);return t}function l(e,t){e.appendChild(t)}function c(e,t,n){e.insertBefore(t,n||null)}function u(e){e.parentNode&&e.parentNode.removeChild(e)}function d(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function h(e){return document.createElement(e)}function p(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function m(e){return document.createTextNode(e)}function f(){return m(" ")}function g(e,t,n,i){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}function y(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function v(e,t){t=""+t,e.data!==t&&(e.data=t)}function b(e,t,n,i){null==n?e.style.removeProperty(t):e.style.setProperty(t,n,i?"important":"")}function w(e,t,n){e.classList[n?"add":"remove"](t)}let E;function N(e){E=e}function T(){if(!E)throw new Error("Function called outside component initialization");return E}function S(e){T().$$.on_mount.push(e)}function M(e){T().$$.on_destroy.push(e)}function D(){const e=T();return(t,n,{cancelable:i=!1}={})=>{const o=e.$$.callbacks[t];if(o){const s=function(e,t,{bubbles:n=!1,cancelable:i=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(e,n,i,t),o}(t,n,{cancelable:i});return o.slice().forEach((t=>{t.call(e,s)})),!s.defaultPrevented}return!0}}const C=[],x=[];let R=[];const k=[],A=Promise.resolve();let I=!1;function O(e){R.push(e)}const _=new Set;let $=0;function L(){if(0!==$)return;const e=E;do{try{for(;$<C.length;){const e=C[$];$++,N(e),F(e.$$)}}catch(e){throw C.length=0,$=0,e}for(N(null),C.length=0,$=0;x.length;)x.pop()();for(let e=0;e<R.length;e+=1){const t=R[e];_.has(t)||(_.add(t),t())}R.length=0}while(C.length);for(;k.length;)k.pop()();I=!1,_.clear(),N(e)}function F(e){if(null!==e.fragment){e.update(),o(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(O)}}const P=new Set;let U;function B(){U={r:0,c:[],p:U}}function j(){U.r||o(U.c),U=U.p}function V(e,t){e&&e.i&&(P.delete(e),e.i(t))}function W(e,t,n,i){if(e&&e.o){if(P.has(e))return;P.add(e),U.c.push((()=>{P.delete(e),i&&(n&&e.d(1),i())})),e.o(t)}else i&&i()}function z(e){e&&e.c()}function G(e,t,i,r){const{fragment:a,after_update:l}=e.$$;a&&a.m(t,i),r||O((()=>{const t=e.$$.on_mount.map(n).filter(s);e.$$.on_destroy?e.$$.on_destroy.push(...t):o(t),e.$$.on_mount=[]})),l.forEach(O)}function H(e,t){const n=e.$$;null!==n.fragment&&(!function(e){const t=[],n=[];R.forEach((i=>-1===e.indexOf(i)?t.push(i):n.push(i))),n.forEach((e=>e())),R=t}(n.after_update),o(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Y(e,t){-1===e.$$.dirty[0]&&(C.push(e),I||(I=!0,A.then(L)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function q(t,n,s,r,a,l,c,d=[-1]){const h=E;N(t);const p=t.$$={fragment:null,ctx:[],props:l,update:e,not_equal:a,bound:i(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(h?h.$$.context:[])),callbacks:i(),dirty:d,skip_bound:!1,root:n.target||h.$$.root};c&&c(p.root);let m=!1;if(p.ctx=s?s(t,n.props||{},((e,n,...i)=>{const o=i.length?i[0]:n;return p.ctx&&a(p.ctx[e],p.ctx[e]=o)&&(!p.skip_bound&&p.bound[e]&&p.bound[e](o),m&&Y(t,e)),n})):[],p.update(),m=!0,o(p.before_update),p.fragment=!!r&&r(p.ctx),n.target){if(n.hydrate){const e=function(e){return Array.from(e.childNodes)}(n.target);p.fragment&&p.fragment.l(e),e.forEach(u)}else p.fragment&&p.fragment.c();n.intro&&V(t.$$.fragment),G(t,n.target,n.anchor,n.customElement),L()}N(h)}class X{$destroy(){H(this,1),this.$destroy=e}$on(t,n){if(!s(n))return e;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const e=i.indexOf(n);-1!==e&&i.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}var Q;function J(e){return e.nodeType===e.ELEMENT_NODE}!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"}(Q||(Q={}));class Z{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-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 t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function K(){return new Z}const ee=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function te(e,t={}){let n=1,i=1;function o(e){const t=e.match(/\n/g);t&&(n+=t.length);const o=e.lastIndexOf("\n");i=-1===o?i+e.length:e.length-o}function s(){const e={line:n,column:i};return t=>(t.position=new r(e),p(),t)}class r{constructor(e){this.start=e,this.end={line:n,column:i},this.source=t.source}}r.prototype.content=e;const a=[];function l(o){const s=new Error(`${t.source||""}:${n}:${i}: ${o}`);if(s.reason=o,s.filename=t.source,s.line=n,s.column=i,s.source=e,!t.silent)throw s;a.push(s)}function c(){return h(/^{\s*/)}function u(){return h(/^}/)}function d(){let t;const n=[];for(p(),m(n);e.length&&"}"!==e.charAt(0)&&(t=M()||D());)t&&(n.push(t),m(n));return n}function h(t){const n=t.exec(e);if(!n)return;const i=n[0];return o(i),e=e.slice(i.length),n}function p(){h(/^\s*/)}function m(e=[]){let t;for(;t=f();)t&&e.push(t),t=f();return e}function f(){const t=s();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return l("End of comment missing");const r=e.slice(2,n-2);return i+=2,o(r),e=e.slice(n),i+=2,t({type:"comment",comment:r})}const g=new RegExp("^(("+[/[^\\]"(?:\\"|[^"])*"/.source,/[^\\]'(?:\\'|[^'])*'/.source,"[^{]"].join("|")+")+)");function y(){for(p();"}"==e[0];)l("extra closing bracket"),e=e.slice(1),p();const t=h(g);if(!t)return;const n=t[0].trim().replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(e=>e.replace(/,/g,"")));return function(e){const t=[];let n="",i=0,o=0,s=null;for(const r of e){const e=n.endsWith("\\");s?s!==r||e||(s=null):"("===r?i++:")"===r?i--:"["===r?o++:"]"===r?o--:"'\"".includes(r)&&(s=r),","===r&&0===i&&0===o?(t.push(n),n=""):n+=r}n&&t.push(n);return t}(n).map((e=>e.replace(/\u200C/g,",").trim()))}function v(){const e=s(),t=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;const n=ne(t[0]);if(!h(/^:\s*/))return l("property missing ':'");const i=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:n.replace(ee,""),value:i?ne(i[0]).replace(ee,""):""});return h(/^[;\s]*/),o}function b(){const e=[];if(!c())return l("missing '{'");let t;for(m(e);t=v();)!1!==t&&(e.push(t),m(e)),t=v();return u()?e:l("missing '}'")}function w(){let e;const t=[],n=s();for(;e=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),h(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const E=S("import"),N=S("charset"),T=S("namespace");function S(e){const t=new RegExp("^@"+e+"\\s*((?:"+[/[^\\]"(?:\\"|[^"])*"/.source,/[^\\]'(?:\\'|[^'])*'/.source,"[^;]"].join("|")+")+);");return()=>{const n=s(),i=h(t);if(!i)return;const o={type:e};return o[e]=i[1].trim(),n(o)}}function M(){if("@"===e[0])return function(){const e=s();let t=h(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=h(/^([-\w]+)\s*/),!t)return l("@keyframes missing name");const i=t[1];if(!c())return l("@keyframes missing '{'");let o,r=m();for(;o=w();)r.push(o),r=r.concat(m());return u()?e({type:"keyframes",name:i,vendor:n,keyframes:r}):l("@keyframes missing '}'")}()||function(){const e=s(),t=h(/^@media *([^{]+)/);if(!t)return;const n=ne(t[1]);if(!c())return l("@media missing '{'");const i=m().concat(d());return u()?e({type:"media",media:n,rules:i}):l("@media missing '}'")}()||function(){const e=s(),t=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:ne(t[1]),media:ne(t[2])})}()||function(){const e=s(),t=h(/^@supports *([^{]+)/);if(!t)return;const n=ne(t[1]);if(!c())return l("@supports missing '{'");const i=m().concat(d());return u()?e({type:"supports",supports:n,rules:i}):l("@supports missing '}'")}()||E()||N()||T()||function(){const e=s(),t=h(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=ne(t[1]),i=ne(t[2]);if(!c())return l("@document missing '{'");const o=m().concat(d());return u()?e({type:"document",document:i,vendor:n,rules:o}):l("@document missing '}'")}()||function(){const e=s();if(!h(/^@page */))return;const t=y()||[];if(!c())return l("@page missing '{'");let n,i=m();for(;n=v();)i.push(n),i=i.concat(m());return u()?e({type:"page",selectors:t,declarations:i}):l("@page missing '}'")}()||function(){const e=s();if(!h(/^@host\s*/))return;if(!c())return l("@host missing '{'");const t=m().concat(d());return u()?e({type:"host",rules:t}):l("@host missing '}'")}()||function(){const e=s();if(!h(/^@font-face\s*/))return;if(!c())return l("@font-face missing '{'");let t,n=m();for(;t=v();)n.push(t),n=n.concat(m());return u()?e({type:"font-face",declarations:n}):l("@font-face missing '}'")}()}function D(){const e=s(),t=y();return t?(m(),e({type:"rule",selectors:t,declarations:b()})):l("selector missing")}return ie(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function ne(e){return e?e.replace(/^\s+|\s+$/g,""):""}function ie(e,t){const n=e&&"string"==typeof e.type,i=n?e:t;for(const t of Object.keys(e)){const n=e[t];Array.isArray(n)?n.forEach((e=>{ie(e,i)})):n&&"object"==typeof n&&ie(n,i)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}const oe={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 se(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const re=/(max|min)-device-(width|height)/,ae=new RegExp(re.source,"g"),le=/([^\\]):hover/,ce=new RegExp(le.source,"g");function ue(e,t){const n=null==t?void 0:t.stylesWithHoverClass.get(e);if(n)return n;const i=te(e,{silent:!0});if(!i.stylesheet)return e;const o=[],s=[];!function e(t){"selectors"in t&&t.selectors&&t.selectors.forEach((e=>{le.test(e)&&o.push(e)})),"media"in t&&t.media&&re.test(t.media)&&s.push(t.media),"rules"in t&&t.rules&&t.rules.forEach(e)}(i.stylesheet);let r=e;if(o.length>0){const e=new RegExp(o.filter(((e,t)=>o.indexOf(e)===t)).sort(((e,t)=>t.length-e.length)).map((e=>se(e))).join("|"),"g");r=r.replace(e,(e=>{const t=e.replace(ce,"$1.\\:hover");return`${e}, ${t}`}))}if(s.length>0){const e=new RegExp(s.filter(((e,t)=>s.indexOf(e)===t)).sort(((e,t)=>t.length-e.length)).map((e=>se(e))).join("|"),"g");r=r.replace(e,(e=>e.replace(ae,"$1-$2")))}return null==t||t.stylesWithHoverClass.set(e,r),r}function de(){return{stylesWithHoverClass:new Map}}function he(e,t){var n;const{doc:i,hackCss:o,cache:s}=t;switch(e.type){case Q.Document:return i.implementation.createDocument(null,"",null);case Q.DocumentType:return i.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case Q.Element:{const t=function(e){let t=oe[e.tagName]?oe[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);let r;e.isSVG?r=i.createElementNS("http://www.w3.org/2000/svg",t):(e.isCustom&&(null===(n=i.defaultView)||void 0===n?void 0:n.customElements)&&!i.defaultView.customElements.get(e.tagName)&&i.defaultView.customElements.define(e.tagName,class extends i.defaultView.HTMLElement{}),r=i.createElement(t));const a={};for(const n in e.attributes){if(!Object.prototype.hasOwnProperty.call(e.attributes,n))continue;let l=e.attributes[n];if("option"===t&&"selected"===n&&!1===l)continue;if(null===l)continue;if(!0===l&&(l=""),n.startsWith("rr_")){a[n]=l;continue}const c="textarea"===t&&"value"===n,u="style"===t&&"_cssText"===n;if(u&&o&&"string"==typeof l&&(l=ue(l,s)),!c&&!u||"string"!=typeof l)try{if(e.isSVG&&"xlink:href"===n)r.setAttributeNS("http://www.w3.org/1999/xlink",n,l.toString());else if("onload"===n||"onclick"===n||"onmouse"===n.substring(0,7))r.setAttribute("_"+n,l.toString());else{if("meta"===t&&"Content-Security-Policy"===e.attributes["http-equiv"]&&"content"===n){r.setAttribute("csp-content",l.toString());continue}("link"!==t||"preload"!==e.attributes.rel&&"modulepreload"!==e.attributes.rel||"script"!==e.attributes.as)&&("link"===t&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")||("img"===t&&e.attributes.srcset&&e.attributes.rr_dataURL?r.setAttribute("rrweb-original-srcset",e.attributes.srcset):r.setAttribute(n,l.toString())))}}catch(e){}else r.appendChild(i.createTextNode(l)),e.childNodes=[]}for(const n in a){const o=a[n];if("canvas"===t&&"rr_dataURL"===n){const e=i.createElement("img");e.onload=()=>{const t=r.getContext("2d");t&&t.drawImage(e,0,0,e.width,e.height)},e.src=o.toString(),r.RRNodeType&&(r.rr_dataURL=o.toString())}else if("img"===t&&"rr_dataURL"===n){const t=r;t.currentSrc.startsWith("data:")||(t.setAttribute("rrweb-original-src",e.attributes.src),t.src=o.toString())}if("rr_width"===n)r.style.width=o.toString();else if("rr_height"===n)r.style.height=o.toString();else if("rr_mediaCurrentTime"===n&&"number"==typeof o)r.currentTime=o;else if("rr_mediaState"===n)switch(o){case"played":r.play().catch((e=>console.warn("media playback error",e)));break;case"paused":r.pause()}else"rr_mediaPlaybackRate"===n&&"number"==typeof o?r.playbackRate=o:"rr_mediaMuted"===n&&"boolean"==typeof o?r.muted=o:"rr_mediaLoop"===n&&"boolean"==typeof o?r.loop=o:"rr_mediaVolume"===n&&"number"==typeof o&&(r.volume=o)}if(e.isShadowHost)if(r.shadowRoot)for(;r.shadowRoot.firstChild;)r.shadowRoot.removeChild(r.shadowRoot.firstChild);else r.attachShadow({mode:"open"});return r}case Q.Text:return i.createTextNode(e.isStyle&&o?ue(e.textContent,s):e.textContent);case Q.CDATA:return i.createCDATASection(e.textContent);case Q.Comment:return i.createComment(e.textContent);default:return null}}function pe(e,t){const{doc:n,mirror:i,skipChild:o=!1,hackCss:s=!0,afterAppend:r,cache:a}=t;if(i.has(e.id)){const t=i.getNode(e.id);if(function(e,t){return!(!e||!t||e.type!==t.type)&&(e.type===Q.Document?e.compatMode===t.compatMode:e.type===Q.DocumentType?e.name===t.name&&e.publicId===t.publicId&&e.systemId===t.systemId:e.type===Q.Comment||e.type===Q.Text||e.type===Q.CDATA?e.textContent===t.textContent:e.type===Q.Element&&e.tagName===t.tagName&&JSON.stringify(e.attributes)===JSON.stringify(t.attributes)&&e.isSVG===t.isSVG&&e.needBlock===t.needBlock)}(i.getMeta(t),e))return i.getNode(e.id)}let l=he(e,{doc:n,hackCss:s,cache:a});if(!l)return null;if(e.rootId&&i.getNode(e.rootId)!==n&&i.replace(e.rootId,n),e.type===Q.Document&&(n.close(),n.open(),"BackCompat"===e.compatMode&&e.childNodes&&e.childNodes[0].type!==Q.DocumentType&&(e.childNodes[0].type===Q.Element&&"xmlns"in e.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===e.childNodes[0].attributes.xmlns?n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),l=n),i.add(l,e),(e.type===Q.Document||e.type===Q.Element)&&!o)for(const t of e.childNodes){const o=pe(t,{doc:n,mirror:i,skipChild:!1,hackCss:s,afterAppend:r,cache:a});if(o){if(t.isShadow&&J(l)&&l.shadowRoot)l.shadowRoot.appendChild(o);else if(e.type===Q.Document&&t.type==Q.Element){const e=o;let t=null;e.childNodes.forEach((e=>{"BODY"===e.nodeName&&(t=e)})),t?(e.removeChild(t),l.appendChild(o),e.appendChild(t)):l.appendChild(o)}else l.appendChild(o);r&&r(o,t.id)}else console.warn("Failed to rebuild",t)}return l}function me(e,t){const{doc:n,onVisit:i,hackCss:o=!0,afterAppend:s,cache:r,mirror:a=new Z}=t,l=pe(e,{doc:n,mirror:a,skipChild:!1,hackCss:o,afterAppend:s,cache:r});return function(e,t){for(const i of e.getIds())e.has(i)&&(n=e.getNode(i),t(n));var n}(a,(e=>{i&&i(e),function(e,t){const n=t.getMeta(e);if((null==n?void 0:n.type)!==Q.Element)return;const i=e;for(const e in n.attributes){if(!Object.prototype.hasOwnProperty.call(n.attributes,e)||!e.startsWith("rr_"))continue;const t=n.attributes[e];"rr_scrollLeft"===e&&(i.scrollLeft=t),"rr_scrollTop"===e&&(i.scrollTop=t)}}(e,a)})),l}var fe=(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))(fe||{}),ge=(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[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(ge||{}),ye=(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))(ye||{}),ve=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ve||{}),be=(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.Destroy="destroy",e))(be||{});const we="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let Ee={map:{},getId:()=>(console.error(we),-1),getNode:()=>(console.error(we),null),removeNodeFromMap(){console.error(we)},has:()=>(console.error(we),!1),reset(){console.error(we)}};function Ne(e){const t={},n=(e,n)=>{const i={value:e,parent:n,children:[]};return t[e.node.id]=i,i},i=[];for(const o of e){const{nextId:e,parentId:s}=o;if(e&&e in t){const s=t[e];if(s.parent){const e=s.parent.children.indexOf(s);s.parent.children.splice(e,0,n(o,s.parent))}else{const e=i.indexOf(s);i.splice(e,0,n(o,null))}}else if(s in t){const e=t[s];e.children.push(n(o,e))}else i.push(n(o,null))}return i}function Te(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)Te(e.children[n],t)}function Se(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Me(e,t){var n,i;const o=null===(i=null===(n=e.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===i?void 0:i.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=o.getBoundingClientRect(),r=Me(o,t),a=s.height/o.clientHeight;return{x:s.x*r.relativeScale+r.x,y:s.y*r.relativeScale+r.y,relativeScale:a,absoluteScale:r.absoluteScale*a}}function De(e){return Boolean(null==e?void 0:e.shadowRoot)}function Ce(e,t){const n=e[t[0]];return 1===t.length?n:Ce(n.cssRules[t[1]].cssRules,t.slice(2))}function xe(e){const t=[...e],n=t.pop();return{positions:t,index:n}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Ee=new Proxy(Ee,{get:(e,t,n)=>("map"===t&&console.error(we),Reflect.get(e,t,n))})),/[1-9][0-9]{12}/.test(Date.now().toString());class Re{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}
|
|
2
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|