@glimt/record 0.0.78 → 0.0.79
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.
- package/dist/record.cjs +8 -0
- package/dist/record.cjs.map +1 -1
- package/dist/record.js +8 -0
- package/dist/record.js.map +1 -1
- package/dist/record.umd.cjs +8 -0
- package/dist/record.umd.cjs.map +2 -2
- package/dist/record.umd.min.cjs +1 -1
- package/dist/record.umd.min.cjs.map +2 -2
- package/package.json +1 -1
package/dist/record.umd.min.cjs
CHANGED
|
@@ -55,7 +55,7 @@ https://www.w3ctech.com/topic/2226`));let l=t(...o);return l.postcssPlugin=e,l.p
|
|
|
55
55
|
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:
|
|
56
56
|
https://www.w3ctech.com/topic/2226`));let l=t(...o);return l.postcssPlugin=e,l.postcssVersion=new ti().version,l}let n;return Object.defineProperty(i,"postcss",{get(){return n||(n=i()),n}}),i.process=function(o,l,a){return k([i(a)]).process(o,l)},i};k.stringify=Nf;k.parse=Ef;k.fromJSON=xf;k.list=Af;k.comment=s=>new Wo(s);k.atRule=s=>new Uo(s);k.decl=s=>new Go(s);k.rule=s=>new Ho(s);k.root=s=>new Vo(s);k.document=s=>new jo(s);k.CssSyntaxError=If;k.Declaration=Go;k.Container=vf;k.Processor=ti;k.Document=jo;k.Comment=Wo;k.Warning=kf;k.AtRule=Uo;k.Result=$f;k.Input=Of;k.Rule=Ho;k.Root=Vo;k.Node=Rf;Mf.registerPostcss(k);var Tf=k;k.default=k;const P=Vc(Tf);P.stringify;P.fromJSON;P.plugin;P.parse;P.list;P.document;P.comment;P.atRule;P.rule;P.decl;P.root;P.CssSyntaxError;P.Declaration;P.Container;P.Processor;P.Document;P.Comment;P.Warning;P.AtRule;P.Result;P.Input;P.Rule;P.Root;P.Node;class ri{constructor(...e){te(this,"parentElement",null),te(this,"parentNode",null),te(this,"ownerDocument"),te(this,"firstChild",null),te(this,"lastChild",null),te(this,"previousSibling",null),te(this,"nextSibling",null),te(this,"ELEMENT_NODE",1),te(this,"TEXT_NODE",3),te(this,"nodeType"),te(this,"nodeName"),te(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 ri){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"}}function J(s,e,t=document){const r={capture:!0,passive:!0};return t.addEventListener(s,e,r),()=>t.removeEventListener(s,e,r)}const ze=`Please stop import mirror directly. Instead of that,\r
|
|
57
57
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
58
|
-
or you can use record.mirror to access the mirror instance during recording.`;let Xi={map:{},getId(){return console.error(ze),-1},getNode(){return console.error(ze),null},removeNodeFromMap(){console.error(ze)},has(){return console.error(ze),!1},reset(){console.error(ze)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(Xi=new Proxy(Xi,{get(s,e,t){return e==="map"&&console.error(ze),Reflect.get(s,e,t)}}));function It(s,e,t={}){let r=null,i=0;return function(...n){const o=Date.now();!i&&t.leading===!1&&(i=o);const l=e-(o-i),a=this;l<=0||l>e?(r&&(clearTimeout(r),r=null),i=o,s.apply(a,n)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{i=t.leading===!1?0:Date.now(),r=null,s.apply(a,n)},l))}}function Fr(s,e,t,r,i=window){const n=i.Object.getOwnPropertyDescriptor(s,e);return i.Object.defineProperty(s,e,r?t:{set(o){setTimeout(()=>{t.set.call(this,o)},0),n&&n.set&&n.set.call(this,o)}}),()=>Fr(s,e,n||{},!0)}let Or=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Or=()=>new Date().getTime());function Yo(s){var e,t,r,i;const n=s.document;return{left:n.scrollingElement?n.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:n.documentElement.scrollLeft||(n==null?void 0:n.body)&&((e=x.parentElement(n.body))==null?void 0:e.scrollLeft)||((t=n==null?void 0:n.body)==null?void 0:t.scrollLeft)||0,top:n.scrollingElement?n.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:(n==null?void 0:n.documentElement.scrollTop)||(n==null?void 0:n.body)&&((r=x.parentElement(n.body))==null?void 0:r.scrollTop)||((i=n==null?void 0:n.body)==null?void 0:i.scrollTop)||0}}function Zo(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Jo(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Xo(s){return s?s.nodeType===s.ELEMENT_NODE?s:x.parentElement(s):null}function X(s,e,t,r){if(!s)return!1;const i=Xo(s);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(gr(i,e,r))return!0}catch(n){}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function _f(s,e){return e.getId(s)!==-1}function Qr(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===pt}function Ko(s,e){if(lt(s))return!1;const t=e.getId(s);if(!e.has(t))return!0;const r=x.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?Ko(r,e):!0}function $s(s){return!!s.changedTouches}function Lf(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 qo(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function Qo(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function Ns(s){return s?s instanceof ri&&"shadowRoot"in s?!!s.shadowRoot:!!x.shadowRoot(s):!1}class Df{constructor(){y(this,"id",1),y(this,"styleIDMap",new WeakMap),y(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 ea(s){var e;let t=null;return"getRootNode"in s&&((e=x.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&x.host(x.getRootNode(s))&&(t=x.host(x.getRootNode(s))),t}function Pf(s){let e=s,t;for(;t=ea(e);)e=t;return e}function Ff(s){const e=s.ownerDocument;if(!e)return!1;const t=Pf(s);return x.contains(e,t)}function ta(s){const e=s.ownerDocument;return e?x.contains(e,s)||Ff(s):!1}const ht=()=>"_rrweb_is_debug"in window&&window._rrweb_is_debug?window._rrweb_is_debug:!1,Y=(...s)=>{ht()&&console.log("[recapt:rrweb]",...s)},Ki="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function Bf(s=8){let e="";for(let t=0;t<s;t++)e+=Ki.charAt(Math.floor(Math.random()*Ki.length));return e}let ft;function zf(s){ft=s}function Uf(){ft=void 0}const A=s=>ft?(...t)=>{try{return s(...t)}catch(r){if(ft&&ft(r)===!0)return;throw r}}:s;class qi{constructor(e){y(this,"iframeIdToRemoteIdMap",new WeakMap),y(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){const n=r||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e);let l=n.get(t);return l||(l=this.generateIdFn(),n.set(t,l),o.set(l,t)),l}getIds(e,t){const r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(n=>this.getId(e,n,r,i))}getRemoteId(e,t,r){const i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;const n=i.get(t);return n||-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 Wf{constructor(e){y(this,"iframes",new WeakMap),y(this,"crossOriginIframeMap",new WeakMap),y(this,"crossOriginIframeMirror",new qi(vn)),y(this,"crossOriginIframeStyleMirror"),y(this,"crossOriginIframeRootIdMap",new WeakMap),y(this,"mirror"),y(this,"mutationCb"),y(this,"wrappedEmit"),y(this,"loadListener"),y(this,"stylesheetManager"),y(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new qi(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 n=this.transformCrossOriginEvent(i,t.data.event);n&&this.wrappedEmit(n,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:I.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 I.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(i.node,n)}),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 I.Drag:case I.TouchMove:case I.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case I.ViewportResize:return!1;case I.MediaInteraction:case I.MouseInteraction:case I.Scroll:case I.CanvasMutation:case I.Input:return this.replaceIds(t.data,e,["id"]),t;case I.StyleSheetRule:case I.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case I.Font:return t;case I.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case I.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 n of i)!Array.isArray(t[n])&&typeof t[n]!="number"||(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):t[n]=e.getId(r,t[n]));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!==hn.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}}const ra=class ur{constructor(){if(y(this,"docsObservers",new WeakSet),y(this,"shadowRootsObservers",new WeakSet),y(this,"mutationOptions"),y(this,"emitter",null),ur.instance)return ur.instance;ur.instance=this}setEmitter(e){this.emitter=e}setMutationOptions(e){this.mutationOptions=e}get usable(){const e=this.emitter!=null;return e||Y("observerManager: emitter is null"),e}serializeDoc(e){var t,r,i;if(!((t=this.mutationOptions)!=null&&t.mirror))return null;const n=$e(e,ee(O({},this.mutationOptions),{doc:e,skipChild:!1,maskTextFn:(r=this.mutationOptions)==null?void 0:r.maskTextFn,maskInputFn:(i=this.mutationOptions)==null?void 0:i.maskInputFn}));return n||(Y("snapshotDoc: no serialized node"),null)}emitDoc(e){!this.emitter||!e||this.emitter({type:M.FullSnapshot,data:{node:e,initialOffset:{left:0,top:0}}})}emitShadowRoot(e,t){var r;if(!this.emitter||!e||!((r=this.mutationOptions)!=null&&r.mirror))return;const i=this.mutationOptions.mirror.getId(t.host),n=this.mutationOptions.mirror.getId(t);this.emitter({type:M.IncrementalSnapshot,data:{source:I.Mutation,adds:[{parentId:i,nextId:null,node:e}],removes:[{id:n,parentId:i}],attributes:[],texts:[]}})}serializeAndEmitDoc(e){const t=this.serializeDoc(e);this.emitDoc(t)}serializeAndEmitShadowRoot(e){const t=this.serializeDoc(e.ownerDocument);this.emitShadowRoot(t,e)}onDocObserver(e){return this.usable?this.docsObservers.has(e)?(Y("onDocObserver: doc already observed, emitting full snapshot for doc",e),this.serializeAndEmitDoc(e),!1):(this.docsObservers.add(e),!0):!1}onShadowRootObserver(e){return this.usable?this.shadowRootsObservers.has(e)?(Y("onShadowRootObserver: shadowRoot already observed, emitting full snapshot for shadowRoot",e),this.serializeAndEmitShadowRoot(e),!1):(this.shadowRootsObservers.add(e),!0):!1}destroy(){this.docsObservers=new WeakSet,this.shadowRootsObservers=new WeakSet}};y(ra,"instance");let Gf=ra;const ot=new Gf,sa=class cr{constructor(){if(y(this,"mutTracker"),y(this,"exitMutTracker"),y(this,"interval",50),y(this,"exitInterval",100),y(this,"mutThreshold",100),y(this,"inGlobalStorm",!1),y(this,"currentStormStartedAt",-1),y(this,"stormTimeLimit",5e3),y(this,"debounceTimeout",null),y(this,"debounceTimeoutMs",250),y(this,"handleStormFinishMethods",{}),cr.instance)return cr.instance;cr.instance=this,Y("MutationRateLimiter, init"),this.reset()}resetTracker(){this.mutTracker={muts:0,ts:-1}}resetExitTracker(){this.exitMutTracker={muts:0,requested:-1}}reset(){this.resetTracker(),this.resetExitTracker(),this.currentStormStartedAt=-1}stormStopped(e){this.debounceTimeout&&clearTimeout(this.debounceTimeout),this.inGlobalStorm=!1,this.reset();for(const[t,r]of Object.entries(this.handleStormFinishMethods))t!==e&&r();this.handleStormFinishMethods={}}handleStormExit(e,t){const r=Date.now();if(this.exitMutTracker.requested===-1)this.exitMutTracker={requested:r,muts:e};else if(this.exitMutTracker.muts+=e,r-this.exitMutTracker.requested>this.exitInterval)return this.exitMutTracker.muts>=this.mutThreshold?(Y("MutationRateLimiter, exit cooldown failed, continuing with storm",{mutTracker:this.mutTracker,exitMutTracker:this.exitMutTracker}),this.mutTracker.ts=r,this.mutTracker.muts+=this.exitMutTracker.muts,this.resetExitTracker(),!0):(Y("MutationRateLimiter, detected global storm exit.",{mutTracker:this.mutTracker,exitMutTracker:this.exitMutTracker}),this.stormStopped(t),!1);return!0}isInGlobalStorm(){return this.inGlobalStorm}doDebounce(){this.debounceTimeout&&clearTimeout(this.debounceTimeout),this.inGlobalStorm&&(this.debounceTimeout=setTimeout(()=>{this.debounceTimeout=null,Y("MutationRateLimiter, stopping storm because of debounce"),this.stormStopped()},this.debounceTimeoutMs))}isStorming(e,t){t.bufId in this.handleStormFinishMethods||(this.handleStormFinishMethods[t.bufId]=t.handleStormFinish.bind(t));const r=Date.now();if(this.inGlobalStorm)return this.doDebounce(),r-this.currentStormStartedAt>this.stormTimeLimit?(Y("MutationRateLimiter, storm time limit reached, stopping storm"),this.stormStopped(t.bufId),!1):r-this.mutTracker.ts>this.interval?this.handleStormExit(e,t.bufId):(this.mutTracker.muts+=e,this.mutTracker.ts=r,!0);if(this.mutTracker.ts===-1)this.mutTracker.muts=e;else if(r-this.mutTracker.ts<=this.interval&&(this.mutTracker.muts+=e,this.mutTracker.muts>=this.mutThreshold))return this.inGlobalStorm=!0,Y("MutationRateLimiter, detected global rolling storm"),this.currentStormStartedAt=r,this.doDebounce(),!0;return this.mutTracker.ts=r,!1}};y(sa,"instance");let jf=sa;const Qi=new jf,ia=class hr{constructor(){if(y(this,"lastFullSnapshot",-1),y(this,"intervalBetweenSnapshots",150),y(this,"debounceTimeout",null),y(this,"debounceTime",10),hr.instance)return hr.instance;hr.instance=this}requestFullSnapshot(){this.debounceTimeout&&clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout(()=>{this.debounceTimeout=null,this.takeSnapshot()},this.debounceTime)}takeSnapshot(){if(Date.now()-this.lastFullSnapshot<this.intervalBetweenSnapshots){Y("StormSnapshotManager, takeSnapshot: too soon");return}Y("StormSnapshotManager, takeSnapshot: taking full snapshot"),vd(),this.lastFullSnapshot=Date.now()}};y(ia,"instance");let Vf=ia;const Hf=new Vf;function en(s){return"__ln"in s}class Yf{constructor(){y(this,"length",0),y(this,"head",null),y(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&&en(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&&en(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 tn=(s,e)=>`${s}@${e}`;class Zf{constructor(){y(this,"frozen",!1),y(this,"locked",!1),y(this,"texts",[]),y(this,"attributes",[]),y(this,"attributeMap",new WeakMap),y(this,"removes",[]),y(this,"mapRemoves",[]),y(this,"movedMap",{}),y(this,"addedSet",new Set),y(this,"movedSet",new Set),y(this,"droppedSet",new Set),y(this,"removesSubTreeCache",new Set),y(this,"mutationCb"),y(this,"blockClass"),y(this,"blockSelector"),y(this,"maskTextClass"),y(this,"maskTextSelector"),y(this,"inlineStylesheet"),y(this,"maskInputOptions"),y(this,"maskTextFn"),y(this,"maskInputFn"),y(this,"keepIframeSrcFn"),y(this,"recordCanvas"),y(this,"inlineImages"),y(this,"slimDOMOptions"),y(this,"dataURLOptions"),y(this,"doc"),y(this,"mirror"),y(this,"iframeManager"),y(this,"stylesheetManager"),y(this,"shadowDomManager"),y(this,"canvasManager"),y(this,"processedNodeManager"),y(this,"unattachedDoc"),y(this,"bufId",Bf()),y(this,"stormBatches",[]),y(this,"stormInfo",null),y(this,"stormSettings",{batchSize:50,timeout:50,mutationLimit:800}),y(this,"debounceStormFinish",()=>{this.stormInfo&&(Qi.isInGlobalStorm()||(this.stormInfo.timeout=setTimeout(this.handleStormFinish,this.stormSettings.timeout)))}),y(this,"handleStormMutations",(e,t=!0)=>{const r=Date.now();this.stormInfo==null&&(Y("detected probable mutation storm start","buffer id:",this.bufId),this.stormInfo={startedAt:r,totalMutations:0,stormExceededLimit:!1},t&&this.debounceStormFinish()),this.stormInfo.totalMutations+=e.length,this.stormInfo.totalMutations>=this.stormSettings.mutationLimit?(this.stormInfo.stormExceededLimit=!0,this.stormBatches=[]):this.stormBatches.push({ts:r,mutations:e}),clearTimeout(this.stormInfo.timeout),t&&e.length<this.stormSettings.batchSize?this.handleStormFinish():this.debounceStormFinish()}),y(this,"handleStormFinish",()=>{if(!this.stormInfo)return;const{stormExceededLimit:e}=this.stormInfo;if(Y("mutation storm finished","totalMutations:",this.stormInfo.totalMutations,"stormExceededLimit:",e,"storm duration:",Date.now()-this.stormInfo.startedAt,"ms","buffer id:",this.bufId),clearTimeout(this.stormInfo.timeout),this.stormInfo=null,e)this.stormBatches=[],Hf.requestFullSnapshot();else{let t=[];for(const r of this.stormBatches)t.push(...r.mutations);this.stormBatches=[],this.processInternalMutations(t,!0)}}),y(this,"processInternalMutations",(e,t=!1)=>{if(!t){if(Qi.isStorming(e.length,this)){this.handleStormMutations(e,!1);return}(this.stormInfo!=null||e.length>=this.stormSettings.batchSize)&&this.handleStormMutations(e);return}for(const r of e)this.processMutation(r);this.emit()}),y(this,"processMutations",e=>{this.processInternalMutations(e)}),y(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new Yf,i=u=>{let h=u,f=pt;for(;f===pt;)h=h&&h.nextSibling,f=h&&this.mirror.getId(h);return f},n=u=>{const h=x.parentNode(u);if(!h||!ta(u))return;let f=!1;if(u.nodeType===Node.TEXT_NODE){const d=h.tagName;if(d==="TEXTAREA")return;d==="STYLE"&&this.addedSet.has(h)&&(f=!0)}const p=lt(h)?this.mirror.getId(ea(u)):this.mirror.getId(h),g=i(u);if(p===-1||g===-1)return r.addNode(u);const m=$e(u,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:d=>{qo(d,this.mirror)&&this.iframeManager.addIframe(d),Qo(d,this.mirror)&&this.stylesheetManager.trackLinkElement(d),Ns(u)&&this.shadowDomManager.addShadowRoot(x.shadowRoot(u),this.doc)},onIframeLoad:(d,w)=>{this.iframeManager.attachIframe(d,w),this.shadowDomManager.observeAttachShadow(d)},onStylesheetLoad:(d,w)=>{this.stylesheetManager.attachLinkElement(d,w)},cssCaptured:f});m&&(e.push({parentId:p,nextId:g,node:m}),t.add(m.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const u of this.movedSet)rn(this.removesSubTreeCache,u,this.mirror)&&!this.movedSet.has(x.parentNode(u))||n(u);for(const u of this.addedSet)!sn(this.droppedSet,u)&&!rn(this.removesSubTreeCache,u,this.mirror)||sn(this.movedSet,u)?n(u):this.droppedSet.add(u);let o=null;for(;r.length;){let u=null;if(o){const h=this.mirror.getId(x.parentNode(o.value)),f=i(o.value);h!==-1&&f!==-1&&(u=o)}if(!u){let h=r.tail;for(;h;){const f=h;if(h=h.previous,f){const p=this.mirror.getId(x.parentNode(f.value));if(i(f.value)===-1)continue;if(p!==-1){u=f;break}else{const m=f.value,d=x.parentNode(m);if(d&&d.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const w=x.host(d);if(this.mirror.getId(w)!==-1){u=f;break}}}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}o=u.previous,r.removeNode(u.value),n(u.value)}const l=[];for(const u of this.texts){const h=u.node,f=x.parentNode(h);f&&f.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(f);const p=this.mirror.getId(h);!t.has(p)&&this.mirror.has(p)&&l.push({id:p,value:u.value})}const a=[];for(const u of this.attributes){const{attributes:h}=u;if(typeof h.style=="string"){const p=JSON.stringify(u.styleDiff),g=JSON.stringify(u._unchangedStyles);p.length<h.style.length&&(p+g).split("var(").length===h.style.split("var(").length&&(h.style=u.styleDiff)}const f=this.mirror.getId(u.node);!t.has(f)&&this.mirror.has(f)&&a.push({id:f,attributes:h})}const c={texts:l,attributes:a,removes:this.removes,adds:e};!c.texts.length&&!c.attributes.length&&!c.removes.length&&!c.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(c))}),y(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(x.childNodes(e),i=>x.textContent(i)||"").join("");t.attributes.value=dr({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:pr(e),value:r,maskInputFn:this.maskInputFn})}),y(this,"processMutation",e=>{if(!Qr(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=x.textContent(e.target);!X(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:On(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Xo(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){const o=pr(t);i=dr({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(X(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let n=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(n||(n={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e.target,n)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!xn(t.tagName,r))if(n.attributes[r]=In(this.doc,ke(t.tagName),ke(r),i),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(l){this.unattachedDoc=this.doc}const o=this.unattachedDoc.createElement("span");e.oldValue&&o.setAttribute("style",e.oldValue);for(const l of Array.from(t.style)){const a=t.style.getPropertyValue(l),c=t.style.getPropertyPriority(l);a!==o.style.getPropertyValue(l)||c!==o.style.getPropertyPriority(l)?c===""?n.styleDiff[l]=a:n.styleDiff[l]=[a,c]:n._unchangedStyles[l]=[a,c]}for(const l of Array.from(o.style))t.style.getPropertyValue(l)===""&&(n.styleDiff[l]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?n.attributes.rr_open_mode="modal":n.attributes.rr_open_mode="non-modal");break}case"childList":{if(X(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}for(let o=0;o<e.addedNodes.length;o++)this.genAdds(e.addedNodes[o],e.target);const t=lt(e.target)?this.mirror.getId(x.host(e.target)):this.mirror.getId(e.target);if(X(e.target,this.blockClass,this.blockSelector,!1))return;const r=this.addedSet.has(e.target),i=Ko(e.target,this.mirror),n=lt(e.target)&&ut(e.target)?!0:void 0;for(let o=0;o<e.removedNodes.length;o++){const l=e.removedNodes[o],a=this.mirror.getId(l);if(Qr(l,this.mirror,this.slimDOMOptions)||!_f(l,this.mirror))return;this.addedSet.has(l)?(ks(this.addedSet,l),this.droppedSet.add(l)):r&&a===-1||i||(this.movedSet.has(l)&&this.movedMap[tn(a,t)]?ks(this.movedSet,l):(this.removes.push({parentId:t,id:a,isShadow:n}),Jf(l,this.removesSubTreeCache))),this.mapRemoves.push(l)}break}}}),y(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Qr(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[tn(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);if(!X(e,this.blockClass,this.blockSelector,!1)){const r=x.childNodes(e);for(let i=0;i<r.length;i++)this.genAdds(r[i]);if(Ns(e)){const i=x.childNodes(x.shadowRoot(e));for(let n=0;n<i.length;n++){const o=i[n];this.processedNodeManager.add(o,this),this.genAdds(o,e)}}}}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function ks(s,e){s.delete(e);const t=x.childNodes(e);for(let r=0;r<t.length;r++)ks(s,t[r])}function Jf(s,e){const t=[s];for(;t.length;){const r=t.pop();if(e.has(r))continue;e.add(r);const i=x.childNodes(r);for(let n=0;n<i.length;n++)t.push(i[n])}}function rn(s,e,t){return s.size===0?!1:Xf(s,e)}function Xf(s,e,t){const r=x.parentNode(e);return r?s.has(r):!1}function sn(s,e){return s.size===0?!1:na(s,e)}function na(s,e){const t=x.parentNode(e);return t?s.has(t)?!0:na(s,t):!1}const Ne=[];function Rt(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 oa(s,e){const t=new Zf;Ne.push(t),t.init(s);const r=new(dn())(A(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function Kf({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};const i=typeof e.mousemove=="number"?e.mousemove:50,n=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let o=[],l;const a=It(A(h=>{const f=Date.now()-l;s(o.map(p=>(p.timeOffset-=f,p)),h),o=[],l=null}),n),c=A(It(A(h=>{const f=Rt(h),{clientX:p,clientY:g}=$s(h)?h.changedTouches[0]:h;l||(l=Or()),o.push({x:p,y:g,id:r.getId(f),timeOffset:Or()-l}),a(typeof DragEvent!="undefined"&&h instanceof DragEvent?I.Drag:h instanceof MouseEvent?I.MouseMove:I.TouchMove)}),i,{trailing:!1})),u=[J("mousemove",c,t),J("touchmove",c,t),J("drag",c,t)];return A(()=>{u.forEach(h=>h())})}function qf({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){if(n.mouseInteraction===!1)return()=>{};const o=n.mouseInteraction===!0||n.mouseInteraction===void 0?{}:n.mouseInteraction,l=[];let a=null;const c=u=>h=>{const f=Rt(h);if(X(f,r,i,!0))return;let p=null,g=u;if("pointerType"in h){switch(h.pointerType){case"mouse":p=ye.Mouse;break;case"touch":p=ye.Touch;break;case"pen":p=ye.Pen;break}p===ye.Touch?q[u]===q.MouseDown?g="TouchStart":q[u]===q.MouseUp&&(g="TouchEnd"):ye.Pen}else $s(h)&&(p=ye.Touch);p!==null?(a=p,(g.startsWith("Touch")&&p===ye.Touch||g.startsWith("Mouse")&&p===ye.Mouse)&&(p=null)):q[u]===q.Click&&(p=a,a=null);const m=$s(h)?h.changedTouches[0]:h;if(!m)return;const d=t.getId(f),{clientX:w,clientY:b}=m;A(s)(O({type:q[g],id:d,x:w,y:b},p!==null&&{pointerType:p}))};return Object.keys(q).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&o[u]!==!1).forEach(u=>{let h=ke(u);const f=c(u);if(window.PointerEvent)switch(q[u]){case q.MouseDown:case q.MouseUp:h=h.replace("mouse","pointer");break;case q.TouchStart:case q.TouchEnd:return}l.push(J(h,f,e))}),A(()=>{l.forEach(u=>u())})}function aa({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){const o=A(It(A(l=>{const a=Rt(l);if(!a||X(a,r,i,!0))return;const c=t.getId(a);if(a===e&&e.defaultView){const u=Yo(e.defaultView);s({id:c,x:u.left,y:u.top})}else s({id:c,x:a.scrollLeft,y:a.scrollTop})}),n.scroll||100));return J("scroll",o,e)}function Qf({viewportResizeCb:s},{win:e}){let t=-1,r=-1;const i=A(It(A(()=>{const n=Zo(),o=Jo();(t!==n||r!==o)&&(s({width:Number(o),height:Number(n)}),t=n,r=o)}),200));return J("resize",i,e)}const ed=["INPUT","TEXTAREA","SELECT"],nn=new WeakMap;function td({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:n,ignoreSelector:o,maskInputOptions:l,maskInputFn:a,sampling:c,userTriggeredOnInput:u}){function h(b){let S=Rt(b);const R=b.isTrusted,B=S&&S.tagName;if(S&&B==="OPTION"&&(S=x.parentElement(S)),!S||!B||ed.indexOf(B)<0||X(S,r,i,!0)||S.classList.contains(n)||o&&S.matches(o))return;let U=S.value,G=!1;const L=pr(S)||"";L==="radio"||L==="checkbox"?G=S.checked:(l[B.toLowerCase()]||l[L])&&(U=dr({element:S,maskInputOptions:l,tagName:B,type:L,value:U,maskInputFn:a})),f(S,u?{text:U,isChecked:G,userTriggered:R}:{text:U,isChecked:G});const K=S.name;L==="radio"&&K&&G&&e.querySelectorAll(`input[type="radio"][name="${K}"]`).forEach(j=>{if(j!==S){const Q=j.value;f(j,u?{text:Q,isChecked:!G,userTriggered:!1}:{text:Q,isChecked:!G})}})}function f(b,S){const R=nn.get(b);if(!R||R.text!==S.text||R.isChecked!==S.isChecked){nn.set(b,S);const B=t.getId(b);A(s)(ee(O({},S),{id:B}))}}const g=(c.input==="last"?["change"]:["input","change"]).map(b=>J(b,A(h),e)),m=e.defaultView;if(!m)return()=>{g.forEach(b=>b())};const d=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),w=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return d&&d.set&&g.push(...w.map(b=>Fr(b[0],b[1],{set(){A(h)({target:this,isTrusted:!1})}},!1,m))),A(()=>{g.forEach(b=>b())})}function Mr(s){const e=[];function t(r,i){if(qt("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||qt("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||qt("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||qt("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const o=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(o)}else if(r.parentStyleSheet){const o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(o)}return i}return t(s,e)}function Ie(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function rd({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:A((u,h,f)=>{const[p,g]=f,{id:m,styleId:d}=Ie(h,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,adds:[{rule:p,index:g}]}),u.apply(h,f)})}),r.CSSStyleSheet.prototype.addRule=function(u,h,f=this.cssRules.length){const p=`${u} { ${h} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[p,f])};const n=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(n,{apply:A((u,h,f)=>{const[p]=f,{id:g,styleId:m}=Ie(h,e,t.styleMirror);return(g&&g!==-1||m&&m!==-1)&&s({id:g,styleId:m,removes:[{index:p}]}),u.apply(h,f)})}),r.CSSStyleSheet.prototype.removeRule=function(u){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[u])};let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:A((u,h,f)=>{const[p]=f,{id:g,styleId:m}=Ie(h,e,t.styleMirror);return(g&&g!==-1||m&&m!==-1)&&s({id:g,styleId:m,replace:p}),u.apply(h,f)})}));let l;r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:A((u,h,f)=>{const[p]=f,{id:g,styleId:m}=Ie(h,e,t.styleMirror);return(g&&g!==-1||m&&m!==-1)&&s({id:g,styleId:m,replaceSync:p}),u.apply(h,f)})}));const a={};Qt("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(Qt("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),Qt("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),Qt("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));const c={};return Object.entries(a).forEach(([u,h])=>{c[u]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(c[u].insertRule,{apply:A((f,p,g)=>{const[m,d]=g,{id:w,styleId:b}=Ie(p.parentStyleSheet,e,t.styleMirror);return(w&&w!==-1||b&&b!==-1)&&s({id:w,styleId:b,adds:[{rule:m,index:[...Mr(p),d||0]}]}),f.apply(p,g)})}),h.prototype.deleteRule=new Proxy(c[u].deleteRule,{apply:A((f,p,g)=>{const[m]=g,{id:d,styleId:w}=Ie(p.parentStyleSheet,e,t.styleMirror);return(d&&d!==-1||w&&w!==-1)&&s({id:d,styleId:w,removes:[{index:[...Mr(p),m]}]}),f.apply(p,g)})})}),A(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=n,o&&(r.CSSStyleSheet.prototype.replace=o),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([u,h])=>{h.prototype.insertRule=c[u].insertRule,h.prototype.deleteRule=c[u].deleteRule})})}function la({mirror:s,stylesheetManager:e},t){var r,i,n;let o=null;t.nodeName==="#document"?o=s.getId(t):o=s.getId(x.host(t));const l=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(n=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:n.ShadowRoot,a=l!=null&&l.prototype?Object.getOwnPropertyDescriptor(l==null?void 0:l.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!l||!a?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var c;return(c=a.get)==null?void 0:c.call(this)},set(c){var u;const h=(u=a.set)==null?void 0:u.call(this,c);if(o!==null&&o!==-1)try{e.adoptStyleSheets(c,o)}catch(f){}return h}}),A(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function sd({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){const n=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(n,{apply:A((l,a,c)=>{var u;const[h,f,p]=c;if(t.has(h))return n.apply(a,[h,f,p]);const{id:g,styleId:m}=Ie((u=a.parentRule)==null?void 0:u.parentStyleSheet,e,r.styleMirror);return(g&&g!==-1||m&&m!==-1)&&s({id:g,styleId:m,set:{property:h,value:f,priority:p},index:Mr(a.parentRule)}),l.apply(a,c)})});const o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:A((l,a,c)=>{var u;const[h]=c;if(t.has(h))return o.apply(a,[h]);const{id:f,styleId:p}=Ie((u=a.parentRule)==null?void 0:u.parentStyleSheet,e,r.styleMirror);return(f&&f!==-1||p&&p!==-1)&&s({id:f,styleId:p,remove:{property:h},index:Mr(a.parentRule)}),l.apply(a,c)})}),A(()=>{i.CSSStyleDeclaration.prototype.setProperty=n,i.CSSStyleDeclaration.prototype.removeProperty=o})}function id({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:n}){const o=A(a=>It(A(c=>{const u=Rt(c);if(!u||X(u,e,t,!0))return;const{currentTime:h,volume:f,muted:p,playbackRate:g,loop:m}=u;s({type:a,id:r.getId(u),currentTime:h,volume:f,muted:p,playbackRate:g,loop:m})}),i.media||500)),l=[J("play",o(Be.Play),n),J("pause",o(Be.Pause),n),J("seeked",o(Be.Seeked),n),J("volumechange",o(Be.VolumeChange),n),J("ratechange",o(Be.RateChange),n)];return A(()=>{l.forEach(a=>a())})}function nd({fontCb:s,doc:e}){const t=e.defaultView;if(!t)return()=>{};const r=[],i=new WeakMap,n=t.FontFace;t.FontFace=function(a,c,u){const h=new n(a,c,u);return i.set(h,{family:a,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),h};const o=Te(e.fonts,"add",function(l){return function(a){return setTimeout(A(()=>{const c=i.get(a);c&&(s(c),i.delete(a))}),0),l.apply(this,[a])}});return r.push(()=>{t.FontFace=n}),r.push(o),A(()=>{r.forEach(l=>l())})}function od(s){const{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:n}=s;let o=!0;const l=A(()=>{const a=e.getSelection();if(!a||o&&(a!=null&&a.isCollapsed))return;o=a.isCollapsed||!1;const c=[],u=a.rangeCount||0;for(let h=0;h<u;h++){const f=a.getRangeAt(h),{startContainer:p,startOffset:g,endContainer:m,endOffset:d}=f;X(p,r,i,!0)||X(m,r,i,!0)||c.push({start:t.getId(p),startOffset:g,end:t.getId(m),endOffset:d})}n({ranges:c})});return l(),J("selectionchange",l)}function ad({doc:s,customElementCb:e}){const t=s.defaultView;return!t||!t.customElements?()=>{}:Te(t.customElements,"define",function(i){return function(n,o,l){try{e({define:{name:n}})}catch(a){console.warn(`Custom element callback failed for ${n}`)}return i.apply(this,[n,o,l])}})}function ld(s,e){const{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:n,viewportResizeCb:o,inputCb:l,mediaInteractionCb:a,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:h,fontCb:f,selectionCb:p,customElementCb:g}=s;s.mutationCb=(...m)=>{e.mutation&&e.mutation(...m),t(...m)},s.mousemoveCb=(...m)=>{e.mousemove&&e.mousemove(...m),r(...m)},s.mouseInteractionCb=(...m)=>{e.mouseInteraction&&e.mouseInteraction(...m),i(...m)},s.scrollCb=(...m)=>{e.scroll&&e.scroll(...m),n(...m)},s.viewportResizeCb=(...m)=>{e.viewportResize&&e.viewportResize(...m),o(...m)},s.inputCb=(...m)=>{e.input&&e.input(...m),l(...m)},s.mediaInteractionCb=(...m)=>{e.mediaInteaction&&e.mediaInteaction(...m),a(...m)},s.styleSheetRuleCb=(...m)=>{e.styleSheetRule&&e.styleSheetRule(...m),c(...m)},s.styleDeclarationCb=(...m)=>{e.styleDeclaration&&e.styleDeclaration(...m),u(...m)},s.canvasMutationCb=(...m)=>{e.canvasMutation&&e.canvasMutation(...m),h(...m)},s.fontCb=(...m)=>{e.font&&e.font(...m),f(...m)},s.selectionCb=(...m)=>{e.selection&&e.selection(...m),p(...m)},s.customElementCb=(...m)=>{e.customElement&&e.customElement(...m),g(...m)}}function ud(s,e={}){const t=s.doc.defaultView;if(!t)return()=>{};ld(s,e);let r;s.recordDOM&&(r=oa(s,s.doc));const i=Kf(s),n=qf(s),o=aa(s),l=Qf(s,{win:t}),a=td(s),c=id(s);let u=()=>{},h=()=>{},f=()=>{},p=()=>{};s.recordDOM&&(u=rd(s,{win:t}),h=la(s,s.doc),f=sd(s,{win:t}),s.collectFonts&&(p=nd(s)));const g=od(s),m=ad(s),d=[];for(const w of s.plugins)d.push(w.observer(w.callback,t,w.options));return A(()=>{Ne.forEach(w=>w.reset()),r==null||r.disconnect(),i(),n(),o(),l(),a(),c(),u(),h(),f(),p(),g(),m(),d.forEach(w=>w())})}function qt(s){return typeof window[s]!="undefined"}function Qt(s){return!!(typeof window[s]!="undefined"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}var We="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",cd=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var er=0;er<We.length;er++)cd[We.charCodeAt(er)]=er;var hd=function(s){var e=new Uint8Array(s),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=We[e[t]>>2],i+=We[(e[t]&3)<<4|e[t+1]>>4],i+=We[(e[t+1]&15)<<2|e[t+2]>>6],i+=We[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};const on=new Map;function fd(s,e){let t=on.get(s);return t||(t=new Map,on.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}const ua=(s,e,t)=>{if(!s||!(ha(s,e)||typeof s=="object"))return;const r=s.constructor.name,i=fd(t,r);let n=i.indexOf(s);return n===-1&&(n=i.length,i.push(s)),n};function fr(s,e,t){if(s instanceof Array)return s.map(r=>fr(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=hd(s);return{rr_type:r,base64:i}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[fr(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:[fr(s.data,e,t),s.width,s.height]};if(ha(s,e)||typeof s=="object"){const r=s.constructor.name,i=ua(s,e,t);return{rr_type:r,index:i}}}}return s}const ca=(s,e,t)=>s.map(r=>fr(r,e,t)),ha=(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 dd(s,e,t,r){const i=[],n=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const o of n)try{if(typeof e.CanvasRenderingContext2D.prototype[o]!="function")continue;const l=Te(e.CanvasRenderingContext2D.prototype,o,function(a){return function(...c){return X(this.canvas,t,r,!0)||setTimeout(()=>{const u=ca(c,e,this);s(this.canvas,{type:je["2D"],property:o,args:u})},0),a.apply(this,c)}});i.push(l)}catch(l){const a=Fr(e.CanvasRenderingContext2D.prototype,o,{set(c){s(this.canvas,{type:je["2D"],property:o,args:[c],setter:!0})}});i.push(a)}return()=>{i.forEach(o=>o())}}function pd(s){return s==="experimental-webgl"?"webgl":s}function an(s,e,t,r){const i=[];try{const n=Te(s.HTMLCanvasElement.prototype,"getContext",function(o){return function(l,...a){if(!X(this,e,t,!0)){const c=pd(l);if("__context"in this||(this.__context=c),r&&["webgl","webgl2"].includes(c))if(a[0]&&typeof a[0]=="object"){const u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return o.apply(this,[l,...a])}});i.push(n)}catch(n){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(n=>n())}}function ln(s,e,t,r,i,n){const o=[],l=Object.getOwnPropertyNames(s);for(const a of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if(typeof s[a]!="function")continue;const c=Te(s,a,function(u){return function(...h){const f=u.apply(this,h);if(ua(f,n,this),"tagName"in this.canvas&&!X(this.canvas,r,i,!0)){const p=ca(h,n,this),g={type:e,property:a,args:p};t(this.canvas,g)}return f}});o.push(c)}catch(c){const u=Fr(s,a,{set(h){t(this.canvas,{type:e,property:a,args:[h],setter:!0})}});o.push(u)}return o}function md(s,e,t,r){const i=[];return i.push(...ln(e.WebGLRenderingContext.prototype,je.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext!="undefined"&&i.push(...ln(e.WebGL2RenderingContext.prototype,je.WebGL2,s,t,r,e)),()=>{i.forEach(n=>n())}}const fa="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",gd=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),un=typeof self!="undefined"&&self.Blob&&new Blob([gd(fa)],{type:"text/javascript;charset=utf-8"});function yd(s){let e;try{if(e=un&&(self.URL||self.webkitURL).createObjectURL(un),!e)throw"";const t=new Worker(e,{name:s==null?void 0:s.name});return t.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),t}catch(t){return new Worker("data:text/javascript;base64,"+fa,{name:s==null?void 0:s.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class wd{constructor(e){y(this,"pendingCanvasMutations",new Map),y(this,"rafStamps",{latestId:0,invokeId:null}),y(this,"mirror"),y(this,"mutationCb"),y(this,"resetObservers"),y(this,"frozen",!1),y(this,"locked",!1),y(this,"processMutation",(a,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(c)});const{sampling:t="all",win:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&t==="all"&&this.initCanvasMutationObserver(r,i,n),o&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,i,n,{dataURLOptions:l})}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,n){const o=an(t,r,i,!0),l=new Map,a=new yd;a.onmessage=g=>{const{id:m}=g.data;if(l.set(m,!1),!("base64"in g.data))return;const{base64:d,type:w,width:b,height:S}=g.data;this.mutationCb({id:m,type:je["2D"],commands:[{property:"clearRect",args:[0,0,b,S]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:d}],type:w}]},0,0]}]})};const c=1e3/e;let u=0,h;const f=()=>{const g=[];return t.document.querySelectorAll("canvas").forEach(m=>{X(m,r,i,!0)||g.push(m)}),g},p=g=>{if(u&&g-u<c){h=requestAnimationFrame(p);return}u=g,f().forEach(async m=>{var d;const w=this.mirror.getId(m);if(l.get(w)||m.width===0||m.height===0)return;if(l.set(w,!0),["webgl","webgl2"].includes(m.__context)){const S=m.getContext(m.__context);((d=S==null?void 0:S.getContextAttributes())==null?void 0:d.preserveDrawingBuffer)===!1&&S.clear(S.COLOR_BUFFER_BIT)}const b=await createImageBitmap(m);a.postMessage({id:w,bitmap:b,width:m.width,height:m.height,dataURLOptions:n.dataURLOptions},[b])}),h=requestAnimationFrame(p)};h=requestAnimationFrame(p),this.resetObservers=()=>{o(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=an(e,t,r,!1),n=dd(this.processMutation.bind(this),e,t,r),o=md(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),n(),o()}}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(o=>{const c=o,{type:l}=c;return De(c,["type"])}),{type:n}=r[0];this.mutationCb({id:t,type:n,commands:i}),this.pendingCanvasMutations.delete(e)}}class bd{constructor(){y(this,"nodeMap",new WeakMap),y(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(){}}class Sd{constructor(e){y(this,"shadowDoms",new WeakSet),y(this,"mutationCb"),y(this,"scrollCb"),y(this,"bypassOptions"),y(this,"mirror"),y(this,"restoreHandlers",[]),y(this,"mappedRestoreHandlers",{}),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!ut(e)||!ot.onShadowRootObserver(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e),Y(`Adding mutation observer for shadowRoot ${e.host}`);const r=oa(ee(O({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(aa(ee(O({},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(x.host(e))),this.restoreHandlers.push(la({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(Te(e.prototype,"attachShadow",function(i){return function(n){const o=i.call(this,n),l=x.shadowRoot(this);return l&&ta(this)&&r.addShadowRoot(l,t),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(t){}}),Object.values(this.mappedRestoreHandlers).forEach(e=>{for(const t of e)try{t()}catch(r){}}),this.mappedRestoreHandlers={},this.restoreHandlers=[],this.shadowDoms=new WeakSet}}class Cd{constructor(e){y(this,"trackedLinkElements",new WeakSet),y(this,"mutationCb"),y(this,"adoptedStyleSheetCb"),y(this,"styleMirror",new Df),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 n of e){let o;this.styleMirror.has(n)?o=this.styleMirror.getId(n):(o=this.styleMirror.add(n),i.push({styleId:o,rules:Array.from(n.rules||CSSRule,(l,a)=>({rule:wn(l,n.href),index:a}))})),r.styleIds.push(o)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}let F,at,tr,dt=!1;try{if(Array.from([1],s=>s*2)[0]!==2){const s=document.createElement("iframe");document.body.appendChild(s),Array.from=((li=s.contentWindow)==null?void 0:li.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){ht()&&console.debug("Unable to override Array.from",s)}const re=qa();function Me(s={}){const{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:n=null,ignoreClass:o="rr-ignore",ignoreSelector:l=null,maskTextClass:a="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:h,maskInputOptions:f,slimDOMOptions:p,maskInputFn:g,maskTextFn:m,hooks:d,packFn:w,sampling:b={},dataURLOptions:S={},mousemoveWait:R,recordDOM:B=!0,recordCanvas:U=!1,recordCrossOriginIframes:G=!1,recordAfter:L=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",userTriggeredOnInput:K=!1,collectFonts:j=!1,inlineImages:Q=!1,plugins:oe,keepIframeSrcFn:ae=()=>!1,ignoreCSSAttributes:E=new Set([]),errorHandler:Ke}=s;zf(Ke);const Se=G?window.parent===window:!0;let Ae=!1;if(!Se)try{window.parent.document&&(Ae=!1)}catch($){Ae=!0}if(Se&&!e)throw new Error("emit function is required");if(!Se&&!Ae)return()=>{};R!==void 0&&b.mousemove===void 0&&(b.mousemove=R),re.reset();const V=h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:f!==void 0?f:{password:!0},se=p===!0||p==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:p==="all",headMetaDescKeywords:p==="all",headTitleMutations:p==="all"}:p||{};Lf();let Re,le=0;const Et=$=>{for(const ue of oe||[])ue.eventProcessor&&($=ue.eventProcessor($));return w&&!Ae&&($=w($)),$};F=($,ue)=>{var z;const W=$;if(W.timestamp=Or(),(z=Ne[0])!=null&&z.isFrozen()&&W.type!==M.FullSnapshot&&!(W.type===M.IncrementalSnapshot&&W.data.source===I.Mutation)&&Ne.forEach(de=>de.unfreeze()),Se)e==null||e(Et(W),ue);else if(Ae){const de={type:"rrweb",event:Et(W),origin:window.location.origin,isCheckout:ue};window.parent.postMessage(de,"*")}if(W.type===M.FullSnapshot)Re=W,le=0;else if(W.type===M.IncrementalSnapshot){if(W.data.source===I.Mutation&&W.data.isAttachIframe)return;le++;const de=r&&le>=r,Qe=t&&W.timestamp-Re.timestamp>t;(de||Qe)&&at(!0)}};const fe=$=>{F({type:M.IncrementalSnapshot,data:O({source:I.Mutation},$)})},si=$=>F({type:M.IncrementalSnapshot,data:O({source:I.Scroll},$)}),ii=$=>F({type:M.IncrementalSnapshot,data:O({source:I.CanvasMutation},$)}),da=$=>F({type:M.IncrementalSnapshot,data:O({source:I.AdoptedStyleSheet},$)}),Ce=new Cd({mutationCb:fe,adoptedStyleSheetCb:da}),ve=new Wf({mirror:re,mutationCb:fe,stylesheetManager:Ce,recordCrossOriginIframes:G,wrappedEmit:F});for(const $ of oe||[])$.getMirror&&$.getMirror({nodeMirror:re,crossOriginIframeMirror:ve.crossOriginIframeMirror,crossOriginIframeStyleMirror:ve.crossOriginIframeStyleMirror});const $t=new bd;tr=new wd({recordCanvas:U,mutationCb:ii,win:window,blockClass:i,blockSelector:n,mirror:re,sampling:b.canvas,dataURLOptions:S});const qe=new Sd({mutationCb:fe,scrollCb:si,bypassOptions:{blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:V,dataURLOptions:S,maskTextFn:m,maskInputFn:g,recordCanvas:U,inlineImages:Q,sampling:b,slimDOMOptions:se,iframeManager:ve,stylesheetManager:Ce,canvasManager:tr,keepIframeSrcFn:ae,processedNodeManager:$t},mirror:re});ot.setEmitter(F),ot.setMutationOptions({blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:V,maskTextFn:m,maskInputFn:g,slimDOMOptions:se,dataURLOptions:S,canvasManager:tr,stylesheetManager:Ce,shadowDomManager:qe,recordCanvas:U,inlineImages:Q,mirror:re,iframeManager:ve,keepIframeSrcFn:ae,mutationCb:fe,processedNodeManager:$t}),at=($=!1)=>{if(!B)return;F({type:M.Meta,data:{href:window.location.href,width:Jo(),height:Zo()}},$),Ce.reset(),qe.init(),Ne.forEach(z=>z.lock());const ue=Pl(document,{mirror:re,blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:V,maskTextFn:m,maskInputFn:g,slimDOM:se,dataURLOptions:S,recordCanvas:U,inlineImages:Q,onSerialize:z=>{qo(z,re)&&ve.addIframe(z),Qo(z,re)&&Ce.trackLinkElement(z),Ns(z)&&qe.addShadowRoot(x.shadowRoot(z),document)},onIframeLoad:(z,W)=>{ve.attachIframe(z,W),qe.observeAttachShadow(z)},onStylesheetLoad:(z,W)=>{Ce.attachLinkElement(z,W)},keepIframeSrcFn:ae});if(!ue){ht()&&console.warn("Failed to snapshot the document");return}F({type:M.FullSnapshot,data:{node:ue,initialOffset:Yo(window)}},$),Ne.forEach(z=>z.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Ce.adoptStyleSheets(document.adoptedStyleSheets,re.getId(document))};try{const $=[],ue={},z=pe=>{var Nt;return A(ud)({mutationCb:fe,mousemoveCb:(_,Br)=>F({type:M.IncrementalSnapshot,data:{source:Br,positions:_}}),mouseInteractionCb:_=>F({type:M.IncrementalSnapshot,data:O({source:I.MouseInteraction},_)}),scrollCb:si,viewportResizeCb:_=>F({type:M.IncrementalSnapshot,data:O({source:I.ViewportResize},_)}),inputCb:_=>F({type:M.IncrementalSnapshot,data:O({source:I.Input},_)}),mediaInteractionCb:_=>F({type:M.IncrementalSnapshot,data:O({source:I.MediaInteraction},_)}),styleSheetRuleCb:_=>F({type:M.IncrementalSnapshot,data:O({source:I.StyleSheetRule},_)}),styleDeclarationCb:_=>F({type:M.IncrementalSnapshot,data:O({source:I.StyleDeclaration},_)}),canvasMutationCb:ii,fontCb:_=>F({type:M.IncrementalSnapshot,data:O({source:I.Font},_)}),selectionCb:_=>{F({type:M.IncrementalSnapshot,data:O({source:I.Selection},_)})},customElementCb:_=>{F({type:M.IncrementalSnapshot,data:O({source:I.CustomElement},_)})},blockClass:i,ignoreClass:o,ignoreSelector:l,maskTextClass:a,maskTextSelector:c,maskInputOptions:V,inlineStylesheet:u,sampling:b,recordDOM:B,recordCanvas:U,inlineImages:Q,userTriggeredOnInput:K,collectFonts:j,doc:pe,maskInputFn:g,maskTextFn:m,keepIframeSrcFn:ae,blockSelector:n,slimDOMOptions:se,dataURLOptions:S,mirror:re,iframeManager:ve,stylesheetManager:Ce,shadowDomManager:qe,processedNodeManager:$t,canvasManager:tr,ignoreCSSAttributes:E,plugins:((Nt=oe==null?void 0:oe.filter(_=>_.observer))==null?void 0:Nt.map(_=>({observer:_.observer,options:_.options,callback:Br=>F({type:M.Plugin,data:{plugin:_.name,payload:Br}})})))||[]},d)};ve.addLoadListener(pe=>{try{if(!ot.onDocObserver(pe.contentDocument))return;Y("Adding mutation observer for iframe",pe),$.push(z(pe.contentDocument))}catch(Nt){ht()&&(console.warn("internal error"),console.warn(Nt))}});let W=null;const de=()=>{W=Date.now(),at(),$.push(z(document)),dt=!0},Qe=()=>{window.removeEventListener("load",Qe),!(!dt||W==null)&&(Date.now()-W<=10||at())};return window.addEventListener("load",Qe),document.readyState==="interactive"||document.readyState==="complete"?(document.readyState==="complete"&&window.removeEventListener("load",Qe),de()):($.push(J("DOMContentLoaded",()=>{F({type:M.DomContentLoaded,data:{}}),L==="DOMContentLoaded"&&de()})),$.push(J("load",()=>{F({type:M.Load,data:{}}),L==="load"&&de()},window))),()=>{$.forEach(pe=>pe()),Object.values(ue).forEach(pe=>pe()),$t.destroy(),ot.destroy(),dt=!1,Uf()}}catch($){ht()&&(console.warn("internal error1"),console.warn($))}}Me.addCustomEvent=(s,e)=>{if(!dt)throw new Error("please add custom event after start recording");F({type:M.Custom,data:{tag:s,payload:e}})};Me.freezePage=()=>{Ne.forEach(s=>s.freeze())};Me.takeFullSnapshot=s=>{if(!dt)throw new Error("please take full snapshot after start recording");at(s)};Me.mirror=re;var cn;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(cn||(cn={}));const{addCustomEvent:rp}=Me,{freezePage:sp}=Me,{takeFullSnapshot:vd}=Me;exports.record=Me;
|
|
58
|
+
or you can use record.mirror to access the mirror instance during recording.`;let Xi={map:{},getId(){return console.error(ze),-1},getNode(){return console.error(ze),null},removeNodeFromMap(){console.error(ze)},has(){return console.error(ze),!1},reset(){console.error(ze)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(Xi=new Proxy(Xi,{get(s,e,t){return e==="map"&&console.error(ze),Reflect.get(s,e,t)}}));function It(s,e,t={}){let r=null,i=0;return function(...n){const o=Date.now();!i&&t.leading===!1&&(i=o);const l=e-(o-i),a=this;l<=0||l>e?(r&&(clearTimeout(r),r=null),i=o,s.apply(a,n)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{i=t.leading===!1?0:Date.now(),r=null,s.apply(a,n)},l))}}function Fr(s,e,t,r,i=window){const n=i.Object.getOwnPropertyDescriptor(s,e);return i.Object.defineProperty(s,e,r?t:{set(o){setTimeout(()=>{t.set.call(this,o)},0),n&&n.set&&n.set.call(this,o)}}),()=>Fr(s,e,n||{},!0)}let Or=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Or=()=>new Date().getTime());function Yo(s){var e,t,r,i;const n=s.document;return{left:n.scrollingElement?n.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:n.documentElement.scrollLeft||(n==null?void 0:n.body)&&((e=x.parentElement(n.body))==null?void 0:e.scrollLeft)||((t=n==null?void 0:n.body)==null?void 0:t.scrollLeft)||0,top:n.scrollingElement?n.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:(n==null?void 0:n.documentElement.scrollTop)||(n==null?void 0:n.body)&&((r=x.parentElement(n.body))==null?void 0:r.scrollTop)||((i=n==null?void 0:n.body)==null?void 0:i.scrollTop)||0}}function Zo(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Jo(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Xo(s){return s?s.nodeType===s.ELEMENT_NODE?s:x.parentElement(s):null}function X(s,e,t,r){if(!s)return!1;const i=Xo(s);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(gr(i,e,r))return!0}catch(n){}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function _f(s,e){return e.getId(s)!==-1}function Qr(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===pt}function Ko(s,e){if(lt(s))return!1;const t=e.getId(s);if(!e.has(t))return!0;const r=x.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?Ko(r,e):!0}function $s(s){return!!s.changedTouches}function Lf(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 qo(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function Qo(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function Ns(s){return s?s instanceof ri&&"shadowRoot"in s?!!s.shadowRoot:!!x.shadowRoot(s):!1}class Df{constructor(){y(this,"id",1),y(this,"styleIDMap",new WeakMap),y(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 ea(s){var e;let t=null;return"getRootNode"in s&&((e=x.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&x.host(x.getRootNode(s))&&(t=x.host(x.getRootNode(s))),t}function Pf(s){let e=s,t;for(;t=ea(e);)e=t;return e}function Ff(s){const e=s.ownerDocument;if(!e)return!1;const t=Pf(s);return x.contains(e,t)}function ta(s){const e=s.ownerDocument;return e?x.contains(e,s)||Ff(s):!1}const ht=()=>"_rrweb_is_debug"in window&&window._rrweb_is_debug?window._rrweb_is_debug:!1,Y=(...s)=>{ht()&&console.log("[recapt:rrweb]",...s)},Ki="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function Bf(s=8){let e="";for(let t=0;t<s;t++)e+=Ki.charAt(Math.floor(Math.random()*Ki.length));return e}let ft;function zf(s){ft=s}function Uf(){ft=void 0}const A=s=>ft?(...t)=>{try{return s(...t)}catch(r){if(ft&&ft(r)===!0)return;throw r}}:s;class qi{constructor(e){y(this,"iframeIdToRemoteIdMap",new WeakMap),y(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){const n=r||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e);let l=n.get(t);return l||(l=this.generateIdFn(),n.set(t,l),o.set(l,t)),l}getIds(e,t){const r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(n=>this.getId(e,n,r,i))}getRemoteId(e,t,r){const i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;const n=i.get(t);return n||-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 Wf{constructor(e){y(this,"iframes",new WeakMap),y(this,"crossOriginIframeMap",new WeakMap),y(this,"crossOriginIframeMirror",new qi(vn)),y(this,"crossOriginIframeStyleMirror"),y(this,"crossOriginIframeRootIdMap",new WeakMap),y(this,"mirror"),y(this,"mutationCb"),y(this,"wrappedEmit"),y(this,"loadListener"),y(this,"stylesheetManager"),y(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new qi(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 n=this.transformCrossOriginEvent(i,t.data.event);n&&this.wrappedEmit(n,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:I.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 I.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(i.node,n)}),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 I.Drag:case I.TouchMove:case I.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case I.ViewportResize:return!1;case I.MediaInteraction:case I.MouseInteraction:case I.Scroll:case I.CanvasMutation:case I.Input:return this.replaceIds(t.data,e,["id"]),t;case I.StyleSheetRule:case I.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case I.Font:return t;case I.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case I.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 n of i)!Array.isArray(t[n])&&typeof t[n]!="number"||(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):t[n]=e.getId(r,t[n]));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!==hn.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}}const ra=class ur{constructor(){if(y(this,"docsObservers",new WeakSet),y(this,"shadowRootsObservers",new WeakSet),y(this,"mutationOptions"),y(this,"emitter",null),y(this,"isSnapshottingShadowRoots",!1),y(this,"isSnapshottingDocs",!1),ur.instance)return ur.instance;ur.instance=this}setEmitter(e){this.emitter=e}setMutationOptions(e){this.mutationOptions=e}get usable(){const e=this.emitter!=null;return e||Y("observerManager: emitter is null"),e}serializeDoc(e){var t,r,i;if(!((t=this.mutationOptions)!=null&&t.mirror))return null;const n=$e(e,ee(O({},this.mutationOptions),{doc:e,skipChild:!1,maskTextFn:(r=this.mutationOptions)==null?void 0:r.maskTextFn,maskInputFn:(i=this.mutationOptions)==null?void 0:i.maskInputFn}));return n||(Y("snapshotDoc: no serialized node"),null)}emitDoc(e){!this.emitter||!e||this.emitter({type:M.FullSnapshot,data:{node:e,initialOffset:{left:0,top:0}}})}emitShadowRoot(e,t){var r;if(!this.emitter||!e||!((r=this.mutationOptions)!=null&&r.mirror))return;const i=this.mutationOptions.mirror.getId(t.host),n=this.mutationOptions.mirror.getId(t);this.emitter({type:M.IncrementalSnapshot,data:{source:I.Mutation,adds:[{parentId:i,nextId:null,node:e}],removes:[{id:n,parentId:i}],attributes:[],texts:[]}})}serializeAndEmitDoc(e){const t=this.serializeDoc(e);this.emitDoc(t)}serializeAndEmitShadowRoot(e){const t=this.serializeDoc(e.ownerDocument);this.emitShadowRoot(t,e)}onDocObserver(e){return this.isSnapshottingDocs||!this.usable?!1:this.docsObservers.has(e)?(Y("onDocObserver: doc already observed, emitting full snapshot for doc",e),this.isSnapshottingDocs=!0,this.serializeAndEmitDoc(e),this.isSnapshottingDocs=!1,!1):(this.docsObservers.add(e),!0)}onShadowRootObserver(e){return this.isSnapshottingShadowRoots||!this.usable?!1:this.shadowRootsObservers.has(e)?(Y("onShadowRootObserver: shadowRoot already observed, emitting full snapshot for shadowRoot",e),this.isSnapshottingShadowRoots=!0,this.serializeAndEmitShadowRoot(e),this.isSnapshottingShadowRoots=!1,!1):(this.shadowRootsObservers.add(e),!0)}destroy(){this.docsObservers=new WeakSet,this.shadowRootsObservers=new WeakSet}};y(ra,"instance");let Gf=ra;const ot=new Gf,sa=class cr{constructor(){if(y(this,"mutTracker"),y(this,"exitMutTracker"),y(this,"interval",50),y(this,"exitInterval",100),y(this,"mutThreshold",100),y(this,"inGlobalStorm",!1),y(this,"currentStormStartedAt",-1),y(this,"stormTimeLimit",5e3),y(this,"debounceTimeout",null),y(this,"debounceTimeoutMs",250),y(this,"handleStormFinishMethods",{}),cr.instance)return cr.instance;cr.instance=this,Y("MutationRateLimiter, init"),this.reset()}resetTracker(){this.mutTracker={muts:0,ts:-1}}resetExitTracker(){this.exitMutTracker={muts:0,requested:-1}}reset(){this.resetTracker(),this.resetExitTracker(),this.currentStormStartedAt=-1}stormStopped(e){this.debounceTimeout&&clearTimeout(this.debounceTimeout),this.inGlobalStorm=!1,this.reset();for(const[t,r]of Object.entries(this.handleStormFinishMethods))t!==e&&r();this.handleStormFinishMethods={}}handleStormExit(e,t){const r=Date.now();if(this.exitMutTracker.requested===-1)this.exitMutTracker={requested:r,muts:e};else if(this.exitMutTracker.muts+=e,r-this.exitMutTracker.requested>this.exitInterval)return this.exitMutTracker.muts>=this.mutThreshold?(Y("MutationRateLimiter, exit cooldown failed, continuing with storm",{mutTracker:this.mutTracker,exitMutTracker:this.exitMutTracker}),this.mutTracker.ts=r,this.mutTracker.muts+=this.exitMutTracker.muts,this.resetExitTracker(),!0):(Y("MutationRateLimiter, detected global storm exit.",{mutTracker:this.mutTracker,exitMutTracker:this.exitMutTracker}),this.stormStopped(t),!1);return!0}isInGlobalStorm(){return this.inGlobalStorm}doDebounce(){this.debounceTimeout&&clearTimeout(this.debounceTimeout),this.inGlobalStorm&&(this.debounceTimeout=setTimeout(()=>{this.debounceTimeout=null,Y("MutationRateLimiter, stopping storm because of debounce"),this.stormStopped()},this.debounceTimeoutMs))}isStorming(e,t){t.bufId in this.handleStormFinishMethods||(this.handleStormFinishMethods[t.bufId]=t.handleStormFinish.bind(t));const r=Date.now();if(this.inGlobalStorm)return this.doDebounce(),r-this.currentStormStartedAt>this.stormTimeLimit?(Y("MutationRateLimiter, storm time limit reached, stopping storm"),this.stormStopped(t.bufId),!1):r-this.mutTracker.ts>this.interval?this.handleStormExit(e,t.bufId):(this.mutTracker.muts+=e,this.mutTracker.ts=r,!0);if(this.mutTracker.ts===-1)this.mutTracker.muts=e;else if(r-this.mutTracker.ts<=this.interval&&(this.mutTracker.muts+=e,this.mutTracker.muts>=this.mutThreshold))return this.inGlobalStorm=!0,Y("MutationRateLimiter, detected global rolling storm"),this.currentStormStartedAt=r,this.doDebounce(),!0;return this.mutTracker.ts=r,!1}};y(sa,"instance");let jf=sa;const Qi=new jf,ia=class hr{constructor(){if(y(this,"lastFullSnapshot",-1),y(this,"intervalBetweenSnapshots",150),y(this,"debounceTimeout",null),y(this,"debounceTime",10),hr.instance)return hr.instance;hr.instance=this}requestFullSnapshot(){this.debounceTimeout&&clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout(()=>{this.debounceTimeout=null,this.takeSnapshot()},this.debounceTime)}takeSnapshot(){if(Date.now()-this.lastFullSnapshot<this.intervalBetweenSnapshots){Y("StormSnapshotManager, takeSnapshot: too soon");return}Y("StormSnapshotManager, takeSnapshot: taking full snapshot"),vd(),this.lastFullSnapshot=Date.now()}};y(ia,"instance");let Vf=ia;const Hf=new Vf;function en(s){return"__ln"in s}class Yf{constructor(){y(this,"length",0),y(this,"head",null),y(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&&en(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&&en(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 tn=(s,e)=>`${s}@${e}`;class Zf{constructor(){y(this,"frozen",!1),y(this,"locked",!1),y(this,"texts",[]),y(this,"attributes",[]),y(this,"attributeMap",new WeakMap),y(this,"removes",[]),y(this,"mapRemoves",[]),y(this,"movedMap",{}),y(this,"addedSet",new Set),y(this,"movedSet",new Set),y(this,"droppedSet",new Set),y(this,"removesSubTreeCache",new Set),y(this,"mutationCb"),y(this,"blockClass"),y(this,"blockSelector"),y(this,"maskTextClass"),y(this,"maskTextSelector"),y(this,"inlineStylesheet"),y(this,"maskInputOptions"),y(this,"maskTextFn"),y(this,"maskInputFn"),y(this,"keepIframeSrcFn"),y(this,"recordCanvas"),y(this,"inlineImages"),y(this,"slimDOMOptions"),y(this,"dataURLOptions"),y(this,"doc"),y(this,"mirror"),y(this,"iframeManager"),y(this,"stylesheetManager"),y(this,"shadowDomManager"),y(this,"canvasManager"),y(this,"processedNodeManager"),y(this,"unattachedDoc"),y(this,"bufId",Bf()),y(this,"stormBatches",[]),y(this,"stormInfo",null),y(this,"stormSettings",{batchSize:50,timeout:50,mutationLimit:800}),y(this,"debounceStormFinish",()=>{this.stormInfo&&(Qi.isInGlobalStorm()||(this.stormInfo.timeout=setTimeout(this.handleStormFinish,this.stormSettings.timeout)))}),y(this,"handleStormMutations",(e,t=!0)=>{const r=Date.now();this.stormInfo==null&&(Y("detected probable mutation storm start","buffer id:",this.bufId),this.stormInfo={startedAt:r,totalMutations:0,stormExceededLimit:!1},t&&this.debounceStormFinish()),this.stormInfo.totalMutations+=e.length,this.stormInfo.totalMutations>=this.stormSettings.mutationLimit?(this.stormInfo.stormExceededLimit=!0,this.stormBatches=[]):this.stormBatches.push({ts:r,mutations:e}),clearTimeout(this.stormInfo.timeout),t&&e.length<this.stormSettings.batchSize?this.handleStormFinish():this.debounceStormFinish()}),y(this,"handleStormFinish",()=>{if(!this.stormInfo)return;const{stormExceededLimit:e}=this.stormInfo;if(Y("mutation storm finished","totalMutations:",this.stormInfo.totalMutations,"stormExceededLimit:",e,"storm duration:",Date.now()-this.stormInfo.startedAt,"ms","buffer id:",this.bufId),clearTimeout(this.stormInfo.timeout),this.stormInfo=null,e)this.stormBatches=[],Hf.requestFullSnapshot();else{let t=[];for(const r of this.stormBatches)t.push(...r.mutations);this.stormBatches=[],this.processInternalMutations(t,!0)}}),y(this,"processInternalMutations",(e,t=!1)=>{if(!t){if(Qi.isStorming(e.length,this)){this.handleStormMutations(e,!1);return}(this.stormInfo!=null||e.length>=this.stormSettings.batchSize)&&this.handleStormMutations(e);return}for(const r of e)this.processMutation(r);this.emit()}),y(this,"processMutations",e=>{this.processInternalMutations(e)}),y(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new Yf,i=u=>{let h=u,f=pt;for(;f===pt;)h=h&&h.nextSibling,f=h&&this.mirror.getId(h);return f},n=u=>{const h=x.parentNode(u);if(!h||!ta(u))return;let f=!1;if(u.nodeType===Node.TEXT_NODE){const d=h.tagName;if(d==="TEXTAREA")return;d==="STYLE"&&this.addedSet.has(h)&&(f=!0)}const p=lt(h)?this.mirror.getId(ea(u)):this.mirror.getId(h),g=i(u);if(p===-1||g===-1)return r.addNode(u);const m=$e(u,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:d=>{qo(d,this.mirror)&&this.iframeManager.addIframe(d),Qo(d,this.mirror)&&this.stylesheetManager.trackLinkElement(d),Ns(u)&&this.shadowDomManager.addShadowRoot(x.shadowRoot(u),this.doc)},onIframeLoad:(d,w)=>{this.iframeManager.attachIframe(d,w),this.shadowDomManager.observeAttachShadow(d)},onStylesheetLoad:(d,w)=>{this.stylesheetManager.attachLinkElement(d,w)},cssCaptured:f});m&&(e.push({parentId:p,nextId:g,node:m}),t.add(m.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const u of this.movedSet)rn(this.removesSubTreeCache,u,this.mirror)&&!this.movedSet.has(x.parentNode(u))||n(u);for(const u of this.addedSet)!sn(this.droppedSet,u)&&!rn(this.removesSubTreeCache,u,this.mirror)||sn(this.movedSet,u)?n(u):this.droppedSet.add(u);let o=null;for(;r.length;){let u=null;if(o){const h=this.mirror.getId(x.parentNode(o.value)),f=i(o.value);h!==-1&&f!==-1&&(u=o)}if(!u){let h=r.tail;for(;h;){const f=h;if(h=h.previous,f){const p=this.mirror.getId(x.parentNode(f.value));if(i(f.value)===-1)continue;if(p!==-1){u=f;break}else{const m=f.value,d=x.parentNode(m);if(d&&d.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const w=x.host(d);if(this.mirror.getId(w)!==-1){u=f;break}}}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}o=u.previous,r.removeNode(u.value),n(u.value)}const l=[];for(const u of this.texts){const h=u.node,f=x.parentNode(h);f&&f.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(f);const p=this.mirror.getId(h);!t.has(p)&&this.mirror.has(p)&&l.push({id:p,value:u.value})}const a=[];for(const u of this.attributes){const{attributes:h}=u;if(typeof h.style=="string"){const p=JSON.stringify(u.styleDiff),g=JSON.stringify(u._unchangedStyles);p.length<h.style.length&&(p+g).split("var(").length===h.style.split("var(").length&&(h.style=u.styleDiff)}const f=this.mirror.getId(u.node);!t.has(f)&&this.mirror.has(f)&&a.push({id:f,attributes:h})}const c={texts:l,attributes:a,removes:this.removes,adds:e};!c.texts.length&&!c.attributes.length&&!c.removes.length&&!c.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(c))}),y(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(x.childNodes(e),i=>x.textContent(i)||"").join("");t.attributes.value=dr({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:pr(e),value:r,maskInputFn:this.maskInputFn})}),y(this,"processMutation",e=>{if(!Qr(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=x.textContent(e.target);!X(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:On(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Xo(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){const o=pr(t);i=dr({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(X(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let n=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(n||(n={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e.target,n)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!xn(t.tagName,r))if(n.attributes[r]=In(this.doc,ke(t.tagName),ke(r),i),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(l){this.unattachedDoc=this.doc}const o=this.unattachedDoc.createElement("span");e.oldValue&&o.setAttribute("style",e.oldValue);for(const l of Array.from(t.style)){const a=t.style.getPropertyValue(l),c=t.style.getPropertyPriority(l);a!==o.style.getPropertyValue(l)||c!==o.style.getPropertyPriority(l)?c===""?n.styleDiff[l]=a:n.styleDiff[l]=[a,c]:n._unchangedStyles[l]=[a,c]}for(const l of Array.from(o.style))t.style.getPropertyValue(l)===""&&(n.styleDiff[l]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?n.attributes.rr_open_mode="modal":n.attributes.rr_open_mode="non-modal");break}case"childList":{if(X(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}for(let o=0;o<e.addedNodes.length;o++)this.genAdds(e.addedNodes[o],e.target);const t=lt(e.target)?this.mirror.getId(x.host(e.target)):this.mirror.getId(e.target);if(X(e.target,this.blockClass,this.blockSelector,!1))return;const r=this.addedSet.has(e.target),i=Ko(e.target,this.mirror),n=lt(e.target)&&ut(e.target)?!0:void 0;for(let o=0;o<e.removedNodes.length;o++){const l=e.removedNodes[o],a=this.mirror.getId(l);if(Qr(l,this.mirror,this.slimDOMOptions)||!_f(l,this.mirror))return;this.addedSet.has(l)?(ks(this.addedSet,l),this.droppedSet.add(l)):r&&a===-1||i||(this.movedSet.has(l)&&this.movedMap[tn(a,t)]?ks(this.movedSet,l):(this.removes.push({parentId:t,id:a,isShadow:n}),Jf(l,this.removesSubTreeCache))),this.mapRemoves.push(l)}break}}}),y(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Qr(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[tn(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);if(!X(e,this.blockClass,this.blockSelector,!1)){const r=x.childNodes(e);for(let i=0;i<r.length;i++)this.genAdds(r[i]);if(Ns(e)){const i=x.childNodes(x.shadowRoot(e));for(let n=0;n<i.length;n++){const o=i[n];this.processedNodeManager.add(o,this),this.genAdds(o,e)}}}}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function ks(s,e){s.delete(e);const t=x.childNodes(e);for(let r=0;r<t.length;r++)ks(s,t[r])}function Jf(s,e){const t=[s];for(;t.length;){const r=t.pop();if(e.has(r))continue;e.add(r);const i=x.childNodes(r);for(let n=0;n<i.length;n++)t.push(i[n])}}function rn(s,e,t){return s.size===0?!1:Xf(s,e)}function Xf(s,e,t){const r=x.parentNode(e);return r?s.has(r):!1}function sn(s,e){return s.size===0?!1:na(s,e)}function na(s,e){const t=x.parentNode(e);return t?s.has(t)?!0:na(s,t):!1}const Ne=[];function Rt(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 oa(s,e){const t=new Zf;Ne.push(t),t.init(s);const r=new(dn())(A(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function Kf({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};const i=typeof e.mousemove=="number"?e.mousemove:50,n=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let o=[],l;const a=It(A(h=>{const f=Date.now()-l;s(o.map(p=>(p.timeOffset-=f,p)),h),o=[],l=null}),n),c=A(It(A(h=>{const f=Rt(h),{clientX:p,clientY:g}=$s(h)?h.changedTouches[0]:h;l||(l=Or()),o.push({x:p,y:g,id:r.getId(f),timeOffset:Or()-l}),a(typeof DragEvent!="undefined"&&h instanceof DragEvent?I.Drag:h instanceof MouseEvent?I.MouseMove:I.TouchMove)}),i,{trailing:!1})),u=[J("mousemove",c,t),J("touchmove",c,t),J("drag",c,t)];return A(()=>{u.forEach(h=>h())})}function qf({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){if(n.mouseInteraction===!1)return()=>{};const o=n.mouseInteraction===!0||n.mouseInteraction===void 0?{}:n.mouseInteraction,l=[];let a=null;const c=u=>h=>{const f=Rt(h);if(X(f,r,i,!0))return;let p=null,g=u;if("pointerType"in h){switch(h.pointerType){case"mouse":p=ye.Mouse;break;case"touch":p=ye.Touch;break;case"pen":p=ye.Pen;break}p===ye.Touch?q[u]===q.MouseDown?g="TouchStart":q[u]===q.MouseUp&&(g="TouchEnd"):ye.Pen}else $s(h)&&(p=ye.Touch);p!==null?(a=p,(g.startsWith("Touch")&&p===ye.Touch||g.startsWith("Mouse")&&p===ye.Mouse)&&(p=null)):q[u]===q.Click&&(p=a,a=null);const m=$s(h)?h.changedTouches[0]:h;if(!m)return;const d=t.getId(f),{clientX:w,clientY:b}=m;A(s)(O({type:q[g],id:d,x:w,y:b},p!==null&&{pointerType:p}))};return Object.keys(q).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&o[u]!==!1).forEach(u=>{let h=ke(u);const f=c(u);if(window.PointerEvent)switch(q[u]){case q.MouseDown:case q.MouseUp:h=h.replace("mouse","pointer");break;case q.TouchStart:case q.TouchEnd:return}l.push(J(h,f,e))}),A(()=>{l.forEach(u=>u())})}function aa({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){const o=A(It(A(l=>{const a=Rt(l);if(!a||X(a,r,i,!0))return;const c=t.getId(a);if(a===e&&e.defaultView){const u=Yo(e.defaultView);s({id:c,x:u.left,y:u.top})}else s({id:c,x:a.scrollLeft,y:a.scrollTop})}),n.scroll||100));return J("scroll",o,e)}function Qf({viewportResizeCb:s},{win:e}){let t=-1,r=-1;const i=A(It(A(()=>{const n=Zo(),o=Jo();(t!==n||r!==o)&&(s({width:Number(o),height:Number(n)}),t=n,r=o)}),200));return J("resize",i,e)}const ed=["INPUT","TEXTAREA","SELECT"],nn=new WeakMap;function td({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:n,ignoreSelector:o,maskInputOptions:l,maskInputFn:a,sampling:c,userTriggeredOnInput:u}){function h(b){let S=Rt(b);const R=b.isTrusted,B=S&&S.tagName;if(S&&B==="OPTION"&&(S=x.parentElement(S)),!S||!B||ed.indexOf(B)<0||X(S,r,i,!0)||S.classList.contains(n)||o&&S.matches(o))return;let U=S.value,G=!1;const L=pr(S)||"";L==="radio"||L==="checkbox"?G=S.checked:(l[B.toLowerCase()]||l[L])&&(U=dr({element:S,maskInputOptions:l,tagName:B,type:L,value:U,maskInputFn:a})),f(S,u?{text:U,isChecked:G,userTriggered:R}:{text:U,isChecked:G});const K=S.name;L==="radio"&&K&&G&&e.querySelectorAll(`input[type="radio"][name="${K}"]`).forEach(j=>{if(j!==S){const Q=j.value;f(j,u?{text:Q,isChecked:!G,userTriggered:!1}:{text:Q,isChecked:!G})}})}function f(b,S){const R=nn.get(b);if(!R||R.text!==S.text||R.isChecked!==S.isChecked){nn.set(b,S);const B=t.getId(b);A(s)(ee(O({},S),{id:B}))}}const g=(c.input==="last"?["change"]:["input","change"]).map(b=>J(b,A(h),e)),m=e.defaultView;if(!m)return()=>{g.forEach(b=>b())};const d=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),w=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return d&&d.set&&g.push(...w.map(b=>Fr(b[0],b[1],{set(){A(h)({target:this,isTrusted:!1})}},!1,m))),A(()=>{g.forEach(b=>b())})}function Mr(s){const e=[];function t(r,i){if(qt("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||qt("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||qt("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||qt("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const o=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(o)}else if(r.parentStyleSheet){const o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(o)}return i}return t(s,e)}function Ie(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function rd({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:A((u,h,f)=>{const[p,g]=f,{id:m,styleId:d}=Ie(h,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,adds:[{rule:p,index:g}]}),u.apply(h,f)})}),r.CSSStyleSheet.prototype.addRule=function(u,h,f=this.cssRules.length){const p=`${u} { ${h} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[p,f])};const n=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(n,{apply:A((u,h,f)=>{const[p]=f,{id:g,styleId:m}=Ie(h,e,t.styleMirror);return(g&&g!==-1||m&&m!==-1)&&s({id:g,styleId:m,removes:[{index:p}]}),u.apply(h,f)})}),r.CSSStyleSheet.prototype.removeRule=function(u){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[u])};let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:A((u,h,f)=>{const[p]=f,{id:g,styleId:m}=Ie(h,e,t.styleMirror);return(g&&g!==-1||m&&m!==-1)&&s({id:g,styleId:m,replace:p}),u.apply(h,f)})}));let l;r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:A((u,h,f)=>{const[p]=f,{id:g,styleId:m}=Ie(h,e,t.styleMirror);return(g&&g!==-1||m&&m!==-1)&&s({id:g,styleId:m,replaceSync:p}),u.apply(h,f)})}));const a={};Qt("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(Qt("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),Qt("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),Qt("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));const c={};return Object.entries(a).forEach(([u,h])=>{c[u]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(c[u].insertRule,{apply:A((f,p,g)=>{const[m,d]=g,{id:w,styleId:b}=Ie(p.parentStyleSheet,e,t.styleMirror);return(w&&w!==-1||b&&b!==-1)&&s({id:w,styleId:b,adds:[{rule:m,index:[...Mr(p),d||0]}]}),f.apply(p,g)})}),h.prototype.deleteRule=new Proxy(c[u].deleteRule,{apply:A((f,p,g)=>{const[m]=g,{id:d,styleId:w}=Ie(p.parentStyleSheet,e,t.styleMirror);return(d&&d!==-1||w&&w!==-1)&&s({id:d,styleId:w,removes:[{index:[...Mr(p),m]}]}),f.apply(p,g)})})}),A(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=n,o&&(r.CSSStyleSheet.prototype.replace=o),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([u,h])=>{h.prototype.insertRule=c[u].insertRule,h.prototype.deleteRule=c[u].deleteRule})})}function la({mirror:s,stylesheetManager:e},t){var r,i,n;let o=null;t.nodeName==="#document"?o=s.getId(t):o=s.getId(x.host(t));const l=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(n=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:n.ShadowRoot,a=l!=null&&l.prototype?Object.getOwnPropertyDescriptor(l==null?void 0:l.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!l||!a?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var c;return(c=a.get)==null?void 0:c.call(this)},set(c){var u;const h=(u=a.set)==null?void 0:u.call(this,c);if(o!==null&&o!==-1)try{e.adoptStyleSheets(c,o)}catch(f){}return h}}),A(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function sd({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){const n=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(n,{apply:A((l,a,c)=>{var u;const[h,f,p]=c;if(t.has(h))return n.apply(a,[h,f,p]);const{id:g,styleId:m}=Ie((u=a.parentRule)==null?void 0:u.parentStyleSheet,e,r.styleMirror);return(g&&g!==-1||m&&m!==-1)&&s({id:g,styleId:m,set:{property:h,value:f,priority:p},index:Mr(a.parentRule)}),l.apply(a,c)})});const o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:A((l,a,c)=>{var u;const[h]=c;if(t.has(h))return o.apply(a,[h]);const{id:f,styleId:p}=Ie((u=a.parentRule)==null?void 0:u.parentStyleSheet,e,r.styleMirror);return(f&&f!==-1||p&&p!==-1)&&s({id:f,styleId:p,remove:{property:h},index:Mr(a.parentRule)}),l.apply(a,c)})}),A(()=>{i.CSSStyleDeclaration.prototype.setProperty=n,i.CSSStyleDeclaration.prototype.removeProperty=o})}function id({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:n}){const o=A(a=>It(A(c=>{const u=Rt(c);if(!u||X(u,e,t,!0))return;const{currentTime:h,volume:f,muted:p,playbackRate:g,loop:m}=u;s({type:a,id:r.getId(u),currentTime:h,volume:f,muted:p,playbackRate:g,loop:m})}),i.media||500)),l=[J("play",o(Be.Play),n),J("pause",o(Be.Pause),n),J("seeked",o(Be.Seeked),n),J("volumechange",o(Be.VolumeChange),n),J("ratechange",o(Be.RateChange),n)];return A(()=>{l.forEach(a=>a())})}function nd({fontCb:s,doc:e}){const t=e.defaultView;if(!t)return()=>{};const r=[],i=new WeakMap,n=t.FontFace;t.FontFace=function(a,c,u){const h=new n(a,c,u);return i.set(h,{family:a,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),h};const o=Te(e.fonts,"add",function(l){return function(a){return setTimeout(A(()=>{const c=i.get(a);c&&(s(c),i.delete(a))}),0),l.apply(this,[a])}});return r.push(()=>{t.FontFace=n}),r.push(o),A(()=>{r.forEach(l=>l())})}function od(s){const{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:n}=s;let o=!0;const l=A(()=>{const a=e.getSelection();if(!a||o&&(a!=null&&a.isCollapsed))return;o=a.isCollapsed||!1;const c=[],u=a.rangeCount||0;for(let h=0;h<u;h++){const f=a.getRangeAt(h),{startContainer:p,startOffset:g,endContainer:m,endOffset:d}=f;X(p,r,i,!0)||X(m,r,i,!0)||c.push({start:t.getId(p),startOffset:g,end:t.getId(m),endOffset:d})}n({ranges:c})});return l(),J("selectionchange",l)}function ad({doc:s,customElementCb:e}){const t=s.defaultView;return!t||!t.customElements?()=>{}:Te(t.customElements,"define",function(i){return function(n,o,l){try{e({define:{name:n}})}catch(a){console.warn(`Custom element callback failed for ${n}`)}return i.apply(this,[n,o,l])}})}function ld(s,e){const{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:n,viewportResizeCb:o,inputCb:l,mediaInteractionCb:a,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:h,fontCb:f,selectionCb:p,customElementCb:g}=s;s.mutationCb=(...m)=>{e.mutation&&e.mutation(...m),t(...m)},s.mousemoveCb=(...m)=>{e.mousemove&&e.mousemove(...m),r(...m)},s.mouseInteractionCb=(...m)=>{e.mouseInteraction&&e.mouseInteraction(...m),i(...m)},s.scrollCb=(...m)=>{e.scroll&&e.scroll(...m),n(...m)},s.viewportResizeCb=(...m)=>{e.viewportResize&&e.viewportResize(...m),o(...m)},s.inputCb=(...m)=>{e.input&&e.input(...m),l(...m)},s.mediaInteractionCb=(...m)=>{e.mediaInteaction&&e.mediaInteaction(...m),a(...m)},s.styleSheetRuleCb=(...m)=>{e.styleSheetRule&&e.styleSheetRule(...m),c(...m)},s.styleDeclarationCb=(...m)=>{e.styleDeclaration&&e.styleDeclaration(...m),u(...m)},s.canvasMutationCb=(...m)=>{e.canvasMutation&&e.canvasMutation(...m),h(...m)},s.fontCb=(...m)=>{e.font&&e.font(...m),f(...m)},s.selectionCb=(...m)=>{e.selection&&e.selection(...m),p(...m)},s.customElementCb=(...m)=>{e.customElement&&e.customElement(...m),g(...m)}}function ud(s,e={}){const t=s.doc.defaultView;if(!t)return()=>{};ld(s,e);let r;s.recordDOM&&(r=oa(s,s.doc));const i=Kf(s),n=qf(s),o=aa(s),l=Qf(s,{win:t}),a=td(s),c=id(s);let u=()=>{},h=()=>{},f=()=>{},p=()=>{};s.recordDOM&&(u=rd(s,{win:t}),h=la(s,s.doc),f=sd(s,{win:t}),s.collectFonts&&(p=nd(s)));const g=od(s),m=ad(s),d=[];for(const w of s.plugins)d.push(w.observer(w.callback,t,w.options));return A(()=>{Ne.forEach(w=>w.reset()),r==null||r.disconnect(),i(),n(),o(),l(),a(),c(),u(),h(),f(),p(),g(),m(),d.forEach(w=>w())})}function qt(s){return typeof window[s]!="undefined"}function Qt(s){return!!(typeof window[s]!="undefined"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}var We="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",cd=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var er=0;er<We.length;er++)cd[We.charCodeAt(er)]=er;var hd=function(s){var e=new Uint8Array(s),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=We[e[t]>>2],i+=We[(e[t]&3)<<4|e[t+1]>>4],i+=We[(e[t+1]&15)<<2|e[t+2]>>6],i+=We[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};const on=new Map;function fd(s,e){let t=on.get(s);return t||(t=new Map,on.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}const ua=(s,e,t)=>{if(!s||!(ha(s,e)||typeof s=="object"))return;const r=s.constructor.name,i=fd(t,r);let n=i.indexOf(s);return n===-1&&(n=i.length,i.push(s)),n};function fr(s,e,t){if(s instanceof Array)return s.map(r=>fr(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=hd(s);return{rr_type:r,base64:i}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[fr(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:[fr(s.data,e,t),s.width,s.height]};if(ha(s,e)||typeof s=="object"){const r=s.constructor.name,i=ua(s,e,t);return{rr_type:r,index:i}}}}return s}const ca=(s,e,t)=>s.map(r=>fr(r,e,t)),ha=(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 dd(s,e,t,r){const i=[],n=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const o of n)try{if(typeof e.CanvasRenderingContext2D.prototype[o]!="function")continue;const l=Te(e.CanvasRenderingContext2D.prototype,o,function(a){return function(...c){return X(this.canvas,t,r,!0)||setTimeout(()=>{const u=ca(c,e,this);s(this.canvas,{type:je["2D"],property:o,args:u})},0),a.apply(this,c)}});i.push(l)}catch(l){const a=Fr(e.CanvasRenderingContext2D.prototype,o,{set(c){s(this.canvas,{type:je["2D"],property:o,args:[c],setter:!0})}});i.push(a)}return()=>{i.forEach(o=>o())}}function pd(s){return s==="experimental-webgl"?"webgl":s}function an(s,e,t,r){const i=[];try{const n=Te(s.HTMLCanvasElement.prototype,"getContext",function(o){return function(l,...a){if(!X(this,e,t,!0)){const c=pd(l);if("__context"in this||(this.__context=c),r&&["webgl","webgl2"].includes(c))if(a[0]&&typeof a[0]=="object"){const u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return o.apply(this,[l,...a])}});i.push(n)}catch(n){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(n=>n())}}function ln(s,e,t,r,i,n){const o=[],l=Object.getOwnPropertyNames(s);for(const a of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if(typeof s[a]!="function")continue;const c=Te(s,a,function(u){return function(...h){const f=u.apply(this,h);if(ua(f,n,this),"tagName"in this.canvas&&!X(this.canvas,r,i,!0)){const p=ca(h,n,this),g={type:e,property:a,args:p};t(this.canvas,g)}return f}});o.push(c)}catch(c){const u=Fr(s,a,{set(h){t(this.canvas,{type:e,property:a,args:[h],setter:!0})}});o.push(u)}return o}function md(s,e,t,r){const i=[];return i.push(...ln(e.WebGLRenderingContext.prototype,je.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext!="undefined"&&i.push(...ln(e.WebGL2RenderingContext.prototype,je.WebGL2,s,t,r,e)),()=>{i.forEach(n=>n())}}const fa="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",gd=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),un=typeof self!="undefined"&&self.Blob&&new Blob([gd(fa)],{type:"text/javascript;charset=utf-8"});function yd(s){let e;try{if(e=un&&(self.URL||self.webkitURL).createObjectURL(un),!e)throw"";const t=new Worker(e,{name:s==null?void 0:s.name});return t.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),t}catch(t){return new Worker("data:text/javascript;base64,"+fa,{name:s==null?void 0:s.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class wd{constructor(e){y(this,"pendingCanvasMutations",new Map),y(this,"rafStamps",{latestId:0,invokeId:null}),y(this,"mirror"),y(this,"mutationCb"),y(this,"resetObservers"),y(this,"frozen",!1),y(this,"locked",!1),y(this,"processMutation",(a,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(c)});const{sampling:t="all",win:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&t==="all"&&this.initCanvasMutationObserver(r,i,n),o&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,i,n,{dataURLOptions:l})}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,n){const o=an(t,r,i,!0),l=new Map,a=new yd;a.onmessage=g=>{const{id:m}=g.data;if(l.set(m,!1),!("base64"in g.data))return;const{base64:d,type:w,width:b,height:S}=g.data;this.mutationCb({id:m,type:je["2D"],commands:[{property:"clearRect",args:[0,0,b,S]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:d}],type:w}]},0,0]}]})};const c=1e3/e;let u=0,h;const f=()=>{const g=[];return t.document.querySelectorAll("canvas").forEach(m=>{X(m,r,i,!0)||g.push(m)}),g},p=g=>{if(u&&g-u<c){h=requestAnimationFrame(p);return}u=g,f().forEach(async m=>{var d;const w=this.mirror.getId(m);if(l.get(w)||m.width===0||m.height===0)return;if(l.set(w,!0),["webgl","webgl2"].includes(m.__context)){const S=m.getContext(m.__context);((d=S==null?void 0:S.getContextAttributes())==null?void 0:d.preserveDrawingBuffer)===!1&&S.clear(S.COLOR_BUFFER_BIT)}const b=await createImageBitmap(m);a.postMessage({id:w,bitmap:b,width:m.width,height:m.height,dataURLOptions:n.dataURLOptions},[b])}),h=requestAnimationFrame(p)};h=requestAnimationFrame(p),this.resetObservers=()=>{o(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=an(e,t,r,!1),n=dd(this.processMutation.bind(this),e,t,r),o=md(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),n(),o()}}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(o=>{const c=o,{type:l}=c;return De(c,["type"])}),{type:n}=r[0];this.mutationCb({id:t,type:n,commands:i}),this.pendingCanvasMutations.delete(e)}}class bd{constructor(){y(this,"nodeMap",new WeakMap),y(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(){}}class Sd{constructor(e){y(this,"shadowDoms",new WeakSet),y(this,"mutationCb"),y(this,"scrollCb"),y(this,"bypassOptions"),y(this,"mirror"),y(this,"restoreHandlers",[]),y(this,"mappedRestoreHandlers",{}),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!ut(e)||!ot.onShadowRootObserver(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e),Y(`Adding mutation observer for shadowRoot ${e.host}`);const r=oa(ee(O({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(aa(ee(O({},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(x.host(e))),this.restoreHandlers.push(la({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(Te(e.prototype,"attachShadow",function(i){return function(n){const o=i.call(this,n),l=x.shadowRoot(this);return l&&ta(this)&&r.addShadowRoot(l,t),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(t){}}),Object.values(this.mappedRestoreHandlers).forEach(e=>{for(const t of e)try{t()}catch(r){}}),this.mappedRestoreHandlers={},this.restoreHandlers=[],this.shadowDoms=new WeakSet}}class Cd{constructor(e){y(this,"trackedLinkElements",new WeakSet),y(this,"mutationCb"),y(this,"adoptedStyleSheetCb"),y(this,"styleMirror",new Df),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 n of e){let o;this.styleMirror.has(n)?o=this.styleMirror.getId(n):(o=this.styleMirror.add(n),i.push({styleId:o,rules:Array.from(n.rules||CSSRule,(l,a)=>({rule:wn(l,n.href),index:a}))})),r.styleIds.push(o)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}let F,at,tr,dt=!1;try{if(Array.from([1],s=>s*2)[0]!==2){const s=document.createElement("iframe");document.body.appendChild(s),Array.from=((li=s.contentWindow)==null?void 0:li.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){ht()&&console.debug("Unable to override Array.from",s)}const re=qa();function Me(s={}){const{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:n=null,ignoreClass:o="rr-ignore",ignoreSelector:l=null,maskTextClass:a="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:h,maskInputOptions:f,slimDOMOptions:p,maskInputFn:g,maskTextFn:m,hooks:d,packFn:w,sampling:b={},dataURLOptions:S={},mousemoveWait:R,recordDOM:B=!0,recordCanvas:U=!1,recordCrossOriginIframes:G=!1,recordAfter:L=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",userTriggeredOnInput:K=!1,collectFonts:j=!1,inlineImages:Q=!1,plugins:oe,keepIframeSrcFn:ae=()=>!1,ignoreCSSAttributes:E=new Set([]),errorHandler:Ke}=s;zf(Ke);const Se=G?window.parent===window:!0;let Ae=!1;if(!Se)try{window.parent.document&&(Ae=!1)}catch($){Ae=!0}if(Se&&!e)throw new Error("emit function is required");if(!Se&&!Ae)return()=>{};R!==void 0&&b.mousemove===void 0&&(b.mousemove=R),re.reset();const V=h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:f!==void 0?f:{password:!0},se=p===!0||p==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:p==="all",headMetaDescKeywords:p==="all",headTitleMutations:p==="all"}:p||{};Lf();let Re,le=0;const Et=$=>{for(const ue of oe||[])ue.eventProcessor&&($=ue.eventProcessor($));return w&&!Ae&&($=w($)),$};F=($,ue)=>{var z;const W=$;if(W.timestamp=Or(),(z=Ne[0])!=null&&z.isFrozen()&&W.type!==M.FullSnapshot&&!(W.type===M.IncrementalSnapshot&&W.data.source===I.Mutation)&&Ne.forEach(de=>de.unfreeze()),Se)e==null||e(Et(W),ue);else if(Ae){const de={type:"rrweb",event:Et(W),origin:window.location.origin,isCheckout:ue};window.parent.postMessage(de,"*")}if(W.type===M.FullSnapshot)Re=W,le=0;else if(W.type===M.IncrementalSnapshot){if(W.data.source===I.Mutation&&W.data.isAttachIframe)return;le++;const de=r&&le>=r,Qe=t&&W.timestamp-Re.timestamp>t;(de||Qe)&&at(!0)}};const fe=$=>{F({type:M.IncrementalSnapshot,data:O({source:I.Mutation},$)})},si=$=>F({type:M.IncrementalSnapshot,data:O({source:I.Scroll},$)}),ii=$=>F({type:M.IncrementalSnapshot,data:O({source:I.CanvasMutation},$)}),da=$=>F({type:M.IncrementalSnapshot,data:O({source:I.AdoptedStyleSheet},$)}),Ce=new Cd({mutationCb:fe,adoptedStyleSheetCb:da}),ve=new Wf({mirror:re,mutationCb:fe,stylesheetManager:Ce,recordCrossOriginIframes:G,wrappedEmit:F});for(const $ of oe||[])$.getMirror&&$.getMirror({nodeMirror:re,crossOriginIframeMirror:ve.crossOriginIframeMirror,crossOriginIframeStyleMirror:ve.crossOriginIframeStyleMirror});const $t=new bd;tr=new wd({recordCanvas:U,mutationCb:ii,win:window,blockClass:i,blockSelector:n,mirror:re,sampling:b.canvas,dataURLOptions:S});const qe=new Sd({mutationCb:fe,scrollCb:si,bypassOptions:{blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:V,dataURLOptions:S,maskTextFn:m,maskInputFn:g,recordCanvas:U,inlineImages:Q,sampling:b,slimDOMOptions:se,iframeManager:ve,stylesheetManager:Ce,canvasManager:tr,keepIframeSrcFn:ae,processedNodeManager:$t},mirror:re});ot.setEmitter(F),ot.setMutationOptions({blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:V,maskTextFn:m,maskInputFn:g,slimDOMOptions:se,dataURLOptions:S,canvasManager:tr,stylesheetManager:Ce,shadowDomManager:qe,recordCanvas:U,inlineImages:Q,mirror:re,iframeManager:ve,keepIframeSrcFn:ae,mutationCb:fe,processedNodeManager:$t}),at=($=!1)=>{if(!B)return;F({type:M.Meta,data:{href:window.location.href,width:Jo(),height:Zo()}},$),Ce.reset(),qe.init(),Ne.forEach(z=>z.lock());const ue=Pl(document,{mirror:re,blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:V,maskTextFn:m,maskInputFn:g,slimDOM:se,dataURLOptions:S,recordCanvas:U,inlineImages:Q,onSerialize:z=>{qo(z,re)&&ve.addIframe(z),Qo(z,re)&&Ce.trackLinkElement(z),Ns(z)&&qe.addShadowRoot(x.shadowRoot(z),document)},onIframeLoad:(z,W)=>{ve.attachIframe(z,W),qe.observeAttachShadow(z)},onStylesheetLoad:(z,W)=>{Ce.attachLinkElement(z,W)},keepIframeSrcFn:ae});if(!ue){ht()&&console.warn("Failed to snapshot the document");return}F({type:M.FullSnapshot,data:{node:ue,initialOffset:Yo(window)}},$),Ne.forEach(z=>z.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Ce.adoptStyleSheets(document.adoptedStyleSheets,re.getId(document))};try{const $=[],ue={},z=pe=>{var Nt;return A(ud)({mutationCb:fe,mousemoveCb:(_,Br)=>F({type:M.IncrementalSnapshot,data:{source:Br,positions:_}}),mouseInteractionCb:_=>F({type:M.IncrementalSnapshot,data:O({source:I.MouseInteraction},_)}),scrollCb:si,viewportResizeCb:_=>F({type:M.IncrementalSnapshot,data:O({source:I.ViewportResize},_)}),inputCb:_=>F({type:M.IncrementalSnapshot,data:O({source:I.Input},_)}),mediaInteractionCb:_=>F({type:M.IncrementalSnapshot,data:O({source:I.MediaInteraction},_)}),styleSheetRuleCb:_=>F({type:M.IncrementalSnapshot,data:O({source:I.StyleSheetRule},_)}),styleDeclarationCb:_=>F({type:M.IncrementalSnapshot,data:O({source:I.StyleDeclaration},_)}),canvasMutationCb:ii,fontCb:_=>F({type:M.IncrementalSnapshot,data:O({source:I.Font},_)}),selectionCb:_=>{F({type:M.IncrementalSnapshot,data:O({source:I.Selection},_)})},customElementCb:_=>{F({type:M.IncrementalSnapshot,data:O({source:I.CustomElement},_)})},blockClass:i,ignoreClass:o,ignoreSelector:l,maskTextClass:a,maskTextSelector:c,maskInputOptions:V,inlineStylesheet:u,sampling:b,recordDOM:B,recordCanvas:U,inlineImages:Q,userTriggeredOnInput:K,collectFonts:j,doc:pe,maskInputFn:g,maskTextFn:m,keepIframeSrcFn:ae,blockSelector:n,slimDOMOptions:se,dataURLOptions:S,mirror:re,iframeManager:ve,stylesheetManager:Ce,shadowDomManager:qe,processedNodeManager:$t,canvasManager:tr,ignoreCSSAttributes:E,plugins:((Nt=oe==null?void 0:oe.filter(_=>_.observer))==null?void 0:Nt.map(_=>({observer:_.observer,options:_.options,callback:Br=>F({type:M.Plugin,data:{plugin:_.name,payload:Br}})})))||[]},d)};ve.addLoadListener(pe=>{try{if(!ot.onDocObserver(pe.contentDocument))return;Y("Adding mutation observer for iframe",pe),$.push(z(pe.contentDocument))}catch(Nt){ht()&&(console.warn("internal error"),console.warn(Nt))}});let W=null;const de=()=>{W=Date.now(),at(),$.push(z(document)),dt=!0},Qe=()=>{window.removeEventListener("load",Qe),!(!dt||W==null)&&(Date.now()-W<=10||at())};return window.addEventListener("load",Qe),document.readyState==="interactive"||document.readyState==="complete"?(document.readyState==="complete"&&window.removeEventListener("load",Qe),de()):($.push(J("DOMContentLoaded",()=>{F({type:M.DomContentLoaded,data:{}}),L==="DOMContentLoaded"&&de()})),$.push(J("load",()=>{F({type:M.Load,data:{}}),L==="load"&&de()},window))),()=>{$.forEach(pe=>pe()),Object.values(ue).forEach(pe=>pe()),$t.destroy(),ot.destroy(),dt=!1,Uf()}}catch($){ht()&&(console.warn("internal error1"),console.warn($))}}Me.addCustomEvent=(s,e)=>{if(!dt)throw new Error("please add custom event after start recording");F({type:M.Custom,data:{tag:s,payload:e}})};Me.freezePage=()=>{Ne.forEach(s=>s.freeze())};Me.takeFullSnapshot=s=>{if(!dt)throw new Error("please take full snapshot after start recording");at(s)};Me.mirror=re;var cn;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(cn||(cn={}));const{addCustomEvent:rp}=Me,{freezePage:sp}=Me,{takeFullSnapshot:vd}=Me;exports.record=Me;
|
|
59
59
|
;if (typeof module.exports == "object" && typeof exports == "object") {
|
|
60
60
|
var __cp = (to, from, except, desc) => {
|
|
61
61
|
if ((from && typeof from === "object") || typeof from === "function") {
|