@appsurify-testmap/rrweb 2.1.2-alpha.1 → 2.1.2-alpha.2

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.
@@ -11,7 +11,7 @@
11
11
  }(this, () => {
12
12
  var exports = {};
13
13
  var module = { exports };
14
- "use strict";var ml=Object.defineProperty,gl=Object.defineProperties;var yl=Object.getOwnPropertyDescriptors;var Lt=Object.getOwnPropertySymbols;var Yi=Object.prototype.hasOwnProperty,Zi=Object.prototype.propertyIsEnumerable;var Hi=(s,e,t)=>e in s?ml(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,N=(s,e)=>{for(var t in e||(e={}))Yi.call(e,t)&&Hi(s,t,e[t]);if(Lt)for(var t of Lt(e))Zi.call(e,t)&&Hi(s,t,e[t]);return s},q=(s,e)=>gl(s,yl(e));var We=(s,e)=>{var t={};for(var r in s)Yi.call(s,r)&&e.indexOf(r)<0&&(t[r]=s[r]);if(s!=null&&Lt)for(var r of Lt(s))e.indexOf(r)<0&&Zi.call(s,r)&&(t[r]=s[r]);return t};var bl=Object.defineProperty,wl=(s,e,t)=>e in s?bl(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,w=(s,e,t)=>wl(s,typeof e!="symbol"?e+"":e,t),Xi;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var vl=Object.defineProperty,Sl=(s,e,t)=>e in s?vl(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,Ji=(s,e,t)=>Sl(s,typeof e!="symbol"?e+"":e,t),D=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(D||{});const Ki={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Qi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Pt={},Cl=()=>!!globalThis.Zone;function qs(s){if(Pt[s])return Pt[s];const e=globalThis[s],t=e.prototype,r=s in Ki?Ki[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 Qi?Qi[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&&!Cl())return Pt[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?Pt[s]=u:t}catch(a){return t}}const Qr={};function De(s,e,t){var r;const i=`${s}.${String(t)}`;if(Qr[i])return Qr[i].call(e);const o=qs(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 co(s,e,t){const r=`${s}.${String(t)}`;if(qr[r])return qr[r].bind(e);const o=qs(s)[t];return typeof o!="function"?e[t]:(qr[r]=o,o.bind(e))}function El(s){return De("Node",s,"childNodes")}function xl(s){return De("Node",s,"parentNode")}function Il(s){return De("Node",s,"parentElement")}function Ml(s){return De("Node",s,"textContent")}function Nl(s,e){return co("Node",s,"contains")(e)}function Rl(s){return co("Node",s,"getRootNode")()}function Al(s){return!s||!("host"in s)?null:De("ShadowRoot",s,"host")}function Ol(s){return s.styleSheets}function Tl(s){return!s||!("shadowRoot"in s)?null:De("Element",s,"shadowRoot")}function Dl(s,e){return De("Element",s,"querySelector")(e)}function _l(s,e){return De("Element",s,"querySelectorAll")(e)}function kl(){return qs("MutationObserver").constructor}function $l(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()=>{}}}function Ll(s){const e=s.tagName.toLowerCase(),t=s.id?`#${s.id}`:"",r=s.classList.length?"."+Array.from(s.classList).join("."):"";return`${e}${t}${r}`}function Pl(s){var f;var e,t;const r=(f=(e=s.ownerDocument)==null?void 0:e.defaultView)!=null?f:window,i=s.getBoundingClientRect(),o=r.innerWidth||r.document.documentElement.clientWidth||0,n=r.innerHeight||r.document.documentElement.clientHeight||0,a=i.width>0&&i.height>0&&i.bottom>0&&i.right>0&&i.top<n&&i.left<o,l=(t=r.getComputedStyle)==null?void 0:t.call(r,s),c=!!l&&l.display!=="none"&&l.visibility!=="hidden"&&(parseFloat(l.opacity)||0)>0&&a;let h=0;if(c){const g=Math.max(0,Math.min(i.right,o)-Math.max(i.left,0)),p=Math.max(0,Math.min(i.bottom,n)-Math.max(i.top,0)),y=g*p,d=i.width*i.height;h=d>0?y/d:0}return{isVisible:c,ratio:h}}const ee={childNodes:El,parentNode:xl,parentElement:Il,textContent:Ml,contains:Nl,getRootNode:Rl,host:Al,styleSheets:Ol,shadowRoot:Tl,querySelector:Dl,querySelectorAll:_l,mutationObserver:kl,patch:$l,describeNode:Ll,getElementVisibility:Pl};function mt(s){return s.nodeType===s.ELEMENT_NODE}function gt(s){const e=s&&"host"in s&&"mode"in s&&ee.host(s)||null;return!!(e&&"shadowRoot"in e&&ee.shadowRoot(e)===s)}function yt(s){return Object.prototype.toString.call(s)==="[object ShadowRoot]"}function Fl(s){return s.includes(" background-clip: text;")&&!s.includes(" -webkit-background-clip: text;")&&(s=s.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),s}function Bl(s){const{cssText:e}=s;if(e.split('"').length<3)return e;const t=["@import",`url(${JSON.stringify(s.href)})`];return s.layerName===""?t.push("layer"):s.layerName&&t.push(`layer(${s.layerName})`),s.supportsText&&t.push(`supports(${s.supportsText})`),s.media.length&&t.push(s.media.mediaText),t.join(" ")+";"}function ms(s){try{const e=s.rules||s.cssRules;if(!e)return null;let t=s.href;!t&&s.ownerNode&&s.ownerNode.ownerDocument&&(t=s.ownerNode.ownerDocument.location.href);const r=Array.from(e,i=>ho(i,t)).join("");return Fl(r)}catch(e){return null}}function ho(s,e){if(Vl(s)){let t;try{t=ms(s.styleSheet)||Bl(s)}catch(r){t=s.cssText}return s.styleSheet.href?gr(t,s.styleSheet.href):t}else{let t=s.cssText;return Wl(s)&&s.selectorText.includes(":")&&(t=Ul(t)),e?gr(t,e):t}}function Ul(s){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return s.replace(e,"$1\\$2")}function Vl(s){return"styleSheet"in s}function Wl(s){return"selectorText"in s}class ei{constructor(){Ji(this,"idNodeMap",new Map),Ji(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 fo(){return new ei}function pr({element:s,maskInputOptions:e,tagName:t,type:r,value:i,maskInputFn:o}){let n=i||"";const a=r&&Te(r);return(e[t.toLowerCase()]||a&&e[a])&&(o?n=o(n,s):n="*".repeat(n.length)),n}function Te(s){return s.toLowerCase()}const qi="__rrweb_original__";function zl(s){const e=s.getContext("2d");if(!e)return!0;const t=50;for(let r=0;r<s.width;r+=t)for(let i=0;i<s.height;i+=t){const o=e.getImageData,n=qi in o?o[qi]:o;if(new Uint32Array(n.call(e,r,i,Math.min(t,s.width-r),Math.min(t,s.height-i)).data.buffer).some(l=>l!==0))return!1}return!0}function Gl(s,e){return!s||!e||s.type!==e.type?!1:s.type===D.Document?s.compatMode===e.compatMode:s.type===D.DocumentType?s.name===e.name&&s.publicId===e.publicId&&s.systemId===e.systemId:s.type===D.Comment||s.type===D.Text||s.type===D.CDATA?s.textContent===e.textContent:s.type===D.Element?s.tagName===e.tagName&&JSON.stringify(s.attributes)===JSON.stringify(e.attributes)&&s.isSVG===e.isSVG&&s.needBlock===e.needBlock:!1}function mr(s){const e=s.type;return s.hasAttribute("data-rr-is-password")?"password":e?Te(e):null}function ti(s,e){var o;let t;try{t=new URL(s,e!=null?e:window.location.href)}catch(n){return null}const r=/\.([0-9a-z]+)(?:$)/i,i=t.pathname.match(r);return(o=i==null?void 0:i[1])!=null?o:null}function jl(s){let e="";return s.indexOf("//")>-1?e=s.split("/").slice(0,3).join("/"):e=s.split("/")[0],e=e.split("?")[0],e}const Hl=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Yl=/^(?:[a-z+]+:)?\/\//i,Zl=/^www\..*/i,Xl=/^(data:)([^,]*),(.*)/i;function gr(s,e){return(s||"").replace(Hl,(t,r,i,o,n,a)=>{const l=i||n||a,u=r||o||"";if(!l)return t;if(Yl.test(l)||Zl.test(l))return`url(${u}${l}${u})`;if(Xl.test(l))return`url(${u}${l}${u})`;if(l[0]==="/")return`url(${u}${jl(e)+l}${u})`;const c=e.split("/"),h=l.split("/");c.pop();for(const f of h)f!=="."&&(f===".."?c.pop():c.push(f));return`url(${u}${c.join("/")}${u})`})}function Ft(s,e=!1){return e?s.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):s.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Jl(s,e,t=!1){const r=Array.from(e.childNodes),i=[];let o=0;if(r.length>1&&s&&typeof s=="string"){let n=Ft(s,t);const a=n.length/s.length;for(let l=1;l<r.length;l++)if(r[l].textContent&&typeof r[l].textContent=="string"){const u=Ft(r[l].textContent,t),c=100;let h=3;for(;h<u.length&&(u[h].match(/[a-zA-Z0-9]/)||u.indexOf(u.substring(0,h),1)!==-1);h++);for(;h<u.length;h++){let f=u.substring(0,h),g=n.split(f),p=-1;if(g.length===2)p=g[0].length;else if(g.length>2&&g[0]===""&&r[l-1].textContent!=="")p=n.indexOf(f,1);else if(g.length===1){if(f=f.substring(0,f.length-1),g=n.split(f),g.length<=1)return i.push(s),i;h=c+1}else h===u.length-1&&(p=n.indexOf(f));if(g.length>=2&&h>c){const y=r[l-1].textContent;if(y&&typeof y=="string"){const d=Ft(y).length;p=n.indexOf(f,d)}p===-1&&(p=g[0].length)}if(p!==-1){let y=Math.floor(p/a);for(;y>0&&y<s.length;){if(o+=1,o>50*r.length)return i.push(s),i;const d=Ft(s.substring(0,y),t);if(d.length===p){i.push(s.substring(0,y)),s=s.substring(y),n=n.substring(p);break}else d.length<p?y+=Math.max(1,Math.floor((p-d.length)/a)):y-=Math.max(1,Math.floor((d.length-p)*a))}break}}}}return i.push(s),i}function Kl(s,e){return Jl(s,e).join("/* rr_split */")}function Ql(s,e){try{const t=document.querySelectorAll(s);return t.length===1&&t[0]===e}catch(t){return!1}}function ql(s){if(!(s instanceof Element))return null;if(s.id)return`#${CSS.escape(s.id)}`;const e=[],t=s.tagName.toLowerCase();s.classList.length&&e.push(...Array.from(s.classList).map(n=>`.${CSS.escape(n)}`)),Array.from(s.attributes).forEach(n=>{n.name.startsWith("data-")&&e.push(`[${n.name}="${CSS.escape(n.value)}"]`)});const r=`${t}${e.join("")}`;if(Ql(r,s))return r;const i=[];let o=s;for(;o&&o.nodeType===Node.ELEMENT_NODE;){const n=o.parentElement,a=o.tagName.toLowerCase();let l="";if(n){const u=Array.from(n.children).filter(c=>c.tagName.toLowerCase()===a);u.length>1&&(l=`:nth-of-type(${u.indexOf(o)+1})`)}i.unshift(`${a}${l}`),o=n}return i.join(" > ")||null}function gs(s){switch(s.nodeType){case Node.DOCUMENT_NODE:return"/";case Node.DOCUMENT_TYPE_NODE:return"/html/doctype";case Node.ELEMENT_NODE:{const e=s;if(e.id)return`//*[@id="${CSS.escape(e.id)}"]`;if(e.tagName.toLowerCase()==="html")return"/html";if(e===document.head)return"/html/head";if(e===document.body)return"/html/body";const t=e.parentNode;if(!t)return"";const r=e.tagName.toLowerCase(),i=Array.from(t.children).filter(n=>n.tagName.toLowerCase()===r),o=i.length>1?`[${i.indexOf(e)+1}]`:"";return`${gs(t)}/${r}${o}`}case Node.TEXT_NODE:case Node.CDATA_SECTION_NODE:case Node.COMMENT_NODE:{const e=s.parentNode;if(!e)return"";const t={[Node.TEXT_NODE]:"text()",[Node.CDATA_SECTION_NODE]:"text()",[Node.COMMENT_NODE]:"comment()"},r=Array.from(e.childNodes).filter(o=>o.nodeType===s.nodeType),i=r.length>1?`[${r.indexOf(s)}]`:"";return`${gs(e)}/${t[s.nodeType]}${i}`}default:return""}}function eu(s){var e;const t=ee.parentNode(s),r=t&&t;return!r||!ri(r)?!1:((e=s.textContent)==null?void 0:e.trim())!==""}function ri(s){return ee.getElementVisibility(s).isVisible}const tu=["change","submit","dragstart","drop","pointerdown","pointerup","input","keydown","keyup","keypress","mouseenter","mouseleave","mouseup","mousedown","click","contextmenu","dblclick","focus","blur","touchstart","touchmove","touchend","touchcancel"],ru=["a","button","input","select","textarea","label","details","summary","dialog","video","audio"],su=["onclick","ondblclick","onmousedown","onmouseup","onmouseover","onmouseout","onmousemove","onfocus","onblur","onkeydown","onkeypress","onkeyup","onchange","oninput","onsubmit","onreset","onselect","oncontextmenu","ontouchstart","ontouchmove","ontouchend","ontouchcancel"],si=new WeakSet,iu=EventTarget.prototype.addEventListener;EventTarget.prototype.addEventListener=function(s,e,t){if(iu.call(this,s,e,t),this instanceof Element){const r=s.toLowerCase();tu.includes(r)&&si.add(this)}};const nu=EventTarget.prototype.removeEventListener;EventTarget.prototype.removeEventListener=function(s,e,t){nu.call(this,s,e,t)};function ou(s){return s instanceof Element&&si.has(s)}function au(s){if(s.nodeType===Node.ELEMENT_NODE){const e=s,t=e.tagName.toLowerCase();if(ru.includes(t))return!0;const r=e.hasAttribute("tabindex")&&e.getAttribute("tabindex")!=="-1",i=["button","link","checkbox","switch","menuitem"].includes(e.getAttribute("role")||"");return ou(e)||r||i||e instanceof HTMLAnchorElement&&e.hasAttribute("href")||e instanceof HTMLButtonElement&&!e.disabled}return!1}function en(){document.querySelectorAll("*").forEach(e=>{su.forEach(t=>{e.hasAttribute(t)&&si.add(e)})})}document.readyState==="complete"||document.readyState==="interactive"?en():document.addEventListener("DOMContentLoaded",en);let lu=1;const uu=new RegExp("[^a-z0-9-_:]"),vt=-2;function po(){return lu++}function cu(s){if(s instanceof HTMLFormElement)return"form";const e=Te(s.tagName);return uu.test(e)?"div":e}let ze,tn;const hu=/^[^ \t\n\r\u000c]+/,fu=/^[, \t\n\r\u000c]+/;function du(s,e){if(e.trim()==="")return e;let t=0;function r(o){let n;const a=o.exec(e.substring(t));return a?(n=a[0],t+=n.length,n):""}const i=[];for(;r(fu),!(t>=e.length);){let o=r(hu);if(o.slice(-1)===",")o=Ye(s,o.substring(0,o.length-1)),i.push(o);else{let n="";o=Ye(s,o);let a=!1;for(;;){const l=e.charAt(t);if(l===""){i.push((o+n).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){t+=1,i.push((o+n).trim());break}else l==="("&&(a=!0);n+=l,t+=1}}}return i.join(", ")}const rn=new WeakMap;function Ye(s,e){return!e||e.trim()===""?e:ii(s,e)}function pu(s){return!!(s.tagName==="svg"||s.ownerSVGElement)}function ii(s,e){let t=rn.get(s);if(t||(t=s.createElement("a"),rn.set(s,t)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return t.setAttribute("href",e),t.href}function mo(s,e,t,r){return r&&(t==="src"||t==="href"&&!(e==="use"&&r[0]==="#")||t==="xlink:href"&&r[0]!=="#"||t==="background"&&(e==="table"||e==="td"||e==="th")?Ye(s,r):t==="srcset"?du(s,r):t==="style"?gr(r,ii(s)):e==="object"&&t==="data"?Ye(s,r):r)}function go(s,e,t){return(s==="video"||s==="audio")&&e==="autoplay"}function ys(s,e){return typeof e=="string"?s.includes(e):e.test(s)}function mu(s,e,t){try{if(typeof e=="string"){if(s.classList.contains(e))return!0}else for(let r=s.classList.length;r--;){const i=s.classList[r];if(e.test(i))return!0}if(t)return s.matches(t)}catch(r){}return!1}function yr(s,e,t){if(!s)return!1;if(s.nodeType!==s.ELEMENT_NODE)return t?yr(ee.parentNode(s),e,t):!1;for(let r=s.classList.length;r--;){const i=s.classList[r];if(e.test(i))return!0}return t?yr(ee.parentNode(s),e,t):!1}function yo(s,e,t,r){let i;if(mt(s)){if(i=s,!ee.childNodes(i).length)return!1}else{if(ee.parentElement(s)===null)return!1;i=ee.parentElement(s)}try{if(typeof e=="string"){if(r){if(i.closest(`.${e}`))return!0}else if(i.classList.contains(e))return!0}else if(yr(i,e,r))return!0;if(t){if(r){if(i.closest(t))return!0}else if(i.matches(t))return!0}}catch(o){}return!1}function gu(s,e,t){const r=s.contentWindow;if(!r)return;let i=!1,o;try{o=r.document.readyState}catch(a){return}if(o!=="complete"){const a=setTimeout(()=>{i||(e(),i=!0)},t);s.addEventListener("load",()=>{clearTimeout(a),i=!0,e()});return}const n="about:blank";if(r.location.href!==n||s.src===n||s.src==="")return setTimeout(e,0),s.addEventListener("load",e);s.addEventListener("load",e)}function yu(s,e,t){let r=!1,i;try{i=s.sheet}catch(n){return}if(i)return;const o=setTimeout(()=>{r||(e(),r=!0)},t);s.addEventListener("load",()=>{clearTimeout(o),r=!0,e()})}function bu(s,e){const{doc:t,mirror:r,blockClass:i,blockSelector:o,excludeAttribute:n,needsMask:a,inlineStylesheet:l,maskInputOptions:u={},maskTextFn:c,maskInputFn:h,dataURLOptions:f={},inlineImages:g,recordCanvas:p,keepIframeSrcFn:y,newlyAddedElement:d=!1,cssCaptured:m=!1}=e,S=wu(t,r);switch(s.nodeType){case s.DOCUMENT_NODE:return s.compatMode!=="CSS1Compat"?{type:D.Document,childNodes:[],compatMode:s.compatMode}:{type:D.Document,childNodes:[]};case s.DOCUMENT_TYPE_NODE:return{type:D.DocumentType,name:s.name,publicId:s.publicId,systemId:s.systemId,rootId:S};case s.ELEMENT_NODE:return Su(s,{doc:t,blockClass:i,blockSelector:o,excludeAttribute:n,inlineStylesheet:l,maskInputOptions:u,maskInputFn:h,dataURLOptions:f,inlineImages:g,recordCanvas:p,keepIframeSrcFn:y,newlyAddedElement:d,rootId:S});case s.TEXT_NODE:return vu(s,{doc:t,needsMask:a,maskTextFn:c,rootId:S,cssCaptured:m});case s.CDATA_SECTION_NODE:return{type:D.CDATA,textContent:"",rootId:S};case s.COMMENT_NODE:return{type:D.Comment,textContent:ee.textContent(s)||"",rootId:S};default:return!1}}function wu(s,e){if(!e.hasNode(s))return;const t=e.getId(s);return t===1?void 0:t}function vu(s,e){const{needsMask:t,maskTextFn:r,rootId:i,cssCaptured:o}=e,n=ee.parentNode(s),a=n&&n.tagName;let l="";const u=a==="STYLE"?!0:void 0,c=a==="SCRIPT"?!0:void 0;return c?l="SCRIPT_PLACEHOLDER":o||(l=ee.textContent(s),u&&l&&(l=gr(l,ii(e.doc)))),!u&&!c&&l&&t&&(l=r?r(l,ee.parentElement(s)):l.replace(/[\S]/g,"*")),{type:D.Text,textContent:l||"",rootId:i}}function Su(s,e){const{doc:t,blockClass:r,blockSelector:i,excludeAttribute:o,inlineStylesheet:n,maskInputOptions:a={},maskInputFn:l,dataURLOptions:u={},inlineImages:c,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:g=!1,rootId:p}=e,y=mu(s,r,i),d=cu(s);let m={};const S=s.attributes.length;for(let b=0;b<S;b++){const C=s.attributes[b];ys(C.name,o)||go(d,C.name,C.value)||(m[C.name]=mo(t,d,Te(C.name),C.value))}if(d==="link"&&n){const b=Array.from(t.styleSheets).find(E=>E.href===s.href);let C=null;b&&(C=ms(b)),C&&(delete m.rel,delete m.href,m._cssText=C)}if(d==="style"&&s.sheet){let b=ms(s.sheet);b&&(s.childNodes.length>1&&(b=Kl(b,s)),m._cssText=b)}if(d==="input"||d==="textarea"||d==="select"){const b=s.value,C=s.checked;m.type!=="radio"&&m.type!=="checkbox"&&m.type!=="submit"&&m.type!=="button"&&b?m.value=pr({element:s,type:mr(s),tagName:d,value:b,maskInputOptions:a,maskInputFn:l}):C&&(m.checked=C)}if(d==="option"&&(s.selected&&!a.select?m.selected=!0:delete m.selected),d==="dialog"&&s.open&&(m.rr_open_mode=s.matches("dialog:modal")?"modal":"non-modal"),d==="canvas"&&h){if(s.__context==="2d")zl(s)||(m.rr_dataURL=s.toDataURL(u.type,u.quality));else if(!("__context"in s)){const b=s.toDataURL(u.type,u.quality),C=t.createElement("canvas");C.width=s.width,C.height=s.height;const E=C.toDataURL(u.type,u.quality);b!==E&&(m.rr_dataURL=b)}}if(d==="img"&&c){ze||(ze=t.createElement("canvas"),tn=ze.getContext("2d"));const b=s,C=b.currentSrc||b.getAttribute("src")||"<unknown-src>",E=b.crossOrigin,_=()=>{b.removeEventListener("load",_);try{ze.width=b.naturalWidth,ze.height=b.naturalHeight,tn.drawImage(b,0,0),m.rr_dataURL=ze.toDataURL(u.type,u.quality)}catch(A){if(b.crossOrigin!=="anonymous"){b.crossOrigin="anonymous",b.complete&&b.naturalWidth!==0?_():b.addEventListener("load",_);return}else console.warn(`Cannot inline img src=${C}! Error: ${A}`)}b.crossOrigin==="anonymous"&&(E?m.crossOrigin=E:b.removeAttribute("crossorigin"))};b.complete&&b.naturalWidth!==0?_():b.addEventListener("load",_)}if(d==="audio"||d==="video"){const b=m;b.rr_mediaState=s.paused?"paused":"played",b.rr_mediaCurrentTime=s.currentTime,b.rr_mediaPlaybackRate=s.playbackRate,b.rr_mediaMuted=s.muted,b.rr_mediaLoop=s.loop,b.rr_mediaVolume=s.volume}if(g||(s.scrollLeft&&(m.rr_scrollLeft=s.scrollLeft),s.scrollTop&&(m.rr_scrollTop=s.scrollTop)),y){const{width:b,height:C}=s.getBoundingClientRect();m={class:m.class,rr_width:`${b}px`,rr_height:`${C}px`}}d==="iframe"&&!f(m.src)&&(s.contentDocument||(m.rr_src=m.src),delete m.src);let v;try{customElements.get(d)&&(v=!0)}catch(b){}return{type:D.Element,tagName:d,attributes:m,childNodes:[],isSVG:pu(s)||void 0,needBlock:y,rootId:p,isCustom:v}}function G(s){return s==null?"":s.toLowerCase()}function Cu(s,e){if(e.comment&&s.type===D.Comment)return!0;if(s.type===D.Element){if(e.script&&(s.tagName==="script"||s.tagName==="link"&&(s.attributes.rel==="preload"&&s.attributes.as==="script"||s.attributes.rel==="modulepreload")||s.tagName==="link"&&s.attributes.rel==="prefetch"&&typeof s.attributes.href=="string"&&ti(s.attributes.href)==="js"))return!0;if(e.headFavicon&&(s.tagName==="link"&&s.attributes.rel==="shortcut icon"||s.tagName==="meta"&&(G(s.attributes.name).match(/^msapplication-tile(image|color)$/)||G(s.attributes.name)==="application-name"||G(s.attributes.rel)==="icon"||G(s.attributes.rel)==="apple-touch-icon"||G(s.attributes.rel)==="shortcut icon")))return!0;if(s.tagName==="meta"){if(e.headMetaDescKeywords&&G(s.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(G(s.attributes.property).match(/^(og|twitter|fb):/)||G(s.attributes.name).match(/^(og|twitter):/)||G(s.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(G(s.attributes.name)==="robots"||G(s.attributes.name)==="googlebot"||G(s.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&s.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(G(s.attributes.name)==="author"||G(s.attributes.name)==="generator"||G(s.attributes.name)==="framework"||G(s.attributes.name)==="publisher"||G(s.attributes.name)==="progid"||G(s.attributes.property).match(/^article:/)||G(s.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(G(s.attributes.name)==="google-site-verification"||G(s.attributes.name)==="yandex-verification"||G(s.attributes.name)==="csrf-token"||G(s.attributes.name)==="p:domain_verify"||G(s.attributes.name)==="verify-v1"||G(s.attributes.name)==="verification"||G(s.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Ze(s,e){const{doc:t,mirror:r,blockClass:i,blockSelector:o,maskTextClass:n,maskTextSelector:a,excludeAttribute:l,skipChild:u=!1,inlineStylesheet:c=!0,maskInputOptions:h={},maskTextFn:f,maskInputFn:g,slimDOMOptions:p,dataURLOptions:y={},inlineImages:d=!1,recordCanvas:m=!1,onSerialize:S,onIframeLoad:v,iframeLoadTimeout:b=5e3,onStylesheetLoad:C,stylesheetLoadTimeout:E=5e3,keepIframeSrcFn:_=()=>!1,newlyAddedElement:A=!1,cssCaptured:V=!1}=e;let{needsMask:z}=e,{preserveWhiteSpace:J=!0}=e;z||(z=yo(s,n,a,z===void 0));const Q=bu(s,{doc:t,mirror:r,blockClass:i,blockSelector:o,excludeAttribute:l,needsMask:z,inlineStylesheet:c,maskInputOptions:h,maskTextFn:f,maskInputFn:g,dataURLOptions:y,inlineImages:d,recordCanvas:m,keepIframeSrcFn:_,newlyAddedElement:A,cssCaptured:V});if(!Q)return console.warn(s,"not serialized"),null;let te;r.hasNode(s)?te=r.getId(s):Cu(Q,p)||!J&&Q.type===D.Text&&!Q.textContent.replace(/^\s+|\s+$/gm,"").length?te=vt:te=po();const R=Object.assign(Q,{id:te});if(mt(s)||s.nodeType===Node.TEXT_NODE){if(R.xpath=gs(s),mt(s)){const O=ql(s);O&&(R.selector=O)}s.nodeType===Node.TEXT_NODE&&(R.isVisible=eu(s)),s.nodeType===Node.ELEMENT_NODE&&(R.isVisible=ri(s),R.isInteractive=au(s))}if(r.add(s,R),te===vt)return null;S&&S(s);let ie=!u;if(R.type===D.Element){ie=ie&&!R.needBlock,delete R.needBlock;const O=ee.shadowRoot(s);O&&yt(O)&&(R.isShadowHost=!0)}if((R.type===D.Document||R.type===D.Element)&&ie){p.headWhitespace&&R.type===D.Element&&R.tagName==="head"&&(J=!1);const O={doc:t,mirror:r,blockClass:i,blockSelector:o,needsMask:z,maskTextClass:n,maskTextSelector:a,excludeAttribute:l,skipChild:u,inlineStylesheet:c,maskInputOptions:h,maskTextFn:f,maskInputFn:g,slimDOMOptions:p,dataURLOptions:y,inlineImages:d,recordCanvas:m,preserveWhiteSpace:J,onSerialize:S,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:C,stylesheetLoadTimeout:E,keepIframeSrcFn:_,cssCaptured:!1};if(!(R.type===D.Element&&R.tagName==="textarea"&&R.attributes.value!==void 0)){R.type===D.Element&&R.attributes._cssText!==void 0&&typeof R.attributes._cssText=="string"&&(O.cssCaptured=!0);for(const de of Array.from(ee.childNodes(s))){const ae=Ze(de,O);ae&&R.childNodes.push(ae)}}let ue=null;if(mt(s)&&(ue=ee.shadowRoot(s)))for(const de of Array.from(ee.childNodes(ue))){const ae=Ze(de,O);ae&&(yt(ue)&&(ae.isShadow=!0),R.childNodes.push(ae))}}const ne=ee.parentNode(s);return ne&&gt(ne)&&yt(ne)&&(R.isShadow=!0),R.type===D.Element&&R.tagName==="iframe"&&gu(s,()=>{const O=s.contentDocument;if(O&&v){const ue=Ze(O,{doc:O,mirror:r,blockClass:i,blockSelector:o,needsMask:z,maskTextClass:n,maskTextSelector:a,excludeAttribute:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:h,maskTextFn:f,maskInputFn:g,slimDOMOptions:p,dataURLOptions:y,inlineImages:d,recordCanvas:m,preserveWhiteSpace:J,onSerialize:S,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:C,stylesheetLoadTimeout:E,keepIframeSrcFn:_});ue&&v(s,ue)}},b),R.type===D.Element&&R.tagName==="link"&&typeof R.attributes.rel=="string"&&(R.attributes.rel==="stylesheet"||R.attributes.rel==="preload"&&typeof R.attributes.href=="string"&&ti(R.attributes.href)==="css")&&yu(s,()=>{if(C){const O=Ze(s,{doc:t,mirror:r,blockClass:i,blockSelector:o,needsMask:z,maskTextClass:n,maskTextSelector:a,excludeAttribute:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:h,maskTextFn:f,maskInputFn:g,slimDOMOptions:p,dataURLOptions:y,inlineImages:d,recordCanvas:m,preserveWhiteSpace:J,onSerialize:S,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:C,stylesheetLoadTimeout:E,keepIframeSrcFn:_});O&&C(s,O)}},E),R}function Eu(s,e){const{mirror:t=new ei,blockClass:r="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:n=null,excludeAttribute:a=/.^/,inlineStylesheet:l=!0,inlineImages:u=!1,recordCanvas:c=!1,maskAllInputs:h=!1,maskTextFn:f,maskInputFn:g,slimDOM:p=!1,dataURLOptions:y,preserveWhiteSpace:d,onSerialize:m,onIframeLoad:S,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:E=()=>!1}=e||{};return Ze(s,{doc:s,mirror:t,blockClass:r,blockSelector:i,maskTextClass:o,maskTextSelector:n,excludeAttribute:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:h===!1?{password:!0}:h,maskTextFn:f,maskInputFn:g,slimDOMOptions:p===!0||p==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:p==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:p===!1?{}:p,dataURLOptions:y,inlineImages:u,recordCanvas:c,preserveWhiteSpace:d,onSerialize:m,onIframeLoad:S,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:E,newlyAddedElement:!1})}const xu=/(max|min)-device-(width|height)/,sn=new RegExp(xu.source,"g"),Iu={postcssPlugin:"postcss-custom-selectors",prepare(){return{postcssPlugin:"postcss-custom-selectors",AtRule:function(s){s.params.match(sn)&&(s.params=s.params.replace(sn,"$1-$2"))}}}},Mu={postcssPlugin:"postcss-hover-classes",prepare:function(){const s=[];return{Rule:function(e){s.indexOf(e)===-1&&(s.push(e),e.selectors.forEach(function(t){t.includes(":hover")&&(e.selector+=`,
14
+ "use strict";var ml=Object.defineProperty,gl=Object.defineProperties;var yl=Object.getOwnPropertyDescriptors;var Lt=Object.getOwnPropertySymbols;var Yi=Object.prototype.hasOwnProperty,Zi=Object.prototype.propertyIsEnumerable;var Hi=(s,e,t)=>e in s?ml(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,N=(s,e)=>{for(var t in e||(e={}))Yi.call(e,t)&&Hi(s,t,e[t]);if(Lt)for(var t of Lt(e))Zi.call(e,t)&&Hi(s,t,e[t]);return s},q=(s,e)=>gl(s,yl(e));var We=(s,e)=>{var t={};for(var r in s)Yi.call(s,r)&&e.indexOf(r)<0&&(t[r]=s[r]);if(s!=null&&Lt)for(var r of Lt(s))e.indexOf(r)<0&&Zi.call(s,r)&&(t[r]=s[r]);return t};var bl=Object.defineProperty,wl=(s,e,t)=>e in s?bl(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,w=(s,e,t)=>wl(s,typeof e!="symbol"?e+"":e,t),Xi;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var vl=Object.defineProperty,Sl=(s,e,t)=>e in s?vl(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,Ji=(s,e,t)=>Sl(s,typeof e!="symbol"?e+"":e,t),D=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(D||{});const Ki={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Qi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Pt={},Cl=()=>!!globalThis.Zone;function qs(s){if(Pt[s])return Pt[s];const e=globalThis[s],t=e.prototype,r=s in Ki?Ki[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 Qi?Qi[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&&!Cl())return Pt[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?Pt[s]=u:t}catch(a){return t}}const Qr={};function De(s,e,t){var r;const i=`${s}.${String(t)}`;if(Qr[i])return Qr[i].call(e);const o=qs(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 co(s,e,t){const r=`${s}.${String(t)}`;if(qr[r])return qr[r].bind(e);const o=qs(s)[t];return typeof o!="function"?e[t]:(qr[r]=o,o.bind(e))}function El(s){return De("Node",s,"childNodes")}function xl(s){return De("Node",s,"parentNode")}function Il(s){return De("Node",s,"parentElement")}function Ml(s){return De("Node",s,"textContent")}function Nl(s,e){return co("Node",s,"contains")(e)}function Rl(s){return co("Node",s,"getRootNode")()}function Al(s){return!s||!("host"in s)?null:De("ShadowRoot",s,"host")}function Ol(s){return s.styleSheets}function Tl(s){return!s||!("shadowRoot"in s)?null:De("Element",s,"shadowRoot")}function Dl(s,e){return De("Element",s,"querySelector")(e)}function _l(s,e){return De("Element",s,"querySelectorAll")(e)}function kl(){return qs("MutationObserver").constructor}function $l(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()=>{}}}function Ll(s){const e=s.tagName.toLowerCase(),t=s.id?`#${s.id}`:"",r=s.classList.length?"."+Array.from(s.classList).join("."):"";return`${e}${t}${r}`}function Pl(s){var f;var e,t;const r=(f=(e=s.ownerDocument)==null?void 0:e.defaultView)!=null?f:window,i=s.getBoundingClientRect(),o=r.innerWidth||r.document.documentElement.clientWidth||0,n=r.innerHeight||r.document.documentElement.clientHeight||0,a=i.width>0&&i.height>0&&i.bottom>0&&i.right>0&&i.top<n&&i.left<o,l=(t=r.getComputedStyle)==null?void 0:t.call(r,s),c=!!l&&l.display!=="none"&&l.visibility!=="hidden"&&(parseFloat(l.opacity)||0)>0&&a;let h=0;if(c){const g=Math.max(0,Math.min(i.right,o)-Math.max(i.left,0)),p=Math.max(0,Math.min(i.bottom,n)-Math.max(i.top,0)),y=g*p,d=i.width*i.height;h=d>0?y/d:0}return{isVisible:c,ratio:h}}const ee={childNodes:El,parentNode:xl,parentElement:Il,textContent:Ml,contains:Nl,getRootNode:Rl,host:Al,styleSheets:Ol,shadowRoot:Tl,querySelector:Dl,querySelectorAll:_l,mutationObserver:kl,patch:$l,describeNode:Ll,getElementVisibility:Pl};function mt(s){return s.nodeType===s.ELEMENT_NODE}function gt(s){const e=s&&"host"in s&&"mode"in s&&ee.host(s)||null;return!!(e&&"shadowRoot"in e&&ee.shadowRoot(e)===s)}function yt(s){return Object.prototype.toString.call(s)==="[object ShadowRoot]"}function Fl(s){return s.includes(" background-clip: text;")&&!s.includes(" -webkit-background-clip: text;")&&(s=s.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),s}function Bl(s){const{cssText:e}=s;if(e.split('"').length<3)return e;const t=["@import",`url(${JSON.stringify(s.href)})`];return s.layerName===""?t.push("layer"):s.layerName&&t.push(`layer(${s.layerName})`),s.supportsText&&t.push(`supports(${s.supportsText})`),s.media.length&&t.push(s.media.mediaText),t.join(" ")+";"}function ms(s){try{const e=s.rules||s.cssRules;if(!e)return null;let t=s.href;!t&&s.ownerNode&&s.ownerNode.ownerDocument&&(t=s.ownerNode.ownerDocument.location.href);const r=Array.from(e,i=>ho(i,t)).join("");return Fl(r)}catch(e){return null}}function ho(s,e){if(Vl(s)){let t;try{t=ms(s.styleSheet)||Bl(s)}catch(r){t=s.cssText}return s.styleSheet.href?gr(t,s.styleSheet.href):t}else{let t=s.cssText;return Wl(s)&&s.selectorText.includes(":")&&(t=Ul(t)),e?gr(t,e):t}}function Ul(s){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return s.replace(e,"$1\\$2")}function Vl(s){return"styleSheet"in s}function Wl(s){return"selectorText"in s}class ei{constructor(){Ji(this,"idNodeMap",new Map),Ji(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 fo(){return new ei}function pr({element:s,maskInputOptions:e,tagName:t,type:r,value:i,maskInputFn:o}){let n=i||"";const a=r&&Te(r);return(e[t.toLowerCase()]||a&&e[a])&&(o?n=o(n,s):n="*".repeat(n.length)),n}function Te(s){return s.toLowerCase()}const qi="__rrweb_original__";function zl(s){const e=s.getContext("2d");if(!e)return!0;const t=50;for(let r=0;r<s.width;r+=t)for(let i=0;i<s.height;i+=t){const o=e.getImageData,n=qi in o?o[qi]:o;if(new Uint32Array(n.call(e,r,i,Math.min(t,s.width-r),Math.min(t,s.height-i)).data.buffer).some(l=>l!==0))return!1}return!0}function Gl(s,e){return!s||!e||s.type!==e.type?!1:s.type===D.Document?s.compatMode===e.compatMode:s.type===D.DocumentType?s.name===e.name&&s.publicId===e.publicId&&s.systemId===e.systemId:s.type===D.Comment||s.type===D.Text||s.type===D.CDATA?s.textContent===e.textContent:s.type===D.Element?s.tagName===e.tagName&&JSON.stringify(s.attributes)===JSON.stringify(e.attributes)&&s.isSVG===e.isSVG&&s.needBlock===e.needBlock:!1}function mr(s){const e=s.type;return s.hasAttribute("data-rr-is-password")?"password":e?Te(e):null}function ti(s,e){var o;let t;try{t=new URL(s,e!=null?e:window.location.href)}catch(n){return null}const r=/\.([0-9a-z]+)(?:$)/i,i=t.pathname.match(r);return(o=i==null?void 0:i[1])!=null?o:null}function jl(s){let e="";return s.indexOf("//")>-1?e=s.split("/").slice(0,3).join("/"):e=s.split("/")[0],e=e.split("?")[0],e}const Hl=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Yl=/^(?:[a-z+]+:)?\/\//i,Zl=/^www\..*/i,Xl=/^(data:)([^,]*),(.*)/i;function gr(s,e){return(s||"").replace(Hl,(t,r,i,o,n,a)=>{const l=i||n||a,u=r||o||"";if(!l)return t;if(Yl.test(l)||Zl.test(l))return`url(${u}${l}${u})`;if(Xl.test(l))return`url(${u}${l}${u})`;if(l[0]==="/")return`url(${u}${jl(e)+l}${u})`;const c=e.split("/"),h=l.split("/");c.pop();for(const f of h)f!=="."&&(f===".."?c.pop():c.push(f));return`url(${u}${c.join("/")}${u})`})}function Ft(s,e=!1){return e?s.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):s.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Jl(s,e,t=!1){const r=Array.from(e.childNodes),i=[];let o=0;if(r.length>1&&s&&typeof s=="string"){let n=Ft(s,t);const a=n.length/s.length;for(let l=1;l<r.length;l++)if(r[l].textContent&&typeof r[l].textContent=="string"){const u=Ft(r[l].textContent,t),c=100;let h=3;for(;h<u.length&&(u[h].match(/[a-zA-Z0-9]/)||u.indexOf(u.substring(0,h),1)!==-1);h++);for(;h<u.length;h++){let f=u.substring(0,h),g=n.split(f),p=-1;if(g.length===2)p=g[0].length;else if(g.length>2&&g[0]===""&&r[l-1].textContent!=="")p=n.indexOf(f,1);else if(g.length===1){if(f=f.substring(0,f.length-1),g=n.split(f),g.length<=1)return i.push(s),i;h=c+1}else h===u.length-1&&(p=n.indexOf(f));if(g.length>=2&&h>c){const y=r[l-1].textContent;if(y&&typeof y=="string"){const d=Ft(y).length;p=n.indexOf(f,d)}p===-1&&(p=g[0].length)}if(p!==-1){let y=Math.floor(p/a);for(;y>0&&y<s.length;){if(o+=1,o>50*r.length)return i.push(s),i;const d=Ft(s.substring(0,y),t);if(d.length===p){i.push(s.substring(0,y)),s=s.substring(y),n=n.substring(p);break}else d.length<p?y+=Math.max(1,Math.floor((p-d.length)/a)):y-=Math.max(1,Math.floor((d.length-p)*a))}break}}}}return i.push(s),i}function Kl(s,e){return Jl(s,e).join("/* rr_split */")}function Ql(s,e){try{const t=document.querySelectorAll(s);return t.length===1&&t[0]===e}catch(t){return!1}}function ql(s){if(!(s instanceof Element))return null;if(s.id)return`#${CSS.escape(s.id)}`;const e=[],t=s.tagName.toLowerCase();s.classList.length&&e.push(...Array.from(s.classList).map(n=>`.${CSS.escape(n)}`)),Array.from(s.attributes).forEach(n=>{n.name.startsWith("data-")&&e.push(`[${n.name}="${CSS.escape(n.value)}"]`)});const r=`${t}${e.join("")}`;if(Ql(r,s))return r;const i=[];let o=s;for(;o&&o.nodeType===Node.ELEMENT_NODE;){const n=o.parentElement,a=o.tagName.toLowerCase();let l="";if(n){const u=Array.from(n.children).filter(c=>c.tagName.toLowerCase()===a);u.length>1&&(l=`:nth-of-type(${u.indexOf(o)+1})`)}i.unshift(`${a}${l}`),o=n}return i.join(" > ")||null}function gs(s){switch(s.nodeType){case Node.DOCUMENT_NODE:return"/";case Node.DOCUMENT_TYPE_NODE:return"/html/doctype";case Node.ELEMENT_NODE:{const e=s;if(e.id)return`//*[@id="${CSS.escape(e.id)}"]`;if(e.tagName.toLowerCase()==="html")return"/html";if(e===document.head)return"/html/head";if(e===document.body)return"/html/body";const t=e.parentNode;if(!t)return"";const r=e.tagName.toLowerCase(),i=Array.from(t.children).filter(n=>n.tagName.toLowerCase()===r),o=i.length>1?`[${i.indexOf(e)+1}]`:"";return`${gs(t)}/${r}${o}`}case Node.TEXT_NODE:case Node.CDATA_SECTION_NODE:case Node.COMMENT_NODE:{const e=s.parentNode;if(!e)return"";const t={[Node.TEXT_NODE]:"text()",[Node.CDATA_SECTION_NODE]:"text()",[Node.COMMENT_NODE]:"comment()"},r=Array.from(e.childNodes).filter(o=>o.nodeType===s.nodeType),i=r.length>1?`[${r.indexOf(s)}]`:"";return`${gs(e)}/${t[s.nodeType]}${i}`}default:return""}}function eu(s){var e;const t=ee.parentNode(s),r=t&&t;return!r||!ri(r)?!1:((e=s.textContent)==null?void 0:e.trim())!==""}function ri(s){return ee.getElementVisibility(s).isVisible}const tu=["change","submit","dragstart","drop","pointerdown","pointerup","input","keydown","keyup","keypress","mouseenter","mouseleave","mouseup","mousedown","click","contextmenu","dblclick","focus","blur","touchstart","touchmove","touchend","touchcancel"],ru=["a","button","input","select","textarea","label","details","summary","dialog","video","audio"],su=["onclick","ondblclick","onmousedown","onmouseup","onmouseover","onmouseout","onmousemove","onfocus","onblur","onkeydown","onkeypress","onkeyup","onchange","oninput","onsubmit","onreset","onselect","oncontextmenu","ontouchstart","ontouchmove","ontouchend","ontouchcancel"],si=new WeakSet,iu=EventTarget.prototype.addEventListener;EventTarget.prototype.addEventListener=function(s,e,t){if(iu.call(this,s,e,t),this instanceof Element){const r=s.toLowerCase();tu.includes(r)&&si.add(this)}};const nu=EventTarget.prototype.removeEventListener;EventTarget.prototype.removeEventListener=function(s,e,t){nu.call(this,s,e,t)};function ou(s){return s instanceof Element&&si.has(s)}function au(s){if(s.nodeType===Node.ELEMENT_NODE){const e=s,t=e.tagName.toLowerCase();if(ru.includes(t))return!0;const r=e.hasAttribute("tabindex")&&e.getAttribute("tabindex")!=="-1",i=["button","link","checkbox","switch","menuitem"].includes(e.getAttribute("role")||"");return ou(e)||r||i||e instanceof HTMLAnchorElement&&e.hasAttribute("href")||e instanceof HTMLButtonElement&&!e.disabled}return!1}function en(){document.querySelectorAll("*").forEach(e=>{su.forEach(t=>{e.hasAttribute(t)&&si.add(e)})})}try{document.readyState==="complete"||document.readyState==="interactive"?en():document.addEventListener("DOMContentLoaded",en)}catch(s){}let lu=1;const uu=new RegExp("[^a-z0-9-_:]"),vt=-2;function po(){return lu++}function cu(s){if(s instanceof HTMLFormElement)return"form";const e=Te(s.tagName);return uu.test(e)?"div":e}let ze,tn;const hu=/^[^ \t\n\r\u000c]+/,fu=/^[, \t\n\r\u000c]+/;function du(s,e){if(e.trim()==="")return e;let t=0;function r(o){let n;const a=o.exec(e.substring(t));return a?(n=a[0],t+=n.length,n):""}const i=[];for(;r(fu),!(t>=e.length);){let o=r(hu);if(o.slice(-1)===",")o=Ye(s,o.substring(0,o.length-1)),i.push(o);else{let n="";o=Ye(s,o);let a=!1;for(;;){const l=e.charAt(t);if(l===""){i.push((o+n).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){t+=1,i.push((o+n).trim());break}else l==="("&&(a=!0);n+=l,t+=1}}}return i.join(", ")}const rn=new WeakMap;function Ye(s,e){return!e||e.trim()===""?e:ii(s,e)}function pu(s){return!!(s.tagName==="svg"||s.ownerSVGElement)}function ii(s,e){let t=rn.get(s);if(t||(t=s.createElement("a"),rn.set(s,t)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return t.setAttribute("href",e),t.href}function mo(s,e,t,r){return r&&(t==="src"||t==="href"&&!(e==="use"&&r[0]==="#")||t==="xlink:href"&&r[0]!=="#"||t==="background"&&(e==="table"||e==="td"||e==="th")?Ye(s,r):t==="srcset"?du(s,r):t==="style"?gr(r,ii(s)):e==="object"&&t==="data"?Ye(s,r):r)}function go(s,e,t){return(s==="video"||s==="audio")&&e==="autoplay"}function ys(s,e){return typeof e=="string"?s.includes(e):e.test(s)}function mu(s,e,t){try{if(typeof e=="string"){if(s.classList.contains(e))return!0}else for(let r=s.classList.length;r--;){const i=s.classList[r];if(e.test(i))return!0}if(t)return s.matches(t)}catch(r){}return!1}function yr(s,e,t){if(!s)return!1;if(s.nodeType!==s.ELEMENT_NODE)return t?yr(ee.parentNode(s),e,t):!1;for(let r=s.classList.length;r--;){const i=s.classList[r];if(e.test(i))return!0}return t?yr(ee.parentNode(s),e,t):!1}function yo(s,e,t,r){let i;if(mt(s)){if(i=s,!ee.childNodes(i).length)return!1}else{if(ee.parentElement(s)===null)return!1;i=ee.parentElement(s)}try{if(typeof e=="string"){if(r){if(i.closest(`.${e}`))return!0}else if(i.classList.contains(e))return!0}else if(yr(i,e,r))return!0;if(t){if(r){if(i.closest(t))return!0}else if(i.matches(t))return!0}}catch(o){}return!1}function gu(s,e,t){const r=s.contentWindow;if(!r)return;let i=!1,o;try{o=r.document.readyState}catch(a){return}if(o!=="complete"){const a=setTimeout(()=>{i||(e(),i=!0)},t);s.addEventListener("load",()=>{clearTimeout(a),i=!0,e()});return}const n="about:blank";if(r.location.href!==n||s.src===n||s.src==="")return setTimeout(e,0),s.addEventListener("load",e);s.addEventListener("load",e)}function yu(s,e,t){let r=!1,i;try{i=s.sheet}catch(n){return}if(i)return;const o=setTimeout(()=>{r||(e(),r=!0)},t);s.addEventListener("load",()=>{clearTimeout(o),r=!0,e()})}function bu(s,e){const{doc:t,mirror:r,blockClass:i,blockSelector:o,excludeAttribute:n,needsMask:a,inlineStylesheet:l,maskInputOptions:u={},maskTextFn:c,maskInputFn:h,dataURLOptions:f={},inlineImages:g,recordCanvas:p,keepIframeSrcFn:y,newlyAddedElement:d=!1,cssCaptured:m=!1}=e,S=wu(t,r);switch(s.nodeType){case s.DOCUMENT_NODE:return s.compatMode!=="CSS1Compat"?{type:D.Document,childNodes:[],compatMode:s.compatMode}:{type:D.Document,childNodes:[]};case s.DOCUMENT_TYPE_NODE:return{type:D.DocumentType,name:s.name,publicId:s.publicId,systemId:s.systemId,rootId:S};case s.ELEMENT_NODE:return Su(s,{doc:t,blockClass:i,blockSelector:o,excludeAttribute:n,inlineStylesheet:l,maskInputOptions:u,maskInputFn:h,dataURLOptions:f,inlineImages:g,recordCanvas:p,keepIframeSrcFn:y,newlyAddedElement:d,rootId:S});case s.TEXT_NODE:return vu(s,{doc:t,needsMask:a,maskTextFn:c,rootId:S,cssCaptured:m});case s.CDATA_SECTION_NODE:return{type:D.CDATA,textContent:"",rootId:S};case s.COMMENT_NODE:return{type:D.Comment,textContent:ee.textContent(s)||"",rootId:S};default:return!1}}function wu(s,e){if(!e.hasNode(s))return;const t=e.getId(s);return t===1?void 0:t}function vu(s,e){const{needsMask:t,maskTextFn:r,rootId:i,cssCaptured:o}=e,n=ee.parentNode(s),a=n&&n.tagName;let l="";const u=a==="STYLE"?!0:void 0,c=a==="SCRIPT"?!0:void 0;return c?l="SCRIPT_PLACEHOLDER":o||(l=ee.textContent(s),u&&l&&(l=gr(l,ii(e.doc)))),!u&&!c&&l&&t&&(l=r?r(l,ee.parentElement(s)):l.replace(/[\S]/g,"*")),{type:D.Text,textContent:l||"",rootId:i}}function Su(s,e){const{doc:t,blockClass:r,blockSelector:i,excludeAttribute:o,inlineStylesheet:n,maskInputOptions:a={},maskInputFn:l,dataURLOptions:u={},inlineImages:c,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:g=!1,rootId:p}=e,y=mu(s,r,i),d=cu(s);let m={};const S=s.attributes.length;for(let b=0;b<S;b++){const C=s.attributes[b];ys(C.name,o)||go(d,C.name,C.value)||(m[C.name]=mo(t,d,Te(C.name),C.value))}if(d==="link"&&n){const b=Array.from(t.styleSheets).find(E=>E.href===s.href);let C=null;b&&(C=ms(b)),C&&(delete m.rel,delete m.href,m._cssText=C)}if(d==="style"&&s.sheet){let b=ms(s.sheet);b&&(s.childNodes.length>1&&(b=Kl(b,s)),m._cssText=b)}if(d==="input"||d==="textarea"||d==="select"){const b=s.value,C=s.checked;m.type!=="radio"&&m.type!=="checkbox"&&m.type!=="submit"&&m.type!=="button"&&b?m.value=pr({element:s,type:mr(s),tagName:d,value:b,maskInputOptions:a,maskInputFn:l}):C&&(m.checked=C)}if(d==="option"&&(s.selected&&!a.select?m.selected=!0:delete m.selected),d==="dialog"&&s.open&&(m.rr_open_mode=s.matches("dialog:modal")?"modal":"non-modal"),d==="canvas"&&h){if(s.__context==="2d")zl(s)||(m.rr_dataURL=s.toDataURL(u.type,u.quality));else if(!("__context"in s)){const b=s.toDataURL(u.type,u.quality),C=t.createElement("canvas");C.width=s.width,C.height=s.height;const E=C.toDataURL(u.type,u.quality);b!==E&&(m.rr_dataURL=b)}}if(d==="img"&&c){ze||(ze=t.createElement("canvas"),tn=ze.getContext("2d"));const b=s,C=b.currentSrc||b.getAttribute("src")||"<unknown-src>",E=b.crossOrigin,_=()=>{b.removeEventListener("load",_);try{ze.width=b.naturalWidth,ze.height=b.naturalHeight,tn.drawImage(b,0,0),m.rr_dataURL=ze.toDataURL(u.type,u.quality)}catch(A){if(b.crossOrigin!=="anonymous"){b.crossOrigin="anonymous",b.complete&&b.naturalWidth!==0?_():b.addEventListener("load",_);return}else console.warn(`Cannot inline img src=${C}! Error: ${A}`)}b.crossOrigin==="anonymous"&&(E?m.crossOrigin=E:b.removeAttribute("crossorigin"))};b.complete&&b.naturalWidth!==0?_():b.addEventListener("load",_)}if(d==="audio"||d==="video"){const b=m;b.rr_mediaState=s.paused?"paused":"played",b.rr_mediaCurrentTime=s.currentTime,b.rr_mediaPlaybackRate=s.playbackRate,b.rr_mediaMuted=s.muted,b.rr_mediaLoop=s.loop,b.rr_mediaVolume=s.volume}if(g||(s.scrollLeft&&(m.rr_scrollLeft=s.scrollLeft),s.scrollTop&&(m.rr_scrollTop=s.scrollTop)),y){const{width:b,height:C}=s.getBoundingClientRect();m={class:m.class,rr_width:`${b}px`,rr_height:`${C}px`}}d==="iframe"&&!f(m.src)&&(s.contentDocument||(m.rr_src=m.src),delete m.src);let v;try{customElements.get(d)&&(v=!0)}catch(b){}return{type:D.Element,tagName:d,attributes:m,childNodes:[],isSVG:pu(s)||void 0,needBlock:y,rootId:p,isCustom:v}}function G(s){return s==null?"":s.toLowerCase()}function Cu(s,e){if(e.comment&&s.type===D.Comment)return!0;if(s.type===D.Element){if(e.script&&(s.tagName==="script"||s.tagName==="link"&&(s.attributes.rel==="preload"&&s.attributes.as==="script"||s.attributes.rel==="modulepreload")||s.tagName==="link"&&s.attributes.rel==="prefetch"&&typeof s.attributes.href=="string"&&ti(s.attributes.href)==="js"))return!0;if(e.headFavicon&&(s.tagName==="link"&&s.attributes.rel==="shortcut icon"||s.tagName==="meta"&&(G(s.attributes.name).match(/^msapplication-tile(image|color)$/)||G(s.attributes.name)==="application-name"||G(s.attributes.rel)==="icon"||G(s.attributes.rel)==="apple-touch-icon"||G(s.attributes.rel)==="shortcut icon")))return!0;if(s.tagName==="meta"){if(e.headMetaDescKeywords&&G(s.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(G(s.attributes.property).match(/^(og|twitter|fb):/)||G(s.attributes.name).match(/^(og|twitter):/)||G(s.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(G(s.attributes.name)==="robots"||G(s.attributes.name)==="googlebot"||G(s.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&s.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(G(s.attributes.name)==="author"||G(s.attributes.name)==="generator"||G(s.attributes.name)==="framework"||G(s.attributes.name)==="publisher"||G(s.attributes.name)==="progid"||G(s.attributes.property).match(/^article:/)||G(s.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(G(s.attributes.name)==="google-site-verification"||G(s.attributes.name)==="yandex-verification"||G(s.attributes.name)==="csrf-token"||G(s.attributes.name)==="p:domain_verify"||G(s.attributes.name)==="verify-v1"||G(s.attributes.name)==="verification"||G(s.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Ze(s,e){const{doc:t,mirror:r,blockClass:i,blockSelector:o,maskTextClass:n,maskTextSelector:a,excludeAttribute:l,skipChild:u=!1,inlineStylesheet:c=!0,maskInputOptions:h={},maskTextFn:f,maskInputFn:g,slimDOMOptions:p,dataURLOptions:y={},inlineImages:d=!1,recordCanvas:m=!1,onSerialize:S,onIframeLoad:v,iframeLoadTimeout:b=5e3,onStylesheetLoad:C,stylesheetLoadTimeout:E=5e3,keepIframeSrcFn:_=()=>!1,newlyAddedElement:A=!1,cssCaptured:V=!1}=e;let{needsMask:z}=e,{preserveWhiteSpace:J=!0}=e;z||(z=yo(s,n,a,z===void 0));const Q=bu(s,{doc:t,mirror:r,blockClass:i,blockSelector:o,excludeAttribute:l,needsMask:z,inlineStylesheet:c,maskInputOptions:h,maskTextFn:f,maskInputFn:g,dataURLOptions:y,inlineImages:d,recordCanvas:m,keepIframeSrcFn:_,newlyAddedElement:A,cssCaptured:V});if(!Q)return console.warn(s,"not serialized"),null;let te;r.hasNode(s)?te=r.getId(s):Cu(Q,p)||!J&&Q.type===D.Text&&!Q.textContent.replace(/^\s+|\s+$/gm,"").length?te=vt:te=po();const R=Object.assign(Q,{id:te});if(mt(s)||s.nodeType===Node.TEXT_NODE){if(R.xpath=gs(s),mt(s)){const O=ql(s);O&&(R.selector=O)}s.nodeType===Node.TEXT_NODE&&(R.isVisible=eu(s)),s.nodeType===Node.ELEMENT_NODE&&(R.isVisible=ri(s),R.isInteractive=au(s))}if(r.add(s,R),te===vt)return null;S&&S(s);let ie=!u;if(R.type===D.Element){ie=ie&&!R.needBlock,delete R.needBlock;const O=ee.shadowRoot(s);O&&yt(O)&&(R.isShadowHost=!0)}if((R.type===D.Document||R.type===D.Element)&&ie){p.headWhitespace&&R.type===D.Element&&R.tagName==="head"&&(J=!1);const O={doc:t,mirror:r,blockClass:i,blockSelector:o,needsMask:z,maskTextClass:n,maskTextSelector:a,excludeAttribute:l,skipChild:u,inlineStylesheet:c,maskInputOptions:h,maskTextFn:f,maskInputFn:g,slimDOMOptions:p,dataURLOptions:y,inlineImages:d,recordCanvas:m,preserveWhiteSpace:J,onSerialize:S,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:C,stylesheetLoadTimeout:E,keepIframeSrcFn:_,cssCaptured:!1};if(!(R.type===D.Element&&R.tagName==="textarea"&&R.attributes.value!==void 0)){R.type===D.Element&&R.attributes._cssText!==void 0&&typeof R.attributes._cssText=="string"&&(O.cssCaptured=!0);for(const de of Array.from(ee.childNodes(s))){const ae=Ze(de,O);ae&&R.childNodes.push(ae)}}let ue=null;if(mt(s)&&(ue=ee.shadowRoot(s)))for(const de of Array.from(ee.childNodes(ue))){const ae=Ze(de,O);ae&&(yt(ue)&&(ae.isShadow=!0),R.childNodes.push(ae))}}const ne=ee.parentNode(s);return ne&&gt(ne)&&yt(ne)&&(R.isShadow=!0),R.type===D.Element&&R.tagName==="iframe"&&gu(s,()=>{const O=s.contentDocument;if(O&&v){const ue=Ze(O,{doc:O,mirror:r,blockClass:i,blockSelector:o,needsMask:z,maskTextClass:n,maskTextSelector:a,excludeAttribute:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:h,maskTextFn:f,maskInputFn:g,slimDOMOptions:p,dataURLOptions:y,inlineImages:d,recordCanvas:m,preserveWhiteSpace:J,onSerialize:S,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:C,stylesheetLoadTimeout:E,keepIframeSrcFn:_});ue&&v(s,ue)}},b),R.type===D.Element&&R.tagName==="link"&&typeof R.attributes.rel=="string"&&(R.attributes.rel==="stylesheet"||R.attributes.rel==="preload"&&typeof R.attributes.href=="string"&&ti(R.attributes.href)==="css")&&yu(s,()=>{if(C){const O=Ze(s,{doc:t,mirror:r,blockClass:i,blockSelector:o,needsMask:z,maskTextClass:n,maskTextSelector:a,excludeAttribute:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:h,maskTextFn:f,maskInputFn:g,slimDOMOptions:p,dataURLOptions:y,inlineImages:d,recordCanvas:m,preserveWhiteSpace:J,onSerialize:S,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:C,stylesheetLoadTimeout:E,keepIframeSrcFn:_});O&&C(s,O)}},E),R}function Eu(s,e){const{mirror:t=new ei,blockClass:r="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:n=null,excludeAttribute:a=/.^/,inlineStylesheet:l=!0,inlineImages:u=!1,recordCanvas:c=!1,maskAllInputs:h=!1,maskTextFn:f,maskInputFn:g,slimDOM:p=!1,dataURLOptions:y,preserveWhiteSpace:d,onSerialize:m,onIframeLoad:S,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:E=()=>!1}=e||{};return Ze(s,{doc:s,mirror:t,blockClass:r,blockSelector:i,maskTextClass:o,maskTextSelector:n,excludeAttribute:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:h===!1?{password:!0}:h,maskTextFn:f,maskInputFn:g,slimDOMOptions:p===!0||p==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:p==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:p===!1?{}:p,dataURLOptions:y,inlineImages:u,recordCanvas:c,preserveWhiteSpace:d,onSerialize:m,onIframeLoad:S,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:E,newlyAddedElement:!1})}const xu=/(max|min)-device-(width|height)/,sn=new RegExp(xu.source,"g"),Iu={postcssPlugin:"postcss-custom-selectors",prepare(){return{postcssPlugin:"postcss-custom-selectors",AtRule:function(s){s.params.match(sn)&&(s.params=s.params.replace(sn,"$1-$2"))}}}},Mu={postcssPlugin:"postcss-hover-classes",prepare:function(){const s=[];return{Rule:function(e){s.indexOf(e)===-1&&(s.push(e),e.selectors.forEach(function(t){t.includes(":hover")&&(e.selector+=`,
15
15
  `+t.replace(/:hover/g,".\\:hover"))}))}}}};function Nu(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Ru(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var i=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return s[r]}})}),t}var ni={exports:{}},j=String,bo=function(){return{isColorSupported:!1,reset:j,bold:j,dim:j,italic:j,underline:j,inverse:j,hidden:j,strikethrough:j,black:j,red:j,green:j,yellow:j,blue:j,magenta:j,cyan:j,white:j,gray:j,bgBlack:j,bgRed:j,bgGreen:j,bgYellow:j,bgBlue:j,bgMagenta:j,bgCyan:j,bgWhite:j}};ni.exports=bo();ni.exports.createColors=bo;var Au=ni.exports;const Ou={},Tu=Object.freeze(Object.defineProperty({__proto__:null,default:Ou},Symbol.toStringTag,{value:"Module"})),ge=Ru(Tu);let nn=Au,on=ge,bs=class wo extends Error{constructor(e,t,r,i,o,n){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),n&&(this.plugin=n),typeof t!="undefined"&&typeof r!="undefined"&&(typeof t=="number"?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,wo)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line!="undefined"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=nn.isColorSupported),on&&e&&(t=on(t));let r=t.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,r.length),n=String(o).length,a,l;if(e){let{bold:u,gray:c,red:h}=nn.createColors(!0);a=f=>u(h(f)),l=f=>c(f)}else a=l=u=>u;return r.slice(i,o).map((u,c)=>{let h=i+1+c,f=" "+(" "+h).slice(-n)+" | ";if(h===this.line){let g=l(f.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(f)+u+`
16
16
  `+g+a("^")}return" "+l(f)+u}).join(`
17
17
  `)}toString(){let e=this.showSourceCode();return e&&(e=`
@@ -38,7 +38,7 @@ var module = { exports };
38
38
  `.charCodeAt(0),ut=" ".charCodeAt(0),zt="\f".charCodeAt(0),Gt=" ".charCodeAt(0),jt="\r".charCodeAt(0),oc="[".charCodeAt(0),ac="]".charCodeAt(0),lc="(".charCodeAt(0),uc=")".charCodeAt(0),cc="{".charCodeAt(0),hc="}".charCodeAt(0),fc=";".charCodeAt(0),dc="*".charCodeAt(0),pc=":".charCodeAt(0),mc="@".charCodeAt(0),Ht=/[\t\n\f\r "#'()/;[\\\]{}]/g,Yt=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,gc=/.[\r\n"'(/\\]/,gn=/[\da-f]/i;var yc=function(e,t={}){let r=e.css.valueOf(),i=t.ignoreErrors,o,n,a,l,u,c,h,f,g,p,y=r.length,d=0,m=[],S=[];function v(){return d}function b(A){throw e.error("Unclosed "+A,d)}function C(){return S.length===0&&d>=y}function E(A){if(S.length)return S.pop();if(d>=y)return;let V=A?A.ignoreUnclosed:!1;switch(o=r.charCodeAt(d),o){case Wt:case ut:case Gt:case jt:case zt:{n=d;do n+=1,o=r.charCodeAt(n);while(o===ut||o===Wt||o===Gt||o===jt||o===zt);p=["space",r.slice(d,n)],d=n-1;break}case oc:case ac:case cc:case hc:case pc:case fc:case uc:{let z=String.fromCharCode(o);p=[z,z,d];break}case lc:{if(f=m.length?m.pop()[1]:"",g=r.charCodeAt(d+1),f==="url"&&g!==ss&&g!==pn&&g!==ut&&g!==Wt&&g!==Gt&&g!==zt&&g!==jt){n=d;do{if(c=!1,n=r.indexOf(")",n+1),n===-1)if(i||V){n=d;break}else b("bracket");for(h=n;r.charCodeAt(h-1)===Vt;)h-=1,c=!c}while(c);p=["brackets",r.slice(d,n+1),d,n],d=n}else n=r.indexOf(")",d+1),l=r.slice(d,n+1),n===-1||gc.test(l)?p=["(","(",d]:(p=["brackets",l,d,n],d=n);break}case ss:case pn:{a=o===ss?"'":'"',n=d;do{if(c=!1,n=r.indexOf(a,n+1),n===-1)if(i||V){n=d+1;break}else b("string");for(h=n;r.charCodeAt(h-1)===Vt;)h-=1,c=!c}while(c);p=["string",r.slice(d,n+1),d,n],d=n;break}case mc:{Ht.lastIndex=d+1,Ht.test(r),Ht.lastIndex===0?n=r.length-1:n=Ht.lastIndex-2,p=["at-word",r.slice(d,n+1),d,n],d=n;break}case Vt:{for(n=d,u=!0;r.charCodeAt(n+1)===Vt;)n+=1,u=!u;if(o=r.charCodeAt(n+1),u&&o!==mn&&o!==ut&&o!==Wt&&o!==Gt&&o!==jt&&o!==zt&&(n+=1,gn.test(r.charAt(n)))){for(;gn.test(r.charAt(n+1));)n+=1;r.charCodeAt(n+1)===ut&&(n+=1)}p=["word",r.slice(d,n+1),d,n],d=n;break}default:{o===mn&&r.charCodeAt(d+1)===dc?(n=r.indexOf("*/",d+2)+1,n===0&&(i||V?n=r.length:b("comment")),p=["comment",r.slice(d,n+1),d,n],d=n):(Yt.lastIndex=d+1,Yt.test(r),Yt.lastIndex===0?n=r.length-1:n=Yt.lastIndex-2,p=["word",r.slice(d,n+1),d,n],m.push(p),d=n);break}}return d++,p}function _(A){S.push(A)}return{back:_,endOfFile:C,nextToken:E,position:v}};let Bo=Fe,wr=class extends Bo{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var hi=wr;wr.default=wr;Bo.registerAtRule(wr);let Uo=Fe,Vo,Wo,et=class extends Uo{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let i=super.normalize(e);if(t){if(r==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let o of i)o.raws.before=t.raws.before}return i}removeChild(e,t){let r=this.index(e);return!t&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Vo(new Wo,this,e).stringify()}};et.registerLazyResult=s=>{Vo=s};et.registerProcessor=s=>{Wo=s};var Ot=et;et.default=et;Uo.registerRoot(et);let Ct={comma(s){return Ct.split(s,[","],!0)},space(s){let e=[" ",`
39
39
  `," "];return Ct.split(s,e)},split(s,e,t){let r=[],i="",o=!1,n=0,a=!1,l="",u=!1;for(let c of s)u?u=!1:c==="\\"?u=!0:a?c===l&&(a=!1):c==='"'||c==="'"?(a=!0,l=c):c==="("?n+=1:c===")"?n>0&&(n-=1):n===0&&e.includes(c)&&(o=!0),o?(i!==""&&r.push(i.trim()),i="",o=!1):i+=c;return(t||i!=="")&&r.push(i.trim()),r}};var zo=Ct;Ct.default=Ct;let Go=Fe,bc=zo,vr=class extends Go{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return bc.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var fi=vr;vr.default=vr;Go.registerRule(vr);let wc=kr,vc=yc,Sc=Lr,Cc=hi,Ec=Ot,yn=fi;const bn={empty:!0,space:!0};function xc(s){for(let e=s.length-1;e>=0;e--){let t=s[e],r=t[3]||t[2];if(r)return r}}let Ic=class{constructor(e){this.input=e,this.root=new Ec,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new Cc;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,i,o,n=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){a=!0;break}else if(r==="}"){if(l.length>0){for(o=l.length-1,i=l[o];i&&i[0]==="space";)i=l[--o];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else l.push(e);else l.push(e);if(this.tokenizer.endOfFile()){n=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(t.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(t,"params",l),n&&(e=l[l.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),a&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r=0,i;for(let o=t-1;o>=0&&(i=e[o],!(i[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(e){let t=0,r,i,o;for(let[n,a]of e.entries()){if(r=a,i=r[0],i==="("&&(t+=1),i===")"&&(t-=1),t===0&&i===":")if(!o)this.doubleColon(r);else{if(o[0]==="word"&&o[1]==="progid")continue;return n}o=r}return!1}comment(e){let t=new Sc;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let i=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=i[2],t.raws.left=i[1],t.raws.right=i[3]}}createTokenizer(){this.tokenizer=vc(this.input)}decl(e,t){let r=new wc;this.init(r,e[0][2]);let i=e[e.length-1];for(i[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||xc(e)),r.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let u=e[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=e.shift()[1]}r.raws.between="";let o;for(;e.length;)if(o=e.shift(),o[0]===":"){r.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),r.raws.between+=o[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let n=[],a;for(;e.length&&(a=e[0][0],!(a!=="space"&&a!=="comment"));)n.push(e.shift());this.precheckMissedSemicolon(e);for(let u=e.length-1;u>=0;u--){if(o=e[u],o[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(e,u);c=this.spacesFromEnd(e)+c,c!==" !important"&&(r.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=e.slice(0),h="";for(let f=u;f>0;f--){let g=c[f][0];if(h.trim().indexOf("!")===0&&g!=="space")break;h=c.pop()[1]+h}h.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=h,e=c)}if(o[0]!=="space"&&o[0]!=="comment")break}e.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=n.map(u=>u[1]).join(""),n=[]),this.raw(r,"value",n.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new yn;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,r=null,i=!1,o=null,n=[],a=e[1].startsWith("--"),l=[],u=e;for(;u;){if(r=u[0],l.push(u),r==="("||r==="[")o||(o=u),n.push(r==="("?")":"]");else if(a&&i&&r==="{")o||(o=u),n.push("}");else if(n.length===0)if(r===";")if(i){this.decl(l,a);return}else break;else if(r==="{"){this.rule(l);return}else if(r==="}"){this.tokenizer.back(l.pop()),t=!0;break}else r===":"&&(i=!0);else r===n[n.length-1]&&(n.pop(),n.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),n.length>0&&this.unclosedBracket(o),t&&i){if(!a)for(;l.length&&(u=l[l.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(l.pop());this.decl(l,a)}else this.unknownWord(l)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,i){let o,n,a=r.length,l="",u=!0,c,h;for(let f=0;f<a;f+=1)o=r[f],n=o[0],n==="space"&&f===a-1&&!i?u=!1:n==="comment"?(h=r[f-1]?r[f-1][0]:"empty",c=r[f+1]?r[f+1][0]:"empty",!bn[h]&&!bn[c]?l.slice(-1)===","?u=!1:l+=o[1]:u=!1):l+=o[1];if(!u){let f=r.reduce((g,p)=>g+p[1],"");e.raws[t]={raw:f,value:l}}e[t]=l}rule(e){e.pop();let t=new yn;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],!(t!=="space"&&t!=="comment"));)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],t==="space");)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let i=t;i<e.length;i++)r+=e[i][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};var Mc=Ic;let Nc=Fe,Rc=Mc,Ac=$r;function Sr(s,e){let t=new Ac(s,e),r=new Rc(t);try{r.parse()}catch(i){throw i}return r.root}var di=Sr;Sr.default=Sr;Nc.registerParse(Sr);let{isClean:we,my:Oc}=At,Tc=Mo,Dc=Dr,_c=Fe,kc=ui;let wn=ci,$c=di,Lc=Ot;const Pc={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Fc={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},Bc={Once:!0,postcssPlugin:!0,prepare:!0},tt=0;function ct(s){return typeof s=="object"&&typeof s.then=="function"}function jo(s){let e=!1,t=Pc[s.type];return s.type==="decl"?e=s.prop.toLowerCase():s.type==="atrule"&&(e=s.name.toLowerCase()),e&&s.append?[t,t+"-"+e,tt,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:s.append?[t,tt,t+"Exit"]:[t,t+"Exit"]}function vn(s){let e;return s.type==="document"?e=["Document",tt,"DocumentExit"]:s.type==="root"?e=["Root",tt,"RootExit"]:e=jo(s),{eventIndex:0,events:e,iterator:0,node:s,visitorIndex:0,visitors:[]}}function Os(s){return s[we]=!1,s.nodes&&s.nodes.forEach(e=>Os(e)),s}let Ts={},rt=class Ho{constructor(e,t,r){this.stringified=!1,this.processed=!1;let i;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))i=Os(t);else if(t instanceof Ho||t instanceof wn)i=Os(t.root),t.map&&(typeof r.map=="undefined"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let o=$c;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(t,r)}catch(n){this.processed=!0,this.error=n}i&&!i[Oc]&&_c.rebuild(i)}this.result=new wn(e,i,r),this.helpers=q(N({},Ts),{postcss:Ts,result:this.result}),this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?N(N({},o),o.prepare(this.result)):o)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=r.postcssPlugin,e.setMessage()):r.postcssVersion}catch(i){console&&console.error&&console.error(i)}return e}prepareVisitors(){this.listeners={};let e=(t,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([t,i])};for(let t of this.plugins)if(typeof t=="object")for(let r in t){if(!Fc[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Bc[r])if(typeof t[r]=="object")for(let i in t[r])i==="*"?e(t,r,t[r][i]):e(t,r+"-"+i.toLowerCase(),t[r][i]);else typeof t[r]=="function"&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(ct(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[we];){e[we]=!0;let t=[vn(e)];for(;t.length>0;){let r=this.visitTick(t);if(ct(r))try{await r}catch(i){let o=t[t.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let i=e.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(e,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return ct(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Dc;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new Tc(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){let t=this.runOnRoot(e);if(ct(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[we];)e[we]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,i]of e){this.result.lastPlugin=r;let o;try{o=i(t,this.helpers)}catch(n){throw this.handleError(n,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(ct(o))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:i}=t;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(i.length>0&&t.visitorIndex<i.length){let[n,a]=i[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===i.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=n;try{return a(r.toProxy(),this.helpers)}catch(l){throw this.handleError(l,r)}}if(t.iterator!==0){let n=t.iterator,a;for(;a=r.nodes[r.indexes[n]];)if(r.indexes[n]+=1,!a[we]){a[we]=!0,e.push(vn(a));return}t.iterator=0,delete r.indexes[n]}let o=t.events;for(;t.eventIndex<o.length;){let n=o[t.eventIndex];if(t.eventIndex+=1,n===tt){r.nodes&&r.nodes.length&&(r[we]=!0,t.iterator=r.getIterator());return}else if(this.listeners[n]){t.visitors=this.listeners[n];return}}e.pop()}walkSync(e){e[we]=!0;let t=jo(e);for(let r of t)if(r===tt)e.nodes&&e.each(i=>{i[we]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};rt.registerPostcss=s=>{Ts=s};var Yo=rt;rt.default=rt;Lc.registerLazyResult(rt);kc.registerLazyResult(rt);let Uc=Mo,Vc=Dr;let Wc=di;const zc=ci;let Ds=class{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let i,o=Vc;this.result=new zc(this._processor,i,this._opts),this.result.css=t;let n=this;Object.defineProperty(this.result,"root",{get(){return n.root}});let a=new Uc(o,i,this._opts,t);if(a.isMap()){let[l,u]=a.generate();l&&(this.result.css=l),u&&(this.result.map=u)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=Wc;try{e=t(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Gc=Ds;Ds.default=Ds;let jc=Gc,Hc=Yo,Yc=ui,Zc=Ot,Et=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)t.push(r);else if(typeof r=="function")t.push(r);else if(!(typeof r=="object"&&(r.parse||r.stringify)))throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new jc(this,e,t):new Hc(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Xc=Et;Et.default=Et;Zc.registerProcessor(Et);Yc.registerProcessor(Et);let Jc=kr,Kc=So,Qc=Lr,qc=hi,eh=$r,th=Ot,rh=fi;function xt(s,e){if(Array.isArray(s))return s.map(n=>xt(n));let i=s,{inputs:t}=i,r=We(i,["inputs"]);if(t){e=[];for(let n of t){let a=q(N({},n),{__proto__:eh.prototype});a.map&&(a.map=q(N({},a.map),{__proto__:Kc.prototype})),e.push(a)}}if(r.nodes&&(r.nodes=s.nodes.map(n=>xt(n,e))),r.source){let o=r.source,{inputId:n}=o,a=We(o,["inputId"]);r.source=a,n!=null&&(r.source.input=e[n])}if(r.type==="root")return new th(r);if(r.type==="decl")return new Jc(r);if(r.type==="rule")return new rh(r);if(r.type==="comment")return new Qc(r);if(r.type==="atrule")return new qc(r);throw new Error("Unknown node type: "+s.type)}var sh=xt;xt.default=xt;let ih=oi,Zo=kr,nh=Yo,oh=Fe,pi=Xc,ah=Dr,lh=sh,Xo=ui,uh=Fo,Jo=Lr,Ko=hi,ch=ci,hh=$r,fh=di,dh=zo,Qo=fi,qo=Ot,ph=_r;function B(...s){return s.length===1&&Array.isArray(s[0])&&(s=s[0]),new pi(s)}B.plugin=function(e,t){let r=!1;function i(...n){console&&console.warn&&!r&&(r=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
40
40
  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:
41
- https://www.w3ctech.com/topic/2226`));let a=t(...n);return a.postcssPlugin=e,a.postcssVersion=new pi().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(n,a,l){return B([i(l)]).process(n,a)},i};B.stringify=ah;B.parse=fh;B.fromJSON=lh;B.list=dh;B.comment=s=>new Jo(s);B.atRule=s=>new Ko(s);B.decl=s=>new Zo(s);B.rule=s=>new Qo(s);B.root=s=>new qo(s);B.document=s=>new Xo(s);B.CssSyntaxError=ih;B.Declaration=Zo;B.Container=oh;B.Processor=pi;B.Document=Xo;B.Comment=Jo;B.Warning=uh;B.AtRule=Ko;B.Result=ch;B.Input=hh;B.Rule=Qo;B.Root=qo;B.Node=ph;nh.registerPostcss(B);var mh=B;B.default=B;const Y=Nu(mh);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;const Sn={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function gh(s){let e=Sn[s.tagName]?Sn[s.tagName]:s.tagName;return e==="link"&&s.attributes._cssText&&(e="style"),e}function Pr(s,e){const t=e==null?void 0:e.stylesWithHoverClass.get(s);if(t)return t;let r=s;try{r=Y([Iu,Mu]).process(s).css}catch(i){console.warn("Failed to adapt css for replay",i)}return e==null||e.stylesWithHoverClass.set(s,r),r}function Cn(){return{stylesWithHoverClass:new Map}}function yh(s,e,t,r){const i=[];for(const l of s.childNodes)l.type===D.Text&&i.push(l);const o=e.split("/* rr_split */");for(;o.length>1&&o.length>i.length;)o.splice(-2,2,o.slice(-2).join(""));let n="";t&&(n=Pr(o.join(""),r));let a=0;for(let l=0;l<i.length&&l!==o.length;l++){const u=i[l];if(!t)u.textContent=o[l];else if(l<o.length-1){let c=a,h=o[l+1].length;h=Math.min(h,30);let f=!1;for(;h>2;h--){const g=o[l+1].substring(0,h),p=n.substring(a).indexOf(g);if(f=p!==-1,f){c+=p;break}}f||(c+=o[l].length),u.textContent=n.substring(a,c),a=c}else u.textContent=n.substring(a)}}function bh(s,e,t,r){const{doc:i,hackCss:o,cache:n}=r;s.childNodes.length?yh(s,t,o,n):(o&&(t=Pr(t,n)),e.appendChild(i.createTextNode(t)))}function wh(s,e){var t;const{doc:r,hackCss:i,cache:o}=e;switch(s.type){case D.Document:return r.implementation.createDocument(null,"",null);case D.DocumentType:return r.implementation.createDocumentType(s.name||"html",s.publicId,s.systemId);case D.Element:{const n=gh(s);let a;s.isSVG?a=r.createElementNS("http://www.w3.org/2000/svg",n):(s.isCustom&&((t=r.defaultView)!=null&&t.customElements)&&!r.defaultView.customElements.get(s.tagName)&&r.defaultView.customElements.define(s.tagName,class extends r.defaultView.HTMLElement{}),a=r.createElement(n));const l={};for(const u in s.attributes){if(!Object.prototype.hasOwnProperty.call(s.attributes,u))continue;let c=s.attributes[u];if(!(n==="option"&&u==="selected"&&c===!1)&&c!==null){if(c===!0&&(c=""),u.startsWith("rr_")){l[u]=c;continue}if(typeof c=="string"){if(n==="style"&&u==="_cssText"){bh(s,a,c,e);continue}else if(n==="textarea"&&u==="value"){a.appendChild(r.createTextNode(c)),s.childNodes=[];continue}}try{if(s.isSVG&&u==="xlink:href")a.setAttributeNS("http://www.w3.org/1999/xlink",u,c.toString());else if(u==="onload"||u==="onclick"||u.substring(0,7)==="onmouse")a.setAttribute("_"+u,c.toString());else if(n==="meta"&&s.attributes["http-equiv"]==="Content-Security-Policy"&&u==="content"){a.setAttribute("csp-content",c.toString());continue}else n==="link"&&(s.attributes.rel==="preload"&&s.attributes.as==="script"||s.attributes.rel==="modulepreload")||n==="link"&&s.attributes.rel==="prefetch"&&typeof s.attributes.href=="string"&&ti(s.attributes.href)==="js"||(n==="img"&&s.attributes.srcset&&s.attributes.rr_dataURL?a.setAttribute("rrweb-original-srcset",s.attributes.srcset):a.setAttribute(u,c.toString()))}catch(h){}}}for(const u in l){const c=l[u];if(n==="canvas"&&u==="rr_dataURL"){const h=r.createElement("img");h.onload=()=>{const f=a.getContext("2d");f&&f.drawImage(h,0,0,h.width,h.height)},h.src=c.toString(),a.RRNodeType&&(a.rr_dataURL=c.toString())}else if(n==="img"&&u==="rr_dataURL"){const h=a;h.currentSrc.startsWith("data:")||(h.setAttribute("rrweb-original-src",s.attributes.src),h.src=c.toString())}if(u==="rr_width")a.style.setProperty("width",c.toString());else if(u==="rr_height")a.style.setProperty("height",c.toString());else if(u==="rr_mediaCurrentTime"&&typeof c=="number")a.currentTime=c;else if(u==="rr_mediaState")switch(c){case"played":a.play().catch(h=>console.warn("media playback error",h));break;case"paused":a.pause();break}else u==="rr_mediaPlaybackRate"&&typeof c=="number"?a.playbackRate=c:u==="rr_mediaMuted"&&typeof c=="boolean"?a.muted=c:u==="rr_mediaLoop"&&typeof c=="boolean"?a.loop=c:u==="rr_mediaVolume"&&typeof c=="number"?a.volume=c:u==="rr_open_mode"&&a.setAttribute("rr_open_mode",c)}if(s.isShadowHost)if(!a.shadowRoot)a.attachShadow({mode:"open"});else for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);return a}case D.Text:return s.isStyle&&i?r.createTextNode(Pr(s.textContent,o)):r.createTextNode(s.textContent);case D.CDATA:return r.createCDATASection(s.textContent);case D.Comment:return r.createComment(s.textContent);default:return null}}function bt(s,e){const{doc:t,mirror:r,skipChild:i=!1,hackCss:o=!0,afterAppend:n,cache:a}=e;if(r.has(s.id)){const u=r.getNode(s.id),c=r.getMeta(u);if(Gl(c,s))return r.getNode(s.id)}let l=wh(s,{doc:t,hackCss:o,cache:a});if(!l)return null;if(s.rootId&&r.getNode(s.rootId)!==t&&r.replace(s.rootId,t),s.type===D.Document&&(t.close(),t.open(),s.compatMode==="BackCompat"&&s.childNodes&&s.childNodes[0].type!==D.DocumentType&&(s.childNodes[0].type===D.Element&&"xmlns"in s.childNodes[0].attributes&&s.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?t.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):t.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),l=t),r.add(l,s),(s.type===D.Document||s.type===D.Element)&&!i)for(const u of s.childNodes){const c=bt(u,{doc:t,mirror:r,skipChild:!1,hackCss:o,afterAppend:n,cache:a});if(!c){console.warn("Failed to rebuild",u);continue}if(u.isShadow&&mt(l)&&l.shadowRoot)l.shadowRoot.appendChild(c);else if(s.type===D.Document&&u.type==D.Element){const h=c;let f=null;h.childNodes.forEach(g=>{g.nodeName==="BODY"&&(f=g)}),f?(h.removeChild(f),l.appendChild(c),h.appendChild(f)):l.appendChild(c)}else l.appendChild(c);n&&n(c,u.id)}return l}function vh(s,e){function t(r){e(r)}for(const r of s.getIds())s.has(r)&&t(s.getNode(r))}function Sh(s,e){const t=e.getMeta(s);if((t==null?void 0:t.type)!==D.Element)return;const r=s;for(const i in t.attributes){if(!(Object.prototype.hasOwnProperty.call(t.attributes,i)&&i.startsWith("rr_")))continue;const o=t.attributes[i];i==="rr_scrollLeft"&&(r.scrollLeft=o),i==="rr_scrollTop"&&(r.scrollTop=o)}}function Ch(s,e){const{doc:t,onVisit:r,hackCss:i=!0,afterAppend:o,cache:n,mirror:a=new ei}=e,l=bt(s,{doc:t,mirror:a,skipChild:!1,hackCss:i,afterAppend:o,cache:n});return vh(a,u=>{r&&r(u),Sh(u,a)}),l}var Eh=Object.defineProperty,xh=(s,e,t)=>e in s?Eh(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,I=(s,e,t)=>xh(s,typeof e!="symbol"?e+"":e,t),Ih=Object.defineProperty,Mh=(s,e,t)=>e in s?Ih(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,En=(s,e,t)=>Mh(s,typeof e!="symbol"?e+"":e,t);let Nh=class{constructor(){En(this,"idNodeMap",new Map),En(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 Rh(){return new Nh}const Ah=["change","submit","dragstart","drop","pointerdown","pointerup","input","keydown","keyup","keypress","mouseenter","mouseleave","mouseup","mousedown","click","contextmenu","dblclick","focus","blur","touchstart","touchmove","touchend","touchcancel"],Oh=["onclick","ondblclick","onmousedown","onmouseup","onmouseover","onmouseout","onmousemove","onfocus","onblur","onkeydown","onkeypress","onkeyup","onchange","oninput","onsubmit","onreset","onselect","oncontextmenu","ontouchstart","ontouchmove","ontouchend","ontouchcancel"],ea=new WeakSet,Th=EventTarget.prototype.addEventListener;EventTarget.prototype.addEventListener=function(s,e,t){if(Th.call(this,s,e,t),this instanceof Element){const r=s.toLowerCase();Ah.includes(r)&&ea.add(this)}};const Dh=EventTarget.prototype.removeEventListener;EventTarget.prototype.removeEventListener=function(s,e,t){Dh.call(this,s,e,t)};function xn(){document.querySelectorAll("*").forEach(e=>{Oh.forEach(t=>{e.hasAttribute(t)&&ea.add(e)})})}document.readyState==="complete"||document.readyState==="interactive"?xn():document.addEventListener("DOMContentLoaded",xn);function _h(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function kh(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var i=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return s[r]}})}),t}var mi={exports:{}},H=String,ta=function(){return{isColorSupported:!1,reset:H,bold:H,dim:H,italic:H,underline:H,inverse:H,hidden:H,strikethrough:H,black:H,red:H,green:H,yellow:H,blue:H,magenta:H,cyan:H,white:H,gray:H,bgBlack:H,bgRed:H,bgGreen:H,bgYellow:H,bgBlue:H,bgMagenta:H,bgCyan:H,bgWhite:H}};mi.exports=ta();mi.exports.createColors=ta;var $h=mi.exports;const Lh={},Ph=Object.freeze(Object.defineProperty({__proto__:null,default:Lh},Symbol.toStringTag,{value:"Module"})),ye=kh(Ph);let In=$h,Mn=ye,_s=class ra extends Error{constructor(e,t,r,i,o,n){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),n&&(this.plugin=n),typeof t!="undefined"&&typeof r!="undefined"&&(typeof t=="number"?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,ra)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line!="undefined"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=In.isColorSupported),Mn&&e&&(t=Mn(t));let r=t.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,r.length),n=String(o).length,a,l;if(e){let{bold:u,gray:c,red:h}=In.createColors(!0);a=f=>u(h(f)),l=f=>c(f)}else a=l=u=>u;return r.slice(i,o).map((u,c)=>{let h=i+1+c,f=" "+(" "+h).slice(-n)+" | ";if(h===this.line){let g=l(f.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(f)+u+`
41
+ https://www.w3ctech.com/topic/2226`));let a=t(...n);return a.postcssPlugin=e,a.postcssVersion=new pi().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(n,a,l){return B([i(l)]).process(n,a)},i};B.stringify=ah;B.parse=fh;B.fromJSON=lh;B.list=dh;B.comment=s=>new Jo(s);B.atRule=s=>new Ko(s);B.decl=s=>new Zo(s);B.rule=s=>new Qo(s);B.root=s=>new qo(s);B.document=s=>new Xo(s);B.CssSyntaxError=ih;B.Declaration=Zo;B.Container=oh;B.Processor=pi;B.Document=Xo;B.Comment=Jo;B.Warning=uh;B.AtRule=Ko;B.Result=ch;B.Input=hh;B.Rule=Qo;B.Root=qo;B.Node=ph;nh.registerPostcss(B);var mh=B;B.default=B;const Y=Nu(mh);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;const Sn={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function gh(s){let e=Sn[s.tagName]?Sn[s.tagName]:s.tagName;return e==="link"&&s.attributes._cssText&&(e="style"),e}function Pr(s,e){const t=e==null?void 0:e.stylesWithHoverClass.get(s);if(t)return t;let r=s;try{r=Y([Iu,Mu]).process(s).css}catch(i){console.warn("Failed to adapt css for replay",i)}return e==null||e.stylesWithHoverClass.set(s,r),r}function Cn(){return{stylesWithHoverClass:new Map}}function yh(s,e,t,r){const i=[];for(const l of s.childNodes)l.type===D.Text&&i.push(l);const o=e.split("/* rr_split */");for(;o.length>1&&o.length>i.length;)o.splice(-2,2,o.slice(-2).join(""));let n="";t&&(n=Pr(o.join(""),r));let a=0;for(let l=0;l<i.length&&l!==o.length;l++){const u=i[l];if(!t)u.textContent=o[l];else if(l<o.length-1){let c=a,h=o[l+1].length;h=Math.min(h,30);let f=!1;for(;h>2;h--){const g=o[l+1].substring(0,h),p=n.substring(a).indexOf(g);if(f=p!==-1,f){c+=p;break}}f||(c+=o[l].length),u.textContent=n.substring(a,c),a=c}else u.textContent=n.substring(a)}}function bh(s,e,t,r){const{doc:i,hackCss:o,cache:n}=r;s.childNodes.length?yh(s,t,o,n):(o&&(t=Pr(t,n)),e.appendChild(i.createTextNode(t)))}function wh(s,e){var t;const{doc:r,hackCss:i,cache:o}=e;switch(s.type){case D.Document:return r.implementation.createDocument(null,"",null);case D.DocumentType:return r.implementation.createDocumentType(s.name||"html",s.publicId,s.systemId);case D.Element:{const n=gh(s);let a;s.isSVG?a=r.createElementNS("http://www.w3.org/2000/svg",n):(s.isCustom&&((t=r.defaultView)!=null&&t.customElements)&&!r.defaultView.customElements.get(s.tagName)&&r.defaultView.customElements.define(s.tagName,class extends r.defaultView.HTMLElement{}),a=r.createElement(n));const l={};for(const u in s.attributes){if(!Object.prototype.hasOwnProperty.call(s.attributes,u))continue;let c=s.attributes[u];if(!(n==="option"&&u==="selected"&&c===!1)&&c!==null){if(c===!0&&(c=""),u.startsWith("rr_")){l[u]=c;continue}if(typeof c=="string"){if(n==="style"&&u==="_cssText"){bh(s,a,c,e);continue}else if(n==="textarea"&&u==="value"){a.appendChild(r.createTextNode(c)),s.childNodes=[];continue}}try{if(s.isSVG&&u==="xlink:href")a.setAttributeNS("http://www.w3.org/1999/xlink",u,c.toString());else if(u==="onload"||u==="onclick"||u.substring(0,7)==="onmouse")a.setAttribute("_"+u,c.toString());else if(n==="meta"&&s.attributes["http-equiv"]==="Content-Security-Policy"&&u==="content"){a.setAttribute("csp-content",c.toString());continue}else n==="link"&&(s.attributes.rel==="preload"&&s.attributes.as==="script"||s.attributes.rel==="modulepreload")||n==="link"&&s.attributes.rel==="prefetch"&&typeof s.attributes.href=="string"&&ti(s.attributes.href)==="js"||(n==="img"&&s.attributes.srcset&&s.attributes.rr_dataURL?a.setAttribute("rrweb-original-srcset",s.attributes.srcset):a.setAttribute(u,c.toString()))}catch(h){}}}for(const u in l){const c=l[u];if(n==="canvas"&&u==="rr_dataURL"){const h=r.createElement("img");h.onload=()=>{const f=a.getContext("2d");f&&f.drawImage(h,0,0,h.width,h.height)},h.src=c.toString(),a.RRNodeType&&(a.rr_dataURL=c.toString())}else if(n==="img"&&u==="rr_dataURL"){const h=a;h.currentSrc.startsWith("data:")||(h.setAttribute("rrweb-original-src",s.attributes.src),h.src=c.toString())}if(u==="rr_width")a.style.setProperty("width",c.toString());else if(u==="rr_height")a.style.setProperty("height",c.toString());else if(u==="rr_mediaCurrentTime"&&typeof c=="number")a.currentTime=c;else if(u==="rr_mediaState")switch(c){case"played":a.play().catch(h=>console.warn("media playback error",h));break;case"paused":a.pause();break}else u==="rr_mediaPlaybackRate"&&typeof c=="number"?a.playbackRate=c:u==="rr_mediaMuted"&&typeof c=="boolean"?a.muted=c:u==="rr_mediaLoop"&&typeof c=="boolean"?a.loop=c:u==="rr_mediaVolume"&&typeof c=="number"?a.volume=c:u==="rr_open_mode"&&a.setAttribute("rr_open_mode",c)}if(s.isShadowHost)if(!a.shadowRoot)a.attachShadow({mode:"open"});else for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);return a}case D.Text:return s.isStyle&&i?r.createTextNode(Pr(s.textContent,o)):r.createTextNode(s.textContent);case D.CDATA:return r.createCDATASection(s.textContent);case D.Comment:return r.createComment(s.textContent);default:return null}}function bt(s,e){const{doc:t,mirror:r,skipChild:i=!1,hackCss:o=!0,afterAppend:n,cache:a}=e;if(r.has(s.id)){const u=r.getNode(s.id),c=r.getMeta(u);if(Gl(c,s))return r.getNode(s.id)}let l=wh(s,{doc:t,hackCss:o,cache:a});if(!l)return null;if(s.rootId&&r.getNode(s.rootId)!==t&&r.replace(s.rootId,t),s.type===D.Document&&(t.close(),t.open(),s.compatMode==="BackCompat"&&s.childNodes&&s.childNodes[0].type!==D.DocumentType&&(s.childNodes[0].type===D.Element&&"xmlns"in s.childNodes[0].attributes&&s.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?t.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):t.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),l=t),r.add(l,s),(s.type===D.Document||s.type===D.Element)&&!i)for(const u of s.childNodes){const c=bt(u,{doc:t,mirror:r,skipChild:!1,hackCss:o,afterAppend:n,cache:a});if(!c){console.warn("Failed to rebuild",u);continue}if(u.isShadow&&mt(l)&&l.shadowRoot)l.shadowRoot.appendChild(c);else if(s.type===D.Document&&u.type==D.Element){const h=c;let f=null;h.childNodes.forEach(g=>{g.nodeName==="BODY"&&(f=g)}),f?(h.removeChild(f),l.appendChild(c),h.appendChild(f)):l.appendChild(c)}else l.appendChild(c);n&&n(c,u.id)}return l}function vh(s,e){function t(r){e(r)}for(const r of s.getIds())s.has(r)&&t(s.getNode(r))}function Sh(s,e){const t=e.getMeta(s);if((t==null?void 0:t.type)!==D.Element)return;const r=s;for(const i in t.attributes){if(!(Object.prototype.hasOwnProperty.call(t.attributes,i)&&i.startsWith("rr_")))continue;const o=t.attributes[i];i==="rr_scrollLeft"&&(r.scrollLeft=o),i==="rr_scrollTop"&&(r.scrollTop=o)}}function Ch(s,e){const{doc:t,onVisit:r,hackCss:i=!0,afterAppend:o,cache:n,mirror:a=new ei}=e,l=bt(s,{doc:t,mirror:a,skipChild:!1,hackCss:i,afterAppend:o,cache:n});return vh(a,u=>{r&&r(u),Sh(u,a)}),l}var Eh=Object.defineProperty,xh=(s,e,t)=>e in s?Eh(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,I=(s,e,t)=>xh(s,typeof e!="symbol"?e+"":e,t),Ih=Object.defineProperty,Mh=(s,e,t)=>e in s?Ih(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,En=(s,e,t)=>Mh(s,typeof e!="symbol"?e+"":e,t);let Nh=class{constructor(){En(this,"idNodeMap",new Map),En(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 Rh(){return new Nh}const Ah=["change","submit","dragstart","drop","pointerdown","pointerup","input","keydown","keyup","keypress","mouseenter","mouseleave","mouseup","mousedown","click","contextmenu","dblclick","focus","blur","touchstart","touchmove","touchend","touchcancel"],Oh=["onclick","ondblclick","onmousedown","onmouseup","onmouseover","onmouseout","onmousemove","onfocus","onblur","onkeydown","onkeypress","onkeyup","onchange","oninput","onsubmit","onreset","onselect","oncontextmenu","ontouchstart","ontouchmove","ontouchend","ontouchcancel"],ea=new WeakSet,Th=EventTarget.prototype.addEventListener;EventTarget.prototype.addEventListener=function(s,e,t){if(Th.call(this,s,e,t),this instanceof Element){const r=s.toLowerCase();Ah.includes(r)&&ea.add(this)}};const Dh=EventTarget.prototype.removeEventListener;EventTarget.prototype.removeEventListener=function(s,e,t){Dh.call(this,s,e,t)};function xn(){document.querySelectorAll("*").forEach(e=>{Oh.forEach(t=>{e.hasAttribute(t)&&ea.add(e)})})}try{document.readyState==="complete"||document.readyState==="interactive"?xn():document.addEventListener("DOMContentLoaded",xn)}catch(s){}function _h(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function kh(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var i=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return s[r]}})}),t}var mi={exports:{}},H=String,ta=function(){return{isColorSupported:!1,reset:H,bold:H,dim:H,italic:H,underline:H,inverse:H,hidden:H,strikethrough:H,black:H,red:H,green:H,yellow:H,blue:H,magenta:H,cyan:H,white:H,gray:H,bgBlack:H,bgRed:H,bgGreen:H,bgYellow:H,bgBlue:H,bgMagenta:H,bgCyan:H,bgWhite:H}};mi.exports=ta();mi.exports.createColors=ta;var $h=mi.exports;const Lh={},Ph=Object.freeze(Object.defineProperty({__proto__:null,default:Lh},Symbol.toStringTag,{value:"Module"})),ye=kh(Ph);let In=$h,Mn=ye,_s=class ra extends Error{constructor(e,t,r,i,o,n){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),n&&(this.plugin=n),typeof t!="undefined"&&typeof r!="undefined"&&(typeof t=="number"?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,ra)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line!="undefined"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=In.isColorSupported),Mn&&e&&(t=Mn(t));let r=t.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,r.length),n=String(o).length,a,l;if(e){let{bold:u,gray:c,red:h}=In.createColors(!0);a=f=>u(h(f)),l=f=>c(f)}else a=l=u=>u;return r.slice(i,o).map((u,c)=>{let h=i+1+c,f=" "+(" "+h).slice(-n)+" | ";if(h===this.line){let g=l(f.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(f)+u+`
42
42
  `+g+a("^")}return" "+l(f)+u}).join(`
43
43
  `)}toString(){let e=this.showSourceCode();return e&&(e=`
44
44
 
@@ -66,7 +66,7 @@ https://www.w3ctech.com/topic/2226`));let a=t(...n);return a.postcssPlugin=e,a.p
66
66
  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:
67
67
  https://www.w3ctech.com/topic/2226`));let a=t(...n);return a.postcssPlugin=e,a.postcssVersion=new xi().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(n,a,l){return U([i(l)]).process(n,a)},i};U.stringify=pd;U.parse=wd;U.fromJSON=md;U.list=vd;U.comment=s=>new _a(s);U.atRule=s=>new ka(s);U.decl=s=>new Ta(s);U.rule=s=>new $a(s);U.root=s=>new La(s);U.document=s=>new Da(s);U.CssSyntaxError=hd;U.Declaration=Ta;U.Container=dd;U.Processor=xi;U.Document=Da;U.Comment=_a;U.Warning=gd;U.AtRule=ka;U.Result=yd;U.Input=bd;U.Rule=$a;U.Root=La;U.Node=Sd;fd.registerPostcss(U);var Cd=U;U.default=U;const X=_h(Cd);X.stringify;X.fromJSON;X.plugin;X.parse;X.list;X.document;X.comment;X.atRule;X.rule;X.decl;X.root;X.CssSyntaxError;X.Declaration;X.Container;X.Processor;X.Document;X.Comment;X.Warning;X.AtRule;X.Result;X.Input;X.Rule;X.Root;X.Node;var $=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))($||{});function Ed(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[Zs(n[0].trim())]=n[1].trim())}}),e}function Vn(s){const e=[];for(const t in s){const r=s[t];if(typeof r!="string")continue;const i=Nd(t);e.push(`${i}: ${r};`)}return e.join(" ")}const xd=/-([a-z])/g,Id=/^--[a-zA-Z0-9-]+$/,Zs=s=>Id.test(s)?s:s.replace(xd,(e,t)=>t?t.toUpperCase():""),Md=/\B([A-Z])/g,Nd=s=>s.replace(Md,"-$1").toLowerCase();class be{constructor(...e){I(this,"parentElement",null),I(this,"parentNode",null),I(this,"ownerDocument"),I(this,"firstChild",null),I(this,"lastChild",null),I(this,"previousSibling",null),I(this,"nextSibling",null),I(this,"ELEMENT_NODE",1),I(this,"TEXT_NODE",3),I(this,"nodeType"),I(this,"nodeName"),I(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 be){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 Ii extends be{constructor(...e){super(e),I(this,"nodeType",9),I(this,"nodeName","#document"),I(this,"compatMode","CSS1Compat"),I(this,"RRNodeType",$.Document),I(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(e=>e.RRNodeType===$.Element&&e.tagName==="HTML")||null}get body(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(t=>t.RRNodeType===$.Element&&t.tagName==="BODY"))||null}get head(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(t=>t.RRNodeType===$.Element&&t.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(e){const t=e.RRNodeType;if((t===$.Element||t===$.DocumentType)&&this.childNodes.some(i=>i.RRNodeType===t))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${t===$.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const r=Mi(this,e);return r.parentElement=null,r}insertBefore(e,t){const r=e.RRNodeType;if((r===$.Element||r===$.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${r===$.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const i=Va(this,e,t);return i.parentElement=null,i}removeChild(e){return Wa(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 Ii}createDocumentType(e,t,r){const i=new Pa(e,t,r);return i.ownerDocument=this,i}createElement(e){const t=new zr(e);return t.ownerDocument=this,t}createElementNS(e,t){return this.createElement(t)}createTextNode(e){const t=new Fa(e);return t.ownerDocument=this,t}createComment(e){const t=new Ba(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new Ua(e);return t.ownerDocument=this,t}toString(){return"RRDocument"}}class Pa extends be{constructor(e,t,r){super(),I(this,"nodeType",10),I(this,"RRNodeType",$.DocumentType),I(this,"name"),I(this,"publicId"),I(this,"systemId"),I(this,"textContent",null),this.name=e,this.publicId=t,this.systemId=r,this.nodeName=e}toString(){return"RRDocumentType"}}class zr extends be{constructor(e){super(),I(this,"nodeType",1),I(this,"RRNodeType",$.Element),I(this,"tagName"),I(this,"attributes",{}),I(this,"shadowRoot",null),I(this,"scrollLeft"),I(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 Od(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?Ed(this.attributes.style):{},t=/\B([A-Z])/g;return e.setProperty=(r,i,o)=>{if(t.test(r))return;const n=Zs(r);i?e[n]=i:delete e[n],o==="important"&&(e[n]+=" !important"),this.attributes.style=Vn(e)},e.removeProperty=r=>{if(t.test(r))return"";const i=Zs(r),o=e[i]||"";return delete e[i],this.attributes.style=Vn(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 Mi(this,e)}insertBefore(e,t){return Va(this,e,t)}removeChild(e){return Wa(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 Rd extends zr{constructor(){super(...arguments),I(this,"currentTime"),I(this,"volume"),I(this,"paused"),I(this,"muted"),I(this,"playbackRate"),I(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 Ad extends zr{constructor(){super(...arguments),I(this,"tagName","DIALOG"),I(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 Fa extends be{constructor(e){super(),I(this,"nodeType",3),I(this,"nodeName","#text"),I(this,"RRNodeType",$.Text),I(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 Ba extends be{constructor(e){super(),I(this,"nodeType",8),I(this,"nodeName","#comment"),I(this,"RRNodeType",$.Comment),I(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 Ua extends be{constructor(e){super(),I(this,"nodeName","#cdata-section"),I(this,"nodeType",4),I(this,"RRNodeType",$.CDATA),I(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 Od{constructor(e,t){if(I(this,"onChange"),I(this,"classes",[]),I(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(" "))}),I(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 Mi(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 Va(s,e,t){if(!t)return Mi(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 Wa(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 he=(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))(he||{});const Xs={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},Td={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 Se=null;function Mr(s,e,t,r=e.mirror||e.ownerDocument.mirror){s=Dd(s,e,t,r),za(s,e,t,r),_d(s,e,t)}function Dd(s,e,t,r){var i;if(t.afterAppend&&!Se&&(Se=new WeakSet,setTimeout(()=>{Se=null},0)),!Ni(s,e)){const o=Nr(e,t.mirror,r);(i=s.parentNode)==null||i.replaceChild(o,s),s=o}switch(e.RRNodeType){case $.Document:{if(!Ge(s,e,t.mirror,r)){const o=r.getMeta(e);o&&(t.mirror.removeNodeFromMap(s),s.close(),s.open(),t.mirror.add(s,o),Se==null||Se.add(s))}break}case $.Element:{const o=s,n=e;switch(n.tagName){case"IFRAME":{const a=s.contentDocument;if(!a)break;Mr(a,e.contentDocument,t,r);break}}n.shadowRoot&&(o.shadowRoot||o.attachShadow({mode:"open"}),za(o.shadowRoot,n.shadowRoot,t,r)),kd(o,n,r);break}}return s}function _d(s,e,t){var r;switch(e.RRNodeType){case $.Document:{const i=e.scrollData;i&&t.applyScroll(i,!0);break}case $.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 $.Text:case $.Comment:case $.CDATA:{s.textContent!==e.data&&(s.textContent=e.data);break}}Se!=null&&Se.has(s)&&(Se.delete(s),(r=t.afterAppend)==null||r.call(t,s,t.mirror.getId(s)))}function kd(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&&Xs[o])s.setAttributeNS(Xs[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;try{s.setAttribute(o,n)}catch(l){console.warn(l)}}}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 za(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,y;for(;n<=a&&l<=u;)if(c===void 0)c=i[++n];else if(h===void 0)h=i[--a];else if(Ge(c,f,t.mirror,r))c=i[++n],f=o[++l];else if(Ge(h,g,t.mirror,r))h=i[--a],g=o[--u];else if(Ge(c,g,t.mirror,r)){try{s.insertBefore(c,h.nextSibling)}catch(S){console.warn(S)}c=i[++n],g=o[--u]}else if(Ge(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 v=n;v<=a;v++){const b=i[v];b&&t.mirror.hasNode(b)&&(p[t.mirror.getId(b)]=v)}}y=p[r.getId(f)];const S=i[y];if(y!==void 0&&S&&Ge(S,f,t.mirror,r)){try{s.insertBefore(S,c)}catch(v){console.warn(v)}i[y]=void 0}else{const v=Nr(f,t.mirror,r);s.nodeName==="#document"&&c&&(v.nodeType===v.DOCUMENT_TYPE_NODE&&c.nodeType===c.DOCUMENT_TYPE_NODE||v.nodeType===v.ELEMENT_NODE&&c.nodeType===c.ELEMENT_NODE)&&(s.removeChild(c),t.mirror.removeNodeFromMap(c),c=i[++n]);try{s.insertBefore(v,c||null)}catch(b){console.warn(b)}}f=o[++l]}if(n>a){const S=o[u+1];let v=null;for(S&&(v=t.mirror.getNode(r.getId(S)));l<=u;++l){const b=Nr(o[l],t.mirror,r);try{s.insertBefore(b,v)}catch(C){console.warn(C)}}}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(v){console.warn(v)}}let d=s.firstChild,m=e.firstChild;for(;d!==null&&m!==null;)Mr(d,m,t,r),d=d.nextSibling,m=m.nextSibling}function Nr(s,e,t){const r=t.getId(s),i=t.getMeta(s);let o=null;if(r>-1&&(o=e.getNode(r)),o!==null&&Ni(o,s))return o;switch(s.RRNodeType){case $.Document:o=new Document;break;case $.DocumentType:o=document.implementation.createDocumentType(s.name,s.publicId,s.systemId);break;case $.Element:{let n=s.tagName.toLowerCase();n=Td[n]||n,i&&"isSVG"in i&&(i!=null&&i.isSVG)?o=document.createElementNS(Xs.svg,n):o=document.createElement(s.tagName);break}case $.Text:o=document.createTextNode(s.data);break;case $.Comment:o=document.createComment(s.data);break;case $.CDATA:o=document.createCDATASection(s.data);break}i&&e.add(o,N({},i));try{Se==null||Se.add(o)}catch(n){}return o}function Ni(s,e){return s.nodeType!==e.nodeType?!1:s.nodeType!==s.ELEMENT_NODE||s.tagName.toUpperCase()===e.tagName}function Ge(s,e,t,r){const i=t.getId(s),o=r.getId(e);return i===-1||i!==o?!1:Ni(s,e)}class lt extends Ii{constructor(e){super(),I(this,"UNSERIALIZED_STARTING_ID",-2),I(this,"_unserializedId",this.UNSERIALIZED_STARTING_ID),I(this,"mirror",Hd()),I(this,"scrollData",null),e&&(this.mirror=e)}get unserializedId(){return this._unserializedId--}createDocument(e,t,r){return new lt}createDocumentType(e,t,r){const i=new $d(e,t,r);return i.ownerDocument=this,i}createElement(e){const t=e.toUpperCase();let r;switch(t){case"AUDIO":case"VIDEO":r=new Ld(t);break;case"IFRAME":r=new Ud(t,this.mirror);break;case"CANVAS":r=new Fd(t);break;case"STYLE":r=new Bd(t);break;case"DIALOG":r=new Pd(t);break;default:r=new Gr(t);break}return r.ownerDocument=this,r}createComment(e){const t=new Wd(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new zd(e);return t.ownerDocument=this,t}createTextNode(e){const t=new Vd(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 $d=Pa;class Gr extends zr{constructor(){super(...arguments),I(this,"inputData",null),I(this,"scrollData",null)}}class Ld extends Rd{}class Pd extends Ad{}class Fd extends Gr{constructor(){super(...arguments),I(this,"rr_dataURL",null),I(this,"canvasMutations",[])}getContext(){return null}}class Bd extends Gr{constructor(){super(...arguments),I(this,"rules",[])}}class Ud extends Gr{constructor(e,t){super(e),I(this,"contentDocument",new lt),this.contentDocument.mirror=t}}const Vd=Fa,Wd=Ba,zd=Ua;function Gd(s){return s instanceof HTMLFormElement?"FORM":s.tagName.toUpperCase()}function Ga(s,e,t,r){let i;switch(s.nodeType){case he.DOCUMENT_NODE:r&&r.nodeName==="IFRAME"?i=r.contentDocument:(i=e,i.compatMode=s.compatMode);break;case he.DOCUMENT_TYPE_NODE:{const n=s;i=e.createDocumentType(n.name,n.publicId,n.systemId);break}case he.ELEMENT_NODE:{const n=s,a=Gd(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 he.TEXT_NODE:i=e.createTextNode(s.textContent||"");break;case he.CDATA_SECTION_NODE:i=e.createCDATASection(s.data);break;case he.COMMENT_NODE:i=e.createComment(s.textContent||"");break;case he.DOCUMENT_FRAGMENT_NODE:i=r.attachShadow({mode:"open"});break;default:return null}let o=t.getMeta(s);return e instanceof lt&&(o||(o=ja(i,e.unserializedId),t.add(s,o)),e.mirror.add(i,N({},o))),i}function jd(s,e=Rh(),t=new lt){function r(i,o){const n=Ga(i,t,e,o);if(n!==null)if((o==null?void 0:o.nodeName)!=="IFRAME"&&i.nodeType!==he.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===he.DOCUMENT_NODE||i.nodeType===he.ELEMENT_NODE||i.nodeType===he.DOCUMENT_FRAGMENT_NODE)&&(i.nodeType===he.ELEMENT_NODE&&i.shadowRoot&&r(i.shadowRoot,n),i.childNodes.forEach(a=>r(a,n)))}return r(s,null),t}function Hd(){return new Yd}class Yd{constructor(){I(this,"idNodeMap",new Map),I(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 ja(s,e){switch(s.RRNodeType){case $.Document:return{id:e,type:s.RRNodeType,childNodes:[]};case $.DocumentType:{const t=s;return{id:e,type:s.RRNodeType,name:t.name,publicId:t.publicId,systemId:t.systemId}}case $.Element:return{id:e,type:s.RRNodeType,tagName:s.tagName.toLowerCase(),attributes:{},childNodes:[]};case $.Text:return{id:e,type:s.RRNodeType,textContent:s.textContent||""};case $.Comment:return{id:e,type:s.RRNodeType,textContent:s.textContent||""};case $.CDATA:return{id:e,type:s.RRNodeType,textContent:""}}}const Wn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},zn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},sr={},Zd=()=>!!globalThis.Zone;function Ri(s){if(sr[s])return sr[s];const e=globalThis[s],t=e.prototype,r=s in Wn?Wn[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 zn?zn[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&&!Zd())return sr[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?sr[s]=u:t}catch(a){return t}}const ls={};function _e(s,e,t){var r;const i=`${s}.${String(t)}`;if(ls[i])return ls[i].call(e);const o=Ri(s),n=(r=Object.getOwnPropertyDescriptor(o,t))==null?void 0:r.get;return n?(ls[i]=n,n.call(e)):e[t]}const us={};function Ha(s,e,t){const r=`${s}.${String(t)}`;if(us[r])return us[r].bind(e);const o=Ri(s)[t];return typeof o!="function"?e[t]:(us[r]=o,o.bind(e))}function Xd(s){return _e("Node",s,"childNodes")}function Jd(s){return _e("Node",s,"parentNode")}function Kd(s){return _e("Node",s,"parentElement")}function Qd(s){return _e("Node",s,"textContent")}function qd(s,e){return Ha("Node",s,"contains")(e)}function ep(s){return Ha("Node",s,"getRootNode")()}function tp(s){return!s||!("host"in s)?null:_e("ShadowRoot",s,"host")}function rp(s){return s.styleSheets}function sp(s){return!s||!("shadowRoot"in s)?null:_e("Element",s,"shadowRoot")}function ip(s,e){return _e("Element",s,"querySelector")(e)}function np(s,e){return _e("Element",s,"querySelectorAll")(e)}function Ya(){return Ri("MutationObserver").constructor}function Ue(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()=>{}}}function op(s){const e=s.tagName.toLowerCase(),t=s.id?`#${s.id}`:"",r=s.classList.length?"."+Array.from(s.classList).join("."):"";return`${e}${t}${r}`}function ap(s){var f;var e,t;const r=(f=(e=s.ownerDocument)==null?void 0:e.defaultView)!=null?f:window,i=s.getBoundingClientRect(),o=r.innerWidth||r.document.documentElement.clientWidth||0,n=r.innerHeight||r.document.documentElement.clientHeight||0,a=i.width>0&&i.height>0&&i.bottom>0&&i.right>0&&i.top<n&&i.left<o,l=(t=r.getComputedStyle)==null?void 0:t.call(r,s),c=!!l&&l.display!=="none"&&l.visibility!=="hidden"&&(parseFloat(l.opacity)||0)>0&&a;let h=0;if(c){const g=Math.max(0,Math.min(i.right,o)-Math.max(i.left,0)),p=Math.max(0,Math.min(i.bottom,n)-Math.max(i.top,0)),y=g*p,d=i.width*i.height;h=d>0?y/d:0}return{isVisible:c,ratio:h}}const T={childNodes:Xd,parentNode:Jd,parentElement:Kd,textContent:Qd,contains:qd,getRootNode:ep,host:tp,styleSheets:rp,shadowRoot:sp,querySelector:ip,querySelectorAll:np,mutationObserver:Ya,patch:Ue,describeNode:op,getElementVisibility:ap};function se(s,e,t=document){const r={capture:!0,passive:!0};return t.addEventListener(s,e,r),()=>t.removeEventListener(s,e,r)}const je=`Please stop import mirror directly. Instead of that,\r
68
68
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
69
- or you can use record.mirror to access the mirror instance during recording.`;exports.mirror={map:{},getId(){return console.error(je),-1},getNode(){return console.error(je),null},removeNodeFromMap(){console.error(je)},has(){return console.error(je),!1},reset(){console.error(je)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(exports.mirror=new Proxy(exports.mirror,{get(s,e,t){return e==="map"&&console.error(je),Reflect.get(s,e,t)}}));function ot(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 _t(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)}}),()=>_t(s,e,o||{},!0)}function me(){return Math.round(performance.timeOrigin+performance.now())}function Ai(s=window){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=T.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=T.parentElement(o.body))==null?void 0:r.scrollTop)||((i=o==null?void 0:o.body)==null?void 0:i.scrollTop)||0}}function Oi(s=window){const e=s.document;return s.innerHeight||e.documentElement&&e.documentElement.clientHeight||e.body&&e.body.clientHeight||0}function Ti(s=window){const e=s.document;return s.innerWidth||e.documentElement&&e.documentElement.clientWidth||e.body&&e.body.clientWidth||0}function Di(s){return s?s.nodeType===s.ELEMENT_NODE?s:T.parentElement(s):null}function oe(s,e,t,r){if(!s)return!1;const i=Di(s);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(yr(i,e,r))return!0}catch(o){}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function Za(s,e){return e.getId(s)!==-1}function fr(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===vt}function _i(s,e){if(gt(s))return!1;const t=e.getId(s);if(!e.has(t))return!0;const r=T.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?_i(r,e):!0}function Rr(s){return!!s.changedTouches}function ki(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 Xa(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 $i(s,e){e(s.value);for(let t=s.children.length-1;t>=0;t--)$i(s.children[t],e)}function Qe(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function Li(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function Pi(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=Pi(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 Ae(s){return s?s instanceof be&&"shadowRoot"in s?!!s.shadowRoot:!!T.shadowRoot(s):!1}function Xe(s,e){const t=s[e[0]];return e.length===1?t:Xe(t.cssRules[e[1]].cssRules,e.slice(2))}function Js(s){const e=[...s],t=e.pop();return{positions:e,index:t}}function Ja(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 Fi{constructor(){w(this,"id",1),w(this,"styleIDMap",new WeakMap),w(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 Bi(s){var e;let t=null;return"getRootNode"in s&&((e=T.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&T.host(T.getRootNode(s))&&(t=T.host(T.getRootNode(s))),t}function Ka(s){let e=s,t;for(;t=Bi(e);)e=t;return e}function Qa(s){const e=s.ownerDocument;if(!e)return!1;const t=Ka(s);return T.contains(e,t)}function Ui(s){const e=s.ownerDocument;return e?T.contains(e,s)||Qa(s):!1}const lp=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:Fi,get _mirror(){return exports.mirror},closestElementOfNode:Di,getBaseDimension:Pi,getNestedRule:Xe,getPositionsAndIndex:Js,getRootShadowHost:Ka,getShadowHost:Bi,getWindowHeight:Oi,getWindowScroll:Ai,getWindowWidth:Ti,hasShadowRoot:Ae,hookSetter:_t,inDom:Ui,isAncestorRemoved:_i,isBlocked:oe,isIgnored:fr,isSerialized:Za,isSerializedIframe:Qe,isSerializedStylesheet:Li,iterateResolveTree:$i,legacy_isTouchEvent:Rr,nowTimestamp:me,on:se,polyfill:ki,queueToResolveTrees:Xa,shadowHostInDom:Qa,throttle:ot,uniqueTextMutations:Ja},Symbol.toStringTag,{value:"Module"}));var M=(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))(M||{}),x=(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[s.VisibilityMutation=17]="VisibilityMutation",s))(x||{}),F=(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))(F||{}),Ce=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(Ce||{}),Me=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(Me||{}),Re=(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))(Re||{}),P=(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))(P||{}),Ee=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(Ee||{});function Gn(s){return"__ln"in s}class up{constructor(){w(this,"length",0),w(this,"head",null),w(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&&Gn(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&&Gn(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 jn=(s,e)=>`${s}@${e}`;class cp{constructor(){w(this,"frozen",!1),w(this,"locked",!1),w(this,"texts",[]),w(this,"attributes",[]),w(this,"attributeMap",new WeakMap),w(this,"removes",[]),w(this,"mapRemoves",[]),w(this,"movedMap",{}),w(this,"addedSet",new Set),w(this,"movedSet",new Set),w(this,"droppedSet",new Set),w(this,"removesSubTreeCache",new Set),w(this,"mutationCb"),w(this,"blockClass"),w(this,"blockSelector"),w(this,"maskTextClass"),w(this,"maskTextSelector"),w(this,"excludeAttribute"),w(this,"inlineStylesheet"),w(this,"maskInputOptions"),w(this,"maskTextFn"),w(this,"maskInputFn"),w(this,"keepIframeSrcFn"),w(this,"recordCanvas"),w(this,"inlineImages"),w(this,"slimDOMOptions"),w(this,"dataURLOptions"),w(this,"doc"),w(this,"mirror"),w(this,"iframeManager"),w(this,"stylesheetManager"),w(this,"shadowDomManager"),w(this,"canvasManager"),w(this,"visibilityManager"),w(this,"processedNodeManager"),w(this,"unattachedDoc"),w(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),w(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new up,i=l=>{let u=l,c=vt;for(;c===vt;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},o=l=>{const u=T.parentNode(l);if(!u||!Ui(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=gt(u)?this.mirror.getId(Bi(l)):this.mirror.getId(u),f=i(l);if(h===-1||f===-1)return r.addNode(l);const g=Ze(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,excludeAttribute:this.excludeAttribute,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=>{Qe(p,this.mirror)&&this.iframeManager.addIframe(p),Li(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),Ae(l)&&this.shadowDomManager.addShadowRoot(T.shadowRoot(l),this.doc)},onIframeLoad:(p,y)=>{this.iframeManager.attachIframe(p,y),this.shadowDomManager.observeAttachShadow(p)},onStylesheetLoad:(p,y)=>{this.stylesheetManager.attachLinkElement(p,y)},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)Hn(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(T.parentNode(l))||o(l);for(const l of this.addedSet)!Yn(this.droppedSet,l)&&!Hn(this.removesSubTreeCache,l,this.mirror)||Yn(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(T.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(T.parentNode(c.value));if(i(c.value)===-1)continue;if(h!==-1){l=c;break}else{const g=c.value,p=T.parentNode(g);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const y=T.host(p);if(this.mirror.getId(y)!==-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=T.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.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(a))}),w(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));const r=Array.from(T.childNodes(e),i=>T.textContent(i)||"").join("");t.attributes.value=pr({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:mr(e),value:r,maskInputFn:this.maskInputFn})}),w(this,"processMutation",e=>{if(!fr(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=T.textContent(e.target);!oe(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:yo(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Di(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);const n=t[r],a=typeof n=="boolean",l=document.contains(t),u=ri(t),c=ys(r,this.excludeAttribute);if(i===null&&!t.hasAttribute(r)&&e.oldValue!==null&&(n===""||n===null||typeof n=="undefined")){console.debug(`[${me()}] [rrweb:record/mutation] \u26D4 phantom attribute mutation ignored`,{node:T.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:r,value:i,oldValue:e.oldValue,excludeAttribute:this.excludeAttribute,propValue:n,isBooleanAttr:a,inDOM:l,isVisible:u,isExcludeAttributeName:c});return}if(ys(r,this.excludeAttribute)){console.debug(`[${me()}] [rrweb:record/mutation] \u26D4 excluded attribute mutation ignored`,{node:T.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:r,value:i,oldValue:e.oldValue,excludeAttribute:this.excludeAttribute,propValue:n,isBooleanAttr:a,inDOM:l,isVisible:u,isExcludeAttributeName:c});return}if(r==="value"){const g=mr(t);i=pr({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:g,value:i,maskInputFn:this.maskInputFn})}if(oe(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let f=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(f||(f={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(f),this.attributeMap.set(e.target,f)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!go(t.tagName,r))if(f.attributes[r]=mo(this.doc,Te(t.tagName),Te(r),i),r!=="class"&&(e.oldValue===null||i===""||i!==e.oldValue)&&console.debug(`[${me()}] [rrweb:record/mutation] \u26A0\uFE0F suspicious attribute mutation`,{reason:[i===e.oldValue?"no change in value":null,i===n?"mirrored in DOM property":null,i===f.attributes[r]?"redundant assignment":null].filter(Boolean).join(", ")||"uncategorized",node:T.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:r,value:i,oldValue:e.oldValue,transformedValue:f.attributes[r],excludeAttribute:this.excludeAttribute,propValue:n,isBooleanAttr:a,inDOM:l,isVisible:u,isExcludeAttributeName:c}),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(y){this.unattachedDoc=this.doc}const p=this.unattachedDoc.createElement("span");e.oldValue&&p.setAttribute("style",e.oldValue);for(const y of Array.from(t.style)){const d=t.style.getPropertyValue(y),m=t.style.getPropertyPriority(y);d!==p.style.getPropertyValue(y)||m!==p.style.getPropertyPriority(y)?m===""?f.styleDiff[y]=d:f.styleDiff[y]=[d,m]:f._unchangedStyles[y]=[d,m]}for(const y of Array.from(p.style))t.style.getPropertyValue(y)===""&&(f.styleDiff[y]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?f.attributes.rr_open_mode="modal":f.attributes.rr_open_mode="non-modal");break}case"childList":{if(oe(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=gt(e.target)?this.mirror.getId(T.host(e.target)):this.mirror.getId(e.target);oe(e.target,this.blockClass,this.blockSelector,!1)||fr(t,this.mirror,this.slimDOMOptions)||!Za(t,this.mirror)||(this.addedSet.has(t)?(Ks(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||_i(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[jn(r,i)]?Ks(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:gt(e.target)&&yt(e.target)?!0:void 0}),hp(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),w(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(fr(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[jn(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);oe(e,this.blockClass,this.blockSelector,!1)||(T.childNodes(e).forEach(r=>this.genAdds(r)),Ae(e)&&T.childNodes(T.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","excludeAttribute","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","visibilityManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze(),this.visibilityManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.visibilityManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock(),this.visibilityManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.visibilityManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset(),this.visibilityManager.reset()}}function Ks(s,e){s.delete(e),T.childNodes(e).forEach(t=>Ks(s,t))}function hp(s,e){const t=[s];for(;t.length;){const r=t.pop();e.has(r)||(e.add(r),T.childNodes(r).forEach(i=>t.push(i)))}}function Hn(s,e,t){return s.size===0?!1:fp(s,e)}function fp(s,e,t){const r=T.parentNode(e);return r?s.has(r):!1}function Yn(s,e){return s.size===0?!1:qa(s,e)}function qa(s,e){const t=T.parentNode(e);return t?s.has(t)?!0:qa(s,t):!1}let wt;function dp(s){wt=s}function pp(){wt=void 0}const L=s=>wt?(...t)=>{try{return s(...t)}catch(r){if(wt&&wt(r)===!0)return;throw r}}:s,Pe=[];function at(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 el(s,e){const t=new cp;Pe.push(t),t.init(s);const r=new(Ya())(L(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function mp({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=ot(L(h=>{const f=Date.now()-a;s(n.map(g=>(g.timeOffset-=f,g)),h),n=[],a=null}),o),u=L(ot(L(h=>{const f=at(h),{clientX:g,clientY:p}=Rr(h)?h.changedTouches[0]:h;a||(a=me()),n.push({x:g,y:p,id:r.getId(f),timeOffset:me()-a}),l(typeof DragEvent!="undefined"&&h instanceof DragEvent?x.Drag:h instanceof MouseEvent?x.MouseMove:x.TouchMove)}),i,{trailing:!1})),c=[se("mousemove",u,t),se("touchmove",u,t),se("drag",u,t)];return L(()=>{c.forEach(h=>h())})}function gp({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{console.debug("MouseInteractionObserver: No operation needed")};const n=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[];let l=null;const u=c=>h=>{const f=at(h);if(oe(f,r,i,!0))return;let g=null,p=c;if("pointerType"in h){switch(h.pointerType){case"mouse":g=Ce.Mouse;break;case"touch":g=Ce.Touch;break;case"pen":g=Ce.Pen;break}g===Ce.Touch?F[c]===F.MouseDown?p="TouchStart":F[c]===F.MouseUp&&(p="TouchEnd"):Ce.Pen}else Rr(h)&&(g=Ce.Touch);g!==null?(l=g,(p.startsWith("Touch")&&g===Ce.Touch||p.startsWith("Mouse")&&g===Ce.Mouse)&&(g=null)):F[c]===F.Click&&(g=l,l=null);const y=Rr(h)?h.changedTouches[0]:h;if(!y)return;const d=t.getId(f),{clientX:m,clientY:S}=y;L(s)(N({type:F[p],id:d,x:m,y:S},g!==null&&{pointerType:g}))};return Object.keys(F).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&n[c]!==!1).forEach(c=>{let h=Te(c);const f=u(c);if(window.PointerEvent)switch(F[c]){case F.MouseDown:case F.MouseUp:h=h.replace("mouse","pointer");break;case F.TouchStart:case F.TouchEnd:return}a.push(se(h,f,e))}),L(()=>{a.forEach(c=>c())})}function tl({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:o}){const n=L(ot(L(a=>{const l=at(a);if(!l||oe(l,r,i,!0))return;const u=t.getId(l);if(l===e&&e.defaultView){const c=Ai(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 se("scroll",n,e)}function yp({viewportResizeCb:s},{win:e}){let t=-1,r=-1;const i=L(ot(L(()=>{const o=Oi(),n=Ti();(t!==o||r!==n)&&(s({width:Number(n),height:Number(o)}),t=o,r=n)}),200));return se("resize",i,e)}const cs=["INPUT","TEXTAREA","SELECT"],Zn=new WeakMap,bp=["Enter","Tab","Escape","ArrowDown","ArrowUp","Delete"],Xn=new WeakMap;function wp({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:o,ignoreSelector:n,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function h(v){let b=at(v);const C=v.isTrusted,E=b&&b.tagName;if(b&&E==="OPTION"&&(b=T.parentElement(b)),!b||!E||cs.indexOf(E)<0||oe(b,r,i,!0)||b.classList.contains(o)||n&&b.matches(n))return;let _=b.value,A=!1;const V=mr(b)||"";V==="radio"||V==="checkbox"?A=b.checked:(a[E.toLowerCase()]||a[V])&&(_=pr({element:b,maskInputOptions:a,tagName:E,type:V,value:_,maskInputFn:l})),f(b,c?{text:_,isChecked:A,userTriggered:C}:{text:_,isChecked:A});const z=b.name;V==="radio"&&z&&A&&e.querySelectorAll(`input[type="radio"][name="${z}"]`).forEach(J=>{if(J!==b){const Q=J.value;f(J,c?{text:Q,isChecked:!A,userTriggered:!1}:{text:Q,isChecked:!A})}})}function f(v,b){const C=Zn.get(v),E=v,_=E.hasAttribute("placeholder"),A=E.value==="",V=typeof E.defaultValue=="string"?E.defaultValue==="":!0,z=!b.userTriggered,J=!C||C.text==="",Q=_&&A&&V&&J&&z&&!b.isChecked&&E.type!=="hidden"&&cs.includes(E.tagName),te=E.tagName==="INPUT"&&E.type==="text"&&!b.userTriggered&&b.text===E.defaultValue&&!C&&E.hasAttribute("placeholder"),R=!b.userTriggered&&E.value===E.defaultValue&&!C&&E.hasAttribute("placeholder")&&!b.isChecked&&E.type!=="hidden"&&cs.includes(E.tagName),ie=E.type==="checkbox"&&!b.userTriggered&&!b.isChecked&&!C,ne=E.type==="radio"&&!b.userTriggered&&!b.isChecked&&!C;if(Q||te||R||ie||ne){console.debug(`[${me()}] [rrweb:record/observer] \u26D4 phantom input ignored`,{node:T.describeNode(E),tag:E.tagName,nodeType:E.nodeType,attribute:E.attributes,value:E.value,isLikelyPhantom:Q,isRenderDrivenTextInput:te,isValueFromDefault:R,isPhantomCheckbox:ie,isPhantomRadio:ne});return}if(!C||C.text!==b.text||C.isChecked!==b.isChecked){Zn.set(v,b);const O=t.getId(v);L(s)(q(N({},b),{id:O}))}}const p=(u.input==="last"?["change"]:["input","change"]).map(v=>se(v,L(h),e)),y=v=>{const b=at(v);if(!b||!b.tagName)return;if(u.input==="all"){h(v);return}const C=b.tagName,E=v.key,_=bp.includes(E),A=C==="TEXTAREA",V=e.activeElement===b,z=b.value,J=Xn.get(b);if(Xn.set(b,z),!V){h(v);return}if(_){if(!A){h(v);return}let Q=J!=null?J:"",te=0;const R=2,ie=()=>{const ne=b.value,O=e.activeElement===b,ue=ne!==Q;if(!O){h(v);return}if(ue)te=0,Q=ne;else if(te++,te>=R){h(v);return}requestAnimationFrame(ie)};requestAnimationFrame(ie);return}};p.push(se("keydown",L(y),e));const d=e.defaultView;if(!d)return()=>{p.forEach(v=>v())};const m=d.Object.getOwnPropertyDescriptor(d.HTMLInputElement.prototype,"value"),S=[[d.HTMLInputElement.prototype,"value"],[d.HTMLInputElement.prototype,"checked"],[d.HTMLSelectElement.prototype,"value"],[d.HTMLTextAreaElement.prototype,"value"],[d.HTMLSelectElement.prototype,"selectedIndex"],[d.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...S.map(v=>_t(v[0],v[1],{set(){L(h)({target:this,isTrusted:!1})}},!1,d))),L(()=>{p.forEach(v=>v())})}function Ar(s){const e=[];function t(r,i){if(ir("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||ir("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||ir("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||ir("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const n=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(n)}else if(r.parentStyleSheet){const n=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(n)}return i}return t(s,e)}function Ne(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function vp({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:L((c,h,f)=>{const[g,p]=f,{id:y,styleId:d}=Ne(h,e,t.styleMirror);return(y&&y!==-1||d&&d!==-1)&&s({id:y,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:L((c,h,f)=>{const[g]=f,{id:p,styleId:y}=Ne(h,e,t.styleMirror);return(p&&p!==-1||y&&y!==-1)&&s({id:p,styleId:y,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:L((c,h,f)=>{const[g]=f,{id:p,styleId:y}=Ne(h,e,t.styleMirror);return(p&&p!==-1||y&&y!==-1)&&s({id:p,styleId:y,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:L((c,h,f)=>{const[g]=f,{id:p,styleId:y}=Ne(h,e,t.styleMirror);return(p&&p!==-1||y&&y!==-1)&&s({id:p,styleId:y,replaceSync:g}),c.apply(h,f)})}));const l={};nr("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(nr("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),nr("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),nr("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:L((f,g,p)=>{const[y,d]=p,{id:m,styleId:S}=Ne(g.parentStyleSheet,e,t.styleMirror);return(m&&m!==-1||S&&S!==-1)&&s({id:m,styleId:S,adds:[{rule:y,index:[...Ar(g),d||0]}]}),f.apply(g,p)})}),h.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:L((f,g,p)=>{const[y]=p,{id:d,styleId:m}=Ne(g.parentStyleSheet,e,t.styleMirror);return(d&&d!==-1||m&&m!==-1)&&s({id:d,styleId:m,removes:[{index:[...Ar(g),y]}]}),f.apply(g,p)})})}),L(()=>{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 rl({mirror:s,stylesheetManager:e},t){var r,i,o;let n=null;t.nodeName==="#document"?n=s.getId(t):n=s.getId(T.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}}),L(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function Sp({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:L((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:y}=Ne((c=l.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(p&&p!==-1||y&&y!==-1)&&s({id:p,styleId:y,set:{property:h,value:f,priority:g},index:Ar(l.parentRule)}),a.apply(l,u)})});const n=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(n,{apply:L((a,l,u)=>{var c;const[h]=u;if(t.has(h))return n.apply(l,[h]);const{id:f,styleId:g}=Ne((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:Ar(l.parentRule)}),a.apply(l,u)})}),L(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=n})}function Cp({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:o}){const n=L(l=>ot(L(u=>{const c=at(u);if(!c||oe(c,e,t,!0))return;const{currentTime:h,volume:f,muted:g,playbackRate:p,loop:y}=c;s({type:l,id:r.getId(c),currentTime:h,volume:f,muted:g,playbackRate:p,loop:y})}),i.media||500)),a=[se("play",n(Re.Play),o),se("pause",n(Re.Pause),o),se("seeked",n(Re.Seeked),o),se("volumechange",n(Re.VolumeChange),o),se("ratechange",n(Re.RateChange),o)];return L(()=>{a.forEach(l=>l())})}function Ep({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=Ue(e.fonts,"add",function(a){return function(l){return setTimeout(L(()=>{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),L(()=>{r.forEach(a=>a())})}function xp(s){const{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:o}=s;let n=!0;const a=L(()=>{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:y,endOffset:d}=f;oe(g,r,i,!0)||oe(y,r,i,!0)||u.push({start:t.getId(g),startOffset:p,end:t.getId(y),endOffset:d})}o({ranges:u})});return a(),se("selectionchange",a)}function Ip({doc:s,customElementCb:e}){const t=s.defaultView;return!t||!t.customElements?()=>{}:Ue(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 Mp(s,e){const{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:n,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,visibilityMutationCb:f,fontCb:g,selectionCb:p,customElementCb:y}=s;s.mutationCb=(...d)=>{e.mutation&&e.mutation(...d),t(...d)},s.mousemoveCb=(...d)=>{e.mousemove&&e.mousemove(...d),r(...d)},s.mouseInteractionCb=(...d)=>{e.mouseInteraction&&e.mouseInteraction(...d),i(...d)},s.scrollCb=(...d)=>{e.scroll&&e.scroll(...d),o(...d)},s.viewportResizeCb=(...d)=>{e.viewportResize&&e.viewportResize(...d),n(...d)},s.inputCb=(...d)=>{e.input&&e.input(...d),a(...d)},s.mediaInteractionCb=(...d)=>{e.mediaInteaction&&e.mediaInteaction(...d),l(...d)},s.styleSheetRuleCb=(...d)=>{e.styleSheetRule&&e.styleSheetRule(...d),u(...d)},s.styleDeclarationCb=(...d)=>{e.styleDeclaration&&e.styleDeclaration(...d),c(...d)},s.canvasMutationCb=(...d)=>{e.canvasMutation&&e.canvasMutation(...d),h(...d)},s.visibilityMutationCb=(...d)=>{e.visibilityMutation&&e.visibilityMutation(...d),f(...d)},s.fontCb=(...d)=>{e.font&&e.font(...d),g(...d)},s.selectionCb=(...d)=>{e.selection&&e.selection(...d),p(...d)},s.customElementCb=(...d)=>{e.customElement&&e.customElement(...d),y(...d)}}function Np(s,e={}){const t=s.doc.defaultView;if(!t)return()=>{};Mp(s,e);let r;s.recordDOM&&(r=el(s,s.doc));const i=mp(s),o=gp(s),n=tl(s),a=yp(s,{win:t}),l=wp(s),u=Cp(s);let c=()=>{},h=()=>{},f=()=>{},g=()=>{};s.recordDOM&&(c=vp(s,{win:t}),h=rl(s,s.doc),f=Sp(s,{win:t}),s.collectFonts&&(g=Ep(s)));const p=xp(s),y=Ip(s),d=[];for(const m of s.plugins)d.push(m.observer(m.callback,t,m.options));return L(()=>{Pe.forEach(m=>m.reset()),r==null||r.disconnect(),i(),o(),n(),a(),l(),u(),c(),h(),f(),g(),p(),y(),d.forEach(m=>m())})}function ir(s){return typeof window[s]!="undefined"}function nr(s){return!!(typeof window[s]!="undefined"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}class Jn{constructor(e){w(this,"iframeIdToRemoteIdMap",new WeakMap),w(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 Rp{constructor(e){w(this,"iframes",new WeakMap),w(this,"crossOriginIframeMap",new WeakMap),w(this,"crossOriginIframeMirror",new Jn(po)),w(this,"crossOriginIframeStyleMirror"),w(this,"crossOriginIframeRootIdMap",new WeakMap),w(this,"mirror"),w(this,"mutationCb"),w(this,"wrappedEmit"),w(this,"loadListener"),w(this,"stylesheetManager"),w(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Jn(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 M.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:M.IncrementalSnapshot,data:{source:x.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case M.Meta:case M.Load:case M.DomContentLoaded:return!1;case M.Plugin:return t;case M.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case M.IncrementalSnapshot:switch(t.data.source){case x.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 x.Drag:case x.TouchMove:case x.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case x.ViewportResize:return!1;case x.MediaInteraction:case x.MouseInteraction:case x.Scroll:case x.CanvasMutation:case x.Input:return this.replaceIds(t.data,e,["id"]),t;case x.StyleSheetRule:case x.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case x.Font:return t;case x.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case x.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!==Ee.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}}class Ap{constructor(e){w(this,"shadowDoms",new WeakSet),w(this,"mutationCb"),w(this,"scrollCb"),w(this,"bypassOptions"),w(this,"mirror"),w(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(!yt(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=el(q(N({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(tl(q(N({},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(T.host(e))),this.restoreHandlers.push(rl({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(Ue(e.prototype,"attachShadow",function(i){return function(o){const n=i.call(this,o),a=T.shadowRoot(this);return a&&Ui(this)&&r.addShadowRoot(a,t),n}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var Je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",dt=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var or=0;or<Je.length;or++)dt[Je.charCodeAt(or)]=or;var Op=function(s){var e=new Uint8Array(s),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=Je[e[t]>>2],i+=Je[(e[t]&3)<<4|e[t+1]>>4],i+=Je[(e[t+1]&15)<<2|e[t+2]>>6],i+=Je[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},Tp=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=dt[s.charCodeAt(r)],n=dt[s.charCodeAt(r+1)],a=dt[s.charCodeAt(r+2)],l=dt[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 Kn=new Map;function Dp(s,e){let t=Kn.get(s);return t||(t=new Map,Kn.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}const sl=(s,e,t)=>{if(!s||!(nl(s,e)||typeof s=="object"))return;const r=s.constructor.name,i=Dp(t,r);let o=i.indexOf(s);return o===-1&&(o=i.length,i.push(s)),o};function dr(s,e,t){if(s instanceof Array)return s.map(r=>dr(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=Op(s);return{rr_type:r,base64:i}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[dr(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:[dr(s.data,e,t),s.width,s.height]};if(nl(s,e)||typeof s=="object"){const r=s.constructor.name,i=sl(s,e,t);return{rr_type:r,index:i}}}}return s}const il=(s,e,t)=>s.map(r=>dr(r,e,t)),nl=(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 _p(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=Ue(e.CanvasRenderingContext2D.prototype,n,function(l){return function(...u){return oe(this.canvas,t,r,!0)||setTimeout(()=>{const c=il(u,e,this);s(this.canvas,{type:Me["2D"],property:n,args:c})},0),l.apply(this,u)}});i.push(a)}catch(a){const l=_t(e.CanvasRenderingContext2D.prototype,n,{set(u){s(this.canvas,{type:Me["2D"],property:n,args:[u],setter:!0})}});i.push(l)}return()=>{i.forEach(n=>n())}}function kp(s){return s==="experimental-webgl"?"webgl":s}function Qn(s,e,t,r){const i=[];try{const o=Ue(s.HTMLCanvasElement.prototype,"getContext",function(n){return function(a,...l){if(!oe(this,e,t,!0)){const u=kp(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 qn(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=Ue(s,l,function(c){return function(...h){const f=c.apply(this,h);if(sl(f,o,this),"tagName"in this.canvas&&!oe(this.canvas,r,i,!0)){const g=il(h,o,this),p={type:e,property:l,args:g};t(this.canvas,p)}return f}});n.push(u)}catch(u){const c=_t(s,l,{set(h){t(this.canvas,{type:e,property:l,args:[h],setter:!0})}});n.push(c)}return n}function $p(s,e,t,r){const i=[];return i.push(...qn(e.WebGLRenderingContext.prototype,Me.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext!="undefined"&&i.push(...qn(e.WebGL2RenderingContext.prototype,Me.WebGL2,s,t,r,e)),()=>{i.forEach(o=>o())}}const ol="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Lp=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),eo=typeof window!="undefined"&&window.Blob&&new Blob([Lp(ol)],{type:"text/javascript;charset=utf-8"});function Pp(s){let e;try{if(e=eo&&(window.URL||window.webkitURL).createObjectURL(eo),!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,"+ol,{name:s==null?void 0:s.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Fp{constructor(e){w(this,"pendingCanvasMutations",new Map),w(this,"rafStamps",{latestId:0,invokeId:null}),w(this,"mirror"),w(this,"mutationCb"),w(this,"resetObservers"),w(this,"frozen",!1),w(this,"locked",!1),w(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=Qn(t,r,i,!0),a=new Map,l=new Pp;l.onmessage=p=>{const{id:y}=p.data;if(a.set(y,!1),!("base64"in p.data))return;const{base64:d,type:m,width:S,height:v}=p.data;this.mutationCb({id:y,type:Me["2D"],commands:[{property:"clearRect",args:[0,0,S,v]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:d}],type:m}]},0,0]}]})};const u=1e3/e;let c=0,h;const f=()=>{const p=[];return t.document.querySelectorAll("canvas").forEach(y=>{oe(y,r,i,!0)||p.push(y)}),p},g=p=>{if(c&&p-c<u){h=requestAnimationFrame(g);return}c=p,f().forEach(async y=>{var d;const m=this.mirror.getId(y);if(a.get(m)||y.width===0||y.height===0)return;if(a.set(m,!0),["webgl","webgl2"].includes(y.__context)){const v=y.getContext(y.__context);((d=v==null?void 0:v.getContextAttributes())==null?void 0:d.preserveDrawingBuffer)===!1&&v.clear(v.COLOR_BUFFER_BIT)}const S=await createImageBitmap(y);l.postMessage({id:m,bitmap:S,width:y.width,height:y.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=Qn(e,t,r,!1),o=_p(this.processMutation.bind(this),e,t,r),n=$p(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 We(u,["type"])}),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:i}),this.pendingCanvasMutations.delete(e)}}class Bp{constructor(e){w(this,"trackedLinkElements",new WeakSet),w(this,"mutationCb"),w(this,"adoptedStyleSheetCb"),w(this,"styleMirror",new Fi),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:ho(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 Up{constructor(){w(this,"nodeMap",new WeakMap),w(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(){}}function Vp(s,e,t){var c,h,f,g,p,y;const r=(c=t==null?void 0:t.root)!=null?c:null,i=(h=t==null?void 0:t.threshold)!=null?h:.5,o=(f=t==null?void 0:t.sensitivity)!=null?f:.05,n=Wp((g=t==null?void 0:t.rootMargin)!=null?g:"0px"),a=new Map,l=zp(r),u=Gp(l,n);for(const d of s){const m=d.getBoundingClientRect();let S=Yp(),v=0;m.width>0&&m.height>0&&(S=jp(m,u),v=Hp(m,S),v=Math.round(v*100)/100);const b=Zp(d),C=(p=e.get(d))!=null?p:null,E=(y=C==null?void 0:C.intersectionRatio)!=null?y:0,_=v,A=(C==null?void 0:C.isStyleVisible)&&E>i,V=b&&_>i;!C||A!==V||A!==V&&Math.abs(_-E)>o?a.set(d,{target:d,isVisible:V,isStyleVisible:b,intersectionRatio:_,intersectionRect:S,oldValue:C}):a.set(d,C)}return a}function Wp(s){const e=s.trim().split(/\s+/),t=(r,i)=>r.endsWith("%")?parseFloat(r)/100*i:parseFloat(r)||0;return function(r){const i=t(e[0]||"0px",r.height),o=t(e[1]||e[0]||"0px",r.width),n=t(e[2]||e[0]||"0px",r.height),a=t(e[3]||e[1]||e[0]||"0px",r.width);return{top:i,right:o,bottom:n,left:a,width:0,height:0}}}function zp(s){return s?s.getBoundingClientRect():new DOMRect(0,0,window.innerWidth,window.innerHeight)}function Gp(s,e){const t=e(s);return new DOMRect(s.left-t.left,s.top-t.top,s.width+t.left+t.right,s.height+t.top+t.bottom)}function jp(s,e){const t=Math.max(s.top,e.top),r=Math.max(s.left,e.left),i=Math.min(s.bottom,e.bottom),o=Math.min(s.right,e.right),n=Math.max(0,o-r),a=Math.max(0,i-t);return{top:t,left:r,bottom:i,right:o,width:n,height:a}}function Hp(s,e){const t=s.width*s.height,r=e.width*e.height;return t>0?r/t:0}function Yp(){return{top:0,left:0,right:0,bottom:0,width:0,height:0}}function Zp(s){const e=getComputedStyle(s);return e&&e.display!=="none"&&e.visibility!=="hidden"&&parseFloat(e.opacity||"1")>0}class Xp{constructor(e){var u,c,h,f,g,p;w(this,"frozen",!1),w(this,"locked",!1),w(this,"pending",new Map),w(this,"mirror"),w(this,"mutationCb"),w(this,"rafId",null),w(this,"rafThrottle"),w(this,"lastFlushTime",0),w(this,"elements",new Set),w(this,"previousState",new Map),w(this,"root",null),w(this,"threshold"),w(this,"sensitivity"),w(this,"rootMargin"),w(this,"hasInitialized",!1),w(this,"mode","none"),w(this,"debounce",50),w(this,"throttle",100),w(this,"buffer",new Map),w(this,"debounceTimer",null),w(this,"lastThrottleTime",0),w(this,"disabled",!1),w(this,"notifyActivity");const{doc:t,mirror:r,sampling:i,mutationCb:o,notifyActivity:n}=e;if(this.mirror=r,this.mutationCb=o,this.notifyActivity=n,this.rootMargin="0px",i===!1){this.disabled=!0;return}const a=typeof i=="object"&&i!==null?i:{};this.mode=(u=a==null?void 0:a.mode)!=null?u:"none",this.debounce=Number((c=a==null?void 0:a.debounce)!=null?c:100),this.throttle=Number((h=a==null?void 0:a.throttle)!=null?h:100),this.threshold=Number((f=a==null?void 0:a.threshold)!=null?f:.5),this.sensitivity=Number((g=a==null?void 0:a.sensitivity)!=null?g:.05),this.rafThrottle=Number((p=a==null?void 0:a.rafThrottle)!=null?p:100),t.querySelectorAll("*").forEach(y=>this.observe(y)),new MutationObserver(y=>{y.forEach(d=>{d.addedNodes.forEach(m=>{m.nodeType===Node.ELEMENT_NODE&&(this.observe(m),m.querySelectorAll("*").forEach(S=>this.observe(S)))}),d.removedNodes.forEach(m=>{m.nodeType===Node.ELEMENT_NODE&&this.unobserve(m)})})}).observe(t.body,{childList:!0,subtree:!0}),this.startPendingFlushLoop()}startPendingFlushLoop(){if(this.disabled)return;const e=t=>{t-this.lastFlushTime>=this.rafThrottle&&(this.lastFlushTime=t,this.flushPendingVisibilityMutations()),this.rafId=requestAnimationFrame(e)};this.rafId=requestAnimationFrame(e)}flushPendingVisibilityMutations(){if(this.disabled||this.frozen||this.locked||this.elements.size===0)return;const e=Vp(this.elements,this.previousState,{root:this.root,threshold:this.threshold,sensitivity:this.sensitivity,rootMargin:this.rootMargin});for(const[t,r]of e.entries()){const i=this.previousState.get(t);if(!i||i.isVisible!==r.isVisible||Math.abs(i.intersectionRatio-r.intersectionRatio)>this.sensitivity){const n=this.mirror.getId(t);n!==-1&&this.buffer.set(t,{id:n,isVisible:r.isVisible,ratio:r.intersectionRatio}),this.previousState.set(t,r)}}if(this.previousState=e,!this.hasInitialized){this.hasInitialized=!0,this.buffer.clear();return}this.scheduleEmit()}scheduleEmit(){if(this.mode==="debounce")clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>this.flushBuffer(),this.debounce);else if(this.mode==="throttle"){const e=performance.now();e-this.lastThrottleTime>=this.throttle&&(this.lastThrottleTime=e,this.flushBuffer())}else this.flushBuffer()}flushBuffer(){var e;this.buffer.size!==0&&((e=this.notifyActivity)==null||e.call(this,this.buffer.size),this.mutationCb({mutations:Array.from(this.buffer.values())}),this.buffer.clear())}observe(e){this.disabled||this.elements.add(e)}unobserve(e){this.disabled||(this.elements.delete(e),this.previousState.delete(e),this.pending.delete(e))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}reset(){this.elements.clear(),this.previousState.clear(),this.pending.clear(),this.rafId&&cancelAnimationFrame(this.rafId)}}const Jp="2.1.2-alpha.1";let Z,pt,hs,fs,qe=!1;const Or=[];let Le;function Kp(s){return new Promise(t=>{const r=()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{t()})})},i=(()=>{let o=!1;return()=>{o||(o=!0,r())}})();["interactive","complete"].includes(s.document.readyState)?i():(s.addEventListener("DOMContentLoaded",i,{once:!0}),s.addEventListener("load",i,{once:!0}),setTimeout(()=>{i()},5e3))})}try{if(Array.from([1],s=>s*2)[0]!==2){const s=document.createElement("iframe");document.body.appendChild(s),Array.from=((Xi=s.contentWindow)==null?void 0:Xi.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}const fe=fo();function ce(s={}){const{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,checkoutEveryNvm:i,blockClass:o="rr-block",blockSelector:n=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,excludeAttribute:u,maskTextClass:c="rr-mask",maskTextSelector:h=null,inlineStylesheet:f=!0,maskAllInputs:g,maskInputOptions:p,slimDOMOptions:y,maskInputFn:d,maskTextFn:m,hooks:S,packFn:v,sampling:b={},dataURLOptions:C={},mousemoveWait:E,recordDOM:_=!0,recordCanvas:A=!1,recordCrossOriginIframes:V=!1,recordAfter:z=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",flushCustomEvent:J=s.flushCustomEvent!==void 0?s.flushCustomEvent:"after",userTriggeredOnInput:Q=!1,collectFonts:te=!1,inlineImages:R=!1,plugins:ie,keepIframeSrcFn:ne=()=>!1,ignoreCSSAttributes:O=new Set([]),errorHandler:ue}=s;dp(ue);const de=V?window.parent===window:!0;let ae=!1;if(!de)try{window.parent.document&&(ae=!1)}catch(k){ae=!0}if(de&&!e)throw new Error("emit function is required");if(!de&&!ae)return()=>{};E!==void 0&&b.mousemove===void 0&&(b.mousemove=E),fe.reset();const jr=u===void 0?/.^/:u,Hr=g===!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}:p!==void 0?p:{password:!0},Yr=y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:y==="all",headMetaDescKeywords:y==="all",headTitleMutations:y==="all"}:y||{};ki();let Vi,Zr=0,Xr=0;const dl=k=>{Xr+=k},Wi=k=>{for(const le of ie||[])le.eventProcessor&&(k=le.eventProcessor(k));return v&&!ae&&(k=v(k)),k};Z=(k,le)=>{var K;const re=k;if(re.timestamp=me(),(K=Pe[0])!=null&&K.isFrozen()&&re.type!==M.FullSnapshot&&!(re.type===M.IncrementalSnapshot&&re.data.source===x.Mutation)&&Pe.forEach(pe=>pe.unfreeze()),de)e==null||e(Wi(re),le);else if(ae){const pe={type:"rrweb",event:Wi(re),origin:window.location.origin,isCheckout:le};window.parent.postMessage(pe,"*")}if(re.type===M.FullSnapshot)Vi=re,Zr=0;else if(re.type===M.IncrementalSnapshot){if(re.data.source===x.Mutation&&re.data.isAttachIframe)return;Zr++;const pe=r&&Zr>=r,Ve=t&&re.timestamp-Vi.timestamp>t,W=i&&Xr>=i;(pe||Ve||W)&&(W&&(Xr=0),pt(!0))}};const kt=k=>{Z({type:M.IncrementalSnapshot,data:N({source:x.Mutation},k)})},zi=k=>Z({type:M.IncrementalSnapshot,data:N({source:x.Scroll},k)}),Gi=k=>Z({type:M.IncrementalSnapshot,data:N({source:x.CanvasMutation},k)}),ji=k=>{var le;(le=S==null?void 0:S.visibilityMutation)==null||le.call(S,k),Z({type:M.IncrementalSnapshot,data:N({source:x.VisibilityMutation},k)})},pl=k=>Z({type:M.IncrementalSnapshot,data:N({source:x.AdoptedStyleSheet},k)}),ke=new Bp({mutationCb:kt,adoptedStyleSheetCb:pl}),$e=new Rp({mirror:fe,mutationCb:kt,stylesheetManager:ke,recordCrossOriginIframes:V,wrappedEmit:Z});for(const k of ie||[])k.getMirror&&k.getMirror({nodeMirror:fe,crossOriginIframeMirror:$e.crossOriginIframeMirror,crossOriginIframeStyleMirror:$e.crossOriginIframeStyleMirror});const Jr=new Up;hs=new Fp({recordCanvas:A,mutationCb:Gi,win:window,blockClass:o,blockSelector:n,mirror:fe,sampling:b.canvas,dataURLOptions:C}),fs=new Xp({doc:window.document,mirror:fe,sampling:b.visibility,mutationCb:ji,notifyActivity:dl});const $t=new Ap({mutationCb:kt,scrollCb:zi,bypassOptions:{blockClass:o,blockSelector:n,maskTextClass:c,maskTextSelector:h,excludeAttribute:jr,inlineStylesheet:f,maskInputOptions:Hr,dataURLOptions:C,maskTextFn:m,maskInputFn:d,recordCanvas:A,inlineImages:R,sampling:b,slimDOMOptions:Yr,iframeManager:$e,stylesheetManager:ke,canvasManager:hs,visibilityManager:fs,keepIframeSrcFn:ne,processedNodeManager:Jr},mirror:fe});pt=(k=!1)=>{if(!_)return;Z({type:M.Meta,data:{href:window.location.href,width:Ti(),height:Oi()}},k),ke.reset(),$t.init(),Pe.forEach(K=>K.lock());const le=Eu(document,{mirror:fe,blockClass:o,blockSelector:n,maskTextClass:c,maskTextSelector:h,excludeAttribute:jr,inlineStylesheet:f,maskAllInputs:Hr,maskTextFn:m,maskInputFn:d,slimDOM:Yr,dataURLOptions:C,recordCanvas:A,inlineImages:R,onSerialize:K=>{Qe(K,fe)&&$e.addIframe(K),Li(K,fe)&&ke.trackLinkElement(K),Ae(K)&&$t.addShadowRoot(T.shadowRoot(K),document)},onIframeLoad:(K,re)=>{$e.attachIframe(K,re),$t.observeAttachShadow(K)},onStylesheetLoad:(K,re)=>{ke.attachLinkElement(K,re)},keepIframeSrcFn:ne});if(!le)return console.warn("Failed to snapshot the document");Z({type:M.FullSnapshot,data:{node:le,initialOffset:Ai(window)}},k),Pe.forEach(K=>K.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ke.adoptStyleSheets(document.adoptedStyleSheets,fe.getId(document))},Le=()=>{for(const k of Or)Z(k);Or.length=0};try{const k=[],le=pe=>{var Ve;return L(Np)({mutationCb:kt,mousemoveCb:(W,Kr)=>Z({type:M.IncrementalSnapshot,data:{source:Kr,positions:W}}),mouseInteractionCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:x.MouseInteraction},W)}),scrollCb:zi,viewportResizeCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:x.ViewportResize},W)}),inputCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:x.Input},W)}),mediaInteractionCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:x.MediaInteraction},W)}),styleSheetRuleCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:x.StyleSheetRule},W)}),styleDeclarationCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:x.StyleDeclaration},W)}),canvasMutationCb:Gi,visibilityMutationCb:ji,fontCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:x.Font},W)}),selectionCb:W=>{Z({type:M.IncrementalSnapshot,data:N({source:x.Selection},W)})},customElementCb:W=>{Z({type:M.IncrementalSnapshot,data:N({source:x.CustomElement},W)})},blockClass:o,ignoreClass:a,ignoreSelector:l,maskTextClass:c,maskTextSelector:h,excludeAttribute:jr,maskInputOptions:Hr,inlineStylesheet:f,sampling:b,recordDOM:_,recordCanvas:A,inlineImages:R,userTriggeredOnInput:Q,collectFonts:te,doc:pe,maskInputFn:d,maskTextFn:m,keepIframeSrcFn:ne,blockSelector:n,slimDOMOptions:Yr,dataURLOptions:C,mirror:fe,iframeManager:$e,stylesheetManager:ke,shadowDomManager:$t,processedNodeManager:Jr,canvasManager:hs,visibilityManager:fs,ignoreCSSAttributes:O,plugins:((Ve=ie==null?void 0:ie.filter(W=>W.observer))==null?void 0:Ve.map(W=>({observer:W.observer,options:W.options,callback:Kr=>Z({type:M.Plugin,data:{plugin:W.name,payload:Kr}})})))||[]},S)};$e.addLoadListener(pe=>{try{k.push(le(pe.contentDocument))}catch(Ve){console.warn(Ve)}});const K=()=>{J==="before"&&Le(),pt(),k.push(le(document)),qe=!0,J==="after"&&Le()},re=async()=>{J==="before"&&Le(),z==="DOMContentStabilized"&&(console.debug(`[${me()}] [rrweb:record] \u{1F7E2} Waiting for DOM stabilization...`),await Kp(window),console.debug(`[${me()}] [rrweb:record] \u2705 DOM stabilized, starting recording`)),console.debug(`[${me()}] [rrweb:record] \u2705 Init dom and takeFullSnapshot `),pt(),k.push(le(document)),qe=!0,J==="after"&&Le()};return document.readyState==="interactive"||document.readyState==="complete"?K():(k.push(se("DOMContentLoaded",()=>{Z({type:M.DomContentLoaded,data:{}}),z==="DOMContentLoaded"&&K()})),k.push(se("load",()=>{Z({type:M.Load,data:{}}),z==="load"&&K()},window))),()=>{Le(),k.forEach(pe=>pe()),Jr.destroy(),qe=!1,pp()}}catch(k){console.warn(k)}}ce.getVersion=()=>Jp;ce.isRecording=()=>qe;ce.flushCustomEventQueue=()=>{console.warn(`[rrweb] CustomEvent flushing: ${Or.length} events`),Le()};ce.addCustomEvent=(s,e)=>{const t={type:M.Custom,data:{tag:s,payload:e}};if(!qe){console.warn(`[rrweb] CustomEvent buffered before/after recording start: ${s}`),Or.push(t);return}Z(t)};ce.freezePage=()=>{Pe.forEach(s=>s.freeze())};ce.takeFullSnapshot=s=>{if(!qe)throw new Error("please take full snapshot after start recording");pt(s)};ce.mirror=fe;function al(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 Qp=Object.freeze(Object.defineProperty({__proto__:null,default:al},Symbol.toStringTag,{value:"Module"}));function qp(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(m){const S=["MSIE ","Trident/","Edge/"];return new RegExp(S.join("|")).test(m)}const a=n(s.navigator.userAgent)?1:0;function l(m,S){this.scrollLeft=m,this.scrollTop=S}function u(m){return .5*(1-Math.cos(Math.PI*m))}function c(m){if(m===null||typeof m!="object"||m.behavior===void 0||m.behavior==="auto"||m.behavior==="instant")return!0;if(typeof m=="object"&&m.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+m.behavior+" is not a valid value for enumeration ScrollBehavior.")}function h(m,S){if(S==="Y")return m.clientHeight+a<m.scrollHeight;if(S==="X")return m.clientWidth+a<m.scrollWidth}function f(m,S){const v=s.getComputedStyle(m,null)["overflow"+S];return v==="auto"||v==="scroll"}function g(m){const S=h(m,"Y")&&f(m,"Y"),v=h(m,"X")&&f(m,"X");return S||v}function p(m){for(;m!==e.body&&g(m)===!1;)m=m.parentNode||m.host;return m}function y(m){const S=o();let v,b,C,E=(S-m.startTime)/r;E=E>1?1:E,v=u(E),b=m.startX+(m.x-m.startX)*v,C=m.startY+(m.y-m.startY)*v,m.method.call(m.scrollable,b,C),(b!==m.x||C!==m.y)&&s.requestAnimationFrame(y.bind(s,m))}function d(m,S,v){let b,C,E,_;const A=o();m===e.body?(b=s,C=s.scrollX||s.pageXOffset,E=s.scrollY||s.pageYOffset,_=i.scroll):(b=m,C=m.scrollLeft,E=m.scrollTop,_=l),y({scrollable:b,method:_,startTime:A,startX:C,startY:E,x:S,y:v})}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 m=arguments[0].left,S=arguments[0].top;d.call(this,this,typeof m=="undefined"?this.scrollLeft:~~m,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 m=p(this),S=m.getBoundingClientRect(),v=this.getBoundingClientRect();m!==e.body?(d.call(this,m,m.scrollLeft+v.left-S.left,m.scrollTop+v.top-S.top),s.getComputedStyle(m).position!=="fixed"&&s.scrollBy({left:S.left,top:S.top,behavior:"smooth"})):s.scrollBy({left:v.left,top:v.top,behavior:"smooth"})}}class em{constructor(e=[],t){w(this,"timeOffset",0),w(this,"speed"),w(this,"actions"),w(this,"raf",null),w(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 to(s,e){if(s.type===M.IncrementalSnapshot&&s.data.source===x.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}/*! *****************************************************************************
69
+ or you can use record.mirror to access the mirror instance during recording.`;exports.mirror={map:{},getId(){return console.error(je),-1},getNode(){return console.error(je),null},removeNodeFromMap(){console.error(je)},has(){return console.error(je),!1},reset(){console.error(je)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(exports.mirror=new Proxy(exports.mirror,{get(s,e,t){return e==="map"&&console.error(je),Reflect.get(s,e,t)}}));function ot(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 _t(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)}}),()=>_t(s,e,o||{},!0)}function me(){return Math.round(performance.timeOrigin+performance.now())}function Ai(s=window){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=T.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=T.parentElement(o.body))==null?void 0:r.scrollTop)||((i=o==null?void 0:o.body)==null?void 0:i.scrollTop)||0}}function Oi(s=window){const e=s.document;return s.innerHeight||e.documentElement&&e.documentElement.clientHeight||e.body&&e.body.clientHeight||0}function Ti(s=window){const e=s.document;return s.innerWidth||e.documentElement&&e.documentElement.clientWidth||e.body&&e.body.clientWidth||0}function Di(s){return s?s.nodeType===s.ELEMENT_NODE?s:T.parentElement(s):null}function oe(s,e,t,r){if(!s)return!1;const i=Di(s);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(yr(i,e,r))return!0}catch(o){}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function Za(s,e){return e.getId(s)!==-1}function fr(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===vt}function _i(s,e){if(gt(s))return!1;const t=e.getId(s);if(!e.has(t))return!0;const r=T.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?_i(r,e):!0}function Rr(s){return!!s.changedTouches}function ki(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 Xa(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 $i(s,e){e(s.value);for(let t=s.children.length-1;t>=0;t--)$i(s.children[t],e)}function Qe(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function Li(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function Pi(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=Pi(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 Ae(s){return s?s instanceof be&&"shadowRoot"in s?!!s.shadowRoot:!!T.shadowRoot(s):!1}function Xe(s,e){const t=s[e[0]];return e.length===1?t:Xe(t.cssRules[e[1]].cssRules,e.slice(2))}function Js(s){const e=[...s],t=e.pop();return{positions:e,index:t}}function Ja(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 Fi{constructor(){w(this,"id",1),w(this,"styleIDMap",new WeakMap),w(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 Bi(s){var e;let t=null;return"getRootNode"in s&&((e=T.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&T.host(T.getRootNode(s))&&(t=T.host(T.getRootNode(s))),t}function Ka(s){let e=s,t;for(;t=Bi(e);)e=t;return e}function Qa(s){const e=s.ownerDocument;if(!e)return!1;const t=Ka(s);return T.contains(e,t)}function Ui(s){const e=s.ownerDocument;return e?T.contains(e,s)||Qa(s):!1}const lp=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:Fi,get _mirror(){return exports.mirror},closestElementOfNode:Di,getBaseDimension:Pi,getNestedRule:Xe,getPositionsAndIndex:Js,getRootShadowHost:Ka,getShadowHost:Bi,getWindowHeight:Oi,getWindowScroll:Ai,getWindowWidth:Ti,hasShadowRoot:Ae,hookSetter:_t,inDom:Ui,isAncestorRemoved:_i,isBlocked:oe,isIgnored:fr,isSerialized:Za,isSerializedIframe:Qe,isSerializedStylesheet:Li,iterateResolveTree:$i,legacy_isTouchEvent:Rr,nowTimestamp:me,on:se,polyfill:ki,queueToResolveTrees:Xa,shadowHostInDom:Qa,throttle:ot,uniqueTextMutations:Ja},Symbol.toStringTag,{value:"Module"}));var M=(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))(M||{}),x=(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[s.VisibilityMutation=17]="VisibilityMutation",s))(x||{}),F=(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))(F||{}),Ce=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(Ce||{}),Me=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(Me||{}),Re=(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))(Re||{}),P=(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))(P||{}),Ee=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(Ee||{});function Gn(s){return"__ln"in s}class up{constructor(){w(this,"length",0),w(this,"head",null),w(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&&Gn(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&&Gn(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 jn=(s,e)=>`${s}@${e}`;class cp{constructor(){w(this,"frozen",!1),w(this,"locked",!1),w(this,"texts",[]),w(this,"attributes",[]),w(this,"attributeMap",new WeakMap),w(this,"removes",[]),w(this,"mapRemoves",[]),w(this,"movedMap",{}),w(this,"addedSet",new Set),w(this,"movedSet",new Set),w(this,"droppedSet",new Set),w(this,"removesSubTreeCache",new Set),w(this,"mutationCb"),w(this,"blockClass"),w(this,"blockSelector"),w(this,"maskTextClass"),w(this,"maskTextSelector"),w(this,"excludeAttribute"),w(this,"inlineStylesheet"),w(this,"maskInputOptions"),w(this,"maskTextFn"),w(this,"maskInputFn"),w(this,"keepIframeSrcFn"),w(this,"recordCanvas"),w(this,"inlineImages"),w(this,"slimDOMOptions"),w(this,"dataURLOptions"),w(this,"doc"),w(this,"mirror"),w(this,"iframeManager"),w(this,"stylesheetManager"),w(this,"shadowDomManager"),w(this,"canvasManager"),w(this,"visibilityManager"),w(this,"processedNodeManager"),w(this,"unattachedDoc"),w(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),w(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new up,i=l=>{let u=l,c=vt;for(;c===vt;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},o=l=>{const u=T.parentNode(l);if(!u||!Ui(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=gt(u)?this.mirror.getId(Bi(l)):this.mirror.getId(u),f=i(l);if(h===-1||f===-1)return r.addNode(l);const g=Ze(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,excludeAttribute:this.excludeAttribute,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=>{Qe(p,this.mirror)&&this.iframeManager.addIframe(p),Li(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),Ae(l)&&this.shadowDomManager.addShadowRoot(T.shadowRoot(l),this.doc)},onIframeLoad:(p,y)=>{this.iframeManager.attachIframe(p,y),this.shadowDomManager.observeAttachShadow(p)},onStylesheetLoad:(p,y)=>{this.stylesheetManager.attachLinkElement(p,y)},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)Hn(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(T.parentNode(l))||o(l);for(const l of this.addedSet)!Yn(this.droppedSet,l)&&!Hn(this.removesSubTreeCache,l,this.mirror)||Yn(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(T.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(T.parentNode(c.value));if(i(c.value)===-1)continue;if(h!==-1){l=c;break}else{const g=c.value,p=T.parentNode(g);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const y=T.host(p);if(this.mirror.getId(y)!==-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=T.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.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(a))}),w(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));const r=Array.from(T.childNodes(e),i=>T.textContent(i)||"").join("");t.attributes.value=pr({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:mr(e),value:r,maskInputFn:this.maskInputFn})}),w(this,"processMutation",e=>{if(!fr(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=T.textContent(e.target);!oe(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:yo(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Di(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);const n=t[r],a=typeof n=="boolean",l=document.contains(t),u=ri(t),c=ys(r,this.excludeAttribute);if(i===null&&!t.hasAttribute(r)&&e.oldValue!==null&&(n===""||n===null||typeof n=="undefined")){console.debug(`[${me()}] [rrweb:record/mutation] \u26D4 phantom attribute mutation ignored`,{node:T.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:r,value:i,oldValue:e.oldValue,excludeAttribute:this.excludeAttribute,propValue:n,isBooleanAttr:a,inDOM:l,isVisible:u,isExcludeAttributeName:c});return}if(ys(r,this.excludeAttribute)){console.debug(`[${me()}] [rrweb:record/mutation] \u26D4 excluded attribute mutation ignored`,{node:T.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:r,value:i,oldValue:e.oldValue,excludeAttribute:this.excludeAttribute,propValue:n,isBooleanAttr:a,inDOM:l,isVisible:u,isExcludeAttributeName:c});return}if(r==="value"){const g=mr(t);i=pr({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:g,value:i,maskInputFn:this.maskInputFn})}if(oe(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let f=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(f||(f={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(f),this.attributeMap.set(e.target,f)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!go(t.tagName,r))if(f.attributes[r]=mo(this.doc,Te(t.tagName),Te(r),i),r!=="class"&&(e.oldValue===null||i===""||i!==e.oldValue)&&console.debug(`[${me()}] [rrweb:record/mutation] \u26A0\uFE0F suspicious attribute mutation`,{reason:[i===e.oldValue?"no change in value":null,i===n?"mirrored in DOM property":null,i===f.attributes[r]?"redundant assignment":null].filter(Boolean).join(", ")||"uncategorized",node:T.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:r,value:i,oldValue:e.oldValue,transformedValue:f.attributes[r],excludeAttribute:this.excludeAttribute,propValue:n,isBooleanAttr:a,inDOM:l,isVisible:u,isExcludeAttributeName:c}),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(y){this.unattachedDoc=this.doc}const p=this.unattachedDoc.createElement("span");e.oldValue&&p.setAttribute("style",e.oldValue);for(const y of Array.from(t.style)){const d=t.style.getPropertyValue(y),m=t.style.getPropertyPriority(y);d!==p.style.getPropertyValue(y)||m!==p.style.getPropertyPriority(y)?m===""?f.styleDiff[y]=d:f.styleDiff[y]=[d,m]:f._unchangedStyles[y]=[d,m]}for(const y of Array.from(p.style))t.style.getPropertyValue(y)===""&&(f.styleDiff[y]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?f.attributes.rr_open_mode="modal":f.attributes.rr_open_mode="non-modal");break}case"childList":{if(oe(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=gt(e.target)?this.mirror.getId(T.host(e.target)):this.mirror.getId(e.target);oe(e.target,this.blockClass,this.blockSelector,!1)||fr(t,this.mirror,this.slimDOMOptions)||!Za(t,this.mirror)||(this.addedSet.has(t)?(Ks(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||_i(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[jn(r,i)]?Ks(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:gt(e.target)&&yt(e.target)?!0:void 0}),hp(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),w(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(fr(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[jn(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);oe(e,this.blockClass,this.blockSelector,!1)||(T.childNodes(e).forEach(r=>this.genAdds(r)),Ae(e)&&T.childNodes(T.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","excludeAttribute","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","visibilityManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze(),this.visibilityManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.visibilityManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock(),this.visibilityManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.visibilityManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset(),this.visibilityManager.reset()}}function Ks(s,e){s.delete(e),T.childNodes(e).forEach(t=>Ks(s,t))}function hp(s,e){const t=[s];for(;t.length;){const r=t.pop();e.has(r)||(e.add(r),T.childNodes(r).forEach(i=>t.push(i)))}}function Hn(s,e,t){return s.size===0?!1:fp(s,e)}function fp(s,e,t){const r=T.parentNode(e);return r?s.has(r):!1}function Yn(s,e){return s.size===0?!1:qa(s,e)}function qa(s,e){const t=T.parentNode(e);return t?s.has(t)?!0:qa(s,t):!1}let wt;function dp(s){wt=s}function pp(){wt=void 0}const L=s=>wt?(...t)=>{try{return s(...t)}catch(r){if(wt&&wt(r)===!0)return;throw r}}:s,Pe=[];function at(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 el(s,e){const t=new cp;Pe.push(t),t.init(s);const r=new(Ya())(L(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function mp({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=ot(L(h=>{const f=Date.now()-a;s(n.map(g=>(g.timeOffset-=f,g)),h),n=[],a=null}),o),u=L(ot(L(h=>{const f=at(h),{clientX:g,clientY:p}=Rr(h)?h.changedTouches[0]:h;a||(a=me()),n.push({x:g,y:p,id:r.getId(f),timeOffset:me()-a}),l(typeof DragEvent!="undefined"&&h instanceof DragEvent?x.Drag:h instanceof MouseEvent?x.MouseMove:x.TouchMove)}),i,{trailing:!1})),c=[se("mousemove",u,t),se("touchmove",u,t),se("drag",u,t)];return L(()=>{c.forEach(h=>h())})}function gp({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{console.debug("MouseInteractionObserver: No operation needed")};const n=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[];let l=null;const u=c=>h=>{const f=at(h);if(oe(f,r,i,!0))return;let g=null,p=c;if("pointerType"in h){switch(h.pointerType){case"mouse":g=Ce.Mouse;break;case"touch":g=Ce.Touch;break;case"pen":g=Ce.Pen;break}g===Ce.Touch?F[c]===F.MouseDown?p="TouchStart":F[c]===F.MouseUp&&(p="TouchEnd"):Ce.Pen}else Rr(h)&&(g=Ce.Touch);g!==null?(l=g,(p.startsWith("Touch")&&g===Ce.Touch||p.startsWith("Mouse")&&g===Ce.Mouse)&&(g=null)):F[c]===F.Click&&(g=l,l=null);const y=Rr(h)?h.changedTouches[0]:h;if(!y)return;const d=t.getId(f),{clientX:m,clientY:S}=y;L(s)(N({type:F[p],id:d,x:m,y:S},g!==null&&{pointerType:g}))};return Object.keys(F).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&n[c]!==!1).forEach(c=>{let h=Te(c);const f=u(c);if(window.PointerEvent)switch(F[c]){case F.MouseDown:case F.MouseUp:h=h.replace("mouse","pointer");break;case F.TouchStart:case F.TouchEnd:return}a.push(se(h,f,e))}),L(()=>{a.forEach(c=>c())})}function tl({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:o}){const n=L(ot(L(a=>{const l=at(a);if(!l||oe(l,r,i,!0))return;const u=t.getId(l);if(l===e&&e.defaultView){const c=Ai(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 se("scroll",n,e)}function yp({viewportResizeCb:s},{win:e}){let t=-1,r=-1;const i=L(ot(L(()=>{const o=Oi(),n=Ti();(t!==o||r!==n)&&(s({width:Number(n),height:Number(o)}),t=o,r=n)}),200));return se("resize",i,e)}const cs=["INPUT","TEXTAREA","SELECT"],Zn=new WeakMap,bp=["Enter","Tab","Escape","ArrowDown","ArrowUp","Delete"],Xn=new WeakMap;function wp({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:o,ignoreSelector:n,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function h(v){let b=at(v);const C=v.isTrusted,E=b&&b.tagName;if(b&&E==="OPTION"&&(b=T.parentElement(b)),!b||!E||cs.indexOf(E)<0||oe(b,r,i,!0)||b.classList.contains(o)||n&&b.matches(n))return;let _=b.value,A=!1;const V=mr(b)||"";V==="radio"||V==="checkbox"?A=b.checked:(a[E.toLowerCase()]||a[V])&&(_=pr({element:b,maskInputOptions:a,tagName:E,type:V,value:_,maskInputFn:l})),f(b,c?{text:_,isChecked:A,userTriggered:C}:{text:_,isChecked:A});const z=b.name;V==="radio"&&z&&A&&e.querySelectorAll(`input[type="radio"][name="${z}"]`).forEach(J=>{if(J!==b){const Q=J.value;f(J,c?{text:Q,isChecked:!A,userTriggered:!1}:{text:Q,isChecked:!A})}})}function f(v,b){const C=Zn.get(v),E=v,_=E.hasAttribute("placeholder"),A=E.value==="",V=typeof E.defaultValue=="string"?E.defaultValue==="":!0,z=!b.userTriggered,J=!C||C.text==="",Q=_&&A&&V&&J&&z&&!b.isChecked&&E.type!=="hidden"&&cs.includes(E.tagName),te=E.tagName==="INPUT"&&E.type==="text"&&!b.userTriggered&&b.text===E.defaultValue&&!C&&E.hasAttribute("placeholder"),R=!b.userTriggered&&E.value===E.defaultValue&&!C&&E.hasAttribute("placeholder")&&!b.isChecked&&E.type!=="hidden"&&cs.includes(E.tagName),ie=E.type==="checkbox"&&!b.userTriggered&&!b.isChecked&&!C,ne=E.type==="radio"&&!b.userTriggered&&!b.isChecked&&!C;if(Q||te||R||ie||ne){console.debug(`[${me()}] [rrweb:record/observer] \u26D4 phantom input ignored`,{node:T.describeNode(E),tag:E.tagName,nodeType:E.nodeType,attribute:E.attributes,value:E.value,isLikelyPhantom:Q,isRenderDrivenTextInput:te,isValueFromDefault:R,isPhantomCheckbox:ie,isPhantomRadio:ne});return}if(!C||C.text!==b.text||C.isChecked!==b.isChecked){Zn.set(v,b);const O=t.getId(v);L(s)(q(N({},b),{id:O}))}}const p=(u.input==="last"?["change"]:["input","change"]).map(v=>se(v,L(h),e)),y=v=>{const b=at(v);if(!b||!b.tagName)return;if(u.input==="all"){h(v);return}const C=b.tagName,E=v.key,_=bp.includes(E),A=C==="TEXTAREA",V=e.activeElement===b,z=b.value,J=Xn.get(b);if(Xn.set(b,z),!V){h(v);return}if(_){if(!A){h(v);return}let Q=J!=null?J:"",te=0;const R=2,ie=()=>{const ne=b.value,O=e.activeElement===b,ue=ne!==Q;if(!O){h(v);return}if(ue)te=0,Q=ne;else if(te++,te>=R){h(v);return}requestAnimationFrame(ie)};requestAnimationFrame(ie);return}};p.push(se("keydown",L(y),e));const d=e.defaultView;if(!d)return()=>{p.forEach(v=>v())};const m=d.Object.getOwnPropertyDescriptor(d.HTMLInputElement.prototype,"value"),S=[[d.HTMLInputElement.prototype,"value"],[d.HTMLInputElement.prototype,"checked"],[d.HTMLSelectElement.prototype,"value"],[d.HTMLTextAreaElement.prototype,"value"],[d.HTMLSelectElement.prototype,"selectedIndex"],[d.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...S.map(v=>_t(v[0],v[1],{set(){L(h)({target:this,isTrusted:!1})}},!1,d))),L(()=>{p.forEach(v=>v())})}function Ar(s){const e=[];function t(r,i){if(ir("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||ir("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||ir("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||ir("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const n=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(n)}else if(r.parentStyleSheet){const n=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(n)}return i}return t(s,e)}function Ne(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function vp({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:L((c,h,f)=>{const[g,p]=f,{id:y,styleId:d}=Ne(h,e,t.styleMirror);return(y&&y!==-1||d&&d!==-1)&&s({id:y,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:L((c,h,f)=>{const[g]=f,{id:p,styleId:y}=Ne(h,e,t.styleMirror);return(p&&p!==-1||y&&y!==-1)&&s({id:p,styleId:y,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:L((c,h,f)=>{const[g]=f,{id:p,styleId:y}=Ne(h,e,t.styleMirror);return(p&&p!==-1||y&&y!==-1)&&s({id:p,styleId:y,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:L((c,h,f)=>{const[g]=f,{id:p,styleId:y}=Ne(h,e,t.styleMirror);return(p&&p!==-1||y&&y!==-1)&&s({id:p,styleId:y,replaceSync:g}),c.apply(h,f)})}));const l={};nr("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(nr("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),nr("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),nr("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:L((f,g,p)=>{const[y,d]=p,{id:m,styleId:S}=Ne(g.parentStyleSheet,e,t.styleMirror);return(m&&m!==-1||S&&S!==-1)&&s({id:m,styleId:S,adds:[{rule:y,index:[...Ar(g),d||0]}]}),f.apply(g,p)})}),h.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:L((f,g,p)=>{const[y]=p,{id:d,styleId:m}=Ne(g.parentStyleSheet,e,t.styleMirror);return(d&&d!==-1||m&&m!==-1)&&s({id:d,styleId:m,removes:[{index:[...Ar(g),y]}]}),f.apply(g,p)})})}),L(()=>{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 rl({mirror:s,stylesheetManager:e},t){var r,i,o;let n=null;t.nodeName==="#document"?n=s.getId(t):n=s.getId(T.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}}),L(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function Sp({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:L((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:y}=Ne((c=l.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(p&&p!==-1||y&&y!==-1)&&s({id:p,styleId:y,set:{property:h,value:f,priority:g},index:Ar(l.parentRule)}),a.apply(l,u)})});const n=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(n,{apply:L((a,l,u)=>{var c;const[h]=u;if(t.has(h))return n.apply(l,[h]);const{id:f,styleId:g}=Ne((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:Ar(l.parentRule)}),a.apply(l,u)})}),L(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=n})}function Cp({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:o}){const n=L(l=>ot(L(u=>{const c=at(u);if(!c||oe(c,e,t,!0))return;const{currentTime:h,volume:f,muted:g,playbackRate:p,loop:y}=c;s({type:l,id:r.getId(c),currentTime:h,volume:f,muted:g,playbackRate:p,loop:y})}),i.media||500)),a=[se("play",n(Re.Play),o),se("pause",n(Re.Pause),o),se("seeked",n(Re.Seeked),o),se("volumechange",n(Re.VolumeChange),o),se("ratechange",n(Re.RateChange),o)];return L(()=>{a.forEach(l=>l())})}function Ep({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=Ue(e.fonts,"add",function(a){return function(l){return setTimeout(L(()=>{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),L(()=>{r.forEach(a=>a())})}function xp(s){const{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:o}=s;let n=!0;const a=L(()=>{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:y,endOffset:d}=f;oe(g,r,i,!0)||oe(y,r,i,!0)||u.push({start:t.getId(g),startOffset:p,end:t.getId(y),endOffset:d})}o({ranges:u})});return a(),se("selectionchange",a)}function Ip({doc:s,customElementCb:e}){const t=s.defaultView;return!t||!t.customElements?()=>{}:Ue(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 Mp(s,e){const{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:n,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,visibilityMutationCb:f,fontCb:g,selectionCb:p,customElementCb:y}=s;s.mutationCb=(...d)=>{e.mutation&&e.mutation(...d),t(...d)},s.mousemoveCb=(...d)=>{e.mousemove&&e.mousemove(...d),r(...d)},s.mouseInteractionCb=(...d)=>{e.mouseInteraction&&e.mouseInteraction(...d),i(...d)},s.scrollCb=(...d)=>{e.scroll&&e.scroll(...d),o(...d)},s.viewportResizeCb=(...d)=>{e.viewportResize&&e.viewportResize(...d),n(...d)},s.inputCb=(...d)=>{e.input&&e.input(...d),a(...d)},s.mediaInteractionCb=(...d)=>{e.mediaInteaction&&e.mediaInteaction(...d),l(...d)},s.styleSheetRuleCb=(...d)=>{e.styleSheetRule&&e.styleSheetRule(...d),u(...d)},s.styleDeclarationCb=(...d)=>{e.styleDeclaration&&e.styleDeclaration(...d),c(...d)},s.canvasMutationCb=(...d)=>{e.canvasMutation&&e.canvasMutation(...d),h(...d)},s.visibilityMutationCb=(...d)=>{e.visibilityMutation&&e.visibilityMutation(...d),f(...d)},s.fontCb=(...d)=>{e.font&&e.font(...d),g(...d)},s.selectionCb=(...d)=>{e.selection&&e.selection(...d),p(...d)},s.customElementCb=(...d)=>{e.customElement&&e.customElement(...d),y(...d)}}function Np(s,e={}){const t=s.doc.defaultView;if(!t)return()=>{};Mp(s,e);let r;s.recordDOM&&(r=el(s,s.doc));const i=mp(s),o=gp(s),n=tl(s),a=yp(s,{win:t}),l=wp(s),u=Cp(s);let c=()=>{},h=()=>{},f=()=>{},g=()=>{};s.recordDOM&&(c=vp(s,{win:t}),h=rl(s,s.doc),f=Sp(s,{win:t}),s.collectFonts&&(g=Ep(s)));const p=xp(s),y=Ip(s),d=[];for(const m of s.plugins)d.push(m.observer(m.callback,t,m.options));return L(()=>{Pe.forEach(m=>m.reset()),r==null||r.disconnect(),i(),o(),n(),a(),l(),u(),c(),h(),f(),g(),p(),y(),d.forEach(m=>m())})}function ir(s){return typeof window[s]!="undefined"}function nr(s){return!!(typeof window[s]!="undefined"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}class Jn{constructor(e){w(this,"iframeIdToRemoteIdMap",new WeakMap),w(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 Rp{constructor(e){w(this,"iframes",new WeakMap),w(this,"crossOriginIframeMap",new WeakMap),w(this,"crossOriginIframeMirror",new Jn(po)),w(this,"crossOriginIframeStyleMirror"),w(this,"crossOriginIframeRootIdMap",new WeakMap),w(this,"mirror"),w(this,"mutationCb"),w(this,"wrappedEmit"),w(this,"loadListener"),w(this,"stylesheetManager"),w(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Jn(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 M.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:M.IncrementalSnapshot,data:{source:x.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case M.Meta:case M.Load:case M.DomContentLoaded:return!1;case M.Plugin:return t;case M.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case M.IncrementalSnapshot:switch(t.data.source){case x.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 x.Drag:case x.TouchMove:case x.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case x.ViewportResize:return!1;case x.MediaInteraction:case x.MouseInteraction:case x.Scroll:case x.CanvasMutation:case x.Input:return this.replaceIds(t.data,e,["id"]),t;case x.StyleSheetRule:case x.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case x.Font:return t;case x.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case x.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!==Ee.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}}class Ap{constructor(e){w(this,"shadowDoms",new WeakSet),w(this,"mutationCb"),w(this,"scrollCb"),w(this,"bypassOptions"),w(this,"mirror"),w(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(!yt(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=el(q(N({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(tl(q(N({},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(T.host(e))),this.restoreHandlers.push(rl({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(Ue(e.prototype,"attachShadow",function(i){return function(o){const n=i.call(this,o),a=T.shadowRoot(this);return a&&Ui(this)&&r.addShadowRoot(a,t),n}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var Je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",dt=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var or=0;or<Je.length;or++)dt[Je.charCodeAt(or)]=or;var Op=function(s){var e=new Uint8Array(s),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=Je[e[t]>>2],i+=Je[(e[t]&3)<<4|e[t+1]>>4],i+=Je[(e[t+1]&15)<<2|e[t+2]>>6],i+=Je[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},Tp=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=dt[s.charCodeAt(r)],n=dt[s.charCodeAt(r+1)],a=dt[s.charCodeAt(r+2)],l=dt[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 Kn=new Map;function Dp(s,e){let t=Kn.get(s);return t||(t=new Map,Kn.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}const sl=(s,e,t)=>{if(!s||!(nl(s,e)||typeof s=="object"))return;const r=s.constructor.name,i=Dp(t,r);let o=i.indexOf(s);return o===-1&&(o=i.length,i.push(s)),o};function dr(s,e,t){if(s instanceof Array)return s.map(r=>dr(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=Op(s);return{rr_type:r,base64:i}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[dr(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:[dr(s.data,e,t),s.width,s.height]};if(nl(s,e)||typeof s=="object"){const r=s.constructor.name,i=sl(s,e,t);return{rr_type:r,index:i}}}}return s}const il=(s,e,t)=>s.map(r=>dr(r,e,t)),nl=(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 _p(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=Ue(e.CanvasRenderingContext2D.prototype,n,function(l){return function(...u){return oe(this.canvas,t,r,!0)||setTimeout(()=>{const c=il(u,e,this);s(this.canvas,{type:Me["2D"],property:n,args:c})},0),l.apply(this,u)}});i.push(a)}catch(a){const l=_t(e.CanvasRenderingContext2D.prototype,n,{set(u){s(this.canvas,{type:Me["2D"],property:n,args:[u],setter:!0})}});i.push(l)}return()=>{i.forEach(n=>n())}}function kp(s){return s==="experimental-webgl"?"webgl":s}function Qn(s,e,t,r){const i=[];try{const o=Ue(s.HTMLCanvasElement.prototype,"getContext",function(n){return function(a,...l){if(!oe(this,e,t,!0)){const u=kp(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 qn(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=Ue(s,l,function(c){return function(...h){const f=c.apply(this,h);if(sl(f,o,this),"tagName"in this.canvas&&!oe(this.canvas,r,i,!0)){const g=il(h,o,this),p={type:e,property:l,args:g};t(this.canvas,p)}return f}});n.push(u)}catch(u){const c=_t(s,l,{set(h){t(this.canvas,{type:e,property:l,args:[h],setter:!0})}});n.push(c)}return n}function $p(s,e,t,r){const i=[];return i.push(...qn(e.WebGLRenderingContext.prototype,Me.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext!="undefined"&&i.push(...qn(e.WebGL2RenderingContext.prototype,Me.WebGL2,s,t,r,e)),()=>{i.forEach(o=>o())}}const ol="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Lp=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),eo=typeof window!="undefined"&&window.Blob&&new Blob([Lp(ol)],{type:"text/javascript;charset=utf-8"});function Pp(s){let e;try{if(e=eo&&(window.URL||window.webkitURL).createObjectURL(eo),!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,"+ol,{name:s==null?void 0:s.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Fp{constructor(e){w(this,"pendingCanvasMutations",new Map),w(this,"rafStamps",{latestId:0,invokeId:null}),w(this,"mirror"),w(this,"mutationCb"),w(this,"resetObservers"),w(this,"frozen",!1),w(this,"locked",!1),w(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=Qn(t,r,i,!0),a=new Map,l=new Pp;l.onmessage=p=>{const{id:y}=p.data;if(a.set(y,!1),!("base64"in p.data))return;const{base64:d,type:m,width:S,height:v}=p.data;this.mutationCb({id:y,type:Me["2D"],commands:[{property:"clearRect",args:[0,0,S,v]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:d}],type:m}]},0,0]}]})};const u=1e3/e;let c=0,h;const f=()=>{const p=[];return t.document.querySelectorAll("canvas").forEach(y=>{oe(y,r,i,!0)||p.push(y)}),p},g=p=>{if(c&&p-c<u){h=requestAnimationFrame(g);return}c=p,f().forEach(async y=>{var d;const m=this.mirror.getId(y);if(a.get(m)||y.width===0||y.height===0)return;if(a.set(m,!0),["webgl","webgl2"].includes(y.__context)){const v=y.getContext(y.__context);((d=v==null?void 0:v.getContextAttributes())==null?void 0:d.preserveDrawingBuffer)===!1&&v.clear(v.COLOR_BUFFER_BIT)}const S=await createImageBitmap(y);l.postMessage({id:m,bitmap:S,width:y.width,height:y.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=Qn(e,t,r,!1),o=_p(this.processMutation.bind(this),e,t,r),n=$p(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 We(u,["type"])}),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:i}),this.pendingCanvasMutations.delete(e)}}class Bp{constructor(e){w(this,"trackedLinkElements",new WeakSet),w(this,"mutationCb"),w(this,"adoptedStyleSheetCb"),w(this,"styleMirror",new Fi),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:ho(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 Up{constructor(){w(this,"nodeMap",new WeakMap),w(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(){}}function Vp(s,e,t){var c,h,f,g,p,y;const r=(c=t==null?void 0:t.root)!=null?c:null,i=(h=t==null?void 0:t.threshold)!=null?h:.5,o=(f=t==null?void 0:t.sensitivity)!=null?f:.05,n=Wp((g=t==null?void 0:t.rootMargin)!=null?g:"0px"),a=new Map,l=zp(r),u=Gp(l,n);for(const d of s){const m=d.getBoundingClientRect();let S=Yp(),v=0;m.width>0&&m.height>0&&(S=jp(m,u),v=Hp(m,S),v=Math.round(v*100)/100);const b=Zp(d),C=(p=e.get(d))!=null?p:null,E=(y=C==null?void 0:C.intersectionRatio)!=null?y:0,_=v,A=(C==null?void 0:C.isStyleVisible)&&E>i,V=b&&_>i;!C||A!==V||A!==V&&Math.abs(_-E)>o?a.set(d,{target:d,isVisible:V,isStyleVisible:b,intersectionRatio:_,intersectionRect:S,oldValue:C}):a.set(d,C)}return a}function Wp(s){const e=s.trim().split(/\s+/),t=(r,i)=>r.endsWith("%")?parseFloat(r)/100*i:parseFloat(r)||0;return function(r){const i=t(e[0]||"0px",r.height),o=t(e[1]||e[0]||"0px",r.width),n=t(e[2]||e[0]||"0px",r.height),a=t(e[3]||e[1]||e[0]||"0px",r.width);return{top:i,right:o,bottom:n,left:a,width:0,height:0}}}function zp(s){return s?s.getBoundingClientRect():new DOMRect(0,0,window.innerWidth,window.innerHeight)}function Gp(s,e){const t=e(s);return new DOMRect(s.left-t.left,s.top-t.top,s.width+t.left+t.right,s.height+t.top+t.bottom)}function jp(s,e){const t=Math.max(s.top,e.top),r=Math.max(s.left,e.left),i=Math.min(s.bottom,e.bottom),o=Math.min(s.right,e.right),n=Math.max(0,o-r),a=Math.max(0,i-t);return{top:t,left:r,bottom:i,right:o,width:n,height:a}}function Hp(s,e){const t=s.width*s.height,r=e.width*e.height;return t>0?r/t:0}function Yp(){return{top:0,left:0,right:0,bottom:0,width:0,height:0}}function Zp(s){const e=getComputedStyle(s);return e&&e.display!=="none"&&e.visibility!=="hidden"&&parseFloat(e.opacity||"1")>0}class Xp{constructor(e){var u,c,h,f,g,p;w(this,"frozen",!1),w(this,"locked",!1),w(this,"pending",new Map),w(this,"mirror"),w(this,"mutationCb"),w(this,"rafId",null),w(this,"rafThrottle"),w(this,"lastFlushTime",0),w(this,"elements",new Set),w(this,"previousState",new Map),w(this,"root",null),w(this,"threshold"),w(this,"sensitivity"),w(this,"rootMargin"),w(this,"hasInitialized",!1),w(this,"mode","none"),w(this,"debounce",50),w(this,"throttle",100),w(this,"buffer",new Map),w(this,"debounceTimer",null),w(this,"lastThrottleTime",0),w(this,"disabled",!1),w(this,"notifyActivity");const{doc:t,mirror:r,sampling:i,mutationCb:o,notifyActivity:n}=e;if(this.mirror=r,this.mutationCb=o,this.notifyActivity=n,this.rootMargin="0px",i===!1){this.disabled=!0;return}const a=typeof i=="object"&&i!==null?i:{};this.mode=(u=a==null?void 0:a.mode)!=null?u:"none",this.debounce=Number((c=a==null?void 0:a.debounce)!=null?c:100),this.throttle=Number((h=a==null?void 0:a.throttle)!=null?h:100),this.threshold=Number((f=a==null?void 0:a.threshold)!=null?f:.5),this.sensitivity=Number((g=a==null?void 0:a.sensitivity)!=null?g:.05),this.rafThrottle=Number((p=a==null?void 0:a.rafThrottle)!=null?p:100),t.querySelectorAll("*").forEach(y=>this.observe(y)),new MutationObserver(y=>{y.forEach(d=>{d.addedNodes.forEach(m=>{m.nodeType===Node.ELEMENT_NODE&&(this.observe(m),m.querySelectorAll("*").forEach(S=>this.observe(S)))}),d.removedNodes.forEach(m=>{m.nodeType===Node.ELEMENT_NODE&&this.unobserve(m)})})}).observe(t.body,{childList:!0,subtree:!0}),this.startPendingFlushLoop()}startPendingFlushLoop(){if(this.disabled)return;const e=t=>{t-this.lastFlushTime>=this.rafThrottle&&(this.lastFlushTime=t,this.flushPendingVisibilityMutations()),this.rafId=requestAnimationFrame(e)};this.rafId=requestAnimationFrame(e)}flushPendingVisibilityMutations(){if(this.disabled||this.frozen||this.locked||this.elements.size===0)return;const e=Vp(this.elements,this.previousState,{root:this.root,threshold:this.threshold,sensitivity:this.sensitivity,rootMargin:this.rootMargin});for(const[t,r]of e.entries()){const i=this.previousState.get(t);if(!i||i.isVisible!==r.isVisible||Math.abs(i.intersectionRatio-r.intersectionRatio)>this.sensitivity){const n=this.mirror.getId(t);n!==-1&&this.buffer.set(t,{id:n,isVisible:r.isVisible,ratio:r.intersectionRatio}),this.previousState.set(t,r)}}if(this.previousState=e,!this.hasInitialized){this.hasInitialized=!0,this.buffer.clear();return}this.scheduleEmit()}scheduleEmit(){if(this.mode==="debounce")clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>this.flushBuffer(),this.debounce);else if(this.mode==="throttle"){const e=performance.now();e-this.lastThrottleTime>=this.throttle&&(this.lastThrottleTime=e,this.flushBuffer())}else this.flushBuffer()}flushBuffer(){var e;this.buffer.size!==0&&((e=this.notifyActivity)==null||e.call(this,this.buffer.size),this.mutationCb({mutations:Array.from(this.buffer.values())}),this.buffer.clear())}observe(e){this.disabled||this.elements.add(e)}unobserve(e){this.disabled||(this.elements.delete(e),this.previousState.delete(e),this.pending.delete(e))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}reset(){this.elements.clear(),this.previousState.clear(),this.pending.clear(),this.rafId&&cancelAnimationFrame(this.rafId)}}const Jp="2.1.2-alpha.2";let Z,pt,hs,fs,qe=!1;const Or=[];let Le;function Kp(s){return new Promise(t=>{const r=()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{t()})})},i=(()=>{let o=!1;return()=>{o||(o=!0,r())}})();["interactive","complete"].includes(s.document.readyState)?i():(s.addEventListener("DOMContentLoaded",i,{once:!0}),s.addEventListener("load",i,{once:!0}),setTimeout(()=>{i()},5e3))})}try{if(Array.from([1],s=>s*2)[0]!==2){const s=document.createElement("iframe");document.body.appendChild(s),Array.from=((Xi=s.contentWindow)==null?void 0:Xi.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}const fe=fo();function ce(s={}){const{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,checkoutEveryNvm:i,blockClass:o="rr-block",blockSelector:n=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,excludeAttribute:u,maskTextClass:c="rr-mask",maskTextSelector:h=null,inlineStylesheet:f=!0,maskAllInputs:g,maskInputOptions:p,slimDOMOptions:y,maskInputFn:d,maskTextFn:m,hooks:S,packFn:v,sampling:b={},dataURLOptions:C={},mousemoveWait:E,recordDOM:_=!0,recordCanvas:A=!1,recordCrossOriginIframes:V=!1,recordAfter:z=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",flushCustomEvent:J=s.flushCustomEvent!==void 0?s.flushCustomEvent:"after",userTriggeredOnInput:Q=!1,collectFonts:te=!1,inlineImages:R=!1,plugins:ie,keepIframeSrcFn:ne=()=>!1,ignoreCSSAttributes:O=new Set([]),errorHandler:ue}=s;dp(ue);const de=V?window.parent===window:!0;let ae=!1;if(!de)try{window.parent.document&&(ae=!1)}catch(k){ae=!0}if(de&&!e)throw new Error("emit function is required");if(!de&&!ae)return()=>{};E!==void 0&&b.mousemove===void 0&&(b.mousemove=E),fe.reset();const jr=u===void 0?/.^/:u,Hr=g===!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}:p!==void 0?p:{password:!0},Yr=y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:y==="all",headMetaDescKeywords:y==="all",headTitleMutations:y==="all"}:y||{};ki();let Vi,Zr=0,Xr=0;const dl=k=>{Xr+=k},Wi=k=>{for(const le of ie||[])le.eventProcessor&&(k=le.eventProcessor(k));return v&&!ae&&(k=v(k)),k};Z=(k,le)=>{var K;const re=k;if(re.timestamp=me(),(K=Pe[0])!=null&&K.isFrozen()&&re.type!==M.FullSnapshot&&!(re.type===M.IncrementalSnapshot&&re.data.source===x.Mutation)&&Pe.forEach(pe=>pe.unfreeze()),de)e==null||e(Wi(re),le);else if(ae){const pe={type:"rrweb",event:Wi(re),origin:window.location.origin,isCheckout:le};window.parent.postMessage(pe,"*")}if(re.type===M.FullSnapshot)Vi=re,Zr=0;else if(re.type===M.IncrementalSnapshot){if(re.data.source===x.Mutation&&re.data.isAttachIframe)return;Zr++;const pe=r&&Zr>=r,Ve=t&&re.timestamp-Vi.timestamp>t,W=i&&Xr>=i;(pe||Ve||W)&&(W&&(Xr=0),pt(!0))}};const kt=k=>{Z({type:M.IncrementalSnapshot,data:N({source:x.Mutation},k)})},zi=k=>Z({type:M.IncrementalSnapshot,data:N({source:x.Scroll},k)}),Gi=k=>Z({type:M.IncrementalSnapshot,data:N({source:x.CanvasMutation},k)}),ji=k=>{var le;(le=S==null?void 0:S.visibilityMutation)==null||le.call(S,k),Z({type:M.IncrementalSnapshot,data:N({source:x.VisibilityMutation},k)})},pl=k=>Z({type:M.IncrementalSnapshot,data:N({source:x.AdoptedStyleSheet},k)}),ke=new Bp({mutationCb:kt,adoptedStyleSheetCb:pl}),$e=new Rp({mirror:fe,mutationCb:kt,stylesheetManager:ke,recordCrossOriginIframes:V,wrappedEmit:Z});for(const k of ie||[])k.getMirror&&k.getMirror({nodeMirror:fe,crossOriginIframeMirror:$e.crossOriginIframeMirror,crossOriginIframeStyleMirror:$e.crossOriginIframeStyleMirror});const Jr=new Up;hs=new Fp({recordCanvas:A,mutationCb:Gi,win:window,blockClass:o,blockSelector:n,mirror:fe,sampling:b.canvas,dataURLOptions:C}),fs=new Xp({doc:window.document,mirror:fe,sampling:b.visibility,mutationCb:ji,notifyActivity:dl});const $t=new Ap({mutationCb:kt,scrollCb:zi,bypassOptions:{blockClass:o,blockSelector:n,maskTextClass:c,maskTextSelector:h,excludeAttribute:jr,inlineStylesheet:f,maskInputOptions:Hr,dataURLOptions:C,maskTextFn:m,maskInputFn:d,recordCanvas:A,inlineImages:R,sampling:b,slimDOMOptions:Yr,iframeManager:$e,stylesheetManager:ke,canvasManager:hs,visibilityManager:fs,keepIframeSrcFn:ne,processedNodeManager:Jr},mirror:fe});pt=(k=!1)=>{if(!_)return;Z({type:M.Meta,data:{href:window.location.href,width:Ti(),height:Oi()}},k),ke.reset(),$t.init(),Pe.forEach(K=>K.lock());const le=Eu(document,{mirror:fe,blockClass:o,blockSelector:n,maskTextClass:c,maskTextSelector:h,excludeAttribute:jr,inlineStylesheet:f,maskAllInputs:Hr,maskTextFn:m,maskInputFn:d,slimDOM:Yr,dataURLOptions:C,recordCanvas:A,inlineImages:R,onSerialize:K=>{Qe(K,fe)&&$e.addIframe(K),Li(K,fe)&&ke.trackLinkElement(K),Ae(K)&&$t.addShadowRoot(T.shadowRoot(K),document)},onIframeLoad:(K,re)=>{$e.attachIframe(K,re),$t.observeAttachShadow(K)},onStylesheetLoad:(K,re)=>{ke.attachLinkElement(K,re)},keepIframeSrcFn:ne});if(!le)return console.warn("Failed to snapshot the document");Z({type:M.FullSnapshot,data:{node:le,initialOffset:Ai(window)}},k),Pe.forEach(K=>K.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ke.adoptStyleSheets(document.adoptedStyleSheets,fe.getId(document))},Le=()=>{for(const k of Or)Z(k);Or.length=0};try{const k=[],le=pe=>{var Ve;return L(Np)({mutationCb:kt,mousemoveCb:(W,Kr)=>Z({type:M.IncrementalSnapshot,data:{source:Kr,positions:W}}),mouseInteractionCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:x.MouseInteraction},W)}),scrollCb:zi,viewportResizeCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:x.ViewportResize},W)}),inputCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:x.Input},W)}),mediaInteractionCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:x.MediaInteraction},W)}),styleSheetRuleCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:x.StyleSheetRule},W)}),styleDeclarationCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:x.StyleDeclaration},W)}),canvasMutationCb:Gi,visibilityMutationCb:ji,fontCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:x.Font},W)}),selectionCb:W=>{Z({type:M.IncrementalSnapshot,data:N({source:x.Selection},W)})},customElementCb:W=>{Z({type:M.IncrementalSnapshot,data:N({source:x.CustomElement},W)})},blockClass:o,ignoreClass:a,ignoreSelector:l,maskTextClass:c,maskTextSelector:h,excludeAttribute:jr,maskInputOptions:Hr,inlineStylesheet:f,sampling:b,recordDOM:_,recordCanvas:A,inlineImages:R,userTriggeredOnInput:Q,collectFonts:te,doc:pe,maskInputFn:d,maskTextFn:m,keepIframeSrcFn:ne,blockSelector:n,slimDOMOptions:Yr,dataURLOptions:C,mirror:fe,iframeManager:$e,stylesheetManager:ke,shadowDomManager:$t,processedNodeManager:Jr,canvasManager:hs,visibilityManager:fs,ignoreCSSAttributes:O,plugins:((Ve=ie==null?void 0:ie.filter(W=>W.observer))==null?void 0:Ve.map(W=>({observer:W.observer,options:W.options,callback:Kr=>Z({type:M.Plugin,data:{plugin:W.name,payload:Kr}})})))||[]},S)};$e.addLoadListener(pe=>{try{k.push(le(pe.contentDocument))}catch(Ve){console.warn(Ve)}});const K=()=>{J==="before"&&Le(),pt(),k.push(le(document)),qe=!0,J==="after"&&Le()},re=async()=>{J==="before"&&Le(),z==="DOMContentStabilized"&&(console.debug(`[${me()}] [rrweb:record] \u{1F7E2} Waiting for DOM stabilization...`),await Kp(window),console.debug(`[${me()}] [rrweb:record] \u2705 DOM stabilized, starting recording`)),console.debug(`[${me()}] [rrweb:record] \u2705 Init dom and takeFullSnapshot `),pt(),k.push(le(document)),qe=!0,J==="after"&&Le()};return document.readyState==="interactive"||document.readyState==="complete"?K():(k.push(se("DOMContentLoaded",()=>{Z({type:M.DomContentLoaded,data:{}}),z==="DOMContentLoaded"&&K()})),k.push(se("load",()=>{Z({type:M.Load,data:{}}),z==="load"&&K()},window))),()=>{Le(),k.forEach(pe=>pe()),Jr.destroy(),qe=!1,pp()}}catch(k){console.warn(k)}}ce.getVersion=()=>Jp;ce.isRecording=()=>qe;ce.flushCustomEventQueue=()=>{console.warn(`[rrweb] CustomEvent flushing: ${Or.length} events`),Le()};ce.addCustomEvent=(s,e)=>{const t={type:M.Custom,data:{tag:s,payload:e}};if(!qe){console.warn(`[rrweb] CustomEvent buffered before/after recording start: ${s}`),Or.push(t);return}Z(t)};ce.freezePage=()=>{Pe.forEach(s=>s.freeze())};ce.takeFullSnapshot=s=>{if(!qe)throw new Error("please take full snapshot after start recording");pt(s)};ce.mirror=fe;function al(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 Qp=Object.freeze(Object.defineProperty({__proto__:null,default:al},Symbol.toStringTag,{value:"Module"}));function qp(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(m){const S=["MSIE ","Trident/","Edge/"];return new RegExp(S.join("|")).test(m)}const a=n(s.navigator.userAgent)?1:0;function l(m,S){this.scrollLeft=m,this.scrollTop=S}function u(m){return .5*(1-Math.cos(Math.PI*m))}function c(m){if(m===null||typeof m!="object"||m.behavior===void 0||m.behavior==="auto"||m.behavior==="instant")return!0;if(typeof m=="object"&&m.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+m.behavior+" is not a valid value for enumeration ScrollBehavior.")}function h(m,S){if(S==="Y")return m.clientHeight+a<m.scrollHeight;if(S==="X")return m.clientWidth+a<m.scrollWidth}function f(m,S){const v=s.getComputedStyle(m,null)["overflow"+S];return v==="auto"||v==="scroll"}function g(m){const S=h(m,"Y")&&f(m,"Y"),v=h(m,"X")&&f(m,"X");return S||v}function p(m){for(;m!==e.body&&g(m)===!1;)m=m.parentNode||m.host;return m}function y(m){const S=o();let v,b,C,E=(S-m.startTime)/r;E=E>1?1:E,v=u(E),b=m.startX+(m.x-m.startX)*v,C=m.startY+(m.y-m.startY)*v,m.method.call(m.scrollable,b,C),(b!==m.x||C!==m.y)&&s.requestAnimationFrame(y.bind(s,m))}function d(m,S,v){let b,C,E,_;const A=o();m===e.body?(b=s,C=s.scrollX||s.pageXOffset,E=s.scrollY||s.pageYOffset,_=i.scroll):(b=m,C=m.scrollLeft,E=m.scrollTop,_=l),y({scrollable:b,method:_,startTime:A,startX:C,startY:E,x:S,y:v})}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 m=arguments[0].left,S=arguments[0].top;d.call(this,this,typeof m=="undefined"?this.scrollLeft:~~m,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 m=p(this),S=m.getBoundingClientRect(),v=this.getBoundingClientRect();m!==e.body?(d.call(this,m,m.scrollLeft+v.left-S.left,m.scrollTop+v.top-S.top),s.getComputedStyle(m).position!=="fixed"&&s.scrollBy({left:S.left,top:S.top,behavior:"smooth"})):s.scrollBy({left:v.left,top:v.top,behavior:"smooth"})}}class em{constructor(e=[],t){w(this,"timeOffset",0),w(this,"speed"),w(this,"actions"),w(this,"raf",null),w(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 to(s,e){if(s.type===M.IncrementalSnapshot&&s.data.source===x.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}/*! *****************************************************************************
70
70
  Copyright (c) Microsoft Corporation.
71
71
 
72
72
  Permission to use, copy, modify, and/or distribute this software for any
@@ -79,7 +79,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
79
79
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
80
80
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
81
81
  PERFORMANCE OF THIS SOFTWARE.
82
- ***************************************************************************** */function ro(s,e){var t=typeof Symbol=="function"&&s[Symbol.iterator];if(!t)return s;var r,i,o=t.call(s),n=[];try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)n.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return n}var Ke;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(Ke||(Ke={}));var ll={type:"xstate.init"};function ds(s){return s===void 0?[]:[].concat(s)}function He(s){return{type:"xstate.assign",assignment:s}}function so(s,e){return typeof(s=typeof s=="string"&&e&&e[s]?e[s]:s)=="string"?{type:s}:typeof s=="function"?{type:s.name,exec:s}:s}function Tr(s){return function(e){return s===e}}function ul(s){return typeof s=="string"?{type:s}:s}function io(s,e){return{value:s,context:e,actions:[],changed:!1,matches:Tr(s)}}function no(s,e,t){var r=e,i=!1;return[s.filter(function(o){if(o.type==="xstate.assign"){i=!0;var n=Object.assign({},r);return typeof o.assignment=="function"?n=o.assignment(r,t):Object.keys(o.assignment).forEach(function(a){n[a]=typeof o.assignment[a]=="function"?o.assignment[a](r,t):o.assignment[a]}),r=n,!1}return!0}),r,i]}function cl(s,e){e===void 0&&(e={});var t=ro(no(ds(s.states[s.initial].entry).map(function(n){return so(n,e.actions)}),s.context,ll),2),r=t[0],i=t[1],o={config:s,_options:e,initialState:{value:s.initial,actions:r,context:i,matches:Tr(s.initial)},transition:function(n,a){var l,u,c=typeof n=="string"?{value:n,context:s.context}:n,h=c.value,f=c.context,g=ul(a),p=s.states[h];if(p.on){var y=ds(p.on[g.type]);try{for(var d=function(O){var ue=typeof Symbol=="function"&&Symbol.iterator,de=ue&&O[ue],ae=0;if(de)return de.call(O);if(O&&typeof O.length=="number")return{next:function(){return O&&ae>=O.length&&(O=void 0),{value:O&&O[ae++],done:!O}}};throw new TypeError(ue?"Object is not iterable.":"Symbol.iterator is not defined.")}(y),m=d.next();!m.done;m=d.next()){var S=m.value;if(S===void 0)return io(h,f);var v=typeof S=="string"?{target:S}:S,b=v.target,C=v.actions,E=C===void 0?[]:C,_=v.cond,A=_===void 0?function(){return!0}:_,V=b===void 0,z=b!=null?b:h,J=s.states[z];if(A(f,g)){var Q=ro(no((V?ds(E):[].concat(p.exit,E,J.entry).filter(function(O){return O})).map(function(O){return so(O,o._options.actions)}),f,g),3),te=Q[0],R=Q[1],ie=Q[2],ne=b!=null?b:h;return{value:ne,context:R,actions:te,changed:b!==h||te.length>0||ie,matches:Tr(ne)}}}}catch(O){l={error:O}}finally{try{m&&!m.done&&(u=d.return)&&u.call(d)}finally{if(l)throw l.error}}}return io(h,f)}};return o}var oo=function(s,e){return s.actions.forEach(function(t){var r=t.exec;return r&&r(s.context,e)})};function hl(s){var e=s.initialState,t=Ke.NotStarted,r=new Set,i={_machine:s,send:function(o){t===Ke.Running&&(e=s.transition(e,o),oo(e,ul(o)),r.forEach(function(n){return n(e)}))},subscribe:function(o){return r.add(o),o(e),{unsubscribe:function(){return r.delete(o)}}},start:function(o){if(o){var n=typeof o=="object"?o:{context:s.config.context,value:o};e={value:n.value,actions:[],context:n.context,matches:Tr(n.value)}}return t=Ke.Running,oo(e,ll),i},stop:function(){return t=Ke.Stopped,r.clear(),i},get state(){return e},get status(){return t}};return i}function tm(s,e){for(let t=s.length-1;t>=0;t--){const r=s[t];if(r.type===M.Meta&&r.timestamp<=e)return s.slice(t)}return s}function rm(s,{getCastFn:e,applyEventsSynchronously:t,emitter:r}){const i=cl({id:"player",context:s,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:He({lastPlayedEvent:(o,n)=>n.type==="CAST_EVENT"?n.payload.event:o.lastPlayedEvent}),recordTimeOffset:He((o,n)=>{let a=o.timeOffset;return"payload"in n&&"timeOffset"in n.payload&&(a=n.payload.timeOffset),q(N({},o),{timeOffset:a,baselineTime:o.events[0].timestamp+a})}),play(o){var n;const{timer:a,events:l,baselineTime:u,lastPlayedEvent:c}=o;a.clear();for(const p of l)to(p,u);const h=tm(l,u);let f=c==null?void 0:c.timestamp;(c==null?void 0:c.type)===M.IncrementalSnapshot&&c.data.source===x.MouseMove&&(f=c.timestamp+((n=c.data.positions[0])==null?void 0:n.timeOffset)),u<(f||0)&&r.emit(P.PlayBack);const g=new Array;for(const p of h)if(!(f&&f<u&&(p.timestamp<=f||p===c)))if(p.timestamp<u)g.push(p);else{const y=e(p,!1);a.addAction({doAction:()=>{y()},delay:p.delay})}t(g),r.emit(P.Flush),a.start()},pause(o){o.timer.clear()},resetLastPlayedEvent:He(o=>q(N({},o),{lastPlayedEvent:null})),startLive:He({baselineTime:(o,n)=>(o.timer.start(),n.type==="TO_LIVE"&&n.payload.baselineTime?n.payload.baselineTime:Date.now())}),addEvent:He((o,n)=>{const{baselineTime:a,timer:l,events:u}=o;if(n.type==="ADD_EVENT"){const{event:c}=n.payload;to(c,a);let h=u.length-1;if(!u[h]||u[h].timestamp<=c.timestamp)u.push(c);else{let p=-1,y=0;for(;y<=h;){const d=Math.floor((y+h)/2);u[d].timestamp<=c.timestamp?y=d+1:h=d-1}p===-1&&(p=y),u.splice(p,0,c)}const f=c.timestamp<a,g=e(c,f);f?g():l.isActive()&&l.addAction({doAction:()=>{g()},delay:c.delay})}return q(N({},o),{events:u})})}});return hl(i)}function sm(s){const e=cl({id:"speed",context:s,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(t,r)=>{"payload"in r&&t.timer.setSpeed(r.payload.speed)},recordSpeed:He({normalSpeed:t=>t.timer.speed}),restoreSpeed:t=>{t.timer.setSpeed(t.normalSpeed)}}});return hl(e)}const im=s=>[`.${s} { background: currentColor }`,"noscript { display: none !important; }"],ao=new Map;function fl(s,e){let t=ao.get(s);return t||(t=new Map,ao.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}function Oe(s,e,t){return async r=>{if(r&&typeof r=="object"&&"rr_type"in r)if(t&&(t.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){const i=await Oe(s,e,t)(r.args);return await createImageBitmap.apply(null,i)}else if("index"in r){if(t||e===null)return r;const{rr_type:i,index:o}=r;return fl(e,i)[o]}else if("args"in r){const{rr_type:i,args:o}=r,n=window[i];return new n(...await Promise.all(o.map(Oe(s,e,t))))}else{if("base64"in r)return Tp(r.base64);if("src"in r){const i=s.get(r.src);if(i)return i;{const o=new Image;return o.src=r.src,s.set(r.src,o),o}}else if("data"in r&&r.rr_type==="Blob"){const i=await Promise.all(r.data.map(Oe(s,e,t)));return new Blob(i,{type:r.type})}}else if(Array.isArray(r))return await Promise.all(r.map(Oe(s,e,t)));return r}}function nm(s,e){try{return e===Me.WebGL?s.getContext("webgl")||s.getContext("experimental-webgl"):s.getContext("webgl2")}catch(t){return null}}const om=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function am(s,e){if(!(e!=null&&e.constructor))return;const{name:t}=e.constructor;if(!om.includes(t))return;const r=fl(s,t);r.includes(e)||r.push(e)}async function lm({mutation:s,target:e,type:t,imageMap:r,errorHandler:i}){try{const o=nm(e,t);if(!o)return;if(s.setter){o[s.property]=s.args[0];return}const n=o[s.property],a=await Promise.all(s.args.map(Oe(r,o))),l=n.apply(o,a);am(o,l);const u=!1}catch(o){i(s,o)}}async function um({event:s,mutations:e,target:t,imageMap:r,errorHandler:i}){const o=t.getContext("2d");if(!o){i(e[0],new Error("Canvas context is null"));return}const n=e.map(async l=>Promise.all(l.args.map(Oe(r,o))));(await Promise.all(n)).forEach((l,u)=>{const c=e[u];try{if(c.setter){o[c.property]=c.args[0];return}const h=o[c.property];c.property==="drawImage"&&typeof c.args[0]=="string"?(r.get(s),h.apply(o,c.args)):h.apply(o,l)}catch(h){i(c,h)}})}async function Qs({event:s,mutation:e,target:t,imageMap:r,canvasEventMap:i,errorHandler:o}){try{const n=i.get(s)||e,a="commands"in n?n.commands:[n];if([Me.WebGL,Me.WebGL2].includes(e.type)){for(let l=0;l<a.length;l++){const u=a[l];await lm({mutation:u,type:e.type,target:t,imageMap:r,errorHandler:o})}return}await um({event:s,mutations:a,target:t,imageMap:r,errorHandler:o})}catch(n){o(e,n)}}class cm{constructor(e){w(this,"mediaMap",new Map),w(this,"warn"),w(this,"service"),w(this,"speedService"),w(this,"emitter"),w(this,"getCurrentTime"),w(this,"metadataCallbackMap",new Map),this.warn=e.warn,this.service=e.service,this.speedService=e.speedService,this.emitter=e.emitter,this.getCurrentTime=e.getCurrentTime,this.emitter.on(P.Start,this.start.bind(this)),this.emitter.on(P.SkipStart,this.start.bind(this)),this.emitter.on(P.Pause,this.pause.bind(this)),this.emitter.on(P.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach((t,r)=>{this.syncTargetWithState(r),e.pause&&r.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:t,mediaState:r}){if(r.isPlaying){const o=(e-r.lastInteractionTimeOffset)/1e3*r.playbackRate,n="duration"in t&&t.duration;if(Number.isNaN(n)){this.waitForMetadata(t);return}let a=r.currentTimeAtLastInteraction+o;t.loop&&n!==!1&&(a=a%n),t.currentTime=a}else t.pause(),t.currentTime=r.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e)||!("addEventListener"in e))return;const t=()=>{this.metadataCallbackMap.delete(e);const r=this.mediaMap.get(e);r&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:r})};this.metadataCallbackMap.set(e,t),e.addEventListener("loadedmetadata",t,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:t,mutation:r}){var g,p,y,d,m;const i=this.mediaMap.get(e),{type:o,playbackRate:n,currentTime:a,muted:l,volume:u,loop:c}=r;return{isPlaying:o===Re.Play||o!==Re.Pause&&((i==null?void 0:i.isPlaying)||e.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:(g=a!=null?a:i==null?void 0:i.currentTimeAtLastInteraction)!=null?g:0,lastInteractionTimeOffset:t,playbackRate:(p=n!=null?n:i==null?void 0:i.playbackRate)!=null?p:1,volume:(y=u!=null?u:i==null?void 0:i.volume)!=null?y:1,muted:(d=l!=null?l:i==null?void 0:i.muted)!=null?d:e.getAttribute("muted")===null,loop:(m=c!=null?c:i==null?void 0:i.loop)!=null?m:e.getAttribute("loop")===null}}syncTargetWithState(e){const t=this.mediaMap.get(e);if(!t)return;const{muted:r,loop:i,volume:o,isPlaying:n}=t,a=this.service.state.matches("paused"),l=t.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:e,mediaState:t}),e.volume!==o&&(e.volume=o),e.muted=r,e.loop=i,e.playbackRate!==l&&(e.playbackRate=l),n&&!a?e.play():e.pause()}catch(u){this.warn(`Failed to replay media interactions: ${u.message||u}`)}}addMediaElements(e,t,r){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;const i=e,o=r.getMeta(i);if(!o||!("attributes"in o))return;const n=this.service.state.matches("paused"),a=o.attributes;let l=!1;a.rr_mediaState?l=a.rr_mediaState==="played":l=i.getAttribute("autoplay")!==null,l&&n&&i.pause();let u=1;typeof a.rr_mediaPlaybackRate=="number"&&(u=a.rr_mediaPlaybackRate);let c=!1;typeof a.rr_mediaMuted=="boolean"?c=a.rr_mediaMuted:c=i.getAttribute("muted")!==null;let h=!1;typeof a.rr_mediaLoop=="boolean"?h=a.rr_mediaLoop:h=i.getAttribute("loop")!==null;let f=1;typeof a.rr_mediaVolume=="number"&&(f=a.rr_mediaVolume);let g=0;typeof a.rr_mediaCurrentTime=="number"&&(g=a.rr_mediaCurrentTime),this.mediaMap.set(i,{isPlaying:l,currentTimeAtLastInteraction:g,lastInteractionTimeOffset:t,playbackRate:u,volume:f,muted:c,loop:h}),this.syncTargetWithState(i)}mediaMutation({target:e,timeOffset:t,mutation:r}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:t,mutation:r})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return["AUDIO","VIDEO"].includes(e.nodeName)}reset(){this.mediaMap.clear()}}function ar(s,e){if(s.nodeName!=="DIALOG"||s instanceof be)return;const t=s,r=t.open,i=r&&t.matches("dialog:modal"),o=t.getAttribute("rr_open_mode"),n=typeof(e==null?void 0:e.attributes.open)=="string"||typeof t.getAttribute("open")=="string",a=o==="modal";if(!(r&&!(i&&o==="non-modal"||!i&&a))){if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}r&&t.close(),n&&(a?t.showModal():t.show())}}function hm(s,e){if(s.nodeName!=="DIALOG"||s instanceof be)return;const t=s;if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}e.attributes.open===null&&(t.removeAttribute("open"),t.removeAttribute("rr_open_mode"))}const fm=5*1e3,dm=al||Qp,lo="[replayer]",ps={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function uo(s){return s.type==M.IncrementalSnapshot&&(s.data.source==x.TouchMove||s.data.source==x.MouseInteraction&&s.data.type==F.TouchStart)}class pm{constructor(e,t){if(w(this,"wrapper"),w(this,"iframe"),w(this,"service"),w(this,"speedService"),w(this,"config"),w(this,"usingVirtualDom",!1),w(this,"virtualDom",new lt),w(this,"mouse"),w(this,"mouseTail",null),w(this,"tailPositions",[]),w(this,"emitter",dm()),w(this,"nextUserInteractionEvent"),w(this,"legacy_missingNodeRetryMap",{}),w(this,"cache",Cn()),w(this,"imageMap",new Map),w(this,"canvasEventMap",new Map),w(this,"mirror",fo()),w(this,"styleMirror",new Fi),w(this,"mediaManager"),w(this,"firstFullSnapshot",null),w(this,"newDocumentQueue",[]),w(this,"mousePos",null),w(this,"touchActive",null),w(this,"lastMouseDownEvent",null),w(this,"lastHoveredRootNode"),w(this,"lastSelectionData",null),w(this,"constructedStyleMutations",[]),w(this,"adoptedStyleSheets",[]),w(this,"handleResize",a=>{this.iframe.style.display="inherit";for(const l of[this.mouseTail,this.iframe])l&&(l.setAttribute("width",String(a.width)),l.setAttribute("height",String(a.height)))}),w(this,"applyEventsSynchronously",a=>{for(const l of a){switch(l.type){case M.DomContentLoaded:case M.Load:case M.Custom:continue;case M.FullSnapshot:case M.Meta:case M.Plugin:case M.IncrementalSnapshot:break}this.getCastFn(l,!0)()}}),w(this,"getCastFn",(a,l=!1)=>{let u;switch(a.type){case M.DomContentLoaded:case M.Load:break;case M.Custom:u=()=>{this.emitter.emit(P.CustomEvent,a)};break;case M.Meta:u=()=>this.emitter.emit(P.Resize,{width:a.data.width,height:a.data.height});break;case M.FullSnapshot:u=()=>{var h;if(this.firstFullSnapshot){if(this.firstFullSnapshot===a){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(a,l),(h=this.iframe.contentWindow)==null||h.scrollTo(a.data.initialOffset)};break;case M.IncrementalSnapshot:u=()=>{if(this.applyIncremental(a,l),!l&&(a===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const h of this.service.state.context.events)if(!(h.timestamp<=a.timestamp)&&this.isUserInteraction(h)){h.delay-a.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=h);break}if(this.nextUserInteractionEvent){const h=this.nextUserInteractionEvent.delay-a.delay,f={speed:Math.min(Math.round(h/fm),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:f}),this.emitter.emit(P.SkipStart,f)}}};break}return()=>{u&&u();for(const f of this.config.plugins||[])f.handler&&f.handler(a,l,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:a}});const h=this.service.state.context.events.length-1;if(!this.config.liveMode&&a===this.service.state.context.events[h]){const f=()=>{h<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(P.Finish))};let g=50;a.type===M.IncrementalSnapshot&&a.data.source===x.MouseMove&&a.data.positions.length&&(g+=Math.max(0,-a.data.positions[0].timeOffset)),setTimeout(f,g)}this.emitter.emit(P.EventCast,a)}}),!(t!=null&&t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const r={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,inactivePeriodThreshold:10*1e3,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:ps,useVirtualDom:!0,logger:console};this.config=Object.assign({},r,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(P.Resize,this.handleResize),this.setupDom();for(const a of this.config.plugins||[])a.getMirror&&a.getMirror({nodeMirror:this.mirror});this.emitter.on(P.Flush,()=>{if(this.usingVirtualDom){const a={mirror:this.mirror,applyCanvas:(l,u,c)=>{Qs({event:l,mutation:u,target:c,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(l,u)=>{l.source===x.StyleSheetRule?this.applyStyleSheetRule(l,u):l.source===x.StyleDeclaration&&this.applyStyleDeclaration(l,u)},afterAppend:(l,u)=>{for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(l,{id:u,replayer:this})}};if(this.iframe.contentDocument)try{Mr(this.iframe.contentDocument,this.virtualDom,a,this.virtualDom.mirror)}catch(l){console.warn(l)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const l in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[l],c=Nr(u.node,this.mirror,this.virtualDom.mirror);Mr(c,u.node,a,this.virtualDom.mirror),u.node=c}catch(u){this.warn(u)}this.constructedStyleMutations.forEach(l=>{this.applyStyleSheetMutation(l)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(l=>{this.applyAdoptedStyleSheet(l)}),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){const[a,l]=this.lastMouseDownEvent;a.dispatchEvent(l)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(P.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});const i=new em([],{speed:this.config.speed});this.service=rm({events:e.map(a=>t&&t.unpackFn?t.unpackFn(a):a).sort((a,l)=>a.timestamp-l.timestamp),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(a=>{this.emitter.emit(P.StateChange,{player:a})}),this.speedService=sm({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(a=>{this.emitter.emit(P.StateChange,{speed:a})}),this.mediaManager=new cm({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});const o=this.service.state.context.events.find(a=>a.type===M.Meta),n=this.service.state.context.events.find(a=>a.type===M.FullSnapshot);if(o){const{width:a,height:l}=o.data;setTimeout(()=>{this.emitter.emit(P.Resize,{width:a,height:l})},0)}n&&setTimeout(()=>{var a;this.firstFullSnapshot||(this.firstFullSnapshot=n,this.rebuildFullSnapshot(n),(a=this.iframe.contentWindow)==null||a.scrollTo(n.data.initialOffset))},1),this.service.state.context.events.find(uo)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,t){return this.emitter.on(e,t),this}off(e,t){return this.emitter.off(e,t),this}setConfig(e){Object.keys(e).forEach(t=>{e[t],this.config[t]=e[t]}),this.config.skipInactive||this.backToNormal(),typeof e.speed!="undefined"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail!="undefined"&&(e.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getMetaData(){const e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:t}=this.service.state.context;return e-t[0].timestamp}getMirror(){return this.mirror}play(e=0){var t,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(r=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||r.classList.remove("rrweb-paused"),this.emitter.emit(P.Start)}pause(e){var t,r;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(r=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||r.classList.add("rrweb-paused"),this.emitter.emit(P.Pause)}resume(e=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(P.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(P.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const t=this.config.unpackFn?this.config.unpackFn(e):e;uo(t)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:t}}))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=Cn()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(qp(this.iframe.contentWindow,this.iframe.contentDocument),ki(this.iframe.contentWindow))}rebuildFullSnapshot(e,t=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const r=[],i=new Set,o=(l,u)=>{if(l.nodeName==="DIALOG"&&i.add(l),this.collectIframeAndAttachDocument(r,l),this.mediaManager.isSupportedMediaElement(l)){const{events:c}=this.service.state.context;this.mediaManager.addMediaElements(l,e.timestamp-c[0].timestamp,this.mirror)}for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(l,{id:u,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),Ch(e.data.node,{doc:this.iframe.contentDocument,afterAppend:o,cache:this.cache,mirror:this.mirror}),o(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:l,builtNode:u}of r)this.attachDocumentToIframe(l,u),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==l);const{documentElement:n,head:a}=this.iframe.contentDocument;this.insertStyleRules(n,a),i.forEach(l=>ar(l)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(P.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var r;const i=im(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!i.length)if(this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,ja(o,this.virtualDom.unserializedId)),e.insertBefore(o,t),o.rules.push({source:x.StyleSheetRule,adds:i.map((n,a)=>({rule:n,index:a}))})}else{const o=document.createElement("style");e.insertBefore(o,t);for(let n=0;n<i.length;n++)(r=o.sheet)==null||r.insertRule(i[n],n)}}attachDocumentToIframe(e,t){const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],o=new Set,n=(a,l)=>{a.nodeName==="DIALOG"&&o.add(a),this.collectIframeAndAttachDocument(i,a);const u=r.getMeta(a);if((u==null?void 0:u.type)===Ee.Element&&(u==null?void 0:u.tagName.toUpperCase())==="HTML"){const{documentElement:c,head:h}=t.contentDocument;this.insertStyleRules(c,h)}if(!this.usingVirtualDom)for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(a,{id:l,replayer:this})};bt(e.node,{doc:t.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:n,cache:this.cache}),n(t.contentDocument,e.node.id);for(const{mutationInQueue:a,builtNode:l}of i)this.attachDocumentToIframe(a,l),this.newDocumentQueue=this.newDocumentQueue.filter(u=>u!==a);o.forEach(a=>ar(a))}collectIframeAndAttachDocument(e,t){if(Qe(t,this.mirror)){const r=this.newDocumentQueue.find(i=>i.parentId===this.mirror.getId(t));r&&e.push({mutationInQueue:r,builtNode:t})}}waitForStylesheetLoad(){var e;const t=(e=this.iframe.contentDocument)==null?void 0:e.head;if(t){const r=new Set;let i,o=this.service.state;const n=()=>{o=this.service.state};this.emitter.on(P.Start,n),this.emitter.on(P.Pause,n);const a=()=>{this.emitter.off(P.Start,n),this.emitter.off(P.Pause,n)};t.querySelectorAll('link[rel="stylesheet"]').forEach(l=>{l.sheet||(r.add(l),l.addEventListener("load",()=>{r.delete(l),r.size===0&&i!==-1&&(o.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(P.LoadStylesheetEnd),i&&clearTimeout(i),a())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(P.LoadStylesheetStart),i=setTimeout(()=>{o.matches("playing")&&this.play(this.getCurrentTime()),i=-1,a()},this.config.loadTimeout))}}async preloadAllImages(){const e=[];for(const t of this.service.state.context.events)t.type===M.IncrementalSnapshot&&t.data.source===x.CanvasMutation&&(e.push(this.deserializeAndPreloadCanvasEvents(t.data,t)),("commands"in t.data?t.data.commands:[t.data]).forEach(i=>{this.preloadImages(i,t)}));return Promise.all(e)}preloadImages(e,t){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(t)){const r=document.createElement("canvas"),i=r.getContext("2d"),o=i==null?void 0:i.createImageData(r.width,r.height);i==null||i.putImageData(o,0,0)}}async deserializeAndPreloadCanvasEvents(e,t){if(!this.canvasEventMap.has(t)){const r={isUnchanged:!0};if("commands"in e){const i=await Promise.all(e.commands.map(async o=>{const n=await Promise.all(o.args.map(Oe(this.imageMap,null,r)));return q(N({},o),{args:n})}));r.isUnchanged===!1&&this.canvasEventMap.set(t,q(N({},e),{commands:i}))}else{const i=await Promise.all(e.args.map(Oe(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(t,q(N({},e),{args:i}))}}}applyIncremental(e,t){var r,i,o;const{data:n}=e;switch(n.source){case x.Mutation:{try{this.applyMutation(n,t)}catch(a){this.warn(`Exception in mutation ${a.message||a}`,n)}break}case x.Drag:case x.TouchMove:case x.MouseMove:if(t){const a=n.positions[n.positions.length-1];this.mousePos={x:a.x,y:a.y,id:a.id,debugData:n}}else n.positions.forEach(a=>{const l={doAction:()=>{this.moveAndHover(a.x,a.y,a.id,t,n)},delay:a.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(l)}),this.timer.addAction({doAction(){},delay:e.delay-((r=n.positions[0])==null?void 0:r.timeOffset)});break;case x.MouseInteraction:{if(n.id===-1)break;const a=new Event(Te(F[n.type])),l=this.mirror.getNode(n.id);if(!l)return this.debugNodeNotFound(n,n.id);this.emitter.emit(P.MouseInteraction,{type:n.type,target:l});const{triggerFocus:u}=this.config;switch(n.type){case F.Blur:"blur"in l&&l.blur();break;case F.Focus:u&&l.focus&&l.focus({preventScroll:!0});break;case F.Click:case F.TouchStart:case F.TouchEnd:case F.MouseDown:case F.MouseUp:t?(n.type===F.TouchStart?this.touchActive=!0:n.type===F.TouchEnd&&(this.touchActive=!1),n.type===F.MouseDown?this.lastMouseDownEvent=[l,a]:n.type===F.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:n.x||0,y:n.y||0,id:n.id,debugData:n}):(n.type===F.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(n.x||0,n.y||0,n.id,t,n),n.type===F.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):n.type===F.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):n.type===F.TouchEnd?this.mouse.classList.remove("touch-active"):l.dispatchEvent(a));break;case F.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:l.dispatchEvent(a)}break}case x.Scroll:{if(n.id===-1)break;if(this.usingVirtualDom){const a=this.virtualDom.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);a.scrollData=n;break}this.applyScroll(n,t);break}case x.ViewportResize:this.emitter.emit(P.Resize,{width:n.width,height:n.height});break;case x.Input:{if(n.id===-1)break;if(this.usingVirtualDom){const a=this.virtualDom.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);a.inputData=n;break}this.applyInput(n);break}case x.MediaInteraction:{const a=this.usingVirtualDom?this.virtualDom.mirror.getNode(n.id):this.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);const l=a,{events:u}=this.service.state.context;this.mediaManager.mediaMutation({target:l,timeOffset:e.timestamp-u[0].timestamp,mutation:n});break}case x.StyleSheetRule:case x.StyleDeclaration:{this.usingVirtualDom?n.styleId?this.constructedStyleMutations.push(n):n.id&&((i=this.virtualDom.mirror.getNode(n.id))==null||i.rules.push(n)):this.applyStyleSheetMutation(n);break}case x.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const a=this.virtualDom.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);a.canvasMutations.push({event:e,mutation:n})}else{const a=this.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);Qs({event:e,mutation:n,target:a,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case x.Font:{try{const a=new FontFace(n.family,n.buffer?new Uint8Array(JSON.parse(n.fontSource)):n.fontSource,n.descriptors);(o=this.iframe.contentDocument)==null||o.fonts.add(a)}catch(a){this.warn(a)}break}case x.Selection:{if(t){this.lastSelectionData=n;break}this.applySelection(n);break}case x.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(n):this.applyAdoptedStyleSheet(n);break}}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,jd(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const u in this.legacy_missingNodeRetryMap)try{const c=this.legacy_missingNodeRetryMap[u],h=Ga(c.node,this.virtualDom,this.mirror);h&&(c.node=h)}catch(c){this.warn(c)}const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(u=>r.getNode(u.id)?!0:(this.warnNodeNotFound(e,u.id),!1)),e.removes.forEach(u=>{var c;const h=r.getNode(u.id);if(!h)return;let f=r.getNode(u.parentId);if(!f)return this.warnNodeNotFound(e,u.parentId);if(u.isShadow&&Ae(f)&&(f=f.shadowRoot),r.removeNodeFromMap(h),f)try{f.removeChild(h),this.usingVirtualDom&&h.nodeName==="#text"&&f.nodeName==="STYLE"&&((c=f.rules)==null?void 0:c.length)>0&&(f.rules=[])}catch(g){if(g instanceof DOMException)this.warn("parent could not remove child in mutation",f,h,e);else throw g}});const i=N({},this.legacy_missingNodeRetryMap),o=[],n=u=>{let c=null;return u.nextId&&(c=r.getNode(u.nextId)),u.nextId!==null&&u.nextId!==void 0&&u.nextId!==-1&&!c},a=u=>{var c,h;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let f=r.getNode(u.parentId);if(!f)return u.node.type===Ee.Document?this.newDocumentQueue.push(u):o.push(u);u.node.isShadow&&(Ae(f)||f.attachShadow({mode:"open"}),f=f.shadowRoot);let g=null,p=null;if(u.previousId&&(g=r.getNode(u.previousId)),u.nextId&&(p=r.getNode(u.nextId)),n(u))return o.push(u);if(u.node.rootId&&!r.getNode(u.node.rootId))return;const y=u.node.rootId?r.getNode(u.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Qe(f,r)){this.attachDocumentToIframe(u,f);return}const d=(v,b)=>{if(!this.usingVirtualDom){ar(v);for(const C of this.config.plugins||[])C.onBuild&&C.onBuild(v,{id:b,replayer:this})}},m=bt(u.node,{doc:y,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:d});if(u.previousId===-1||u.nextId===-1){i[u.node.id]={node:m,mutation:u};return}const S=r.getMeta(f);if(S&&S.type===Ee.Element&&u.node.type===Ee.Text){const v=Array.isArray(f.childNodes)?f.childNodes:Array.from(f.childNodes);if(S.tagName==="textarea")for(const b of v)b.nodeType===f.TEXT_NODE&&f.removeChild(b);else if(S.tagName==="style"&&v.length===1)for(const b of v)b.nodeType===f.TEXT_NODE&&!r.hasNode(b)&&(m.textContent=b.textContent,f.removeChild(b))}else if((S==null?void 0:S.type)===Ee.Document){const v=f;u.node.type===Ee.DocumentType&&((c=v.childNodes[0])==null?void 0:c.nodeType)===Node.DOCUMENT_TYPE_NODE&&v.removeChild(v.childNodes[0]),m.nodeName==="HTML"&&v.documentElement&&v.removeChild(v.documentElement)}if(g&&g.nextSibling&&g.nextSibling.parentNode?f.insertBefore(m,g.nextSibling):p&&p.parentNode?f.contains(p)?f.insertBefore(m,p):f.insertBefore(m,null):f.appendChild(m),d(m,u.node.id),this.usingVirtualDom&&m.nodeName==="#text"&&f.nodeName==="STYLE"&&((h=f.rules)==null?void 0:h.length)>0&&(f.rules=[]),Qe(m,this.mirror)){const v=this.mirror.getId(m),b=this.newDocumentQueue.find(C=>C.parentId===v);b&&(this.attachDocumentToIframe(b,m),this.newDocumentQueue=this.newDocumentQueue.filter(C=>C!==b))}(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(i,f,m,u)};e.adds.forEach(u=>{a(u)});const l=Date.now();for(;o.length;){const u=Xa(o);if(o.length=0,Date.now()-l>500){this.warn("Timeout in the loop, please check the resolve tree data:",u);break}for(const c of u)r.getNode(c.value.parentId)?$i(c,f=>{a(f)}):this.debug("Drop resolve tree since there is no parent for the root node.",c)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),Ja(e.texts).forEach(u=>{var c;const h=r.getNode(u.id);if(!h)return e.removes.find(g=>g.id===u.id)?void 0:this.warnNodeNotFound(e,u.id);const f=h.parentElement;if(u.value&&f&&f.tagName==="STYLE"?h.textContent=Pr(u.value,this.cache):h.textContent=u.value,this.usingVirtualDom){const g=h.parentNode;((c=g==null?void 0:g.rules)==null?void 0:c.length)>0&&(g.rules=[])}}),e.attributes.forEach(u=>{var c;const h=r.getNode(u.id);if(!h)return e.removes.find(f=>f.id===u.id)?void 0:this.warnNodeNotFound(e,u.id);for(const f in u.attributes)if(typeof f=="string"){const g=u.attributes[f];if(g===null)h.removeAttribute(f),f==="open"&&hm(h,u);else if(typeof g=="string")try{if(f==="_cssText"&&(h.nodeName==="LINK"||h.nodeName==="STYLE"))try{const p=r.getMeta(h),y=bt(q(N({},p),{attributes:N(N({},p.attributes),u.attributes)}),{doc:h.ownerDocument,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(p.attributes,u.attributes);const d=h.nextSibling,m=h.parentNode;if(y&&m){m.removeChild(h),m.insertBefore(y,d),r.replace(u.id,y);break}}catch(p){}if(f==="value"&&h.nodeName==="TEXTAREA"){const p=h;p.childNodes.forEach(d=>p.removeChild(d));const y=(c=h.ownerDocument)==null?void 0:c.createTextNode(g);y&&p.appendChild(y)}else h.setAttribute(f,g);f==="rr_open_mode"&&h.nodeName==="DIALOG"&&ar(h,u)}catch(p){this.warn("An error occurred may due to the checkout feature.",p)}else if(f==="style"){const p=g,y=h;for(const d in p)if(p[d]===!1)y.style.removeProperty(d);else if(p[d]instanceof Array){const m=p[d];y.style.setProperty(d,m[0],m[1])}else{const m=p[d];y.style.setProperty(d,m)}}}})}applyScroll(e,t){var r,i;const o=this.mirror.getNode(e.id);if(!o)return this.debugNodeNotFound(e,e.id);const n=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)(r=this.iframe.contentWindow)==null||r.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if((n==null?void 0:n.type)===Ee.Document)(i=o.defaultView)==null||i.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else try{o.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"})}catch(a){}}applyInput(e){const t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(r){}}applySelection(e){try{const t=new Set,r=e.ranges.map(({start:i,startOffset:o,end:n,endOffset:a})=>{const l=this.mirror.getNode(i),u=this.mirror.getNode(n);if(!l||!u)return;const c=new Range;c.setStart(l,o),c.setEnd(u,a);const h=l.ownerDocument,f=h==null?void 0:h.getSelection();return f&&t.add(f),{range:c,selection:f}});t.forEach(i=>i.removeAllRanges()),r.forEach(i=>{var o;return i&&((o=i.selection)==null?void 0:o.addRange(i.range))})}catch(t){}}applyStyleSheetMutation(e){var t;let r=null;e.styleId?r=this.styleMirror.getStyle(e.styleId):e.id&&(r=((t=this.mirror.getNode(e.id))==null?void 0:t.sheet)||null),r&&(e.source===x.StyleSheetRule?this.applyStyleSheetRule(e,r):e.source===x.StyleDeclaration&&this.applyStyleDeclaration(e,r))}applyStyleSheetRule(e,t){var r,i,o,n;if((r=e.adds)==null||r.forEach(({rule:a,index:l})=>{try{if(Array.isArray(l)){const{positions:u,index:c}=Js(l);Xe(t.cssRules,u).insertRule(a,c)}else{const u=l===void 0?void 0:Math.min(l,t.cssRules.length);t==null||t.insertRule(a,u)}}catch(u){}}),(i=e.removes)==null||i.forEach(({index:a})=>{try{if(Array.isArray(a)){const{positions:l,index:u}=Js(a);Xe(t.cssRules,l).deleteRule(u||0)}else t==null||t.deleteRule(a)}catch(l){}}),e.replace)try{(o=t.replace)==null||o.call(t,e.replace)}catch(a){}if(e.replaceSync)try{(n=t.replaceSync)==null||n.call(t,e.replaceSync)}catch(a){}}applyStyleDeclaration(e,t){e.set&&Xe(t.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&Xe(t.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var t;const r=this.mirror.getNode(e.id);if(!r)return;(t=e.styles)==null||t.forEach(a=>{var l;let u=null,c=null;if(Ae(r)?c=((l=r.ownerDocument)==null?void 0:l.defaultView)||null:r.nodeName==="#document"&&(c=r.defaultView),!!c)try{u=new c.CSSStyleSheet,this.styleMirror.add(u,a.styleId),this.applyStyleSheetRule({source:x.StyleSheetRule,adds:a.rules},u)}catch(h){}});const i=10;let o=0;const n=(a,l)=>{const u=l.map(c=>this.styleMirror.getStyle(c)).filter(c=>c!==null);Ae(a)?a.shadowRoot.adoptedStyleSheets=u:a.nodeName==="#document"&&(a.adoptedStyleSheets=u),u.length!==l.length&&o<i&&(setTimeout(()=>n(a,l),0+100*o),o++)};n(r,e.styleIds)}legacy_resolveMissingNode(e,t,r,i){const{previousId:o,nextId:n}=i,a=o&&e[o],l=n&&e[n];if(a){const{node:u,mutation:c}=a;t.insertBefore(u,r),delete e[c.node.id],delete this.legacy_missingNodeRetryMap[c.node.id],(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(e,t,u,c)}if(l){const{node:u,mutation:c}=l;t.insertBefore(u,r.nextSibling),delete e[c.node.id],delete this.legacy_missingNodeRetryMap[c.node.id],(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(e,t,u,c)}}moveAndHover(e,t,r,i,o){const n=this.mirror.getNode(r);if(!n)return this.debugNodeNotFound(o,r);const a=Pi(n,this.iframe),l=e*a.absoluteScale+a.x,u=t*a.absoluteScale+a.y;this.mouse.style.left=`${l}px`,this.mouse.style.top=`${u}px`,i||this.drawMouseTail({x:l,y:u}),this.hoverElements(n)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:t,lineWidth:r,strokeStyle:i,duration:o}=this.config.mouseTail===!0?ps:Object.assign({},ps,this.config.mouseTail),n=()=>{if(!this.mouseTail)return;const a=this.mouseTail.getContext("2d");!a||!this.tailPositions.length||(a.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),a.beginPath(),a.lineWidth=r,a.lineCap=t,a.strokeStyle=i,a.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(l=>a.lineTo(l.x,l.y)),a.stroke())};this.tailPositions.push(e),n(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(a=>a!==e),n()},o/this.speedService.state.context.timer.speed)}hoverElements(e){var t;(t=this.lastHoveredRootNode||this.iframe.contentDocument)==null||t.querySelectorAll(".\\:hover").forEach(i=>{i.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let r=e;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(e){return e.type!==M.IncrementalSnapshot?!1:e.data.source>x.Mutation&&e.data.source<=x.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(P.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,t){this.warn(`Node with id '${t}' not found. `,e)}warnCanvasMutationFailed(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)}debugNodeNotFound(e,t){this.debug(`Node with id '${t}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn(lo,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(lo,...e)}}const mm="2.1.2-alpha.1",{getVersion:gm}=ce,{isRecording:ym}=ce,{flushCustomEventQueue:bm}=ce,{addCustomEvent:wm}=ce,{freezePage:vm}=ce,{takeFullSnapshot:Sm}=ce;exports.EventType=M;exports.IncrementalSource=x;exports.MouseInteractions=F;exports.Replayer=pm;exports.ReplayerEvents=P;exports.addCustomEvent=wm;exports.canvasMutation=Qs;exports.flushCustomEventQueue=bm;exports.freezePage=vm;exports.getVersion=gm;exports.isRecording=ym;exports.record=ce;exports.takeFullSnapshot=Sm;exports.utils=lp;exports.version=mm;
82
+ ***************************************************************************** */function ro(s,e){var t=typeof Symbol=="function"&&s[Symbol.iterator];if(!t)return s;var r,i,o=t.call(s),n=[];try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)n.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return n}var Ke;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(Ke||(Ke={}));var ll={type:"xstate.init"};function ds(s){return s===void 0?[]:[].concat(s)}function He(s){return{type:"xstate.assign",assignment:s}}function so(s,e){return typeof(s=typeof s=="string"&&e&&e[s]?e[s]:s)=="string"?{type:s}:typeof s=="function"?{type:s.name,exec:s}:s}function Tr(s){return function(e){return s===e}}function ul(s){return typeof s=="string"?{type:s}:s}function io(s,e){return{value:s,context:e,actions:[],changed:!1,matches:Tr(s)}}function no(s,e,t){var r=e,i=!1;return[s.filter(function(o){if(o.type==="xstate.assign"){i=!0;var n=Object.assign({},r);return typeof o.assignment=="function"?n=o.assignment(r,t):Object.keys(o.assignment).forEach(function(a){n[a]=typeof o.assignment[a]=="function"?o.assignment[a](r,t):o.assignment[a]}),r=n,!1}return!0}),r,i]}function cl(s,e){e===void 0&&(e={});var t=ro(no(ds(s.states[s.initial].entry).map(function(n){return so(n,e.actions)}),s.context,ll),2),r=t[0],i=t[1],o={config:s,_options:e,initialState:{value:s.initial,actions:r,context:i,matches:Tr(s.initial)},transition:function(n,a){var l,u,c=typeof n=="string"?{value:n,context:s.context}:n,h=c.value,f=c.context,g=ul(a),p=s.states[h];if(p.on){var y=ds(p.on[g.type]);try{for(var d=function(O){var ue=typeof Symbol=="function"&&Symbol.iterator,de=ue&&O[ue],ae=0;if(de)return de.call(O);if(O&&typeof O.length=="number")return{next:function(){return O&&ae>=O.length&&(O=void 0),{value:O&&O[ae++],done:!O}}};throw new TypeError(ue?"Object is not iterable.":"Symbol.iterator is not defined.")}(y),m=d.next();!m.done;m=d.next()){var S=m.value;if(S===void 0)return io(h,f);var v=typeof S=="string"?{target:S}:S,b=v.target,C=v.actions,E=C===void 0?[]:C,_=v.cond,A=_===void 0?function(){return!0}:_,V=b===void 0,z=b!=null?b:h,J=s.states[z];if(A(f,g)){var Q=ro(no((V?ds(E):[].concat(p.exit,E,J.entry).filter(function(O){return O})).map(function(O){return so(O,o._options.actions)}),f,g),3),te=Q[0],R=Q[1],ie=Q[2],ne=b!=null?b:h;return{value:ne,context:R,actions:te,changed:b!==h||te.length>0||ie,matches:Tr(ne)}}}}catch(O){l={error:O}}finally{try{m&&!m.done&&(u=d.return)&&u.call(d)}finally{if(l)throw l.error}}}return io(h,f)}};return o}var oo=function(s,e){return s.actions.forEach(function(t){var r=t.exec;return r&&r(s.context,e)})};function hl(s){var e=s.initialState,t=Ke.NotStarted,r=new Set,i={_machine:s,send:function(o){t===Ke.Running&&(e=s.transition(e,o),oo(e,ul(o)),r.forEach(function(n){return n(e)}))},subscribe:function(o){return r.add(o),o(e),{unsubscribe:function(){return r.delete(o)}}},start:function(o){if(o){var n=typeof o=="object"?o:{context:s.config.context,value:o};e={value:n.value,actions:[],context:n.context,matches:Tr(n.value)}}return t=Ke.Running,oo(e,ll),i},stop:function(){return t=Ke.Stopped,r.clear(),i},get state(){return e},get status(){return t}};return i}function tm(s,e){for(let t=s.length-1;t>=0;t--){const r=s[t];if(r.type===M.Meta&&r.timestamp<=e)return s.slice(t)}return s}function rm(s,{getCastFn:e,applyEventsSynchronously:t,emitter:r}){const i=cl({id:"player",context:s,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:He({lastPlayedEvent:(o,n)=>n.type==="CAST_EVENT"?n.payload.event:o.lastPlayedEvent}),recordTimeOffset:He((o,n)=>{let a=o.timeOffset;return"payload"in n&&"timeOffset"in n.payload&&(a=n.payload.timeOffset),q(N({},o),{timeOffset:a,baselineTime:o.events[0].timestamp+a})}),play(o){var n;const{timer:a,events:l,baselineTime:u,lastPlayedEvent:c}=o;a.clear();for(const p of l)to(p,u);const h=tm(l,u);let f=c==null?void 0:c.timestamp;(c==null?void 0:c.type)===M.IncrementalSnapshot&&c.data.source===x.MouseMove&&(f=c.timestamp+((n=c.data.positions[0])==null?void 0:n.timeOffset)),u<(f||0)&&r.emit(P.PlayBack);const g=new Array;for(const p of h)if(!(f&&f<u&&(p.timestamp<=f||p===c)))if(p.timestamp<u)g.push(p);else{const y=e(p,!1);a.addAction({doAction:()=>{y()},delay:p.delay})}t(g),r.emit(P.Flush),a.start()},pause(o){o.timer.clear()},resetLastPlayedEvent:He(o=>q(N({},o),{lastPlayedEvent:null})),startLive:He({baselineTime:(o,n)=>(o.timer.start(),n.type==="TO_LIVE"&&n.payload.baselineTime?n.payload.baselineTime:Date.now())}),addEvent:He((o,n)=>{const{baselineTime:a,timer:l,events:u}=o;if(n.type==="ADD_EVENT"){const{event:c}=n.payload;to(c,a);let h=u.length-1;if(!u[h]||u[h].timestamp<=c.timestamp)u.push(c);else{let p=-1,y=0;for(;y<=h;){const d=Math.floor((y+h)/2);u[d].timestamp<=c.timestamp?y=d+1:h=d-1}p===-1&&(p=y),u.splice(p,0,c)}const f=c.timestamp<a,g=e(c,f);f?g():l.isActive()&&l.addAction({doAction:()=>{g()},delay:c.delay})}return q(N({},o),{events:u})})}});return hl(i)}function sm(s){const e=cl({id:"speed",context:s,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(t,r)=>{"payload"in r&&t.timer.setSpeed(r.payload.speed)},recordSpeed:He({normalSpeed:t=>t.timer.speed}),restoreSpeed:t=>{t.timer.setSpeed(t.normalSpeed)}}});return hl(e)}const im=s=>[`.${s} { background: currentColor }`,"noscript { display: none !important; }"],ao=new Map;function fl(s,e){let t=ao.get(s);return t||(t=new Map,ao.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}function Oe(s,e,t){return async r=>{if(r&&typeof r=="object"&&"rr_type"in r)if(t&&(t.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){const i=await Oe(s,e,t)(r.args);return await createImageBitmap.apply(null,i)}else if("index"in r){if(t||e===null)return r;const{rr_type:i,index:o}=r;return fl(e,i)[o]}else if("args"in r){const{rr_type:i,args:o}=r,n=window[i];return new n(...await Promise.all(o.map(Oe(s,e,t))))}else{if("base64"in r)return Tp(r.base64);if("src"in r){const i=s.get(r.src);if(i)return i;{const o=new Image;return o.src=r.src,s.set(r.src,o),o}}else if("data"in r&&r.rr_type==="Blob"){const i=await Promise.all(r.data.map(Oe(s,e,t)));return new Blob(i,{type:r.type})}}else if(Array.isArray(r))return await Promise.all(r.map(Oe(s,e,t)));return r}}function nm(s,e){try{return e===Me.WebGL?s.getContext("webgl")||s.getContext("experimental-webgl"):s.getContext("webgl2")}catch(t){return null}}const om=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function am(s,e){if(!(e!=null&&e.constructor))return;const{name:t}=e.constructor;if(!om.includes(t))return;const r=fl(s,t);r.includes(e)||r.push(e)}async function lm({mutation:s,target:e,type:t,imageMap:r,errorHandler:i}){try{const o=nm(e,t);if(!o)return;if(s.setter){o[s.property]=s.args[0];return}const n=o[s.property],a=await Promise.all(s.args.map(Oe(r,o))),l=n.apply(o,a);am(o,l);const u=!1}catch(o){i(s,o)}}async function um({event:s,mutations:e,target:t,imageMap:r,errorHandler:i}){const o=t.getContext("2d");if(!o){i(e[0],new Error("Canvas context is null"));return}const n=e.map(async l=>Promise.all(l.args.map(Oe(r,o))));(await Promise.all(n)).forEach((l,u)=>{const c=e[u];try{if(c.setter){o[c.property]=c.args[0];return}const h=o[c.property];c.property==="drawImage"&&typeof c.args[0]=="string"?(r.get(s),h.apply(o,c.args)):h.apply(o,l)}catch(h){i(c,h)}})}async function Qs({event:s,mutation:e,target:t,imageMap:r,canvasEventMap:i,errorHandler:o}){try{const n=i.get(s)||e,a="commands"in n?n.commands:[n];if([Me.WebGL,Me.WebGL2].includes(e.type)){for(let l=0;l<a.length;l++){const u=a[l];await lm({mutation:u,type:e.type,target:t,imageMap:r,errorHandler:o})}return}await um({event:s,mutations:a,target:t,imageMap:r,errorHandler:o})}catch(n){o(e,n)}}class cm{constructor(e){w(this,"mediaMap",new Map),w(this,"warn"),w(this,"service"),w(this,"speedService"),w(this,"emitter"),w(this,"getCurrentTime"),w(this,"metadataCallbackMap",new Map),this.warn=e.warn,this.service=e.service,this.speedService=e.speedService,this.emitter=e.emitter,this.getCurrentTime=e.getCurrentTime,this.emitter.on(P.Start,this.start.bind(this)),this.emitter.on(P.SkipStart,this.start.bind(this)),this.emitter.on(P.Pause,this.pause.bind(this)),this.emitter.on(P.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach((t,r)=>{this.syncTargetWithState(r),e.pause&&r.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:t,mediaState:r}){if(r.isPlaying){const o=(e-r.lastInteractionTimeOffset)/1e3*r.playbackRate,n="duration"in t&&t.duration;if(Number.isNaN(n)){this.waitForMetadata(t);return}let a=r.currentTimeAtLastInteraction+o;t.loop&&n!==!1&&(a=a%n),t.currentTime=a}else t.pause(),t.currentTime=r.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e)||!("addEventListener"in e))return;const t=()=>{this.metadataCallbackMap.delete(e);const r=this.mediaMap.get(e);r&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:r})};this.metadataCallbackMap.set(e,t),e.addEventListener("loadedmetadata",t,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:t,mutation:r}){var g,p,y,d,m;const i=this.mediaMap.get(e),{type:o,playbackRate:n,currentTime:a,muted:l,volume:u,loop:c}=r;return{isPlaying:o===Re.Play||o!==Re.Pause&&((i==null?void 0:i.isPlaying)||e.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:(g=a!=null?a:i==null?void 0:i.currentTimeAtLastInteraction)!=null?g:0,lastInteractionTimeOffset:t,playbackRate:(p=n!=null?n:i==null?void 0:i.playbackRate)!=null?p:1,volume:(y=u!=null?u:i==null?void 0:i.volume)!=null?y:1,muted:(d=l!=null?l:i==null?void 0:i.muted)!=null?d:e.getAttribute("muted")===null,loop:(m=c!=null?c:i==null?void 0:i.loop)!=null?m:e.getAttribute("loop")===null}}syncTargetWithState(e){const t=this.mediaMap.get(e);if(!t)return;const{muted:r,loop:i,volume:o,isPlaying:n}=t,a=this.service.state.matches("paused"),l=t.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:e,mediaState:t}),e.volume!==o&&(e.volume=o),e.muted=r,e.loop=i,e.playbackRate!==l&&(e.playbackRate=l),n&&!a?e.play():e.pause()}catch(u){this.warn(`Failed to replay media interactions: ${u.message||u}`)}}addMediaElements(e,t,r){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;const i=e,o=r.getMeta(i);if(!o||!("attributes"in o))return;const n=this.service.state.matches("paused"),a=o.attributes;let l=!1;a.rr_mediaState?l=a.rr_mediaState==="played":l=i.getAttribute("autoplay")!==null,l&&n&&i.pause();let u=1;typeof a.rr_mediaPlaybackRate=="number"&&(u=a.rr_mediaPlaybackRate);let c=!1;typeof a.rr_mediaMuted=="boolean"?c=a.rr_mediaMuted:c=i.getAttribute("muted")!==null;let h=!1;typeof a.rr_mediaLoop=="boolean"?h=a.rr_mediaLoop:h=i.getAttribute("loop")!==null;let f=1;typeof a.rr_mediaVolume=="number"&&(f=a.rr_mediaVolume);let g=0;typeof a.rr_mediaCurrentTime=="number"&&(g=a.rr_mediaCurrentTime),this.mediaMap.set(i,{isPlaying:l,currentTimeAtLastInteraction:g,lastInteractionTimeOffset:t,playbackRate:u,volume:f,muted:c,loop:h}),this.syncTargetWithState(i)}mediaMutation({target:e,timeOffset:t,mutation:r}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:t,mutation:r})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return["AUDIO","VIDEO"].includes(e.nodeName)}reset(){this.mediaMap.clear()}}function ar(s,e){if(s.nodeName!=="DIALOG"||s instanceof be)return;const t=s,r=t.open,i=r&&t.matches("dialog:modal"),o=t.getAttribute("rr_open_mode"),n=typeof(e==null?void 0:e.attributes.open)=="string"||typeof t.getAttribute("open")=="string",a=o==="modal";if(!(r&&!(i&&o==="non-modal"||!i&&a))){if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}r&&t.close(),n&&(a?t.showModal():t.show())}}function hm(s,e){if(s.nodeName!=="DIALOG"||s instanceof be)return;const t=s;if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}e.attributes.open===null&&(t.removeAttribute("open"),t.removeAttribute("rr_open_mode"))}const fm=5*1e3,dm=al||Qp,lo="[replayer]",ps={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function uo(s){return s.type==M.IncrementalSnapshot&&(s.data.source==x.TouchMove||s.data.source==x.MouseInteraction&&s.data.type==F.TouchStart)}class pm{constructor(e,t){if(w(this,"wrapper"),w(this,"iframe"),w(this,"service"),w(this,"speedService"),w(this,"config"),w(this,"usingVirtualDom",!1),w(this,"virtualDom",new lt),w(this,"mouse"),w(this,"mouseTail",null),w(this,"tailPositions",[]),w(this,"emitter",dm()),w(this,"nextUserInteractionEvent"),w(this,"legacy_missingNodeRetryMap",{}),w(this,"cache",Cn()),w(this,"imageMap",new Map),w(this,"canvasEventMap",new Map),w(this,"mirror",fo()),w(this,"styleMirror",new Fi),w(this,"mediaManager"),w(this,"firstFullSnapshot",null),w(this,"newDocumentQueue",[]),w(this,"mousePos",null),w(this,"touchActive",null),w(this,"lastMouseDownEvent",null),w(this,"lastHoveredRootNode"),w(this,"lastSelectionData",null),w(this,"constructedStyleMutations",[]),w(this,"adoptedStyleSheets",[]),w(this,"handleResize",a=>{this.iframe.style.display="inherit";for(const l of[this.mouseTail,this.iframe])l&&(l.setAttribute("width",String(a.width)),l.setAttribute("height",String(a.height)))}),w(this,"applyEventsSynchronously",a=>{for(const l of a){switch(l.type){case M.DomContentLoaded:case M.Load:case M.Custom:continue;case M.FullSnapshot:case M.Meta:case M.Plugin:case M.IncrementalSnapshot:break}this.getCastFn(l,!0)()}}),w(this,"getCastFn",(a,l=!1)=>{let u;switch(a.type){case M.DomContentLoaded:case M.Load:break;case M.Custom:u=()=>{this.emitter.emit(P.CustomEvent,a)};break;case M.Meta:u=()=>this.emitter.emit(P.Resize,{width:a.data.width,height:a.data.height});break;case M.FullSnapshot:u=()=>{var h;if(this.firstFullSnapshot){if(this.firstFullSnapshot===a){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(a,l),(h=this.iframe.contentWindow)==null||h.scrollTo(a.data.initialOffset)};break;case M.IncrementalSnapshot:u=()=>{if(this.applyIncremental(a,l),!l&&(a===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const h of this.service.state.context.events)if(!(h.timestamp<=a.timestamp)&&this.isUserInteraction(h)){h.delay-a.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=h);break}if(this.nextUserInteractionEvent){const h=this.nextUserInteractionEvent.delay-a.delay,f={speed:Math.min(Math.round(h/fm),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:f}),this.emitter.emit(P.SkipStart,f)}}};break}return()=>{u&&u();for(const f of this.config.plugins||[])f.handler&&f.handler(a,l,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:a}});const h=this.service.state.context.events.length-1;if(!this.config.liveMode&&a===this.service.state.context.events[h]){const f=()=>{h<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(P.Finish))};let g=50;a.type===M.IncrementalSnapshot&&a.data.source===x.MouseMove&&a.data.positions.length&&(g+=Math.max(0,-a.data.positions[0].timeOffset)),setTimeout(f,g)}this.emitter.emit(P.EventCast,a)}}),!(t!=null&&t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const r={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,inactivePeriodThreshold:10*1e3,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:ps,useVirtualDom:!0,logger:console};this.config=Object.assign({},r,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(P.Resize,this.handleResize),this.setupDom();for(const a of this.config.plugins||[])a.getMirror&&a.getMirror({nodeMirror:this.mirror});this.emitter.on(P.Flush,()=>{if(this.usingVirtualDom){const a={mirror:this.mirror,applyCanvas:(l,u,c)=>{Qs({event:l,mutation:u,target:c,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(l,u)=>{l.source===x.StyleSheetRule?this.applyStyleSheetRule(l,u):l.source===x.StyleDeclaration&&this.applyStyleDeclaration(l,u)},afterAppend:(l,u)=>{for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(l,{id:u,replayer:this})}};if(this.iframe.contentDocument)try{Mr(this.iframe.contentDocument,this.virtualDom,a,this.virtualDom.mirror)}catch(l){console.warn(l)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const l in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[l],c=Nr(u.node,this.mirror,this.virtualDom.mirror);Mr(c,u.node,a,this.virtualDom.mirror),u.node=c}catch(u){this.warn(u)}this.constructedStyleMutations.forEach(l=>{this.applyStyleSheetMutation(l)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(l=>{this.applyAdoptedStyleSheet(l)}),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){const[a,l]=this.lastMouseDownEvent;a.dispatchEvent(l)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(P.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});const i=new em([],{speed:this.config.speed});this.service=rm({events:e.map(a=>t&&t.unpackFn?t.unpackFn(a):a).sort((a,l)=>a.timestamp-l.timestamp),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(a=>{this.emitter.emit(P.StateChange,{player:a})}),this.speedService=sm({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(a=>{this.emitter.emit(P.StateChange,{speed:a})}),this.mediaManager=new cm({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});const o=this.service.state.context.events.find(a=>a.type===M.Meta),n=this.service.state.context.events.find(a=>a.type===M.FullSnapshot);if(o){const{width:a,height:l}=o.data;setTimeout(()=>{this.emitter.emit(P.Resize,{width:a,height:l})},0)}n&&setTimeout(()=>{var a;this.firstFullSnapshot||(this.firstFullSnapshot=n,this.rebuildFullSnapshot(n),(a=this.iframe.contentWindow)==null||a.scrollTo(n.data.initialOffset))},1),this.service.state.context.events.find(uo)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,t){return this.emitter.on(e,t),this}off(e,t){return this.emitter.off(e,t),this}setConfig(e){Object.keys(e).forEach(t=>{e[t],this.config[t]=e[t]}),this.config.skipInactive||this.backToNormal(),typeof e.speed!="undefined"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail!="undefined"&&(e.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getMetaData(){const e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:t}=this.service.state.context;return e-t[0].timestamp}getMirror(){return this.mirror}play(e=0){var t,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(r=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||r.classList.remove("rrweb-paused"),this.emitter.emit(P.Start)}pause(e){var t,r;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(r=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||r.classList.add("rrweb-paused"),this.emitter.emit(P.Pause)}resume(e=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(P.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(P.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const t=this.config.unpackFn?this.config.unpackFn(e):e;uo(t)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:t}}))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=Cn()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(qp(this.iframe.contentWindow,this.iframe.contentDocument),ki(this.iframe.contentWindow))}rebuildFullSnapshot(e,t=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const r=[],i=new Set,o=(l,u)=>{if(l.nodeName==="DIALOG"&&i.add(l),this.collectIframeAndAttachDocument(r,l),this.mediaManager.isSupportedMediaElement(l)){const{events:c}=this.service.state.context;this.mediaManager.addMediaElements(l,e.timestamp-c[0].timestamp,this.mirror)}for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(l,{id:u,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),Ch(e.data.node,{doc:this.iframe.contentDocument,afterAppend:o,cache:this.cache,mirror:this.mirror}),o(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:l,builtNode:u}of r)this.attachDocumentToIframe(l,u),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==l);const{documentElement:n,head:a}=this.iframe.contentDocument;this.insertStyleRules(n,a),i.forEach(l=>ar(l)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(P.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var r;const i=im(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!i.length)if(this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,ja(o,this.virtualDom.unserializedId)),e.insertBefore(o,t),o.rules.push({source:x.StyleSheetRule,adds:i.map((n,a)=>({rule:n,index:a}))})}else{const o=document.createElement("style");e.insertBefore(o,t);for(let n=0;n<i.length;n++)(r=o.sheet)==null||r.insertRule(i[n],n)}}attachDocumentToIframe(e,t){const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],o=new Set,n=(a,l)=>{a.nodeName==="DIALOG"&&o.add(a),this.collectIframeAndAttachDocument(i,a);const u=r.getMeta(a);if((u==null?void 0:u.type)===Ee.Element&&(u==null?void 0:u.tagName.toUpperCase())==="HTML"){const{documentElement:c,head:h}=t.contentDocument;this.insertStyleRules(c,h)}if(!this.usingVirtualDom)for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(a,{id:l,replayer:this})};bt(e.node,{doc:t.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:n,cache:this.cache}),n(t.contentDocument,e.node.id);for(const{mutationInQueue:a,builtNode:l}of i)this.attachDocumentToIframe(a,l),this.newDocumentQueue=this.newDocumentQueue.filter(u=>u!==a);o.forEach(a=>ar(a))}collectIframeAndAttachDocument(e,t){if(Qe(t,this.mirror)){const r=this.newDocumentQueue.find(i=>i.parentId===this.mirror.getId(t));r&&e.push({mutationInQueue:r,builtNode:t})}}waitForStylesheetLoad(){var e;const t=(e=this.iframe.contentDocument)==null?void 0:e.head;if(t){const r=new Set;let i,o=this.service.state;const n=()=>{o=this.service.state};this.emitter.on(P.Start,n),this.emitter.on(P.Pause,n);const a=()=>{this.emitter.off(P.Start,n),this.emitter.off(P.Pause,n)};t.querySelectorAll('link[rel="stylesheet"]').forEach(l=>{l.sheet||(r.add(l),l.addEventListener("load",()=>{r.delete(l),r.size===0&&i!==-1&&(o.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(P.LoadStylesheetEnd),i&&clearTimeout(i),a())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(P.LoadStylesheetStart),i=setTimeout(()=>{o.matches("playing")&&this.play(this.getCurrentTime()),i=-1,a()},this.config.loadTimeout))}}async preloadAllImages(){const e=[];for(const t of this.service.state.context.events)t.type===M.IncrementalSnapshot&&t.data.source===x.CanvasMutation&&(e.push(this.deserializeAndPreloadCanvasEvents(t.data,t)),("commands"in t.data?t.data.commands:[t.data]).forEach(i=>{this.preloadImages(i,t)}));return Promise.all(e)}preloadImages(e,t){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(t)){const r=document.createElement("canvas"),i=r.getContext("2d"),o=i==null?void 0:i.createImageData(r.width,r.height);i==null||i.putImageData(o,0,0)}}async deserializeAndPreloadCanvasEvents(e,t){if(!this.canvasEventMap.has(t)){const r={isUnchanged:!0};if("commands"in e){const i=await Promise.all(e.commands.map(async o=>{const n=await Promise.all(o.args.map(Oe(this.imageMap,null,r)));return q(N({},o),{args:n})}));r.isUnchanged===!1&&this.canvasEventMap.set(t,q(N({},e),{commands:i}))}else{const i=await Promise.all(e.args.map(Oe(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(t,q(N({},e),{args:i}))}}}applyIncremental(e,t){var r,i,o;const{data:n}=e;switch(n.source){case x.Mutation:{try{this.applyMutation(n,t)}catch(a){this.warn(`Exception in mutation ${a.message||a}`,n)}break}case x.Drag:case x.TouchMove:case x.MouseMove:if(t){const a=n.positions[n.positions.length-1];this.mousePos={x:a.x,y:a.y,id:a.id,debugData:n}}else n.positions.forEach(a=>{const l={doAction:()=>{this.moveAndHover(a.x,a.y,a.id,t,n)},delay:a.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(l)}),this.timer.addAction({doAction(){},delay:e.delay-((r=n.positions[0])==null?void 0:r.timeOffset)});break;case x.MouseInteraction:{if(n.id===-1)break;const a=new Event(Te(F[n.type])),l=this.mirror.getNode(n.id);if(!l)return this.debugNodeNotFound(n,n.id);this.emitter.emit(P.MouseInteraction,{type:n.type,target:l});const{triggerFocus:u}=this.config;switch(n.type){case F.Blur:"blur"in l&&l.blur();break;case F.Focus:u&&l.focus&&l.focus({preventScroll:!0});break;case F.Click:case F.TouchStart:case F.TouchEnd:case F.MouseDown:case F.MouseUp:t?(n.type===F.TouchStart?this.touchActive=!0:n.type===F.TouchEnd&&(this.touchActive=!1),n.type===F.MouseDown?this.lastMouseDownEvent=[l,a]:n.type===F.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:n.x||0,y:n.y||0,id:n.id,debugData:n}):(n.type===F.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(n.x||0,n.y||0,n.id,t,n),n.type===F.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):n.type===F.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):n.type===F.TouchEnd?this.mouse.classList.remove("touch-active"):l.dispatchEvent(a));break;case F.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:l.dispatchEvent(a)}break}case x.Scroll:{if(n.id===-1)break;if(this.usingVirtualDom){const a=this.virtualDom.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);a.scrollData=n;break}this.applyScroll(n,t);break}case x.ViewportResize:this.emitter.emit(P.Resize,{width:n.width,height:n.height});break;case x.Input:{if(n.id===-1)break;if(this.usingVirtualDom){const a=this.virtualDom.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);a.inputData=n;break}this.applyInput(n);break}case x.MediaInteraction:{const a=this.usingVirtualDom?this.virtualDom.mirror.getNode(n.id):this.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);const l=a,{events:u}=this.service.state.context;this.mediaManager.mediaMutation({target:l,timeOffset:e.timestamp-u[0].timestamp,mutation:n});break}case x.StyleSheetRule:case x.StyleDeclaration:{this.usingVirtualDom?n.styleId?this.constructedStyleMutations.push(n):n.id&&((i=this.virtualDom.mirror.getNode(n.id))==null||i.rules.push(n)):this.applyStyleSheetMutation(n);break}case x.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const a=this.virtualDom.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);a.canvasMutations.push({event:e,mutation:n})}else{const a=this.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);Qs({event:e,mutation:n,target:a,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case x.Font:{try{const a=new FontFace(n.family,n.buffer?new Uint8Array(JSON.parse(n.fontSource)):n.fontSource,n.descriptors);(o=this.iframe.contentDocument)==null||o.fonts.add(a)}catch(a){this.warn(a)}break}case x.Selection:{if(t){this.lastSelectionData=n;break}this.applySelection(n);break}case x.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(n):this.applyAdoptedStyleSheet(n);break}}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,jd(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const u in this.legacy_missingNodeRetryMap)try{const c=this.legacy_missingNodeRetryMap[u],h=Ga(c.node,this.virtualDom,this.mirror);h&&(c.node=h)}catch(c){this.warn(c)}const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(u=>r.getNode(u.id)?!0:(this.warnNodeNotFound(e,u.id),!1)),e.removes.forEach(u=>{var c;const h=r.getNode(u.id);if(!h)return;let f=r.getNode(u.parentId);if(!f)return this.warnNodeNotFound(e,u.parentId);if(u.isShadow&&Ae(f)&&(f=f.shadowRoot),r.removeNodeFromMap(h),f)try{f.removeChild(h),this.usingVirtualDom&&h.nodeName==="#text"&&f.nodeName==="STYLE"&&((c=f.rules)==null?void 0:c.length)>0&&(f.rules=[])}catch(g){if(g instanceof DOMException)this.warn("parent could not remove child in mutation",f,h,e);else throw g}});const i=N({},this.legacy_missingNodeRetryMap),o=[],n=u=>{let c=null;return u.nextId&&(c=r.getNode(u.nextId)),u.nextId!==null&&u.nextId!==void 0&&u.nextId!==-1&&!c},a=u=>{var c,h;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let f=r.getNode(u.parentId);if(!f)return u.node.type===Ee.Document?this.newDocumentQueue.push(u):o.push(u);u.node.isShadow&&(Ae(f)||f.attachShadow({mode:"open"}),f=f.shadowRoot);let g=null,p=null;if(u.previousId&&(g=r.getNode(u.previousId)),u.nextId&&(p=r.getNode(u.nextId)),n(u))return o.push(u);if(u.node.rootId&&!r.getNode(u.node.rootId))return;const y=u.node.rootId?r.getNode(u.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Qe(f,r)){this.attachDocumentToIframe(u,f);return}const d=(v,b)=>{if(!this.usingVirtualDom){ar(v);for(const C of this.config.plugins||[])C.onBuild&&C.onBuild(v,{id:b,replayer:this})}},m=bt(u.node,{doc:y,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:d});if(u.previousId===-1||u.nextId===-1){i[u.node.id]={node:m,mutation:u};return}const S=r.getMeta(f);if(S&&S.type===Ee.Element&&u.node.type===Ee.Text){const v=Array.isArray(f.childNodes)?f.childNodes:Array.from(f.childNodes);if(S.tagName==="textarea")for(const b of v)b.nodeType===f.TEXT_NODE&&f.removeChild(b);else if(S.tagName==="style"&&v.length===1)for(const b of v)b.nodeType===f.TEXT_NODE&&!r.hasNode(b)&&(m.textContent=b.textContent,f.removeChild(b))}else if((S==null?void 0:S.type)===Ee.Document){const v=f;u.node.type===Ee.DocumentType&&((c=v.childNodes[0])==null?void 0:c.nodeType)===Node.DOCUMENT_TYPE_NODE&&v.removeChild(v.childNodes[0]),m.nodeName==="HTML"&&v.documentElement&&v.removeChild(v.documentElement)}if(g&&g.nextSibling&&g.nextSibling.parentNode?f.insertBefore(m,g.nextSibling):p&&p.parentNode?f.contains(p)?f.insertBefore(m,p):f.insertBefore(m,null):f.appendChild(m),d(m,u.node.id),this.usingVirtualDom&&m.nodeName==="#text"&&f.nodeName==="STYLE"&&((h=f.rules)==null?void 0:h.length)>0&&(f.rules=[]),Qe(m,this.mirror)){const v=this.mirror.getId(m),b=this.newDocumentQueue.find(C=>C.parentId===v);b&&(this.attachDocumentToIframe(b,m),this.newDocumentQueue=this.newDocumentQueue.filter(C=>C!==b))}(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(i,f,m,u)};e.adds.forEach(u=>{a(u)});const l=Date.now();for(;o.length;){const u=Xa(o);if(o.length=0,Date.now()-l>500){this.warn("Timeout in the loop, please check the resolve tree data:",u);break}for(const c of u)r.getNode(c.value.parentId)?$i(c,f=>{a(f)}):this.debug("Drop resolve tree since there is no parent for the root node.",c)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),Ja(e.texts).forEach(u=>{var c;const h=r.getNode(u.id);if(!h)return e.removes.find(g=>g.id===u.id)?void 0:this.warnNodeNotFound(e,u.id);const f=h.parentElement;if(u.value&&f&&f.tagName==="STYLE"?h.textContent=Pr(u.value,this.cache):h.textContent=u.value,this.usingVirtualDom){const g=h.parentNode;((c=g==null?void 0:g.rules)==null?void 0:c.length)>0&&(g.rules=[])}}),e.attributes.forEach(u=>{var c;const h=r.getNode(u.id);if(!h)return e.removes.find(f=>f.id===u.id)?void 0:this.warnNodeNotFound(e,u.id);for(const f in u.attributes)if(typeof f=="string"){const g=u.attributes[f];if(g===null)h.removeAttribute(f),f==="open"&&hm(h,u);else if(typeof g=="string")try{if(f==="_cssText"&&(h.nodeName==="LINK"||h.nodeName==="STYLE"))try{const p=r.getMeta(h),y=bt(q(N({},p),{attributes:N(N({},p.attributes),u.attributes)}),{doc:h.ownerDocument,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(p.attributes,u.attributes);const d=h.nextSibling,m=h.parentNode;if(y&&m){m.removeChild(h),m.insertBefore(y,d),r.replace(u.id,y);break}}catch(p){}if(f==="value"&&h.nodeName==="TEXTAREA"){const p=h;p.childNodes.forEach(d=>p.removeChild(d));const y=(c=h.ownerDocument)==null?void 0:c.createTextNode(g);y&&p.appendChild(y)}else h.setAttribute(f,g);f==="rr_open_mode"&&h.nodeName==="DIALOG"&&ar(h,u)}catch(p){this.warn("An error occurred may due to the checkout feature.",p)}else if(f==="style"){const p=g,y=h;for(const d in p)if(p[d]===!1)y.style.removeProperty(d);else if(p[d]instanceof Array){const m=p[d];y.style.setProperty(d,m[0],m[1])}else{const m=p[d];y.style.setProperty(d,m)}}}})}applyScroll(e,t){var r,i;const o=this.mirror.getNode(e.id);if(!o)return this.debugNodeNotFound(e,e.id);const n=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)(r=this.iframe.contentWindow)==null||r.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if((n==null?void 0:n.type)===Ee.Document)(i=o.defaultView)==null||i.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else try{o.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"})}catch(a){}}applyInput(e){const t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(r){}}applySelection(e){try{const t=new Set,r=e.ranges.map(({start:i,startOffset:o,end:n,endOffset:a})=>{const l=this.mirror.getNode(i),u=this.mirror.getNode(n);if(!l||!u)return;const c=new Range;c.setStart(l,o),c.setEnd(u,a);const h=l.ownerDocument,f=h==null?void 0:h.getSelection();return f&&t.add(f),{range:c,selection:f}});t.forEach(i=>i.removeAllRanges()),r.forEach(i=>{var o;return i&&((o=i.selection)==null?void 0:o.addRange(i.range))})}catch(t){}}applyStyleSheetMutation(e){var t;let r=null;e.styleId?r=this.styleMirror.getStyle(e.styleId):e.id&&(r=((t=this.mirror.getNode(e.id))==null?void 0:t.sheet)||null),r&&(e.source===x.StyleSheetRule?this.applyStyleSheetRule(e,r):e.source===x.StyleDeclaration&&this.applyStyleDeclaration(e,r))}applyStyleSheetRule(e,t){var r,i,o,n;if((r=e.adds)==null||r.forEach(({rule:a,index:l})=>{try{if(Array.isArray(l)){const{positions:u,index:c}=Js(l);Xe(t.cssRules,u).insertRule(a,c)}else{const u=l===void 0?void 0:Math.min(l,t.cssRules.length);t==null||t.insertRule(a,u)}}catch(u){}}),(i=e.removes)==null||i.forEach(({index:a})=>{try{if(Array.isArray(a)){const{positions:l,index:u}=Js(a);Xe(t.cssRules,l).deleteRule(u||0)}else t==null||t.deleteRule(a)}catch(l){}}),e.replace)try{(o=t.replace)==null||o.call(t,e.replace)}catch(a){}if(e.replaceSync)try{(n=t.replaceSync)==null||n.call(t,e.replaceSync)}catch(a){}}applyStyleDeclaration(e,t){e.set&&Xe(t.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&Xe(t.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var t;const r=this.mirror.getNode(e.id);if(!r)return;(t=e.styles)==null||t.forEach(a=>{var l;let u=null,c=null;if(Ae(r)?c=((l=r.ownerDocument)==null?void 0:l.defaultView)||null:r.nodeName==="#document"&&(c=r.defaultView),!!c)try{u=new c.CSSStyleSheet,this.styleMirror.add(u,a.styleId),this.applyStyleSheetRule({source:x.StyleSheetRule,adds:a.rules},u)}catch(h){}});const i=10;let o=0;const n=(a,l)=>{const u=l.map(c=>this.styleMirror.getStyle(c)).filter(c=>c!==null);Ae(a)?a.shadowRoot.adoptedStyleSheets=u:a.nodeName==="#document"&&(a.adoptedStyleSheets=u),u.length!==l.length&&o<i&&(setTimeout(()=>n(a,l),0+100*o),o++)};n(r,e.styleIds)}legacy_resolveMissingNode(e,t,r,i){const{previousId:o,nextId:n}=i,a=o&&e[o],l=n&&e[n];if(a){const{node:u,mutation:c}=a;t.insertBefore(u,r),delete e[c.node.id],delete this.legacy_missingNodeRetryMap[c.node.id],(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(e,t,u,c)}if(l){const{node:u,mutation:c}=l;t.insertBefore(u,r.nextSibling),delete e[c.node.id],delete this.legacy_missingNodeRetryMap[c.node.id],(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(e,t,u,c)}}moveAndHover(e,t,r,i,o){const n=this.mirror.getNode(r);if(!n)return this.debugNodeNotFound(o,r);const a=Pi(n,this.iframe),l=e*a.absoluteScale+a.x,u=t*a.absoluteScale+a.y;this.mouse.style.left=`${l}px`,this.mouse.style.top=`${u}px`,i||this.drawMouseTail({x:l,y:u}),this.hoverElements(n)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:t,lineWidth:r,strokeStyle:i,duration:o}=this.config.mouseTail===!0?ps:Object.assign({},ps,this.config.mouseTail),n=()=>{if(!this.mouseTail)return;const a=this.mouseTail.getContext("2d");!a||!this.tailPositions.length||(a.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),a.beginPath(),a.lineWidth=r,a.lineCap=t,a.strokeStyle=i,a.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(l=>a.lineTo(l.x,l.y)),a.stroke())};this.tailPositions.push(e),n(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(a=>a!==e),n()},o/this.speedService.state.context.timer.speed)}hoverElements(e){var t;(t=this.lastHoveredRootNode||this.iframe.contentDocument)==null||t.querySelectorAll(".\\:hover").forEach(i=>{i.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let r=e;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(e){return e.type!==M.IncrementalSnapshot?!1:e.data.source>x.Mutation&&e.data.source<=x.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(P.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,t){this.warn(`Node with id '${t}' not found. `,e)}warnCanvasMutationFailed(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)}debugNodeNotFound(e,t){this.debug(`Node with id '${t}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn(lo,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(lo,...e)}}const mm="2.1.2-alpha.2",{getVersion:gm}=ce,{isRecording:ym}=ce,{flushCustomEventQueue:bm}=ce,{addCustomEvent:wm}=ce,{freezePage:vm}=ce,{takeFullSnapshot:Sm}=ce;exports.EventType=M;exports.IncrementalSource=x;exports.MouseInteractions=F;exports.Replayer=pm;exports.ReplayerEvents=P;exports.addCustomEvent=wm;exports.canvasMutation=Qs;exports.flushCustomEventQueue=bm;exports.freezePage=vm;exports.getVersion=gm;exports.isRecording=ym;exports.record=ce;exports.takeFullSnapshot=Sm;exports.utils=lp;exports.version=mm;
83
83
  if (typeof module.exports == "object" && typeof exports == "object") {
84
84
  var __cp = (to, from, except, desc) => {
85
85
  if ((from && typeof from === "object") || typeof from === "function") {