New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@sentry-internal/rrweb-snapshot

Package Overview
Dependencies
Maintainers
0
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sentry-internal/rrweb-snapshot - npm Package Compare versions

Comparing version 2.27.0 to 2.28.0

2

dist/rrweb-snapshot.min.js

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

var rrwebSnapshot=function(e){"use strict";var t;function n(e){return e.nodeType===e.ELEMENT_NODE}function r(e){const t=e?.host;return Boolean(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 a(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(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t):null}catch(e){return null}var t}function i(e){let t;if(l(e))try{t=a(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){if(!e)return-1;const t=this.getMeta(e)?.id;return t??-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 m({maskInputOptions:e,tagName:t,type:n}){return"OPTION"===t&&(t="SELECT"),Boolean(e[t.toLowerCase()]||n&&e[n]||"password"===n||"INPUT"===t&&!n&&e.text)}function p({isMasked:e,element:t,value:n,maskInputFn:r}){let o=n||"";return e?(r&&(o=r(o,t)),"*".repeat(o.length)):o}function f(e){return e.toLowerCase()}function h(e){return e.toUpperCase()}const y="__rrweb_original__";function g(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=y in o?o[y]: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 k(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 T(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?f(t):null}function b(e,t,n){return"INPUT"!==t||"radio"!==n&&"checkbox"!==n?e.value:e.getAttribute("value")||""}function N(e,t){let n;try{n=new URL(e,t??window.location.href)}catch(e){return null}const r=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return r?.[1]??null}const S={};function x(e){const t=S[e];if(t)return t;const n=window.document;let r=window[e];if(n&&"function"==typeof n.createElement)try{const t=n.createElement("iframe");t.hidden=!0,n.head.appendChild(t);const o=t.contentWindow;o&&o[e]&&(r=o[e]),n.head.removeChild(t)}catch(e){}return S[e]=r.bind(window)}function C(...e){return x("setTimeout")(...e)}function w(...e){return x("clearTimeout")(...e)}let E=1;const I=new RegExp("[^a-z0-9-_:]"),v=-2;function M(){return E++}let L,A;const O=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,D=/^(?:[a-z+]+:)?\/\//i,F=/^www\..*/i,R=/^(data:)([^,]*),(.*)/i;function _(e,t){return(e||"").replace(O,((e,n,r,o,s,a)=>{const i=r||s||a,c=n||o||"";if(!i)return e;if(D.test(i)||F.test(i))return`url(${c}${i}${c})`;if(R.test(i))return`url(${c}${i}${c})`;if("/"===i[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)+i}${c})`;const l=t.split("/"),u=i.split("/");l.pop();for(const e of u)"."!==e&&(".."===e?l.pop():l.push(e));return`url(${c}${l.join("/")}${c})`}))}const $=/^[^ \t\n\r\u000c]+/,U=/^[, \t\n\r\u000c]+/;const W=new WeakMap;function P(e,t){return t&&""!==t.trim()?B(e,t):t}function j(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function B(e,t){let n=W.get(e);if(n||(n=e.createElement("a"),W.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function V(e,t,n,r,o,s){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?P(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(U),!(n>=t.length);){let s=r($);if(","===s.slice(-1))s=P(e,s.substring(0,s.length-1)),o.push(s);else{let r="";s=P(e,s);let a=!1;for(;;){const e=t.charAt(n);if(""===e){o.push((s+r).trim());break}if(a)")"===e&&(a=!1);else{if(","===e){n+=1,o.push((s+r).trim());break}"("===e&&(a=!0)}r+=e,n+=1}}}return o.join(", ")}(e,r):"style"===n?_(r,B(e)):"object"===t&&"data"===n?P(e,r):"function"==typeof s?s(n,r,o):r:P(e,r):r}function G(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function H(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function z(e,t,n=1/0,r=0){return e?e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:z(e.parentNode,t,n,r+1):-1}function q(e,t){return n=>{const r=n;if(null===r)return!1;try{if(e)if("string"==typeof e){if(r.matches(`.${e}`))return!0}else if(H(r,e))return!0;return!(!t||!r.matches(t))}catch{return!1}}}function Y(e,t,n,r,o,s){try{const a=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===a)return!1;if("INPUT"===a.tagName){const e=a.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(e))return!0}let i=-1,c=-1;if(s){if(c=z(a,q(r,o)),c<0)return!0;i=z(a,q(t,n),c>=0?c:1/0)}else{if(i=z(a,q(t,n)),i<0)return!1;c=z(a,q(r,o),i>=0?i:1/0)}return i>=0?!(c>=0)||i<=c:!(c>=0)&&!!s}catch(e){}return!!s}function X(t,n){const{doc:r,mirror:o,blockClass:s,blockSelector:i,unblockSelector:c,maskAllText:l,maskAttributeFn:u,maskTextClass:d,unmaskTextClass:y,maskTextSelector:k,unmaskTextSelector:N,inlineStylesheet:S,maskInputOptions:x={},maskTextFn:C,maskInputFn:w,dataURLOptions:E={},inlineImages:v,recordCanvas:M,keepIframeSrcFn:O,newlyAddedElement:D=!1}=n,F=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:F};case t.ELEMENT_NODE:return function(t,n){const{doc:r,blockClass:o,blockSelector:s,unblockSelector:i,inlineStylesheet:c,maskInputOptions:l={},maskAttributeFn:u,maskInputFn:d,dataURLOptions:y={},inlineImages:k,recordCanvas:N,keepIframeSrcFn:S,newlyAddedElement:x=!1,rootId:C,maskAllText:w,maskTextClass:E,unmaskTextClass:v,maskTextSelector:M,unmaskTextSelector:O}=n,D=function(e,t,n,r){try{if(r&&e.matches(r))return!1;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,i),F=function(e){if(e instanceof HTMLFormElement)return"form";const t=f(e.tagName);return I.test(t)?"div":t}(t);let R={};const $=t.attributes.length;for(let e=0;e<$;e++){const n=t.attributes[e];n.name&&!G(F,n.name,n.value)&&(R[n.name]=V(r,F,f(n.name),n.value,t,u))}if("link"===F&&c){const e=Array.from(r.styleSheets).find((e=>e.href===t.href));let n=null;e&&(n=a(e)),n&&(delete R.rel,delete R.href,R._cssText=_(n,e.href))}if("style"===F&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){const e=a(t.sheet);e&&(R._cssText=_(e,B(r)))}if("input"===F||"textarea"===F||"select"===F||"option"===F){const e=t,n=T(e),r=b(e,h(F),n),o=e.checked;if("submit"!==n&&"button"!==n&&r){const t=Y(e,E,M,v,O,m({type:n,tagName:h(F),maskInputOptions:l}));R.value=p({isMasked:t,element:e,value:r,maskInputFn:d})}o&&(R.checked=o)}"option"===F&&(t.selected&&!l.select?R.selected=!0:delete R.selected);if("canvas"===F&&N)if("2d"===t.__context)g(t)||(R.rr_dataURL=t.toDataURL(y.type,y.quality));else if(!("__context"in t)){const e=t.toDataURL(y.type,y.quality),n=document.createElement("canvas");n.width=t.width,n.height=t.height;e!==n.toDataURL(y.type,y.quality)&&(R.rr_dataURL=e)}if("img"===F&&k){L||(L=r.createElement("canvas"),A=L.getContext("2d"));const e=t,n=e.crossOrigin;e.crossOrigin="anonymous";const o=()=>{e.removeEventListener("load",o);try{L.width=e.naturalWidth,L.height=e.naturalHeight,A.drawImage(e,0,0),R.rr_dataURL=L.toDataURL(y.type,y.quality)}catch(t){console.warn(`Cannot inline img src=${e.currentSrc}! Error: ${t}`)}n?R.crossOrigin=n:e.removeAttribute("crossorigin")};e.complete&&0!==e.naturalWidth?o():e.addEventListener("load",o)}"audio"!==F&&"video"!==F||(R.rr_mediaState=t.paused?"paused":"played",R.rr_mediaCurrentTime=t.currentTime);x||(t.scrollLeft&&(R.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(R.rr_scrollTop=t.scrollTop));if(D){const{width:e,height:n}=t.getBoundingClientRect();R={class:R.class,rr_width:`${e}px`,rr_height:`${n}px`}}"iframe"!==F||S(R.src)||(D||t.contentDocument||(R.rr_src=R.src),delete R.src);let U;try{customElements.get(F)&&(U=!0)}catch(e){}return{type:e.NodeType.Element,tagName:F,attributes:R,childNodes:[],isSVG:j(t)||void 0,needBlock:D,rootId:C,isCustom:U}}(t,{doc:r,blockClass:s,blockSelector:i,unblockSelector:c,inlineStylesheet:S,maskAttributeFn:u,maskInputOptions:x,maskInputFn:w,dataURLOptions:E,inlineImages:v,recordCanvas:M,keepIframeSrcFn:O,newlyAddedElement:D,rootId:F,maskAllText:l,maskTextClass:d,unmaskTextClass:y,maskTextSelector:k,unmaskTextSelector:N});case t.TEXT_NODE:return function(t,n){const{maskAllText:r,maskTextClass:o,unmaskTextClass:s,maskTextSelector:i,unmaskTextSelector:c,maskTextFn:l,maskInputOptions:u,maskInputFn:d,rootId:f}=n,h=t.parentNode&&t.parentNode.tagName;let y=t.textContent;const g="STYLE"===h||void 0,k="SCRIPT"===h||void 0,T="TEXTAREA"===h||void 0;if(g&&y){try{t.nextSibling||t.previousSibling||t.parentNode.sheet?.cssRules&&(y=a(t.parentNode.sheet))}catch(e){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${e}`,t)}y=_(y,B(n.doc))}k&&(y="SCRIPT_PLACEHOLDER");const b=Y(t,o,i,s,c,r);g||k||T||!y||!b||(y=l?l(y,t.parentElement):y.replace(/[\S]/g,"*"));T&&y&&(u.textarea||b)&&(y=d?d(y,t.parentNode):y.replace(/[\S]/g,"*"));if("OPTION"===h&&y){y=p({isMasked:Y(t,o,i,s,c,m({type:null,tagName:h,maskInputOptions:u})),element:t,value:y,maskInputFn:d})}return{type:e.NodeType.Text,textContent:y||"",isStyle:g,rootId:f}}(t,{doc:r,maskAllText:l,maskTextClass:d,unmaskTextClass:y,maskTextSelector:k,unmaskTextSelector:N,maskTextFn:C,maskInputOptions:x,maskInputFn:w,rootId:F});case t.CDATA_SECTION_NODE:return{type:e.NodeType.CDATA,textContent:"",rootId:F};case t.COMMENT_NODE:return{type:e.NodeType.Comment,textContent:t.textContent||"",rootId:F};default:return!1}}function J(e){return null==e?"":e.toLowerCase()}function K(t,s){const{doc:a,mirror:i,blockClass:c,blockSelector:l,unblockSelector:u,maskAllText:d,maskTextClass:m,unmaskTextClass:p,maskTextSelector:f,unmaskTextSelector:h,skipChild:y=!1,inlineStylesheet:g=!0,maskInputOptions:k={},maskAttributeFn:T,maskTextFn:b,maskInputFn:S,slimDOMOptions:x,dataURLOptions:E={},inlineImages:I=!1,recordCanvas:L=!1,onSerialize:A,onIframeLoad:O,iframeLoadTimeout:D=5e3,onStylesheetLoad:F,stylesheetLoadTimeout:R=5e3,keepIframeSrcFn:_=(()=>!1),newlyAddedElement:$=!1}=s;let{preserveWhiteSpace:U=!0}=s;const W=X(t,{doc:a,mirror:i,blockClass:c,blockSelector:l,maskAllText:d,unblockSelector:u,maskTextClass:m,unmaskTextClass:p,maskTextSelector:f,unmaskTextSelector:h,inlineStylesheet:g,maskInputOptions:k,maskAttributeFn:T,maskTextFn:b,maskInputFn:S,dataURLOptions:E,inlineImages:I,recordCanvas:L,keepIframeSrcFn:_,newlyAddedElement:$});if(!W)return console.warn(t,"not serialized"),null;let P;P=i.hasNode(t)?i.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&&"js"===N(t.attributes.href)))return!0;if(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(J(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===J(t.attributes.name)||"icon"===J(t.attributes.rel)||"apple-touch-icon"===J(t.attributes.rel)||"shortcut icon"===J(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&J(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(J(t.attributes.property).match(/^(og|twitter|fb):/)||J(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===J(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===J(t.attributes.name)||"googlebot"===J(t.attributes.name)||"bingbot"===J(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===J(t.attributes.name)||"generator"===J(t.attributes.name)||"framework"===J(t.attributes.name)||"publisher"===J(t.attributes.name)||"progid"===J(t.attributes.name)||J(t.attributes.property).match(/^article:/)||J(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===J(t.attributes.name)||"yandex-verification"===J(t.attributes.name)||"csrf-token"===J(t.attributes.name)||"p:domain_verify"===J(t.attributes.name)||"verify-v1"===J(t.attributes.name)||"verification"===J(t.attributes.name)||"shopify-checkout-api-token"===J(t.attributes.name)))return!0}}return!1}(W,x)&&(U||W.type!==e.NodeType.Text||W.isStyle||W.textContent.replace(/^\s+|\s+$/gm,"").length)?M():v;const j=Object.assign(W,{id:P});if(i.add(t,j),P===v)return null;A&&A(t);let B=!y;if(j.type===e.NodeType.Element){B=B&&!j.needBlock,delete j.needBlock;const e=t.shadowRoot;e&&o(e)&&(j.isShadowHost=!0)}if((j.type===e.NodeType.Document||j.type===e.NodeType.Element)&&B){x.headWhitespace&&j.type===e.NodeType.Element&&"head"===j.tagName&&(U=!1);const r={doc:a,mirror:i,blockClass:c,blockSelector:l,maskAllText:d,unblockSelector:u,maskTextClass:m,unmaskTextClass:p,maskTextSelector:f,unmaskTextSelector:h,skipChild:y,inlineStylesheet:g,maskInputOptions:k,maskAttributeFn:T,maskTextFn:b,maskInputFn:S,slimDOMOptions:x,dataURLOptions:E,inlineImages:I,recordCanvas:L,preserveWhiteSpace:U,onSerialize:A,onIframeLoad:O,iframeLoadTimeout:D,onStylesheetLoad:F,stylesheetLoadTimeout:R,keepIframeSrcFn:_};for(const e of Array.from(t.childNodes)){const t=K(e,r);t&&j.childNodes.push(t)}if(n(t)&&t.shadowRoot)for(const e of Array.from(t.shadowRoot.childNodes)){const n=K(e,r);n&&(o(t.shadowRoot)&&(n.isShadow=!0),j.childNodes.push(n))}}return t.parentNode&&r(t.parentNode)&&o(t.parentNode)&&(j.isShadow=!0),j.type===e.NodeType.Element&&"iframe"===j.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=C((()=>{s||(t(),s=!0)}),n);return void e.addEventListener("load",(()=>{w(r),s=!0,t()}))}const a="about:blank";if(r.location.href!==a||e.src===a||""===e.src)return C(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(t,(()=>{const e=t.contentDocument;if(e&&O){const n=K(e,{doc:e,mirror:i,blockClass:c,blockSelector:l,unblockSelector:u,maskAllText:d,maskTextClass:m,unmaskTextClass:p,maskTextSelector:f,unmaskTextSelector:h,skipChild:!1,inlineStylesheet:g,maskInputOptions:k,maskAttributeFn:T,maskTextFn:b,maskInputFn:S,slimDOMOptions:x,dataURLOptions:E,inlineImages:I,recordCanvas:L,preserveWhiteSpace:U,onSerialize:A,onIframeLoad:O,iframeLoadTimeout:D,onStylesheetLoad:F,stylesheetLoadTimeout:R,keepIframeSrcFn:_});n&&O(t,n)}}),D),j.type===e.NodeType.Element&&"link"===j.tagName&&"string"==typeof j.attributes.rel&&("stylesheet"===j.attributes.rel||"preload"===j.attributes.rel&&"string"==typeof j.attributes.href&&"css"===N(j.attributes.href))&&function(e,t,n){let r,o=!1;try{r=e.sheet}catch(e){return}if(r)return;const s=C((()=>{o||(t(),o=!0)}),n);e.addEventListener("load",(()=>{w(s),o=!0,t()}))}(t,(()=>{if(F){const e=K(t,{doc:a,mirror:i,blockClass:c,blockSelector:l,unblockSelector:u,maskAllText:d,maskTextClass:m,unmaskTextClass:p,maskTextSelector:f,unmaskTextSelector:h,skipChild:!1,inlineStylesheet:g,maskInputOptions:k,maskAttributeFn:T,maskTextFn:b,maskInputFn:S,slimDOMOptions:x,dataURLOptions:E,inlineImages:I,recordCanvas:L,preserveWhiteSpace:U,onSerialize:A,onIframeLoad:O,iframeLoadTimeout:D,onStylesheetLoad:F,stylesheetLoadTimeout:R,keepIframeSrcFn:_});e&&F(t,e)}}),R),j}const Q=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Z(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 a(e),p(),t)}class a{constructor(e){this.start=e,this.end={line:n,column:r},this.source=t.source}}a.prototype.content=e;const i=[];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;i.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=C()||w());)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 a=e.slice(2,n-2);return r+=2,o(a),e=e.slice(n),r+=2,t({type:"comment",comment:a})}function y(){const e=m(/^([^{]+)/);if(!e)return;const t=ee(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(e=>e.replace(/,/g,"‌"))).split(/\s*(?![^(]*\)),\s*/);if(t.length<=1)return t.map((e=>e.replace(/\u200C/g,",")));let n=0,r=0;const o=t.length,s=[];for(;n<o;){let e=(t[n].match(/\(/g)||[]).length-(t[n].match(/\)/g)||[]).length;if(e>=1){let a=!1;for(r=n+1;r<o;){const o=(t[r].match(/\(/g)||[]).length,i=(t[r].match(/\)/g)||[]).length-o;if(i===e){s.push(t.slice(n,r+1).join(",")),n=r+1,a=!0;break}r++,e-=i}if(a)continue;t.slice(n,o).forEach((e=>e&&s.push(e)));break}t[n]&&s.push(t[n]),n++}return s.map((e=>e.replace(/\u200C/g,",")))}function g(){const e=s(),t=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;const n=ee(t[0]);if(!m(/^:\s*/))return c("property missing ':'");const r=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:n.replace(Q,""),value:r?ee(r[0]).replace(Q,""):""});return m(/^[;\s]*/),o}function k(){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 T(){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:k()})}const b=x("import"),N=x("charset"),S=x("namespace");function x(e){const t=new RegExp("^@"+e+"\\s*((?:"+['(?<!\\\\)"(?:\\\\"|[^"])*"',"(?<!\\\\)'(?:\\\\'|[^'])*'","[^;]"].join("|")+")+);");return()=>{const n=s(),r=m(t);if(!r)return;const o={type:e};return o[e]=r[1].trim(),n(o)}}function C(){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,a=f();for(;o=T();)a.push(o),a=a.concat(f());return u()?e({type:"keyframes",name:r,vendor:n,keyframes:a}):c("@keyframes missing '}'")}()||function(){const e=s(),t=m(/^@media *([^{]+)/);if(!t)return;const n=ee(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:ee(t[1]),media:ee(t[2])})}()||function(){const e=s(),t=m(/^@supports *([^{]+)/);if(!t)return;const n=ee(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 '}'")}()||b()||N()||S()||function(){const e=s(),t=m(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=ee(t[1]),r=ee(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=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(!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=g();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):c("@font-face missing '}'")}()}function w(){const e=s(),t=y();return t?(f(),e({type:"rule",selectors:t,declarations:k()})):c("selector missing")}return te(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:i}}}())}function ee(e){return e?e.replace(/^\s+|\s+$/g,""):""}function te(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=>{te(e,r)})):n&&"object"==typeof n&&te(n,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}const ne={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 re=/([^\\]):hover/,oe=new RegExp(re.source,"g");function se(e,t){const n=t?.stylesWithHoverClass.get(e);if(n)return n;if(e.length>=1e6)return e;const r=Z(e,{silent:!0});if(!r.stylesheet)return e;const o=[];if(r.stylesheet.rules.forEach((e=>{"selectors"in e&&(e.selectors||[]).forEach((e=>{re.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"),a=e.replace(s,(e=>{const t=e.replace(oe,"$1.\\:hover");return`${e}, ${t}`}));return t?.stylesWithHoverClass.set(e,a),a}function ae(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=ne[e.tagName]?ne[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(t);let n;t.isSVG?n=r.createElementNS("http://www.w3.org/2000/svg",e):(t.isCustom&&r.defaultView?.customElements&&!r.defaultView.customElements.get(t.tagName)&&r.defaultView.customElements.define(t.tagName,class extends r.defaultView.HTMLElement{}),n=r.createElement(e));const a={};for(const i in t.attributes){if(!Object.prototype.hasOwnProperty.call(t.attributes,i))continue;let c=t.attributes[i];if("option"===e&&"selected"===i&&!1===c)continue;if(null===c)continue;if(!0===c&&(c=""),i.startsWith("rr_")){a[i]=c;continue}const l="textarea"===e&&"value"===i,u="style"===e&&"_cssText"===i;if(u&&o&&"string"==typeof c&&(c=se(c,s)),!l&&!u||"string"!=typeof c)try{if(t.isSVG&&"xlink:href"===i)n.setAttributeNS("http://www.w3.org/1999/xlink",i,c.toString());else if("onload"===i||"onclick"===i||"onmouse"===i.substring(0,7))n.setAttribute("_"+i,c.toString());else{if("meta"===e&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"===i){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(i,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 a){const o=a[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.setProperty("width",o.toString());else if("rr_height"===r)n.style.setProperty("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?se(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 ie(t,r){const{doc:o,mirror:s,skipChild:a=!1,hackCss:i=!0,afterAppend:c,cache:l}=r;if(s.has(t.id)){const e=s.getNode(t.id);if(k(s.getMeta(e),t))return s.getNode(t.id)}let u=ae(t,{doc:o,hackCss:i,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)&&!a)for(const r of t.childNodes){const a=ie(r,{doc:o,mirror:s,skipChild:!1,hackCss:i,afterAppend:c,cache:l});if(a){if(r.isShadow&&n(u)&&u.shadowRoot)u.shadowRoot.appendChild(a);else if(t.type===e.NodeType.Document&&r.type==e.NodeType.Element){const e=a;let t=null;e.childNodes.forEach((e=>{"BODY"===e.nodeName&&(t=e)})),t?(e.removeChild(t),u.appendChild(a),e.appendChild(t)):u.appendChild(a)}else u.appendChild(a);c&&c(a,r.id)}else console.warn("Failed to rebuild",r)}return u}return e.IGNORED_NODE=v,e.Mirror=d,e.addHoverClass=se,e.buildNodeWithSN=ie,e.classMatchesRegex=function(e,t,n){return!!e&&(n?z(e,(e=>H(e,t)))>=0:e.nodeType===e.ELEMENT_NODE&&H(e,t))},e.cleanupSnapshot=function(){E=1},e.clearTimeout=w,e.createCache=function(){return{stylesWithHoverClass:new Map}},e.createMatchPredicate=q,e.createMirror=function(){return new d},e.distanceToMatch=z,e.escapeImportStatement=s,e.extractFileExtension=N,e.fixSafariColons=c,e.genId=M,e.getInputType=T,e.getInputValue=b,e.ignoreAttribute=G,e.is2DCanvasBlank=g,e.isCSSImportRule=l,e.isCSSStyleRule=u,e.isElement=n,e.isNativeShadowDom=o,e.isNodeMetaEqual=k,e.isShadowRoot=r,e.maskInputValue=p,e.needMaskingText=Y,e.onRequestAnimationFrame=function(...e){return x("requestAnimationFrame")(...e)},e.rebuild=function(t,n){const{doc:r,onVisit:o,hackCss:s=!0,afterAppend:a,cache:i,mirror:c=new d}=n,l=ie(t,{doc:r,mirror:c,skipChild:!1,hackCss:s,afterAppend:a,cache:i});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(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=K,e.setTimeout=C,e.shouldMaskInput=m,e.snapshot=function(e,t){const{mirror:n=new d,blockClass:r="rr-block",blockSelector:o=null,unblockSelector:s=null,maskAllText:a=!1,maskTextClass:i="rr-mask",unmaskTextClass:c=null,maskTextSelector:l=null,unmaskTextSelector:u=null,inlineStylesheet:m=!0,inlineImages:p=!1,recordCanvas:f=!1,maskAllInputs:h=!1,maskAttributeFn:y,maskTextFn:g,maskInputFn:k,slimDOM:T=!1,dataURLOptions:b,preserveWhiteSpace:N,onSerialize:S,onIframeLoad:x,iframeLoadTimeout:C,onStylesheetLoad:w,stylesheetLoadTimeout:E,keepIframeSrcFn:I=(()=>!1)}=t||{};return K(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,maskAllText:a,maskTextClass:i,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:m,maskInputOptions:!0===h?{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}:!1===h?{}:h,maskAttributeFn:y,maskTextFn:g,maskInputFn:k,slimDOMOptions:!0===T||"all"===T?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===T,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===T?{}:T,dataURLOptions:b,inlineImages:p,recordCanvas:f,preserveWhiteSpace:N,onSerialize:S,onIframeLoad:x,iframeLoadTimeout:C,onStylesheetLoad:w,stylesheetLoadTimeout:E,keepIframeSrcFn:I,newlyAddedElement:!1})},e.stringifyRule=i,e.stringifyStylesheet=a,e.toLowerCase=f,e.toUpperCase=h,e.transformAttribute=V,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}({});
var rrwebSnapshot=function(e){"use strict";var t;function n(e){return e.nodeType===e.ELEMENT_NODE}function r(e){const t=e?.host;return Boolean(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 a(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(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t):null}catch(e){return null}var t}function i(e){let t;if(l(e))try{t=a(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){if(!e)return-1;const t=this.getMeta(e)?.id;return t??-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 m({maskInputOptions:e,tagName:t,type:n}){return"OPTION"===t&&(t="SELECT"),Boolean(e[t.toLowerCase()]||n&&e[n]||"password"===n||"INPUT"===t&&!n&&e.text)}function p({isMasked:e,element:t,value:n,maskInputFn:r}){let o=n||"";return e?(r&&(o=r(o,t)),"*".repeat(o.length)):o}function f(e){return e.toLowerCase()}function h(e){return e.toUpperCase()}const y="__rrweb_original__";function g(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=y in o?o[y]: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 k(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 T(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?f(t):null}function b(e,t,n){return"INPUT"!==t||"radio"!==n&&"checkbox"!==n?e.value:e.getAttribute("value")||""}function N(e,t){let n;try{n=new URL(e,t??window.location.href)}catch(e){return null}const r=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return r?.[1]??null}const S={};function x(e){const t=S[e];if(t)return t;const n=window.document;let r=window[e];if(n&&"function"==typeof n.createElement)try{const t=n.createElement("iframe");t.hidden=!0,n.head.appendChild(t);const o=t.contentWindow;o&&o[e]&&(r=o[e]),n.head.removeChild(t)}catch(e){}return S[e]=r.bind(window)}function C(...e){return x("setTimeout")(...e)}function w(...e){return x("clearTimeout")(...e)}let E=1;const I=new RegExp("[^a-z0-9-_:]"),v=-2;function M(){return E++}let L,A;const O=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,D=/^(?:[a-z+]+:)?\/\//i,F=/^www\..*/i,R=/^(data:)([^,]*),(.*)/i;function _(e,t){return(e||"").replace(O,((e,n,r,o,s,a)=>{const i=r||s||a,c=n||o||"";if(!i)return e;if(D.test(i)||F.test(i))return`url(${c}${i}${c})`;if(R.test(i))return`url(${c}${i}${c})`;if("/"===i[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)+i}${c})`;const l=t.split("/"),u=i.split("/");l.pop();for(const e of u)"."!==e&&(".."===e?l.pop():l.push(e));return`url(${c}${l.join("/")}${c})`}))}const $=/^[^ \t\n\r\u000c]+/,U=/^[, \t\n\r\u000c]+/;const W=new WeakMap;function P(e,t){return t&&""!==t.trim()?B(e,t):t}function j(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function B(e,t){let n=W.get(e);if(n||(n=e.createElement("a"),W.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function V(e,t,n,r,o,s){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?P(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(U),!(n>=t.length);){let s=r($);if(","===s.slice(-1))s=P(e,s.substring(0,s.length-1)),o.push(s);else{let r="";s=P(e,s);let a=!1;for(;;){const e=t.charAt(n);if(""===e){o.push((s+r).trim());break}if(a)")"===e&&(a=!1);else{if(","===e){n+=1,o.push((s+r).trim());break}"("===e&&(a=!0)}r+=e,n+=1}}}return o.join(", ")}(e,r):"style"===n?_(r,B(e)):"object"===t&&"data"===n?P(e,r):"function"==typeof s?s(n,r,o):r:P(e,r):r}function G(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function H(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function z(e,t,n=1/0,r=0){return e?e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:z(e.parentNode,t,n,r+1):-1}function q(e,t){return n=>{const r=n;if(null===r)return!1;try{if(e)if("string"==typeof e){if(r.matches(`.${e}`))return!0}else if(H(r,e))return!0;return!(!t||!r.matches(t))}catch{return!1}}}function Y(e,t,n,r,o,s){try{const a=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===a)return!1;if("INPUT"===a.tagName){const e=a.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(e))return!0}let i=-1,c=-1;if(s){if(c=z(a,q(r,o)),c<0)return!0;i=z(a,q(t,n),c>=0?c:1/0)}else{if(i=z(a,q(t,n)),i<0)return!1;c=z(a,q(r,o),i>=0?i:1/0)}return i>=0?!(c>=0)||i<=c:!(c>=0)&&!!s}catch(e){}return!!s}function X(t,n){const{doc:r,mirror:o,blockClass:s,blockSelector:i,unblockSelector:c,maskAllText:l,maskAttributeFn:u,maskTextClass:d,unmaskTextClass:y,maskTextSelector:k,unmaskTextSelector:N,inlineStylesheet:S,maskInputOptions:x={},maskTextFn:C,maskInputFn:w,dataURLOptions:E={},inlineImages:v,recordCanvas:M,keepIframeSrcFn:O,newlyAddedElement:D=!1}=n,F=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:F};case t.ELEMENT_NODE:return function(t,n){const{doc:r,blockClass:o,blockSelector:s,unblockSelector:i,inlineStylesheet:c,maskInputOptions:l={},maskAttributeFn:u,maskInputFn:d,dataURLOptions:y={},inlineImages:k,recordCanvas:N,keepIframeSrcFn:S,newlyAddedElement:x=!1,rootId:C,maskAllText:w,maskTextClass:E,unmaskTextClass:v,maskTextSelector:M,unmaskTextSelector:O}=n,D=function(e,t,n,r){try{if(r&&e.matches(r))return!1;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,i),F=function(e){if(e instanceof HTMLFormElement)return"form";const t=f(e.tagName);return I.test(t)?"div":t}(t);let R={};const $=t.attributes.length;for(let e=0;e<$;e++){const n=t.attributes[e];n.name&&!G(F,n.name,n.value)&&(R[n.name]=V(r,F,f(n.name),n.value,t,u))}if("link"===F&&c){const e=Array.from(r.styleSheets).find((e=>e.href===t.href));let n=null;e&&(n=a(e)),n&&(delete R.rel,delete R.href,R._cssText=_(n,e.href))}if("style"===F&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){const e=a(t.sheet);e&&(R._cssText=_(e,B(r)))}if("input"===F||"textarea"===F||"select"===F||"option"===F){const e=t,n=T(e),r=b(e,h(F),n),o=e.checked;if("submit"!==n&&"button"!==n&&r){const t=Y(e,E,M,v,O,m({type:n,tagName:h(F),maskInputOptions:l}));R.value=p({isMasked:t,element:e,value:r,maskInputFn:d})}o&&(R.checked=o)}"option"===F&&(t.selected&&!l.select?R.selected=!0:delete R.selected);if("canvas"===F&&N)if("2d"===t.__context)g(t)||(R.rr_dataURL=t.toDataURL(y.type,y.quality));else if(!("__context"in t)){const e=t.toDataURL(y.type,y.quality),n=r.createElement("canvas");n.width=t.width,n.height=t.height;e!==n.toDataURL(y.type,y.quality)&&(R.rr_dataURL=e)}if("img"===F&&k){L||(L=r.createElement("canvas"),A=L.getContext("2d"));const e=t,n=e.currentSrc||e.getAttribute("src")||"<unknown-src>",o=e.crossOrigin,s=()=>{e.removeEventListener("load",s);try{L.width=e.naturalWidth,L.height=e.naturalHeight,A.drawImage(e,0,0),R.rr_dataURL=L.toDataURL(y.type,y.quality)}catch(t){if("anonymous"!==e.crossOrigin)return e.crossOrigin="anonymous",void(e.complete&&0!==e.naturalWidth?s():e.addEventListener("load",s));console.warn(`Cannot inline img src=${n}! Error: ${t}`)}"anonymous"===e.crossOrigin&&(o?R.crossOrigin=o:e.removeAttribute("crossorigin"))};e.complete&&0!==e.naturalWidth?s():e.addEventListener("load",s)}"audio"!==F&&"video"!==F||(R.rr_mediaState=t.paused?"paused":"played",R.rr_mediaCurrentTime=t.currentTime);x||(t.scrollLeft&&(R.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(R.rr_scrollTop=t.scrollTop));if(D){const{width:e,height:n}=t.getBoundingClientRect();R={class:R.class,rr_width:`${e}px`,rr_height:`${n}px`}}"iframe"!==F||S(R.src)||(D||t.contentDocument||(R.rr_src=R.src),delete R.src);let U;try{customElements.get(F)&&(U=!0)}catch(e){}return{type:e.NodeType.Element,tagName:F,attributes:R,childNodes:[],isSVG:j(t)||void 0,needBlock:D,rootId:C,isCustom:U}}(t,{doc:r,blockClass:s,blockSelector:i,unblockSelector:c,inlineStylesheet:S,maskAttributeFn:u,maskInputOptions:x,maskInputFn:w,dataURLOptions:E,inlineImages:v,recordCanvas:M,keepIframeSrcFn:O,newlyAddedElement:D,rootId:F,maskAllText:l,maskTextClass:d,unmaskTextClass:y,maskTextSelector:k,unmaskTextSelector:N});case t.TEXT_NODE:return function(t,n){const{maskAllText:r,maskTextClass:o,unmaskTextClass:s,maskTextSelector:i,unmaskTextSelector:c,maskTextFn:l,maskInputOptions:u,maskInputFn:d,rootId:f}=n,h=t.parentNode&&t.parentNode.tagName;let y=t.textContent;const g="STYLE"===h||void 0,k="SCRIPT"===h||void 0,T="TEXTAREA"===h||void 0;if(g&&y){try{t.nextSibling||t.previousSibling||t.parentNode.sheet?.cssRules&&(y=a(t.parentNode.sheet))}catch(e){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${e}`,t)}y=_(y,B(n.doc))}k&&(y="SCRIPT_PLACEHOLDER");const b=Y(t,o,i,s,c,r);g||k||T||!y||!b||(y=l?l(y,t.parentElement):y.replace(/[\S]/g,"*"));T&&y&&(u.textarea||b)&&(y=d?d(y,t.parentNode):y.replace(/[\S]/g,"*"));if("OPTION"===h&&y){y=p({isMasked:Y(t,o,i,s,c,m({type:null,tagName:h,maskInputOptions:u})),element:t,value:y,maskInputFn:d})}return{type:e.NodeType.Text,textContent:y||"",isStyle:g,rootId:f}}(t,{doc:r,maskAllText:l,maskTextClass:d,unmaskTextClass:y,maskTextSelector:k,unmaskTextSelector:N,maskTextFn:C,maskInputOptions:x,maskInputFn:w,rootId:F});case t.CDATA_SECTION_NODE:return{type:e.NodeType.CDATA,textContent:"",rootId:F};case t.COMMENT_NODE:return{type:e.NodeType.Comment,textContent:t.textContent||"",rootId:F};default:return!1}}function J(e){return null==e?"":e.toLowerCase()}function K(t,s){const{doc:a,mirror:i,blockClass:c,blockSelector:l,unblockSelector:u,maskAllText:d,maskTextClass:m,unmaskTextClass:p,maskTextSelector:f,unmaskTextSelector:h,skipChild:y=!1,inlineStylesheet:g=!0,maskInputOptions:k={},maskAttributeFn:T,maskTextFn:b,maskInputFn:S,slimDOMOptions:x,dataURLOptions:E={},inlineImages:I=!1,recordCanvas:L=!1,onSerialize:A,onIframeLoad:O,iframeLoadTimeout:D=5e3,onStylesheetLoad:F,stylesheetLoadTimeout:R=5e3,keepIframeSrcFn:_=(()=>!1),newlyAddedElement:$=!1}=s;let{preserveWhiteSpace:U=!0}=s;const W=X(t,{doc:a,mirror:i,blockClass:c,blockSelector:l,maskAllText:d,unblockSelector:u,maskTextClass:m,unmaskTextClass:p,maskTextSelector:f,unmaskTextSelector:h,inlineStylesheet:g,maskInputOptions:k,maskAttributeFn:T,maskTextFn:b,maskInputFn:S,dataURLOptions:E,inlineImages:I,recordCanvas:L,keepIframeSrcFn:_,newlyAddedElement:$});if(!W)return console.warn(t,"not serialized"),null;let P;P=i.hasNode(t)?i.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&&"js"===N(t.attributes.href)))return!0;if(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(J(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===J(t.attributes.name)||"icon"===J(t.attributes.rel)||"apple-touch-icon"===J(t.attributes.rel)||"shortcut icon"===J(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&J(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(J(t.attributes.property).match(/^(og|twitter|fb):/)||J(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===J(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===J(t.attributes.name)||"googlebot"===J(t.attributes.name)||"bingbot"===J(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===J(t.attributes.name)||"generator"===J(t.attributes.name)||"framework"===J(t.attributes.name)||"publisher"===J(t.attributes.name)||"progid"===J(t.attributes.name)||J(t.attributes.property).match(/^article:/)||J(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===J(t.attributes.name)||"yandex-verification"===J(t.attributes.name)||"csrf-token"===J(t.attributes.name)||"p:domain_verify"===J(t.attributes.name)||"verify-v1"===J(t.attributes.name)||"verification"===J(t.attributes.name)||"shopify-checkout-api-token"===J(t.attributes.name)))return!0}}return!1}(W,x)&&(U||W.type!==e.NodeType.Text||W.isStyle||W.textContent.replace(/^\s+|\s+$/gm,"").length)?M():v;const j=Object.assign(W,{id:P});if(i.add(t,j),P===v)return null;A&&A(t);let B=!y;if(j.type===e.NodeType.Element){B=B&&!j.needBlock,delete j.needBlock;const e=t.shadowRoot;e&&o(e)&&(j.isShadowHost=!0)}if((j.type===e.NodeType.Document||j.type===e.NodeType.Element)&&B){x.headWhitespace&&j.type===e.NodeType.Element&&"head"===j.tagName&&(U=!1);const r={doc:a,mirror:i,blockClass:c,blockSelector:l,maskAllText:d,unblockSelector:u,maskTextClass:m,unmaskTextClass:p,maskTextSelector:f,unmaskTextSelector:h,skipChild:y,inlineStylesheet:g,maskInputOptions:k,maskAttributeFn:T,maskTextFn:b,maskInputFn:S,slimDOMOptions:x,dataURLOptions:E,inlineImages:I,recordCanvas:L,preserveWhiteSpace:U,onSerialize:A,onIframeLoad:O,iframeLoadTimeout:D,onStylesheetLoad:F,stylesheetLoadTimeout:R,keepIframeSrcFn:_};for(const e of Array.from(t.childNodes)){const t=K(e,r);t&&j.childNodes.push(t)}if(n(t)&&t.shadowRoot)for(const e of Array.from(t.shadowRoot.childNodes)){const n=K(e,r);n&&(o(t.shadowRoot)&&(n.isShadow=!0),j.childNodes.push(n))}}return t.parentNode&&r(t.parentNode)&&o(t.parentNode)&&(j.isShadow=!0),j.type===e.NodeType.Element&&"iframe"===j.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=C((()=>{s||(t(),s=!0)}),n);return void e.addEventListener("load",(()=>{w(r),s=!0,t()}))}const a="about:blank";if(r.location.href!==a||e.src===a||""===e.src)return C(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(t,(()=>{const e=t.contentDocument;if(e&&O){const n=K(e,{doc:e,mirror:i,blockClass:c,blockSelector:l,unblockSelector:u,maskAllText:d,maskTextClass:m,unmaskTextClass:p,maskTextSelector:f,unmaskTextSelector:h,skipChild:!1,inlineStylesheet:g,maskInputOptions:k,maskAttributeFn:T,maskTextFn:b,maskInputFn:S,slimDOMOptions:x,dataURLOptions:E,inlineImages:I,recordCanvas:L,preserveWhiteSpace:U,onSerialize:A,onIframeLoad:O,iframeLoadTimeout:D,onStylesheetLoad:F,stylesheetLoadTimeout:R,keepIframeSrcFn:_});n&&O(t,n)}}),D),j.type===e.NodeType.Element&&"link"===j.tagName&&"string"==typeof j.attributes.rel&&("stylesheet"===j.attributes.rel||"preload"===j.attributes.rel&&"string"==typeof j.attributes.href&&"css"===N(j.attributes.href))&&function(e,t,n){let r,o=!1;try{r=e.sheet}catch(e){return}if(r)return;const s=C((()=>{o||(t(),o=!0)}),n);e.addEventListener("load",(()=>{w(s),o=!0,t()}))}(t,(()=>{if(F){const e=K(t,{doc:a,mirror:i,blockClass:c,blockSelector:l,unblockSelector:u,maskAllText:d,maskTextClass:m,unmaskTextClass:p,maskTextSelector:f,unmaskTextSelector:h,skipChild:!1,inlineStylesheet:g,maskInputOptions:k,maskAttributeFn:T,maskTextFn:b,maskInputFn:S,slimDOMOptions:x,dataURLOptions:E,inlineImages:I,recordCanvas:L,preserveWhiteSpace:U,onSerialize:A,onIframeLoad:O,iframeLoadTimeout:D,onStylesheetLoad:F,stylesheetLoadTimeout:R,keepIframeSrcFn:_});e&&F(t,e)}}),R),j}const Q=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Z(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 a(e),p(),t)}class a{constructor(e){this.start=e,this.end={line:n,column:r},this.source=t.source}}a.prototype.content=e;const i=[];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;i.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=C()||w());)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 a=e.slice(2,n-2);return r+=2,o(a),e=e.slice(n),r+=2,t({type:"comment",comment:a})}function y(){const e=m(/^([^{]+)/);if(!e)return;const t=ee(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(e=>e.replace(/,/g,"‌"))).split(/\s*(?![^(]*\)),\s*/);if(t.length<=1)return t.map((e=>e.replace(/\u200C/g,",")));let n=0,r=0;const o=t.length,s=[];for(;n<o;){let e=(t[n].match(/\(/g)||[]).length-(t[n].match(/\)/g)||[]).length;if(e>=1){let a=!1;for(r=n+1;r<o;){const o=(t[r].match(/\(/g)||[]).length,i=(t[r].match(/\)/g)||[]).length-o;if(i===e){s.push(t.slice(n,r+1).join(",")),n=r+1,a=!0;break}r++,e-=i}if(a)continue;t.slice(n,o).forEach((e=>e&&s.push(e)));break}t[n]&&s.push(t[n]),n++}return s.map((e=>e.replace(/\u200C/g,",")))}function g(){const e=s(),t=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;const n=ee(t[0]);if(!m(/^:\s*/))return c("property missing ':'");const r=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:n.replace(Q,""),value:r?ee(r[0]).replace(Q,""):""});return m(/^[;\s]*/),o}function k(){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 T(){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:k()})}const b=x("import"),N=x("charset"),S=x("namespace");function x(e){const t=new RegExp("^@"+e+"\\s*((?:"+[/[^\\]"(?:\\"|[^"])*"/.source,/[^\\]'(?:\\'|[^'])*'/.source,"[^;]"].join("|")+")+);");return()=>{const n=s(),r=m(t);if(!r)return;const o={type:e};return o[e]=r[1].trim(),n(o)}}function C(){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,a=f();for(;o=T();)a.push(o),a=a.concat(f());return u()?e({type:"keyframes",name:r,vendor:n,keyframes:a}):c("@keyframes missing '}'")}()||function(){const e=s(),t=m(/^@media *([^{]+)/);if(!t)return;const n=ee(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:ee(t[1]),media:ee(t[2])})}()||function(){const e=s(),t=m(/^@supports *([^{]+)/);if(!t)return;const n=ee(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 '}'")}()||b()||N()||S()||function(){const e=s(),t=m(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=ee(t[1]),r=ee(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=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(!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=g();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):c("@font-face missing '}'")}()}function w(){const e=s(),t=y();return t?(f(),e({type:"rule",selectors:t,declarations:k()})):c("selector missing")}return te(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:i}}}())}function ee(e){return e?e.replace(/^\s+|\s+$/g,""):""}function te(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=>{te(e,r)})):n&&"object"==typeof n&&te(n,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}const ne={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 re=/([^\\]):hover/,oe=new RegExp(re.source,"g");function se(e,t){const n=t?.stylesWithHoverClass.get(e);if(n)return n;if(e.length>=1e6)return e;const r=Z(e,{silent:!0});if(!r.stylesheet)return e;const o=[];if(r.stylesheet.rules.forEach((e=>{"selectors"in e&&(e.selectors||[]).forEach((e=>{re.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"),a=e.replace(s,(e=>{const t=e.replace(oe,"$1.\\:hover");return`${e}, ${t}`}));return t?.stylesWithHoverClass.set(e,a),a}function ae(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=ne[e.tagName]?ne[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(t);let n;t.isSVG?n=r.createElementNS("http://www.w3.org/2000/svg",e):(t.isCustom&&r.defaultView?.customElements&&!r.defaultView.customElements.get(t.tagName)&&r.defaultView.customElements.define(t.tagName,class extends r.defaultView.HTMLElement{}),n=r.createElement(e));const a={};for(const i in t.attributes){if(!Object.prototype.hasOwnProperty.call(t.attributes,i))continue;let c=t.attributes[i];if("option"===e&&"selected"===i&&!1===c)continue;if(null===c)continue;if(!0===c&&(c=""),i.startsWith("rr_")){a[i]=c;continue}const l="textarea"===e&&"value"===i,u="style"===e&&"_cssText"===i;if(u&&o&&"string"==typeof c&&(c=se(c,s)),!l&&!u||"string"!=typeof c)try{if(t.isSVG&&"xlink:href"===i)n.setAttributeNS("http://www.w3.org/1999/xlink",i,c.toString());else if("onload"===i||"onclick"===i||"onmouse"===i.substring(0,7))n.setAttribute("_"+i,c.toString());else{if("meta"===e&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"===i){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(i,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 o in a){const s=a[o];if("canvas"===e&&"rr_dataURL"===o){const e=r.createElement("img");e.onload=()=>{const t=n.getContext("2d");t&&t.drawImage(e,0,0,e.width,e.height)},e.src=s.toString(),n.RRNodeType&&(n.rr_dataURL=s.toString())}else if("img"===e&&"rr_dataURL"===o){const e=n;e.currentSrc.startsWith("data:")||(e.setAttribute("rrweb-original-src",t.attributes.src),e.src=s.toString())}if("rr_width"===o)n.style.setProperty("width",s.toString());else if("rr_height"===o)n.style.setProperty("height",s.toString());else if("rr_mediaCurrentTime"===o&&"number"==typeof s)n.currentTime=s;else if("rr_mediaState"===o)switch(s){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?se(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 ie(t,r){const{doc:o,mirror:s,skipChild:a=!1,hackCss:i=!0,afterAppend:c,cache:l}=r;if(s.has(t.id)){const e=s.getNode(t.id);if(k(s.getMeta(e),t))return s.getNode(t.id)}let u=ae(t,{doc:o,hackCss:i,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)&&!a)for(const r of t.childNodes){const a=ie(r,{doc:o,mirror:s,skipChild:!1,hackCss:i,afterAppend:c,cache:l});if(a){if(r.isShadow&&n(u)&&u.shadowRoot)u.shadowRoot.appendChild(a);else if(t.type===e.NodeType.Document&&r.type==e.NodeType.Element){const e=a;let t=null;e.childNodes.forEach((e=>{"BODY"===e.nodeName&&(t=e)})),t?(e.removeChild(t),u.appendChild(a),e.appendChild(t)):u.appendChild(a)}else u.appendChild(a);c&&c(a,r.id)}else console.warn("Failed to rebuild",r)}return u}return e.IGNORED_NODE=v,e.Mirror=d,e.addHoverClass=se,e.buildNodeWithSN=ie,e.classMatchesRegex=function(e,t,n){return!!e&&(n?z(e,(e=>H(e,t)))>=0:e.nodeType===e.ELEMENT_NODE&&H(e,t))},e.cleanupSnapshot=function(){E=1},e.clearTimeout=w,e.createCache=function(){return{stylesWithHoverClass:new Map}},e.createMatchPredicate=q,e.createMirror=function(){return new d},e.distanceToMatch=z,e.escapeImportStatement=s,e.extractFileExtension=N,e.fixSafariColons=c,e.genId=M,e.getInputType=T,e.getInputValue=b,e.ignoreAttribute=G,e.is2DCanvasBlank=g,e.isCSSImportRule=l,e.isCSSStyleRule=u,e.isElement=n,e.isNativeShadowDom=o,e.isNodeMetaEqual=k,e.isShadowRoot=r,e.maskInputValue=p,e.needMaskingText=Y,e.onRequestAnimationFrame=function(...e){return x("requestAnimationFrame")(...e)},e.rebuild=function(t,n){const{doc:r,onVisit:o,hackCss:s=!0,afterAppend:a,cache:i,mirror:c=new d}=n,l=ie(t,{doc:r,mirror:c,skipChild:!1,hackCss:s,afterAppend:a,cache:i});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(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=K,e.setTimeout=C,e.shouldMaskInput=m,e.snapshot=function(e,t){const{mirror:n=new d,blockClass:r="rr-block",blockSelector:o=null,unblockSelector:s=null,maskAllText:a=!1,maskTextClass:i="rr-mask",unmaskTextClass:c=null,maskTextSelector:l=null,unmaskTextSelector:u=null,inlineStylesheet:m=!0,inlineImages:p=!1,recordCanvas:f=!1,maskAllInputs:h=!1,maskAttributeFn:y,maskTextFn:g,maskInputFn:k,slimDOM:T=!1,dataURLOptions:b,preserveWhiteSpace:N,onSerialize:S,onIframeLoad:x,iframeLoadTimeout:C,onStylesheetLoad:w,stylesheetLoadTimeout:E,keepIframeSrcFn:I=(()=>!1)}=t||{};return K(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,maskAllText:a,maskTextClass:i,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:m,maskInputOptions:!0===h?{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}:!1===h?{}:h,maskAttributeFn:y,maskTextFn:g,maskInputFn:k,slimDOMOptions:!0===T||"all"===T?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===T,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===T?{}:T,dataURLOptions:b,inlineImages:p,recordCanvas:f,preserveWhiteSpace:N,onSerialize:S,onIframeLoad:x,iframeLoadTimeout:C,onStylesheetLoad:w,stylesheetLoadTimeout:E,keepIframeSrcFn:I,newlyAddedElement:!1})},e.stringifyRule=i,e.stringifyStylesheet=a,e.toLowerCase=f,e.toUpperCase=h,e.transformAttribute=V,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 n(e){const t=e?.host;return Boolean(t?.shadowRoot===e)}function r(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 o(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(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t):null}catch(e){return null}var t}function a(e){let t;if(c(e))try{t=o(e.styleSheet)||s(e)}catch(e){}else if(l(e)&&e.selectorText.includes(":"))return i(e.cssText);return t||e.cssText}function i(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){if(!e)return-1;const t=this.getMeta(e)?.id;return t??-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 m(){return new u}function d({maskInputOptions:e,tagName:t,type:n}){return"OPTION"===t&&(t="SELECT"),Boolean(e[t.toLowerCase()]||n&&e[n]||"password"===n||"INPUT"===t&&!n&&e.text)}function p({isMasked:e,element:t,value:n,maskInputFn:r}){let s=n||"";return e?(r&&(s=r(s,t)),"*".repeat(s.length)):s}function f(e){return e.toLowerCase()}function h(e){return e.toUpperCase()}const g="__rrweb_original__";function k(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 s=t.getImageData,o=g in s?s[g]:s;if(new Uint32Array(o.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.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 b(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?f(t):null}function T(e,t,n){return"INPUT"!==t||"radio"!==n&&"checkbox"!==n?e.value:e.getAttribute("value")||""}function x(e,t){let n;try{n=new URL(e,t??window.location.href)}catch(e){return null}const r=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return r?.[1]??null}const C={};function S(e){const t=C[e];if(t)return t;const n=window.document;let r=window[e];if(n&&"function"==typeof n.createElement)try{const t=n.createElement("iframe");t.hidden=!0,n.head.appendChild(t);const s=t.contentWindow;s&&s[e]&&(r=s[e]),n.head.removeChild(t)}catch(e){}return C[e]=r.bind(window)}function w(...e){return S("requestAnimationFrame")(...e)}function N(...e){return S("setTimeout")(...e)}function E(...e){return S("clearTimeout")(...e)}let I=1;const v=new RegExp("[^a-z0-9-_:]"),L=-2;function M(){return I++}let A,O;const D=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,F=/^(?:[a-z+]+:)?\/\//i,_=/^www\..*/i,R=/^(data:)([^,]*),(.*)/i;function $(e,t){return(e||"").replace(D,((e,n,r,s,o,a)=>{const i=r||o||a,c=n||s||"";if(!i)return e;if(F.test(i)||_.test(i))return`url(${c}${i}${c})`;if(R.test(i))return`url(${c}${i}${c})`;if("/"===i[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)+i}${c})`;const l=t.split("/"),u=i.split("/");l.pop();for(const e of u)"."!==e&&(".."===e?l.pop():l.push(e));return`url(${c}${l.join("/")}${c})`}))}const U=/^[^ \t\n\r\u000c]+/,W=/^[, \t\n\r\u000c]+/;const j=new WeakMap;function P(e,t){return t&&""!==t.trim()?G(e,t):t}function B(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function G(e,t){let n=j.get(e);if(n||(n=e.createElement("a"),j.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function H(e,t,n,r,s,o){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?P(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 s=e.exec(t.substring(n));return s?(r=s[0],n+=r.length,r):""}const s=[];for(;r(W),!(n>=t.length);){let o=r(U);if(","===o.slice(-1))o=P(e,o.substring(0,o.length-1)),s.push(o);else{let r="";o=P(e,o);let a=!1;for(;;){const e=t.charAt(n);if(""===e){s.push((o+r).trim());break}if(a)")"===e&&(a=!1);else{if(","===e){n+=1,s.push((o+r).trim());break}"("===e&&(a=!0)}r+=e,n+=1}}}return s.join(", ")}(e,r):"style"===n?$(r,G(e)):"object"===t&&"data"===n?P(e,r):"function"==typeof o?o(n,r,s):r:P(e,r):r}function V(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function z(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function q(e,t,n){return!!e&&(n?Y(e,(e=>z(e,t)))>=0:e.nodeType===e.ELEMENT_NODE&&z(e,t))}function Y(e,t,n=1/0,r=0){return e?e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:Y(e.parentNode,t,n,r+1):-1}function X(e,t){return n=>{const r=n;if(null===r)return!1;try{if(e)if("string"==typeof e){if(r.matches(`.${e}`))return!0}else if(z(r,e))return!0;return!(!t||!r.matches(t))}catch{return!1}}}function J(e,t,n,r,s,o){try{const a=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===a)return!1;if("INPUT"===a.tagName){const e=a.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(e))return!0}let i=-1,c=-1;if(o){if(c=Y(a,X(r,s)),c<0)return!0;i=Y(a,X(t,n),c>=0?c:1/0)}else{if(i=Y(a,X(t,n)),i<0)return!1;c=Y(a,X(r,s),i>=0?i:1/0)}return i>=0?!(c>=0)||i<=c:!(c>=0)&&!!o}catch(e){}return!!o}function K(t,n){const{doc:r,mirror:s,blockClass:a,blockSelector:i,unblockSelector:c,maskAllText:l,maskAttributeFn:u,maskTextClass:m,unmaskTextClass:g,maskTextSelector:y,unmaskTextSelector:x,inlineStylesheet:C,maskInputOptions:S={},maskTextFn:w,maskInputFn:N,dataURLOptions:E={},inlineImages:I,recordCanvas:L,keepIframeSrcFn:M,newlyAddedElement:D=!1}=n,F=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(r,s);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:F};case t.ELEMENT_NODE:return function(t,n){const{doc:r,blockClass:s,blockSelector:a,unblockSelector:i,inlineStylesheet:c,maskInputOptions:l={},maskAttributeFn:u,maskInputFn:m,dataURLOptions:g={},inlineImages:y,recordCanvas:x,keepIframeSrcFn:C,newlyAddedElement:S=!1,rootId:w,maskAllText:N,maskTextClass:E,unmaskTextClass:I,maskTextSelector:L,unmaskTextSelector:M}=n,D=function(e,t,n,r){try{if(r&&e.matches(r))return!1;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,s,a,i),F=function(e){if(e instanceof HTMLFormElement)return"form";const t=f(e.tagName);return v.test(t)?"div":t}(t);let _={};const R=t.attributes.length;for(let e=0;e<R;e++){const n=t.attributes[e];n.name&&!V(F,n.name,n.value)&&(_[n.name]=H(r,F,f(n.name),n.value,t,u))}if("link"===F&&c){const e=Array.from(r.styleSheets).find((e=>e.href===t.href));let n=null;e&&(n=o(e)),n&&(delete _.rel,delete _.href,_._cssText=$(n,e.href))}if("style"===F&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){const e=o(t.sheet);e&&(_._cssText=$(e,G(r)))}if("input"===F||"textarea"===F||"select"===F||"option"===F){const e=t,n=b(e),r=T(e,h(F),n),s=e.checked;if("submit"!==n&&"button"!==n&&r){const t=J(e,E,L,I,M,d({type:n,tagName:h(F),maskInputOptions:l}));_.value=p({isMasked:t,element:e,value:r,maskInputFn:m})}s&&(_.checked=s)}"option"===F&&(t.selected&&!l.select?_.selected=!0:delete _.selected);if("canvas"===F&&x)if("2d"===t.__context)k(t)||(_.rr_dataURL=t.toDataURL(g.type,g.quality));else if(!("__context"in t)){const e=t.toDataURL(g.type,g.quality),n=document.createElement("canvas");n.width=t.width,n.height=t.height;e!==n.toDataURL(g.type,g.quality)&&(_.rr_dataURL=e)}if("img"===F&&y){A||(A=r.createElement("canvas"),O=A.getContext("2d"));const e=t,n=e.crossOrigin;e.crossOrigin="anonymous";const s=()=>{e.removeEventListener("load",s);try{A.width=e.naturalWidth,A.height=e.naturalHeight,O.drawImage(e,0,0),_.rr_dataURL=A.toDataURL(g.type,g.quality)}catch(t){console.warn(`Cannot inline img src=${e.currentSrc}! Error: ${t}`)}n?_.crossOrigin=n:e.removeAttribute("crossorigin")};e.complete&&0!==e.naturalWidth?s():e.addEventListener("load",s)}"audio"!==F&&"video"!==F||(_.rr_mediaState=t.paused?"paused":"played",_.rr_mediaCurrentTime=t.currentTime);S||(t.scrollLeft&&(_.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(_.rr_scrollTop=t.scrollTop));if(D){const{width:e,height:n}=t.getBoundingClientRect();_={class:_.class,rr_width:`${e}px`,rr_height:`${n}px`}}"iframe"!==F||C(_.src)||(D||t.contentDocument||(_.rr_src=_.src),delete _.src);let U;try{customElements.get(F)&&(U=!0)}catch(e){}return{type:e.Element,tagName:F,attributes:_,childNodes:[],isSVG:B(t)||void 0,needBlock:D,rootId:w,isCustom:U}}(t,{doc:r,blockClass:a,blockSelector:i,unblockSelector:c,inlineStylesheet:C,maskAttributeFn:u,maskInputOptions:S,maskInputFn:N,dataURLOptions:E,inlineImages:I,recordCanvas:L,keepIframeSrcFn:M,newlyAddedElement:D,rootId:F,maskAllText:l,maskTextClass:m,unmaskTextClass:g,maskTextSelector:y,unmaskTextSelector:x});case t.TEXT_NODE:return function(t,n){const{maskAllText:r,maskTextClass:s,unmaskTextClass:a,maskTextSelector:i,unmaskTextSelector:c,maskTextFn:l,maskInputOptions:u,maskInputFn:m,rootId:f}=n,h=t.parentNode&&t.parentNode.tagName;let g=t.textContent;const k="STYLE"===h||void 0,y="SCRIPT"===h||void 0,b="TEXTAREA"===h||void 0;if(k&&g){try{t.nextSibling||t.previousSibling||t.parentNode.sheet?.cssRules&&(g=o(t.parentNode.sheet))}catch(e){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${e}`,t)}g=$(g,G(n.doc))}y&&(g="SCRIPT_PLACEHOLDER");const T=J(t,s,i,a,c,r);k||y||b||!g||!T||(g=l?l(g,t.parentElement):g.replace(/[\S]/g,"*"));b&&g&&(u.textarea||T)&&(g=m?m(g,t.parentNode):g.replace(/[\S]/g,"*"));if("OPTION"===h&&g){g=p({isMasked:J(t,s,i,a,c,d({type:null,tagName:h,maskInputOptions:u})),element:t,value:g,maskInputFn:m})}return{type:e.Text,textContent:g||"",isStyle:k,rootId:f}}(t,{doc:r,maskAllText:l,maskTextClass:m,unmaskTextClass:g,maskTextSelector:y,unmaskTextSelector:x,maskTextFn:w,maskInputOptions:S,maskInputFn:N,rootId:F});case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:F};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:F};default:return!1}}function Q(e){return null==e?"":e.toLowerCase()}function Z(s,o){const{doc:a,mirror:i,blockClass:c,blockSelector:l,unblockSelector:u,maskAllText:m,maskTextClass:d,unmaskTextClass:p,maskTextSelector:f,unmaskTextSelector:h,skipChild:g=!1,inlineStylesheet:k=!0,maskInputOptions:y={},maskAttributeFn:b,maskTextFn:T,maskInputFn:C,slimDOMOptions:S,dataURLOptions:w={},inlineImages:I=!1,recordCanvas:v=!1,onSerialize:A,onIframeLoad:O,iframeLoadTimeout:D=5e3,onStylesheetLoad:F,stylesheetLoadTimeout:_=5e3,keepIframeSrcFn:R=(()=>!1),newlyAddedElement:$=!1}=o;let{preserveWhiteSpace:U=!0}=o;const W=K(s,{doc:a,mirror:i,blockClass:c,blockSelector:l,maskAllText:m,unblockSelector:u,maskTextClass:d,unmaskTextClass:p,maskTextSelector:f,unmaskTextSelector:h,inlineStylesheet:k,maskInputOptions:y,maskAttributeFn:b,maskTextFn:T,maskInputFn:C,dataURLOptions:w,inlineImages:I,recordCanvas:v,keepIframeSrcFn:R,newlyAddedElement:$});if(!W)return console.warn(s,"not serialized"),null;let j;j=i.hasNode(s)?i.getId(s):!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&&"js"===x(t.attributes.href)))return!0;if(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Q(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Q(t.attributes.name)||"icon"===Q(t.attributes.rel)||"apple-touch-icon"===Q(t.attributes.rel)||"shortcut icon"===Q(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&Q(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(Q(t.attributes.property).match(/^(og|twitter|fb):/)||Q(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Q(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===Q(t.attributes.name)||"googlebot"===Q(t.attributes.name)||"bingbot"===Q(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===Q(t.attributes.name)||"generator"===Q(t.attributes.name)||"framework"===Q(t.attributes.name)||"publisher"===Q(t.attributes.name)||"progid"===Q(t.attributes.name)||Q(t.attributes.property).match(/^article:/)||Q(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===Q(t.attributes.name)||"yandex-verification"===Q(t.attributes.name)||"csrf-token"===Q(t.attributes.name)||"p:domain_verify"===Q(t.attributes.name)||"verify-v1"===Q(t.attributes.name)||"verification"===Q(t.attributes.name)||"shopify-checkout-api-token"===Q(t.attributes.name)))return!0}}return!1}(W,S)&&(U||W.type!==e.Text||W.isStyle||W.textContent.replace(/^\s+|\s+$/gm,"").length)?M():L;const P=Object.assign(W,{id:j});if(i.add(s,P),j===L)return null;A&&A(s);let B=!g;if(P.type===e.Element){B=B&&!P.needBlock,delete P.needBlock;const e=s.shadowRoot;e&&r(e)&&(P.isShadowHost=!0)}if((P.type===e.Document||P.type===e.Element)&&B){S.headWhitespace&&P.type===e.Element&&"head"===P.tagName&&(U=!1);const n={doc:a,mirror:i,blockClass:c,blockSelector:l,maskAllText:m,unblockSelector:u,maskTextClass:d,unmaskTextClass:p,maskTextSelector:f,unmaskTextSelector:h,skipChild:g,inlineStylesheet:k,maskInputOptions:y,maskAttributeFn:b,maskTextFn:T,maskInputFn:C,slimDOMOptions:S,dataURLOptions:w,inlineImages:I,recordCanvas:v,preserveWhiteSpace:U,onSerialize:A,onIframeLoad:O,iframeLoadTimeout:D,onStylesheetLoad:F,stylesheetLoadTimeout:_,keepIframeSrcFn:R};for(const e of Array.from(s.childNodes)){const t=Z(e,n);t&&P.childNodes.push(t)}if(t(s)&&s.shadowRoot)for(const e of Array.from(s.shadowRoot.childNodes)){const t=Z(e,n);t&&(r(s.shadowRoot)&&(t.isShadow=!0),P.childNodes.push(t))}}return s.parentNode&&n(s.parentNode)&&r(s.parentNode)&&(P.isShadow=!0),P.type===e.Element&&"iframe"===P.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let s,o=!1;try{s=r.document.readyState}catch(e){return}if("complete"!==s){const r=N((()=>{o||(t(),o=!0)}),n);return void e.addEventListener("load",(()=>{E(r),o=!0,t()}))}const a="about:blank";if(r.location.href!==a||e.src===a||""===e.src)return N(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(s,(()=>{const e=s.contentDocument;if(e&&O){const t=Z(e,{doc:e,mirror:i,blockClass:c,blockSelector:l,unblockSelector:u,maskAllText:m,maskTextClass:d,unmaskTextClass:p,maskTextSelector:f,unmaskTextSelector:h,skipChild:!1,inlineStylesheet:k,maskInputOptions:y,maskAttributeFn:b,maskTextFn:T,maskInputFn:C,slimDOMOptions:S,dataURLOptions:w,inlineImages:I,recordCanvas:v,preserveWhiteSpace:U,onSerialize:A,onIframeLoad:O,iframeLoadTimeout:D,onStylesheetLoad:F,stylesheetLoadTimeout:_,keepIframeSrcFn:R});t&&O(s,t)}}),D),P.type===e.Element&&"link"===P.tagName&&"string"==typeof P.attributes.rel&&("stylesheet"===P.attributes.rel||"preload"===P.attributes.rel&&"string"==typeof P.attributes.href&&"css"===x(P.attributes.href))&&function(e,t,n){let r,s=!1;try{r=e.sheet}catch(e){return}if(r)return;const o=N((()=>{s||(t(),s=!0)}),n);e.addEventListener("load",(()=>{E(o),s=!0,t()}))}(s,(()=>{if(F){const e=Z(s,{doc:a,mirror:i,blockClass:c,blockSelector:l,unblockSelector:u,maskAllText:m,maskTextClass:d,unmaskTextClass:p,maskTextSelector:f,unmaskTextSelector:h,skipChild:!1,inlineStylesheet:k,maskInputOptions:y,maskAttributeFn:b,maskTextFn:T,maskInputFn:C,slimDOMOptions:S,dataURLOptions:w,inlineImages:I,recordCanvas:v,preserveWhiteSpace:U,onSerialize:A,onIframeLoad:O,iframeLoadTimeout:D,onStylesheetLoad:F,stylesheetLoadTimeout:_,keepIframeSrcFn:R});e&&F(s,e)}}),_),P}function ee(e,t){const{mirror:n=new u,blockClass:r="rr-block",blockSelector:s=null,unblockSelector:o=null,maskAllText:a=!1,maskTextClass:i="rr-mask",unmaskTextClass:c=null,maskTextSelector:l=null,unmaskTextSelector:m=null,inlineStylesheet:d=!0,inlineImages:p=!1,recordCanvas:f=!1,maskAllInputs:h=!1,maskAttributeFn:g,maskTextFn:k,maskInputFn:y,slimDOM:b=!1,dataURLOptions:T,preserveWhiteSpace:x,onSerialize:C,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:N,stylesheetLoadTimeout:E,keepIframeSrcFn:I=(()=>!1)}=t||{};return Z(e,{doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:o,maskAllText:a,maskTextClass:i,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:m,skipChild:!1,inlineStylesheet:d,maskInputOptions:!0===h?{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}:!1===h?{}:h,maskAttributeFn:g,maskTextFn:k,maskInputFn:y,slimDOMOptions:!0===b||"all"===b?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===b,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===b?{}:b,dataURLOptions:T,inlineImages:p,recordCanvas:f,preserveWhiteSpace:x,onSerialize:C,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:N,stylesheetLoadTimeout:E,keepIframeSrcFn:I,newlyAddedElement:!1})}function te(t,n){!function t(r){n(r),r.type!==e.Document&&r.type!==e.Element||r.childNodes.forEach(t)}(t)}function ne(){I=1}const re=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function se(e,t={}){let n=1,r=1;function s(e){const t=e.match(/\n/g);t&&(n+=t.length);const s=e.lastIndexOf("\n");r=-1===s?r+e.length:e.length-s}function o(){const e={line:n,column:r};return t=>(t.position=new a(e),p(),t)}class a{constructor(e){this.start=e,this.end={line:n,column:r},this.source=t.source}}a.prototype.content=e;const i=[];function c(s){const o=new Error(`${t.source||""}:${n}:${r}: ${s}`);if(o.reason=s,o.filename=t.source,o.line=n,o.column=r,o.source=e,!t.silent)throw o;i.push(o)}function l(){return d(/^{\s*/)}function u(){return d(/^}/)}function m(){let t;const n=[];for(p(),f(n);e.length&&"}"!==e.charAt(0)&&(t=w()||N());)t&&(n.push(t),f(n));return n}function d(t){const n=t.exec(e);if(!n)return;const r=n[0];return s(r),e=e.slice(r.length),n}function p(){d(/^\s*/)}function f(e=[]){let t;for(;t=h();)t&&e.push(t),t=h();return e}function h(){const t=o();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 a=e.slice(2,n-2);return r+=2,s(a),e=e.slice(n),r+=2,t({type:"comment",comment:a})}function g(){const e=d(/^([^{]+)/);if(!e)return;const t=oe(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(e=>e.replace(/,/g,"‌"))).split(/\s*(?![^(]*\)),\s*/);if(t.length<=1)return t.map((e=>e.replace(/\u200C/g,",")));let n=0,r=0;const s=t.length,o=[];for(;n<s;){let e=(t[n].match(/\(/g)||[]).length-(t[n].match(/\)/g)||[]).length;if(e>=1){let a=!1;for(r=n+1;r<s;){const s=(t[r].match(/\(/g)||[]).length,i=(t[r].match(/\)/g)||[]).length-s;if(i===e){o.push(t.slice(n,r+1).join(",")),n=r+1,a=!0;break}r++,e-=i}if(a)continue;t.slice(n,s).forEach((e=>e&&o.push(e)));break}t[n]&&o.push(t[n]),n++}return o.map((e=>e.replace(/\u200C/g,",")))}function k(){const e=o(),t=d(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;const n=oe(t[0]);if(!d(/^:\s*/))return c("property missing ':'");const r=d(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),s=e({type:"declaration",property:n.replace(re,""),value:r?oe(r[0]).replace(re,""):""});return d(/^[;\s]*/),s}function y(){const e=[];if(!l())return c("missing '{'");let t;for(f(e);t=k();)!1!==t&&(e.push(t),f(e)),t=k();return u()?e:c("missing '}'")}function b(){let e;const t=[],n=o();for(;e=d(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),d(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:y()})}const T=S("import"),x=S("charset"),C=S("namespace");function S(e){const t=new RegExp("^@"+e+"\\s*((?:"+['(?<!\\\\)"(?:\\\\"|[^"])*"',"(?<!\\\\)'(?:\\\\'|[^'])*'","[^;]"].join("|")+")+);");return()=>{const n=o(),r=d(t);if(!r)return;const s={type:e};return s[e]=r[1].trim(),n(s)}}function w(){if("@"===e[0])return function(){const e=o();let t=d(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=d(/^([-\w]+)\s*/),!t)return c("@keyframes missing name");const r=t[1];if(!l())return c("@keyframes missing '{'");let s,a=f();for(;s=b();)a.push(s),a=a.concat(f());return u()?e({type:"keyframes",name:r,vendor:n,keyframes:a}):c("@keyframes missing '}'")}()||function(){const e=o(),t=d(/^@media *([^{]+)/);if(!t)return;const n=oe(t[1]);if(!l())return c("@media missing '{'");const r=f().concat(m());return u()?e({type:"media",media:n,rules:r}):c("@media missing '}'")}()||function(){const e=o(),t=d(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:oe(t[1]),media:oe(t[2])})}()||function(){const e=o(),t=d(/^@supports *([^{]+)/);if(!t)return;const n=oe(t[1]);if(!l())return c("@supports missing '{'");const r=f().concat(m());return u()?e({type:"supports",supports:n,rules:r}):c("@supports missing '}'")}()||T()||x()||C()||function(){const e=o(),t=d(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=oe(t[1]),r=oe(t[2]);if(!l())return c("@document missing '{'");const s=f().concat(m());return u()?e({type:"document",document:r,vendor:n,rules:s}):c("@document missing '}'")}()||function(){const e=o();if(!d(/^@page */))return;const t=g()||[];if(!l())return c("@page missing '{'");let n,r=f();for(;n=k();)r.push(n),r=r.concat(f());return u()?e({type:"page",selectors:t,declarations:r}):c("@page missing '}'")}()||function(){const e=o();if(!d(/^@host\s*/))return;if(!l())return c("@host missing '{'");const t=f().concat(m());return u()?e({type:"host",rules:t}):c("@host missing '}'")}()||function(){const e=o();if(!d(/^@font-face\s*/))return;if(!l())return c("@font-face missing '{'");let t,n=f();for(;t=k();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):c("@font-face missing '}'")}()}function N(){const e=o(),t=g();return t?(f(),e({type:"rule",selectors:t,declarations:y()})):c("selector missing")}return ae(function(){const e=m();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:i}}}())}function oe(e){return e?e.replace(/^\s+|\s+$/g,""):""}function ae(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=>{ae(e,r)})):n&&"object"==typeof n&&ae(n,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}const ie={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 ce=/([^\\]):hover/,le=new RegExp(ce.source,"g");function ue(e,t){const n=t?.stylesWithHoverClass.get(e);if(n)return n;if(e.length>=1e6)return e;const r=se(e,{silent:!0});if(!r.stylesheet)return e;const s=[];if(r.stylesheet.rules.forEach((e=>{"selectors"in e&&(e.selectors||[]).forEach((e=>{ce.test(e)&&s.push(e)}))})),0===s.length)return e;const o=new RegExp(s.filter(((e,t)=>s.indexOf(e)===t)).sort(((e,t)=>t.length-e.length)).map((e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))).join("|"),"g"),a=e.replace(o,(e=>{const t=e.replace(le,"$1.\\:hover");return`${e}, ${t}`}));return t?.stylesWithHoverClass.set(e,a),a}function me(){return{stylesWithHoverClass:new Map}}function de(t,n){const{doc:r,hackCss:s,cache:o}=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=ie[e.tagName]?ie[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(t);let n;t.isSVG?n=r.createElementNS("http://www.w3.org/2000/svg",e):(t.isCustom&&r.defaultView?.customElements&&!r.defaultView.customElements.get(t.tagName)&&r.defaultView.customElements.define(t.tagName,class extends r.defaultView.HTMLElement{}),n=r.createElement(e));const a={};for(const i in t.attributes){if(!Object.prototype.hasOwnProperty.call(t.attributes,i))continue;let c=t.attributes[i];if("option"===e&&"selected"===i&&!1===c)continue;if(null===c)continue;if(!0===c&&(c=""),i.startsWith("rr_")){a[i]=c;continue}const l="textarea"===e&&"value"===i,u="style"===e&&"_cssText"===i;if(u&&s&&"string"==typeof c&&(c=ue(c,o)),!l&&!u||"string"!=typeof c)try{if(t.isSVG&&"xlink:href"===i)n.setAttributeNS("http://www.w3.org/1999/xlink",i,c.toString());else if("onload"===i||"onclick"===i||"onmouse"===i.substring(0,7))n.setAttribute("_"+i,c.toString());else{if("meta"===e&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"===i){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(i,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 a){const s=a[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=s.toString(),n.RRNodeType&&(n.rr_dataURL=s.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=s.toString())}if("rr_width"===r)n.style.setProperty("width",s.toString());else if("rr_height"===r)n.style.setProperty("height",s.toString());else if("rr_mediaCurrentTime"===r&&"number"==typeof s)n.currentTime=s;else if("rr_mediaState"===r)switch(s){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&&s?ue(t.textContent,o):t.textContent);case e.CDATA:return r.createCDATASection(t.textContent);case e.Comment:return r.createComment(t.textContent);default:return null}}function pe(n,r){const{doc:s,mirror:o,skipChild:a=!1,hackCss:i=!0,afterAppend:c,cache:l}=r;if(o.has(n.id)){const e=o.getNode(n.id);if(y(o.getMeta(e),n))return o.getNode(n.id)}let u=de(n,{doc:s,hackCss:i,cache:l});if(!u)return null;if(n.rootId&&o.getNode(n.rootId)!==s&&o.replace(n.rootId,s),n.type===e.Document&&(s.close(),s.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?s.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):s.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=s),o.add(u,n),(n.type===e.Document||n.type===e.Element)&&!a)for(const r of n.childNodes){const a=pe(r,{doc:s,mirror:o,skipChild:!1,hackCss:i,afterAppend:c,cache:l});if(a){if(r.isShadow&&t(u)&&u.shadowRoot)u.shadowRoot.appendChild(a);else if(n.type===e.Document&&r.type==e.Element){const e=a;let t=null;e.childNodes.forEach((e=>{"BODY"===e.nodeName&&(t=e)})),t?(e.removeChild(t),u.appendChild(a),e.appendChild(t)):u.appendChild(a)}else u.appendChild(a);c&&c(a,r.id)}else console.warn("Failed to rebuild",r)}return u}function fe(t,n){const{doc:r,onVisit:s,hackCss:o=!0,afterAppend:a,cache:i,mirror:c=new u}=n,l=pe(t,{doc:r,mirror:c,skipChild:!1,hackCss:o,afterAppend:a,cache:i});return function(e,t){for(const r of e.getIds())e.has(r)&&(n=e.getNode(r),t(n));var n}(c,(t=>{s&&s(t),function(t,n){const r=n.getMeta(t);if(r?.type!==e.Element)return;const s=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&&(s.scrollLeft=t),"rr_scrollTop"===e&&(s.scrollTop=t)}}(t,c)})),l}export{L as IGNORED_NODE,u as Mirror,e as NodeType,ue as addHoverClass,pe as buildNodeWithSN,q as classMatchesRegex,ne as cleanupSnapshot,E as clearTimeout,me as createCache,X as createMatchPredicate,m as createMirror,Y as distanceToMatch,s as escapeImportStatement,x as extractFileExtension,i as fixSafariColons,M as genId,b as getInputType,T as getInputValue,V as ignoreAttribute,k as is2DCanvasBlank,c as isCSSImportRule,l as isCSSStyleRule,t as isElement,r as isNativeShadowDom,y as isNodeMetaEqual,n as isShadowRoot,p as maskInputValue,J as needMaskingText,w as onRequestAnimationFrame,fe as rebuild,Z as serializeNodeWithId,N as setTimeout,d as shouldMaskInput,ee as snapshot,a as stringifyRule,o as stringifyStylesheet,f as toLowerCase,h as toUpperCase,H as transformAttribute,te as visitSnapshot};
var e;function t(e){return e.nodeType===e.ELEMENT_NODE}function n(e){const t=e?.host;return Boolean(t?.shadowRoot===e)}function r(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 o(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(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t):null}catch(e){return null}var t}function a(e){let t;if(c(e))try{t=o(e.styleSheet)||s(e)}catch(e){}else if(l(e)&&e.selectorText.includes(":"))return i(e.cssText);return t||e.cssText}function i(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){if(!e)return-1;const t=this.getMeta(e)?.id;return t??-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 m(){return new u}function d({maskInputOptions:e,tagName:t,type:n}){return"OPTION"===t&&(t="SELECT"),Boolean(e[t.toLowerCase()]||n&&e[n]||"password"===n||"INPUT"===t&&!n&&e.text)}function p({isMasked:e,element:t,value:n,maskInputFn:r}){let s=n||"";return e?(r&&(s=r(s,t)),"*".repeat(s.length)):s}function f(e){return e.toLowerCase()}function h(e){return e.toUpperCase()}const g="__rrweb_original__";function y(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 s=t.getImageData,o=g in s?s[g]:s;if(new Uint32Array(o.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 k(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 b(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?f(t):null}function T(e,t,n){return"INPUT"!==t||"radio"!==n&&"checkbox"!==n?e.value:e.getAttribute("value")||""}function x(e,t){let n;try{n=new URL(e,t??window.location.href)}catch(e){return null}const r=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return r?.[1]??null}const C={};function S(e){const t=C[e];if(t)return t;const n=window.document;let r=window[e];if(n&&"function"==typeof n.createElement)try{const t=n.createElement("iframe");t.hidden=!0,n.head.appendChild(t);const s=t.contentWindow;s&&s[e]&&(r=s[e]),n.head.removeChild(t)}catch(e){}return C[e]=r.bind(window)}function w(...e){return S("requestAnimationFrame")(...e)}function N(...e){return S("setTimeout")(...e)}function E(...e){return S("clearTimeout")(...e)}let I=1;const v=new RegExp("[^a-z0-9-_:]"),L=-2;function A(){return I++}let M,O;const D=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,F=/^(?:[a-z+]+:)?\/\//i,_=/^www\..*/i,R=/^(data:)([^,]*),(.*)/i;function $(e,t){return(e||"").replace(D,((e,n,r,s,o,a)=>{const i=r||o||a,c=n||s||"";if(!i)return e;if(F.test(i)||_.test(i))return`url(${c}${i}${c})`;if(R.test(i))return`url(${c}${i}${c})`;if("/"===i[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)+i}${c})`;const l=t.split("/"),u=i.split("/");l.pop();for(const e of u)"."!==e&&(".."===e?l.pop():l.push(e));return`url(${c}${l.join("/")}${c})`}))}const U=/^[^ \t\n\r\u000c]+/,W=/^[, \t\n\r\u000c]+/;const j=new WeakMap;function P(e,t){return t&&""!==t.trim()?G(e,t):t}function B(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function G(e,t){let n=j.get(e);if(n||(n=e.createElement("a"),j.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function H(e,t,n,r,s,o){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?P(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 s=e.exec(t.substring(n));return s?(r=s[0],n+=r.length,r):""}const s=[];for(;r(W),!(n>=t.length);){let o=r(U);if(","===o.slice(-1))o=P(e,o.substring(0,o.length-1)),s.push(o);else{let r="";o=P(e,o);let a=!1;for(;;){const e=t.charAt(n);if(""===e){s.push((o+r).trim());break}if(a)")"===e&&(a=!1);else{if(","===e){n+=1,s.push((o+r).trim());break}"("===e&&(a=!0)}r+=e,n+=1}}}return s.join(", ")}(e,r):"style"===n?$(r,G(e)):"object"===t&&"data"===n?P(e,r):"function"==typeof o?o(n,r,s):r:P(e,r):r}function V(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function z(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function q(e,t,n){return!!e&&(n?Y(e,(e=>z(e,t)))>=0:e.nodeType===e.ELEMENT_NODE&&z(e,t))}function Y(e,t,n=1/0,r=0){return e?e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:Y(e.parentNode,t,n,r+1):-1}function X(e,t){return n=>{const r=n;if(null===r)return!1;try{if(e)if("string"==typeof e){if(r.matches(`.${e}`))return!0}else if(z(r,e))return!0;return!(!t||!r.matches(t))}catch{return!1}}}function J(e,t,n,r,s,o){try{const a=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===a)return!1;if("INPUT"===a.tagName){const e=a.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(e))return!0}let i=-1,c=-1;if(o){if(c=Y(a,X(r,s)),c<0)return!0;i=Y(a,X(t,n),c>=0?c:1/0)}else{if(i=Y(a,X(t,n)),i<0)return!1;c=Y(a,X(r,s),i>=0?i:1/0)}return i>=0?!(c>=0)||i<=c:!(c>=0)&&!!o}catch(e){}return!!o}function K(t,n){const{doc:r,mirror:s,blockClass:a,blockSelector:i,unblockSelector:c,maskAllText:l,maskAttributeFn:u,maskTextClass:m,unmaskTextClass:g,maskTextSelector:k,unmaskTextSelector:x,inlineStylesheet:C,maskInputOptions:S={},maskTextFn:w,maskInputFn:N,dataURLOptions:E={},inlineImages:I,recordCanvas:L,keepIframeSrcFn:A,newlyAddedElement:D=!1}=n,F=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(r,s);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:F};case t.ELEMENT_NODE:return function(t,n){const{doc:r,blockClass:s,blockSelector:a,unblockSelector:i,inlineStylesheet:c,maskInputOptions:l={},maskAttributeFn:u,maskInputFn:m,dataURLOptions:g={},inlineImages:k,recordCanvas:x,keepIframeSrcFn:C,newlyAddedElement:S=!1,rootId:w,maskAllText:N,maskTextClass:E,unmaskTextClass:I,maskTextSelector:L,unmaskTextSelector:A}=n,D=function(e,t,n,r){try{if(r&&e.matches(r))return!1;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,s,a,i),F=function(e){if(e instanceof HTMLFormElement)return"form";const t=f(e.tagName);return v.test(t)?"div":t}(t);let _={};const R=t.attributes.length;for(let e=0;e<R;e++){const n=t.attributes[e];n.name&&!V(F,n.name,n.value)&&(_[n.name]=H(r,F,f(n.name),n.value,t,u))}if("link"===F&&c){const e=Array.from(r.styleSheets).find((e=>e.href===t.href));let n=null;e&&(n=o(e)),n&&(delete _.rel,delete _.href,_._cssText=$(n,e.href))}if("style"===F&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){const e=o(t.sheet);e&&(_._cssText=$(e,G(r)))}if("input"===F||"textarea"===F||"select"===F||"option"===F){const e=t,n=b(e),r=T(e,h(F),n),s=e.checked;if("submit"!==n&&"button"!==n&&r){const t=J(e,E,L,I,A,d({type:n,tagName:h(F),maskInputOptions:l}));_.value=p({isMasked:t,element:e,value:r,maskInputFn:m})}s&&(_.checked=s)}"option"===F&&(t.selected&&!l.select?_.selected=!0:delete _.selected);if("canvas"===F&&x)if("2d"===t.__context)y(t)||(_.rr_dataURL=t.toDataURL(g.type,g.quality));else if(!("__context"in t)){const e=t.toDataURL(g.type,g.quality),n=r.createElement("canvas");n.width=t.width,n.height=t.height;e!==n.toDataURL(g.type,g.quality)&&(_.rr_dataURL=e)}if("img"===F&&k){M||(M=r.createElement("canvas"),O=M.getContext("2d"));const e=t,n=e.currentSrc||e.getAttribute("src")||"<unknown-src>",s=e.crossOrigin,o=()=>{e.removeEventListener("load",o);try{M.width=e.naturalWidth,M.height=e.naturalHeight,O.drawImage(e,0,0),_.rr_dataURL=M.toDataURL(g.type,g.quality)}catch(t){if("anonymous"!==e.crossOrigin)return e.crossOrigin="anonymous",void(e.complete&&0!==e.naturalWidth?o():e.addEventListener("load",o));console.warn(`Cannot inline img src=${n}! Error: ${t}`)}"anonymous"===e.crossOrigin&&(s?_.crossOrigin=s:e.removeAttribute("crossorigin"))};e.complete&&0!==e.naturalWidth?o():e.addEventListener("load",o)}"audio"!==F&&"video"!==F||(_.rr_mediaState=t.paused?"paused":"played",_.rr_mediaCurrentTime=t.currentTime);S||(t.scrollLeft&&(_.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(_.rr_scrollTop=t.scrollTop));if(D){const{width:e,height:n}=t.getBoundingClientRect();_={class:_.class,rr_width:`${e}px`,rr_height:`${n}px`}}"iframe"!==F||C(_.src)||(D||t.contentDocument||(_.rr_src=_.src),delete _.src);let U;try{customElements.get(F)&&(U=!0)}catch(e){}return{type:e.Element,tagName:F,attributes:_,childNodes:[],isSVG:B(t)||void 0,needBlock:D,rootId:w,isCustom:U}}(t,{doc:r,blockClass:a,blockSelector:i,unblockSelector:c,inlineStylesheet:C,maskAttributeFn:u,maskInputOptions:S,maskInputFn:N,dataURLOptions:E,inlineImages:I,recordCanvas:L,keepIframeSrcFn:A,newlyAddedElement:D,rootId:F,maskAllText:l,maskTextClass:m,unmaskTextClass:g,maskTextSelector:k,unmaskTextSelector:x});case t.TEXT_NODE:return function(t,n){const{maskAllText:r,maskTextClass:s,unmaskTextClass:a,maskTextSelector:i,unmaskTextSelector:c,maskTextFn:l,maskInputOptions:u,maskInputFn:m,rootId:f}=n,h=t.parentNode&&t.parentNode.tagName;let g=t.textContent;const y="STYLE"===h||void 0,k="SCRIPT"===h||void 0,b="TEXTAREA"===h||void 0;if(y&&g){try{t.nextSibling||t.previousSibling||t.parentNode.sheet?.cssRules&&(g=o(t.parentNode.sheet))}catch(e){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${e}`,t)}g=$(g,G(n.doc))}k&&(g="SCRIPT_PLACEHOLDER");const T=J(t,s,i,a,c,r);y||k||b||!g||!T||(g=l?l(g,t.parentElement):g.replace(/[\S]/g,"*"));b&&g&&(u.textarea||T)&&(g=m?m(g,t.parentNode):g.replace(/[\S]/g,"*"));if("OPTION"===h&&g){g=p({isMasked:J(t,s,i,a,c,d({type:null,tagName:h,maskInputOptions:u})),element:t,value:g,maskInputFn:m})}return{type:e.Text,textContent:g||"",isStyle:y,rootId:f}}(t,{doc:r,maskAllText:l,maskTextClass:m,unmaskTextClass:g,maskTextSelector:k,unmaskTextSelector:x,maskTextFn:w,maskInputOptions:S,maskInputFn:N,rootId:F});case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:F};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:F};default:return!1}}function Q(e){return null==e?"":e.toLowerCase()}function Z(s,o){const{doc:a,mirror:i,blockClass:c,blockSelector:l,unblockSelector:u,maskAllText:m,maskTextClass:d,unmaskTextClass:p,maskTextSelector:f,unmaskTextSelector:h,skipChild:g=!1,inlineStylesheet:y=!0,maskInputOptions:k={},maskAttributeFn:b,maskTextFn:T,maskInputFn:C,slimDOMOptions:S,dataURLOptions:w={},inlineImages:I=!1,recordCanvas:v=!1,onSerialize:M,onIframeLoad:O,iframeLoadTimeout:D=5e3,onStylesheetLoad:F,stylesheetLoadTimeout:_=5e3,keepIframeSrcFn:R=(()=>!1),newlyAddedElement:$=!1}=o;let{preserveWhiteSpace:U=!0}=o;const W=K(s,{doc:a,mirror:i,blockClass:c,blockSelector:l,maskAllText:m,unblockSelector:u,maskTextClass:d,unmaskTextClass:p,maskTextSelector:f,unmaskTextSelector:h,inlineStylesheet:y,maskInputOptions:k,maskAttributeFn:b,maskTextFn:T,maskInputFn:C,dataURLOptions:w,inlineImages:I,recordCanvas:v,keepIframeSrcFn:R,newlyAddedElement:$});if(!W)return console.warn(s,"not serialized"),null;let j;j=i.hasNode(s)?i.getId(s):!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&&"js"===x(t.attributes.href)))return!0;if(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Q(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Q(t.attributes.name)||"icon"===Q(t.attributes.rel)||"apple-touch-icon"===Q(t.attributes.rel)||"shortcut icon"===Q(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&Q(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(Q(t.attributes.property).match(/^(og|twitter|fb):/)||Q(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Q(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===Q(t.attributes.name)||"googlebot"===Q(t.attributes.name)||"bingbot"===Q(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===Q(t.attributes.name)||"generator"===Q(t.attributes.name)||"framework"===Q(t.attributes.name)||"publisher"===Q(t.attributes.name)||"progid"===Q(t.attributes.name)||Q(t.attributes.property).match(/^article:/)||Q(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===Q(t.attributes.name)||"yandex-verification"===Q(t.attributes.name)||"csrf-token"===Q(t.attributes.name)||"p:domain_verify"===Q(t.attributes.name)||"verify-v1"===Q(t.attributes.name)||"verification"===Q(t.attributes.name)||"shopify-checkout-api-token"===Q(t.attributes.name)))return!0}}return!1}(W,S)&&(U||W.type!==e.Text||W.isStyle||W.textContent.replace(/^\s+|\s+$/gm,"").length)?A():L;const P=Object.assign(W,{id:j});if(i.add(s,P),j===L)return null;M&&M(s);let B=!g;if(P.type===e.Element){B=B&&!P.needBlock,delete P.needBlock;const e=s.shadowRoot;e&&r(e)&&(P.isShadowHost=!0)}if((P.type===e.Document||P.type===e.Element)&&B){S.headWhitespace&&P.type===e.Element&&"head"===P.tagName&&(U=!1);const n={doc:a,mirror:i,blockClass:c,blockSelector:l,maskAllText:m,unblockSelector:u,maskTextClass:d,unmaskTextClass:p,maskTextSelector:f,unmaskTextSelector:h,skipChild:g,inlineStylesheet:y,maskInputOptions:k,maskAttributeFn:b,maskTextFn:T,maskInputFn:C,slimDOMOptions:S,dataURLOptions:w,inlineImages:I,recordCanvas:v,preserveWhiteSpace:U,onSerialize:M,onIframeLoad:O,iframeLoadTimeout:D,onStylesheetLoad:F,stylesheetLoadTimeout:_,keepIframeSrcFn:R};for(const e of Array.from(s.childNodes)){const t=Z(e,n);t&&P.childNodes.push(t)}if(t(s)&&s.shadowRoot)for(const e of Array.from(s.shadowRoot.childNodes)){const t=Z(e,n);t&&(r(s.shadowRoot)&&(t.isShadow=!0),P.childNodes.push(t))}}return s.parentNode&&n(s.parentNode)&&r(s.parentNode)&&(P.isShadow=!0),P.type===e.Element&&"iframe"===P.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let s,o=!1;try{s=r.document.readyState}catch(e){return}if("complete"!==s){const r=N((()=>{o||(t(),o=!0)}),n);return void e.addEventListener("load",(()=>{E(r),o=!0,t()}))}const a="about:blank";if(r.location.href!==a||e.src===a||""===e.src)return N(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(s,(()=>{const e=s.contentDocument;if(e&&O){const t=Z(e,{doc:e,mirror:i,blockClass:c,blockSelector:l,unblockSelector:u,maskAllText:m,maskTextClass:d,unmaskTextClass:p,maskTextSelector:f,unmaskTextSelector:h,skipChild:!1,inlineStylesheet:y,maskInputOptions:k,maskAttributeFn:b,maskTextFn:T,maskInputFn:C,slimDOMOptions:S,dataURLOptions:w,inlineImages:I,recordCanvas:v,preserveWhiteSpace:U,onSerialize:M,onIframeLoad:O,iframeLoadTimeout:D,onStylesheetLoad:F,stylesheetLoadTimeout:_,keepIframeSrcFn:R});t&&O(s,t)}}),D),P.type===e.Element&&"link"===P.tagName&&"string"==typeof P.attributes.rel&&("stylesheet"===P.attributes.rel||"preload"===P.attributes.rel&&"string"==typeof P.attributes.href&&"css"===x(P.attributes.href))&&function(e,t,n){let r,s=!1;try{r=e.sheet}catch(e){return}if(r)return;const o=N((()=>{s||(t(),s=!0)}),n);e.addEventListener("load",(()=>{E(o),s=!0,t()}))}(s,(()=>{if(F){const e=Z(s,{doc:a,mirror:i,blockClass:c,blockSelector:l,unblockSelector:u,maskAllText:m,maskTextClass:d,unmaskTextClass:p,maskTextSelector:f,unmaskTextSelector:h,skipChild:!1,inlineStylesheet:y,maskInputOptions:k,maskAttributeFn:b,maskTextFn:T,maskInputFn:C,slimDOMOptions:S,dataURLOptions:w,inlineImages:I,recordCanvas:v,preserveWhiteSpace:U,onSerialize:M,onIframeLoad:O,iframeLoadTimeout:D,onStylesheetLoad:F,stylesheetLoadTimeout:_,keepIframeSrcFn:R});e&&F(s,e)}}),_),P}function ee(e,t){const{mirror:n=new u,blockClass:r="rr-block",blockSelector:s=null,unblockSelector:o=null,maskAllText:a=!1,maskTextClass:i="rr-mask",unmaskTextClass:c=null,maskTextSelector:l=null,unmaskTextSelector:m=null,inlineStylesheet:d=!0,inlineImages:p=!1,recordCanvas:f=!1,maskAllInputs:h=!1,maskAttributeFn:g,maskTextFn:y,maskInputFn:k,slimDOM:b=!1,dataURLOptions:T,preserveWhiteSpace:x,onSerialize:C,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:N,stylesheetLoadTimeout:E,keepIframeSrcFn:I=(()=>!1)}=t||{};return Z(e,{doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:o,maskAllText:a,maskTextClass:i,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:m,skipChild:!1,inlineStylesheet:d,maskInputOptions:!0===h?{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}:!1===h?{}:h,maskAttributeFn:g,maskTextFn:y,maskInputFn:k,slimDOMOptions:!0===b||"all"===b?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===b,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===b?{}:b,dataURLOptions:T,inlineImages:p,recordCanvas:f,preserveWhiteSpace:x,onSerialize:C,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:N,stylesheetLoadTimeout:E,keepIframeSrcFn:I,newlyAddedElement:!1})}function te(t,n){!function t(r){n(r),r.type!==e.Document&&r.type!==e.Element||r.childNodes.forEach(t)}(t)}function ne(){I=1}const re=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function se(e,t={}){let n=1,r=1;function s(e){const t=e.match(/\n/g);t&&(n+=t.length);const s=e.lastIndexOf("\n");r=-1===s?r+e.length:e.length-s}function o(){const e={line:n,column:r};return t=>(t.position=new a(e),p(),t)}class a{constructor(e){this.start=e,this.end={line:n,column:r},this.source=t.source}}a.prototype.content=e;const i=[];function c(s){const o=new Error(`${t.source||""}:${n}:${r}: ${s}`);if(o.reason=s,o.filename=t.source,o.line=n,o.column=r,o.source=e,!t.silent)throw o;i.push(o)}function l(){return d(/^{\s*/)}function u(){return d(/^}/)}function m(){let t;const n=[];for(p(),f(n);e.length&&"}"!==e.charAt(0)&&(t=w()||N());)t&&(n.push(t),f(n));return n}function d(t){const n=t.exec(e);if(!n)return;const r=n[0];return s(r),e=e.slice(r.length),n}function p(){d(/^\s*/)}function f(e=[]){let t;for(;t=h();)t&&e.push(t),t=h();return e}function h(){const t=o();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 a=e.slice(2,n-2);return r+=2,s(a),e=e.slice(n),r+=2,t({type:"comment",comment:a})}function g(){const e=d(/^([^{]+)/);if(!e)return;const t=oe(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(e=>e.replace(/,/g,"‌"))).split(/\s*(?![^(]*\)),\s*/);if(t.length<=1)return t.map((e=>e.replace(/\u200C/g,",")));let n=0,r=0;const s=t.length,o=[];for(;n<s;){let e=(t[n].match(/\(/g)||[]).length-(t[n].match(/\)/g)||[]).length;if(e>=1){let a=!1;for(r=n+1;r<s;){const s=(t[r].match(/\(/g)||[]).length,i=(t[r].match(/\)/g)||[]).length-s;if(i===e){o.push(t.slice(n,r+1).join(",")),n=r+1,a=!0;break}r++,e-=i}if(a)continue;t.slice(n,s).forEach((e=>e&&o.push(e)));break}t[n]&&o.push(t[n]),n++}return o.map((e=>e.replace(/\u200C/g,",")))}function y(){const e=o(),t=d(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;const n=oe(t[0]);if(!d(/^:\s*/))return c("property missing ':'");const r=d(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),s=e({type:"declaration",property:n.replace(re,""),value:r?oe(r[0]).replace(re,""):""});return d(/^[;\s]*/),s}function k(){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 b(){let e;const t=[],n=o();for(;e=d(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),d(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:k()})}const T=S("import"),x=S("charset"),C=S("namespace");function S(e){const t=new RegExp("^@"+e+"\\s*((?:"+[/[^\\]"(?:\\"|[^"])*"/.source,/[^\\]'(?:\\'|[^'])*'/.source,"[^;]"].join("|")+")+);");return()=>{const n=o(),r=d(t);if(!r)return;const s={type:e};return s[e]=r[1].trim(),n(s)}}function w(){if("@"===e[0])return function(){const e=o();let t=d(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=d(/^([-\w]+)\s*/),!t)return c("@keyframes missing name");const r=t[1];if(!l())return c("@keyframes missing '{'");let s,a=f();for(;s=b();)a.push(s),a=a.concat(f());return u()?e({type:"keyframes",name:r,vendor:n,keyframes:a}):c("@keyframes missing '}'")}()||function(){const e=o(),t=d(/^@media *([^{]+)/);if(!t)return;const n=oe(t[1]);if(!l())return c("@media missing '{'");const r=f().concat(m());return u()?e({type:"media",media:n,rules:r}):c("@media missing '}'")}()||function(){const e=o(),t=d(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:oe(t[1]),media:oe(t[2])})}()||function(){const e=o(),t=d(/^@supports *([^{]+)/);if(!t)return;const n=oe(t[1]);if(!l())return c("@supports missing '{'");const r=f().concat(m());return u()?e({type:"supports",supports:n,rules:r}):c("@supports missing '}'")}()||T()||x()||C()||function(){const e=o(),t=d(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=oe(t[1]),r=oe(t[2]);if(!l())return c("@document missing '{'");const s=f().concat(m());return u()?e({type:"document",document:r,vendor:n,rules:s}):c("@document missing '}'")}()||function(){const e=o();if(!d(/^@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=o();if(!d(/^@host\s*/))return;if(!l())return c("@host missing '{'");const t=f().concat(m());return u()?e({type:"host",rules:t}):c("@host missing '}'")}()||function(){const e=o();if(!d(/^@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=o(),t=g();return t?(f(),e({type:"rule",selectors:t,declarations:k()})):c("selector missing")}return ae(function(){const e=m();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:i}}}())}function oe(e){return e?e.replace(/^\s+|\s+$/g,""):""}function ae(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=>{ae(e,r)})):n&&"object"==typeof n&&ae(n,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}const ie={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 ce=/([^\\]):hover/,le=new RegExp(ce.source,"g");function ue(e,t){const n=t?.stylesWithHoverClass.get(e);if(n)return n;if(e.length>=1e6)return e;const r=se(e,{silent:!0});if(!r.stylesheet)return e;const s=[];if(r.stylesheet.rules.forEach((e=>{"selectors"in e&&(e.selectors||[]).forEach((e=>{ce.test(e)&&s.push(e)}))})),0===s.length)return e;const o=new RegExp(s.filter(((e,t)=>s.indexOf(e)===t)).sort(((e,t)=>t.length-e.length)).map((e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))).join("|"),"g"),a=e.replace(o,(e=>{const t=e.replace(le,"$1.\\:hover");return`${e}, ${t}`}));return t?.stylesWithHoverClass.set(e,a),a}function me(){return{stylesWithHoverClass:new Map}}function de(t,n){const{doc:r,hackCss:s,cache:o}=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=ie[e.tagName]?ie[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(t);let n;t.isSVG?n=r.createElementNS("http://www.w3.org/2000/svg",e):(t.isCustom&&r.defaultView?.customElements&&!r.defaultView.customElements.get(t.tagName)&&r.defaultView.customElements.define(t.tagName,class extends r.defaultView.HTMLElement{}),n=r.createElement(e));const a={};for(const i in t.attributes){if(!Object.prototype.hasOwnProperty.call(t.attributes,i))continue;let c=t.attributes[i];if("option"===e&&"selected"===i&&!1===c)continue;if(null===c)continue;if(!0===c&&(c=""),i.startsWith("rr_")){a[i]=c;continue}const l="textarea"===e&&"value"===i,u="style"===e&&"_cssText"===i;if(u&&s&&"string"==typeof c&&(c=ue(c,o)),!l&&!u||"string"!=typeof c)try{if(t.isSVG&&"xlink:href"===i)n.setAttributeNS("http://www.w3.org/1999/xlink",i,c.toString());else if("onload"===i||"onclick"===i||"onmouse"===i.substring(0,7))n.setAttribute("_"+i,c.toString());else{if("meta"===e&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"===i){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(i,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 s in a){const o=a[s];if("canvas"===e&&"rr_dataURL"===s){const e=r.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"===s){const e=n;e.currentSrc.startsWith("data:")||(e.setAttribute("rrweb-original-src",t.attributes.src),e.src=o.toString())}if("rr_width"===s)n.style.setProperty("width",o.toString());else if("rr_height"===s)n.style.setProperty("height",o.toString());else if("rr_mediaCurrentTime"===s&&"number"==typeof o)n.currentTime=o;else if("rr_mediaState"===s)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&&s?ue(t.textContent,o):t.textContent);case e.CDATA:return r.createCDATASection(t.textContent);case e.Comment:return r.createComment(t.textContent);default:return null}}function pe(n,r){const{doc:s,mirror:o,skipChild:a=!1,hackCss:i=!0,afterAppend:c,cache:l}=r;if(o.has(n.id)){const e=o.getNode(n.id);if(k(o.getMeta(e),n))return o.getNode(n.id)}let u=de(n,{doc:s,hackCss:i,cache:l});if(!u)return null;if(n.rootId&&o.getNode(n.rootId)!==s&&o.replace(n.rootId,s),n.type===e.Document&&(s.close(),s.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?s.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):s.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=s),o.add(u,n),(n.type===e.Document||n.type===e.Element)&&!a)for(const r of n.childNodes){const a=pe(r,{doc:s,mirror:o,skipChild:!1,hackCss:i,afterAppend:c,cache:l});if(a){if(r.isShadow&&t(u)&&u.shadowRoot)u.shadowRoot.appendChild(a);else if(n.type===e.Document&&r.type==e.Element){const e=a;let t=null;e.childNodes.forEach((e=>{"BODY"===e.nodeName&&(t=e)})),t?(e.removeChild(t),u.appendChild(a),e.appendChild(t)):u.appendChild(a)}else u.appendChild(a);c&&c(a,r.id)}else console.warn("Failed to rebuild",r)}return u}function fe(t,n){const{doc:r,onVisit:s,hackCss:o=!0,afterAppend:a,cache:i,mirror:c=new u}=n,l=pe(t,{doc:r,mirror:c,skipChild:!1,hackCss:o,afterAppend:a,cache:i});return function(e,t){for(const r of e.getIds())e.has(r)&&(n=e.getNode(r),t(n));var n}(c,(t=>{s&&s(t),function(t,n){const r=n.getMeta(t);if(r?.type!==e.Element)return;const s=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&&(s.scrollLeft=t),"rr_scrollTop"===e&&(s.scrollTop=t)}}(t,c)})),l}export{L as IGNORED_NODE,u as Mirror,e as NodeType,ue as addHoverClass,pe as buildNodeWithSN,q as classMatchesRegex,ne as cleanupSnapshot,E as clearTimeout,me as createCache,X as createMatchPredicate,m as createMirror,Y as distanceToMatch,s as escapeImportStatement,x as extractFileExtension,i as fixSafariColons,A as genId,b as getInputType,T as getInputValue,V as ignoreAttribute,y as is2DCanvasBlank,c as isCSSImportRule,l as isCSSStyleRule,t as isElement,r as isNativeShadowDom,k as isNodeMetaEqual,n as isShadowRoot,p as maskInputValue,J as needMaskingText,w as onRequestAnimationFrame,fe as rebuild,Z as serializeNodeWithId,N as setTimeout,d as shouldMaskInput,ee as snapshot,a as stringifyRule,o as stringifyStylesheet,f as toLowerCase,h as toUpperCase,H as transformAttribute,te as visitSnapshot};
//# sourceMappingURL=rrweb-snapshot.min.js.map
{
"name": "@sentry-internal/rrweb-snapshot",
"version": "2.27.0",
"version": "2.28.0",
"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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc