posthog-js 1.426.2 → 1.426.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-external-dependencies.js +1 -1
- package/dist/all-external-dependencies.js.map +1 -1
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.es5.js.map +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.full.no-external.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/array.no-external.js.map +1 -1
- package/dist/conversations.js +1 -1
- package/dist/customizations.d.ts +3 -0
- package/dist/customizations.full.js +1 -1
- package/dist/customizations.js +1 -1
- package/dist/default-extensions.js +1 -1
- package/dist/default-extensions.js.map +1 -1
- package/dist/extension-bundles.js +1 -1
- package/dist/extension-bundles.js.map +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/lazy-recorder.js.map +1 -1
- package/dist/main.d.ts +3 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.d.ts +3 -0
- package/dist/module.full.d.ts +3 -0
- package/dist/module.full.js +1 -1
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.d.ts +3 -0
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/module.mjs +1 -1
- package/dist/module.mjs.map +1 -1
- package/dist/module.no-external.d.ts +3 -0
- package/dist/module.no-external.js +1 -1
- package/dist/module.no-external.js.map +1 -1
- package/dist/module.slim.js +1 -1
- package/dist/module.slim.no-external.d.ts +3 -0
- package/dist/module.slim.no-external.js +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/dist/posthog-recorder.js.map +1 -1
- package/dist/product-tours.js +1 -1
- package/dist/recorder-v2.js +1 -1
- package/dist/recorder-v2.js.map +1 -1
- package/dist/recorder.js +1 -1
- package/dist/recorder.js.map +1 -1
- package/dist/src/posthog-featureflags.d.ts +3 -0
- package/lib/package.json +1 -1
- package/lib/src/extensions/replay/external/network-plugin.js +3 -3
- package/lib/src/extensions/replay/external/network-plugin.js.map +1 -1
- package/lib/src/posthog-featureflags.d.ts +3 -0
- package/lib/src/posthog-featureflags.js +41 -3
- package/lib/src/posthog-featureflags.js.map +1 -1
- package/package.json +7 -7
package/dist/recorder.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){"use strict";function e(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function t(t){return function(){var r=this,n=arguments;return new Promise((function(i,a){var o=t.apply(r,n);function s(t){e(o,i,a,s,u,"next",t)}function u(t){e(o,i,a,s,u,"throw",t)}s(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},r.apply(null,arguments)}var n,i=["type"],a=Object.defineProperty,o=(e,t,r)=>((e,t,r)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),s=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(s||{}),u=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(u||{}),l=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(l||{}),c=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(c||{}),h=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(h||{}),d=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(d||{}),f=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(f||{});function v(e,t){return-1!==e.indexOf(t)}var p={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},m={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},y={};function g(e){if(y[e])return y[e];var t=function(e){var t,r,n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in p?p[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),a=e in m?m[e]:void 0,o=Boolean(a&&a.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&o)return y[e]=t.prototype,t.prototype;var s=document.createElement("iframe");s.style.display="none";var u,l=!1;try{document.body.appendChild(s);var c=s.contentWindow;if(!c)return t.prototype;var h=c[e].prototype;return h?(v(u=navigator.userAgent,"AppleWebKit")&&!v(u,"Chrome")&&(s.classList.add("rr-block","ph-no-capture"),s.setAttribute("__rrwebUntaintedPrototype",e),l=!0),y[e]=h):r}catch(e){return r}finally{!l&&s.parentNode&&document.body.removeChild(s)}}var w={};function b(e,t,r){var n,i=e+"."+String(r);if(w[i])return w[i].call(t);var a=g(e),o=null==(n=Object.getOwnPropertyDescriptor(a,r))?void 0:n.get;return o?(w[i]=o,o.call(t)):t[r]}var k={};function S(e,t,r){var n=e+"."+String(r);if(k[n])return k[n].bind(t);var i=g(e)[r];return"function"!=typeof i?t[r]:(k[n]=i,i.bind(t))}function M(){return g("MutationObserver").constructor}function I(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i={next:n},a=r((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return i.next.apply(this,t)}));return"function"==typeof a&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__rrweb_original__:{enumerable:!1,value:n},__rrweb_layer__:{enumerable:!1,value:i}})),e[t]=a,()=>{if(e[t]!==a)for(var r=e=>{var t;return"function"==typeof e?null!==(t=e.__rrweb_layer__)&&void 0!==t?t:e.__posthog_layer__:void 0},n=e[t],o=r(n);o;){if(o.next===a)return void(o.next=i.next);o=r(n=o.next)}else e[t]=i.next}}catch(e){return()=>{}}}var C={childNodes:e=>b("Node",e,"childNodes"),parentNode:e=>b("Node",e,"parentNode"),parentElement:e=>b("Node",e,"parentElement"),textContent:e=>b("Node",e,"textContent"),contains:(e,t)=>S("Node",e,"contains")(t),getRootNode:e=>S("Node",e,"getRootNode")(),host:e=>e&&"host"in e?b("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?b("Element",e,"shadowRoot"):null,querySelector:(e,t)=>S("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>S("Element",e,"querySelectorAll")(t),mutationObserver:M,patch:I},A=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0});function x(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(e){}return Date.now()}var R=0,T=6e4;function O(){R+=1}function F(){return R}function E(e,t){return t!==R||e>T}var L=0,N=0,_=0,D=A(),W=null,P=null,j=[],B=0,H=0,q={slowestBatchMs:0},U={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0},z=e=>e&&e>0?e:null;function G(e){(L+=1)>1||(D=A(),j=[],B=0,P=z(e),N=x(),_=R)}function Z(){return 0===L?W||A():(L-=1)>0?D:(D.durationMs=x()-N,D.deferredStylesheetCount=B,U.deferredCount+=B,P=null,E(D.durationMs,_)?D:W=D)}var V=32;function J(e,t,r){var n=e.length;if(r>=V)return n;for(var i=0;e.length>i;i++){var a=e[i];try{var o=a.cssRules;if(o&&o.length)n+=J(o,t,r+1);else if(t&&a.styleSheet){var s=a.styleSheet;if(!t.has(s)){t.add(s);var u=s.rules||s.cssRules;u&&(n+=J(u,t,r+1))}}}catch(e){}}return n}function X(e){if(0!==L){var t=J(e,null,0);D.cssRuleCount+=t,H>0&&(D.nonDeferrableCssRuleCount+=t)}}function Y(e){H+=1;try{return e()}finally{H-=1}}function K(e){L>0&&(D.stylesheetMs+=e)}function Q(e){if(0===L||null===P)return!1;var t=D.cssRuleCount-D.nonDeferrableCssRuleCount;return t>=P||t+function(e){try{var t=e&&(e.rules||e.cssRules);if(!t)return 0;var r=new WeakSet;return r.add(e),J(t,r,0)}catch(e){return 0}}(e)>P}function ee(){U.failedCount+=1}function te(e){e>0&&(U.abandonedCount+=e)}function re(e){return e.nodeType===e.ELEMENT_NODE}function ne(e){var t=e&&"host"in e&&"mode"in e&&C.host(e)||null;return Boolean(t&&"shadowRoot"in t&&C.shadowRoot(t)===e)}function ie(e){return"[object ShadowRoot]"==={}.toString.call(e)}function ae(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function oe(e){var t=e.cssText;if(3>t.split('"').length)return t;var r=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer("+e.layerName+")"),e.supportsText&&r.push("supports("+e.supportsText+")"),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}var se=0;function ue(e){var t=0===se,r=t?x():0;se+=1;try{var n=e.rules||e.cssRules;if(!n)return null;X(n);var i=e.href;return!i&&e.ownerNode&&(i=e.ownerNode.baseURI),ae(Array.from(n,(e=>le(e,i))).join(""))}catch(e){return null}finally{se-=1,t&&K(x()-r)}}function le(e,t){var r;if(he(e)){var n;try{n=ue(e.styleSheet)||oe(e)}catch(t){n=e.cssText}try{if(n&&(null==(r=e.styleSheet)?void 0:r.href))return xe(n,e.styleSheet.href)}catch(e){}return n}var i=e.cssText;return de(e)&&e.selectorText.includes(":")&&(i=ce(i)),t?xe(i,t):i}function ce(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function he(e){return"styleSheet"in e}function de(e){return"selectorText"in e}var fe=/^-?[A-Za-z_][\w-]*$/,ve=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function pe(e){var t=[],r=!1,n=null,i=new Map;function a(e){var i=t.pop();if("group"===i.kind){if(null===e){for(;t.length>0&&"group"===t[t.length-1].kind;)t.pop();return void a(null)}var s=t[t.length-1];return s.parts.push(e),void(s.index+=1)}if(!i.importRule)return r=!0,void(n=e);o(t[t.length-1],i.importRule,e)}function o(e,t,r){var n;try{var i;try{i=r||oe(t)}catch(e){i=t.cssText}try{i&&(null==(n=t.styleSheet)?void 0:n.href)&&(i=xe(i,t.styleSheet.href))}catch(e){}i&&e.parts.push(i),e.index+=1}catch(e){a(null)}}function s(e){var r=e.rules[e.index];if("sheet"===e.kind&&he(r)){var n=i.get(r);return null===n?(e.parts.push(r.cssText),void(e.index+=1)):n?void t.push({kind:"sheet",sheet:n.sheet,rules:n.rules,sheetHref:n.sheetHref,index:0,parts:[],importRule:r}):void o(e,r,null)}if(!function(e,r){try{var n=function(e){var t,r=e;if(!r.cssRules||0===r.cssRules.length)return null;if(r.media&&"string"==typeof r.media.mediaText)return"@media "+r.media.mediaText+" {";if(de(e)){if("number"==typeof r.type&&1!==r.type)return null;var n=r.style?r.style.cssText:"";return e.selectorText+" {"+(n?" "+n:"")}if("containerName"in r)return"string"!=typeof r.containerQuery||r.containerName&&!fe.test(r.containerName)?null:"@container "+(r.containerName?r.containerName+" ":"")+r.containerQuery+" {";if("string"==typeof r.conditionText){var i="";try{i=(null==(t=e.constructor)?void 0:t.name)||""}catch(e){return null}return""===i||"Object"===i||"CSSSupportsRule"===i?"@supports "+r.conditionText+" {":null}return"string"==typeof r.name?"keyText"in r.cssRules[0]?fe.test(r.name)?"@keyframes "+r.name+" {":null:""===r.name?"@layer {":ve.test(r.name)?"@layer "+r.name+" {":null:null}(e);if(null===n)return!1;var i=r.sheetHref;return t.push({kind:"group",rules:Array.from(e.cssRules),sheetHref:i,index:0,parts:[],prelude:i?xe(n,i):n,fixColons:"sheet"===r.kind&&de(e)&&e.selectorText.includes(":")}),!0}catch(e){return!1}}(r,e)){var a=r.cssText;"sheet"===e.kind&&de(r)&&r.selectorText.includes(":")&&(a=ce(a)),e.parts.push(e.sheetHref?xe(a,e.sheetHref):a),e.index+=1}}return function(e){try{var r=e.rules||e.cssRules;if(!r)return!1;X(r);var n=e.href;!n&&e.ownerNode&&(n=e.ownerNode.baseURI);var a=Array.from(r);return t.push({kind:"sheet",sheet:e,rules:a,sheetHref:n,index:0,parts:[],importRule:null}),function(e,t){for(var r=[{sheet:t,rules:e,index:0}],n=function(){var e=r[r.length-1];if(e.index>=e.rules.length)return r.pop(),0;var t=e.rules[e.index];if(e.index+=1,!he(t)||i.has(t))return 0;var n=null;try{n=t.styleSheet}catch(e){return i.set(t,null),0}if(!n||r.some((e=>e.sheet===n)))return 0;try{var a=n.rules||n.cssRules;if(!a)return 0;X(a);var o=n.href;!o&&n.ownerNode&&(o=n.ownerNode.baseURI);var s=Array.from(a);i.set(t,{sheet:n,rules:s,sheetHref:o}),r.push({sheet:n,rules:s,index:0})}catch(e){}};r.length>0;)n()}(a,e),!0}catch(e){return!1}}(e)||(r=!0),{advance(e){if(r)return!0;var i=x(),o=e>0?e:1;try{for(;!r&&o>0;){var u=t[t.length-1];if(u.rules.length>u.index){o-=1;try{s(u)}catch(e){a(null)}}else{var l=null;try{if("group"===u.kind){var c=u.prelude+u.parts.join("")+"}";l=u.fixColons?ce(c):c}else l=ae(u.parts.join(""))}catch(e){}a(l)}}}catch(e){r=!0,n=null}finally{K(x()-i)}return r},text:()=>r?n:null,remainingRules(){if(r)return 0;var e=0;for(var n of t)e+=n.rules.length-n.index;return e}}}class me{constructor(){o(this,"idNodeMap",new Map),o(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);if(this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e))),re(e)){var r=C.shadowRoot(e);r&&this.removeNodeFromMap(r),"IFRAME"===e.nodeName&&e.contentDocument&&this.removeNodeFromMap(e.contentDocument)}}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){this.idNodeMap.set(t.id,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ye(e){var t=e.element,r=e.maskInputOptions,n=e.tagName,i=e.type,a=e.maskInputFn,o=e.value||"",s=i&&ge(i);return(r[n.toLowerCase()]||s&&r[s])&&(o=a?a(o,t):"*".repeat(o.length)),o}function ge(e){return e.toLowerCase()}var we=new Set(["rr_width","rr_height","rr_left","rr_top","rr_position","rr_transform","rr_display","rr_scrollleft","rr_scrolltop","rr_mediastate","rr_open_mode"]);function be(e){var t=e.element,r=e.name,n=e.value,i=e.maskAttributeFn,a=e.isGenerated;return n?e.maskAllElementAttributes?void 0!==a&&a&&we.has(ge(r))?n:"*".repeat(n.length):i?i(r,n,t):n:n}var ke="__rrweb_original__";function Se(e){try{var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?ge(t):null}catch(e){return null}}var Me=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ie=/^(?:[a-z+]+:)?\/\//i,Ce=/^www\..*/i,Ae=/^(data:)([^,]*),(.*)/i;function xe(e,t){return(e||"").replace(Me,((e,r,n,i,a,o)=>{var s,u=n||a||o,l=r||i||"";if(!u)return e;if(Ie.test(u)||Ce.test(u))return"url("+l+u+l+")";if(Ae.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+l+")";var c=t.split("/"),h=u.split("/");for(var d of(c.pop(),h))"."!==d&&(".."===d?c.pop():c.push(d));return"url("+l+c.join("/")+l+")"}))}var Re,Te,Oe="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",Fe=4096,Ee=1e5,Le=10,Ne=new Map,_e=1,De=new RegExp("[^a-z0-9-_:]"),We=-2;function Pe(){return _e++}var je=/^[^ \t\n\r\u000c]+/,Be=/^[, \t\n\r\u000c]+/,He=new WeakMap;function qe(e,t){return t&&""!==t.trim()?Ue(e,t):t}function Ue(e,t){var r=He.get(e);if(r||(r=e.createElement("a"),He.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function ze(e,t){return(null==t?void 0:t.maxBase64ImageLength)?function(e,t){return t&&e.length>t?Oe:e}(e,t.maxBase64ImageLength):e}function Ge(e,t,r,n,i,a){var o;if(!n)return n;if("src"===r||"href"===r&&("use"!==t||"#"!==n[0])){if("link"===t&&i){var s=null==(o=i.sheet)?void 0:o.href;if(s)return s}var u=qe(e,n);if(u.startsWith("data:")){if("img"===t&&i){var l=u;return((null==a?void 0:a.type)||void 0!==(null==a?void 0:a.quality))&&(l=function(e,t,r,n){if(Ee>t.length)return t;if(!e.complete||0===e.naturalWidth)return t;if(e.naturalWidth>Fe||e.naturalHeight>Fe)return t;var i=Ne.get(t);if(i&&i.type===r&&i.quality===n)return i.result;try{var a=document.createElement("canvas");a.width=e.naturalWidth,a.height=e.naturalHeight;var o=a.getContext("2d");if(!o)return t;o.drawImage(e,0,0);var s=a.toDataURL(r||"image/webp",null!=n?n:.4),u=t.length>s.length?s:t;if(Ne.size>=Le){var l=Ne.keys().next().value;void 0!==l&&Ne.delete(l)}return Ne.set(t,{type:r,quality:n,result:u}),u}catch(e){return t}}(i,u,a.type,a.quality)),ze(l,a)}if("image"===t)return ze(u,a)}return u}if("xlink:href"===r&&"#"!==n[0]){var c=qe(e,n);return"image"===t&&c.startsWith("data:")?ze(c,a):c}return"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,i=e.exec(t.substring(r));return i?(r+=(n=i[0]).length,n):""}for(var i=[];n(Be),t.length>r;){var a=n(je);if(","===a.slice(-1))a=qe(e,a.substring(0,a.length-1)),i.push(a);else{var o="";a=qe(e,a);for(var s=!1;;){var u=t.charAt(r);if(""===u){i.push((a+o).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){r+=1,i.push((a+o).trim());break}"("===u&&(s=!0)}o+=u,r+=1}}}return i.join(", ")}(e,n):"style"===r?xe(n,Ue(e)):"object"===t&&"data"===r?qe(e,n):n:qe(e,n)}function Ze(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function Ve(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Ve(C.parentNode(e),t,r);for(var n=e.classList.length;n--;)if(t.test(e.classList[n]))return!0;return!!r&&Ve(C.parentNode(e),t,r)}function $e(e,t,r,n){var i;if(re(e)){if(!C.childNodes(i=e).length)return!1}else{if(null===C.parentElement(e))return!1;i=C.parentElement(e)}try{if("string"==typeof t){if(n){if(i.closest("."+t))return!0}else if(i.classList.contains(t))return!0}else if(Ve(i,t,n))return!0;if(r)if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}catch(e){}return!1}function Je(e,t,r){var n=e.removeEventListener;"function"==typeof n&&n.call(e,t,r)}var Xe=new Map;function Ye(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}function Ke(e){return null==e?"":e.toLowerCase()}var Qe=50,et=!1,tt=!1;function rt(e,t){var r=t.doc,n=t.mirror,i=t.blockClass,a=t.blockSelector,o=t.maskTextClass,s=t.maskTextSelector,u=t.skipChild,l=void 0!==u&&u,c=t.inlineStylesheet,h=void 0===c||c,d=t.maskInputOptions,v=void 0===d?{}:d,p=t.maskTextFn,m=t.maskInputFn,y=t.maskAllElementAttributes,g=void 0!==y&&y,w=t.maskAttributeFn,b=t.slimDOMOptions,k=t.dataURLOptions,S=void 0===k?{}:k,M=t.inlineImages,I=void 0!==M&&M,A=t.recordCanvas,x=void 0!==A&&A,R=t.canvasMaskingConfigured,T=t.onSerialize,O=t.onIframeLoad,F=t.iframeLoadTimeout,E=void 0===F?5e3:F,N=t.onIframeListenerRegistered,_=t.onStylesheetLoad,W=t.stylesheetLoadTimeout,P=void 0===W?5e3:W,H=t.keepIframeSrcFn,q=void 0===H?()=>!1:H,U=t.newlyAddedElement,z=void 0!==U&&U,G=t.depth,Z=void 0===G?0:G,V=t.maxDepth,J=void 0===V?Qe:V,X=t.needsMask,K=t.preserveWhiteSpace,ee=void 0===K||K;if(Z>=J)return tt=!0,et||(et=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+J+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;X||(X=$e(e,o,s,void 0===X)),L>0&&(D.nodeCount+=1);var te,ae=function(e,t){var r=t.doc,n=t.blockClass,i=t.blockSelector,a=t.needsMask,o=t.inlineStylesheet,s=t.maskInputOptions,u=void 0===s?{}:s,l=t.maskTextFn,c=t.maskInputFn,h=t.maskAllElementAttributes,d=void 0!==h&&h,v=t.maskAttributeFn,p=t.dataURLOptions,m=void 0===p?{}:p,y=t.inlineImages,g=t.recordCanvas,w=t.canvasMaskingConfigured,b=t.keepIframeSrcFn,k=t.newlyAddedElement,S=void 0!==k&&k,M=function(e,t){if(t.hasNode(e)){var r=t.getId(e);return 1===r?void 0:r}}(r,t.mirror);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:f.Document,childNodes:[],compatMode:e.compatMode}:{type:f.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:f.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:M};case e.ELEMENT_NODE:return function(e,t){for(var r,n,i,a=t.doc,o=t.inlineStylesheet,s=t.maskInputOptions,u=void 0===s?{}:s,l=t.maskInputFn,c=t.maskAllElementAttributes,h=void 0!==c&&c,d=t.maskAttributeFn,v=t.dataURLOptions,p=void 0===v?{}:v,m=t.inlineImages,y=t.recordCanvas,g=t.canvasMaskingConfigured,w=t.keepIframeSrcFn,b=t.newlyAddedElement,k=void 0!==b&&b,S=t.rootId,M=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;)if(t.test(e.classList[n]))return!0;if(r)return e.matches(r)}catch(e){}return!1}(e,t.blockClass,t.blockSelector),I=function(e){if(e instanceof HTMLFormElement)return"form";var t=ge(e.tagName);return De.test(t)?"div":t}(e),A=new Set,x={},R=e.attributes.length,T=0;R>T;T++){var O=e.attributes[T];Ze(I,O.name)||(x[O.name]=Ge(a,I,ge(O.name),O.value,e,p))}if("link"===I&&o&&!M){var F=e.sheet;if(!F){var E=function(e){return e.href}(e);E&&!(F=Ye(a,E))&&E.includes(".css")&&(F=Ye(a,window.location.origin+"/"+E.replace(window.location.href,"")))}var N=null;F&&(Q(F)?L>0&&(j.push(e),B+=1):N=ue(F)),N&&(delete x.rel,delete x.href,x._cssText=N)}if("style"===I&&e.sheet&&!(e.innerText||C.textContent(e)||"").trim().length){var _=Y((()=>ue(e.sheet)));_&&(x._cssText=_)}if("input"===I||"textarea"===I||"select"===I){var D=e.value,W=e.checked;"radio"!==x.type&&"checkbox"!==x.type&&"submit"!==x.type&&"button"!==x.type&&D?x.value=ye({element:e,type:Se(e),tagName:I,value:D,maskInputOptions:u,maskInputFn:l}):W&&(x.checked=W)}if("option"===I&&(e.selected&&!u.select?x.selected=!0:delete x.selected),"dialog"===I&&e.open){try{x.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){x.rr_open_mode="modal",x.ph_rr_could_not_detect_modal=!0}A.add("rr_open_mode")}if("canvas"===I&&y&&!(null==g?void 0:g()))if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;e.width>r;r+=50)for(var n=0;e.height>n;n+=50){var i=t.getImageData;if(new Uint32Array((ke in i?i[ke]:i).call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(x.rr_dataURL=e.toDataURL(p.type,p.quality));else if(!("__context"in e)){var P=e.toDataURL(p.type,p.quality),H=a.createElement("canvas");H.width=e.width,H.height=e.height,P!==H.toDataURL(p.type,p.quality)&&(x.rr_dataURL=P)}var q,U,z=!1;if("img"===I&&m){Re||(Re=a.createElement("canvas"),Te=Re.getContext("2d"));var G=e,Z=G.currentSrc||G.getAttribute("src")||"<unknown-src>",V=G.crossOrigin,J=(t,r)=>z?be({element:e,name:t,value:r,maskAllElementAttributes:h,maskAttributeFn:d}):r,X=()=>{Je(G,"load",X);try{Re.width=G.naturalWidth,Re.height=G.naturalHeight,Te.drawImage(G,0,0);var e=Re.toDataURL(p.type,p.quality);x.rr_dataURL=J("rr_dataURL",e)}catch(e){if("anonymous"!==G.crossOrigin)return G.crossOrigin="anonymous",void(G.complete&&0!==G.naturalWidth?X():G.addEventListener("load",X));console.warn("Cannot inline img src="+Z+"! Error: "+e)}"anonymous"===G.crossOrigin&&(V?x.crossOrigin=J("crossOrigin",V):G.removeAttribute("crossorigin"))};G.complete&&0!==G.naturalWidth?X():G.addEventListener("load",X)}if("audio"===I||"video"===I){var K=x;K.rr_mediaState=e.paused?"paused":"played",A.add("rr_mediaState"),K.rr_mediaCurrentTime=e.currentTime,K.rr_mediaPlaybackRate=e.playbackRate,K.rr_mediaMuted=e.muted,K.rr_mediaLoop=e.loop,K.rr_mediaVolume=e.volume}if(k||(e.scrollLeft&&(x.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(x.rr_scrollTop=e.scrollTop)),M){var ee=e.getBoundingClientRect(),te=ee.width,re=ee.height,ne=ee.left,ie=ee.top,ae=null==(r=a.defaultView)?void 0:r.getComputedStyle(e);x={class:x.class,rr_width:te+"px",rr_height:re+"px",rr_left:Math.floor(ne+((null==(n=a.defaultView)?void 0:n.scrollX)||0))+"px",rr_top:Math.floor(ie+((null==(i=a.defaultView)?void 0:i.scrollY)||0))+"px"},A.add("rr_width"),A.add("rr_height"),A.add("rr_left"),A.add("rr_top"),ae&&(x.rr_position=ae.position||"static",A.add("rr_position"),ae.transform&&"none"!==ae.transform&&(x.rr_transform=ae.transform,A.add("rr_transform")),ae.display&&ae.display.startsWith("inline")&&(x.rr_display=ae.display,A.add("rr_display")))}if("iframe"!==I||w(x.src)||(e.contentDocument||(x.rr_src=x.src),delete x.src),h||d)for(var oe of Object.entries(x)){var se=oe[0],le=oe[1];"string"!=typeof le&&null!==le||(x[se]=be({element:e,name:se,value:le,maskAllElementAttributes:h,maskAttributeFn:d,isGenerated:A.has(se)}))}z=!0;try{customElements.get(I)&&(q=!0)}catch(e){}return{type:f.Element,tagName:I,attributes:x,childNodes:[],isSVG:(U=e,Boolean("svg"===U.tagName||U.ownerSVGElement)||void 0),needBlock:M,rootId:S,isCustom:q}}(e,{doc:r,blockClass:n,blockSelector:i,inlineStylesheet:o,maskInputOptions:u,maskInputFn:c,maskAllElementAttributes:d,maskAttributeFn:v,dataURLOptions:m,inlineImages:y,recordCanvas:g,canvasMaskingConfigured:w,keepIframeSrcFn:b,newlyAddedElement:S,rootId:M});case e.TEXT_NODE:return function(e,t){var r,n=t.needsMask,i=t.maskTextFn,a=t.rootId,o=C.parentNode(e),s=o&&o.tagName,u=C.textContent(e),l="STYLE"===s||void 0,c="SCRIPT"===s||void 0;if(l&&u){try{if(e.nextSibling||e.previousSibling);else if(Q(o.sheet));else if(null==(r=o.sheet)?void 0:r.cssRules){var h=ue(o.sheet);h&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(h)&&(u=h)}}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}u=xe(u,Ue(t.doc))}return c&&(u="SCRIPT_PLACEHOLDER"),!l&&!c&&u&&n&&(u=i?i(u,C.parentElement(e)):u.replace(/[\S]/g,"*")),{type:f.Text,textContent:u||"",isStyle:l,rootId:a}}(e,{doc:r,needsMask:a,maskTextFn:l,rootId:M});case e.CDATA_SECTION_NODE:return{type:f.CDATA,textContent:"",rootId:M};case e.COMMENT_NODE:return{type:f.Comment,textContent:C.textContent(e)||"",rootId:M};default:return!1}}(e,{doc:r,mirror:n,blockClass:i,blockSelector:a,needsMask:X,inlineStylesheet:h,maskInputOptions:v,maskTextFn:p,maskInputFn:m,maskAllElementAttributes:g,maskAttributeFn:w,dataURLOptions:S,inlineImages:I,recordCanvas:x,canvasMaskingConfigured:R,keepIframeSrcFn:q,newlyAddedElement:z});if(!ae)return console.warn(e,"not serialized"),null;te=n.hasNode(e)?n.getId(e):function(e,t){if(t.comment&&e.type===f.Comment)return!0;if(e.type===f.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===function(e,t){var r,n;try{n=new URL(e,window.location.href)}catch(e){return null}var i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==i?void 0:i[1])&&void 0!==r?r:null}(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Ke(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Ke(e.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Ke(e.attributes.rel)))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Ke(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Ke(e.attributes.property).match(/^(og|twitter|fb):/)||Ke(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Ke(e.attributes.name)))return!0;if(t.headMetaRobots&&["robots","googlebot","bingbot"].includes(Ke(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(Ke(e.attributes.name))||Ke(e.attributes.property).match(/^article:/)||Ke(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(Ke(e.attributes.name)))return!0}}return!1}(ae,b)||!ee&&ae.type===f.Text&&!ae.isStyle&&!ae.textContent.replace(/^\s+|\s+$/gm,"").length?We:Pe();var oe=Object.assign(ae,{id:te});if(n.add(e,oe),te===We)return null;T&&T(e);var se=!l;if(oe.type===f.Element){se=se&&!oe.needBlock,delete oe.needBlock;var le=C.shadowRoot(e);le&&ie(le)&&(oe.isShadowHost=!0)}if((oe.type===f.Document||oe.type===f.Element)&&se){b.headWhitespace&&oe.type===f.Element&&"head"===oe.tagName&&(ee=!1);var ce={doc:r,mirror:n,blockClass:i,blockSelector:a,needsMask:X,maskTextClass:o,maskTextSelector:s,skipChild:l,inlineStylesheet:h,maskInputOptions:v,maskTextFn:p,maskInputFn:m,maskAllElementAttributes:g,maskAttributeFn:w,slimDOMOptions:b,dataURLOptions:S,inlineImages:I,recordCanvas:x,canvasMaskingConfigured:R,preserveWhiteSpace:ee,onSerialize:T,onIframeLoad:O,iframeLoadTimeout:E,onIframeListenerRegistered:N,onStylesheetLoad:_,stylesheetLoadTimeout:P,keepIframeSrcFn:q,depth:Z+1,maxDepth:J};if(oe.type===f.Element&&"textarea"===oe.tagName&&void 0!==oe.attributes.value);else for(var he of Array.from(C.childNodes(e))){var de=rt(he,ce);de&&oe.childNodes.push(de)}var fe=null;if(re(e)&&(fe=C.shadowRoot(e)))for(var ve of Array.from(C.childNodes(fe))){var pe=rt(ve,ce);pe&&(ie(fe)&&(pe.isShadow=!0),oe.childNodes.push(pe))}}var me=C.parentNode(e);if(me&&ne(me)&&ie(me)&&(oe.isShadow=!0),oe.type===f.Element&&"iframe"===oe.tagName){var we=function(e,t,r){var n,i=()=>{},a=e.contentWindow;if(!a)return i;try{n=a.document.readyState}catch(e){return i}var o=()=>t();if("complete"!==n){var s=!1,u=null,l=()=>{s||(s=!0,null!==u&&(clearTimeout(u),u=null),Je(e,"load",c),e.addEventListener("load",o),t())},c=()=>l();return u=setTimeout(l,r),e.addEventListener("load",c),()=>{null!==u&&(clearTimeout(u),u=null),s?Je(e,"load",o):(s=!0,Je(e,"load",c))}}var h,d="about:blank";try{h=a.location.href}catch(e){return i}if(h!==d||e.src===d||""===e.src){var f=setTimeout(t,0);return e.addEventListener("load",o),()=>{clearTimeout(f),Je(e,"load",o)}}return e.addEventListener("load",o),()=>{Je(e,"load",o)}}(e,(()=>{var t=e.contentDocument;if(t&&O){var r=rt(t,{doc:t,mirror:n,blockClass:i,blockSelector:a,needsMask:X,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:h,maskInputOptions:v,maskTextFn:p,maskInputFn:m,maskAllElementAttributes:g,maskAttributeFn:w,slimDOMOptions:b,dataURLOptions:S,inlineImages:I,recordCanvas:x,canvasMaskingConfigured:R,preserveWhiteSpace:ee,onSerialize:T,onIframeLoad:O,iframeLoadTimeout:E,onIframeListenerRegistered:N,onStylesheetLoad:_,stylesheetLoadTimeout:P,keepIframeSrcFn:q,depth:Z+1,maxDepth:J});r&&O(e,r)}}),E);null==N||N(e,we)}return oe.type===f.Element&&"link"===oe.tagName&&"stylesheet"===oe.attributes.rel&&function(t,u,l){if(!Xe.has(t)){var c;try{c=t.sheet}catch(e){return}if(!c){var d=new AbortController,f=!1,y=()=>{if(!f){f=!0;try{(()=>{if(_){var t=rt(e,{doc:r,mirror:n,blockClass:i,blockSelector:a,needsMask:X,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:h,maskInputOptions:v,maskTextFn:p,maskInputFn:m,maskAllElementAttributes:g,maskAttributeFn:w,slimDOMOptions:b,dataURLOptions:S,inlineImages:I,recordCanvas:x,canvasMaskingConfigured:R,preserveWhiteSpace:ee,onSerialize:T,onIframeLoad:O,iframeLoadTimeout:E,onStylesheetLoad:_,stylesheetLoadTimeout:P,keepIframeSrcFn:q,depth:Z,maxDepth:J});t&&_(e,t)}})()}finally{Xe.delete(t),d.abort()}}},k=setTimeout(y,l);d.signal.addEventListener("abort",(()=>clearTimeout(k)),{once:!0}),t.addEventListener("load",y,{signal:d.signal,once:!0}),Xe.set(t,d)}}}(e,0,P),oe}function nt(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:!1===e?{}:e}class it{constructor(){o(this,"parentElement",null),o(this,"parentNode",null),o(this,"ownerDocument"),o(this,"firstChild",null),o(this,"lastChild",null),o(this,"previousSibling",null),o(this,"nextSibling",null),o(this,"ELEMENT_NODE",1),o(this,"TEXT_NODE",3),o(this,"nodeType"),o(this,"nodeName"),o(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof it))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;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 at(e,t,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>ot(r,e,t,n)}function ot(e,t,r,n){st((()=>{var i=e.removeEventListener;"function"==typeof i&&(void 0!==n?i.call(e,t,r,n):i.call(e,t,r))}))}function st(e){try{e()}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}}var ut="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",lt={map:{},getId(){return console.error(ut),-1},getNode(){return console.error(ut),null},removeNodeFromMap(){console.error(ut)},has(){return console.error(ut),!1},reset(){console.error(ut)}};function ct(e,t,r){void 0===r&&(r={});var n=null,i=0;return function(){for(var a=arguments.length,o=new Array(a),s=0;a>s;s++)o[s]=arguments[s];var u=Date.now();i||!1!==r.leading||(i=u);var l=t-(u-i),c=this;0>=l||l>t?(n&&(clearTimeout(n),n=null),i=u,e.apply(c,o)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(c,o)}),l))}}function ht(e,t,r,n,i){void 0===i&&(i=window);var a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(e){if(setTimeout((()=>{try{r.set.call(this,e)}catch(e){}}),0),a&&a.set){if(a.get)try{a.get.call(this)}catch(e){return}a.set.call(this,e)}}}),()=>ht(e,t,a||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(lt=new Proxy(lt,{get(e,t,r){return"map"===t&&console.error(ut),Reflect.get(e,t,r)}}));var dt=Date.now;function ft(e){var t,r,n,i,a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:a.documentElement.scrollLeft||(null==a?void 0:a.body)&&(null==(t=C.parentElement(a.body))?void 0:t.scrollLeft)||(null==(r=null==a?void 0:a.body)?void 0:r.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null==a?void 0:a.body)&&(null==(n=C.parentElement(a.body))?void 0:n.scrollTop)||(null==(i=null==a?void 0:a.body)?void 0:i.scrollTop)||0}}function vt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function pt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function mt(e){return e?e.nodeType===e.ELEMENT_NODE?e:C.parentElement(e):null}function yt(e,t,r,n){if(!e)return!1;var i=mt(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(Ve(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1}function gt(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===We}function wt(e,t){if(ne(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var n=C.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||wt(n,t))}function bt(e){return Boolean(e.changedTouches)}function kt(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function St(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Mt(e){return!!e&&(e instanceof it&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(C.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(dt=()=>(new Date).getTime());class It{constructor(){o(this,"id",1),o(this,"styleIDMap",new WeakMap),o(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var 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 Ct(e){var t,r=null;return"getRootNode"in e&&(null==(t=C.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(e))&&(r=C.host(C.getRootNode(e))),r}function At(e){var t=e.ownerDocument;return!!t&&(C.contains(t,e)||function(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Ct(r);)r=t;return r}(e);return C.contains(t,r)}(e))}function xt(e){return"__ln"in e}class Rt{constructor(){o(this,"length",0),o(this,"head",null),o(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;e>r;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&xt(e.previousSibling)){var 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&&xt(e.nextSibling)&&e.nextSibling.__ln.previous){var n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){var 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--)}}var Tt,Ot=(e,t)=>e+"@"+t;class Ft{constructor(){o(this,"frozen",!1),o(this,"locked",!1),o(this,"texts",[]),o(this,"attributes",[]),o(this,"attributeMap",new WeakMap),o(this,"generatedAttributes",new WeakMap),o(this,"removes",[]),o(this,"mapRemoves",[]),o(this,"movedMap",{}),o(this,"addedSet",new Set),o(this,"movedSet",new Set),o(this,"droppedSet",new Set),o(this,"removesSubTreeCache",new Set),o(this,"mutationCb"),o(this,"blockClass"),o(this,"blockSelector"),o(this,"maskTextClass"),o(this,"maskTextSelector"),o(this,"inlineStylesheet"),o(this,"maskInputOptions"),o(this,"maskTextFn"),o(this,"maskInputFn"),o(this,"maskAllElementAttributes"),o(this,"maskAttributeFn"),o(this,"keepIframeSrcFn"),o(this,"recordCanvas"),o(this,"canvasMaskingConfigured"),o(this,"inlineImages"),o(this,"slimDOMOptions"),o(this,"dataURLOptions"),o(this,"doc"),o(this,"mirror"),o(this,"iframeManager"),o(this,"stylesheetManager"),o(this,"shadowDomManager"),o(this,"canvasManager"),o(this,"processedNodeManager"),o(this,"unattachedDoc"),o(this,"canvasManagerReleased",!1),o(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),o(this,"emit",(()=>{if(!this.frozen&&!this.locked){var e,t,r=x(),n=F();try{this.processBufferedMutations()}finally{e=x()-r,t=n,L>0||E(e,null!=t?t:R)||e>q.slowestBatchMs&&(q.slowestBatchMs=e)}}})),o(this,"processBufferedMutations",(()=>{for(var e=[],t=new Set,r=new Rt,n=e=>{for(var t=e,r=We;r===We;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},i=i=>{var a=C.parentNode(i);if(a&&At(i)&&"TEXTAREA"!==a.tagName){var o=ne(a)?this.mirror.getId(Ct(i)):this.mirror.getId(a),s=n(i);if(-1===o||-1===s)return r.addNode(i);var u=rt(i,{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,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:e=>{kt(e,this.mirror)&&this.iframeManager.addIframe(e),St(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Mt(e)&&!yt(e,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(e),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onIframeListenerRegistered:(e,t)=>{this.iframeManager.registerLoadListenerDisposer(e,t)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});u&&(e.push({parentId:o,nextId:s,node:u}),t.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var a of this.movedSet)Lt(this.removesSubTreeCache,a)&&!this.movedSet.has(C.parentNode(a))||i(a);for(var o of this.addedSet)Nt(this.droppedSet,o)||Lt(this.removesSubTreeCache,o)?Nt(this.movedSet,o)?i(o):this.droppedSet.add(o):i(o);for(var s=null;r.length;){var u=null;if(s){var l=this.mirror.getId(C.parentNode(s.value)),c=n(s.value);-1!==l&&-1!==c&&(u=s)}if(!u)for(var h=r.tail;h;){var d=h;if(h=h.previous,d){var f=this.mirror.getId(C.parentNode(d.value));if(-1===n(d.value))continue;if(-1!==f){u=d;break}var v=C.parentNode(d.value);if(v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=C.host(v);if(-1!==this.mirror.getId(p)){u=d;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}s=u.previous,r.removeNode(u.value),i(u.value)}var m={texts:this.texts.map((e=>{var t=e.node,r=C.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{var t,r=e.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof r.style){var n=JSON.stringify(e.styleDiff),i=JSON.stringify(e._unchangedStyles);r.style.length>n.length&&(n+i).split("var(").length===r.style.split("var(").length&&(r.style=e.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var a of Object.entries(r)){var o=a[0],s=a[1];"string"!=typeof s&&null!==s||(r[o]=be({element:e.node,name:o,value:s,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null==(t=this.generatedAttributes.get(e.node))?void 0:t.has(o)}))}return{id:this.mirror.getId(e.node),attributes:r}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},(m.texts.length||m.attributes.length||m.removes.length||m.adds.length)&&this.mutationCb(m)})),o(this,"bufferBelongsToIframe",(e=>this.doc===e.contentDocument)),o(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(this.attributes.push(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e,t));var r=Array.from(C.childNodes(e),(e=>C.textContent(e)||"")).join("");t.attributes.value=ye({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Se(e),value:r,maskInputFn:this.maskInputFn})})),o(this,"processMutation",(e=>{var t;if(!gt(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var r=C.textContent(e.target);yt(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue||this.texts.push({value:$e(e.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,mt(e.target)):r.replace(/[\S]/g,"*"):r,node:e.target});break;case"attributes":var n,i=e.target,a=e.attributeName,o=null!==(n=e.attributeNamespace)&&void 0!==n?n:null,s=function(e,t,r){if(!r)return t;var n=e.getAttributeNodeNS(r,t);if(n)return n.name;if("http://www.w3.org/1999/xlink"===r)return"xlink:"+t;if("http://www.w3.org/XML/1998/namespace"===r)return"xml:"+t;if("http://www.w3.org/2000/xmlns/"===r)return"xmlns"===t?t:"xmlns:"+t;var i=e.lookupPrefix(r);return i?i+":"+t:t}(i,a,o),u=o?i.getAttributeNS(o,a):e.target.getAttribute(a);if("value"===s){var l=i,c=Se(l);u=ye({element:l,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:c,value:u,maskInputFn:this.maskInputFn})}if(yt(e.target,this.blockClass,this.blockSelector,!1)||u===e.oldValue)return;var h=this.attributeMap.get(e.target),d="IFRAME"===i.tagName&&"src"===s;if(d&&!this.keepIframeSrcFn(u)&&i.contentDocument)return;if(h||(this.attributes.push(h={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e.target,h)),"type"===s&&"INPUT"===i.tagName&&"password"===(e.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!Ze(i.tagName,s)){var f=Ge(this.doc,ge(i.tagName),ge(s),u,i,this.dataURLOptions);if(d&&!this.keepIframeSrcFn(u)&&(s="rr_src"),h.attributes[s]=f,null==(t=this.generatedAttributes.get(e.target))||t.delete(s),"style"===s){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}var v=this.unattachedDoc.createElement("span"),p=i.style;for(var m of(e.oldValue&&(v.style.cssText=e.oldValue),Array.from(p))){var y=p.getPropertyValue(m),g=p.getPropertyPriority(m);y!==v.style.getPropertyValue(m)||g!==v.style.getPropertyPriority(m)?h.styleDiff[m]=""===g?y:[y,g]:h._unchangedStyles[m]=[y,g]}for(var w of Array.from(v.style))""===p.getPropertyValue(w)&&(h.styleDiff[w]=!1)}else if("open"===s&&"DIALOG"===i.tagName){h.attributes.rr_open_mode=i.matches("dialog:modal")?"modal":"non-modal";var b=this.generatedAttributes.get(e.target);b||this.generatedAttributes.set(e.target,b=new Set),b.add("rr_open_mode")}}break;case"childList":if(yt(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{var r=this.mirror.getId(t),n=ne(e.target)?this.mirror.getId(C.host(e.target)):this.mirror.getId(e.target);yt(e.target,this.blockClass,this.blockSelector,!1)||gt(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Et(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||wt(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ot(r,n)]?Et(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!ne(e.target)||!ie(e.target))||void 0}),function(e,t){for(var r=[e];r.length;){var n=r.pop();t.has(n)||(t.add(n),C.childNodes(n).forEach((e=>r.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),o(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)){if(this.addedSet.has(e))return this.addedSet.delete(e),void this.addedSet.add(e);if(!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(gt(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[Ot(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);yt(e,this.blockClass,this.blockSelector,!1)||(C.childNodes(e).forEach((e=>this.genAdds(e))),Mt(e)&&C.childNodes(C.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAllElementAttributes","maskAttributeFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]})),this.canvasManager.acquire()}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.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function Et(e,t){for(var r=[t];r.length;){var n=r.pop();e.delete(n),C.childNodes(n).forEach((e=>r.push(e)))}}function Lt(e,t,r){return 0!==e.size&&function(e,t,r){var n=C.parentNode(t);return!!n&&e.has(n)}(e,t)}function Nt(e,t){if(0===e.size)return!1;for(var r=C.parentNode(t);r;){if(e.has(r))return!0;r=C.parentNode(r)}return!1}var _t=function(e,t){return void 0===t&&(t="rrweb"),Tt?function(){try{return e(...arguments)}catch(e){if(Tt&&!0===Tt(e,t))return;throw e}}:e},Dt=[];function Wt(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function Pt(e,t){var r,n=new Ft;n.init(e);try{r=new(M())(_t(n.processMutations.bind(n)));var i={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return e.attributeFilter&&e.attributeFilter.length>0&&(i.attributeFilter=e.attributeFilter),r.observe(t,i),Dt.push(n),{observer:r,buffer:n}}catch(e){try{null==r||r.disconnect(),n.destroy(),n.reset()}catch(e){}throw e}}function jt(e){var t=e.scrollCb,r=e.doc,n=e.mirror,i=e.blockClass,a=e.blockSelector,o=e.sampling,s=new Map,u=e=>{var o=Wt(e);if(o&&!yt(o,i,a,!0)){var u,l,c=n.getId(o);if(o===r&&r.defaultView){var h=ft(r.defaultView);u=h.left,l=h.top}else u=o.scrollLeft,l=o.scrollTop;var d=u+","+l;s.get(c)!==d&&(s.set(c,d),t({id:c,x:u,y:l}))}},l=[at("scroll",_t(ct(_t((e=>u(e))),o.scroll||100)),r)];return"onscrollend"in r&&l.push(at("scrollend",_t(u),r)),()=>l.forEach((e=>e()))}function Bt(e,t){for(var r=Dt.length-1;r>=0;r--){var n=Dt[r];if(n){var i=n.bufferBelongsToIframe(e);!i&&t&&t.has(n.bufferDoc())&&(i=!0),i&&(n.reset(),Dt.splice(r,1))}}}var Ht=["INPUT","TEXTAREA","SELECT"],qt=new WeakMap;function Ut(e){return function e(t,r){if($t("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||$t("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||$t("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||$t("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var n=Array.from(t.parentRule.cssRules).indexOf(t);return r.unshift(n),e(t.parentRule,r)}if(t.parentStyleSheet){var i=Array.from(t.parentStyleSheet.cssRules).indexOf(t);r.unshift(i)}return r}(e,[])}function zt(e,t,r){var n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}var Gt=5e3;function Zt(e,t){var r,n,i,a,o=e.stylesheetManager;a=e.mirror.getId("#document"===t.nodeName?t:C.host(t));var s="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(i=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:i.ShadowRoot,u=(null==s?void 0:s.prototype)?Object.getOwnPropertyDescriptor(null==s?void 0:s.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&s&&u?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var e;return null==(e=u.get)?void 0:e.call(this)},set(e){var t,r;try{r=null==(t=u.set)?void 0:t.call(this,e)}catch(e){if(e&&"object"==typeof e&&"NotAllowedError"===e.name)return;throw e}if(null!==a&&-1!==a)try{o.adoptStyleSheets(e,a)}catch(e){}return r}}),_t((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function Vt(e,t){void 0===t&&(t={});var n,i,a=e.doc.defaultView;if(!a)return()=>{};!function(e,t){var r=e.mutationCb,n=e.mousemoveCb,i=e.mouseInteractionCb,a=e.scrollCb,o=e.viewportResizeCb,s=e.inputCb,u=e.mediaInteractionCb,l=e.styleSheetRuleCb,c=e.styleDeclarationCb,h=e.canvasMutationCb,d=e.fontCb,f=e.selectionCb,v=e.customElementCb;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),r(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),n(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),i(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),a(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),o(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),s(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),u(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),l(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),c(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),h(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),d(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),f(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),v(...arguments)}}(e,t);var o,s,h,f,v,p,m,y,g=[],w=_t((()=>{if(i){i.destroy(),i.reset();var t=Dt.indexOf(i);-1!==t&&Dt.splice(t,1)}e.shadowDomManager.resetForDoc(e.doc),null==n||n.disconnect(),g.forEach((e=>e()))}));try{if(e.recordDOM){var b=Pt(e,e.doc);n=b.observer,i=b.buffer}if(g.push(function(e){var t=e.mousemoveCb,r=e.sampling,n=e.doc,i=e.mirror;if(!1===r.mousemove)return()=>{};var a,o="number"==typeof r.mousemove?r.mousemove:50,s="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],c=ct(_t((e=>{var r=Date.now()-a;t(l.map((e=>(e.timeOffset-=r,e))),e),l=[],a=null})),s),h=_t(ct(_t((e=>{var t=Wt(e),r=bt(e)?e.changedTouches[0]:e,n=r.clientX,o=r.clientY;a||(a=dt()),l.push({x:n,y:o,id:i.getId(t),timeOffset:dt()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?u.Drag:e instanceof MouseEvent?u.MouseMove:u.TouchMove)})),o,{trailing:!1})),d=[at("mousemove",h,n),at("touchmove",h,n),at("drag",h,n)];return _t((()=>{d.forEach((e=>e()))}))}(e)),g.push(function(e){var t=e.mouseInteractionCb,n=e.doc,i=e.mirror,a=e.blockClass,o=e.blockSelector,s=e.sampling;if(!1===s.mouseInteraction)return()=>{};var u=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,h=[],d=null;return Object.keys(l).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==u[e])).forEach((e=>{var s=ge(e),u=(e=>n=>{var s=Wt(n);if(!yt(s,a,o,!0)){var u=null,h=e;if("pointerType"in n){switch(n.pointerType){case"mouse":u=c.Mouse;break;case"touch":u=c.Touch;break;case"pen":u=c.Pen}u===c.Touch&&(l[e]===l.MouseDown?h="TouchStart":l[e]===l.MouseUp&&(h="TouchEnd"))}else bt(n)&&(u=c.Touch);null!==u?(d=u,(h.startsWith("Touch")&&u===c.Touch||h.startsWith("Mouse")&&u===c.Mouse)&&(u=null)):l[e]===l.Click&&(u=d,d=null);var f=bt(n)?n.changedTouches[0]:n;if(f){var v=i.getId(s),p=f.clientX,m=f.clientY;_t(t)(r({type:l[h],id:v,x:p,y:m},null!==u&&{pointerType:u}))}}})(e);if(window.PointerEvent)switch(l[e]){case l.MouseDown:case l.MouseUp:s=s.replace("mouse","pointer");break;case l.TouchStart:case l.TouchEnd:return}h.push(at(s,u,n))})),_t((()=>{h.forEach((e=>e()))}))}(e)),g.push(jt(e)),g.push(function(e,t){var r=e.viewportResizeCb,n=t.win,i=-1,a=-1;return at("resize",_t(ct(_t((()=>{var e=vt(),t=pt();i===e&&a===t||(r({width:Number(t),height:Number(e)}),i=e,a=t)})),200)),n)}(e,{win:a})),g.push(function(e){var t=e.inputCb,n=e.doc,i=e.mirror,a=e.blockClass,o=e.blockSelector,s=e.ignoreClass,u=e.ignoreSelector,l=e.maskInputOptions,c=e.maskInputFn,h=e.userTriggeredOnInput;function d(e){var t=Wt(e),r=e.isTrusted,i=n.defaultView;if(!t||!i||t instanceof i.HTMLElement){var d=t&&t.tagName;if(t&&"OPTION"===d&&(t=C.parentElement(t)),t&&d&&Ht.indexOf(d)>=0&&!yt(t,a,o,!0)&&!(t.classList.contains(s)||u&&t.matches(u))){var v=t.value,p=!1,m=Se(t)||"";"radio"===m||"checkbox"===m?p=t.checked:(l[d.toLowerCase()]||l[m])&&(v=ye({element:t,maskInputOptions:l,tagName:d,type:m,value:v,maskInputFn:c})),f(t,h?{text:v,isChecked:p,userTriggered:r}:{text:v,isChecked:p});var y=t.name;"radio"===m&&y&&p&&n.querySelectorAll('input[type="radio"][name="'+y+'"]').forEach((e=>{if(e!==t){var r=e.value;f(e,h?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}}function f(e,n){var a=qt.get(e);if(!a||a.text!==n.text||a.isChecked!==n.isChecked){qt.set(e,n);var o=i.getId(e);_t(t)(r({},n,{id:o}))}}var v=("last"===e.sampling.input?["change"]:["input","change"]).map((e=>at(e,_t(d),n))),p=n.defaultView;if(!p)return()=>{v.forEach((e=>e()))};var m=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return m&&m.set&&v.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map((e=>ht(e[0],e[1],{set(){_t(d)({target:this,isTrusted:!1})}},!1,p)))),_t((()=>{v.forEach((e=>e()))}))}(e)),g.push(function(e){var t=e.mediaInteractionCb,r=e.blockClass,n=e.blockSelector,i=e.mirror,a=e.sampling,o=e.doc,s=_t((e=>ct(_t((a=>{var o=Wt(a);if(o&&!yt(o,r,n,!0)){var s=o.currentTime,u=o.volume,l=o.muted,c=o.playbackRate,h=o.loop;t({type:e,id:i.getId(o),currentTime:s,volume:u,muted:l,playbackRate:c,loop:h})}})),a.media||500))),u=[at("play",s(d.Play),o),at("pause",s(d.Pause),o),at("seeked",s(d.Seeked),o),at("volumechange",s(d.VolumeChange),o),at("ratechange",s(d.RateChange),o)];return _t((()=>{u.forEach((e=>e()))}))}(e)),e.recordDOM){var k=function(e){var t=new Map,r=new Set,n=!0,i=e=>{if(n)try{e()}catch(e){}},a=e=>{var r,n=t.get(e);if(n){for(;null==(r=n[0])?void 0:r.ready;){var a=n.shift();(null==a?void 0:a.emit)&&i(a.emit)}0===n.length&&t.delete(e)}};return{queueMutation(e,r){if(e){var n=t.get(e);n?(n.push({emit:r,ready:!0}),a(e)):i(r)}else i(r)},queuePendingMutation(o,s,u){if(!n)return()=>{};var l=t.get(o);l||t.set(o,l=[]);var c={emit:s,ready:!1};l.push(c);var h,d=!1,f=!1,v=()=>{d||f||(d=!0,void 0!==h&&r.delete(h),c.ready=!0,c.emit=void 0,a(o))};try{h=e.setTimeout(v,Gt),d||f?e.clearTimeout(h):r.add(h)}catch(e){v()}return t=>{!f&&n&&(f=!0,void 0!==h&&(e.clearTimeout(h),r.delete(h)),d?t&&i(u):(c.ready=!0,t||(c.emit=void 0),a(o)))}},reset(){n=!1,r.forEach((t=>e.clearTimeout(t))),r.clear(),t.clear()}}}(a);g.push(k.reset),g.push(function(e,t){var r=e.styleSheetRuleCb,n=e.mirror,i=e.stylesheetManager,a=t.win,o=t.mutationQueue;if(!a.CSSStyleSheet||!a.CSSStyleSheet.prototype)return()=>{};var s=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:_t(((e,t,a)=>{var s=a[0],u=e.apply(t,a);i.onCssomSheetMutation(t);var l=zt(t,n,i.styleMirror),c=l.id,h=l.styleId;return(c&&-1!==c||h&&-1!==h)&&o.queueMutation(t,(()=>r({id:c,styleId:h,adds:[{rule:s,index:u}]}))),u}),"host")}),a.CSSStyleSheet.prototype.addRule=function(e,t,r){return void 0===r&&(r=this.cssRules.length),a.CSSStyleSheet.prototype.insertRule.apply(this,[e+" { "+t+" }",r])};var u,l,c=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=new Proxy(c,{apply:_t(((e,t,a)=>{var s=a[0],u=e.apply(t,a);i.onCssomSheetMutation(t);var l=zt(t,n,i.styleMirror),c=l.id,h=l.styleId;return(c&&-1!==c||h&&-1!==h)&&o.queueMutation(t,(()=>r({id:c,styleId:h,removes:[{index:s}]}))),u}),"host")}),a.CSSStyleSheet.prototype.removeRule=function(e){return a.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},a.CSSStyleSheet.prototype.replace&&(u=a.CSSStyleSheet.prototype.replace,a.CSSStyleSheet.prototype.replace=new Proxy(u,{apply:_t(((e,t,a)=>{var s=a[0],u=e.apply(t,a);try{var l=null==u?void 0:u.then;if(t.ownerNode||!u||"function"!=typeof l)return u;i.onCssomSheetMutation(t);var c=zt(t,n,i.styleMirror),h=c.id,d=c.styleId;if(!(h&&-1!==h||d&&-1!==d))return u;var f=o.queuePendingMutation(t,(()=>r({id:h,styleId:d,replace:s})),(()=>{var e=ue(t);null!==e&&r({id:h,styleId:d,replace:e})}));try{l.call(u,(()=>f(!0)),(()=>f(!1)))}catch(e){f(!1)}}catch(e){}return u}),"host")})),a.CSSStyleSheet.prototype.replaceSync&&(l=a.CSSStyleSheet.prototype.replaceSync,a.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:_t(((e,t,a)=>{var s=a[0],u=e.apply(t,a);i.onCssomSheetMutation(t);var l=zt(t,n,i.styleMirror),c=l.id,h=l.styleId;return(c&&-1!==c||h&&-1!==h)&&o.queueMutation(t,(()=>r({id:c,styleId:h,replaceSync:s}))),u}),"host")}));var h={};Jt("CSSGroupingRule")?h.CSSGroupingRule=a.CSSGroupingRule:(Jt("CSSMediaRule")&&(h.CSSMediaRule=a.CSSMediaRule),Jt("CSSConditionRule")&&(h.CSSConditionRule=a.CSSConditionRule),Jt("CSSSupportsRule")&&(h.CSSSupportsRule=a.CSSSupportsRule));var d={};return Object.entries(h).forEach((e=>{var t=e[0],a=e[1];d[t]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=new Proxy(d[t].insertRule,{apply:_t(((e,t,a)=>{var s=a[0],u=e.apply(t,a);i.onCssomSheetMutation(t.parentStyleSheet);var l=zt(t.parentStyleSheet,n,i.styleMirror),c=l.id,h=l.styleId;if(t.parentStyleSheet&&(c&&-1!==c||h&&-1!==h)){var d=[...Ut(t),u];o.queueMutation(t.parentStyleSheet,(()=>r({id:c,styleId:h,adds:[{rule:s,index:d}]})))}return u}),"host")}),a.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:_t(((e,t,a)=>{var s=a[0],u=e.apply(t,a);i.onCssomSheetMutation(t.parentStyleSheet);var l=zt(t.parentStyleSheet,n,i.styleMirror),c=l.id,h=l.styleId;if(t.parentStyleSheet&&(c&&-1!==c||h&&-1!==h)){var d=[...Ut(t),s];o.queueMutation(t.parentStyleSheet,(()=>r({id:c,styleId:h,removes:[{index:d}]})))}return u}),"host")})})),_t((()=>{a.CSSStyleSheet.prototype.insertRule=s,a.CSSStyleSheet.prototype.deleteRule=c,u&&(a.CSSStyleSheet.prototype.replace=u),l&&(a.CSSStyleSheet.prototype.replaceSync=l),Object.entries(h).forEach((e=>{var t=e[0],r=e[1];r.prototype.insertRule=d[t].insertRule,r.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:a,mutationQueue:k})),g.push(Zt(e,e.doc)),g.push(function(e,t){var r=e.styleDeclarationCb,n=e.mirror,i=e.ignoreCSSAttributes,a=e.stylesheetManager,o=t.win,s=t.mutationQueue,u=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(u,{apply:_t(((e,t,o)=>{var u,l=o[0],c=o[1],h=o[2],d=e.apply(t,o);if(i.has(l))return d;var f=null==(u=t.parentRule)?void 0:u.parentStyleSheet;a.onCssomSheetMutation(f);var v=zt(f,n,a.styleMirror),p=v.id,m=v.styleId;if(p&&-1!==p||m&&-1!==m){var y=Ut(t.parentRule);s.queueMutation(f,(()=>r({id:p,styleId:m,set:{property:l,value:c,priority:h},index:y})))}return d}),"host")});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:_t(((e,t,o)=>{var u,l=o[0],c=e.apply(t,o);if(i.has(l))return c;var h=null==(u=t.parentRule)?void 0:u.parentStyleSheet;a.onCssomSheetMutation(h);var d=zt(h,n,a.styleMirror),f=d.id,v=d.styleId;if(f&&-1!==f||v&&-1!==v){var p=Ut(t.parentRule);s.queueMutation(h,(()=>r({id:f,styleId:v,remove:{property:l},index:p})))}return c}),"host")}),_t((()=>{o.CSSStyleDeclaration.prototype.setProperty=u,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:a,mutationQueue:k})),e.collectFonts&&g.push(function(e){var t=e.fontCb,r=e.doc,n=r.defaultView;if(!n)return()=>{};var i=[],a=new WeakMap,o=n.FontFace;n.FontFace=function(e,t,r){var n=new o(e,t,r);return a.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};var s=I(r.fonts,"add",(function(e){return function(r){return setTimeout(_t((()=>{var e=a.get(r);e&&(t(e),a.delete(r))})),0),e.apply(this,[r])}}));return i.push((()=>{n.FontFace=o})),i.push(s),_t((()=>{i.forEach((e=>e()))}))}(e))}for(var S of(g.push((s=(o=e).doc,h=o.mirror,f=o.blockClass,v=o.blockSelector,p=o.selectionCb,m=!0,(y=_t((()=>{var e=s.getSelection();if(!(!e||m&&(null==e?void 0:e.isCollapsed))){m=e.isCollapsed||!1;for(var t=[],r=e.rangeCount||0,n=0;r>n;n++){var i=e.getRangeAt(n),a=i.startContainer,o=i.startOffset,u=i.endContainer,l=i.endOffset;yt(a,f,v,!0)||yt(u,f,v,!0)||t.push({start:h.getId(a),startOffset:o,end:h.getId(u),endOffset:l})}p({ranges:t})}})))(),at("selectionchange",y))),g.push(function(e){var t=e.customElementCb,r=e.doc.defaultView;return r&&r.customElements?I(r.customElements,"define",(function(e){return function(r,n,i){try{t({define:{name:r}})}catch(e){console.warn("Custom element callback failed for "+r)}return e.apply(this,[r,n,i])}})):()=>{}}(e)),e.plugins))g.push(S.observer(S.callback,a,S.options))}catch(e){try{w()}catch(e){}throw e}return w}function $t(e){return void 0!==window[e]}function Jt(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Xt{constructor(e){o(this,"iframeRemoteIdToLocalIdMap",new WeakMap),o(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){if(0>t)return t;var i=r||this.getRemoteIdToLocalIdMap(e),a=n||this.getLocalIdToRemoteIdMap(e),o=i.get(t);return void 0===o&&(o=this.generateIdFn(),i.set(t,o),a.set(o,t)),o}getIds(e,t){var r=this.getRemoteIdToLocalIdMap(e),n=this.getLocalIdToRemoteIdMap(e);return t.map((t=>this.getId(e,t,r,n)))}getRemoteId(e,t,r){var n;return"number"!=typeof t||0>t?t:null!==(n=(r||this.getLocalIdToRemoteIdMap(e)).get(t))&&void 0!==n?n:-1}getRemoteIds(e,t){var r=this.getLocalIdToRemoteIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(e),this.iframeLocalIdToRemoteIdMap.delete(e)}getRemoteIdToLocalIdMap(e){var t=this.iframeRemoteIdToLocalIdMap.get(e);return t||this.iframeRemoteIdToLocalIdMap.set(e,t=new Map),t}getLocalIdToRemoteIdMap(e){var t=this.iframeLocalIdToRemoteIdMap.get(e);return t||this.iframeLocalIdToRemoteIdMap.set(e,t=new Map),t}}class Yt{constructor(e){o(this,"iframes",new WeakMap),o(this,"crossOriginIframeMap",new WeakMap),o(this,"crossOriginIframeMirror",new Xt(Pe)),o(this,"crossOriginIframeStyleMirror"),o(this,"crossOriginIframeRootIdMap",new WeakMap),o(this,"mirror"),o(this,"mutationCb"),o(this,"wrappedEmit"),o(this,"loadListener"),o(this,"pageHideListener"),o(this,"stylesheetManager"),o(this,"recordCrossOriginIframes"),o(this,"messageHandler"),o(this,"nestedIframeListeners",new Map),o(this,"attachedWindows",new WeakMap),o(this,"attachedDocuments",new WeakMap),o(this,"attachedIframes",new Map),o(this,"loadListenerDisposers",new WeakMap),o(this,"iframeElementsById",new Map),o(this,"pageHideHandlers",new WeakMap),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Xt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}registerLoadListenerDisposer(e,t){var r=this.loadListenerDisposers.get(e);r||this.loadListenerDisposers.set(e,r=new Set),r.add(t);var n=this.mirror.getId(e);-1!==n&&this.iframeElementsById.set(n,e)}getIframeElementById(e){var t,r,n;return null!==(t=null!==(r=null==(n=this.attachedIframes.get(e))?void 0:n.element)&&void 0!==r?r:this.iframeElementsById.get(e))&&void 0!==t?t:null}forgetIframeId(e){this.attachedIframes.delete(e),this.iframeElementsById.delete(e)}disposeLoadListeners(e){var t=this.loadListenerDisposers.get(e);t&&(t.forEach((e=>st(e))),this.loadListenerDisposers.delete(e))}removePageHideListener(e){var t=this.pageHideHandlers.get(e);t&&(t.forEach((e=>{ot(e.win,"pagehide",e.handler)})),this.pageHideHandlers.delete(e))}addLoadListener(e){this.loadListener=e}addPageHideListener(e){this.pageHideListener=e}removeLoadListener(){this.loadListener=void 0}trackIframeContent(e,t){var r=this.mirror.getId(e);return this.attachedIframes.set(r,{element:e,content:t}),r}attachIframe(e,t){var r,n=this.trackIframeContent(e,t);if(e.contentDocument){var i=this.attachedDocuments.get(e);i||this.attachedDocuments.set(e,i=new Set),i.add(e.contentDocument)}this.mutationCb({adds:[{parentId:n,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var a=e.contentWindow;if(this.recordCrossOriginIframes&&a&&!this.nestedIframeListeners.has(a)){var o=this.handleMessage.bind(this);st((()=>{a.addEventListener("message",o),this.nestedIframeListeners.set(a,o);var t=this.attachedWindows.get(e);t||this.attachedWindows.set(e,t=new Set),t.add(a)}))}st((()=>{var t=e.contentWindow;if(t){var r=this.pageHideHandlers.get(e);if(r)for(var n of r)if(n.win===t)return;var i=()=>{var t;null==(t=this.pageHideListener)||t.call(this,e),e.contentDocument&&this.mirror.removeNodeFromMap(e.contentDocument),e.contentWindow&&this.crossOriginIframeMap.delete(e.contentWindow)};t.addEventListener("pagehide",i),r||this.pageHideHandlers.set(e,r=new Set),r.add({win:t,handler:i})}})),null==(r=this.loadListener)||r.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){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var r=this.crossOriginIframeMap.get(e.source);if(r){var n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var r;switch(t.type){case s.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),this.trackIframeContent(e,t.data.node),{timestamp:t.timestamp,type:s.IncrementalSnapshot,data:{source:u.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case s.Meta:case s.Load:case s.DomContentLoaded:return!1;case s.Plugin:return t;case s.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case s.IncrementalSnapshot:switch(t.data.source){case u.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case u.Drag:case u.TouchMove:case u.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case u.ViewportResize:return!1;case u.MediaInteraction:case u.MouseInteraction:case u.Scroll:case u.CanvasMutation:case u.Input:return this.replaceIds(t.data,e,["id"]),t;case u.StyleSheetRule:case u.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case u.Font:return t;case u.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case u.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,n){for(var i of n)(Array.isArray(t[i])||"number"==typeof t[i])&&(t[i]=Array.isArray(t[i])?e.getIds(r,t[i]):e.getId(r,t[i]));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((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===f.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}removeIframeById(e){var t=this.attachedIframes.get(e),r=(null==t?void 0:t.element)||this.iframeElementsById.get(e)||this.mirror.getNode(e);if(this.iframeElementsById.delete(e),r){var n=r.contentWindow,i=this.attachedWindows.get(r);i&&(i.forEach((e=>{var t=this.nestedIframeListeners.get(e);t&&(ot(e,"message",t),this.nestedIframeListeners.delete(e)),this.crossOriginIframeMap.delete(e)})),this.attachedWindows.delete(r)),n&&this.nestedIframeListeners.has(n)&&(ot(n,"message",this.nestedIframeListeners.get(n)),this.nestedIframeListeners.delete(n)),n&&this.crossOriginIframeMap.delete(n),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var a=this.attachedDocuments.get(r);a&&(a.forEach((e=>{st((()=>this.mirror.removeNodeFromMap(e)))})),st((()=>Bt(r,a))),this.attachedDocuments.delete(r))}t&&this.attachedIframes.delete(e)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var e=[];this.attachedIframes.forEach(((t,r)=>{this.mirror.has(r)||e.push(r)})),e.forEach((e=>this.removeIframeById(e)))}}reattachIframes(){this.attachedIframes.forEach(((e,t)=>{var r=e.content;this.mirror.has(t)?this.mutationCb({adds:[{parentId:t,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(t)}))}destroy(){this.recordCrossOriginIframes&&ot(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((e,t)=>{ot(t,"message",e)})),this.nestedIframeListeners.clear();var e=new Set;this.iframeElementsById.forEach((t=>e.add(t))),this.attachedIframes.forEach((t=>e.add(t.element))),e.forEach((e=>{this.disposeLoadListeners(e),this.removePageHideListener(e)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}}class Kt{constructor(e){o(this,"shadowDoms",new WeakSet),o(this,"mutationCb"),o(this,"scrollCb"),o(this,"bypassOptions"),o(this,"mirror"),o(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){var n,i;if(ie(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var a=null!==(n=null==(i=C.host(e))?void 0:i.ownerDocument)&&void 0!==n?n:t,o=Pt(r({},this.bypassOptions,{doc:a,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),s=o.observer,u=o.buffer;this.restoreHandlers.push({doc:a,handler(){s.disconnect(),u.destroy(),u.releaseCanvasManager();var e=Dt.indexOf(u);-1!==e&&Dt.splice(e,1)}}),this.restoreHandlers.push({doc:a,handler:jt(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))}),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(C.host(e))),this.restoreHandlers.push({doc:a,handler:Zt({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){var r=this;this.restoreHandlers.push({doc:t,handler:I(e.prototype,"attachShadow",(function(e){return function(n){var i=e.call(this,n),a=C.shadowRoot(this);return a&&At(this)&&r.addShadowRoot(a,t),i}}))})}reset(){this.restoreHandlers.forEach((e=>{var t=e.handler;try{t()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(e){var t=[];for(var r of this.restoreHandlers)if(r.doc===e)try{r.handler()}catch(e){}else t.push(r);this.restoreHandlers=t}}var Qt="skip-frame";function er(e){if("object"!=typeof e||null===e)return!1;var t=e.y,r=e.width,n=e.height;return Number.isFinite(e.x)&&Number.isFinite(t)&&Number.isFinite(r)&&Number.isFinite(n)&&r>=0&&n>=0}for(var tr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",rr="undefined"==typeof Uint8Array?[]:new Uint8Array(256),nr=0;64>nr;nr++)rr[tr.charCodeAt(nr)]=nr;var ir=new Map,ar=(e,t,r)=>{if(e&&(ur(e,t)||"object"==typeof e)){var n=function(e,t){var r=ir.get(e);return r||ir.set(e,r=new Map),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),i=n.indexOf(e);return-1===i&&(i=n.length,n.push(e)),i}};function or(e,t,r,n){if(e instanceof Array)return e.map((e=>or(e,t,r,n)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){var i=e.constructor.name,a=function(e){var t,r=new Uint8Array(e),n=r.length,i="";for(t=0;n>t;t+=3)i+=tr[r[t]>>2],i+=tr[(3&r[t])<<4|r[t+1]>>4],i+=tr[(15&r[t+1])<<2|r[t+2]>>6],i+=tr[63&r[t+2]];return n%3==2?i=i.substring(0,i.length-1)+"=":n%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e);return{rr_type:i,base64:a}}return e instanceof DataView?{rr_type:e.constructor.name,args:[or(e.buffer,t,r,n),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL(n.type,n.quality)}:e instanceof ImageData?{rr_type:e.constructor.name,args:[or(e.data,t,r,n),e.width,e.height]}:ur(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:ar(e,t,r)}:e}var sr=(e,t,r,n)=>e.map((e=>or(e,t,r,n))),ur=(e,t)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))},lr=["webgl","webgl2"];function cr(e){return"nodeType"in e}function hr(e,t,n,i){var a=[];try{if(i){var o=function(e,t,n){var i=e.GPUCanvasContext;if((null==i?void 0:i.prototype)&&"function"==typeof i.prototype.configure)return I(i.prototype,"configure",(function(i){return function(a){var o=function(e){var t=e.canvas;return t&&"object"==typeof t?t:null}(this);if(!o||cr(o)&&yt(o,t,n,!0))return i.call(this,a);cr(o)&&!("__context"in o)&&(o.__context="webgpu");var s=function(e){var t=e.GPUTextureUsage;return t?t.COPY_SRC|t.RENDER_ATTACHMENT:null}(e);return i.call(this,null!==s&&a?r({},a,{usage:"number"==typeof a.usage?a.usage|s:s}):a)}}))}(e,t,n);o&&a.push(o)}var s=I(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(r){for(var a=function(e){return"experimental-webgl"===e?"webgl":e}(r),o=arguments.length,s=new Array(o>1?o-1:0),u=1;o>u;u++)s[u-1]=arguments[u];if(!yt(this,t,n,!0)&&("__context"in this||(this.__context=a),i&&lr.includes(a)))if(s[0]&&"object"==typeof s[0]){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0});return e.apply(this,[r,...s])}}));a.push(s)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{a.forEach((e=>e()))}}function dr(e,t,r,n,i,a,o){var s=[],u=Object.getOwnPropertyNames(e),l=function(u){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))return 0;try{if("function"!=typeof e[u])return 0;var l=I(e,u,(function(e){return function(){for(var s=arguments.length,l=new Array(s),c=0;s>c;c++)l[c]=arguments[c];var h=e.apply(this,l);if(ar(h,a,this),this.canvas&&"tagName"in this.canvas&&!yt(this.canvas,n,i,!0)){var d=sr(l,a,this,o);r(this.canvas,{type:t,property:u,args:d})}return h}}));s.push(l)}catch(a){var c=ht(e,u,{set(e){this.canvas&&"tagName"in this.canvas&&!yt(this.canvas,n,i,!0)&&r(this.canvas,{type:t,property:u,args:[e],setter:!0})}});s.push(c)}};for(var c of u)l(c);return s}var fr,vr,pr,mr='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentFingerprintMap = /* @__PURE__ */ new Map();\n const lastSentAtMap = /* @__PURE__ */ new Map();\n const PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n function hashPixels(data) {\n const view = new Uint32Array(\n data.buffer,\n data.byteOffset,\n data.byteLength >>> 2\n );\n let primaryHash = 2166136261;\n let secondaryHash = 2654435769;\n for (let i2 = 0; i2 < view.length; i2++) {\n primaryHash ^= view[i2];\n primaryHash = Math.imul(primaryHash, 16777619);\n secondaryHash ^= view[i2];\n secondaryHash = Math.imul(secondaryHash, 2246822507);\n }\n return `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n }\n function frameFingerprint(width, height, data) {\n return `${width}x${height}:${hashPixels(data)}`;\n }\n function transparentFingerprint(width, height) {\n const pixelCount = width * height;\n let hash = transparentFingerprintMap.get(pixelCount);\n if (hash === void 0) {\n hash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n transparentFingerprintMap.set(pixelCount, hash);\n }\n return `${width}x${height}:${hash}`;\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("resetFrameDedup" in e.data) {\n lastFingerprintMap.clear();\n return;\n }\n if ("OffscreenCanvas" in globalThis) {\n const {\n id,\n bitmap,\n width,\n height,\n displayWidth,\n displayHeight,\n dataURLOptions,\n maskRegions\n } = e.data;\n try {\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d", {\n willReadFrequently: true\n });\n }\n const ctx = reusableCtx;\n ctx.clearRect(0, 0, width, height);\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n if (maskRegions) {\n ctx.fillStyle = "black";\n for (const region of maskRegions) {\n ctx.fillRect(region.x, region.y, region.width, region.height);\n }\n }\n const fingerprint = frameFingerprint(\n width,\n height,\n ctx.getImageData(0, 0, width, height).data\n );\n const lastFingerprint = lastFingerprintMap.get(id) ?? transparentFingerprint(width, height);\n if (fingerprint === lastFingerprint) {\n const lastSentAt = lastSentAtMap.get(id);\n const keyframeDue = maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS;\n if (!keyframeDue) {\n return worker.postMessage({ id });\n }\n }\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n worker.postMessage({\n id,\n type: blob.type,\n base64: encode(arrayBuffer),\n // cpu intensive\n displayWidth,\n displayHeight\n });\n lastFingerprintMap.set(id, fingerprint);\n lastSentAtMap.set(id, Date.now());\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n',yr="undefined"!=typeof self&&self.Blob&&new Blob([mr],{type:"text/javascript;charset=utf-8"});function gr(e){var t;try{if(!(t=yr&&(self.URL||self.webkitURL).createObjectURL(yr)))throw"";var r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(mr),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class wr{constructor(e){o(this,"pendingCanvasMutations",new Map),o(this,"rafStamps",{latestId:0,invokeId:null}),o(this,"mirror"),o(this,"mutationCb"),o(this,"resetObservers"),o(this,"frozen",!1),o(this,"locked",!1),o(this,"rafIdTimestamp",null),o(this,"rafIdFlush",null),o(this,"refCount",0),o(this,"torndown",!1),o(this,"resetFrameDedup",null),o(this,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));var t=e.sampling,r=void 0===t?"all":t,n=e.win,i=e.blockClass,a=e.blockSelector,s=e.recordCanvas,u=e.dataURLOptions,l=e.resolutionScale,c=e.canvasMasking;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===r&&this.initCanvasMutationObserver(n,i,a,u),s&&"number"==typeof r&&this.initCanvasFPSObserver(r,n,i,a,{dataURLOptions:u,resolutionScale:l,canvasMasking:c})}onFullSnapshot(){var e;null==(e=this.resetFrameDedup)||e.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,r,n,i,a){var o=this;if("OffscreenCanvas"in r){var s,u="number"==typeof a.resolutionScale&&Number.isFinite(a.resolutionScale)?Math.min(1,Math.max(.1,a.resolutionScale)):1,l=hr(r,n,i,!0),c=new Map;try{s=new gr}catch(e){return}var d=!1;s.onerror=()=>{var e;d=!0,cancelAnimationFrame(f),null==(e=s.terminate)||e.call(s),this.resetFrameDedup=null},this.resetFrameDedup=()=>{s.postMessage({resetFrameDedup:!0})},s.onmessage=e=>{var t=e.data.id;if(c.set(t,!1),"base64"in e.data){var r=e.data,n=r.displayWidth,i=r.displayHeight;this.mutationCb({id:t,type:h["2D"],commands:[{property:"clearRect",args:[0,0,n,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r.base64}],type:r.type}]},0,0,n,i]}],displayWidth:n,displayHeight:i})}};var f,v=1e3/e,p=0,m=e=>{var l,h;d||(p&&v>e-p||(p=e,(l=[],h=e=>{try{e.querySelectorAll("canvas").forEach((e=>{yt(e,n,i,!0)||l.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&h(e.shadowRoot)}))}catch(e){}},h(r.document),l).forEach(function(){var e=t((function*(e){var t,r,n=o.mirror.getId(e);if(!c.get(n)&&0!==e.width&&0!==e.height){c.set(n,!0);try{if(["webgl","webgl2"].includes(e.__context)){var i=e.getContext(e.__context);if(null==(t=null==i?void 0:i.isContextLost)?void 0:t.call(i))return void c.set(n,!1);!1===(null==(r=null==i?void 0:i.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var l=e.clientWidth||e.width,h=e.clientHeight||e.height,d=Math.max(1,Math.round(l*u)),f=Math.max(1,Math.round(h*u)),v=function(e,t,r,n,i,a){if(e&&"function"==typeof e.regionsFn){var o;try{o=e.regionsFn(t)}catch(e){return Qt}if(void 0!==o){if(!Array.isArray(o)||!o.every(er))return Qt;var s=r/i,u=n/a;return o.filter((e=>e.width>0&&e.height>0)).map((e=>{var t=Math.floor(e.x*s),r=Math.floor(e.y*u);return{x:t,y:r,width:Math.ceil((e.x+e.width)*s)-t,height:Math.ceil((e.y+e.height)*u)-r}}))}}}(a.canvasMasking,e,d,f,l,h);if(v===Qt)return void c.set(n,!1);var p=yield createImageBitmap(e,1>u?{resizeWidth:d,resizeHeight:f,resizeQuality:"medium"}:{resizeWidth:d,resizeHeight:f});s.postMessage({id:n,bitmap:p,width:d,height:f,displayWidth:l,displayHeight:h,dataURLOptions:a.dataURLOptions,maskRegions:v},[p])}catch(e){c.set(n,!1)}}}));return function(t){return e.apply(this,arguments)}}())),f=requestAnimationFrame(m))};f=requestAnimationFrame(m),this.resetObservers=()=>{var e;l(),cancelAnimationFrame(f),null==(e=s.terminate)||e.call(s),this.resetFrameDedup=null}}}initCanvasMutationObserver(e,t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=hr(e,t,r,!1),a=function(e,t,r,n,i){var a=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return 1;var s=I(t.CanvasRenderingContext2D.prototype,o,(function(a){return function(){for(var s=arguments.length,u=new Array(s),l=0;s>l;l++)u[l]=arguments[l];return yt(this.canvas,r,n,!0)||setTimeout((()=>{var r=sr(u,t,this,i);e(this.canvas,{type:h["2D"],property:o,args:r})}),0),a.apply(this,u)}}));a.push(s)}catch(i){var u=ht(t.CanvasRenderingContext2D.prototype,o,{set(t){yt(this.canvas,r,n,!0)||e(this.canvas,{type:h["2D"],property:o,args:[t],setter:!0})}});a.push(u)}};for(var u of o)s(u);return()=>{a.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,n),o=function(e,t,r,n,i){var a=[];return void 0!==t.WebGLRenderingContext&&a.push(...dr(t.WebGLRenderingContext.prototype,h.WebGL,e,r,n,t,i)),void 0!==t.WebGL2RenderingContext&&a.push(...dr(t.WebGL2RenderingContext.prototype,h.WebGL2,e,r,n,t,i)),()=>{a.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,n);this.resetObservers=()=>{i(),a(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,this.rafIdTimestamp=requestAnimationFrame(e)};this.rafIdTimestamp=requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var n=r.map((e=>function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,i)));this.mutationCb({id:t,type:r[0].type,commands:n}),this.pendingCanvasMutations.delete(e)}}}}class br{constructor(e){var t;o(this,"trackedLinkElements",new WeakSet),o(this,"pendingDeferredSheets",new Set),o(this,"mutationCb"),o(this,"adoptedStyleSheetCb"),o(this,"maskAllElementAttributes"),o(this,"maskAttributeFn"),o(this,"styleMirror",new It),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(t=e.maskAllElementAttributes)&&void 0!==t&&t,this.maskAttributeFn=e.maskAttributeFn}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}beginDeferredLinkInlining(e,t){if(-1===t||!e.isConnected)return null;var r=null,n=null;try{(n=e.sheet)&&(r=pe(n))}catch(e){}if(!r||!n)return ee(),null;var i=r,a=!1,o={sheet:n,invalidate(){a=!0}};this.pendingDeferredSheets.add(o);var s=!1;return{advance:r=>{if(s)return!0;var u,l,c=x(),h=F(),d=!0;try{if(a)return s=!0,ee(),!0;if(!i.advance(r))return d=!1,!1;s=!0;var f=i.text();if(!e.isConnected)return!0;var v=null;try{v=e.sheet}catch(e){}return v!==n?(ee(),!0):f?(this.emitCssTextMutation(e,t,f),!0):(ee(),!0)}finally{d&&this.pendingDeferredSheets.delete(o),E(u=x()-c,null!=(l=h)?l:R)||(U.totalMs+=u,u>U.slowestSliceMs&&(U.slowestSliceMs=u))}},remainingRules:()=>i.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(o)}}}onCssomSheetMutation(e){if(e&&0!==this.pendingDeferredSheets.size)for(var t of this.pendingDeferredSheets)t.sheet===e&&(this.pendingDeferredSheets.delete(t),t.invalidate())}inlineDeferredLinkElement(e,t){var r;null==(r=this.beginDeferredLinkInlining(e,t))||r.advance(1/0)}emitCssTextMutation(e,t,r){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t,attributes:{_cssText:be({element:e,name:"_cssText",value:r,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){var r=this;if(0!==e.length){var n={id:t,styleIds:[]},i=[],a=function(e){var t;if(r.styleMirror.has(e))t=r.styleMirror.getId(e);else{var a=r.styleMirror.add(e);t=a;var o=x();try{Y((()=>{try{var t=e.rules||e.cssRules;t&&X(t)}catch(e){}i.push({styleId:a,rules:Array.from(e.rules||CSSRule,((t,r)=>({rule:le(t,e.href),index:r})))})}))}finally{K(x()-o)}}n.styleIds.push(t)};for(var o of e)a(o);i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),Xe.forEach((e=>e.abort())),Xe.clear()}trackStylesheetInLinkElement(e){}}class kr{constructor(){o(this,"nodeMap",new WeakMap),o(this,"active",!1)}inOtherBuffer(e,t){var r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==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(){}}var Sr=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Mr=document.createElement("iframe");document.body.appendChild(Mr),Array.from=(null==(n=Mr.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Mr)}}catch(e){console.debug("Unable to override Array.from",e)}var Ir=new me,Cr=new Set([u.Mutation,u.MediaInteraction,u.StyleSheetRule,u.CanvasMutation,u.Font,u.Log,u.StyleDeclaration,u.AdoptedStyleSheet]);function Ar(e){var t=window;if("function"==typeof t.requestIdleCallback){var r=t.requestIdleCallback(e,{timeout:2e3});return{cancel(){var e;return null==(e=t.cancelIdleCallback)?void 0:e.call(t,r)}}}var n=setTimeout(e,250);return{cancel:()=>clearTimeout(n)}}function xr(e){var t;void 0===e&&(e={});var n=e,i=n.emit,a=n.checkoutEveryNms,o=n.checkoutEveryNth,l=n.blockClass,c=void 0===l?"rr-block":l,h=n.blockSelector,d=void 0===h?null:h,f=n.ignoreClass,v=void 0===f?"rr-ignore":f,p=n.ignoreSelector,m=void 0===p?null:p,y=n.maskTextClass,g=void 0===y?"rr-mask":y,w=n.maskTextSelector,b=void 0===w?null:w,k=n.inlineStylesheet,S=void 0===k||k,M=n.inlineStylesheetBudgetRules,I=n.maskAllInputs,A=n.maskInputOptions,x=n.slimDOMOptions,R=n.maskInputFn,T=n.maskTextFn,F=n.maskAllElementAttributes,E=void 0!==F&&F,L=n.maskAttributeFn,N=n.hooks,_=n.packFn,D=n.sampling,W=void 0===D?{}:D,P=n.dataURLOptions,B=void 0===P?{}:P,H=n.canvasResolutionScale,q=n.canvasMasking,U=n.mousemoveWait,z=n.recordDOM,V=void 0===z||z,J=n.recordCanvas,X=void 0!==J&&J,Y=n.recordCrossOriginIframes,K=void 0!==Y&&Y,Q=n.recordAfter,ee=void 0===Q?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":Q,re=n.userTriggeredOnInput,ne=void 0!==re&&re,ie=n.collectFonts,ae=void 0!==ie&&ie,oe=n.inlineImages,se=void 0!==oe&&oe,ue=n.plugins,le=n.keepIframeSrcFn,ce=void 0===le?()=>!1:le,he=n.ignoreCSSAttributes,de=void 0===he?new Set([]):he,fe=n.attributeFilter;Tt=n.errorHandler;var ve=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},B),pe=!K||window.parent===window,ye=!1;if(!pe)try{window.parent.document&&(ye=!1)}catch(e){ye=!0}if(pe&&!i)throw new Error("emit function is required");if(!pe&&!ye)return()=>{};void 0!==U&&void 0===W.mousemove&&(W.mousemove=U),Ir.reset();var ge,we=!0===I?{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}:void 0!==A?A:{password:!0},be=nt(void 0!==x&&x);!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=[].forEach)}();var ke,Se,Me=0,Ie=new Map,Ce=e=>{for(var t of ue||[])t.eventProcessor&&(e=t.eventProcessor(e));return _&&!ye&&(e=_(e)),e};fr=(e,t)=>{var r,n=e;if(n.timestamp=dt(),!(null==(r=Dt[0])?void 0:r.isFrozen())||n.type===s.FullSnapshot||n.type===s.IncrementalSnapshot&&Cr.has(n.data.source)||Dt.forEach((e=>e.unfreeze())),pe)null==i||i(Ce(n),t);else if(ye){var l={type:"rrweb",event:Ce(n),origin:window.location.origin,isCheckout:t};window.parent.postMessage(l,"*")}if(n.type===s.FullSnapshot)ge=n,Me=0;else if(n.type===s.IncrementalSnapshot){if(n.data.source===u.Mutation&&n.data.isAttachIframe)return;Me++,(o&&Me>=o||a&&n.timestamp-ge.timestamp>a)&&vr(!0)}};var Ae=e=>{if(e.removes&&e.removes.length>0){var t=e.adds.length>0?new Set(e.adds.map((e=>e.node.id))):null,n=new Set;if(e.adds.length>0)for(var i of e.adds){var a=Ir.getNode(i.node.id);a&&"IFRAME"===a.nodeName&&n.add(a)}e.removes.forEach((e=>{var r=e.id;if(!t||!t.has(r)){var i=Oe.getIframeElementById(r);i&&n.has(i)?Oe.forgetIframeId(r):(null==ke||ke(r),Oe.removeIframeById(r))}})),null==Se||Se(),Oe.cleanupDetachedIframes()}fr({type:s.IncrementalSnapshot,data:r({source:u.Mutation},e)})},xe=e=>fr({type:s.IncrementalSnapshot,data:r({source:u.Scroll},e)}),Re=e=>fr({type:s.IncrementalSnapshot,data:r({source:u.CanvasMutation},e)}),Te=new br({mutationCb:Ae,adoptedStyleSheetCb:e=>fr({type:s.IncrementalSnapshot,data:r({source:u.AdoptedStyleSheet},e)}),maskAllElementAttributes:E,maskAttributeFn:L}),Oe=new Yt({mirror:Ir,mutationCb:Ae,stylesheetManager:Te,recordCrossOriginIframes:K,wrappedEmit:fr});for(var Fe of ue||[])Fe.getMirror&&Fe.getMirror({nodeMirror:Ir,crossOriginIframeMirror:Oe.crossOriginIframeMirror,crossOriginIframeStyleMirror:Oe.crossOriginIframeStyleMirror});var Ee=new kr,Le=null==q?void 0:q.configured;pr=new wr({recordCanvas:X,mutationCb:Re,win:window,blockClass:c,blockSelector:d,mirror:Ir,sampling:W.canvas,dataURLOptions:ve,resolutionScale:H,canvasMasking:q});var Ne=new Kt({mutationCb:Ae,scrollCb:xe,bypassOptions:{blockClass:c,blockSelector:d,maskTextClass:g,maskTextSelector:b,inlineStylesheet:S,maskInputOptions:we,dataURLOptions:ve,maskTextFn:T,maskInputFn:R,maskAllElementAttributes:E,maskAttributeFn:L,recordCanvas:X,canvasMaskingConfigured:Le,inlineImages:se,sampling:W,slimDOMOptions:be,iframeManager:Oe,stylesheetManager:Te,canvasManager:pr,keepIframeSrcFn:ce,processedNodeManager:Ee,attributeFilter:fe},mirror:Ir});vr=function(e){if(void 0===e&&(e=!1),V){G(M);try{fr({type:s.Meta,data:{href:window.location.href,width:pt(),height:vt()}},e),null==t||t.cancel(),t=void 0,Te.reset(),Ne.init(),Dt.forEach((e=>e.lock()));var r,n=null;try{n=function(e,t){var r=t||{},n=r.mirror,i=void 0===n?new me:n,a=r.blockClass,o=void 0===a?"rr-block":a,s=r.blockSelector,u=void 0===s?null:s,l=r.maskTextClass,c=void 0===l?"rr-mask":l,h=r.maskTextSelector,d=void 0===h?null:h,f=r.inlineStylesheet,v=void 0===f||f,p=r.inlineImages,m=void 0!==p&&p,y=r.recordCanvas,g=void 0!==y&&y,w=r.canvasMaskingConfigured,b=r.maskAllInputs,k=void 0!==b&&b,S=r.maskTextFn,M=r.maskInputFn,I=r.maskAllElementAttributes,C=void 0!==I&&I,A=r.maskAttributeFn,x=r.slimDOM,R=r.dataURLOptions,T=r.preserveWhiteSpace,O=r.onSerialize,F=r.onIframeLoad,E=r.iframeLoadTimeout,L=r.onIframeListenerRegistered,N=r.onStylesheetLoad,_=r.stylesheetLoadTimeout,D=r.keepIframeSrcFn,W=void 0===D?()=>!1:D,P=r.maxDepth,j=r.inlineStylesheetBudgetRules,B=!0===k?{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}:!1===k?{password:!0}:k,H=nt(void 0!==x&&x);G(j);try{return rt(e,{doc:e,mirror:i,blockClass:o,blockSelector:u,maskTextClass:c,maskTextSelector:d,skipChild:!1,inlineStylesheet:v,maskInputOptions:B,maskTextFn:S,maskInputFn:M,maskAllElementAttributes:C,maskAttributeFn:A,slimDOMOptions:H,dataURLOptions:R,inlineImages:m,recordCanvas:g,canvasMaskingConfigured:w,preserveWhiteSpace:T,onSerialize:O,onIframeLoad:F,iframeLoadTimeout:E,onIframeListenerRegistered:L,onStylesheetLoad:N,stylesheetLoadTimeout:_,keepIframeSrcFn:W,newlyAddedElement:!1,maxDepth:P})}finally{Z()}}(document,{mirror:Ir,blockClass:c,blockSelector:d,maskTextClass:g,maskTextSelector:b,inlineStylesheet:S,maskAllInputs:we,inlineStylesheetBudgetRules:M,maskTextFn:T,maskInputFn:R,maskAllElementAttributes:E,maskAttributeFn:L,slimDOM:be,dataURLOptions:ve,recordCanvas:X,canvasMaskingConfigured:Le,inlineImages:se,onSerialize(e){kt(e,Ir)&&Oe.addIframe(e),St(e,Ir)&&Te.trackLinkElement(e),Mt(e)&&Ne.addShadowRoot(C.shadowRoot(e),document)},onIframeLoad(e,t){Oe.attachIframe(e,t),Ne.observeAttachShadow(e)},onIframeListenerRegistered(e,t){Oe.registerLoadListenerDisposer(e,t)},onStylesheetLoad(e,t){Te.attachLinkElement(e,t)},keepIframeSrcFn:ce})}finally{a=j,j=[],r=a}if(!n)return console.warn("Failed to snapshot the document");if(fr({type:s.FullSnapshot,data:{node:n,initialOffset:ft(window)}},e),Dt.forEach((e=>e.unlock())),pr.onFullSnapshot(),r.length){var i=function(e,t,r){var n=!1,i=null,a=0,o=null,s=()=>null!==o||e.length>a,u=()=>{var r=e[a];e[a]=null,a+=1,r&&st((()=>{o=t.beginDeferredLinkInlining(r,Ir.getId(r))}))},l=()=>{if(o){var e=o,t=!0;st((()=>{t=e.advance(200)})),t&&(o=null)}},c=e=>{if(i=null,!n){var t=0;do{try{o||u(),l()}catch(e){null==o||o.discard(),o=null,te(1)}t+=1}while(!n&&s()&&(e?!e.didTimeout&&e.timeRemaining()>5:10>t));n||(s()?i=Ar(c):r())}};return i=Ar(c),{cancel(){n=!0,null==o||o.discard(),o=null,null==i||i.cancel(),i=null},flush(){if(!n){n=!0,null==i||i.cancel(),i=null;for(var t=0,c=0;s()&&50>t;){o||u();var h=o;if(h)if(Math.floor(h.remainingRules()/200)+1>50-t)h.discard(),o=null,c+=1;else{try{l()}catch(e){null==o||o.discard(),o=null,c+=1}t+=1}}if(s()||c>0){for(var d=c+(null!==o?1:0),f=a;e.length>f;f++)null!==e[f]&&(d+=1);te(d),null==o||o.discard(),o=null}r()}}}}(r,Te,(()=>{t===i&&(t=void 0)}));t=i}K&&Oe.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Te.adoptStyleSheets(document.adoptedStyleSheets,Ir.getId(document))}finally{Z()}var a}};try{var _e=[];for(var De of(_e.push(at("pagehide",(()=>{try{null==t||t.flush()}catch(e){}t=void 0}),window)),["visibilitychange","freeze","resume"]))_e.push(at(De,O,document));ke=e=>{var t=Ie.get(e);t&&(t.forEach((e=>{st(e);var t=_e.indexOf(e);-1!==t&&_e.splice(t,1)})),Ie.delete(e))},Se=()=>{for(var e of Ie){var t=e[0],r=Ir.getNode(t);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==ke||ke(t)}catch(e){null==ke||ke(t)}else null==ke||ke(t)}};var We=e=>{var t;return _t(Vt)({mutationCb:Ae,mousemoveCb:(e,t)=>fr({type:s.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>fr({type:s.IncrementalSnapshot,data:r({source:u.MouseInteraction},e)}),scrollCb:xe,viewportResizeCb:e=>fr({type:s.IncrementalSnapshot,data:r({source:u.ViewportResize},e)}),inputCb:e=>fr({type:s.IncrementalSnapshot,data:r({source:u.Input},e)}),mediaInteractionCb:e=>fr({type:s.IncrementalSnapshot,data:r({source:u.MediaInteraction},e)}),styleSheetRuleCb:e=>fr({type:s.IncrementalSnapshot,data:r({source:u.StyleSheetRule},e)}),styleDeclarationCb:e=>fr({type:s.IncrementalSnapshot,data:r({source:u.StyleDeclaration},e)}),canvasMutationCb:Re,fontCb:e=>fr({type:s.IncrementalSnapshot,data:r({source:u.Font},e)}),selectionCb(e){fr({type:s.IncrementalSnapshot,data:r({source:u.Selection},e)})},customElementCb(e){fr({type:s.IncrementalSnapshot,data:r({source:u.CustomElement},e)})},blockClass:c,ignoreClass:v,ignoreSelector:m,maskTextClass:g,maskTextSelector:b,maskInputOptions:we,inlineStylesheet:S,sampling:W,recordDOM:V,recordCanvas:X,canvasMaskingConfigured:Le,inlineImages:se,userTriggeredOnInput:ne,collectFonts:ae,doc:e,maskInputFn:R,maskTextFn:T,maskAllElementAttributes:E,maskAttributeFn:L,keepIframeSrcFn:ce,blockSelector:d,slimDOMOptions:be,dataURLOptions:ve,mirror:Ir,iframeManager:Oe,stylesheetManager:Te,shadowDomManager:Ne,processedNodeManager:Ee,canvasManager:pr,ignoreCSSAttributes:de,attributeFilter:fe,plugins:(null==(t=null==ue?void 0:ue.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>fr({type:s.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},N)};Oe.addLoadListener((e=>{try{var t=Ir.getId(e),r=We(e.contentDocument);if("function"==typeof r&&(_e.push(r),-1!==t)){var n=Ie.get(t);n||Ie.set(t,n=new Set),n.add(r)}}catch(e){console.warn(e)}})),Oe.addPageHideListener((e=>{var t=Ir.getId(e);null==ke||ke(t),Bt(e)}));var Pe=-1,je=e=>fr({type:s.Custom,data:{tag:"rrweb/fullscreen",payload:e}}),Be=()=>{var e,t,r,n,i=document,a=null!==(e=null!==(t=null!==(r=null!==(n=i.fullscreenElement)&&void 0!==n?n:i.webkitFullscreenElement)&&void 0!==r?r:i.mozFullScreenElement)&&void 0!==t?t:i.msFullscreenElement)&&void 0!==e?e:null,o=a?Ir.getId(a):-1;o!==Pe&&(-1!==Pe&&je({id:Pe,enter:!1}),Pe=o,-1!==o&&je({id:o,enter:!0}))},He=()=>{vr();var e=We(document);"function"==typeof e&&_e.push(e),_e.push(at("fullscreenchange",Be)),_e.push(at("webkitfullscreenchange",Be)),_e.push(at("mozfullscreenchange",Be)),_e.push(at("MSFullscreenChange",Be)),Sr=!0};return["interactive","complete"].includes(document.readyState)?He():(_e.push(at("DOMContentLoaded",(()=>{fr({type:s.DomContentLoaded,data:{}}),"DOMContentLoaded"===ee&&He()}))),_e.push(at("load",(()=>{fr({type:s.Load,data:{}}),"load"===ee&&He()}),window))),()=>{try{null==t||t.flush()}catch(e){}t=void 0,_e.forEach((e=>st(e))),Ee.destroy(),Oe.removeLoadListener(),Oe.destroy(),Ie.clear(),Ne.reset(),Ir.reset(),Sr=!1,Tt=void 0}}catch(e){console.warn(e)}}xr.addCustomEvent=(e,t)=>{if(!Sr)throw new Error("please add custom event after start recording");fr({type:s.Custom,data:{tag:e,payload:t}})},xr.freezePage=()=>{Dt.forEach((e=>e.freeze()))},xr.takeFullSnapshot=e=>{if(!Sr)throw new Error("please take full snapshot after start recording");vr(e)},xr.mirror=Ir;var Rr=Object.defineProperty,Tr=(e,t,r)=>((e,t,r)=>t in e?Rr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class Or{constructor(e){Tr(this,"fileName"),Tr(this,"functionName"),Tr(this,"lineNumber"),Tr(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}}var Fr=/(^|@)\S+:\d+/,Er=/^\s*at .*(\S+:\d+|\(native\))/m,Lr=/^(eval@)?(\[native code])?$/,Nr={parse(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Er)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):[]:[]},extractLocation(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE(e){return e.stack.split("\n").filter((function(e){return!!e.match(Er)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),n=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),i=this.extractLocation(r?r[1]:n.pop()),a=n.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Or({functionName:a,fileName:o,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari(e){return e.stack.split("\n").filter((function(e){return!e.match(Lr)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Or({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(e.replace(t,""));return new Or({functionName:n,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)},parseOpera(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[],i=2,a=r.length;a>i;i+=2){var o=t.exec(r[i]);o&&n.push(new Or({fileName:o[2],lineNumber:parseFloat(o[1])}))}return n},parseOpera10(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[],i=0,a=r.length;a>i;i+=2){var o=t.exec(r[i]);o&&n.push(new Or({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return n},parseOpera11(e){return e.stack.split("\n").filter((function(e){return!!e.match(Fr)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Or({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function _r(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var n=e.parentElement,i=[];if(n.children&&n.children.length>0)for(var a=0;n.children.length>a;a++){var o=n.children[a];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&i.push(o)}i.length>1&&(r+=":eq("+i.indexOf(e)+")"),t=r+(t?">"+t:""),e=n}return t}function Dr(e){return Array.isArray(e)}function Wr(e){return"object"==typeof e&&null!==e&&!Dr(e)}function Pr(e,t){if(0===t)return!0;var r=Object.keys(e);for(var n of r)if(Wr(e[n])&&Pr(e[n],t-1))return!0;return!1}function jr(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var n=[],i=[];return JSON.stringify(e,(function(e,t){if(n.length>0){var a=n.indexOf(this);~a?n.splice(a+1):n.push(this),~a?i.splice(a,1/0,e):i.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(t)).join(".")+"]")}else n.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(Wr(o=t)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||Wr(o)&&Pr(o,r.depthOfLimit))return function(e){var t=e.toString();return r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.stringLengthLimit)+"..."),t}(t);var o;if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var s={};for(var u in t){var l=t[u];s[u]=Dr(l)?_r(l.length?l[0]:null):l}return s}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Br={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Hr(e,t,r){var n,i=r?Object.assign({},Br,r):Br,a=i.logger;if(!a)return()=>{};n="string"==typeof a?t[a]:a;var o=0,s=!1,u=[];if(i.level.includes("error")){var l=t=>{var r=t.message,n=Nr.parse(t.error).map((e=>e.toString())),a=[jr(r,i.stringifyOptions)];e({level:"error",trace:n,payload:a})};t.addEventListener("error",l),u.push((()=>{t.removeEventListener("error",l)}));var c=t=>{var r,n;t.reason instanceof Error?n=[jr("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,i.stringifyOptions)]:(r=new Error,n=[jr("Uncaught (in promise)",i.stringifyOptions),jr(t.reason,i.stringifyOptions)]);var a=Nr.parse(r).map((e=>e.toString()));e({level:"error",trace:a,payload:n})};t.addEventListener("unhandledrejection",c),u.push((()=>{t.removeEventListener("unhandledrejection",c)}))}for(var h of i.level)u.push(d(n,h));return()=>{u.forEach((e=>e()))};function d(t,r){var n=this;return t[r]?function(t,a,u){try{if(!(a in t))return()=>{};var l=t[a],c={next:l},h=(t=>function(){for(var a=arguments.length,u=new Array(a),l=0;a>l;l++)u[l]=arguments[l];if(t.apply(n,u),!("assert"===r&&u[0]||s)){s=!0;try{var c=Nr.parse(new Error).map((e=>e.toString())).splice(1),h=("assert"===r?u.slice(1):u).map((e=>jr(e,i.stringifyOptions)));o++,i.lengthThreshold>o?e({level:r,trace:c,payload:h}):o===i.lengthThreshold&&e({level:"warn",trace:[],payload:[jr("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...u)}finally{s=!1}}})((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return c.next.apply(this,t)}));return"function"==typeof h&&(h.prototype=h.prototype||{},Object.defineProperties(h,{__rrweb_original__:{enumerable:!1,value:l},__rrweb_layer__:{enumerable:!1,value:c}})),t[a]=h,()=>{if(t[a]!==h)for(var e=e=>{var t;return"function"==typeof e?null!==(t=e.__rrweb_layer__)&&void 0!==t?t:e.__posthog_layer__:void 0},r=t[a],n=e(r);n;){if(n.next===h)return void(n.next=c.next);n=e(r=n.next)}else t[a]=c.next}}catch(e){return()=>{}}}(t,r):()=>{}}}var qr=e=>({name:"rrweb/console@1",observer:Hr,options:e}),Ur=Object.prototype,zr=Ur.hasOwnProperty,Gr=Ur.toString,Zr=Array.isArray||function(e){return"[object Array]"===Gr.call(e)},Vr=e=>"function"==typeof e,$r=e=>e===Object(e)&&!Zr(e),Jr=e=>void 0===e,Xr=e=>"[object String]"==Gr.call(e),Yr=e=>null===e,Kr=e=>Jr(e)||Yr(e),Qr=e=>"[object Boolean]"===Gr.call(e),en=e=>e instanceof FormData,tn="u">typeof window?window:void 0,rn="u">typeof globalThis?globalThis:tn;null!=rn&&rn.XMLHttpRequest&&new rn.XMLHttpRequest;var nn=e=>"u">typeof Document&&e instanceof Document,an=function(e,t){var r=(void 0===t?{}:t).debugEnabled,n={q(t){if(tn&&(tn.POSTHOG_DEBUG||r)&&!Jr(tn.console)&&tn.console){for(var n=("__rrweb_original__"in tn.console[t]?tn.console[t].__rrweb_original__:tn.console[t]),i=arguments.length,a=new Array(i>1?i-1:0),o=1;i>o;o++)a[o-1]=arguments[o];n(e,...a)}},debug(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.q("debug",...t)},info(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.q("log",...t)},warn(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.q("warn",...t)},error(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.q("error",...t)},critical(){for(var t=arguments.length,r=new Array(t),n=0;t>n;n++)r[n]=arguments[n];console.error(e,...r)},uninitializedWarning(e){n.error("You must initialize PostHog before calling "+e)},createLogger:(t,r)=>an(e+" "+t,r)};return n},on=an("[PostHog.js]").createLogger,sn=function(e,t){var r,n;void 0===t&&(t="&");var i=[];return function(e,t){if(!Kr(e))if(Zr(e))e.forEach(t);else if(en(e))e.forEach(((e,r)=>t(e,r)));else for(var r in e)zr.call(e,r)&&t(e[r],r)}(e,(function(e,t){Jr(e)||Jr(t)||"undefined"===t||(r=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(t),i[i.length]=n+"="+r)})),i.join(t)},un=()=>{},ln=e=>{var t;if(Vr(e))return null!==(t=e.__posthog_layer__)&&void 0!==t?t:e.__rrweb_layer__};function cn(e,t,r){try{if(!(t in e))return un;var n={next:e[t]},i=r((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return n.next.apply(this,t)}));return Vr(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:n}})),e[t]=i,()=>{if(e[t]!==i)for(var r=e[t],a=ln(r);a;){if(a.next===i)return void(a.next=n.next);a=ln(r=a.next)}else e[t]=n.next}}catch(e){return un}}function hn(e,t){var r,n=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),i={hostname:n,isHostDenied:!1};if(null==(r=t.payloadHostDenyList)||!r.length||null==n||!n.trim().length)return i;for(var a of t.payloadHostDenyList)if(n.endsWith(a))return{hostname:n,isHostDenied:!0};return i}var dn=1e6,fn={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:dn,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},vn=new WeakSet,pn=on("[Recorder]"),mn=e=>"navigation"===e.entryType,yn=e=>"resource"===e.entryType;function gn(e,t){return!!t&&(Qr(t)||t[e])}function wn(e){if("undefined"==typeof Request)return!1;if(e instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(e)}catch(e){return!1}}var bn=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function kn(e){var t=e.type,r=e.recordBody,n=e.headers;function i(e){var t=Object.keys(n).find((e=>"content-type"===e.toLowerCase())),r=t&&n[t];return e.some((e=>null==r?void 0:r.toLowerCase().includes(e)))}if(!r)return!1;if(function e(t){try{return"string"==typeof t?t.startsWith("blob:"):t instanceof URL?"blob:"===t.protocol:!!wn(t)&&e(t.url)}catch(e){return!1}}(e.url))return!1;if(i(bn))return!1;if(Qr(r))return!0;if(Zr(r))return i(r);var a=r[t];return Qr(a)?a:i(a)}function Sn(e,t,r,n,i,a){return Mn.apply(this,arguments)}function Mn(){return Mn=t((function*(e,t,r,n,i,a){if(void 0===a&&(a=0),a>10)return pn.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var o=function(e,r){for(var a=e.length-1;a>=0;a-=1)if(yn(o=e[a])&&o.initiatorType===t&&(Jr(n)||o.startTime>=n)&&(Jr(i)||i>=o.startTime))return e[a];var o}(e.performance.getEntriesByName(r));return o||(yield new Promise((e=>setTimeout(e,50*a))),Sn(e,t,r,n,i,a+1))})),Mn.apply(this,arguments)}function In(e){var t=e.body,r=e.options,n=e.url;if(Kr(t))return null;var i=hn(n,r);if(i.isHostDenied)return i.hostname+" is in deny list";if(Xr(t))return t;if(nn(t))return t.textContent;if(en(t))return sn(t);if($r(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}var Cn=e=>!Yr(e)&&("navigation"===e.entryType||"resource"===e.entryType);function An(e){var t=e.entry,n=e.method,i=e.status,a=e.networkRequest,o=e.isInitial,s=e.start,u=e.end,l=e.url,c=e.initiatorType;s=t?t.startTime:s,u=t?t.responseEnd:u;var h=Math.floor(Date.now()-performance.now()),d=Math.floor(h+(s||0)),f=[r({},t?t.toJSON():{name:l},{startTime:Jr(s)?void 0:Math.round(s),endTime:Jr(u)?void 0:Math.round(u),timeOrigin:h,timestamp:d,method:n,initiatorType:c||(t?t.initiatorType:void 0),status:i,requestHeaders:a.requestHeaders,requestBody:a.requestBody,responseHeaders:a.responseHeaders,responseBody:a.responseBody,isInitial:o})];if(Cn(t))for(var v of t.serverTiming||[])f.push({timeOrigin:h,timestamp:d,startTime:Math.round(t.startTime),name:v.name,duration:v.duration,entryType:"serverTiming"});return f}var xn=["video/","audio/"];function Rn(e){return $r(e)&&Vr(e.getReader)&&Vr(e.tee)}var Tn=500,On="[SessionReplay] Timeout while trying to read body",Fn="[SessionReplay] Failed to read body";function En(e){return Fn+": "+e}function Ln(e){return"[SessionReplay] Body too large to record (> "+e+" bytes)"}function Nn(e,t){if(!t.streamNetworkBody)return function(e){return new Promise((t=>{var r=setTimeout((()=>t(On)),Tn);try{e.clone().text().then((e=>t(e)),(e=>t(En(e)))).finally((()=>clearTimeout(r)))}catch(e){clearTimeout(r),t(Fn)}}))}(e);var r=function(e){var t;return Math.min(dn,null!==(t=e.payloadSizeLimitBytes)&&void 0!==t?t:dn)}(t);return function(e,t){try{var r,n=null==(r=e.headers)||null==r.get?void 0:r.get("content-length");if(!n)return!1;var i=parseInt(n,10);return Number.isFinite(i)&&i>t}catch(e){return!1}}(e,r)?Promise.resolve(Ln(r)):function(e,t){return new Promise((r=>{var n,i=!1;function a(){try{var e;null==(e=n)||e.cancel().catch((()=>{}))}catch(e){}}function o(e){i||(i=!0,clearTimeout(u),a(),r(e))}var s,u=setTimeout((()=>o(On)),Tn);try{s=e.clone()}catch(e){return void o(Fn)}var l=s.body;if(Rn(l)&&"undefined"!=typeof TextDecoder){try{n=l.getReader()}catch(e){return void o(Fn)}var c=[],h=0;!function e(){n.read().then((r=>{var n=r.done,s=r.value;if(i)a();else if(n)o((new TextDecoder).decode(function(e,t){var r=new Uint8Array(t),n=0;for(var i of e)r.set(i,n),n+=i.byteLength;return r}(c,h)));else{if(s){if(h+s.byteLength>t)return void o(Ln(t));h+=s.byteLength,c.push(s)}e()}}),(e=>o(En(e))))}()}else try{s.text().then((e=>o(e)),(e=>o(En(e))))}catch(e){o(Fn)}}))}(e,r)}function _n(){return(_n=t((function*(e){var t=e.r,r=e.options,n=hn(e.url,r);return n.isHostDenied?Promise.resolve(n.hostname+" is in deny list"):Nn(t,r)}))).apply(this,arguments)}function Dn(){return(Dn=t((function*(e){var t=e.r,r=e.options,n=function(e){var t,r=e.r,n=e.options,i=e.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var a=null==(t=r.headers.get("Content-Type"))?void 0:t.toLowerCase(),o=xn.some((e=>null==a?void 0:a.startsWith(e)));if(a&&o)return"Content-Type "+a+" is not supported";var s=hn(i,n);return s.isHostDenied?s.hostname+" is in deny list":null}({r:t,options:r,url:e.url});return Yr(n)?Nn(t,r):Promise.resolve(n)}))).apply(this,arguments)}var Wn=null;function Pn(e,n,i){if(!("performance"in n))return()=>{};if(Wn)return pn.warn("Network observer already initialised, doing nothing"),()=>{};var a=i?Object.assign({},fn,i):fn,o=t=>{var n=[],i=!1;t.requests.forEach((e=>{var t="serverTiming"===e.entryType;if(!t||!i){var r=a.maskRequestFn(e);t||(i=!r||(e=>!!e&&vn.has(e))(r)),r&&n.push(r)}})),n.length>0&&e(r({},t,{requests:n}))},s=function(e,t,r){if(r.recordInitialRequests){var n=t.performance.getEntries().filter((e=>mn(e)||yn(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:n.flatMap((e=>An({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var i=new t.PerformanceObserver((t=>{var n=t.getEntries().filter((e=>mn(e)||yn(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:n.flatMap((e=>An({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),a=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return i.observe({entryTypes:a}),()=>{i.disconnect()}}(o,n,a),u=()=>{},l=()=>{};return(a.recordHeaders||a.recordBody)&&(u=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var n=gn("request",r.recordHeaders),i=gn("response",r.recordHeaders),a=cn(t.XMLHttpRequest.prototype,"open",(a=>function(o,s,u,l,c){void 0===u&&(u=!0);var h=this;try{var d,f,v=new Request(s),p={},m={},y=h.setRequestHeader.bind(h);h.setRequestHeader=(e,t)=>(m[e]=t,y(e,t)),n&&(p.requestHeaders=m);var g=h.send.bind(h);h.send=e=>(kn({type:"request",headers:m,url:s,recordBody:r.recordBody})&&(p.requestBody=In({body:e,options:r,url:s})),d=t.performance.now(),g(e));var w=()=>{h.removeEventListener("readystatechange",b),h.removeEventListener("error",w),h.removeEventListener("abort",w),h.removeEventListener("timeout",w)},b=()=>{if(h.readyState===h.DONE){w(),f=t.performance.now();var n={};h.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),i=t.join(": ");r&&(n[r]=i)})),i&&(p.responseHeaders=n),kn({type:"response",headers:n,url:s,recordBody:r.recordBody})&&(p.responseBody=In({body:h.response,options:r,url:s})),Sn(t,"xmlhttprequest",v.url,d,f).then((t=>{var r=An({entry:t,method:o,status:null==h?void 0:h.status,networkRequest:p,start:d,end:f,url:s.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}};h.addEventListener("readystatechange",b),h.addEventListener("error",w),h.addEventListener("abort",w),h.addEventListener("timeout",w)}catch(e){pn.error("Failed to instrument XHR for network capture",e)}a.call(h,o,s.toString(),u,l,c)}));return()=>{a()}}(o,n,a),l=function(e,r,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};var i=gn("request",n.recordHeaders),a=gn("response",n.recordHeaders),o=cn(r,"fetch",(o=>function(){var s=t((function*(t,s){var u,l;try{u=new Request(t,s)}catch(e){return pn.error("Failed to instrument fetch for network capture",e),o(t,s)}var c,h,d={};try{try{var f={};u.headers.forEach(((e,t)=>{f[t]=e})),i&&(d.requestHeaders=f),!Rn(null==s?void 0:s.body)&&kn({type:"request",headers:f,url:t,recordBody:n.recordBody})&&(d.requestBody=yield function(e){return _n.apply(this,arguments)}({r:u,options:n,url:t}))}catch(e){pn.error("Failed to record fetch request for network capture",e)}c=r.performance.now(),l=wn(t)?yield o(u):yield o(t,s),h=r.performance.now();var v={};l.headers.forEach(((e,t)=>{v[t]=e})),a&&(d.responseHeaders=v);try{kn({type:"response",headers:v,url:t,recordBody:n.recordBody})&&(d.responseBody=yield function(e){return Dn.apply(this,arguments)}({r:l,options:n,url:t}))}catch(e){pn.error("Failed to record fetch response for network capture",e)}return l}finally{Sn(r,"fetch",u.url,c,h).then((t=>{var r,n=An({entry:t,method:u.method,status:null==(r=l)?void 0:r.status,networkRequest:d,start:c,end:h,url:u.url,initiatorType:"fetch"});e({requests:n})})).catch((()=>{}))}}));return function(e,t){return s.apply(this,arguments)}}()));return()=>{o()}}(o,n,a)),Wn=()=>{s(),u(),l(),Wn=null}}var jn=e=>({name:"rrweb/network@1",observer:Pn,options:e}),Bn="undefined"!=typeof globalThis?globalThis:tn;Bn&&"undefined"==typeof self&&(Bn.self=Bn),Bn&&"undefined"==typeof File&&(Bn.File=function(){});var Hn=null!=tn?tn:{};Hn.__PosthogExtensions__=Hn.__PosthogExtensions__||{},Hn.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:qr,getRecordNetworkPlugin:jn},Hn.__PosthogExtensions__.rrweb={record:xr,version:"v2",wasMaxDepthReached:()=>tt,resetMaxDepthState(){tt=!1,et=!1},getLastSnapshotCost:()=>W,getMutationCost:()=>r({},q),resetSnapshotCostState(){L=0,N=0,_=0,R=0,D=A(),W=null,P=null,j=[],B=0,H=0,q={slowestBatchMs:0},U={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},Hn.rrweb={record:xr,version:"v2"},Hn.rrwebConsoleRecord={getRecordConsolePlugin:qr},Hn.getRecordNetworkPlugin=jn}();
|
|
1
|
+
!function(){"use strict";function e(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function t(t){return function(){var r=this,n=arguments;return new Promise((function(i,a){var o=t.apply(r,n);function s(t){e(o,i,a,s,u,"next",t)}function u(t){e(o,i,a,s,u,"throw",t)}s(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},r.apply(null,arguments)}var n,i=["type"],a=Object.defineProperty,o=(e,t,r)=>((e,t,r)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),s=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(s||{}),u=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(u||{}),l=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(l||{}),c=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(c||{}),h=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(h||{}),d=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(d||{}),f=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(f||{});function v(e,t){return-1!==e.indexOf(t)}var p={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},m={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},y={};function g(e){if(y[e])return y[e];var t=function(e){var t,r,n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in p?p[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),a=e in m?m[e]:void 0,o=Boolean(a&&a.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&o)return y[e]=t.prototype,t.prototype;var s=document.createElement("iframe");s.style.display="none";var u,l=!1;try{document.body.appendChild(s);var c=s.contentWindow;if(!c)return t.prototype;var h=c[e].prototype;return h?(v(u=navigator.userAgent,"AppleWebKit")&&!v(u,"Chrome")&&(s.classList.add("rr-block","ph-no-capture"),s.setAttribute("__rrwebUntaintedPrototype",e),l=!0),y[e]=h):r}catch(e){return r}finally{!l&&s.parentNode&&document.body.removeChild(s)}}var w={};function b(e,t,r){var n,i=e+"."+String(r);if(w[i])return w[i].call(t);var a=g(e),o=null==(n=Object.getOwnPropertyDescriptor(a,r))?void 0:n.get;return o?(w[i]=o,o.call(t)):t[r]}var k={};function S(e,t,r){var n=e+"."+String(r);if(k[n])return k[n].bind(t);var i=g(e)[r];return"function"!=typeof i?t[r]:(k[n]=i,i.bind(t))}function M(){return g("MutationObserver").constructor}function I(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i={next:n},a=r((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return i.next.apply(this,t)}));return"function"==typeof a&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__rrweb_original__:{enumerable:!1,value:n},__rrweb_layer__:{enumerable:!1,value:i}})),e[t]=a,()=>{if(e[t]!==a)for(var r=e=>{var t;return"function"==typeof e?null!==(t=e.__rrweb_layer__)&&void 0!==t?t:e.__posthog_layer__:void 0},n=e[t],o=r(n);o;){if(o.next===a)return void(o.next=i.next);o=r(n=o.next)}else e[t]=i.next}}catch(e){return()=>{}}}var C={childNodes:e=>b("Node",e,"childNodes"),parentNode:e=>b("Node",e,"parentNode"),parentElement:e=>b("Node",e,"parentElement"),textContent:e=>b("Node",e,"textContent"),contains:(e,t)=>S("Node",e,"contains")(t),getRootNode:e=>S("Node",e,"getRootNode")(),host:e=>e&&"host"in e?b("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?b("Element",e,"shadowRoot"):null,querySelector:(e,t)=>S("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>S("Element",e,"querySelectorAll")(t),mutationObserver:M,patch:I},A=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0});function x(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(e){}return Date.now()}var R=0,T=6e4;function O(){R+=1}function F(){return R}function E(e,t){return t!==R||e>T}var L=0,N=0,_=0,D=A(),W=null,P=null,j=[],B=0,H=0,q={slowestBatchMs:0},U={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0},z=e=>e&&e>0?e:null;function G(e){(L+=1)>1||(D=A(),j=[],B=0,P=z(e),N=x(),_=R)}function Z(){return 0===L?W||A():(L-=1)>0?D:(D.durationMs=x()-N,D.deferredStylesheetCount=B,U.deferredCount+=B,P=null,E(D.durationMs,_)?D:W=D)}var V=32;function J(e,t,r){var n=e.length;if(r>=V)return n;for(var i=0;e.length>i;i++){var a=e[i];try{var o=a.cssRules;if(o&&o.length)n+=J(o,t,r+1);else if(t&&a.styleSheet){var s=a.styleSheet;if(!t.has(s)){t.add(s);var u=s.rules||s.cssRules;u&&(n+=J(u,t,r+1))}}}catch(e){}}return n}function X(e){if(0!==L){var t=J(e,null,0);D.cssRuleCount+=t,H>0&&(D.nonDeferrableCssRuleCount+=t)}}function Y(e){H+=1;try{return e()}finally{H-=1}}function K(e){L>0&&(D.stylesheetMs+=e)}function Q(e){if(0===L||null===P)return!1;var t=D.cssRuleCount-D.nonDeferrableCssRuleCount;return t>=P||t+function(e){try{var t=e&&(e.rules||e.cssRules);if(!t)return 0;var r=new WeakSet;return r.add(e),J(t,r,0)}catch(e){return 0}}(e)>P}function ee(){U.failedCount+=1}function te(e){e>0&&(U.abandonedCount+=e)}function re(e){return e.nodeType===e.ELEMENT_NODE}function ne(e){var t=e&&"host"in e&&"mode"in e&&C.host(e)||null;return Boolean(t&&"shadowRoot"in t&&C.shadowRoot(t)===e)}function ie(e){return"[object ShadowRoot]"==={}.toString.call(e)}function ae(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function oe(e){var t=e.cssText;if(3>t.split('"').length)return t;var r=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer("+e.layerName+")"),e.supportsText&&r.push("supports("+e.supportsText+")"),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}var se=0;function ue(e){var t=0===se,r=t?x():0;se+=1;try{var n=e.rules||e.cssRules;if(!n)return null;X(n);var i=e.href;return!i&&e.ownerNode&&(i=e.ownerNode.baseURI),ae(Array.from(n,(e=>le(e,i))).join(""))}catch(e){return null}finally{se-=1,t&&K(x()-r)}}function le(e,t){var r;if(he(e)){var n;try{n=ue(e.styleSheet)||oe(e)}catch(t){n=e.cssText}try{if(n&&(null==(r=e.styleSheet)?void 0:r.href))return xe(n,e.styleSheet.href)}catch(e){}return n}var i=e.cssText;return de(e)&&e.selectorText.includes(":")&&(i=ce(i)),t?xe(i,t):i}function ce(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function he(e){return"styleSheet"in e}function de(e){return"selectorText"in e}var fe=/^-?[A-Za-z_][\w-]*$/,ve=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function pe(e){var t=[],r=!1,n=null,i=new Map;function a(e){var i=t.pop();if("group"===i.kind){if(null===e){for(;t.length>0&&"group"===t[t.length-1].kind;)t.pop();return void a(null)}var s=t[t.length-1];return s.parts.push(e),void(s.index+=1)}if(!i.importRule)return r=!0,void(n=e);o(t[t.length-1],i.importRule,e)}function o(e,t,r){var n;try{var i;try{i=r||oe(t)}catch(e){i=t.cssText}try{i&&(null==(n=t.styleSheet)?void 0:n.href)&&(i=xe(i,t.styleSheet.href))}catch(e){}i&&e.parts.push(i),e.index+=1}catch(e){a(null)}}function s(e){var r=e.rules[e.index];if("sheet"===e.kind&&he(r)){var n=i.get(r);return null===n?(e.parts.push(r.cssText),void(e.index+=1)):n?void t.push({kind:"sheet",sheet:n.sheet,rules:n.rules,sheetHref:n.sheetHref,index:0,parts:[],importRule:r}):void o(e,r,null)}if(!function(e,r){try{var n=function(e){var t,r=e;if(!r.cssRules||0===r.cssRules.length)return null;if(r.media&&"string"==typeof r.media.mediaText)return"@media "+r.media.mediaText+" {";if(de(e)){if("number"==typeof r.type&&1!==r.type)return null;var n=r.style?r.style.cssText:"";return e.selectorText+" {"+(n?" "+n:"")}if("containerName"in r)return"string"!=typeof r.containerQuery||r.containerName&&!fe.test(r.containerName)?null:"@container "+(r.containerName?r.containerName+" ":"")+r.containerQuery+" {";if("string"==typeof r.conditionText){var i="";try{i=(null==(t=e.constructor)?void 0:t.name)||""}catch(e){return null}return""===i||"Object"===i||"CSSSupportsRule"===i?"@supports "+r.conditionText+" {":null}return"string"==typeof r.name?"keyText"in r.cssRules[0]?fe.test(r.name)?"@keyframes "+r.name+" {":null:""===r.name?"@layer {":ve.test(r.name)?"@layer "+r.name+" {":null:null}(e);if(null===n)return!1;var i=r.sheetHref;return t.push({kind:"group",rules:Array.from(e.cssRules),sheetHref:i,index:0,parts:[],prelude:i?xe(n,i):n,fixColons:"sheet"===r.kind&&de(e)&&e.selectorText.includes(":")}),!0}catch(e){return!1}}(r,e)){var a=r.cssText;"sheet"===e.kind&&de(r)&&r.selectorText.includes(":")&&(a=ce(a)),e.parts.push(e.sheetHref?xe(a,e.sheetHref):a),e.index+=1}}return function(e){try{var r=e.rules||e.cssRules;if(!r)return!1;X(r);var n=e.href;!n&&e.ownerNode&&(n=e.ownerNode.baseURI);var a=Array.from(r);return t.push({kind:"sheet",sheet:e,rules:a,sheetHref:n,index:0,parts:[],importRule:null}),function(e,t){for(var r=[{sheet:t,rules:e,index:0}],n=function(){var e=r[r.length-1];if(e.index>=e.rules.length)return r.pop(),0;var t=e.rules[e.index];if(e.index+=1,!he(t)||i.has(t))return 0;var n=null;try{n=t.styleSheet}catch(e){return i.set(t,null),0}if(!n||r.some((e=>e.sheet===n)))return 0;try{var a=n.rules||n.cssRules;if(!a)return 0;X(a);var o=n.href;!o&&n.ownerNode&&(o=n.ownerNode.baseURI);var s=Array.from(a);i.set(t,{sheet:n,rules:s,sheetHref:o}),r.push({sheet:n,rules:s,index:0})}catch(e){}};r.length>0;)n()}(a,e),!0}catch(e){return!1}}(e)||(r=!0),{advance(e){if(r)return!0;var i=x(),o=e>0?e:1;try{for(;!r&&o>0;){var u=t[t.length-1];if(u.rules.length>u.index){o-=1;try{s(u)}catch(e){a(null)}}else{var l=null;try{if("group"===u.kind){var c=u.prelude+u.parts.join("")+"}";l=u.fixColons?ce(c):c}else l=ae(u.parts.join(""))}catch(e){}a(l)}}}catch(e){r=!0,n=null}finally{K(x()-i)}return r},text:()=>r?n:null,remainingRules(){if(r)return 0;var e=0;for(var n of t)e+=n.rules.length-n.index;return e}}}class me{constructor(){o(this,"idNodeMap",new Map),o(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);if(this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e))),re(e)){var r=C.shadowRoot(e);r&&this.removeNodeFromMap(r),"IFRAME"===e.nodeName&&e.contentDocument&&this.removeNodeFromMap(e.contentDocument)}}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){this.idNodeMap.set(t.id,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ye(e){var t=e.element,r=e.maskInputOptions,n=e.tagName,i=e.type,a=e.maskInputFn,o=e.value||"",s=i&&ge(i);return(r[n.toLowerCase()]||s&&r[s])&&(o=a?a(o,t):"*".repeat(o.length)),o}function ge(e){return e.toLowerCase()}var we=new Set(["rr_width","rr_height","rr_left","rr_top","rr_position","rr_transform","rr_display","rr_scrollleft","rr_scrolltop","rr_mediastate","rr_open_mode"]);function be(e){var t=e.element,r=e.name,n=e.value,i=e.maskAttributeFn,a=e.isGenerated;return n?e.maskAllElementAttributes?void 0!==a&&a&&we.has(ge(r))?n:"*".repeat(n.length):i?i(r,n,t):n:n}var ke="__rrweb_original__";function Se(e){try{var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?ge(t):null}catch(e){return null}}var Me=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ie=/^(?:[a-z+]+:)?\/\//i,Ce=/^www\..*/i,Ae=/^(data:)([^,]*),(.*)/i;function xe(e,t){return(e||"").replace(Me,((e,r,n,i,a,o)=>{var s,u=n||a||o,l=r||i||"";if(!u)return e;if(Ie.test(u)||Ce.test(u))return"url("+l+u+l+")";if(Ae.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+l+")";var c=t.split("/"),h=u.split("/");for(var d of(c.pop(),h))"."!==d&&(".."===d?c.pop():c.push(d));return"url("+l+c.join("/")+l+")"}))}var Re,Te,Oe="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",Fe=4096,Ee=1e5,Le=10,Ne=new Map,_e=1,De=new RegExp("[^a-z0-9-_:]"),We=-2;function Pe(){return _e++}var je=/^[^ \t\n\r\u000c]+/,Be=/^[, \t\n\r\u000c]+/,He=new WeakMap;function qe(e,t){return t&&""!==t.trim()?Ue(e,t):t}function Ue(e,t){var r=He.get(e);if(r||(r=e.createElement("a"),He.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function ze(e,t){return(null==t?void 0:t.maxBase64ImageLength)?function(e,t){return t&&e.length>t?Oe:e}(e,t.maxBase64ImageLength):e}function Ge(e,t,r,n,i,a){var o;if(!n)return n;if("src"===r||"href"===r&&("use"!==t||"#"!==n[0])){if("link"===t&&i){var s=null==(o=i.sheet)?void 0:o.href;if(s)return s}var u=qe(e,n);if(u.startsWith("data:")){if("img"===t&&i){var l=u;return((null==a?void 0:a.type)||void 0!==(null==a?void 0:a.quality))&&(l=function(e,t,r,n){if(Ee>t.length)return t;if(!e.complete||0===e.naturalWidth)return t;if(e.naturalWidth>Fe||e.naturalHeight>Fe)return t;var i=Ne.get(t);if(i&&i.type===r&&i.quality===n)return i.result;try{var a=document.createElement("canvas");a.width=e.naturalWidth,a.height=e.naturalHeight;var o=a.getContext("2d");if(!o)return t;o.drawImage(e,0,0);var s=a.toDataURL(r||"image/webp",null!=n?n:.4),u=t.length>s.length?s:t;if(Ne.size>=Le){var l=Ne.keys().next().value;void 0!==l&&Ne.delete(l)}return Ne.set(t,{type:r,quality:n,result:u}),u}catch(e){return t}}(i,u,a.type,a.quality)),ze(l,a)}if("image"===t)return ze(u,a)}return u}if("xlink:href"===r&&"#"!==n[0]){var c=qe(e,n);return"image"===t&&c.startsWith("data:")?ze(c,a):c}return"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,i=e.exec(t.substring(r));return i?(r+=(n=i[0]).length,n):""}for(var i=[];n(Be),t.length>r;){var a=n(je);if(","===a.slice(-1))a=qe(e,a.substring(0,a.length-1)),i.push(a);else{var o="";a=qe(e,a);for(var s=!1;;){var u=t.charAt(r);if(""===u){i.push((a+o).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){r+=1,i.push((a+o).trim());break}"("===u&&(s=!0)}o+=u,r+=1}}}return i.join(", ")}(e,n):"style"===r?xe(n,Ue(e)):"object"===t&&"data"===r?qe(e,n):n:qe(e,n)}function Ze(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function Ve(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Ve(C.parentNode(e),t,r);for(var n=e.classList.length;n--;)if(t.test(e.classList[n]))return!0;return!!r&&Ve(C.parentNode(e),t,r)}function $e(e,t,r,n){var i;if(re(e)){if(!C.childNodes(i=e).length)return!1}else{if(null===C.parentElement(e))return!1;i=C.parentElement(e)}try{if("string"==typeof t){if(n){if(i.closest("."+t))return!0}else if(i.classList.contains(t))return!0}else if(Ve(i,t,n))return!0;if(r)if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}catch(e){}return!1}function Je(e,t,r){var n=e.removeEventListener;"function"==typeof n&&n.call(e,t,r)}var Xe=new Map;function Ye(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}function Ke(e){return null==e?"":e.toLowerCase()}var Qe=50,et=!1,tt=!1;function rt(e,t){var r=t.doc,n=t.mirror,i=t.blockClass,a=t.blockSelector,o=t.maskTextClass,s=t.maskTextSelector,u=t.skipChild,l=void 0!==u&&u,c=t.inlineStylesheet,h=void 0===c||c,d=t.maskInputOptions,v=void 0===d?{}:d,p=t.maskTextFn,m=t.maskInputFn,y=t.maskAllElementAttributes,g=void 0!==y&&y,w=t.maskAttributeFn,b=t.slimDOMOptions,k=t.dataURLOptions,S=void 0===k?{}:k,M=t.inlineImages,I=void 0!==M&&M,A=t.recordCanvas,x=void 0!==A&&A,R=t.canvasMaskingConfigured,T=t.onSerialize,O=t.onIframeLoad,F=t.iframeLoadTimeout,E=void 0===F?5e3:F,N=t.onIframeListenerRegistered,_=t.onStylesheetLoad,W=t.stylesheetLoadTimeout,P=void 0===W?5e3:W,H=t.keepIframeSrcFn,q=void 0===H?()=>!1:H,U=t.newlyAddedElement,z=void 0!==U&&U,G=t.depth,Z=void 0===G?0:G,V=t.maxDepth,J=void 0===V?Qe:V,X=t.needsMask,K=t.preserveWhiteSpace,ee=void 0===K||K;if(Z>=J)return tt=!0,et||(et=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+J+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;X||(X=$e(e,o,s,void 0===X)),L>0&&(D.nodeCount+=1);var te,ae=function(e,t){var r=t.doc,n=t.blockClass,i=t.blockSelector,a=t.needsMask,o=t.inlineStylesheet,s=t.maskInputOptions,u=void 0===s?{}:s,l=t.maskTextFn,c=t.maskInputFn,h=t.maskAllElementAttributes,d=void 0!==h&&h,v=t.maskAttributeFn,p=t.dataURLOptions,m=void 0===p?{}:p,y=t.inlineImages,g=t.recordCanvas,w=t.canvasMaskingConfigured,b=t.keepIframeSrcFn,k=t.newlyAddedElement,S=void 0!==k&&k,M=function(e,t){if(t.hasNode(e)){var r=t.getId(e);return 1===r?void 0:r}}(r,t.mirror);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:f.Document,childNodes:[],compatMode:e.compatMode}:{type:f.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:f.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:M};case e.ELEMENT_NODE:return function(e,t){for(var r,n,i,a=t.doc,o=t.inlineStylesheet,s=t.maskInputOptions,u=void 0===s?{}:s,l=t.maskInputFn,c=t.maskAllElementAttributes,h=void 0!==c&&c,d=t.maskAttributeFn,v=t.dataURLOptions,p=void 0===v?{}:v,m=t.inlineImages,y=t.recordCanvas,g=t.canvasMaskingConfigured,w=t.keepIframeSrcFn,b=t.newlyAddedElement,k=void 0!==b&&b,S=t.rootId,M=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;)if(t.test(e.classList[n]))return!0;if(r)return e.matches(r)}catch(e){}return!1}(e,t.blockClass,t.blockSelector),I=function(e){if(e instanceof HTMLFormElement)return"form";var t=ge(e.tagName);return De.test(t)?"div":t}(e),A=new Set,x={},R=e.attributes.length,T=0;R>T;T++){var O=e.attributes[T];Ze(I,O.name)||(x[O.name]=Ge(a,I,ge(O.name),O.value,e,p))}if("link"===I&&o&&!M){var F=e.sheet;if(!F){var E=function(e){return e.href}(e);E&&!(F=Ye(a,E))&&E.includes(".css")&&(F=Ye(a,window.location.origin+"/"+E.replace(window.location.href,"")))}var N=null;F&&(Q(F)?L>0&&(j.push(e),B+=1):N=ue(F)),N&&(delete x.rel,delete x.href,x._cssText=N)}if("style"===I&&e.sheet&&!(e.innerText||C.textContent(e)||"").trim().length){var _=Y((()=>ue(e.sheet)));_&&(x._cssText=_)}if("input"===I||"textarea"===I||"select"===I){var D=e.value,W=e.checked;"radio"!==x.type&&"checkbox"!==x.type&&"submit"!==x.type&&"button"!==x.type&&D?x.value=ye({element:e,type:Se(e),tagName:I,value:D,maskInputOptions:u,maskInputFn:l}):W&&(x.checked=W)}if("option"===I&&(e.selected&&!u.select?x.selected=!0:delete x.selected),"dialog"===I&&e.open){try{x.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){x.rr_open_mode="modal",x.ph_rr_could_not_detect_modal=!0}A.add("rr_open_mode")}if("canvas"===I&&y&&!(null==g?void 0:g()))if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;e.width>r;r+=50)for(var n=0;e.height>n;n+=50){var i=t.getImageData;if(new Uint32Array((ke in i?i[ke]:i).call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(x.rr_dataURL=e.toDataURL(p.type,p.quality));else if(!("__context"in e)){var P=e.toDataURL(p.type,p.quality),H=a.createElement("canvas");H.width=e.width,H.height=e.height,P!==H.toDataURL(p.type,p.quality)&&(x.rr_dataURL=P)}var q,U,z=!1;if("img"===I&&m){Re||(Re=a.createElement("canvas"),Te=Re.getContext("2d"));var G=e,Z=G.currentSrc||G.getAttribute("src")||"<unknown-src>",V=G.crossOrigin,J=(t,r)=>z?be({element:e,name:t,value:r,maskAllElementAttributes:h,maskAttributeFn:d}):r,X=()=>{Je(G,"load",X);try{Re.width=G.naturalWidth,Re.height=G.naturalHeight,Te.drawImage(G,0,0);var e=Re.toDataURL(p.type,p.quality);x.rr_dataURL=J("rr_dataURL",e)}catch(e){if("anonymous"!==G.crossOrigin)return G.crossOrigin="anonymous",void(G.complete&&0!==G.naturalWidth?X():G.addEventListener("load",X));console.warn("Cannot inline img src="+Z+"! Error: "+e)}"anonymous"===G.crossOrigin&&(V?x.crossOrigin=J("crossOrigin",V):G.removeAttribute("crossorigin"))};G.complete&&0!==G.naturalWidth?X():G.addEventListener("load",X)}if("audio"===I||"video"===I){var K=x;K.rr_mediaState=e.paused?"paused":"played",A.add("rr_mediaState"),K.rr_mediaCurrentTime=e.currentTime,K.rr_mediaPlaybackRate=e.playbackRate,K.rr_mediaMuted=e.muted,K.rr_mediaLoop=e.loop,K.rr_mediaVolume=e.volume}if(k||(e.scrollLeft&&(x.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(x.rr_scrollTop=e.scrollTop)),M){var ee=e.getBoundingClientRect(),te=ee.width,re=ee.height,ne=ee.left,ie=ee.top,ae=null==(r=a.defaultView)?void 0:r.getComputedStyle(e);x={class:x.class,rr_width:te+"px",rr_height:re+"px",rr_left:Math.floor(ne+((null==(n=a.defaultView)?void 0:n.scrollX)||0))+"px",rr_top:Math.floor(ie+((null==(i=a.defaultView)?void 0:i.scrollY)||0))+"px"},A.add("rr_width"),A.add("rr_height"),A.add("rr_left"),A.add("rr_top"),ae&&(x.rr_position=ae.position||"static",A.add("rr_position"),ae.transform&&"none"!==ae.transform&&(x.rr_transform=ae.transform,A.add("rr_transform")),ae.display&&ae.display.startsWith("inline")&&(x.rr_display=ae.display,A.add("rr_display")))}if("iframe"!==I||w(x.src)||(e.contentDocument||(x.rr_src=x.src),delete x.src),h||d)for(var oe of Object.entries(x)){var se=oe[0],le=oe[1];"string"!=typeof le&&null!==le||(x[se]=be({element:e,name:se,value:le,maskAllElementAttributes:h,maskAttributeFn:d,isGenerated:A.has(se)}))}z=!0;try{customElements.get(I)&&(q=!0)}catch(e){}return{type:f.Element,tagName:I,attributes:x,childNodes:[],isSVG:(U=e,Boolean("svg"===U.tagName||U.ownerSVGElement)||void 0),needBlock:M,rootId:S,isCustom:q}}(e,{doc:r,blockClass:n,blockSelector:i,inlineStylesheet:o,maskInputOptions:u,maskInputFn:c,maskAllElementAttributes:d,maskAttributeFn:v,dataURLOptions:m,inlineImages:y,recordCanvas:g,canvasMaskingConfigured:w,keepIframeSrcFn:b,newlyAddedElement:S,rootId:M});case e.TEXT_NODE:return function(e,t){var r,n=t.needsMask,i=t.maskTextFn,a=t.rootId,o=C.parentNode(e),s=o&&o.tagName,u=C.textContent(e),l="STYLE"===s||void 0,c="SCRIPT"===s||void 0;if(l&&u){try{if(e.nextSibling||e.previousSibling);else if(Q(o.sheet));else if(null==(r=o.sheet)?void 0:r.cssRules){var h=ue(o.sheet);h&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(h)&&(u=h)}}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}u=xe(u,Ue(t.doc))}return c&&(u="SCRIPT_PLACEHOLDER"),!l&&!c&&u&&n&&(u=i?i(u,C.parentElement(e)):u.replace(/[\S]/g,"*")),{type:f.Text,textContent:u||"",isStyle:l,rootId:a}}(e,{doc:r,needsMask:a,maskTextFn:l,rootId:M});case e.CDATA_SECTION_NODE:return{type:f.CDATA,textContent:"",rootId:M};case e.COMMENT_NODE:return{type:f.Comment,textContent:C.textContent(e)||"",rootId:M};default:return!1}}(e,{doc:r,mirror:n,blockClass:i,blockSelector:a,needsMask:X,inlineStylesheet:h,maskInputOptions:v,maskTextFn:p,maskInputFn:m,maskAllElementAttributes:g,maskAttributeFn:w,dataURLOptions:S,inlineImages:I,recordCanvas:x,canvasMaskingConfigured:R,keepIframeSrcFn:q,newlyAddedElement:z});if(!ae)return console.warn(e,"not serialized"),null;te=n.hasNode(e)?n.getId(e):function(e,t){if(t.comment&&e.type===f.Comment)return!0;if(e.type===f.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===function(e,t){var r,n;try{n=new URL(e,window.location.href)}catch(e){return null}var i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==i?void 0:i[1])&&void 0!==r?r:null}(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Ke(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Ke(e.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Ke(e.attributes.rel)))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Ke(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Ke(e.attributes.property).match(/^(og|twitter|fb):/)||Ke(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Ke(e.attributes.name)))return!0;if(t.headMetaRobots&&["robots","googlebot","bingbot"].includes(Ke(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(Ke(e.attributes.name))||Ke(e.attributes.property).match(/^article:/)||Ke(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(Ke(e.attributes.name)))return!0}}return!1}(ae,b)||!ee&&ae.type===f.Text&&!ae.isStyle&&!ae.textContent.replace(/^\s+|\s+$/gm,"").length?We:Pe();var oe=Object.assign(ae,{id:te});if(n.add(e,oe),te===We)return null;T&&T(e);var se=!l;if(oe.type===f.Element){se=se&&!oe.needBlock,delete oe.needBlock;var le=C.shadowRoot(e);le&&ie(le)&&(oe.isShadowHost=!0)}if((oe.type===f.Document||oe.type===f.Element)&&se){b.headWhitespace&&oe.type===f.Element&&"head"===oe.tagName&&(ee=!1);var ce={doc:r,mirror:n,blockClass:i,blockSelector:a,needsMask:X,maskTextClass:o,maskTextSelector:s,skipChild:l,inlineStylesheet:h,maskInputOptions:v,maskTextFn:p,maskInputFn:m,maskAllElementAttributes:g,maskAttributeFn:w,slimDOMOptions:b,dataURLOptions:S,inlineImages:I,recordCanvas:x,canvasMaskingConfigured:R,preserveWhiteSpace:ee,onSerialize:T,onIframeLoad:O,iframeLoadTimeout:E,onIframeListenerRegistered:N,onStylesheetLoad:_,stylesheetLoadTimeout:P,keepIframeSrcFn:q,depth:Z+1,maxDepth:J};if(oe.type===f.Element&&"textarea"===oe.tagName&&void 0!==oe.attributes.value);else for(var he of Array.from(C.childNodes(e))){var de=rt(he,ce);de&&oe.childNodes.push(de)}var fe=null;if(re(e)&&(fe=C.shadowRoot(e)))for(var ve of Array.from(C.childNodes(fe))){var pe=rt(ve,ce);pe&&(ie(fe)&&(pe.isShadow=!0),oe.childNodes.push(pe))}}var me=C.parentNode(e);if(me&&ne(me)&&ie(me)&&(oe.isShadow=!0),oe.type===f.Element&&"iframe"===oe.tagName){var we=function(e,t,r){var n,i=()=>{},a=e.contentWindow;if(!a)return i;try{n=a.document.readyState}catch(e){return i}var o=()=>t();if("complete"!==n){var s=!1,u=null,l=()=>{s||(s=!0,null!==u&&(clearTimeout(u),u=null),Je(e,"load",c),e.addEventListener("load",o),t())},c=()=>l();return u=setTimeout(l,r),e.addEventListener("load",c),()=>{null!==u&&(clearTimeout(u),u=null),s?Je(e,"load",o):(s=!0,Je(e,"load",c))}}var h,d="about:blank";try{h=a.location.href}catch(e){return i}if(h!==d||e.src===d||""===e.src){var f=setTimeout(t,0);return e.addEventListener("load",o),()=>{clearTimeout(f),Je(e,"load",o)}}return e.addEventListener("load",o),()=>{Je(e,"load",o)}}(e,(()=>{var t=e.contentDocument;if(t&&O){var r=rt(t,{doc:t,mirror:n,blockClass:i,blockSelector:a,needsMask:X,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:h,maskInputOptions:v,maskTextFn:p,maskInputFn:m,maskAllElementAttributes:g,maskAttributeFn:w,slimDOMOptions:b,dataURLOptions:S,inlineImages:I,recordCanvas:x,canvasMaskingConfigured:R,preserveWhiteSpace:ee,onSerialize:T,onIframeLoad:O,iframeLoadTimeout:E,onIframeListenerRegistered:N,onStylesheetLoad:_,stylesheetLoadTimeout:P,keepIframeSrcFn:q,depth:Z+1,maxDepth:J});r&&O(e,r)}}),E);null==N||N(e,we)}return oe.type===f.Element&&"link"===oe.tagName&&"stylesheet"===oe.attributes.rel&&function(t,u,l){if(!Xe.has(t)){var c;try{c=t.sheet}catch(e){return}if(!c){var d=new AbortController,f=!1,y=()=>{if(!f){f=!0;try{(()=>{if(_){var t=rt(e,{doc:r,mirror:n,blockClass:i,blockSelector:a,needsMask:X,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:h,maskInputOptions:v,maskTextFn:p,maskInputFn:m,maskAllElementAttributes:g,maskAttributeFn:w,slimDOMOptions:b,dataURLOptions:S,inlineImages:I,recordCanvas:x,canvasMaskingConfigured:R,preserveWhiteSpace:ee,onSerialize:T,onIframeLoad:O,iframeLoadTimeout:E,onStylesheetLoad:_,stylesheetLoadTimeout:P,keepIframeSrcFn:q,depth:Z,maxDepth:J});t&&_(e,t)}})()}finally{Xe.delete(t),d.abort()}}},k=setTimeout(y,l);d.signal.addEventListener("abort",(()=>clearTimeout(k)),{once:!0}),t.addEventListener("load",y,{signal:d.signal,once:!0}),Xe.set(t,d)}}}(e,0,P),oe}function nt(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:!1===e?{}:e}class it{constructor(){o(this,"parentElement",null),o(this,"parentNode",null),o(this,"ownerDocument"),o(this,"firstChild",null),o(this,"lastChild",null),o(this,"previousSibling",null),o(this,"nextSibling",null),o(this,"ELEMENT_NODE",1),o(this,"TEXT_NODE",3),o(this,"nodeType"),o(this,"nodeName"),o(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof it))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;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 at(e,t,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>ot(r,e,t,n)}function ot(e,t,r,n){st((()=>{var i=e.removeEventListener;"function"==typeof i&&(void 0!==n?i.call(e,t,r,n):i.call(e,t,r))}))}function st(e){try{e()}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}}var ut="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",lt={map:{},getId(){return console.error(ut),-1},getNode(){return console.error(ut),null},removeNodeFromMap(){console.error(ut)},has(){return console.error(ut),!1},reset(){console.error(ut)}};function ct(e,t,r){void 0===r&&(r={});var n=null,i=0;return function(){for(var a=arguments.length,o=new Array(a),s=0;a>s;s++)o[s]=arguments[s];var u=Date.now();i||!1!==r.leading||(i=u);var l=t-(u-i),c=this;0>=l||l>t?(n&&(clearTimeout(n),n=null),i=u,e.apply(c,o)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(c,o)}),l))}}function ht(e,t,r,n,i){void 0===i&&(i=window);var a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(e){if(setTimeout((()=>{try{r.set.call(this,e)}catch(e){}}),0),a&&a.set){if(a.get)try{a.get.call(this)}catch(e){return}a.set.call(this,e)}}}),()=>ht(e,t,a||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(lt=new Proxy(lt,{get(e,t,r){return"map"===t&&console.error(ut),Reflect.get(e,t,r)}}));var dt=Date.now;function ft(e){var t,r,n,i,a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:a.documentElement.scrollLeft||(null==a?void 0:a.body)&&(null==(t=C.parentElement(a.body))?void 0:t.scrollLeft)||(null==(r=null==a?void 0:a.body)?void 0:r.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null==a?void 0:a.body)&&(null==(n=C.parentElement(a.body))?void 0:n.scrollTop)||(null==(i=null==a?void 0:a.body)?void 0:i.scrollTop)||0}}function vt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function pt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function mt(e){return e?e.nodeType===e.ELEMENT_NODE?e:C.parentElement(e):null}function yt(e,t,r,n){if(!e)return!1;var i=mt(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(Ve(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1}function gt(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===We}function wt(e,t){if(ne(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var n=C.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||wt(n,t))}function bt(e){return Boolean(e.changedTouches)}function kt(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function St(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Mt(e){return!!e&&(e instanceof it&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(C.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(dt=()=>(new Date).getTime());class It{constructor(){o(this,"id",1),o(this,"styleIDMap",new WeakMap),o(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var 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 Ct(e){var t,r=null;return"getRootNode"in e&&(null==(t=C.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(e))&&(r=C.host(C.getRootNode(e))),r}function At(e){var t=e.ownerDocument;return!!t&&(C.contains(t,e)||function(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Ct(r);)r=t;return r}(e);return C.contains(t,r)}(e))}function xt(e){return"__ln"in e}class Rt{constructor(){o(this,"length",0),o(this,"head",null),o(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;e>r;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&xt(e.previousSibling)){var 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&&xt(e.nextSibling)&&e.nextSibling.__ln.previous){var n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){var 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--)}}var Tt,Ot=(e,t)=>e+"@"+t;class Ft{constructor(){o(this,"frozen",!1),o(this,"locked",!1),o(this,"texts",[]),o(this,"attributes",[]),o(this,"attributeMap",new WeakMap),o(this,"generatedAttributes",new WeakMap),o(this,"removes",[]),o(this,"mapRemoves",[]),o(this,"movedMap",{}),o(this,"addedSet",new Set),o(this,"movedSet",new Set),o(this,"droppedSet",new Set),o(this,"removesSubTreeCache",new Set),o(this,"mutationCb"),o(this,"blockClass"),o(this,"blockSelector"),o(this,"maskTextClass"),o(this,"maskTextSelector"),o(this,"inlineStylesheet"),o(this,"maskInputOptions"),o(this,"maskTextFn"),o(this,"maskInputFn"),o(this,"maskAllElementAttributes"),o(this,"maskAttributeFn"),o(this,"keepIframeSrcFn"),o(this,"recordCanvas"),o(this,"canvasMaskingConfigured"),o(this,"inlineImages"),o(this,"slimDOMOptions"),o(this,"dataURLOptions"),o(this,"doc"),o(this,"mirror"),o(this,"iframeManager"),o(this,"stylesheetManager"),o(this,"shadowDomManager"),o(this,"canvasManager"),o(this,"processedNodeManager"),o(this,"unattachedDoc"),o(this,"canvasManagerReleased",!1),o(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),o(this,"emit",(()=>{if(!this.frozen&&!this.locked){var e,t,r=x(),n=F();try{this.processBufferedMutations()}finally{e=x()-r,t=n,L>0||E(e,null!=t?t:R)||e>q.slowestBatchMs&&(q.slowestBatchMs=e)}}})),o(this,"processBufferedMutations",(()=>{for(var e=[],t=new Set,r=new Rt,n=e=>{for(var t=e,r=We;r===We;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},i=i=>{var a=C.parentNode(i);if(a&&At(i)&&"TEXTAREA"!==a.tagName){var o=ne(a)?this.mirror.getId(Ct(i)):this.mirror.getId(a),s=n(i);if(-1===o||-1===s)return r.addNode(i);var u=rt(i,{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,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:e=>{kt(e,this.mirror)&&this.iframeManager.addIframe(e),St(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Mt(e)&&!yt(e,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(e),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onIframeListenerRegistered:(e,t)=>{this.iframeManager.registerLoadListenerDisposer(e,t)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});u&&(e.push({parentId:o,nextId:s,node:u}),t.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var a of this.movedSet)Lt(this.removesSubTreeCache,a)&&!this.movedSet.has(C.parentNode(a))||i(a);for(var o of this.addedSet)Nt(this.droppedSet,o)||Lt(this.removesSubTreeCache,o)?Nt(this.movedSet,o)?i(o):this.droppedSet.add(o):i(o);for(var s=null;r.length;){var u=null;if(s){var l=this.mirror.getId(C.parentNode(s.value)),c=n(s.value);-1!==l&&-1!==c&&(u=s)}if(!u)for(var h=r.tail;h;){var d=h;if(h=h.previous,d){var f=this.mirror.getId(C.parentNode(d.value));if(-1===n(d.value))continue;if(-1!==f){u=d;break}var v=C.parentNode(d.value);if(v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=C.host(v);if(-1!==this.mirror.getId(p)){u=d;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}s=u.previous,r.removeNode(u.value),i(u.value)}var m={texts:this.texts.map((e=>{var t=e.node,r=C.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{var t,r=e.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof r.style){var n=JSON.stringify(e.styleDiff),i=JSON.stringify(e._unchangedStyles);r.style.length>n.length&&(n+i).split("var(").length===r.style.split("var(").length&&(r.style=e.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var a of Object.entries(r)){var o=a[0],s=a[1];"string"!=typeof s&&null!==s||(r[o]=be({element:e.node,name:o,value:s,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null==(t=this.generatedAttributes.get(e.node))?void 0:t.has(o)}))}return{id:this.mirror.getId(e.node),attributes:r}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},(m.texts.length||m.attributes.length||m.removes.length||m.adds.length)&&this.mutationCb(m)})),o(this,"bufferBelongsToIframe",(e=>this.doc===e.contentDocument)),o(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(this.attributes.push(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e,t));var r=Array.from(C.childNodes(e),(e=>C.textContent(e)||"")).join("");t.attributes.value=ye({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Se(e),value:r,maskInputFn:this.maskInputFn})})),o(this,"processMutation",(e=>{var t;if(!gt(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var r=C.textContent(e.target);yt(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue||this.texts.push({value:$e(e.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,mt(e.target)):r.replace(/[\S]/g,"*"):r,node:e.target});break;case"attributes":var n,i=e.target,a=e.attributeName,o=null!==(n=e.attributeNamespace)&&void 0!==n?n:null,s=function(e,t,r){if(!r)return t;var n=e.getAttributeNodeNS(r,t);if(n)return n.name;if("http://www.w3.org/1999/xlink"===r)return"xlink:"+t;if("http://www.w3.org/XML/1998/namespace"===r)return"xml:"+t;if("http://www.w3.org/2000/xmlns/"===r)return"xmlns"===t?t:"xmlns:"+t;var i=e.lookupPrefix(r);return i?i+":"+t:t}(i,a,o),u=o?i.getAttributeNS(o,a):e.target.getAttribute(a);if("value"===s){var l=i,c=Se(l);u=ye({element:l,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:c,value:u,maskInputFn:this.maskInputFn})}if(yt(e.target,this.blockClass,this.blockSelector,!1)||u===e.oldValue)return;var h=this.attributeMap.get(e.target),d="IFRAME"===i.tagName&&"src"===s;if(d&&!this.keepIframeSrcFn(u)&&i.contentDocument)return;if(h||(this.attributes.push(h={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e.target,h)),"type"===s&&"INPUT"===i.tagName&&"password"===(e.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!Ze(i.tagName,s)){var f=Ge(this.doc,ge(i.tagName),ge(s),u,i,this.dataURLOptions);if(d&&!this.keepIframeSrcFn(u)&&(s="rr_src"),h.attributes[s]=f,null==(t=this.generatedAttributes.get(e.target))||t.delete(s),"style"===s){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}var v=this.unattachedDoc.createElement("span"),p=i.style;for(var m of(e.oldValue&&(v.style.cssText=e.oldValue),Array.from(p))){var y=p.getPropertyValue(m),g=p.getPropertyPriority(m);y!==v.style.getPropertyValue(m)||g!==v.style.getPropertyPriority(m)?h.styleDiff[m]=""===g?y:[y,g]:h._unchangedStyles[m]=[y,g]}for(var w of Array.from(v.style))""===p.getPropertyValue(w)&&(h.styleDiff[w]=!1)}else if("open"===s&&"DIALOG"===i.tagName){h.attributes.rr_open_mode=i.matches("dialog:modal")?"modal":"non-modal";var b=this.generatedAttributes.get(e.target);b||this.generatedAttributes.set(e.target,b=new Set),b.add("rr_open_mode")}}break;case"childList":if(yt(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{var r=this.mirror.getId(t),n=ne(e.target)?this.mirror.getId(C.host(e.target)):this.mirror.getId(e.target);yt(e.target,this.blockClass,this.blockSelector,!1)||gt(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Et(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||wt(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ot(r,n)]?Et(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!ne(e.target)||!ie(e.target))||void 0}),function(e,t){for(var r=[e];r.length;){var n=r.pop();t.has(n)||(t.add(n),C.childNodes(n).forEach((e=>r.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),o(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)){if(this.addedSet.has(e))return this.addedSet.delete(e),void this.addedSet.add(e);if(!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(gt(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[Ot(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);yt(e,this.blockClass,this.blockSelector,!1)||(C.childNodes(e).forEach((e=>this.genAdds(e))),Mt(e)&&C.childNodes(C.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAllElementAttributes","maskAttributeFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]})),this.canvasManager.acquire()}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.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function Et(e,t){for(var r=[t];r.length;){var n=r.pop();e.delete(n),C.childNodes(n).forEach((e=>r.push(e)))}}function Lt(e,t,r){return 0!==e.size&&function(e,t,r){var n=C.parentNode(t);return!!n&&e.has(n)}(e,t)}function Nt(e,t){if(0===e.size)return!1;for(var r=C.parentNode(t);r;){if(e.has(r))return!0;r=C.parentNode(r)}return!1}var _t=function(e,t){return void 0===t&&(t="rrweb"),Tt?function(){try{return e(...arguments)}catch(e){if(Tt&&!0===Tt(e,t))return;throw e}}:e},Dt=[];function Wt(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function Pt(e,t){var r,n=new Ft;n.init(e);try{r=new(M())(_t(n.processMutations.bind(n)));var i={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return e.attributeFilter&&e.attributeFilter.length>0&&(i.attributeFilter=e.attributeFilter),r.observe(t,i),Dt.push(n),{observer:r,buffer:n}}catch(e){try{null==r||r.disconnect(),n.destroy(),n.reset()}catch(e){}throw e}}function jt(e){var t=e.scrollCb,r=e.doc,n=e.mirror,i=e.blockClass,a=e.blockSelector,o=e.sampling,s=new Map,u=e=>{var o=Wt(e);if(o&&!yt(o,i,a,!0)){var u,l,c=n.getId(o);if(o===r&&r.defaultView){var h=ft(r.defaultView);u=h.left,l=h.top}else u=o.scrollLeft,l=o.scrollTop;var d=u+","+l;s.get(c)!==d&&(s.set(c,d),t({id:c,x:u,y:l}))}},l=[at("scroll",_t(ct(_t((e=>u(e))),o.scroll||100)),r)];return"onscrollend"in r&&l.push(at("scrollend",_t(u),r)),()=>l.forEach((e=>e()))}function Bt(e,t){for(var r=Dt.length-1;r>=0;r--){var n=Dt[r];if(n){var i=n.bufferBelongsToIframe(e);!i&&t&&t.has(n.bufferDoc())&&(i=!0),i&&(n.reset(),Dt.splice(r,1))}}}var Ht=["INPUT","TEXTAREA","SELECT"],qt=new WeakMap;function Ut(e){return function e(t,r){if($t("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||$t("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||$t("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||$t("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var n=Array.from(t.parentRule.cssRules).indexOf(t);return r.unshift(n),e(t.parentRule,r)}if(t.parentStyleSheet){var i=Array.from(t.parentStyleSheet.cssRules).indexOf(t);r.unshift(i)}return r}(e,[])}function zt(e,t,r){var n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}var Gt=5e3;function Zt(e,t){var r,n,i,a,o=e.stylesheetManager;a=e.mirror.getId("#document"===t.nodeName?t:C.host(t));var s="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(i=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:i.ShadowRoot,u=(null==s?void 0:s.prototype)?Object.getOwnPropertyDescriptor(null==s?void 0:s.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&s&&u?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var e;return null==(e=u.get)?void 0:e.call(this)},set(e){var t,r;try{r=null==(t=u.set)?void 0:t.call(this,e)}catch(e){if(e&&"object"==typeof e&&"NotAllowedError"===e.name)return;throw e}if(null!==a&&-1!==a)try{o.adoptStyleSheets(e,a)}catch(e){}return r}}),_t((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function Vt(e,t){void 0===t&&(t={});var n,i,a=e.doc.defaultView;if(!a)return()=>{};!function(e,t){var r=e.mutationCb,n=e.mousemoveCb,i=e.mouseInteractionCb,a=e.scrollCb,o=e.viewportResizeCb,s=e.inputCb,u=e.mediaInteractionCb,l=e.styleSheetRuleCb,c=e.styleDeclarationCb,h=e.canvasMutationCb,d=e.fontCb,f=e.selectionCb,v=e.customElementCb;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),r(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),n(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),i(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),a(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),o(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),s(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),u(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),l(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),c(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),h(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),d(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),f(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),v(...arguments)}}(e,t);var o,s,h,f,v,p,m,y,g=[],w=_t((()=>{if(i){i.destroy(),i.reset();var t=Dt.indexOf(i);-1!==t&&Dt.splice(t,1)}e.shadowDomManager.resetForDoc(e.doc),null==n||n.disconnect(),g.forEach((e=>e()))}));try{if(e.recordDOM){var b=Pt(e,e.doc);n=b.observer,i=b.buffer}if(g.push(function(e){var t=e.mousemoveCb,r=e.sampling,n=e.doc,i=e.mirror;if(!1===r.mousemove)return()=>{};var a,o="number"==typeof r.mousemove?r.mousemove:50,s="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],c=ct(_t((e=>{var r=Date.now()-a;t(l.map((e=>(e.timeOffset-=r,e))),e),l=[],a=null})),s),h=_t(ct(_t((e=>{var t=Wt(e),r=bt(e)?e.changedTouches[0]:e,n=r.clientX,o=r.clientY;a||(a=dt()),l.push({x:n,y:o,id:i.getId(t),timeOffset:dt()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?u.Drag:e instanceof MouseEvent?u.MouseMove:u.TouchMove)})),o,{trailing:!1})),d=[at("mousemove",h,n),at("touchmove",h,n),at("drag",h,n)];return _t((()=>{d.forEach((e=>e()))}))}(e)),g.push(function(e){var t=e.mouseInteractionCb,n=e.doc,i=e.mirror,a=e.blockClass,o=e.blockSelector,s=e.sampling;if(!1===s.mouseInteraction)return()=>{};var u=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,h=[],d=null;return Object.keys(l).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==u[e])).forEach((e=>{var s=ge(e),u=(e=>n=>{var s=Wt(n);if(!yt(s,a,o,!0)){var u=null,h=e;if("pointerType"in n){switch(n.pointerType){case"mouse":u=c.Mouse;break;case"touch":u=c.Touch;break;case"pen":u=c.Pen}u===c.Touch&&(l[e]===l.MouseDown?h="TouchStart":l[e]===l.MouseUp&&(h="TouchEnd"))}else bt(n)&&(u=c.Touch);null!==u?(d=u,(h.startsWith("Touch")&&u===c.Touch||h.startsWith("Mouse")&&u===c.Mouse)&&(u=null)):l[e]===l.Click&&(u=d,d=null);var f=bt(n)?n.changedTouches[0]:n;if(f){var v=i.getId(s),p=f.clientX,m=f.clientY;_t(t)(r({type:l[h],id:v,x:p,y:m},null!==u&&{pointerType:u}))}}})(e);if(window.PointerEvent)switch(l[e]){case l.MouseDown:case l.MouseUp:s=s.replace("mouse","pointer");break;case l.TouchStart:case l.TouchEnd:return}h.push(at(s,u,n))})),_t((()=>{h.forEach((e=>e()))}))}(e)),g.push(jt(e)),g.push(function(e,t){var r=e.viewportResizeCb,n=t.win,i=-1,a=-1;return at("resize",_t(ct(_t((()=>{var e=vt(),t=pt();i===e&&a===t||(r({width:Number(t),height:Number(e)}),i=e,a=t)})),200)),n)}(e,{win:a})),g.push(function(e){var t=e.inputCb,n=e.doc,i=e.mirror,a=e.blockClass,o=e.blockSelector,s=e.ignoreClass,u=e.ignoreSelector,l=e.maskInputOptions,c=e.maskInputFn,h=e.userTriggeredOnInput;function d(e){var t=Wt(e),r=e.isTrusted,i=n.defaultView;if(!t||!i||t instanceof i.HTMLElement){var d=t&&t.tagName;if(t&&"OPTION"===d&&(t=C.parentElement(t)),t&&d&&Ht.indexOf(d)>=0&&!yt(t,a,o,!0)&&!(t.classList.contains(s)||u&&t.matches(u))){var v=t.value,p=!1,m=Se(t)||"";"radio"===m||"checkbox"===m?p=t.checked:(l[d.toLowerCase()]||l[m])&&(v=ye({element:t,maskInputOptions:l,tagName:d,type:m,value:v,maskInputFn:c})),f(t,h?{text:v,isChecked:p,userTriggered:r}:{text:v,isChecked:p});var y=t.name;"radio"===m&&y&&p&&n.querySelectorAll('input[type="radio"][name="'+y+'"]').forEach((e=>{if(e!==t){var r=e.value;f(e,h?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}}function f(e,n){var a=qt.get(e);if(!a||a.text!==n.text||a.isChecked!==n.isChecked){qt.set(e,n);var o=i.getId(e);_t(t)(r({},n,{id:o}))}}var v=("last"===e.sampling.input?["change"]:["input","change"]).map((e=>at(e,_t(d),n))),p=n.defaultView;if(!p)return()=>{v.forEach((e=>e()))};var m=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return m&&m.set&&v.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map((e=>ht(e[0],e[1],{set(){_t(d)({target:this,isTrusted:!1})}},!1,p)))),_t((()=>{v.forEach((e=>e()))}))}(e)),g.push(function(e){var t=e.mediaInteractionCb,r=e.blockClass,n=e.blockSelector,i=e.mirror,a=e.sampling,o=e.doc,s=_t((e=>ct(_t((a=>{var o=Wt(a);if(o&&!yt(o,r,n,!0)){var s=o.currentTime,u=o.volume,l=o.muted,c=o.playbackRate,h=o.loop;t({type:e,id:i.getId(o),currentTime:s,volume:u,muted:l,playbackRate:c,loop:h})}})),a.media||500))),u=[at("play",s(d.Play),o),at("pause",s(d.Pause),o),at("seeked",s(d.Seeked),o),at("volumechange",s(d.VolumeChange),o),at("ratechange",s(d.RateChange),o)];return _t((()=>{u.forEach((e=>e()))}))}(e)),e.recordDOM){var k=function(e){var t=new Map,r=new Set,n=!0,i=e=>{if(n)try{e()}catch(e){}},a=e=>{var r,n=t.get(e);if(n){for(;null==(r=n[0])?void 0:r.ready;){var a=n.shift();(null==a?void 0:a.emit)&&i(a.emit)}0===n.length&&t.delete(e)}};return{queueMutation(e,r){if(e){var n=t.get(e);n?(n.push({emit:r,ready:!0}),a(e)):i(r)}else i(r)},queuePendingMutation(o,s,u){if(!n)return()=>{};var l=t.get(o);l||t.set(o,l=[]);var c={emit:s,ready:!1};l.push(c);var h,d=!1,f=!1,v=()=>{d||f||(d=!0,void 0!==h&&r.delete(h),c.ready=!0,c.emit=void 0,a(o))};try{h=e.setTimeout(v,Gt),d||f?e.clearTimeout(h):r.add(h)}catch(e){v()}return t=>{!f&&n&&(f=!0,void 0!==h&&(e.clearTimeout(h),r.delete(h)),d?t&&i(u):(c.ready=!0,t||(c.emit=void 0),a(o)))}},reset(){n=!1,r.forEach((t=>e.clearTimeout(t))),r.clear(),t.clear()}}}(a);g.push(k.reset),g.push(function(e,t){var r=e.styleSheetRuleCb,n=e.mirror,i=e.stylesheetManager,a=t.win,o=t.mutationQueue;if(!a.CSSStyleSheet||!a.CSSStyleSheet.prototype)return()=>{};var s=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:_t(((e,t,a)=>{var s=a[0],u=e.apply(t,a);i.onCssomSheetMutation(t);var l=zt(t,n,i.styleMirror),c=l.id,h=l.styleId;return(c&&-1!==c||h&&-1!==h)&&o.queueMutation(t,(()=>r({id:c,styleId:h,adds:[{rule:s,index:u}]}))),u}),"host")}),a.CSSStyleSheet.prototype.addRule=function(e,t,r){return void 0===r&&(r=this.cssRules.length),a.CSSStyleSheet.prototype.insertRule.apply(this,[e+" { "+t+" }",r])};var u,l,c=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=new Proxy(c,{apply:_t(((e,t,a)=>{var s=a[0],u=e.apply(t,a);i.onCssomSheetMutation(t);var l=zt(t,n,i.styleMirror),c=l.id,h=l.styleId;return(c&&-1!==c||h&&-1!==h)&&o.queueMutation(t,(()=>r({id:c,styleId:h,removes:[{index:s}]}))),u}),"host")}),a.CSSStyleSheet.prototype.removeRule=function(e){return a.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},a.CSSStyleSheet.prototype.replace&&(u=a.CSSStyleSheet.prototype.replace,a.CSSStyleSheet.prototype.replace=new Proxy(u,{apply:_t(((e,t,a)=>{var s=a[0],u=e.apply(t,a);try{var l=null==u?void 0:u.then;if(t.ownerNode||!u||"function"!=typeof l)return u;i.onCssomSheetMutation(t);var c=zt(t,n,i.styleMirror),h=c.id,d=c.styleId;if(!(h&&-1!==h||d&&-1!==d))return u;var f=o.queuePendingMutation(t,(()=>r({id:h,styleId:d,replace:s})),(()=>{var e=ue(t);null!==e&&r({id:h,styleId:d,replace:e})}));try{l.call(u,(()=>f(!0)),(()=>f(!1)))}catch(e){f(!1)}}catch(e){}return u}),"host")})),a.CSSStyleSheet.prototype.replaceSync&&(l=a.CSSStyleSheet.prototype.replaceSync,a.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:_t(((e,t,a)=>{var s=a[0],u=e.apply(t,a);i.onCssomSheetMutation(t);var l=zt(t,n,i.styleMirror),c=l.id,h=l.styleId;return(c&&-1!==c||h&&-1!==h)&&o.queueMutation(t,(()=>r({id:c,styleId:h,replaceSync:s}))),u}),"host")}));var h={};Jt("CSSGroupingRule")?h.CSSGroupingRule=a.CSSGroupingRule:(Jt("CSSMediaRule")&&(h.CSSMediaRule=a.CSSMediaRule),Jt("CSSConditionRule")&&(h.CSSConditionRule=a.CSSConditionRule),Jt("CSSSupportsRule")&&(h.CSSSupportsRule=a.CSSSupportsRule));var d={};return Object.entries(h).forEach((e=>{var t=e[0],a=e[1];d[t]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=new Proxy(d[t].insertRule,{apply:_t(((e,t,a)=>{var s=a[0],u=e.apply(t,a);i.onCssomSheetMutation(t.parentStyleSheet);var l=zt(t.parentStyleSheet,n,i.styleMirror),c=l.id,h=l.styleId;if(t.parentStyleSheet&&(c&&-1!==c||h&&-1!==h)){var d=[...Ut(t),u];o.queueMutation(t.parentStyleSheet,(()=>r({id:c,styleId:h,adds:[{rule:s,index:d}]})))}return u}),"host")}),a.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:_t(((e,t,a)=>{var s=a[0],u=e.apply(t,a);i.onCssomSheetMutation(t.parentStyleSheet);var l=zt(t.parentStyleSheet,n,i.styleMirror),c=l.id,h=l.styleId;if(t.parentStyleSheet&&(c&&-1!==c||h&&-1!==h)){var d=[...Ut(t),s];o.queueMutation(t.parentStyleSheet,(()=>r({id:c,styleId:h,removes:[{index:d}]})))}return u}),"host")})})),_t((()=>{a.CSSStyleSheet.prototype.insertRule=s,a.CSSStyleSheet.prototype.deleteRule=c,u&&(a.CSSStyleSheet.prototype.replace=u),l&&(a.CSSStyleSheet.prototype.replaceSync=l),Object.entries(h).forEach((e=>{var t=e[0],r=e[1];r.prototype.insertRule=d[t].insertRule,r.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:a,mutationQueue:k})),g.push(Zt(e,e.doc)),g.push(function(e,t){var r=e.styleDeclarationCb,n=e.mirror,i=e.ignoreCSSAttributes,a=e.stylesheetManager,o=t.win,s=t.mutationQueue,u=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(u,{apply:_t(((e,t,o)=>{var u,l=o[0],c=o[1],h=o[2],d=e.apply(t,o);if(i.has(l))return d;var f=null==(u=t.parentRule)?void 0:u.parentStyleSheet;a.onCssomSheetMutation(f);var v=zt(f,n,a.styleMirror),p=v.id,m=v.styleId;if(p&&-1!==p||m&&-1!==m){var y=Ut(t.parentRule);s.queueMutation(f,(()=>r({id:p,styleId:m,set:{property:l,value:c,priority:h},index:y})))}return d}),"host")});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:_t(((e,t,o)=>{var u,l=o[0],c=e.apply(t,o);if(i.has(l))return c;var h=null==(u=t.parentRule)?void 0:u.parentStyleSheet;a.onCssomSheetMutation(h);var d=zt(h,n,a.styleMirror),f=d.id,v=d.styleId;if(f&&-1!==f||v&&-1!==v){var p=Ut(t.parentRule);s.queueMutation(h,(()=>r({id:f,styleId:v,remove:{property:l},index:p})))}return c}),"host")}),_t((()=>{o.CSSStyleDeclaration.prototype.setProperty=u,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:a,mutationQueue:k})),e.collectFonts&&g.push(function(e){var t=e.fontCb,r=e.doc,n=r.defaultView;if(!n)return()=>{};var i=[],a=new WeakMap,o=n.FontFace;n.FontFace=function(e,t,r){var n=new o(e,t,r);return a.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};var s=I(r.fonts,"add",(function(e){return function(r){return setTimeout(_t((()=>{var e=a.get(r);e&&(t(e),a.delete(r))})),0),e.apply(this,[r])}}));return i.push((()=>{n.FontFace=o})),i.push(s),_t((()=>{i.forEach((e=>e()))}))}(e))}for(var S of(g.push((s=(o=e).doc,h=o.mirror,f=o.blockClass,v=o.blockSelector,p=o.selectionCb,m=!0,(y=_t((()=>{var e=s.getSelection();if(!(!e||m&&(null==e?void 0:e.isCollapsed))){m=e.isCollapsed||!1;for(var t=[],r=e.rangeCount||0,n=0;r>n;n++){var i=e.getRangeAt(n),a=i.startContainer,o=i.startOffset,u=i.endContainer,l=i.endOffset;yt(a,f,v,!0)||yt(u,f,v,!0)||t.push({start:h.getId(a),startOffset:o,end:h.getId(u),endOffset:l})}p({ranges:t})}})))(),at("selectionchange",y))),g.push(function(e){var t=e.customElementCb,r=e.doc.defaultView;return r&&r.customElements?I(r.customElements,"define",(function(e){return function(r,n,i){try{t({define:{name:r}})}catch(e){console.warn("Custom element callback failed for "+r)}return e.apply(this,[r,n,i])}})):()=>{}}(e)),e.plugins))g.push(S.observer(S.callback,a,S.options))}catch(e){try{w()}catch(e){}throw e}return w}function $t(e){return void 0!==window[e]}function Jt(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Xt{constructor(e){o(this,"iframeRemoteIdToLocalIdMap",new WeakMap),o(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){if(0>t)return t;var i=r||this.getRemoteIdToLocalIdMap(e),a=n||this.getLocalIdToRemoteIdMap(e),o=i.get(t);return void 0===o&&(o=this.generateIdFn(),i.set(t,o),a.set(o,t)),o}getIds(e,t){var r=this.getRemoteIdToLocalIdMap(e),n=this.getLocalIdToRemoteIdMap(e);return t.map((t=>this.getId(e,t,r,n)))}getRemoteId(e,t,r){var n;return"number"!=typeof t||0>t?t:null!==(n=(r||this.getLocalIdToRemoteIdMap(e)).get(t))&&void 0!==n?n:-1}getRemoteIds(e,t){var r=this.getLocalIdToRemoteIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(e),this.iframeLocalIdToRemoteIdMap.delete(e)}getRemoteIdToLocalIdMap(e){var t=this.iframeRemoteIdToLocalIdMap.get(e);return t||this.iframeRemoteIdToLocalIdMap.set(e,t=new Map),t}getLocalIdToRemoteIdMap(e){var t=this.iframeLocalIdToRemoteIdMap.get(e);return t||this.iframeLocalIdToRemoteIdMap.set(e,t=new Map),t}}class Yt{constructor(e){o(this,"iframes",new WeakMap),o(this,"crossOriginIframeMap",new WeakMap),o(this,"crossOriginIframeMirror",new Xt(Pe)),o(this,"crossOriginIframeStyleMirror"),o(this,"crossOriginIframeRootIdMap",new WeakMap),o(this,"mirror"),o(this,"mutationCb"),o(this,"wrappedEmit"),o(this,"loadListener"),o(this,"pageHideListener"),o(this,"stylesheetManager"),o(this,"recordCrossOriginIframes"),o(this,"messageHandler"),o(this,"nestedIframeListeners",new Map),o(this,"attachedWindows",new WeakMap),o(this,"attachedDocuments",new WeakMap),o(this,"attachedIframes",new Map),o(this,"loadListenerDisposers",new WeakMap),o(this,"iframeElementsById",new Map),o(this,"pageHideHandlers",new WeakMap),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Xt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}registerLoadListenerDisposer(e,t){var r=this.loadListenerDisposers.get(e);r||this.loadListenerDisposers.set(e,r=new Set),r.add(t);var n=this.mirror.getId(e);-1!==n&&this.iframeElementsById.set(n,e)}getIframeElementById(e){var t,r,n;return null!==(t=null!==(r=null==(n=this.attachedIframes.get(e))?void 0:n.element)&&void 0!==r?r:this.iframeElementsById.get(e))&&void 0!==t?t:null}forgetIframeId(e){this.attachedIframes.delete(e),this.iframeElementsById.delete(e)}disposeLoadListeners(e){var t=this.loadListenerDisposers.get(e);t&&(t.forEach((e=>st(e))),this.loadListenerDisposers.delete(e))}removePageHideListener(e){var t=this.pageHideHandlers.get(e);t&&(t.forEach((e=>{ot(e.win,"pagehide",e.handler)})),this.pageHideHandlers.delete(e))}addLoadListener(e){this.loadListener=e}addPageHideListener(e){this.pageHideListener=e}removeLoadListener(){this.loadListener=void 0}trackIframeContent(e,t){var r=this.mirror.getId(e);return this.attachedIframes.set(r,{element:e,content:t}),r}attachIframe(e,t){var r,n=this.trackIframeContent(e,t);if(e.contentDocument){var i=this.attachedDocuments.get(e);i||this.attachedDocuments.set(e,i=new Set),i.add(e.contentDocument)}this.mutationCb({adds:[{parentId:n,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var a=e.contentWindow;if(this.recordCrossOriginIframes&&a&&!this.nestedIframeListeners.has(a)){var o=this.handleMessage.bind(this);st((()=>{a.addEventListener("message",o),this.nestedIframeListeners.set(a,o);var t=this.attachedWindows.get(e);t||this.attachedWindows.set(e,t=new Set),t.add(a)}))}st((()=>{var t=e.contentWindow;if(t){var r=this.pageHideHandlers.get(e);if(r)for(var n of r)if(n.win===t)return;var i=()=>{var t;null==(t=this.pageHideListener)||t.call(this,e),e.contentDocument&&this.mirror.removeNodeFromMap(e.contentDocument),e.contentWindow&&this.crossOriginIframeMap.delete(e.contentWindow)};t.addEventListener("pagehide",i),r||this.pageHideHandlers.set(e,r=new Set),r.add({win:t,handler:i})}})),null==(r=this.loadListener)||r.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){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var r=this.crossOriginIframeMap.get(e.source);if(r){var n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var r;switch(t.type){case s.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),this.trackIframeContent(e,t.data.node),{timestamp:t.timestamp,type:s.IncrementalSnapshot,data:{source:u.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case s.Meta:case s.Load:case s.DomContentLoaded:return!1;case s.Plugin:return t;case s.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case s.IncrementalSnapshot:switch(t.data.source){case u.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case u.Drag:case u.TouchMove:case u.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case u.ViewportResize:return!1;case u.MediaInteraction:case u.MouseInteraction:case u.Scroll:case u.CanvasMutation:case u.Input:return this.replaceIds(t.data,e,["id"]),t;case u.StyleSheetRule:case u.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case u.Font:return t;case u.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case u.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,n){for(var i of n)(Array.isArray(t[i])||"number"==typeof t[i])&&(t[i]=Array.isArray(t[i])?e.getIds(r,t[i]):e.getId(r,t[i]));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((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===f.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}removeIframeById(e){var t=this.attachedIframes.get(e),r=(null==t?void 0:t.element)||this.iframeElementsById.get(e)||this.mirror.getNode(e);if(this.iframeElementsById.delete(e),r){var n=r.contentWindow,i=this.attachedWindows.get(r);i&&(i.forEach((e=>{var t=this.nestedIframeListeners.get(e);t&&(ot(e,"message",t),this.nestedIframeListeners.delete(e)),this.crossOriginIframeMap.delete(e)})),this.attachedWindows.delete(r)),n&&this.nestedIframeListeners.has(n)&&(ot(n,"message",this.nestedIframeListeners.get(n)),this.nestedIframeListeners.delete(n)),n&&this.crossOriginIframeMap.delete(n),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var a=this.attachedDocuments.get(r);a&&(a.forEach((e=>{st((()=>this.mirror.removeNodeFromMap(e)))})),st((()=>Bt(r,a))),this.attachedDocuments.delete(r))}t&&this.attachedIframes.delete(e)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var e=[];this.attachedIframes.forEach(((t,r)=>{this.mirror.has(r)||e.push(r)})),e.forEach((e=>this.removeIframeById(e)))}}reattachIframes(){this.attachedIframes.forEach(((e,t)=>{var r=e.content;this.mirror.has(t)?this.mutationCb({adds:[{parentId:t,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(t)}))}destroy(){this.recordCrossOriginIframes&&ot(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((e,t)=>{ot(t,"message",e)})),this.nestedIframeListeners.clear();var e=new Set;this.iframeElementsById.forEach((t=>e.add(t))),this.attachedIframes.forEach((t=>e.add(t.element))),e.forEach((e=>{this.disposeLoadListeners(e),this.removePageHideListener(e)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}}class Kt{constructor(e){o(this,"shadowDoms",new WeakSet),o(this,"mutationCb"),o(this,"scrollCb"),o(this,"bypassOptions"),o(this,"mirror"),o(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){var n,i;if(ie(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var a=null!==(n=null==(i=C.host(e))?void 0:i.ownerDocument)&&void 0!==n?n:t,o=Pt(r({},this.bypassOptions,{doc:a,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),s=o.observer,u=o.buffer;this.restoreHandlers.push({doc:a,handler(){s.disconnect(),u.destroy(),u.releaseCanvasManager();var e=Dt.indexOf(u);-1!==e&&Dt.splice(e,1)}}),this.restoreHandlers.push({doc:a,handler:jt(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))}),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(C.host(e))),this.restoreHandlers.push({doc:a,handler:Zt({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){var r=this;this.restoreHandlers.push({doc:t,handler:I(e.prototype,"attachShadow",(function(e){return function(n){var i=e.call(this,n),a=C.shadowRoot(this);return a&&At(this)&&r.addShadowRoot(a,t),i}}))})}reset(){this.restoreHandlers.forEach((e=>{var t=e.handler;try{t()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(e){var t=[];for(var r of this.restoreHandlers)if(r.doc===e)try{r.handler()}catch(e){}else t.push(r);this.restoreHandlers=t}}var Qt="skip-frame";function er(e){if("object"!=typeof e||null===e)return!1;var t=e.y,r=e.width,n=e.height;return Number.isFinite(e.x)&&Number.isFinite(t)&&Number.isFinite(r)&&Number.isFinite(n)&&r>=0&&n>=0}for(var tr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",rr="undefined"==typeof Uint8Array?[]:new Uint8Array(256),nr=0;64>nr;nr++)rr[tr.charCodeAt(nr)]=nr;var ir=new Map,ar=(e,t,r)=>{if(e&&(ur(e,t)||"object"==typeof e)){var n=function(e,t){var r=ir.get(e);return r||ir.set(e,r=new Map),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),i=n.indexOf(e);return-1===i&&(i=n.length,n.push(e)),i}};function or(e,t,r,n){if(e instanceof Array)return e.map((e=>or(e,t,r,n)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){var i=e.constructor.name,a=function(e){var t,r=new Uint8Array(e),n=r.length,i="";for(t=0;n>t;t+=3)i+=tr[r[t]>>2],i+=tr[(3&r[t])<<4|r[t+1]>>4],i+=tr[(15&r[t+1])<<2|r[t+2]>>6],i+=tr[63&r[t+2]];return n%3==2?i=i.substring(0,i.length-1)+"=":n%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e);return{rr_type:i,base64:a}}return e instanceof DataView?{rr_type:e.constructor.name,args:[or(e.buffer,t,r,n),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL(n.type,n.quality)}:e instanceof ImageData?{rr_type:e.constructor.name,args:[or(e.data,t,r,n),e.width,e.height]}:ur(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:ar(e,t,r)}:e}var sr=(e,t,r,n)=>e.map((e=>or(e,t,r,n))),ur=(e,t)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))},lr=["webgl","webgl2"];function cr(e){return"nodeType"in e}function hr(e,t,n,i){var a=[];try{if(i){var o=function(e,t,n){var i=e.GPUCanvasContext;if((null==i?void 0:i.prototype)&&"function"==typeof i.prototype.configure)return I(i.prototype,"configure",(function(i){return function(a){var o=function(e){var t=e.canvas;return t&&"object"==typeof t?t:null}(this);if(!o||cr(o)&&yt(o,t,n,!0))return i.call(this,a);cr(o)&&!("__context"in o)&&(o.__context="webgpu");var s=function(e){var t=e.GPUTextureUsage;return t?t.COPY_SRC|t.RENDER_ATTACHMENT:null}(e);return i.call(this,null!==s&&a?r({},a,{usage:"number"==typeof a.usage?a.usage|s:s}):a)}}))}(e,t,n);o&&a.push(o)}var s=I(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(r){for(var a=function(e){return"experimental-webgl"===e?"webgl":e}(r),o=arguments.length,s=new Array(o>1?o-1:0),u=1;o>u;u++)s[u-1]=arguments[u];if(!yt(this,t,n,!0)&&("__context"in this||(this.__context=a),i&&lr.includes(a)))if(s[0]&&"object"==typeof s[0]){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0});return e.apply(this,[r,...s])}}));a.push(s)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{a.forEach((e=>e()))}}function dr(e,t,r,n,i,a,o){var s=[],u=Object.getOwnPropertyNames(e),l=function(u){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))return 0;try{if("function"!=typeof e[u])return 0;var l=I(e,u,(function(e){return function(){for(var s=arguments.length,l=new Array(s),c=0;s>c;c++)l[c]=arguments[c];var h=e.apply(this,l);if(ar(h,a,this),this.canvas&&"tagName"in this.canvas&&!yt(this.canvas,n,i,!0)){var d=sr(l,a,this,o);r(this.canvas,{type:t,property:u,args:d})}return h}}));s.push(l)}catch(a){var c=ht(e,u,{set(e){this.canvas&&"tagName"in this.canvas&&!yt(this.canvas,n,i,!0)&&r(this.canvas,{type:t,property:u,args:[e],setter:!0})}});s.push(c)}};for(var c of u)l(c);return s}var fr,vr,pr,mr='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentFingerprintMap = /* @__PURE__ */ new Map();\n const lastSentAtMap = /* @__PURE__ */ new Map();\n const PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n function hashPixels(data) {\n const view = new Uint32Array(\n data.buffer,\n data.byteOffset,\n data.byteLength >>> 2\n );\n let primaryHash = 2166136261;\n let secondaryHash = 2654435769;\n for (let i2 = 0; i2 < view.length; i2++) {\n primaryHash ^= view[i2];\n primaryHash = Math.imul(primaryHash, 16777619);\n secondaryHash ^= view[i2];\n secondaryHash = Math.imul(secondaryHash, 2246822507);\n }\n return `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n }\n function frameFingerprint(width, height, data) {\n return `${width}x${height}:${hashPixels(data)}`;\n }\n function transparentFingerprint(width, height) {\n const pixelCount = width * height;\n let hash = transparentFingerprintMap.get(pixelCount);\n if (hash === void 0) {\n hash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n transparentFingerprintMap.set(pixelCount, hash);\n }\n return `${width}x${height}:${hash}`;\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("resetFrameDedup" in e.data) {\n lastFingerprintMap.clear();\n return;\n }\n if ("OffscreenCanvas" in globalThis) {\n const {\n id,\n bitmap,\n width,\n height,\n displayWidth,\n displayHeight,\n dataURLOptions,\n maskRegions\n } = e.data;\n try {\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d", {\n willReadFrequently: true\n });\n }\n const ctx = reusableCtx;\n ctx.clearRect(0, 0, width, height);\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n if (maskRegions) {\n ctx.fillStyle = "black";\n for (const region of maskRegions) {\n ctx.fillRect(region.x, region.y, region.width, region.height);\n }\n }\n const fingerprint = frameFingerprint(\n width,\n height,\n ctx.getImageData(0, 0, width, height).data\n );\n const lastFingerprint = lastFingerprintMap.get(id) ?? transparentFingerprint(width, height);\n if (fingerprint === lastFingerprint) {\n const lastSentAt = lastSentAtMap.get(id);\n const keyframeDue = maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS;\n if (!keyframeDue) {\n return worker.postMessage({ id });\n }\n }\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n worker.postMessage({\n id,\n type: blob.type,\n base64: encode(arrayBuffer),\n // cpu intensive\n displayWidth,\n displayHeight\n });\n lastFingerprintMap.set(id, fingerprint);\n lastSentAtMap.set(id, Date.now());\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n',yr="undefined"!=typeof self&&self.Blob&&new Blob([mr],{type:"text/javascript;charset=utf-8"});function gr(e){var t;try{if(!(t=yr&&(self.URL||self.webkitURL).createObjectURL(yr)))throw"";var r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(mr),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class wr{constructor(e){o(this,"pendingCanvasMutations",new Map),o(this,"rafStamps",{latestId:0,invokeId:null}),o(this,"mirror"),o(this,"mutationCb"),o(this,"resetObservers"),o(this,"frozen",!1),o(this,"locked",!1),o(this,"rafIdTimestamp",null),o(this,"rafIdFlush",null),o(this,"refCount",0),o(this,"torndown",!1),o(this,"resetFrameDedup",null),o(this,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));var t=e.sampling,r=void 0===t?"all":t,n=e.win,i=e.blockClass,a=e.blockSelector,s=e.recordCanvas,u=e.dataURLOptions,l=e.resolutionScale,c=e.canvasMasking;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===r&&this.initCanvasMutationObserver(n,i,a,u),s&&"number"==typeof r&&this.initCanvasFPSObserver(r,n,i,a,{dataURLOptions:u,resolutionScale:l,canvasMasking:c})}onFullSnapshot(){var e;null==(e=this.resetFrameDedup)||e.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,r,n,i,a){var o=this;if("OffscreenCanvas"in r){var s,u="number"==typeof a.resolutionScale&&Number.isFinite(a.resolutionScale)?Math.min(1,Math.max(.1,a.resolutionScale)):1,l=hr(r,n,i,!0),c=new Map;try{s=new gr}catch(e){return}var d=!1;s.onerror=()=>{var e;d=!0,cancelAnimationFrame(f),null==(e=s.terminate)||e.call(s),this.resetFrameDedup=null},this.resetFrameDedup=()=>{s.postMessage({resetFrameDedup:!0})},s.onmessage=e=>{var t=e.data.id;if(c.set(t,!1),"base64"in e.data){var r=e.data,n=r.displayWidth,i=r.displayHeight;this.mutationCb({id:t,type:h["2D"],commands:[{property:"clearRect",args:[0,0,n,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r.base64}],type:r.type}]},0,0,n,i]}],displayWidth:n,displayHeight:i})}};var f,v=1e3/e,p=0,m=e=>{var l,h;d||(p&&v>e-p||(p=e,(l=[],h=e=>{try{e.querySelectorAll("canvas").forEach((e=>{yt(e,n,i,!0)||l.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&h(e.shadowRoot)}))}catch(e){}},h(r.document),l).forEach(function(){var e=t((function*(e){var t,r,n=o.mirror.getId(e);if(!c.get(n)&&0!==e.width&&0!==e.height){c.set(n,!0);try{if(["webgl","webgl2"].includes(e.__context)){var i=e.getContext(e.__context);if(null==(t=null==i?void 0:i.isContextLost)?void 0:t.call(i))return void c.set(n,!1);!1===(null==(r=null==i?void 0:i.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var l=e.clientWidth||e.width,h=e.clientHeight||e.height,d=Math.max(1,Math.round(l*u)),f=Math.max(1,Math.round(h*u)),v=function(e,t,r,n,i,a){if(e&&"function"==typeof e.regionsFn){var o;try{o=e.regionsFn(t)}catch(e){return Qt}if(void 0!==o){if(!Array.isArray(o)||!o.every(er))return Qt;var s=r/i,u=n/a;return o.filter((e=>e.width>0&&e.height>0)).map((e=>{var t=Math.floor(e.x*s),r=Math.floor(e.y*u);return{x:t,y:r,width:Math.ceil((e.x+e.width)*s)-t,height:Math.ceil((e.y+e.height)*u)-r}}))}}}(a.canvasMasking,e,d,f,l,h);if(v===Qt)return void c.set(n,!1);var p=yield createImageBitmap(e,1>u?{resizeWidth:d,resizeHeight:f,resizeQuality:"medium"}:{resizeWidth:d,resizeHeight:f});s.postMessage({id:n,bitmap:p,width:d,height:f,displayWidth:l,displayHeight:h,dataURLOptions:a.dataURLOptions,maskRegions:v},[p])}catch(e){c.set(n,!1)}}}));return function(t){return e.apply(this,arguments)}}())),f=requestAnimationFrame(m))};f=requestAnimationFrame(m),this.resetObservers=()=>{var e;l(),cancelAnimationFrame(f),null==(e=s.terminate)||e.call(s),this.resetFrameDedup=null}}}initCanvasMutationObserver(e,t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=hr(e,t,r,!1),a=function(e,t,r,n,i){var a=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return 1;var s=I(t.CanvasRenderingContext2D.prototype,o,(function(a){return function(){for(var s=arguments.length,u=new Array(s),l=0;s>l;l++)u[l]=arguments[l];return yt(this.canvas,r,n,!0)||setTimeout((()=>{var r=sr(u,t,this,i);e(this.canvas,{type:h["2D"],property:o,args:r})}),0),a.apply(this,u)}}));a.push(s)}catch(i){var u=ht(t.CanvasRenderingContext2D.prototype,o,{set(t){yt(this.canvas,r,n,!0)||e(this.canvas,{type:h["2D"],property:o,args:[t],setter:!0})}});a.push(u)}};for(var u of o)s(u);return()=>{a.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,n),o=function(e,t,r,n,i){var a=[];return void 0!==t.WebGLRenderingContext&&a.push(...dr(t.WebGLRenderingContext.prototype,h.WebGL,e,r,n,t,i)),void 0!==t.WebGL2RenderingContext&&a.push(...dr(t.WebGL2RenderingContext.prototype,h.WebGL2,e,r,n,t,i)),()=>{a.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,n);this.resetObservers=()=>{i(),a(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,this.rafIdTimestamp=requestAnimationFrame(e)};this.rafIdTimestamp=requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var n=r.map((e=>function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,i)));this.mutationCb({id:t,type:r[0].type,commands:n}),this.pendingCanvasMutations.delete(e)}}}}class br{constructor(e){var t;o(this,"trackedLinkElements",new WeakSet),o(this,"pendingDeferredSheets",new Set),o(this,"mutationCb"),o(this,"adoptedStyleSheetCb"),o(this,"maskAllElementAttributes"),o(this,"maskAttributeFn"),o(this,"styleMirror",new It),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(t=e.maskAllElementAttributes)&&void 0!==t&&t,this.maskAttributeFn=e.maskAttributeFn}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}beginDeferredLinkInlining(e,t){if(-1===t||!e.isConnected)return null;var r=null,n=null;try{(n=e.sheet)&&(r=pe(n))}catch(e){}if(!r||!n)return ee(),null;var i=r,a=!1,o={sheet:n,invalidate(){a=!0}};this.pendingDeferredSheets.add(o);var s=!1;return{advance:r=>{if(s)return!0;var u,l,c=x(),h=F(),d=!0;try{if(a)return s=!0,ee(),!0;if(!i.advance(r))return d=!1,!1;s=!0;var f=i.text();if(!e.isConnected)return!0;var v=null;try{v=e.sheet}catch(e){}return v!==n?(ee(),!0):f?(this.emitCssTextMutation(e,t,f),!0):(ee(),!0)}finally{d&&this.pendingDeferredSheets.delete(o),E(u=x()-c,null!=(l=h)?l:R)||(U.totalMs+=u,u>U.slowestSliceMs&&(U.slowestSliceMs=u))}},remainingRules:()=>i.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(o)}}}onCssomSheetMutation(e){if(e&&0!==this.pendingDeferredSheets.size)for(var t of this.pendingDeferredSheets)t.sheet===e&&(this.pendingDeferredSheets.delete(t),t.invalidate())}inlineDeferredLinkElement(e,t){var r;null==(r=this.beginDeferredLinkInlining(e,t))||r.advance(1/0)}emitCssTextMutation(e,t,r){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t,attributes:{_cssText:be({element:e,name:"_cssText",value:r,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){var r=this;if(0!==e.length){var n={id:t,styleIds:[]},i=[],a=function(e){var t;if(r.styleMirror.has(e))t=r.styleMirror.getId(e);else{var a=r.styleMirror.add(e);t=a;var o=x();try{Y((()=>{try{var t=e.rules||e.cssRules;t&&X(t)}catch(e){}i.push({styleId:a,rules:Array.from(e.rules||CSSRule,((t,r)=>({rule:le(t,e.href),index:r})))})}))}finally{K(x()-o)}}n.styleIds.push(t)};for(var o of e)a(o);i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),Xe.forEach((e=>e.abort())),Xe.clear()}trackStylesheetInLinkElement(e){}}class kr{constructor(){o(this,"nodeMap",new WeakMap),o(this,"active",!1)}inOtherBuffer(e,t){var r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==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(){}}var Sr=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Mr=document.createElement("iframe");document.body.appendChild(Mr),Array.from=(null==(n=Mr.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Mr)}}catch(e){console.debug("Unable to override Array.from",e)}var Ir=new me,Cr=new Set([u.Mutation,u.MediaInteraction,u.StyleSheetRule,u.CanvasMutation,u.Font,u.Log,u.StyleDeclaration,u.AdoptedStyleSheet]);function Ar(e){var t=window;if("function"==typeof t.requestIdleCallback){var r=t.requestIdleCallback(e,{timeout:2e3});return{cancel(){var e;return null==(e=t.cancelIdleCallback)?void 0:e.call(t,r)}}}var n=setTimeout(e,250);return{cancel:()=>clearTimeout(n)}}function xr(e){var t;void 0===e&&(e={});var n=e,i=n.emit,a=n.checkoutEveryNms,o=n.checkoutEveryNth,l=n.blockClass,c=void 0===l?"rr-block":l,h=n.blockSelector,d=void 0===h?null:h,f=n.ignoreClass,v=void 0===f?"rr-ignore":f,p=n.ignoreSelector,m=void 0===p?null:p,y=n.maskTextClass,g=void 0===y?"rr-mask":y,w=n.maskTextSelector,b=void 0===w?null:w,k=n.inlineStylesheet,S=void 0===k||k,M=n.inlineStylesheetBudgetRules,I=n.maskAllInputs,A=n.maskInputOptions,x=n.slimDOMOptions,R=n.maskInputFn,T=n.maskTextFn,F=n.maskAllElementAttributes,E=void 0!==F&&F,L=n.maskAttributeFn,N=n.hooks,_=n.packFn,D=n.sampling,W=void 0===D?{}:D,P=n.dataURLOptions,B=void 0===P?{}:P,H=n.canvasResolutionScale,q=n.canvasMasking,U=n.mousemoveWait,z=n.recordDOM,V=void 0===z||z,J=n.recordCanvas,X=void 0!==J&&J,Y=n.recordCrossOriginIframes,K=void 0!==Y&&Y,Q=n.recordAfter,ee=void 0===Q?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":Q,re=n.userTriggeredOnInput,ne=void 0!==re&&re,ie=n.collectFonts,ae=void 0!==ie&&ie,oe=n.inlineImages,se=void 0!==oe&&oe,ue=n.plugins,le=n.keepIframeSrcFn,ce=void 0===le?()=>!1:le,he=n.ignoreCSSAttributes,de=void 0===he?new Set([]):he,fe=n.attributeFilter;Tt=n.errorHandler;var ve=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},B),pe=!K||window.parent===window,ye=!1;if(!pe)try{window.parent.document&&(ye=!1)}catch(e){ye=!0}if(pe&&!i)throw new Error("emit function is required");if(!pe&&!ye)return()=>{};void 0!==U&&void 0===W.mousemove&&(W.mousemove=U),Ir.reset();var ge,we=!0===I?{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}:void 0!==A?A:{password:!0},be=nt(void 0!==x&&x);!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=[].forEach)}();var ke,Se,Me=0,Ie=new Map,Ce=e=>{for(var t of ue||[])t.eventProcessor&&(e=t.eventProcessor(e));return _&&!ye&&(e=_(e)),e};fr=(e,t)=>{var r,n=e;if(n.timestamp=dt(),!(null==(r=Dt[0])?void 0:r.isFrozen())||n.type===s.FullSnapshot||n.type===s.IncrementalSnapshot&&Cr.has(n.data.source)||Dt.forEach((e=>e.unfreeze())),pe)null==i||i(Ce(n),t);else if(ye){var l={type:"rrweb",event:Ce(n),origin:window.location.origin,isCheckout:t};window.parent.postMessage(l,"*")}if(n.type===s.FullSnapshot)ge=n,Me=0;else if(n.type===s.IncrementalSnapshot){if(n.data.source===u.Mutation&&n.data.isAttachIframe)return;Me++,(o&&Me>=o||a&&n.timestamp-ge.timestamp>a)&&vr(!0)}};var Ae=e=>{if(e.removes&&e.removes.length>0){var t=e.adds.length>0?new Set(e.adds.map((e=>e.node.id))):null,n=new Set;if(e.adds.length>0)for(var i of e.adds){var a=Ir.getNode(i.node.id);a&&"IFRAME"===a.nodeName&&n.add(a)}e.removes.forEach((e=>{var r=e.id;if(!t||!t.has(r)){var i=Oe.getIframeElementById(r);i&&n.has(i)?Oe.forgetIframeId(r):(null==ke||ke(r),Oe.removeIframeById(r))}})),null==Se||Se(),Oe.cleanupDetachedIframes()}fr({type:s.IncrementalSnapshot,data:r({source:u.Mutation},e)})},xe=e=>fr({type:s.IncrementalSnapshot,data:r({source:u.Scroll},e)}),Re=e=>fr({type:s.IncrementalSnapshot,data:r({source:u.CanvasMutation},e)}),Te=new br({mutationCb:Ae,adoptedStyleSheetCb:e=>fr({type:s.IncrementalSnapshot,data:r({source:u.AdoptedStyleSheet},e)}),maskAllElementAttributes:E,maskAttributeFn:L}),Oe=new Yt({mirror:Ir,mutationCb:Ae,stylesheetManager:Te,recordCrossOriginIframes:K,wrappedEmit:fr});for(var Fe of ue||[])Fe.getMirror&&Fe.getMirror({nodeMirror:Ir,crossOriginIframeMirror:Oe.crossOriginIframeMirror,crossOriginIframeStyleMirror:Oe.crossOriginIframeStyleMirror});var Ee=new kr,Le=null==q?void 0:q.configured;pr=new wr({recordCanvas:X,mutationCb:Re,win:window,blockClass:c,blockSelector:d,mirror:Ir,sampling:W.canvas,dataURLOptions:ve,resolutionScale:H,canvasMasking:q});var Ne=new Kt({mutationCb:Ae,scrollCb:xe,bypassOptions:{blockClass:c,blockSelector:d,maskTextClass:g,maskTextSelector:b,inlineStylesheet:S,maskInputOptions:we,dataURLOptions:ve,maskTextFn:T,maskInputFn:R,maskAllElementAttributes:E,maskAttributeFn:L,recordCanvas:X,canvasMaskingConfigured:Le,inlineImages:se,sampling:W,slimDOMOptions:be,iframeManager:Oe,stylesheetManager:Te,canvasManager:pr,keepIframeSrcFn:ce,processedNodeManager:Ee,attributeFilter:fe},mirror:Ir});vr=function(e){if(void 0===e&&(e=!1),V){G(M);try{fr({type:s.Meta,data:{href:window.location.href,width:pt(),height:vt()}},e),null==t||t.cancel(),t=void 0,Te.reset(),Ne.init(),Dt.forEach((e=>e.lock()));var r,n=null;try{n=function(e,t){var r=t||{},n=r.mirror,i=void 0===n?new me:n,a=r.blockClass,o=void 0===a?"rr-block":a,s=r.blockSelector,u=void 0===s?null:s,l=r.maskTextClass,c=void 0===l?"rr-mask":l,h=r.maskTextSelector,d=void 0===h?null:h,f=r.inlineStylesheet,v=void 0===f||f,p=r.inlineImages,m=void 0!==p&&p,y=r.recordCanvas,g=void 0!==y&&y,w=r.canvasMaskingConfigured,b=r.maskAllInputs,k=void 0!==b&&b,S=r.maskTextFn,M=r.maskInputFn,I=r.maskAllElementAttributes,C=void 0!==I&&I,A=r.maskAttributeFn,x=r.slimDOM,R=r.dataURLOptions,T=r.preserveWhiteSpace,O=r.onSerialize,F=r.onIframeLoad,E=r.iframeLoadTimeout,L=r.onIframeListenerRegistered,N=r.onStylesheetLoad,_=r.stylesheetLoadTimeout,D=r.keepIframeSrcFn,W=void 0===D?()=>!1:D,P=r.maxDepth,j=r.inlineStylesheetBudgetRules,B=!0===k?{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}:!1===k?{password:!0}:k,H=nt(void 0!==x&&x);G(j);try{return rt(e,{doc:e,mirror:i,blockClass:o,blockSelector:u,maskTextClass:c,maskTextSelector:d,skipChild:!1,inlineStylesheet:v,maskInputOptions:B,maskTextFn:S,maskInputFn:M,maskAllElementAttributes:C,maskAttributeFn:A,slimDOMOptions:H,dataURLOptions:R,inlineImages:m,recordCanvas:g,canvasMaskingConfigured:w,preserveWhiteSpace:T,onSerialize:O,onIframeLoad:F,iframeLoadTimeout:E,onIframeListenerRegistered:L,onStylesheetLoad:N,stylesheetLoadTimeout:_,keepIframeSrcFn:W,newlyAddedElement:!1,maxDepth:P})}finally{Z()}}(document,{mirror:Ir,blockClass:c,blockSelector:d,maskTextClass:g,maskTextSelector:b,inlineStylesheet:S,maskAllInputs:we,inlineStylesheetBudgetRules:M,maskTextFn:T,maskInputFn:R,maskAllElementAttributes:E,maskAttributeFn:L,slimDOM:be,dataURLOptions:ve,recordCanvas:X,canvasMaskingConfigured:Le,inlineImages:se,onSerialize(e){kt(e,Ir)&&Oe.addIframe(e),St(e,Ir)&&Te.trackLinkElement(e),Mt(e)&&Ne.addShadowRoot(C.shadowRoot(e),document)},onIframeLoad(e,t){Oe.attachIframe(e,t),Ne.observeAttachShadow(e)},onIframeListenerRegistered(e,t){Oe.registerLoadListenerDisposer(e,t)},onStylesheetLoad(e,t){Te.attachLinkElement(e,t)},keepIframeSrcFn:ce})}finally{a=j,j=[],r=a}if(!n)return console.warn("Failed to snapshot the document");if(fr({type:s.FullSnapshot,data:{node:n,initialOffset:ft(window)}},e),Dt.forEach((e=>e.unlock())),pr.onFullSnapshot(),r.length){var i=function(e,t,r){var n=!1,i=null,a=0,o=null,s=()=>null!==o||e.length>a,u=()=>{var r=e[a];e[a]=null,a+=1,r&&st((()=>{o=t.beginDeferredLinkInlining(r,Ir.getId(r))}))},l=()=>{if(o){var e=o,t=!0;st((()=>{t=e.advance(200)})),t&&(o=null)}},c=e=>{if(i=null,!n){var t=0;do{try{o||u(),l()}catch(e){null==o||o.discard(),o=null,te(1)}t+=1}while(!n&&s()&&(e?!e.didTimeout&&e.timeRemaining()>5:10>t));n||(s()?i=Ar(c):r())}};return i=Ar(c),{cancel(){n=!0,null==o||o.discard(),o=null,null==i||i.cancel(),i=null},flush(){if(!n){n=!0,null==i||i.cancel(),i=null;for(var t=0,c=0;s()&&50>t;){o||u();var h=o;if(h)if(Math.floor(h.remainingRules()/200)+1>50-t)h.discard(),o=null,c+=1;else{try{l()}catch(e){null==o||o.discard(),o=null,c+=1}t+=1}}if(s()||c>0){for(var d=c+(null!==o?1:0),f=a;e.length>f;f++)null!==e[f]&&(d+=1);te(d),null==o||o.discard(),o=null}r()}}}}(r,Te,(()=>{t===i&&(t=void 0)}));t=i}K&&Oe.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Te.adoptStyleSheets(document.adoptedStyleSheets,Ir.getId(document))}finally{Z()}var a}};try{var _e=[];for(var De of(_e.push(at("pagehide",(()=>{try{null==t||t.flush()}catch(e){}t=void 0}),window)),["visibilitychange","freeze","resume"]))_e.push(at(De,O,document));ke=e=>{var t=Ie.get(e);t&&(t.forEach((e=>{st(e);var t=_e.indexOf(e);-1!==t&&_e.splice(t,1)})),Ie.delete(e))},Se=()=>{for(var e of Ie){var t=e[0],r=Ir.getNode(t);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==ke||ke(t)}catch(e){null==ke||ke(t)}else null==ke||ke(t)}};var We=e=>{var t;return _t(Vt)({mutationCb:Ae,mousemoveCb:(e,t)=>fr({type:s.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>fr({type:s.IncrementalSnapshot,data:r({source:u.MouseInteraction},e)}),scrollCb:xe,viewportResizeCb:e=>fr({type:s.IncrementalSnapshot,data:r({source:u.ViewportResize},e)}),inputCb:e=>fr({type:s.IncrementalSnapshot,data:r({source:u.Input},e)}),mediaInteractionCb:e=>fr({type:s.IncrementalSnapshot,data:r({source:u.MediaInteraction},e)}),styleSheetRuleCb:e=>fr({type:s.IncrementalSnapshot,data:r({source:u.StyleSheetRule},e)}),styleDeclarationCb:e=>fr({type:s.IncrementalSnapshot,data:r({source:u.StyleDeclaration},e)}),canvasMutationCb:Re,fontCb:e=>fr({type:s.IncrementalSnapshot,data:r({source:u.Font},e)}),selectionCb(e){fr({type:s.IncrementalSnapshot,data:r({source:u.Selection},e)})},customElementCb(e){fr({type:s.IncrementalSnapshot,data:r({source:u.CustomElement},e)})},blockClass:c,ignoreClass:v,ignoreSelector:m,maskTextClass:g,maskTextSelector:b,maskInputOptions:we,inlineStylesheet:S,sampling:W,recordDOM:V,recordCanvas:X,canvasMaskingConfigured:Le,inlineImages:se,userTriggeredOnInput:ne,collectFonts:ae,doc:e,maskInputFn:R,maskTextFn:T,maskAllElementAttributes:E,maskAttributeFn:L,keepIframeSrcFn:ce,blockSelector:d,slimDOMOptions:be,dataURLOptions:ve,mirror:Ir,iframeManager:Oe,stylesheetManager:Te,shadowDomManager:Ne,processedNodeManager:Ee,canvasManager:pr,ignoreCSSAttributes:de,attributeFilter:fe,plugins:(null==(t=null==ue?void 0:ue.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>fr({type:s.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},N)};Oe.addLoadListener((e=>{try{var t=Ir.getId(e),r=We(e.contentDocument);if("function"==typeof r&&(_e.push(r),-1!==t)){var n=Ie.get(t);n||Ie.set(t,n=new Set),n.add(r)}}catch(e){console.warn(e)}})),Oe.addPageHideListener((e=>{var t=Ir.getId(e);null==ke||ke(t),Bt(e)}));var Pe=-1,je=e=>fr({type:s.Custom,data:{tag:"rrweb/fullscreen",payload:e}}),Be=()=>{var e,t,r,n,i=document,a=null!==(e=null!==(t=null!==(r=null!==(n=i.fullscreenElement)&&void 0!==n?n:i.webkitFullscreenElement)&&void 0!==r?r:i.mozFullScreenElement)&&void 0!==t?t:i.msFullscreenElement)&&void 0!==e?e:null,o=a?Ir.getId(a):-1;o!==Pe&&(-1!==Pe&&je({id:Pe,enter:!1}),Pe=o,-1!==o&&je({id:o,enter:!0}))},He=()=>{vr();var e=We(document);"function"==typeof e&&_e.push(e),_e.push(at("fullscreenchange",Be)),_e.push(at("webkitfullscreenchange",Be)),_e.push(at("mozfullscreenchange",Be)),_e.push(at("MSFullscreenChange",Be)),Sr=!0};return["interactive","complete"].includes(document.readyState)?He():(_e.push(at("DOMContentLoaded",(()=>{fr({type:s.DomContentLoaded,data:{}}),"DOMContentLoaded"===ee&&He()}))),_e.push(at("load",(()=>{fr({type:s.Load,data:{}}),"load"===ee&&He()}),window))),()=>{try{null==t||t.flush()}catch(e){}t=void 0,_e.forEach((e=>st(e))),Ee.destroy(),Oe.removeLoadListener(),Oe.destroy(),Ie.clear(),Ne.reset(),Ir.reset(),Sr=!1,Tt=void 0}}catch(e){console.warn(e)}}xr.addCustomEvent=(e,t)=>{if(!Sr)throw new Error("please add custom event after start recording");fr({type:s.Custom,data:{tag:e,payload:t}})},xr.freezePage=()=>{Dt.forEach((e=>e.freeze()))},xr.takeFullSnapshot=e=>{if(!Sr)throw new Error("please take full snapshot after start recording");vr(e)},xr.mirror=Ir;var Rr=Object.defineProperty,Tr=(e,t,r)=>((e,t,r)=>t in e?Rr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class Or{constructor(e){Tr(this,"fileName"),Tr(this,"functionName"),Tr(this,"lineNumber"),Tr(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}}var Fr=/(^|@)\S+:\d+/,Er=/^\s*at .*(\S+:\d+|\(native\))/m,Lr=/^(eval@)?(\[native code])?$/,Nr={parse(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Er)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):[]:[]},extractLocation(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE(e){return e.stack.split("\n").filter((function(e){return!!e.match(Er)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),n=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),i=this.extractLocation(r?r[1]:n.pop()),a=n.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Or({functionName:a,fileName:o,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari(e){return e.stack.split("\n").filter((function(e){return!e.match(Lr)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Or({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(e.replace(t,""));return new Or({functionName:n,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)},parseOpera(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[],i=2,a=r.length;a>i;i+=2){var o=t.exec(r[i]);o&&n.push(new Or({fileName:o[2],lineNumber:parseFloat(o[1])}))}return n},parseOpera10(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[],i=0,a=r.length;a>i;i+=2){var o=t.exec(r[i]);o&&n.push(new Or({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return n},parseOpera11(e){return e.stack.split("\n").filter((function(e){return!!e.match(Fr)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Or({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function _r(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var n=e.parentElement,i=[];if(n.children&&n.children.length>0)for(var a=0;n.children.length>a;a++){var o=n.children[a];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&i.push(o)}i.length>1&&(r+=":eq("+i.indexOf(e)+")"),t=r+(t?">"+t:""),e=n}return t}function Dr(e){return Array.isArray(e)}function Wr(e){return"object"==typeof e&&null!==e&&!Dr(e)}function Pr(e,t){if(0===t)return!0;var r=Object.keys(e);for(var n of r)if(Wr(e[n])&&Pr(e[n],t-1))return!0;return!1}function jr(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var n=[],i=[];return JSON.stringify(e,(function(e,t){if(n.length>0){var a=n.indexOf(this);~a?n.splice(a+1):n.push(this),~a?i.splice(a,1/0,e):i.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(t)).join(".")+"]")}else n.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(Wr(o=t)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||Wr(o)&&Pr(o,r.depthOfLimit))return function(e){var t=e.toString();return r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.stringLengthLimit)+"..."),t}(t);var o;if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var s={};for(var u in t){var l=t[u];s[u]=Dr(l)?_r(l.length?l[0]:null):l}return s}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Br={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Hr(e,t,r){var n,i=r?Object.assign({},Br,r):Br,a=i.logger;if(!a)return()=>{};n="string"==typeof a?t[a]:a;var o=0,s=!1,u=[];if(i.level.includes("error")){var l=t=>{var r=t.message,n=Nr.parse(t.error).map((e=>e.toString())),a=[jr(r,i.stringifyOptions)];e({level:"error",trace:n,payload:a})};t.addEventListener("error",l),u.push((()=>{t.removeEventListener("error",l)}));var c=t=>{var r,n;t.reason instanceof Error?n=[jr("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,i.stringifyOptions)]:(r=new Error,n=[jr("Uncaught (in promise)",i.stringifyOptions),jr(t.reason,i.stringifyOptions)]);var a=Nr.parse(r).map((e=>e.toString()));e({level:"error",trace:a,payload:n})};t.addEventListener("unhandledrejection",c),u.push((()=>{t.removeEventListener("unhandledrejection",c)}))}for(var h of i.level)u.push(d(n,h));return()=>{u.forEach((e=>e()))};function d(t,r){var n=this;return t[r]?function(t,a,u){try{if(!(a in t))return()=>{};var l=t[a],c={next:l},h=(t=>function(){for(var a=arguments.length,u=new Array(a),l=0;a>l;l++)u[l]=arguments[l];if(t.apply(n,u),!("assert"===r&&u[0]||s)){s=!0;try{var c=Nr.parse(new Error).map((e=>e.toString())).splice(1),h=("assert"===r?u.slice(1):u).map((e=>jr(e,i.stringifyOptions)));o++,i.lengthThreshold>o?e({level:r,trace:c,payload:h}):o===i.lengthThreshold&&e({level:"warn",trace:[],payload:[jr("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...u)}finally{s=!1}}})((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return c.next.apply(this,t)}));return"function"==typeof h&&(h.prototype=h.prototype||{},Object.defineProperties(h,{__rrweb_original__:{enumerable:!1,value:l},__rrweb_layer__:{enumerable:!1,value:c}})),t[a]=h,()=>{if(t[a]!==h)for(var e=e=>{var t;return"function"==typeof e?null!==(t=e.__rrweb_layer__)&&void 0!==t?t:e.__posthog_layer__:void 0},r=t[a],n=e(r);n;){if(n.next===h)return void(n.next=c.next);n=e(r=n.next)}else t[a]=c.next}}catch(e){return()=>{}}}(t,r):()=>{}}}var qr=e=>({name:"rrweb/console@1",observer:Hr,options:e}),Ur=Object.prototype,zr=Ur.hasOwnProperty,Gr=Ur.toString,Zr=Array.isArray||function(e){return"[object Array]"===Gr.call(e)},Vr=e=>"function"==typeof e,$r=e=>e===Object(e)&&!Zr(e),Jr=e=>void 0===e,Xr=e=>"[object String]"==Gr.call(e),Yr=e=>null===e,Kr=e=>Jr(e)||Yr(e),Qr=e=>"[object Boolean]"===Gr.call(e),en=e=>e instanceof FormData,tn="u">typeof window?window:void 0,rn="u">typeof globalThis?globalThis:tn;null!=rn&&rn.XMLHttpRequest&&new rn.XMLHttpRequest;var nn=e=>"u">typeof Document&&e instanceof Document,an=function(e,t){var r=(void 0===t?{}:t).debugEnabled,n={q(t){if(tn&&(tn.POSTHOG_DEBUG||r)&&!Jr(tn.console)&&tn.console){for(var n=("__rrweb_original__"in tn.console[t]?tn.console[t].__rrweb_original__:tn.console[t]),i=arguments.length,a=new Array(i>1?i-1:0),o=1;i>o;o++)a[o-1]=arguments[o];n(e,...a)}},debug(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.q("debug",...t)},info(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.q("log",...t)},warn(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.q("warn",...t)},error(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.q("error",...t)},critical(){for(var t=arguments.length,r=new Array(t),n=0;t>n;n++)r[n]=arguments[n];console.error(e,...r)},uninitializedWarning(e){n.error("You must initialize PostHog before calling "+e)},createLogger:(t,r)=>an(e+" "+t,r)};return n},on=an("[PostHog.js]").createLogger,sn=function(e,t){var r,n;void 0===t&&(t="&");var i=[];return function(e,t){if(!Kr(e))if(Zr(e))e.forEach(t);else if(en(e))e.forEach(((e,r)=>t(e,r)));else for(var r in e)zr.call(e,r)&&t(e[r],r)}(e,(function(e,t){Jr(e)||Jr(t)||"undefined"===t||(r=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(t),i[i.length]=n+"="+r)})),i.join(t)},un=()=>{},ln=e=>{var t;if(Vr(e))return null!==(t=e.__posthog_layer__)&&void 0!==t?t:e.__rrweb_layer__};function cn(e,t,r){try{if(!(t in e))return un;var n={next:e[t]},i=r((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return n.next.apply(this,t)}));return Vr(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:n}})),e[t]=i,()=>{if(e[t]!==i)for(var r=e[t],a=ln(r);a;){if(a.next===i)return void(a.next=n.next);a=ln(r=a.next)}else e[t]=n.next}}catch(e){return un}}function hn(e,t){var r,n=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),i={hostname:n,isHostDenied:!1};if(null==(r=t.payloadHostDenyList)||!r.length||null==n||!n.trim().length)return i;for(var a of t.payloadHostDenyList)if(n.endsWith(a))return{hostname:n,isHostDenied:!0};return i}var dn=1e6,fn={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:dn,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},vn=new WeakSet,pn=on("[Recorder]"),mn=e=>"navigation"===e.entryType,yn=e=>"resource"===e.entryType;function gn(e,t){return!!t&&(Qr(t)||t[e])}function wn(e){if("undefined"==typeof Request)return!1;if(e instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(e)}catch(e){return!1}}var bn=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function kn(e){var t=e.type,r=e.recordBody,n=e.headers;function i(e){var t=Object.keys(n).find((e=>"content-type"===e.toLowerCase())),r=t&&n[t];return e.some((e=>null==r?void 0:r.toLowerCase().includes(e)))}if(!r)return!1;if(function e(t){try{return"string"==typeof t?t.startsWith("blob:"):t instanceof URL?"blob:"===t.protocol:!!wn(t)&&e(t.url)}catch(e){return!1}}(e.url))return!1;if(i(bn))return!1;if(Qr(r))return!0;if(Zr(r))return i(r);var a=r[t];return Qr(a)?a:i(a)}function Sn(e,t,r,n,i,a){return Mn.apply(this,arguments)}function Mn(){return Mn=t((function*(e,t,r,n,i,a){if(void 0===a&&(a=0),a>10)return pn.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var o=function(e,r){for(var a=e.length-1;a>=0;a-=1)if(yn(o=e[a])&&o.initiatorType===t&&(Jr(n)||o.startTime>=n)&&(Jr(i)||i>=o.startTime))return e[a];var o}(e.performance.getEntriesByName(r));return o||(yield new Promise((e=>setTimeout(e,50*a))),Sn(e,t,r,n,i,a+1))})),Mn.apply(this,arguments)}function In(e){var t=e.body,r=e.options,n=e.url;if(Kr(t))return null;var i=hn(n,r);if(i.isHostDenied)return i.hostname+" is in deny list";if(Xr(t))return t;if(nn(t))return t.textContent;if(en(t))return sn(t);if($r(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}var Cn=e=>!Yr(e)&&("navigation"===e.entryType||"resource"===e.entryType);function An(e){var t=e.entry,n=e.method,i=e.status,a=e.networkRequest,o=e.isInitial,s=e.start,u=e.end,l=e.url,c=e.initiatorType;s=t?t.startTime:s,u=t?t.responseEnd:u;var h=Math.floor(Date.now()-performance.now()),d=Math.floor(h+(s||0)),f=[r({},t?t.toJSON():{name:l},{startTime:Jr(s)?void 0:Math.round(s),endTime:Jr(u)?void 0:Math.round(u),timeOrigin:h,timestamp:d,method:n,initiatorType:c||(t?t.initiatorType:void 0),status:i,requestHeaders:a.requestHeaders,requestBody:a.requestBody,responseHeaders:a.responseHeaders,responseBody:a.responseBody,isInitial:o})];if(Cn(t))for(var v of t.serverTiming||[])f.push({timeOrigin:h,timestamp:d,startTime:Math.round(t.startTime),name:v.name,duration:v.duration,entryType:"serverTiming"});return f}var xn=["video/","audio/"];function Rn(e){return $r(e)&&Vr(e.getReader)&&Vr(e.tee)}var Tn=500,On="[SessionReplay] Timeout while trying to read body",Fn="[SessionReplay] Failed to read body";function En(e){return Fn+": "+e}function Ln(e){return"[SessionReplay] Body too large to record (> "+e+" bytes)"}function Nn(e,t){if(!t.streamNetworkBody)return function(e){return new Promise((t=>{var r=setTimeout((()=>t(On)),Tn);try{e.clone().text().then((e=>t(e)),(e=>t(En(e)))).finally((()=>clearTimeout(r)))}catch(e){clearTimeout(r),t(Fn)}}))}(e);var r=function(e){var t;return Math.min(dn,null!==(t=e.payloadSizeLimitBytes)&&void 0!==t?t:dn)}(t);return function(e,t){try{var r,n=null==(r=e.headers)||null==r.get?void 0:r.get("content-length");if(!n)return!1;var i=parseInt(n,10);return Number.isFinite(i)&&i>t}catch(e){return!1}}(e,r)?Promise.resolve(Ln(r)):function(e,t){return new Promise((r=>{var n,i=!1;function a(){try{var e;null==(e=n)||e.cancel().catch((()=>{}))}catch(e){}}function o(e){i||(i=!0,clearTimeout(u),a(),r(e))}var s,u=setTimeout((()=>o(On)),Tn);try{s=e.clone()}catch(e){return void o(Fn)}var l=s.body;if(Rn(l)&&"undefined"!=typeof TextDecoder){try{n=l.getReader()}catch(e){return void o(Fn)}var c=[],h=0;!function e(){n.read().then((r=>{var n=r.done,s=r.value;if(i)a();else if(n)o((new TextDecoder).decode(function(e,t){var r=new Uint8Array(t),n=0;for(var i of e)r.set(i,n),n+=i.byteLength;return r}(c,h)));else{if(s){if(h+s.byteLength>t)return void o(Ln(t));h+=s.byteLength,c.push(s)}e()}}),(e=>o(En(e))))}()}else try{s.text().then((e=>o(e)),(e=>o(En(e))))}catch(e){o(Fn)}}))}(e,r)}function _n(){return(_n=t((function*(e){var t=e.r,r=e.options,n=hn(e.url,r);return n.isHostDenied?Promise.resolve(n.hostname+" is in deny list"):Nn(t,r)}))).apply(this,arguments)}function Dn(){return(Dn=t((function*(e){var t=e.r,r=e.options,n=function(e){var t,r=e.r,n=e.options,i=e.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var a=null==(t=r.headers.get("Content-Type"))?void 0:t.toLowerCase(),o=xn.some((e=>null==a?void 0:a.startsWith(e)));if(a&&o)return"Content-Type "+a+" is not supported";var s=hn(i,n);return s.isHostDenied?s.hostname+" is in deny list":null}({r:t,options:r,url:e.url});return Yr(n)?Nn(t,r):Promise.resolve(n)}))).apply(this,arguments)}var Wn=null;function Pn(e,n,i){if(!("performance"in n))return()=>{};if(Wn)return pn.warn("Network observer already initialised, doing nothing"),()=>{};var a=i?Object.assign({},fn,i):fn,o=t=>{var n=[],i=!1;t.requests.forEach((e=>{var t="serverTiming"===e.entryType;if(!t||!i){var r=a.maskRequestFn(e);t||(i=!r||(e=>!!e&&vn.has(e))(r)),r&&n.push(r)}})),n.length>0&&e(r({},t,{requests:n}))},s=function(e,t,r){if(r.recordInitialRequests){var n=t.performance.getEntries().filter((e=>mn(e)||yn(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:n.flatMap((e=>An({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var i=new t.PerformanceObserver((t=>{var n=t.getEntries().filter((e=>mn(e)||yn(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:n.flatMap((e=>An({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),a=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return i.observe({entryTypes:a}),()=>{i.disconnect()}}(o,n,a),u=()=>{},l=()=>{};return(a.recordHeaders||a.recordBody)&&(u=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var n=gn("request",r.recordHeaders),i=gn("response",r.recordHeaders),a=cn(t.XMLHttpRequest.prototype,"open",(a=>function(o,s,u,l,c){void 0===u&&(u=!0);var h=this;try{var d,f,v=new Request(s),p={},m={},y=h.setRequestHeader.bind(h);h.setRequestHeader=(e,t)=>(m[e]=t,y(e,t)),n&&(p.requestHeaders=m);var g=h.send.bind(h);h.send=e=>(kn({type:"request",headers:m,url:s,recordBody:r.recordBody})&&(p.requestBody=In({body:e,options:r,url:s})),d=t.performance.now(),g(e));var w=()=>{h.removeEventListener("readystatechange",b),h.removeEventListener("error",w),h.removeEventListener("abort",w),h.removeEventListener("timeout",w)},b=()=>{if(h.readyState===h.DONE){w(),f=t.performance.now();var n={};h.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),i=t.join(": ");r&&(n[r]=i)})),i&&(p.responseHeaders=n),kn({type:"response",headers:n,url:s,recordBody:r.recordBody})&&(p.responseBody=In({body:h.response,options:r,url:s})),Sn(t,"xmlhttprequest",v.url,d,f).then((t=>{var r=An({entry:t,method:o,status:null==h?void 0:h.status,networkRequest:p,start:d,end:f,url:s.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}};h.addEventListener("readystatechange",b),h.addEventListener("error",w),h.addEventListener("abort",w),h.addEventListener("timeout",w)}catch(e){pn.error("Failed to instrument XHR for network capture",e)}a.call(h,o,s.toString(),u,l,c)}));return()=>{a()}}(o,n,a),l=function(e,r,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};var i=gn("request",n.recordHeaders),a=gn("response",n.recordHeaders),o=cn(r,"fetch",(o=>function(){var s=t((function*(t,s){var u,l;try{u=new Request(t,s)}catch(e){return pn.error("Failed to instrument fetch for network capture",e),o(t,s)}var c,h,d={};try{try{var f={};u.headers.forEach(((e,t)=>{f[t]=e})),i&&(d.requestHeaders=f),!Rn(null==s?void 0:s.body)&&kn({type:"request",headers:f,url:t,recordBody:n.recordBody})&&(d.requestBody=yield function(e){return _n.apply(this,arguments)}({r:u,options:n,url:t}))}catch(e){pn.error("Failed to record fetch request for network capture",e)}c=r.performance.now(),l=wn(t)?yield o(u):yield o(t,s),h=r.performance.now();try{var v={};l.headers.forEach(((e,t)=>{v[t]=e})),a&&(d.responseHeaders=v),kn({type:"response",headers:v,url:t,recordBody:n.recordBody})&&(d.responseBody=yield function(e){return Dn.apply(this,arguments)}({r:l,options:n,url:t}))}catch(e){pn.error("Failed to record fetch response for network capture",e)}return l}finally{Sn(r,"fetch",u.url,c,h).then((t=>{var r,n=An({entry:t,method:u.method,status:null==(r=l)?void 0:r.status,networkRequest:d,start:c,end:h,url:u.url,initiatorType:"fetch"});e({requests:n})})).catch((()=>{}))}}));return function(e,t){return s.apply(this,arguments)}}()));return()=>{o()}}(o,n,a)),Wn=()=>{s(),u(),l(),Wn=null}}var jn=e=>({name:"rrweb/network@1",observer:Pn,options:e}),Bn="undefined"!=typeof globalThis?globalThis:tn;Bn&&"undefined"==typeof self&&(Bn.self=Bn),Bn&&"undefined"==typeof File&&(Bn.File=function(){});var Hn=null!=tn?tn:{};Hn.__PosthogExtensions__=Hn.__PosthogExtensions__||{},Hn.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:qr,getRecordNetworkPlugin:jn},Hn.__PosthogExtensions__.rrweb={record:xr,version:"v2",wasMaxDepthReached:()=>tt,resetMaxDepthState(){tt=!1,et=!1},getLastSnapshotCost:()=>W,getMutationCost:()=>r({},q),resetSnapshotCostState(){L=0,N=0,_=0,R=0,D=A(),W=null,P=null,j=[],B=0,H=0,q={slowestBatchMs:0},U={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},Hn.rrweb={record:xr,version:"v2"},Hn.rrwebConsoleRecord={getRecordConsolePlugin:qr},Hn.getRecordNetworkPlugin=jn}();
|
|
2
2
|
//# sourceMappingURL=recorder.js.map
|