@screeb/rrweb 1.0.3 → 1.0.4

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.
@@ -64,7 +64,7 @@ https://www.w3ctech.com/topic/2226`));let a=t(...n);return a.postcssPlugin=e,a.p
64
64
  https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
65
65
  https://www.w3ctech.com/topic/2226`));let a=t(...n);return a.postcssPlugin=e,a.postcssVersion=new ci().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(n,a,l){return F([i(l)]).process(n,a)},i};F.stringify=Df;F.parse=Pf;F.fromJSON=Tf;F.list=Lf;F.comment=s=>new ma(s);F.atRule=s=>new ga(s);F.decl=s=>new da(s);F.rule=s=>new ya(s);F.root=s=>new wa(s);F.document=s=>new pa(s);F.CssSyntaxError=Rf;F.Declaration=da;F.Container=Of;F.Processor=ci;F.Document=pa;F.Comment=ma;F.Warning=_f;F.AtRule=ga;F.Result=kf;F.Input=$f;F.Rule=ya;F.Root=wa;F.Node=Ff;Af.registerPostcss(F);var Bf=F;F.default=F;const Y=Jc(Bf);Y.stringify;Y.fromJSON;Y.plugin;Y.parse;Y.list;Y.document;Y.comment;Y.atRule;Y.rule;Y.decl;Y.root;Y.CssSyntaxError;Y.Declaration;Y.Container;Y.Processor;Y.Document;Y.Comment;Y.Warning;Y.AtRule;Y.Result;Y.Input;Y.Rule;Y.Root;Y.Node;function Uf(s){const e={},t=/;(?![^(]*\))/g,r=/:(.+)/,i=/\/\*.*?\*\//g;return s.replace(i,"").split(t).forEach(function(o){if(o){const n=o.split(r);n.length>1&&(e[ks(n[0].trim())]=n[1].trim())}}),e}function In(s){const e=[];for(const t in s){const r=s[t];if(typeof r!="string")continue;const i=Gf(t);e.push(`${i}: ${r};`)}return e.join(" ")}const Wf=/-([a-z])/g,zf=/^--[a-zA-Z0-9-]+$/,ks=s=>zf.test(s)?s:s.replace(Wf,(e,t)=>t?t.toUpperCase():""),Vf=/\B([A-Z])/g,Gf=s=>s.replace(Vf,"-$1").toLowerCase();class fe{constructor(...e){C(this,"parentElement",null),C(this,"parentNode",null),C(this,"ownerDocument"),C(this,"firstChild",null),C(this,"lastChild",null),C(this,"previousSibling",null),C(this,"nextSibling",null),C(this,"ELEMENT_NODE",1),C(this,"TEXT_NODE",3),C(this,"nodeType"),C(this,"nodeName"),C(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(e instanceof fe){if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0}else return!1;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}class hi extends fe{constructor(...e){super(e),C(this,"nodeType",9),C(this,"nodeName","#document"),C(this,"compatMode","CSS1Compat"),C(this,"RRNodeType",T.Document),C(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(e=>e.RRNodeType===T.Element&&e.tagName==="HTML")||null}get body(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(t=>t.RRNodeType===T.Element&&t.tagName==="BODY"))||null}get head(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(t=>t.RRNodeType===T.Element&&t.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(e){const t=e.RRNodeType;if((t===T.Element||t===T.DocumentType)&&this.childNodes.some(i=>i.RRNodeType===t))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${t===T.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const r=fi(this,e);return r.parentElement=null,r}insertBefore(e,t){const r=e.RRNodeType;if((r===T.Element||r===T.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${r===T.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const i=Ea(this,e,t);return i.parentElement=null,i}removeChild(e){return Ia(this,e)}open(){this.firstChild=null,this.lastChild=null}close(){}write(e){let t;if(e==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?t="-//W3C//DTD XHTML 1.0 Transitional//EN":e==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(t="-//W3C//DTD HTML 4.0 Transitional//EN"),t){const r=this.createDocumentType("html",t,"");this.open(),this.appendChild(r)}}createDocument(e,t,r){return new hi}createDocumentType(e,t,r){const i=new ba(e,t,r);return i.ownerDocument=this,i}createElement(e){const t=new $r(e);return t.ownerDocument=this,t}createElementNS(e,t){return this.createElement(t)}createTextNode(e){const t=new Sa(e);return t.ownerDocument=this,t}createComment(e){const t=new va(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new Ca(e);return t.ownerDocument=this,t}toString(){return"RRDocument"}}class ba extends fe{constructor(e,t,r){super(),C(this,"nodeType",10),C(this,"RRNodeType",T.DocumentType),C(this,"name"),C(this,"publicId"),C(this,"systemId"),C(this,"textContent",null),this.name=e,this.publicId=t,this.systemId=r,this.nodeName=e}toString(){return"RRDocumentType"}}class $r extends fe{constructor(e){super(),C(this,"nodeType",1),C(this,"RRNodeType",T.Element),C(this,"tagName"),C(this,"attributes",{}),C(this,"shadowRoot",null),C(this,"scrollLeft"),C(this,"scrollTop"),this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e="";return this.childNodes.forEach(t=>e+=t.textContent),e}set textContent(e){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(e))}get classList(){return new Hf(this.attributes.class,e=>{this.attributes.class=e})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const e=this.attributes.style?Uf(this.attributes.style):{},t=/\B([A-Z])/g;return e.setProperty=(r,i,o)=>{if(t.test(r))return;const n=ks(r);i?e[n]=i:delete e[n],o==="important"&&(e[n]+=" !important"),this.attributes.style=In(e)},e.removeProperty=r=>{if(t.test(r))return"";const i=ks(r),o=e[i]||"";return delete e[i],this.attributes.style=In(e),o},e}getAttribute(e){return this.attributes[e]===void 0?null:this.attributes[e]}setAttribute(e,t){this.attributes[e]=t}setAttributeNS(e,t,r){this.setAttribute(t,r)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return fi(this,e)}insertBefore(e,t){return Ea(this,e,t)}removeChild(e){return Ia(this,e)}attachShadow(e){const t=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=t,t}dispatchEvent(e){return!0}toString(){let e="";for(const t in this.attributes)e+=`${t}="${this.attributes[t]}" `;return`${this.tagName} ${e}`}}class jf extends $r{constructor(){super(...arguments),C(this,"currentTime"),C(this,"volume"),C(this,"paused"),C(this,"muted"),C(this,"playbackRate"),C(this,"loop")}attachShadow(e){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}class Yf extends $r{constructor(){super(...arguments),C(this,"tagName","DIALOG"),C(this,"nodeName","DIALOG")}get isModal(){return this.getAttribute("rr_open_mode")==="modal"}get open(){return this.getAttribute("open")!==null}close(){this.removeAttribute("open"),this.removeAttribute("rr_open_mode")}show(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","non-modal")}showModal(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","modal")}}class Sa extends fe{constructor(e){super(),C(this,"nodeType",3),C(this,"nodeName","#text"),C(this,"RRNodeType",T.Text),C(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRText text=${JSON.stringify(this.data)}`}}class va extends fe{constructor(e){super(),C(this,"nodeType",8),C(this,"nodeName","#comment"),C(this,"RRNodeType",T.Comment),C(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}class Ca extends fe{constructor(e){super(),C(this,"nodeName","#cdata-section"),C(this,"nodeType",4),C(this,"RRNodeType",T.CDATA),C(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}class Hf{constructor(e,t){if(C(this,"onChange"),C(this,"classes",[]),C(this,"add",(...r)=>{for(const i of r){const o=String(i);this.classes.indexOf(o)>=0||this.classes.push(o)}this.onChange&&this.onChange(this.classes.join(" "))}),C(this,"remove",(...r)=>{this.classes=this.classes.filter(i=>r.indexOf(i)===-1),this.onChange&&this.onChange(this.classes.join(" "))}),e){const r=e.trim().split(/\s+/);this.classes.push(...r)}this.onChange=t}}function fi(s,e){return e.parentNode&&e.parentNode.removeChild(e),s.lastChild?(s.lastChild.nextSibling=e,e.previousSibling=s.lastChild):(s.firstChild=e,e.previousSibling=null),s.lastChild=e,e.nextSibling=null,e.parentNode=s,e.parentElement=s,e.ownerDocument=s.ownerDocument,e}function Ea(s,e,t){if(!t)return fi(s,e);if(t.parentNode!==s)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return e===t||(e.parentNode&&e.parentNode.removeChild(e),e.previousSibling=t.previousSibling,t.previousSibling=e,e.nextSibling=t,e.previousSibling?e.previousSibling.nextSibling=e:s.firstChild=e,e.parentElement=s,e.parentNode=s,e.ownerDocument=s.ownerDocument),e}function Ia(s,e){if(e.parentNode!==s)throw new Error("Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.");return e.previousSibling?e.previousSibling.nextSibling=e.nextSibling:s.firstChild=e.nextSibling,e.nextSibling?e.nextSibling.previousSibling=e.previousSibling:s.lastChild=e.previousSibling,e.previousSibling=null,e.nextSibling=null,e.parentElement=null,e.parentNode=null,e}var ne=(s=>(s[s.PLACEHOLDER=0]="PLACEHOLDER",s[s.ELEMENT_NODE=1]="ELEMENT_NODE",s[s.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",s[s.TEXT_NODE=3]="TEXT_NODE",s[s.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",s[s.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",s[s.ENTITY_NODE=6]="ENTITY_NODE",s[s.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",s[s.COMMENT_NODE=8]="COMMENT_NODE",s[s.DOCUMENT_NODE=9]="DOCUMENT_NODE",s[s.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",s[s.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",s))(ne||{});const $s={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},Zf={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};let ge=null;function wr(s,e,t,r=e.mirror||e.ownerDocument.mirror){s=Xf(s,e,t,r),xa(s,e,t,r),Jf(s,e,t)}function Xf(s,e,t,r){var i;if(t.afterAppend&&!ge&&(ge=new WeakSet,setTimeout(()=>{ge=null},0)),!di(s,e)){const o=br(e,t.mirror,r);(i=s.parentNode)==null||i.replaceChild(o,s),s=o}switch(e.RRNodeType){case T.Document:{if(!Ue(s,e,t.mirror,r)){const o=r.getMeta(e);o&&(t.mirror.removeNodeFromMap(s),s.close(),s.open(),t.mirror.add(s,o),ge==null||ge.add(s))}break}case T.Element:{const o=s,n=e;switch(n.tagName){case"IFRAME":{const a=s.contentDocument;if(!a)break;wr(a,e.contentDocument,t,r);break}}n.shadowRoot&&(o.shadowRoot||o.attachShadow({mode:"open"}),xa(o.shadowRoot,n.shadowRoot,t,r)),Kf(o,n,r);break}}return s}function Jf(s,e,t){var r;switch(e.RRNodeType){case T.Document:{const i=e.scrollData;i&&t.applyScroll(i,!0);break}case T.Element:{const i=s,o=e;switch(o.scrollData&&t.applyScroll(o.scrollData,!0),o.inputData&&t.applyInput(o.inputData),o.tagName){case"AUDIO":case"VIDEO":{const n=s,a=o;a.paused!==void 0&&(a.paused?n.pause():n.play()),a.muted!==void 0&&(n.muted=a.muted),a.volume!==void 0&&(n.volume=a.volume),a.currentTime!==void 0&&(n.currentTime=a.currentTime),a.playbackRate!==void 0&&(n.playbackRate=a.playbackRate),a.loop!==void 0&&(n.loop=a.loop);break}case"CANVAS":{const n=e;if(n.rr_dataURL!==null){const a=document.createElement("img");a.onload=()=>{const l=i.getContext("2d");l&&l.drawImage(a,0,0,a.width,a.height)},a.src=n.rr_dataURL}n.canvasMutations.forEach(a=>t.applyCanvas(a.event,a.mutation,s));break}case"STYLE":{const n=i.sheet;n&&e.rules.forEach(a=>t.applyStyleSheetMutation(a,n));break}case"DIALOG":{const n=i,a=o,l=n.open,u=n.matches("dialog:modal"),c=a.open,h=a.isModal,f=u!==h,g=l!==c;if((f||l&&g)&&n.close(),c&&(g||f))try{h?n.showModal():n.show()}catch(p){console.warn(p)}break}}break}case T.Text:case T.Comment:case T.CDATA:{s.textContent!==e.data&&(s.textContent=e.data);break}}ge!=null&&ge.has(s)&&(ge.delete(s),(r=t.afterAppend)==null||r.call(t,s,t.mirror.getId(s)))}function Kf(s,e,t){const r=s.attributes,i=e.attributes;for(const o in i){const n=i[o],a=t.getMeta(e);if(a!=null&&a.isSVG&&$s[o])s.setAttributeNS($s[o],o,n);else if(e.tagName==="CANVAS"&&o==="rr_dataURL"){const l=document.createElement("img");l.src=n,l.onload=()=>{const u=s.getContext("2d");u&&u.drawImage(l,0,0,l.width,l.height)}}else{if(e.tagName==="IFRAME"&&o==="srcdoc")continue;s.setAttribute(o,n)}}for(const{name:o}of Array.from(r))o in i||s.removeAttribute(o);e.scrollLeft&&(s.scrollLeft=e.scrollLeft),e.scrollTop&&(s.scrollTop=e.scrollTop)}function xa(s,e,t,r){const i=Array.from(s.childNodes),o=e.childNodes;if(i.length===0&&o.length===0)return;let n=0,a=i.length-1,l=0,u=o.length-1,c=i[n],h=i[a],f=o[l],g=o[u],p,m;for(;n<=a&&l<=u;)if(c===void 0)c=i[++n];else if(h===void 0)h=i[--a];else if(Ue(c,f,t.mirror,r))c=i[++n],f=o[++l];else if(Ue(h,g,t.mirror,r))h=i[--a],g=o[--u];else if(Ue(c,g,t.mirror,r)){try{s.insertBefore(c,h.nextSibling)}catch(S){console.warn(S)}c=i[++n],g=o[--u]}else if(Ue(h,f,t.mirror,r)){try{s.insertBefore(h,c)}catch(S){console.warn(S)}h=i[--a],f=o[++l]}else{if(!p){p={};for(let w=n;w<=a;w++){const v=i[w];v&&t.mirror.hasNode(v)&&(p[t.mirror.getId(v)]=w)}}m=p[r.getId(f)];const S=i[m];if(m!==void 0&&S&&Ue(S,f,t.mirror,r)){try{s.insertBefore(S,c)}catch(w){console.warn(w)}i[m]=void 0}else{const w=br(f,t.mirror,r);s.nodeName==="#document"&&c&&(w.nodeType===w.DOCUMENT_TYPE_NODE&&c.nodeType===c.DOCUMENT_TYPE_NODE||w.nodeType===w.ELEMENT_NODE&&c.nodeType===c.ELEMENT_NODE)&&(s.removeChild(c),t.mirror.removeNodeFromMap(c),c=i[++n]);try{s.insertBefore(w,c||null)}catch(v){console.warn(v)}}f=o[++l]}if(n>a){const S=o[u+1];let w=null;for(S&&(w=t.mirror.getNode(r.getId(S)));l<=u;++l){const v=br(o[l],t.mirror,r);try{s.insertBefore(v,w)}catch(x){console.warn(x)}}}else if(l>u)for(;n<=a;n++){const S=i[n];if(!(!S||S.parentNode!==s))try{s.removeChild(S),t.mirror.removeNodeFromMap(S)}catch(w){console.warn(w)}}let d=s.firstChild,y=e.firstChild;for(;d!==null&&y!==null;)wr(d,y,t,r),d=d.nextSibling,y=y.nextSibling}function br(s,e,t){const r=t.getId(s),i=t.getMeta(s);let o=null;if(r>-1&&(o=e.getNode(r)),o!==null&&di(o,s))return o;switch(s.RRNodeType){case T.Document:o=new Document;break;case T.DocumentType:o=document.implementation.createDocumentType(s.name,s.publicId,s.systemId);break;case T.Element:{let n=s.tagName.toLowerCase();n=Zf[n]||n,i&&"isSVG"in i&&(i!=null&&i.isSVG)?o=document.createElementNS($s.svg,n):o=document.createElement(s.tagName);break}case T.Text:o=document.createTextNode(s.data);break;case T.Comment:o=document.createComment(s.data);break;case T.CDATA:o=document.createCDATASection(s.data);break}i&&e.add(o,R({},i));try{ge==null||ge.add(o)}catch(n){}return o}function di(s,e){return s.nodeType!==e.nodeType?!1:s.nodeType!==s.ELEMENT_NODE||s.tagName.toUpperCase()===e.tagName}function Ue(s,e,t,r){const i=t.getId(s),o=r.getId(e);return i===-1||i!==o?!1:di(s,e)}class rt extends hi{constructor(e){super(),C(this,"UNSERIALIZED_STARTING_ID",-2),C(this,"_unserializedId",this.UNSERIALIZED_STARTING_ID),C(this,"mirror",ud()),C(this,"scrollData",null),e&&(this.mirror=e)}get unserializedId(){return this._unserializedId--}createDocument(e,t,r){return new rt}createDocumentType(e,t,r){const i=new Qf(e,t,r);return i.ownerDocument=this,i}createElement(e){const t=e.toUpperCase();let r;switch(t){case"AUDIO":case"VIDEO":r=new qf(t);break;case"IFRAME":r=new sd(t,this.mirror);break;case"CANVAS":r=new td(t);break;case"STYLE":r=new rd(t);break;case"DIALOG":r=new ed(t);break;default:r=new Pr(t);break}return r.ownerDocument=this,r}createComment(e){const t=new nd(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new od(e);return t.ownerDocument=this,t}createTextNode(e){const t=new id(e);return t.ownerDocument=this,t}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}}const Qf=ba;class Pr extends $r{constructor(){super(...arguments),C(this,"inputData",null),C(this,"scrollData",null)}}class qf extends jf{}class ed extends Yf{}class td extends Pr{constructor(){super(...arguments),C(this,"rr_dataURL",null),C(this,"canvasMutations",[])}getContext(){return null}}class rd extends Pr{constructor(){super(...arguments),C(this,"rules",[])}}class sd extends Pr{constructor(e,t){super(e),C(this,"contentDocument",new rt),this.contentDocument.mirror=t}}const id=Sa,nd=va,od=Ca;function ad(s){return s instanceof HTMLFormElement?"FORM":s.tagName.toUpperCase()}function Ma(s,e,t,r){let i;switch(s.nodeType){case ne.DOCUMENT_NODE:r&&r.nodeName==="IFRAME"?i=r.contentDocument:(i=e,i.compatMode=s.compatMode);break;case ne.DOCUMENT_TYPE_NODE:{const n=s;i=e.createDocumentType(n.name,n.publicId,n.systemId);break}case ne.ELEMENT_NODE:{const n=s,a=ad(n);i=e.createElement(a);const l=i;for(const{name:u,value:c}of Array.from(n.attributes))l.attributes[u]=c;n.scrollLeft&&(l.scrollLeft=n.scrollLeft),n.scrollTop&&(l.scrollTop=n.scrollTop);break}case ne.TEXT_NODE:i=e.createTextNode(s.textContent||"");break;case ne.CDATA_SECTION_NODE:i=e.createCDATASection(s.data);break;case ne.COMMENT_NODE:i=e.createComment(s.textContent||"");break;case ne.DOCUMENT_FRAGMENT_NODE:i=r.attachShadow({mode:"open"});break;default:return null}let o=t.getMeta(s);return e instanceof rt&&(o||(o=Na(i,e.unserializedId),t.add(s,o)),e.mirror.add(i,R({},o))),i}function ld(s,e=Xc(),t=new rt){function r(i,o){const n=Ma(i,t,e,o);if(n!==null)if((o==null?void 0:o.nodeName)!=="IFRAME"&&i.nodeType!==ne.DOCUMENT_FRAGMENT_NODE&&(o==null||o.appendChild(n),n.parentNode=o,n.parentElement=o),i.nodeName==="IFRAME"){const a=i.contentDocument;a&&r(a,n)}else(i.nodeType===ne.DOCUMENT_NODE||i.nodeType===ne.ELEMENT_NODE||i.nodeType===ne.DOCUMENT_FRAGMENT_NODE)&&(i.nodeType===ne.ELEMENT_NODE&&i.shadowRoot&&r(i.shadowRoot,n),i.childNodes.forEach(a=>r(a,n)))}return r(s,null),t}function ud(){return new cd}class cd{constructor(){C(this,"idNodeMap",new Map),C(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const r=(t=this.getMeta(e))==null?void 0:t.id;return r!=null?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Na(s,e){switch(s.RRNodeType){case T.Document:return{id:e,type:s.RRNodeType,childNodes:[]};case T.DocumentType:{const t=s;return{id:e,type:s.RRNodeType,name:t.name,publicId:t.publicId,systemId:t.systemId}}case T.Element:return{id:e,type:s.RRNodeType,tagName:s.tagName.toLowerCase(),attributes:{},childNodes:[]};case T.Text:return{id:e,type:s.RRNodeType,textContent:s.textContent||""};case T.Comment:return{id:e,type:s.RRNodeType,textContent:s.textContent||""};case T.CDATA:return{id:e,type:s.RRNodeType,textContent:""}}}const xn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Mn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Jt={};function pi(s){if(Jt[s])return Jt[s];const e=globalThis[s],t=e.prototype,r=s in xn?xn[s]:void 0,i=!!(r&&r.every(a=>{var l,u;return!!((u=(l=Object.getOwnPropertyDescriptor(t,a))==null?void 0:l.get)!=null&&u.toString().includes("[native code]"))})),o=s in Mn?Mn[s]:void 0,n=!!(o&&o.every(a=>{var l;return typeof t[a]=="function"&&((l=t[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&n)return Jt[s]=e.prototype,e.prototype;try{const a=document.createElement("iframe");document.body.appendChild(a);const l=a.contentWindow;if(!l)return e.prototype;const u=l[s].prototype;return document.body.removeChild(a),u?Jt[s]=u:t}catch(a){return t}}const Qr={};function Re(s,e,t){var r;const i=`${s}.${String(t)}`;if(Qr[i])return Qr[i].call(e);const o=pi(s),n=(r=Object.getOwnPropertyDescriptor(o,t))==null?void 0:r.get;return n?(Qr[i]=n,n.call(e)):e[t]}const qr={};function Ra(s,e,t){const r=`${s}.${String(t)}`;if(qr[r])return qr[r].bind(e);const o=pi(s)[t];return typeof o!="function"?e[t]:(qr[r]=o,o.bind(e))}function hd(s){return Re("Node",s,"childNodes")}function fd(s){return Re("Node",s,"parentNode")}function dd(s){return Re("Node",s,"parentElement")}function pd(s){return Re("Node",s,"textContent")}function md(s,e){return Ra("Node",s,"contains")(e)}function gd(s){return Ra("Node",s,"getRootNode")()}function yd(s){return!s||!("host"in s)?null:Re("ShadowRoot",s,"host")}function wd(s){return s.styleSheets}function bd(s){return!s||!("shadowRoot"in s)?null:Re("Element",s,"shadowRoot")}function Sd(s,e){return Re("Element",s,"querySelector")(e)}function vd(s,e){return Re("Element",s,"querySelectorAll")(e)}function Aa(){return pi("MutationObserver").constructor}const D={childNodes:hd,parentNode:fd,parentElement:dd,textContent:pd,contains:md,getRootNode:gd,host:yd,styleSheets:wd,shadowRoot:bd,querySelector:Sd,querySelectorAll:vd,mutationObserver:Aa};function te(s,e,t=document){const r={capture:!0,passive:!0};return t.addEventListener(s,e,r),()=>t.removeEventListener(s,e,r)}const We=`Please stop import mirror directly. Instead of that,\r
66
66
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
67
- or you can use record.mirror to access the mirror instance during recording.`;exports.mirror={map:{},getId(){return console.error(We),-1},getNode(){return console.error(We),null},removeNodeFromMap(){console.error(We)},has(){return console.error(We),!1},reset(){console.error(We)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(exports.mirror=new Proxy(exports.mirror,{get(s,e,t){return e==="map"&&console.error(We),Reflect.get(s,e,t)}}));function tt(s,e,t={}){let r=null,i=0;return function(...o){const n=Date.now();!i&&t.leading===!1&&(i=n);const a=e-(n-i),l=this;a<=0||a>e?(r&&(clearTimeout(r),r=null),i=n,s.apply(l,o)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{i=t.leading===!1?0:Date.now(),r=null,s.apply(l,o)},a))}}function Mt(s,e,t,r,i=window){const o=i.Object.getOwnPropertyDescriptor(s,e);return i.Object.defineProperty(s,e,r?t:{set(n){setTimeout(()=>{t.set.call(this,n)},0),o&&o.set&&o.set.call(this,n)}}),()=>Mt(s,e,o||{},!0)}function Pe(s,e,t){try{if(!(e in s))return()=>{};const r=s[e],i=t(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),s[e]=i,()=>{s[e]=r}}catch(r){return()=>{}}}let vt=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(vt=()=>new Date().getTime());function mi(s){var e,t,r,i;const o=s.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:o.documentElement.scrollLeft||(o==null?void 0:o.body)&&((e=D.parentElement(o.body))==null?void 0:e.scrollLeft)||((t=o==null?void 0:o.body)==null?void 0:t.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:(o==null?void 0:o.documentElement.scrollTop)||(o==null?void 0:o.body)&&((r=D.parentElement(o.body))==null?void 0:r.scrollTop)||((i=o==null?void 0:o.body)==null?void 0:i.scrollTop)||0}}function gi(s){return s.innerHeight||s.document.documentElement&&s.document.documentElement.clientHeight||s.document.body&&s.document.body.clientHeight}function yi(s){return s.innerWidth||s.document.documentElement&&s.document.documentElement.clientWidth||s.document.body&&s.document.body.clientWidth}function wi(s){return s?s.nodeType===s.ELEMENT_NODE?s:D.parentElement(s):null}function re(s,e,t,r){if(!s)return!1;const i=wi(s);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(ur(i,e,r))return!0}catch(o){}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function Oa(s,e){return e.getId(s)!==-1}function nr(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===ft}function bi(s,e){if(lt(s))return!1;const t=e.getId(s);if(!e.has(t))return!0;const r=D.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?bi(r,e):!0}function Sr(s){return!!s.changedTouches}function Si(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function Da(s){const e={},t=(i,o)=>{const n={value:i,parent:o,children:[]};return e[i.node.id]=n,n},r=[];for(const i of s){const{nextId:o,parentId:n}=i;if(o&&o in e){const a=e[o];if(a.parent){const l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,t(i,a.parent))}else{const l=r.indexOf(a);r.splice(l,0,t(i,null))}continue}if(n in e){const a=e[n];a.children.push(t(i,a));continue}r.push(t(i,null))}return r}function vi(s,e){e(s.value);for(let t=s.children.length-1;t>=0;t--)vi(s.children[t],e)}function Ze(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function Ci(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function Ei(s,e){var t,r;const i=(r=(t=s.ownerDocument)==null?void 0:t.defaultView)==null?void 0:r.frameElement;if(!i||i===e)return{x:0,y:0,relativeScale:1,absoluteScale:1};const o=i.getBoundingClientRect(),n=Ei(i,e),a=o.height/i.clientHeight;return{x:o.x*n.relativeScale+n.x,y:o.y*n.relativeScale+n.y,relativeScale:a,absoluteScale:n.absoluteScale*a}}function Ie(s){return s?s instanceof fe&&"shadowRoot"in s?!!s.shadowRoot:!!D.shadowRoot(s):!1}function je(s,e){const t=s[e[0]];return e.length===1?t:je(t.cssRules[e[1]].cssRules,e.slice(2))}function Ps(s){const e=[...s],t=e.pop();return{positions:e,index:t}}function Ta(s){const e=new Set,t=[];for(let r=s.length;r--;){const i=s[r];e.has(i.id)||(t.push(i),e.add(i.id))}return t}class Ii{constructor(){b(this,"id",1),b(this,"styleIDMap",new WeakMap),b(this,"idStyleMap",new Map)}getId(e){var t;return(t=this.styleIDMap.get(e))!=null?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return t===void 0?r=this.id++:r=t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function xi(s){var e;let t=null;return"getRootNode"in s&&((e=D.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&D.host(D.getRootNode(s))&&(t=D.host(D.getRootNode(s))),t}function _a(s){let e=s,t;for(;t=xi(e);)e=t;return e}function ka(s){const e=s.ownerDocument;if(!e)return!1;const t=_a(s);return D.contains(e,t)}function Mi(s){const e=s.ownerDocument;return e?D.contains(e,s)||ka(s):!1}const Cd=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:Ii,get _mirror(){return exports.mirror},closestElementOfNode:wi,getBaseDimension:Ei,getNestedRule:je,getPositionsAndIndex:Ps,getRootShadowHost:_a,getShadowHost:xi,getWindowHeight:gi,getWindowScroll:mi,getWindowWidth:yi,hasShadowRoot:Ie,hookSetter:Mt,inDom:Mi,isAncestorRemoved:bi,isBlocked:re,isIgnored:nr,isSerialized:Oa,isSerializedIframe:Ze,isSerializedStylesheet:Ci,iterateResolveTree:vi,legacy_isTouchEvent:Sr,get nowTimestamp(){return vt},on:te,patch:Pe,polyfill:Si,queueToResolveTrees:Da,shadowHostInDom:ka,throttle:tt,uniqueTextMutations:Ta},Symbol.toStringTag,{value:"Module"}));var I=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(I||{}),E=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(E||{}),$=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))($||{}),we=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(we||{}),ve=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(ve||{}),Ee=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(Ee||{}),k=(s=>(s.Start="start",s.Pause="pause",s.Resume="resume",s.Resize="resize",s.Finish="finish",s.FullsnapshotRebuilded="fullsnapshot-rebuilded",s.LoadStylesheetStart="load-stylesheet-start",s.LoadStylesheetEnd="load-stylesheet-end",s.SkipStart="skip-start",s.SkipEnd="skip-end",s.MouseInteraction="mouse-interaction",s.EventCast="event-cast",s.CustomEvent="custom-event",s.Flush="flush",s.StateChange="state-change",s.PlayBack="play-back",s.Destroy="destroy",s))(k||{});function Nn(s){return"__ln"in s}class Ed{constructor(){b(this,"length",0),b(this,"head",null),b(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(t==null?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Nn(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Nn(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const Rn=(s,e)=>`${s}@${e}`;class Id{constructor(){b(this,"frozen",!1),b(this,"locked",!1),b(this,"texts",[]),b(this,"attributes",[]),b(this,"attributeMap",new WeakMap),b(this,"removes",[]),b(this,"mapRemoves",[]),b(this,"movedMap",{}),b(this,"addedSet",new Set),b(this,"movedSet",new Set),b(this,"droppedSet",new Set),b(this,"mutationCb"),b(this,"blockClass"),b(this,"blockSelector"),b(this,"maskTextClass"),b(this,"maskTextSelector"),b(this,"inlineStylesheet"),b(this,"maskInputOptions"),b(this,"maskTextFn"),b(this,"maskInputFn"),b(this,"keepIframeSrcFn"),b(this,"recordCanvas"),b(this,"inlineImages"),b(this,"slimDOMOptions"),b(this,"dataURLOptions"),b(this,"doc"),b(this,"mirror"),b(this,"iframeManager"),b(this,"stylesheetManager"),b(this,"shadowDomManager"),b(this,"canvasManager"),b(this,"processedNodeManager"),b(this,"unattachedDoc"),b(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),b(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new Ed,i=l=>{let u=l,c=ft;for(;c===ft;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},o=l=>{const u=D.parentNode(l);if(!u||!Mi(l))return;let c=!1;if(l.nodeType===Node.TEXT_NODE){const p=u.tagName;if(p==="TEXTAREA")return;p==="STYLE"&&this.addedSet.has(u)&&(c=!0)}const h=lt(u)?this.mirror.getId(xi(l)):this.mirror.getId(u),f=i(l);if(h===-1||f===-1)return r.addNode(l);const g=Ge(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,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:p=>{Ze(p,this.mirror)&&this.iframeManager.addIframe(p),Ci(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),Ie(l)&&this.shadowDomManager.addShadowRoot(D.shadowRoot(l),this.doc)},onIframeLoad:(p,m)=>{this.iframeManager.attachIframe(p,m),this.shadowDomManager.observeAttachShadow(p)},onStylesheetLoad:(p,m)=>{this.stylesheetManager.attachLinkElement(p,m)},cssCaptured:c});g&&(e.push({parentId:h,nextId:f,node:g}),t.add(g.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of this.movedSet)An(this.removes,l,this.mirror)&&!this.movedSet.has(D.parentNode(l))||o(l);for(const l of this.addedSet)!On(this.droppedSet,l)&&!An(this.removes,l,this.mirror)||On(this.movedSet,l)?o(l):this.droppedSet.add(l);let n=null;for(;r.length;){let l=null;if(n){const u=this.mirror.getId(D.parentNode(n.value)),c=i(n.value);u!==-1&&c!==-1&&(l=n)}if(!l){let u=r.tail;for(;u;){const c=u;if(u=u.previous,c){const h=this.mirror.getId(D.parentNode(c.value));if(i(c.value)===-1)continue;if(h!==-1){l=c;break}else{const g=c.value,p=D.parentNode(g);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const m=D.host(p);if(this.mirror.getId(m)!==-1){l=c;break}}}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}n=l.previous,r.removeNode(l.value),o(l.value)}const a={texts:this.texts.map(l=>{const u=l.node,c=D.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:l.value}}).filter(l=>!t.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{const{attributes:u}=l;if(typeof u.style=="string"){const c=JSON.stringify(l.styleDiff),h=JSON.stringify(l._unchangedStyles);c.length<u.style.length&&(c+h).split("var(").length===u.style.split("var(").length&&(u.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:u}}).filter(l=>!t.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:e};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.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.movedMap={},this.mutationCb(a))}),b(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(D.childNodes(e),r=>D.textContent(r)||"").join("")}),b(this,"processMutation",e=>{if(!nr(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=D.textContent(e.target);!re(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:qn(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,wi(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){const n=Vs(t);i=zs({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:n,value:i,maskInputFn:this.maskInputFn})}if(re(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let o=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!Qn(t.tagName,r))if(o.attributes[r]=Kn(this.doc,Me(t.tagName),Me(r),i),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(a){this.unattachedDoc=this.doc}const n=this.unattachedDoc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue);for(const a of Array.from(t.style)){const l=t.style.getPropertyValue(a),u=t.style.getPropertyPriority(a);l!==n.style.getPropertyValue(a)||u!==n.style.getPropertyPriority(a)?u===""?o.styleDiff[a]=l:o.styleDiff[a]=[l,u]:o._unchangedStyles[a]=[l,u]}for(const a of Array.from(n.style))t.style.getPropertyValue(a)===""&&(o.styleDiff[a]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":{if(re(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const r=this.mirror.getId(t),i=lt(e.target)?this.mirror.getId(D.host(e.target)):this.mirror.getId(e.target);re(e.target,this.blockClass,this.blockSelector,!1)||nr(t,this.mirror,this.slimDOMOptions)||!Oa(t,this.mirror)||(this.addedSet.has(t)?(Ls(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||bi(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Rn(r,i)]?Ls(this.movedSet,t):this.removes.push({parentId:i,id:r,isShadow:lt(e.target)&&ut(e.target)?!0:void 0})),this.mapRemoves.push(t))});break}}}),b(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(nr(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[Rn(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);re(e,this.blockClass,this.blockSelector,!1)||(D.childNodes(e).forEach(r=>this.genAdds(r)),Ie(e)&&D.childNodes(D.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Ls(s,e){s.delete(e),D.childNodes(e).forEach(t=>Ls(s,t))}function An(s,e,t){return s.length===0?!1:xd(s,e,t)}function xd(s,e,t){let r=D.parentNode(e);for(;r;){const i=t.getId(r);if(s.some(o=>o.id===i))return!0;r=D.parentNode(r)}return!1}function On(s,e){return s.size===0?!1:$a(s,e)}function $a(s,e){const t=D.parentNode(e);return t?s.has(t)?!0:$a(s,t):!1}let ht;function Md(s){ht=s}function Nd(){ht=void 0}const _=s=>ht?(...t)=>{try{return s(...t)}catch(r){if(ht&&ht(r)===!0)return;throw r}}:s,_e=[];function Nt(s){try{if("composedPath"in s){const e=s.composedPath();if(e.length)return e[0]}else if("path"in s&&s.path.length)return s.path[0]}catch(e){}return s&&s.target}function Pa(s,e){const t=new Id;_e.push(t),t.init(s);const r=new(Aa())(_(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function Rd({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};const i=typeof e.mousemove=="number"?e.mousemove:50,o=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let n=[],a;const l=tt(_(h=>{const f=Date.now()-a;s(n.map(g=>(g.timeOffset-=f,g)),h),n=[],a=null}),o),u=_(tt(_(h=>{const f=Nt(h),{clientX:g,clientY:p}=Sr(h)?h.changedTouches[0]:h;a||(a=vt()),n.push({x:g,y:p,id:r.getId(f),timeOffset:vt()-a}),l(typeof DragEvent!="undefined"&&h instanceof DragEvent?E.Drag:h instanceof MouseEvent?E.MouseMove:E.TouchMove)}),i,{trailing:!1})),c=[te("mousemove",u,t),te("touchmove",u,t),te("drag",u,t)];return _(()=>{c.forEach(h=>h())})}function Ad({mouseInteractionCb:s,doc:e,win:t,mirror:r,blockClass:i,blockSelector:o,sampling:n}){if(n.mouseInteraction===!1)return()=>{};const a=n.mouseInteraction===!0||n.mouseInteraction===void 0?{}:n.mouseInteraction,l=[];let u=null;const c=h=>f=>{const g=Nt(f);if(re(g,i,o,!0))return;let p=null,m=h;if("pointerType"in f){switch(f.pointerType){case"mouse":p=we.Mouse;break;case"touch":p=we.Touch;break;case"pen":p=we.Pen;break}p===we.Touch?$[h]===$.MouseDown?m="TouchStart":$[h]===$.MouseUp&&(m="TouchEnd"):we.Pen}else Sr(f)&&(p=we.Touch);p!==null?(u=p,(m.startsWith("Touch")&&p===we.Touch||m.startsWith("Mouse")&&p===we.Mouse)&&(p=null)):$[h]===$.Click&&(p=u,u=null);const d=Sr(f)?f.changedTouches[0]:f;if(!d)return;const y=r.getId(g),{clientX:S,clientY:w}=d;_(s)(R({type:$[m],id:y,x:S,y:w},p!==null&&{pointerType:p}))};return Object.keys($).filter(h=>Number.isNaN(Number(h))&&!h.endsWith("_Departed")&&a[h]!==!1).forEach(h=>{let f=Me(h);const g=c(h);if(t.PointerEvent)switch($[h]){case $.MouseDown:case $.MouseUp:f=f.replace("mouse","pointer");break;case $.TouchStart:case $.TouchEnd:return}l.push(te(f,g,e))}),_(()=>{l.forEach(h=>h())})}function La({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:o}){const n=_(tt(_(a=>{const l=Nt(a);if(!l||re(l,r,i,!0))return;const u=t.getId(l);if(l===e&&e.defaultView){const c=mi(e.defaultView);s({id:u,x:c.left,y:c.top})}else s({id:u,x:l.scrollLeft,y:l.scrollTop})}),o.scroll||100));return te("scroll",n,e)}function Od({viewportResizeCb:s},{win:e}){let t=-1,r=-1;const i=_(tt(_(()=>{const o=gi(e),n=yi(e);(t!==o||r!==n)&&(s({width:Number(n),height:Number(o)}),t=o,r=n)}),200));return te("resize",i,e)}const Dd=["INPUT","TEXTAREA","SELECT"],Dn=new WeakMap;function Td({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:o,ignoreSelector:n,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function h(S){let w=Nt(S);const v=S.isTrusted,x=w&&w.tagName;if(w&&x==="OPTION"&&(w=D.parentElement(w)),!w||!x||Dd.indexOf(x)<0||re(w,r,i,!0)||w.classList.contains(o)||n&&w.matches(n))return;let A=w.value,z=!1;const B=Vs(w)||"";B==="radio"||B==="checkbox"?z=w.checked:(a[x.toLowerCase()]||a[B])&&(A=zs({element:w,maskInputOptions:a,tagName:x,type:B,value:A,maskInputFn:l})),f(w,c?{text:A,isChecked:z,userTriggered:v}:{text:A,isChecked:z});const H=w.name;B==="radio"&&H&&z&&e.querySelectorAll(`input[type="radio"][name="${H}"]`).forEach(K=>{if(K!==w){const ie=K.value;f(K,c?{text:ie,isChecked:!z,userTriggered:!1}:{text:ie,isChecked:!z})}})}function f(S,w){const v=Dn.get(S);if(!v||v.text!==w.text||v.isChecked!==w.isChecked){Dn.set(S,w);const x=t.getId(S);_(s)(q(R({},w),{id:x}))}}const p=(u.input==="last"?["change"]:["input","change"]).map(S=>te(S,_(h),e)),m=e.defaultView;if(!m)return()=>{p.forEach(S=>S())};const d=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),y=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return d&&d.set&&p.push(...y.map(S=>Mt(S[0],S[1],{set(){_(h)({target:this,isTrusted:!1})}},!1,m))),_(()=>{p.forEach(S=>S())})}function vr(s,e){const t=[];function r(i,o){if(Kt(s,"CSSGroupingRule")&&i.parentRule instanceof CSSGroupingRule||Kt(s,"CSSMediaRule")&&i.parentRule instanceof CSSMediaRule||Kt(s,"CSSSupportsRule")&&i.parentRule instanceof CSSSupportsRule||Kt(s,"CSSConditionRule")&&i.parentRule instanceof CSSConditionRule){const a=Array.from(i.parentRule.cssRules).indexOf(i);o.unshift(a)}else if(i.parentStyleSheet){const a=Array.from(i.parentStyleSheet.cssRules).indexOf(i);o.unshift(a)}return o}return r(e,t)}function Ce(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function _d({styleSheetRuleCb:s,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:_((c,h,f)=>{const[g,p]=f,{id:m,styleId:d}=Ce(h,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,adds:[{rule:g,index:p}]}),c.apply(h,f)})}),r.CSSStyleSheet.prototype.addRule=function(c,h,f=this.cssRules.length){const g=`${c} { ${h} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[g,f])};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:_((c,h,f)=>{const[g]=f,{id:p,styleId:m}=Ce(h,e,t.styleMirror);return(p&&p!==-1||m&&m!==-1)&&s({id:p,styleId:m,removes:[{index:g}]}),c.apply(h,f)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let n;r.CSSStyleSheet.prototype.replace&&(n=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(n,{apply:_((c,h,f)=>{const[g]=f,{id:p,styleId:m}=Ce(h,e,t.styleMirror);return(p&&p!==-1||m&&m!==-1)&&s({id:p,styleId:m,replace:g}),c.apply(h,f)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:_((c,h,f)=>{const[g]=f,{id:p,styleId:m}=Ce(h,e,t.styleMirror);return(p&&p!==-1||m&&m!==-1)&&s({id:p,styleId:m,replaceSync:g}),c.apply(h,f)})}));const l={};Qt(r,"CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(Qt(r,"CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),Qt(r,"CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),Qt(r,"CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(l).forEach(([c,h])=>{u[c]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(u[c].insertRule,{apply:_((f,g,p)=>{const[m,d]=p,{id:y,styleId:S}=Ce(g.parentStyleSheet,e,t.styleMirror);return(y&&y!==-1||S&&S!==-1)&&s({id:y,styleId:S,adds:[{rule:m,index:[...vr(r,g),d||0]}]}),f.apply(g,p)})}),h.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:_((f,g,p)=>{const[m]=p,{id:d,styleId:y}=Ce(g.parentStyleSheet,e,t.styleMirror);return(d&&d!==-1||y&&y!==-1)&&s({id:d,styleId:y,removes:[{index:[...vr(r,g),m]}]}),f.apply(g,p)})})}),_(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=o,n&&(r.CSSStyleSheet.prototype.replace=n),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([c,h])=>{h.prototype.insertRule=u[c].insertRule,h.prototype.deleteRule=u[c].deleteRule})})}function Fa({mirror:s,stylesheetManager:e},t){var r,i,o;let n=null;t.nodeName==="#document"?n=s.getId(t):n=s.getId(D.host(t));const a=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(o=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:o.ShadowRoot,l=a!=null&&a.prototype?Object.getOwnPropertyDescriptor(a==null?void 0:a.prototype,"adoptedStyleSheets"):void 0;return n===null||n===-1||!a||!l?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var u;return(u=l.get)==null?void 0:u.call(this)},set(u){var c;const h=(c=l.set)==null?void 0:c.call(this,u);if(n!==null&&n!==-1)try{e.adoptStyleSheets(u,n)}catch(f){}return h}}),_(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function kd({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:_((a,l,u)=>{var c;const[h,f,g]=u;if(t.has(h))return o.apply(l,[h,f,g]);const{id:p,styleId:m}=Ce((c=l.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(p&&p!==-1||m&&m!==-1)&&s({id:p,styleId:m,set:{property:h,value:f,priority:g},index:vr(i,l.parentRule)}),a.apply(l,u)})});const n=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(n,{apply:_((a,l,u)=>{var c;const[h]=u;if(t.has(h))return n.apply(l,[h]);const{id:f,styleId:g}=Ce((c=l.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(f&&f!==-1||g&&g!==-1)&&s({id:f,styleId:g,remove:{property:h},index:vr(i,l.parentRule)}),a.apply(l,u)})}),_(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=n})}function $d({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:o}){const n=_(l=>tt(_(u=>{const c=Nt(u);if(!c||re(c,e,t,!0))return;const{currentTime:h,volume:f,muted:g,playbackRate:p,loop:m}=c;s({type:l,id:r.getId(c),currentTime:h,volume:f,muted:g,playbackRate:p,loop:m})}),i.media||500)),a=[te("play",n(Ee.Play),o),te("pause",n(Ee.Pause),o),te("seeked",n(Ee.Seeked),o),te("volumechange",n(Ee.VolumeChange),o),te("ratechange",n(Ee.RateChange),o)];return _(()=>{a.forEach(l=>l())})}function Pd({fontCb:s,doc:e}){const t=e.defaultView;if(!t)return()=>{};const r=[],i=new WeakMap,o=t.FontFace;t.FontFace=function(l,u,c){const h=new o(l,u,c);return i.set(h,{family:l,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),h};const n=Pe(e.fonts,"add",function(a){return function(l){return setTimeout(_(()=>{const u=i.get(l);u&&(s(u),i.delete(l))}),0),a.apply(this,[l])}});return r.push(()=>{t.FontFace=o}),r.push(n),_(()=>{r.forEach(a=>a())})}function Ld(s){const{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:o}=s;let n=!0;const a=_(()=>{const l=e.getSelection();if(!l||n&&(l!=null&&l.isCollapsed))return;n=l.isCollapsed||!1;const u=[],c=l.rangeCount||0;for(let h=0;h<c;h++){const f=l.getRangeAt(h),{startContainer:g,startOffset:p,endContainer:m,endOffset:d}=f;re(g,r,i,!0)||re(m,r,i,!0)||u.push({start:t.getId(g),startOffset:p,end:t.getId(m),endOffset:d})}o({ranges:u})});return a(),te("selectionchange",a)}function Fd({doc:s,customElementCb:e}){const t=s.defaultView;return!t||!t.customElements?()=>{}:Pe(t.customElements,"define",function(i){return function(o,n,a){try{e({define:{name:o}})}catch(l){console.warn(`Custom element callback failed for ${o}`)}return i.apply(this,[o,n,a])}})}function Bd(s,e){const{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:n,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,fontCb:f,selectionCb:g,customElementCb:p}=s;s.mutationCb=(...m)=>{e.mutation&&e.mutation(...m),t(...m)},s.mousemoveCb=(...m)=>{e.mousemove&&e.mousemove(...m),r(...m)},s.mouseInteractionCb=(...m)=>{e.mouseInteraction&&e.mouseInteraction(...m),i(...m)},s.scrollCb=(...m)=>{e.scroll&&e.scroll(...m),o(...m)},s.viewportResizeCb=(...m)=>{e.viewportResize&&e.viewportResize(...m),n(...m)},s.inputCb=(...m)=>{e.input&&e.input(...m),a(...m)},s.mediaInteractionCb=(...m)=>{e.mediaInteaction&&e.mediaInteaction(...m),l(...m)},s.styleSheetRuleCb=(...m)=>{e.styleSheetRule&&e.styleSheetRule(...m),u(...m)},s.styleDeclarationCb=(...m)=>{e.styleDeclaration&&e.styleDeclaration(...m),c(...m)},s.canvasMutationCb=(...m)=>{e.canvasMutation&&e.canvasMutation(...m),h(...m)},s.fontCb=(...m)=>{e.font&&e.font(...m),f(...m)},s.selectionCb=(...m)=>{e.selection&&e.selection(...m),g(...m)},s.customElementCb=(...m)=>{e.customElement&&e.customElement(...m),p(...m)}}function Ud(s,e={}){const t=s.doc.defaultView;if(!t)return()=>{};Bd(s,e);let r;s.recordDOM&&(r=Pa(s,s.doc));const i=Rd(s),o=Ad(s),n=La(s),a=Od(s,{win:t}),l=Td(s),u=$d(s);let c=()=>{},h=()=>{},f=()=>{},g=()=>{};s.recordDOM&&(c=_d(s,{win:t}),h=Fa(s,s.doc),f=kd(s,{win:t}),s.collectFonts&&(g=Pd(s)));const p=Ld(s),m=Fd(s),d=[];for(const y of s.plugins)d.push(y.observer(y.callback,t,y.options));return _(()=>{_e.forEach(y=>y.reset()),r==null||r.disconnect(),i(),o(),n(),a(),l(),u(),c(),h(),f(),g(),p(),m(),d.forEach(y=>y())})}function Kt(s,e){return typeof s[e]!="undefined"}function Qt(s,e){return!!(typeof s[e]!="undefined"&&s[e].prototype&&"insertRule"in s[e].prototype&&"deleteRule"in s[e].prototype)}class Tn{constructor(e){b(this,"iframeIdToRemoteIdMap",new WeakMap),b(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){const o=r||this.getIdToRemoteIdMap(e),n=i||this.getRemoteIdToIdMap(e);let a=o.get(t);return a||(a=this.generateIdFn(),o.set(t,a),n.set(a,t)),a}getIds(e,t){const r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(o=>this.getId(e,o,r,i))}getRemoteId(e,t,r){const i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;const o=i.get(t);return o||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Wd{constructor(e){b(this,"iframes",new WeakMap),b(this,"crossOriginIframeMap",new WeakMap),b(this,"crossOriginIframeMirror",new Tn(Jn)),b(this,"crossOriginIframeStyleMirror"),b(this,"crossOriginIframeRootIdMap",new WeakMap),b(this,"mirror"),b(this,"mutationCb"),b(this,"wrappedEmit"),b(this,"loadListener"),b(this,"stylesheetManager"),b(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Tn(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;const i=this.crossOriginIframeMap.get(e.source);if(!i)return;const o=this.transformCrossOriginEvent(i,t.data.event);o&&this.wrappedEmit(o,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case I.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:I.IncrementalSnapshot,data:{source:E.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case I.Meta:case I.Load:case I.DomContentLoaded:return!1;case I.Plugin:return t;case I.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case I.IncrementalSnapshot:switch(t.data.source){case E.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);const o=this.crossOriginIframeRootIdMap.get(e);o&&this.patchRootIdOnNode(i.node,o)}),t.data.removes.forEach(i=>{this.replaceIds(i,e,["parentId","id"])}),t.data.attributes.forEach(i=>{this.replaceIds(i,e,["id"])}),t.data.texts.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case E.Drag:case E.TouchMove:case E.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case E.ViewportResize:return!1;case E.MediaInteraction:case E.MouseInteraction:case E.Scroll:case E.CanvasMutation:case E.Input:return this.replaceIds(t.data,e,["id"]),t;case E.StyleSheetRule:case E.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case E.Font:return t;case E.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case E.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,e,["styleId"])}),t}}return!1}replace(e,t,r,i){for(const o of i)!Array.isArray(t[o])&&typeof t[o]!="number"||(Array.isArray(t[o])?t[o]=e.getIds(r,t[o]):t[o]=e.getId(r,t[o]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==M.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}}class zd{constructor(e){b(this,"shadowDoms",new WeakSet),b(this,"mutationCb"),b(this,"scrollCb"),b(this,"bypassOptions"),b(this,"mirror"),b(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!ut(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=Pa(q(R({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(La(q(R({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(D.host(e))),this.restoreHandlers.push(Fa({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const r=this;this.restoreHandlers.push(Pe(e.prototype,"attachShadow",function(i){return function(o){const n=i.call(this,o),a=D.shadowRoot(this);return a&&Mi(this)&&r.addShadowRoot(a,t),n}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var Ye="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",at=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var qt=0;qt<Ye.length;qt++)at[Ye.charCodeAt(qt)]=qt;var Vd=function(s){var e=new Uint8Array(s),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=Ye[e[t]>>2],i+=Ye[(e[t]&3)<<4|e[t+1]>>4],i+=Ye[(e[t+1]&15)<<2|e[t+2]>>6],i+=Ye[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i},Gd=function(s){var e=s.length*.75,t=s.length,r,i=0,o,n,a,l;s[s.length-1]==="="&&(e--,s[s.length-2]==="="&&e--);var u=new ArrayBuffer(e),c=new Uint8Array(u);for(r=0;r<t;r+=4)o=at[s.charCodeAt(r)],n=at[s.charCodeAt(r+1)],a=at[s.charCodeAt(r+2)],l=at[s.charCodeAt(r+3)],c[i++]=o<<2|n>>4,c[i++]=(n&15)<<4|a>>2,c[i++]=(a&3)<<6|l&63;return u};const _n=new Map;function jd(s,e){let t=_n.get(s);return t||(t=new Map,_n.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}const Ba=(s,e,t)=>{if(!s||!(Wa(s,e)||typeof s=="object"))return;const r=s.constructor.name,i=jd(t,r);let o=i.indexOf(s);return o===-1&&(o=i.length,i.push(s)),o};function or(s,e,t){if(s instanceof Array)return s.map(r=>or(r,e,t));if(s===null)return s;if(s instanceof Float32Array||s instanceof Float64Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Uint8Array||s instanceof Uint16Array||s instanceof Int16Array||s instanceof Int8Array||s instanceof Uint8ClampedArray)return{rr_type:s.constructor.name,args:[Object.values(s)]};if(s instanceof ArrayBuffer){const r=s.constructor.name,i=Vd(s);return{rr_type:r,base64:i}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[or(s.buffer,e,t),s.byteOffset,s.byteLength]};if(s instanceof HTMLImageElement){const r=s.constructor.name,{src:i}=s;return{rr_type:r,src:i}}else if(s instanceof HTMLCanvasElement){const r="HTMLImageElement",i=s.toDataURL();return{rr_type:r,src:i}}else{if(s instanceof ImageData)return{rr_type:s.constructor.name,args:[or(s.data,e,t),s.width,s.height]};if(Wa(s,e)||typeof s=="object"){const r=s.constructor.name,i=Ba(s,e,t);return{rr_type:r,index:i}}}}return s}const Ua=(s,e,t)=>s.map(r=>or(r,e,t)),Wa=(s,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>s instanceof e[i]);function Yd(s,e,t,r){const i=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const n of o)try{if(typeof e.CanvasRenderingContext2D.prototype[n]!="function")continue;const a=Pe(e.CanvasRenderingContext2D.prototype,n,function(l){return function(...u){return re(this.canvas,t,r,!0)||setTimeout(()=>{const c=Ua(u,e,this);s(this.canvas,{type:ve["2D"],property:n,args:c})},0),l.apply(this,u)}});i.push(a)}catch(a){const l=Mt(e.CanvasRenderingContext2D.prototype,n,{set(u){s(this.canvas,{type:ve["2D"],property:n,args:[u],setter:!0})}});i.push(l)}return()=>{i.forEach(n=>n())}}function Hd(s){return s==="experimental-webgl"?"webgl":s}function kn(s,e,t,r){const i=[];try{const o=Pe(s.HTMLCanvasElement.prototype,"getContext",function(n){return function(a,...l){if(!re(this,e,t,!0)){const u=Hd(a);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(l[0]&&typeof l[0]=="object"){const c=l[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return n.apply(this,[a,...l])}});i.push(o)}catch(o){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(o=>o())}}function $n(s,e,t,r,i,o){const n=[],a=Object.getOwnPropertyNames(s);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof s[l]!="function")continue;const u=Pe(s,l,function(c){return function(...h){const f=c.apply(this,h);if(Ba(f,o,this),"tagName"in this.canvas&&!re(this.canvas,r,i,!0)){const g=Ua(h,o,this),p={type:e,property:l,args:g};t(this.canvas,p)}return f}});n.push(u)}catch(u){const c=Mt(s,l,{set(h){t(this.canvas,{type:e,property:l,args:[h],setter:!0})}});n.push(c)}return n}function Zd(s,e,t,r){const i=[];return i.push(...$n(e.WebGLRenderingContext.prototype,ve.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext!="undefined"&&i.push(...$n(e.WebGL2RenderingContext.prototype,ve.WebGL2,s,t,r,e)),()=>{i.forEach(o=>o())}}const za="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Xd=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),Pn=typeof window!="undefined"&&window.Blob&&new Blob([Xd(za)],{type:"text/javascript;charset=utf-8"});function Jd(s){let e;try{if(e=Pn&&(window.URL||window.webkitURL).createObjectURL(Pn),!e)throw"";const t=new Worker(e,{name:s==null?void 0:s.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch(t){return new Worker("data:text/javascript;base64,"+za,{name:s==null?void 0:s.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Kd{constructor(e){b(this,"pendingCanvasMutations",new Map),b(this,"rafStamps",{latestId:0,invokeId:null}),b(this,"mirror"),b(this,"mutationCb"),b(this,"resetObservers"),b(this,"frozen",!1),b(this,"locked",!1),b(this,"processMutation",(l,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(u)});const{sampling:t="all",win:r,blockClass:i,blockSelector:o,recordCanvas:n,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,n&&t==="all"&&this.initCanvasMutationObserver(r,i,o),n&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,i,o,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,i,o){const n=kn(t,r,i,!0),a=new Map,l=new Jd;l.onmessage=p=>{const{id:m}=p.data;if(a.set(m,!1),!("base64"in p.data))return;const{base64:d,type:y,width:S,height:w}=p.data;this.mutationCb({id:m,type:ve["2D"],commands:[{property:"clearRect",args:[0,0,S,w]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:d}],type:y}]},0,0]}]})};const u=1e3/e;let c=0,h;const f=()=>{const p=[];return t.document.querySelectorAll("canvas").forEach(m=>{re(m,r,i,!0)||p.push(m)}),p},g=p=>{if(c&&p-c<u){h=requestAnimationFrame(g);return}c=p,f().forEach(async m=>{var d;const y=this.mirror.getId(m);if(a.get(y)||m.width===0||m.height===0)return;if(a.set(y,!0),["webgl","webgl2"].includes(m.__context)){const w=m.getContext(m.__context);((d=w==null?void 0:w.getContextAttributes())==null?void 0:d.preserveDrawingBuffer)===!1&&w.clear(w.COLOR_BUFFER_BIT)}const S=await createImageBitmap(m);l.postMessage({id:y,bitmap:S,width:m.width,height:m.height,dataURLOptions:o.dataURLOptions},[S])}),h=requestAnimationFrame(g)};h=requestAnimationFrame(g),this.resetObservers=()=>{n(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=kn(e,t,r,!1),o=Yd(this.processMutation.bind(this),e,t,r),n=Zd(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),o(),n()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||t===-1)return;const i=r.map(n=>{const u=n,{type:a}=u;return Fe(u,["type"])}),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:i}),this.pendingCanvasMutations.delete(e)}}class Qd{constructor(e){b(this,"trackedLinkElements",new WeakSet),b(this,"mutationCb"),b(this,"adoptedStyleSheetCb"),b(this,"styleMirror",new Ii),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;const r={id:t,styleIds:[]},i=[];for(const o of e){let n;this.styleMirror.has(o)?n=this.styleMirror.getId(o):(n=this.styleMirror.add(o),i.push({styleId:n,rules:Array.from(o.rules||CSSRule,(a,l)=>({rule:Hn(a,o.href),index:l}))})),r.styleIds.push(n)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class qd{constructor(){b(this,"nodeMap",new WeakMap),b(this,"active",!1)}inOtherBuffer(e,t){const r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let J,ar,es,Cr=!1;try{if(Array.from([1],s=>s*2)[0]!==2){const s=document.createElement("iframe");document.body.appendChild(s),Array.from=((ki=s.contentWindow)==null?void 0:ki.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}const ue=Zn();function Ae(s={}){const{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:n="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:f,slimDOMOptions:g,maskInputFn:p,maskTextFn:m,hooks:d,packFn:y,sampling:S={},dataURLOptions:w={},mousemoveWait:v,recordDOM:x=!0,recordCanvas:A=!1,recordCrossOriginIframes:z=!1,recordAfter:B=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",userTriggeredOnInput:H=!1,collectFonts:K=!1,inlineImages:ie=!1,win:ae=window,plugins:O,keepIframeSrcFn:ye=()=>!1,ignoreCSSAttributes:Oe=new Set([]),errorHandler:Q}=s,N=ae;Md(Q);const oe=z?N.parent===N:!0;let se=!1;if(!oe)try{N.parent.document&&(se=!1)}catch(P){se=!0}if(oe&&!e)throw new Error("emit function is required");if(!oe&&!se)return()=>{};v!==void 0&&S.mousemove===void 0&&(S.mousemove=v),ue.reset();const Le=h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:f!==void 0?f:{password:!0},Lr=g===!0||g==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:g==="all",headMetaDescKeywords:g==="all",headTitleMutations:g==="all"}:g||{};Si(N);let Ni,Fr=0;const Ri=P=>{for(const le of O||[])le.eventProcessor&&(P=le.eventProcessor(P));return y&&!se&&(P=y(P)),P};J=(P,le)=>{var Z;const X=P;if(X.timestamp=vt(),(Z=_e[0])!=null&&Z.isFrozen()&&X.type!==I.FullSnapshot&&!(X.type===I.IncrementalSnapshot&&X.data.source===E.Mutation)&&_e.forEach(de=>de.unfreeze()),oe)e==null||e(Ri(X),le);else if(se){const de={type:"rrweb",event:Ri(X),origin:N.location.origin,isCheckout:le};N.parent.postMessage(de,"*")}if(X.type===I.FullSnapshot)Ni=X,Fr=0;else if(X.type===I.IncrementalSnapshot){if(X.data.source===E.Mutation&&X.data.isAttachIframe)return;Fr++;const de=r&&Fr>=r,U=t&&X.timestamp-Ni.timestamp>t;(de||U)&&ar(!0)}};const Rt=P=>{J({type:I.IncrementalSnapshot,data:R({source:E.Mutation},P)})},Ai=P=>J({type:I.IncrementalSnapshot,data:R({source:E.Scroll},P)}),Oi=P=>J({type:I.IncrementalSnapshot,data:R({source:E.CanvasMutation},P)}),Xa=P=>J({type:I.IncrementalSnapshot,data:R({source:E.AdoptedStyleSheet},P)}),De=new Qd({mutationCb:Rt,adoptedStyleSheetCb:Xa}),Te=new Wd({mirror:ue,mutationCb:Rt,stylesheetManager:De,recordCrossOriginIframes:z,wrappedEmit:J});for(const P of O||[])P.getMirror&&P.getMirror({nodeMirror:ue,crossOriginIframeMirror:Te.crossOriginIframeMirror,crossOriginIframeStyleMirror:Te.crossOriginIframeStyleMirror});const Br=new qd;es=new Kd({recordCanvas:A,mutationCb:Oi,win:N,blockClass:i,blockSelector:o,mirror:ue,sampling:S.canvas,dataURLOptions:w});const At=new zd({mutationCb:Rt,scrollCb:Ai,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:Le,dataURLOptions:w,maskTextFn:m,maskInputFn:p,recordCanvas:A,inlineImages:ie,sampling:S,slimDOMOptions:Lr,iframeManager:Te,stylesheetManager:De,canvasManager:es,keepIframeSrcFn:ye,processedNodeManager:Br,win:N},mirror:ue});ar=(P=!1)=>{if(!x)return;J({type:I.Meta,data:{href:N.location.href,width:yi(N),height:gi(N)}},P),De.reset(),At.init(),_e.forEach(Z=>Z.lock());const le=Gl(N.document,{mirror:ue,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:Le,maskTextFn:m,maskInputFn:p,slimDOM:Lr,dataURLOptions:w,recordCanvas:A,inlineImages:ie,onSerialize:Z=>{Ze(Z,ue)&&Te.addIframe(Z),Ci(Z,ue)&&De.trackLinkElement(Z),Ie(Z)&&At.addShadowRoot(D.shadowRoot(Z),document)},onIframeLoad:(Z,X)=>{Te.attachIframe(Z,X),At.observeAttachShadow(Z)},onStylesheetLoad:(Z,X)=>{De.attachLinkElement(Z,X)},keepIframeSrcFn:ye});if(!le)return console.warn("Failed to snapshot the document");J({type:I.FullSnapshot,data:{node:le,initialOffset:mi(N)}},P),_e.forEach(Z=>Z.unlock()),N.document.adoptedStyleSheets&&N.document.adoptedStyleSheets.length>0&&De.adoptStyleSheets(N.document.adoptedStyleSheets,ue.getId(N.document))};try{const P=[],le=X=>{var de;return _(Ud)({mutationCb:Rt,mousemoveCb:(U,Ur)=>J({type:I.IncrementalSnapshot,data:{source:Ur,positions:U}}),mouseInteractionCb:U=>J({type:I.IncrementalSnapshot,data:R({source:E.MouseInteraction},U)}),scrollCb:Ai,viewportResizeCb:U=>J({type:I.IncrementalSnapshot,data:R({source:E.ViewportResize},U)}),inputCb:U=>J({type:I.IncrementalSnapshot,data:R({source:E.Input},U)}),mediaInteractionCb:U=>J({type:I.IncrementalSnapshot,data:R({source:E.MediaInteraction},U)}),styleSheetRuleCb:U=>J({type:I.IncrementalSnapshot,data:R({source:E.StyleSheetRule},U)}),styleDeclarationCb:U=>J({type:I.IncrementalSnapshot,data:R({source:E.StyleDeclaration},U)}),canvasMutationCb:Oi,fontCb:U=>J({type:I.IncrementalSnapshot,data:R({source:E.Font},U)}),selectionCb:U=>{J({type:I.IncrementalSnapshot,data:R({source:E.Selection},U)})},customElementCb:U=>{J({type:I.IncrementalSnapshot,data:R({source:E.CustomElement},U)})},blockClass:i,ignoreClass:n,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:Le,inlineStylesheet:c,sampling:S,recordDOM:x,recordCanvas:A,inlineImages:ie,userTriggeredOnInput:H,collectFonts:K,win:N,doc:X,maskInputFn:p,maskTextFn:m,keepIframeSrcFn:ye,blockSelector:o,slimDOMOptions:Lr,dataURLOptions:w,mirror:ue,iframeManager:Te,stylesheetManager:De,shadowDomManager:At,processedNodeManager:Br,canvasManager:es,ignoreCSSAttributes:Oe,plugins:((de=O==null?void 0:O.filter(U=>U.observer))==null?void 0:de.map(U=>({observer:U.observer,options:U.options,callback:Ur=>J({type:I.Plugin,data:{plugin:U.name,payload:Ur}})})))||[]},d)};Te.addLoadListener(X=>{try{P.push(le(X.contentDocument))}catch(de){console.warn(de)}});const Z=()=>{ar(),P.push(le(N.document)),Cr=!0};return N.document.readyState==="interactive"||N.document.readyState==="complete"?Z():(P.push(te("DOMContentLoaded",()=>{J({type:I.DomContentLoaded,data:{}}),B==="DOMContentLoaded"&&Z()})),P.push(te("load",()=>{J({type:I.Load,data:{}}),B==="load"&&Z()},N))),()=>{P.forEach(X=>X()),Br.destroy(),Cr=!1,Nd()}}catch(P){console.warn(P)}}Ae.addCustomEvent=(s,e)=>{if(!Cr)throw new Error("please add custom event after start recording");J({type:I.Custom,data:{tag:s,payload:e}})};Ae.freezePage=()=>{_e.forEach(s=>s.freeze())};Ae.takeFullSnapshot=s=>{if(!Cr)throw new Error("please take full snapshot after start recording");ar(s)};Ae.mirror=ue;function Va(s){return{all:s=s||new Map,on:function(e,t){var r=s.get(e);r?r.push(t):s.set(e,[t])},off:function(e,t){var r=s.get(e);r&&(t?r.splice(r.indexOf(t)>>>0,1):s.set(e,[]))},emit:function(e,t){var r=s.get(e);r&&r.slice().map(function(i){i(t)}),(r=s.get("*"))&&r.slice().map(function(i){i(e,t)})}}}const ep=Object.freeze(Object.defineProperty({__proto__:null,default:Va},Symbol.toStringTag,{value:"Module"}));function tp(s=window,e=document){if("scrollBehavior"in e.documentElement.style&&s.__forceSmoothScrollPolyfill__!==!0)return;const t=s.HTMLElement||s.Element,r=468,i={scroll:s.scroll||s.scrollTo,scrollBy:s.scrollBy,elementScroll:t.prototype.scroll||l,scrollIntoView:t.prototype.scrollIntoView},o=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now;function n(y){const S=["MSIE ","Trident/","Edge/"];return new RegExp(S.join("|")).test(y)}const a=n(s.navigator.userAgent)?1:0;function l(y,S){this.scrollLeft=y,this.scrollTop=S}function u(y){return .5*(1-Math.cos(Math.PI*y))}function c(y){if(y===null||typeof y!="object"||y.behavior===void 0||y.behavior==="auto"||y.behavior==="instant")return!0;if(typeof y=="object"&&y.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+y.behavior+" is not a valid value for enumeration ScrollBehavior.")}function h(y,S){if(S==="Y")return y.clientHeight+a<y.scrollHeight;if(S==="X")return y.clientWidth+a<y.scrollWidth}function f(y,S){const w=s.getComputedStyle(y,null)["overflow"+S];return w==="auto"||w==="scroll"}function g(y){const S=h(y,"Y")&&f(y,"Y"),w=h(y,"X")&&f(y,"X");return S||w}function p(y){for(;y!==e.body&&g(y)===!1;)y=y.parentNode||y.host;return y}function m(y){const S=o();let w,v,x,A=(S-y.startTime)/r;A=A>1?1:A,w=u(A),v=y.startX+(y.x-y.startX)*w,x=y.startY+(y.y-y.startY)*w,y.method.call(y.scrollable,v,x),(v!==y.x||x!==y.y)&&s.requestAnimationFrame(m.bind(s,y))}function d(y,S,w){let v,x,A,z;const B=o();y===e.body?(v=s,x=s.scrollX||s.pageXOffset,A=s.scrollY||s.pageYOffset,z=i.scroll):(v=y,x=y.scrollLeft,A=y.scrollTop,z=l),m({scrollable:v,method:z,startTime:B,startX:x,startY:A,x:S,y:w})}s.scroll=s.scrollTo=function(){if(arguments[0]!==void 0){if(c(arguments[0])===!0){i.scroll.call(s,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:s.scrollX||s.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:s.scrollY||s.pageYOffset);return}d.call(s,e.body,arguments[0].left!==void 0?~~arguments[0].left:s.scrollX||s.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:s.scrollY||s.pageYOffset)}},s.scrollBy=function(){if(arguments[0]!==void 0){if(c(arguments[0])){i.scrollBy.call(s,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}d.call(s,e.body,~~arguments[0].left+(s.scrollX||s.pageXOffset),~~arguments[0].top+(s.scrollY||s.pageYOffset))}},t.prototype.scroll=t.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(c(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const y=arguments[0].left,S=arguments[0].top;d.call(this,this,typeof y=="undefined"?this.scrollLeft:~~y,typeof S=="undefined"?this.scrollTop:~~S)},t.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(c(arguments[0])===!0){i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},t.prototype.scrollIntoView=function(){if(c(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const y=p(this),S=y.getBoundingClientRect(),w=this.getBoundingClientRect();y!==e.body?(d.call(this,y,y.scrollLeft+w.left-S.left,y.scrollTop+w.top-S.top),s.getComputedStyle(y).position!=="fixed"&&s.scrollBy({left:S.left,top:S.top,behavior:"smooth"})):s.scrollBy({left:w.left,top:w.top,behavior:"smooth"})}}class rp{constructor(e=[],t){b(this,"timeOffset",0),b(this,"speed"),b(this,"actions"),b(this,"raf",null),b(this,"lastTimestamp"),this.actions=e,this.speed=t.speed}addAction(e){const t=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{const r=this.findActionIndex(e);this.actions.splice(r,0,e)}t&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){const e=performance.now();for(this.timeOffset+=(e-this.lastTimestamp)*this.speed,this.lastTimestamp=e;this.actions.length;){const t=this.actions[0];if(this.timeOffset>=t.delay)this.actions.shift(),t.doAction();else break}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(this.raf!==!0&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return this.raf!==null}findActionIndex(e){let t=0,r=this.actions.length-1;for(;t<=r;){const i=Math.floor((t+r)/2);if(this.actions[i].delay<e.delay)t=i+1;else if(this.actions[i].delay>e.delay)r=i-1;else return i+1}return t}}function Ln(s,e){if(s.type===I.IncrementalSnapshot&&s.data.source===E.MouseMove&&s.data.positions&&s.data.positions.length){const t=s.data.positions[0].timeOffset,r=s.timestamp+t;return s.delay=r-e,r-e}return s.delay=s.timestamp-e,s.delay}/*! *****************************************************************************
67
+ or you can use record.mirror to access the mirror instance during recording.`;exports.mirror={map:{},getId(){return console.error(We),-1},getNode(){return console.error(We),null},removeNodeFromMap(){console.error(We)},has(){return console.error(We),!1},reset(){console.error(We)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(exports.mirror=new Proxy(exports.mirror,{get(s,e,t){return e==="map"&&console.error(We),Reflect.get(s,e,t)}}));function tt(s,e,t={}){let r=null,i=0;return function(...o){const n=Date.now();!i&&t.leading===!1&&(i=n);const a=e-(n-i),l=this;a<=0||a>e?(r&&(clearTimeout(r),r=null),i=n,s.apply(l,o)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{i=t.leading===!1?0:Date.now(),r=null,s.apply(l,o)},a))}}function Mt(s,e,t,r,i=window){const o=i.Object.getOwnPropertyDescriptor(s,e);return i.Object.defineProperty(s,e,r?t:{set(n){setTimeout(()=>{t.set.call(this,n)},0),o&&o.set&&o.set.call(this,n)}}),()=>Mt(s,e,o||{},!0)}function Pe(s,e,t){try{if(!(e in s))return()=>{};const r=s[e],i=t(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),s[e]=i,()=>{s[e]=r}}catch(r){return()=>{}}}let vt=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(vt=()=>new Date().getTime());function mi(s){var e,t,r,i;const o=s.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:o.documentElement.scrollLeft||(o==null?void 0:o.body)&&((e=D.parentElement(o.body))==null?void 0:e.scrollLeft)||((t=o==null?void 0:o.body)==null?void 0:t.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:(o==null?void 0:o.documentElement.scrollTop)||(o==null?void 0:o.body)&&((r=D.parentElement(o.body))==null?void 0:r.scrollTop)||((i=o==null?void 0:o.body)==null?void 0:i.scrollTop)||0}}function gi(s){return s.innerHeight||s.document.documentElement&&s.document.documentElement.clientHeight||s.document.body&&s.document.body.clientHeight}function yi(s){return s.innerWidth||s.document.documentElement&&s.document.documentElement.clientWidth||s.document.body&&s.document.body.clientWidth}function wi(s){return s?s.nodeType===s.ELEMENT_NODE?s:D.parentElement(s):null}function re(s,e,t,r){if(!s)return!1;const i=wi(s);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(ur(i,e,r))return!0}catch(o){}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function Oa(s,e){return e.getId(s)!==-1}function nr(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===ft}function bi(s,e){if(lt(s))return!1;const t=e.getId(s);if(!e.has(t))return!0;const r=D.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?bi(r,e):!0}function Sr(s){return!!s.changedTouches}function Si(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function Da(s){const e={},t=(i,o)=>{const n={value:i,parent:o,children:[]};return e[i.node.id]=n,n},r=[];for(const i of s){const{nextId:o,parentId:n}=i;if(o&&o in e){const a=e[o];if(a.parent){const l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,t(i,a.parent))}else{const l=r.indexOf(a);r.splice(l,0,t(i,null))}continue}if(n in e){const a=e[n];a.children.push(t(i,a));continue}r.push(t(i,null))}return r}function vi(s,e){e(s.value);for(let t=s.children.length-1;t>=0;t--)vi(s.children[t],e)}function Ze(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function Ci(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function Ei(s,e){var t,r;const i=(r=(t=s.ownerDocument)==null?void 0:t.defaultView)==null?void 0:r.frameElement;if(!i||i===e)return{x:0,y:0,relativeScale:1,absoluteScale:1};const o=i.getBoundingClientRect(),n=Ei(i,e),a=o.height/i.clientHeight;return{x:o.x*n.relativeScale+n.x,y:o.y*n.relativeScale+n.y,relativeScale:a,absoluteScale:n.absoluteScale*a}}function Ie(s){return s?s instanceof fe&&"shadowRoot"in s?!!s.shadowRoot:!!D.shadowRoot(s):!1}function je(s,e){const t=s[e[0]];return e.length===1?t:je(t.cssRules[e[1]].cssRules,e.slice(2))}function Ps(s){const e=[...s],t=e.pop();return{positions:e,index:t}}function Ta(s){const e=new Set,t=[];for(let r=s.length;r--;){const i=s[r];e.has(i.id)||(t.push(i),e.add(i.id))}return t}class Ii{constructor(){b(this,"id",1),b(this,"styleIDMap",new WeakMap),b(this,"idStyleMap",new Map)}getId(e){var t;return(t=this.styleIDMap.get(e))!=null?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return t===void 0?r=this.id++:r=t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function xi(s){var e;let t=null;return"getRootNode"in s&&((e=D.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&D.host(D.getRootNode(s))&&(t=D.host(D.getRootNode(s))),t}function _a(s){let e=s,t;for(;t=xi(e);)e=t;return e}function ka(s){const e=s.ownerDocument;if(!e)return!1;const t=_a(s);return D.contains(e,t)}function Mi(s){const e=s.ownerDocument;return e?D.contains(e,s)||ka(s):!1}const Cd=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:Ii,get _mirror(){return exports.mirror},closestElementOfNode:wi,getBaseDimension:Ei,getNestedRule:je,getPositionsAndIndex:Ps,getRootShadowHost:_a,getShadowHost:xi,getWindowHeight:gi,getWindowScroll:mi,getWindowWidth:yi,hasShadowRoot:Ie,hookSetter:Mt,inDom:Mi,isAncestorRemoved:bi,isBlocked:re,isIgnored:nr,isSerialized:Oa,isSerializedIframe:Ze,isSerializedStylesheet:Ci,iterateResolveTree:vi,legacy_isTouchEvent:Sr,get nowTimestamp(){return vt},on:te,patch:Pe,polyfill:Si,queueToResolveTrees:Da,shadowHostInDom:ka,throttle:tt,uniqueTextMutations:Ta},Symbol.toStringTag,{value:"Module"}));var I=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(I||{}),E=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(E||{}),$=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))($||{}),we=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(we||{}),ve=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(ve||{}),Ee=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(Ee||{}),k=(s=>(s.Start="start",s.Pause="pause",s.Resume="resume",s.Resize="resize",s.Finish="finish",s.FullsnapshotRebuilded="fullsnapshot-rebuilded",s.LoadStylesheetStart="load-stylesheet-start",s.LoadStylesheetEnd="load-stylesheet-end",s.SkipStart="skip-start",s.SkipEnd="skip-end",s.MouseInteraction="mouse-interaction",s.EventCast="event-cast",s.CustomEvent="custom-event",s.Flush="flush",s.StateChange="state-change",s.PlayBack="play-back",s.Destroy="destroy",s))(k||{});function Nn(s){return"__ln"in s}class Ed{constructor(){b(this,"length",0),b(this,"head",null),b(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(t==null?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Nn(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Nn(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const Rn=(s,e)=>`${s}@${e}`;class Id{constructor(){b(this,"frozen",!1),b(this,"locked",!1),b(this,"texts",[]),b(this,"attributes",[]),b(this,"attributeMap",new WeakMap),b(this,"removes",[]),b(this,"mapRemoves",[]),b(this,"movedMap",{}),b(this,"addedSet",new Set),b(this,"movedSet",new Set),b(this,"droppedSet",new Set),b(this,"mutationCb"),b(this,"blockClass"),b(this,"blockSelector"),b(this,"maskTextClass"),b(this,"maskTextSelector"),b(this,"inlineStylesheet"),b(this,"maskInputOptions"),b(this,"maskTextFn"),b(this,"maskInputFn"),b(this,"keepIframeSrcFn"),b(this,"recordCanvas"),b(this,"inlineImages"),b(this,"slimDOMOptions"),b(this,"dataURLOptions"),b(this,"doc"),b(this,"mirror"),b(this,"iframeManager"),b(this,"stylesheetManager"),b(this,"shadowDomManager"),b(this,"canvasManager"),b(this,"processedNodeManager"),b(this,"unattachedDoc"),b(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),b(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new Ed,i=l=>{let u=l,c=ft;for(;c===ft;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},o=l=>{const u=D.parentNode(l);if(!u||!Mi(l))return;let c=!1;if(l.nodeType===Node.TEXT_NODE){const p=u.tagName;if(p==="TEXTAREA")return;p==="STYLE"&&this.addedSet.has(u)&&(c=!0)}const h=lt(u)?this.mirror.getId(xi(l)):this.mirror.getId(u),f=i(l);if(h===-1||f===-1)return r.addNode(l);const g=Ge(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,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:p=>{Ze(p,this.mirror)&&this.iframeManager.addIframe(p),Ci(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),Ie(l)&&this.shadowDomManager.addShadowRoot(D.shadowRoot(l),this.doc)},onIframeLoad:(p,m)=>{this.iframeManager.attachIframe(p,m),this.shadowDomManager.observeAttachShadow(p)},onStylesheetLoad:(p,m)=>{this.stylesheetManager.attachLinkElement(p,m)},cssCaptured:c});g&&(e.push({parentId:h,nextId:f,node:g}),t.add(g.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of this.movedSet)An(this.removes,l,this.mirror)&&!this.movedSet.has(D.parentNode(l))||o(l);for(const l of this.addedSet)!On(this.droppedSet,l)&&!An(this.removes,l,this.mirror)||On(this.movedSet,l)?o(l):this.droppedSet.add(l);let n=null;for(;r.length;){let l=null;if(n){const u=this.mirror.getId(D.parentNode(n.value)),c=i(n.value);u!==-1&&c!==-1&&(l=n)}if(!l){let u=r.tail;for(;u;){const c=u;if(u=u.previous,c){const h=this.mirror.getId(D.parentNode(c.value));if(i(c.value)===-1)continue;if(h!==-1){l=c;break}else{const g=c.value,p=D.parentNode(g);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const m=D.host(p);if(this.mirror.getId(m)!==-1){l=c;break}}}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}n=l.previous,r.removeNode(l.value),o(l.value)}const a={texts:this.texts.map(l=>{const u=l.node,c=D.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:l.value}}).filter(l=>!t.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{const{attributes:u}=l;if(typeof u.style=="string"){const c=JSON.stringify(l.styleDiff),h=JSON.stringify(l._unchangedStyles);c.length<u.style.length&&(c+h).split("var(").length===u.style.split("var(").length&&(u.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:u}}).filter(l=>!t.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:e};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.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.movedMap={},this.mutationCb(a))}),b(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(D.childNodes(e),r=>D.textContent(r)||"").join("")}),b(this,"processMutation",e=>{if(!nr(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=D.textContent(e.target);!re(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:qn(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,wi(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){const n=Vs(t);i=zs({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:n,value:i,maskInputFn:this.maskInputFn})}if(re(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let o=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!Qn(t.tagName,r))if(o.attributes[r]=Kn(this.doc,Me(t.tagName),Me(r),i),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(a){this.unattachedDoc=this.doc}const n=this.unattachedDoc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue);for(const a of Array.from(t.style)){const l=t.style.getPropertyValue(a),u=t.style.getPropertyPriority(a);l!==n.style.getPropertyValue(a)||u!==n.style.getPropertyPriority(a)?u===""?o.styleDiff[a]=l:o.styleDiff[a]=[l,u]:o._unchangedStyles[a]=[l,u]}for(const a of Array.from(n.style))t.style.getPropertyValue(a)===""&&(o.styleDiff[a]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":{if(re(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const r=this.mirror.getId(t),i=lt(e.target)?this.mirror.getId(D.host(e.target)):this.mirror.getId(e.target);re(e.target,this.blockClass,this.blockSelector,!1)||nr(t,this.mirror,this.slimDOMOptions)||!Oa(t,this.mirror)||(this.addedSet.has(t)?(Ls(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||bi(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Rn(r,i)]?Ls(this.movedSet,t):this.removes.push({parentId:i,id:r,isShadow:lt(e.target)&&ut(e.target)?!0:void 0})),this.mapRemoves.push(t))});break}}}),b(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(nr(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[Rn(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);re(e,this.blockClass,this.blockSelector,!1)||(D.childNodes(e).forEach(r=>this.genAdds(r)),Ie(e)&&D.childNodes(D.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Ls(s,e){s.delete(e),D.childNodes(e).forEach(t=>Ls(s,t))}function An(s,e,t){return s.length===0?!1:xd(s,e,t)}function xd(s,e,t){let r=D.parentNode(e);for(;r;){const i=t.getId(r);if(s.some(o=>o.id===i))return!0;r=D.parentNode(r)}return!1}function On(s,e){return s.size===0?!1:$a(s,e)}function $a(s,e){const t=D.parentNode(e);return t?s.has(t)?!0:$a(s,t):!1}let ht;function Md(s){ht=s}function Nd(){ht=void 0}const _=s=>ht?(...t)=>{try{return s(...t)}catch(r){if(ht&&ht(r)===!0)return;throw r}}:s,_e=[];function Nt(s){try{if("composedPath"in s){const e=s.composedPath();if(e.length)return e[0]}else if("path"in s&&s.path.length)return s.path[0]}catch(e){}return s&&s.target}function Pa(s,e){const t=new Id;_e.push(t),t.init(s);const r=new(Aa())(_(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function Rd({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};const i=typeof e.mousemove=="number"?e.mousemove:50,o=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let n=[],a;const l=tt(_(h=>{const f=Date.now()-a;s(n.map(g=>(g.timeOffset-=f,g)),h),n=[],a=null}),o),u=_(tt(_(h=>{const f=Nt(h),{clientX:g,clientY:p}=Sr(h)?h.changedTouches[0]:h;a||(a=vt()),n.push({x:g,y:p,id:r.getId(f),timeOffset:vt()-a}),l(typeof DragEvent!="undefined"&&h instanceof DragEvent?E.Drag:h instanceof MouseEvent?E.MouseMove:E.TouchMove)}),i,{trailing:!1})),c=[te("mousemove",u,t),te("touchmove",u,t),te("drag",u,t)];return _(()=>{c.forEach(h=>h())})}function Ad({mouseInteractionCb:s,doc:e,win:t,mirror:r,blockClass:i,blockSelector:o,sampling:n}){if(n.mouseInteraction===!1)return()=>{};const a=n.mouseInteraction===!0||n.mouseInteraction===void 0?{}:n.mouseInteraction,l=[];let u=null;const c=h=>f=>{const g=Nt(f);if(re(g,i,o,!0))return;let p=null,m=h;if("pointerType"in f){switch(f.pointerType){case"mouse":p=we.Mouse;break;case"touch":p=we.Touch;break;case"pen":p=we.Pen;break}p===we.Touch?$[h]===$.MouseDown?m="TouchStart":$[h]===$.MouseUp&&(m="TouchEnd"):we.Pen}else Sr(f)&&(p=we.Touch);p!==null?(u=p,(m.startsWith("Touch")&&p===we.Touch||m.startsWith("Mouse")&&p===we.Mouse)&&(p=null)):$[h]===$.Click&&(p=u,u=null);const d=Sr(f)?f.changedTouches[0]:f;if(!d)return;const y=r.getId(g),{clientX:S,clientY:w}=d;_(s)(R({type:$[m],id:y,x:S,y:w},p!==null&&{pointerType:p}))};return Object.keys($).filter(h=>Number.isNaN(Number(h))&&!h.endsWith("_Departed")&&a[h]!==!1).forEach(h=>{let f=Me(h);const g=c(h);if(t.PointerEvent)switch($[h]){case $.MouseDown:case $.MouseUp:f=f.replace("mouse","pointer");break;case $.TouchStart:case $.TouchEnd:return}l.push(te(f,g,e))}),_(()=>{l.forEach(h=>h())})}function La({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:o}){const n=_(tt(_(a=>{const l=Nt(a);if(!l||re(l,r,i,!0))return;const u=t.getId(l);if(l===e&&e.defaultView){const c=mi(e.defaultView);s({id:u,x:c.left,y:c.top})}else s({id:u,x:l.scrollLeft,y:l.scrollTop})}),o.scroll||100));return te("scroll",n,e)}function Od({viewportResizeCb:s,win:e},{win:t}){let r=-1,i=-1;const o=_(tt(_(()=>{const n=gi(e),a=yi(e);(r!==n||i!==a)&&(s({width:Number(a),height:Number(n)}),r=n,i=a)}),200));return te("resize",o,t)}const Dd=["INPUT","TEXTAREA","SELECT"],Dn=new WeakMap;function Td({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:o,ignoreSelector:n,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function h(S){let w=Nt(S);const v=S.isTrusted,x=w&&w.tagName;if(w&&x==="OPTION"&&(w=D.parentElement(w)),!w||!x||Dd.indexOf(x)<0||re(w,r,i,!0)||w.classList.contains(o)||n&&w.matches(n))return;let A=w.value,z=!1;const B=Vs(w)||"";B==="radio"||B==="checkbox"?z=w.checked:(a[x.toLowerCase()]||a[B])&&(A=zs({element:w,maskInputOptions:a,tagName:x,type:B,value:A,maskInputFn:l})),f(w,c?{text:A,isChecked:z,userTriggered:v}:{text:A,isChecked:z});const H=w.name;B==="radio"&&H&&z&&e.querySelectorAll(`input[type="radio"][name="${H}"]`).forEach(K=>{if(K!==w){const ie=K.value;f(K,c?{text:ie,isChecked:!z,userTriggered:!1}:{text:ie,isChecked:!z})}})}function f(S,w){const v=Dn.get(S);if(!v||v.text!==w.text||v.isChecked!==w.isChecked){Dn.set(S,w);const x=t.getId(S);_(s)(q(R({},w),{id:x}))}}const p=(u.input==="last"?["change"]:["input","change"]).map(S=>te(S,_(h),e)),m=e.defaultView;if(!m)return()=>{p.forEach(S=>S())};const d=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),y=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return d&&d.set&&p.push(...y.map(S=>Mt(S[0],S[1],{set(){_(h)({target:this,isTrusted:!1})}},!1,m))),_(()=>{p.forEach(S=>S())})}function vr(s,e){const t=[];function r(i,o){if(Kt(s,"CSSGroupingRule")&&i.parentRule instanceof CSSGroupingRule||Kt(s,"CSSMediaRule")&&i.parentRule instanceof CSSMediaRule||Kt(s,"CSSSupportsRule")&&i.parentRule instanceof CSSSupportsRule||Kt(s,"CSSConditionRule")&&i.parentRule instanceof CSSConditionRule){const a=Array.from(i.parentRule.cssRules).indexOf(i);o.unshift(a)}else if(i.parentStyleSheet){const a=Array.from(i.parentStyleSheet.cssRules).indexOf(i);o.unshift(a)}return o}return r(e,t)}function Ce(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function _d({styleSheetRuleCb:s,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:_((c,h,f)=>{const[g,p]=f,{id:m,styleId:d}=Ce(h,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,adds:[{rule:g,index:p}]}),c.apply(h,f)})}),r.CSSStyleSheet.prototype.addRule=function(c,h,f=this.cssRules.length){const g=`${c} { ${h} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[g,f])};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:_((c,h,f)=>{const[g]=f,{id:p,styleId:m}=Ce(h,e,t.styleMirror);return(p&&p!==-1||m&&m!==-1)&&s({id:p,styleId:m,removes:[{index:g}]}),c.apply(h,f)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let n;r.CSSStyleSheet.prototype.replace&&(n=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(n,{apply:_((c,h,f)=>{const[g]=f,{id:p,styleId:m}=Ce(h,e,t.styleMirror);return(p&&p!==-1||m&&m!==-1)&&s({id:p,styleId:m,replace:g}),c.apply(h,f)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:_((c,h,f)=>{const[g]=f,{id:p,styleId:m}=Ce(h,e,t.styleMirror);return(p&&p!==-1||m&&m!==-1)&&s({id:p,styleId:m,replaceSync:g}),c.apply(h,f)})}));const l={};Qt(r,"CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(Qt(r,"CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),Qt(r,"CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),Qt(r,"CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(l).forEach(([c,h])=>{u[c]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(u[c].insertRule,{apply:_((f,g,p)=>{const[m,d]=p,{id:y,styleId:S}=Ce(g.parentStyleSheet,e,t.styleMirror);return(y&&y!==-1||S&&S!==-1)&&s({id:y,styleId:S,adds:[{rule:m,index:[...vr(r,g),d||0]}]}),f.apply(g,p)})}),h.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:_((f,g,p)=>{const[m]=p,{id:d,styleId:y}=Ce(g.parentStyleSheet,e,t.styleMirror);return(d&&d!==-1||y&&y!==-1)&&s({id:d,styleId:y,removes:[{index:[...vr(r,g),m]}]}),f.apply(g,p)})})}),_(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=o,n&&(r.CSSStyleSheet.prototype.replace=n),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([c,h])=>{h.prototype.insertRule=u[c].insertRule,h.prototype.deleteRule=u[c].deleteRule})})}function Fa({mirror:s,stylesheetManager:e},t){var r,i,o;let n=null;t.nodeName==="#document"?n=s.getId(t):n=s.getId(D.host(t));const a=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(o=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:o.ShadowRoot,l=a!=null&&a.prototype?Object.getOwnPropertyDescriptor(a==null?void 0:a.prototype,"adoptedStyleSheets"):void 0;return n===null||n===-1||!a||!l?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var u;return(u=l.get)==null?void 0:u.call(this)},set(u){var c;const h=(c=l.set)==null?void 0:c.call(this,u);if(n!==null&&n!==-1)try{e.adoptStyleSheets(u,n)}catch(f){}return h}}),_(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function kd({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:_((a,l,u)=>{var c;const[h,f,g]=u;if(t.has(h))return o.apply(l,[h,f,g]);const{id:p,styleId:m}=Ce((c=l.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(p&&p!==-1||m&&m!==-1)&&s({id:p,styleId:m,set:{property:h,value:f,priority:g},index:vr(i,l.parentRule)}),a.apply(l,u)})});const n=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(n,{apply:_((a,l,u)=>{var c;const[h]=u;if(t.has(h))return n.apply(l,[h]);const{id:f,styleId:g}=Ce((c=l.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(f&&f!==-1||g&&g!==-1)&&s({id:f,styleId:g,remove:{property:h},index:vr(i,l.parentRule)}),a.apply(l,u)})}),_(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=n})}function $d({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:o}){const n=_(l=>tt(_(u=>{const c=Nt(u);if(!c||re(c,e,t,!0))return;const{currentTime:h,volume:f,muted:g,playbackRate:p,loop:m}=c;s({type:l,id:r.getId(c),currentTime:h,volume:f,muted:g,playbackRate:p,loop:m})}),i.media||500)),a=[te("play",n(Ee.Play),o),te("pause",n(Ee.Pause),o),te("seeked",n(Ee.Seeked),o),te("volumechange",n(Ee.VolumeChange),o),te("ratechange",n(Ee.RateChange),o)];return _(()=>{a.forEach(l=>l())})}function Pd({fontCb:s,doc:e}){const t=e.defaultView;if(!t)return()=>{};const r=[],i=new WeakMap,o=t.FontFace;t.FontFace=function(l,u,c){const h=new o(l,u,c);return i.set(h,{family:l,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),h};const n=Pe(e.fonts,"add",function(a){return function(l){return setTimeout(_(()=>{const u=i.get(l);u&&(s(u),i.delete(l))}),0),a.apply(this,[l])}});return r.push(()=>{t.FontFace=o}),r.push(n),_(()=>{r.forEach(a=>a())})}function Ld(s){const{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:o}=s;let n=!0;const a=_(()=>{const l=e.getSelection();if(!l||n&&(l!=null&&l.isCollapsed))return;n=l.isCollapsed||!1;const u=[],c=l.rangeCount||0;for(let h=0;h<c;h++){const f=l.getRangeAt(h),{startContainer:g,startOffset:p,endContainer:m,endOffset:d}=f;re(g,r,i,!0)||re(m,r,i,!0)||u.push({start:t.getId(g),startOffset:p,end:t.getId(m),endOffset:d})}o({ranges:u})});return a(),te("selectionchange",a)}function Fd({doc:s,customElementCb:e}){const t=s.defaultView;return!t||!t.customElements?()=>{}:Pe(t.customElements,"define",function(i){return function(o,n,a){try{e({define:{name:o}})}catch(l){console.warn(`Custom element callback failed for ${o}`)}return i.apply(this,[o,n,a])}})}function Bd(s,e){const{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:n,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,fontCb:f,selectionCb:g,customElementCb:p}=s;s.mutationCb=(...m)=>{e.mutation&&e.mutation(...m),t(...m)},s.mousemoveCb=(...m)=>{e.mousemove&&e.mousemove(...m),r(...m)},s.mouseInteractionCb=(...m)=>{e.mouseInteraction&&e.mouseInteraction(...m),i(...m)},s.scrollCb=(...m)=>{e.scroll&&e.scroll(...m),o(...m)},s.viewportResizeCb=(...m)=>{e.viewportResize&&e.viewportResize(...m),n(...m)},s.inputCb=(...m)=>{e.input&&e.input(...m),a(...m)},s.mediaInteractionCb=(...m)=>{e.mediaInteaction&&e.mediaInteaction(...m),l(...m)},s.styleSheetRuleCb=(...m)=>{e.styleSheetRule&&e.styleSheetRule(...m),u(...m)},s.styleDeclarationCb=(...m)=>{e.styleDeclaration&&e.styleDeclaration(...m),c(...m)},s.canvasMutationCb=(...m)=>{e.canvasMutation&&e.canvasMutation(...m),h(...m)},s.fontCb=(...m)=>{e.font&&e.font(...m),f(...m)},s.selectionCb=(...m)=>{e.selection&&e.selection(...m),g(...m)},s.customElementCb=(...m)=>{e.customElement&&e.customElement(...m),p(...m)}}function Ud(s,e={}){const t=s.doc.defaultView;if(!t)return()=>{};Bd(s,e);let r;s.recordDOM&&(r=Pa(s,s.doc));const i=Rd(s),o=Ad(s),n=La(s),a=Od(s,{win:t}),l=Td(s),u=$d(s);let c=()=>{},h=()=>{},f=()=>{},g=()=>{};s.recordDOM&&(c=_d(s,{win:t}),h=Fa(s,s.doc),f=kd(s,{win:t}),s.collectFonts&&(g=Pd(s)));const p=Ld(s),m=Fd(s),d=[];for(const y of s.plugins)d.push(y.observer(y.callback,t,y.options));return _(()=>{_e.forEach(y=>y.reset()),r==null||r.disconnect(),i(),o(),n(),a(),l(),u(),c(),h(),f(),g(),p(),m(),d.forEach(y=>y())})}function Kt(s,e){return typeof s[e]!="undefined"}function Qt(s,e){return!!(typeof s[e]!="undefined"&&s[e].prototype&&"insertRule"in s[e].prototype&&"deleteRule"in s[e].prototype)}class Tn{constructor(e){b(this,"iframeIdToRemoteIdMap",new WeakMap),b(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){const o=r||this.getIdToRemoteIdMap(e),n=i||this.getRemoteIdToIdMap(e);let a=o.get(t);return a||(a=this.generateIdFn(),o.set(t,a),n.set(a,t)),a}getIds(e,t){const r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(o=>this.getId(e,o,r,i))}getRemoteId(e,t,r){const i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;const o=i.get(t);return o||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Wd{constructor(e){b(this,"iframes",new WeakMap),b(this,"crossOriginIframeMap",new WeakMap),b(this,"crossOriginIframeMirror",new Tn(Jn)),b(this,"crossOriginIframeStyleMirror"),b(this,"crossOriginIframeRootIdMap",new WeakMap),b(this,"mirror"),b(this,"mutationCb"),b(this,"wrappedEmit"),b(this,"loadListener"),b(this,"stylesheetManager"),b(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Tn(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;const i=this.crossOriginIframeMap.get(e.source);if(!i)return;const o=this.transformCrossOriginEvent(i,t.data.event);o&&this.wrappedEmit(o,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case I.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:I.IncrementalSnapshot,data:{source:E.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case I.Meta:case I.Load:case I.DomContentLoaded:return!1;case I.Plugin:return t;case I.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case I.IncrementalSnapshot:switch(t.data.source){case E.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);const o=this.crossOriginIframeRootIdMap.get(e);o&&this.patchRootIdOnNode(i.node,o)}),t.data.removes.forEach(i=>{this.replaceIds(i,e,["parentId","id"])}),t.data.attributes.forEach(i=>{this.replaceIds(i,e,["id"])}),t.data.texts.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case E.Drag:case E.TouchMove:case E.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case E.ViewportResize:return!1;case E.MediaInteraction:case E.MouseInteraction:case E.Scroll:case E.CanvasMutation:case E.Input:return this.replaceIds(t.data,e,["id"]),t;case E.StyleSheetRule:case E.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case E.Font:return t;case E.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case E.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,e,["styleId"])}),t}}return!1}replace(e,t,r,i){for(const o of i)!Array.isArray(t[o])&&typeof t[o]!="number"||(Array.isArray(t[o])?t[o]=e.getIds(r,t[o]):t[o]=e.getId(r,t[o]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==M.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}}class zd{constructor(e){b(this,"shadowDoms",new WeakSet),b(this,"mutationCb"),b(this,"scrollCb"),b(this,"bypassOptions"),b(this,"mirror"),b(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!ut(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=Pa(q(R({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(La(q(R({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(D.host(e))),this.restoreHandlers.push(Fa({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const r=this;this.restoreHandlers.push(Pe(e.prototype,"attachShadow",function(i){return function(o){const n=i.call(this,o),a=D.shadowRoot(this);return a&&Mi(this)&&r.addShadowRoot(a,t),n}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var Ye="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",at=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var qt=0;qt<Ye.length;qt++)at[Ye.charCodeAt(qt)]=qt;var Vd=function(s){var e=new Uint8Array(s),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=Ye[e[t]>>2],i+=Ye[(e[t]&3)<<4|e[t+1]>>4],i+=Ye[(e[t+1]&15)<<2|e[t+2]>>6],i+=Ye[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i},Gd=function(s){var e=s.length*.75,t=s.length,r,i=0,o,n,a,l;s[s.length-1]==="="&&(e--,s[s.length-2]==="="&&e--);var u=new ArrayBuffer(e),c=new Uint8Array(u);for(r=0;r<t;r+=4)o=at[s.charCodeAt(r)],n=at[s.charCodeAt(r+1)],a=at[s.charCodeAt(r+2)],l=at[s.charCodeAt(r+3)],c[i++]=o<<2|n>>4,c[i++]=(n&15)<<4|a>>2,c[i++]=(a&3)<<6|l&63;return u};const _n=new Map;function jd(s,e){let t=_n.get(s);return t||(t=new Map,_n.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}const Ba=(s,e,t)=>{if(!s||!(Wa(s,e)||typeof s=="object"))return;const r=s.constructor.name,i=jd(t,r);let o=i.indexOf(s);return o===-1&&(o=i.length,i.push(s)),o};function or(s,e,t){if(s instanceof Array)return s.map(r=>or(r,e,t));if(s===null)return s;if(s instanceof Float32Array||s instanceof Float64Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Uint8Array||s instanceof Uint16Array||s instanceof Int16Array||s instanceof Int8Array||s instanceof Uint8ClampedArray)return{rr_type:s.constructor.name,args:[Object.values(s)]};if(s instanceof ArrayBuffer){const r=s.constructor.name,i=Vd(s);return{rr_type:r,base64:i}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[or(s.buffer,e,t),s.byteOffset,s.byteLength]};if(s instanceof HTMLImageElement){const r=s.constructor.name,{src:i}=s;return{rr_type:r,src:i}}else if(s instanceof HTMLCanvasElement){const r="HTMLImageElement",i=s.toDataURL();return{rr_type:r,src:i}}else{if(s instanceof ImageData)return{rr_type:s.constructor.name,args:[or(s.data,e,t),s.width,s.height]};if(Wa(s,e)||typeof s=="object"){const r=s.constructor.name,i=Ba(s,e,t);return{rr_type:r,index:i}}}}return s}const Ua=(s,e,t)=>s.map(r=>or(r,e,t)),Wa=(s,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>s instanceof e[i]);function Yd(s,e,t,r){const i=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const n of o)try{if(typeof e.CanvasRenderingContext2D.prototype[n]!="function")continue;const a=Pe(e.CanvasRenderingContext2D.prototype,n,function(l){return function(...u){return re(this.canvas,t,r,!0)||setTimeout(()=>{const c=Ua(u,e,this);s(this.canvas,{type:ve["2D"],property:n,args:c})},0),l.apply(this,u)}});i.push(a)}catch(a){const l=Mt(e.CanvasRenderingContext2D.prototype,n,{set(u){s(this.canvas,{type:ve["2D"],property:n,args:[u],setter:!0})}});i.push(l)}return()=>{i.forEach(n=>n())}}function Hd(s){return s==="experimental-webgl"?"webgl":s}function kn(s,e,t,r){const i=[];try{const o=Pe(s.HTMLCanvasElement.prototype,"getContext",function(n){return function(a,...l){if(!re(this,e,t,!0)){const u=Hd(a);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(l[0]&&typeof l[0]=="object"){const c=l[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return n.apply(this,[a,...l])}});i.push(o)}catch(o){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(o=>o())}}function $n(s,e,t,r,i,o){const n=[],a=Object.getOwnPropertyNames(s);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof s[l]!="function")continue;const u=Pe(s,l,function(c){return function(...h){const f=c.apply(this,h);if(Ba(f,o,this),"tagName"in this.canvas&&!re(this.canvas,r,i,!0)){const g=Ua(h,o,this),p={type:e,property:l,args:g};t(this.canvas,p)}return f}});n.push(u)}catch(u){const c=Mt(s,l,{set(h){t(this.canvas,{type:e,property:l,args:[h],setter:!0})}});n.push(c)}return n}function Zd(s,e,t,r){const i=[];return i.push(...$n(e.WebGLRenderingContext.prototype,ve.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext!="undefined"&&i.push(...$n(e.WebGL2RenderingContext.prototype,ve.WebGL2,s,t,r,e)),()=>{i.forEach(o=>o())}}const za="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Xd=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),Pn=typeof window!="undefined"&&window.Blob&&new Blob([Xd(za)],{type:"text/javascript;charset=utf-8"});function Jd(s){let e;try{if(e=Pn&&(window.URL||window.webkitURL).createObjectURL(Pn),!e)throw"";const t=new Worker(e,{name:s==null?void 0:s.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch(t){return new Worker("data:text/javascript;base64,"+za,{name:s==null?void 0:s.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Kd{constructor(e){b(this,"pendingCanvasMutations",new Map),b(this,"rafStamps",{latestId:0,invokeId:null}),b(this,"mirror"),b(this,"mutationCb"),b(this,"resetObservers"),b(this,"frozen",!1),b(this,"locked",!1),b(this,"processMutation",(l,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(u)});const{sampling:t="all",win:r,blockClass:i,blockSelector:o,recordCanvas:n,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,n&&t==="all"&&this.initCanvasMutationObserver(r,i,o),n&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,i,o,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,i,o){const n=kn(t,r,i,!0),a=new Map,l=new Jd;l.onmessage=p=>{const{id:m}=p.data;if(a.set(m,!1),!("base64"in p.data))return;const{base64:d,type:y,width:S,height:w}=p.data;this.mutationCb({id:m,type:ve["2D"],commands:[{property:"clearRect",args:[0,0,S,w]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:d}],type:y}]},0,0]}]})};const u=1e3/e;let c=0,h;const f=()=>{const p=[];return t.document.querySelectorAll("canvas").forEach(m=>{re(m,r,i,!0)||p.push(m)}),p},g=p=>{if(c&&p-c<u){h=requestAnimationFrame(g);return}c=p,f().forEach(async m=>{var d;const y=this.mirror.getId(m);if(a.get(y)||m.width===0||m.height===0)return;if(a.set(y,!0),["webgl","webgl2"].includes(m.__context)){const w=m.getContext(m.__context);((d=w==null?void 0:w.getContextAttributes())==null?void 0:d.preserveDrawingBuffer)===!1&&w.clear(w.COLOR_BUFFER_BIT)}const S=await createImageBitmap(m);l.postMessage({id:y,bitmap:S,width:m.width,height:m.height,dataURLOptions:o.dataURLOptions},[S])}),h=requestAnimationFrame(g)};h=requestAnimationFrame(g),this.resetObservers=()=>{n(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=kn(e,t,r,!1),o=Yd(this.processMutation.bind(this),e,t,r),n=Zd(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),o(),n()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||t===-1)return;const i=r.map(n=>{const u=n,{type:a}=u;return Fe(u,["type"])}),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:i}),this.pendingCanvasMutations.delete(e)}}class Qd{constructor(e){b(this,"trackedLinkElements",new WeakSet),b(this,"mutationCb"),b(this,"adoptedStyleSheetCb"),b(this,"styleMirror",new Ii),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;const r={id:t,styleIds:[]},i=[];for(const o of e){let n;this.styleMirror.has(o)?n=this.styleMirror.getId(o):(n=this.styleMirror.add(o),i.push({styleId:n,rules:Array.from(o.rules||CSSRule,(a,l)=>({rule:Hn(a,o.href),index:l}))})),r.styleIds.push(n)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class qd{constructor(){b(this,"nodeMap",new WeakMap),b(this,"active",!1)}inOtherBuffer(e,t){const r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let J,ar,es,Cr=!1;try{if(Array.from([1],s=>s*2)[0]!==2){const s=document.createElement("iframe");document.body.appendChild(s),Array.from=((ki=s.contentWindow)==null?void 0:ki.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}const ue=Zn();function Ae(s={}){const{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:n="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:f,slimDOMOptions:g,maskInputFn:p,maskTextFn:m,hooks:d,packFn:y,sampling:S={},dataURLOptions:w={},mousemoveWait:v,recordDOM:x=!0,recordCanvas:A=!1,recordCrossOriginIframes:z=!1,recordAfter:B=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",userTriggeredOnInput:H=!1,collectFonts:K=!1,inlineImages:ie=!1,win:ae=window,plugins:O,keepIframeSrcFn:ye=()=>!1,ignoreCSSAttributes:Oe=new Set([]),errorHandler:Q}=s,N=ae;Md(Q);const oe=z?N.parent===N:!0;let se=!1;if(!oe)try{N.parent.document&&(se=!1)}catch(P){se=!0}if(oe&&!e)throw new Error("emit function is required");if(!oe&&!se)return()=>{};v!==void 0&&S.mousemove===void 0&&(S.mousemove=v),ue.reset();const Le=h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:f!==void 0?f:{password:!0},Lr=g===!0||g==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:g==="all",headMetaDescKeywords:g==="all",headTitleMutations:g==="all"}:g||{};Si(N);let Ni,Fr=0;const Ri=P=>{for(const le of O||[])le.eventProcessor&&(P=le.eventProcessor(P));return y&&!se&&(P=y(P)),P};J=(P,le)=>{var Z;const X=P;if(X.timestamp=vt(),(Z=_e[0])!=null&&Z.isFrozen()&&X.type!==I.FullSnapshot&&!(X.type===I.IncrementalSnapshot&&X.data.source===E.Mutation)&&_e.forEach(de=>de.unfreeze()),oe)e==null||e(Ri(X),le);else if(se){const de={type:"rrweb",event:Ri(X),origin:N.location.origin,isCheckout:le};N.parent.postMessage(de,"*")}if(X.type===I.FullSnapshot)Ni=X,Fr=0;else if(X.type===I.IncrementalSnapshot){if(X.data.source===E.Mutation&&X.data.isAttachIframe)return;Fr++;const de=r&&Fr>=r,U=t&&X.timestamp-Ni.timestamp>t;(de||U)&&ar(!0)}};const Rt=P=>{J({type:I.IncrementalSnapshot,data:R({source:E.Mutation},P)})},Ai=P=>J({type:I.IncrementalSnapshot,data:R({source:E.Scroll},P)}),Oi=P=>J({type:I.IncrementalSnapshot,data:R({source:E.CanvasMutation},P)}),Xa=P=>J({type:I.IncrementalSnapshot,data:R({source:E.AdoptedStyleSheet},P)}),De=new Qd({mutationCb:Rt,adoptedStyleSheetCb:Xa}),Te=new Wd({mirror:ue,mutationCb:Rt,stylesheetManager:De,recordCrossOriginIframes:z,wrappedEmit:J});for(const P of O||[])P.getMirror&&P.getMirror({nodeMirror:ue,crossOriginIframeMirror:Te.crossOriginIframeMirror,crossOriginIframeStyleMirror:Te.crossOriginIframeStyleMirror});const Br=new qd;es=new Kd({recordCanvas:A,mutationCb:Oi,win:N,blockClass:i,blockSelector:o,mirror:ue,sampling:S.canvas,dataURLOptions:w});const At=new zd({mutationCb:Rt,scrollCb:Ai,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:Le,dataURLOptions:w,maskTextFn:m,maskInputFn:p,recordCanvas:A,inlineImages:ie,sampling:S,slimDOMOptions:Lr,iframeManager:Te,stylesheetManager:De,canvasManager:es,keepIframeSrcFn:ye,processedNodeManager:Br,win:N},mirror:ue});ar=(P=!1)=>{if(!x)return;J({type:I.Meta,data:{href:N.location.href,width:yi(N),height:gi(N)}},P),De.reset(),At.init(),_e.forEach(Z=>Z.lock());const le=Gl(N.document,{mirror:ue,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:Le,maskTextFn:m,maskInputFn:p,slimDOM:Lr,dataURLOptions:w,recordCanvas:A,inlineImages:ie,onSerialize:Z=>{Ze(Z,ue)&&Te.addIframe(Z),Ci(Z,ue)&&De.trackLinkElement(Z),Ie(Z)&&At.addShadowRoot(D.shadowRoot(Z),document)},onIframeLoad:(Z,X)=>{Te.attachIframe(Z,X),At.observeAttachShadow(Z)},onStylesheetLoad:(Z,X)=>{De.attachLinkElement(Z,X)},keepIframeSrcFn:ye});if(!le)return console.warn("Failed to snapshot the document");J({type:I.FullSnapshot,data:{node:le,initialOffset:mi(N)}},P),_e.forEach(Z=>Z.unlock()),N.document.adoptedStyleSheets&&N.document.adoptedStyleSheets.length>0&&De.adoptStyleSheets(N.document.adoptedStyleSheets,ue.getId(N.document))};try{const P=[],le=X=>{var de;return _(Ud)({mutationCb:Rt,mousemoveCb:(U,Ur)=>J({type:I.IncrementalSnapshot,data:{source:Ur,positions:U}}),mouseInteractionCb:U=>J({type:I.IncrementalSnapshot,data:R({source:E.MouseInteraction},U)}),scrollCb:Ai,viewportResizeCb:U=>J({type:I.IncrementalSnapshot,data:R({source:E.ViewportResize},U)}),inputCb:U=>J({type:I.IncrementalSnapshot,data:R({source:E.Input},U)}),mediaInteractionCb:U=>J({type:I.IncrementalSnapshot,data:R({source:E.MediaInteraction},U)}),styleSheetRuleCb:U=>J({type:I.IncrementalSnapshot,data:R({source:E.StyleSheetRule},U)}),styleDeclarationCb:U=>J({type:I.IncrementalSnapshot,data:R({source:E.StyleDeclaration},U)}),canvasMutationCb:Oi,fontCb:U=>J({type:I.IncrementalSnapshot,data:R({source:E.Font},U)}),selectionCb:U=>{J({type:I.IncrementalSnapshot,data:R({source:E.Selection},U)})},customElementCb:U=>{J({type:I.IncrementalSnapshot,data:R({source:E.CustomElement},U)})},blockClass:i,ignoreClass:n,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:Le,inlineStylesheet:c,sampling:S,recordDOM:x,recordCanvas:A,inlineImages:ie,userTriggeredOnInput:H,collectFonts:K,win:N,doc:X,maskInputFn:p,maskTextFn:m,keepIframeSrcFn:ye,blockSelector:o,slimDOMOptions:Lr,dataURLOptions:w,mirror:ue,iframeManager:Te,stylesheetManager:De,shadowDomManager:At,processedNodeManager:Br,canvasManager:es,ignoreCSSAttributes:Oe,plugins:((de=O==null?void 0:O.filter(U=>U.observer))==null?void 0:de.map(U=>({observer:U.observer,options:U.options,callback:Ur=>J({type:I.Plugin,data:{plugin:U.name,payload:Ur}})})))||[]},d)};Te.addLoadListener(X=>{try{P.push(le(X.contentDocument))}catch(de){console.warn(de)}});const Z=()=>{ar(),P.push(le(N.document)),Cr=!0};return N.document.readyState==="interactive"||N.document.readyState==="complete"?Z():(P.push(te("DOMContentLoaded",()=>{J({type:I.DomContentLoaded,data:{}}),B==="DOMContentLoaded"&&Z()})),P.push(te("load",()=>{J({type:I.Load,data:{}}),B==="load"&&Z()},N))),()=>{P.forEach(X=>X()),Br.destroy(),Cr=!1,Nd()}}catch(P){console.warn(P)}}Ae.addCustomEvent=(s,e)=>{if(!Cr)throw new Error("please add custom event after start recording");J({type:I.Custom,data:{tag:s,payload:e}})};Ae.freezePage=()=>{_e.forEach(s=>s.freeze())};Ae.takeFullSnapshot=s=>{if(!Cr)throw new Error("please take full snapshot after start recording");ar(s)};Ae.mirror=ue;function Va(s){return{all:s=s||new Map,on:function(e,t){var r=s.get(e);r?r.push(t):s.set(e,[t])},off:function(e,t){var r=s.get(e);r&&(t?r.splice(r.indexOf(t)>>>0,1):s.set(e,[]))},emit:function(e,t){var r=s.get(e);r&&r.slice().map(function(i){i(t)}),(r=s.get("*"))&&r.slice().map(function(i){i(e,t)})}}}const ep=Object.freeze(Object.defineProperty({__proto__:null,default:Va},Symbol.toStringTag,{value:"Module"}));function tp(s=window,e=document){if("scrollBehavior"in e.documentElement.style&&s.__forceSmoothScrollPolyfill__!==!0)return;const t=s.HTMLElement||s.Element,r=468,i={scroll:s.scroll||s.scrollTo,scrollBy:s.scrollBy,elementScroll:t.prototype.scroll||l,scrollIntoView:t.prototype.scrollIntoView},o=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now;function n(y){const S=["MSIE ","Trident/","Edge/"];return new RegExp(S.join("|")).test(y)}const a=n(s.navigator.userAgent)?1:0;function l(y,S){this.scrollLeft=y,this.scrollTop=S}function u(y){return .5*(1-Math.cos(Math.PI*y))}function c(y){if(y===null||typeof y!="object"||y.behavior===void 0||y.behavior==="auto"||y.behavior==="instant")return!0;if(typeof y=="object"&&y.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+y.behavior+" is not a valid value for enumeration ScrollBehavior.")}function h(y,S){if(S==="Y")return y.clientHeight+a<y.scrollHeight;if(S==="X")return y.clientWidth+a<y.scrollWidth}function f(y,S){const w=s.getComputedStyle(y,null)["overflow"+S];return w==="auto"||w==="scroll"}function g(y){const S=h(y,"Y")&&f(y,"Y"),w=h(y,"X")&&f(y,"X");return S||w}function p(y){for(;y!==e.body&&g(y)===!1;)y=y.parentNode||y.host;return y}function m(y){const S=o();let w,v,x,A=(S-y.startTime)/r;A=A>1?1:A,w=u(A),v=y.startX+(y.x-y.startX)*w,x=y.startY+(y.y-y.startY)*w,y.method.call(y.scrollable,v,x),(v!==y.x||x!==y.y)&&s.requestAnimationFrame(m.bind(s,y))}function d(y,S,w){let v,x,A,z;const B=o();y===e.body?(v=s,x=s.scrollX||s.pageXOffset,A=s.scrollY||s.pageYOffset,z=i.scroll):(v=y,x=y.scrollLeft,A=y.scrollTop,z=l),m({scrollable:v,method:z,startTime:B,startX:x,startY:A,x:S,y:w})}s.scroll=s.scrollTo=function(){if(arguments[0]!==void 0){if(c(arguments[0])===!0){i.scroll.call(s,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:s.scrollX||s.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:s.scrollY||s.pageYOffset);return}d.call(s,e.body,arguments[0].left!==void 0?~~arguments[0].left:s.scrollX||s.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:s.scrollY||s.pageYOffset)}},s.scrollBy=function(){if(arguments[0]!==void 0){if(c(arguments[0])){i.scrollBy.call(s,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}d.call(s,e.body,~~arguments[0].left+(s.scrollX||s.pageXOffset),~~arguments[0].top+(s.scrollY||s.pageYOffset))}},t.prototype.scroll=t.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(c(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const y=arguments[0].left,S=arguments[0].top;d.call(this,this,typeof y=="undefined"?this.scrollLeft:~~y,typeof S=="undefined"?this.scrollTop:~~S)},t.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(c(arguments[0])===!0){i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},t.prototype.scrollIntoView=function(){if(c(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const y=p(this),S=y.getBoundingClientRect(),w=this.getBoundingClientRect();y!==e.body?(d.call(this,y,y.scrollLeft+w.left-S.left,y.scrollTop+w.top-S.top),s.getComputedStyle(y).position!=="fixed"&&s.scrollBy({left:S.left,top:S.top,behavior:"smooth"})):s.scrollBy({left:w.left,top:w.top,behavior:"smooth"})}}class rp{constructor(e=[],t){b(this,"timeOffset",0),b(this,"speed"),b(this,"actions"),b(this,"raf",null),b(this,"lastTimestamp"),this.actions=e,this.speed=t.speed}addAction(e){const t=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{const r=this.findActionIndex(e);this.actions.splice(r,0,e)}t&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){const e=performance.now();for(this.timeOffset+=(e-this.lastTimestamp)*this.speed,this.lastTimestamp=e;this.actions.length;){const t=this.actions[0];if(this.timeOffset>=t.delay)this.actions.shift(),t.doAction();else break}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(this.raf!==!0&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return this.raf!==null}findActionIndex(e){let t=0,r=this.actions.length-1;for(;t<=r;){const i=Math.floor((t+r)/2);if(this.actions[i].delay<e.delay)t=i+1;else if(this.actions[i].delay>e.delay)r=i-1;else return i+1}return t}}function Ln(s,e){if(s.type===I.IncrementalSnapshot&&s.data.source===E.MouseMove&&s.data.positions&&s.data.positions.length){const t=s.data.positions[0].timeOffset,r=s.timestamp+t;return s.delay=r-e,r-e}return s.delay=s.timestamp-e,s.delay}/*! *****************************************************************************
68
68
  Copyright (c) Microsoft Corporation.
69
69
 
70
70
  Permission to use, copy, modify, and/or distribute this software for any