@mrrocket/sdk 0.15.0 → 0.17.0

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.
Files changed (71) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +47 -3
  3. package/dist/api-client.d.ts +12 -5
  4. package/dist/api-client.js +12 -8
  5. package/dist/api-client.js.map +1 -1
  6. package/dist/api.d.ts +4 -1
  7. package/dist/api.js +2 -1
  8. package/dist/api.js.map +1 -1
  9. package/dist/batch.d.ts +6 -4
  10. package/dist/batch.js +3 -3
  11. package/dist/batch.js.map +1 -1
  12. package/dist/browser/mrrocket-flows.js +9 -2
  13. package/dist/browser/mrrocket-forms.js +1 -1
  14. package/dist/browser/mrrocket-messenger.js +42 -43
  15. package/dist/browser/mrrocket-push.js +1 -1
  16. package/dist/browser/mrrocket-replay.js +3 -3
  17. package/dist/browser/mrrocket.js +1 -1
  18. package/dist/client.d.ts +10 -2
  19. package/dist/client.js +36 -15
  20. package/dist/client.js.map +1 -1
  21. package/dist/context.d.ts +5 -1
  22. package/dist/context.js.map +1 -1
  23. package/dist/core.d.ts +1 -1
  24. package/dist/core.js +1 -1
  25. package/dist/core.js.map +1 -1
  26. package/dist/errors.d.ts +5 -1
  27. package/dist/errors.js +8 -2
  28. package/dist/errors.js.map +1 -1
  29. package/dist/flows-ui.d.ts +1 -1
  30. package/dist/flows-ui.js +64 -14
  31. package/dist/flows-ui.js.map +1 -1
  32. package/dist/flows-web.d.ts +2 -0
  33. package/dist/flows-web.js +4 -1
  34. package/dist/flows-web.js.map +1 -1
  35. package/dist/flows.d.ts +59 -3
  36. package/dist/flows.js +88 -7
  37. package/dist/flows.js.map +1 -1
  38. package/dist/forms.d.ts +4 -0
  39. package/dist/forms.js +4 -1
  40. package/dist/forms.js.map +1 -1
  41. package/dist/identity.d.ts +42 -0
  42. package/dist/identity.js +24 -0
  43. package/dist/identity.js.map +1 -0
  44. package/dist/index.d.ts +3 -1
  45. package/dist/index.js +5 -1
  46. package/dist/index.js.map +1 -1
  47. package/dist/messenger-ui.d.ts +12 -2
  48. package/dist/messenger-ui.js +58 -47
  49. package/dist/messenger-ui.js.map +1 -1
  50. package/dist/messenger.js +3 -2
  51. package/dist/messenger.js.map +1 -1
  52. package/dist/push-web.d.ts +2 -13
  53. package/dist/push-web.js +4 -2
  54. package/dist/push-web.js.map +1 -1
  55. package/dist/react-native/index.d.cts +105 -14
  56. package/dist/react-native/index.d.ts +105 -14
  57. package/dist/react-native/index.js +238 -55
  58. package/dist/react-native/index.js.map +1 -1
  59. package/dist/replay.d.ts +4 -1
  60. package/dist/replay.js +8 -2
  61. package/dist/replay.js.map +1 -1
  62. package/dist/server.d.ts +2 -0
  63. package/dist/server.js +2 -0
  64. package/dist/server.js.map +1 -1
  65. package/dist/styles-css.d.ts +1 -1
  66. package/dist/styles-css.js +40 -41
  67. package/dist/styles-css.js.map +1 -1
  68. package/dist/user-hash.d.ts +27 -0
  69. package/dist/user-hash.js +24 -0
  70. package/dist/user-hash.js.map +1 -0
  71. package/package.json +5 -1
@@ -1,6 +1,6 @@
1
- (function(){'use strict';var St=Object.defineProperty;var vr=(e,t,r)=>t in e?St(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r;var Mr=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ir=(e,t)=>{for(var r in t)St(e,r,{get:t[r],enumerable:true});};var Ee=(e,t,r)=>vr(e,typeof t!="symbol"?t+"":t,r);var br={};Ir(br,{record:()=>Me});function ht(e){if(ke[e])return ke[e];let t=globalThis[e],r=t.prototype,n=e in Nt?Nt[e]:void 0,s=!!(n&&n.every(c=>{var i,p;return !!((p=(i=Object.getOwnPropertyDescriptor(r,c))==null?void 0:i.get)!=null&&p.toString().includes("[native code]"))})),o=e in Lt?Lt[e]:void 0,a=!!(o&&o.every(c=>{var i;return typeof r[c]=="function"&&((i=r[c])==null?void 0:i.toString().includes("[native code]"))}));if(s&&a&&!Lr())return ke[e]=t.prototype,t.prototype;try{let c=document.createElement("iframe");c.style.display="none",document.body.appendChild(c);let i=c.contentWindow;if(!i)return t.prototype;let p=i[e].prototype;if(!p)return c.remove(),r;let u=navigator.userAgent;return u.includes("Safari")&&!u.includes("Chrome")?(c.classList.add("rr-block"),c.setAttribute("__rrwebUntaintedMutationObserver",""),jt[e]=()=>c.remove()):c.remove(),ke[e]=p}catch(c){return r}}function J(e,t,r){var n,s;let o=(n=Je[e])==null?void 0:n[r];if(o)return o.call(t);let a=ht(e),c=(s=Object.getOwnPropertyDescriptor(a,r))==null?void 0:s.get;return c?((Je[e]||(Je[e]={}))[r]=c,c.call(t)):t[r]}function Vt(e,t,r){let n=`${e}.${String(r)}`;if(Qe[n])return Qe[n].bind(t);let o=ht(e)[r];return typeof o!="function"?t[r]:(Qe[n]=o,o.bind(t))}function Dr(e){return J("Node",e,"ownerDocument")}function _r(e){return J("Node",e,"childNodes")}function Ar(e){return J("Node",e,"parentNode")}function Fr(e){return J("Node",e,"parentElement")}function Pr(e){return J("Node",e,"textContent")}function Ur(e){return J("Node",e,"firstChild")}function Wr(e){return J("Node",e,"lastChild")}function Br(e){return J("Node",e,"nextSibling")}function Hr(e){return J("Node",e,"previousSibling")}function $r(e,t){return Vt("Node",e,"contains")(t)}function zr(e){return Vt("Node",e,"getRootNode")()}function jr(e){return !e||!("host"in e)?null:J("ShadowRoot",e,"host")}function Vr(e){return e.styleSheets}function Gr(e){return !e||!("shadowRoot"in e)?null:J("Element",e,"shadowRoot")}function qr(e,t){return J("Element",e,"querySelector")(t)}function Kr(e,t){return J("Element",e,"querySelectorAll")(t)}function Gt(){var e;return [ht("MutationObserver").constructor,(e=jt.MutationObserver)!=null?e:(()=>{})]}function ae(e,t,r){try{if(!(t in e))return ()=>{};let n=e[t],s=r(n);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=s,()=>{e[t]=n;}}catch(n){return ()=>{}}}function qt(e){return e.nodeType===e.ELEMENT_NODE}function ye(e){let t=e&&"host"in e&&"mode"in e&&S.host(e)||null;return !!(t&&"shadowRoot"in t&&S.shadowRoot(t)===e)}function be(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Xr(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 Yr(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 tt(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);let n=Array.from(t,s=>Kt(s,r)).join("");return Xr(n)}catch(t){return null}}function Kt(e,t){if(Qr(e)){let r;try{r=tt(e.styleSheet)||Yr(e);}catch(n){r=e.cssText;}return e.styleSheet.href?Pe(r,e.styleSheet.href):r}else {let r=e.cssText;return Zr(e)&&e.selectorText.includes(":")&&(r=Jr(r)),t?Pe(r,t):r}}function Jr(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function Qr(e){return "styleSheet"in e}function Zr(e){return "selectorText"in e}function en(){return new _e}function Ae({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:o}){let a=s||"",c=n&&ne(n);return (t[r.toLowerCase()]||c&&t[c])&&(o?a=o(a,e):a="*".repeat(a.length)),a}function ne(e){return e.toLowerCase()}function tn(e){let t=e.getContext("2d");if(!t)return true;let r=50;for(let n=0;n<e.width;n+=r)for(let s=0;s<e.height;s+=r){let o=t.getImageData,a=Dt in o?o[Dt]:o;if(new Uint32Array(a.call(t,n,s,Math.min(r,e.width-n),Math.min(r,e.height-s)).data.buffer).some(i=>i!==0))return false}return true}function Fe(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?ne(t):null}function Xt(e,t){var o;let r;try{r=new URL(e,t!=null?t:window.location.href);}catch(a){return null}let n=/\.([0-9a-z]+)(?:$)/i,s=r.pathname.match(n);return (o=s==null?void 0:s[1])!=null?o:null}function rn(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}function Pe(e,t){return (e||"").replace(nn,(r,n,s,o,a,c)=>{let i=s||a||c,p=n||o||"";if(!i)return r;if(sn.test(i)||on.test(i))return `url(${p}${i}${p})`;if(an.test(i))return `url(${p}${i}${p})`;if(i[0]==="/")return `url(${p}${rn(t)+i}${p})`;let u=i.split("#")[0],d=i.substring(u.length),h=t.split("#")[0].split("/"),f=u.split("/");h.pop();for(let m of f)m!=="."&&(m===".."?h.pop():h.push(m));return `url(${p}${h.join("/")}${d}${p})`})}function Oe(e,t=false){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function ln(e,t,r=false){let n=Array.from(t.childNodes),s=[],o=0;if(n.length>1&&e&&typeof e=="string"){let a=Oe(e,r),c=a.length/e.length;for(let i=1;i<n.length;i++)if(n[i].textContent&&typeof n[i].textContent=="string"){let p=Oe(n[i].textContent,r),u=100,d=3;for(;d<p.length&&(p[d].match(/[a-zA-Z0-9]/)||p.indexOf(p.substring(0,d),1)!==-1);d++);for(;d<p.length;d++){let h=p.substring(0,d),f=a.split(h),m=-1;if(f.length===2)m=f[0].length;else if(f.length>2&&f[0]===""&&n[i-1].textContent!=="")m=a.indexOf(h,1);else if(f.length===1){if(h=h.substring(0,h.length-1),f=a.split(h),f.length<=1)return s.push(e),s;d=u+1;}else d===p.length-1&&(m=a.indexOf(h));if(f.length>=2&&d>u){let l=n[i-1].textContent;if(l&&typeof l=="string"){let b=Oe(l).length;m=a.indexOf(h,b);}m===-1&&(m=f[0].length);}if(m!==-1){let l=Math.floor(m/c);for(;l>0&&l<e.length;){if(o+=1,o>50*n.length)return s.push(e),s;let b=Oe(e.substring(0,l),r);if(b.length===m){s.push(e.substring(0,l)),e=e.substring(l),a=a.substring(m);break}else b.length<m?l+=Math.max(1,Math.floor((m-b.length)/c)):l-=Math.max(1,Math.floor((b.length-m)*c));}break}}}}return s.push(e),s}function cn(e,t){return ln(e,t).join("/* rr_split */")}function Yt(){return un++}function pn(e){if(e instanceof HTMLFormElement)return "form";let t=ne(e.tagName);return dn.test(t)?"div":t}function mn(e,t){if(t.trim()==="")return t;let r=0;function n(o){let a,c=o.exec(t.substring(r));return c?(a=c[0],r+=a.length,a):""}let s=[];for(;n(fn),!(r>=t.length);){let o=n(hn);if(o.slice(-1)===",")o=pe(e,o.substring(0,o.length-1)),s.push(o);else {let a="";o=pe(e,o);let c=false;for(;;){let i=t.charAt(r);if(i===""){s.push((o+a).trim());break}else if(c)i===")"&&(c=false);else if(i===","){r+=1,s.push((o+a).trim());break}else i==="("&&(c=true);a+=i,r+=1;}}}return s.join(", ")}function pe(e,t){return !t||t.trim()===""?t:ft(e,t)}function gn(e){return !!(e.tagName==="svg"||e.ownerSVGElement)}function ft(e,t){let r=At.get(e);if(r||(r=e.createElement("a"),At.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Jt(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&["table","td","th"].includes(t)?pe(e,n):r==="srcset"?mn(e,n):r==="style"?Pe(n,ft(e)):t==="object"&&r==="data"?pe(e,n):n)}function Qt(e,t,r){return ["video","audio"].includes(e)&&ne(t)==="autoplay"}function yn(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return !0}else for(let n=e.classList.length;n--;){let s=e.classList[n];if(t.test(s))return !0}if(r)return e.matches(r)}catch(n){}return false}function We(e,t,r){if(!e)return false;if(e.nodeType!==e.ELEMENT_NODE)return r?We(S.parentNode(e),t,r):false;for(let n=e.classList.length;n--;){let s=e.classList[n];if(t.test(s))return true}return r?We(S.parentNode(e),t,r):false}function Zt(e,t,r,n){let s;if(qt(e)){if(s=e,!S.childNodes(s).length)return false}else {if(S.parentElement(e)===null)return false;s=S.parentElement(e);}try{if(typeof t=="string"){if(n){if(s.closest(`.${t}`))return !0}else if(s.classList.contains(t))return !0}else if(We(s,t,n))return !0;if(r){if(n){if(s.closest(r))return !0}else if(s.matches(r))return !0}}catch(o){}return false}function bn(e,t,r){let n=e.contentWindow;if(!n)return;let s=false,o;try{o=n.document.readyState;}catch(c){return}if(o!=="complete"){let c=setTimeout(()=>{s||(t(),s=true);},r);e.addEventListener("load",()=>{clearTimeout(c),s=true,t();});return}let a="about:blank";if(n.location.href!==a||e.src===a||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t);}function Sn(e,t,r){let n=false,s;try{s=e.sheet;}catch(a){return}if(s)return;let o=setTimeout(()=>{n||(t(),n=true);},r);e.addEventListener("load",()=>{clearTimeout(o),n=true,t();});}function wn(e,t){let{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:a,inlineStylesheet:c,maskInputOptions:i={},maskTextFn:p,maskInputFn:u,dataURLOptions:d={},inlineImages:h,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:l=false,cssCaptured:b=false}=t,v=Cn(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:B.Document,childNodes:[],compatMode:e.compatMode}:{type:B.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return {type:B.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return Mn(e,{doc:r,blockClass:s,blockSelector:o,inlineStylesheet:c,maskInputOptions:i,maskInputFn:u,dataURLOptions:d,inlineImages:h,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:l,rootId:v});case e.TEXT_NODE:return vn(e,{doc:r,needsMask:a,maskTextFn:p,rootId:v,cssCaptured:b});case e.CDATA_SECTION_NODE:return {type:B.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return {type:B.Comment,textContent:S.textContent(e)||"",rootId:v};default:return false}}function Cn(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function vn(e,t){let{needsMask:r,maskTextFn:n,rootId:s,cssCaptured:o}=t,a=S.parentNode(e),c=a&&a.tagName,i="",p=c==="STYLE"?true:void 0,u=c==="SCRIPT"?true:void 0;return u?i="SCRIPT_PLACEHOLDER":o||(i=S.textContent(e),p&&i&&(i=Pe(i,ft(t.doc)))),!p&&!u&&i&&r&&(i=n?n(i,S.parentElement(e)):i.replace(/[\S]/g,"*")),{type:B.Text,textContent:i||"",rootId:s}}function Mn(e,t){let{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:c,dataURLOptions:i={},inlineImages:p,recordCanvas:u,keepIframeSrcFn:d,newlyAddedElement:h=false,rootId:f}=t,m=yn(e,n,s),l=pn(e),b={},v=e.attributes.length;for(let g=0;g<v;g++){let I=e.attributes[g];Qt(l,I.name,I.value)||(b[I.name]=Jt(r,l,ne(I.name),I.value));}if(l==="link"&&o){let g=Array.from(r.styleSheets).find(L=>L.href===e.href),I=null;g&&(I=tt(g)),I&&(delete b.rel,delete b.href,b._cssText=I);}if(l==="style"&&e.sheet){let g=tt(e.sheet);g&&(e.childNodes.length>1&&(g=cn(g,e)),b._cssText=g);}if(["input","textarea","select"].includes(l)){let g=e.value,I=e.checked;b.type!=="radio"&&b.type!=="checkbox"&&b.type!=="submit"&&b.type!=="button"&&g?b.value=Ae({element:e,type:Fe(e),tagName:l,value:g,maskInputOptions:a,maskInputFn:c}):I&&(b.checked=I);}if(l==="option"&&(e.selected&&!a.select?b.selected=true:delete b.selected),l==="dialog"&&e.open&&(b.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),l==="canvas"&&u){if(e.__context==="2d")tn(e)||(b.rr_dataURL=e.toDataURL(i.type,i.quality));else if(!("__context"in e)){let g=e.toDataURL(i.type,i.quality),I=r.createElement("canvas");I.width=e.width,I.height=e.height;let L=I.toDataURL(i.type,i.quality);g!==L&&(b.rr_dataURL=g);}}if(l==="img"&&p){ce||(ce=r.createElement("canvas"),_t=ce.getContext("2d"));let g=e,I=g.currentSrc||g.getAttribute("src")||"<unknown-src>",L=g.crossOrigin,_=()=>{g.removeEventListener("load",_);try{ce.width=g.naturalWidth,ce.height=g.naturalHeight,_t.drawImage(g,0,0),b.rr_dataURL=ce.toDataURL(i.type,i.quality);}catch(H){if(g.crossOrigin!=="anonymous"){g.crossOrigin="anonymous",g.complete&&g.naturalWidth!==0?_():g.addEventListener("load",_);return}else console.warn(`Cannot inline img src=${I}! Error: ${H}`);}g.crossOrigin==="anonymous"&&(L?b.crossOrigin=L:g.removeAttribute("crossorigin"));};g.complete&&g.naturalWidth!==0?_():g.addEventListener("load",_);}if(["audio","video"].includes(l)){let g=b;g.rr_mediaState=e.paused?"paused":"played",g.rr_mediaCurrentTime=e.currentTime,g.rr_mediaPlaybackRate=e.playbackRate,g.rr_mediaMuted=e.muted,g.rr_mediaLoop=e.loop,g.rr_mediaVolume=e.volume;}if(h||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop)),m){let{width:g,height:I}=e.getBoundingClientRect();b={class:b.class,rr_width:`${g}px`,rr_height:`${I}px`};}l==="iframe"&&!d(b.src)&&(e.contentDocument||(b.rr_src=b.src),delete b.src);let w;try{customElements.get(l)&&(w=!0);}catch(g){}return {type:B.Element,tagName:l,attributes:b,childNodes:[],isSVG:gn(e)||void 0,needBlock:m,rootId:f,isCustom:w}}function D(e){return e==null?"":e.toLowerCase()}function er(e){return e===true||e==="all"?{script:true,comment:true,headFavicon:true,headWhitespace:true,headMetaSocial:true,headMetaRobots:true,headMetaHttpEquiv:true,headMetaVerification:true,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function In(e,t){if(t.comment&&e.type===B.Comment)return true;if(e.type===B.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"&&Xt(e.attributes.href)==="js"))return true;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(D(e.attributes.name).match(/^msapplication-tile(image|color)$/)||D(e.attributes.name)==="application-name"||D(e.attributes.rel)==="icon"||D(e.attributes.rel)==="apple-touch-icon"||D(e.attributes.rel)==="shortcut icon")))return true;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&D(e.attributes.name).match(/^description|keywords$/))return true;if(t.headMetaSocial&&(D(e.attributes.property).match(/^(og|twitter|fb):/)||D(e.attributes.name).match(/^(og|twitter):/)||D(e.attributes.name)==="pinterest"))return true;if(t.headMetaRobots&&(D(e.attributes.name)==="robots"||D(e.attributes.name)==="googlebot"||D(e.attributes.name)==="bingbot"))return true;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return true;if(t.headMetaAuthorship&&(D(e.attributes.name)==="author"||D(e.attributes.name)==="generator"||D(e.attributes.name)==="framework"||D(e.attributes.name)==="publisher"||D(e.attributes.name)==="progid"||D(e.attributes.property).match(/^article:/)||D(e.attributes.property).match(/^product:/)))return true;if(t.headMetaVerification&&(D(e.attributes.name)==="google-site-verification"||D(e.attributes.name)==="yandex-verification"||D(e.attributes.name)==="csrf-token"||D(e.attributes.name)==="p:domain_verify"||D(e.attributes.name)==="verify-v1"||D(e.attributes.name)==="verification"||D(e.attributes.name)==="shopify-checkout-api-token"))return true}}return false}function he(e,t){let{doc:r,mirror:n,blockClass:s,blockSelector:o,maskTextClass:a,maskTextSelector:c,skipChild:i=false,inlineStylesheet:p=true,maskInputOptions:u={},maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:m={},inlineImages:l=false,recordCanvas:b=false,onSerialize:v,onIframeLoad:w,iframeLoadTimeout:g=5e3,onStylesheetLoad:I,stylesheetLoadTimeout:L=5e3,keepIframeSrcFn:_=()=>false,newlyAddedElement:H=false,cssCaptured:X=false}=t,{needsMask:$}=t,{preserveWhiteSpace:q=true}=t;$||($=Zt(e,a,c,$===void 0));let z=wn(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:$,inlineStylesheet:p,maskInputOptions:u,maskTextFn:d,maskInputFn:h,dataURLOptions:m,inlineImages:l,recordCanvas:b,keepIframeSrcFn:_,newlyAddedElement:H,cssCaptured:X});if(!z)return console.warn(e,"not serialized"),null;let j;n.hasNode(e)?j=n.getId(e):In(z,f)||!q&&z.type===B.Text&&!z.textContent.replace(/^\s+|\s+$/gm,"").length?j=Ue:j=Yt();let E=Object.assign(z,{id:j});if(n.add(e,E),j===Ue)return null;v&&v(e);let te=!i;if(E.type===B.Element){te=te&&!E.needBlock,delete E.needBlock;let C=S.shadowRoot(e);C&&be(C)&&(E.isShadowHost=true);}if((E.type===B.Document||E.type===B.Element)&&te){f.headWhitespace&&E.type===B.Element&&E.tagName==="head"&&(q=false);let C={doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:$,maskTextClass:a,maskTextSelector:c,skipChild:i,inlineStylesheet:p,maskInputOptions:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:m,inlineImages:l,recordCanvas:b,preserveWhiteSpace:q,onSerialize:v,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:I,stylesheetLoadTimeout:L,keepIframeSrcFn:_,cssCaptured:false};if(!(E.type===B.Element&&E.tagName==="textarea"&&E.attributes.value!==void 0)){E.type===B.Element&&E.attributes._cssText!==void 0&&typeof E.attributes._cssText=="string"&&(C.cssCaptured=true);for(let A of Array.from(S.childNodes(e))){let F=he(A,C);F&&E.childNodes.push(F);}}let O=null;if(qt(e)&&(O=S.shadowRoot(e)))for(let A of Array.from(S.childNodes(O))){let F=he(A,C);F&&(be(O)&&(F.isShadow=true),E.childNodes.push(F));}}let M=S.parentNode(e);return M&&ye(M)&&be(M)&&(E.isShadow=true),E.type===B.Element&&E.tagName==="iframe"&&bn(e,()=>{let C=e.contentDocument;if(C&&w){let O=he(C,{doc:C,mirror:n,blockClass:s,blockSelector:o,needsMask:$,maskTextClass:a,maskTextSelector:c,skipChild:false,inlineStylesheet:p,maskInputOptions:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:m,inlineImages:l,recordCanvas:b,preserveWhiteSpace:q,onSerialize:v,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:I,stylesheetLoadTimeout:L,keepIframeSrcFn:_});O&&w(e,O);}},g),E.type===B.Element&&E.tagName==="link"&&typeof E.attributes.rel=="string"&&(E.attributes.rel==="stylesheet"||E.attributes.rel==="preload"&&typeof E.attributes.href=="string"&&Xt(E.attributes.href)==="css")&&Sn(e,()=>{if(I){let C=he(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:$,maskTextClass:a,maskTextSelector:c,skipChild:false,inlineStylesheet:p,maskInputOptions:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:m,inlineImages:l,recordCanvas:b,preserveWhiteSpace:q,onSerialize:v,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:I,stylesheetLoadTimeout:L,keepIframeSrcFn:_});C&&I(e,C);}},L),E}function Rn(e,t){let{mirror:r=new _e,blockClass:n="rr-block",blockSelector:s=null,maskTextClass:o="rr-mask",maskTextSelector:a=null,inlineStylesheet:c=true,inlineImages:i=false,recordCanvas:p=false,maskAllInputs:u=false,maskTextFn:d,maskInputFn:h,slimDOM:f=false,dataURLOptions:m,preserveWhiteSpace:l,onSerialize:b,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:g,stylesheetLoadTimeout:I,keepIframeSrcFn:L=()=>false}=t,_=u===true?{color:true,date:true,"datetime-local":true,email:true,month:true,number:true,range:true,search:true,tel:true,text:true,time:true,url:true,week:true,textarea:true,select:true,password:true}:u===false?{password:true}:u,H=er(f);return he(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:false,inlineStylesheet:c,maskInputOptions:_,maskTextFn:d,maskInputFn:h,slimDOMOptions:H,dataURLOptions:m,inlineImages:i,recordCanvas:p,preserveWhiteSpace:l,onSerialize:b,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:g,stylesheetLoadTimeout:I,keepIframeSrcFn:L,newlyAddedElement:false})}function V(e,t,r=document){let n={capture:true,passive:true};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}function Ce(e,t,r={}){let n=null,s=0;return function(...o){let a=Date.now();!s&&r.leading===false&&(s=a);let c=t-(a-s),i=this;c<=0||c>t?(n&&(clearTimeout(n),n=null),s=a,e.apply(i,o)):!n&&r.trailing!==false&&(n=setTimeout(()=>{s=r.leading===false?0:Date.now(),n=null,e.apply(i,o);},c));}}function ze(e,t,r,n,s=window){let o=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,n?r:{set(a){setTimeout(()=>{r.set.call(this,a);},0),o&&o.set&&o.set.call(this,a);}}),()=>ze(e,t,o||{},true)}function tr(e){var t,r,n,s;let o=e.document;return {left:o.scrollingElement?o.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:o.documentElement.scrollLeft||(o==null?void 0:o.body)&&((t=S.parentElement(o.body))==null?void 0:t.scrollLeft)||((r=o==null?void 0:o.body)==null?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(o==null?void 0:o.documentElement.scrollTop)||(o==null?void 0:o.body)&&((n=S.parentElement(o.body))==null?void 0:n.scrollTop)||((s=o==null?void 0:o.body)==null?void 0:s.scrollTop)||0}}function rr(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function nr(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function sr(e){return e?e.nodeType===e.ELEMENT_NODE?e:S.parentElement(e):null}function G(e,t,r,n){if(!e)return false;let s=sr(e);if(!s)return false;try{if(typeof t=="string"){if(s.classList.contains(t)||n&&s.closest("."+t)!==null)return !0}else if(We(s,t,n))return !0}catch(o){}return !!(r&&(s.matches(r)||n&&s.closest(r)!==null))}function En(e,t){return t.getId(e)!==-1}function Ze(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?true:t.getId(e)===Ue}function or(e,t){if(ye(e))return false;let r=t.getId(e);if(!t.has(r))return true;let n=S.parentNode(e);return n&&n.nodeType===e.DOCUMENT_NODE?false:n?or(n,t):true}function nt(e){return !!e.changedTouches}function xn(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach);}function ir(e,t){return !!(e.nodeName==="IFRAME"&&t.getMeta(e))}function ar(e,t){return !!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function st(e){return e?e instanceof rt&&"shadowRoot"in e?!!e.shadowRoot:!!S.shadowRoot(e):false}function lr(e){var t;let r=null;return "getRootNode"in e&&((t=S.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&S.host(S.getRootNode(e))&&(r=S.host(S.getRootNode(e))),r}function kn(e){let t=e,r;for(;r=lr(t);)t=r;return t}function On(e){let t=S.ownerDocument(e);if(!t)return false;let r=kn(e);return S.contains(t,r)}function cr(e){let t=S.ownerDocument(e);return t?S.contains(t,e)||On(e):false}function at(e,t){e.delete(t),S.childNodes(t).forEach(r=>at(e,r));}function Tn(e,t){let r=[e];for(;r.length;){let n=r.pop();t.has(n)||(t.add(n),S.childNodes(n).forEach(s=>r.push(s)));}}function Ut(e,t){return e.size===0?false:ur(e,t)}function ur(e,t){if(e.has(t))return true;let r=S.parentNode(t);return r?ur(e,r):false}function Nn(e){Se=e;}function Ln(){Se=void 0;}function ve(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(t){}return e&&e.target}function dr(e,t){let r=new it;ie.push(r),r.init(e);let[n,s]=Gt(),o=new n(x(r.processMutations.bind(r)));return o.observe(t,{attributes:true,attributeOldValue:true,characterData:true,characterDataOldValue:true,childList:true,subtree:true}),[o,s]}function Dn({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===false)return ()=>{};let s=typeof t.mousemove=="number"?t.mousemove:50,o=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,a=[],c,i=Ce(x(d=>{let h=Date.now()-c;e(a.map(f=>(f.timeOffset-=h,f)),d),a=[],c=null;}),o),p=x(Ce(x(d=>{let h=ve(d),{clientX:f,clientY:m}=nt(d)?d.changedTouches[0]:d;c||(c=we()),a.push({x:f,y:m,id:n.getId(h),timeOffset:we()-c}),i(typeof DragEvent!="undefined"&&d instanceof DragEvent?R.Drag:d instanceof MouseEvent?R.MouseMove:R.TouchMove);}),s,{trailing:!1})),u=[V("mousemove",p,r),V("touchmove",p,r),V("drag",p,r)];return x(()=>{u.forEach(d=>d());})}function _n({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){if(o.mouseInteraction===false)return ()=>{};let a=o.mouseInteraction===true||o.mouseInteraction===void 0?{}:o.mouseInteraction,c=[],i=null,p=u=>d=>{let h=ve(d);if(G(h,n,s,true))return;let f=null,m=u;if("pointerType"in d){switch(d.pointerType){case "mouse":f=ee.Mouse;break;case "touch":f=ee.Touch;break;case "pen":f=ee.Pen;break}f===ee.Touch?K[u]===K.MouseDown?m="TouchStart":K[u]===K.MouseUp&&(m="TouchEnd"):ee.Pen;}else nt(d)&&(f=ee.Touch);f!==null?(i=f,(m.startsWith("Touch")&&f===ee.Touch||m.startsWith("Mouse")&&f===ee.Mouse)&&(f=null)):K[u]===K.Click&&(f=i,i=null);let l=nt(d)?d.changedTouches[0]:d;if(!l)return;let b=r.getId(h),{clientX:v,clientY:w}=l;x(e)({type:K[m],id:b,x:v,y:w,...f!==null&&{pointerType:f}});};return Object.keys(K).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&a[u]!==false).forEach(u=>{let d=ne(u),h=p(u);if(window.PointerEvent)switch(K[u]){case K.MouseDown:case K.MouseUp:d=d.replace("mouse","pointer");break;case K.TouchStart:case K.TouchEnd:return}c.push(V(d,h,t));}),x(()=>{c.forEach(u=>u());})}function pr({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){let a=x(Ce(x(c=>{let i=ve(c);if(!i||G(i,n,s,!0))return;let p=r.getId(i);if(i===t&&t.defaultView){let u=tr(t.defaultView);e({id:p,x:u.left,y:u.top});}else e({id:p,x:i.scrollLeft,y:i.scrollTop});}),o.scroll||100));return V("scroll",a,t)}function An({viewportResizeCb:e},{win:t}){let r=-1,n=-1,s=x(Ce(x(()=>{let o=rr(),a=nr();(r!==o||n!==a)&&(e({width:Number(a),height:Number(o)}),r=o,n=a);}),200));return V("resize",s,t)}function Pn({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,ignoreClass:o,ignoreSelector:a,maskInputOptions:c,maskInputFn:i,sampling:p,userTriggeredOnInput:u}){function d(w){let g=ve(w),I=w.isTrusted,L=g&&g.tagName;if(g&&L==="OPTION"&&(g=S.parentElement(g)),!g||!L||Fn.indexOf(L)<0||G(g,n,s,true)||g.classList.contains(o)||a&&g.matches(a))return;let _=g.value,H=false,X=Fe(g)||"";X==="radio"||X==="checkbox"?H=g.checked:(c[L.toLowerCase()]||c[X])&&(_=Ae({element:g,maskInputOptions:c,tagName:L,type:X,value:_,maskInputFn:i})),h(g,u?{text:_,isChecked:H,userTriggered:I}:{text:_,isChecked:H});let $=g.name;X==="radio"&&$&&H&&t.querySelectorAll(`input[type="radio"][name="${$}"]`).forEach(q=>{if(q!==g){let z=q.value;h(q,u?{text:z,isChecked:!H,userTriggered:false}:{text:z,isChecked:!H});}});}function h(w,g){let I=Wt.get(w);if(!I||I.text!==g.text||I.isChecked!==g.isChecked){Wt.set(w,g);let L=r.getId(w);x(e)({...g,id:L});}}let m=(p.input==="last"?["change"]:["input","change"]).map(w=>V(w,x(d),t)),l=t.defaultView;if(!l)return ()=>{m.forEach(w=>w());};let b=l.Object.getOwnPropertyDescriptor(l.HTMLInputElement.prototype,"value"),v=[[l.HTMLInputElement.prototype,"value"],[l.HTMLInputElement.prototype,"checked"],[l.HTMLSelectElement.prototype,"value"],[l.HTMLTextAreaElement.prototype,"value"],[l.HTMLSelectElement.prototype,"selectedIndex"],[l.HTMLOptionElement.prototype,"selected"]];return b&&b.set&&m.push(...v.map(w=>ze(w[0],w[1],{set(){x(d)({target:this,isTrusted:false});}},false,l))),x(()=>{m.forEach(w=>w());})}function Be(e){let t=[];function r(n,s){if(Te("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||Te("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||Te("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||Te("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){let a=Array.from(n.parentRule.cssRules).indexOf(n);return s.unshift(a),r(n.parentRule,s)}else if(n.parentStyleSheet){let a=Array.from(n.parentStyleSheet.cssRules).indexOf(n);s.unshift(a);}return s}return r(e,t)}function re(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function Un({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return ()=>{};let s=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:x((u,d,h)=>{let[f,m]=h,{id:l,styleId:b}=re(d,t,r.styleMirror);return (l&&l!==-1||b&&b!==-1)&&e({id:l,styleId:b,adds:[{rule:f,index:m}]}),u.apply(d,h)})}),n.CSSStyleSheet.prototype.addRule=function(u,d,h=this.cssRules.length){let f=`${u} { ${d} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[f,h])};let o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:x((u,d,h)=>{let[f]=h,{id:m,styleId:l}=re(d,t,r.styleMirror);return (m&&m!==-1||l&&l!==-1)&&e({id:m,styleId:l,removes:[{index:f}]}),u.apply(d,h)})}),n.CSSStyleSheet.prototype.removeRule=function(u){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[u])};let a;n.CSSStyleSheet.prototype.replace&&(a=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:x((u,d,h)=>{let[f]=h,{id:m,styleId:l}=re(d,t,r.styleMirror);return (m&&m!==-1||l&&l!==-1)&&e({id:m,styleId:l,replace:f}),u.apply(d,h)})}));let c;n.CSSStyleSheet.prototype.replaceSync&&(c=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:x((u,d,h)=>{let[f]=h,{id:m,styleId:l}=re(d,t,r.styleMirror);return (m&&m!==-1||l&&l!==-1)&&e({id:m,styleId:l,replaceSync:f}),u.apply(d,h)})}));let i={};Ne("CSSGroupingRule")?i.CSSGroupingRule=n.CSSGroupingRule:(Ne("CSSMediaRule")&&(i.CSSMediaRule=n.CSSMediaRule),Ne("CSSConditionRule")&&(i.CSSConditionRule=n.CSSConditionRule),Ne("CSSSupportsRule")&&(i.CSSSupportsRule=n.CSSSupportsRule));let p={};return Object.entries(i).forEach(([u,d])=>{p[u]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(p[u].insertRule,{apply:x((h,f,m)=>{let[l,b]=m,{id:v,styleId:w}=re(f.parentStyleSheet,t,r.styleMirror);return (v&&v!==-1||w&&w!==-1)&&e({id:v,styleId:w,adds:[{rule:l,index:[...Be(f),b||0]}]}),h.apply(f,m)})}),d.prototype.deleteRule=new Proxy(p[u].deleteRule,{apply:x((h,f,m)=>{let[l]=m,{id:b,styleId:v}=re(f.parentStyleSheet,t,r.styleMirror);return (b&&b!==-1||v&&v!==-1)&&e({id:b,styleId:v,removes:[{index:[...Be(f),l]}]}),h.apply(f,m)})});}),x(()=>{n.CSSStyleSheet.prototype.insertRule=s,n.CSSStyleSheet.prototype.deleteRule=o,a&&(n.CSSStyleSheet.prototype.replace=a),c&&(n.CSSStyleSheet.prototype.replaceSync=c),Object.entries(i).forEach(([u,d])=>{d.prototype.insertRule=p[u].insertRule,d.prototype.deleteRule=p[u].deleteRule;});})}function hr({mirror:e,stylesheetManager:t},r){var n,s,o;let a=null;r.nodeName==="#document"?a=e.getId(r):a=e.getId(S.host(r));let c=r.nodeName==="#document"?(n=r.defaultView)==null?void 0:n.Document:(o=(s=r.ownerDocument)==null?void 0:s.defaultView)==null?void 0:o.ShadowRoot,i=c!=null&&c.prototype?Object.getOwnPropertyDescriptor(c==null?void 0:c.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!c||!i?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){var p;return (p=i.get)==null?void 0:p.call(this)},set(p){var u;let d=(u=i.set)==null?void 0:u.call(this,p);if(a!==null&&a!==-1)try{t.adoptStyleSheets(p,a);}catch(h){}return d}}),x(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set});}))}function Wn({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:s}){let o=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:x((c,i,p)=>{var u;let[d,h,f]=p;if(r.has(d))return o.apply(i,[d,h,f]);let{id:m,styleId:l}=re((u=i.parentRule)==null?void 0:u.parentStyleSheet,t,n.styleMirror);return (m&&m!==-1||l&&l!==-1)&&e({id:m,styleId:l,set:{property:d,value:h,priority:f},index:Be(i.parentRule)}),c.apply(i,p)})});let a=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:x((c,i,p)=>{var u;let[d]=p;if(r.has(d))return a.apply(i,[d]);let{id:h,styleId:f}=re((u=i.parentRule)==null?void 0:u.parentStyleSheet,t,n.styleMirror);return (h&&h!==-1||f&&f!==-1)&&e({id:h,styleId:f,remove:{property:d},index:Be(i.parentRule)}),c.apply(i,p)})}),x(()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=a;})}function Bn({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:o}){let a=x(i=>Ce(x(p=>{let u=ve(p);if(!u||G(u,t,r,!0))return;let{currentTime:d,volume:h,muted:f,playbackRate:m,loop:l}=u;e({type:i,id:n.getId(u),currentTime:d,volume:h,muted:f,playbackRate:m,loop:l});}),s.media||500)),c=[V("play",a(ue.Play),o),V("pause",a(ue.Pause),o),V("seeked",a(ue.Seeked),o),V("volumechange",a(ue.VolumeChange),o),V("ratechange",a(ue.RateChange),o)];return x(()=>{c.forEach(i=>i());})}function Hn({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return ()=>{};let n=[],s=new WeakMap,o=r.FontFace;r.FontFace=function(i,p,u){let d=new o(i,p,u);return s.set(d,{family:i,buffer:typeof p!="string",descriptors:u,fontSource:typeof p=="string"?p:JSON.stringify(Array.from(new Uint8Array(p)))}),d};let a=ae(t.fonts,"add",function(c){return function(i){return setTimeout(x(()=>{let p=s.get(i);p&&(e(p),s.delete(i));}),0),c.apply(this,[i])}});return n.push(()=>{r.FontFace=o;}),n.push(a),x(()=>{n.forEach(c=>c());})}function $n(e){let{doc:t,mirror:r,blockClass:n,blockSelector:s,selectionCb:o}=e,a=true,c=x(()=>{let i=t.getSelection();if(!i||a&&(i!=null&&i.isCollapsed))return;a=i.isCollapsed||false;let p=[],u=i.rangeCount||0;for(let d=0;d<u;d++){let h=i.getRangeAt(d),{startContainer:f,startOffset:m,endContainer:l,endOffset:b}=h;G(f,n,s,!0)||G(l,n,s,!0)||p.push({start:r.getId(f),startOffset:m,end:r.getId(l),endOffset:b});}o({ranges:p});});return c(),V("selectionchange",c)}function zn({doc:e,customElementCb:t}){let r=e.defaultView;return !r||!r.customElements?()=>{}:ae(r.customElements,"define",function(s){return function(o,a,c){try{t({define:{name:o}});}catch(i){console.warn(`Custom element callback failed for ${o}`);}return s.apply(this,[o,a,c])}})}function jn(e,t){let{mutationCb:r,mousemoveCb:n,mouseInteractionCb:s,scrollCb:o,viewportResizeCb:a,inputCb:c,mediaInteractionCb:i,styleSheetRuleCb:p,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h,selectionCb:f,customElementCb:m}=e;e.mutationCb=(...l)=>{t.mutation&&t.mutation(...l),r(...l);},e.mousemoveCb=(...l)=>{t.mousemove&&t.mousemove(...l),n(...l);},e.mouseInteractionCb=(...l)=>{t.mouseInteraction&&t.mouseInteraction(...l),s(...l);},e.scrollCb=(...l)=>{t.scroll&&t.scroll(...l),o(...l);},e.viewportResizeCb=(...l)=>{t.viewportResize&&t.viewportResize(...l),a(...l);},e.inputCb=(...l)=>{t.input&&t.input(...l),c(...l);},e.mediaInteractionCb=(...l)=>{t.mediaInteaction&&t.mediaInteaction(...l),i(...l);},e.styleSheetRuleCb=(...l)=>{t.styleSheetRule&&t.styleSheetRule(...l),p(...l);},e.styleDeclarationCb=(...l)=>{t.styleDeclaration&&t.styleDeclaration(...l),u(...l);},e.canvasMutationCb=(...l)=>{t.canvasMutation&&t.canvasMutation(...l),d(...l);},e.fontCb=(...l)=>{t.font&&t.font(...l),h(...l);},e.selectionCb=(...l)=>{t.selection&&t.selection(...l),f(...l);},e.customElementCb=(...l)=>{t.customElement&&t.customElement(...l),m(...l);};}function Vn(e,t={}){let r=e.doc.defaultView;if(!r)return ()=>{};jn(e,t);let n,s=()=>{};e.recordDOM&&([n,s]=dr(e,e.doc));let o=Dn(e),a=_n(e),c=pr(e),i=An(e,{win:r}),p=Pn(e),u=Bn(e),d=()=>{},h=()=>{},f=()=>{},m=()=>{};e.recordDOM&&(d=Un(e,{win:r}),h=hr(e,e.doc),f=Wn(e,{win:r}),e.collectFonts&&(m=Hn(e)));let l=$n(e),b=zn(e),v=[];for(let w of e.plugins)v.push(w.observer(w.callback,r,w.options));return x(()=>{ie.forEach(w=>w.reset()),n==null||n.disconnect(),s(),o(),a(),c(),i(),p(),u(),d(),h(),f(),m(),l(),b(),v.forEach(w=>w());})}function Te(e){return typeof window[e]!="undefined"}function Ne(e){return !!(typeof window[e]!="undefined"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}function Kn(e,t){let r=Bt.get(e);return r||(r=new Map,Bt.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function Le(e,t,r){if(e instanceof Array)return e.map(n=>Le(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return {rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){let n=e.constructor.name,s=qn(e);return {rr_type:n,base64:s}}else {if(e instanceof DataView)return {rr_type:e.constructor.name,args:[Le(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let n=e.constructor.name,{src:s}=e;return {rr_type:n,src:s}}else if(e instanceof HTMLCanvasElement){let n="HTMLImageElement",s=e.toDataURL();return {rr_type:n,src:s}}else {if(e instanceof ImageData)return {rr_type:e.constructor.name,args:[Le(e.data,t,r),e.width,e.height]};if(gr(e,t)||typeof e=="object"){let n=e.constructor.name,s=fr(e,t,r);return {rr_type:n,index:s}}}}return e}function Xn(e,t,r,n){let s=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let a of o)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;let c=ae(t.CanvasRenderingContext2D.prototype,a,function(i){return function(...p){return G(this.canvas,r,n,!0)||setTimeout(()=>{let u=mr(p,t,this);e(this.canvas,{type:me["2D"],property:a,args:u});},0),i.apply(this,p)}});s.push(c);}catch(c){let i=ze(t.CanvasRenderingContext2D.prototype,a,{set(p){e(this.canvas,{type:me["2D"],property:a,args:[p],setter:true});}});s.push(i);}return ()=>{s.forEach(a=>a());}}function Yn(e){return e==="experimental-webgl"?"webgl":e}function Ht(e,t,r,n){let s=[];try{let o=ae(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(c,...i){if(!G(this,t,r,!0)){let p=Yn(c);if("__context"in this||(this.__context=p),n&&["webgl","webgl2"].includes(p))if(i[0]&&typeof i[0]=="object"){let u=i[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0);}else i.splice(0,1,{preserveDrawingBuffer:!0});}return a.apply(this,[c,...i])}});s.push(o);}catch(o){console.error("failed to patch HTMLCanvasElement.prototype.getContext");}return ()=>{s.forEach(o=>o());}}function $t(e,t,r,n,s,o){let a=[],c=Object.getOwnPropertyNames(e);for(let i of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(i))try{if(typeof e[i]!="function")continue;let p=ae(e,i,function(u){return function(...d){let h=u.apply(this,d);if(fr(h,o,this),"tagName"in this.canvas&&!G(this.canvas,n,s,!0)){let f=mr(d,o,this),m={type:t,property:i,args:f};r(this.canvas,m);}return h}});a.push(p);}catch(p){let u=ze(e,i,{set(d){r(this.canvas,{type:t,property:i,args:[d],setter:true});}});a.push(u);}return a}function Jn(e,t,r,n){let s=[];return typeof t.WebGLRenderingContext!="undefined"&&s.push(...$t(t.WebGLRenderingContext.prototype,me.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext!="undefined"&&s.push(...$t(t.WebGL2RenderingContext.prototype,me.WebGL2,e,r,n,t)),()=>{s.forEach(o=>o());}}function Qn(e){let t;try{if(t=zt&&(self.URL||self.webkitURL).createObjectURL(zt),!t)throw "";let r=new Worker(t,{name:e==null?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t);}),r}catch(r){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(yr),{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t);}}function Me(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskTextClass:i="rr-mask",maskTextSelector:p=null,inlineStylesheet:u=true,maskAllInputs:d,maskInputOptions:h,slimDOMOptions:f,maskInputFn:m,maskTextFn:l,hooks:b,packFn:v,sampling:w={},dataURLOptions:g={},mousemoveWait:I,recordDOM:L=true,recordCanvas:_=false,recordCrossOriginIframes:H=false,recordAfter:X=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:$=false,collectFonts:q=false,inlineImages:z=false,plugins:j,keepIframeSrcFn:E=()=>false,ignoreCSSAttributes:te=new Set([]),errorHandler:M}=e;Nn(M);let C=H?window.parent===window:true,O=false;if(!C)try{window.parent.document&&(O=!1);}catch(T){O=true;}if(C&&!t)throw new Error("emit function is required");if(!C&&!O)return ()=>{};I!==void 0&&w.mousemove===void 0&&(w.mousemove=I),Z.reset();let A=d===true?{color:true,date:true,"datetime-local":true,email:true,month:true,number:true,range:true,search:true,tel:true,text:true,time:true,url:true,week:true,textarea:true,select:true,password:true}:h!==void 0?h:{password:true},F=er(f);xn();let le,Ve=0,gt=T=>{for(let Q of j||[])Q.eventProcessor&&(T=Q.eventProcessor(T));return v&&!O&&(T=v(T)),T};W=(T,Q)=>{var P;let U=T;if(U.timestamp=we(),(P=ie[0])!=null&&P.isFrozen()&&U.type!==k.FullSnapshot&&!(U.type===k.IncrementalSnapshot&&U.data.source===R.Mutation)&&ie.forEach(Y=>Y.unfreeze()),C)t==null||t(gt(U),Q);else if(O){let Y={type:"rrweb",event:gt(U),origin:window.location.origin,isCheckout:Q};window.parent.postMessage(Y,"*");}if(U.type===k.FullSnapshot)le=U,Ve=0;else if(U.type===k.IncrementalSnapshot){if(U.data.source===R.Mutation&&U.data.isAttachIframe)return;Ve++;let Y=n&&Ve>=n,N=r&&U.timestamp-le.timestamp>r;(Y||N)&&De(true);}};let Ie=T=>{W({type:k.IncrementalSnapshot,data:{source:R.Mutation,...T}});},yt=T=>W({type:k.IncrementalSnapshot,data:{source:R.Scroll,...T}}),bt=T=>W({type:k.IncrementalSnapshot,data:{source:R.CanvasMutation,...T}}),Cr=T=>W({type:k.IncrementalSnapshot,data:{source:R.AdoptedStyleSheet,...T}}),se=new dt({mutationCb:Ie,adoptedStyleSheetCb:Cr}),oe=new lt({mirror:Z,mutationCb:Ie,stylesheetManager:se,recordCrossOriginIframes:H,wrappedEmit:W});for(let T of j||[])T.getMirror&&T.getMirror({nodeMirror:Z,crossOriginIframeMirror:oe.crossOriginIframeMirror,crossOriginIframeStyleMirror:oe.crossOriginIframeStyleMirror});let Ge=new pt;et=new ut({recordCanvas:_,mutationCb:bt,win:window,blockClass:s,blockSelector:o,mirror:Z,sampling:w.canvas,dataURLOptions:g});let Re=new ct({mutationCb:Ie,scrollCb:yt,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:i,maskTextSelector:p,inlineStylesheet:u,maskInputOptions:A,dataURLOptions:g,maskTextFn:l,maskInputFn:m,recordCanvas:_,inlineImages:z,sampling:w,slimDOMOptions:F,iframeManager:oe,stylesheetManager:se,canvasManager:et,keepIframeSrcFn:E,processedNodeManager:Ge},mirror:Z});De=(T=false)=>{if(!L)return;W({type:k.Meta,data:{href:window.location.href,width:nr(),height:rr()}},T),se.reset(),Re.init(),ie.forEach(P=>P.lock());let Q=Rn(document,{mirror:Z,blockClass:s,blockSelector:o,maskTextClass:i,maskTextSelector:p,inlineStylesheet:u,maskAllInputs:A,maskTextFn:l,maskInputFn:m,slimDOM:F,dataURLOptions:g,recordCanvas:_,inlineImages:z,onSerialize:P=>{ir(P,Z)&&oe.addIframe(P),ar(P,Z)&&se.trackLinkElement(P),st(P)&&Re.addShadowRoot(S.shadowRoot(P),document);},onIframeLoad:(P,U)=>{oe.attachIframe(P,U),Re.observeAttachShadow(P);},onStylesheetLoad:(P,U)=>{se.attachLinkElement(P,U);},keepIframeSrcFn:E});if(!Q)return console.warn("Failed to snapshot the document");W({type:k.FullSnapshot,data:{node:Q,initialOffset:tr(window)}},T),ie.forEach(P=>P.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&se.adoptStyleSheets(document.adoptedStyleSheets,Z.getId(document));};try{let T=[],Q=U=>{var Y;return x(Vn)({mutationCb:Ie,mousemoveCb:(N,qe)=>W({type:k.IncrementalSnapshot,data:{source:qe,positions:N}}),mouseInteractionCb:N=>W({type:k.IncrementalSnapshot,data:{source:R.MouseInteraction,...N}}),scrollCb:yt,viewportResizeCb:N=>W({type:k.IncrementalSnapshot,data:{source:R.ViewportResize,...N}}),inputCb:N=>W({type:k.IncrementalSnapshot,data:{source:R.Input,...N}}),mediaInteractionCb:N=>W({type:k.IncrementalSnapshot,data:{source:R.MediaInteraction,...N}}),styleSheetRuleCb:N=>W({type:k.IncrementalSnapshot,data:{source:R.StyleSheetRule,...N}}),styleDeclarationCb:N=>W({type:k.IncrementalSnapshot,data:{source:R.StyleDeclaration,...N}}),canvasMutationCb:bt,fontCb:N=>W({type:k.IncrementalSnapshot,data:{source:R.Font,...N}}),selectionCb:N=>{W({type:k.IncrementalSnapshot,data:{source:R.Selection,...N}});},customElementCb:N=>{W({type:k.IncrementalSnapshot,data:{source:R.CustomElement,...N}});},blockClass:s,ignoreClass:a,ignoreSelector:c,maskTextClass:i,maskTextSelector:p,maskInputOptions:A,inlineStylesheet:u,sampling:w,recordDOM:L,recordCanvas:_,inlineImages:z,userTriggeredOnInput:$,collectFonts:q,doc:U,maskInputFn:m,maskTextFn:l,keepIframeSrcFn:E,blockSelector:o,slimDOMOptions:F,dataURLOptions:g,mirror:Z,iframeManager:oe,stylesheetManager:se,shadowDomManager:Re,processedNodeManager:Ge,canvasManager:et,ignoreCSSAttributes:te,plugins:((Y=j==null?void 0:j.filter(N=>N.observer))==null?void 0:Y.map(N=>({observer:N.observer,options:N.options,callback:qe=>W({type:k.Plugin,data:{plugin:N.name,payload:qe}})})))||[]},b)};oe.addLoadListener(U=>{try{T.push(Q(U.contentDocument));}catch(Y){console.warn(Y);}});let P=()=>{De(),T.push(Q(document)),$e=!0;};return ["interactive","complete"].includes(document.readyState)?P():(T.push(V("DOMContentLoaded",()=>{W({type:k.DomContentLoaded,data:{}}),X==="DOMContentLoaded"&&P();})),T.push(V("load",()=>{W({type:k.Load,data:{}}),X==="load"&&P();},window))),()=>{T.forEach(U=>{try{U();}catch(Y){String(Y).toLowerCase().includes("cross-origin")||console.warn(Y);}}),Ge.destroy(),$e=!1,Ln();}}catch(T){console.warn(T);}}var Tr,Nr,y,Tt,k,R,K,ee,me,ue,B,Nt,Lt,ke,jt,Lr,Je,Qe,we,S,_e,Dt,nn,sn,on,an,un,dn,Ue,ce,_t,hn,fn,At,rt,de,Ft,ot,Pt,it,Se,x,ie,Fn,Wt,He,lt,ct,fe,Gn,ge,qn,Bt,fr,mr,gr,yr,zt,ut,dt,pt,W,De,et,$e,Z,Sr=Mr(()=>{Tr=Object.defineProperty,Nr=(e,t,r)=>t in e?Tr(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r,y=(e,t,r)=>Nr(e,typeof t!="symbol"?t+"":t,r),k=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e))(k||{}),R=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(R||{}),K=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(K||{}),ee=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(ee||{}),me=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(me||{}),ue=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(ue||{}),B=(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))(B||{}),Nt={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Lt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ke={},jt={},Lr=()=>!!globalThis.Zone;Je={};Qe={};we=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(we=()=>new Date().getTime());S={ownerDocument:Dr,childNodes:_r,parentNode:Ar,parentElement:Fr,textContent:Pr,firstChild:Ur,lastChild:Wr,nextSibling:Br,previousSibling:Hr,contains:$r,getRootNode:zr,host:jr,styleSheets:Vr,shadowRoot:Gr,querySelector:qr,querySelectorAll:Kr,nowTimestamp:we,mutationObserverCtor:Gt,patch:ae};_e=class{constructor(){y(this,"idNodeMap",new Map),y(this,"nodeMetaMap",new WeakMap);}getId(t){var r;if(!t)return -1;let n=(r=this.getMeta(t))==null?void 0:r.id;return n!=null?n:-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);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n));}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r);}replace(t,r){let n=this.getNode(t);if(n){let s=this.nodeMetaMap.get(n);s&&this.nodeMetaMap.set(r,s);}this.idNodeMap.set(t,r);}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap;}};Dt="__rrweb_original__";nn=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,sn=/^(?:[a-z+]+:)?\/\//i,on=/^www\..*/i,an=/^(data:)([^,]*),(.*)/i;un=1,dn=new RegExp("[^a-z0-9-_:]"),Ue=-2;hn=/^[^ \t\n\r\u000c]+/,fn=/^[, \t\n\r\u000c]+/;At=new WeakMap;rt=class e{constructor(...t){y(this,"parentElement",null),y(this,"parentNode",null),y(this,"ownerDocument"),y(this,"firstChild",null),y(this,"lastChild",null),y(this,"previousSibling",null),y(this,"nextSibling",null),y(this,"ELEMENT_NODE",1),y(this,"TEXT_NODE",3),y(this,"nodeType"),y(this,"nodeName"),y(this,"RRNodeType");}get childNodes(){let t=[],r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(t instanceof e){if(t.ownerDocument!==this.ownerDocument)return false;if(t===this)return true}else return false;for(;t.parentNode;){if(t.parentNode===this)return true;t=t.parentNode;}return false}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return "RRNode"}};de=`Please stop import mirror directly. Instead of that,\r
1
+ (function(){'use strict';var St=Object.defineProperty;var Mr=(e,t,r)=>t in e?St(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r;var Ir=(e,t)=>()=>(e&&(t=e(e=0)),t);var Rr=(e,t)=>{for(var r in t)St(e,r,{get:t[r],enumerable:true});};var xe=(e,t,r)=>Mr(e,typeof t!="symbol"?t+"":t,r);var Sr={};Rr(Sr,{record:()=>Ie});function ht(e){if(Oe[e])return Oe[e];let t=globalThis[e],r=t.prototype,n=e in Lt?Lt[e]:void 0,s=!!(n&&n.every(c=>{var i,p;return !!((p=(i=Object.getOwnPropertyDescriptor(r,c))==null?void 0:i.get)!=null&&p.toString().includes("[native code]"))})),o=e in _t?_t[e]:void 0,a=!!(o&&o.every(c=>{var i;return typeof r[c]=="function"&&((i=r[c])==null?void 0:i.toString().includes("[native code]"))}));if(s&&a&&!Dr())return Oe[e]=t.prototype,t.prototype;try{let c=document.createElement("iframe");c.style.display="none",document.body.appendChild(c);let i=c.contentWindow;if(!i)return t.prototype;let p=i[e].prototype;if(!p)return c.remove(),r;let u=navigator.userAgent;return u.includes("Safari")&&!u.includes("Chrome")?(c.classList.add("rr-block"),c.setAttribute("__rrwebUntaintedMutationObserver",""),Vt[e]=()=>c.remove()):c.remove(),Oe[e]=p}catch(c){return r}}function J(e,t,r){var n,s;let o=(n=Je[e])==null?void 0:n[r];if(o)return o.call(t);let a=ht(e),c=(s=Object.getOwnPropertyDescriptor(a,r))==null?void 0:s.get;return c?((Je[e]||(Je[e]={}))[r]=c,c.call(t)):t[r]}function Gt(e,t,r){let n=`${e}.${String(r)}`;if(Qe[n])return Qe[n].bind(t);let o=ht(e)[r];return typeof o!="function"?t[r]:(Qe[n]=o,o.bind(t))}function Ar(e){return J("Node",e,"ownerDocument")}function Fr(e){return J("Node",e,"childNodes")}function Pr(e){return J("Node",e,"parentNode")}function Ur(e){return J("Node",e,"parentElement")}function Wr(e){return J("Node",e,"textContent")}function Hr(e){return J("Node",e,"firstChild")}function Br(e){return J("Node",e,"lastChild")}function $r(e){return J("Node",e,"nextSibling")}function zr(e){return J("Node",e,"previousSibling")}function jr(e,t){return Gt("Node",e,"contains")(t)}function Vr(e){return Gt("Node",e,"getRootNode")()}function Gr(e){return !e||!("host"in e)?null:J("ShadowRoot",e,"host")}function qr(e){return e.styleSheets}function Kr(e){return !e||!("shadowRoot"in e)?null:J("Element",e,"shadowRoot")}function Xr(e,t){return J("Element",e,"querySelector")(t)}function Yr(e,t){return J("Element",e,"querySelectorAll")(t)}function qt(){var e;return [ht("MutationObserver").constructor,(e=Vt.MutationObserver)!=null?e:(()=>{})]}function ce(e,t,r){try{if(!(t in e))return ()=>{};let n=e[t],s=r(n);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=s,()=>{e[t]=n;}}catch(n){return ()=>{}}}function Kt(e){return e.nodeType===e.ELEMENT_NODE}function be(e){let t=e&&"host"in e&&"mode"in e&&C.host(e)||null;return !!(t&&"shadowRoot"in t&&C.shadowRoot(t)===e)}function Se(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Jr(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 Qr(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 tt(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);let n=Array.from(t,s=>Xt(s,r)).join("");return Jr(n)}catch(t){return null}}function Xt(e,t){if(en(e)){let r;try{r=tt(e.styleSheet)||Qr(e);}catch(n){r=e.cssText;}return e.styleSheet.href?Ue(r,e.styleSheet.href):r}else {let r=e.cssText;return tn(e)&&e.selectorText.includes(":")&&(r=Zr(r)),t?Ue(r,t):r}}function Zr(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function en(e){return "styleSheet"in e}function tn(e){return "selectorText"in e}function rn(){return new Ae}function Fe({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:o}){let a=s||"",c=n&&ne(n);return (t[r.toLowerCase()]||c&&t[c])&&(o?a=o(a,e):a="*".repeat(a.length)),a}function ne(e){return e.toLowerCase()}function nn(e){let t=e.getContext("2d");if(!t)return true;let r=50;for(let n=0;n<e.width;n+=r)for(let s=0;s<e.height;s+=r){let o=t.getImageData,a=Dt in o?o[Dt]:o;if(new Uint32Array(a.call(t,n,s,Math.min(r,e.width-n),Math.min(r,e.height-s)).data.buffer).some(i=>i!==0))return false}return true}function Pe(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?ne(t):null}function Yt(e,t){var o;let r;try{r=new URL(e,t!=null?t:window.location.href);}catch(a){return null}let n=/\.([0-9a-z]+)(?:$)/i,s=r.pathname.match(n);return (o=s==null?void 0:s[1])!=null?o:null}function sn(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}function Ue(e,t){return (e||"").replace(on,(r,n,s,o,a,c)=>{let i=s||a||c,p=n||o||"";if(!i)return r;if(an.test(i)||ln.test(i))return `url(${p}${i}${p})`;if(cn.test(i))return `url(${p}${i}${p})`;if(i[0]==="/")return `url(${p}${sn(t)+i}${p})`;let u=i.split("#")[0],d=i.substring(u.length),f=t.split("#")[0].split("/"),h=u.split("/");f.pop();for(let m of h)m!=="."&&(m===".."?f.pop():f.push(m));return `url(${p}${f.join("/")}${d}${p})`})}function Te(e,t=false){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function un(e,t,r=false){let n=Array.from(t.childNodes),s=[],o=0;if(n.length>1&&e&&typeof e=="string"){let a=Te(e,r),c=a.length/e.length;for(let i=1;i<n.length;i++)if(n[i].textContent&&typeof n[i].textContent=="string"){let p=Te(n[i].textContent,r),u=100,d=3;for(;d<p.length&&(p[d].match(/[a-zA-Z0-9]/)||p.indexOf(p.substring(0,d),1)!==-1);d++);for(;d<p.length;d++){let f=p.substring(0,d),h=a.split(f),m=-1;if(h.length===2)m=h[0].length;else if(h.length>2&&h[0]===""&&n[i-1].textContent!=="")m=a.indexOf(f,1);else if(h.length===1){if(f=f.substring(0,f.length-1),h=a.split(f),h.length<=1)return s.push(e),s;d=u+1;}else d===p.length-1&&(m=a.indexOf(f));if(h.length>=2&&d>u){let l=n[i-1].textContent;if(l&&typeof l=="string"){let b=Te(l).length;m=a.indexOf(f,b);}m===-1&&(m=h[0].length);}if(m!==-1){let l=Math.floor(m/c);for(;l>0&&l<e.length;){if(o+=1,o>50*n.length)return s.push(e),s;let b=Te(e.substring(0,l),r);if(b.length===m){s.push(e.substring(0,l)),e=e.substring(l),a=a.substring(m);break}else b.length<m?l+=Math.max(1,Math.floor((m-b.length)/c)):l-=Math.max(1,Math.floor((b.length-m)*c));}break}}}}return s.push(e),s}function dn(e,t){return un(e,t).join("/* rr_split */")}function Jt(){return pn++}function fn(e){if(e instanceof HTMLFormElement)return "form";let t=ne(e.tagName);return hn.test(t)?"div":t}function yn(e,t){if(t.trim()==="")return t;let r=0;function n(o){let a,c=o.exec(t.substring(r));return c?(a=c[0],r+=a.length,a):""}let s=[];for(;n(gn),!(r>=t.length);){let o=n(mn);if(o.slice(-1)===",")o=he(e,o.substring(0,o.length-1)),s.push(o);else {let a="";o=he(e,o);let c=false;for(;;){let i=t.charAt(r);if(i===""){s.push((o+a).trim());break}else if(c)i===")"&&(c=false);else if(i===","){r+=1,s.push((o+a).trim());break}else i==="("&&(c=true);a+=i,r+=1;}}}return s.join(", ")}function he(e,t){return !t||t.trim()===""?t:ft(e,t)}function bn(e){return !!(e.tagName==="svg"||e.ownerSVGElement)}function ft(e,t){let r=Ft.get(e);if(r||(r=e.createElement("a"),Ft.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Qt(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&["table","td","th"].includes(t)?he(e,n):r==="srcset"?yn(e,n):r==="style"?Ue(n,ft(e)):t==="object"&&r==="data"?he(e,n):n)}function Zt(e,t,r){return ["video","audio"].includes(e)&&ne(t)==="autoplay"}function Sn(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return !0}else for(let n=e.classList.length;n--;){let s=e.classList[n];if(t.test(s))return !0}if(r)return e.matches(r)}catch(n){}return false}function He(e,t,r){if(!e)return false;if(e.nodeType!==e.ELEMENT_NODE)return r?He(C.parentNode(e),t,r):false;for(let n=e.classList.length;n--;){let s=e.classList[n];if(t.test(s))return true}return r?He(C.parentNode(e),t,r):false}function er(e,t,r,n){let s;if(Kt(e)){if(s=e,!C.childNodes(s).length)return false}else {if(C.parentElement(e)===null)return false;s=C.parentElement(e);}try{if(typeof t=="string"){if(n){if(s.closest(`.${t}`))return !0}else if(s.classList.contains(t))return !0}else if(He(s,t,n))return !0;if(r){if(n){if(s.closest(r))return !0}else if(s.matches(r))return !0}}catch(o){}return false}function wn(e,t,r){let n=e.contentWindow;if(!n)return;let s=false,o;try{o=n.document.readyState;}catch(c){return}if(o!=="complete"){let c=setTimeout(()=>{s||(t(),s=true);},r);e.addEventListener("load",()=>{clearTimeout(c),s=true,t();});return}let a="about:blank";if(n.location.href!==a||e.src===a||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t);}function Cn(e,t,r){let n=false,s;try{s=e.sheet;}catch(a){return}if(s)return;let o=setTimeout(()=>{n||(t(),n=true);},r);e.addEventListener("load",()=>{clearTimeout(o),n=true,t();});}function vn(e,t){let{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:a,inlineStylesheet:c,maskInputOptions:i={},maskTextFn:p,maskInputFn:u,dataURLOptions:d={},inlineImages:f,recordCanvas:h,keepIframeSrcFn:m,newlyAddedElement:l=false,cssCaptured:b=false}=t,I=Mn(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:W.Document,childNodes:[],compatMode:e.compatMode}:{type:W.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return {type:W.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:return Rn(e,{doc:r,blockClass:s,blockSelector:o,inlineStylesheet:c,maskInputOptions:i,maskInputFn:u,dataURLOptions:d,inlineImages:f,recordCanvas:h,keepIframeSrcFn:m,newlyAddedElement:l,rootId:I});case e.TEXT_NODE:return In(e,{doc:r,needsMask:a,maskTextFn:p,rootId:I,cssCaptured:b});case e.CDATA_SECTION_NODE:return {type:W.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return {type:W.Comment,textContent:C.textContent(e)||"",rootId:I};default:return false}}function Mn(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function In(e,t){let{needsMask:r,maskTextFn:n,rootId:s,cssCaptured:o}=t,a=C.parentNode(e),c=a&&a.tagName,i="",p=c==="STYLE"?true:void 0,u=c==="SCRIPT"?true:void 0;return u?i="SCRIPT_PLACEHOLDER":o||(i=C.textContent(e),p&&i&&(i=Ue(i,ft(t.doc)))),!p&&!u&&i&&r&&(i=n?n(i,C.parentElement(e)):i.replace(/[\S]/g,"*")),{type:W.Text,textContent:i||"",rootId:s}}function Rn(e,t){let{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:c,dataURLOptions:i={},inlineImages:p,recordCanvas:u,keepIframeSrcFn:d,newlyAddedElement:f=false,rootId:h}=t,m=Sn(e,n,s),l=fn(e),b={},I=e.attributes.length;for(let g=0;g<I;g++){let M=e.attributes[g];Zt(l,M.name,M.value)||(b[M.name]=Qt(r,l,ne(M.name),M.value));}if(l==="link"&&o){let g=Array.from(r.styleSheets).find(T=>T.href===e.href),M=null;g&&(M=tt(g)),M&&(delete b.rel,delete b.href,b._cssText=M);}if(l==="style"&&e.sheet){let g=tt(e.sheet);g&&(e.childNodes.length>1&&(g=dn(g,e)),b._cssText=g);}if(["input","textarea","select"].includes(l)){let g=e.value,M=e.checked;b.type!=="radio"&&b.type!=="checkbox"&&b.type!=="submit"&&b.type!=="button"&&g?b.value=Fe({element:e,type:Pe(e),tagName:l,value:g,maskInputOptions:a,maskInputFn:c}):M&&(b.checked=M);}if(l==="option"&&(e.selected&&!a.select?b.selected=true:delete b.selected),l==="dialog"&&e.open&&(b.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),l==="canvas"&&u){if(e.__context==="2d")nn(e)||(b.rr_dataURL=e.toDataURL(i.type,i.quality));else if(!("__context"in e)){let g=e.toDataURL(i.type,i.quality),M=r.createElement("canvas");M.width=e.width,M.height=e.height;let T=M.toDataURL(i.type,i.quality);g!==T&&(b.rr_dataURL=g);}}if(l==="img"&&p){ue||(ue=r.createElement("canvas"),At=ue.getContext("2d"));let g=e,M=g.currentSrc||g.getAttribute("src")||"<unknown-src>",T=g.crossOrigin,A=()=>{g.removeEventListener("load",A);try{ue.width=g.naturalWidth,ue.height=g.naturalHeight,At.drawImage(g,0,0),b.rr_dataURL=ue.toDataURL(i.type,i.quality);}catch(H){if(g.crossOrigin!=="anonymous"){g.crossOrigin="anonymous",g.complete&&g.naturalWidth!==0?A():g.addEventListener("load",A);return}else console.warn(`Cannot inline img src=${M}! Error: ${H}`);}g.crossOrigin==="anonymous"&&(T?b.crossOrigin=T:g.removeAttribute("crossorigin"));};g.complete&&g.naturalWidth!==0?A():g.addEventListener("load",A);}if(["audio","video"].includes(l)){let g=b;g.rr_mediaState=e.paused?"paused":"played",g.rr_mediaCurrentTime=e.currentTime,g.rr_mediaPlaybackRate=e.playbackRate,g.rr_mediaMuted=e.muted,g.rr_mediaLoop=e.loop,g.rr_mediaVolume=e.volume;}if(f||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop)),m){let{width:g,height:M}=e.getBoundingClientRect();b={class:b.class,rr_width:`${g}px`,rr_height:`${M}px`};}l==="iframe"&&!d(b.src)&&(e.contentDocument||(b.rr_src=b.src),delete b.src);let w;try{customElements.get(l)&&(w=!0);}catch(g){}return {type:W.Element,tagName:l,attributes:b,childNodes:[],isSVG:bn(e)||void 0,needBlock:m,rootId:h,isCustom:w}}function _(e){return e==null?"":e.toLowerCase()}function tr(e){return e===true||e==="all"?{script:true,comment:true,headFavicon:true,headWhitespace:true,headMetaSocial:true,headMetaRobots:true,headMetaHttpEquiv:true,headMetaVerification:true,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function En(e,t){if(t.comment&&e.type===W.Comment)return true;if(e.type===W.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"&&Yt(e.attributes.href)==="js"))return true;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(_(e.attributes.name).match(/^msapplication-tile(image|color)$/)||_(e.attributes.name)==="application-name"||_(e.attributes.rel)==="icon"||_(e.attributes.rel)==="apple-touch-icon"||_(e.attributes.rel)==="shortcut icon")))return true;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&_(e.attributes.name).match(/^description|keywords$/))return true;if(t.headMetaSocial&&(_(e.attributes.property).match(/^(og|twitter|fb):/)||_(e.attributes.name).match(/^(og|twitter):/)||_(e.attributes.name)==="pinterest"))return true;if(t.headMetaRobots&&(_(e.attributes.name)==="robots"||_(e.attributes.name)==="googlebot"||_(e.attributes.name)==="bingbot"))return true;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return true;if(t.headMetaAuthorship&&(_(e.attributes.name)==="author"||_(e.attributes.name)==="generator"||_(e.attributes.name)==="framework"||_(e.attributes.name)==="publisher"||_(e.attributes.name)==="progid"||_(e.attributes.property).match(/^article:/)||_(e.attributes.property).match(/^product:/)))return true;if(t.headMetaVerification&&(_(e.attributes.name)==="google-site-verification"||_(e.attributes.name)==="yandex-verification"||_(e.attributes.name)==="csrf-token"||_(e.attributes.name)==="p:domain_verify"||_(e.attributes.name)==="verify-v1"||_(e.attributes.name)==="verification"||_(e.attributes.name)==="shopify-checkout-api-token"))return true}}return false}function fe(e,t){let{doc:r,mirror:n,blockClass:s,blockSelector:o,maskTextClass:a,maskTextSelector:c,skipChild:i=false,inlineStylesheet:p=true,maskInputOptions:u={},maskTextFn:d,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m={},inlineImages:l=false,recordCanvas:b=false,onSerialize:I,onIframeLoad:w,iframeLoadTimeout:g=5e3,onStylesheetLoad:M,stylesheetLoadTimeout:T=5e3,keepIframeSrcFn:A=()=>false,newlyAddedElement:H=false,cssCaptured:K=false}=t,{needsMask:$}=t,{preserveWhiteSpace:G=true}=t;$||($=er(e,a,c,$===void 0));let z=vn(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:$,inlineStylesheet:p,maskInputOptions:u,maskTextFn:d,maskInputFn:f,dataURLOptions:m,inlineImages:l,recordCanvas:b,keepIframeSrcFn:A,newlyAddedElement:H,cssCaptured:K});if(!z)return console.warn(e,"not serialized"),null;let X;n.hasNode(e)?X=n.getId(e):En(z,h)||!G&&z.type===W.Text&&!z.textContent.replace(/^\s+|\s+$/gm,"").length?X=We:X=Jt();let R=Object.assign(z,{id:X});if(n.add(e,R),X===We)return null;I&&I(e);let se=!i;if(R.type===W.Element){se=se&&!R.needBlock,delete R.needBlock;let S=C.shadowRoot(e);S&&Se(S)&&(R.isShadowHost=true);}if((R.type===W.Document||R.type===W.Element)&&se){h.headWhitespace&&R.type===W.Element&&R.tagName==="head"&&(G=false);let S={doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:$,maskTextClass:a,maskTextSelector:c,skipChild:i,inlineStylesheet:p,maskInputOptions:u,maskTextFn:d,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m,inlineImages:l,recordCanvas:b,preserveWhiteSpace:G,onSerialize:I,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:M,stylesheetLoadTimeout:T,keepIframeSrcFn:A,cssCaptured:false};if(!(R.type===W.Element&&R.tagName==="textarea"&&R.attributes.value!==void 0)){R.type===W.Element&&R.attributes._cssText!==void 0&&typeof R.attributes._cssText=="string"&&(S.cssCaptured=true);for(let D of Array.from(C.childNodes(e))){let L=fe(D,S);L&&R.childNodes.push(L);}}let v=null;if(Kt(e)&&(v=C.shadowRoot(e)))for(let D of Array.from(C.childNodes(v))){let L=fe(D,S);L&&(Se(v)&&(L.isShadow=true),R.childNodes.push(L));}}let te=C.parentNode(e);return te&&be(te)&&Se(te)&&(R.isShadow=true),R.type===W.Element&&R.tagName==="iframe"&&wn(e,()=>{let S=e.contentDocument;if(S&&w){let v=fe(S,{doc:S,mirror:n,blockClass:s,blockSelector:o,needsMask:$,maskTextClass:a,maskTextSelector:c,skipChild:false,inlineStylesheet:p,maskInputOptions:u,maskTextFn:d,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m,inlineImages:l,recordCanvas:b,preserveWhiteSpace:G,onSerialize:I,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:M,stylesheetLoadTimeout:T,keepIframeSrcFn:A});v&&w(e,v);}},g),R.type===W.Element&&R.tagName==="link"&&typeof R.attributes.rel=="string"&&(R.attributes.rel==="stylesheet"||R.attributes.rel==="preload"&&typeof R.attributes.href=="string"&&Yt(R.attributes.href)==="css")&&Cn(e,()=>{if(M){let S=fe(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:$,maskTextClass:a,maskTextSelector:c,skipChild:false,inlineStylesheet:p,maskInputOptions:u,maskTextFn:d,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m,inlineImages:l,recordCanvas:b,preserveWhiteSpace:G,onSerialize:I,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:M,stylesheetLoadTimeout:T,keepIframeSrcFn:A});S&&M(e,S);}},T),R}function xn(e,t){let{mirror:r=new Ae,blockClass:n="rr-block",blockSelector:s=null,maskTextClass:o="rr-mask",maskTextSelector:a=null,inlineStylesheet:c=true,inlineImages:i=false,recordCanvas:p=false,maskAllInputs:u=false,maskTextFn:d,maskInputFn:f,slimDOM:h=false,dataURLOptions:m,preserveWhiteSpace:l,onSerialize:b,onIframeLoad:I,iframeLoadTimeout:w,onStylesheetLoad:g,stylesheetLoadTimeout:M,keepIframeSrcFn:T=()=>false}=t,A=u===true?{color:true,date:true,"datetime-local":true,email:true,month:true,number:true,range:true,search:true,tel:true,text:true,time:true,url:true,week:true,textarea:true,select:true,password:true}:u===false?{password:true}:u,H=tr(h);return fe(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:false,inlineStylesheet:c,maskInputOptions:A,maskTextFn:d,maskInputFn:f,slimDOMOptions:H,dataURLOptions:m,inlineImages:i,recordCanvas:p,preserveWhiteSpace:l,onSerialize:b,onIframeLoad:I,iframeLoadTimeout:w,onStylesheetLoad:g,stylesheetLoadTimeout:M,keepIframeSrcFn:T,newlyAddedElement:false})}function j(e,t,r=document){let n={capture:true,passive:true};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}function ve(e,t,r={}){let n=null,s=0;return function(...o){let a=Date.now();!s&&r.leading===false&&(s=a);let c=t-(a-s),i=this;c<=0||c>t?(n&&(clearTimeout(n),n=null),s=a,e.apply(i,o)):!n&&r.trailing!==false&&(n=setTimeout(()=>{s=r.leading===false?0:Date.now(),n=null,e.apply(i,o);},c));}}function je(e,t,r,n,s=window){let o=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,n?r:{set(a){setTimeout(()=>{r.set.call(this,a);},0),o&&o.set&&o.set.call(this,a);}}),()=>je(e,t,o||{},true)}function rr(e){var t,r,n,s;let o=e.document;return {left:o.scrollingElement?o.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:o.documentElement.scrollLeft||(o==null?void 0:o.body)&&((t=C.parentElement(o.body))==null?void 0:t.scrollLeft)||((r=o==null?void 0:o.body)==null?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(o==null?void 0:o.documentElement.scrollTop)||(o==null?void 0:o.body)&&((n=C.parentElement(o.body))==null?void 0:n.scrollTop)||((s=o==null?void 0:o.body)==null?void 0:s.scrollTop)||0}}function nr(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function sr(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function or(e){return e?e.nodeType===e.ELEMENT_NODE?e:C.parentElement(e):null}function V(e,t,r,n){if(!e)return false;let s=or(e);if(!s)return false;try{if(typeof t=="string"){if(s.classList.contains(t)||n&&s.closest("."+t)!==null)return !0}else if(He(s,t,n))return !0}catch(o){}return !!(r&&(s.matches(r)||n&&s.closest(r)!==null))}function kn(e,t){return t.getId(e)!==-1}function Ze(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?true:t.getId(e)===We}function ir(e,t){if(be(e))return false;let r=t.getId(e);if(!t.has(r))return true;let n=C.parentNode(e);return n&&n.nodeType===e.DOCUMENT_NODE?false:n?ir(n,t):true}function nt(e){return !!e.changedTouches}function On(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach);}function ar(e,t){return !!(e.nodeName==="IFRAME"&&t.getMeta(e))}function lr(e,t){return !!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function st(e){return e?e instanceof rt&&"shadowRoot"in e?!!e.shadowRoot:!!C.shadowRoot(e):false}function cr(e){var t;let r=null;return "getRootNode"in e&&((t=C.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(e))&&(r=C.host(C.getRootNode(e))),r}function Tn(e){let t=e,r;for(;r=cr(t);)t=r;return t}function Nn(e){let t=C.ownerDocument(e);if(!t)return false;let r=Tn(e);return C.contains(t,r)}function ur(e){let t=C.ownerDocument(e);return t?C.contains(t,e)||Nn(e):false}function at(e,t){e.delete(t),C.childNodes(t).forEach(r=>at(e,r));}function Ln(e,t){let r=[e];for(;r.length;){let n=r.pop();t.has(n)||(t.add(n),C.childNodes(n).forEach(s=>r.push(s)));}}function Wt(e,t){return e.size===0?false:dr(e,t)}function dr(e,t){if(e.has(t))return true;let r=C.parentNode(t);return r?dr(e,r):false}function _n(e){we=e;}function Dn(){we=void 0;}function Me(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(t){}return e&&e.target}function pr(e,t){let r=new it;le.push(r),r.init(e);let[n,s]=qt(),o=new n(x(r.processMutations.bind(r)));return o.observe(t,{attributes:true,attributeOldValue:true,characterData:true,characterDataOldValue:true,childList:true,subtree:true}),[o,s]}function An({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===false)return ()=>{};let s=typeof t.mousemove=="number"?t.mousemove:50,o=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,a=[],c,i=ve(x(d=>{let f=Date.now()-c;e(a.map(h=>(h.timeOffset-=f,h)),d),a=[],c=null;}),o),p=x(ve(x(d=>{let f=Me(d),{clientX:h,clientY:m}=nt(d)?d.changedTouches[0]:d;c||(c=Ce()),a.push({x:h,y:m,id:n.getId(f),timeOffset:Ce()-c}),i(typeof DragEvent!="undefined"&&d instanceof DragEvent?E.Drag:d instanceof MouseEvent?E.MouseMove:E.TouchMove);}),s,{trailing:!1})),u=[j("mousemove",p,r),j("touchmove",p,r),j("drag",p,r)];return x(()=>{u.forEach(d=>d());})}function Fn({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){if(o.mouseInteraction===false)return ()=>{};let a=o.mouseInteraction===true||o.mouseInteraction===void 0?{}:o.mouseInteraction,c=[],i=null,p=u=>d=>{let f=Me(d);if(V(f,n,s,true))return;let h=null,m=u;if("pointerType"in d){switch(d.pointerType){case "mouse":h=ee.Mouse;break;case "touch":h=ee.Touch;break;case "pen":h=ee.Pen;break}h===ee.Touch?q[u]===q.MouseDown?m="TouchStart":q[u]===q.MouseUp&&(m="TouchEnd"):ee.Pen;}else nt(d)&&(h=ee.Touch);h!==null?(i=h,(m.startsWith("Touch")&&h===ee.Touch||m.startsWith("Mouse")&&h===ee.Mouse)&&(h=null)):q[u]===q.Click&&(h=i,i=null);let l=nt(d)?d.changedTouches[0]:d;if(!l)return;let b=r.getId(f),{clientX:I,clientY:w}=l;x(e)({type:q[m],id:b,x:I,y:w,...h!==null&&{pointerType:h}});};return Object.keys(q).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&a[u]!==false).forEach(u=>{let d=ne(u),f=p(u);if(window.PointerEvent)switch(q[u]){case q.MouseDown:case q.MouseUp:d=d.replace("mouse","pointer");break;case q.TouchStart:case q.TouchEnd:return}c.push(j(d,f,t));}),x(()=>{c.forEach(u=>u());})}function hr({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){let a=x(ve(x(c=>{let i=Me(c);if(!i||V(i,n,s,!0))return;let p=r.getId(i);if(i===t&&t.defaultView){let u=rr(t.defaultView);e({id:p,x:u.left,y:u.top});}else e({id:p,x:i.scrollLeft,y:i.scrollTop});}),o.scroll||100));return j("scroll",a,t)}function Pn({viewportResizeCb:e},{win:t}){let r=-1,n=-1,s=x(ve(x(()=>{let o=nr(),a=sr();(r!==o||n!==a)&&(e({width:Number(a),height:Number(o)}),r=o,n=a);}),200));return j("resize",s,t)}function Wn({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,ignoreClass:o,ignoreSelector:a,maskInputOptions:c,maskInputFn:i,sampling:p,userTriggeredOnInput:u}){function d(w){let g=Me(w),M=w.isTrusted,T=g&&g.tagName;if(g&&T==="OPTION"&&(g=C.parentElement(g)),!g||!T||Un.indexOf(T)<0||V(g,n,s,true)||g.classList.contains(o)||a&&g.matches(a))return;let A=g.value,H=false,K=Pe(g)||"";K==="radio"||K==="checkbox"?H=g.checked:(c[T.toLowerCase()]||c[K])&&(A=Fe({element:g,maskInputOptions:c,tagName:T,type:K,value:A,maskInputFn:i})),f(g,u?{text:A,isChecked:H,userTriggered:M}:{text:A,isChecked:H});let $=g.name;K==="radio"&&$&&H&&t.querySelectorAll(`input[type="radio"][name="${$}"]`).forEach(G=>{if(G!==g){let z=G.value;f(G,u?{text:z,isChecked:!H,userTriggered:false}:{text:z,isChecked:!H});}});}function f(w,g){let M=Ht.get(w);if(!M||M.text!==g.text||M.isChecked!==g.isChecked){Ht.set(w,g);let T=r.getId(w);x(e)({...g,id:T});}}let m=(p.input==="last"?["change"]:["input","change"]).map(w=>j(w,x(d),t)),l=t.defaultView;if(!l)return ()=>{m.forEach(w=>w());};let b=l.Object.getOwnPropertyDescriptor(l.HTMLInputElement.prototype,"value"),I=[[l.HTMLInputElement.prototype,"value"],[l.HTMLInputElement.prototype,"checked"],[l.HTMLSelectElement.prototype,"value"],[l.HTMLTextAreaElement.prototype,"value"],[l.HTMLSelectElement.prototype,"selectedIndex"],[l.HTMLOptionElement.prototype,"selected"]];return b&&b.set&&m.push(...I.map(w=>je(w[0],w[1],{set(){x(d)({target:this,isTrusted:false});}},false,l))),x(()=>{m.forEach(w=>w());})}function Be(e){let t=[];function r(n,s){if(Ne("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||Ne("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||Ne("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||Ne("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){let a=Array.from(n.parentRule.cssRules).indexOf(n);return s.unshift(a),r(n.parentRule,s)}else if(n.parentStyleSheet){let a=Array.from(n.parentStyleSheet.cssRules).indexOf(n);s.unshift(a);}return s}return r(e,t)}function re(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function Hn({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return ()=>{};let s=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:x((u,d,f)=>{let[h,m]=f,{id:l,styleId:b}=re(d,t,r.styleMirror);return (l&&l!==-1||b&&b!==-1)&&e({id:l,styleId:b,adds:[{rule:h,index:m}]}),u.apply(d,f)})}),n.CSSStyleSheet.prototype.addRule=function(u,d,f=this.cssRules.length){let h=`${u} { ${d} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[h,f])};let o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:x((u,d,f)=>{let[h]=f,{id:m,styleId:l}=re(d,t,r.styleMirror);return (m&&m!==-1||l&&l!==-1)&&e({id:m,styleId:l,removes:[{index:h}]}),u.apply(d,f)})}),n.CSSStyleSheet.prototype.removeRule=function(u){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[u])};let a;n.CSSStyleSheet.prototype.replace&&(a=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:x((u,d,f)=>{let[h]=f,{id:m,styleId:l}=re(d,t,r.styleMirror);return (m&&m!==-1||l&&l!==-1)&&e({id:m,styleId:l,replace:h}),u.apply(d,f)})}));let c;n.CSSStyleSheet.prototype.replaceSync&&(c=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:x((u,d,f)=>{let[h]=f,{id:m,styleId:l}=re(d,t,r.styleMirror);return (m&&m!==-1||l&&l!==-1)&&e({id:m,styleId:l,replaceSync:h}),u.apply(d,f)})}));let i={};Le("CSSGroupingRule")?i.CSSGroupingRule=n.CSSGroupingRule:(Le("CSSMediaRule")&&(i.CSSMediaRule=n.CSSMediaRule),Le("CSSConditionRule")&&(i.CSSConditionRule=n.CSSConditionRule),Le("CSSSupportsRule")&&(i.CSSSupportsRule=n.CSSSupportsRule));let p={};return Object.entries(i).forEach(([u,d])=>{p[u]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(p[u].insertRule,{apply:x((f,h,m)=>{let[l,b]=m,{id:I,styleId:w}=re(h.parentStyleSheet,t,r.styleMirror);return (I&&I!==-1||w&&w!==-1)&&e({id:I,styleId:w,adds:[{rule:l,index:[...Be(h),b||0]}]}),f.apply(h,m)})}),d.prototype.deleteRule=new Proxy(p[u].deleteRule,{apply:x((f,h,m)=>{let[l]=m,{id:b,styleId:I}=re(h.parentStyleSheet,t,r.styleMirror);return (b&&b!==-1||I&&I!==-1)&&e({id:b,styleId:I,removes:[{index:[...Be(h),l]}]}),f.apply(h,m)})});}),x(()=>{n.CSSStyleSheet.prototype.insertRule=s,n.CSSStyleSheet.prototype.deleteRule=o,a&&(n.CSSStyleSheet.prototype.replace=a),c&&(n.CSSStyleSheet.prototype.replaceSync=c),Object.entries(i).forEach(([u,d])=>{d.prototype.insertRule=p[u].insertRule,d.prototype.deleteRule=p[u].deleteRule;});})}function fr({mirror:e,stylesheetManager:t},r){var n,s,o;let a=null;r.nodeName==="#document"?a=e.getId(r):a=e.getId(C.host(r));let c=r.nodeName==="#document"?(n=r.defaultView)==null?void 0:n.Document:(o=(s=r.ownerDocument)==null?void 0:s.defaultView)==null?void 0:o.ShadowRoot,i=c!=null&&c.prototype?Object.getOwnPropertyDescriptor(c==null?void 0:c.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!c||!i?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){var p;return (p=i.get)==null?void 0:p.call(this)},set(p){var u;let d=(u=i.set)==null?void 0:u.call(this,p);if(a!==null&&a!==-1)try{t.adoptStyleSheets(p,a);}catch(f){}return d}}),x(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set});}))}function Bn({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:s}){let o=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:x((c,i,p)=>{var u;let[d,f,h]=p;if(r.has(d))return o.apply(i,[d,f,h]);let{id:m,styleId:l}=re((u=i.parentRule)==null?void 0:u.parentStyleSheet,t,n.styleMirror);return (m&&m!==-1||l&&l!==-1)&&e({id:m,styleId:l,set:{property:d,value:f,priority:h},index:Be(i.parentRule)}),c.apply(i,p)})});let a=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:x((c,i,p)=>{var u;let[d]=p;if(r.has(d))return a.apply(i,[d]);let{id:f,styleId:h}=re((u=i.parentRule)==null?void 0:u.parentStyleSheet,t,n.styleMirror);return (f&&f!==-1||h&&h!==-1)&&e({id:f,styleId:h,remove:{property:d},index:Be(i.parentRule)}),c.apply(i,p)})}),x(()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=a;})}function $n({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:o}){let a=x(i=>ve(x(p=>{let u=Me(p);if(!u||V(u,t,r,!0))return;let{currentTime:d,volume:f,muted:h,playbackRate:m,loop:l}=u;e({type:i,id:n.getId(u),currentTime:d,volume:f,muted:h,playbackRate:m,loop:l});}),s.media||500)),c=[j("play",a(de.Play),o),j("pause",a(de.Pause),o),j("seeked",a(de.Seeked),o),j("volumechange",a(de.VolumeChange),o),j("ratechange",a(de.RateChange),o)];return x(()=>{c.forEach(i=>i());})}function zn({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return ()=>{};let n=[],s=new WeakMap,o=r.FontFace;r.FontFace=function(i,p,u){let d=new o(i,p,u);return s.set(d,{family:i,buffer:typeof p!="string",descriptors:u,fontSource:typeof p=="string"?p:JSON.stringify(Array.from(new Uint8Array(p)))}),d};let a=ce(t.fonts,"add",function(c){return function(i){return setTimeout(x(()=>{let p=s.get(i);p&&(e(p),s.delete(i));}),0),c.apply(this,[i])}});return n.push(()=>{r.FontFace=o;}),n.push(a),x(()=>{n.forEach(c=>c());})}function jn(e){let{doc:t,mirror:r,blockClass:n,blockSelector:s,selectionCb:o}=e,a=true,c=x(()=>{let i=t.getSelection();if(!i||a&&(i!=null&&i.isCollapsed))return;a=i.isCollapsed||false;let p=[],u=i.rangeCount||0;for(let d=0;d<u;d++){let f=i.getRangeAt(d),{startContainer:h,startOffset:m,endContainer:l,endOffset:b}=f;V(h,n,s,!0)||V(l,n,s,!0)||p.push({start:r.getId(h),startOffset:m,end:r.getId(l),endOffset:b});}o({ranges:p});});return c(),j("selectionchange",c)}function Vn({doc:e,customElementCb:t}){let r=e.defaultView;return !r||!r.customElements?()=>{}:ce(r.customElements,"define",function(s){return function(o,a,c){try{t({define:{name:o}});}catch(i){console.warn(`Custom element callback failed for ${o}`);}return s.apply(this,[o,a,c])}})}function Gn(e,t){let{mutationCb:r,mousemoveCb:n,mouseInteractionCb:s,scrollCb:o,viewportResizeCb:a,inputCb:c,mediaInteractionCb:i,styleSheetRuleCb:p,styleDeclarationCb:u,canvasMutationCb:d,fontCb:f,selectionCb:h,customElementCb:m}=e;e.mutationCb=(...l)=>{t.mutation&&t.mutation(...l),r(...l);},e.mousemoveCb=(...l)=>{t.mousemove&&t.mousemove(...l),n(...l);},e.mouseInteractionCb=(...l)=>{t.mouseInteraction&&t.mouseInteraction(...l),s(...l);},e.scrollCb=(...l)=>{t.scroll&&t.scroll(...l),o(...l);},e.viewportResizeCb=(...l)=>{t.viewportResize&&t.viewportResize(...l),a(...l);},e.inputCb=(...l)=>{t.input&&t.input(...l),c(...l);},e.mediaInteractionCb=(...l)=>{t.mediaInteaction&&t.mediaInteaction(...l),i(...l);},e.styleSheetRuleCb=(...l)=>{t.styleSheetRule&&t.styleSheetRule(...l),p(...l);},e.styleDeclarationCb=(...l)=>{t.styleDeclaration&&t.styleDeclaration(...l),u(...l);},e.canvasMutationCb=(...l)=>{t.canvasMutation&&t.canvasMutation(...l),d(...l);},e.fontCb=(...l)=>{t.font&&t.font(...l),f(...l);},e.selectionCb=(...l)=>{t.selection&&t.selection(...l),h(...l);},e.customElementCb=(...l)=>{t.customElement&&t.customElement(...l),m(...l);};}function qn(e,t={}){let r=e.doc.defaultView;if(!r)return ()=>{};Gn(e,t);let n,s=()=>{};e.recordDOM&&([n,s]=pr(e,e.doc));let o=An(e),a=Fn(e),c=hr(e),i=Pn(e,{win:r}),p=Wn(e),u=$n(e),d=()=>{},f=()=>{},h=()=>{},m=()=>{};e.recordDOM&&(d=Hn(e,{win:r}),f=fr(e,e.doc),h=Bn(e,{win:r}),e.collectFonts&&(m=zn(e)));let l=jn(e),b=Vn(e),I=[];for(let w of e.plugins)I.push(w.observer(w.callback,r,w.options));return x(()=>{le.forEach(w=>w.reset()),n==null||n.disconnect(),s(),o(),a(),c(),i(),p(),u(),d(),f(),h(),m(),l(),b(),I.forEach(w=>w());})}function Ne(e){return typeof window[e]!="undefined"}function Le(e){return !!(typeof window[e]!="undefined"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}function Yn(e,t){let r=Bt.get(e);return r||(r=new Map,Bt.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function _e(e,t,r){if(e instanceof Array)return e.map(n=>_e(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return {rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){let n=e.constructor.name,s=Xn(e);return {rr_type:n,base64:s}}else {if(e instanceof DataView)return {rr_type:e.constructor.name,args:[_e(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let n=e.constructor.name,{src:s}=e;return {rr_type:n,src:s}}else if(e instanceof HTMLCanvasElement){let n="HTMLImageElement",s=e.toDataURL();return {rr_type:n,src:s}}else {if(e instanceof ImageData)return {rr_type:e.constructor.name,args:[_e(e.data,t,r),e.width,e.height]};if(yr(e,t)||typeof e=="object"){let n=e.constructor.name,s=mr(e,t,r);return {rr_type:n,index:s}}}}return e}function Jn(e,t,r,n){let s=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let a of o)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;let c=ce(t.CanvasRenderingContext2D.prototype,a,function(i){return function(...p){return V(this.canvas,r,n,!0)||setTimeout(()=>{let u=gr(p,t,this);e(this.canvas,{type:ge["2D"],property:a,args:u});},0),i.apply(this,p)}});s.push(c);}catch(c){let i=je(t.CanvasRenderingContext2D.prototype,a,{set(p){e(this.canvas,{type:ge["2D"],property:a,args:[p],setter:true});}});s.push(i);}return ()=>{s.forEach(a=>a());}}function Qn(e){return e==="experimental-webgl"?"webgl":e}function $t(e,t,r,n){let s=[];try{let o=ce(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(c,...i){if(!V(this,t,r,!0)){let p=Qn(c);if("__context"in this||(this.__context=p),n&&["webgl","webgl2"].includes(p))if(i[0]&&typeof i[0]=="object"){let u=i[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0);}else i.splice(0,1,{preserveDrawingBuffer:!0});}return a.apply(this,[c,...i])}});s.push(o);}catch(o){console.error("failed to patch HTMLCanvasElement.prototype.getContext");}return ()=>{s.forEach(o=>o());}}function zt(e,t,r,n,s,o){let a=[],c=Object.getOwnPropertyNames(e);for(let i of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(i))try{if(typeof e[i]!="function")continue;let p=ce(e,i,function(u){return function(...d){let f=u.apply(this,d);if(mr(f,o,this),"tagName"in this.canvas&&!V(this.canvas,n,s,!0)){let h=gr(d,o,this),m={type:t,property:i,args:h};r(this.canvas,m);}return f}});a.push(p);}catch(p){let u=je(e,i,{set(d){r(this.canvas,{type:t,property:i,args:[d],setter:true});}});a.push(u);}return a}function Zn(e,t,r,n){let s=[];return typeof t.WebGLRenderingContext!="undefined"&&s.push(...zt(t.WebGLRenderingContext.prototype,ge.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext!="undefined"&&s.push(...zt(t.WebGL2RenderingContext.prototype,ge.WebGL2,e,r,n,t)),()=>{s.forEach(o=>o());}}function es(e){let t;try{if(t=jt&&(self.URL||self.webkitURL).createObjectURL(jt),!t)throw "";let r=new Worker(t,{name:e==null?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t);}),r}catch(r){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(br),{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t);}}function Ie(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskTextClass:i="rr-mask",maskTextSelector:p=null,inlineStylesheet:u=true,maskAllInputs:d,maskInputOptions:f,slimDOMOptions:h,maskInputFn:m,maskTextFn:l,hooks:b,packFn:I,sampling:w={},dataURLOptions:g={},mousemoveWait:M,recordDOM:T=true,recordCanvas:A=false,recordCrossOriginIframes:H=false,recordAfter:K=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:$=false,collectFonts:G=false,inlineImages:z=false,plugins:X,keepIframeSrcFn:R=()=>false,ignoreCSSAttributes:se=new Set([]),errorHandler:te}=e;_n(te);let S=H?window.parent===window:true,v=false;if(!S)try{window.parent.document&&(v=!1);}catch(O){v=true;}if(S&&!t)throw new Error("emit function is required");if(!S&&!v)return ()=>{};M!==void 0&&w.mousemove===void 0&&(w.mousemove=M),Z.reset();let D=d===true?{color:true,date:true,"datetime-local":true,email:true,month:true,number:true,range:true,search:true,tel:true,text:true,time:true,url:true,week:true,textarea:true,select:true,password:true}:f!==void 0?f:{password:true},L=tr(h);On();let B,oe=0,gt=O=>{for(let Q of X||[])Q.eventProcessor&&(O=Q.eventProcessor(O));return I&&!v&&(O=I(O)),O};U=(O,Q)=>{var F;let P=O;if(P.timestamp=Ce(),(F=le[0])!=null&&F.isFrozen()&&P.type!==k.FullSnapshot&&!(P.type===k.IncrementalSnapshot&&P.data.source===E.Mutation)&&le.forEach(Y=>Y.unfreeze()),S)t==null||t(gt(P),Q);else if(v){let Y={type:"rrweb",event:gt(P),origin:window.location.origin,isCheckout:Q};window.parent.postMessage(Y,"*");}if(P.type===k.FullSnapshot)B=P,oe=0;else if(P.type===k.IncrementalSnapshot){if(P.data.source===E.Mutation&&P.data.isAttachIframe)return;oe++;let Y=n&&oe>=n,N=r&&P.timestamp-B.timestamp>r;(Y||N)&&De(true);}};let Re=O=>{U({type:k.IncrementalSnapshot,data:{source:E.Mutation,...O}});},yt=O=>U({type:k.IncrementalSnapshot,data:{source:E.Scroll,...O}}),bt=O=>U({type:k.IncrementalSnapshot,data:{source:E.CanvasMutation,...O}}),vr=O=>U({type:k.IncrementalSnapshot,data:{source:E.AdoptedStyleSheet,...O}}),ie=new dt({mutationCb:Re,adoptedStyleSheetCb:vr}),ae=new lt({mirror:Z,mutationCb:Re,stylesheetManager:ie,recordCrossOriginIframes:H,wrappedEmit:U});for(let O of X||[])O.getMirror&&O.getMirror({nodeMirror:Z,crossOriginIframeMirror:ae.crossOriginIframeMirror,crossOriginIframeStyleMirror:ae.crossOriginIframeStyleMirror});let Ge=new pt;et=new ut({recordCanvas:A,mutationCb:bt,win:window,blockClass:s,blockSelector:o,mirror:Z,sampling:w.canvas,dataURLOptions:g});let Ee=new ct({mutationCb:Re,scrollCb:yt,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:i,maskTextSelector:p,inlineStylesheet:u,maskInputOptions:D,dataURLOptions:g,maskTextFn:l,maskInputFn:m,recordCanvas:A,inlineImages:z,sampling:w,slimDOMOptions:L,iframeManager:ae,stylesheetManager:ie,canvasManager:et,keepIframeSrcFn:R,processedNodeManager:Ge},mirror:Z});De=(O=false)=>{if(!T)return;U({type:k.Meta,data:{href:window.location.href,width:sr(),height:nr()}},O),ie.reset(),Ee.init(),le.forEach(F=>F.lock());let Q=xn(document,{mirror:Z,blockClass:s,blockSelector:o,maskTextClass:i,maskTextSelector:p,inlineStylesheet:u,maskAllInputs:D,maskTextFn:l,maskInputFn:m,slimDOM:L,dataURLOptions:g,recordCanvas:A,inlineImages:z,onSerialize:F=>{ar(F,Z)&&ae.addIframe(F),lr(F,Z)&&ie.trackLinkElement(F),st(F)&&Ee.addShadowRoot(C.shadowRoot(F),document);},onIframeLoad:(F,P)=>{ae.attachIframe(F,P),Ee.observeAttachShadow(F);},onStylesheetLoad:(F,P)=>{ie.attachLinkElement(F,P);},keepIframeSrcFn:R});if(!Q)return console.warn("Failed to snapshot the document");U({type:k.FullSnapshot,data:{node:Q,initialOffset:rr(window)}},O),le.forEach(F=>F.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ie.adoptStyleSheets(document.adoptedStyleSheets,Z.getId(document));};try{let O=[],Q=P=>{var Y;return x(qn)({mutationCb:Re,mousemoveCb:(N,qe)=>U({type:k.IncrementalSnapshot,data:{source:qe,positions:N}}),mouseInteractionCb:N=>U({type:k.IncrementalSnapshot,data:{source:E.MouseInteraction,...N}}),scrollCb:yt,viewportResizeCb:N=>U({type:k.IncrementalSnapshot,data:{source:E.ViewportResize,...N}}),inputCb:N=>U({type:k.IncrementalSnapshot,data:{source:E.Input,...N}}),mediaInteractionCb:N=>U({type:k.IncrementalSnapshot,data:{source:E.MediaInteraction,...N}}),styleSheetRuleCb:N=>U({type:k.IncrementalSnapshot,data:{source:E.StyleSheetRule,...N}}),styleDeclarationCb:N=>U({type:k.IncrementalSnapshot,data:{source:E.StyleDeclaration,...N}}),canvasMutationCb:bt,fontCb:N=>U({type:k.IncrementalSnapshot,data:{source:E.Font,...N}}),selectionCb:N=>{U({type:k.IncrementalSnapshot,data:{source:E.Selection,...N}});},customElementCb:N=>{U({type:k.IncrementalSnapshot,data:{source:E.CustomElement,...N}});},blockClass:s,ignoreClass:a,ignoreSelector:c,maskTextClass:i,maskTextSelector:p,maskInputOptions:D,inlineStylesheet:u,sampling:w,recordDOM:T,recordCanvas:A,inlineImages:z,userTriggeredOnInput:$,collectFonts:G,doc:P,maskInputFn:m,maskTextFn:l,keepIframeSrcFn:R,blockSelector:o,slimDOMOptions:L,dataURLOptions:g,mirror:Z,iframeManager:ae,stylesheetManager:ie,shadowDomManager:Ee,processedNodeManager:Ge,canvasManager:et,ignoreCSSAttributes:se,plugins:((Y=X==null?void 0:X.filter(N=>N.observer))==null?void 0:Y.map(N=>({observer:N.observer,options:N.options,callback:qe=>U({type:k.Plugin,data:{plugin:N.name,payload:qe}})})))||[]},b)};ae.addLoadListener(P=>{try{O.push(Q(P.contentDocument));}catch(Y){console.warn(Y);}});let F=()=>{De(),O.push(Q(document)),ze=!0;};return ["interactive","complete"].includes(document.readyState)?F():(O.push(j("DOMContentLoaded",()=>{U({type:k.DomContentLoaded,data:{}}),K==="DOMContentLoaded"&&F();})),O.push(j("load",()=>{U({type:k.Load,data:{}}),K==="load"&&F();},window))),()=>{O.forEach(P=>{try{P();}catch(Y){String(Y).toLowerCase().includes("cross-origin")||console.warn(Y);}}),Ge.destroy(),ze=!1,Dn();}}catch(O){console.warn(O);}}var Lr,_r,y,Nt,k,E,q,ee,ge,de,W,Lt,_t,Oe,Vt,Dr,Je,Qe,Ce,C,Ae,Dt,on,an,ln,cn,pn,hn,We,ue,At,mn,gn,Ft,rt,pe,Pt,ot,Ut,it,we,x,le,Un,Ht,$e,lt,ct,me,Kn,ye,Xn,Bt,mr,gr,yr,br,jt,ut,dt,pt,U,De,et,ze,Z,wr=Ir(()=>{Lr=Object.defineProperty,_r=(e,t,r)=>t in e?Lr(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r,y=(e,t,r)=>_r(e,typeof t!="symbol"?t+"":t,r),k=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e))(k||{}),E=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(E||{}),q=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(q||{}),ee=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(ee||{}),ge=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ge||{}),de=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(de||{}),W=(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))(W||{}),Lt={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},_t={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Oe={},Vt={},Dr=()=>!!globalThis.Zone;Je={};Qe={};Ce=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Ce=()=>new Date().getTime());C={ownerDocument:Ar,childNodes:Fr,parentNode:Pr,parentElement:Ur,textContent:Wr,firstChild:Hr,lastChild:Br,nextSibling:$r,previousSibling:zr,contains:jr,getRootNode:Vr,host:Gr,styleSheets:qr,shadowRoot:Kr,querySelector:Xr,querySelectorAll:Yr,nowTimestamp:Ce,mutationObserverCtor:qt,patch:ce};Ae=class{constructor(){y(this,"idNodeMap",new Map),y(this,"nodeMetaMap",new WeakMap);}getId(t){var r;if(!t)return -1;let n=(r=this.getMeta(t))==null?void 0:r.id;return n!=null?n:-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);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n));}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r);}replace(t,r){let n=this.getNode(t);if(n){let s=this.nodeMetaMap.get(n);s&&this.nodeMetaMap.set(r,s);}this.idNodeMap.set(t,r);}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap;}};Dt="__rrweb_original__";on=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,an=/^(?:[a-z+]+:)?\/\//i,ln=/^www\..*/i,cn=/^(data:)([^,]*),(.*)/i;pn=1,hn=new RegExp("[^a-z0-9-_:]"),We=-2;mn=/^[^ \t\n\r\u000c]+/,gn=/^[, \t\n\r\u000c]+/;Ft=new WeakMap;rt=class e{constructor(...t){y(this,"parentElement",null),y(this,"parentNode",null),y(this,"ownerDocument"),y(this,"firstChild",null),y(this,"lastChild",null),y(this,"previousSibling",null),y(this,"nextSibling",null),y(this,"ELEMENT_NODE",1),y(this,"TEXT_NODE",3),y(this,"nodeType"),y(this,"nodeName"),y(this,"RRNodeType");}get childNodes(){let t=[],r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(t instanceof e){if(t.ownerDocument!==this.ownerDocument)return false;if(t===this)return true}else return false;for(;t.parentNode;){if(t.parentNode===this)return true;t=t.parentNode;}return false}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return "RRNode"}};pe=`Please stop import mirror directly. Instead of that,\r
2
2
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
3
- or you can use record.mirror to access the mirror instance during recording.`,Ft={map:{},getId(){return console.error(de),-1},getNode(){return console.error(de),null},removeNodeFromMap(){console.error(de);},has(){return console.error(de),false},reset(){console.error(de);}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(Ft=new Proxy(Ft,{get(e,t,r){return t==="map"&&console.error(de),Reflect.get(e,t,r)}}));ot=class{constructor(){y(this,"id",1),y(this,"styleIDMap",new WeakMap),y(this,"idStyleMap",new Map);}getId(t){var r;return (r=this.styleIDMap.get(t))!=null?r:-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1;}generateId(){return this.id++}};Pt=(e,t)=>`${e}@${t}`,it=class{constructor(){y(this,"frozen",false),y(this,"locked",false),y(this,"texts",[]),y(this,"attributes",[]),y(this,"attributeMap",new WeakMap),y(this,"removes",[]),y(this,"mapRemoves",[]),y(this,"movedMap",{}),y(this,"addedSet",new Set),y(this,"movedSet",new Set),y(this,"droppedSet",new Set),y(this,"removesSubTreeCache",new Set),y(this,"mutationCb"),y(this,"blockClass"),y(this,"blockSelector"),y(this,"maskTextClass"),y(this,"maskTextSelector"),y(this,"inlineStylesheet"),y(this,"maskInputOptions"),y(this,"maskTextFn"),y(this,"maskInputFn"),y(this,"keepIframeSrcFn"),y(this,"recordCanvas"),y(this,"inlineImages"),y(this,"slimDOMOptions"),y(this,"dataURLOptions"),y(this,"doc"),y(this,"mirror"),y(this,"iframeManager"),y(this,"stylesheetManager"),y(this,"shadowDomManager"),y(this,"canvasManager"),y(this,"processedNodeManager"),y(this,"unattachedDoc"),y(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit();}),y(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],r=new Set;for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let h of this.movedSet){let f=S.parentNode(h);this.removesSubTreeCache.has(f)&&!this.movedSet.has(f)||this.addedSet.add(h);}let n=null,s=null,o=-1,a=null,c=false,i=new Set,p=this.addedSet.values(),u=p.next();for(;this.addedSet.size;){if(n!==null&&this.addedSet.has(S.previousSibling(n)))a=n,n=S.previousSibling(n);else {for(this.addedSet.has(u.value)||(u=p.next()),n=u.value;;){if(s=S.parentNode(n),this.addedSet.has(s)){n=s;continue}break}if(i.has(s))s=null;else if(s){if(cr(s)?(c=Ut(this.droppedSet,s)||this.removesSubTreeCache.has(s),c&&Ut(this.movedSet,n)&&(c=false)):c=true,this.addedSet.has(S.lastChild(s)))n=S.lastChild(s),a=null;else for(;;){if(a=S.nextSibling(n),this.addedSet.has(a)){n=a;continue}break}if(o=ye(s)?this.mirror.getId(lr(n)):this.mirror.getId(s),o===-1&&s.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let l=S.host(s);o=this.mirror.getId(l);}}}if(this.addedSet.delete(n),!s||o===-1){i.add(n);continue}else if(c){this.droppedSet.add(n);continue}let h=false;if(n.nodeType===Node.TEXT_NODE){let l=s.tagName;if(l==="TEXTAREA")continue;l==="STYLE"&&r.has(o)&&(h=true);}let f=a?this.mirror.getId(a):null;for(;f===Ue;)a=a&&S.nextSibling(a),f=a&&this.mirror.getId(a);if(f===-1){console.warn("Couldn't record new node. Couldn't find mirror id for nextSibling:",a),n=null;continue}let m=he(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:true,newlyAddedElement:true,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:l=>{ir(l,this.mirror)&&this.iframeManager.addIframe(l),ar(l,this.mirror)&&this.stylesheetManager.trackLinkElement(l),st(n)&&this.shadowDomManager.addShadowRoot(S.shadowRoot(n),this.doc);},onIframeLoad:(l,b)=>{this.iframeManager.attachIframe(l,b),this.shadowDomManager.observeAttachShadow(l);},onStylesheetLoad:(l,b)=>{this.stylesheetManager.attachLinkElement(l,b);},cssCaptured:h});m&&(t.push({parentId:o,nextId:f,node:m}),r.add(m.id));}let d={texts:this.texts.map(h=>{let f=h.node,m=S.parentNode(f);return m&&m.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(m),{id:this.mirror.getId(f),value:h.value}}).filter(h=>!r.has(h.id)).filter(h=>this.mirror.has(h.id)),attributes:this.attributes.map(h=>{let{attributes:f}=h;if(typeof f.style=="string"){let m=JSON.stringify(h.styleDiff),l=JSON.stringify(h._unchangedStyles);m.length<f.style.length&&(m+l).split("var(").length===f.style.split("var(").length&&(f.style=h.styleDiff);}return {id:this.mirror.getId(h.node),attributes:f}}).filter(h=>!r.has(h.id)).filter(h=>this.mirror.has(h.id)),removes:this.removes,adds:t};!d.texts.length&&!d.attributes.length&&!d.removes.length&&!d.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(d));}),y(this,"genTextAreaValueMutation",t=>{let r=this.attributeMap.get(t);r||(r={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(t,r));let n=Array.from(S.childNodes(t),s=>S.textContent(s)||"").join("");r.attributes.value=Ae({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Fe(t),value:n,maskInputFn:this.maskInputFn});}),y(this,"processMutation",t=>{if(!Ze(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case "characterData":{let r=S.textContent(t.target);!G(t.target,this.blockClass,this.blockSelector,false)&&r!==t.oldValue&&this.texts.push({value:Zt(t.target,this.maskTextClass,this.maskTextSelector,true)&&r?this.maskTextFn?this.maskTextFn(r,sr(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case "attributes":{let r=t.target,n=ne(r.tagName),s=t.attributeName,o=t.target.getAttribute(s);if(s==="value"){let c=Fe(r);o=Ae({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:c,value:o,maskInputFn:this.maskInputFn});}if(G(t.target,this.blockClass,this.blockSelector,false)||o===t.oldValue)return;let a=this.attributeMap.get(t.target);if(n==="iframe"&&s==="src"&&!this.keepIframeSrcFn(o))if(!r.contentDocument)s="rr_src";else return;if(a||(a={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(a),this.attributeMap.set(t.target,a)),s==="type"&&n==="input"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Qt(n,s))if(a.attributes[s]=Jt(this.doc,n,ne(s),o),s==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument();}catch(i){this.unattachedDoc=this.doc;}let c=this.unattachedDoc.createElement("span");t.oldValue&&c.setAttribute("style",t.oldValue);for(let i of Array.from(r.style)){let p=r.style.getPropertyValue(i),u=r.style.getPropertyPriority(i);p!==c.style.getPropertyValue(i)||u!==c.style.getPropertyPriority(i)?u===""?a.styleDiff[i]=p:a.styleDiff[i]=[p,u]:a._unchangedStyles[i]=[p,u];}for(let i of Array.from(c.style))r.style.getPropertyValue(i)===""&&(a.styleDiff[i]=false);}else s==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?a.attributes.rr_open_mode="modal":a.attributes.rr_open_mode="non-modal");break}case "childList":{if(G(t.target,this.blockClass,this.blockSelector,true))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{let n=this.mirror.getId(r),s=ye(t.target)?this.mirror.getId(S.host(t.target)):this.mirror.getId(t.target);G(t.target,this.blockClass,this.blockSelector,false)||Ze(r,this.mirror,this.slimDOMOptions)||!En(r,this.mirror)||(this.addedSet.has(r)?(at(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||or(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Pt(n,s)]?at(this.movedSet,r):(this.removes.push({parentId:s,id:n,isShadow:ye(t.target)&&be(t.target)?true:void 0}),Tn(r,this.removesSubTreeCache))),this.mapRemoves.push(r));});break}}}),y(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Ze(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[Pt(this.mirror.getId(t),n)]=true);}else this.addedSet.add(t),this.droppedSet.delete(t);G(t,this.blockClass,this.blockSelector,false)||(S.childNodes(t).forEach(n=>this.genAdds(n)),st(t)&&S.childNodes(S.shadowRoot(t)).forEach(n=>{this.processedNodeManager.add(n,this),this.genAdds(n,t);}));}});}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(r=>{this[r]=t[r];});}freeze(){this.frozen=true,this.canvasManager.freeze();}unfreeze(){this.frozen=false,this.canvasManager.unfreeze(),this.emit();}isFrozen(){return this.frozen}lock(){this.locked=true,this.canvasManager.lock();}unlock(){this.locked=false,this.canvasManager.unlock(),this.emit();}reset(){this.shadowDomManager.reset(),this.canvasManager.reset();}};x=e=>Se?(...r)=>{try{return e(...r)}catch(n){if(Se&&Se(n)===true)return;throw n}}:e,ie=[];Fn=["INPUT","TEXTAREA","SELECT"],Wt=new WeakMap;He=class{constructor(t){y(this,"iframeIdToRemoteIdMap",new WeakMap),y(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t;}getId(t,r,n,s){let o=n||this.getIdToRemoteIdMap(t),a=s||this.getRemoteIdToIdMap(t),c=o.get(r);return c||(c=this.generateIdFn(),o.set(r,c),a.set(c,r)),c}getIds(t,r){let n=this.getIdToRemoteIdMap(t),s=this.getRemoteIdToIdMap(t);return r.map(o=>this.getId(t,o,n,s))}getRemoteId(t,r,n){let s=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;let o=s.get(r);return o||-1}getRemoteIds(t,r){let n=this.getRemoteIdToIdMap(t);return r.map(s=>this.getRemoteId(t,s,n))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t);}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}},lt=class{constructor(t){y(this,"iframes",new WeakMap),y(this,"crossOriginIframeMap",new WeakMap),y(this,"crossOriginIframeMirror",new He(Yt)),y(this,"crossOriginIframeStyleMirror"),y(this,"crossOriginIframeRootIdMap",new WeakMap),y(this,"mirror"),y(this,"mutationCb"),y(this,"wrappedEmit"),y(this,"loadListener"),y(this,"stylesheetManager"),y(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new He(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this));}addIframe(t){this.iframes.set(t,true),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t);}addLoadListener(t){this.loadListener=t;}attachIframe(t,r){var n,s;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:true}),this.recordCrossOriginIframes&&((n=t.contentWindow)==null||n.addEventListener("message",this.handleMessage.bind(this))),(s=this.loadListener)==null||s.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument));}handleMessage(t){let r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;let s=this.crossOriginIframeMap.get(t.source);if(!s)return;let o=this.transformCrossOriginEvent(s,r.data.event);o&&this.wrappedEmit(o,r.data.isCheckout);}transformCrossOriginEvent(t,r){var n;switch(r.type){case k.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);let s=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,s),this.patchRootIdOnNode(r.data.node,s),{timestamp:r.timestamp,type:k.IncrementalSnapshot,data:{source:R.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:true}}}case k.Meta:case k.Load:case k.DomContentLoaded:return false;case k.Plugin:return r;case k.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case k.IncrementalSnapshot:switch(r.data.source){case R.Mutation:return r.data.adds.forEach(s=>{this.replaceIds(s,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,t);let o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(s.node,o);}),r.data.removes.forEach(s=>{this.replaceIds(s,t,["parentId","id"]);}),r.data.attributes.forEach(s=>{this.replaceIds(s,t,["id"]);}),r.data.texts.forEach(s=>{this.replaceIds(s,t,["id"]);}),r;case R.Drag:case R.TouchMove:case R.MouseMove:return r.data.positions.forEach(s=>{this.replaceIds(s,t,["id"]);}),r;case R.ViewportResize:return false;case R.MediaInteraction:case R.MouseInteraction:case R.Scroll:case R.CanvasMutation:case R.Input:return this.replaceIds(r.data,t,["id"]),r;case R.StyleSheetRule:case R.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case R.Font:return r;case R.Selection:return r.data.ranges.forEach(s=>{this.replaceIds(s,t,["start","end"]);}),r;case R.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)==null||n.forEach(s=>{this.replaceStyleIds(s,t,["styleId"]);}),r}}return false}replace(t,r,n,s){for(let o of s)!Array.isArray(r[o])&&typeof r[o]!="number"||(Array.isArray(r[o])?r[o]=t.getIds(n,r[o]):r[o]=t.getId(n,r[o]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r);});}patchRootIdOnNode(t,r){t.type!==B.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r);});}},ct=class{constructor(t){y(this,"shadowDoms",new WeakSet),y(this,"mutationCb"),y(this,"scrollCb"),y(this,"bypassOptions"),y(this,"mirror"),y(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init();}init(){this.reset(),this.patchAttachShadow(Element,document);}addShadowRoot(t,r){if(!be(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);let[n]=dr({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(pr({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(S.host(t))),this.restoreHandlers.push(hr({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t));},0);}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument);}patchAttachShadow(t,r){let n=this;this.restoreHandlers.push(ae(t.prototype,"attachShadow",function(s){return function(o){let a=s.call(this,o),c=S.shadowRoot(this);return c&&cr(this)&&n.addShadowRoot(c,r),a}}));}reset(){this.restoreHandlers.forEach(t=>{try{t();}catch(r){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet;}},fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Gn=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(ge=0;ge<fe.length;ge++)Gn[fe.charCodeAt(ge)]=ge;qn=function(e){var t=new Uint8Array(e),r,n=t.length,s="";for(r=0;r<n;r+=3)s+=fe[t[r]>>2],s+=fe[(t[r]&3)<<4|t[r+1]>>4],s+=fe[(t[r+1]&15)<<2|t[r+2]>>6],s+=fe[t[r+2]&63];return n%3===2?s=s.substring(0,s.length-1)+"=":n%3===1&&(s=s.substring(0,s.length-2)+"=="),s},Bt=new Map;fr=(e,t,r)=>{if(!e||!(gr(e,t)||typeof e=="object"))return;let n=e.constructor.name,s=Kn(r,n),o=s.indexOf(e);return o===-1&&(o=s.length,s.push(e)),o};mr=(e,t,r)=>e.map(n=>Le(n,t,r)),gr=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(s=>typeof t[s]=="function").find(s=>e instanceof t[s]);yr=`(function() {
3
+ or you can use record.mirror to access the mirror instance during recording.`,Pt={map:{},getId(){return console.error(pe),-1},getNode(){return console.error(pe),null},removeNodeFromMap(){console.error(pe);},has(){return console.error(pe),false},reset(){console.error(pe);}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(Pt=new Proxy(Pt,{get(e,t,r){return t==="map"&&console.error(pe),Reflect.get(e,t,r)}}));ot=class{constructor(){y(this,"id",1),y(this,"styleIDMap",new WeakMap),y(this,"idStyleMap",new Map);}getId(t){var r;return (r=this.styleIDMap.get(t))!=null?r:-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1;}generateId(){return this.id++}};Ut=(e,t)=>`${e}@${t}`,it=class{constructor(){y(this,"frozen",false),y(this,"locked",false),y(this,"texts",[]),y(this,"attributes",[]),y(this,"attributeMap",new WeakMap),y(this,"removes",[]),y(this,"mapRemoves",[]),y(this,"movedMap",{}),y(this,"addedSet",new Set),y(this,"movedSet",new Set),y(this,"droppedSet",new Set),y(this,"removesSubTreeCache",new Set),y(this,"mutationCb"),y(this,"blockClass"),y(this,"blockSelector"),y(this,"maskTextClass"),y(this,"maskTextSelector"),y(this,"inlineStylesheet"),y(this,"maskInputOptions"),y(this,"maskTextFn"),y(this,"maskInputFn"),y(this,"keepIframeSrcFn"),y(this,"recordCanvas"),y(this,"inlineImages"),y(this,"slimDOMOptions"),y(this,"dataURLOptions"),y(this,"doc"),y(this,"mirror"),y(this,"iframeManager"),y(this,"stylesheetManager"),y(this,"shadowDomManager"),y(this,"canvasManager"),y(this,"processedNodeManager"),y(this,"unattachedDoc"),y(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit();}),y(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],r=new Set;for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let f of this.movedSet){let h=C.parentNode(f);this.removesSubTreeCache.has(h)&&!this.movedSet.has(h)||this.addedSet.add(f);}let n=null,s=null,o=-1,a=null,c=false,i=new Set,p=this.addedSet.values(),u=p.next();for(;this.addedSet.size;){if(n!==null&&this.addedSet.has(C.previousSibling(n)))a=n,n=C.previousSibling(n);else {for(this.addedSet.has(u.value)||(u=p.next()),n=u.value;;){if(s=C.parentNode(n),this.addedSet.has(s)){n=s;continue}break}if(i.has(s))s=null;else if(s){if(ur(s)?(c=Wt(this.droppedSet,s)||this.removesSubTreeCache.has(s),c&&Wt(this.movedSet,n)&&(c=false)):c=true,this.addedSet.has(C.lastChild(s)))n=C.lastChild(s),a=null;else for(;;){if(a=C.nextSibling(n),this.addedSet.has(a)){n=a;continue}break}if(o=be(s)?this.mirror.getId(cr(n)):this.mirror.getId(s),o===-1&&s.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let l=C.host(s);o=this.mirror.getId(l);}}}if(this.addedSet.delete(n),!s||o===-1){i.add(n);continue}else if(c){this.droppedSet.add(n);continue}let f=false;if(n.nodeType===Node.TEXT_NODE){let l=s.tagName;if(l==="TEXTAREA")continue;l==="STYLE"&&r.has(o)&&(f=true);}let h=a?this.mirror.getId(a):null;for(;h===We;)a=a&&C.nextSibling(a),h=a&&this.mirror.getId(a);if(h===-1){console.warn("Couldn't record new node. Couldn't find mirror id for nextSibling:",a),n=null;continue}let m=fe(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:true,newlyAddedElement:true,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:l=>{ar(l,this.mirror)&&this.iframeManager.addIframe(l),lr(l,this.mirror)&&this.stylesheetManager.trackLinkElement(l),st(n)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(n),this.doc);},onIframeLoad:(l,b)=>{this.iframeManager.attachIframe(l,b),this.shadowDomManager.observeAttachShadow(l);},onStylesheetLoad:(l,b)=>{this.stylesheetManager.attachLinkElement(l,b);},cssCaptured:f});m&&(t.push({parentId:o,nextId:h,node:m}),r.add(m.id));}let d={texts:this.texts.map(f=>{let h=f.node,m=C.parentNode(h);return m&&m.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(m),{id:this.mirror.getId(h),value:f.value}}).filter(f=>!r.has(f.id)).filter(f=>this.mirror.has(f.id)),attributes:this.attributes.map(f=>{let{attributes:h}=f;if(typeof h.style=="string"){let m=JSON.stringify(f.styleDiff),l=JSON.stringify(f._unchangedStyles);m.length<h.style.length&&(m+l).split("var(").length===h.style.split("var(").length&&(h.style=f.styleDiff);}return {id:this.mirror.getId(f.node),attributes:h}}).filter(f=>!r.has(f.id)).filter(f=>this.mirror.has(f.id)),removes:this.removes,adds:t};!d.texts.length&&!d.attributes.length&&!d.removes.length&&!d.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(d));}),y(this,"genTextAreaValueMutation",t=>{let r=this.attributeMap.get(t);r||(r={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(t,r));let n=Array.from(C.childNodes(t),s=>C.textContent(s)||"").join("");r.attributes.value=Fe({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Pe(t),value:n,maskInputFn:this.maskInputFn});}),y(this,"processMutation",t=>{if(!Ze(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case "characterData":{let r=C.textContent(t.target);!V(t.target,this.blockClass,this.blockSelector,false)&&r!==t.oldValue&&this.texts.push({value:er(t.target,this.maskTextClass,this.maskTextSelector,true)&&r?this.maskTextFn?this.maskTextFn(r,or(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case "attributes":{let r=t.target,n=ne(r.tagName),s=t.attributeName,o=t.target.getAttribute(s);if(s==="value"){let c=Pe(r);o=Fe({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:c,value:o,maskInputFn:this.maskInputFn});}if(V(t.target,this.blockClass,this.blockSelector,false)||o===t.oldValue)return;let a=this.attributeMap.get(t.target);if(n==="iframe"&&s==="src"&&!this.keepIframeSrcFn(o))if(!r.contentDocument)s="rr_src";else return;if(a||(a={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(a),this.attributeMap.set(t.target,a)),s==="type"&&n==="input"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Zt(n,s))if(a.attributes[s]=Qt(this.doc,n,ne(s),o),s==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument();}catch(i){this.unattachedDoc=this.doc;}let c=this.unattachedDoc.createElement("span");t.oldValue&&c.setAttribute("style",t.oldValue);for(let i of Array.from(r.style)){let p=r.style.getPropertyValue(i),u=r.style.getPropertyPriority(i);p!==c.style.getPropertyValue(i)||u!==c.style.getPropertyPriority(i)?u===""?a.styleDiff[i]=p:a.styleDiff[i]=[p,u]:a._unchangedStyles[i]=[p,u];}for(let i of Array.from(c.style))r.style.getPropertyValue(i)===""&&(a.styleDiff[i]=false);}else s==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?a.attributes.rr_open_mode="modal":a.attributes.rr_open_mode="non-modal");break}case "childList":{if(V(t.target,this.blockClass,this.blockSelector,true))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{let n=this.mirror.getId(r),s=be(t.target)?this.mirror.getId(C.host(t.target)):this.mirror.getId(t.target);V(t.target,this.blockClass,this.blockSelector,false)||Ze(r,this.mirror,this.slimDOMOptions)||!kn(r,this.mirror)||(this.addedSet.has(r)?(at(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||ir(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Ut(n,s)]?at(this.movedSet,r):(this.removes.push({parentId:s,id:n,isShadow:be(t.target)&&Se(t.target)?true:void 0}),Ln(r,this.removesSubTreeCache))),this.mapRemoves.push(r));});break}}}),y(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Ze(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[Ut(this.mirror.getId(t),n)]=true);}else this.addedSet.add(t),this.droppedSet.delete(t);V(t,this.blockClass,this.blockSelector,false)||(C.childNodes(t).forEach(n=>this.genAdds(n)),st(t)&&C.childNodes(C.shadowRoot(t)).forEach(n=>{this.processedNodeManager.add(n,this),this.genAdds(n,t);}));}});}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(r=>{this[r]=t[r];});}freeze(){this.frozen=true,this.canvasManager.freeze();}unfreeze(){this.frozen=false,this.canvasManager.unfreeze(),this.emit();}isFrozen(){return this.frozen}lock(){this.locked=true,this.canvasManager.lock();}unlock(){this.locked=false,this.canvasManager.unlock(),this.emit();}reset(){this.shadowDomManager.reset(),this.canvasManager.reset();}};x=e=>we?(...r)=>{try{return e(...r)}catch(n){if(we&&we(n)===true)return;throw n}}:e,le=[];Un=["INPUT","TEXTAREA","SELECT"],Ht=new WeakMap;$e=class{constructor(t){y(this,"iframeIdToRemoteIdMap",new WeakMap),y(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t;}getId(t,r,n,s){let o=n||this.getIdToRemoteIdMap(t),a=s||this.getRemoteIdToIdMap(t),c=o.get(r);return c||(c=this.generateIdFn(),o.set(r,c),a.set(c,r)),c}getIds(t,r){let n=this.getIdToRemoteIdMap(t),s=this.getRemoteIdToIdMap(t);return r.map(o=>this.getId(t,o,n,s))}getRemoteId(t,r,n){let s=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;let o=s.get(r);return o||-1}getRemoteIds(t,r){let n=this.getRemoteIdToIdMap(t);return r.map(s=>this.getRemoteId(t,s,n))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t);}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}},lt=class{constructor(t){y(this,"iframes",new WeakMap),y(this,"crossOriginIframeMap",new WeakMap),y(this,"crossOriginIframeMirror",new $e(Jt)),y(this,"crossOriginIframeStyleMirror"),y(this,"crossOriginIframeRootIdMap",new WeakMap),y(this,"mirror"),y(this,"mutationCb"),y(this,"wrappedEmit"),y(this,"loadListener"),y(this,"stylesheetManager"),y(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new $e(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this));}addIframe(t){this.iframes.set(t,true),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t);}addLoadListener(t){this.loadListener=t;}attachIframe(t,r){var n,s;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:true}),this.recordCrossOriginIframes&&((n=t.contentWindow)==null||n.addEventListener("message",this.handleMessage.bind(this))),(s=this.loadListener)==null||s.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument));}handleMessage(t){let r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;let s=this.crossOriginIframeMap.get(t.source);if(!s)return;let o=this.transformCrossOriginEvent(s,r.data.event);o&&this.wrappedEmit(o,r.data.isCheckout);}transformCrossOriginEvent(t,r){var n;switch(r.type){case k.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);let s=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,s),this.patchRootIdOnNode(r.data.node,s),{timestamp:r.timestamp,type:k.IncrementalSnapshot,data:{source:E.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:true}}}case k.Meta:case k.Load:case k.DomContentLoaded:return false;case k.Plugin:return r;case k.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case k.IncrementalSnapshot:switch(r.data.source){case E.Mutation:return r.data.adds.forEach(s=>{this.replaceIds(s,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,t);let o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(s.node,o);}),r.data.removes.forEach(s=>{this.replaceIds(s,t,["parentId","id"]);}),r.data.attributes.forEach(s=>{this.replaceIds(s,t,["id"]);}),r.data.texts.forEach(s=>{this.replaceIds(s,t,["id"]);}),r;case E.Drag:case E.TouchMove:case E.MouseMove:return r.data.positions.forEach(s=>{this.replaceIds(s,t,["id"]);}),r;case E.ViewportResize:return false;case E.MediaInteraction:case E.MouseInteraction:case E.Scroll:case E.CanvasMutation:case E.Input:return this.replaceIds(r.data,t,["id"]),r;case E.StyleSheetRule:case E.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case E.Font:return r;case E.Selection:return r.data.ranges.forEach(s=>{this.replaceIds(s,t,["start","end"]);}),r;case E.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)==null||n.forEach(s=>{this.replaceStyleIds(s,t,["styleId"]);}),r}}return false}replace(t,r,n,s){for(let o of s)!Array.isArray(r[o])&&typeof r[o]!="number"||(Array.isArray(r[o])?r[o]=t.getIds(n,r[o]):r[o]=t.getId(n,r[o]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r);});}patchRootIdOnNode(t,r){t.type!==W.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r);});}},ct=class{constructor(t){y(this,"shadowDoms",new WeakSet),y(this,"mutationCb"),y(this,"scrollCb"),y(this,"bypassOptions"),y(this,"mirror"),y(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init();}init(){this.reset(),this.patchAttachShadow(Element,document);}addShadowRoot(t,r){if(!Se(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);let[n]=pr({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(hr({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(C.host(t))),this.restoreHandlers.push(fr({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t));},0);}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument);}patchAttachShadow(t,r){let n=this;this.restoreHandlers.push(ce(t.prototype,"attachShadow",function(s){return function(o){let a=s.call(this,o),c=C.shadowRoot(this);return c&&ur(this)&&n.addShadowRoot(c,r),a}}));}reset(){this.restoreHandlers.forEach(t=>{try{t();}catch(r){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet;}},me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Kn=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(ye=0;ye<me.length;ye++)Kn[me.charCodeAt(ye)]=ye;Xn=function(e){var t=new Uint8Array(e),r,n=t.length,s="";for(r=0;r<n;r+=3)s+=me[t[r]>>2],s+=me[(t[r]&3)<<4|t[r+1]>>4],s+=me[(t[r+1]&15)<<2|t[r+2]>>6],s+=me[t[r+2]&63];return n%3===2?s=s.substring(0,s.length-1)+"=":n%3===1&&(s=s.substring(0,s.length-2)+"=="),s},Bt=new Map;mr=(e,t,r)=>{if(!e||!(yr(e,t)||typeof e=="object"))return;let n=e.constructor.name,s=Yn(r,n),o=s.indexOf(e);return o===-1&&(o=s.length,s.push(e)),o};gr=(e,t,r)=>e.map(n=>_e(n,t,r)),yr=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(s=>typeof t[s]=="function").find(s=>e instanceof t[s]);br=`(function() {
4
4
  "use strict";
5
5
  var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
6
6
  var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
@@ -75,4 +75,4 @@ or you can use record.mirror to access the mirror instance during recording.`,Ft
75
75
  };
76
76
  })();
77
77
  //# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map
78
- `,zt=typeof self!="undefined"&&self.Blob&&new Blob([yr],{type:"text/javascript;charset=utf-8"});ut=class{constructor(t){y(this,"pendingCanvasMutations",new Map),y(this,"rafStamps",{latestId:0,invokeId:null}),y(this,"mirror"),y(this,"mutationCb"),y(this,"resetObservers"),y(this,"frozen",false),y(this,"locked",false),y(this,"processMutation",(i,p)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(i)||this.pendingCanvasMutations.set(i,[]),this.pendingCanvasMutations.get(i).push(p);});let{sampling:r="all",win:n,blockClass:s,blockSelector:o,recordCanvas:a,dataURLOptions:c}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&r==="all"&&this.initCanvasMutationObserver(n,s,o),a&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,s,o,{dataURLOptions:c});}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers();}freeze(){this.frozen=true;}unfreeze(){this.frozen=false;}lock(){this.locked=true;}unlock(){this.locked=false;}initCanvasFPSObserver(t,r,n,s,o){let a=Ht(r,n,s,true),c=new Map,i=new Qn;i.onmessage=m=>{let{id:l}=m.data;if(c.set(l,false),!("base64"in m.data))return;let{base64:b,type:v,width:w,height:g}=m.data;this.mutationCb({id:l,type:me["2D"],commands:[{property:"clearRect",args:[0,0,w,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:b}],type:v}]},0,0]}]});};let p=1e3/t,u=0,d,h=()=>{let m=[];return r.document.querySelectorAll("canvas").forEach(l=>{G(l,n,s,true)||m.push(l);}),m},f=m=>{if(u&&m-u<p){d=requestAnimationFrame(f);return}u=m,h().forEach(async l=>{var b;let v=this.mirror.getId(l);if(c.get(v)||l.width===0||l.height===0)return;if(c.set(v,true),["webgl","webgl2"].includes(l.__context)){let g=l.getContext(l.__context);((b=g==null?void 0:g.getContextAttributes())==null?void 0:b.preserveDrawingBuffer)===false&&g.clear(g.COLOR_BUFFER_BIT);}let w=await createImageBitmap(l);i.postMessage({id:v,bitmap:w,width:l.width,height:l.height,dataURLOptions:o.dataURLOptions},[w]);}),d=requestAnimationFrame(f);};d=requestAnimationFrame(f),this.resetObservers=()=>{a(),cancelAnimationFrame(d);};}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let s=Ht(t,r,n,false),o=Xn(this.processMutation.bind(this),t,r,n),a=Jn(this.processMutation.bind(this),t,r,n);this.resetObservers=()=>{s(),o(),a();};}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations());}startRAFTimestamping(){let t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t);};requestAnimationFrame(t);}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{let n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n);}),requestAnimationFrame(()=>this.flushPendingCanvasMutations());}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;let s=n.map(a=>{let{type:c,...i}=a;return i}),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:s}),this.pendingCanvasMutations.delete(t);}},dt=class{constructor(t){y(this,"trackedLinkElements",new WeakSet),y(this,"mutationCb"),y(this,"adoptedStyleSheetCb"),y(this,"styleMirror",new ot),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb;}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t);}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t));}adoptStyleSheets(t,r){if(t.length===0)return;let n={id:r,styleIds:[]},s=[];for(let o of t){let a;this.styleMirror.has(o)?a=this.styleMirror.getId(o):(a=this.styleMirror.add(o),s.push({styleId:a,rules:Array.from(o.rules||CSSRule,(c,i)=>({rule:Kt(c,o.href),index:i}))})),n.styleIds.push(a);}s.length>0&&(n.styles=s),this.adoptedStyleSheetCb(n);}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet;}trackStylesheetInLinkElement(t){}},pt=class{constructor(){y(this,"nodeMap",new WeakMap),y(this,"active",false);}inOtherBuffer(t,r){let n=this.nodeMap.get(t);return n&&Array.from(n).some(s=>s!==r)}add(t,r){this.active||(this.active=true,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=false;})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r));}destroy(){}},$e=false;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Tt=e.contentWindow)==null?void 0:Tt.Array.from)||Array.from,document.body.removeChild(e);}}catch(e){console.debug("Unable to override Array.from",e);}Z=en();Me.addCustomEvent=(e,t)=>{if(!$e)throw new Error("please add custom event after start recording");W({type:k.Custom,data:{tag:e,payload:t}});};Me.freezePage=()=>{ie.forEach(e=>e.freeze());};Me.takeFullSnapshot=e=>{if(!$e)throw new Error("please take full snapshot after start recording");De(e);};Me.mirror=Z;});var wt="[data-ck-mask]",Ct="[data-ck-block]";var vt=e=>{let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return (t>>>0)/4294967296};var Ke=1800*1e3,Xe=60*1e3,Mt=30*1e3,Rr=5*1e3,Ye=64*1024,Er=4*1024*1024,It=1024*1024,xr=[Ct,'input[type="password"]','input[type="hidden"]','[autocomplete^="cc-"]','input[name*="card" i]','input[name*="cvc" i]','input[name*="cvv" i]','iframe[src*="js.stripe.com"]','iframe[src*="paypal.com"]'].join(","),kr=wt,Rt=(e,t)=>vt(`replay:${e}`)<Math.min(1,Math.max(0,t)),Et=e=>{let t=e.toLowerCase().replace(/^\$/,"");return t.startsWith("purchase")?"purchase":t.startsWith("checkout")?"checkout":null},Or=e=>"*".repeat(Math.min(12,e.length)),xt=e=>({emit:e,maskAllInputs:true,maskInputOptions:{color:true,date:true,"datetime-local":true,email:true,month:true,number:true,range:true,search:true,tel:true,text:true,time:true,url:true,week:true,textarea:true,select:true,password:true},maskInputFn:Or,maskTextSelector:kr,blockSelector:xr,recordCanvas:false,recordCrossOriginIframes:false,collectFonts:false,inlineImages:false,slimDOMOptions:"all",sampling:{mousemove:50,scroll:150,media:800,input:"last"}}),xe=class{constructor(t=Xe,r=Er){Ee(this,"windowMs",t);Ee(this,"maxBytes",r);Ee(this,"segments",[]);}push(t,r){(t.type===4||!this.segments.length)&&this.segments.push({events:[],bytes:0});let n=this.segments[this.segments.length-1];n.events.push(t),n.bytes+=r;let s=t.timestamp-this.windowMs;for(;this.segments.length>1&&(this.segments[1].events[0].timestamp<=s||this.bytes>this.maxBytes);)this.segments.shift();}get bytes(){return this.segments.reduce((t,r)=>t+r.bytes,0)}get size(){return this.segments.reduce((t,r)=>t+r.events.length,0)}get first(){var t,r,n;return (n=(r=(t=this.segments[0])==null?void 0:t.events[0])==null?void 0:r.timestamp)!=null?n:null}drain(){let t=this.segments.flatMap(r=>r.events);return this.segments=[],t}clear(){this.segments=[];}},kt=(e,t)=>e>=Ye||e>0&&t>=Rr,Ot=e=>{let t="";for(let r=0;r<e.length;r+=32768)t+=String.fromCharCode(...e.subarray(r,r+32768));return btoa(t)};var mt=(e,t)=>String(e!=null?e:"").slice(0,t),je=()=>window.location.pathname.slice(0,300)||"/",Zn=async e=>{let t=new Blob([e]).stream().pipeThrough(new CompressionStream("gzip"));return new Uint8Array(await new Response(t).arrayBuffer())},wr=async e=>{if(typeof window=="undefined")return null;let{record:t}=await Promise.resolve().then(()=>(Sr(),br)),r=`${e.host}/api/sdk/replay`,n=Rt(e.sessionId,e.sampleRate)?"upload":"buffer",s=n==="upload"?"sample":null,o=e.distinctId,a=e.identified===true,c=null,i=0,p=false,u=Date.now(),d=new xe,h=[],f=0,m=Date.now(),l=[{t:Date.now(),kind:"pageview",path:je()}],b=Promise.resolve(),v=M=>{p||(!M&&n==="upload"&&g(false),p=true,j==null||j(),window.clearInterval(E),window.clearInterval(te),window.removeEventListener("error",X),window.removeEventListener("unhandledrejection",$),window.removeEventListener("pagehide",q),document.removeEventListener("visibilitychange",z),console.error===H&&(console.error=_),h=[],d.clear(),l=[]);},w=async(M,C,O)=>{let A;if(!O&&typeof CompressionStream!="undefined"?A=JSON.stringify({...M,enc:"gzip",data:Ot(await Zn(C))}):A=JSON.stringify({...M,enc:"json",data:C}),A.length>It){e.warn("A recording chunk was over 1 MB (a very large page). The recording stopped."),v(true);return}if(!(O&&"sendBeacon"in navigator&&navigator.sendBeacon(r,A)))try{let F=await fetch(r,{method:"POST",headers:{"content-type":"application/json"},body:A,keepalive:O||A.length<6e4});(F.status===403||F.status===409||F.status===413)&&v(!0);}catch(F){e.warn(`Could not reach ${e.host||"this origin"} to upload a recording.`);}};function g(M){if(!h.length)return;let C=h;h=[],f=0,m=Date.now(),c!=null||(c=C[0].timestamp);let O=l;l=[];let A={key:e.apiKey,sessionId:e.sessionId,distinctId:o,identified:a,start:c,seq:i++,consent:{replay:true},trigger:s,final:M,meta:{first:C[0].timestamp,last:C[C.length-1].timestamp,vw:window.innerWidth,vh:window.innerHeight,marks:O}},F=`[${C.map(le=>le.json).join(",")}]`;M?w(A,F,true):b=b.then(()=>w(A,F,false));}let I=M=>{p||n==="upload"||(n="upload",s=M,window.clearInterval(te),h=d.drain(),f=h.reduce((C,O)=>C+O.json.length,0),g(false));},L=M=>{var A;if(p)return;if(Date.now()-(c!=null?c:u)>Ke){v(false);return}let C=JSON.stringify(M),O={type:M.type,timestamp:M.timestamp,json:C};if(n==="buffer"){d.push(O,C.length);let F=(A=d.first)!=null?A:M.timestamp-Xe;l=l.filter(le=>le.t>=F);return}h.push(O),f+=C.length,f>=Ye&&g(false);},_=console.error,H=(...M)=>{try{t.addCustomEvent("$console",{level:"error",text:mt(M.map(C=>C instanceof Error?C.message:typeof C=="string"?C:"[object]").join(" "),300)});}catch(C){}_.apply(console,M);},X=M=>{let C=mt(M.message||"Script error",200);l.push({t:Date.now(),kind:"error",path:je(),label:C});try{t.addCustomEvent("$error",{message:C});}catch(O){}I("error");},$=M=>{let C=M.reason,O=mt(typeof(C==null?void 0:C.message)=="string"?C.message:"Unhandled promise rejection",200);l.push({t:Date.now(),kind:"error",path:je(),label:O});try{t.addCustomEvent("$error",{message:O});}catch(A){}I("error");},q=()=>n==="upload"&&g(true),z=()=>document.visibilityState==="hidden"&&n==="upload"&&g(false),j=t(xt(L));if(!j)return null;console.error=H,window.addEventListener("error",X),window.addEventListener("unhandledrejection",$),window.addEventListener("pagehide",q),document.addEventListener("visibilitychange",z);let E=window.setInterval(()=>{Date.now()-(c!=null?c:u)>Ke?v(false):n==="upload"&&kt(f,Date.now()-m)&&g(false);},1e3),te=n==="buffer"?window.setInterval(()=>t.takeFullSnapshot(true),Mt):0;return {event:M=>{let C=Et(M);C&&I(C);},click:(M,C)=>{if(p)return;let O=Date.now(),A=je(),F=M.label||M.selector.split(" > ").pop()||"";l.push({t:O,kind:"click",path:A,label:F,x:M.x,y:M.y,vw:M.vw,dead:!M.interactive}),C&&(l.push({t:O,kind:"rage",path:A,label:F,x:M.x,y:M.y,vw:M.vw}),I("rage"));},page:M=>!p&&l.push({t:Date.now(),kind:"pageview",path:M.slice(0,300)||"/"}),identify:M=>{o=M,a=true;},stop:(M=false)=>v(M)}};window.__mrrocketReplay={startReplay:wr};})();
78
+ `,jt=typeof self!="undefined"&&self.Blob&&new Blob([br],{type:"text/javascript;charset=utf-8"});ut=class{constructor(t){y(this,"pendingCanvasMutations",new Map),y(this,"rafStamps",{latestId:0,invokeId:null}),y(this,"mirror"),y(this,"mutationCb"),y(this,"resetObservers"),y(this,"frozen",false),y(this,"locked",false),y(this,"processMutation",(i,p)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(i)||this.pendingCanvasMutations.set(i,[]),this.pendingCanvasMutations.get(i).push(p);});let{sampling:r="all",win:n,blockClass:s,blockSelector:o,recordCanvas:a,dataURLOptions:c}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&r==="all"&&this.initCanvasMutationObserver(n,s,o),a&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,s,o,{dataURLOptions:c});}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers();}freeze(){this.frozen=true;}unfreeze(){this.frozen=false;}lock(){this.locked=true;}unlock(){this.locked=false;}initCanvasFPSObserver(t,r,n,s,o){let a=$t(r,n,s,true),c=new Map,i=new es;i.onmessage=m=>{let{id:l}=m.data;if(c.set(l,false),!("base64"in m.data))return;let{base64:b,type:I,width:w,height:g}=m.data;this.mutationCb({id:l,type:ge["2D"],commands:[{property:"clearRect",args:[0,0,w,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:b}],type:I}]},0,0]}]});};let p=1e3/t,u=0,d,f=()=>{let m=[];return r.document.querySelectorAll("canvas").forEach(l=>{V(l,n,s,true)||m.push(l);}),m},h=m=>{if(u&&m-u<p){d=requestAnimationFrame(h);return}u=m,f().forEach(async l=>{var b;let I=this.mirror.getId(l);if(c.get(I)||l.width===0||l.height===0)return;if(c.set(I,true),["webgl","webgl2"].includes(l.__context)){let g=l.getContext(l.__context);((b=g==null?void 0:g.getContextAttributes())==null?void 0:b.preserveDrawingBuffer)===false&&g.clear(g.COLOR_BUFFER_BIT);}let w=await createImageBitmap(l);i.postMessage({id:I,bitmap:w,width:l.width,height:l.height,dataURLOptions:o.dataURLOptions},[w]);}),d=requestAnimationFrame(h);};d=requestAnimationFrame(h),this.resetObservers=()=>{a(),cancelAnimationFrame(d);};}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let s=$t(t,r,n,false),o=Jn(this.processMutation.bind(this),t,r,n),a=Zn(this.processMutation.bind(this),t,r,n);this.resetObservers=()=>{s(),o(),a();};}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations());}startRAFTimestamping(){let t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t);};requestAnimationFrame(t);}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{let n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n);}),requestAnimationFrame(()=>this.flushPendingCanvasMutations());}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;let s=n.map(a=>{let{type:c,...i}=a;return i}),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:s}),this.pendingCanvasMutations.delete(t);}},dt=class{constructor(t){y(this,"trackedLinkElements",new WeakSet),y(this,"mutationCb"),y(this,"adoptedStyleSheetCb"),y(this,"styleMirror",new ot),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb;}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t);}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t));}adoptStyleSheets(t,r){if(t.length===0)return;let n={id:r,styleIds:[]},s=[];for(let o of t){let a;this.styleMirror.has(o)?a=this.styleMirror.getId(o):(a=this.styleMirror.add(o),s.push({styleId:a,rules:Array.from(o.rules||CSSRule,(c,i)=>({rule:Xt(c,o.href),index:i}))})),n.styleIds.push(a);}s.length>0&&(n.styles=s),this.adoptedStyleSheetCb(n);}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet;}trackStylesheetInLinkElement(t){}},pt=class{constructor(){y(this,"nodeMap",new WeakMap),y(this,"active",false);}inOtherBuffer(t,r){let n=this.nodeMap.get(t);return n&&Array.from(n).some(s=>s!==r)}add(t,r){this.active||(this.active=true,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=false;})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r));}destroy(){}},ze=false;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Nt=e.contentWindow)==null?void 0:Nt.Array.from)||Array.from,document.body.removeChild(e);}}catch(e){console.debug("Unable to override Array.from",e);}Z=rn();Ie.addCustomEvent=(e,t)=>{if(!ze)throw new Error("please add custom event after start recording");U({type:k.Custom,data:{tag:e,payload:t}});};Ie.freezePage=()=>{le.forEach(e=>e.freeze());};Ie.takeFullSnapshot=e=>{if(!ze)throw new Error("please take full snapshot after start recording");De(e);};Ie.mirror=Z;});var Er="401: sign the user id on your server with userHash(id) from @mrrocket/sdk/next/server and pass identify(id, props, { hash }).",wt=(e,t=r=>console.warn(r))=>{let r=globalThis;e!==401||r.__mrrocketUnsigned||(r.__mrrocketUnsigned=true,t(`[MRRocket] ${Er}`));};var Ct="[data-ck-mask]",vt="[data-ck-block]";var Mt=e=>{let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return (t>>>0)/4294967296};var Ke=1800*1e3,Xe=60*1e3,It=30*1e3,xr=5*1e3,Ye=64*1024,kr=4*1024*1024,Rt=1024*1024,Or=[vt,'input[type="password"]','input[type="hidden"]','[autocomplete^="cc-"]','input[name*="card" i]','input[name*="cvc" i]','input[name*="cvv" i]','iframe[src*="js.stripe.com"]','iframe[src*="paypal.com"]'].join(","),Tr=Ct,Et=(e,t)=>Mt(`replay:${e}`)<Math.min(1,Math.max(0,t)),xt=e=>{let t=e.toLowerCase().replace(/^\$/,"");return t.startsWith("purchase")?"purchase":t.startsWith("checkout")?"checkout":null},Nr=e=>"*".repeat(Math.min(12,e.length)),kt=e=>({emit:e,maskAllInputs:true,maskInputOptions:{color:true,date:true,"datetime-local":true,email:true,month:true,number:true,range:true,search:true,tel:true,text:true,time:true,url:true,week:true,textarea:true,select:true,password:true},maskInputFn:Nr,maskTextSelector:Tr,blockSelector:Or,recordCanvas:false,recordCrossOriginIframes:false,collectFonts:false,inlineImages:false,slimDOMOptions:"all",sampling:{mousemove:50,scroll:150,media:800,input:"last"}}),ke=class{constructor(t=Xe,r=kr){xe(this,"windowMs",t);xe(this,"maxBytes",r);xe(this,"segments",[]);}push(t,r){(t.type===4||!this.segments.length)&&this.segments.push({events:[],bytes:0});let n=this.segments[this.segments.length-1];n.events.push(t),n.bytes+=r;let s=t.timestamp-this.windowMs;for(;this.segments.length>1&&(this.segments[1].events[0].timestamp<=s||this.bytes>this.maxBytes);)this.segments.shift();}get bytes(){return this.segments.reduce((t,r)=>t+r.bytes,0)}get size(){return this.segments.reduce((t,r)=>t+r.events.length,0)}get first(){var t,r,n;return (n=(r=(t=this.segments[0])==null?void 0:t.events[0])==null?void 0:r.timestamp)!=null?n:null}drain(){let t=this.segments.flatMap(r=>r.events);return this.segments=[],t}clear(){this.segments=[];}},Ot=(e,t)=>e>=Ye||e>0&&t>=xr,Tt=e=>{let t="";for(let r=0;r<e.length;r+=32768)t+=String.fromCharCode(...e.subarray(r,r+32768));return btoa(t)};var mt=(e,t)=>String(e!=null?e:"").slice(0,t),Ve=()=>window.location.pathname.slice(0,300)||"/",ts=async e=>{let t=new Blob([e]).stream().pipeThrough(new CompressionStream("gzip"));return new Uint8Array(await new Response(t).arrayBuffer())},Cr=async e=>{if(typeof window=="undefined")return null;let{record:t}=await Promise.resolve().then(()=>(wr(),Sr)),r=`${e.host}/api/sdk/replay`,n=Et(e.sessionId,e.sampleRate)?"upload":"buffer",s=n==="upload"?"sample":null,o=e.distinctId,a=e.identified===true,c=e.userHash,i=null,p=0,u=false,d=Date.now(),f=new ke,h=[],m=0,l=Date.now(),b=[{t:Date.now(),kind:"pageview",path:Ve()}],I=Promise.resolve(),w=S=>{u||(!S&&n==="upload"&&M(false),u=true,R==null||R(),window.clearInterval(se),window.clearInterval(te),window.removeEventListener("error",$),window.removeEventListener("unhandledrejection",G),window.removeEventListener("pagehide",z),document.removeEventListener("visibilitychange",X),console.error===K&&(console.error=H),h=[],f.clear(),b=[]);},g=async(S,v,D)=>{let L;if(!D&&typeof CompressionStream!="undefined"?L=JSON.stringify({...S,enc:"gzip",data:Tt(await ts(v))}):L=JSON.stringify({...S,enc:"json",data:v}),L.length>Rt){e.warn("A recording chunk was over 1 MB (a very large page). The recording stopped."),w(true);return}if(!(D&&"sendBeacon"in navigator&&navigator.sendBeacon(r,L)))try{let B=await fetch(r,{method:"POST",headers:{"content-type":"application/json"},body:L,keepalive:D||L.length<6e4});wt(B.status),(B.status===401||B.status===403||B.status===409||B.status===413)&&w(!0);}catch(B){e.warn(`Could not reach ${e.host||"this origin"} to upload a recording.`);}};function M(S){if(!h.length)return;let v=h;h=[],m=0,l=Date.now(),i!=null||(i=v[0].timestamp);let D=b;b=[];let L={key:e.apiKey,sessionId:e.sessionId,distinctId:o,identified:a,...c?{userHash:c}:{},start:i,seq:p++,consent:{replay:true},trigger:s,final:S,meta:{first:v[0].timestamp,last:v[v.length-1].timestamp,vw:window.innerWidth,vh:window.innerHeight,marks:D}},B=`[${v.map(oe=>oe.json).join(",")}]`;S?g(L,B,true):I=I.then(()=>g(L,B,false));}let T=S=>{u||n==="upload"||(n="upload",s=S,window.clearInterval(te),h=f.drain(),m=h.reduce((v,D)=>v+D.json.length,0),M(false));},A=S=>{var L;if(u)return;if(Date.now()-(i!=null?i:d)>Ke){w(false);return}let v=JSON.stringify(S),D={type:S.type,timestamp:S.timestamp,json:v};if(n==="buffer"){f.push(D,v.length);let B=(L=f.first)!=null?L:S.timestamp-Xe;b=b.filter(oe=>oe.t>=B);return}h.push(D),m+=v.length,m>=Ye&&M(false);},H=console.error,K=(...S)=>{try{t.addCustomEvent("$console",{level:"error",text:mt(S.map(v=>v instanceof Error?v.message:typeof v=="string"?v:"[object]").join(" "),300)});}catch(v){}H.apply(console,S);},$=S=>{let v=mt(S.message||"Script error",200);b.push({t:Date.now(),kind:"error",path:Ve(),label:v});try{t.addCustomEvent("$error",{message:v});}catch(D){}T("error");},G=S=>{let v=S.reason,D=mt(typeof(v==null?void 0:v.message)=="string"?v.message:"Unhandled promise rejection",200);b.push({t:Date.now(),kind:"error",path:Ve(),label:D});try{t.addCustomEvent("$error",{message:D});}catch(L){}T("error");},z=()=>n==="upload"&&M(true),X=()=>document.visibilityState==="hidden"&&n==="upload"&&M(false),R=t(kt(A));if(!R)return null;console.error=K,window.addEventListener("error",$),window.addEventListener("unhandledrejection",G),window.addEventListener("pagehide",z),document.addEventListener("visibilitychange",X);let se=window.setInterval(()=>{Date.now()-(i!=null?i:d)>Ke?w(false):n==="upload"&&Ot(m,Date.now()-l)&&M(false);},1e3),te=n==="buffer"?window.setInterval(()=>t.takeFullSnapshot(true),It):0;return {event:S=>{let v=xt(S);v&&T(v);},click:(S,v)=>{if(u)return;let D=Date.now(),L=Ve(),B=S.label||S.selector.split(" > ").pop()||"";b.push({t:D,kind:"click",path:L,label:B,x:S.x,y:S.y,vw:S.vw,dead:!S.interactive}),v&&(b.push({t:D,kind:"rage",path:L,label:B,x:S.x,y:S.y,vw:S.vw}),T("rage"));},page:S=>!u&&b.push({t:Date.now(),kind:"pageview",path:S.slice(0,300)||"/"}),identify:(S,v)=>{v?c=v:S!==o&&(c=void 0),o=S,a=true;},stop:(S=false)=>w(S)}};window.__mrrocketReplay={startReplay:Cr};})();