@posthog/rrweb-snapshot 0.0.49 → 0.0.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  (function (g, f) {if ("object" == typeof exports && "object" == typeof module) {module.exports = f();} else if ("function" == typeof define && define.amd) {define("rrwebSnapshotRecord", [], f);} else if ("object" == typeof exports) {exports["rrwebSnapshotRecord"] = f();} else {g["rrwebSnapshotRecord"] = f();}}(typeof self !== 'undefined' ? self : typeof globalThis !== 'undefined' ? globalThis : this, () => {var exports = {};var module = { exports };
2
- "use strict";var le=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ie=le(S=>{"use strict";var Ae=Object.defineProperty,Le=(e,t,r)=>t in e?Ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ce=(e,t,r)=>Le(e,typeof t!="symbol"?t+"":t,r),O=(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))(O||{}),ue={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},de={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},G={};function Oe(e){var t,r;let i=(r=(t=globalThis==null?void 0:globalThis.Zone)==null?void 0:t.__symbol__)==null?void 0:r.call(t,e);if(i&&globalThis[i])return globalThis[i]}function te(e){if(G[e])return G[e];let t=Oe(e)||globalThis[e],r=t.prototype,i=e in ue?ue[e]:void 0,o=!!(i&&i.every(u=>{var l,f;return!!((f=(l=Object.getOwnPropertyDescriptor(r,u))==null?void 0:l.get)!=null&&f.toString().includes("[native code]"))})),n=e in de?de[e]:void 0,c=!!(n&&n.every(u=>{var l;return typeof r[u]=="function"&&((l=r[u])==null?void 0:l.toString().includes("[native code]"))}));if(o&&c)return G[e]=t.prototype,t.prototype;try{let u=document.createElement("iframe");document.body.appendChild(u);let l=u.contentWindow;if(!l)return t.prototype;let f=l[e].prototype;return document.body.removeChild(u),f?G[e]=f:r}catch(u){return r}}var K={};function $(e,t,r){var i;let o=`${e}.${String(r)}`;if(K[o])return K[o].call(t);let n=te(e),c=(i=Object.getOwnPropertyDescriptor(n,r))==null?void 0:i.get;return c?(K[o]=c,c.call(t)):t[r]}var Q={};function pe(e,t,r){let i=`${e}.${String(r)}`;if(Q[i])return Q[i].bind(t);let n=te(e)[r];return typeof n!="function"?t[r]:(Q[i]=n,n.bind(t))}function $e(e){return $("Node",e,"childNodes")}function Pe(e){return $("Node",e,"parentNode")}function Be(e){return $("Node",e,"parentElement")}function We(e){return $("Node",e,"textContent")}function Fe(e,t){return pe("Node",e,"contains")(t)}function ze(e){return pe("Node",e,"getRootNode")()}function Ue(e){return!e||!("host"in e)?null:$("ShadowRoot",e,"host")}function He(e){return e.styleSheets}function Ze(e){return!e||!("shadowRoot"in e)?null:$("Element",e,"shadowRoot")}function Ge(e,t){return $("Element",e,"querySelector")(t)}function je(e,t){return $("Element",e,"querySelectorAll")(t)}function Ve(){return te("MutationObserver").constructor}function qe(e,t,r){try{if(!(t in e))return()=>{};let i=e[t],o=r(i);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=o,()=>{e[t]=i}}catch(i){return()=>{}}}var j={childNodes:$e,parentNode:Pe,parentElement:Be,textContent:We,contains:Fe,getRootNode:ze,host:Ue,styleSheets:He,shadowRoot:Ze,querySelector:Ge,querySelectorAll:je,mutationObserver:Ve,patch:qe};function me(e){return e.nodeType===e.ELEMENT_NODE}function Xe(e){let t=e&&"host"in e&&"mode"in e&&j.host(e)||null;return!!(t&&"shadowRoot"in t&&j.shadowRoot(t)===e)}function Ye(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Je(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function ge(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function ye(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);let i=Array.from(t,o=>Se(o,r)).join("");return Je(i)}catch(t){return null}}function Se(e,t){var r;if(be(e)){let i;try{i=ye(e.styleSheet)||ge(e)}catch(o){i=e.cssText}try{if(i&&((r=e.styleSheet)!=null&&r.href))return ee(i,e.styleSheet.href)}catch(o){}return i}else{let i=e.cssText;return xe(e)&&e.selectorText.includes(":")&&(i=Ne(i)),t?ee(i,t):i}}function Ne(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function be(e){return"styleSheet"in e}function xe(e){return"selectorText"in e}var V=class{constructor(){ce(this,"idNodeMap",new Map),ce(this,"nodeMetaMap",new WeakMap)}getId(t){var r;if(!t)return-1;let i=(r=this.getMeta(t))==null?void 0:r.id;return i!=null?i:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let r=this.getId(t);if(this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(i=>this.removeNodeFromMap(i)),me(t)){let i=j.shadowRoot(t);i&&this.removeNodeFromMap(i),t.nodeName==="IFRAME"&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let i=r.id;this.idNodeMap.set(i,t),this.nodeMetaMap.set(t,r)}replace(t,r){let i=this.getNode(t);if(i){let o=this.nodeMetaMap.get(i);o&&this.nodeMetaMap.set(r,o)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Ke(){return new V}function Qe({element:e,maskInputOptions:t,tagName:r,type:i,value:o,maskInputFn:n}){let c=o||"",u=i&&re(i);return(t[r.toLowerCase()]||u&&t[u])&&(n?c=n(c,e):c="*".repeat(c.length)),c}function re(e){return e.toLowerCase()}var fe="__rrweb_original__";function et(e){let t=e.getContext("2d");if(!t)return!0;let r=50;for(let i=0;i<e.width;i+=r)for(let o=0;o<e.height;o+=r){let n=t.getImageData,c=fe in n?n[fe]:n;if(new Uint32Array(c.call(t,i,o,Math.min(r,e.width-i),Math.min(r,e.height-o)).data.buffer).some(l=>l!==0))return!1}return!0}function tt(e,t){return!e||!t||e.type!==t.type?!1:e.type===O.Document?e.compatMode===t.compatMode:e.type===O.DocumentType?e.name===t.name&&e.publicId===t.publicId&&e.systemId===t.systemId:e.type===O.Comment||e.type===O.Text||e.type===O.CDATA?e.textContent===t.textContent:e.type===O.Element?e.tagName===t.tagName&&JSON.stringify(e.attributes)===JSON.stringify(t.attributes)&&e.isSVG===t.isSVG&&e.needBlock===t.needBlock:!1}function rt(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?re(t):null}function it(e,t){var n;let r;try{r=new URL(e,t!=null?t:window.location.href)}catch(c){return null}let i=/\.([0-9a-z]+)(?:$)/i,o=r.pathname.match(i);return(n=o==null?void 0:o[1])!=null?n:null}function ot(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var nt=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,at=/^(?:[a-z+]+:)?\/\//i,st=/^www\..*/i,lt=/^(data:)([^,]*),(.*)/i;function ee(e,t){return(e||"").replace(nt,(r,i,o,n,c,u)=>{let l=o||c||u,f=i||n||"";if(!l)return r;if(at.test(l)||st.test(l))return`url(${f}${l}${f})`;if(lt.test(l))return`url(${f}${l}${f})`;if(l[0]==="/")return`url(${f}${ot(t)+l}${f})`;let h=t.split("/"),E=l.split("/");h.pop();for(let w of E)w!=="."&&(w===".."?h.pop():h.push(w));return`url(${f}${h.join("/")}${f})`})}var ct="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",he=4096;function ut(e,t,r,i){if(!e.complete||e.naturalWidth===0||e.naturalWidth>he||e.naturalHeight>he)return t;try{let o=document.createElement("canvas");o.width=e.naturalWidth,o.height=e.naturalHeight;let n=o.getContext("2d");return n?(n.drawImage(e,0,0),o.toDataURL(r||"image/webp",i!=null?i:.4)):t}catch(o){return t}}function dt(e,t){return!t||e.length<=t?e:ct}var Ie=(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))(Ie||{});S.Mirror=V;S.NodeType=Ie;S.NodeType$1=O;S.absolutifyURLs=ee;S.checkDataURLSize=dt;S.createMirror=Ke;S.escapeImportStatement=ge;S.extractFileExtension=it;S.fixSafariColons=Ne;S.getInputType=rt;S.index=j;S.is2DCanvasBlank=et;S.isCSSImportRule=be;S.isCSSStyleRule=xe;S.isElement=me;S.isNativeShadowDom=Ye;S.isNodeMetaEqual=tt;S.isShadowRoot=Xe;S.maskInputValue=Qe;S.recompressBase64Image=ut;S.stringifyRule=Se;S.stringifyStylesheet=ye;S.toLowerCase=re});var ke=le(C=>{"use strict";var a=ie(),Me=1,ft=new RegExp("[^a-z0-9-_:]"),oe=-2;function De(){return Me++}function ht(e){if(e instanceof HTMLFormElement)return"form";let t=a.toLowerCase(e.tagName);return ft.test(t)?"div":t}var F,Ee,pt=/^[^ \t\n\r\u000c]+/,mt=/^[, \t\n\r\u000c]+/;function gt(e,t){if(t.trim()==="")return t;let r=0;function i(n){let c,u=n.exec(t.substring(r));return u?(c=u[0],r+=c.length,c):""}let o=[];for(;i(mt),!(r>=t.length);){let n=i(pt);if(n.slice(-1)===",")n=z(e,n.substring(0,n.length-1)),o.push(n);else{let c="";n=z(e,n);let u=!1;for(;;){let l=t.charAt(r);if(l===""){o.push((n+c).trim());break}else if(u)l===")"&&(u=!1);else if(l===","){r+=1,o.push((n+c).trim());break}else l==="("&&(u=!0);c+=l,r+=1}}}return o.join(", ")}var we=new WeakMap;function z(e,t){return!t||t.trim()===""?t:ae(e,t)}function yt(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function ae(e,t){let r=we.get(e);if(r||(r=e.createElement("a"),we.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function ve(e,t,r,i,o,n){if(!i)return i;if(r==="src"||r==="href"&&!(t==="use"&&i[0]==="#")){let c=z(e,i);if(t==="img"&&c.startsWith("data:")&&o){let u=o,l=c;return(n!=null&&n.type||(n==null?void 0:n.quality)!==void 0)&&(l=a.recompressBase64Image(u,c,n.type,n.quality)),n!=null&&n.maxBase64ImageLength&&(l=a.checkDataURLSize(l,n.maxBase64ImageLength)),l}return c}else{if(r==="xlink:href"&&i[0]!=="#")return z(e,i);if(r==="background"&&(t==="table"||t==="td"||t==="th"))return z(e,i);if(r==="srcset")return gt(e,i);if(r==="style")return a.absolutifyURLs(i,ae(e));if(t==="object"&&r==="data")return z(e,i)}return i}function _e(e,t,r){return(e==="video"||e==="audio")&&t==="autoplay"}function St(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let i=e.classList.length;i--;){let o=e.classList[i];if(t.test(o))return!0}if(r)return e.matches(r)}catch(i){}return!1}function q(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?q(a.index.parentNode(e),t,r):!1;for(let i=e.classList.length;i--;){let o=e.classList[i];if(t.test(o))return!0}return r?q(a.index.parentNode(e),t,r):!1}function Te(e,t,r,i){let o;if(a.isElement(e)){if(o=e,!a.index.childNodes(o).length)return!1}else{if(a.index.parentElement(e)===null)return!1;o=a.index.parentElement(e)}try{if(typeof t=="string"){if(i){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(q(o,t,i))return!0;if(r){if(i){if(o.closest(r))return!0}else if(o.matches(r))return!0}}catch(n){}return!1}function Nt(e,t,r){let i=e.contentWindow;if(!i)return;let o=!1,n;try{n=i.document.readyState}catch(u){return}if(n!=="complete"){let u=setTimeout(()=>{o||(t(),o=!0)},r);e.addEventListener("load",()=>{clearTimeout(u),o=!0,t()});return}let c="about:blank";if(i.location.href!==c||e.src===c||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function bt(e,t,r){let i=!1,o;try{o=e.sheet}catch(c){return}if(o)return;let n=setTimeout(()=>{i||(t(),i=!0)},r);e.addEventListener("load",()=>{clearTimeout(n),i=!0,t()})}function xt(e,t){let{doc:r,mirror:i,blockClass:o,blockSelector:n,needsMask:c,inlineStylesheet:u,maskInputOptions:l={},maskTextFn:f,maskInputFn:h,dataURLOptions:E={},inlineImages:w,recordCanvas:b,keepIframeSrcFn:_,newlyAddedElement:T=!1}=t,x=It(r,i);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:a.NodeType$1.Document,childNodes:[],compatMode:e.compatMode}:{type:a.NodeType$1.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:a.NodeType$1.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:x};case e.ELEMENT_NODE:return Ct(e,{doc:r,blockClass:o,blockSelector:n,inlineStylesheet:u,maskInputOptions:l,maskInputFn:h,dataURLOptions:E,inlineImages:w,recordCanvas:b,keepIframeSrcFn:_,newlyAddedElement:T,rootId:x});case e.TEXT_NODE:return Et(e,{doc:r,needsMask:c,maskTextFn:f,rootId:x});case e.CDATA_SECTION_NODE:return{type:a.NodeType$1.CDATA,textContent:"",rootId:x};case e.COMMENT_NODE:return{type:a.NodeType$1.Comment,textContent:a.index.textContent(e)||"",rootId:x};default:return!1}}function It(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function Et(e,t){var r;let{needsMask:i,maskTextFn:o,rootId:n}=t,c=a.index.parentNode(e),u=c&&c.tagName,l=a.index.textContent(e),f=u==="STYLE"?!0:void 0,h=u==="SCRIPT"?!0:void 0;if(f&&l){try{e.nextSibling||e.previousSibling||(r=c.sheet)!=null&&r.cssRules&&(l=a.stringifyStylesheet(c.sheet))}catch(E){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${E}`,e)}l=a.absolutifyURLs(l,ae(t.doc))}return h&&(l="SCRIPT_PLACEHOLDER"),!f&&!h&&l&&i&&(l=o?o(l,a.index.parentElement(e)):l.replace(/[\S]/g,"*")),{type:a.NodeType$1.Text,textContent:l||"",isStyle:f,rootId:n}}function Ce(e,t){return Array.from(e.styleSheets).find(r=>r.href===t)}function wt(e){return e.href}function Ct(e,t){var r,i;let{doc:o,blockClass:n,blockSelector:c,inlineStylesheet:u,maskInputOptions:l={},maskInputFn:f,dataURLOptions:h={},inlineImages:E,recordCanvas:w,keepIframeSrcFn:b,newlyAddedElement:_=!1,rootId:T}=t,x=St(e,n,c),g=ht(e),d={},L=e.attributes.length;for(let s=0;s<L;s++){let p=e.attributes[s];_e(g,p.name,p.value)||(d[p.name]=ve(o,g,a.toLowerCase(p.name),p.value,e,h))}if(g==="link"&&u){let s=wt(e);if(s){let p=Ce(o,s);if(!p&&s.includes(".css")){let I=window.location.origin,k=s.replace(window.location.href,""),A=I+"/"+k;p=Ce(o,A)}let M=null;p&&(M=a.stringifyStylesheet(p)),M&&(delete d.rel,delete d.href,d._cssText=M)}}if(g==="style"&&e.sheet&&!(e.innerText||a.index.textContent(e)||"").trim().length){let s=a.stringifyStylesheet(e.sheet);s&&(d._cssText=s)}if(g==="input"||g==="textarea"||g==="select"){let s=e.value,p=e.checked;d.type!=="radio"&&d.type!=="checkbox"&&d.type!=="submit"&&d.type!=="button"&&s?d.value=a.maskInputValue({element:e,type:a.getInputType(e),tagName:g,value:s,maskInputOptions:l,maskInputFn:f}):p&&(d.checked=p)}if(g==="option"&&(e.selected&&!l.select?d.selected=!0:delete d.selected),g==="dialog"&&e.open)try{d.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(s){d.rr_open_mode="modal",d.ph_rr_could_not_detect_modal=!0}if(g==="canvas"&&w){if(e.__context==="2d")a.is2DCanvasBlank(e)||(d.rr_dataURL=e.toDataURL(h.type,h.quality));else if(!("__context"in e)){let s=e.toDataURL(h.type,h.quality),p=o.createElement("canvas");p.width=e.width,p.height=e.height;let M=p.toDataURL(h.type,h.quality);s!==M&&(d.rr_dataURL=s)}}if(g==="img"&&E){F||(F=o.createElement("canvas"),Ee=F.getContext("2d"));let s=e,p=s.currentSrc||s.getAttribute("src")||"<unknown-src>",M=s.crossOrigin,I=()=>{s.removeEventListener("load",I);try{F.width=s.naturalWidth,F.height=s.naturalHeight,Ee.drawImage(s,0,0),d.rr_dataURL=F.toDataURL(h.type,h.quality)}catch(k){if(s.crossOrigin!=="anonymous"){s.crossOrigin="anonymous",s.complete&&s.naturalWidth!==0?I():s.addEventListener("load",I);return}else console.warn(`Cannot inline img src=${p}! Error: ${k}`)}s.crossOrigin==="anonymous"&&(M?d.crossOrigin=M:s.removeAttribute("crossorigin"))};s.complete&&s.naturalWidth!==0?I():s.addEventListener("load",I)}if(g==="audio"||g==="video"){let s=d;s.rr_mediaState=e.paused?"paused":"played",s.rr_mediaCurrentTime=e.currentTime,s.rr_mediaPlaybackRate=e.playbackRate,s.rr_mediaMuted=e.muted,s.rr_mediaLoop=e.loop,s.rr_mediaVolume=e.volume}if(_||(e.scrollLeft&&(d.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(d.rr_scrollTop=e.scrollTop)),x){let{width:s,height:p,left:M,top:I}=e.getBoundingClientRect();d={class:d.class,rr_width:`${s}px`,rr_height:`${p}px`,rr_left:`${Math.floor(M+(((r=o.defaultView)==null?void 0:r.scrollX)||0))}px`,rr_top:`${Math.floor(I+(((i=o.defaultView)==null?void 0:i.scrollY)||0))}px`}}g==="iframe"&&!b(d.src)&&(e.contentDocument||(d.rr_src=d.src),delete d.src);let R;try{customElements.get(g)&&(R=!0)}catch(s){}return{type:a.NodeType$1.Element,tagName:g,attributes:d,childNodes:[],isSVG:yt(e)||void 0,needBlock:x,rootId:T,isCustom:R}}function m(e){return e==null?"":e.toLowerCase()}function Mt(e,t){if(t.comment&&e.type===a.NodeType$1.Comment)return!0;if(e.type===a.NodeType$1.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&a.extractFileExtension(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(m(e.attributes.name).match(/^msapplication-tile(image|color)$/)||m(e.attributes.name)==="application-name"||m(e.attributes.rel)==="icon"||m(e.attributes.rel)==="apple-touch-icon"||m(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&m(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(m(e.attributes.property).match(/^(og|twitter|fb):/)||m(e.attributes.name).match(/^(og|twitter):/)||m(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(m(e.attributes.name)==="robots"||m(e.attributes.name)==="googlebot"||m(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(m(e.attributes.name)==="author"||m(e.attributes.name)==="generator"||m(e.attributes.name)==="framework"||m(e.attributes.name)==="publisher"||m(e.attributes.name)==="progid"||m(e.attributes.property).match(/^article:/)||m(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(m(e.attributes.name)==="google-site-verification"||m(e.attributes.name)==="yandex-verification"||m(e.attributes.name)==="csrf-token"||m(e.attributes.name)==="p:domain_verify"||m(e.attributes.name)==="verify-v1"||m(e.attributes.name)==="verification"||m(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}var Re=50,ne=!1,se=!1;function Dt(){return se}function vt(){se=!1,ne=!1}function U(e,t){let{doc:r,mirror:i,blockClass:o,blockSelector:n,maskTextClass:c,maskTextSelector:u,skipChild:l=!1,inlineStylesheet:f=!0,maskInputOptions:h={},maskTextFn:E,maskInputFn:w,slimDOMOptions:b,dataURLOptions:_={},inlineImages:T=!1,recordCanvas:x=!1,onSerialize:g,onIframeLoad:d,iframeLoadTimeout:L=5e3,onStylesheetLoad:R,stylesheetLoadTimeout:s=5e3,keepIframeSrcFn:p=()=>!1,newlyAddedElement:M=!1,depth:I=0,maxDepth:k=Re}=t,{needsMask:A}=t,{preserveWhiteSpace:H=!0}=t;if(I>=k)return se=!0,ne||(ne=!0,console.warn(`[rrweb-snapshot] DOM tree depth exceeded max depth of ${k}. Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.`)),null;A||(A=Te(e,c,u,A===void 0));let P=xt(e,{doc:r,mirror:i,blockClass:o,blockSelector:n,needsMask:A,inlineStylesheet:f,maskInputOptions:h,maskTextFn:E,maskInputFn:w,dataURLOptions:_,inlineImages:T,recordCanvas:x,keepIframeSrcFn:p,newlyAddedElement:M});if(!P)return console.warn(e,"not serialized"),null;let Z;i.hasNode(e)?Z=i.getId(e):Mt(P,b)||!H&&P.type===a.NodeType$1.Text&&!P.isStyle&&!P.textContent.replace(/^\s+|\s+$/gm,"").length?Z=oe:Z=De();let y=Object.assign(P,{id:Z});if(i.add(e,y),Z===oe)return null;g&&g(e);let X=!l;if(y.type===a.NodeType$1.Element){X=X&&!y.needBlock,delete y.needBlock;let D=a.index.shadowRoot(e);D&&a.isNativeShadowDom(D)&&(y.isShadowHost=!0)}if((y.type===a.NodeType$1.Document||y.type===a.NodeType$1.Element)&&X){b.headWhitespace&&y.type===a.NodeType$1.Element&&y.tagName==="head"&&(H=!1);let D={doc:r,mirror:i,blockClass:o,blockSelector:n,needsMask:A,maskTextClass:c,maskTextSelector:u,skipChild:l,inlineStylesheet:f,maskInputOptions:h,maskTextFn:E,maskInputFn:w,slimDOMOptions:b,dataURLOptions:_,inlineImages:T,recordCanvas:x,preserveWhiteSpace:H,onSerialize:g,onIframeLoad:d,iframeLoadTimeout:L,onStylesheetLoad:R,stylesheetLoadTimeout:s,keepIframeSrcFn:p,depth:I+1,maxDepth:k};if(!(y.type===a.NodeType$1.Element&&y.tagName==="textarea"&&y.attributes.value!==void 0))for(let J of Array.from(a.index.childNodes(e))){let W=U(J,D);W&&y.childNodes.push(W)}let B=null;if(a.isElement(e)&&(B=a.index.shadowRoot(e)))for(let J of Array.from(a.index.childNodes(B))){let W=U(J,D);W&&(a.isNativeShadowDom(B)&&(W.isShadow=!0),y.childNodes.push(W))}}let Y=a.index.parentNode(e);return Y&&a.isShadowRoot(Y)&&a.isNativeShadowDom(Y)&&(y.isShadow=!0),y.type===a.NodeType$1.Element&&y.tagName==="iframe"&&Nt(e,()=>{let D=e.contentDocument;if(D&&d){let B=U(D,{doc:D,mirror:i,blockClass:o,blockSelector:n,needsMask:A,maskTextClass:c,maskTextSelector:u,skipChild:!1,inlineStylesheet:f,maskInputOptions:h,maskTextFn:E,maskInputFn:w,slimDOMOptions:b,dataURLOptions:_,inlineImages:T,recordCanvas:x,preserveWhiteSpace:H,onSerialize:g,onIframeLoad:d,iframeLoadTimeout:L,onStylesheetLoad:R,stylesheetLoadTimeout:s,keepIframeSrcFn:p,depth:I+1,maxDepth:k});B&&d(e,B)}},L),y.type===a.NodeType$1.Element&&y.tagName==="link"&&typeof y.attributes.rel=="string"&&(y.attributes.rel==="stylesheet"||y.attributes.rel==="preload"&&typeof y.attributes.href=="string"&&a.extractFileExtension(y.attributes.href)==="css")&&bt(e,()=>{if(R){let D=U(e,{doc:r,mirror:i,blockClass:o,blockSelector:n,needsMask:A,maskTextClass:c,maskTextSelector:u,skipChild:!1,inlineStylesheet:f,maskInputOptions:h,maskTextFn:E,maskInputFn:w,slimDOMOptions:b,dataURLOptions:_,inlineImages:T,recordCanvas:x,preserveWhiteSpace:H,onSerialize:g,onIframeLoad:d,iframeLoadTimeout:L,onStylesheetLoad:R,stylesheetLoadTimeout:s,keepIframeSrcFn:p,depth:I,maxDepth:k});D&&R(e,D)}},s),y}function _t(e,t){let{mirror:r=new a.Mirror,blockClass:i="rr-block",blockSelector:o=null,maskTextClass:n="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,inlineImages:l=!1,recordCanvas:f=!1,maskAllInputs:h=!1,maskTextFn:E,maskInputFn:w,slimDOM:b=!1,dataURLOptions:_,preserveWhiteSpace:T,onSerialize:x,onIframeLoad:g,iframeLoadTimeout:d,onStylesheetLoad:L,stylesheetLoadTimeout:R,keepIframeSrcFn:s=()=>!1,maxDepth:p}=t||{};return U(e,{doc:e,mirror:r,blockClass:i,blockSelector:o,maskTextClass:n,maskTextSelector:c,skipChild:!1,inlineStylesheet:u,maskInputOptions:h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:h===!1?{password:!0}:h,maskTextFn:E,maskInputFn:w,slimDOMOptions:b===!0||b==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:b==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:b===!1?{}:b,dataURLOptions:_,inlineImages:l,recordCanvas:f,preserveWhiteSpace:T,onSerialize:x,onIframeLoad:g,iframeLoadTimeout:d,onStylesheetLoad:L,stylesheetLoadTimeout:R,keepIframeSrcFn:s,newlyAddedElement:!1,maxDepth:p})}function Tt(e,t){function r(i){t(i),(i.type===a.NodeType$1.Document||i.type===a.NodeType$1.Element)&&i.childNodes.forEach(r)}r(e)}function Rt(){Me=1}C.DEFAULT_MAX_DEPTH=Re;C.IGNORED_NODE=oe;C.classMatchesRegex=q;C.cleanupSnapshot=Rt;C.genId=De;C.ignoreAttribute=_e;C.needMaskingText=Te;C.resetMaxDepthState=vt;C.serializeNodeWithId=U;C.snapshot=_t;C.transformAttribute=ve;C.visitSnapshot=Tt;C.wasMaxDepthReached=Dt});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var v=ke(),N=ie();exports.DEFAULT_MAX_DEPTH=v.DEFAULT_MAX_DEPTH;exports.IGNORED_NODE=v.IGNORED_NODE;exports.classMatchesRegex=v.classMatchesRegex;exports.cleanupSnapshot=v.cleanupSnapshot;exports.genId=v.genId;exports.ignoreAttribute=v.ignoreAttribute;exports.needMaskingText=v.needMaskingText;exports.serializeNodeWithId=v.serializeNodeWithId;exports.snapshot=v.snapshot;exports.transformAttribute=v.transformAttribute;exports.visitSnapshot=v.visitSnapshot;exports.wasMaxDepthReached=v.wasMaxDepthReached;exports.Mirror=N.Mirror;exports.NodeType=N.NodeType;exports.absolutifyURLs=N.absolutifyURLs;exports.checkDataURLSize=N.checkDataURLSize;exports.createMirror=N.createMirror;exports.escapeImportStatement=N.escapeImportStatement;exports.extractFileExtension=N.extractFileExtension;exports.fixSafariColons=N.fixSafariColons;exports.getInputType=N.getInputType;exports.is2DCanvasBlank=N.is2DCanvasBlank;exports.isCSSImportRule=N.isCSSImportRule;exports.isCSSStyleRule=N.isCSSStyleRule;exports.isElement=N.isElement;exports.isNativeShadowDom=N.isNativeShadowDom;exports.isNodeMetaEqual=N.isNodeMetaEqual;exports.isShadowRoot=N.isShadowRoot;exports.maskInputValue=N.maskInputValue;exports.recompressBase64Image=N.recompressBase64Image;exports.stringifyRule=N.stringifyRule;exports.stringifyStylesheet=N.stringifyStylesheet;exports.toLowerCase=N.toLowerCase;
2
+ "use strict";var le=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var oe=le(y=>{"use strict";var Le=Object.defineProperty,$e=(e,t,r)=>t in e?Le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ce=(e,t,r)=>$e(e,typeof t!="symbol"?t+"":t,r),$=(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))($||{}),ue={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},de={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},G={};function Oe(e){var t,r;let o=(r=(t=globalThis==null?void 0:globalThis.Zone)==null?void 0:t.__symbol__)==null?void 0:r.call(t,e);if(o&&globalThis[o])return globalThis[o]}function te(e){if(G[e])return G[e];let t=Oe(e)||globalThis[e],r=t.prototype,o=e in ue?ue[e]:void 0,i=!!(o&&o.every(u=>{var l,f;return!!((f=(l=Object.getOwnPropertyDescriptor(r,u))==null?void 0:l.get)!=null&&f.toString().includes("[native code]"))})),n=e in de?de[e]:void 0,c=!!(n&&n.every(u=>{var l;return typeof r[u]=="function"&&((l=r[u])==null?void 0:l.toString().includes("[native code]"))}));if(i&&c)return G[e]=t.prototype,t.prototype;try{let u=document.createElement("iframe");document.body.appendChild(u);let l=u.contentWindow;if(!l)return t.prototype;let f=l[e].prototype;return document.body.removeChild(u),f?G[e]=f:r}catch(u){return r}}var K={};function O(e,t,r){var o;let i=`${e}.${String(r)}`;if(K[i])return K[i].call(t);let n=te(e),c=(o=Object.getOwnPropertyDescriptor(n,r))==null?void 0:o.get;return c?(K[i]=c,c.call(t)):t[r]}var Q={};function pe(e,t,r){let o=`${e}.${String(r)}`;if(Q[o])return Q[o].bind(t);let n=te(e)[r];return typeof n!="function"?t[r]:(Q[o]=n,n.bind(t))}function Pe(e){return O("Node",e,"childNodes")}function Be(e){return O("Node",e,"parentNode")}function We(e){return O("Node",e,"parentElement")}function Fe(e){return O("Node",e,"textContent")}function ze(e,t){return pe("Node",e,"contains")(t)}function Ue(e){return pe("Node",e,"getRootNode")()}function He(e){return!e||!("host"in e)?null:O("ShadowRoot",e,"host")}function Ze(e){return e.styleSheets}function Ge(e){return!e||!("shadowRoot"in e)?null:O("Element",e,"shadowRoot")}function je(e,t){return O("Element",e,"querySelector")(t)}function Ve(e,t){return O("Element",e,"querySelectorAll")(t)}function qe(){return te("MutationObserver").constructor}function Xe(e,t,r){try{if(!(t in e))return()=>{};let o=e[t],i=r(o);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:o}})),e[t]=i,()=>{e[t]=o}}catch(o){return()=>{}}}var j={childNodes:Pe,parentNode:Be,parentElement:We,textContent:Fe,contains:ze,getRootNode:Ue,host:He,styleSheets:Ze,shadowRoot:Ge,querySelector:je,querySelectorAll:Ve,mutationObserver:qe,patch:Xe};function me(e){return e.nodeType===e.ELEMENT_NODE}function Ye(e){let t=e&&"host"in e&&"mode"in e&&j.host(e)||null;return!!(t&&"shadowRoot"in t&&j.shadowRoot(t)===e)}function Je(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Ke(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function ge(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function ye(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);let o=Array.from(t,i=>Se(i,r)).join("");return Ke(o)}catch(t){return null}}function Se(e,t){var r;if(xe(e)){let o;try{o=ye(e.styleSheet)||ge(e)}catch(i){o=e.cssText}try{if(o&&((r=e.styleSheet)!=null&&r.href))return ee(o,e.styleSheet.href)}catch(i){}return o}else{let o=e.cssText;return Ie(e)&&e.selectorText.includes(":")&&(o=Ne(o)),t?ee(o,t):o}}function Ne(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function xe(e){return"styleSheet"in e}function Ie(e){return"selectorText"in e}var V=class{constructor(){ce(this,"idNodeMap",new Map),ce(this,"nodeMetaMap",new WeakMap)}getId(t){var r;if(!t)return-1;let o=(r=this.getMeta(t))==null?void 0:r.id;return o!=null?o:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let r=this.getId(t);if(this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(o=>this.removeNodeFromMap(o)),me(t)){let o=j.shadowRoot(t);o&&this.removeNodeFromMap(o),t.nodeName==="IFRAME"&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let o=r.id;this.idNodeMap.set(o,t),this.nodeMetaMap.set(t,r)}replace(t,r){let o=this.getNode(t);if(o){let i=this.nodeMetaMap.get(o);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Qe(){return new V}function et({element:e,maskInputOptions:t,tagName:r,type:o,value:i,maskInputFn:n}){let c=i||"",u=o&&re(o);return(t[r.toLowerCase()]||u&&t[u])&&(n?c=n(c,e):c="*".repeat(c.length)),c}function re(e){return e.toLowerCase()}var fe="__rrweb_original__";function tt(e){let t=e.getContext("2d");if(!t)return!0;let r=50;for(let o=0;o<e.width;o+=r)for(let i=0;i<e.height;i+=r){let n=t.getImageData,c=fe in n?n[fe]:n;if(new Uint32Array(c.call(t,o,i,Math.min(r,e.width-o),Math.min(r,e.height-i)).data.buffer).some(l=>l!==0))return!1}return!0}function rt(e,t){return!e||!t||e.type!==t.type?!1:e.type===$.Document?e.compatMode===t.compatMode:e.type===$.DocumentType?e.name===t.name&&e.publicId===t.publicId&&e.systemId===t.systemId:e.type===$.Comment||e.type===$.Text||e.type===$.CDATA?e.textContent===t.textContent:e.type===$.Element?e.tagName===t.tagName&&JSON.stringify(e.attributes)===JSON.stringify(t.attributes)&&e.isSVG===t.isSVG&&e.needBlock===t.needBlock:!1}function ot(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?re(t):null}function it(e,t){var n;let r;try{r=new URL(e,t!=null?t:window.location.href)}catch(c){return null}let o=/\.([0-9a-z]+)(?:$)/i,i=r.pathname.match(o);return(n=i==null?void 0:i[1])!=null?n:null}function nt(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var at=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,st=/^(?:[a-z+]+:)?\/\//i,lt=/^www\..*/i,ct=/^(data:)([^,]*),(.*)/i;function ee(e,t){return(e||"").replace(at,(r,o,i,n,c,u)=>{let l=i||c||u,f=o||n||"";if(!l)return r;if(st.test(l)||lt.test(l))return`url(${f}${l}${f})`;if(ct.test(l))return`url(${f}${l}${f})`;if(l[0]==="/")return`url(${f}${nt(t)+l}${f})`;let h=t.split("/"),E=l.split("/");h.pop();for(let b of E)b!=="."&&(b===".."?h.pop():h.push(b));return`url(${f}${h.join("/")}${f})`})}var ut="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",he=4096;function dt(e,t,r,o){if(!e.complete||e.naturalWidth===0||e.naturalWidth>he||e.naturalHeight>he)return t;try{let i=document.createElement("canvas");i.width=e.naturalWidth,i.height=e.naturalHeight;let n=i.getContext("2d");return n?(n.drawImage(e,0,0),i.toDataURL(r||"image/webp",o!=null?o:.4)):t}catch(i){return t}}function ft(e,t){return!t||e.length<=t?e:ut}var Ee=(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))(Ee||{});y.Mirror=V;y.NodeType=Ee;y.NodeType$1=$;y.absolutifyURLs=ee;y.checkDataURLSize=ft;y.createMirror=Qe;y.escapeImportStatement=ge;y.extractFileExtension=it;y.fixSafariColons=Ne;y.getInputType=ot;y.index=j;y.is2DCanvasBlank=tt;y.isCSSImportRule=xe;y.isCSSStyleRule=Ie;y.isElement=me;y.isNativeShadowDom=Je;y.isNodeMetaEqual=rt;y.isShadowRoot=Ye;y.maskInputValue=et;y.recompressBase64Image=dt;y.stringifyRule=Se;y.stringifyStylesheet=ye;y.toLowerCase=re});var ke=le(I=>{"use strict";var a=oe(),Me=1,ht=new RegExp("[^a-z0-9-_:]"),ie=-2;function ve(){return Me++}function pt(e){if(e instanceof HTMLFormElement)return"form";let t=a.toLowerCase(e.tagName);return ht.test(t)?"div":t}var F,be,mt=/^[^ \t\n\r\u000c]+/,gt=/^[, \t\n\r\u000c]+/;function yt(e,t){if(t.trim()==="")return t;let r=0;function o(n){let c,u=n.exec(t.substring(r));return u?(c=u[0],r+=c.length,c):""}let i=[];for(;o(gt),!(r>=t.length);){let n=o(mt);if(n.slice(-1)===",")n=z(e,n.substring(0,n.length-1)),i.push(n);else{let c="";n=z(e,n);let u=!1;for(;;){let l=t.charAt(r);if(l===""){i.push((n+c).trim());break}else if(u)l===")"&&(u=!1);else if(l===","){r+=1,i.push((n+c).trim());break}else l==="("&&(u=!0);c+=l,r+=1}}}return i.join(", ")}var we=new WeakMap;function z(e,t){return!t||t.trim()===""?t:ae(e,t)}function St(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function ae(e,t){let r=we.get(e);if(r||(r=e.createElement("a"),we.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function _e(e,t,r,o,i,n){if(!o)return o;if(r==="src"||r==="href"&&!(t==="use"&&o[0]==="#")){let c=z(e,o);if(t==="img"&&c.startsWith("data:")&&i){let u=i,l=c;return(n!=null&&n.type||(n==null?void 0:n.quality)!==void 0)&&(l=a.recompressBase64Image(u,c,n.type,n.quality)),n!=null&&n.maxBase64ImageLength&&(l=a.checkDataURLSize(l,n.maxBase64ImageLength)),l}return c}else{if(r==="xlink:href"&&o[0]!=="#")return z(e,o);if(r==="background"&&(t==="table"||t==="td"||t==="th"))return z(e,o);if(r==="srcset")return yt(e,o);if(r==="style")return a.absolutifyURLs(o,ae(e));if(t==="object"&&r==="data")return z(e,o)}return o}function De(e,t,r){return(e==="video"||e==="audio")&&t==="autoplay"}function Nt(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let o=e.classList.length;o--;){let i=e.classList[o];if(t.test(i))return!0}if(r)return e.matches(r)}catch(o){}return!1}function q(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?q(a.index.parentNode(e),t,r):!1;for(let o=e.classList.length;o--;){let i=e.classList[o];if(t.test(i))return!0}return r?q(a.index.parentNode(e),t,r):!1}function Te(e,t,r,o){let i;if(a.isElement(e)){if(i=e,!a.index.childNodes(i).length)return!1}else{if(a.index.parentElement(e)===null)return!1;i=a.index.parentElement(e)}try{if(typeof t=="string"){if(o){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(q(i,t,o))return!0;if(r){if(o){if(i.closest(r))return!0}else if(i.matches(r))return!0}}catch(n){}return!1}function xt(e,t,r){let o=e.contentWindow;if(!o)return;let i=!1,n;try{n=o.document.readyState}catch(u){return}if(n!=="complete"){let u=setTimeout(()=>{i||(t(),i=!0)},r);e.addEventListener("load",()=>{clearTimeout(u),i=!0,t()});return}let c="about:blank";if(o.location.href!==c||e.src===c||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function It(e,t,r){let o=!1,i;try{i=e.sheet}catch(c){return}if(i)return;let n=setTimeout(()=>{o||(t(),o=!0)},r);e.addEventListener("load",()=>{clearTimeout(n),o=!0,t()})}function Et(e,t){let{doc:r,mirror:o,blockClass:i,blockSelector:n,needsMask:c,inlineStylesheet:u,maskInputOptions:l={},maskTextFn:f,maskInputFn:h,dataURLOptions:E={},inlineImages:b,recordCanvas:_,keepIframeSrcFn:D,newlyAddedElement:T=!1}=t,x=bt(r,o);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:a.NodeType$1.Document,childNodes:[],compatMode:e.compatMode}:{type:a.NodeType$1.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:a.NodeType$1.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:x};case e.ELEMENT_NODE:return Mt(e,{doc:r,blockClass:i,blockSelector:n,inlineStylesheet:u,maskInputOptions:l,maskInputFn:h,dataURLOptions:E,inlineImages:b,recordCanvas:_,keepIframeSrcFn:D,newlyAddedElement:T,rootId:x});case e.TEXT_NODE:return wt(e,{doc:r,needsMask:c,maskTextFn:f,rootId:x});case e.CDATA_SECTION_NODE:return{type:a.NodeType$1.CDATA,textContent:"",rootId:x};case e.COMMENT_NODE:return{type:a.NodeType$1.Comment,textContent:a.index.textContent(e)||"",rootId:x};default:return!1}}function bt(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function wt(e,t){var r;let{needsMask:o,maskTextFn:i,rootId:n}=t,c=a.index.parentNode(e),u=c&&c.tagName,l=a.index.textContent(e),f=u==="STYLE"?!0:void 0,h=u==="SCRIPT"?!0:void 0;if(f&&l){try{e.nextSibling||e.previousSibling||(r=c.sheet)!=null&&r.cssRules&&(l=a.stringifyStylesheet(c.sheet))}catch(E){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${E}`,e)}l=a.absolutifyURLs(l,ae(t.doc))}return h&&(l="SCRIPT_PLACEHOLDER"),!f&&!h&&l&&o&&(l=i?i(l,a.index.parentElement(e)):l.replace(/[\S]/g,"*")),{type:a.NodeType$1.Text,textContent:l||"",isStyle:f,rootId:n}}function Ce(e,t){return Array.from(e.styleSheets).find(r=>r.href===t)}function Ct(e){return e.href}function Mt(e,t){var r,o;let{doc:i,blockClass:n,blockSelector:c,inlineStylesheet:u,maskInputOptions:l={},maskInputFn:f,dataURLOptions:h={},inlineImages:E,recordCanvas:b,keepIframeSrcFn:_,newlyAddedElement:D=!1,rootId:T}=t,x=Nt(e,n,c),m=pt(e),d={},L=e.attributes.length;for(let s=0;s<L;s++){let p=e.attributes[s];De(m,p.name,p.value)||(d[p.name]=_e(i,m,a.toLowerCase(p.name),p.value,e,h))}if(m==="link"&&u){let s=Ct(e);if(s){let p=Ce(i,s);if(!p&&s.includes(".css")){let N=window.location.origin,A=s.replace(window.location.href,""),k=N+"/"+A;p=Ce(i,k)}let w=null;p&&(w=a.stringifyStylesheet(p)),w&&(delete d.rel,delete d.href,d._cssText=w)}}if(m==="style"&&e.sheet&&!(e.innerText||a.index.textContent(e)||"").trim().length){let s=a.stringifyStylesheet(e.sheet);s&&(d._cssText=s)}if(m==="input"||m==="textarea"||m==="select"){let s=e.value,p=e.checked;d.type!=="radio"&&d.type!=="checkbox"&&d.type!=="submit"&&d.type!=="button"&&s?d.value=a.maskInputValue({element:e,type:a.getInputType(e),tagName:m,value:s,maskInputOptions:l,maskInputFn:f}):p&&(d.checked=p)}if(m==="option"&&(e.selected&&!l.select?d.selected=!0:delete d.selected),m==="dialog"&&e.open)try{d.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(s){d.rr_open_mode="modal",d.ph_rr_could_not_detect_modal=!0}if(m==="canvas"&&b){if(e.__context==="2d")a.is2DCanvasBlank(e)||(d.rr_dataURL=e.toDataURL(h.type,h.quality));else if(!("__context"in e)){let s=e.toDataURL(h.type,h.quality),p=i.createElement("canvas");p.width=e.width,p.height=e.height;let w=p.toDataURL(h.type,h.quality);s!==w&&(d.rr_dataURL=s)}}if(m==="img"&&E){F||(F=i.createElement("canvas"),be=F.getContext("2d"));let s=e,p=s.currentSrc||s.getAttribute("src")||"<unknown-src>",w=s.crossOrigin,N=()=>{s.removeEventListener("load",N);try{F.width=s.naturalWidth,F.height=s.naturalHeight,be.drawImage(s,0,0),d.rr_dataURL=F.toDataURL(h.type,h.quality)}catch(A){if(s.crossOrigin!=="anonymous"){s.crossOrigin="anonymous",s.complete&&s.naturalWidth!==0?N():s.addEventListener("load",N);return}else console.warn(`Cannot inline img src=${p}! Error: ${A}`)}s.crossOrigin==="anonymous"&&(w?d.crossOrigin=w:s.removeAttribute("crossorigin"))};s.complete&&s.naturalWidth!==0?N():s.addEventListener("load",N)}if(m==="audio"||m==="video"){let s=d;s.rr_mediaState=e.paused?"paused":"played",s.rr_mediaCurrentTime=e.currentTime,s.rr_mediaPlaybackRate=e.playbackRate,s.rr_mediaMuted=e.muted,s.rr_mediaLoop=e.loop,s.rr_mediaVolume=e.volume}if(D||(e.scrollLeft&&(d.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(d.rr_scrollTop=e.scrollTop)),x){let{width:s,height:p,left:w,top:N}=e.getBoundingClientRect();d={class:d.class,rr_width:`${s}px`,rr_height:`${p}px`,rr_left:`${Math.floor(w+(((r=i.defaultView)==null?void 0:r.scrollX)||0))}px`,rr_top:`${Math.floor(N+(((o=i.defaultView)==null?void 0:o.scrollY)||0))}px`}}m==="iframe"&&!_(d.src)&&(e.contentDocument||(d.rr_src=d.src),delete d.src);let R;try{customElements.get(m)&&(R=!0)}catch(s){}return{type:a.NodeType$1.Element,tagName:m,attributes:d,childNodes:[],isSVG:St(e)||void 0,needBlock:x,rootId:T,isCustom:R}}function M(e){return e==null?"":e.toLowerCase()}function vt(e,t){if(t.comment&&e.type===a.NodeType$1.Comment)return!0;if(e.type===a.NodeType$1.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&a.extractFileExtension(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(M(e.attributes.name).match(/^msapplication-tile(image|color)$/)||M(e.attributes.name)==="application-name"||["icon","apple-touch-icon","shortcut icon"].includes(M(e.attributes.rel)))))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&M(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(M(e.attributes.property).match(/^(og|twitter|fb):/)||M(e.attributes.name).match(/^(og|twitter):/)||M(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&["robots","googlebot","bingbot"].includes(M(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(M(e.attributes.name))||M(e.attributes.property).match(/^article:/)||M(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(M(e.attributes.name)))return!0}}return!1}var Re=50,ne=!1,se=!1;function _t(){return se}function Dt(){se=!1,ne=!1}function U(e,t){let{doc:r,mirror:o,blockClass:i,blockSelector:n,maskTextClass:c,maskTextSelector:u,skipChild:l=!1,inlineStylesheet:f=!0,maskInputOptions:h={},maskTextFn:E,maskInputFn:b,slimDOMOptions:_,dataURLOptions:D={},inlineImages:T=!1,recordCanvas:x=!1,onSerialize:m,onIframeLoad:d,iframeLoadTimeout:L=5e3,onStylesheetLoad:R,stylesheetLoadTimeout:s=5e3,keepIframeSrcFn:p=()=>!1,newlyAddedElement:w=!1,depth:N=0,maxDepth:A=Re}=t,{needsMask:k}=t,{preserveWhiteSpace:H=!0}=t;if(N>=A)return se=!0,ne||(ne=!0,console.warn(`[rrweb-snapshot] DOM tree depth exceeded max depth of ${A}. Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.`)),null;k||(k=Te(e,c,u,k===void 0));let P=Et(e,{doc:r,mirror:o,blockClass:i,blockSelector:n,needsMask:k,inlineStylesheet:f,maskInputOptions:h,maskTextFn:E,maskInputFn:b,dataURLOptions:D,inlineImages:T,recordCanvas:x,keepIframeSrcFn:p,newlyAddedElement:w});if(!P)return console.warn(e,"not serialized"),null;let Z;o.hasNode(e)?Z=o.getId(e):vt(P,_)||!H&&P.type===a.NodeType$1.Text&&!P.isStyle&&!P.textContent.replace(/^\s+|\s+$/gm,"").length?Z=ie:Z=ve();let g=Object.assign(P,{id:Z});if(o.add(e,g),Z===ie)return null;m&&m(e);let X=!l;if(g.type===a.NodeType$1.Element){X=X&&!g.needBlock,delete g.needBlock;let C=a.index.shadowRoot(e);C&&a.isNativeShadowDom(C)&&(g.isShadowHost=!0)}if((g.type===a.NodeType$1.Document||g.type===a.NodeType$1.Element)&&X){_.headWhitespace&&g.type===a.NodeType$1.Element&&g.tagName==="head"&&(H=!1);let C={doc:r,mirror:o,blockClass:i,blockSelector:n,needsMask:k,maskTextClass:c,maskTextSelector:u,skipChild:l,inlineStylesheet:f,maskInputOptions:h,maskTextFn:E,maskInputFn:b,slimDOMOptions:_,dataURLOptions:D,inlineImages:T,recordCanvas:x,preserveWhiteSpace:H,onSerialize:m,onIframeLoad:d,iframeLoadTimeout:L,onStylesheetLoad:R,stylesheetLoadTimeout:s,keepIframeSrcFn:p,depth:N+1,maxDepth:A};if(!(g.type===a.NodeType$1.Element&&g.tagName==="textarea"&&g.attributes.value!==void 0))for(let J of Array.from(a.index.childNodes(e))){let W=U(J,C);W&&g.childNodes.push(W)}let B=null;if(a.isElement(e)&&(B=a.index.shadowRoot(e)))for(let J of Array.from(a.index.childNodes(B))){let W=U(J,C);W&&(a.isNativeShadowDom(B)&&(W.isShadow=!0),g.childNodes.push(W))}}let Y=a.index.parentNode(e);return Y&&a.isShadowRoot(Y)&&a.isNativeShadowDom(Y)&&(g.isShadow=!0),g.type===a.NodeType$1.Element&&g.tagName==="iframe"&&xt(e,()=>{let C=e.contentDocument;if(C&&d){let B=U(C,{doc:C,mirror:o,blockClass:i,blockSelector:n,needsMask:k,maskTextClass:c,maskTextSelector:u,skipChild:!1,inlineStylesheet:f,maskInputOptions:h,maskTextFn:E,maskInputFn:b,slimDOMOptions:_,dataURLOptions:D,inlineImages:T,recordCanvas:x,preserveWhiteSpace:H,onSerialize:m,onIframeLoad:d,iframeLoadTimeout:L,onStylesheetLoad:R,stylesheetLoadTimeout:s,keepIframeSrcFn:p,depth:N+1,maxDepth:A});B&&d(e,B)}},L),g.type===a.NodeType$1.Element&&g.tagName==="link"&&typeof g.attributes.rel=="string"&&(g.attributes.rel==="stylesheet"||g.attributes.rel==="preload"&&typeof g.attributes.href=="string"&&a.extractFileExtension(g.attributes.href)==="css")&&It(e,()=>{if(R){let C=U(e,{doc:r,mirror:o,blockClass:i,blockSelector:n,needsMask:k,maskTextClass:c,maskTextSelector:u,skipChild:!1,inlineStylesheet:f,maskInputOptions:h,maskTextFn:E,maskInputFn:b,slimDOMOptions:_,dataURLOptions:D,inlineImages:T,recordCanvas:x,preserveWhiteSpace:H,onSerialize:m,onIframeLoad:d,iframeLoadTimeout:L,onStylesheetLoad:R,stylesheetLoadTimeout:s,keepIframeSrcFn:p,depth:N,maxDepth:A});C&&R(e,C)}},s),g}function Ae(e){return e===!0||e==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e===!1?{}:e}function Tt(e,t){let{mirror:r=new a.Mirror,blockClass:o="rr-block",blockSelector:i=null,maskTextClass:n="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,inlineImages:l=!1,recordCanvas:f=!1,maskAllInputs:h=!1,maskTextFn:E,maskInputFn:b,slimDOM:_=!1,dataURLOptions:D,preserveWhiteSpace:T,onSerialize:x,onIframeLoad:m,iframeLoadTimeout:d,onStylesheetLoad:L,stylesheetLoadTimeout:R,keepIframeSrcFn:s=()=>!1,maxDepth:p}=t||{},w=h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:h===!1?{password:!0}:h,N=Ae(_);return U(e,{doc:e,mirror:r,blockClass:o,blockSelector:i,maskTextClass:n,maskTextSelector:c,skipChild:!1,inlineStylesheet:u,maskInputOptions:w,maskTextFn:E,maskInputFn:b,slimDOMOptions:N,dataURLOptions:D,inlineImages:l,recordCanvas:f,preserveWhiteSpace:T,onSerialize:x,onIframeLoad:m,iframeLoadTimeout:d,onStylesheetLoad:L,stylesheetLoadTimeout:R,keepIframeSrcFn:s,newlyAddedElement:!1,maxDepth:p})}function Rt(e,t){function r(o){t(o),(o.type===a.NodeType$1.Document||o.type===a.NodeType$1.Element)&&o.childNodes.forEach(r)}r(e)}function At(){Me=1}I.DEFAULT_MAX_DEPTH=Re;I.IGNORED_NODE=ie;I.classMatchesRegex=q;I.cleanupSnapshot=At;I.genId=ve;I.ignoreAttribute=De;I.needMaskingText=Te;I.resetMaxDepthState=Dt;I.serializeNodeWithId=U;I.slimDOMDefaults=Ae;I.snapshot=Tt;I.transformAttribute=_e;I.visitSnapshot=Rt;I.wasMaxDepthReached=_t});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var v=ke(),S=oe();exports.DEFAULT_MAX_DEPTH=v.DEFAULT_MAX_DEPTH;exports.IGNORED_NODE=v.IGNORED_NODE;exports.classMatchesRegex=v.classMatchesRegex;exports.cleanupSnapshot=v.cleanupSnapshot;exports.genId=v.genId;exports.ignoreAttribute=v.ignoreAttribute;exports.needMaskingText=v.needMaskingText;exports.serializeNodeWithId=v.serializeNodeWithId;exports.snapshot=v.snapshot;exports.transformAttribute=v.transformAttribute;exports.visitSnapshot=v.visitSnapshot;exports.wasMaxDepthReached=v.wasMaxDepthReached;exports.Mirror=S.Mirror;exports.NodeType=S.NodeType;exports.absolutifyURLs=S.absolutifyURLs;exports.checkDataURLSize=S.checkDataURLSize;exports.createMirror=S.createMirror;exports.escapeImportStatement=S.escapeImportStatement;exports.extractFileExtension=S.extractFileExtension;exports.fixSafariColons=S.fixSafariColons;exports.getInputType=S.getInputType;exports.is2DCanvasBlank=S.is2DCanvasBlank;exports.isCSSImportRule=S.isCSSImportRule;exports.isCSSStyleRule=S.isCSSStyleRule;exports.isElement=S.isElement;exports.isNativeShadowDom=S.isNativeShadowDom;exports.isNodeMetaEqual=S.isNodeMetaEqual;exports.isShadowRoot=S.isShadowRoot;exports.maskInputValue=S.maskInputValue;exports.recompressBase64Image=S.recompressBase64Image;exports.stringifyRule=S.stringifyRule;exports.stringifyStylesheet=S.stringifyStylesheet;exports.toLowerCase=S.toLowerCase;
3
3
  ;if (typeof module.exports == "object" && typeof exports == "object") {
4
4
  var __cp = (to, from, except, desc) => {
5
5
  if ((from && typeof from === "object") || typeof from === "function") {