Socket
Socket
Sign inDemoInstall

rrweb-snapshot

Package Overview
Dependencies
Maintainers
1
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rrweb-snapshot - npm Package Compare versions

Comparing version 1.1.9 to 1.1.10

34

dist/rrweb-snapshot.js

@@ -199,5 +199,8 @@ var rrwebSnapshot = (function (exports) {

function transformAttribute(doc, tagName, name, value) {
if (name === 'src' || ((name === 'href' || name === 'xlink:href') && value)) {
if (name === 'src' || (name === 'href' && value)) {
return absoluteToDoc(doc, value);
}
else if (name === 'xlink:href' && value && value[0] !== '#') {
return absoluteToDoc(doc, value);
}
else if (name === 'background' &&

@@ -302,4 +305,12 @@ value &&

}
function stringifyStyleSheet(sheet) {
return sheet.cssRules
? Array.from(sheet.cssRules)
.map(function (rule) { return rule.cssText || ''; })
.join('')
: '';
}
function serializeNode(n, options) {
var doc = options.doc, blockClass = options.blockClass, blockSelector = options.blockSelector, maskTextClass = options.maskTextClass, maskTextSelector = options.maskTextSelector, inlineStylesheet = options.inlineStylesheet, _a = options.maskInputOptions, maskInputOptions = _a === void 0 ? {} : _a, maskTextFn = options.maskTextFn, maskInputFn = options.maskInputFn, recordCanvas = options.recordCanvas, keepIframeSrcFn = options.keepIframeSrcFn;
var _a;
var doc = options.doc, blockClass = options.blockClass, blockSelector = options.blockSelector, maskTextClass = options.maskTextClass, maskTextSelector = options.maskTextSelector, inlineStylesheet = options.inlineStylesheet, _b = options.maskInputOptions, maskInputOptions = _b === void 0 ? {} : _b, maskTextFn = options.maskTextFn, maskInputFn = options.maskInputFn, recordCanvas = options.recordCanvas, keepIframeSrcFn = options.keepIframeSrcFn;
var rootId;

@@ -339,4 +350,4 @@ if (doc.__sn) {

var attributes = {};
for (var _i = 0, _b = Array.from(n.attributes); _i < _b.length; _i++) {
var _c = _b[_i], name_1 = _c.name, value = _c.value;
for (var _i = 0, _c = Array.from(n.attributes); _i < _c.length; _i++) {
var _d = _c[_i], name_1 = _d.name, value = _d.value;
attributes[name_1] = transformAttribute(doc, tagName, name_1, value);

@@ -410,3 +421,3 @@ }

if (needBlock) {
var _d = n.getBoundingClientRect(), width = _d.width, height = _d.height;
var _e = n.getBoundingClientRect(), width = _e.width, height = _e.height;
attributes = {

@@ -419,2 +430,5 @@ "class": attributes["class"],

if (tagName === 'iframe' && !keepIframeSrcFn(attributes.src)) {
if (!n.contentDocument) {
attributes.rr_src = attributes.src;
}
delete attributes.src;

@@ -437,2 +451,9 @@ }

if (isStyle && textContent) {
try {
if ((_a = n.parentNode.sheet) === null || _a === void 0 ? void 0 : _a.cssRules) {
textContent = stringifyStyleSheet(n.parentNode.sheet);
}
}
catch (_f) {
}
textContent = absoluteToStylesheet(textContent, getHref());

@@ -1446,3 +1467,4 @@ }

if (n.compatMode === 'BackCompat' &&
(n.childNodes && n.childNodes[0].type !== exports.NodeType.DocumentType)) {
n.childNodes &&
n.childNodes[0].type !== exports.NodeType.DocumentType) {
if (n.childNodes[0].type === exports.NodeType.Element &&

@@ -1449,0 +1471,0 @@ 'xmlns' in n.childNodes[0].attributes &&

2

dist/rrweb-snapshot.min.js

@@ -1,2 +0,2 @@

var rrwebSnapshot=function(e){"use strict";var t;function r(e){return e.nodeType===e.ELEMENT_NODE}function n(e){var t,r=null===(t=e)||void 0===t?void 0:t.host;return Boolean(r&&r.shadowRoot&&r.shadowRoot===e)}function a(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,a=e.value,o=e.maskInputFn,i=a||"";return(t[r.toLowerCase()]||t[n])&&(i=o?o(i):"*".repeat(i.length)),i}e.NodeType=void 0,(t=e.NodeType||(e.NodeType={}))[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment";var o=1,i=RegExp("[^a-z0-9-_:]");function s(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(c).join(""):null}catch(e){return null}}function c(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=s(e.styleSheet)||t}catch(e){}return t}var u=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,l=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,f=/^(data:)([^,]*),(.*)/i;function p(e,t){return(e||"").replace(u,(function(e,r,n,a,o,i){var s,c=n||o||i,u=r||a||"";if(!c)return e;if(!l.test(c))return"url("+u+c+u+")";if(f.test(c))return"url("+u+c+u+")";if("/"===c[0])return"url("+u+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+c)+u+")";var p=t.split("/"),d=c.split("/");p.pop();for(var m=0,h=d;m<h.length;m++){var v=h[m];"."!==v&&(".."===v?p.pop():p.push(v))}return"url("+u+p.join("/")+u+")"}))}var d=/^[^ \t\n\r\u000c]+/,m=/^[, \t\n\r\u000c]+/;function h(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function v(){var e=document.createElement("a");return e.href="",e.href}function y(e,t,r,n){return"src"===r||("href"===r||"xlink:href"===r)&&n?h(e,n):"background"!==r||!n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r&&n?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,a=e.exec(t.substring(r));return a?(n=a[0],r+=n.length,n):""}for(var a=[];n(m),!(r>=t.length);){var o=n(d);if(","===o.slice(-1))o=h(e,o.substring(0,o.length-1)),a.push(o);else{var i="";o=h(e,o);for(var s=!1;;){var c=t.charAt(r);if(""===c){a.push((o+i).trim());break}if(s)")"===c&&(s=!1);else{if(","===c){r+=1,a.push((o+i).trim());break}"("===c&&(s=!0)}i+=c,r+=1}}}return a.join(", ")}(e,n):"style"===r&&n?p(n,v()):n:h(e,n)}function g(e,t,r){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else e.classList.forEach((function(e){if(t.test(e))return!0}));return!(!r||!e.matches(r))||g(e.parentNode,t,r)}return e.nodeType,e.TEXT_NODE,g(e.parentNode,t,r)}function T(t,r){var n,o,c=r.doc,u=r.blockClass,l=r.blockSelector,f=r.maskTextClass,d=r.maskTextSelector,m=r.inlineStylesheet,h=r.maskInputOptions,T=void 0===h?{}:h,b=r.maskTextFn,k=r.maskInputFn,C=r.recordCanvas,N=r.keepIframeSrcFn;if(c.__sn){var S=c.__sn.id;n=1===S?void 0:S}switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.NodeType.Document,childNodes:[],compatMode:t.compatMode,rootId:n}:{type:e.NodeType.Document,childNodes:[],rootId:n};case t.DOCUMENT_TYPE_NODE:return{type:e.NodeType.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:n};case t.ELEMENT_NODE:for(var w=function(e,t,r){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=0;n<e.classList.length;n++){var a=e.classList[n];if(t.test(a))return!0}return!!r&&e.matches(r)}(t,u,l),x=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return i.test(t)?"div":t}(t),E={},D=0,I=Array.from(t.attributes);D<I.length;D++){var _=I[D],O=_.name,L=_.value;E[O]=y(c,x,O,L)}if("link"===x&&m){var A,M=Array.from(c.styleSheets).find((function(e){return e.href===t.href}));(A=s(M))&&(delete E.rel,delete E.href,E._cssText=p(A,M.href))}if("style"===x&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(A=s(t.sheet))&&(E._cssText=p(A,v()));if("input"===x||"textarea"===x||"select"===x){L=t.value;"radio"!==E.type&&"checkbox"!==E.type&&"submit"!==E.type&&"button"!==E.type&&L?E.value=a({type:E.type,tagName:x,value:L,maskInputOptions:T,maskInputFn:k}):t.checked&&(E.checked=t.checked)}if("option"===x&&(t.selected?E.selected=!0:delete E.selected),"canvas"===x&&C&&(E.rr_dataURL=t.toDataURL()),"audio"!==x&&"video"!==x||(E.rr_mediaState=t.paused?"paused":"played",E.rr_mediaCurrentTime=t.currentTime),t.scrollLeft&&(E.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(E.rr_scrollTop=t.scrollTop),w){var F=t.getBoundingClientRect(),R=F.width,W=F.height;E={class:E.class,rr_width:R+"px",rr_height:W+"px"}}return"iframe"!==x||N(E.src)||delete E.src,{type:e.NodeType.Element,tagName:x,attributes:E,childNodes:[],isSVG:(o=t,"svg"===o.tagName||o instanceof SVGElement||void 0),needBlock:w,rootId:n};case t.TEXT_NODE:var P=t.parentNode&&t.parentNode.tagName,j=t.textContent,G="STYLE"===P||void 0,H="SCRIPT"===P||void 0;return G&&j&&(j=p(j,v())),H&&(j="SCRIPT_PLACEHOLDER"),!G&&!H&&g(t,f,d)&&j&&(j=b?b(j):j.replace(/[\S]/g,"*")),{type:e.NodeType.Text,textContent:j||"",isStyle:G,rootId:n};case t.CDATA_SECTION_NODE:return{type:e.NodeType.CDATA,textContent:"",rootId:n};case t.COMMENT_NODE:return{type:e.NodeType.Comment,textContent:t.textContent||"",rootId:n};default:return!1}}function b(e){return void 0===e?"":e.toLowerCase()}function k(t,a){var i,s=a.doc,c=a.map,u=a.blockClass,l=a.blockSelector,f=a.maskTextClass,p=a.maskTextSelector,d=a.skipChild,m=void 0!==d&&d,h=a.inlineStylesheet,v=void 0===h||h,y=a.maskInputOptions,g=void 0===y?{}:y,C=a.maskTextFn,N=a.maskInputFn,S=a.slimDOMOptions,w=a.recordCanvas,x=void 0!==w&&w,E=a.onSerialize,D=a.onIframeLoad,I=a.iframeLoadTimeout,_=void 0===I?5e3:I,O=a.keepIframeSrcFn,L=void 0===O?function(){return!1}:O,A=a.preserveWhiteSpace,M=void 0===A||A,F=T(t,{doc:s,blockClass:u,blockSelector:l,maskTextClass:f,maskTextSelector:p,inlineStylesheet:v,maskInputOptions:g,maskTextFn:C,maskInputFn:N,recordCanvas:x,keepIframeSrcFn:L});if(!F)return console.warn(t,"not serialized"),null;i="__sn"in t?t.__sn.id:!function(t,r){if(r.comment&&t.type===e.NodeType.Comment)return!0;if(t.type===e.NodeType.Element){if(r.script&&("script"===t.tagName||"link"===t.tagName&&"preload"===t.attributes.rel&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")))return!0;if(r.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(b(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===b(t.attributes.name)||"icon"===b(t.attributes.rel)||"apple-touch-icon"===b(t.attributes.rel)||"shortcut icon"===b(t.attributes.rel))))return!0;if("meta"===t.tagName){if(r.headMetaDescKeywords&&b(t.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(b(t.attributes.property).match(/^(og|twitter|fb):/)||b(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===b(t.attributes.name)))return!0;if(r.headMetaRobots&&("robots"===b(t.attributes.name)||"googlebot"===b(t.attributes.name)||"bingbot"===b(t.attributes.name)))return!0;if(r.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(r.headMetaAuthorship&&("author"===b(t.attributes.name)||"generator"===b(t.attributes.name)||"framework"===b(t.attributes.name)||"publisher"===b(t.attributes.name)||"progid"===b(t.attributes.name)||b(t.attributes.property).match(/^article:/)||b(t.attributes.property).match(/^product:/)))return!0;if(r.headMetaVerification&&("google-site-verification"===b(t.attributes.name)||"yandex-verification"===b(t.attributes.name)||"csrf-token"===b(t.attributes.name)||"p:domain_verify"===b(t.attributes.name)||"verify-v1"===b(t.attributes.name)||"verification"===b(t.attributes.name)||"shopify-checkout-api-token"===b(t.attributes.name)))return!0}}return!1}(F,S)&&(M||F.type!==e.NodeType.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?o++:-2;var R=Object.assign(F,{id:i});if(t.__sn=R,-2===i)return null;c[i]=t,E&&E(t);var W=!m;if(R.type===e.NodeType.Element&&(W=W&&!R.needBlock,delete R.needBlock),(R.type===e.NodeType.Document||R.type===e.NodeType.Element)&&W){S.headWhitespace&&F.type===e.NodeType.Element&&"head"===F.tagName&&(M=!1);for(var P={doc:s,map:c,blockClass:u,blockSelector:l,maskTextClass:f,maskTextSelector:p,skipChild:m,inlineStylesheet:v,maskInputOptions:g,maskTextFn:C,maskInputFn:N,slimDOMOptions:S,recordCanvas:x,preserveWhiteSpace:M,onSerialize:E,onIframeLoad:D,iframeLoadTimeout:_,keepIframeSrcFn:L},j=0,G=Array.from(t.childNodes);j<G.length;j++){(B=k(G[j],P))&&R.childNodes.push(B)}if(r(t)&&t.shadowRoot){R.isShadowHost=!0;for(var H=0,z=Array.from(t.shadowRoot.childNodes);H<z.length;H++){var B;(B=k(z[H],P))&&(B.isShadow=!0,R.childNodes.push(B))}}}return t.parentNode&&n(t.parentNode)&&(R.isShadow=!0),R.type===e.NodeType.Element&&"iframe"===R.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var a,o=!1;try{a=n.document.readyState}catch(e){return}if("complete"===a){var i="about:blank";n.location.href===i&&e.src!==i&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var s=setTimeout((function(){o||(t(),o=!0)}),r);e.addEventListener("load",(function(){clearTimeout(s),o=!0,t()}))}}}(t,(function(){var e=t.contentDocument;if(e&&D){var r=k(e,{doc:e,map:c,blockClass:u,blockSelector:l,maskTextClass:f,maskTextSelector:p,skipChild:!1,inlineStylesheet:v,maskInputOptions:g,maskTextFn:C,maskInputFn:N,slimDOMOptions:S,recordCanvas:x,preserveWhiteSpace:M,onSerialize:E,onIframeLoad:D,iframeLoadTimeout:_,keepIframeSrcFn:L});r&&D(t,r)}}),_),R}var C=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function N(e,t){void 0===t&&(t={});var r=1,n=1;function a(e){var t=e.match(/\n/g);t&&(r+=t.length);var a=e.lastIndexOf("\n");n=-1===a?n+e.length:e.length-a}function o(){var e={line:r,column:n};return function(t){return t.position=new i(e),d(),t}}var i=function(e){this.start=e,this.end={line:r,column:n},this.source=t.source};i.prototype.content=e;var s=[];function c(a){var o=new Error(t.source+":"+r+":"+n+": "+a);if(o.reason=a,o.filename=t.source,o.line=r,o.column=n,o.source=e,!t.silent)throw o;s.push(o)}function u(){return p(/^{\s*/)}function l(){return p(/^}/)}function f(){var t,r=[];for(d(),m(r);e.length&&"}"!==e.charAt(0)&&(t=D()||I());)!1!==t&&(r.push(t),m(r));return r}function p(t){var r=t.exec(e);if(r){var n=r[0];return a(n),e=e.slice(n.length),r}}function d(){p(/^\s*/)}function m(e){var t;for(void 0===e&&(e=[]);t=h();)!1!==t&&e.push(t),t=h();return e}function h(){var t=o();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var r=2;""!==e.charAt(r)&&("*"!==e.charAt(r)||"/"!==e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return c("End of comment missing");var i=e.slice(2,r-2);return n+=2,a(i),e=e.slice(r),n+=2,t({type:"comment",comment:i})}}function v(){var e=p(/^([^{]+)/);if(e)return S(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function y(){var e=o(),t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=S(t[0]);if(!p(/^:\s*/))return c("property missing ':'");var n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),a=e({type:"declaration",property:r.replace(C,""),value:n?S(n[0]).replace(C,""):""});return p(/^[;\s]*/),a}}function g(){var e,t=[];if(!u())return c("missing '{'");for(m(t);e=y();)!1!==e&&(t.push(e),m(t)),e=y();return l()?t:c("missing '}'")}function T(){for(var e,t=[],r=o();e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:g()})}var b,k=E("import"),N=E("charset"),x=E("namespace");function E(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=o(),n=p(t);if(n){var a={type:e};return a[e]=n[1].trim(),r(a)}}}function D(){if("@"===e[0])return function(){var e=o(),t=p(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=p(/^([-\w]+)\s*/)))return c("@keyframes missing name");var n,a=t[1];if(!u())return c("@keyframes missing '{'");for(var i=m();n=T();)i.push(n),i=i.concat(m());return l()?e({type:"keyframes",name:a,vendor:r,keyframes:i}):c("@keyframes missing '}'")}}()||function(){var e=o(),t=p(/^@media *([^{]+)/);if(t){var r=S(t[1]);if(!u())return c("@media missing '{'");var n=m().concat(f());return l()?e({type:"media",media:r,rules:n}):c("@media missing '}'")}}()||function(){var e=o(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:S(t[1]),media:S(t[2])})}()||function(){var e=o(),t=p(/^@supports *([^{]+)/);if(t){var r=S(t[1]);if(!u())return c("@supports missing '{'");var n=m().concat(f());return l()?e({type:"supports",supports:r,rules:n}):c("@supports missing '}'")}}()||k()||N()||x()||function(){var e=o(),t=p(/^@([-\w]+)?document *([^{]+)/);if(t){var r=S(t[1]),n=S(t[2]);if(!u())return c("@document missing '{'");var a=m().concat(f());return l()?e({type:"document",document:n,vendor:r,rules:a}):c("@document missing '}'")}}()||function(){var e=o();if(p(/^@page */)){var t=v()||[];if(!u())return c("@page missing '{'");for(var r,n=m();r=y();)n.push(r),n=n.concat(m());return l()?e({type:"page",selectors:t,declarations:n}):c("@page missing '}'")}}()||function(){var e=o();if(p(/^@host\s*/)){if(!u())return c("@host missing '{'");var t=m().concat(f());return l()?e({type:"host",rules:t}):c("@host missing '}'")}}()||function(){var e=o();if(p(/^@font-face\s*/)){if(!u())return c("@font-face missing '{'");for(var t,r=m();t=y();)r.push(t),r=r.concat(m());return l()?e({type:"font-face",declarations:r}):c("@font-face missing '}'")}}()}function I(){var e=o(),t=v();return t?(m(),e({type:"rule",selectors:t,declarations:g()})):c("selector missing")}return w((b=f(),{type:"stylesheet",stylesheet:{source:t.source,rules:b,parsingErrors:s}}))}function S(e){return e?e.replace(/^\s+|\s+$/g,""):""}function w(e,t){for(var r=e&&"string"==typeof e.type,n=r?e:t,a=0,o=Object.keys(e);a<o.length;a++){var i=e[o[a]];Array.isArray(i)?i.forEach((function(e){w(e,n)})):i&&"object"==typeof i&&w(i,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var x={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"};var E=/([^\\]):hover/,D=new RegExp(E,"g");function I(e,t){var r=null==t?void 0:t.stylesWithHoverClass.get(e);if(r)return r;var n=N(e,{silent:!0});if(!n.stylesheet)return e;var a=[];if(n.stylesheet.rules.forEach((function(e){"selectors"in e&&(e.selectors||[]).forEach((function(e){E.test(e)&&a.push(e)}))})),0===a.length)return e;var o=new RegExp(a.filter((function(e,t){return a.indexOf(e)===t})).sort((function(e,t){return t.length-e.length})).map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})).join("|"),"g"),i=e.replace(o,(function(e){var t=e.replace(D,"$1.\\:hover");return e+", "+t}));return null==t||t.stylesWithHoverClass.set(e,i),i}function _(t,r){var n=r.doc,a=r.hackCss,o=r.cache;switch(t.type){case e.NodeType.Document:return n.implementation.createDocument(null,"",null);case e.NodeType.DocumentType:return n.implementation.createDocumentType(t.name||"html",t.publicId,t.systemId);case e.NodeType.Element:var i,s=function(e){var t=x[e.tagName]?x[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(t);i=t.isSVG?n.createElementNS("http://www.w3.org/2000/svg",s):n.createElement(s);var c=function(e){if(!t.attributes.hasOwnProperty(e))return"continue";var r=t.attributes[e];if("option"===s&&"selected"===e&&!1===r)return"continue";if(r="boolean"==typeof r||"number"==typeof r?"":r,e.startsWith("rr_")){if("canvas"===s&&"rr_dataURL"===e){var c=document.createElement("img");c.src=r,c.onload=function(){var e=i.getContext("2d");e&&e.drawImage(c,0,0,c.width,c.height)}}if("rr_width"===e&&(i.style.width=r),"rr_height"===e&&(i.style.height=r),"rr_mediaCurrentTime"===e&&(i.currentTime=t.attributes.rr_mediaCurrentTime),"rr_mediaState"===e)switch(r){case"played":i.play().catch((function(e){return console.warn("media playback error",e)}));break;case"paused":i.pause()}}else{var u="textarea"===s&&"value"===e,l="style"===s&&"_cssText"===e;if(l&&a&&(r=I(r,o)),u||l){for(var f=n.createTextNode(r),p=0,d=Array.from(i.childNodes);p<d.length;p++){var m=d[p];m.nodeType===i.TEXT_NODE&&i.removeChild(m)}return i.appendChild(f),"continue"}try{if(t.isSVG&&"xlink:href"===e)i.setAttributeNS("http://www.w3.org/1999/xlink",e,r);else if("onload"===e||"onclick"===e||"onmouse"===e.substring(0,7))i.setAttribute("_"+e,r);else{if("meta"===s&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"===e)return i.setAttribute("csp-content",r),"continue";"link"===s&&"preload"===t.attributes.rel&&"script"===t.attributes.as||"link"===s&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")||i.setAttribute(e,r)}}catch(e){}}};for(var u in t.attributes)c(u);if(t.isShadowHost)if(i.shadowRoot)for(;i.shadowRoot.firstChild;)i.shadowRoot.removeChild(i.shadowRoot.firstChild);else i.attachShadow({mode:"open"});return i;case e.NodeType.Text:return n.createTextNode(t.isStyle&&a?I(t.textContent,o):t.textContent);case e.NodeType.CDATA:return n.createCDATASection(t.textContent);case e.NodeType.Comment:return n.createComment(t.textContent);default:return null}}function O(t,n){var a=n.doc,o=n.map,i=n.skipChild,s=void 0!==i&&i,c=n.hackCss,u=void 0===c||c,l=n.afterAppend,f=n.cache,p=_(t,{doc:a,hackCss:u,cache:f});if(!p)return null;if(t.rootId&&console.assert(o[t.rootId]===a,"Target document should has the same root id."),t.type===e.NodeType.Document&&(a.close(),a.open(),"BackCompat"===t.compatMode&&t.childNodes&&t.childNodes[0].type!==e.NodeType.DocumentType&&(t.childNodes[0].type===e.NodeType.Element&&"xmlns"in t.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===t.childNodes[0].attributes.xmlns?a.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):a.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),p=a),p.__sn=t,o[t.id]=p,(t.type===e.NodeType.Document||t.type===e.NodeType.Element)&&!s)for(var d=0,m=t.childNodes;d<m.length;d++){var h=m[d],v=O(h,{doc:a,map:o,skipChild:!1,hackCss:u,afterAppend:l,cache:f});v?(h.isShadow&&r(p)&&p.shadowRoot?p.shadowRoot.appendChild(v):p.appendChild(v),l&&l(v)):console.warn("Failed to rebuild",h)}return p}return e.IGNORED_NODE=-2,e.addHoverClass=I,e.buildNodeWithSN=O,e.cleanupSnapshot=function(){o=1},e.createCache=function(){return{stylesWithHoverClass:new Map}},e.isElement=r,e.isShadowRoot=n,e.maskInputValue=a,e.needMaskingText=g,e.rebuild=function(t,r){var n=r.doc,a=r.onVisit,o=r.hackCss,i={},s=O(t,{doc:n,map:i,skipChild:!1,hackCss:void 0===o||o,afterAppend:r.afterAppend,cache:r.cache});return function(e,t){for(var r in e)e[r]&&(n=e[r],t(n));var n}(i,(function(t){a&&a(t),function(t){var r=t.__sn;if(r.type===e.NodeType.Element){var n=t;for(var a in r.attributes)if(r.attributes.hasOwnProperty(a)&&a.startsWith("rr_")){var o=r.attributes[a];"rr_scrollLeft"===a&&(n.scrollLeft=o),"rr_scrollTop"===a&&(n.scrollTop=o)}}}(t)})),[s,i]},e.serializeNodeWithId=k,e.snapshot=function(e,t){var r=t||{},n=r.blockClass,a=void 0===n?"rr-block":n,o=r.blockSelector,i=void 0===o?null:o,s=r.maskTextClass,c=void 0===s?"rr-mask":s,u=r.maskTextSelector,l=void 0===u?null:u,f=r.inlineStylesheet,p=void 0===f||f,d=r.recordCanvas,m=void 0!==d&&d,h=r.maskAllInputs,v=void 0!==h&&h,y=r.maskTextFn,g=r.maskInputFn,T=r.slimDOM,b=void 0!==T&&T,C=r.preserveWhiteSpace,N=r.onSerialize,S=r.onIframeLoad,w=r.iframeLoadTimeout,x=r.keepIframeSrcFn,E={};return[k(e,{doc:e,map:E,blockClass:a,blockSelector:i,maskTextClass:c,maskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===v?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===v?{password:!0}:v,maskTextFn:y,maskInputFn:g,slimDOMOptions:!0===b||"all"===b?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===b,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===b?{}:b,recordCanvas:m,preserveWhiteSpace:C,onSerialize:N,onIframeLoad:S,iframeLoadTimeout:w,keepIframeSrcFn:void 0===x?function(){return!1}:x}),E]},e.transformAttribute=y,e.visitSnapshot=function(t,r){!function t(n){r(n),n.type!==e.NodeType.Document&&n.type!==e.NodeType.Element||n.childNodes.forEach(t)}(t)},Object.defineProperty(e,"__esModule",{value:!0}),e}({});
var rrwebSnapshot=function(e){"use strict";var t;function r(e){return e.nodeType===e.ELEMENT_NODE}function n(e){var t,r=null===(t=e)||void 0===t?void 0:t.host;return Boolean(r&&r.shadowRoot&&r.shadowRoot===e)}function a(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,a=e.value,o=e.maskInputFn,i=a||"";return(t[r.toLowerCase()]||t[n])&&(i=o?o(i):"*".repeat(i.length)),i}e.NodeType=void 0,(t=e.NodeType||(e.NodeType={}))[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment";var o=1,i=RegExp("[^a-z0-9-_:]");function s(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(c).join(""):null}catch(e){return null}}function c(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=s(e.styleSheet)||t}catch(e){}return t}var u=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,l=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,f=/^(data:)([^,]*),(.*)/i;function p(e,t){return(e||"").replace(u,(function(e,r,n,a,o,i){var s,c=n||o||i,u=r||a||"";if(!c)return e;if(!l.test(c))return"url("+u+c+u+")";if(f.test(c))return"url("+u+c+u+")";if("/"===c[0])return"url("+u+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+c)+u+")";var p=t.split("/"),d=c.split("/");p.pop();for(var m=0,h=d;m<h.length;m++){var v=h[m];"."!==v&&(".."===v?p.pop():p.push(v))}return"url("+u+p.join("/")+u+")"}))}var d=/^[^ \t\n\r\u000c]+/,m=/^[, \t\n\r\u000c]+/;function h(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function v(){var e=document.createElement("a");return e.href="",e.href}function y(e,t,r,n){return"src"===r||"href"===r&&n||"xlink:href"===r&&n&&"#"!==n[0]?h(e,n):"background"!==r||!n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r&&n?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,a=e.exec(t.substring(r));return a?(n=a[0],r+=n.length,n):""}for(var a=[];n(m),!(r>=t.length);){var o=n(d);if(","===o.slice(-1))o=h(e,o.substring(0,o.length-1)),a.push(o);else{var i="";o=h(e,o);for(var s=!1;;){var c=t.charAt(r);if(""===c){a.push((o+i).trim());break}if(s)")"===c&&(s=!1);else{if(","===c){r+=1,a.push((o+i).trim());break}"("===c&&(s=!0)}i+=c,r+=1}}}return a.join(", ")}(e,n):"style"===r&&n?p(n,v()):n:h(e,n)}function g(e,t,r){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else e.classList.forEach((function(e){if(t.test(e))return!0}));return!(!r||!e.matches(r))||g(e.parentNode,t,r)}return e.nodeType,e.TEXT_NODE,g(e.parentNode,t,r)}function T(t,r){var n,o,c,u,l=r.doc,f=r.blockClass,d=r.blockSelector,m=r.maskTextClass,h=r.maskTextSelector,T=r.inlineStylesheet,b=r.maskInputOptions,k=void 0===b?{}:b,N=r.maskTextFn,C=r.maskInputFn,S=r.recordCanvas,w=r.keepIframeSrcFn;if(l.__sn){var x=l.__sn.id;o=1===x?void 0:x}switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.NodeType.Document,childNodes:[],compatMode:t.compatMode,rootId:o}:{type:e.NodeType.Document,childNodes:[],rootId:o};case t.DOCUMENT_TYPE_NODE:return{type:e.NodeType.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:o};case t.ELEMENT_NODE:for(var E=function(e,t,r){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=0;n<e.classList.length;n++){var a=e.classList[n];if(t.test(a))return!0}return!!r&&e.matches(r)}(t,f,d),D=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return i.test(t)?"div":t}(t),I={},_=0,O=Array.from(t.attributes);_<O.length;_++){var A=O[_],L=A.name,M=A.value;I[L]=y(l,D,L,M)}if("link"===D&&T){var F,R=Array.from(l.styleSheets).find((function(e){return e.href===t.href}));(F=s(R))&&(delete I.rel,delete I.href,I._cssText=p(F,R.href))}if("style"===D&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(F=s(t.sheet))&&(I._cssText=p(F,v()));if("input"===D||"textarea"===D||"select"===D){M=t.value;"radio"!==I.type&&"checkbox"!==I.type&&"submit"!==I.type&&"button"!==I.type&&M?I.value=a({type:I.type,tagName:D,value:M,maskInputOptions:k,maskInputFn:C}):t.checked&&(I.checked=t.checked)}if("option"===D&&(t.selected?I.selected=!0:delete I.selected),"canvas"===D&&S&&(I.rr_dataURL=t.toDataURL()),"audio"!==D&&"video"!==D||(I.rr_mediaState=t.paused?"paused":"played",I.rr_mediaCurrentTime=t.currentTime),t.scrollLeft&&(I.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(I.rr_scrollTop=t.scrollTop),E){var W=t.getBoundingClientRect(),j=W.width,P=W.height;I={class:I.class,rr_width:j+"px",rr_height:P+"px"}}return"iframe"!==D||w(I.src)||(t.contentDocument||(I.rr_src=I.src),delete I.src),{type:e.NodeType.Element,tagName:D,attributes:I,childNodes:[],isSVG:(u=t,"svg"===u.tagName||u instanceof SVGElement||void 0),needBlock:E,rootId:o};case t.TEXT_NODE:var G=t.parentNode&&t.parentNode.tagName,H=t.textContent,z="STYLE"===G||void 0,B="SCRIPT"===G||void 0;if(z&&H){try{(null===(n=t.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(H=(c=t.parentNode.sheet).cssRules?Array.from(c.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){}H=p(H,v())}return B&&(H="SCRIPT_PLACEHOLDER"),!z&&!B&&g(t,m,h)&&H&&(H=N?N(H):H.replace(/[\S]/g,"*")),{type:e.NodeType.Text,textContent:H||"",isStyle:z,rootId:o};case t.CDATA_SECTION_NODE:return{type:e.NodeType.CDATA,textContent:"",rootId:o};case t.COMMENT_NODE:return{type:e.NodeType.Comment,textContent:t.textContent||"",rootId:o};default:return!1}}function b(e){return void 0===e?"":e.toLowerCase()}function k(t,a){var i,s=a.doc,c=a.map,u=a.blockClass,l=a.blockSelector,f=a.maskTextClass,p=a.maskTextSelector,d=a.skipChild,m=void 0!==d&&d,h=a.inlineStylesheet,v=void 0===h||h,y=a.maskInputOptions,g=void 0===y?{}:y,N=a.maskTextFn,C=a.maskInputFn,S=a.slimDOMOptions,w=a.recordCanvas,x=void 0!==w&&w,E=a.onSerialize,D=a.onIframeLoad,I=a.iframeLoadTimeout,_=void 0===I?5e3:I,O=a.keepIframeSrcFn,A=void 0===O?function(){return!1}:O,L=a.preserveWhiteSpace,M=void 0===L||L,F=T(t,{doc:s,blockClass:u,blockSelector:l,maskTextClass:f,maskTextSelector:p,inlineStylesheet:v,maskInputOptions:g,maskTextFn:N,maskInputFn:C,recordCanvas:x,keepIframeSrcFn:A});if(!F)return console.warn(t,"not serialized"),null;i="__sn"in t?t.__sn.id:!function(t,r){if(r.comment&&t.type===e.NodeType.Comment)return!0;if(t.type===e.NodeType.Element){if(r.script&&("script"===t.tagName||"link"===t.tagName&&"preload"===t.attributes.rel&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")))return!0;if(r.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(b(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===b(t.attributes.name)||"icon"===b(t.attributes.rel)||"apple-touch-icon"===b(t.attributes.rel)||"shortcut icon"===b(t.attributes.rel))))return!0;if("meta"===t.tagName){if(r.headMetaDescKeywords&&b(t.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(b(t.attributes.property).match(/^(og|twitter|fb):/)||b(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===b(t.attributes.name)))return!0;if(r.headMetaRobots&&("robots"===b(t.attributes.name)||"googlebot"===b(t.attributes.name)||"bingbot"===b(t.attributes.name)))return!0;if(r.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(r.headMetaAuthorship&&("author"===b(t.attributes.name)||"generator"===b(t.attributes.name)||"framework"===b(t.attributes.name)||"publisher"===b(t.attributes.name)||"progid"===b(t.attributes.name)||b(t.attributes.property).match(/^article:/)||b(t.attributes.property).match(/^product:/)))return!0;if(r.headMetaVerification&&("google-site-verification"===b(t.attributes.name)||"yandex-verification"===b(t.attributes.name)||"csrf-token"===b(t.attributes.name)||"p:domain_verify"===b(t.attributes.name)||"verify-v1"===b(t.attributes.name)||"verification"===b(t.attributes.name)||"shopify-checkout-api-token"===b(t.attributes.name)))return!0}}return!1}(F,S)&&(M||F.type!==e.NodeType.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?o++:-2;var R=Object.assign(F,{id:i});if(t.__sn=R,-2===i)return null;c[i]=t,E&&E(t);var W=!m;if(R.type===e.NodeType.Element&&(W=W&&!R.needBlock,delete R.needBlock),(R.type===e.NodeType.Document||R.type===e.NodeType.Element)&&W){S.headWhitespace&&F.type===e.NodeType.Element&&"head"===F.tagName&&(M=!1);for(var j={doc:s,map:c,blockClass:u,blockSelector:l,maskTextClass:f,maskTextSelector:p,skipChild:m,inlineStylesheet:v,maskInputOptions:g,maskTextFn:N,maskInputFn:C,slimDOMOptions:S,recordCanvas:x,preserveWhiteSpace:M,onSerialize:E,onIframeLoad:D,iframeLoadTimeout:_,keepIframeSrcFn:A},P=0,G=Array.from(t.childNodes);P<G.length;P++){(B=k(G[P],j))&&R.childNodes.push(B)}if(r(t)&&t.shadowRoot){R.isShadowHost=!0;for(var H=0,z=Array.from(t.shadowRoot.childNodes);H<z.length;H++){var B;(B=k(z[H],j))&&(B.isShadow=!0,R.childNodes.push(B))}}}return t.parentNode&&n(t.parentNode)&&(R.isShadow=!0),R.type===e.NodeType.Element&&"iframe"===R.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var a,o=!1;try{a=n.document.readyState}catch(e){return}if("complete"===a){var i="about:blank";n.location.href===i&&e.src!==i&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var s=setTimeout((function(){o||(t(),o=!0)}),r);e.addEventListener("load",(function(){clearTimeout(s),o=!0,t()}))}}}(t,(function(){var e=t.contentDocument;if(e&&D){var r=k(e,{doc:e,map:c,blockClass:u,blockSelector:l,maskTextClass:f,maskTextSelector:p,skipChild:!1,inlineStylesheet:v,maskInputOptions:g,maskTextFn:N,maskInputFn:C,slimDOMOptions:S,recordCanvas:x,preserveWhiteSpace:M,onSerialize:E,onIframeLoad:D,iframeLoadTimeout:_,keepIframeSrcFn:A});r&&D(t,r)}}),_),R}var N=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function C(e,t){void 0===t&&(t={});var r=1,n=1;function a(e){var t=e.match(/\n/g);t&&(r+=t.length);var a=e.lastIndexOf("\n");n=-1===a?n+e.length:e.length-a}function o(){var e={line:r,column:n};return function(t){return t.position=new i(e),d(),t}}var i=function(e){this.start=e,this.end={line:r,column:n},this.source=t.source};i.prototype.content=e;var s=[];function c(a){var o=new Error(t.source+":"+r+":"+n+": "+a);if(o.reason=a,o.filename=t.source,o.line=r,o.column=n,o.source=e,!t.silent)throw o;s.push(o)}function u(){return p(/^{\s*/)}function l(){return p(/^}/)}function f(){var t,r=[];for(d(),m(r);e.length&&"}"!==e.charAt(0)&&(t=D()||I());)!1!==t&&(r.push(t),m(r));return r}function p(t){var r=t.exec(e);if(r){var n=r[0];return a(n),e=e.slice(n.length),r}}function d(){p(/^\s*/)}function m(e){var t;for(void 0===e&&(e=[]);t=h();)!1!==t&&e.push(t),t=h();return e}function h(){var t=o();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var r=2;""!==e.charAt(r)&&("*"!==e.charAt(r)||"/"!==e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return c("End of comment missing");var i=e.slice(2,r-2);return n+=2,a(i),e=e.slice(r),n+=2,t({type:"comment",comment:i})}}function v(){var e=p(/^([^{]+)/);if(e)return S(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function y(){var e=o(),t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=S(t[0]);if(!p(/^:\s*/))return c("property missing ':'");var n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),a=e({type:"declaration",property:r.replace(N,""),value:n?S(n[0]).replace(N,""):""});return p(/^[;\s]*/),a}}function g(){var e,t=[];if(!u())return c("missing '{'");for(m(t);e=y();)!1!==e&&(t.push(e),m(t)),e=y();return l()?t:c("missing '}'")}function T(){for(var e,t=[],r=o();e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:g()})}var b,k=E("import"),C=E("charset"),x=E("namespace");function E(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=o(),n=p(t);if(n){var a={type:e};return a[e]=n[1].trim(),r(a)}}}function D(){if("@"===e[0])return function(){var e=o(),t=p(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=p(/^([-\w]+)\s*/)))return c("@keyframes missing name");var n,a=t[1];if(!u())return c("@keyframes missing '{'");for(var i=m();n=T();)i.push(n),i=i.concat(m());return l()?e({type:"keyframes",name:a,vendor:r,keyframes:i}):c("@keyframes missing '}'")}}()||function(){var e=o(),t=p(/^@media *([^{]+)/);if(t){var r=S(t[1]);if(!u())return c("@media missing '{'");var n=m().concat(f());return l()?e({type:"media",media:r,rules:n}):c("@media missing '}'")}}()||function(){var e=o(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:S(t[1]),media:S(t[2])})}()||function(){var e=o(),t=p(/^@supports *([^{]+)/);if(t){var r=S(t[1]);if(!u())return c("@supports missing '{'");var n=m().concat(f());return l()?e({type:"supports",supports:r,rules:n}):c("@supports missing '}'")}}()||k()||C()||x()||function(){var e=o(),t=p(/^@([-\w]+)?document *([^{]+)/);if(t){var r=S(t[1]),n=S(t[2]);if(!u())return c("@document missing '{'");var a=m().concat(f());return l()?e({type:"document",document:n,vendor:r,rules:a}):c("@document missing '}'")}}()||function(){var e=o();if(p(/^@page */)){var t=v()||[];if(!u())return c("@page missing '{'");for(var r,n=m();r=y();)n.push(r),n=n.concat(m());return l()?e({type:"page",selectors:t,declarations:n}):c("@page missing '}'")}}()||function(){var e=o();if(p(/^@host\s*/)){if(!u())return c("@host missing '{'");var t=m().concat(f());return l()?e({type:"host",rules:t}):c("@host missing '}'")}}()||function(){var e=o();if(p(/^@font-face\s*/)){if(!u())return c("@font-face missing '{'");for(var t,r=m();t=y();)r.push(t),r=r.concat(m());return l()?e({type:"font-face",declarations:r}):c("@font-face missing '}'")}}()}function I(){var e=o(),t=v();return t?(m(),e({type:"rule",selectors:t,declarations:g()})):c("selector missing")}return w((b=f(),{type:"stylesheet",stylesheet:{source:t.source,rules:b,parsingErrors:s}}))}function S(e){return e?e.replace(/^\s+|\s+$/g,""):""}function w(e,t){for(var r=e&&"string"==typeof e.type,n=r?e:t,a=0,o=Object.keys(e);a<o.length;a++){var i=e[o[a]];Array.isArray(i)?i.forEach((function(e){w(e,n)})):i&&"object"==typeof i&&w(i,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var x={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"};var E=/([^\\]):hover/,D=new RegExp(E,"g");function I(e,t){var r=null==t?void 0:t.stylesWithHoverClass.get(e);if(r)return r;var n=C(e,{silent:!0});if(!n.stylesheet)return e;var a=[];if(n.stylesheet.rules.forEach((function(e){"selectors"in e&&(e.selectors||[]).forEach((function(e){E.test(e)&&a.push(e)}))})),0===a.length)return e;var o=new RegExp(a.filter((function(e,t){return a.indexOf(e)===t})).sort((function(e,t){return t.length-e.length})).map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})).join("|"),"g"),i=e.replace(o,(function(e){var t=e.replace(D,"$1.\\:hover");return e+", "+t}));return null==t||t.stylesWithHoverClass.set(e,i),i}function _(t,r){var n=r.doc,a=r.hackCss,o=r.cache;switch(t.type){case e.NodeType.Document:return n.implementation.createDocument(null,"",null);case e.NodeType.DocumentType:return n.implementation.createDocumentType(t.name||"html",t.publicId,t.systemId);case e.NodeType.Element:var i,s=function(e){var t=x[e.tagName]?x[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(t);i=t.isSVG?n.createElementNS("http://www.w3.org/2000/svg",s):n.createElement(s);var c=function(e){if(!t.attributes.hasOwnProperty(e))return"continue";var r=t.attributes[e];if("option"===s&&"selected"===e&&!1===r)return"continue";if(r="boolean"==typeof r||"number"==typeof r?"":r,e.startsWith("rr_")){if("canvas"===s&&"rr_dataURL"===e){var c=document.createElement("img");c.src=r,c.onload=function(){var e=i.getContext("2d");e&&e.drawImage(c,0,0,c.width,c.height)}}if("rr_width"===e&&(i.style.width=r),"rr_height"===e&&(i.style.height=r),"rr_mediaCurrentTime"===e&&(i.currentTime=t.attributes.rr_mediaCurrentTime),"rr_mediaState"===e)switch(r){case"played":i.play().catch((function(e){return console.warn("media playback error",e)}));break;case"paused":i.pause()}}else{var u="textarea"===s&&"value"===e,l="style"===s&&"_cssText"===e;if(l&&a&&(r=I(r,o)),u||l){for(var f=n.createTextNode(r),p=0,d=Array.from(i.childNodes);p<d.length;p++){var m=d[p];m.nodeType===i.TEXT_NODE&&i.removeChild(m)}return i.appendChild(f),"continue"}try{if(t.isSVG&&"xlink:href"===e)i.setAttributeNS("http://www.w3.org/1999/xlink",e,r);else if("onload"===e||"onclick"===e||"onmouse"===e.substring(0,7))i.setAttribute("_"+e,r);else{if("meta"===s&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"===e)return i.setAttribute("csp-content",r),"continue";"link"===s&&"preload"===t.attributes.rel&&"script"===t.attributes.as||"link"===s&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")||i.setAttribute(e,r)}}catch(e){}}};for(var u in t.attributes)c(u);if(t.isShadowHost)if(i.shadowRoot)for(;i.shadowRoot.firstChild;)i.shadowRoot.removeChild(i.shadowRoot.firstChild);else i.attachShadow({mode:"open"});return i;case e.NodeType.Text:return n.createTextNode(t.isStyle&&a?I(t.textContent,o):t.textContent);case e.NodeType.CDATA:return n.createCDATASection(t.textContent);case e.NodeType.Comment:return n.createComment(t.textContent);default:return null}}function O(t,n){var a=n.doc,o=n.map,i=n.skipChild,s=void 0!==i&&i,c=n.hackCss,u=void 0===c||c,l=n.afterAppend,f=n.cache,p=_(t,{doc:a,hackCss:u,cache:f});if(!p)return null;if(t.rootId&&console.assert(o[t.rootId]===a,"Target document should has the same root id."),t.type===e.NodeType.Document&&(a.close(),a.open(),"BackCompat"===t.compatMode&&t.childNodes&&t.childNodes[0].type!==e.NodeType.DocumentType&&(t.childNodes[0].type===e.NodeType.Element&&"xmlns"in t.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===t.childNodes[0].attributes.xmlns?a.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):a.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),p=a),p.__sn=t,o[t.id]=p,(t.type===e.NodeType.Document||t.type===e.NodeType.Element)&&!s)for(var d=0,m=t.childNodes;d<m.length;d++){var h=m[d],v=O(h,{doc:a,map:o,skipChild:!1,hackCss:u,afterAppend:l,cache:f});v?(h.isShadow&&r(p)&&p.shadowRoot?p.shadowRoot.appendChild(v):p.appendChild(v),l&&l(v)):console.warn("Failed to rebuild",h)}return p}return e.IGNORED_NODE=-2,e.addHoverClass=I,e.buildNodeWithSN=O,e.cleanupSnapshot=function(){o=1},e.createCache=function(){return{stylesWithHoverClass:new Map}},e.isElement=r,e.isShadowRoot=n,e.maskInputValue=a,e.needMaskingText=g,e.rebuild=function(t,r){var n=r.doc,a=r.onVisit,o=r.hackCss,i={},s=O(t,{doc:n,map:i,skipChild:!1,hackCss:void 0===o||o,afterAppend:r.afterAppend,cache:r.cache});return function(e,t){for(var r in e)e[r]&&(n=e[r],t(n));var n}(i,(function(t){a&&a(t),function(t){var r=t.__sn;if(r.type===e.NodeType.Element){var n=t;for(var a in r.attributes)if(r.attributes.hasOwnProperty(a)&&a.startsWith("rr_")){var o=r.attributes[a];"rr_scrollLeft"===a&&(n.scrollLeft=o),"rr_scrollTop"===a&&(n.scrollTop=o)}}}(t)})),[s,i]},e.serializeNodeWithId=k,e.snapshot=function(e,t){var r=t||{},n=r.blockClass,a=void 0===n?"rr-block":n,o=r.blockSelector,i=void 0===o?null:o,s=r.maskTextClass,c=void 0===s?"rr-mask":s,u=r.maskTextSelector,l=void 0===u?null:u,f=r.inlineStylesheet,p=void 0===f||f,d=r.recordCanvas,m=void 0!==d&&d,h=r.maskAllInputs,v=void 0!==h&&h,y=r.maskTextFn,g=r.maskInputFn,T=r.slimDOM,b=void 0!==T&&T,N=r.preserveWhiteSpace,C=r.onSerialize,S=r.onIframeLoad,w=r.iframeLoadTimeout,x=r.keepIframeSrcFn,E={};return[k(e,{doc:e,map:E,blockClass:a,blockSelector:i,maskTextClass:c,maskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===v?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===v?{password:!0}:v,maskTextFn:y,maskInputFn:g,slimDOMOptions:!0===b||"all"===b?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===b,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===b?{}:b,recordCanvas:m,preserveWhiteSpace:N,onSerialize:C,onIframeLoad:S,iframeLoadTimeout:w,keepIframeSrcFn:void 0===x?function(){return!1}:x}),E]},e.transformAttribute=y,e.visitSnapshot=function(t,r){!function t(n){r(n),n.type!==e.NodeType.Document&&n.type!==e.NodeType.Element||n.childNodes.forEach(t)}(t)},Object.defineProperty(e,"__esModule",{value:!0}),e}({});
//# sourceMappingURL=rrweb-snapshot.min.js.map

@@ -196,5 +196,8 @@ var NodeType;

function transformAttribute(doc, tagName, name, value) {
if (name === 'src' || ((name === 'href' || name === 'xlink:href') && value)) {
if (name === 'src' || (name === 'href' && value)) {
return absoluteToDoc(doc, value);
}
else if (name === 'xlink:href' && value && value[0] !== '#') {
return absoluteToDoc(doc, value);
}
else if (name === 'background' &&

@@ -299,4 +302,12 @@ value &&

}
function stringifyStyleSheet(sheet) {
return sheet.cssRules
? Array.from(sheet.cssRules)
.map(function (rule) { return rule.cssText || ''; })
.join('')
: '';
}
function serializeNode(n, options) {
var doc = options.doc, blockClass = options.blockClass, blockSelector = options.blockSelector, maskTextClass = options.maskTextClass, maskTextSelector = options.maskTextSelector, inlineStylesheet = options.inlineStylesheet, _a = options.maskInputOptions, maskInputOptions = _a === void 0 ? {} : _a, maskTextFn = options.maskTextFn, maskInputFn = options.maskInputFn, recordCanvas = options.recordCanvas, keepIframeSrcFn = options.keepIframeSrcFn;
var _a;
var doc = options.doc, blockClass = options.blockClass, blockSelector = options.blockSelector, maskTextClass = options.maskTextClass, maskTextSelector = options.maskTextSelector, inlineStylesheet = options.inlineStylesheet, _b = options.maskInputOptions, maskInputOptions = _b === void 0 ? {} : _b, maskTextFn = options.maskTextFn, maskInputFn = options.maskInputFn, recordCanvas = options.recordCanvas, keepIframeSrcFn = options.keepIframeSrcFn;
var rootId;

@@ -336,4 +347,4 @@ if (doc.__sn) {

var attributes = {};
for (var _i = 0, _b = Array.from(n.attributes); _i < _b.length; _i++) {
var _c = _b[_i], name_1 = _c.name, value = _c.value;
for (var _i = 0, _c = Array.from(n.attributes); _i < _c.length; _i++) {
var _d = _c[_i], name_1 = _d.name, value = _d.value;
attributes[name_1] = transformAttribute(doc, tagName, name_1, value);

@@ -407,3 +418,3 @@ }

if (needBlock) {
var _d = n.getBoundingClientRect(), width = _d.width, height = _d.height;
var _e = n.getBoundingClientRect(), width = _e.width, height = _e.height;
attributes = {

@@ -416,2 +427,5 @@ "class": attributes["class"],

if (tagName === 'iframe' && !keepIframeSrcFn(attributes.src)) {
if (!n.contentDocument) {
attributes.rr_src = attributes.src;
}
delete attributes.src;

@@ -434,2 +448,9 @@ }

if (isStyle && textContent) {
try {
if ((_a = n.parentNode.sheet) === null || _a === void 0 ? void 0 : _a.cssRules) {
textContent = stringifyStyleSheet(n.parentNode.sheet);
}
}
catch (_f) {
}
textContent = absoluteToStylesheet(textContent, getHref());

@@ -1443,3 +1464,4 @@ }

if (n.compatMode === 'BackCompat' &&
(n.childNodes && n.childNodes[0].type !== NodeType.DocumentType)) {
n.childNodes &&
n.childNodes[0].type !== NodeType.DocumentType) {
if (n.childNodes[0].type === NodeType.Element &&

@@ -1446,0 +1468,0 @@ 'xmlns' in n.childNodes[0].attributes &&

@@ -1,2 +0,2 @@

var e;function t(e){return e.nodeType===e.ELEMENT_NODE}function r(e){var t,r=null===(t=e)||void 0===t?void 0:t.host;return Boolean(r&&r.shadowRoot&&r.shadowRoot===e)}function n(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,a=e.value,i=e.maskInputFn,o=a||"";return(t[r.toLowerCase()]||t[n])&&(o=i?i(o):"*".repeat(o.length)),o}!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"}(e||(e={}));var a=1,i=RegExp("[^a-z0-9-_:]"),o=-2;function s(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(c).join(""):null}catch(e){return null}}function c(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=s(e.styleSheet)||t}catch(e){}return t}var u=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,l=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,f=/^(data:)([^,]*),(.*)/i;function m(e,t){return(e||"").replace(u,(function(e,r,n,a,i,o){var s,c=n||i||o,u=r||a||"";if(!c)return e;if(!l.test(c))return"url("+u+c+u+")";if(f.test(c))return"url("+u+c+u+")";if("/"===c[0])return"url("+u+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+c)+u+")";var m=t.split("/"),p=c.split("/");m.pop();for(var d=0,h=p;d<h.length;d++){var v=h[d];"."!==v&&(".."===v?m.pop():m.push(v))}return"url("+u+m.join("/")+u+")"}))}var p=/^[^ \t\n\r\u000c]+/,d=/^[, \t\n\r\u000c]+/;function h(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function v(){var e=document.createElement("a");return e.href="",e.href}function g(e,t,r,n){return"src"===r||("href"===r||"xlink:href"===r)&&n?h(e,n):"background"!==r||!n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r&&n?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,a=e.exec(t.substring(r));return a?(n=a[0],r+=n.length,n):""}for(var a=[];n(d),!(r>=t.length);){var i=n(p);if(","===i.slice(-1))i=h(e,i.substring(0,i.length-1)),a.push(i);else{var o="";i=h(e,i);for(var s=!1;;){var c=t.charAt(r);if(""===c){a.push((i+o).trim());break}if(s)")"===c&&(s=!1);else{if(","===c){r+=1,a.push((i+o).trim());break}"("===c&&(s=!0)}o+=c,r+=1}}}return a.join(", ")}(e,n):"style"===r&&n?m(n,v()):n:h(e,n)}function y(e,t,r){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else e.classList.forEach((function(e){if(t.test(e))return!0}));return!(!r||!e.matches(r))||y(e.parentNode,t,r)}return e.nodeType,e.TEXT_NODE,y(e.parentNode,t,r)}function k(t,r){var a,o,c=r.doc,u=r.blockClass,l=r.blockSelector,f=r.maskTextClass,p=r.maskTextSelector,d=r.inlineStylesheet,h=r.maskInputOptions,k=void 0===h?{}:h,b=r.maskTextFn,T=r.maskInputFn,C=r.recordCanvas,w=r.keepIframeSrcFn;if(c.__sn){var x=c.__sn.id;a=1===x?void 0:x}switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode,rootId:a}:{type:e.Document,childNodes:[],rootId:a};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:a};case t.ELEMENT_NODE:for(var S=function(e,t,r){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=0;n<e.classList.length;n++){var a=e.classList[n];if(t.test(a))return!0}return!!r&&e.matches(r)}(t,u,l),E=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return i.test(t)?"div":t}(t),N={},D=0,I=Array.from(t.attributes);D<I.length;D++){var _=I[D],L=_.name,O=_.value;N[L]=g(c,E,L,O)}if("link"===E&&d){var A,M=Array.from(c.styleSheets).find((function(e){return e.href===t.href}));(A=s(M))&&(delete N.rel,delete N.href,N._cssText=m(A,M.href))}if("style"===E&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(A=s(t.sheet))&&(N._cssText=m(A,v()));if("input"===E||"textarea"===E||"select"===E){O=t.value;"radio"!==N.type&&"checkbox"!==N.type&&"submit"!==N.type&&"button"!==N.type&&O?N.value=n({type:N.type,tagName:E,value:O,maskInputOptions:k,maskInputFn:T}):t.checked&&(N.checked=t.checked)}if("option"===E&&(t.selected?N.selected=!0:delete N.selected),"canvas"===E&&C&&(N.rr_dataURL=t.toDataURL()),"audio"!==E&&"video"!==E||(N.rr_mediaState=t.paused?"paused":"played",N.rr_mediaCurrentTime=t.currentTime),t.scrollLeft&&(N.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(N.rr_scrollTop=t.scrollTop),S){var F=t.getBoundingClientRect(),R=F.width,W=F.height;N={class:N.class,rr_width:R+"px",rr_height:W+"px"}}return"iframe"!==E||w(N.src)||delete N.src,{type:e.Element,tagName:E,attributes:N,childNodes:[],isSVG:(o=t,"svg"===o.tagName||o instanceof SVGElement||void 0),needBlock:S,rootId:a};case t.TEXT_NODE:var P=t.parentNode&&t.parentNode.tagName,j=t.textContent,B="STYLE"===P||void 0,G="SCRIPT"===P||void 0;return B&&j&&(j=m(j,v())),G&&(j="SCRIPT_PLACEHOLDER"),!B&&!G&&y(t,f,p)&&j&&(j=b?b(j):j.replace(/[\S]/g,"*")),{type:e.Text,textContent:j||"",isStyle:B,rootId:a};case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:a};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:a};default:return!1}}function b(e){return void 0===e?"":e.toLowerCase()}function T(n,i){var o,s=i.doc,c=i.map,u=i.blockClass,l=i.blockSelector,f=i.maskTextClass,m=i.maskTextSelector,p=i.skipChild,d=void 0!==p&&p,h=i.inlineStylesheet,v=void 0===h||h,g=i.maskInputOptions,y=void 0===g?{}:g,C=i.maskTextFn,w=i.maskInputFn,x=i.slimDOMOptions,S=i.recordCanvas,E=void 0!==S&&S,N=i.onSerialize,D=i.onIframeLoad,I=i.iframeLoadTimeout,_=void 0===I?5e3:I,L=i.keepIframeSrcFn,O=void 0===L?function(){return!1}:L,A=i.preserveWhiteSpace,M=void 0===A||A,F=k(n,{doc:s,blockClass:u,blockSelector:l,maskTextClass:f,maskTextSelector:m,inlineStylesheet:v,maskInputOptions:y,maskTextFn:C,maskInputFn:w,recordCanvas:E,keepIframeSrcFn:O});if(!F)return console.warn(n,"not serialized"),null;o="__sn"in n?n.__sn.id:!function(t,r){if(r.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(r.script&&("script"===t.tagName||"link"===t.tagName&&"preload"===t.attributes.rel&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")))return!0;if(r.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(b(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===b(t.attributes.name)||"icon"===b(t.attributes.rel)||"apple-touch-icon"===b(t.attributes.rel)||"shortcut icon"===b(t.attributes.rel))))return!0;if("meta"===t.tagName){if(r.headMetaDescKeywords&&b(t.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(b(t.attributes.property).match(/^(og|twitter|fb):/)||b(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===b(t.attributes.name)))return!0;if(r.headMetaRobots&&("robots"===b(t.attributes.name)||"googlebot"===b(t.attributes.name)||"bingbot"===b(t.attributes.name)))return!0;if(r.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(r.headMetaAuthorship&&("author"===b(t.attributes.name)||"generator"===b(t.attributes.name)||"framework"===b(t.attributes.name)||"publisher"===b(t.attributes.name)||"progid"===b(t.attributes.name)||b(t.attributes.property).match(/^article:/)||b(t.attributes.property).match(/^product:/)))return!0;if(r.headMetaVerification&&("google-site-verification"===b(t.attributes.name)||"yandex-verification"===b(t.attributes.name)||"csrf-token"===b(t.attributes.name)||"p:domain_verify"===b(t.attributes.name)||"verify-v1"===b(t.attributes.name)||"verification"===b(t.attributes.name)||"shopify-checkout-api-token"===b(t.attributes.name)))return!0}}return!1}(F,x)&&(M||F.type!==e.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?a++:-2;var R=Object.assign(F,{id:o});if(n.__sn=R,-2===o)return null;c[o]=n,N&&N(n);var W=!d;if(R.type===e.Element&&(W=W&&!R.needBlock,delete R.needBlock),(R.type===e.Document||R.type===e.Element)&&W){x.headWhitespace&&F.type===e.Element&&"head"===F.tagName&&(M=!1);for(var P={doc:s,map:c,blockClass:u,blockSelector:l,maskTextClass:f,maskTextSelector:m,skipChild:d,inlineStylesheet:v,maskInputOptions:y,maskTextFn:C,maskInputFn:w,slimDOMOptions:x,recordCanvas:E,preserveWhiteSpace:M,onSerialize:N,onIframeLoad:D,iframeLoadTimeout:_,keepIframeSrcFn:O},j=0,B=Array.from(n.childNodes);j<B.length;j++){(z=T(B[j],P))&&R.childNodes.push(z)}if(t(n)&&n.shadowRoot){R.isShadowHost=!0;for(var G=0,H=Array.from(n.shadowRoot.childNodes);G<H.length;G++){var z;(z=T(H[G],P))&&(z.isShadow=!0,R.childNodes.push(z))}}}return n.parentNode&&r(n.parentNode)&&(R.isShadow=!0),R.type===e.Element&&"iframe"===R.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var a,i=!1;try{a=n.document.readyState}catch(e){return}if("complete"===a){var o="about:blank";n.location.href===o&&e.src!==o&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var s=setTimeout((function(){i||(t(),i=!0)}),r);e.addEventListener("load",(function(){clearTimeout(s),i=!0,t()}))}}}(n,(function(){var e=n.contentDocument;if(e&&D){var t=T(e,{doc:e,map:c,blockClass:u,blockSelector:l,maskTextClass:f,maskTextSelector:m,skipChild:!1,inlineStylesheet:v,maskInputOptions:y,maskTextFn:C,maskInputFn:w,slimDOMOptions:x,recordCanvas:E,preserveWhiteSpace:M,onSerialize:N,onIframeLoad:D,iframeLoadTimeout:_,keepIframeSrcFn:O});t&&D(n,t)}}),_),R}function C(e,t){var r=t||{},n=r.blockClass,a=void 0===n?"rr-block":n,i=r.blockSelector,o=void 0===i?null:i,s=r.maskTextClass,c=void 0===s?"rr-mask":s,u=r.maskTextSelector,l=void 0===u?null:u,f=r.inlineStylesheet,m=void 0===f||f,p=r.recordCanvas,d=void 0!==p&&p,h=r.maskAllInputs,v=void 0!==h&&h,g=r.maskTextFn,y=r.maskInputFn,k=r.slimDOM,b=void 0!==k&&k,C=r.preserveWhiteSpace,w=r.onSerialize,x=r.onIframeLoad,S=r.iframeLoadTimeout,E=r.keepIframeSrcFn,N={};return[T(e,{doc:e,map:N,blockClass:a,blockSelector:o,maskTextClass:c,maskTextSelector:l,skipChild:!1,inlineStylesheet:m,maskInputOptions:!0===v?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===v?{password:!0}:v,maskTextFn:g,maskInputFn:y,slimDOMOptions:!0===b||"all"===b?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===b,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===b?{}:b,recordCanvas:d,preserveWhiteSpace:C,onSerialize:w,onIframeLoad:x,iframeLoadTimeout:S,keepIframeSrcFn:void 0===E?function(){return!1}:E}),N]}function w(t,r){!function t(n){r(n),n.type!==e.Document&&n.type!==e.Element||n.childNodes.forEach(t)}(t)}function x(){a=1}var S=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function E(e,t){void 0===t&&(t={});var r=1,n=1;function a(e){var t=e.match(/\n/g);t&&(r+=t.length);var a=e.lastIndexOf("\n");n=-1===a?n+e.length:e.length-a}function i(){var e={line:r,column:n};return function(t){return t.position=new o(e),p(),t}}var o=function(e){this.start=e,this.end={line:r,column:n},this.source=t.source};o.prototype.content=e;var s=[];function c(a){var i=new Error(t.source+":"+r+":"+n+": "+a);if(i.reason=a,i.filename=t.source,i.line=r,i.column=n,i.source=e,!t.silent)throw i;s.push(i)}function u(){return m(/^{\s*/)}function l(){return m(/^}/)}function f(){var t,r=[];for(p(),d(r);e.length&&"}"!==e.charAt(0)&&(t=E()||I());)!1!==t&&(r.push(t),d(r));return r}function m(t){var r=t.exec(e);if(r){var n=r[0];return a(n),e=e.slice(n.length),r}}function p(){m(/^\s*/)}function d(e){var t;for(void 0===e&&(e=[]);t=h();)!1!==t&&e.push(t),t=h();return e}function h(){var t=i();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var r=2;""!==e.charAt(r)&&("*"!==e.charAt(r)||"/"!==e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return c("End of comment missing");var o=e.slice(2,r-2);return n+=2,a(o),e=e.slice(r),n+=2,t({type:"comment",comment:o})}}function v(){var e=m(/^([^{]+)/);if(e)return N(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function g(){var e=i(),t=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=N(t[0]);if(!m(/^:\s*/))return c("property missing ':'");var n=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),a=e({type:"declaration",property:r.replace(S,""),value:n?N(n[0]).replace(S,""):""});return m(/^[;\s]*/),a}}function y(){var e,t=[];if(!u())return c("missing '{'");for(d(t);e=g();)!1!==e&&(t.push(e),d(t)),e=g();return l()?t:c("missing '}'")}function k(){for(var e,t=[],r=i();e=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),m(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:y()})}var b,T=x("import"),C=x("charset"),w=x("namespace");function x(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=i(),n=m(t);if(n){var a={type:e};return a[e]=n[1].trim(),r(a)}}}function E(){if("@"===e[0])return function(){var e=i(),t=m(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=m(/^([-\w]+)\s*/)))return c("@keyframes missing name");var n,a=t[1];if(!u())return c("@keyframes missing '{'");for(var o=d();n=k();)o.push(n),o=o.concat(d());return l()?e({type:"keyframes",name:a,vendor:r,keyframes:o}):c("@keyframes missing '}'")}}()||function(){var e=i(),t=m(/^@media *([^{]+)/);if(t){var r=N(t[1]);if(!u())return c("@media missing '{'");var n=d().concat(f());return l()?e({type:"media",media:r,rules:n}):c("@media missing '}'")}}()||function(){var e=i(),t=m(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:N(t[1]),media:N(t[2])})}()||function(){var e=i(),t=m(/^@supports *([^{]+)/);if(t){var r=N(t[1]);if(!u())return c("@supports missing '{'");var n=d().concat(f());return l()?e({type:"supports",supports:r,rules:n}):c("@supports missing '}'")}}()||T()||C()||w()||function(){var e=i(),t=m(/^@([-\w]+)?document *([^{]+)/);if(t){var r=N(t[1]),n=N(t[2]);if(!u())return c("@document missing '{'");var a=d().concat(f());return l()?e({type:"document",document:n,vendor:r,rules:a}):c("@document missing '}'")}}()||function(){var e=i();if(m(/^@page */)){var t=v()||[];if(!u())return c("@page missing '{'");for(var r,n=d();r=g();)n.push(r),n=n.concat(d());return l()?e({type:"page",selectors:t,declarations:n}):c("@page missing '}'")}}()||function(){var e=i();if(m(/^@host\s*/)){if(!u())return c("@host missing '{'");var t=d().concat(f());return l()?e({type:"host",rules:t}):c("@host missing '}'")}}()||function(){var e=i();if(m(/^@font-face\s*/)){if(!u())return c("@font-face missing '{'");for(var t,r=d();t=g();)r.push(t),r=r.concat(d());return l()?e({type:"font-face",declarations:r}):c("@font-face missing '}'")}}()}function I(){var e=i(),t=v();return t?(d(),e({type:"rule",selectors:t,declarations:y()})):c("selector missing")}return D((b=f(),{type:"stylesheet",stylesheet:{source:t.source,rules:b,parsingErrors:s}}))}function N(e){return e?e.replace(/^\s+|\s+$/g,""):""}function D(e,t){for(var r=e&&"string"==typeof e.type,n=r?e:t,a=0,i=Object.keys(e);a<i.length;a++){var o=e[i[a]];Array.isArray(o)?o.forEach((function(e){D(e,n)})):o&&"object"==typeof o&&D(o,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var I={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"};var _=/([^\\]):hover/,L=new RegExp(_,"g");function O(e,t){var r=null==t?void 0:t.stylesWithHoverClass.get(e);if(r)return r;var n=E(e,{silent:!0});if(!n.stylesheet)return e;var a=[];if(n.stylesheet.rules.forEach((function(e){"selectors"in e&&(e.selectors||[]).forEach((function(e){_.test(e)&&a.push(e)}))})),0===a.length)return e;var i=new RegExp(a.filter((function(e,t){return a.indexOf(e)===t})).sort((function(e,t){return t.length-e.length})).map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})).join("|"),"g"),o=e.replace(i,(function(e){var t=e.replace(L,"$1.\\:hover");return e+", "+t}));return null==t||t.stylesWithHoverClass.set(e,o),o}function A(){return{stylesWithHoverClass:new Map}}function M(t,r){var n=r.doc,a=r.hackCss,i=r.cache;switch(t.type){case e.Document:return n.implementation.createDocument(null,"",null);case e.DocumentType:return n.implementation.createDocumentType(t.name||"html",t.publicId,t.systemId);case e.Element:var o,s=function(e){var t=I[e.tagName]?I[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(t);o=t.isSVG?n.createElementNS("http://www.w3.org/2000/svg",s):n.createElement(s);var c=function(e){if(!t.attributes.hasOwnProperty(e))return"continue";var r=t.attributes[e];if("option"===s&&"selected"===e&&!1===r)return"continue";if(r="boolean"==typeof r||"number"==typeof r?"":r,e.startsWith("rr_")){if("canvas"===s&&"rr_dataURL"===e){var c=document.createElement("img");c.src=r,c.onload=function(){var e=o.getContext("2d");e&&e.drawImage(c,0,0,c.width,c.height)}}if("rr_width"===e&&(o.style.width=r),"rr_height"===e&&(o.style.height=r),"rr_mediaCurrentTime"===e&&(o.currentTime=t.attributes.rr_mediaCurrentTime),"rr_mediaState"===e)switch(r){case"played":o.play().catch((function(e){return console.warn("media playback error",e)}));break;case"paused":o.pause()}}else{var u="textarea"===s&&"value"===e,l="style"===s&&"_cssText"===e;if(l&&a&&(r=O(r,i)),u||l){for(var f=n.createTextNode(r),m=0,p=Array.from(o.childNodes);m<p.length;m++){var d=p[m];d.nodeType===o.TEXT_NODE&&o.removeChild(d)}return o.appendChild(f),"continue"}try{if(t.isSVG&&"xlink:href"===e)o.setAttributeNS("http://www.w3.org/1999/xlink",e,r);else if("onload"===e||"onclick"===e||"onmouse"===e.substring(0,7))o.setAttribute("_"+e,r);else{if("meta"===s&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"===e)return o.setAttribute("csp-content",r),"continue";"link"===s&&"preload"===t.attributes.rel&&"script"===t.attributes.as||"link"===s&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")||o.setAttribute(e,r)}}catch(e){}}};for(var u in t.attributes)c(u);if(t.isShadowHost)if(o.shadowRoot)for(;o.shadowRoot.firstChild;)o.shadowRoot.removeChild(o.shadowRoot.firstChild);else o.attachShadow({mode:"open"});return o;case e.Text:return n.createTextNode(t.isStyle&&a?O(t.textContent,i):t.textContent);case e.CDATA:return n.createCDATASection(t.textContent);case e.Comment:return n.createComment(t.textContent);default:return null}}function F(r,n){var a=n.doc,i=n.map,o=n.skipChild,s=void 0!==o&&o,c=n.hackCss,u=void 0===c||c,l=n.afterAppend,f=n.cache,m=M(r,{doc:a,hackCss:u,cache:f});if(!m)return null;if(r.rootId&&console.assert(i[r.rootId]===a,"Target document should has the same root id."),r.type===e.Document&&(a.close(),a.open(),"BackCompat"===r.compatMode&&r.childNodes&&r.childNodes[0].type!==e.DocumentType&&(r.childNodes[0].type===e.Element&&"xmlns"in r.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===r.childNodes[0].attributes.xmlns?a.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):a.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),m=a),m.__sn=r,i[r.id]=m,(r.type===e.Document||r.type===e.Element)&&!s)for(var p=0,d=r.childNodes;p<d.length;p++){var h=d[p],v=F(h,{doc:a,map:i,skipChild:!1,hackCss:u,afterAppend:l,cache:f});v?(h.isShadow&&t(m)&&m.shadowRoot?m.shadowRoot.appendChild(v):m.appendChild(v),l&&l(v)):console.warn("Failed to rebuild",h)}return m}function R(t,r){var n=r.doc,a=r.onVisit,i=r.hackCss,o={},s=F(t,{doc:n,map:o,skipChild:!1,hackCss:void 0===i||i,afterAppend:r.afterAppend,cache:r.cache});return function(e,t){for(var r in e)e[r]&&(n=e[r],t(n));var n}(o,(function(t){a&&a(t),function(t){var r=t.__sn;if(r.type===e.Element){var n=t;for(var a in r.attributes)if(r.attributes.hasOwnProperty(a)&&a.startsWith("rr_")){var i=r.attributes[a];"rr_scrollLeft"===a&&(n.scrollLeft=i),"rr_scrollTop"===a&&(n.scrollTop=i)}}}(t)})),[s,o]}export{o as IGNORED_NODE,e as NodeType,O as addHoverClass,F as buildNodeWithSN,x as cleanupSnapshot,A as createCache,t as isElement,r as isShadowRoot,n as maskInputValue,y as needMaskingText,R as rebuild,T as serializeNodeWithId,C as snapshot,g as transformAttribute,w as visitSnapshot};
var e;function t(e){return e.nodeType===e.ELEMENT_NODE}function r(e){var t,r=null===(t=e)||void 0===t?void 0:t.host;return Boolean(r&&r.shadowRoot&&r.shadowRoot===e)}function n(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,a=e.value,i=e.maskInputFn,o=a||"";return(t[r.toLowerCase()]||t[n])&&(o=i?i(o):"*".repeat(o.length)),o}!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"}(e||(e={}));var a=1,i=RegExp("[^a-z0-9-_:]"),o=-2;function s(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(c).join(""):null}catch(e){return null}}function c(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=s(e.styleSheet)||t}catch(e){}return t}var u=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,l=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,f=/^(data:)([^,]*),(.*)/i;function m(e,t){return(e||"").replace(u,(function(e,r,n,a,i,o){var s,c=n||i||o,u=r||a||"";if(!c)return e;if(!l.test(c))return"url("+u+c+u+")";if(f.test(c))return"url("+u+c+u+")";if("/"===c[0])return"url("+u+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+c)+u+")";var m=t.split("/"),p=c.split("/");m.pop();for(var d=0,h=p;d<h.length;d++){var v=h[d];"."!==v&&(".."===v?m.pop():m.push(v))}return"url("+u+m.join("/")+u+")"}))}var p=/^[^ \t\n\r\u000c]+/,d=/^[, \t\n\r\u000c]+/;function h(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function v(){var e=document.createElement("a");return e.href="",e.href}function g(e,t,r,n){return"src"===r||"href"===r&&n||"xlink:href"===r&&n&&"#"!==n[0]?h(e,n):"background"!==r||!n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r&&n?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,a=e.exec(t.substring(r));return a?(n=a[0],r+=n.length,n):""}for(var a=[];n(d),!(r>=t.length);){var i=n(p);if(","===i.slice(-1))i=h(e,i.substring(0,i.length-1)),a.push(i);else{var o="";i=h(e,i);for(var s=!1;;){var c=t.charAt(r);if(""===c){a.push((i+o).trim());break}if(s)")"===c&&(s=!1);else{if(","===c){r+=1,a.push((i+o).trim());break}"("===c&&(s=!0)}o+=c,r+=1}}}return a.join(", ")}(e,n):"style"===r&&n?m(n,v()):n:h(e,n)}function y(e,t,r){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else e.classList.forEach((function(e){if(t.test(e))return!0}));return!(!r||!e.matches(r))||y(e.parentNode,t,r)}return e.nodeType,e.TEXT_NODE,y(e.parentNode,t,r)}function k(t,r){var a,o,c,u,l=r.doc,f=r.blockClass,p=r.blockSelector,d=r.maskTextClass,h=r.maskTextSelector,k=r.inlineStylesheet,b=r.maskInputOptions,T=void 0===b?{}:b,C=r.maskTextFn,x=r.maskInputFn,w=r.recordCanvas,S=r.keepIframeSrcFn;if(l.__sn){var E=l.__sn.id;o=1===E?void 0:E}switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode,rootId:o}:{type:e.Document,childNodes:[],rootId:o};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:o};case t.ELEMENT_NODE:for(var N=function(e,t,r){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=0;n<e.classList.length;n++){var a=e.classList[n];if(t.test(a))return!0}return!!r&&e.matches(r)}(t,f,p),D=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return i.test(t)?"div":t}(t),I={},_=0,L=Array.from(t.attributes);_<L.length;_++){var O=L[_],A=O.name,M=O.value;I[A]=g(l,D,A,M)}if("link"===D&&k){var F,R=Array.from(l.styleSheets).find((function(e){return e.href===t.href}));(F=s(R))&&(delete I.rel,delete I.href,I._cssText=m(F,R.href))}if("style"===D&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(F=s(t.sheet))&&(I._cssText=m(F,v()));if("input"===D||"textarea"===D||"select"===D){M=t.value;"radio"!==I.type&&"checkbox"!==I.type&&"submit"!==I.type&&"button"!==I.type&&M?I.value=n({type:I.type,tagName:D,value:M,maskInputOptions:T,maskInputFn:x}):t.checked&&(I.checked=t.checked)}if("option"===D&&(t.selected?I.selected=!0:delete I.selected),"canvas"===D&&w&&(I.rr_dataURL=t.toDataURL()),"audio"!==D&&"video"!==D||(I.rr_mediaState=t.paused?"paused":"played",I.rr_mediaCurrentTime=t.currentTime),t.scrollLeft&&(I.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(I.rr_scrollTop=t.scrollTop),N){var W=t.getBoundingClientRect(),j=W.width,P=W.height;I={class:I.class,rr_width:j+"px",rr_height:P+"px"}}return"iframe"!==D||S(I.src)||(t.contentDocument||(I.rr_src=I.src),delete I.src),{type:e.Element,tagName:D,attributes:I,childNodes:[],isSVG:(u=t,"svg"===u.tagName||u instanceof SVGElement||void 0),needBlock:N,rootId:o};case t.TEXT_NODE:var B=t.parentNode&&t.parentNode.tagName,G=t.textContent,H="STYLE"===B||void 0,z="SCRIPT"===B||void 0;if(H&&G){try{(null===(a=t.parentNode.sheet)||void 0===a?void 0:a.cssRules)&&(G=(c=t.parentNode.sheet).cssRules?Array.from(c.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){}G=m(G,v())}return z&&(G="SCRIPT_PLACEHOLDER"),!H&&!z&&y(t,d,h)&&G&&(G=C?C(G):G.replace(/[\S]/g,"*")),{type:e.Text,textContent:G||"",isStyle:H,rootId:o};case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:o};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:o};default:return!1}}function b(e){return void 0===e?"":e.toLowerCase()}function T(n,i){var o,s=i.doc,c=i.map,u=i.blockClass,l=i.blockSelector,f=i.maskTextClass,m=i.maskTextSelector,p=i.skipChild,d=void 0!==p&&p,h=i.inlineStylesheet,v=void 0===h||h,g=i.maskInputOptions,y=void 0===g?{}:g,C=i.maskTextFn,x=i.maskInputFn,w=i.slimDOMOptions,S=i.recordCanvas,E=void 0!==S&&S,N=i.onSerialize,D=i.onIframeLoad,I=i.iframeLoadTimeout,_=void 0===I?5e3:I,L=i.keepIframeSrcFn,O=void 0===L?function(){return!1}:L,A=i.preserveWhiteSpace,M=void 0===A||A,F=k(n,{doc:s,blockClass:u,blockSelector:l,maskTextClass:f,maskTextSelector:m,inlineStylesheet:v,maskInputOptions:y,maskTextFn:C,maskInputFn:x,recordCanvas:E,keepIframeSrcFn:O});if(!F)return console.warn(n,"not serialized"),null;o="__sn"in n?n.__sn.id:!function(t,r){if(r.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(r.script&&("script"===t.tagName||"link"===t.tagName&&"preload"===t.attributes.rel&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")))return!0;if(r.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(b(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===b(t.attributes.name)||"icon"===b(t.attributes.rel)||"apple-touch-icon"===b(t.attributes.rel)||"shortcut icon"===b(t.attributes.rel))))return!0;if("meta"===t.tagName){if(r.headMetaDescKeywords&&b(t.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(b(t.attributes.property).match(/^(og|twitter|fb):/)||b(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===b(t.attributes.name)))return!0;if(r.headMetaRobots&&("robots"===b(t.attributes.name)||"googlebot"===b(t.attributes.name)||"bingbot"===b(t.attributes.name)))return!0;if(r.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(r.headMetaAuthorship&&("author"===b(t.attributes.name)||"generator"===b(t.attributes.name)||"framework"===b(t.attributes.name)||"publisher"===b(t.attributes.name)||"progid"===b(t.attributes.name)||b(t.attributes.property).match(/^article:/)||b(t.attributes.property).match(/^product:/)))return!0;if(r.headMetaVerification&&("google-site-verification"===b(t.attributes.name)||"yandex-verification"===b(t.attributes.name)||"csrf-token"===b(t.attributes.name)||"p:domain_verify"===b(t.attributes.name)||"verify-v1"===b(t.attributes.name)||"verification"===b(t.attributes.name)||"shopify-checkout-api-token"===b(t.attributes.name)))return!0}}return!1}(F,w)&&(M||F.type!==e.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?a++:-2;var R=Object.assign(F,{id:o});if(n.__sn=R,-2===o)return null;c[o]=n,N&&N(n);var W=!d;if(R.type===e.Element&&(W=W&&!R.needBlock,delete R.needBlock),(R.type===e.Document||R.type===e.Element)&&W){w.headWhitespace&&F.type===e.Element&&"head"===F.tagName&&(M=!1);for(var j={doc:s,map:c,blockClass:u,blockSelector:l,maskTextClass:f,maskTextSelector:m,skipChild:d,inlineStylesheet:v,maskInputOptions:y,maskTextFn:C,maskInputFn:x,slimDOMOptions:w,recordCanvas:E,preserveWhiteSpace:M,onSerialize:N,onIframeLoad:D,iframeLoadTimeout:_,keepIframeSrcFn:O},P=0,B=Array.from(n.childNodes);P<B.length;P++){(z=T(B[P],j))&&R.childNodes.push(z)}if(t(n)&&n.shadowRoot){R.isShadowHost=!0;for(var G=0,H=Array.from(n.shadowRoot.childNodes);G<H.length;G++){var z;(z=T(H[G],j))&&(z.isShadow=!0,R.childNodes.push(z))}}}return n.parentNode&&r(n.parentNode)&&(R.isShadow=!0),R.type===e.Element&&"iframe"===R.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var a,i=!1;try{a=n.document.readyState}catch(e){return}if("complete"===a){var o="about:blank";n.location.href===o&&e.src!==o&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var s=setTimeout((function(){i||(t(),i=!0)}),r);e.addEventListener("load",(function(){clearTimeout(s),i=!0,t()}))}}}(n,(function(){var e=n.contentDocument;if(e&&D){var t=T(e,{doc:e,map:c,blockClass:u,blockSelector:l,maskTextClass:f,maskTextSelector:m,skipChild:!1,inlineStylesheet:v,maskInputOptions:y,maskTextFn:C,maskInputFn:x,slimDOMOptions:w,recordCanvas:E,preserveWhiteSpace:M,onSerialize:N,onIframeLoad:D,iframeLoadTimeout:_,keepIframeSrcFn:O});t&&D(n,t)}}),_),R}function C(e,t){var r=t||{},n=r.blockClass,a=void 0===n?"rr-block":n,i=r.blockSelector,o=void 0===i?null:i,s=r.maskTextClass,c=void 0===s?"rr-mask":s,u=r.maskTextSelector,l=void 0===u?null:u,f=r.inlineStylesheet,m=void 0===f||f,p=r.recordCanvas,d=void 0!==p&&p,h=r.maskAllInputs,v=void 0!==h&&h,g=r.maskTextFn,y=r.maskInputFn,k=r.slimDOM,b=void 0!==k&&k,C=r.preserveWhiteSpace,x=r.onSerialize,w=r.onIframeLoad,S=r.iframeLoadTimeout,E=r.keepIframeSrcFn,N={};return[T(e,{doc:e,map:N,blockClass:a,blockSelector:o,maskTextClass:c,maskTextSelector:l,skipChild:!1,inlineStylesheet:m,maskInputOptions:!0===v?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===v?{password:!0}:v,maskTextFn:g,maskInputFn:y,slimDOMOptions:!0===b||"all"===b?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===b,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===b?{}:b,recordCanvas:d,preserveWhiteSpace:C,onSerialize:x,onIframeLoad:w,iframeLoadTimeout:S,keepIframeSrcFn:void 0===E?function(){return!1}:E}),N]}function x(t,r){!function t(n){r(n),n.type!==e.Document&&n.type!==e.Element||n.childNodes.forEach(t)}(t)}function w(){a=1}var S=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function E(e,t){void 0===t&&(t={});var r=1,n=1;function a(e){var t=e.match(/\n/g);t&&(r+=t.length);var a=e.lastIndexOf("\n");n=-1===a?n+e.length:e.length-a}function i(){var e={line:r,column:n};return function(t){return t.position=new o(e),p(),t}}var o=function(e){this.start=e,this.end={line:r,column:n},this.source=t.source};o.prototype.content=e;var s=[];function c(a){var i=new Error(t.source+":"+r+":"+n+": "+a);if(i.reason=a,i.filename=t.source,i.line=r,i.column=n,i.source=e,!t.silent)throw i;s.push(i)}function u(){return m(/^{\s*/)}function l(){return m(/^}/)}function f(){var t,r=[];for(p(),d(r);e.length&&"}"!==e.charAt(0)&&(t=E()||I());)!1!==t&&(r.push(t),d(r));return r}function m(t){var r=t.exec(e);if(r){var n=r[0];return a(n),e=e.slice(n.length),r}}function p(){m(/^\s*/)}function d(e){var t;for(void 0===e&&(e=[]);t=h();)!1!==t&&e.push(t),t=h();return e}function h(){var t=i();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var r=2;""!==e.charAt(r)&&("*"!==e.charAt(r)||"/"!==e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return c("End of comment missing");var o=e.slice(2,r-2);return n+=2,a(o),e=e.slice(r),n+=2,t({type:"comment",comment:o})}}function v(){var e=m(/^([^{]+)/);if(e)return N(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function g(){var e=i(),t=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=N(t[0]);if(!m(/^:\s*/))return c("property missing ':'");var n=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),a=e({type:"declaration",property:r.replace(S,""),value:n?N(n[0]).replace(S,""):""});return m(/^[;\s]*/),a}}function y(){var e,t=[];if(!u())return c("missing '{'");for(d(t);e=g();)!1!==e&&(t.push(e),d(t)),e=g();return l()?t:c("missing '}'")}function k(){for(var e,t=[],r=i();e=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),m(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:y()})}var b,T=w("import"),C=w("charset"),x=w("namespace");function w(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=i(),n=m(t);if(n){var a={type:e};return a[e]=n[1].trim(),r(a)}}}function E(){if("@"===e[0])return function(){var e=i(),t=m(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=m(/^([-\w]+)\s*/)))return c("@keyframes missing name");var n,a=t[1];if(!u())return c("@keyframes missing '{'");for(var o=d();n=k();)o.push(n),o=o.concat(d());return l()?e({type:"keyframes",name:a,vendor:r,keyframes:o}):c("@keyframes missing '}'")}}()||function(){var e=i(),t=m(/^@media *([^{]+)/);if(t){var r=N(t[1]);if(!u())return c("@media missing '{'");var n=d().concat(f());return l()?e({type:"media",media:r,rules:n}):c("@media missing '}'")}}()||function(){var e=i(),t=m(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:N(t[1]),media:N(t[2])})}()||function(){var e=i(),t=m(/^@supports *([^{]+)/);if(t){var r=N(t[1]);if(!u())return c("@supports missing '{'");var n=d().concat(f());return l()?e({type:"supports",supports:r,rules:n}):c("@supports missing '}'")}}()||T()||C()||x()||function(){var e=i(),t=m(/^@([-\w]+)?document *([^{]+)/);if(t){var r=N(t[1]),n=N(t[2]);if(!u())return c("@document missing '{'");var a=d().concat(f());return l()?e({type:"document",document:n,vendor:r,rules:a}):c("@document missing '}'")}}()||function(){var e=i();if(m(/^@page */)){var t=v()||[];if(!u())return c("@page missing '{'");for(var r,n=d();r=g();)n.push(r),n=n.concat(d());return l()?e({type:"page",selectors:t,declarations:n}):c("@page missing '}'")}}()||function(){var e=i();if(m(/^@host\s*/)){if(!u())return c("@host missing '{'");var t=d().concat(f());return l()?e({type:"host",rules:t}):c("@host missing '}'")}}()||function(){var e=i();if(m(/^@font-face\s*/)){if(!u())return c("@font-face missing '{'");for(var t,r=d();t=g();)r.push(t),r=r.concat(d());return l()?e({type:"font-face",declarations:r}):c("@font-face missing '}'")}}()}function I(){var e=i(),t=v();return t?(d(),e({type:"rule",selectors:t,declarations:y()})):c("selector missing")}return D((b=f(),{type:"stylesheet",stylesheet:{source:t.source,rules:b,parsingErrors:s}}))}function N(e){return e?e.replace(/^\s+|\s+$/g,""):""}function D(e,t){for(var r=e&&"string"==typeof e.type,n=r?e:t,a=0,i=Object.keys(e);a<i.length;a++){var o=e[i[a]];Array.isArray(o)?o.forEach((function(e){D(e,n)})):o&&"object"==typeof o&&D(o,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var I={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"};var _=/([^\\]):hover/,L=new RegExp(_,"g");function O(e,t){var r=null==t?void 0:t.stylesWithHoverClass.get(e);if(r)return r;var n=E(e,{silent:!0});if(!n.stylesheet)return e;var a=[];if(n.stylesheet.rules.forEach((function(e){"selectors"in e&&(e.selectors||[]).forEach((function(e){_.test(e)&&a.push(e)}))})),0===a.length)return e;var i=new RegExp(a.filter((function(e,t){return a.indexOf(e)===t})).sort((function(e,t){return t.length-e.length})).map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})).join("|"),"g"),o=e.replace(i,(function(e){var t=e.replace(L,"$1.\\:hover");return e+", "+t}));return null==t||t.stylesWithHoverClass.set(e,o),o}function A(){return{stylesWithHoverClass:new Map}}function M(t,r){var n=r.doc,a=r.hackCss,i=r.cache;switch(t.type){case e.Document:return n.implementation.createDocument(null,"",null);case e.DocumentType:return n.implementation.createDocumentType(t.name||"html",t.publicId,t.systemId);case e.Element:var o,s=function(e){var t=I[e.tagName]?I[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(t);o=t.isSVG?n.createElementNS("http://www.w3.org/2000/svg",s):n.createElement(s);var c=function(e){if(!t.attributes.hasOwnProperty(e))return"continue";var r=t.attributes[e];if("option"===s&&"selected"===e&&!1===r)return"continue";if(r="boolean"==typeof r||"number"==typeof r?"":r,e.startsWith("rr_")){if("canvas"===s&&"rr_dataURL"===e){var c=document.createElement("img");c.src=r,c.onload=function(){var e=o.getContext("2d");e&&e.drawImage(c,0,0,c.width,c.height)}}if("rr_width"===e&&(o.style.width=r),"rr_height"===e&&(o.style.height=r),"rr_mediaCurrentTime"===e&&(o.currentTime=t.attributes.rr_mediaCurrentTime),"rr_mediaState"===e)switch(r){case"played":o.play().catch((function(e){return console.warn("media playback error",e)}));break;case"paused":o.pause()}}else{var u="textarea"===s&&"value"===e,l="style"===s&&"_cssText"===e;if(l&&a&&(r=O(r,i)),u||l){for(var f=n.createTextNode(r),m=0,p=Array.from(o.childNodes);m<p.length;m++){var d=p[m];d.nodeType===o.TEXT_NODE&&o.removeChild(d)}return o.appendChild(f),"continue"}try{if(t.isSVG&&"xlink:href"===e)o.setAttributeNS("http://www.w3.org/1999/xlink",e,r);else if("onload"===e||"onclick"===e||"onmouse"===e.substring(0,7))o.setAttribute("_"+e,r);else{if("meta"===s&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"===e)return o.setAttribute("csp-content",r),"continue";"link"===s&&"preload"===t.attributes.rel&&"script"===t.attributes.as||"link"===s&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")||o.setAttribute(e,r)}}catch(e){}}};for(var u in t.attributes)c(u);if(t.isShadowHost)if(o.shadowRoot)for(;o.shadowRoot.firstChild;)o.shadowRoot.removeChild(o.shadowRoot.firstChild);else o.attachShadow({mode:"open"});return o;case e.Text:return n.createTextNode(t.isStyle&&a?O(t.textContent,i):t.textContent);case e.CDATA:return n.createCDATASection(t.textContent);case e.Comment:return n.createComment(t.textContent);default:return null}}function F(r,n){var a=n.doc,i=n.map,o=n.skipChild,s=void 0!==o&&o,c=n.hackCss,u=void 0===c||c,l=n.afterAppend,f=n.cache,m=M(r,{doc:a,hackCss:u,cache:f});if(!m)return null;if(r.rootId&&console.assert(i[r.rootId]===a,"Target document should has the same root id."),r.type===e.Document&&(a.close(),a.open(),"BackCompat"===r.compatMode&&r.childNodes&&r.childNodes[0].type!==e.DocumentType&&(r.childNodes[0].type===e.Element&&"xmlns"in r.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===r.childNodes[0].attributes.xmlns?a.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):a.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),m=a),m.__sn=r,i[r.id]=m,(r.type===e.Document||r.type===e.Element)&&!s)for(var p=0,d=r.childNodes;p<d.length;p++){var h=d[p],v=F(h,{doc:a,map:i,skipChild:!1,hackCss:u,afterAppend:l,cache:f});v?(h.isShadow&&t(m)&&m.shadowRoot?m.shadowRoot.appendChild(v):m.appendChild(v),l&&l(v)):console.warn("Failed to rebuild",h)}return m}function R(t,r){var n=r.doc,a=r.onVisit,i=r.hackCss,o={},s=F(t,{doc:n,map:o,skipChild:!1,hackCss:void 0===i||i,afterAppend:r.afterAppend,cache:r.cache});return function(e,t){for(var r in e)e[r]&&(n=e[r],t(n));var n}(o,(function(t){a&&a(t),function(t){var r=t.__sn;if(r.type===e.Element){var n=t;for(var a in r.attributes)if(r.attributes.hasOwnProperty(a)&&a.startsWith("rr_")){var i=r.attributes[a];"rr_scrollLeft"===a&&(n.scrollLeft=i),"rr_scrollTop"===a&&(n.scrollTop=i)}}}(t)})),[s,o]}export{o as IGNORED_NODE,e as NodeType,O as addHoverClass,F as buildNodeWithSN,w as cleanupSnapshot,A as createCache,t as isElement,r as isShadowRoot,n as maskInputValue,y as needMaskingText,R as rebuild,T as serializeNodeWithId,C as snapshot,g as transformAttribute,x as visitSnapshot};
//# sourceMappingURL=rrweb-snapshot.min.js.map

@@ -200,5 +200,8 @@ 'use strict';

function transformAttribute(doc, tagName, name, value) {
if (name === 'src' || ((name === 'href' || name === 'xlink:href') && value)) {
if (name === 'src' || (name === 'href' && value)) {
return absoluteToDoc(doc, value);
}
else if (name === 'xlink:href' && value && value[0] !== '#') {
return absoluteToDoc(doc, value);
}
else if (name === 'background' &&

@@ -303,4 +306,12 @@ value &&

}
function stringifyStyleSheet(sheet) {
return sheet.cssRules
? Array.from(sheet.cssRules)
.map(function (rule) { return rule.cssText || ''; })
.join('')
: '';
}
function serializeNode(n, options) {
var doc = options.doc, blockClass = options.blockClass, blockSelector = options.blockSelector, maskTextClass = options.maskTextClass, maskTextSelector = options.maskTextSelector, inlineStylesheet = options.inlineStylesheet, _a = options.maskInputOptions, maskInputOptions = _a === void 0 ? {} : _a, maskTextFn = options.maskTextFn, maskInputFn = options.maskInputFn, recordCanvas = options.recordCanvas, keepIframeSrcFn = options.keepIframeSrcFn;
var _a;
var doc = options.doc, blockClass = options.blockClass, blockSelector = options.blockSelector, maskTextClass = options.maskTextClass, maskTextSelector = options.maskTextSelector, inlineStylesheet = options.inlineStylesheet, _b = options.maskInputOptions, maskInputOptions = _b === void 0 ? {} : _b, maskTextFn = options.maskTextFn, maskInputFn = options.maskInputFn, recordCanvas = options.recordCanvas, keepIframeSrcFn = options.keepIframeSrcFn;
var rootId;

@@ -340,4 +351,4 @@ if (doc.__sn) {

var attributes = {};
for (var _i = 0, _b = Array.from(n.attributes); _i < _b.length; _i++) {
var _c = _b[_i], name_1 = _c.name, value = _c.value;
for (var _i = 0, _c = Array.from(n.attributes); _i < _c.length; _i++) {
var _d = _c[_i], name_1 = _d.name, value = _d.value;
attributes[name_1] = transformAttribute(doc, tagName, name_1, value);

@@ -411,3 +422,3 @@ }

if (needBlock) {
var _d = n.getBoundingClientRect(), width = _d.width, height = _d.height;
var _e = n.getBoundingClientRect(), width = _e.width, height = _e.height;
attributes = {

@@ -420,2 +431,5 @@ "class": attributes["class"],

if (tagName === 'iframe' && !keepIframeSrcFn(attributes.src)) {
if (!n.contentDocument) {
attributes.rr_src = attributes.src;
}
delete attributes.src;

@@ -438,2 +452,9 @@ }

if (isStyle && textContent) {
try {
if ((_a = n.parentNode.sheet) === null || _a === void 0 ? void 0 : _a.cssRules) {
textContent = stringifyStyleSheet(n.parentNode.sheet);
}
}
catch (_f) {
}
textContent = absoluteToStylesheet(textContent, getHref());

@@ -1447,3 +1468,4 @@ }

if (n.compatMode === 'BackCompat' &&
(n.childNodes && n.childNodes[0].type !== exports.NodeType.DocumentType)) {
n.childNodes &&
n.childNodes[0].type !== exports.NodeType.DocumentType) {
if (n.childNodes[0].type === exports.NodeType.Element &&

@@ -1450,0 +1472,0 @@ 'xmlns' in n.childNodes[0].attributes &&

{
"name": "rrweb-snapshot",
"version": "1.1.9",
"version": "1.1.10",
"description": "rrweb's component to take a snapshot of DOM, aka DOM serializer",

@@ -9,4 +9,6 @@ "scripts": {

"test": "jest",
"test:watch": "jest --watch",
"bundle": "rollup --config",
"bundle:es-only": "cross-env ES_ONLY=true rollup --config",
"dev": "yarn bundle:es-only --watch",
"typings": "tsc -d --declarationDir typings",

@@ -60,3 +62,3 @@ "prepublish": "npm run typings && npm run bundle"

},
"gitHead": "cabd5eb157175dbb6c9fc4e0b60e82cb246f7d3f"
"gitHead": "7223e929a3b73ae96402fac26b44d9c7bf536804"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc