@amplitude/rrweb-snapshot
Advanced tools
Comparing version 2.0.0-alpha.14 to 2.0.0-alpha.15
@@ -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=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function a(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function o(e){var t=e.cssText;if(t.split('"').length<3)return t;var r=["@import","url(".concat(JSON.stringify(e.href),")")];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer(".concat(e.layerName,")")),e.supportsText&&r.push("supports(".concat(e.supportsText,")")),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function i(e){try{var t=e.rules||e.cssRules;return t?((r=Array.from(t,s).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),r):null}catch(e){return null}var r}function s(e){var t;if(l(e))try{t=i(e.styleSheet)||o(e)}catch(e){}else if(u(e)&&e.selectorText.includes(":"))return c(e.cssText);return t||e.cssText}function c(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function l(e){return"styleSheet"in e}function u(e){return"selectorText"in e}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 d=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var r=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=r?r:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,r=this.getId(e);this.idNodeMap.delete(r),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function p(e){var t=e.element,r=e.maskInputOptions,n=e.tagName,a=e.type,o=e.value,i=e.maskInputFn,s=o||"",c=a&&f(a);return(r[n.toLowerCase()]||c&&r[c])&&(s=i?i(s,t):"*".repeat(s.length)),s}function f(e){return e.toLowerCase()}var m="__rrweb_original__";function h(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var n=0;n<e.height;n+=50){var a=t.getImageData,o=m in a?a.__rrweb_original__:a;if(new Uint32Array(o.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((function(e){return 0!==e})))return!1}return!0}function v(t,r){return!(!t||!r||t.type!==r.type)&&(t.type===e.NodeType.Document?t.compatMode===r.compatMode:t.type===e.NodeType.DocumentType?t.name===r.name&&t.publicId===r.publicId&&t.systemId===r.systemId:t.type===e.NodeType.Comment||t.type===e.NodeType.Text||t.type===e.NodeType.CDATA?t.textContent===r.textContent:t.type===e.NodeType.Element&&(t.tagName===r.tagName&&JSON.stringify(t.attributes)===JSON.stringify(r.attributes)&&t.isSVG===r.isSVG&&t.needBlock===r.needBlock))}function y(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?f(t):null}var g,T,b=1,k=new RegExp("[^a-z0-9-_:]");function N(){return b++}var S=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,C=/^(?:[a-z+]+:)?\/\//i,w=/^www\..*/i,x=/^(data:)([^,]*),(.*)/i;function E(e,t){return(e||"").replace(S,(function(e,r,n,a,o,i){var s,c=n||o||i,l=r||a||"";if(!c)return e;if(C.test(c)||w.test(c))return"url(".concat(l).concat(c).concat(l,")");if(x.test(c))return"url(".concat(l).concat(c).concat(l,")");if("/"===c[0])return"url(".concat(l).concat((s=t,(s.indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+c)).concat(l,")");var u=t.split("/"),d=c.split("/");u.pop();for(var p=0,f=d;p<f.length;p++){var m=f[p];"."!==m&&(".."===m?u.pop():u.push(m))}return"url(".concat(l).concat(u.join("/")).concat(l,")")}))}var I=/^[^ \t\n\r\u000c]+/,L=/^[, \t\n\r\u000c]+/;function M(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function O(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function D(){var e=document.createElement("a");return e.href="",e.href}function _(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?M(e,n):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?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(L),!(r>=t.length);){var o=n(I);if(","===o.slice(-1))o=M(e,o.substring(0,o.length-1)),a.push(o);else{var i="";o=M(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?E(n,D()):"object"===t&&"data"===r?M(e,n):n:M(e,n):n}function A(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function R(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&R(e.parentNode,t,r);for(var n=e.classList.length;n--;){var a=e.classList[n];if(t.test(a))return!0}return!!r&&R(e.parentNode,t,r)}function F(e,t,r){try{var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===n)return!1;if("string"==typeof t){if(n.classList.contains(t))return!0;if(n.closest(".".concat(t)))return!0}else if(R(n,t,!0))return!0;if(r){if(n.matches(r))return!0;if(n.closest(r))return!0}}catch(e){}return!1}function U(t,r){var n=r.doc,a=r.mirror,o=r.blockClass,s=r.blockSelector,c=r.maskTextClass,l=r.maskTextSelector,u=r.inlineStylesheet,d=r.maskInputOptions,m=void 0===d?{}:d,v=r.maskTextFn,b=r.maskInputFn,N=r.dataURLOptions,S=void 0===N?{}:N,C=r.inlineImages,w=r.recordCanvas,x=r.keepIframeSrcFn,I=r.newlyAddedElement,L=void 0!==I&&I,M=function(e,t){if(!t.hasNode(e))return;var r=t.getId(e);return 1===r?void 0:r}(n,a);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.NodeType.Document,childNodes:[],compatMode:t.compatMode}:{type:e.NodeType.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.NodeType.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:M};case t.ELEMENT_NODE:return function(t,r){for(var n=r.doc,a=r.blockClass,o=r.blockSelector,s=r.inlineStylesheet,c=r.maskInputOptions,l=void 0===c?{}:c,u=r.maskInputFn,d=r.dataURLOptions,m=void 0===d?{}:d,v=r.inlineImages,b=r.recordCanvas,N=r.keepIframeSrcFn,S=r.newlyAddedElement,C=void 0!==S&&S,w=r.rootId,x=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var a=e.classList[n];if(t.test(a))return!0}if(r)return e.matches(r)}catch(e){}return!1}(t,a,o),I=function(e){if(e instanceof HTMLFormElement)return"form";var t=f(e.tagName);return k.test(t)?"div":t}(t),L={},M=t.attributes.length,R=0;R<M;R++){var F=t.attributes[R];A(I,F.name,F.value)||(L[F.name]=_(n,I,f(F.name),F.value))}if("link"===I&&s){var U=Array.from(n.styleSheets).find((function(e){return e.href===t.href})),W=null;U&&(W=i(U)),W&&(delete L.rel,delete L.href,L._cssText=E(W,U.href))}if("style"===I&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){(W=i(t.sheet))&&(L._cssText=E(W,D()))}if("input"===I||"textarea"===I||"select"===I){var j=t.value,B=t.checked;if("radio"!==L.type&&"checkbox"!==L.type&&"submit"!==L.type&&"button"!==L.type&&j){var P=y(t);L.value=p({element:t,type:P,tagName:I,value:j,maskInputOptions:l,maskInputFn:u})}else B&&(L.checked=B)}"option"===I&&(t.selected&&!l.select?L.selected=!0:delete L.selected);if("canvas"===I&&b)if("2d"===t.__context)h(t)||(L.rr_dataURL=t.toDataURL(m.type,m.quality));else if(!("__context"in t)){var G=t.toDataURL(m.type,m.quality),H=document.createElement("canvas");H.width=t.width,H.height=t.height,G!==H.toDataURL(m.type,m.quality)&&(L.rr_dataURL=G)}if("img"===I&&v){g||(g=n.createElement("canvas"),T=g.getContext("2d"));var z=t,V=z.crossOrigin;z.crossOrigin="anonymous";var q=function(){z.removeEventListener("load",q);try{g.width=z.naturalWidth,g.height=z.naturalHeight,T.drawImage(z,0,0),L.rr_dataURL=g.toDataURL(m.type,m.quality)}catch(e){console.warn("Cannot inline img src=".concat(z.currentSrc,"! Error: ").concat(e))}V?L.crossOrigin=V:z.removeAttribute("crossorigin")};z.complete&&0!==z.naturalWidth?q():z.addEventListener("load",q)}"audio"!==I&&"video"!==I||(L.rr_mediaState=t.paused?"paused":"played",L.rr_mediaCurrentTime=t.currentTime);C||(t.scrollLeft&&(L.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(L.rr_scrollTop=t.scrollTop));if(x){var $=t.getBoundingClientRect(),Y=$.width,J=$.height;L={class:L.class,rr_width:"".concat(Y,"px"),rr_height:"".concat(J,"px")}}"iframe"!==I||N(L.src)||(t.contentDocument||(L.rr_src=L.src),delete L.src);return{type:e.NodeType.Element,tagName:I,attributes:L,childNodes:[],isSVG:O(t)||void 0,needBlock:x,rootId:w}}(t,{doc:n,blockClass:o,blockSelector:s,inlineStylesheet:u,maskInputOptions:m,maskInputFn:b,dataURLOptions:S,inlineImages:C,recordCanvas:w,keepIframeSrcFn:x,newlyAddedElement:L,rootId:M});case t.TEXT_NODE:return function(t,r){var n,a=r.maskTextClass,o=r.maskTextSelector,s=r.maskTextFn,c=r.rootId,l=t.parentNode&&t.parentNode.tagName,u=t.textContent,d="STYLE"===l||void 0,p="SCRIPT"===l||void 0;if(d&&u){try{t.nextSibling||t.previousSibling||(null===(n=t.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(u=i(t.parentNode.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(e),t)}u=E(u,D())}p&&(u="SCRIPT_PLACEHOLDER");!d&&!p&&u&&F(t,a,o)&&(u=s?s(u,t.parentElement):u.replace(/[\S]/g,"*"));return{type:e.NodeType.Text,textContent:u||"",isStyle:d,rootId:c}}(t,{maskTextClass:c,maskTextSelector:l,maskTextFn:v,rootId:M});case t.CDATA_SECTION_NODE:return{type:e.NodeType.CDATA,textContent:"",rootId:M};case t.COMMENT_NODE:return{type:e.NodeType.Comment,textContent:t.textContent||"",rootId:M};default:return!1}}function W(e){return null==e?"":e.toLowerCase()}function j(t,o){var i,s=o.doc,c=o.mirror,l=o.blockClass,u=o.blockSelector,d=o.maskTextClass,p=o.maskTextSelector,f=o.skipChild,m=void 0!==f&&f,h=o.inlineStylesheet,v=void 0===h||h,y=o.maskInputOptions,g=void 0===y?{}:y,T=o.maskTextFn,b=o.maskInputFn,k=o.slimDOMOptions,S=o.dataURLOptions,C=void 0===S?{}:S,w=o.inlineImages,x=void 0!==w&&w,E=o.recordCanvas,I=void 0!==E&&E,L=o.onSerialize,M=o.onIframeLoad,O=o.iframeLoadTimeout,D=void 0===O?5e3:O,_=o.onStylesheetLoad,A=o.stylesheetLoadTimeout,R=void 0===A?5e3:A,F=o.keepIframeSrcFn,B=void 0===F?function(){return!1}:F,P=o.newlyAddedElement,G=void 0!==P&&P,H=o.preserveWhiteSpace,z=void 0===H||H,V=U(t,{doc:s,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:p,inlineStylesheet:v,maskInputOptions:g,maskTextFn:T,maskInputFn:b,dataURLOptions:C,inlineImages:x,recordCanvas:I,keepIframeSrcFn:B,newlyAddedElement:G});if(!V)return console.warn(t,"not serialized"),null;i=c.hasNode(t)?c.getId(t):!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||"modulepreload"===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&&(W(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===W(t.attributes.name)||"icon"===W(t.attributes.rel)||"apple-touch-icon"===W(t.attributes.rel)||"shortcut icon"===W(t.attributes.rel))))return!0;if("meta"===t.tagName){if(r.headMetaDescKeywords&&W(t.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(W(t.attributes.property).match(/^(og|twitter|fb):/)||W(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===W(t.attributes.name)))return!0;if(r.headMetaRobots&&("robots"===W(t.attributes.name)||"googlebot"===W(t.attributes.name)||"bingbot"===W(t.attributes.name)))return!0;if(r.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(r.headMetaAuthorship&&("author"===W(t.attributes.name)||"generator"===W(t.attributes.name)||"framework"===W(t.attributes.name)||"publisher"===W(t.attributes.name)||"progid"===W(t.attributes.name)||W(t.attributes.property).match(/^article:/)||W(t.attributes.property).match(/^product:/)))return!0;if(r.headMetaVerification&&("google-site-verification"===W(t.attributes.name)||"yandex-verification"===W(t.attributes.name)||"csrf-token"===W(t.attributes.name)||"p:domain_verify"===W(t.attributes.name)||"verify-v1"===W(t.attributes.name)||"verification"===W(t.attributes.name)||"shopify-checkout-api-token"===W(t.attributes.name)))return!0}}return!1}(V,k)&&(z||V.type!==e.NodeType.Text||V.isStyle||V.textContent.replace(/^\s+|\s+$/gm,"").length)?N():-2;var q=Object.assign(V,{id:i});if(c.add(t,q),-2===i)return null;L&&L(t);var $=!m;if(q.type===e.NodeType.Element){$=$&&!q.needBlock,delete q.needBlock;var Y=t.shadowRoot;Y&&a(Y)&&(q.isShadowHost=!0)}if((q.type===e.NodeType.Document||q.type===e.NodeType.Element)&&$){k.headWhitespace&&q.type===e.NodeType.Element&&"head"===q.tagName&&(z=!1);for(var J={doc:s,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:p,skipChild:m,inlineStylesheet:v,maskInputOptions:g,maskTextFn:T,maskInputFn:b,slimDOMOptions:k,dataURLOptions:C,inlineImages:x,recordCanvas:I,preserveWhiteSpace:z,onSerialize:L,onIframeLoad:M,iframeLoadTimeout:D,onStylesheetLoad:_,stylesheetLoadTimeout:R,keepIframeSrcFn:B},X=0,K=Array.from(t.childNodes);X<K.length;X++){(ee=j(K[X],J))&&q.childNodes.push(ee)}if(r(t)&&t.shadowRoot)for(var Q=0,Z=Array.from(t.shadowRoot.childNodes);Q<Z.length;Q++){var ee;(ee=j(Z[Q],J))&&(a(t.shadowRoot)&&(ee.isShadow=!0),q.childNodes.push(ee))}}return t.parentNode&&n(t.parentNode)&&a(t.parentNode)&&(q.isShadow=!0),q.type===e.NodeType.Element&&"iframe"===q.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";if(n.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}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&&M){var r=j(e,{doc:e,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:p,skipChild:!1,inlineStylesheet:v,maskInputOptions:g,maskTextFn:T,maskInputFn:b,slimDOMOptions:k,dataURLOptions:C,inlineImages:x,recordCanvas:I,preserveWhiteSpace:z,onSerialize:L,onIframeLoad:M,iframeLoadTimeout:D,onStylesheetLoad:_,stylesheetLoadTimeout:R,keepIframeSrcFn:B});r&&M(t,r)}}),D),q.type===e.NodeType.Element&&"link"===q.tagName&&"stylesheet"===q.attributes.rel&&function(e,t,r){var n,a=!1;try{n=e.sheet}catch(e){return}if(!n){var o=setTimeout((function(){a||(t(),a=!0)}),r);e.addEventListener("load",(function(){clearTimeout(o),a=!0,t()}))}}(t,(function(){if(_){var e=j(t,{doc:s,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:p,skipChild:!1,inlineStylesheet:v,maskInputOptions:g,maskTextFn:T,maskInputFn:b,slimDOMOptions:k,dataURLOptions:C,inlineImages:x,recordCanvas:I,preserveWhiteSpace:z,onSerialize:L,onIframeLoad:M,iframeLoadTimeout:D,onStylesheetLoad:_,stylesheetLoadTimeout:R,keepIframeSrcFn:B});e&&_(t,e)}}),R),q}var B=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function P(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),f(),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("".concat(t.source||"",":").concat(r,":").concat(n,": ").concat(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 l(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){var t,r=[];for(f(),m(r);e.length&&"}"!==e.charAt(0)&&(t=w()||x());)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 f(){p(/^\s*/)}function m(e){var t;for(void 0===e&&(e=[]);t=h();)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 G(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=G(t[0]);if(!p(/^:\s*/))return c("property missing ':'");var n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),a=e({type:"declaration",property:r.replace(B,""),value:n?G(n[0]).replace(B,""):""});return p(/^[;\s]*/),a}}function g(){var e,t=[];if(!l())return c("missing '{'");for(m(t);e=y();)!1!==e&&(t.push(e),m(t)),e=y();return u()?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=C("import"),N=C("charset"),S=C("namespace");function C(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 w(){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(!l())return c("@keyframes missing '{'");for(var i=m();n=T();)i.push(n),i=i.concat(m());return u()?e({type:"keyframes",name:a,vendor:r,keyframes:i}):c("@keyframes missing '}'")}}()||function(){var e=o(),t=p(/^@media *([^{]+)/);if(t){var r=G(t[1]);if(!l())return c("@media missing '{'");var n=m().concat(d());return u()?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:G(t[1]),media:G(t[2])})}()||function(){var e=o(),t=p(/^@supports *([^{]+)/);if(t){var r=G(t[1]);if(!l())return c("@supports missing '{'");var n=m().concat(d());return u()?e({type:"supports",supports:r,rules:n}):c("@supports missing '}'")}}()||k()||N()||S()||function(){var e=o(),t=p(/^@([-\w]+)?document *([^{]+)/);if(t){var r=G(t[1]),n=G(t[2]);if(!l())return c("@document missing '{'");var a=m().concat(d());return u()?e({type:"document",document:n,vendor:r,rules:a}):c("@document missing '}'")}}()||function(){var e=o();if(p(/^@page */)){var t=v()||[];if(!l())return c("@page missing '{'");for(var r,n=m();r=y();)n.push(r),n=n.concat(m());return u()?e({type:"page",selectors:t,declarations:n}):c("@page missing '}'")}}()||function(){var e=o();if(p(/^@host\s*/)){if(!l())return c("@host missing '{'");var t=m().concat(d());return u()?e({type:"host",rules:t}):c("@host missing '}'")}}()||function(){var e=o();if(p(/^@font-face\s*/)){if(!l())return c("@font-face missing '{'");for(var t,r=m();t=y();)r.push(t),r=r.concat(m());return u()?e({type:"font-face",declarations:r}):c("@font-face missing '}'")}}()}function x(){var e=o(),t=v();return t?(m(),e({type:"rule",selectors:t,declarations:g()})):c("selector missing")}return H((b=d(),{type:"stylesheet",stylesheet:{source:t.source,rules:b,parsingErrors:s}}))}function G(e){return e?e.replace(/^\s+|\s+$/g,""):""}function H(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){H(e,n)})):i&&"object"==typeof i&&H(i,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var z={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 V=/([^\\]):hover/,q=new RegExp(V.source,"g");function $(e,t){var r=null==t?void 0:t.stylesWithHoverClass.get(e);if(r)return r;var n=P(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){V.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(q,"$1.\\:hover");return"".concat(e,", ").concat(t)}));return null==t||t.stylesWithHoverClass.set(e,i),i}function Y(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=z[e.tagName]?z[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={};for(var l in t.attributes)if(Object.prototype.hasOwnProperty.call(t.attributes,l)){var u=t.attributes[l];if(("option"!==s||"selected"!==l||!1!==u)&&null!==u)if(!0===u&&(u=""),l.startsWith("rr_"))c[l]=u;else{var d="textarea"===s&&"value"===l,p="style"===s&&"_cssText"===l;if(p&&a&&"string"==typeof u&&(u=$(u,o)),!d&&!p||"string"!=typeof u)try{if(t.isSVG&&"xlink:href"===l)i.setAttributeNS("http://www.w3.org/1999/xlink",l,u.toString());else if("onload"===l||"onclick"===l||"onmouse"===l.substring(0,7))i.setAttribute("_"+l,u.toString());else{if("meta"===s&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"===l){i.setAttribute("csp-content",u.toString());continue}("link"!==s||"preload"!==t.attributes.rel&&"modulepreload"!==t.attributes.rel||"script"!==t.attributes.as)&&("link"===s&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")||("img"===s&&t.attributes.srcset&&t.attributes.rr_dataURL?i.setAttribute("rrweb-original-srcset",t.attributes.srcset):i.setAttribute(l,u.toString())))}}catch(e){}else{for(var f=n.createTextNode(u),m=0,h=Array.from(i.childNodes);m<h.length;m++){var v=h[m];v.nodeType===i.TEXT_NODE&&i.removeChild(v)}i.appendChild(f)}}}var y=function(e){var r=c[e];if("canvas"===s&&"rr_dataURL"===e){var n=document.createElement("img");n.onload=function(){var e=i.getContext("2d");e&&e.drawImage(n,0,0,n.width,n.height)},n.src=r.toString(),i.RRNodeType&&(i.rr_dataURL=r.toString())}else if("img"===s&&"rr_dataURL"===e){var a=i;a.currentSrc.startsWith("data:")||(a.setAttribute("rrweb-original-src",t.attributes.src),a.src=r.toString())}if("rr_width"===e)i.style.width=r.toString();else if("rr_height"===e)i.style.height=r.toString();else if("rr_mediaCurrentTime"===e&&"number"==typeof r)i.currentTime=r;else if("rr_mediaState"===e)switch(r){case"played":i.play().catch((function(e){return console.warn("media playback error",e)}));break;case"paused":i.pause()}};for(var g in c)y(g);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?$(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 J(t,n){var a=n.doc,o=n.mirror,i=n.skipChild,s=void 0!==i&&i,c=n.hackCss,l=void 0===c||c,u=n.afterAppend,d=n.cache;if(o.has(t.id)){var p=o.getNode(t.id);if(v(o.getMeta(p),t))return o.getNode(t.id)}var f=Y(t,{doc:a,hackCss:l,cache:d});if(!f)return null;if(t.rootId&&o.getNode(t.rootId)!==a&&o.replace(t.rootId,a),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" "">')),f=a),o.add(f,t),(t.type===e.NodeType.Document||t.type===e.NodeType.Element)&&!s)for(var m=function(n){var i=J(n,{doc:a,mirror:o,skipChild:!1,hackCss:l,afterAppend:u,cache:d});if(!i)return console.warn("Failed to rebuild",n),"continue";if(n.isShadow&&r(f)&&f.shadowRoot)f.shadowRoot.appendChild(i);else if(t.type===e.NodeType.Document&&n.type==e.NodeType.Element){var s=i,c=null;s.childNodes.forEach((function(e){"BODY"===e.nodeName&&(c=e)})),c?(s.removeChild(c),f.appendChild(i),s.appendChild(c)):f.appendChild(i)}else f.appendChild(i);u&&u(i,n.id)},h=0,y=t.childNodes;h<y.length;h++){m(y[h])}return f}return e.IGNORED_NODE=-2,e.Mirror=d,e.addHoverClass=$,e.buildNodeWithSN=J,e.classMatchesRegex=R,e.cleanupSnapshot=function(){b=1},e.createCache=function(){return{stylesWithHoverClass:new Map}},e.createMirror=function(){return new d},e.escapeImportStatement=o,e.fixSafariColons=c,e.genId=N,e.getInputType=y,e.ignoreAttribute=A,e.is2DCanvasBlank=h,e.isCSSImportRule=l,e.isCSSStyleRule=u,e.isElement=r,e.isNativeShadowDom=a,e.isNodeMetaEqual=v,e.isShadowRoot=n,e.maskInputValue=p,e.needMaskingText=F,e.rebuild=function(t,r){var n=r.doc,a=r.onVisit,o=r.hackCss,i=void 0===o||o,s=r.afterAppend,c=r.cache,l=r.mirror,u=void 0===l?new d:l,p=J(t,{doc:n,mirror:u,skipChild:!1,hackCss:i,afterAppend:s,cache:c});return function(e,t){for(var r=0,n=e.getIds();r<n.length;r++){var a=n[r];e.has(a)&&t(e.getNode(a))}}(u,(function(t){a&&a(t),function(t,r){var n=r.getMeta(t);if((null==n?void 0:n.type)===e.NodeType.Element){var a=t;for(var o in n.attributes)if(Object.prototype.hasOwnProperty.call(n.attributes,o)&&o.startsWith("rr_")){var i=n.attributes[o];"rr_scrollLeft"===o&&(a.scrollLeft=i),"rr_scrollTop"===o&&(a.scrollTop=i)}}}(t,u)})),p},e.serializeNodeWithId=j,e.snapshot=function(e,t){var r=t||{},n=r.mirror,a=void 0===n?new d:n,o=r.blockClass,i=void 0===o?"rr-block":o,s=r.blockSelector,c=void 0===s?null:s,l=r.maskTextClass,u=void 0===l?"rr-mask":l,p=r.maskTextSelector,f=void 0===p?null:p,m=r.inlineStylesheet,h=void 0===m||m,v=r.inlineImages,y=void 0!==v&&v,g=r.recordCanvas,T=void 0!==g&&g,b=r.maskAllInputs,k=void 0!==b&&b,N=r.maskTextFn,S=r.maskInputFn,C=r.slimDOM,w=void 0!==C&&C,x=r.dataURLOptions,E=r.preserveWhiteSpace,I=r.onSerialize,L=r.onIframeLoad,M=r.iframeLoadTimeout,O=r.onStylesheetLoad,D=r.stylesheetLoadTimeout,_=r.keepIframeSrcFn;return j(e,{doc:e,mirror:a,blockClass:i,blockSelector:c,maskTextClass:u,maskTextSelector:f,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===k?{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===k?{password:!0}:k,maskTextFn:N,maskInputFn:S,slimDOMOptions:!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===w,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===w?{}:w,dataURLOptions:x,inlineImages:y,recordCanvas:T,preserveWhiteSpace:E,onSerialize:I,onIframeLoad:L,iframeLoadTimeout:M,onStylesheetLoad:O,stylesheetLoadTimeout:D,keepIframeSrcFn:void 0===_?function(){return!1}:_,newlyAddedElement:!1})},e.stringifyRule=s,e.stringifyStylesheet=i,e.toLowerCase=f,e.transformAttribute=_,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 n(e){return e.nodeType===e.ELEMENT_NODE}function r(e){const t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function o(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function s(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}function i(e){try{const n=e.rules||e.cssRules;return n?((t=Array.from(n,a).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),t):null}catch(e){return null}var t}function a(e){let t;if(l(e))try{t=i(e.styleSheet)||s(e)}catch(e){}else if(u(e)&&e.selectorText.includes(":"))return c(e.cssText);return t||e.cssText}function c(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function l(e){return"styleSheet"in e}function u(e){return"selectorText"in e}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";class d{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function p({element:e,maskInputOptions:t,tagName:n,type:r,value:o,maskInputFn:s}){let i=o||"";const a=r&&m(r);return(t[n.toLowerCase()]||a&&t[a])&&(i=s?s(i,e):"*".repeat(i.length)),i}function m(e){return e.toLowerCase()}const f="__rrweb_original__";function h(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){const o=t.getImageData,s=f in o?o.__rrweb_original__:o;if(new Uint32Array(s.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((e=>0!==e)))return!1}return!0}function y(t,n){return!(!t||!n||t.type!==n.type)&&(t.type===e.NodeType.Document?t.compatMode===n.compatMode:t.type===e.NodeType.DocumentType?t.name===n.name&&t.publicId===n.publicId&&t.systemId===n.systemId:t.type===e.NodeType.Comment||t.type===e.NodeType.Text||t.type===e.NodeType.CDATA?t.textContent===n.textContent:t.type===e.NodeType.Element&&(t.tagName===n.tagName&&JSON.stringify(t.attributes)===JSON.stringify(n.attributes)&&t.isSVG===n.isSVG&&t.needBlock===n.needBlock))}function g(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?m(t):null}let T=1;const b=new RegExp("[^a-z0-9-_:]");function k(){return T++}let N,S;const C=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,w=/^(?:[a-z+]+:)?\/\//i,x=/^www\..*/i,v=/^(data:)([^,]*),(.*)/i;function E(e,t){return(e||"").replace(C,((e,n,r,o,s,i)=>{const a=r||s||i,c=n||o||"";if(!a)return e;if(w.test(a)||x.test(a))return`url(${c}${a}${c})`;if(v.test(a))return`url(${c}${a}${c})`;if("/"===a[0])return`url(${c}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${c})`;const l=t.split("/"),u=a.split("/");l.pop();for(const e of u)"."!==e&&(".."===e?l.pop():l.push(e));return`url(${c}${l.join("/")}${c})`}))}const I=/^[^ \t\n\r\u000c]+/,L=/^[, \t\n\r\u000c]+/;function M(e,t){if(!t||""===t.trim())return t;const n=e.createElement("a");return n.href=t,n.href}function O(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function D(){const e=document.createElement("a");return e.href="",e.href}function _(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?M(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r;const o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}const o=[];for(;r(L),!(n>=t.length);){let s=r(I);if(","===s.slice(-1))s=M(e,s.substring(0,s.length-1)),o.push(s);else{let r="";s=M(e,s);let i=!1;for(;;){const e=t.charAt(n);if(""===e){o.push((s+r).trim());break}if(i)")"===e&&(i=!1);else{if(","===e){n+=1,o.push((s+r).trim());break}"("===e&&(i=!0)}r+=e,n+=1}}}return o.join(", ")}(e,r):"style"===n?E(r,D()):"object"===t&&"data"===n?M(e,r):r:M(e,r):r}function A(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function R(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&R(e.parentNode,t,n);for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!!n&&R(e.parentNode,t,n)}function F(e,t,n){try{const r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===r)return!1;if("string"==typeof t){if(r.classList.contains(t))return!0;if(r.closest(`.${t}`))return!0}else if(R(r,t,!0))return!0;if(n){if(r.matches(n))return!0;if(r.closest(n))return!0}}catch(e){}return!1}function $(t,n){const{doc:r,mirror:o,blockClass:s,blockSelector:a,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskInputOptions:d={},maskTextFn:f,maskInputFn:y,dataURLOptions:T={},inlineImages:k,recordCanvas:C,keepIframeSrcFn:w,newlyAddedElement:x=!1}=n,v=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(r,o);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.NodeType.Document,childNodes:[],compatMode:t.compatMode}:{type:e.NodeType.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.NodeType.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:v};case t.ELEMENT_NODE:return function(t,n){const{doc:r,blockClass:o,blockSelector:s,inlineStylesheet:a,maskInputOptions:c={},maskInputFn:l,dataURLOptions:u={},inlineImages:d,recordCanvas:f,keepIframeSrcFn:y,newlyAddedElement:T=!1,rootId:k}=n,C=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(e){}return!1}(t,o,s),w=function(e){if(e instanceof HTMLFormElement)return"form";const t=m(e.tagName);return b.test(t)?"div":t}(t);let x={};const v=t.attributes.length;for(let e=0;e<v;e++){const n=t.attributes[e];A(w,n.name,n.value)||(x[n.name]=_(r,w,m(n.name),n.value))}if("link"===w&&a){const e=Array.from(r.styleSheets).find((e=>e.href===t.href));let n=null;e&&(n=i(e)),n&&(delete x.rel,delete x.href,x._cssText=E(n,e.href))}if("style"===w&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){const e=i(t.sheet);e&&(x._cssText=E(e,D()))}if("input"===w||"textarea"===w||"select"===w){const e=t.value,n=t.checked;if("radio"!==x.type&&"checkbox"!==x.type&&"submit"!==x.type&&"button"!==x.type&&e){const n=g(t);x.value=p({element:t,type:n,tagName:w,value:e,maskInputOptions:c,maskInputFn:l})}else n&&(x.checked=n)}"option"===w&&(t.selected&&!c.select?x.selected=!0:delete x.selected);if("canvas"===w&&f)if("2d"===t.__context)h(t)||(x.rr_dataURL=t.toDataURL(u.type,u.quality));else if(!("__context"in t)){const e=t.toDataURL(u.type,u.quality),n=document.createElement("canvas");n.width=t.width,n.height=t.height;e!==n.toDataURL(u.type,u.quality)&&(x.rr_dataURL=e)}if("img"===w&&d){N||(N=r.createElement("canvas"),S=N.getContext("2d"));const e=t,n=e.crossOrigin;e.crossOrigin="anonymous";const o=()=>{e.removeEventListener("load",o);try{N.width=e.naturalWidth,N.height=e.naturalHeight,S.drawImage(e,0,0),x.rr_dataURL=N.toDataURL(u.type,u.quality)}catch(t){console.warn(`Cannot inline img src=${e.currentSrc}! Error: ${t}`)}n?x.crossOrigin=n:e.removeAttribute("crossorigin")};e.complete&&0!==e.naturalWidth?o():e.addEventListener("load",o)}"audio"!==w&&"video"!==w||(x.rr_mediaState=t.paused?"paused":"played",x.rr_mediaCurrentTime=t.currentTime);T||(t.scrollLeft&&(x.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(x.rr_scrollTop=t.scrollTop));if(C){const{width:e,height:n}=t.getBoundingClientRect();x={class:x.class,rr_width:`${e}px`,rr_height:`${n}px`}}"iframe"!==w||y(x.src)||(t.contentDocument||(x.rr_src=x.src),delete x.src);return{type:e.NodeType.Element,tagName:w,attributes:x,childNodes:[],isSVG:O(t)||void 0,needBlock:C,rootId:k}}(t,{doc:r,blockClass:s,blockSelector:a,inlineStylesheet:u,maskInputOptions:d,maskInputFn:y,dataURLOptions:T,inlineImages:k,recordCanvas:C,keepIframeSrcFn:w,newlyAddedElement:x,rootId:v});case t.TEXT_NODE:return function(t,n){var r;const{maskTextClass:o,maskTextSelector:s,maskTextFn:a,rootId:c}=n,l=t.parentNode&&t.parentNode.tagName;let u=t.textContent;const d="STYLE"===l||void 0,p="SCRIPT"===l||void 0;if(d&&u){try{t.nextSibling||t.previousSibling||(null===(r=t.parentNode.sheet)||void 0===r?void 0:r.cssRules)&&(u=i(t.parentNode.sheet))}catch(e){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${e}`,t)}u=E(u,D())}p&&(u="SCRIPT_PLACEHOLDER");!d&&!p&&u&&F(t,o,s)&&(u=a?a(u,t.parentElement):u.replace(/[\S]/g,"*"));return{type:e.NodeType.Text,textContent:u||"",isStyle:d,rootId:c}}(t,{maskTextClass:c,maskTextSelector:l,maskTextFn:f,rootId:v});case t.CDATA_SECTION_NODE:return{type:e.NodeType.CDATA,textContent:"",rootId:v};case t.COMMENT_NODE:return{type:e.NodeType.Comment,textContent:t.textContent||"",rootId:v};default:return!1}}function U(e){return null==e?"":e.toLowerCase()}function W(t,s){const{doc:i,mirror:a,blockClass:c,blockSelector:l,maskTextClass:u,maskTextSelector:d,skipChild:p=!1,inlineStylesheet:m=!0,maskInputOptions:f={},maskTextFn:h,maskInputFn:y,slimDOMOptions:g,dataURLOptions:T={},inlineImages:b=!1,recordCanvas:N=!1,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:v=5e3,keepIframeSrcFn:E=(()=>!1),newlyAddedElement:I=!1}=s;let{preserveWhiteSpace:L=!0}=s;const M=$(t,{doc:i,mirror:a,blockClass:c,blockSelector:l,maskTextClass:u,maskTextSelector:d,inlineStylesheet:m,maskInputOptions:f,maskTextFn:h,maskInputFn:y,dataURLOptions:T,inlineImages:b,recordCanvas:N,keepIframeSrcFn:E,newlyAddedElement:I});if(!M)return console.warn(t,"not serialized"),null;let O;O=a.hasNode(t)?a.getId(t):!function(t,n){if(n.comment&&t.type===e.NodeType.Comment)return!0;if(t.type===e.NodeType.Element){if(n.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===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(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(U(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===U(t.attributes.name)||"icon"===U(t.attributes.rel)||"apple-touch-icon"===U(t.attributes.rel)||"shortcut icon"===U(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&U(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(U(t.attributes.property).match(/^(og|twitter|fb):/)||U(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===U(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===U(t.attributes.name)||"googlebot"===U(t.attributes.name)||"bingbot"===U(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===U(t.attributes.name)||"generator"===U(t.attributes.name)||"framework"===U(t.attributes.name)||"publisher"===U(t.attributes.name)||"progid"===U(t.attributes.name)||U(t.attributes.property).match(/^article:/)||U(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===U(t.attributes.name)||"yandex-verification"===U(t.attributes.name)||"csrf-token"===U(t.attributes.name)||"p:domain_verify"===U(t.attributes.name)||"verify-v1"===U(t.attributes.name)||"verification"===U(t.attributes.name)||"shopify-checkout-api-token"===U(t.attributes.name)))return!0}}return!1}(M,g)&&(L||M.type!==e.NodeType.Text||M.isStyle||M.textContent.replace(/^\s+|\s+$/gm,"").length)?k():-2;const D=Object.assign(M,{id:O});if(a.add(t,D),-2===O)return null;S&&S(t);let _=!p;if(D.type===e.NodeType.Element){_=_&&!D.needBlock,delete D.needBlock;const e=t.shadowRoot;e&&o(e)&&(D.isShadowHost=!0)}if((D.type===e.NodeType.Document||D.type===e.NodeType.Element)&&_){g.headWhitespace&&D.type===e.NodeType.Element&&"head"===D.tagName&&(L=!1);const r={doc:i,mirror:a,blockClass:c,blockSelector:l,maskTextClass:u,maskTextSelector:d,skipChild:p,inlineStylesheet:m,maskInputOptions:f,maskTextFn:h,maskInputFn:y,slimDOMOptions:g,dataURLOptions:T,inlineImages:b,recordCanvas:N,preserveWhiteSpace:L,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w,onStylesheetLoad:x,stylesheetLoadTimeout:v,keepIframeSrcFn:E};for(const e of Array.from(t.childNodes)){const t=W(e,r);t&&D.childNodes.push(t)}if(n(t)&&t.shadowRoot)for(const e of Array.from(t.shadowRoot.childNodes)){const n=W(e,r);n&&(o(t.shadowRoot)&&(n.isShadow=!0),D.childNodes.push(n))}}return t.parentNode&&r(t.parentNode)&&o(t.parentNode)&&(D.isShadow=!0),D.type===e.NodeType.Element&&"iframe"===D.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let o,s=!1;try{o=r.document.readyState}catch(e){return}if("complete"!==o){const r=setTimeout((()=>{s||(t(),s=!0)}),n);return void e.addEventListener("load",(()=>{clearTimeout(r),s=!0,t()}))}const i="about:blank";if(r.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(t,(()=>{const e=t.contentDocument;if(e&&C){const n=W(e,{doc:e,mirror:a,blockClass:c,blockSelector:l,maskTextClass:u,maskTextSelector:d,skipChild:!1,inlineStylesheet:m,maskInputOptions:f,maskTextFn:h,maskInputFn:y,slimDOMOptions:g,dataURLOptions:T,inlineImages:b,recordCanvas:N,preserveWhiteSpace:L,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w,onStylesheetLoad:x,stylesheetLoadTimeout:v,keepIframeSrcFn:E});n&&C(t,n)}}),w),D.type===e.NodeType.Element&&"link"===D.tagName&&"stylesheet"===D.attributes.rel&&function(e,t,n){let r,o=!1;try{r=e.sheet}catch(e){return}if(r)return;const s=setTimeout((()=>{o||(t(),o=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(s),o=!0,t()}))}(t,(()=>{if(x){const e=W(t,{doc:i,mirror:a,blockClass:c,blockSelector:l,maskTextClass:u,maskTextSelector:d,skipChild:!1,inlineStylesheet:m,maskInputOptions:f,maskTextFn:h,maskInputFn:y,slimDOMOptions:g,dataURLOptions:T,inlineImages:b,recordCanvas:N,preserveWhiteSpace:L,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w,onStylesheetLoad:x,stylesheetLoadTimeout:v,keepIframeSrcFn:E});e&&x(t,e)}}),v),D}const j=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function B(e,t={}){let n=1,r=1;function o(e){const t=e.match(/\n/g);t&&(n+=t.length);const o=e.lastIndexOf("\n");r=-1===o?r+e.length:e.length-o}function s(){const e={line:n,column:r};return t=>(t.position=new i(e),m(),t)}class i{constructor(e){this.start=e,this.end={line:n,column:r},this.source=t.source}}i.prototype.content=e;const a=[];function c(o){const s=new Error(`${t.source||""}:${n}:${r}: ${o}`);if(s.reason=o,s.filename=t.source,s.line=n,s.column=r,s.source=e,!t.silent)throw s;a.push(s)}function l(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(m(),f(n);e.length&&"}"!==e.charAt(0)&&(t=w()||x());)t&&(n.push(t),f(n));return n}function p(t){const n=t.exec(e);if(!n)return;const r=n[0];return o(r),e=e.slice(r.length),n}function m(){p(/^\s*/)}function f(e=[]){let t;for(;t=h();)t&&e.push(t),t=h();return e}function h(){const t=s();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return c("End of comment missing");const i=e.slice(2,n-2);return r+=2,o(i),e=e.slice(n),r+=2,t({type:"comment",comment:i})}function y(){for(m();"}"==e[0];)c("extra closing bracket"),e=e.slice(1),m();const t=p(/^(("(?:\\"|[^"])*"|'(?:\\'|[^'])*'|[^{])+)/);if(!t)return;const n=t[0].trim().replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(e=>e.replace(/,/g,"")));return function(e){const t=[];let n="",r=0,o=0;for(const s of e)"("===s?r++:")"===s?r--:"["===s?o++:"]"===s&&o--,","===s&&0===r&&0===o?(t.push(n),n=""):n+=s;n&&t.push(n);return t}(n).map((e=>e.replace(/\u200C/g,",").trim()))}function g(){const e=s(),t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;const n=P(t[0]);if(!p(/^:\s*/))return c("property missing ':'");const r=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:n.replace(j,""),value:r?P(r[0]).replace(j,""):""});return p(/^[;\s]*/),o}function T(){const e=[];if(!l())return c("missing '{'");let t;for(f(e);t=g();)!1!==t&&(e.push(t),f(e)),t=g();return u()?e:c("missing '}'")}function b(){let e;const t=[],n=s();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:T()})}const k=C("import"),N=C("charset"),S=C("namespace");function C(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return()=>{const n=s(),r=p(t);if(!r)return;const o={type:e};return o[e]=r[1].trim(),n(o)}}function w(){if("@"===e[0])return function(){const e=s();let t=p(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=p(/^([-\w]+)\s*/),!t)return c("@keyframes missing name");const r=t[1];if(!l())return c("@keyframes missing '{'");let o,i=f();for(;o=b();)i.push(o),i=i.concat(f());return u()?e({type:"keyframes",name:r,vendor:n,keyframes:i}):c("@keyframes missing '}'")}()||function(){const e=s(),t=p(/^@media *([^{]+)/);if(!t)return;const n=P(t[1]);if(!l())return c("@media missing '{'");const r=f().concat(d());return u()?e({type:"media",media:n,rules:r}):c("@media missing '}'")}()||function(){const e=s(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:P(t[1]),media:P(t[2])})}()||function(){const e=s(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=P(t[1]);if(!l())return c("@supports missing '{'");const r=f().concat(d());return u()?e({type:"supports",supports:n,rules:r}):c("@supports missing '}'")}()||k()||N()||S()||function(){const e=s(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=P(t[1]),r=P(t[2]);if(!l())return c("@document missing '{'");const o=f().concat(d());return u()?e({type:"document",document:r,vendor:n,rules:o}):c("@document missing '}'")}()||function(){const e=s();if(!p(/^@page */))return;const t=y()||[];if(!l())return c("@page missing '{'");let n,r=f();for(;n=g();)r.push(n),r=r.concat(f());return u()?e({type:"page",selectors:t,declarations:r}):c("@page missing '}'")}()||function(){const e=s();if(!p(/^@host\s*/))return;if(!l())return c("@host missing '{'");const t=f().concat(d());return u()?e({type:"host",rules:t}):c("@host missing '}'")}()||function(){const e=s();if(!p(/^@font-face\s*/))return;if(!l())return c("@font-face missing '{'");let t,n=f();for(;t=g();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):c("@font-face missing '}'")}()}function x(){const e=s(),t=y();return t?(f(),e({type:"rule",selectors:t,declarations:T()})):c("selector missing")}return G(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function P(e){return e?e.replace(/^\s+|\s+$/g,""):""}function G(e,t){const n=e&&"string"==typeof e.type,r=n?e:t;for(const t of Object.keys(e)){const n=e[t];Array.isArray(n)?n.forEach((e=>{G(e,r)})):n&&"object"==typeof n&&G(n,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}const H={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"};const z=/([^\\]):hover/,V=new RegExp(z.source,"g");function q(e,t){const n=null==t?void 0:t.stylesWithHoverClass.get(e);if(n)return n;const r=B(e,{silent:!0});if(!r.stylesheet)return e;const o=[];if(r.stylesheet.rules.forEach((e=>{"selectors"in e&&(e.selectors||[]).forEach((e=>{z.test(e)&&o.push(e)}))})),0===o.length)return e;const s=new RegExp(o.filter(((e,t)=>o.indexOf(e)===t)).sort(((e,t)=>t.length-e.length)).map((e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))).join("|"),"g"),i=e.replace(s,(e=>{const t=e.replace(V,"$1.\\:hover");return`${e}, ${t}`}));return null==t||t.stylesWithHoverClass.set(e,i),i}function Y(t,n){const{doc:r,hackCss:o,cache:s}=n;switch(t.type){case e.NodeType.Document:return r.implementation.createDocument(null,"",null);case e.NodeType.DocumentType:return r.implementation.createDocumentType(t.name||"html",t.publicId,t.systemId);case e.NodeType.Element:{const e=function(e){let t=H[e.tagName]?H[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(t);let n;n=t.isSVG?r.createElementNS("http://www.w3.org/2000/svg",e):r.createElement(e);const i={};for(const a in t.attributes){if(!Object.prototype.hasOwnProperty.call(t.attributes,a))continue;let c=t.attributes[a];if("option"===e&&"selected"===a&&!1===c)continue;if(null===c)continue;if(!0===c&&(c=""),a.startsWith("rr_")){i[a]=c;continue}const l="textarea"===e&&"value"===a,u="style"===e&&"_cssText"===a;if(u&&o&&"string"==typeof c&&(c=q(c,s)),!l&&!u||"string"!=typeof c)try{if(t.isSVG&&"xlink:href"===a)n.setAttributeNS("http://www.w3.org/1999/xlink",a,c.toString());else if("onload"===a||"onclick"===a||"onmouse"===a.substring(0,7))n.setAttribute("_"+a,c.toString());else{if("meta"===e&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"===a){n.setAttribute("csp-content",c.toString());continue}("link"!==e||"preload"!==t.attributes.rel&&"modulepreload"!==t.attributes.rel||"script"!==t.attributes.as)&&("link"===e&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")||("img"===e&&t.attributes.srcset&&t.attributes.rr_dataURL?n.setAttribute("rrweb-original-srcset",t.attributes.srcset):n.setAttribute(a,c.toString())))}}catch(e){}else{const e=r.createTextNode(c);for(const e of Array.from(n.childNodes))e.nodeType===n.TEXT_NODE&&n.removeChild(e);n.appendChild(e)}}for(const r in i){const o=i[r];if("canvas"===e&&"rr_dataURL"===r){const e=document.createElement("img");e.onload=()=>{const t=n.getContext("2d");t&&t.drawImage(e,0,0,e.width,e.height)},e.src=o.toString(),n.RRNodeType&&(n.rr_dataURL=o.toString())}else if("img"===e&&"rr_dataURL"===r){const e=n;e.currentSrc.startsWith("data:")||(e.setAttribute("rrweb-original-src",t.attributes.src),e.src=o.toString())}if("rr_width"===r)n.style.width=o.toString();else if("rr_height"===r)n.style.height=o.toString();else if("rr_mediaCurrentTime"===r&&"number"==typeof o)n.currentTime=o;else if("rr_mediaState"===r)switch(o){case"played":n.play().catch((e=>console.warn("media playback error",e)));break;case"paused":n.pause()}}if(t.isShadowHost)if(n.shadowRoot)for(;n.shadowRoot.firstChild;)n.shadowRoot.removeChild(n.shadowRoot.firstChild);else n.attachShadow({mode:"open"});return n}case e.NodeType.Text:return r.createTextNode(t.isStyle&&o?q(t.textContent,s):t.textContent);case e.NodeType.CDATA:return r.createCDATASection(t.textContent);case e.NodeType.Comment:return r.createComment(t.textContent);default:return null}}function J(t,r){const{doc:o,mirror:s,skipChild:i=!1,hackCss:a=!0,afterAppend:c,cache:l}=r;if(s.has(t.id)){const e=s.getNode(t.id);if(y(s.getMeta(e),t))return s.getNode(t.id)}let u=Y(t,{doc:o,hackCss:a,cache:l});if(!u)return null;if(t.rootId&&s.getNode(t.rootId)!==o&&s.replace(t.rootId,o),t.type===e.NodeType.Document&&(o.close(),o.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?o.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):o.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=o),s.add(u,t),(t.type===e.NodeType.Document||t.type===e.NodeType.Element)&&!i)for(const r of t.childNodes){const i=J(r,{doc:o,mirror:s,skipChild:!1,hackCss:a,afterAppend:c,cache:l});if(i){if(r.isShadow&&n(u)&&u.shadowRoot)u.shadowRoot.appendChild(i);else if(t.type===e.NodeType.Document&&r.type==e.NodeType.Element){const e=i;let t=null;e.childNodes.forEach((e=>{"BODY"===e.nodeName&&(t=e)})),t?(e.removeChild(t),u.appendChild(i),e.appendChild(t)):u.appendChild(i)}else u.appendChild(i);c&&c(i,r.id)}else console.warn("Failed to rebuild",r)}return u}return e.IGNORED_NODE=-2,e.Mirror=d,e.addHoverClass=q,e.buildNodeWithSN=J,e.classMatchesRegex=R,e.cleanupSnapshot=function(){T=1},e.createCache=function(){return{stylesWithHoverClass:new Map}},e.createMirror=function(){return new d},e.escapeImportStatement=s,e.fixSafariColons=c,e.genId=k,e.getInputType=g,e.ignoreAttribute=A,e.is2DCanvasBlank=h,e.isCSSImportRule=l,e.isCSSStyleRule=u,e.isElement=n,e.isNativeShadowDom=o,e.isNodeMetaEqual=y,e.isShadowRoot=r,e.maskInputValue=p,e.needMaskingText=F,e.rebuild=function(t,n){const{doc:r,onVisit:o,hackCss:s=!0,afterAppend:i,cache:a,mirror:c=new d}=n,l=J(t,{doc:r,mirror:c,skipChild:!1,hackCss:s,afterAppend:i,cache:a});return function(e,t){for(const r of e.getIds())e.has(r)&&(n=e.getNode(r),t(n));var n}(c,(t=>{o&&o(t),function(t,n){const r=n.getMeta(t);if((null==r?void 0:r.type)!==e.NodeType.Element)return;const o=t;for(const e in r.attributes){if(!Object.prototype.hasOwnProperty.call(r.attributes,e)||!e.startsWith("rr_"))continue;const t=r.attributes[e];"rr_scrollLeft"===e&&(o.scrollLeft=t),"rr_scrollTop"===e&&(o.scrollTop=t)}}(t,c)})),l},e.serializeNodeWithId=W,e.snapshot=function(e,t){const{mirror:n=new d,blockClass:r="rr-block",blockSelector:o=null,maskTextClass:s="rr-mask",maskTextSelector:i=null,inlineStylesheet:a=!0,inlineImages:c=!1,recordCanvas:l=!1,maskAllInputs:u=!1,maskTextFn:p,maskInputFn:m,slimDOM:f=!1,dataURLOptions:h,preserveWhiteSpace:y,onSerialize:g,onIframeLoad:T,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:N,keepIframeSrcFn:S=(()=>!1)}=t||{};return W(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,maskTextClass:s,maskTextSelector:i,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===u?{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===u?{password:!0}:u,maskTextFn:p,maskInputFn:m,slimDOMOptions:!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===f,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===f?{}:f,dataURLOptions:h,inlineImages:c,recordCanvas:l,preserveWhiteSpace:y,onSerialize:g,onIframeLoad:T,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:N,keepIframeSrcFn:S,newlyAddedElement:!1})},e.stringifyRule=a,e.stringifyStylesheet=i,e.toLowerCase=m,e.transformAttribute=_,e.visitSnapshot=function(t,n){!function t(r){n(r),r.type!==e.NodeType.Document&&r.type!==e.NodeType.Element||r.childNodes.forEach(t)}(t)},Object.defineProperty(e,"__esModule",{value:!0}),e}({}); | ||
//# sourceMappingURL=rrweb-snapshot.min.js.map |
@@ -1,2 +0,2 @@ | ||
var e;function t(e){return e.nodeType===e.ELEMENT_NODE}function r(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function n(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function a(e){var t=e.cssText;if(t.split('"').length<3)return t;var r=["@import","url(".concat(JSON.stringify(e.href),")")];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer(".concat(e.layerName,")")),e.supportsText&&r.push("supports(".concat(e.supportsText,")")),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function o(e){try{var t=e.rules||e.cssRules;return t?((r=Array.from(t,i).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),r):null}catch(e){return null}var r}function i(e){var t;if(c(e))try{t=o(e.styleSheet)||a(e)}catch(e){}else if(l(e)&&e.selectorText.includes(":"))return s(e.cssText);return t||e.cssText}function s(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function c(e){return"styleSheet"in e}function l(e){return"selectorText"in e}!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 u=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var r=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=r?r:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,r=this.getId(e);this.idNodeMap.delete(r),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function d(){return new u}function f(e){var t=e.element,r=e.maskInputOptions,n=e.tagName,a=e.type,o=e.value,i=e.maskInputFn,s=o||"",c=a&&p(a);return(r[n.toLowerCase()]||c&&r[c])&&(s=i?i(s,t):"*".repeat(s.length)),s}function p(e){return e.toLowerCase()}function m(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var n=0;n<e.height;n+=50){var a=t.getImageData,o="__rrweb_original__"in a?a.__rrweb_original__:a;if(new Uint32Array(o.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((function(e){return 0!==e})))return!1}return!0}function h(t,r){return!(!t||!r||t.type!==r.type)&&(t.type===e.Document?t.compatMode===r.compatMode:t.type===e.DocumentType?t.name===r.name&&t.publicId===r.publicId&&t.systemId===r.systemId:t.type===e.Comment||t.type===e.Text||t.type===e.CDATA?t.textContent===r.textContent:t.type===e.Element&&(t.tagName===r.tagName&&JSON.stringify(t.attributes)===JSON.stringify(r.attributes)&&t.isSVG===r.isSVG&&t.needBlock===r.needBlock))}function v(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?p(t):null}var g,y,b=1,k=new RegExp("[^a-z0-9-_:]"),T=-2;function C(){return b++}var S=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,w=/^(?:[a-z+]+:)?\/\//i,x=/^www\..*/i,N=/^(data:)([^,]*),(.*)/i;function E(e,t){return(e||"").replace(S,(function(e,r,n,a,o,i){var s,c=n||o||i,l=r||a||"";if(!c)return e;if(w.test(c)||x.test(c))return"url(".concat(l).concat(c).concat(l,")");if(N.test(c))return"url(".concat(l).concat(c).concat(l,")");if("/"===c[0])return"url(".concat(l).concat((s=t,(s.indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+c)).concat(l,")");var u=t.split("/"),d=c.split("/");u.pop();for(var f=0,p=d;f<p.length;f++){var m=p[f];"."!==m&&(".."===m?u.pop():u.push(m))}return"url(".concat(l).concat(u.join("/")).concat(l,")")}))}var I=/^[^ \t\n\r\u000c]+/,L=/^[, \t\n\r\u000c]+/;function M(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function O(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function D(){var e=document.createElement("a");return e.href="",e.href}function _(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?M(e,n):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?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(L),!(r>=t.length);){var o=n(I);if(","===o.slice(-1))o=M(e,o.substring(0,o.length-1)),a.push(o);else{var i="";o=M(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?E(n,D()):"object"===t&&"data"===r?M(e,n):n:M(e,n):n}function A(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function R(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&R(e.parentNode,t,r);for(var n=e.classList.length;n--;){var a=e.classList[n];if(t.test(a))return!0}return!!r&&R(e.parentNode,t,r)}function F(e,t,r){try{var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===n)return!1;if("string"==typeof t){if(n.classList.contains(t))return!0;if(n.closest(".".concat(t)))return!0}else if(R(n,t,!0))return!0;if(r){if(n.matches(r))return!0;if(n.closest(r))return!0}}catch(e){}return!1}function U(t,r){var n=r.doc,a=r.mirror,i=r.blockClass,s=r.blockSelector,c=r.maskTextClass,l=r.maskTextSelector,u=r.inlineStylesheet,d=r.maskInputOptions,h=void 0===d?{}:d,b=r.maskTextFn,T=r.maskInputFn,C=r.dataURLOptions,S=void 0===C?{}:C,w=r.inlineImages,x=r.recordCanvas,N=r.keepIframeSrcFn,I=r.newlyAddedElement,L=void 0!==I&&I,M=function(e,t){if(!t.hasNode(e))return;var r=t.getId(e);return 1===r?void 0:r}(n,a);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode}:{type:e.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:M};case t.ELEMENT_NODE:return function(t,r){for(var n=r.doc,a=r.blockClass,i=r.blockSelector,s=r.inlineStylesheet,c=r.maskInputOptions,l=void 0===c?{}:c,u=r.maskInputFn,d=r.dataURLOptions,h=void 0===d?{}:d,b=r.inlineImages,T=r.recordCanvas,C=r.keepIframeSrcFn,S=r.newlyAddedElement,w=void 0!==S&&S,x=r.rootId,N=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var a=e.classList[n];if(t.test(a))return!0}if(r)return e.matches(r)}catch(e){}return!1}(t,a,i),I=function(e){if(e instanceof HTMLFormElement)return"form";var t=p(e.tagName);return k.test(t)?"div":t}(t),L={},M=t.attributes.length,R=0;R<M;R++){var F=t.attributes[R];A(I,F.name,F.value)||(L[F.name]=_(n,I,p(F.name),F.value))}if("link"===I&&s){var U=Array.from(n.styleSheets).find((function(e){return e.href===t.href})),W=null;U&&(W=o(U)),W&&(delete L.rel,delete L.href,L._cssText=E(W,U.href))}if("style"===I&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){(W=o(t.sheet))&&(L._cssText=E(W,D()))}if("input"===I||"textarea"===I||"select"===I){var j=t.value,B=t.checked;if("radio"!==L.type&&"checkbox"!==L.type&&"submit"!==L.type&&"button"!==L.type&&j){var P=v(t);L.value=f({element:t,type:P,tagName:I,value:j,maskInputOptions:l,maskInputFn:u})}else B&&(L.checked=B)}"option"===I&&(t.selected&&!l.select?L.selected=!0:delete L.selected);if("canvas"===I&&T)if("2d"===t.__context)m(t)||(L.rr_dataURL=t.toDataURL(h.type,h.quality));else if(!("__context"in t)){var G=t.toDataURL(h.type,h.quality),H=document.createElement("canvas");H.width=t.width,H.height=t.height,G!==H.toDataURL(h.type,h.quality)&&(L.rr_dataURL=G)}if("img"===I&&b){g||(g=n.createElement("canvas"),y=g.getContext("2d"));var z=t,V=z.crossOrigin;z.crossOrigin="anonymous";var $=function(){z.removeEventListener("load",$);try{g.width=z.naturalWidth,g.height=z.naturalHeight,y.drawImage(z,0,0),L.rr_dataURL=g.toDataURL(h.type,h.quality)}catch(e){console.warn("Cannot inline img src=".concat(z.currentSrc,"! Error: ").concat(e))}V?L.crossOrigin=V:z.removeAttribute("crossorigin")};z.complete&&0!==z.naturalWidth?$():z.addEventListener("load",$)}"audio"!==I&&"video"!==I||(L.rr_mediaState=t.paused?"paused":"played",L.rr_mediaCurrentTime=t.currentTime);w||(t.scrollLeft&&(L.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(L.rr_scrollTop=t.scrollTop));if(N){var q=t.getBoundingClientRect(),Y=q.width,J=q.height;L={class:L.class,rr_width:"".concat(Y,"px"),rr_height:"".concat(J,"px")}}"iframe"!==I||C(L.src)||(t.contentDocument||(L.rr_src=L.src),delete L.src);return{type:e.Element,tagName:I,attributes:L,childNodes:[],isSVG:O(t)||void 0,needBlock:N,rootId:x}}(t,{doc:n,blockClass:i,blockSelector:s,inlineStylesheet:u,maskInputOptions:h,maskInputFn:T,dataURLOptions:S,inlineImages:w,recordCanvas:x,keepIframeSrcFn:N,newlyAddedElement:L,rootId:M});case t.TEXT_NODE:return function(t,r){var n,a=r.maskTextClass,i=r.maskTextSelector,s=r.maskTextFn,c=r.rootId,l=t.parentNode&&t.parentNode.tagName,u=t.textContent,d="STYLE"===l||void 0,f="SCRIPT"===l||void 0;if(d&&u){try{t.nextSibling||t.previousSibling||(null===(n=t.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(u=o(t.parentNode.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(e),t)}u=E(u,D())}f&&(u="SCRIPT_PLACEHOLDER");!d&&!f&&u&&F(t,a,i)&&(u=s?s(u,t.parentElement):u.replace(/[\S]/g,"*"));return{type:e.Text,textContent:u||"",isStyle:d,rootId:c}}(t,{maskTextClass:c,maskTextSelector:l,maskTextFn:b,rootId:M});case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:M};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:M};default:return!1}}function W(e){return null==e?"":e.toLowerCase()}function j(a,o){var i,s=o.doc,c=o.mirror,l=o.blockClass,u=o.blockSelector,d=o.maskTextClass,f=o.maskTextSelector,p=o.skipChild,m=void 0!==p&&p,h=o.inlineStylesheet,v=void 0===h||h,g=o.maskInputOptions,y=void 0===g?{}:g,b=o.maskTextFn,k=o.maskInputFn,T=o.slimDOMOptions,S=o.dataURLOptions,w=void 0===S?{}:S,x=o.inlineImages,N=void 0!==x&&x,E=o.recordCanvas,I=void 0!==E&&E,L=o.onSerialize,M=o.onIframeLoad,O=o.iframeLoadTimeout,D=void 0===O?5e3:O,_=o.onStylesheetLoad,A=o.stylesheetLoadTimeout,R=void 0===A?5e3:A,F=o.keepIframeSrcFn,B=void 0===F?function(){return!1}:F,P=o.newlyAddedElement,G=void 0!==P&&P,H=o.preserveWhiteSpace,z=void 0===H||H,V=U(a,{doc:s,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:f,inlineStylesheet:v,maskInputOptions:y,maskTextFn:b,maskInputFn:k,dataURLOptions:w,inlineImages:N,recordCanvas:I,keepIframeSrcFn:B,newlyAddedElement:G});if(!V)return console.warn(a,"not serialized"),null;i=c.hasNode(a)?c.getId(a):!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||"modulepreload"===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&&(W(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===W(t.attributes.name)||"icon"===W(t.attributes.rel)||"apple-touch-icon"===W(t.attributes.rel)||"shortcut icon"===W(t.attributes.rel))))return!0;if("meta"===t.tagName){if(r.headMetaDescKeywords&&W(t.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(W(t.attributes.property).match(/^(og|twitter|fb):/)||W(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===W(t.attributes.name)))return!0;if(r.headMetaRobots&&("robots"===W(t.attributes.name)||"googlebot"===W(t.attributes.name)||"bingbot"===W(t.attributes.name)))return!0;if(r.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(r.headMetaAuthorship&&("author"===W(t.attributes.name)||"generator"===W(t.attributes.name)||"framework"===W(t.attributes.name)||"publisher"===W(t.attributes.name)||"progid"===W(t.attributes.name)||W(t.attributes.property).match(/^article:/)||W(t.attributes.property).match(/^product:/)))return!0;if(r.headMetaVerification&&("google-site-verification"===W(t.attributes.name)||"yandex-verification"===W(t.attributes.name)||"csrf-token"===W(t.attributes.name)||"p:domain_verify"===W(t.attributes.name)||"verify-v1"===W(t.attributes.name)||"verification"===W(t.attributes.name)||"shopify-checkout-api-token"===W(t.attributes.name)))return!0}}return!1}(V,T)&&(z||V.type!==e.Text||V.isStyle||V.textContent.replace(/^\s+|\s+$/gm,"").length)?C():-2;var $=Object.assign(V,{id:i});if(c.add(a,$),-2===i)return null;L&&L(a);var q=!m;if($.type===e.Element){q=q&&!$.needBlock,delete $.needBlock;var Y=a.shadowRoot;Y&&n(Y)&&($.isShadowHost=!0)}if(($.type===e.Document||$.type===e.Element)&&q){T.headWhitespace&&$.type===e.Element&&"head"===$.tagName&&(z=!1);for(var J={doc:s,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:f,skipChild:m,inlineStylesheet:v,maskInputOptions:y,maskTextFn:b,maskInputFn:k,slimDOMOptions:T,dataURLOptions:w,inlineImages:N,recordCanvas:I,preserveWhiteSpace:z,onSerialize:L,onIframeLoad:M,iframeLoadTimeout:D,onStylesheetLoad:_,stylesheetLoadTimeout:R,keepIframeSrcFn:B},X=0,K=Array.from(a.childNodes);X<K.length;X++){(ee=j(K[X],J))&&$.childNodes.push(ee)}if(t(a)&&a.shadowRoot)for(var Q=0,Z=Array.from(a.shadowRoot.childNodes);Q<Z.length;Q++){var ee;(ee=j(Z[Q],J))&&(n(a.shadowRoot)&&(ee.isShadow=!0),$.childNodes.push(ee))}}return a.parentNode&&r(a.parentNode)&&n(a.parentNode)&&($.isShadow=!0),$.type===e.Element&&"iframe"===$.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";if(n.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout((function(){o||(t(),o=!0)}),r);e.addEventListener("load",(function(){clearTimeout(s),o=!0,t()}))}}}(a,(function(){var e=a.contentDocument;if(e&&M){var t=j(e,{doc:e,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:f,skipChild:!1,inlineStylesheet:v,maskInputOptions:y,maskTextFn:b,maskInputFn:k,slimDOMOptions:T,dataURLOptions:w,inlineImages:N,recordCanvas:I,preserveWhiteSpace:z,onSerialize:L,onIframeLoad:M,iframeLoadTimeout:D,onStylesheetLoad:_,stylesheetLoadTimeout:R,keepIframeSrcFn:B});t&&M(a,t)}}),D),$.type===e.Element&&"link"===$.tagName&&"stylesheet"===$.attributes.rel&&function(e,t,r){var n,a=!1;try{n=e.sheet}catch(e){return}if(!n){var o=setTimeout((function(){a||(t(),a=!0)}),r);e.addEventListener("load",(function(){clearTimeout(o),a=!0,t()}))}}(a,(function(){if(_){var e=j(a,{doc:s,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:f,skipChild:!1,inlineStylesheet:v,maskInputOptions:y,maskTextFn:b,maskInputFn:k,slimDOMOptions:T,dataURLOptions:w,inlineImages:N,recordCanvas:I,preserveWhiteSpace:z,onSerialize:L,onIframeLoad:M,iframeLoadTimeout:D,onStylesheetLoad:_,stylesheetLoadTimeout:R,keepIframeSrcFn:B});e&&_(a,e)}}),R),$}function B(e,t){var r=t||{},n=r.mirror,a=void 0===n?new u:n,o=r.blockClass,i=void 0===o?"rr-block":o,s=r.blockSelector,c=void 0===s?null:s,l=r.maskTextClass,d=void 0===l?"rr-mask":l,f=r.maskTextSelector,p=void 0===f?null:f,m=r.inlineStylesheet,h=void 0===m||m,v=r.inlineImages,g=void 0!==v&&v,y=r.recordCanvas,b=void 0!==y&&y,k=r.maskAllInputs,T=void 0!==k&&k,C=r.maskTextFn,S=r.maskInputFn,w=r.slimDOM,x=void 0!==w&&w,N=r.dataURLOptions,E=r.preserveWhiteSpace,I=r.onSerialize,L=r.onIframeLoad,M=r.iframeLoadTimeout,O=r.onStylesheetLoad,D=r.stylesheetLoadTimeout,_=r.keepIframeSrcFn;return j(e,{doc:e,mirror:a,blockClass:i,blockSelector:c,maskTextClass:d,maskTextSelector:p,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===T?{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===T?{password:!0}:T,maskTextFn:C,maskInputFn:S,slimDOMOptions:!0===x||"all"===x?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===x,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===x?{}:x,dataURLOptions:N,inlineImages:g,recordCanvas:b,preserveWhiteSpace:E,onSerialize:I,onIframeLoad:L,iframeLoadTimeout:M,onStylesheetLoad:O,stylesheetLoadTimeout:D,keepIframeSrcFn:void 0===_?function(){return!1}:_,newlyAddedElement:!1})}function P(t,r){!function t(n){r(n),n.type!==e.Document&&n.type!==e.Element||n.childNodes.forEach(t)}(t)}function G(){b=1}var H=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function z(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),p(),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("".concat(t.source||"",":").concat(r,":").concat(n,": ").concat(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 l(){return f(/^{\s*/)}function u(){return f(/^}/)}function d(){var t,r=[];for(p(),m(r);e.length&&"}"!==e.charAt(0)&&(t=x()||N());)t&&(r.push(t),m(r));return r}function f(t){var r=t.exec(e);if(r){var n=r[0];return a(n),e=e.slice(n.length),r}}function p(){f(/^\s*/)}function m(e){var t;for(void 0===e&&(e=[]);t=h();)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=f(/^([^{]+)/);if(e)return V(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=o(),t=f(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=V(t[0]);if(!f(/^:\s*/))return c("property missing ':'");var n=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),a=e({type:"declaration",property:r.replace(H,""),value:n?V(n[0]).replace(H,""):""});return f(/^[;\s]*/),a}}function y(){var e,t=[];if(!l())return c("missing '{'");for(m(t);e=g();)!1!==e&&(t.push(e),m(t)),e=g();return u()?t:c("missing '}'")}function b(){for(var e,t=[],r=o();e=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),f(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:y()})}var k,T=w("import"),C=w("charset"),S=w("namespace");function w(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=o(),n=f(t);if(n){var a={type:e};return a[e]=n[1].trim(),r(a)}}}function x(){if("@"===e[0])return function(){var e=o(),t=f(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=f(/^([-\w]+)\s*/)))return c("@keyframes missing name");var n,a=t[1];if(!l())return c("@keyframes missing '{'");for(var i=m();n=b();)i.push(n),i=i.concat(m());return u()?e({type:"keyframes",name:a,vendor:r,keyframes:i}):c("@keyframes missing '}'")}}()||function(){var e=o(),t=f(/^@media *([^{]+)/);if(t){var r=V(t[1]);if(!l())return c("@media missing '{'");var n=m().concat(d());return u()?e({type:"media",media:r,rules:n}):c("@media missing '}'")}}()||function(){var e=o(),t=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:V(t[1]),media:V(t[2])})}()||function(){var e=o(),t=f(/^@supports *([^{]+)/);if(t){var r=V(t[1]);if(!l())return c("@supports missing '{'");var n=m().concat(d());return u()?e({type:"supports",supports:r,rules:n}):c("@supports missing '}'")}}()||T()||C()||S()||function(){var e=o(),t=f(/^@([-\w]+)?document *([^{]+)/);if(t){var r=V(t[1]),n=V(t[2]);if(!l())return c("@document missing '{'");var a=m().concat(d());return u()?e({type:"document",document:n,vendor:r,rules:a}):c("@document missing '}'")}}()||function(){var e=o();if(f(/^@page */)){var t=v()||[];if(!l())return c("@page missing '{'");for(var r,n=m();r=g();)n.push(r),n=n.concat(m());return u()?e({type:"page",selectors:t,declarations:n}):c("@page missing '}'")}}()||function(){var e=o();if(f(/^@host\s*/)){if(!l())return c("@host missing '{'");var t=m().concat(d());return u()?e({type:"host",rules:t}):c("@host missing '}'")}}()||function(){var e=o();if(f(/^@font-face\s*/)){if(!l())return c("@font-face missing '{'");for(var t,r=m();t=g();)r.push(t),r=r.concat(m());return u()?e({type:"font-face",declarations:r}):c("@font-face missing '}'")}}()}function N(){var e=o(),t=v();return t?(m(),e({type:"rule",selectors:t,declarations:y()})):c("selector missing")}return $((k=d(),{type:"stylesheet",stylesheet:{source:t.source,rules:k,parsingErrors:s}}))}function V(e){return e?e.replace(/^\s+|\s+$/g,""):""}function $(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){$(e,n)})):i&&"object"==typeof i&&$(i,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var q={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 Y=/([^\\]):hover/,J=new RegExp(Y.source,"g");function X(e,t){var r=null==t?void 0:t.stylesWithHoverClass.get(e);if(r)return r;var n=z(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){Y.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(J,"$1.\\:hover");return"".concat(e,", ").concat(t)}));return null==t||t.stylesWithHoverClass.set(e,i),i}function K(){return{stylesWithHoverClass:new Map}}function Q(t,r){var n=r.doc,a=r.hackCss,o=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 i,s=function(e){var t=q[e.tagName]?q[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={};for(var l in t.attributes)if(Object.prototype.hasOwnProperty.call(t.attributes,l)){var u=t.attributes[l];if(("option"!==s||"selected"!==l||!1!==u)&&null!==u)if(!0===u&&(u=""),l.startsWith("rr_"))c[l]=u;else{var d="textarea"===s&&"value"===l,f="style"===s&&"_cssText"===l;if(f&&a&&"string"==typeof u&&(u=X(u,o)),!d&&!f||"string"!=typeof u)try{if(t.isSVG&&"xlink:href"===l)i.setAttributeNS("http://www.w3.org/1999/xlink",l,u.toString());else if("onload"===l||"onclick"===l||"onmouse"===l.substring(0,7))i.setAttribute("_"+l,u.toString());else{if("meta"===s&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"===l){i.setAttribute("csp-content",u.toString());continue}("link"!==s||"preload"!==t.attributes.rel&&"modulepreload"!==t.attributes.rel||"script"!==t.attributes.as)&&("link"===s&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")||("img"===s&&t.attributes.srcset&&t.attributes.rr_dataURL?i.setAttribute("rrweb-original-srcset",t.attributes.srcset):i.setAttribute(l,u.toString())))}}catch(e){}else{for(var p=n.createTextNode(u),m=0,h=Array.from(i.childNodes);m<h.length;m++){var v=h[m];v.nodeType===i.TEXT_NODE&&i.removeChild(v)}i.appendChild(p)}}}var g=function(e){var r=c[e];if("canvas"===s&&"rr_dataURL"===e){var n=document.createElement("img");n.onload=function(){var e=i.getContext("2d");e&&e.drawImage(n,0,0,n.width,n.height)},n.src=r.toString(),i.RRNodeType&&(i.rr_dataURL=r.toString())}else if("img"===s&&"rr_dataURL"===e){var a=i;a.currentSrc.startsWith("data:")||(a.setAttribute("rrweb-original-src",t.attributes.src),a.src=r.toString())}if("rr_width"===e)i.style.width=r.toString();else if("rr_height"===e)i.style.height=r.toString();else if("rr_mediaCurrentTime"===e&&"number"==typeof r)i.currentTime=r;else if("rr_mediaState"===e)switch(r){case"played":i.play().catch((function(e){return console.warn("media playback error",e)}));break;case"paused":i.pause()}};for(var y in c)g(y);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.Text:return n.createTextNode(t.isStyle&&a?X(t.textContent,o):t.textContent);case e.CDATA:return n.createCDATASection(t.textContent);case e.Comment:return n.createComment(t.textContent);default:return null}}function Z(r,n){var a=n.doc,o=n.mirror,i=n.skipChild,s=void 0!==i&&i,c=n.hackCss,l=void 0===c||c,u=n.afterAppend,d=n.cache;if(o.has(r.id)){var f=o.getNode(r.id);if(h(o.getMeta(f),r))return o.getNode(r.id)}var p=Q(r,{doc:a,hackCss:l,cache:d});if(!p)return null;if(r.rootId&&o.getNode(r.rootId)!==a&&o.replace(r.rootId,a),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" "">')),p=a),o.add(p,r),(r.type===e.Document||r.type===e.Element)&&!s)for(var m=function(n){var i=Z(n,{doc:a,mirror:o,skipChild:!1,hackCss:l,afterAppend:u,cache:d});if(!i)return console.warn("Failed to rebuild",n),"continue";if(n.isShadow&&t(p)&&p.shadowRoot)p.shadowRoot.appendChild(i);else if(r.type===e.Document&&n.type==e.Element){var s=i,c=null;s.childNodes.forEach((function(e){"BODY"===e.nodeName&&(c=e)})),c?(s.removeChild(c),p.appendChild(i),s.appendChild(c)):p.appendChild(i)}else p.appendChild(i);u&&u(i,n.id)},v=0,g=r.childNodes;v<g.length;v++){m(g[v])}return p}function ee(t,r){var n=r.doc,a=r.onVisit,o=r.hackCss,i=void 0===o||o,s=r.afterAppend,c=r.cache,l=r.mirror,d=void 0===l?new u:l,f=Z(t,{doc:n,mirror:d,skipChild:!1,hackCss:i,afterAppend:s,cache:c});return function(e,t){for(var r=0,n=e.getIds();r<n.length;r++){var a=n[r];e.has(a)&&t(e.getNode(a))}}(d,(function(t){a&&a(t),function(t,r){var n=r.getMeta(t);if((null==n?void 0:n.type)===e.Element){var a=t;for(var o in n.attributes)if(Object.prototype.hasOwnProperty.call(n.attributes,o)&&o.startsWith("rr_")){var i=n.attributes[o];"rr_scrollLeft"===o&&(a.scrollLeft=i),"rr_scrollTop"===o&&(a.scrollTop=i)}}}(t,d)})),f}export{T as IGNORED_NODE,u as Mirror,e as NodeType,X as addHoverClass,Z as buildNodeWithSN,R as classMatchesRegex,G as cleanupSnapshot,K as createCache,d as createMirror,a as escapeImportStatement,s as fixSafariColons,C as genId,v as getInputType,A as ignoreAttribute,m as is2DCanvasBlank,c as isCSSImportRule,l as isCSSStyleRule,t as isElement,n as isNativeShadowDom,h as isNodeMetaEqual,r as isShadowRoot,f as maskInputValue,F as needMaskingText,ee as rebuild,j as serializeNodeWithId,B as snapshot,i as stringifyRule,o as stringifyStylesheet,p as toLowerCase,_ as transformAttribute,P as visitSnapshot}; | ||
var e;function t(e){return e.nodeType===e.ELEMENT_NODE}function n(e){const t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function r(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function o(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}function s(e){try{const n=e.rules||e.cssRules;return n?((t=Array.from(n,i).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),t):null}catch(e){return null}var t}function i(e){let t;if(c(e))try{t=s(e.styleSheet)||o(e)}catch(e){}else if(l(e)&&e.selectorText.includes(":"))return a(e.cssText);return t||e.cssText}function a(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function c(e){return"styleSheet"in e}function l(e){return"selectorText"in e}!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={}));class u{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function d(){return new u}function m({element:e,maskInputOptions:t,tagName:n,type:r,value:o,maskInputFn:s}){let i=o||"";const a=r&&p(r);return(t[n.toLowerCase()]||a&&t[a])&&(i=s?s(i,e):"*".repeat(i.length)),i}function p(e){return e.toLowerCase()}function f(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){const o=t.getImageData,s="__rrweb_original__"in o?o.__rrweb_original__:o;if(new Uint32Array(s.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((e=>0!==e)))return!1}return!0}function h(t,n){return!(!t||!n||t.type!==n.type)&&(t.type===e.Document?t.compatMode===n.compatMode:t.type===e.DocumentType?t.name===n.name&&t.publicId===n.publicId&&t.systemId===n.systemId:t.type===e.Comment||t.type===e.Text||t.type===e.CDATA?t.textContent===n.textContent:t.type===e.Element&&(t.tagName===n.tagName&&JSON.stringify(t.attributes)===JSON.stringify(n.attributes)&&t.isSVG===n.isSVG&&t.needBlock===n.needBlock))}function g(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?p(t):null}let y=1;const b=new RegExp("[^a-z0-9-_:]"),k=-2;function T(){return y++}let C,S;const w=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,x=/^(?:[a-z+]+:)?\/\//i,N=/^www\..*/i,E=/^(data:)([^,]*),(.*)/i;function v(e,t){return(e||"").replace(w,((e,n,r,o,s,i)=>{const a=r||s||i,c=n||o||"";if(!a)return e;if(x.test(a)||N.test(a))return`url(${c}${a}${c})`;if(E.test(a))return`url(${c}${a}${c})`;if("/"===a[0])return`url(${c}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${c})`;const l=t.split("/"),u=a.split("/");l.pop();for(const e of u)"."!==e&&(".."===e?l.pop():l.push(e));return`url(${c}${l.join("/")}${c})`}))}const I=/^[^ \t\n\r\u000c]+/,L=/^[, \t\n\r\u000c]+/;function M(e,t){if(!t||""===t.trim())return t;const n=e.createElement("a");return n.href=t,n.href}function O(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function D(){const e=document.createElement("a");return e.href="",e.href}function _(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?M(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r;const o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}const o=[];for(;r(L),!(n>=t.length);){let s=r(I);if(","===s.slice(-1))s=M(e,s.substring(0,s.length-1)),o.push(s);else{let r="";s=M(e,s);let i=!1;for(;;){const e=t.charAt(n);if(""===e){o.push((s+r).trim());break}if(i)")"===e&&(i=!1);else{if(","===e){n+=1,o.push((s+r).trim());break}"("===e&&(i=!0)}r+=e,n+=1}}}return o.join(", ")}(e,r):"style"===n?v(r,D()):"object"===t&&"data"===n?M(e,r):r:M(e,r):r}function A(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function R(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&R(e.parentNode,t,n);for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!!n&&R(e.parentNode,t,n)}function F(e,t,n){try{const r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===r)return!1;if("string"==typeof t){if(r.classList.contains(t))return!0;if(r.closest(`.${t}`))return!0}else if(R(r,t,!0))return!0;if(n){if(r.matches(n))return!0;if(r.closest(n))return!0}}catch(e){}return!1}function $(t,n){const{doc:r,mirror:o,blockClass:i,blockSelector:a,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskInputOptions:d={},maskTextFn:h,maskInputFn:y,dataURLOptions:k={},inlineImages:T,recordCanvas:w,keepIframeSrcFn:x,newlyAddedElement:N=!1}=n,E=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(r,o);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode}:{type:e.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:E};case t.ELEMENT_NODE:return function(t,n){const{doc:r,blockClass:o,blockSelector:i,inlineStylesheet:a,maskInputOptions:c={},maskInputFn:l,dataURLOptions:u={},inlineImages:d,recordCanvas:h,keepIframeSrcFn:y,newlyAddedElement:k=!1,rootId:T}=n,w=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(e){}return!1}(t,o,i),x=function(e){if(e instanceof HTMLFormElement)return"form";const t=p(e.tagName);return b.test(t)?"div":t}(t);let N={};const E=t.attributes.length;for(let e=0;e<E;e++){const n=t.attributes[e];A(x,n.name,n.value)||(N[n.name]=_(r,x,p(n.name),n.value))}if("link"===x&&a){const e=Array.from(r.styleSheets).find((e=>e.href===t.href));let n=null;e&&(n=s(e)),n&&(delete N.rel,delete N.href,N._cssText=v(n,e.href))}if("style"===x&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){const e=s(t.sheet);e&&(N._cssText=v(e,D()))}if("input"===x||"textarea"===x||"select"===x){const e=t.value,n=t.checked;if("radio"!==N.type&&"checkbox"!==N.type&&"submit"!==N.type&&"button"!==N.type&&e){const n=g(t);N.value=m({element:t,type:n,tagName:x,value:e,maskInputOptions:c,maskInputFn:l})}else n&&(N.checked=n)}"option"===x&&(t.selected&&!c.select?N.selected=!0:delete N.selected);if("canvas"===x&&h)if("2d"===t.__context)f(t)||(N.rr_dataURL=t.toDataURL(u.type,u.quality));else if(!("__context"in t)){const e=t.toDataURL(u.type,u.quality),n=document.createElement("canvas");n.width=t.width,n.height=t.height;e!==n.toDataURL(u.type,u.quality)&&(N.rr_dataURL=e)}if("img"===x&&d){C||(C=r.createElement("canvas"),S=C.getContext("2d"));const e=t,n=e.crossOrigin;e.crossOrigin="anonymous";const o=()=>{e.removeEventListener("load",o);try{C.width=e.naturalWidth,C.height=e.naturalHeight,S.drawImage(e,0,0),N.rr_dataURL=C.toDataURL(u.type,u.quality)}catch(t){console.warn(`Cannot inline img src=${e.currentSrc}! Error: ${t}`)}n?N.crossOrigin=n:e.removeAttribute("crossorigin")};e.complete&&0!==e.naturalWidth?o():e.addEventListener("load",o)}"audio"!==x&&"video"!==x||(N.rr_mediaState=t.paused?"paused":"played",N.rr_mediaCurrentTime=t.currentTime);k||(t.scrollLeft&&(N.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(N.rr_scrollTop=t.scrollTop));if(w){const{width:e,height:n}=t.getBoundingClientRect();N={class:N.class,rr_width:`${e}px`,rr_height:`${n}px`}}"iframe"!==x||y(N.src)||(t.contentDocument||(N.rr_src=N.src),delete N.src);return{type:e.Element,tagName:x,attributes:N,childNodes:[],isSVG:O(t)||void 0,needBlock:w,rootId:T}}(t,{doc:r,blockClass:i,blockSelector:a,inlineStylesheet:u,maskInputOptions:d,maskInputFn:y,dataURLOptions:k,inlineImages:T,recordCanvas:w,keepIframeSrcFn:x,newlyAddedElement:N,rootId:E});case t.TEXT_NODE:return function(t,n){var r;const{maskTextClass:o,maskTextSelector:i,maskTextFn:a,rootId:c}=n,l=t.parentNode&&t.parentNode.tagName;let u=t.textContent;const d="STYLE"===l||void 0,m="SCRIPT"===l||void 0;if(d&&u){try{t.nextSibling||t.previousSibling||(null===(r=t.parentNode.sheet)||void 0===r?void 0:r.cssRules)&&(u=s(t.parentNode.sheet))}catch(e){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${e}`,t)}u=v(u,D())}m&&(u="SCRIPT_PLACEHOLDER");!d&&!m&&u&&F(t,o,i)&&(u=a?a(u,t.parentElement):u.replace(/[\S]/g,"*"));return{type:e.Text,textContent:u||"",isStyle:d,rootId:c}}(t,{maskTextClass:c,maskTextSelector:l,maskTextFn:h,rootId:E});case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:E};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:E};default:return!1}}function U(e){return null==e?"":e.toLowerCase()}function W(o,s){const{doc:i,mirror:a,blockClass:c,blockSelector:l,maskTextClass:u,maskTextSelector:d,skipChild:m=!1,inlineStylesheet:p=!0,maskInputOptions:f={},maskTextFn:h,maskInputFn:g,slimDOMOptions:y,dataURLOptions:b={},inlineImages:k=!1,recordCanvas:C=!1,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:x=5e3,onStylesheetLoad:N,stylesheetLoadTimeout:E=5e3,keepIframeSrcFn:v=(()=>!1),newlyAddedElement:I=!1}=s;let{preserveWhiteSpace:L=!0}=s;const M=$(o,{doc:i,mirror:a,blockClass:c,blockSelector:l,maskTextClass:u,maskTextSelector:d,inlineStylesheet:p,maskInputOptions:f,maskTextFn:h,maskInputFn:g,dataURLOptions:b,inlineImages:k,recordCanvas:C,keepIframeSrcFn:v,newlyAddedElement:I});if(!M)return console.warn(o,"not serialized"),null;let O;O=a.hasNode(o)?a.getId(o):!function(t,n){if(n.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(n.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===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(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(U(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===U(t.attributes.name)||"icon"===U(t.attributes.rel)||"apple-touch-icon"===U(t.attributes.rel)||"shortcut icon"===U(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&U(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(U(t.attributes.property).match(/^(og|twitter|fb):/)||U(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===U(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===U(t.attributes.name)||"googlebot"===U(t.attributes.name)||"bingbot"===U(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===U(t.attributes.name)||"generator"===U(t.attributes.name)||"framework"===U(t.attributes.name)||"publisher"===U(t.attributes.name)||"progid"===U(t.attributes.name)||U(t.attributes.property).match(/^article:/)||U(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===U(t.attributes.name)||"yandex-verification"===U(t.attributes.name)||"csrf-token"===U(t.attributes.name)||"p:domain_verify"===U(t.attributes.name)||"verify-v1"===U(t.attributes.name)||"verification"===U(t.attributes.name)||"shopify-checkout-api-token"===U(t.attributes.name)))return!0}}return!1}(M,y)&&(L||M.type!==e.Text||M.isStyle||M.textContent.replace(/^\s+|\s+$/gm,"").length)?T():-2;const D=Object.assign(M,{id:O});if(a.add(o,D),-2===O)return null;S&&S(o);let _=!m;if(D.type===e.Element){_=_&&!D.needBlock,delete D.needBlock;const e=o.shadowRoot;e&&r(e)&&(D.isShadowHost=!0)}if((D.type===e.Document||D.type===e.Element)&&_){y.headWhitespace&&D.type===e.Element&&"head"===D.tagName&&(L=!1);const n={doc:i,mirror:a,blockClass:c,blockSelector:l,maskTextClass:u,maskTextSelector:d,skipChild:m,inlineStylesheet:p,maskInputOptions:f,maskTextFn:h,maskInputFn:g,slimDOMOptions:y,dataURLOptions:b,inlineImages:k,recordCanvas:C,preserveWhiteSpace:L,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:x,onStylesheetLoad:N,stylesheetLoadTimeout:E,keepIframeSrcFn:v};for(const e of Array.from(o.childNodes)){const t=W(e,n);t&&D.childNodes.push(t)}if(t(o)&&o.shadowRoot)for(const e of Array.from(o.shadowRoot.childNodes)){const t=W(e,n);t&&(r(o.shadowRoot)&&(t.isShadow=!0),D.childNodes.push(t))}}return o.parentNode&&n(o.parentNode)&&r(o.parentNode)&&(D.isShadow=!0),D.type===e.Element&&"iframe"===D.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let o,s=!1;try{o=r.document.readyState}catch(e){return}if("complete"!==o){const r=setTimeout((()=>{s||(t(),s=!0)}),n);return void e.addEventListener("load",(()=>{clearTimeout(r),s=!0,t()}))}const i="about:blank";if(r.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(o,(()=>{const e=o.contentDocument;if(e&&w){const t=W(e,{doc:e,mirror:a,blockClass:c,blockSelector:l,maskTextClass:u,maskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:f,maskTextFn:h,maskInputFn:g,slimDOMOptions:y,dataURLOptions:b,inlineImages:k,recordCanvas:C,preserveWhiteSpace:L,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:x,onStylesheetLoad:N,stylesheetLoadTimeout:E,keepIframeSrcFn:v});t&&w(o,t)}}),x),D.type===e.Element&&"link"===D.tagName&&"stylesheet"===D.attributes.rel&&function(e,t,n){let r,o=!1;try{r=e.sheet}catch(e){return}if(r)return;const s=setTimeout((()=>{o||(t(),o=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(s),o=!0,t()}))}(o,(()=>{if(N){const e=W(o,{doc:i,mirror:a,blockClass:c,blockSelector:l,maskTextClass:u,maskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:f,maskTextFn:h,maskInputFn:g,slimDOMOptions:y,dataURLOptions:b,inlineImages:k,recordCanvas:C,preserveWhiteSpace:L,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:x,onStylesheetLoad:N,stylesheetLoadTimeout:E,keepIframeSrcFn:v});e&&N(o,e)}}),E),D}function j(e,t){const{mirror:n=new u,blockClass:r="rr-block",blockSelector:o=null,maskTextClass:s="rr-mask",maskTextSelector:i=null,inlineStylesheet:a=!0,inlineImages:c=!1,recordCanvas:l=!1,maskAllInputs:d=!1,maskTextFn:m,maskInputFn:p,slimDOM:f=!1,dataURLOptions:h,preserveWhiteSpace:g,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:k,onStylesheetLoad:T,stylesheetLoadTimeout:C,keepIframeSrcFn:S=(()=>!1)}=t||{};return W(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,maskTextClass:s,maskTextSelector:i,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===d?{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===d?{password:!0}:d,maskTextFn:m,maskInputFn:p,slimDOMOptions:!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===f,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===f?{}:f,dataURLOptions:h,inlineImages:c,recordCanvas:l,preserveWhiteSpace:g,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:k,onStylesheetLoad:T,stylesheetLoadTimeout:C,keepIframeSrcFn:S,newlyAddedElement:!1})}function B(t,n){!function t(r){n(r),r.type!==e.Document&&r.type!==e.Element||r.childNodes.forEach(t)}(t)}function P(){y=1}const G=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function H(e,t={}){let n=1,r=1;function o(e){const t=e.match(/\n/g);t&&(n+=t.length);const o=e.lastIndexOf("\n");r=-1===o?r+e.length:e.length-o}function s(){const e={line:n,column:r};return t=>(t.position=new i(e),p(),t)}class i{constructor(e){this.start=e,this.end={line:n,column:r},this.source=t.source}}i.prototype.content=e;const a=[];function c(o){const s=new Error(`${t.source||""}:${n}:${r}: ${o}`);if(s.reason=o,s.filename=t.source,s.line=n,s.column=r,s.source=e,!t.silent)throw s;a.push(s)}function l(){return m(/^{\s*/)}function u(){return m(/^}/)}function d(){let t;const n=[];for(p(),f(n);e.length&&"}"!==e.charAt(0)&&(t=x()||N());)t&&(n.push(t),f(n));return n}function m(t){const n=t.exec(e);if(!n)return;const r=n[0];return o(r),e=e.slice(r.length),n}function p(){m(/^\s*/)}function f(e=[]){let t;for(;t=h();)t&&e.push(t),t=h();return e}function h(){const t=s();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return c("End of comment missing");const i=e.slice(2,n-2);return r+=2,o(i),e=e.slice(n),r+=2,t({type:"comment",comment:i})}function g(){for(p();"}"==e[0];)c("extra closing bracket"),e=e.slice(1),p();const t=m(/^(("(?:\\"|[^"])*"|'(?:\\'|[^'])*'|[^{])+)/);if(!t)return;const n=t[0].trim().replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(e=>e.replace(/,/g,"")));return function(e){const t=[];let n="",r=0,o=0;for(const s of e)"("===s?r++:")"===s?r--:"["===s?o++:"]"===s&&o--,","===s&&0===r&&0===o?(t.push(n),n=""):n+=s;n&&t.push(n);return t}(n).map((e=>e.replace(/\u200C/g,",").trim()))}function y(){const e=s(),t=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;const n=z(t[0]);if(!m(/^:\s*/))return c("property missing ':'");const r=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:n.replace(G,""),value:r?z(r[0]).replace(G,""):""});return m(/^[;\s]*/),o}function b(){const e=[];if(!l())return c("missing '{'");let t;for(f(e);t=y();)!1!==t&&(e.push(t),f(e)),t=y();return u()?e:c("missing '}'")}function k(){let e;const t=[],n=s();for(;e=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),m(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const T=w("import"),C=w("charset"),S=w("namespace");function w(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return()=>{const n=s(),r=m(t);if(!r)return;const o={type:e};return o[e]=r[1].trim(),n(o)}}function x(){if("@"===e[0])return function(){const e=s();let t=m(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=m(/^([-\w]+)\s*/),!t)return c("@keyframes missing name");const r=t[1];if(!l())return c("@keyframes missing '{'");let o,i=f();for(;o=k();)i.push(o),i=i.concat(f());return u()?e({type:"keyframes",name:r,vendor:n,keyframes:i}):c("@keyframes missing '}'")}()||function(){const e=s(),t=m(/^@media *([^{]+)/);if(!t)return;const n=z(t[1]);if(!l())return c("@media missing '{'");const r=f().concat(d());return u()?e({type:"media",media:n,rules:r}):c("@media missing '}'")}()||function(){const e=s(),t=m(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:z(t[1]),media:z(t[2])})}()||function(){const e=s(),t=m(/^@supports *([^{]+)/);if(!t)return;const n=z(t[1]);if(!l())return c("@supports missing '{'");const r=f().concat(d());return u()?e({type:"supports",supports:n,rules:r}):c("@supports missing '}'")}()||T()||C()||S()||function(){const e=s(),t=m(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=z(t[1]),r=z(t[2]);if(!l())return c("@document missing '{'");const o=f().concat(d());return u()?e({type:"document",document:r,vendor:n,rules:o}):c("@document missing '}'")}()||function(){const e=s();if(!m(/^@page */))return;const t=g()||[];if(!l())return c("@page missing '{'");let n,r=f();for(;n=y();)r.push(n),r=r.concat(f());return u()?e({type:"page",selectors:t,declarations:r}):c("@page missing '}'")}()||function(){const e=s();if(!m(/^@host\s*/))return;if(!l())return c("@host missing '{'");const t=f().concat(d());return u()?e({type:"host",rules:t}):c("@host missing '}'")}()||function(){const e=s();if(!m(/^@font-face\s*/))return;if(!l())return c("@font-face missing '{'");let t,n=f();for(;t=y();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):c("@font-face missing '}'")}()}function N(){const e=s(),t=g();return t?(f(),e({type:"rule",selectors:t,declarations:b()})):c("selector missing")}return V(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function z(e){return e?e.replace(/^\s+|\s+$/g,""):""}function V(e,t){const n=e&&"string"==typeof e.type,r=n?e:t;for(const t of Object.keys(e)){const n=e[t];Array.isArray(n)?n.forEach((e=>{V(e,r)})):n&&"object"==typeof n&&V(n,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}const q={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"};const Y=/([^\\]):hover/,J=new RegExp(Y.source,"g");function X(e,t){const n=null==t?void 0:t.stylesWithHoverClass.get(e);if(n)return n;const r=H(e,{silent:!0});if(!r.stylesheet)return e;const o=[];if(r.stylesheet.rules.forEach((e=>{"selectors"in e&&(e.selectors||[]).forEach((e=>{Y.test(e)&&o.push(e)}))})),0===o.length)return e;const s=new RegExp(o.filter(((e,t)=>o.indexOf(e)===t)).sort(((e,t)=>t.length-e.length)).map((e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))).join("|"),"g"),i=e.replace(s,(e=>{const t=e.replace(J,"$1.\\:hover");return`${e}, ${t}`}));return null==t||t.stylesWithHoverClass.set(e,i),i}function K(){return{stylesWithHoverClass:new Map}}function Q(t,n){const{doc:r,hackCss:o,cache:s}=n;switch(t.type){case e.Document:return r.implementation.createDocument(null,"",null);case e.DocumentType:return r.implementation.createDocumentType(t.name||"html",t.publicId,t.systemId);case e.Element:{const e=function(e){let t=q[e.tagName]?q[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(t);let n;n=t.isSVG?r.createElementNS("http://www.w3.org/2000/svg",e):r.createElement(e);const i={};for(const a in t.attributes){if(!Object.prototype.hasOwnProperty.call(t.attributes,a))continue;let c=t.attributes[a];if("option"===e&&"selected"===a&&!1===c)continue;if(null===c)continue;if(!0===c&&(c=""),a.startsWith("rr_")){i[a]=c;continue}const l="textarea"===e&&"value"===a,u="style"===e&&"_cssText"===a;if(u&&o&&"string"==typeof c&&(c=X(c,s)),!l&&!u||"string"!=typeof c)try{if(t.isSVG&&"xlink:href"===a)n.setAttributeNS("http://www.w3.org/1999/xlink",a,c.toString());else if("onload"===a||"onclick"===a||"onmouse"===a.substring(0,7))n.setAttribute("_"+a,c.toString());else{if("meta"===e&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"===a){n.setAttribute("csp-content",c.toString());continue}("link"!==e||"preload"!==t.attributes.rel&&"modulepreload"!==t.attributes.rel||"script"!==t.attributes.as)&&("link"===e&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")||("img"===e&&t.attributes.srcset&&t.attributes.rr_dataURL?n.setAttribute("rrweb-original-srcset",t.attributes.srcset):n.setAttribute(a,c.toString())))}}catch(e){}else{const e=r.createTextNode(c);for(const e of Array.from(n.childNodes))e.nodeType===n.TEXT_NODE&&n.removeChild(e);n.appendChild(e)}}for(const r in i){const o=i[r];if("canvas"===e&&"rr_dataURL"===r){const e=document.createElement("img");e.onload=()=>{const t=n.getContext("2d");t&&t.drawImage(e,0,0,e.width,e.height)},e.src=o.toString(),n.RRNodeType&&(n.rr_dataURL=o.toString())}else if("img"===e&&"rr_dataURL"===r){const e=n;e.currentSrc.startsWith("data:")||(e.setAttribute("rrweb-original-src",t.attributes.src),e.src=o.toString())}if("rr_width"===r)n.style.width=o.toString();else if("rr_height"===r)n.style.height=o.toString();else if("rr_mediaCurrentTime"===r&&"number"==typeof o)n.currentTime=o;else if("rr_mediaState"===r)switch(o){case"played":n.play().catch((e=>console.warn("media playback error",e)));break;case"paused":n.pause()}}if(t.isShadowHost)if(n.shadowRoot)for(;n.shadowRoot.firstChild;)n.shadowRoot.removeChild(n.shadowRoot.firstChild);else n.attachShadow({mode:"open"});return n}case e.Text:return r.createTextNode(t.isStyle&&o?X(t.textContent,s):t.textContent);case e.CDATA:return r.createCDATASection(t.textContent);case e.Comment:return r.createComment(t.textContent);default:return null}}function Z(n,r){const{doc:o,mirror:s,skipChild:i=!1,hackCss:a=!0,afterAppend:c,cache:l}=r;if(s.has(n.id)){const e=s.getNode(n.id);if(h(s.getMeta(e),n))return s.getNode(n.id)}let u=Q(n,{doc:o,hackCss:a,cache:l});if(!u)return null;if(n.rootId&&s.getNode(n.rootId)!==o&&s.replace(n.rootId,o),n.type===e.Document&&(o.close(),o.open(),"BackCompat"===n.compatMode&&n.childNodes&&n.childNodes[0].type!==e.DocumentType&&(n.childNodes[0].type===e.Element&&"xmlns"in n.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===n.childNodes[0].attributes.xmlns?o.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):o.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=o),s.add(u,n),(n.type===e.Document||n.type===e.Element)&&!i)for(const r of n.childNodes){const i=Z(r,{doc:o,mirror:s,skipChild:!1,hackCss:a,afterAppend:c,cache:l});if(i){if(r.isShadow&&t(u)&&u.shadowRoot)u.shadowRoot.appendChild(i);else if(n.type===e.Document&&r.type==e.Element){const e=i;let t=null;e.childNodes.forEach((e=>{"BODY"===e.nodeName&&(t=e)})),t?(e.removeChild(t),u.appendChild(i),e.appendChild(t)):u.appendChild(i)}else u.appendChild(i);c&&c(i,r.id)}else console.warn("Failed to rebuild",r)}return u}function ee(t,n){const{doc:r,onVisit:o,hackCss:s=!0,afterAppend:i,cache:a,mirror:c=new u}=n,l=Z(t,{doc:r,mirror:c,skipChild:!1,hackCss:s,afterAppend:i,cache:a});return function(e,t){for(const r of e.getIds())e.has(r)&&(n=e.getNode(r),t(n));var n}(c,(t=>{o&&o(t),function(t,n){const r=n.getMeta(t);if((null==r?void 0:r.type)!==e.Element)return;const o=t;for(const e in r.attributes){if(!Object.prototype.hasOwnProperty.call(r.attributes,e)||!e.startsWith("rr_"))continue;const t=r.attributes[e];"rr_scrollLeft"===e&&(o.scrollLeft=t),"rr_scrollTop"===e&&(o.scrollTop=t)}}(t,c)})),l}export{k as IGNORED_NODE,u as Mirror,e as NodeType,X as addHoverClass,Z as buildNodeWithSN,R as classMatchesRegex,P as cleanupSnapshot,K as createCache,d as createMirror,o as escapeImportStatement,a as fixSafariColons,T as genId,g as getInputType,A as ignoreAttribute,f as is2DCanvasBlank,c as isCSSImportRule,l as isCSSStyleRule,t as isElement,r as isNativeShadowDom,h as isNodeMetaEqual,n as isShadowRoot,m as maskInputValue,F as needMaskingText,ee as rebuild,W as serializeNodeWithId,j as snapshot,i as stringifyRule,s as stringifyStylesheet,p as toLowerCase,_ as transformAttribute,B as visitSnapshot}; | ||
//# sourceMappingURL=rrweb-snapshot.min.js.map |
{ | ||
"name": "@amplitude/rrweb-snapshot", | ||
"version": "2.0.0-alpha.14", | ||
"version": "2.0.0-alpha.15", | ||
"description": "rrweb's component to take a snapshot of DOM, aka DOM serializer", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6474
276611