ripplo 0.21.0 → 0.21.1
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/README.md +1 -1
- package/dist/assets/collector-runtime.js +6 -6
- package/dist/assets/download-viewer/LICENSE +177 -0
- package/dist/assets/download-viewer/cmaps/78-EUC-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/78-EUC-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/78-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/78-RKSJ-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/78-RKSJ-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/78-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/78ms-RKSJ-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/78ms-RKSJ-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/83pv-RKSJ-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/90ms-RKSJ-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/90ms-RKSJ-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/90msp-RKSJ-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/90msp-RKSJ-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/90pv-RKSJ-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/90pv-RKSJ-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Add-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Add-RKSJ-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Add-RKSJ-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Add-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-CNS1-0.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-CNS1-1.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-CNS1-2.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-CNS1-3.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-CNS1-4.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-CNS1-5.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-CNS1-6.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-GB1-0.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-GB1-1.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-GB1-2.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-GB1-3.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-GB1-4.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-GB1-5.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-Japan1-0.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-Japan1-1.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-Japan1-2.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-Japan1-3.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-Japan1-4.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-Japan1-5.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-Japan1-6.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-Korea1-0.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-Korea1-1.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-Korea1-2.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/B5-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/B5-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/B5pc-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/B5pc-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/CNS-EUC-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/CNS-EUC-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/CNS1-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/CNS1-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/CNS2-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/CNS2-V.bcmap +3 -0
- package/dist/assets/download-viewer/cmaps/ETHK-B5-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/ETHK-B5-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/ETen-B5-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/ETen-B5-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/ETenms-B5-H.bcmap +3 -0
- package/dist/assets/download-viewer/cmaps/ETenms-B5-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/EUC-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/EUC-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Ext-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Ext-RKSJ-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Ext-RKSJ-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Ext-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/GB-EUC-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/GB-EUC-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/GB-H.bcmap +4 -0
- package/dist/assets/download-viewer/cmaps/GB-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/GBK-EUC-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/GBK-EUC-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/GBK2K-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/GBK2K-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/GBKp-EUC-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/GBKp-EUC-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/GBT-EUC-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/GBT-EUC-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/GBT-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/GBT-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/GBTpc-EUC-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/GBTpc-EUC-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/GBpc-EUC-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/GBpc-EUC-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/HKdla-B5-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/HKdla-B5-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/HKdlb-B5-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/HKdlb-B5-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/HKgccs-B5-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/HKgccs-B5-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/HKm314-B5-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/HKm314-B5-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/HKm471-B5-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/HKm471-B5-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/HKscs-B5-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/HKscs-B5-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Hankaku.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Hiragana.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/KSC-EUC-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/KSC-EUC-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/KSC-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/KSC-Johab-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/KSC-Johab-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/KSC-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/KSCms-UHC-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/KSCms-UHC-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/KSCpc-EUC-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/KSCpc-EUC-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Katakana.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/LICENSE +36 -0
- package/dist/assets/download-viewer/cmaps/NWP-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/NWP-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/RKSJ-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/RKSJ-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/Roman.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniCNS-UCS2-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniCNS-UCS2-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniCNS-UTF16-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniCNS-UTF16-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniCNS-UTF32-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniCNS-UTF32-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniCNS-UTF8-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniCNS-UTF8-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniGB-UCS2-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniGB-UCS2-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniGB-UTF16-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniGB-UTF16-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniGB-UTF32-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniGB-UTF32-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniGB-UTF8-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniGB-UTF8-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniJIS-UCS2-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniJIS-UCS2-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniJIS-UTF16-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniJIS-UTF16-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniJIS-UTF32-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniJIS-UTF32-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniJIS-UTF8-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniJIS-UTF8-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniKS-UCS2-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniKS-UCS2-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniKS-UTF16-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniKS-UTF16-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniKS-UTF32-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniKS-UTF32-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniKS-UTF8-H.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/UniKS-UTF8-V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/V.bcmap +0 -0
- package/dist/assets/download-viewer/cmaps/WP-Symbol.bcmap +0 -0
- package/dist/assets/download-viewer/iccs/CGATS001Compat-v2-micro.icc +0 -0
- package/dist/assets/download-viewer/iccs/LICENSE +116 -0
- package/dist/assets/download-viewer/standard_fonts/FoxitDingbats.pfb +0 -0
- package/dist/assets/download-viewer/standard_fonts/FoxitFixed.pfb +0 -0
- package/dist/assets/download-viewer/standard_fonts/FoxitFixedBold.pfb +0 -0
- package/dist/assets/download-viewer/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
- package/dist/assets/download-viewer/standard_fonts/FoxitFixedItalic.pfb +0 -0
- package/dist/assets/download-viewer/standard_fonts/FoxitSerif.pfb +0 -0
- package/dist/assets/download-viewer/standard_fonts/FoxitSerifBold.pfb +0 -0
- package/dist/assets/download-viewer/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
- package/dist/assets/download-viewer/standard_fonts/FoxitSerifItalic.pfb +0 -0
- package/dist/assets/download-viewer/standard_fonts/FoxitSymbol.pfb +0 -0
- package/dist/assets/download-viewer/standard_fonts/LICENSE_FOXIT +27 -0
- package/dist/assets/download-viewer/standard_fonts/LICENSE_LIBERATION +363 -0
- package/dist/assets/download-viewer/standard_fonts/LiberationSans-Bold.ttf +0 -0
- package/dist/assets/download-viewer/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
- package/dist/assets/download-viewer/standard_fonts/LiberationSans-Italic.ttf +0 -0
- package/dist/assets/download-viewer/standard_fonts/LiberationSans-Regular.ttf +0 -0
- package/dist/assets/download-viewer/viewer.js +147 -0
- package/dist/assets/download-viewer/wasm/LICENSE_JBIG2 +196 -0
- package/dist/assets/download-viewer/wasm/LICENSE_OPENJPEG +39 -0
- package/dist/assets/download-viewer/wasm/LICENSE_PDFJS_JBIG2 +13 -0
- package/dist/assets/download-viewer/wasm/LICENSE_PDFJS_OPENJPEG +22 -0
- package/dist/assets/download-viewer/wasm/LICENSE_PDFJS_QCMS +19 -0
- package/dist/assets/download-viewer/wasm/LICENSE_QCMS +21 -0
- package/dist/assets/download-viewer/wasm/jbig2.wasm +0 -0
- package/dist/assets/download-viewer/wasm/jbig2_nowasm_fallback.js +15 -0
- package/dist/assets/download-viewer/wasm/openjpeg.wasm +0 -0
- package/dist/assets/download-viewer/wasm/openjpeg_nowasm_fallback.js +17 -0
- package/dist/assets/download-viewer/wasm/qcms_bg.wasm +0 -0
- package/dist/assets/download-viewer/wasm/quickjs-eval.js +16 -0
- package/dist/assets/download-viewer/wasm/quickjs-eval.wasm +0 -0
- package/dist/assets/rrweb-replay.js +1 -1
- package/dist/assets/rrweb.js +9 -9
- package/dist/index.js +381 -303
- package/dist/page-runtime.js +23 -23
- package/dist/plugin-source/plugin.json +19 -0
- package/dist/plugin-source/skills/skills/cover/SKILL.md +68 -0
- package/dist/plugin-source/skills/skills/review/SKILL.md +52 -0
- package/package.json +3 -3
|
@@ -51,4 +51,4 @@ https://www.w3ctech.com/topic/2226`));let a=t(...o);return a.postcssPlugin=e,a.p
|
|
|
51
51
|
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
|
|
52
52
|
https://www.w3ctech.com/topic/2226`));let a=t(...o);return a.postcssPlugin=e,a.postcssVersion=new Di().version,a}let n;return Object.defineProperty(i,"postcss",{get(){return n||(n=i()),n}}),i.process=function(o,a,l){return L([i(l)]).process(o,a)},i};L.stringify=Uf;L.parse=Gf;L.fromJSON=Bf;L.list=jf;L.comment=s=>new va(s);L.atRule=s=>new Ca(s);L.decl=s=>new ba(s);L.rule=s=>new Ia(s);L.root=s=>new Ea(s);L.document=s=>new Sa(s);L.CssSyntaxError=Pf;L.Declaration=ba;L.Container=Ff;L.Processor=Di;L.Document=Sa;L.Comment=va;L.Warning=Wf;L.AtRule=Ca;L.Result=zf;L.Input=Vf;L.Rule=Ia;L.Root=Ea;L.Node=Yf;Lf.registerPostcss(L);var Hf=L;L.default=L;var j=ih(Hf);j.stringify;j.fromJSON;j.plugin;j.parse;j.list;j.document;j.comment;j.atRule;j.rule;j.decl;j.root;j.CssSyntaxError;j.Declaration;j.Container;j.Processor;j.Document;j.Comment;j.Warning;j.AtRule;j.Result;j.Input;j.Rule;j.Root;j.Node;var O=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(O||{});function Zf(s){let e={},t=/;(?![^(]*\))/g,r=/:(.+)/,i=/\/\*.*?\*\//g;return s.replace(i,"").split(t).forEach(function(n){if(n){let o=n.split(r);o.length>1&&(e[Us(o[0].trim())]=o[1].trim())}}),e}function Rn(s){let e=[];for(let t in s){let r=s[t];if(typeof r!="string")continue;let i=Qf(t);e.push(`${i}: ${r};`)}return e.join(" ")}var Xf=/-([a-z])/g,Jf=/^--[a-zA-Z0-9-]+$/,Us=s=>Jf.test(s)?s:s.replace(Xf,(e,t)=>t?t.toUpperCase():""),Kf=/\B([A-Z])/g,Qf=s=>s.replace(Kf,"-$1").toLowerCase(),ue=class s{constructor(...e){C(this,"parentElement",null),C(this,"parentNode",null),C(this,"ownerDocument"),C(this,"firstChild",null),C(this,"lastChild",null),C(this,"previousSibling",null),C(this,"nextSibling",null),C(this,"ELEMENT_NODE",1),C(this,"TEXT_NODE",3),C(this,"nodeType"),C(this,"nodeName"),C(this,"RRNodeType")}get childNodes(){let e=[],t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(e instanceof s){if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0}else return!1;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}},Bs=class s extends ue{constructor(...e){super(e),C(this,"nodeType",9),C(this,"nodeName","#document"),C(this,"compatMode","CSS1Compat"),C(this,"RRNodeType",O.Document),C(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(e=>e.RRNodeType===O.Element&&e.tagName==="HTML")||null}get body(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(t=>t.RRNodeType===O.Element&&t.tagName==="BODY"))||null}get head(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(t=>t.RRNodeType===O.Element&&t.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(e){let t=e.RRNodeType;if((t===O.Element||t===O.DocumentType)&&this.childNodes.some(i=>i.RRNodeType===t))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${t===O.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);let r=Ti(this,e);return r.parentElement=null,r}insertBefore(e,t){let r=e.RRNodeType;if((r===O.Element||r===O.DocumentType)&&this.childNodes.some(n=>n.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${r===O.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);let i=xa(this,e,t);return i.parentElement=null,i}removeChild(e){return Ma(this,e)}open(){this.firstChild=null,this.lastChild=null}close(){}write(e){let t;if(e==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?t="-//W3C//DTD XHTML 1.0 Transitional//EN":e==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(t="-//W3C//DTD HTML 4.0 Transitional//EN"),t){let r=this.createDocumentType("html",t,"");this.open(),this.appendChild(r)}}createDocument(e,t,r){return new s}createDocumentType(e,t,r){let i=new wr(e,t,r);return i.ownerDocument=this,i}createElement(e){let t=new Je(e);return t.ownerDocument=this,t}createElementNS(e,t){return this.createElement(t)}createTextNode(e){let t=new br(e);return t.ownerDocument=this,t}createComment(e){let t=new Sr(e);return t.ownerDocument=this,t}createCDATASection(e){let t=new vr(e);return t.ownerDocument=this,t}toString(){return"RRDocument"}},wr=class extends ue{constructor(e,t,r){super(),C(this,"nodeType",10),C(this,"RRNodeType",O.DocumentType),C(this,"name"),C(this,"publicId"),C(this,"systemId"),C(this,"textContent",null),this.name=e,this.publicId=t,this.systemId=r,this.nodeName=e}toString(){return"RRDocumentType"}},Je=class extends ue{constructor(e){super(),C(this,"nodeType",1),C(this,"RRNodeType",O.Element),C(this,"tagName"),C(this,"attributes",{}),C(this,"shadowRoot",null),C(this,"scrollLeft"),C(this,"scrollTop"),this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e="";return this.childNodes.forEach(t=>e+=t.textContent),e}set textContent(e){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(e))}get classList(){return new Vs(this.attributes.class,e=>{this.attributes.class=e})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){let e=this.attributes.style?Zf(this.attributes.style):{},t=/\B([A-Z])/g;return e.setProperty=(r,i,n)=>{if(t.test(r))return;let o=Us(r);i?e[o]=i:delete e[o],n==="important"&&(e[o]+=" !important"),this.attributes.style=Rn(e)},e.removeProperty=r=>{if(t.test(r))return"";let i=Us(r),n=e[i]||"";return delete e[i],this.attributes.style=Rn(e),n},e}getAttribute(e){return this.attributes[e]===void 0?null:this.attributes[e]}setAttribute(e,t){this.attributes[e]=t}setAttributeNS(e,t,r){this.setAttribute(t,r)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return Ti(this,e)}insertBefore(e,t){return xa(this,e,t)}removeChild(e){return Ma(this,e)}attachShadow(e){let t=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=t,t}dispatchEvent(e){return!0}toString(){let e="";for(let t in this.attributes)e+=`${t}="${this.attributes[t]}" `;return`${this.tagName} ${e}`}},Ws=class extends Je{constructor(){super(...arguments),C(this,"currentTime"),C(this,"volume"),C(this,"paused"),C(this,"muted"),C(this,"playbackRate"),C(this,"loop")}attachShadow(e){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}},zs=class extends Je{constructor(){super(...arguments),C(this,"tagName","DIALOG"),C(this,"nodeName","DIALOG")}get isModal(){return this.getAttribute("rr_open_mode")==="modal"}get open(){return this.getAttribute("open")!==null}close(){this.removeAttribute("open"),this.removeAttribute("rr_open_mode")}show(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","non-modal")}showModal(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","modal")}},br=class extends ue{constructor(e){super(),C(this,"nodeType",3),C(this,"nodeName","#text"),C(this,"RRNodeType",O.Text),C(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRText text=${JSON.stringify(this.data)}`}},Sr=class extends ue{constructor(e){super(),C(this,"nodeType",8),C(this,"nodeName","#comment"),C(this,"RRNodeType",O.Comment),C(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRComment text=${JSON.stringify(this.data)}`}},vr=class extends ue{constructor(e){super(),C(this,"nodeName","#cdata-section"),C(this,"nodeType",4),C(this,"RRNodeType",O.CDATA),C(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}},Vs=class{constructor(e,t){if(C(this,"onChange"),C(this,"classes",[]),C(this,"add",(...r)=>{for(let i of r){let n=String(i);this.classes.indexOf(n)>=0||this.classes.push(n)}this.onChange&&this.onChange(this.classes.join(" "))}),C(this,"remove",(...r)=>{this.classes=this.classes.filter(i=>r.indexOf(i)===-1),this.onChange&&this.onChange(this.classes.join(" "))}),e){let r=e.trim().split(/\s+/);this.classes.push(...r)}this.onChange=t}};function Ti(s,e){return e.parentNode&&e.parentNode.removeChild(e),s.lastChild?(s.lastChild.nextSibling=e,e.previousSibling=s.lastChild):(s.firstChild=e,e.previousSibling=null),s.lastChild=e,e.nextSibling=null,e.parentNode=s,e.parentElement=s,e.ownerDocument=s.ownerDocument,e}function xa(s,e,t){if(!t)return Ti(s,e);if(t.parentNode!==s)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return e===t||(e.parentNode&&e.parentNode.removeChild(e),e.previousSibling=t.previousSibling,t.previousSibling=e,e.nextSibling=t,e.previousSibling?e.previousSibling.nextSibling=e:s.firstChild=e,e.parentElement=s,e.parentNode=s,e.ownerDocument=s.ownerDocument),e}function Ma(s,e){if(e.parentNode!==s)throw new Error("Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.");return e.previousSibling?e.previousSibling.nextSibling=e.nextSibling:s.firstChild=e.nextSibling,e.nextSibling?e.nextSibling.previousSibling=e.previousSibling:s.lastChild=e.previousSibling,e.previousSibling=null,e.nextSibling=null,e.parentElement=null,e.parentNode=null,e}var ne=(s=>(s[s.PLACEHOLDER=0]="PLACEHOLDER",s[s.ELEMENT_NODE=1]="ELEMENT_NODE",s[s.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",s[s.TEXT_NODE=3]="TEXT_NODE",s[s.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",s[s.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",s[s.ENTITY_NODE=6]="ENTITY_NODE",s[s.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",s[s.COMMENT_NODE=8]="COMMENT_NODE",s[s.DOCUMENT_NODE=9]="DOCUMENT_NODE",s[s.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",s[s.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",s))(ne||{}),Gs={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},qf={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"},pe=null;function Cr(s,e,t,r=e.mirror||e.ownerDocument.mirror){s=ed(s,e,t,r),Na(s,e,t,r),td(s,e,t)}function ed(s,e,t,r){var i;if(t.afterAppend&&!pe&&(pe=new WeakSet,setTimeout(()=>{pe=null},0)),!_i(s,e)){let n=Ir(e,t.mirror,r);(i=s.parentNode)==null||i.replaceChild(n,s),s=n}switch(e.RRNodeType){case O.Document:{if(!Le(s,e,t.mirror,r)){let n=r.getMeta(e);n&&(t.mirror.removeNodeFromMap(s),s.close(),s.open(),t.mirror.add(s,n),pe?.add(s))}break}case O.Element:{let n=s,o=e;switch(o.tagName){case"IFRAME":{let a=s.contentDocument;if(!a)break;Cr(a,e.contentDocument,t,r);break}}o.shadowRoot&&(n.shadowRoot||n.attachShadow({mode:"open"}),Na(n.shadowRoot,o.shadowRoot,t,r)),rd(n,o,r);break}}return s}function td(s,e,t){var r;switch(e.RRNodeType){case O.Document:{let i=e.scrollData;i&&t.applyScroll(i,!0);break}case O.Element:{let i=s,n=e;switch(n.scrollData&&t.applyScroll(n.scrollData,!0),n.inputData&&t.applyInput(n.inputData),n.tagName){case"AUDIO":case"VIDEO":{let o=s,a=n;a.paused!==void 0&&(a.paused?o.pause():o.play()),a.muted!==void 0&&(o.muted=a.muted),a.volume!==void 0&&(o.volume=a.volume),a.currentTime!==void 0&&(o.currentTime=a.currentTime),a.playbackRate!==void 0&&(o.playbackRate=a.playbackRate),a.loop!==void 0&&(o.loop=a.loop);break}case"CANVAS":{let o=e;if(o.rr_dataURL!==null){let a=document.createElement("img");a.onload=()=>{let l=i.getContext("2d");l&&l.drawImage(a,0,0,a.width,a.height)},a.src=o.rr_dataURL}o.canvasMutations.forEach(a=>t.applyCanvas(a.event,a.mutation,s));break}case"STYLE":{let o=i.sheet;o&&e.rules.forEach(a=>t.applyStyleSheetMutation(a,o));break}case"DIALOG":{let o=i,a=n,l=o.open,u=o.matches("dialog:modal"),c=a.open,h=a.isModal,f=u!==h,g=l!==c;if((f||l&&g)&&o.close(),c&&(g||f))try{h?o.showModal():o.show()}catch(p){console.warn(p)}break}}break}case O.Text:case O.Comment:case O.CDATA:{s.textContent!==e.data&&(s.textContent=e.data);break}}pe?.has(s)&&(pe.delete(s),(r=t.afterAppend)==null||r.call(t,s,t.mirror.getId(s)))}function rd(s,e,t){let r=s.attributes,i=e.attributes;for(let n in i){let o=i[n],a=t.getMeta(e);if(a?.isSVG&&Gs[n])s.setAttributeNS(Gs[n],n,o);else if(e.tagName==="CANVAS"&&n==="rr_dataURL"){let l=document.createElement("img");l.src=o,l.onload=()=>{let u=s.getContext("2d");u&&u.drawImage(l,0,0,l.width,l.height)}}else{if(e.tagName==="IFRAME"&&n==="srcdoc")continue;try{s.setAttribute(n,o)}catch(l){console.warn(l)}}}for(let{name:n}of Array.from(r))n in i||s.removeAttribute(n);e.scrollLeft&&(s.scrollLeft=e.scrollLeft),e.scrollTop&&(s.scrollTop=e.scrollTop)}function Na(s,e,t,r){let i=Array.from(s.childNodes),n=e.childNodes;if(i.length===0&&n.length===0)return;let o=0,a=i.length-1,l=0,u=n.length-1,c=i[o],h=i[a],f=n[l],g=n[u],p,m;for(;o<=a&&l<=u;)if(c===void 0)c=i[++o];else if(h===void 0)h=i[--a];else if(Le(c,f,t.mirror,r))c=i[++o],f=n[++l];else if(Le(h,g,t.mirror,r))h=i[--a],g=n[--u];else if(Le(c,g,t.mirror,r)){try{s.insertBefore(c,h.nextSibling)}catch(S){console.warn(S)}c=i[++o],g=n[--u]}else if(Le(h,f,t.mirror,r)){try{s.insertBefore(h,c)}catch(S){console.warn(S)}h=i[--a],f=n[++l]}else{if(!p){p={};for(let w=o;w<=a;w++){let v=i[w];v&&t.mirror.hasNode(v)&&(p[t.mirror.getId(v)]=w)}}m=p[r.getId(f)];let S=i[m];if(m!==void 0&&S&&Le(S,f,t.mirror,r)){try{s.insertBefore(S,c)}catch(w){console.warn(w)}i[m]=void 0}else{let w=Ir(f,t.mirror,r);s.nodeName==="#document"&&c&&(w.nodeType===w.DOCUMENT_TYPE_NODE&&c.nodeType===c.DOCUMENT_TYPE_NODE||w.nodeType===w.ELEMENT_NODE&&c.nodeType===c.ELEMENT_NODE)&&(s.removeChild(c),t.mirror.removeNodeFromMap(c),c=i[++o]);try{s.insertBefore(w,c||null)}catch(v){console.warn(v)}}f=n[++l]}if(o>a){let S=n[u+1],w=null;for(S&&(w=t.mirror.getNode(r.getId(S)));l<=u;++l){let v=Ir(n[l],t.mirror,r);try{s.insertBefore(v,w)}catch(x){console.warn(x)}}}else if(l>u)for(;o<=a;o++){let S=i[o];if(!(!S||S.parentNode!==s))try{s.removeChild(S),t.mirror.removeNodeFromMap(S)}catch(w){console.warn(w)}}let d=s.firstChild,y=e.firstChild;for(;d!==null&&y!==null;)Cr(d,y,t,r),d=d.nextSibling,y=y.nextSibling}function Ir(s,e,t){let r=t.getId(s),i=t.getMeta(s),n=null;if(r>-1&&(n=e.getNode(r)),n!==null&&_i(n,s))return n;switch(s.RRNodeType){case O.Document:n=new Document;break;case O.DocumentType:n=document.implementation.createDocumentType(s.name,s.publicId,s.systemId);break;case O.Element:{let o=s.tagName.toLowerCase();o=qf[o]||o,i&&"isSVG"in i&&i?.isSVG?n=document.createElementNS(Gs.svg,o):n=document.createElement(s.tagName);break}case O.Text:n=document.createTextNode(s.data);break;case O.Comment:n=document.createComment(s.data);break;case O.CDATA:n=document.createCDATASection(s.data);break}i&&e.add(n,{...i});try{pe?.add(n)}catch{}return n}function _i(s,e){return s.nodeType!==e.nodeType?!1:s.nodeType!==s.ELEMENT_NODE||s.tagName.toUpperCase()===e.tagName}function Le(s,e,t,r){let i=t.getId(s),n=r.getId(e);return i===-1||i!==n?!1:_i(s,e)}var Ke=class s extends Bs{constructor(e){super(),C(this,"UNSERIALIZED_STARTING_ID",-2),C(this,"_unserializedId",this.UNSERIALIZED_STARTING_ID),C(this,"mirror",ud()),C(this,"scrollData",null),e&&(this.mirror=e)}get unserializedId(){return this._unserializedId--}createDocument(e,t,r){return new s}createDocumentType(e,t,r){let i=new sd(e,t,r);return i.ownerDocument=this,i}createElement(e){let t=e.toUpperCase(),r;switch(t){case"AUDIO":case"VIDEO":r=new js(t);break;case"IFRAME":r=new Xs(t,this.mirror);break;case"CANVAS":r=new Hs(t);break;case"STYLE":r=new Zs(t);break;case"DIALOG":r=new Ys(t);break;default:r=new Qe(t);break}return r.ownerDocument=this,r}createComment(e){let t=new nd(e);return t.ownerDocument=this,t}createCDATASection(e){let t=new od(e);return t.ownerDocument=this,t}createTextNode(e){let t=new id(e);return t.ownerDocument=this,t}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}},sd=wr,Qe=class extends Je{constructor(){super(...arguments),C(this,"inputData",null),C(this,"scrollData",null)}},js=class extends Ws{},Ys=class extends zs{},Hs=class extends Qe{constructor(){super(...arguments),C(this,"rr_dataURL",null),C(this,"canvasMutations",[])}getContext(){return null}},Zs=class extends Qe{constructor(){super(...arguments),C(this,"rules",[])}},Xs=class extends Qe{constructor(e,t){super(e),C(this,"contentDocument",new Ke),this.contentDocument.mirror=t}},id=br,nd=Sr,od=vr;function ad(s){return s instanceof HTMLFormElement?"FORM":s.tagName.toUpperCase()}function Ra(s,e,t,r){let i;switch(s.nodeType){case ne.DOCUMENT_NODE:r&&r.nodeName==="IFRAME"?i=r.contentDocument:(i=e,i.compatMode=s.compatMode);break;case ne.DOCUMENT_TYPE_NODE:{let o=s;i=e.createDocumentType(o.name,o.publicId,o.systemId);break}case ne.ELEMENT_NODE:{let o=s,a=ad(o);i=e.createElement(a);let l=i;for(let{name:u,value:c}of Array.from(o.attributes))l.attributes[u]=c;o.scrollLeft&&(l.scrollLeft=o.scrollLeft),o.scrollTop&&(l.scrollTop=o.scrollTop);break}case ne.TEXT_NODE:i=e.createTextNode(s.textContent||"");break;case ne.CDATA_SECTION_NODE:i=e.createCDATASection(s.data);break;case ne.COMMENT_NODE:i=e.createComment(s.textContent||"");break;case ne.DOCUMENT_FRAGMENT_NODE:i=r.attachShadow({mode:"open"});break;default:return null}let n=t.getMeta(s);return e instanceof Ke&&(n||(n=Aa(i,e.unserializedId),t.add(s,n)),e.mirror.add(i,{...n})),i}function ld(s,e=sh(),t=new Ke){function r(i,n){let o=Ra(i,t,e,n);if(o!==null)if(n?.nodeName!=="IFRAME"&&i.nodeType!==ne.DOCUMENT_FRAGMENT_NODE&&(n?.appendChild(o),o.parentNode=n,o.parentElement=n),i.nodeName==="IFRAME"){let a=i.contentDocument;a&&r(a,o)}else(i.nodeType===ne.DOCUMENT_NODE||i.nodeType===ne.ELEMENT_NODE||i.nodeType===ne.DOCUMENT_FRAGMENT_NODE)&&(i.nodeType===ne.ELEMENT_NODE&&i.shadowRoot&&r(i.shadowRoot,o),i.childNodes.forEach(a=>r(a,o)))}return r(s,null),t}function ud(){return new Js}var Js=class{constructor(){C(this,"idNodeMap",new Map),C(this,"nodeMetaMap",new WeakMap)}getId(e){var t;return e?((t=this.getMeta(e))==null?void 0:t.id)??-1:-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){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){let r=this.getNode(e);if(r){let i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Aa(s,e){switch(s.RRNodeType){case O.Document:return{id:e,type:s.RRNodeType,childNodes:[]};case O.DocumentType:{let t=s;return{id:e,type:s.RRNodeType,name:t.name,publicId:t.publicId,systemId:t.systemId}}case O.Element:return{id:e,type:s.RRNodeType,tagName:s.tagName.toLowerCase(),attributes:{},childNodes:[]};case O.Text:return{id:e,type:s.RRNodeType,textContent:s.textContent||""};case O.Comment:return{id:e,type:s.RRNodeType,textContent:s.textContent||""};case O.CDATA:return{id:e,type:s.RRNodeType,textContent:""}}}var An={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},On={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Jt={},cd=()=>!!globalThis.Zone;function ki(s){if(Jt[s])return Jt[s];let e=globalThis[s],t=e.prototype,r=s in An?An[s]:void 0,i=!!(r&&r.every(a=>{var l,u;return!!((u=(l=Object.getOwnPropertyDescriptor(t,a))==null?void 0:l.get)!=null&&u.toString().includes("[native code]"))})),n=s in On?On[s]:void 0,o=!!(n&&n.every(a=>{var l;return typeof t[a]=="function"&&((l=t[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&o&&!cd())return Jt[s]=e.prototype,e.prototype;try{let a=document.createElement("iframe");document.body.appendChild(a);let l=a.contentWindow;if(!l)return e.prototype;let u=l[s].prototype;return document.body.removeChild(a),u?Jt[s]=u:t}catch{return t}}var rs={};function ve(s,e,t){var r;let i=`${s}.${String(t)}`;if(rs[i])return rs[i].call(e);let n=ki(s),o=(r=Object.getOwnPropertyDescriptor(n,t))==null?void 0:r.get;return o?(rs[i]=o,o.call(e)):e[t]}var ss={};function Oa(s,e,t){let r=`${s}.${String(t)}`;if(ss[r])return ss[r].bind(e);let n=ki(s)[t];return typeof n!="function"?e[t]:(ss[r]=n,n.bind(e))}function hd(s){return ve("Node",s,"ownerDocument")}function fd(s){return ve("Node",s,"childNodes")}function dd(s){return ve("Node",s,"parentNode")}function pd(s){return ve("Node",s,"parentElement")}function md(s){return ve("Node",s,"textContent")}function gd(s,e){return Oa("Node",s,"contains")(e)}function yd(s){return Oa("Node",s,"getRootNode")()}function wd(s){return!s||!("host"in s)?null:ve("ShadowRoot",s,"host")}function bd(s){return s.styleSheets}function Sd(s){return!s||!("shadowRoot"in s)?null:ve("Element",s,"shadowRoot")}function vd(s,e){return ve("Element",s,"querySelector")(e)}function Cd(s,e){return ve("Element",s,"querySelectorAll")(e)}function Da(){return ki("MutationObserver").constructor}function ke(s,e,t){try{if(!(e in s))return()=>{};let r=s[e],i=t(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),s[e]=i,()=>{s[e]=r}}catch{return()=>{}}}var R={ownerDocument:hd,childNodes:fd,parentNode:dd,parentElement:pd,textContent:md,contains:gd,getRootNode:yd,host:wd,styleSheets:bd,shadowRoot:Sd,querySelector:vd,querySelectorAll:Cd,mutationObserver:Da,patch:ke};function q(s,e,t=document){let r={capture:!0,passive:!0};return t.addEventListener(s,e,r),()=>t.removeEventListener(s,e,r)}var Fe=`Please stop import mirror directly. Instead of that,\r
|
|
53
53
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
54
|
-
or you can use record.mirror to access the mirror instance during recording.`,Dn={map:{},getId(){return console.error(Fe),-1},getNode(){return console.error(Fe),null},removeNodeFromMap(){console.error(Fe)},has(){return console.error(Fe),!1},reset(){console.error(Fe)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Dn=new Proxy(Dn,{get(s,e,t){return e==="map"&&console.error(Fe),Reflect.get(s,e,t)}}));function Ct(s,e,t={}){let r=null,i=0;return function(...n){let o=Date.now();!i&&t.leading===!1&&(i=o);let a=e-(o-i),l=this;a<=0||a>e?(r&&(clearTimeout(r),r=null),i=o,s.apply(l,n)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{i=t.leading===!1?0:Date.now(),r=null,s.apply(l,n)},a))}}function zr(s,e,t,r,i=window){let n=i.Object.getOwnPropertyDescriptor(s,e);return i.Object.defineProperty(s,e,r?t:{set(o){setTimeout(()=>{t.set.call(this,o)},0),n&&n.set&&n.set.call(this,o)}}),()=>zr(s,e,n||{},!0)}var Er=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Er=()=>new Date().getTime());function Ta(s){var e,t,r,i;let n=s.document;return{left:n.scrollingElement?n.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:n.documentElement.scrollLeft||n?.body&&((e=R.parentElement(n.body))==null?void 0:e.scrollLeft)||((t=n?.body)==null?void 0:t.scrollLeft)||0,top:n.scrollingElement?n.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:n?.documentElement.scrollTop||n?.body&&((r=R.parentElement(n.body))==null?void 0:r.scrollTop)||((i=n?.body)==null?void 0:i.scrollTop)||0}}function _a(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ka(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function $a(s){return s?s.nodeType===s.ELEMENT_NODE?s:R.parentElement(s):null}function ee(s,e,t,r){if(!s)return!1;let i=$a(s);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(ur(i,e,r))return!0}catch{}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function Id(s,e){return e.getId(s)!==-1}function is(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===dt}function Pa(s,e){if(at(s))return!1;let t=e.getId(s);if(!e.has(t))return!0;let r=R.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?Pa(r,e):!0}function Ks(s){return!!s.changedTouches}function La(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function Ed(s){let e={},t=(i,n)=>{let o={value:i,parent:n,children:[]};return e[i.node.id]=o,o},r=[];for(let i of s){let{nextId:n,parentId:o}=i;if(n&&n in e){let a=e[n];if(a.parent){let l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,t(i,a.parent))}else{let l=r.indexOf(a);r.splice(l,0,t(i,null))}continue}if(o in e){let a=e[o];a.children.push(t(i,a));continue}r.push(t(i,null))}return r}function Fa(s,e){e(s.value);for(let t=s.children.length-1;t>=0;t--)Fa(s.children[t],e)}function ct(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function Ua(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function Ba(s,e){var t,r;let i=(r=(t=s.ownerDocument)==null?void 0:t.defaultView)==null?void 0:r.frameElement;if(!i||i===e)return{x:0,y:0,relativeScale:1,absoluteScale:1};let n=i.getBoundingClientRect(),o=Ba(i,e),a=n.height/i.clientHeight;return{x:n.x*o.relativeScale+o.x,y:n.y*o.relativeScale+o.y,relativeScale:a,absoluteScale:o.absoluteScale*a}}function Oe(s){return s?s instanceof ue&&"shadowRoot"in s?!!s.shadowRoot:!!R.shadowRoot(s):!1}function nt(s,e){let t=s[e[0]];return e.length===1?t:nt(t.cssRules[e[1]].cssRules,e.slice(2))}function Tn(s){let e=[...s],t=e.pop();return{positions:e,index:t}}function xd(s){let e=new Set,t=[];for(let r=s.length;r--;){let i=s[r];e.has(i.id)||(t.push(i),e.add(i.id))}return t}var xr=class{constructor(){b(this,"id",1),b(this,"styleIDMap",new WeakMap),b(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return t===void 0?r=this.id++:r=t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Wa(s){var e;let t=null;return"getRootNode"in s&&((e=R.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&R.host(R.getRootNode(s))&&(t=R.host(R.getRootNode(s))),t}function Md(s){let e=s,t;for(;t=Wa(e);)e=t;return e}function Nd(s){let e=R.ownerDocument(s);if(!e)return!1;let t=Md(s);return R.contains(e,t)}function za(s){let e=R.ownerDocument(s);return e?R.contains(e,s)||Nd(s):!1}var E=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(E||{}),I=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(I||{}),_=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(_||{}),me=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(me||{}),be=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(be||{}),Ie=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(Ie||{}),T=(s=>(s.Start="start",s.Pause="pause",s.Resume="resume",s.Resize="resize",s.Finish="finish",s.FullsnapshotRebuilded="fullsnapshot-rebuilded",s.LoadStylesheetStart="load-stylesheet-start",s.LoadStylesheetEnd="load-stylesheet-end",s.SkipStart="skip-start",s.SkipEnd="skip-end",s.MouseInteraction="mouse-interaction",s.EventCast="event-cast",s.CustomEvent="custom-event",s.Flush="flush",s.StateChange="state-change",s.PlayBack="play-back",s.Destroy="destroy",s))(T||{}),ge=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(ge||{});function _n(s){return"__ln"in s}var Qs=class{constructor(){b(this,"length",0),b(this,"head",null),b(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=t?.next||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&_n(e.previousSibling)){let 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&&_n(e.nextSibling)&&e.nextSibling.__ln.previous){let r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){let 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--)}},kn=(s,e)=>`${s}@${e}`,qs=class{constructor(){b(this,"frozen",!1),b(this,"locked",!1),b(this,"texts",[]),b(this,"attributes",[]),b(this,"attributeMap",new WeakMap),b(this,"removes",[]),b(this,"mapRemoves",[]),b(this,"movedMap",{}),b(this,"addedSet",new Set),b(this,"movedSet",new Set),b(this,"droppedSet",new Set),b(this,"removesSubTreeCache",new Set),b(this,"mutationCb"),b(this,"blockClass"),b(this,"blockSelector"),b(this,"maskTextClass"),b(this,"maskTextSelector"),b(this,"inlineStylesheet"),b(this,"maskInputOptions"),b(this,"maskTextFn"),b(this,"maskInputFn"),b(this,"keepIframeSrcFn"),b(this,"recordCanvas"),b(this,"inlineImages"),b(this,"slimDOMOptions"),b(this,"dataURLOptions"),b(this,"doc"),b(this,"mirror"),b(this,"iframeManager"),b(this,"stylesheetManager"),b(this,"shadowDomManager"),b(this,"canvasManager"),b(this,"processedNodeManager"),b(this,"unattachedDoc"),b(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),b(this,"emit",()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,r=new Qs,i=l=>{let u=l,c=dt;for(;c===dt;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},n=l=>{let u=R.parentNode(l);if(!u||!za(l))return;let c=!1;if(l.nodeType===Node.TEXT_NODE){let p=u.tagName;if(p==="TEXTAREA")return;p==="STYLE"&&this.addedSet.has(u)&&(c=!0)}let h=at(u)?this.mirror.getId(Wa(l)):this.mirror.getId(u),f=i(l);if(h===-1||f===-1)return r.addNode(l);let g=We(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:p=>{ct(p,this.mirror)&&this.iframeManager.addIframe(p),Ua(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),Oe(l)&&this.shadowDomManager.addShadowRoot(R.shadowRoot(l),this.doc)},onIframeLoad:(p,m)=>{this.iframeManager.attachIframe(p,m),this.shadowDomManager.observeAttachShadow(p)},onStylesheetLoad:(p,m)=>{this.stylesheetManager.attachLinkElement(p,m)},cssCaptured:c});g&&(e.push({parentId:h,nextId:f,node:g}),t.add(g.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let l of this.movedSet)$n(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(R.parentNode(l))||n(l);for(let l of this.addedSet)!Pn(this.droppedSet,l)&&!$n(this.removesSubTreeCache,l,this.mirror)||Pn(this.movedSet,l)?n(l):this.droppedSet.add(l);let o=null;for(;r.length;){let l=null;if(o){let u=this.mirror.getId(R.parentNode(o.value)),c=i(o.value);u!==-1&&c!==-1&&(l=o)}if(!l){let u=r.tail;for(;u;){let c=u;if(u=u.previous,c){let h=this.mirror.getId(R.parentNode(c.value));if(i(c.value)===-1)continue;if(h!==-1){l=c;break}else{let g=c.value,p=R.parentNode(g);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let m=R.host(p);if(this.mirror.getId(m)!==-1){l=c;break}}}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}o=l.previous,r.removeNode(l.value),n(l.value)}let a={texts:this.texts.map(l=>{let u=l.node,c=R.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:l.value}}).filter(l=>!t.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{let{attributes:u}=l;if(typeof u.style=="string"){let c=JSON.stringify(l.styleDiff),h=JSON.stringify(l._unchangedStyles);c.length<u.style.length&&(c+h).split("var(").length===u.style.split("var(").length&&(u.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:u}}).filter(l=>!t.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:e};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(a))}),b(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));let r=Array.from(R.childNodes(e),i=>R.textContent(i)||"").join("");t.attributes.value=or({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:ar(e),value:r,maskInputFn:this.maskInputFn})}),b(this,"processMutation",e=>{if(!is(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{let t=R.textContent(e.target);!ee(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:io(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,$a(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{let t=e.target,r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){let o=ar(t);i=or({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(ee(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let n=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(n||(n={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e.target,n)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!so(t.tagName,r))if(n.attributes[r]=ro(this.doc,xe(t.tagName),xe(r),i),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let o=this.unattachedDoc.createElement("span");e.oldValue&&o.setAttribute("style",e.oldValue);for(let a of Array.from(t.style)){let l=t.style.getPropertyValue(a),u=t.style.getPropertyPriority(a);l!==o.style.getPropertyValue(a)||u!==o.style.getPropertyPriority(a)?u===""?n.styleDiff[a]=l:n.styleDiff[a]=[l,u]:n._unchangedStyles[a]=[l,u]}for(let a of Array.from(o.style))t.style.getPropertyValue(a)===""&&(n.styleDiff[a]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?n.attributes.rr_open_mode="modal":n.attributes.rr_open_mode="non-modal");break}case"childList":{if(ee(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let r=this.mirror.getId(t),i=at(e.target)?this.mirror.getId(R.host(e.target)):this.mirror.getId(e.target);ee(e.target,this.blockClass,this.blockSelector,!1)||is(t,this.mirror,this.slimDOMOptions)||!Id(t,this.mirror)||(this.addedSet.has(t)?(ei(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||Pa(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[kn(r,i)]?ei(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:at(e.target)&<(e.target)?!0:void 0}),Rd(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),b(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(is(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[kn(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ee(e,this.blockClass,this.blockSelector,!1)||(R.childNodes(e).forEach(r=>this.genAdds(r)),Oe(e)&&R.childNodes(R.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function ei(s,e){s.delete(e),R.childNodes(e).forEach(t=>ei(s,t))}function Rd(s,e){let t=[s];for(;t.length;){let r=t.pop();e.has(r)||(e.add(r),R.childNodes(r).forEach(i=>t.push(i)))}}function $n(s,e,t){return s.size===0?!1:Ad(s,e)}function Ad(s,e,t){let r=R.parentNode(e);return r?s.has(r):!1}function Pn(s,e){return s.size===0?!1:Va(s,e)}function Va(s,e){let t=R.parentNode(e);return t?s.has(t)?!0:Va(s,t):!1}var ht;function Od(s){ht=s}function Dd(){ht=void 0}var D=s=>ht?(...t)=>{try{return s(...t)}catch(r){if(ht&&ht(r)===!0)return;throw r}}:s,De=[];function Nt(s){try{if("composedPath"in s){let e=s.composedPath();if(e.length)return e[0]}else if("path"in s&&s.path.length)return s.path[0]}catch{}return s&&s.target}function Ga(s,e){let t=new qs;De.push(t),t.init(s);let r=new(Da())(D(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function Td({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};let i=typeof e.mousemove=="number"?e.mousemove:50,n=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500,o=[],a,l=Ct(D(h=>{let f=Date.now()-a;s(o.map(g=>(g.timeOffset-=f,g)),h),o=[],a=null}),n),u=D(Ct(D(h=>{let f=Nt(h),{clientX:g,clientY:p}=Ks(h)?h.changedTouches[0]:h;a||(a=Er()),o.push({x:g,y:p,id:r.getId(f),timeOffset:Er()-a}),l(typeof DragEvent<"u"&&h instanceof DragEvent?I.Drag:h instanceof MouseEvent?I.MouseMove:I.TouchMove)}),i,{trailing:!1})),c=[q("mousemove",u,t),q("touchmove",u,t),q("drag",u,t)];return D(()=>{c.forEach(h=>h())})}function _d({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){if(n.mouseInteraction===!1)return()=>{};let o=n.mouseInteraction===!0||n.mouseInteraction===void 0?{}:n.mouseInteraction,a=[],l=null,u=c=>h=>{let f=Nt(h);if(ee(f,r,i,!0))return;let g=null,p=c;if("pointerType"in h){switch(h.pointerType){case"mouse":g=me.Mouse;break;case"touch":g=me.Touch;break;case"pen":g=me.Pen;break}g===me.Touch?_[c]===_.MouseDown?p="TouchStart":_[c]===_.MouseUp&&(p="TouchEnd"):me.Pen}else Ks(h)&&(g=me.Touch);g!==null?(l=g,(p.startsWith("Touch")&&g===me.Touch||p.startsWith("Mouse")&&g===me.Mouse)&&(g=null)):_[c]===_.Click&&(g=l,l=null);let m=Ks(h)?h.changedTouches[0]:h;if(!m)return;let d=t.getId(f),{clientX:y,clientY:S}=m;D(s)({type:_[p],id:d,x:y,y:S,...g!==null&&{pointerType:g}})};return Object.keys(_).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&o[c]!==!1).forEach(c=>{let h=xe(c),f=u(c);if(window.PointerEvent)switch(_[c]){case _.MouseDown:case _.MouseUp:h=h.replace("mouse","pointer");break;case _.TouchStart:case _.TouchEnd:return}a.push(q(h,f,e))}),D(()=>{a.forEach(c=>c())})}function ja({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){let o=D(Ct(D(a=>{let l=Nt(a);if(!l||ee(l,r,i,!0))return;let u=t.getId(l);if(l===e&&e.defaultView){let c=Ta(e.defaultView);s({id:u,x:c.left,y:c.top})}else s({id:u,x:l.scrollLeft,y:l.scrollTop})}),n.scroll||100));return q("scroll",o,e)}function kd({viewportResizeCb:s},{win:e}){let t=-1,r=-1,i=D(Ct(D(()=>{let n=_a(),o=ka();(t!==n||r!==o)&&(s({width:Number(o),height:Number(n)}),t=n,r=o)}),200));return q("resize",i,e)}var $d=["INPUT","TEXTAREA","SELECT"],Ln=new WeakMap;function Pd({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:n,ignoreSelector:o,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function h(S){let w=Nt(S),v=S.isTrusted,x=w&&w.tagName;if(w&&x==="OPTION"&&(w=R.parentElement(w)),!w||!x||$d.indexOf(x)<0||ee(w,r,i,!0)||w.classList.contains(n)||o&&w.matches(o))return;let N=w.value,B=!1,F=ar(w)||"";F==="radio"||F==="checkbox"?B=w.checked:(a[x.toLowerCase()]||a[F])&&(N=or({element:w,maskInputOptions:a,tagName:x,type:F,value:N,maskInputFn:l})),f(w,c?{text:N,isChecked:B,userTriggered:v}:{text:N,isChecked:B});let Y=w.name;F==="radio"&&Y&&B&&e.querySelectorAll(`input[type="radio"][name="${Y}"]`).forEach(K=>{if(K!==w){let te=K.value;f(K,c?{text:te,isChecked:!B,userTriggered:!1}:{text:te,isChecked:!B})}})}function f(S,w){let v=Ln.get(S);if(!v||v.text!==w.text||v.isChecked!==w.isChecked){Ln.set(S,w);let x=t.getId(S);D(s)({...w,id:x})}}let p=(u.input==="last"?["change"]:["input","change"]).map(S=>q(S,D(h),e)),m=e.defaultView;if(!m)return()=>{p.forEach(S=>S())};let d=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),y=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return d&&d.set&&p.push(...y.map(S=>zr(S[0],S[1],{set(){D(h)({target:this,isTrusted:!1})}},!1,m))),D(()=>{p.forEach(S=>S())})}function Mr(s){let e=[];function t(r,i){if(Kt("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Kt("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Kt("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Kt("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let o=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(o)}else if(r.parentStyleSheet){let o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(o)}return i}return t(s,e)}function Ce(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function Ld({styleSheetRuleCb:s,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:D((c,h,f)=>{let[g,p]=f,{id:m,styleId:d}=Ce(h,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,adds:[{rule:g,index:p}]}),c.apply(h,f)})}),r.CSSStyleSheet.prototype.addRule=function(c,h,f=this.cssRules.length){let g=`${c} { ${h} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[g,f])};let n=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(n,{apply:D((c,h,f)=>{let[g]=f,{id:p,styleId:m}=Ce(h,e,t.styleMirror);return(p&&p!==-1||m&&m!==-1)&&s({id:p,styleId:m,removes:[{index:g}]}),c.apply(h,f)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:D((c,h,f)=>{let[g]=f,{id:p,styleId:m}=Ce(h,e,t.styleMirror);return(p&&p!==-1||m&&m!==-1)&&s({id:p,styleId:m,replace:g}),c.apply(h,f)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:D((c,h,f)=>{let[g]=f,{id:p,styleId:m}=Ce(h,e,t.styleMirror);return(p&&p!==-1||m&&m!==-1)&&s({id:p,styleId:m,replaceSync:g}),c.apply(h,f)})}));let l={};Qt("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(Qt("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),Qt("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),Qt("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));let u={};return Object.entries(l).forEach(([c,h])=>{u[c]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(u[c].insertRule,{apply:D((f,g,p)=>{let[m,d]=p,{id:y,styleId:S}=Ce(g.parentStyleSheet,e,t.styleMirror);return(y&&y!==-1||S&&S!==-1)&&s({id:y,styleId:S,adds:[{rule:m,index:[...Mr(g),d||0]}]}),f.apply(g,p)})}),h.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:D((f,g,p)=>{let[m]=p,{id:d,styleId:y}=Ce(g.parentStyleSheet,e,t.styleMirror);return(d&&d!==-1||y&&y!==-1)&&s({id:d,styleId:y,removes:[{index:[...Mr(g),m]}]}),f.apply(g,p)})})}),D(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=n,o&&(r.CSSStyleSheet.prototype.replace=o),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([c,h])=>{h.prototype.insertRule=u[c].insertRule,h.prototype.deleteRule=u[c].deleteRule})})}function Ya({mirror:s,stylesheetManager:e},t){var r,i,n;let o=null;t.nodeName==="#document"?o=s.getId(t):o=s.getId(R.host(t));let a=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(n=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:n.ShadowRoot,l=a?.prototype?Object.getOwnPropertyDescriptor(a?.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!a||!l?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var u;return(u=l.get)==null?void 0:u.call(this)},set(u){var c;let h=(c=l.set)==null?void 0:c.call(this,u);if(o!==null&&o!==-1)try{e.adoptStyleSheets(u,o)}catch{}return h}}),D(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function Fd({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){let n=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(n,{apply:D((a,l,u)=>{var c;let[h,f,g]=u;if(t.has(h))return n.apply(l,[h,f,g]);let{id:p,styleId:m}=Ce((c=l.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(p&&p!==-1||m&&m!==-1)&&s({id:p,styleId:m,set:{property:h,value:f,priority:g},index:Mr(l.parentRule)}),a.apply(l,u)})});let o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:D((a,l,u)=>{var c;let[h]=u;if(t.has(h))return o.apply(l,[h]);let{id:f,styleId:g}=Ce((c=l.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(f&&f!==-1||g&&g!==-1)&&s({id:f,styleId:g,remove:{property:h},index:Mr(l.parentRule)}),a.apply(l,u)})}),D(()=>{i.CSSStyleDeclaration.prototype.setProperty=n,i.CSSStyleDeclaration.prototype.removeProperty=o})}function Ud({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:n}){let o=D(l=>Ct(D(u=>{let c=Nt(u);if(!c||ee(c,e,t,!0))return;let{currentTime:h,volume:f,muted:g,playbackRate:p,loop:m}=c;s({type:l,id:r.getId(c),currentTime:h,volume:f,muted:g,playbackRate:p,loop:m})}),i.media||500)),a=[q("play",o(Ie.Play),n),q("pause",o(Ie.Pause),n),q("seeked",o(Ie.Seeked),n),q("volumechange",o(Ie.VolumeChange),n),q("ratechange",o(Ie.RateChange),n)];return D(()=>{a.forEach(l=>l())})}function Bd({fontCb:s,doc:e}){let t=e.defaultView;if(!t)return()=>{};let r=[],i=new WeakMap,n=t.FontFace;t.FontFace=function(l,u,c){let h=new n(l,u,c);return i.set(h,{family:l,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),h};let o=ke(e.fonts,"add",function(a){return function(l){return setTimeout(D(()=>{let u=i.get(l);u&&(s(u),i.delete(l))}),0),a.apply(this,[l])}});return r.push(()=>{t.FontFace=n}),r.push(o),D(()=>{r.forEach(a=>a())})}function Wd(s){let{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:n}=s,o=!0,a=D(()=>{let l=e.getSelection();if(!l||o&&l?.isCollapsed)return;o=l.isCollapsed||!1;let u=[],c=l.rangeCount||0;for(let h=0;h<c;h++){let f=l.getRangeAt(h),{startContainer:g,startOffset:p,endContainer:m,endOffset:d}=f;ee(g,r,i,!0)||ee(m,r,i,!0)||u.push({start:t.getId(g),startOffset:p,end:t.getId(m),endOffset:d})}n({ranges:u})});return a(),q("selectionchange",a)}function zd({doc:s,customElementCb:e}){let t=s.defaultView;return!t||!t.customElements?()=>{}:ke(t.customElements,"define",function(i){return function(n,o,a){try{e({define:{name:n}})}catch{console.warn(`Custom element callback failed for ${n}`)}return i.apply(this,[n,o,a])}})}function Vd(s,e){let{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:n,viewportResizeCb:o,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,fontCb:f,selectionCb:g,customElementCb:p}=s;s.mutationCb=(...m)=>{e.mutation&&e.mutation(...m),t(...m)},s.mousemoveCb=(...m)=>{e.mousemove&&e.mousemove(...m),r(...m)},s.mouseInteractionCb=(...m)=>{e.mouseInteraction&&e.mouseInteraction(...m),i(...m)},s.scrollCb=(...m)=>{e.scroll&&e.scroll(...m),n(...m)},s.viewportResizeCb=(...m)=>{e.viewportResize&&e.viewportResize(...m),o(...m)},s.inputCb=(...m)=>{e.input&&e.input(...m),a(...m)},s.mediaInteractionCb=(...m)=>{e.mediaInteaction&&e.mediaInteaction(...m),l(...m)},s.styleSheetRuleCb=(...m)=>{e.styleSheetRule&&e.styleSheetRule(...m),u(...m)},s.styleDeclarationCb=(...m)=>{e.styleDeclaration&&e.styleDeclaration(...m),c(...m)},s.canvasMutationCb=(...m)=>{e.canvasMutation&&e.canvasMutation(...m),h(...m)},s.fontCb=(...m)=>{e.font&&e.font(...m),f(...m)},s.selectionCb=(...m)=>{e.selection&&e.selection(...m),g(...m)},s.customElementCb=(...m)=>{e.customElement&&e.customElement(...m),p(...m)}}function Gd(s,e={}){let t=s.doc.defaultView;if(!t)return()=>{};Vd(s,e);let r;s.recordDOM&&(r=Ga(s,s.doc));let i=Td(s),n=_d(s),o=ja(s),a=kd(s,{win:t}),l=Pd(s),u=Ud(s),c=()=>{},h=()=>{},f=()=>{},g=()=>{};s.recordDOM&&(c=Ld(s,{win:t}),h=Ya(s,s.doc),f=Fd(s,{win:t}),s.collectFonts&&(g=Bd(s)));let p=Wd(s),m=zd(s),d=[];for(let y of s.plugins)d.push(y.observer(y.callback,t,y.options));return D(()=>{De.forEach(y=>y.reset()),r?.disconnect(),i(),n(),o(),a(),l(),u(),c(),h(),f(),g(),p(),m(),d.forEach(y=>y())})}function Kt(s){return typeof window[s]<"u"}function Qt(s){return!!(typeof window[s]<"u"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}var Nr=class{constructor(e){b(this,"iframeIdToRemoteIdMap",new WeakMap),b(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){let n=r||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e),a=n.get(t);return a||(a=this.generateIdFn(),n.set(t,a),o.set(a,t)),a}getIds(e,t){let r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(n=>this.getId(e,n,r,i))}getRemoteId(e,t,r){let i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;let n=i.get(t);return n||-1}getRemoteIds(e,t){let r=this.getRemoteIdToIdMap(e);return t.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}},ti=class{constructor(e){b(this,"iframes",new WeakMap),b(this,"crossOriginIframeMap",new WeakMap),b(this,"crossOriginIframeMirror",new Nr(to)),b(this,"crossOriginIframeStyleMirror"),b(this,"crossOriginIframeRootIdMap",new WeakMap),b(this,"mirror"),b(this,"mutationCb"),b(this,"wrappedEmit"),b(this,"loadListener"),b(this,"stylesheetManager"),b(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Nr(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){let t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;let i=this.crossOriginIframeMap.get(e.source);if(!i)return;let n=this.transformCrossOriginEvent(i,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case E.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:E.IncrementalSnapshot,data:{source:I.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case E.Meta:case E.Load:case E.DomContentLoaded:return!1;case E.Plugin:return t;case E.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case E.IncrementalSnapshot:switch(t.data.source){case I.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(i.node,n)}),t.data.removes.forEach(i=>{this.replaceIds(i,e,["parentId","id"])}),t.data.attributes.forEach(i=>{this.replaceIds(i,e,["id"])}),t.data.texts.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case I.Drag:case I.TouchMove:case I.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case I.ViewportResize:return!1;case I.MediaInteraction:case I.MouseInteraction:case I.Scroll:case I.CanvasMutation:case I.Input:return this.replaceIds(t.data,e,["id"]),t;case I.StyleSheetRule:case I.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case I.Font:return t;case I.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case I.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,e,["styleId"])}),t}}return!1}replace(e,t,r,i){for(let n of i)!Array.isArray(t[n])&&typeof t[n]!="number"||(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):t[n]=e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==ge.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}},ri=class{constructor(e){b(this,"shadowDoms",new WeakSet),b(this,"mutationCb"),b(this,"scrollCb"),b(this,"bypassOptions"),b(this,"mirror"),b(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!lt(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);let r=Ga({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(ja({...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(R.host(e))),this.restoreHandlers.push(Ya({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){let r=this;this.restoreHandlers.push(ke(e.prototype,"attachShadow",function(i){return function(n){let o=i.call(this,n),a=R.shadowRoot(this);return a&&za(this)&&r.addShadowRoot(a,t),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ot=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(it=0;it<ze.length;it++)ot[ze.charCodeAt(it)]=it;var it,jd=function(s){var e=new Uint8Array(s),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=ze[e[t]>>2],i+=ze[(e[t]&3)<<4|e[t+1]>>4],i+=ze[(e[t+1]&15)<<2|e[t+2]>>6],i+=ze[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i},Yd=function(s){var e=s.length*.75,t=s.length,r,i=0,n,o,a,l;s[s.length-1]==="="&&(e--,s[s.length-2]==="="&&e--);var u=new ArrayBuffer(e),c=new Uint8Array(u);for(r=0;r<t;r+=4)n=ot[s.charCodeAt(r)],o=ot[s.charCodeAt(r+1)],a=ot[s.charCodeAt(r+2)],l=ot[s.charCodeAt(r+3)],c[i++]=n<<2|o>>4,c[i++]=(o&15)<<4|a>>2,c[i++]=(a&3)<<6|l&63;return u},Fn=new Map;function Hd(s,e){let t=Fn.get(s);return t||(t=new Map,Fn.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}var Ha=(s,e,t)=>{if(!s||!(Xa(s,e)||typeof s=="object"))return;let r=s.constructor.name,i=Hd(t,r),n=i.indexOf(s);return n===-1&&(n=i.length,i.push(s)),n};function ir(s,e,t){if(s instanceof Array)return s.map(r=>ir(r,e,t));if(s===null)return s;if(s instanceof Float32Array||s instanceof Float64Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Uint8Array||s instanceof Uint16Array||s instanceof Int16Array||s instanceof Int8Array||s instanceof Uint8ClampedArray)return{rr_type:s.constructor.name,args:[Object.values(s)]};if(s instanceof ArrayBuffer){let r=s.constructor.name,i=jd(s);return{rr_type:r,base64:i}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[ir(s.buffer,e,t),s.byteOffset,s.byteLength]};if(s instanceof HTMLImageElement){let r=s.constructor.name,{src:i}=s;return{rr_type:r,src:i}}else if(s instanceof HTMLCanvasElement){let r="HTMLImageElement",i=s.toDataURL();return{rr_type:r,src:i}}else{if(s instanceof ImageData)return{rr_type:s.constructor.name,args:[ir(s.data,e,t),s.width,s.height]};if(Xa(s,e)||typeof s=="object"){let r=s.constructor.name,i=Ha(s,e,t);return{rr_type:r,index:i}}}}return s}var Za=(s,e,t)=>s.map(r=>ir(r,e,t)),Xa=(s,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>s instanceof e[i]);function Zd(s,e,t,r){let i=[],n=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(let o of n)try{if(typeof e.CanvasRenderingContext2D.prototype[o]!="function")continue;let a=ke(e.CanvasRenderingContext2D.prototype,o,function(l){return function(...u){return ee(this.canvas,t,r,!0)||setTimeout(()=>{let c=Za(u,e,this);s(this.canvas,{type:be["2D"],property:o,args:c})},0),l.apply(this,u)}});i.push(a)}catch{let a=zr(e.CanvasRenderingContext2D.prototype,o,{set(l){s(this.canvas,{type:be["2D"],property:o,args:[l],setter:!0})}});i.push(a)}return()=>{i.forEach(o=>o())}}function Xd(s){return s==="experimental-webgl"?"webgl":s}function Un(s,e,t,r){let i=[];try{let n=ke(s.HTMLCanvasElement.prototype,"getContext",function(o){return function(a,...l){if(!ee(this,e,t,!0)){let u=Xd(a);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(l[0]&&typeof l[0]=="object"){let c=l[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return o.apply(this,[a,...l])}});i.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(n=>n())}}function Bn(s,e,t,r,i,n){let o=[],a=Object.getOwnPropertyNames(s);for(let l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof s[l]!="function")continue;let u=ke(s,l,function(c){return function(...h){let f=c.apply(this,h);if(Ha(f,n,this),"tagName"in this.canvas&&!ee(this.canvas,r,i,!0)){let g=Za(h,n,this),p={type:e,property:l,args:g};t(this.canvas,p)}return f}});o.push(u)}catch{let u=zr(s,l,{set(c){t(this.canvas,{type:e,property:l,args:[c],setter:!0})}});o.push(u)}return o}function Jd(s,e,t,r){let i=[];return i.push(...Bn(e.WebGLRenderingContext.prototype,be.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext<"u"&&i.push(...Bn(e.WebGL2RenderingContext.prototype,be.WebGL2,s,t,r,e)),()=>{i.forEach(n=>n())}}var Ja="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Kd=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),Wn=typeof window<"u"&&window.Blob&&new Blob([Kd(Ja)],{type:"text/javascript;charset=utf-8"});function Qd(s){let e;try{if(e=Wn&&(window.URL||window.webkitURL).createObjectURL(Wn),!e)throw"";let t=new Worker(e,{name:s?.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch{return new Worker("data:text/javascript;base64,"+Ja,{name:s?.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}var si=class{constructor(e){b(this,"pendingCanvasMutations",new Map),b(this,"rafStamps",{latestId:0,invokeId:null}),b(this,"mirror"),b(this,"mutationCb"),b(this,"resetObservers"),b(this,"frozen",!1),b(this,"locked",!1),b(this,"processMutation",(l,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(u)});let{sampling:t="all",win:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&t==="all"&&this.initCanvasMutationObserver(r,i,n),o&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,i,n,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,i,n){let o=Un(t,r,i,!0),a=new Map,l=new Qd;l.onmessage=p=>{let{id:m}=p.data;if(a.set(m,!1),!("base64"in p.data))return;let{base64:d,type:y,width:S,height:w}=p.data;this.mutationCb({id:m,type:be["2D"],commands:[{property:"clearRect",args:[0,0,S,w]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:d}],type:y}]},0,0]}]})};let u=1e3/e,c=0,h,f=()=>{let p=[];return t.document.querySelectorAll("canvas").forEach(m=>{ee(m,r,i,!0)||p.push(m)}),p},g=p=>{if(c&&p-c<u){h=requestAnimationFrame(g);return}c=p,f().forEach(async m=>{var d;let y=this.mirror.getId(m);if(a.get(y)||m.width===0||m.height===0)return;if(a.set(y,!0),["webgl","webgl2"].includes(m.__context)){let w=m.getContext(m.__context);((d=w?.getContextAttributes())==null?void 0:d.preserveDrawingBuffer)===!1&&w.clear(w.COLOR_BUFFER_BIT)}let S=await createImageBitmap(m);l.postMessage({id:y,bitmap:S,width:m.width,height:m.height,dataURLOptions:n.dataURLOptions},[S])}),h=requestAnimationFrame(g)};h=requestAnimationFrame(g),this.resetObservers=()=>{o(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=Un(e,t,r,!1),n=Zd(this.processMutation.bind(this),e,t,r),o=Jd(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(e);if(!r||t===-1)return;let i=r.map(o=>{let{type:a,...l}=o;return l}),{type:n}=r[0];this.mutationCb({id:t,type:n,commands:i}),this.pendingCanvasMutations.delete(e)}},ii=class{constructor(e){b(this,"trackedLinkElements",new WeakSet),b(this,"mutationCb"),b(this,"adoptedStyleSheetCb"),b(this,"styleMirror",new xr),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;let r={id:t,styleIds:[]},i=[];for(let n of e){let o;this.styleMirror.has(n)?o=this.styleMirror.getId(n):(o=this.styleMirror.add(n),i.push({styleId:o,rules:Array.from(n.rules||CSSRule,(a,l)=>({rule:qn(a,n.href),index:l}))})),r.styleIds.push(o)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},ni=class{constructor(){b(this,"nodeMap",new WeakMap),b(this,"active",!1)}inOtherBuffer(e,t){let r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},J,nr,ns,Rr=!1;try{if(Array.from([1],s=>s*2)[0]!==2){let s=document.createElement("iframe");document.body.appendChild(s),Array.from=((Fi=s.contentWindow)==null?void 0:Fi.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}var le=eo();function $e(s={}){let{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:n=null,ignoreClass:o="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:f,slimDOMOptions:g,maskInputFn:p,maskTextFn:m,hooks:d,packFn:y,sampling:S={},dataURLOptions:w={},mousemoveWait:v,recordDOM:x=!0,recordCanvas:N=!1,recordCrossOriginIframes:B=!1,recordAfter:F=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",userTriggeredOnInput:Y=!1,collectFonts:K=!1,inlineImages:te=!1,plugins:re,keepIframeSrcFn:A=()=>!1,ignoreCSSAttributes:Me=new Set([]),errorHandler:Ne}=s;Od(Ne);let H=B?window.parent===window:!0,$=!1;if(!H)try{window.parent.document&&($=!1)}catch{$=!0}if(H&&!e)throw new Error("emit function is required");if(!H&&!$)return()=>{};v!==void 0&&S.mousemove===void 0&&(S.mousemove=v),le.reset();let oe=h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:f!==void 0?f:{password:!0},se=no(g);La();let qe,Vr=0,$i=k=>{for(let ae of re||[])ae.eventProcessor&&(k=ae.eventProcessor(k));return y&&!$&&(k=y(k)),k};J=(k,ae)=>{var Z;let X=k;if(X.timestamp=Er(),(Z=De[0])!=null&&Z.isFrozen()&&X.type!==E.FullSnapshot&&!(X.type===E.IncrementalSnapshot&&X.data.source===I.Mutation)&&De.forEach(ie=>ie.unfreeze()),H)e?.($i(X),ae);else if($){let ie={type:"rrweb",event:$i(X),origin:window.location.origin,isCheckout:ae};window.parent.postMessage(ie,"*")}if(X.type===E.FullSnapshot)qe=X,Vr=0;else if(X.type===E.IncrementalSnapshot){if(X.data.source===I.Mutation&&X.data.isAttachIframe)return;Vr++;let ie=r&&Vr>=r,U=t&&X.timestamp-qe.timestamp>t;(ie||U)&&nr(!0)}};let Rt=k=>{J({type:E.IncrementalSnapshot,data:{source:I.Mutation,...k}})},Pi=k=>J({type:E.IncrementalSnapshot,data:{source:I.Scroll,...k}}),Li=k=>J({type:E.IncrementalSnapshot,data:{source:I.CanvasMutation,...k}}),sl=k=>J({type:E.IncrementalSnapshot,data:{source:I.AdoptedStyleSheet,...k}}),Re=new ii({mutationCb:Rt,adoptedStyleSheetCb:sl}),Ae=new ti({mirror:le,mutationCb:Rt,stylesheetManager:Re,recordCrossOriginIframes:B,wrappedEmit:J});for(let k of re||[])k.getMirror&&k.getMirror({nodeMirror:le,crossOriginIframeMirror:Ae.crossOriginIframeMirror,crossOriginIframeStyleMirror:Ae.crossOriginIframeStyleMirror});let Gr=new ni;ns=new si({recordCanvas:N,mutationCb:Li,win:window,blockClass:i,blockSelector:n,mirror:le,sampling:S.canvas,dataURLOptions:w});let At=new ri({mutationCb:Rt,scrollCb:Pi,bypassOptions:{blockClass:i,blockSelector:n,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:oe,dataURLOptions:w,maskTextFn:m,maskInputFn:p,recordCanvas:N,inlineImages:te,sampling:S,slimDOMOptions:se,iframeManager:Ae,stylesheetManager:Re,canvasManager:ns,keepIframeSrcFn:A,processedNodeManager:Gr},mirror:le});nr=(k=!1)=>{if(!x)return;J({type:E.Meta,data:{href:window.location.href,width:ka(),height:_a()}},k),Re.reset(),At.init(),De.forEach(Z=>Z.lock());let ae=Ql(document,{mirror:le,blockClass:i,blockSelector:n,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:oe,maskTextFn:m,maskInputFn:p,slimDOM:se,dataURLOptions:w,recordCanvas:N,inlineImages:te,onSerialize:Z=>{ct(Z,le)&&Ae.addIframe(Z),Ua(Z,le)&&Re.trackLinkElement(Z),Oe(Z)&&At.addShadowRoot(R.shadowRoot(Z),document)},onIframeLoad:(Z,X)=>{Ae.attachIframe(Z,X),At.observeAttachShadow(Z)},onStylesheetLoad:(Z,X)=>{Re.attachLinkElement(Z,X)},keepIframeSrcFn:A});if(!ae)return console.warn("Failed to snapshot the document");J({type:E.FullSnapshot,data:{node:ae,initialOffset:Ta(window)}},k),De.forEach(Z=>Z.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Re.adoptStyleSheets(document.adoptedStyleSheets,le.getId(document))};try{let k=[],ae=X=>{var ie;return D(Gd)({mutationCb:Rt,mousemoveCb:(U,jr)=>J({type:E.IncrementalSnapshot,data:{source:jr,positions:U}}),mouseInteractionCb:U=>J({type:E.IncrementalSnapshot,data:{source:I.MouseInteraction,...U}}),scrollCb:Pi,viewportResizeCb:U=>J({type:E.IncrementalSnapshot,data:{source:I.ViewportResize,...U}}),inputCb:U=>J({type:E.IncrementalSnapshot,data:{source:I.Input,...U}}),mediaInteractionCb:U=>J({type:E.IncrementalSnapshot,data:{source:I.MediaInteraction,...U}}),styleSheetRuleCb:U=>J({type:E.IncrementalSnapshot,data:{source:I.StyleSheetRule,...U}}),styleDeclarationCb:U=>J({type:E.IncrementalSnapshot,data:{source:I.StyleDeclaration,...U}}),canvasMutationCb:Li,fontCb:U=>J({type:E.IncrementalSnapshot,data:{source:I.Font,...U}}),selectionCb:U=>{J({type:E.IncrementalSnapshot,data:{source:I.Selection,...U}})},customElementCb:U=>{J({type:E.IncrementalSnapshot,data:{source:I.CustomElement,...U}})},blockClass:i,ignoreClass:o,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:oe,inlineStylesheet:c,sampling:S,recordDOM:x,recordCanvas:N,inlineImages:te,userTriggeredOnInput:Y,collectFonts:K,doc:X,maskInputFn:p,maskTextFn:m,keepIframeSrcFn:A,blockSelector:n,slimDOMOptions:se,dataURLOptions:w,mirror:le,iframeManager:Ae,stylesheetManager:Re,shadowDomManager:At,processedNodeManager:Gr,canvasManager:ns,ignoreCSSAttributes:Me,plugins:((ie=re?.filter(U=>U.observer))==null?void 0:ie.map(U=>({observer:U.observer,options:U.options,callback:jr=>J({type:E.Plugin,data:{plugin:U.name,payload:jr}})})))||[]},d)};Ae.addLoadListener(X=>{try{k.push(ae(X.contentDocument))}catch(ie){console.warn(ie)}});let Z=()=>{nr(),k.push(ae(document)),Rr=!0};return["interactive","complete"].includes(document.readyState)?Z():(k.push(q("DOMContentLoaded",()=>{J({type:E.DomContentLoaded,data:{}}),F==="DOMContentLoaded"&&Z()})),k.push(q("load",()=>{J({type:E.Load,data:{}}),F==="load"&&Z()},window))),()=>{k.forEach(X=>{try{X()}catch(ie){String(ie).toLowerCase().includes("cross-origin")||console.warn(ie)}}),Gr.destroy(),Rr=!1,Dd()}}catch(k){console.warn(k)}}$e.addCustomEvent=(s,e)=>{if(!Rr)throw new Error("please add custom event after start recording");J({type:E.Custom,data:{tag:s,payload:e}})};$e.freezePage=()=>{De.forEach(s=>s.freeze())};$e.takeFullSnapshot=s=>{if(!Rr)throw new Error("please take full snapshot after start recording");nr(s)};$e.mirror=le;function Ka(s){return{all:s=s||new Map,on:function(e,t){var r=s.get(e);r?r.push(t):s.set(e,[t])},off:function(e,t){var r=s.get(e);r&&(t?r.splice(r.indexOf(t)>>>0,1):s.set(e,[]))},emit:function(e,t){var r=s.get(e);r&&r.slice().map(function(i){i(t)}),(r=s.get("*"))&&r.slice().map(function(i){i(e,t)})}}}var qd=Object.freeze(Object.defineProperty({__proto__:null,default:Ka},Symbol.toStringTag,{value:"Module"}));function ep(s=window,e=document){if("scrollBehavior"in e.documentElement.style&&s.__forceSmoothScrollPolyfill__!==!0)return;let t=s.HTMLElement||s.Element,r=468,i={scroll:s.scroll||s.scrollTo,scrollBy:s.scrollBy,elementScroll:t.prototype.scroll||l,scrollIntoView:t.prototype.scrollIntoView},n=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now;function o(y){let S=["MSIE ","Trident/","Edge/"];return new RegExp(S.join("|")).test(y)}let a=o(s.navigator.userAgent)?1:0;function l(y,S){this.scrollLeft=y,this.scrollTop=S}function u(y){return .5*(1-Math.cos(Math.PI*y))}function c(y){if(y===null||typeof y!="object"||y.behavior===void 0||y.behavior==="auto"||y.behavior==="instant")return!0;if(typeof y=="object"&&y.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+y.behavior+" is not a valid value for enumeration ScrollBehavior.")}function h(y,S){if(S==="Y")return y.clientHeight+a<y.scrollHeight;if(S==="X")return y.clientWidth+a<y.scrollWidth}function f(y,S){let w=s.getComputedStyle(y,null)["overflow"+S];return w==="auto"||w==="scroll"}function g(y){let S=h(y,"Y")&&f(y,"Y"),w=h(y,"X")&&f(y,"X");return S||w}function p(y){for(;y!==e.body&&g(y)===!1;)y=y.parentNode||y.host;return y}function m(y){let S=n(),w,v,x,N=(S-y.startTime)/r;N=N>1?1:N,w=u(N),v=y.startX+(y.x-y.startX)*w,x=y.startY+(y.y-y.startY)*w,y.method.call(y.scrollable,v,x),(v!==y.x||x!==y.y)&&s.requestAnimationFrame(m.bind(s,y))}function d(y,S,w){let v,x,N,B,F=n();y===e.body?(v=s,x=s.scrollX||s.pageXOffset,N=s.scrollY||s.pageYOffset,B=i.scroll):(v=y,x=y.scrollLeft,N=y.scrollTop,B=l),m({scrollable:v,method:B,startTime:F,startX:x,startY:N,x:S,y:w})}s.scroll=s.scrollTo=function(){if(arguments[0]!==void 0){if(c(arguments[0])===!0){i.scroll.call(s,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:s.scrollX||s.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:s.scrollY||s.pageYOffset);return}d.call(s,e.body,arguments[0].left!==void 0?~~arguments[0].left:s.scrollX||s.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:s.scrollY||s.pageYOffset)}},s.scrollBy=function(){if(arguments[0]!==void 0){if(c(arguments[0])){i.scrollBy.call(s,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}d.call(s,e.body,~~arguments[0].left+(s.scrollX||s.pageXOffset),~~arguments[0].top+(s.scrollY||s.pageYOffset))}},t.prototype.scroll=t.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(c(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}let y=arguments[0].left,S=arguments[0].top;d.call(this,this,typeof y>"u"?this.scrollLeft:~~y,typeof S>"u"?this.scrollTop:~~S)},t.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(c(arguments[0])===!0){i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},t.prototype.scrollIntoView=function(){if(c(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}let y=p(this),S=y.getBoundingClientRect(),w=this.getBoundingClientRect();y!==e.body?(d.call(this,y,y.scrollLeft+w.left-S.left,y.scrollTop+w.top-S.top),s.getComputedStyle(y).position!=="fixed"&&s.scrollBy({left:S.left,top:S.top,behavior:"smooth"})):s.scrollBy({left:w.left,top:w.top,behavior:"smooth"})}}var oi=class{constructor(e=[],t){b(this,"timeOffset",0),b(this,"speed"),b(this,"actions"),b(this,"raf",null),b(this,"lastTimestamp"),this.actions=e,this.speed=t.speed}addAction(e){let t=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{let r=this.findActionIndex(e);this.actions.splice(r,0,e)}t&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){let e=performance.now();for(this.timeOffset+=(e-this.lastTimestamp)*this.speed,this.lastTimestamp=e;this.actions.length;){let t=this.actions[0];if(this.timeOffset>=t.delay)this.actions.shift(),t.doAction();else break}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(this.raf!==!0&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return this.raf!==null}findActionIndex(e){let t=0,r=this.actions.length-1;for(;t<=r;){let i=Math.floor((t+r)/2);if(this.actions[i].delay<e.delay)t=i+1;else if(this.actions[i].delay>e.delay)r=i-1;else return i+1}return t}};function zn(s,e){if(s.type===E.IncrementalSnapshot&&s.data.source===I.MouseMove&&s.data.positions&&s.data.positions.length){let t=s.data.positions[0].timeOffset,r=s.timestamp+t;return s.delay=r-e,r-e}return s.delay=s.timestamp-e,s.delay}function Vn(s,e){var t=typeof Symbol=="function"&&s[Symbol.iterator];if(!t)return s;var r,i,n=t.call(s),o=[];try{for(;(e===void 0||e-- >0)&&!(r=n.next()).done;)o.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(i)throw i.error}}return o}var Ve;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(Ve||(Ve={}));var Qa={type:"xstate.init"};function os(s){return s===void 0?[]:[].concat(s)}function Ue(s){return{type:"xstate.assign",assignment:s}}function Gn(s,e){return typeof(s=typeof s=="string"&&e&&e[s]?e[s]:s)=="string"?{type:s}:typeof s=="function"?{type:s.name,exec:s}:s}function Ar(s){return function(e){return s===e}}function qa(s){return typeof s=="string"?{type:s}:s}function jn(s,e){return{value:s,context:e,actions:[],changed:!1,matches:Ar(s)}}function Yn(s,e,t){var r=e,i=!1;return[s.filter(function(n){if(n.type==="xstate.assign"){i=!0;var o=Object.assign({},r);return typeof n.assignment=="function"?o=n.assignment(r,t):Object.keys(n.assignment).forEach(function(a){o[a]=typeof n.assignment[a]=="function"?n.assignment[a](r,t):n.assignment[a]}),r=o,!1}return!0}),r,i]}function el(s,e){e===void 0&&(e={});var t=Vn(Yn(os(s.states[s.initial].entry).map(function(o){return Gn(o,e.actions)}),s.context,Qa),2),r=t[0],i=t[1],n={config:s,_options:e,initialState:{value:s.initial,actions:r,context:i,matches:Ar(s.initial)},transition:function(o,a){var l,u,c=typeof o=="string"?{value:o,context:s.context}:o,h=c.value,f=c.context,g=qa(a),p=s.states[h];if(p.on){var m=os(p.on[g.type]);try{for(var d=(function($){var oe=typeof Symbol=="function"&&Symbol.iterator,se=oe&&$[oe],qe=0;if(se)return se.call($);if($&&typeof $.length=="number")return{next:function(){return $&&qe>=$.length&&($=void 0),{value:$&&$[qe++],done:!$}}};throw new TypeError(oe?"Object is not iterable.":"Symbol.iterator is not defined.")})(m),y=d.next();!y.done;y=d.next()){var S=y.value;if(S===void 0)return jn(h,f);var w=typeof S=="string"?{target:S}:S,v=w.target,x=w.actions,N=x===void 0?[]:x,B=w.cond,F=B===void 0?function(){return!0}:B,Y=v===void 0,K=v??h,te=s.states[K];if(F(f,g)){var re=Vn(Yn((Y?os(N):[].concat(p.exit,N,te.entry).filter(function($){return $})).map(function($){return Gn($,n._options.actions)}),f,g),3),A=re[0],Me=re[1],Ne=re[2],H=v??h;return{value:H,context:Me,actions:A,changed:v!==h||A.length>0||Ne,matches:Ar(H)}}}}catch($){l={error:$}}finally{try{y&&!y.done&&(u=d.return)&&u.call(d)}finally{if(l)throw l.error}}}return jn(h,f)}};return n}var Hn=function(s,e){return s.actions.forEach(function(t){var r=t.exec;return r&&r(s.context,e)})};function tl(s){var e=s.initialState,t=Ve.NotStarted,r=new Set,i={_machine:s,send:function(n){t===Ve.Running&&(e=s.transition(e,n),Hn(e,qa(n)),r.forEach(function(o){return o(e)}))},subscribe:function(n){return r.add(n),n(e),{unsubscribe:function(){return r.delete(n)}}},start:function(n){if(n){var o=typeof n=="object"?n:{context:s.config.context,value:n};e={value:o.value,actions:[],context:o.context,matches:Ar(o.value)}}return t=Ve.Running,Hn(e,Qa),i},stop:function(){return t=Ve.Stopped,r.clear(),i},get state(){return e},get status(){return t}};return i}function tp(s,e){for(let t=s.length-1;t>=0;t--){let r=s[t];if(r.type===E.Meta&&r.timestamp<=e)return s.slice(t)}return s}function rp(s,{getCastFn:e,applyEventsSynchronously:t,emitter:r}){let i=el({id:"player",context:s,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:Ue({lastPlayedEvent:(n,o)=>o.type==="CAST_EVENT"?o.payload.event:n.lastPlayedEvent}),recordTimeOffset:Ue((n,o)=>{let a=n.timeOffset;return"payload"in o&&"timeOffset"in o.payload&&(a=o.payload.timeOffset),{...n,timeOffset:a,baselineTime:n.events[0].timestamp+a}}),play(n){var o;let{timer:a,events:l,baselineTime:u,lastPlayedEvent:c}=n;a.clear();for(let p of l)zn(p,u);let h=tp(l,u),f=c?.timestamp;c?.type===E.IncrementalSnapshot&&c.data.source===I.MouseMove&&(f=c.timestamp+((o=c.data.positions[0])==null?void 0:o.timeOffset)),u<(f||0)&&r.emit(T.PlayBack);let g=new Array;for(let p of h)if(!(f&&f<u&&(p.timestamp<=f||p===c)))if(p.timestamp<u)g.push(p);else{let m=e(p,!1);a.addAction({doAction:()=>{m()},delay:p.delay})}t(g),r.emit(T.Flush),a.start()},pause(n){n.timer.clear()},resetLastPlayedEvent:Ue(n=>({...n,lastPlayedEvent:null})),startLive:Ue({baselineTime:(n,o)=>(n.timer.start(),o.type==="TO_LIVE"&&o.payload.baselineTime?o.payload.baselineTime:Date.now())}),addEvent:Ue((n,o)=>{let{baselineTime:a,timer:l,events:u}=n;if(o.type==="ADD_EVENT"){let{event:c}=o.payload;zn(c,a);let h=u.length-1;if(!u[h]||u[h].timestamp<=c.timestamp)u.push(c);else{let p=-1,m=0;for(;m<=h;){let d=Math.floor((m+h)/2);u[d].timestamp<=c.timestamp?m=d+1:h=d-1}p===-1&&(p=m),u.splice(p,0,c)}let f=c.timestamp<a,g=e(c,f);f?g():l.isActive()&&l.addAction({doAction:()=>{g()},delay:c.delay})}return{...n,events:u}})}});return tl(i)}function sp(s){let e=el({id:"speed",context:s,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(t,r)=>{"payload"in r&&t.timer.setSpeed(r.payload.speed)},recordSpeed:Ue({normalSpeed:t=>t.timer.speed}),restoreSpeed:t=>{t.timer.setSpeed(t.normalSpeed)}}});return tl(e)}var ip=s=>[`.${s} { background: currentColor }`,"noscript { display: none !important; }"],Zn=new Map;function rl(s,e){let t=Zn.get(s);return t||(t=new Map,Zn.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}function Ee(s,e,t){return async r=>{if(r&&typeof r=="object"&&"rr_type"in r)if(t&&(t.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){let i=await Ee(s,e,t)(r.args);return await createImageBitmap.apply(null,i)}else if("index"in r){if(t||e===null)return r;let{rr_type:i,index:n}=r;return rl(e,i)[n]}else if("args"in r){let{rr_type:i,args:n}=r,o=window[i];return new o(...await Promise.all(n.map(Ee(s,e,t))))}else{if("base64"in r)return Yd(r.base64);if("src"in r){let i=s.get(r.src);if(i)return i;{let n=new Image;return n.src=r.src,s.set(r.src,n),n}}else if("data"in r&&r.rr_type==="Blob"){let i=await Promise.all(r.data.map(Ee(s,e,t)));return new Blob(i,{type:r.type})}}else if(Array.isArray(r))return await Promise.all(r.map(Ee(s,e,t)));return r}}function np(s,e){try{return e===be.WebGL?s.getContext("webgl")||s.getContext("experimental-webgl"):s.getContext("webgl2")}catch{return null}}var op=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function ap(s,e){if(!e?.constructor)return;let{name:t}=e.constructor;if(!op.includes(t))return;let r=rl(s,t);r.includes(e)||r.push(e)}async function lp({mutation:s,target:e,type:t,imageMap:r,errorHandler:i}){try{let n=np(e,t);if(!n)return;if(s.setter){n[s.property]=s.args[0];return}let o=n[s.property],a=await Promise.all(s.args.map(Ee(r,n))),l=o.apply(n,a);ap(n,l);let u=!1}catch(n){i(s,n)}}async function up({event:s,mutations:e,target:t,imageMap:r,errorHandler:i}){let n=t.getContext("2d");if(!n){i(e[0],new Error("Canvas context is null"));return}let o=e.map(async l=>Promise.all(l.args.map(Ee(r,n))));(await Promise.all(o)).forEach((l,u)=>{let c=e[u];try{if(c.setter){n[c.property]=c.args[0];return}let h=n[c.property];c.property==="drawImage"&&typeof c.args[0]=="string"?(r.get(s),h.apply(n,c.args)):h.apply(n,l)}catch(h){i(c,h)}})}async function Xn({event:s,mutation:e,target:t,imageMap:r,canvasEventMap:i,errorHandler:n}){try{let o=i.get(s)||e,a="commands"in o?o.commands:[o];if([be.WebGL,be.WebGL2].includes(e.type)){for(let l=0;l<a.length;l++){let u=a[l];await lp({mutation:u,type:e.type,target:t,imageMap:r,errorHandler:n})}return}await up({event:s,mutations:a,target:t,imageMap:r,errorHandler:n})}catch(o){n(e,o)}}var ai=class{constructor(e){b(this,"mediaMap",new Map),b(this,"warn"),b(this,"service"),b(this,"speedService"),b(this,"emitter"),b(this,"getCurrentTime"),b(this,"metadataCallbackMap",new Map),this.warn=e.warn,this.service=e.service,this.speedService=e.speedService,this.emitter=e.emitter,this.getCurrentTime=e.getCurrentTime,this.emitter.on(T.Start,this.start.bind(this)),this.emitter.on(T.SkipStart,this.start.bind(this)),this.emitter.on(T.Pause,this.pause.bind(this)),this.emitter.on(T.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach((t,r)=>{this.syncTargetWithState(r),e.pause&&r.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:t,mediaState:r}){if(r.isPlaying){let n=(e-r.lastInteractionTimeOffset)/1e3*r.playbackRate,o="duration"in t&&t.duration;if(Number.isNaN(o)){this.waitForMetadata(t);return}let a=r.currentTimeAtLastInteraction+n;t.loop&&o!==!1&&(a=a%o),t.currentTime=a}else t.pause(),t.currentTime=r.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e)||!("addEventListener"in e))return;let t=()=>{this.metadataCallbackMap.delete(e);let r=this.mediaMap.get(e);r&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:r})};this.metadataCallbackMap.set(e,t),e.addEventListener("loadedmetadata",t,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:t,mutation:r}){let i=this.mediaMap.get(e),{type:n,playbackRate:o,currentTime:a,muted:l,volume:u,loop:c}=r;return{isPlaying:n===Ie.Play||n!==Ie.Pause&&(i?.isPlaying||e.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:a??i?.currentTimeAtLastInteraction??0,lastInteractionTimeOffset:t,playbackRate:o??i?.playbackRate??1,volume:u??i?.volume??1,muted:l??i?.muted??e.getAttribute("muted")===null,loop:c??i?.loop??e.getAttribute("loop")===null}}syncTargetWithState(e){let t=this.mediaMap.get(e);if(!t)return;let{muted:r,loop:i,volume:n,isPlaying:o}=t,a=this.service.state.matches("paused"),l=t.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:e,mediaState:t}),e.volume!==n&&(e.volume=n),e.muted=r,e.loop=i,e.playbackRate!==l&&(e.playbackRate=l),o&&!a?e.play():e.pause()}catch(u){this.warn(`Failed to replay media interactions: ${u.message||u}`)}}addMediaElements(e,t,r){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;let i=e,n=r.getMeta(i);if(!n||!("attributes"in n))return;let o=this.service.state.matches("paused"),a=n.attributes,l=!1;a.rr_mediaState?l=a.rr_mediaState==="played":l=i.getAttribute("autoplay")!==null,l&&o&&i.pause();let u=1;typeof a.rr_mediaPlaybackRate=="number"&&(u=a.rr_mediaPlaybackRate);let c=!1;typeof a.rr_mediaMuted=="boolean"?c=a.rr_mediaMuted:c=i.getAttribute("muted")!==null;let h=!1;typeof a.rr_mediaLoop=="boolean"?h=a.rr_mediaLoop:h=i.getAttribute("loop")!==null;let f=1;typeof a.rr_mediaVolume=="number"&&(f=a.rr_mediaVolume);let g=0;typeof a.rr_mediaCurrentTime=="number"&&(g=a.rr_mediaCurrentTime),this.mediaMap.set(i,{isPlaying:l,currentTimeAtLastInteraction:g,lastInteractionTimeOffset:t,playbackRate:u,volume:f,muted:c,loop:h}),this.syncTargetWithState(i)}mediaMutation({target:e,timeOffset:t,mutation:r}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:t,mutation:r})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return["AUDIO","VIDEO"].includes(e.nodeName)}reset(){this.mediaMap.clear()}};function qt(s,e){if(s.nodeName!=="DIALOG"||s instanceof ue)return;let t=s,r=t.open,i=r&&t.matches("dialog:modal"),n=t.getAttribute("rr_open_mode"),o=typeof e?.attributes.open=="string"||typeof t.getAttribute("open")=="string",a=n==="modal";if(!(r&&!(i&&n==="non-modal"||!i&&a))){if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}r&&t.close(),o&&(a?t.showModal():t.show())}}function cp(s,e){if(s.nodeName!=="DIALOG"||s instanceof ue)return;let t=s;if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}e.attributes.open===null&&(t.removeAttribute("open"),t.removeAttribute("rr_open_mode"))}var hp=5*1e3,fp=Ka||qd,Jn="[replayer]",as={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Kn(s){return s.type==E.IncrementalSnapshot&&(s.data.source==I.TouchMove||s.data.source==I.MouseInteraction&&s.data.type==_.TouchStart)}var Or=class{constructor(e,t){if(b(this,"wrapper"),b(this,"iframe"),b(this,"service"),b(this,"speedService"),b(this,"config"),b(this,"usingVirtualDom",!1),b(this,"virtualDom",new Ke),b(this,"mouse"),b(this,"mouseTail",null),b(this,"tailPositions",[]),b(this,"emitter",fp()),b(this,"nextUserInteractionEvent"),b(this,"legacy_missingNodeRetryMap",{}),b(this,"cache",cn()),b(this,"imageMap",new Map),b(this,"canvasEventMap",new Map),b(this,"mirror",eo()),b(this,"styleMirror",new xr),b(this,"mediaManager"),b(this,"firstFullSnapshot",null),b(this,"newDocumentQueue",[]),b(this,"mousePos",null),b(this,"touchActive",null),b(this,"lastMouseDownEvent",null),b(this,"lastHoveredRootNode"),b(this,"lastSelectionData",null),b(this,"constructedStyleMutations",[]),b(this,"adoptedStyleSheets",[]),b(this,"handleResize",a=>{this.iframe.style.display="inherit";for(let l of[this.mouseTail,this.iframe])l&&(l.setAttribute("width",String(a.width)),l.setAttribute("height",String(a.height)))}),b(this,"applyEventsSynchronously",a=>{for(let l of a){switch(l.type){case E.DomContentLoaded:case E.Load:case E.Custom:continue;case E.FullSnapshot:case E.Meta:case E.Plugin:case E.IncrementalSnapshot:break}this.getCastFn(l,!0)()}}),b(this,"getCastFn",(a,l=!1)=>{let u;switch(a.type){case E.DomContentLoaded:case E.Load:break;case E.Custom:u=()=>{this.emitter.emit(T.CustomEvent,a)};break;case E.Meta:u=()=>this.emitter.emit(T.Resize,{width:a.data.width,height:a.data.height});break;case E.FullSnapshot:u=()=>{var h;if(this.firstFullSnapshot){if(this.firstFullSnapshot===a){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(a,l),(h=this.iframe.contentWindow)==null||h.scrollTo(a.data.initialOffset)};break;case E.IncrementalSnapshot:u=()=>{if(this.applyIncremental(a,l),!l&&(a===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(let h of this.service.state.context.events)if(!(h.timestamp<=a.timestamp)&&this.isUserInteraction(h)){h.delay-a.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=h);break}if(this.nextUserInteractionEvent){let h=this.nextUserInteractionEvent.delay-a.delay,f={speed:Math.min(Math.round(h/hp),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:f}),this.emitter.emit(T.SkipStart,f)}}};break}return()=>{u&&u();for(let f of this.config.plugins||[])f.handler&&f.handler(a,l,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:a}});let h=this.service.state.context.events.length-1;if(!this.config.liveMode&&a===this.service.state.context.events[h]){let f=()=>{h<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(T.Finish))},g=50;a.type===E.IncrementalSnapshot&&a.data.source===I.MouseMove&&a.data.positions.length&&(g+=Math.max(0,-a.data.positions[0].timeOffset)),setTimeout(f,g)}this.emitter.emit(T.EventCast,a)}}),!t?.liveMode&&e.length<2)throw new Error("Replayer need at least 2 events.");let r={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,inactivePeriodThreshold:10*1e3,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:as,useVirtualDom:!0,logger:console};this.config=Object.assign({},r,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(T.Resize,this.handleResize),this.setupDom();for(let a of this.config.plugins||[])a.getMirror&&a.getMirror({nodeMirror:this.mirror});this.emitter.on(T.Flush,()=>{if(this.usingVirtualDom){let a={mirror:this.mirror,applyCanvas:(l,u,c)=>{Xn({event:l,mutation:u,target:c,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(l,u)=>{l.source===I.StyleSheetRule?this.applyStyleSheetRule(l,u):l.source===I.StyleDeclaration&&this.applyStyleDeclaration(l,u)},afterAppend:(l,u)=>{for(let c of this.config.plugins||[])c.onBuild&&c.onBuild(l,{id:u,replayer:this})}};if(this.iframe.contentDocument)try{Cr(this.iframe.contentDocument,this.virtualDom,a,this.virtualDom.mirror)}catch(l){console.warn(l)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(let l in this.legacy_missingNodeRetryMap)try{let u=this.legacy_missingNodeRetryMap[l],c=Ir(u.node,this.mirror,this.virtualDom.mirror);Cr(c,u.node,a,this.virtualDom.mirror),u.node=c}catch(u){this.warn(u)}this.constructedStyleMutations.forEach(l=>{this.applyStyleSheetMutation(l)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(l=>{this.applyAdoptedStyleSheet(l)}),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){let[a,l]=this.lastMouseDownEvent;a.dispatchEvent(l)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(T.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});let i=new oi([],{speed:this.config.speed});this.service=rp({events:e.map(a=>t&&t.unpackFn?t.unpackFn(a):a).sort((a,l)=>a.timestamp-l.timestamp),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(a=>{this.emitter.emit(T.StateChange,{player:a})}),this.speedService=sp({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(a=>{this.emitter.emit(T.StateChange,{speed:a})}),this.mediaManager=new ai({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});let n=this.service.state.context.events.find(a=>a.type===E.Meta),o=this.service.state.context.events.find(a=>a.type===E.FullSnapshot);if(n){let{width:a,height:l}=n.data;setTimeout(()=>{this.emitter.emit(T.Resize,{width:a,height:l})},0)}o&&setTimeout(()=>{var a;this.firstFullSnapshot||(this.firstFullSnapshot=o,this.rebuildFullSnapshot(o),(a=this.iframe.contentWindow)==null||a.scrollTo(o.data.initialOffset))},1),this.service.state.context.events.find(Kn)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,t){return this.emitter.on(e,t),this}off(e,t){return this.emitter.off(e,t),this}setConfig(e){Object.keys(e).forEach(t=>{e[t],this.config[t]=e[t]}),this.config.skipInactive||this.backToNormal(),typeof e.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail<"u"&&(e.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getMetaData(){let e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){let{baselineTime:e,events:t}=this.service.state.context;return e-t[0].timestamp}getMirror(){return this.mirror}play(e=0){var t,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(r=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||r.classList.remove("rrweb-paused"),this.emitter.emit(T.Start)}pause(e){var t,r;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(r=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||r.classList.add("rrweb-paused"),this.emitter.emit(T.Pause)}resume(e=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(T.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(T.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){let t=this.config.unpackFn?this.config.unpackFn(e):e;Kn(t)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:t}}))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=cn()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");let e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(ep(this.iframe.contentWindow,this.iframe.contentDocument),La(this.iframe.contentWindow))}rebuildFullSnapshot(e,t=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};let r=[],i=new Set,n=(l,u)=>{if(l.nodeName==="DIALOG"&&i.add(l),this.collectIframeAndAttachDocument(r,l),this.mediaManager.isSupportedMediaElement(l)){let{events:c}=this.service.state.context;this.mediaManager.addMediaElements(l,e.timestamp-c[0].timestamp,this.mirror)}for(let c of this.config.plugins||[])c.onBuild&&c.onBuild(l,{id:u,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),Kc(e.data.node,{doc:this.iframe.contentDocument,afterAppend:n,cache:this.cache,mirror:this.mirror}),n(this.iframe.contentDocument,e.data.node.id);for(let{mutationInQueue:l,builtNode:u}of r)this.attachDocumentToIframe(l,u),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==l);let{documentElement:o,head:a}=this.iframe.contentDocument;this.insertStyleRules(o,a),i.forEach(l=>qt(l)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(T.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var r;let i=ip(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!i.length)if(this.usingVirtualDom){let n=this.virtualDom.createElement("style");this.virtualDom.mirror.add(n,Aa(n,this.virtualDom.unserializedId)),e.insertBefore(n,t),n.rules.push({source:I.StyleSheetRule,adds:i.map((o,a)=>({rule:o,index:a}))})}else{let n=document.createElement("style");e.insertBefore(n,t);for(let o=0;o<i.length;o++)(r=n.sheet)==null||r.insertRule(i[o],o)}}attachDocumentToIframe(e,t){let r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],n=new Set,o=(a,l)=>{a.nodeName==="DIALOG"&&n.add(a),this.collectIframeAndAttachDocument(i,a);let u=r.getMeta(a);if(u?.type===ge.Element&&u?.tagName.toUpperCase()==="HTML"){let{documentElement:c,head:h}=t.contentDocument;this.insertStyleRules(c,h)}if(!this.usingVirtualDom)for(let c of this.config.plugins||[])c.onBuild&&c.onBuild(a,{id:l,replayer:this})};ut(e.node,{doc:t.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:o,cache:this.cache}),o(t.contentDocument,e.node.id);for(let{mutationInQueue:a,builtNode:l}of i)this.attachDocumentToIframe(a,l),this.newDocumentQueue=this.newDocumentQueue.filter(u=>u!==a);n.forEach(a=>qt(a))}collectIframeAndAttachDocument(e,t){if(ct(t,this.mirror)){let r=this.newDocumentQueue.find(i=>i.parentId===this.mirror.getId(t));r&&e.push({mutationInQueue:r,builtNode:t})}}waitForStylesheetLoad(){var e;let t=(e=this.iframe.contentDocument)==null?void 0:e.head;if(t){let r=new Set,i,n=this.service.state,o=()=>{n=this.service.state};this.emitter.on(T.Start,o),this.emitter.on(T.Pause,o);let a=()=>{this.emitter.off(T.Start,o),this.emitter.off(T.Pause,o)};t.querySelectorAll('link[rel="stylesheet"]').forEach(l=>{l.sheet||(r.add(l),l.addEventListener("load",()=>{r.delete(l),r.size===0&&i!==-1&&(n.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(T.LoadStylesheetEnd),i&&clearTimeout(i),a())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(T.LoadStylesheetStart),i=setTimeout(()=>{n.matches("playing")&&this.play(this.getCurrentTime()),i=-1,a()},this.config.loadTimeout))}}async preloadAllImages(){let e=[];for(let t of this.service.state.context.events)t.type===E.IncrementalSnapshot&&t.data.source===I.CanvasMutation&&(e.push(this.deserializeAndPreloadCanvasEvents(t.data,t)),("commands"in t.data?t.data.commands:[t.data]).forEach(i=>{this.preloadImages(i,t)}));return Promise.all(e)}preloadImages(e,t){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(t)){let r=document.createElement("canvas"),i=r.getContext("2d"),n=i?.createImageData(r.width,r.height);i?.putImageData(n,0,0)}}async deserializeAndPreloadCanvasEvents(e,t){if(!this.canvasEventMap.has(t)){let r={isUnchanged:!0};if("commands"in e){let i=await Promise.all(e.commands.map(async n=>{let o=await Promise.all(n.args.map(Ee(this.imageMap,null,r)));return{...n,args:o}}));r.isUnchanged===!1&&this.canvasEventMap.set(t,{...e,commands:i})}else{let i=await Promise.all(e.args.map(Ee(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(t,{...e,args:i})}}}applyIncremental(e,t){var r,i,n;let{data:o}=e;switch(o.source){case I.Mutation:{try{this.applyMutation(o,t)}catch(a){this.warn(`Exception in mutation ${a.message||a}`,o)}break}case I.Drag:case I.TouchMove:case I.MouseMove:if(t){let a=o.positions[o.positions.length-1];this.mousePos={x:a.x,y:a.y,id:a.id,debugData:o}}else o.positions.forEach(a=>{let l={doAction:()=>{this.moveAndHover(a.x,a.y,a.id,t,o)},delay:a.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(l)}),this.timer.addAction({doAction(){},delay:e.delay-((r=o.positions[0])==null?void 0:r.timeOffset)});break;case I.MouseInteraction:{if(o.id===-1)break;let a=new Event(xe(_[o.type])),l=this.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);this.emitter.emit(T.MouseInteraction,{type:o.type,target:l});let{triggerFocus:u}=this.config;switch(o.type){case _.Blur:"blur"in l&&l.blur();break;case _.Focus:u&&l.focus&&l.focus({preventScroll:!0});break;case _.Click:case _.TouchStart:case _.TouchEnd:case _.MouseDown:case _.MouseUp:t?(o.type===_.TouchStart?this.touchActive=!0:o.type===_.TouchEnd&&(this.touchActive=!1),o.type===_.MouseDown?this.lastMouseDownEvent=[l,a]:o.type===_.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:o.x||0,y:o.y||0,id:o.id,debugData:o}):(o.type===_.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(o.x||0,o.y||0,o.id,t,o),o.type===_.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):o.type===_.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):o.type===_.TouchEnd?this.mouse.classList.remove("touch-active"):l.dispatchEvent(a));break;case _.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:l.dispatchEvent(a)}break}case I.Scroll:{if(o.id===-1)break;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(o.id);if(!a)return this.debugNodeNotFound(o,o.id);a.scrollData=o;break}this.applyScroll(o,t);break}case I.ViewportResize:this.emitter.emit(T.Resize,{width:o.width,height:o.height});break;case I.Input:{if(o.id===-1)break;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(o.id);if(!a)return this.debugNodeNotFound(o,o.id);a.inputData=o;break}this.applyInput(o);break}case I.MediaInteraction:{let a=this.usingVirtualDom?this.virtualDom.mirror.getNode(o.id):this.mirror.getNode(o.id);if(!a)return this.debugNodeNotFound(o,o.id);let l=a,{events:u}=this.service.state.context;this.mediaManager.mediaMutation({target:l,timeOffset:e.timestamp-u[0].timestamp,mutation:o});break}case I.StyleSheetRule:case I.StyleDeclaration:{this.usingVirtualDom?o.styleId?this.constructedStyleMutations.push(o):o.id&&((i=this.virtualDom.mirror.getNode(o.id))==null||i.rules.push(o)):this.applyStyleSheetMutation(o);break}case I.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(o.id);if(!a)return this.debugNodeNotFound(o,o.id);a.canvasMutations.push({event:e,mutation:o})}else{let a=this.mirror.getNode(o.id);if(!a)return this.debugNodeNotFound(o,o.id);Xn({event:e,mutation:o,target:a,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case I.Font:{try{let a=new FontFace(o.family,o.buffer?new Uint8Array(JSON.parse(o.fontSource)):o.fontSource,o.descriptors);(n=this.iframe.contentDocument)==null||n.fonts.add(a)}catch(a){this.warn(a)}break}case I.Selection:{if(t){this.lastSelectionData=o;break}this.applySelection(o);break}case I.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(o):this.applyAdoptedStyleSheet(o);break}}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,ld(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(let u in this.legacy_missingNodeRetryMap)try{let c=this.legacy_missingNodeRetryMap[u],h=Ra(c.node,this.virtualDom,this.mirror);h&&(c.node=h)}catch(c){this.warn(c)}let r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(u=>r.getNode(u.id)?!0:(this.warnNodeNotFound(e,u.id),!1)),e.removes.forEach(u=>{var c;let h=r.getNode(u.id);if(!h)return;let f=r.getNode(u.parentId);if(!f)return this.warnNodeNotFound(e,u.parentId);if(u.isShadow&&Oe(f)&&(f=f.shadowRoot),r.removeNodeFromMap(h),f)try{f.removeChild(h),this.usingVirtualDom&&h.nodeName==="#text"&&f.nodeName==="STYLE"&&((c=f.rules)==null?void 0:c.length)>0&&(f.rules=[])}catch(g){if(g instanceof DOMException)this.warn("parent could not remove child in mutation",f,h,e);else throw g}});let i={...this.legacy_missingNodeRetryMap},n=[],o=u=>{let c=null;return u.nextId&&(c=r.getNode(u.nextId)),u.nextId!==null&&u.nextId!==void 0&&u.nextId!==-1&&!c},a=u=>{var c,h;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let f=r.getNode(u.parentId);if(!f)return u.node.type===ge.Document?this.newDocumentQueue.push(u):n.push(u);u.node.isShadow&&(Oe(f)||f.attachShadow({mode:"open"}),f=f.shadowRoot);let g=null,p=null;if(u.previousId&&(g=r.getNode(u.previousId)),u.nextId&&(p=r.getNode(u.nextId)),o(u))return n.push(u);if(u.node.rootId&&!r.getNode(u.node.rootId))return;let m=u.node.rootId?r.getNode(u.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(ct(f,r)){this.attachDocumentToIframe(u,f);return}let d=(w,v)=>{if(!this.usingVirtualDom){qt(w);for(let x of this.config.plugins||[])x.onBuild&&x.onBuild(w,{id:v,replayer:this})}},y=ut(u.node,{doc:m,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:d});if(u.previousId===-1||u.nextId===-1){i[u.node.id]={node:y,mutation:u};return}let S=r.getMeta(f);if(S&&S.type===ge.Element&&u.node.type===ge.Text){let w=Array.isArray(f.childNodes)?f.childNodes:Array.from(f.childNodes);if(S.tagName==="textarea")for(let v of w)v.nodeType===f.TEXT_NODE&&f.removeChild(v);else if(S.tagName==="style"&&w.length===1)for(let v of w)v.nodeType===f.TEXT_NODE&&!r.hasNode(v)&&(y.textContent=v.textContent,f.removeChild(v))}else if(S?.type===ge.Document){let w=f;u.node.type===ge.DocumentType&&((c=w.childNodes[0])==null?void 0:c.nodeType)===Node.DOCUMENT_TYPE_NODE&&w.removeChild(w.childNodes[0]),y.nodeName==="HTML"&&w.documentElement&&w.removeChild(w.documentElement)}if(g&&g.nextSibling&&g.nextSibling.parentNode?f.insertBefore(y,g.nextSibling):p&&p.parentNode?f.contains(p)?f.insertBefore(y,p):f.insertBefore(y,null):f.appendChild(y),d(y,u.node.id),this.usingVirtualDom&&y.nodeName==="#text"&&f.nodeName==="STYLE"&&((h=f.rules)==null?void 0:h.length)>0&&(f.rules=[]),ct(y,this.mirror)){let w=this.mirror.getId(y),v=this.newDocumentQueue.find(x=>x.parentId===w);v&&(this.attachDocumentToIframe(v,y),this.newDocumentQueue=this.newDocumentQueue.filter(x=>x!==v))}(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(i,f,y,u)};e.adds.forEach(u=>{a(u)});let l=Date.now();for(;n.length;){let u=Ed(n);if(n.length=0,Date.now()-l>500){this.warn("Timeout in the loop, please check the resolve tree data:",u);break}for(let c of u)r.getNode(c.value.parentId)?Fa(c,f=>{a(f)}):this.debug("Drop resolve tree since there is no parent for the root node.",c)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),xd(e.texts).forEach(u=>{var c;let h=r.getNode(u.id);if(!h)return e.removes.find(g=>g.id===u.id)?void 0:this.warnNodeNotFound(e,u.id);let f=h.parentElement;if(u.value&&f&&f.tagName==="STYLE"?h.textContent=Pr(u.value,this.cache):h.textContent=u.value,this.usingVirtualDom){let g=h.parentNode;((c=g?.rules)==null?void 0:c.length)>0&&(g.rules=[])}}),e.attributes.forEach(u=>{var c;let h=r.getNode(u.id);if(!h)return e.removes.find(f=>f.id===u.id)?void 0:this.warnNodeNotFound(e,u.id);for(let f in u.attributes)if(typeof f=="string"){let g=u.attributes[f];if(g===null)h.removeAttribute(f),f==="open"&&cp(h,u);else if(typeof g=="string")try{if(f==="_cssText"&&(h.nodeName==="LINK"||h.nodeName==="STYLE"))try{let p=r.getMeta(h),m=ut({...p,attributes:{...p.attributes,...u.attributes}},{doc:h.ownerDocument,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(p.attributes,u.attributes);let d=h.nextSibling,y=h.parentNode;if(m&&y){y.removeChild(h),y.insertBefore(m,d),r.replace(u.id,m);break}}catch{}if(f==="value"&&h.nodeName==="TEXTAREA"){let p=h;p.childNodes.forEach(d=>p.removeChild(d));let m=(c=h.ownerDocument)==null?void 0:c.createTextNode(g);m&&p.appendChild(m)}else h.setAttribute(f,g);f==="rr_open_mode"&&h.nodeName==="DIALOG"&&qt(h,u)}catch(p){this.warn("An error occurred may due to the checkout feature.",p)}else if(f==="style"){let p=g,m=h;for(let d in p)if(p[d]===!1)m.style.removeProperty(d);else if(p[d]instanceof Array){let y=p[d];m.style.setProperty(d,y[0],y[1])}else{let y=p[d];m.style.setProperty(d,y)}}}})}applyScroll(e,t){var r,i;let n=this.mirror.getNode(e.id);if(!n)return this.debugNodeNotFound(e,e.id);let o=this.mirror.getMeta(n);if(n===this.iframe.contentDocument)(r=this.iframe.contentWindow)==null||r.scrollTo({top:e.y,left:e.x,behavior:"auto"});else if(o?.type===ge.Document)(i=n.defaultView)==null||i.scrollTo({top:e.y,left:e.x,behavior:"auto"});else try{n.scrollTo({top:e.y,left:e.x,behavior:"auto"})}catch{}}applyInput(e){let t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch{}}applySelection(e){try{let t=new Set,r=e.ranges.map(({start:i,startOffset:n,end:o,endOffset:a})=>{let l=this.mirror.getNode(i),u=this.mirror.getNode(o);if(!l||!u)return;let c=new Range;c.setStart(l,n),c.setEnd(u,a);let h=l.ownerDocument,f=h?.getSelection();return f&&t.add(f),{range:c,selection:f}});t.forEach(i=>i.removeAllRanges()),r.forEach(i=>{var n;return i&&((n=i.selection)==null?void 0:n.addRange(i.range))})}catch{}}applyStyleSheetMutation(e){var t;let r=null;e.styleId?r=this.styleMirror.getStyle(e.styleId):e.id&&(r=((t=this.mirror.getNode(e.id))==null?void 0:t.sheet)||null),r&&(e.source===I.StyleSheetRule?this.applyStyleSheetRule(e,r):e.source===I.StyleDeclaration&&this.applyStyleDeclaration(e,r))}applyStyleSheetRule(e,t){var r,i,n,o;if((r=e.adds)==null||r.forEach(({rule:a,index:l})=>{try{if(Array.isArray(l)){let{positions:u,index:c}=Tn(l);nt(t.cssRules,u).insertRule(a,c)}else{let u=l===void 0?void 0:Math.min(l,t.cssRules.length);t?.insertRule(a,u)}}catch{}}),(i=e.removes)==null||i.forEach(({index:a})=>{try{if(Array.isArray(a)){let{positions:l,index:u}=Tn(a);nt(t.cssRules,l).deleteRule(u||0)}else t?.deleteRule(a)}catch{}}),e.replace)try{(n=t.replace)==null||n.call(t,e.replace)}catch{}if(e.replaceSync)try{(o=t.replaceSync)==null||o.call(t,e.replaceSync)}catch{}}applyStyleDeclaration(e,t){e.set&&nt(t.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&nt(t.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var t;let r=this.mirror.getNode(e.id);if(!r)return;(t=e.styles)==null||t.forEach(a=>{var l;let u=null,c=null;if(Oe(r)?c=((l=r.ownerDocument)==null?void 0:l.defaultView)||null:r.nodeName==="#document"&&(c=r.defaultView),!!c)try{u=new c.CSSStyleSheet,this.styleMirror.add(u,a.styleId),this.applyStyleSheetRule({source:I.StyleSheetRule,adds:a.rules},u)}catch{}});let i=10,n=0,o=(a,l)=>{let u=l.map(c=>this.styleMirror.getStyle(c)).filter(c=>c!==null);Oe(a)?a.shadowRoot.adoptedStyleSheets=u:a.nodeName==="#document"&&(a.adoptedStyleSheets=u),u.length!==l.length&&n<i&&(setTimeout(()=>o(a,l),0+100*n),n++)};o(r,e.styleIds)}legacy_resolveMissingNode(e,t,r,i){let{previousId:n,nextId:o}=i,a=n&&e[n],l=o&&e[o];if(a){let{node:u,mutation:c}=a;t.insertBefore(u,r),delete e[c.node.id],delete this.legacy_missingNodeRetryMap[c.node.id],(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(e,t,u,c)}if(l){let{node:u,mutation:c}=l;t.insertBefore(u,r.nextSibling),delete e[c.node.id],delete this.legacy_missingNodeRetryMap[c.node.id],(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(e,t,u,c)}}moveAndHover(e,t,r,i,n){let o=this.mirror.getNode(r);if(!o)return this.debugNodeNotFound(n,r);let a=Ba(o,this.iframe),l=e*a.absoluteScale+a.x,u=t*a.absoluteScale+a.y;this.mouse.style.left=`${l}px`,this.mouse.style.top=`${u}px`,i||this.drawMouseTail({x:l,y:u}),this.hoverElements(o)}drawMouseTail(e){if(!this.mouseTail)return;let{lineCap:t,lineWidth:r,strokeStyle:i,duration:n}=this.config.mouseTail===!0?as:Object.assign({},as,this.config.mouseTail),o=()=>{if(!this.mouseTail)return;let a=this.mouseTail.getContext("2d");!a||!this.tailPositions.length||(a.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),a.beginPath(),a.lineWidth=r,a.lineCap=t,a.strokeStyle=i,a.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(l=>a.lineTo(l.x,l.y)),a.stroke())};this.tailPositions.push(e),o(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(a=>a!==e),o()},n/this.speedService.state.context.timer.speed)}hoverElements(e){var t;(t=this.lastHoveredRootNode||this.iframe.contentDocument)==null||t.querySelectorAll(".\\:hover").forEach(i=>{i.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let r=e;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(e){return e.type!==E.IncrementalSnapshot?!1:e.data.source>I.Mutation&&e.data.source<=I.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(T.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,t){this.warn(`Node with id '${t}' not found. `,e)}warnCanvasMutationFailed(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)}debugNodeNotFound(e,t){this.debug(`Node with id '${t}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn(Jn,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(Jn,...e)}},{addCustomEvent:Yp}=$e,{freezePage:Hp}=$e,{takeFullSnapshot:Zp}=$e;globalThis.__RipploReplayer=Or;})();
|
|
54
|
+
or you can use record.mirror to access the mirror instance during recording.`,Dn={map:{},getId(){return console.error(Fe),-1},getNode(){return console.error(Fe),null},removeNodeFromMap(){console.error(Fe)},has(){return console.error(Fe),!1},reset(){console.error(Fe)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Dn=new Proxy(Dn,{get(s,e,t){return e==="map"&&console.error(Fe),Reflect.get(s,e,t)}}));function Ct(s,e,t={}){let r=null,i=0;return function(...n){let o=Date.now();!i&&t.leading===!1&&(i=o);let a=e-(o-i),l=this;a<=0||a>e?(r&&(clearTimeout(r),r=null),i=o,s.apply(l,n)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{i=t.leading===!1?0:Date.now(),r=null,s.apply(l,n)},a))}}function zr(s,e,t,r,i=window){let n=i.Object.getOwnPropertyDescriptor(s,e);return i.Object.defineProperty(s,e,r?t:{set(o){setTimeout(()=>{t.set.call(this,o)},0),n&&n.set&&n.set.call(this,o)}}),()=>zr(s,e,n||{},!0)}var Er=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Er=()=>new Date().getTime());function Ta(s){var e,t,r,i;let n=s.document;return{left:n.scrollingElement?n.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:n.documentElement.scrollLeft||n?.body&&((e=R.parentElement(n.body))==null?void 0:e.scrollLeft)||((t=n?.body)==null?void 0:t.scrollLeft)||0,top:n.scrollingElement?n.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:n?.documentElement.scrollTop||n?.body&&((r=R.parentElement(n.body))==null?void 0:r.scrollTop)||((i=n?.body)==null?void 0:i.scrollTop)||0}}function _a(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ka(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function $a(s){return s?s.nodeType===s.ELEMENT_NODE?s:R.parentElement(s):null}function ee(s,e,t,r){if(!s)return!1;let i=$a(s);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(ur(i,e,r))return!0}catch{}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function Id(s,e){return e.getId(s)!==-1}function is(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===dt}function Pa(s,e){if(at(s))return!1;let t=e.getId(s);if(!e.has(t))return!0;let r=R.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?Pa(r,e):!0}function Ks(s){return!!s.changedTouches}function La(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function Ed(s){let e={},t=(i,n)=>{let o={value:i,parent:n,children:[]};return e[i.node.id]=o,o},r=[];for(let i of s){let{nextId:n,parentId:o}=i;if(n&&n in e){let a=e[n];if(a.parent){let l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,t(i,a.parent))}else{let l=r.indexOf(a);r.splice(l,0,t(i,null))}continue}if(o in e){let a=e[o];a.children.push(t(i,a));continue}r.push(t(i,null))}return r}function Fa(s,e){e(s.value);for(let t=s.children.length-1;t>=0;t--)Fa(s.children[t],e)}function ct(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function Ua(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function Ba(s,e){var t,r;let i=(r=(t=s.ownerDocument)==null?void 0:t.defaultView)==null?void 0:r.frameElement;if(!i||i===e)return{x:0,y:0,relativeScale:1,absoluteScale:1};let n=i.getBoundingClientRect(),o=Ba(i,e),a=n.height/i.clientHeight;return{x:n.x*o.relativeScale+o.x,y:n.y*o.relativeScale+o.y,relativeScale:a,absoluteScale:o.absoluteScale*a}}function Oe(s){return s?s instanceof ue&&"shadowRoot"in s?!!s.shadowRoot:!!R.shadowRoot(s):!1}function nt(s,e){let t=s[e[0]];return e.length===1?t:nt(t.cssRules[e[1]].cssRules,e.slice(2))}function Tn(s){let e=[...s],t=e.pop();return{positions:e,index:t}}function xd(s){let e=new Set,t=[];for(let r=s.length;r--;){let i=s[r];e.has(i.id)||(t.push(i),e.add(i.id))}return t}var xr=class{constructor(){b(this,"id",1),b(this,"styleIDMap",new WeakMap),b(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return t===void 0?r=this.id++:r=t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Wa(s){var e;let t=null;return"getRootNode"in s&&((e=R.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&R.host(R.getRootNode(s))&&(t=R.host(R.getRootNode(s))),t}function Md(s){let e=s,t;for(;t=Wa(e);)e=t;return e}function Nd(s){let e=R.ownerDocument(s);if(!e)return!1;let t=Md(s);return R.contains(e,t)}function za(s){let e=R.ownerDocument(s);return e?R.contains(e,s)||Nd(s):!1}var E=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(E||{}),I=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(I||{}),_=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(_||{}),me=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(me||{}),be=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(be||{}),Ie=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(Ie||{}),T=(s=>(s.Start="start",s.Pause="pause",s.Resume="resume",s.Resize="resize",s.Finish="finish",s.FullsnapshotRebuilded="fullsnapshot-rebuilded",s.LoadStylesheetStart="load-stylesheet-start",s.LoadStylesheetEnd="load-stylesheet-end",s.SkipStart="skip-start",s.SkipEnd="skip-end",s.MouseInteraction="mouse-interaction",s.EventCast="event-cast",s.CustomEvent="custom-event",s.Flush="flush",s.StateChange="state-change",s.PlayBack="play-back",s.Destroy="destroy",s))(T||{}),ge=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(ge||{});function _n(s){return"__ln"in s}var Qs=class{constructor(){b(this,"length",0),b(this,"head",null),b(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=t?.next||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&_n(e.previousSibling)){let 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&&_n(e.nextSibling)&&e.nextSibling.__ln.previous){let r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){let 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--)}},kn=(s,e)=>`${s}@${e}`,qs=class{constructor(){b(this,"frozen",!1),b(this,"locked",!1),b(this,"texts",[]),b(this,"attributes",[]),b(this,"attributeMap",new WeakMap),b(this,"removes",[]),b(this,"mapRemoves",[]),b(this,"movedMap",{}),b(this,"addedSet",new Set),b(this,"movedSet",new Set),b(this,"droppedSet",new Set),b(this,"removesSubTreeCache",new Set),b(this,"mutationCb"),b(this,"blockClass"),b(this,"blockSelector"),b(this,"maskTextClass"),b(this,"maskTextSelector"),b(this,"inlineStylesheet"),b(this,"maskInputOptions"),b(this,"maskTextFn"),b(this,"maskInputFn"),b(this,"keepIframeSrcFn"),b(this,"recordCanvas"),b(this,"inlineImages"),b(this,"slimDOMOptions"),b(this,"dataURLOptions"),b(this,"doc"),b(this,"mirror"),b(this,"iframeManager"),b(this,"stylesheetManager"),b(this,"shadowDomManager"),b(this,"canvasManager"),b(this,"processedNodeManager"),b(this,"unattachedDoc"),b(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),b(this,"emit",()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,r=new Qs,i=l=>{let u=l,c=dt;for(;c===dt;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},n=l=>{let u=R.parentNode(l);if(!u||!za(l))return;let c=!1;if(l.nodeType===Node.TEXT_NODE){let p=u.tagName;if(p==="TEXTAREA")return;p==="STYLE"&&this.addedSet.has(u)&&(c=!0)}let h=at(u)?this.mirror.getId(Wa(l)):this.mirror.getId(u),f=i(l);if(h===-1||f===-1)return r.addNode(l);let g=We(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:p=>{ct(p,this.mirror)&&this.iframeManager.addIframe(p),Ua(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),Oe(l)&&this.shadowDomManager.addShadowRoot(R.shadowRoot(l),this.doc)},onIframeLoad:(p,m)=>{this.iframeManager.attachIframe(p,m),this.shadowDomManager.observeAttachShadow(p)},onStylesheetLoad:(p,m)=>{this.stylesheetManager.attachLinkElement(p,m)},cssCaptured:c});g&&(e.push({parentId:h,nextId:f,node:g}),t.add(g.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let l of this.movedSet)$n(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(R.parentNode(l))||n(l);for(let l of this.addedSet)!Pn(this.droppedSet,l)&&!$n(this.removesSubTreeCache,l,this.mirror)||Pn(this.movedSet,l)?n(l):this.droppedSet.add(l);let o=null;for(;r.length;){let l=null;if(o){let u=this.mirror.getId(R.parentNode(o.value)),c=i(o.value);u!==-1&&c!==-1&&(l=o)}if(!l){let u=r.tail;for(;u;){let c=u;if(u=u.previous,c){let h=this.mirror.getId(R.parentNode(c.value));if(i(c.value)===-1)continue;if(h!==-1){l=c;break}else{let g=c.value,p=R.parentNode(g);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let m=R.host(p);if(this.mirror.getId(m)!==-1){l=c;break}}}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}o=l.previous,r.removeNode(l.value),n(l.value)}let a={texts:this.texts.map(l=>{let u=l.node,c=R.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:l.value}}).filter(l=>!t.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{let{attributes:u}=l;if(typeof u.style=="string"){let c=JSON.stringify(l.styleDiff),h=JSON.stringify(l._unchangedStyles);c.length<u.style.length&&(c+h).split("var(").length===u.style.split("var(").length&&(u.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:u}}).filter(l=>!t.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:e};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(a))}),b(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));let r=Array.from(R.childNodes(e),i=>R.textContent(i)||"").join("");t.attributes.value=or({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:ar(e),value:r,maskInputFn:this.maskInputFn})}),b(this,"processMutation",e=>{if(!is(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{let t=R.textContent(e.target);!ee(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:io(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,$a(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{let t=e.target,r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){let o=ar(t);i=or({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(ee(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let n=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(n||(n={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e.target,n)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!so(t.tagName,r))if(n.attributes[r]=ro(this.doc,xe(t.tagName),xe(r),i),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let o=this.unattachedDoc.createElement("span");e.oldValue&&o.setAttribute("style",e.oldValue);for(let a of Array.from(t.style)){let l=t.style.getPropertyValue(a),u=t.style.getPropertyPriority(a);l!==o.style.getPropertyValue(a)||u!==o.style.getPropertyPriority(a)?u===""?n.styleDiff[a]=l:n.styleDiff[a]=[l,u]:n._unchangedStyles[a]=[l,u]}for(let a of Array.from(o.style))t.style.getPropertyValue(a)===""&&(n.styleDiff[a]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?n.attributes.rr_open_mode="modal":n.attributes.rr_open_mode="non-modal");break}case"childList":{if(ee(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let r=this.mirror.getId(t),i=at(e.target)?this.mirror.getId(R.host(e.target)):this.mirror.getId(e.target);ee(e.target,this.blockClass,this.blockSelector,!1)||is(t,this.mirror,this.slimDOMOptions)||!Id(t,this.mirror)||(this.addedSet.has(t)?(ei(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||Pa(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[kn(r,i)]?ei(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:at(e.target)&<(e.target)?!0:void 0}),Rd(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),b(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(is(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[kn(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ee(e,this.blockClass,this.blockSelector,!1)||(R.childNodes(e).forEach(r=>this.genAdds(r)),Oe(e)&&R.childNodes(R.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function ei(s,e){s.delete(e),R.childNodes(e).forEach(t=>ei(s,t))}function Rd(s,e){let t=[s];for(;t.length;){let r=t.pop();e.has(r)||(e.add(r),R.childNodes(r).forEach(i=>t.push(i)))}}function $n(s,e,t){return s.size===0?!1:Ad(s,e)}function Ad(s,e,t){let r=R.parentNode(e);return r?s.has(r):!1}function Pn(s,e){return s.size===0?!1:Va(s,e)}function Va(s,e){let t=R.parentNode(e);return t?s.has(t)?!0:Va(s,t):!1}var ht;function Od(s){ht=s}function Dd(){ht=void 0}var D=s=>ht?(...t)=>{try{return s(...t)}catch(r){if(ht&&ht(r)===!0)return;throw r}}:s,De=[];function Nt(s){try{if("composedPath"in s){let e=s.composedPath();if(e.length)return e[0]}else if("path"in s&&s.path.length)return s.path[0]}catch{}return s&&s.target}function Ga(s,e){let t=new qs;De.push(t),t.init(s);let r=new(Da())(D(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function Td({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};let i=typeof e.mousemove=="number"?e.mousemove:50,n=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500,o=[],a,l=Ct(D(h=>{let f=Date.now()-a;s(o.map(g=>(g.timeOffset-=f,g)),h),o=[],a=null}),n),u=D(Ct(D(h=>{let f=Nt(h),{clientX:g,clientY:p}=Ks(h)?h.changedTouches[0]:h;a||(a=Er()),o.push({x:g,y:p,id:r.getId(f),timeOffset:Er()-a}),l(typeof DragEvent<"u"&&h instanceof DragEvent?I.Drag:h instanceof MouseEvent?I.MouseMove:I.TouchMove)}),i,{trailing:!1})),c=[q("mousemove",u,t),q("touchmove",u,t),q("drag",u,t)];return D(()=>{c.forEach(h=>h())})}function _d({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){if(n.mouseInteraction===!1)return()=>{};let o=n.mouseInteraction===!0||n.mouseInteraction===void 0?{}:n.mouseInteraction,a=[],l=null,u=c=>h=>{let f=Nt(h);if(ee(f,r,i,!0))return;let g=null,p=c;if("pointerType"in h){switch(h.pointerType){case"mouse":g=me.Mouse;break;case"touch":g=me.Touch;break;case"pen":g=me.Pen;break}g===me.Touch?_[c]===_.MouseDown?p="TouchStart":_[c]===_.MouseUp&&(p="TouchEnd"):me.Pen}else Ks(h)&&(g=me.Touch);g!==null?(l=g,(p.startsWith("Touch")&&g===me.Touch||p.startsWith("Mouse")&&g===me.Mouse)&&(g=null)):_[c]===_.Click&&(g=l,l=null);let m=Ks(h)?h.changedTouches[0]:h;if(!m)return;let d=t.getId(f),{clientX:y,clientY:S}=m;D(s)({type:_[p],id:d,x:y,y:S,...g!==null&&{pointerType:g}})};return Object.keys(_).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&o[c]!==!1).forEach(c=>{let h=xe(c),f=u(c);if(window.PointerEvent)switch(_[c]){case _.MouseDown:case _.MouseUp:h=h.replace("mouse","pointer");break;case _.TouchStart:case _.TouchEnd:return}a.push(q(h,f,e))}),D(()=>{a.forEach(c=>c())})}function ja({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){let o=D(Ct(D(a=>{let l=Nt(a);if(!l||ee(l,r,i,!0))return;let u=t.getId(l);if(l===e&&e.defaultView){let c=Ta(e.defaultView);s({id:u,x:c.left,y:c.top})}else s({id:u,x:l.scrollLeft,y:l.scrollTop})}),n.scroll||100));return q("scroll",o,e)}function kd({viewportResizeCb:s},{win:e}){let t=-1,r=-1,i=D(Ct(D(()=>{let n=_a(),o=ka();(t!==n||r!==o)&&(s({width:Number(o),height:Number(n)}),t=n,r=o)}),200));return q("resize",i,e)}var $d=["INPUT","TEXTAREA","SELECT"],Ln=new WeakMap;function Pd({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:n,ignoreSelector:o,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function h(S){let w=Nt(S),v=S.isTrusted,x=w&&w.tagName;if(w&&x==="OPTION"&&(w=R.parentElement(w)),!w||!x||$d.indexOf(x)<0||ee(w,r,i,!0)||w.classList.contains(n)||o&&w.matches(o))return;let N=w.value,B=!1,F=ar(w)||"";F==="radio"||F==="checkbox"?B=w.checked:(a[x.toLowerCase()]||a[F])&&(N=or({element:w,maskInputOptions:a,tagName:x,type:F,value:N,maskInputFn:l})),f(w,c?{text:N,isChecked:B,userTriggered:v}:{text:N,isChecked:B});let Y=w.name;F==="radio"&&Y&&B&&e.querySelectorAll(`input[type="radio"][name="${Y}"]`).forEach(K=>{if(K!==w){let te=K.value;f(K,c?{text:te,isChecked:!B,userTriggered:!1}:{text:te,isChecked:!B})}})}function f(S,w){let v=Ln.get(S);if(!v||v.text!==w.text||v.isChecked!==w.isChecked){Ln.set(S,w);let x=t.getId(S);D(s)({...w,id:x})}}let p=(u.input==="last"?["change"]:["input","change"]).map(S=>q(S,D(h),e)),m=e.defaultView;if(!m)return()=>{p.forEach(S=>S())};let d=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),y=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return d&&d.set&&p.push(...y.map(S=>zr(S[0],S[1],{set(){D(h)({target:this,isTrusted:!1})}},!1,m))),D(()=>{p.forEach(S=>S())})}function Mr(s){let e=[];function t(r,i){if(Kt("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Kt("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Kt("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Kt("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let o=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(o)}else if(r.parentStyleSheet){let o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(o)}return i}return t(s,e)}function Ce(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function Ld({styleSheetRuleCb:s,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:D((c,h,f)=>{let[g,p]=f,{id:m,styleId:d}=Ce(h,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,adds:[{rule:g,index:p}]}),c.apply(h,f)})}),r.CSSStyleSheet.prototype.addRule=function(c,h,f=this.cssRules.length){let g=`${c} { ${h} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[g,f])};let n=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(n,{apply:D((c,h,f)=>{let[g]=f,{id:p,styleId:m}=Ce(h,e,t.styleMirror);return(p&&p!==-1||m&&m!==-1)&&s({id:p,styleId:m,removes:[{index:g}]}),c.apply(h,f)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:D((c,h,f)=>{let[g]=f,{id:p,styleId:m}=Ce(h,e,t.styleMirror);return(p&&p!==-1||m&&m!==-1)&&s({id:p,styleId:m,replace:g}),c.apply(h,f)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:D((c,h,f)=>{let[g]=f,{id:p,styleId:m}=Ce(h,e,t.styleMirror);return(p&&p!==-1||m&&m!==-1)&&s({id:p,styleId:m,replaceSync:g}),c.apply(h,f)})}));let l={};Qt("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(Qt("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),Qt("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),Qt("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));let u={};return Object.entries(l).forEach(([c,h])=>{u[c]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(u[c].insertRule,{apply:D((f,g,p)=>{let[m,d]=p,{id:y,styleId:S}=Ce(g.parentStyleSheet,e,t.styleMirror);return(y&&y!==-1||S&&S!==-1)&&s({id:y,styleId:S,adds:[{rule:m,index:[...Mr(g),d||0]}]}),f.apply(g,p)})}),h.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:D((f,g,p)=>{let[m]=p,{id:d,styleId:y}=Ce(g.parentStyleSheet,e,t.styleMirror);return(d&&d!==-1||y&&y!==-1)&&s({id:d,styleId:y,removes:[{index:[...Mr(g),m]}]}),f.apply(g,p)})})}),D(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=n,o&&(r.CSSStyleSheet.prototype.replace=o),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([c,h])=>{h.prototype.insertRule=u[c].insertRule,h.prototype.deleteRule=u[c].deleteRule})})}function Ya({mirror:s,stylesheetManager:e},t){var r,i,n;let o=null;t.nodeName==="#document"?o=s.getId(t):o=s.getId(R.host(t));let a=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(n=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:n.ShadowRoot,l=a?.prototype?Object.getOwnPropertyDescriptor(a?.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!a||!l?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var u;return(u=l.get)==null?void 0:u.call(this)},set(u){var c;let h=(c=l.set)==null?void 0:c.call(this,u);if(o!==null&&o!==-1)try{e.adoptStyleSheets(u,o)}catch{}return h}}),D(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function Fd({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){let n=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(n,{apply:D((a,l,u)=>{var c;let[h,f,g]=u;if(t.has(h))return n.apply(l,[h,f,g]);let{id:p,styleId:m}=Ce((c=l.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(p&&p!==-1||m&&m!==-1)&&s({id:p,styleId:m,set:{property:h,value:f,priority:g},index:Mr(l.parentRule)}),a.apply(l,u)})});let o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:D((a,l,u)=>{var c;let[h]=u;if(t.has(h))return o.apply(l,[h]);let{id:f,styleId:g}=Ce((c=l.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(f&&f!==-1||g&&g!==-1)&&s({id:f,styleId:g,remove:{property:h},index:Mr(l.parentRule)}),a.apply(l,u)})}),D(()=>{i.CSSStyleDeclaration.prototype.setProperty=n,i.CSSStyleDeclaration.prototype.removeProperty=o})}function Ud({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:n}){let o=D(l=>Ct(D(u=>{let c=Nt(u);if(!c||ee(c,e,t,!0))return;let{currentTime:h,volume:f,muted:g,playbackRate:p,loop:m}=c;s({type:l,id:r.getId(c),currentTime:h,volume:f,muted:g,playbackRate:p,loop:m})}),i.media||500)),a=[q("play",o(Ie.Play),n),q("pause",o(Ie.Pause),n),q("seeked",o(Ie.Seeked),n),q("volumechange",o(Ie.VolumeChange),n),q("ratechange",o(Ie.RateChange),n)];return D(()=>{a.forEach(l=>l())})}function Bd({fontCb:s,doc:e}){let t=e.defaultView;if(!t)return()=>{};let r=[],i=new WeakMap,n=t.FontFace;t.FontFace=function(l,u,c){let h=new n(l,u,c);return i.set(h,{family:l,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),h};let o=ke(e.fonts,"add",function(a){return function(l){return setTimeout(D(()=>{let u=i.get(l);u&&(s(u),i.delete(l))}),0),a.apply(this,[l])}});return r.push(()=>{t.FontFace=n}),r.push(o),D(()=>{r.forEach(a=>a())})}function Wd(s){let{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:n}=s,o=!0,a=D(()=>{let l=e.getSelection();if(!l||o&&l?.isCollapsed)return;o=l.isCollapsed||!1;let u=[],c=l.rangeCount||0;for(let h=0;h<c;h++){let f=l.getRangeAt(h),{startContainer:g,startOffset:p,endContainer:m,endOffset:d}=f;ee(g,r,i,!0)||ee(m,r,i,!0)||u.push({start:t.getId(g),startOffset:p,end:t.getId(m),endOffset:d})}n({ranges:u})});return a(),q("selectionchange",a)}function zd({doc:s,customElementCb:e}){let t=s.defaultView;return!t||!t.customElements?()=>{}:ke(t.customElements,"define",function(i){return function(n,o,a){try{e({define:{name:n}})}catch{console.warn(`Custom element callback failed for ${n}`)}return i.apply(this,[n,o,a])}})}function Vd(s,e){let{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:n,viewportResizeCb:o,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,fontCb:f,selectionCb:g,customElementCb:p}=s;s.mutationCb=(...m)=>{e.mutation&&e.mutation(...m),t(...m)},s.mousemoveCb=(...m)=>{e.mousemove&&e.mousemove(...m),r(...m)},s.mouseInteractionCb=(...m)=>{e.mouseInteraction&&e.mouseInteraction(...m),i(...m)},s.scrollCb=(...m)=>{e.scroll&&e.scroll(...m),n(...m)},s.viewportResizeCb=(...m)=>{e.viewportResize&&e.viewportResize(...m),o(...m)},s.inputCb=(...m)=>{e.input&&e.input(...m),a(...m)},s.mediaInteractionCb=(...m)=>{e.mediaInteaction&&e.mediaInteaction(...m),l(...m)},s.styleSheetRuleCb=(...m)=>{e.styleSheetRule&&e.styleSheetRule(...m),u(...m)},s.styleDeclarationCb=(...m)=>{e.styleDeclaration&&e.styleDeclaration(...m),c(...m)},s.canvasMutationCb=(...m)=>{e.canvasMutation&&e.canvasMutation(...m),h(...m)},s.fontCb=(...m)=>{e.font&&e.font(...m),f(...m)},s.selectionCb=(...m)=>{e.selection&&e.selection(...m),g(...m)},s.customElementCb=(...m)=>{e.customElement&&e.customElement(...m),p(...m)}}function Gd(s,e={}){let t=s.doc.defaultView;if(!t)return()=>{};Vd(s,e);let r;s.recordDOM&&(r=Ga(s,s.doc));let i=Td(s),n=_d(s),o=ja(s),a=kd(s,{win:t}),l=Pd(s),u=Ud(s),c=()=>{},h=()=>{},f=()=>{},g=()=>{};s.recordDOM&&(c=Ld(s,{win:t}),h=Ya(s,s.doc),f=Fd(s,{win:t}),s.collectFonts&&(g=Bd(s)));let p=Wd(s),m=zd(s),d=[];for(let y of s.plugins)d.push(y.observer(y.callback,t,y.options));return D(()=>{De.forEach(y=>y.reset()),r?.disconnect(),i(),n(),o(),a(),l(),u(),c(),h(),f(),g(),p(),m(),d.forEach(y=>y())})}function Kt(s){return typeof window[s]<"u"}function Qt(s){return!!(typeof window[s]<"u"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}var Nr=class{constructor(e){b(this,"iframeIdToRemoteIdMap",new WeakMap),b(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){let n=r||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e),a=n.get(t);return a||(a=this.generateIdFn(),n.set(t,a),o.set(a,t)),a}getIds(e,t){let r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(n=>this.getId(e,n,r,i))}getRemoteId(e,t,r){let i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;let n=i.get(t);return n||-1}getRemoteIds(e,t){let r=this.getRemoteIdToIdMap(e);return t.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}},ti=class{constructor(e){b(this,"iframes",new WeakMap),b(this,"crossOriginIframeMap",new WeakMap),b(this,"crossOriginIframeMirror",new Nr(to)),b(this,"crossOriginIframeStyleMirror"),b(this,"crossOriginIframeRootIdMap",new WeakMap),b(this,"mirror"),b(this,"mutationCb"),b(this,"wrappedEmit"),b(this,"loadListener"),b(this,"stylesheetManager"),b(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Nr(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){let t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;let i=this.crossOriginIframeMap.get(e.source);if(!i)return;let n=this.transformCrossOriginEvent(i,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case E.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:E.IncrementalSnapshot,data:{source:I.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case E.Meta:case E.Load:case E.DomContentLoaded:return!1;case E.Plugin:return t;case E.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case E.IncrementalSnapshot:switch(t.data.source){case I.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(i.node,n)}),t.data.removes.forEach(i=>{this.replaceIds(i,e,["parentId","id"])}),t.data.attributes.forEach(i=>{this.replaceIds(i,e,["id"])}),t.data.texts.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case I.Drag:case I.TouchMove:case I.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case I.ViewportResize:return!1;case I.MediaInteraction:case I.MouseInteraction:case I.Scroll:case I.CanvasMutation:case I.Input:return this.replaceIds(t.data,e,["id"]),t;case I.StyleSheetRule:case I.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case I.Font:return t;case I.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case I.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,e,["styleId"])}),t}}return!1}replace(e,t,r,i){for(let n of i)!Array.isArray(t[n])&&typeof t[n]!="number"||(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):t[n]=e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==ge.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}},ri=class{constructor(e){b(this,"shadowDoms",new WeakSet),b(this,"mutationCb"),b(this,"scrollCb"),b(this,"bypassOptions"),b(this,"mirror"),b(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!lt(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);let r=Ga({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(ja({...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(R.host(e))),this.restoreHandlers.push(Ya({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){let r=this;this.restoreHandlers.push(ke(e.prototype,"attachShadow",function(i){return function(n){let o=i.call(this,n),a=R.shadowRoot(this);return a&&za(this)&&r.addShadowRoot(a,t),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ot=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(it=0;it<ze.length;it++)ot[ze.charCodeAt(it)]=it;var it,jd=function(s){var e=new Uint8Array(s),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=ze[e[t]>>2],i+=ze[(e[t]&3)<<4|e[t+1]>>4],i+=ze[(e[t+1]&15)<<2|e[t+2]>>6],i+=ze[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i},Yd=function(s){var e=s.length*.75,t=s.length,r,i=0,n,o,a,l;s[s.length-1]==="="&&(e--,s[s.length-2]==="="&&e--);var u=new ArrayBuffer(e),c=new Uint8Array(u);for(r=0;r<t;r+=4)n=ot[s.charCodeAt(r)],o=ot[s.charCodeAt(r+1)],a=ot[s.charCodeAt(r+2)],l=ot[s.charCodeAt(r+3)],c[i++]=n<<2|o>>4,c[i++]=(o&15)<<4|a>>2,c[i++]=(a&3)<<6|l&63;return u},Fn=new Map;function Hd(s,e){let t=Fn.get(s);return t||(t=new Map,Fn.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}var Ha=(s,e,t)=>{if(!s||!(Xa(s,e)||typeof s=="object"))return;let r=s.constructor.name,i=Hd(t,r),n=i.indexOf(s);return n===-1&&(n=i.length,i.push(s)),n};function ir(s,e,t){if(s instanceof Array)return s.map(r=>ir(r,e,t));if(s===null)return s;if(s instanceof Float32Array||s instanceof Float64Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Uint8Array||s instanceof Uint16Array||s instanceof Int16Array||s instanceof Int8Array||s instanceof Uint8ClampedArray)return{rr_type:s.constructor.name,args:[Object.values(s)]};if(s instanceof ArrayBuffer){let r=s.constructor.name,i=jd(s);return{rr_type:r,base64:i}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[ir(s.buffer,e,t),s.byteOffset,s.byteLength]};if(s instanceof HTMLImageElement){let r=s.constructor.name,{src:i}=s;return{rr_type:r,src:i}}else if(s instanceof HTMLCanvasElement){let r="HTMLImageElement",i=s.toDataURL();return{rr_type:r,src:i}}else{if(s instanceof ImageData)return{rr_type:s.constructor.name,args:[ir(s.data,e,t),s.width,s.height]};if(Xa(s,e)||typeof s=="object"){let r=s.constructor.name,i=Ha(s,e,t);return{rr_type:r,index:i}}}}return s}var Za=(s,e,t)=>s.map(r=>ir(r,e,t)),Xa=(s,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>s instanceof e[i]);function Zd(s,e,t,r){let i=[],n=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(let o of n)try{if(typeof e.CanvasRenderingContext2D.prototype[o]!="function")continue;let a=ke(e.CanvasRenderingContext2D.prototype,o,function(l){return function(...u){return ee(this.canvas,t,r,!0)||setTimeout(()=>{let c=Za(u,e,this);s(this.canvas,{type:be["2D"],property:o,args:c})},0),l.apply(this,u)}});i.push(a)}catch{let a=zr(e.CanvasRenderingContext2D.prototype,o,{set(l){s(this.canvas,{type:be["2D"],property:o,args:[l],setter:!0})}});i.push(a)}return()=>{i.forEach(o=>o())}}function Xd(s){return s==="experimental-webgl"?"webgl":s}function Un(s,e,t,r){let i=[];try{let n=ke(s.HTMLCanvasElement.prototype,"getContext",function(o){return function(a,...l){if(!ee(this,e,t,!0)){let u=Xd(a);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(l[0]&&typeof l[0]=="object"){let c=l[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return o.apply(this,[a,...l])}});i.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(n=>n())}}function Bn(s,e,t,r,i,n){let o=[],a=Object.getOwnPropertyNames(s);for(let l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof s[l]!="function")continue;let u=ke(s,l,function(c){return function(...h){let f=c.apply(this,h);if(Ha(f,n,this),"tagName"in this.canvas&&!ee(this.canvas,r,i,!0)){let g=Za(h,n,this),p={type:e,property:l,args:g};t(this.canvas,p)}return f}});o.push(u)}catch{let u=zr(s,l,{set(c){t(this.canvas,{type:e,property:l,args:[c],setter:!0})}});o.push(u)}return o}function Jd(s,e,t,r){let i=[];return i.push(...Bn(e.WebGLRenderingContext.prototype,be.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext<"u"&&i.push(...Bn(e.WebGL2RenderingContext.prototype,be.WebGL2,s,t,r,e)),()=>{i.forEach(n=>n())}}var Ja="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Kd=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),Wn=typeof window<"u"&&window.Blob&&new Blob([Kd(Ja)],{type:"text/javascript;charset=utf-8"});function Qd(s){let e;try{if(e=Wn&&(window.URL||window.webkitURL).createObjectURL(Wn),!e)throw"";let t=new Worker(e,{name:s?.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch{return new Worker("data:text/javascript;base64,"+Ja,{name:s?.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}var si=class{constructor(e){b(this,"pendingCanvasMutations",new Map),b(this,"rafStamps",{latestId:0,invokeId:null}),b(this,"mirror"),b(this,"mutationCb"),b(this,"resetObservers"),b(this,"frozen",!1),b(this,"locked",!1),b(this,"processMutation",(l,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(u)});let{sampling:t="all",win:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&t==="all"&&this.initCanvasMutationObserver(r,i,n),o&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,i,n,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,i,n){let o=Un(t,r,i,!0),a=new Map,l=new Qd;l.onmessage=p=>{let{id:m}=p.data;if(a.set(m,!1),!("base64"in p.data))return;let{base64:d,type:y,width:S,height:w}=p.data;this.mutationCb({id:m,type:be["2D"],commands:[{property:"clearRect",args:[0,0,S,w]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:d}],type:y}]},0,0]}]})};let u=1e3/e,c=0,h,f=()=>{let p=[];return t.document.querySelectorAll("canvas").forEach(m=>{ee(m,r,i,!0)||p.push(m)}),p},g=p=>{if(c&&p-c<u){h=requestAnimationFrame(g);return}c=p,f().forEach(async m=>{var d;let y=this.mirror.getId(m);if(a.get(y)||m.width===0||m.height===0)return;if(a.set(y,!0),["webgl","webgl2"].includes(m.__context)){let w=m.getContext(m.__context);((d=w?.getContextAttributes())==null?void 0:d.preserveDrawingBuffer)===!1&&w.clear(w.COLOR_BUFFER_BIT)}let S=await createImageBitmap(m);l.postMessage({id:y,bitmap:S,width:m.width,height:m.height,dataURLOptions:n.dataURLOptions},[S])}),h=requestAnimationFrame(g)};h=requestAnimationFrame(g),this.resetObservers=()=>{o(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=Un(e,t,r,!1),n=Zd(this.processMutation.bind(this),e,t,r),o=Jd(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(e);if(!r||t===-1)return;let i=r.map(o=>{let{type:a,...l}=o;return l}),{type:n}=r[0];this.mutationCb({id:t,type:n,commands:i}),this.pendingCanvasMutations.delete(e)}},ii=class{constructor(e){b(this,"trackedLinkElements",new WeakSet),b(this,"mutationCb"),b(this,"adoptedStyleSheetCb"),b(this,"styleMirror",new xr),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;let r={id:t,styleIds:[]},i=[];for(let n of e){let o;this.styleMirror.has(n)?o=this.styleMirror.getId(n):(o=this.styleMirror.add(n),i.push({styleId:o,rules:Array.from(n.rules||CSSRule,(a,l)=>({rule:qn(a,n.href),index:l}))})),r.styleIds.push(o)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},ni=class{constructor(){b(this,"nodeMap",new WeakMap),b(this,"active",!1)}inOtherBuffer(e,t){let r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},J,nr,ns,Rr=!1;try{if(Array.from([1],s=>s*2)[0]!==2){let s=document.createElement("iframe");document.body.appendChild(s),Array.from=((Fi=s.contentWindow)==null?void 0:Fi.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}var le=eo();function $e(s={}){let{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:n=null,ignoreClass:o="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:f,slimDOMOptions:g,maskInputFn:p,maskTextFn:m,hooks:d,packFn:y,sampling:S={},dataURLOptions:w={},mousemoveWait:v,recordDOM:x=!0,recordCanvas:N=!1,recordCrossOriginIframes:B=!1,recordAfter:F=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",userTriggeredOnInput:Y=!1,collectFonts:K=!1,inlineImages:te=!1,plugins:re,keepIframeSrcFn:A=()=>!1,ignoreCSSAttributes:Me=new Set([]),errorHandler:Ne}=s;Od(Ne);let H=B?window.parent===window:!0,$=!1;if(!H)try{window.parent.document&&($=!1)}catch{$=!0}if(H&&!e)throw new Error("emit function is required");if(!H&&!$)return()=>{};v!==void 0&&S.mousemove===void 0&&(S.mousemove=v),le.reset();let oe=h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:f!==void 0?f:{password:!0},se=no(g);La();let qe,Vr=0,$i=k=>{for(let ae of re||[])ae.eventProcessor&&(k=ae.eventProcessor(k));return y&&!$&&(k=y(k)),k};J=(k,ae)=>{var Z;let X=k;if(X.timestamp=Er(),(Z=De[0])!=null&&Z.isFrozen()&&X.type!==E.FullSnapshot&&!(X.type===E.IncrementalSnapshot&&X.data.source===I.Mutation)&&De.forEach(ie=>ie.unfreeze()),H)e?.($i(X),ae);else if($){let ie={type:"rrweb",event:$i(X),origin:window.location.origin,isCheckout:ae};window.parent.postMessage(ie,"*")}if(X.type===E.FullSnapshot)qe=X,Vr=0;else if(X.type===E.IncrementalSnapshot){if(X.data.source===I.Mutation&&X.data.isAttachIframe)return;Vr++;let ie=r&&Vr>=r,U=t&&X.timestamp-qe.timestamp>t;(ie||U)&&nr(!0)}};let Rt=k=>{J({type:E.IncrementalSnapshot,data:{source:I.Mutation,...k}})},Pi=k=>J({type:E.IncrementalSnapshot,data:{source:I.Scroll,...k}}),Li=k=>J({type:E.IncrementalSnapshot,data:{source:I.CanvasMutation,...k}}),sl=k=>J({type:E.IncrementalSnapshot,data:{source:I.AdoptedStyleSheet,...k}}),Re=new ii({mutationCb:Rt,adoptedStyleSheetCb:sl}),Ae=new ti({mirror:le,mutationCb:Rt,stylesheetManager:Re,recordCrossOriginIframes:B,wrappedEmit:J});for(let k of re||[])k.getMirror&&k.getMirror({nodeMirror:le,crossOriginIframeMirror:Ae.crossOriginIframeMirror,crossOriginIframeStyleMirror:Ae.crossOriginIframeStyleMirror});let Gr=new ni;ns=new si({recordCanvas:N,mutationCb:Li,win:window,blockClass:i,blockSelector:n,mirror:le,sampling:S.canvas,dataURLOptions:w});let At=new ri({mutationCb:Rt,scrollCb:Pi,bypassOptions:{blockClass:i,blockSelector:n,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:oe,dataURLOptions:w,maskTextFn:m,maskInputFn:p,recordCanvas:N,inlineImages:te,sampling:S,slimDOMOptions:se,iframeManager:Ae,stylesheetManager:Re,canvasManager:ns,keepIframeSrcFn:A,processedNodeManager:Gr},mirror:le});nr=(k=!1)=>{if(!x)return;J({type:E.Meta,data:{href:window.location.href,width:ka(),height:_a()}},k),Re.reset(),At.init(),De.forEach(Z=>Z.lock());let ae=Ql(document,{mirror:le,blockClass:i,blockSelector:n,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:oe,maskTextFn:m,maskInputFn:p,slimDOM:se,dataURLOptions:w,recordCanvas:N,inlineImages:te,onSerialize:Z=>{ct(Z,le)&&Ae.addIframe(Z),Ua(Z,le)&&Re.trackLinkElement(Z),Oe(Z)&&At.addShadowRoot(R.shadowRoot(Z),document)},onIframeLoad:(Z,X)=>{Ae.attachIframe(Z,X),At.observeAttachShadow(Z)},onStylesheetLoad:(Z,X)=>{Re.attachLinkElement(Z,X)},keepIframeSrcFn:A});if(!ae)return console.warn("Failed to snapshot the document");J({type:E.FullSnapshot,data:{node:ae,initialOffset:Ta(window)}},k),De.forEach(Z=>Z.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Re.adoptStyleSheets(document.adoptedStyleSheets,le.getId(document))};try{let k=[],ae=X=>{var ie;return D(Gd)({mutationCb:Rt,mousemoveCb:(U,jr)=>J({type:E.IncrementalSnapshot,data:{source:jr,positions:U}}),mouseInteractionCb:U=>J({type:E.IncrementalSnapshot,data:{source:I.MouseInteraction,...U}}),scrollCb:Pi,viewportResizeCb:U=>J({type:E.IncrementalSnapshot,data:{source:I.ViewportResize,...U}}),inputCb:U=>J({type:E.IncrementalSnapshot,data:{source:I.Input,...U}}),mediaInteractionCb:U=>J({type:E.IncrementalSnapshot,data:{source:I.MediaInteraction,...U}}),styleSheetRuleCb:U=>J({type:E.IncrementalSnapshot,data:{source:I.StyleSheetRule,...U}}),styleDeclarationCb:U=>J({type:E.IncrementalSnapshot,data:{source:I.StyleDeclaration,...U}}),canvasMutationCb:Li,fontCb:U=>J({type:E.IncrementalSnapshot,data:{source:I.Font,...U}}),selectionCb:U=>{J({type:E.IncrementalSnapshot,data:{source:I.Selection,...U}})},customElementCb:U=>{J({type:E.IncrementalSnapshot,data:{source:I.CustomElement,...U}})},blockClass:i,ignoreClass:o,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:oe,inlineStylesheet:c,sampling:S,recordDOM:x,recordCanvas:N,inlineImages:te,userTriggeredOnInput:Y,collectFonts:K,doc:X,maskInputFn:p,maskTextFn:m,keepIframeSrcFn:A,blockSelector:n,slimDOMOptions:se,dataURLOptions:w,mirror:le,iframeManager:Ae,stylesheetManager:Re,shadowDomManager:At,processedNodeManager:Gr,canvasManager:ns,ignoreCSSAttributes:Me,plugins:((ie=re?.filter(U=>U.observer))==null?void 0:ie.map(U=>({observer:U.observer,options:U.options,callback:jr=>J({type:E.Plugin,data:{plugin:U.name,payload:jr}})})))||[]},d)};Ae.addLoadListener(X=>{try{k.push(ae(X.contentDocument))}catch(ie){console.warn(ie)}});let Z=()=>{nr(),k.push(ae(document)),Rr=!0};return["interactive","complete"].includes(document.readyState)?Z():(k.push(q("DOMContentLoaded",()=>{J({type:E.DomContentLoaded,data:{}}),F==="DOMContentLoaded"&&Z()})),k.push(q("load",()=>{J({type:E.Load,data:{}}),F==="load"&&Z()},window))),()=>{k.forEach(X=>{try{X()}catch(ie){String(ie).toLowerCase().includes("cross-origin")||console.warn(ie)}}),Gr.destroy(),Rr=!1,Dd()}}catch(k){console.warn(k)}}$e.addCustomEvent=(s,e)=>{if(!Rr)throw new Error("please add custom event after start recording");J({type:E.Custom,data:{tag:s,payload:e}})};$e.freezePage=()=>{De.forEach(s=>s.freeze())};$e.takeFullSnapshot=s=>{if(!Rr)throw new Error("please take full snapshot after start recording");nr(s)};$e.mirror=le;function Ka(s){return{all:s=s||new Map,on:function(e,t){var r=s.get(e);r?r.push(t):s.set(e,[t])},off:function(e,t){var r=s.get(e);r&&(t?r.splice(r.indexOf(t)>>>0,1):s.set(e,[]))},emit:function(e,t){var r=s.get(e);r&&r.slice().map(function(i){i(t)}),(r=s.get("*"))&&r.slice().map(function(i){i(e,t)})}}}var qd=Object.freeze(Object.defineProperty({__proto__:null,default:Ka},Symbol.toStringTag,{value:"Module"}));function ep(s=window,e=document){if("scrollBehavior"in e.documentElement.style&&s.__forceSmoothScrollPolyfill__!==!0)return;let t=s.HTMLElement||s.Element,r=468,i={scroll:s.scroll||s.scrollTo,scrollBy:s.scrollBy,elementScroll:t.prototype.scroll||l,scrollIntoView:t.prototype.scrollIntoView},n=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now;function o(y){let S=["MSIE ","Trident/","Edge/"];return new RegExp(S.join("|")).test(y)}let a=o(s.navigator.userAgent)?1:0;function l(y,S){this.scrollLeft=y,this.scrollTop=S}function u(y){return .5*(1-Math.cos(Math.PI*y))}function c(y){if(y===null||typeof y!="object"||y.behavior===void 0||y.behavior==="auto"||y.behavior==="instant")return!0;if(typeof y=="object"&&y.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+y.behavior+" is not a valid value for enumeration ScrollBehavior.")}function h(y,S){if(S==="Y")return y.clientHeight+a<y.scrollHeight;if(S==="X")return y.clientWidth+a<y.scrollWidth}function f(y,S){let w=s.getComputedStyle(y,null)["overflow"+S];return w==="auto"||w==="scroll"}function g(y){let S=h(y,"Y")&&f(y,"Y"),w=h(y,"X")&&f(y,"X");return S||w}function p(y){for(;y!==e.body&&g(y)===!1;)y=y.parentNode||y.host;return y}function m(y){let S=n(),w,v,x,N=(S-y.startTime)/r;N=N>1?1:N,w=u(N),v=y.startX+(y.x-y.startX)*w,x=y.startY+(y.y-y.startY)*w,y.method.call(y.scrollable,v,x),(v!==y.x||x!==y.y)&&s.requestAnimationFrame(m.bind(s,y))}function d(y,S,w){let v,x,N,B,F=n();y===e.body?(v=s,x=s.scrollX||s.pageXOffset,N=s.scrollY||s.pageYOffset,B=i.scroll):(v=y,x=y.scrollLeft,N=y.scrollTop,B=l),m({scrollable:v,method:B,startTime:F,startX:x,startY:N,x:S,y:w})}s.scroll=s.scrollTo=function(){if(arguments[0]!==void 0){if(c(arguments[0])===!0){i.scroll.call(s,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:s.scrollX||s.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:s.scrollY||s.pageYOffset);return}d.call(s,e.body,arguments[0].left!==void 0?~~arguments[0].left:s.scrollX||s.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:s.scrollY||s.pageYOffset)}},s.scrollBy=function(){if(arguments[0]!==void 0){if(c(arguments[0])){i.scrollBy.call(s,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}d.call(s,e.body,~~arguments[0].left+(s.scrollX||s.pageXOffset),~~arguments[0].top+(s.scrollY||s.pageYOffset))}},t.prototype.scroll=t.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(c(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}let y=arguments[0].left,S=arguments[0].top;d.call(this,this,typeof y>"u"?this.scrollLeft:~~y,typeof S>"u"?this.scrollTop:~~S)},t.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(c(arguments[0])===!0){i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},t.prototype.scrollIntoView=function(){if(c(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}let y=p(this),S=y.getBoundingClientRect(),w=this.getBoundingClientRect();y!==e.body?(d.call(this,y,y.scrollLeft+w.left-S.left,y.scrollTop+w.top-S.top),s.getComputedStyle(y).position!=="fixed"&&s.scrollBy({left:S.left,top:S.top,behavior:"smooth"})):s.scrollBy({left:w.left,top:w.top,behavior:"smooth"})}}var oi=class{constructor(e=[],t){b(this,"timeOffset",0),b(this,"speed"),b(this,"actions"),b(this,"raf",null),b(this,"lastTimestamp"),this.actions=e,this.speed=t.speed}addAction(e){let t=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{let r=this.findActionIndex(e);this.actions.splice(r,0,e)}t&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){let e=performance.now();for(this.timeOffset+=(e-this.lastTimestamp)*this.speed,this.lastTimestamp=e;this.actions.length;){let t=this.actions[0];if(this.timeOffset>=t.delay)this.actions.shift(),t.doAction();else break}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(this.raf!==!0&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return this.raf!==null}findActionIndex(e){let t=0,r=this.actions.length-1;for(;t<=r;){let i=Math.floor((t+r)/2);if(this.actions[i].delay<e.delay)t=i+1;else if(this.actions[i].delay>e.delay)r=i-1;else return i+1}return t}};function zn(s,e){if(s.type===E.IncrementalSnapshot&&s.data.source===I.MouseMove&&s.data.positions&&s.data.positions.length){let t=s.data.positions[0].timeOffset,r=s.timestamp+t;return s.delay=r-e,r-e}return s.delay=s.timestamp-e,s.delay}function Vn(s,e){var t=typeof Symbol=="function"&&s[Symbol.iterator];if(!t)return s;var r,i,n=t.call(s),o=[];try{for(;(e===void 0||e-- >0)&&!(r=n.next()).done;)o.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(i)throw i.error}}return o}var Ve;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(Ve||(Ve={}));var Qa={type:"xstate.init"};function os(s){return s===void 0?[]:[].concat(s)}function Ue(s){return{type:"xstate.assign",assignment:s}}function Gn(s,e){return typeof(s=typeof s=="string"&&e&&e[s]?e[s]:s)=="string"?{type:s}:typeof s=="function"?{type:s.name,exec:s}:s}function Ar(s){return function(e){return s===e}}function qa(s){return typeof s=="string"?{type:s}:s}function jn(s,e){return{value:s,context:e,actions:[],changed:!1,matches:Ar(s)}}function Yn(s,e,t){var r=e,i=!1;return[s.filter(function(n){if(n.type==="xstate.assign"){i=!0;var o=Object.assign({},r);return typeof n.assignment=="function"?o=n.assignment(r,t):Object.keys(n.assignment).forEach(function(a){o[a]=typeof n.assignment[a]=="function"?n.assignment[a](r,t):n.assignment[a]}),r=o,!1}return!0}),r,i]}function el(s,e){e===void 0&&(e={});var t=Vn(Yn(os(s.states[s.initial].entry).map(function(o){return Gn(o,e.actions)}),s.context,Qa),2),r=t[0],i=t[1],n={config:s,_options:e,initialState:{value:s.initial,actions:r,context:i,matches:Ar(s.initial)},transition:function(o,a){var l,u,c=typeof o=="string"?{value:o,context:s.context}:o,h=c.value,f=c.context,g=qa(a),p=s.states[h];if(p.on){var m=os(p.on[g.type]);try{for(var d=(function($){var oe=typeof Symbol=="function"&&Symbol.iterator,se=oe&&$[oe],qe=0;if(se)return se.call($);if($&&typeof $.length=="number")return{next:function(){return $&&qe>=$.length&&($=void 0),{value:$&&$[qe++],done:!$}}};throw new TypeError(oe?"Object is not iterable.":"Symbol.iterator is not defined.")})(m),y=d.next();!y.done;y=d.next()){var S=y.value;if(S===void 0)return jn(h,f);var w=typeof S=="string"?{target:S}:S,v=w.target,x=w.actions,N=x===void 0?[]:x,B=w.cond,F=B===void 0?function(){return!0}:B,Y=v===void 0,K=v??h,te=s.states[K];if(F(f,g)){var re=Vn(Yn((Y?os(N):[].concat(p.exit,N,te.entry).filter(function($){return $})).map(function($){return Gn($,n._options.actions)}),f,g),3),A=re[0],Me=re[1],Ne=re[2],H=v??h;return{value:H,context:Me,actions:A,changed:v!==h||A.length>0||Ne,matches:Ar(H)}}}}catch($){l={error:$}}finally{try{y&&!y.done&&(u=d.return)&&u.call(d)}finally{if(l)throw l.error}}}return jn(h,f)}};return n}var Hn=function(s,e){return s.actions.forEach(function(t){var r=t.exec;return r&&r(s.context,e)})};function tl(s){var e=s.initialState,t=Ve.NotStarted,r=new Set,i={_machine:s,send:function(n){t===Ve.Running&&(e=s.transition(e,n),Hn(e,qa(n)),r.forEach(function(o){return o(e)}))},subscribe:function(n){return r.add(n),n(e),{unsubscribe:function(){return r.delete(n)}}},start:function(n){if(n){var o=typeof n=="object"?n:{context:s.config.context,value:n};e={value:o.value,actions:[],context:o.context,matches:Ar(o.value)}}return t=Ve.Running,Hn(e,Qa),i},stop:function(){return t=Ve.Stopped,r.clear(),i},get state(){return e},get status(){return t}};return i}function tp(s,e){for(let t=s.length-1;t>=0;t--){let r=s[t];if(r.type===E.Meta&&r.timestamp<=e)return s.slice(t)}return s}function rp(s,{getCastFn:e,applyEventsSynchronously:t,emitter:r}){let i=el({id:"player",context:s,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:Ue({lastPlayedEvent:(n,o)=>o.type==="CAST_EVENT"?o.payload.event:n.lastPlayedEvent}),recordTimeOffset:Ue((n,o)=>{let a=n.timeOffset;return"payload"in o&&"timeOffset"in o.payload&&(a=o.payload.timeOffset),{...n,timeOffset:a,baselineTime:n.events[0].timestamp+a}}),play(n){var o;let{timer:a,events:l,baselineTime:u,lastPlayedEvent:c}=n;a.clear();for(let p of l)zn(p,u);let h=tp(l,u),f=c?.timestamp;c?.type===E.IncrementalSnapshot&&c.data.source===I.MouseMove&&(f=c.timestamp+((o=c.data.positions[0])==null?void 0:o.timeOffset)),u<(f||0)&&r.emit(T.PlayBack);let g=new Array;for(let p of h)if(!(f&&f<u&&(p.timestamp<=f||p===c)))if(p.timestamp<u)g.push(p);else{let m=e(p,!1);a.addAction({doAction:()=>{m()},delay:p.delay})}t(g),r.emit(T.Flush),a.start()},pause(n){n.timer.clear()},resetLastPlayedEvent:Ue(n=>({...n,lastPlayedEvent:null})),startLive:Ue({baselineTime:(n,o)=>(n.timer.start(),o.type==="TO_LIVE"&&o.payload.baselineTime?o.payload.baselineTime:Date.now())}),addEvent:Ue((n,o)=>{let{baselineTime:a,timer:l,events:u}=n;if(o.type==="ADD_EVENT"){let{event:c}=o.payload;zn(c,a);let h=u.length-1;if(!u[h]||u[h].timestamp<=c.timestamp)u.push(c);else{let p=-1,m=0;for(;m<=h;){let d=Math.floor((m+h)/2);u[d].timestamp<=c.timestamp?m=d+1:h=d-1}p===-1&&(p=m),u.splice(p,0,c)}let f=c.timestamp<a,g=e(c,f);f?g():l.isActive()&&l.addAction({doAction:()=>{g()},delay:c.delay})}return{...n,events:u}})}});return tl(i)}function sp(s){let e=el({id:"speed",context:s,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(t,r)=>{"payload"in r&&t.timer.setSpeed(r.payload.speed)},recordSpeed:Ue({normalSpeed:t=>t.timer.speed}),restoreSpeed:t=>{t.timer.setSpeed(t.normalSpeed)}}});return tl(e)}var ip=s=>[`.${s} { background: currentColor }`,"noscript { display: none !important; }"],Zn=new Map;function rl(s,e){let t=Zn.get(s);return t||(t=new Map,Zn.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}function Ee(s,e,t){return async r=>{if(r&&typeof r=="object"&&"rr_type"in r)if(t&&(t.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){let i=await Ee(s,e,t)(r.args);return await createImageBitmap.apply(null,i)}else if("index"in r){if(t||e===null)return r;let{rr_type:i,index:n}=r;return rl(e,i)[n]}else if("args"in r){let{rr_type:i,args:n}=r,o=window[i];return new o(...await Promise.all(n.map(Ee(s,e,t))))}else{if("base64"in r)return Yd(r.base64);if("src"in r){let i=s.get(r.src);if(i)return i;{let n=new Image;return n.src=r.src,s.set(r.src,n),n}}else if("data"in r&&r.rr_type==="Blob"){let i=await Promise.all(r.data.map(Ee(s,e,t)));return new Blob(i,{type:r.type})}}else if(Array.isArray(r))return await Promise.all(r.map(Ee(s,e,t)));return r}}function np(s,e){try{return e===be.WebGL?s.getContext("webgl")||s.getContext("experimental-webgl"):s.getContext("webgl2")}catch{return null}}var op=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function ap(s,e){if(!e?.constructor)return;let{name:t}=e.constructor;if(!op.includes(t))return;let r=rl(s,t);r.includes(e)||r.push(e)}async function lp({mutation:s,target:e,type:t,imageMap:r,errorHandler:i}){try{let n=np(e,t);if(!n)return;if(s.setter){n[s.property]=s.args[0];return}let o=n[s.property],a=await Promise.all(s.args.map(Ee(r,n))),l=o.apply(n,a);ap(n,l);let u=!1}catch(n){i(s,n)}}async function up({event:s,mutations:e,target:t,imageMap:r,errorHandler:i}){let n=t.getContext("2d");if(!n){i(e[0],new Error("Canvas context is null"));return}let o=e.map(async l=>Promise.all(l.args.map(Ee(r,n))));(await Promise.all(o)).forEach((l,u)=>{let c=e[u];try{if(c.setter){n[c.property]=c.args[0];return}let h=n[c.property];c.property==="drawImage"&&typeof c.args[0]=="string"?(r.get(s),h.apply(n,c.args)):h.apply(n,l)}catch(h){i(c,h)}})}async function Xn({event:s,mutation:e,target:t,imageMap:r,canvasEventMap:i,errorHandler:n}){try{let o=i.get(s)||e,a="commands"in o?o.commands:[o];if([be.WebGL,be.WebGL2].includes(e.type)){for(let l=0;l<a.length;l++){let u=a[l];await lp({mutation:u,type:e.type,target:t,imageMap:r,errorHandler:n})}return}await up({event:s,mutations:a,target:t,imageMap:r,errorHandler:n})}catch(o){n(e,o)}}var ai=class{constructor(e){b(this,"mediaMap",new Map),b(this,"warn"),b(this,"service"),b(this,"speedService"),b(this,"emitter"),b(this,"getCurrentTime"),b(this,"metadataCallbackMap",new Map),this.warn=e.warn,this.service=e.service,this.speedService=e.speedService,this.emitter=e.emitter,this.getCurrentTime=e.getCurrentTime,this.emitter.on(T.Start,this.start.bind(this)),this.emitter.on(T.SkipStart,this.start.bind(this)),this.emitter.on(T.Pause,this.pause.bind(this)),this.emitter.on(T.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach((t,r)=>{this.syncTargetWithState(r),e.pause&&r.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:t,mediaState:r}){if(r.isPlaying){let n=(e-r.lastInteractionTimeOffset)/1e3*r.playbackRate,o="duration"in t&&t.duration;if(Number.isNaN(o)){this.waitForMetadata(t);return}let a=r.currentTimeAtLastInteraction+n;t.loop&&o!==!1&&(a=a%o),t.currentTime=a}else t.pause(),t.currentTime=r.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e)||!("addEventListener"in e))return;let t=()=>{this.metadataCallbackMap.delete(e);let r=this.mediaMap.get(e);r&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:r})};this.metadataCallbackMap.set(e,t),e.addEventListener("loadedmetadata",t,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:t,mutation:r}){let i=this.mediaMap.get(e),{type:n,playbackRate:o,currentTime:a,muted:l,volume:u,loop:c}=r;return{isPlaying:n===Ie.Play||n!==Ie.Pause&&(i?.isPlaying||e.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:a??i?.currentTimeAtLastInteraction??0,lastInteractionTimeOffset:t,playbackRate:o??i?.playbackRate??1,volume:u??i?.volume??1,muted:l??i?.muted??e.getAttribute("muted")===null,loop:c??i?.loop??e.getAttribute("loop")===null}}syncTargetWithState(e){let t=this.mediaMap.get(e);if(!t)return;let{muted:r,loop:i,volume:n,isPlaying:o}=t,a=this.service.state.matches("paused"),l=t.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:e,mediaState:t}),e.volume!==n&&(e.volume=n),e.muted=r,e.loop=i,e.playbackRate!==l&&(e.playbackRate=l),o&&!a?e.play():e.pause()}catch(u){this.warn(`Failed to replay media interactions: ${u.message||u}`)}}addMediaElements(e,t,r){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;let i=e,n=r.getMeta(i);if(!n||!("attributes"in n))return;let o=this.service.state.matches("paused"),a=n.attributes,l=!1;a.rr_mediaState?l=a.rr_mediaState==="played":l=i.getAttribute("autoplay")!==null,l&&o&&i.pause();let u=1;typeof a.rr_mediaPlaybackRate=="number"&&(u=a.rr_mediaPlaybackRate);let c=!1;typeof a.rr_mediaMuted=="boolean"?c=a.rr_mediaMuted:c=i.getAttribute("muted")!==null;let h=!1;typeof a.rr_mediaLoop=="boolean"?h=a.rr_mediaLoop:h=i.getAttribute("loop")!==null;let f=1;typeof a.rr_mediaVolume=="number"&&(f=a.rr_mediaVolume);let g=0;typeof a.rr_mediaCurrentTime=="number"&&(g=a.rr_mediaCurrentTime),this.mediaMap.set(i,{isPlaying:l,currentTimeAtLastInteraction:g,lastInteractionTimeOffset:t,playbackRate:u,volume:f,muted:c,loop:h}),this.syncTargetWithState(i)}mediaMutation({target:e,timeOffset:t,mutation:r}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:t,mutation:r})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return["AUDIO","VIDEO"].includes(e.nodeName)}reset(){this.mediaMap.clear()}};function qt(s,e){if(s.nodeName!=="DIALOG"||s instanceof ue)return;let t=s,r=t.open,i=r&&t.matches("dialog:modal"),n=t.getAttribute("rr_open_mode"),o=typeof e?.attributes.open=="string"||typeof t.getAttribute("open")=="string",a=n==="modal";if(!(r&&!(i&&n==="non-modal"||!i&&a))){if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}r&&t.close(),o&&(a?t.showModal():t.show())}}function cp(s,e){if(s.nodeName!=="DIALOG"||s instanceof ue)return;let t=s;if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}e.attributes.open===null&&(t.removeAttribute("open"),t.removeAttribute("rr_open_mode"))}var hp=5*1e3,fp=Ka||qd,Jn="[replayer]",as={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Kn(s){return s.type==E.IncrementalSnapshot&&(s.data.source==I.TouchMove||s.data.source==I.MouseInteraction&&s.data.type==_.TouchStart)}var Or=class{constructor(e,t){if(b(this,"wrapper"),b(this,"iframe"),b(this,"service"),b(this,"speedService"),b(this,"config"),b(this,"usingVirtualDom",!1),b(this,"virtualDom",new Ke),b(this,"mouse"),b(this,"mouseTail",null),b(this,"tailPositions",[]),b(this,"emitter",fp()),b(this,"nextUserInteractionEvent"),b(this,"legacy_missingNodeRetryMap",{}),b(this,"cache",cn()),b(this,"imageMap",new Map),b(this,"canvasEventMap",new Map),b(this,"mirror",eo()),b(this,"styleMirror",new xr),b(this,"mediaManager"),b(this,"firstFullSnapshot",null),b(this,"newDocumentQueue",[]),b(this,"mousePos",null),b(this,"touchActive",null),b(this,"lastMouseDownEvent",null),b(this,"lastHoveredRootNode"),b(this,"lastSelectionData",null),b(this,"constructedStyleMutations",[]),b(this,"adoptedStyleSheets",[]),b(this,"handleResize",a=>{this.iframe.style.display="inherit";for(let l of[this.mouseTail,this.iframe])l&&(l.setAttribute("width",String(a.width)),l.setAttribute("height",String(a.height)))}),b(this,"applyEventsSynchronously",a=>{for(let l of a){switch(l.type){case E.DomContentLoaded:case E.Load:case E.Custom:continue;case E.FullSnapshot:case E.Meta:case E.Plugin:case E.IncrementalSnapshot:break}this.getCastFn(l,!0)()}}),b(this,"getCastFn",(a,l=!1)=>{let u;switch(a.type){case E.DomContentLoaded:case E.Load:break;case E.Custom:u=()=>{this.emitter.emit(T.CustomEvent,a)};break;case E.Meta:u=()=>this.emitter.emit(T.Resize,{width:a.data.width,height:a.data.height});break;case E.FullSnapshot:u=()=>{var h;if(this.firstFullSnapshot){if(this.firstFullSnapshot===a){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(a,l),(h=this.iframe.contentWindow)==null||h.scrollTo(a.data.initialOffset)};break;case E.IncrementalSnapshot:u=()=>{if(this.applyIncremental(a,l),!l&&(a===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(let h of this.service.state.context.events)if(!(h.timestamp<=a.timestamp)&&this.isUserInteraction(h)){h.delay-a.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=h);break}if(this.nextUserInteractionEvent){let h=this.nextUserInteractionEvent.delay-a.delay,f={speed:Math.min(Math.round(h/hp),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:f}),this.emitter.emit(T.SkipStart,f)}}};break}return()=>{u&&u();for(let f of this.config.plugins||[])f.handler&&f.handler(a,l,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:a}});let h=this.service.state.context.events.length-1;if(!this.config.liveMode&&a===this.service.state.context.events[h]){let f=()=>{h<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(T.Finish))},g=50;a.type===E.IncrementalSnapshot&&a.data.source===I.MouseMove&&a.data.positions.length&&(g+=Math.max(0,-a.data.positions[0].timeOffset)),setTimeout(f,g)}this.emitter.emit(T.EventCast,a)}}),!t?.liveMode&&e.length<2)throw new Error("Replayer need at least 2 events.");let r={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,inactivePeriodThreshold:10*1e3,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:as,useVirtualDom:!0,logger:console};this.config=Object.assign({},r,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(T.Resize,this.handleResize),this.setupDom();for(let a of this.config.plugins||[])a.getMirror&&a.getMirror({nodeMirror:this.mirror});this.emitter.on(T.Flush,()=>{if(this.usingVirtualDom){let a={mirror:this.mirror,applyCanvas:(l,u,c)=>{Xn({event:l,mutation:u,target:c,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(l,u)=>{l.source===I.StyleSheetRule?this.applyStyleSheetRule(l,u):l.source===I.StyleDeclaration&&this.applyStyleDeclaration(l,u)},afterAppend:(l,u)=>{for(let c of this.config.plugins||[])c.onBuild&&c.onBuild(l,{id:u,replayer:this})}};if(this.iframe.contentDocument)try{Cr(this.iframe.contentDocument,this.virtualDom,a,this.virtualDom.mirror)}catch(l){console.warn(l)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(let l in this.legacy_missingNodeRetryMap)try{let u=this.legacy_missingNodeRetryMap[l],c=Ir(u.node,this.mirror,this.virtualDom.mirror);Cr(c,u.node,a,this.virtualDom.mirror),u.node=c}catch(u){this.warn(u)}this.constructedStyleMutations.forEach(l=>{this.applyStyleSheetMutation(l)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(l=>{this.applyAdoptedStyleSheet(l)}),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){let[a,l]=this.lastMouseDownEvent;a.dispatchEvent(l)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(T.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});let i=new oi([],{speed:this.config.speed});this.service=rp({events:e.map(a=>t&&t.unpackFn?t.unpackFn(a):a).sort((a,l)=>a.timestamp-l.timestamp),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(a=>{this.emitter.emit(T.StateChange,{player:a})}),this.speedService=sp({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(a=>{this.emitter.emit(T.StateChange,{speed:a})}),this.mediaManager=new ai({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});let n=this.service.state.context.events.find(a=>a.type===E.Meta),o=this.service.state.context.events.find(a=>a.type===E.FullSnapshot);if(n){let{width:a,height:l}=n.data;setTimeout(()=>{this.emitter.emit(T.Resize,{width:a,height:l})},0)}o&&setTimeout(()=>{var a;this.firstFullSnapshot||(this.firstFullSnapshot=o,this.rebuildFullSnapshot(o),(a=this.iframe.contentWindow)==null||a.scrollTo(o.data.initialOffset))},1),this.service.state.context.events.find(Kn)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,t){return this.emitter.on(e,t),this}off(e,t){return this.emitter.off(e,t),this}setConfig(e){Object.keys(e).forEach(t=>{e[t],this.config[t]=e[t]}),this.config.skipInactive||this.backToNormal(),typeof e.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail<"u"&&(e.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getMetaData(){let e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){let{baselineTime:e,events:t}=this.service.state.context;return e-t[0].timestamp}getMirror(){return this.mirror}play(e=0){var t,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(r=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||r.classList.remove("rrweb-paused"),this.emitter.emit(T.Start)}pause(e){var t,r;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(r=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||r.classList.add("rrweb-paused"),this.emitter.emit(T.Pause)}resume(e=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(T.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(T.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){let t=this.config.unpackFn?this.config.unpackFn(e):e;Kn(t)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:t}}))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=cn()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");let e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(ep(this.iframe.contentWindow,this.iframe.contentDocument),La(this.iframe.contentWindow))}rebuildFullSnapshot(e,t=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};let r=[],i=new Set,n=(l,u)=>{if(l.nodeName==="DIALOG"&&i.add(l),this.collectIframeAndAttachDocument(r,l),this.mediaManager.isSupportedMediaElement(l)){let{events:c}=this.service.state.context;this.mediaManager.addMediaElements(l,e.timestamp-c[0].timestamp,this.mirror)}for(let c of this.config.plugins||[])c.onBuild&&c.onBuild(l,{id:u,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),Kc(e.data.node,{doc:this.iframe.contentDocument,afterAppend:n,cache:this.cache,mirror:this.mirror}),n(this.iframe.contentDocument,e.data.node.id);for(let{mutationInQueue:l,builtNode:u}of r)this.attachDocumentToIframe(l,u),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==l);let{documentElement:o,head:a}=this.iframe.contentDocument;this.insertStyleRules(o,a),i.forEach(l=>qt(l)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(T.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var r;let i=ip(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!i.length)if(this.usingVirtualDom){let n=this.virtualDom.createElement("style");this.virtualDom.mirror.add(n,Aa(n,this.virtualDom.unserializedId)),e.insertBefore(n,t),n.rules.push({source:I.StyleSheetRule,adds:i.map((o,a)=>({rule:o,index:a}))})}else{let n=document.createElement("style");e.insertBefore(n,t);for(let o=0;o<i.length;o++)(r=n.sheet)==null||r.insertRule(i[o],o)}}attachDocumentToIframe(e,t){let r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],n=new Set,o=(a,l)=>{a.nodeName==="DIALOG"&&n.add(a),this.collectIframeAndAttachDocument(i,a);let u=r.getMeta(a);if(u?.type===ge.Element&&u?.tagName.toUpperCase()==="HTML"){let{documentElement:c,head:h}=t.contentDocument;this.insertStyleRules(c,h)}if(!this.usingVirtualDom)for(let c of this.config.plugins||[])c.onBuild&&c.onBuild(a,{id:l,replayer:this})};ut(e.node,{doc:t.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:o,cache:this.cache}),o(t.contentDocument,e.node.id);for(let{mutationInQueue:a,builtNode:l}of i)this.attachDocumentToIframe(a,l),this.newDocumentQueue=this.newDocumentQueue.filter(u=>u!==a);n.forEach(a=>qt(a))}collectIframeAndAttachDocument(e,t){if(ct(t,this.mirror)){let r=this.newDocumentQueue.find(i=>i.parentId===this.mirror.getId(t));r&&e.push({mutationInQueue:r,builtNode:t})}}waitForStylesheetLoad(){var e;let t=(e=this.iframe.contentDocument)==null?void 0:e.head;if(t){let r=new Set,i,n=this.service.state,o=()=>{n=this.service.state};this.emitter.on(T.Start,o),this.emitter.on(T.Pause,o);let a=()=>{this.emitter.off(T.Start,o),this.emitter.off(T.Pause,o)};t.querySelectorAll('link[rel="stylesheet"]').forEach(l=>{l.sheet||(r.add(l),l.addEventListener("load",()=>{r.delete(l),r.size===0&&i!==-1&&(n.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(T.LoadStylesheetEnd),i&&clearTimeout(i),a())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(T.LoadStylesheetStart),i=setTimeout(()=>{n.matches("playing")&&this.play(this.getCurrentTime()),i=-1,a()},this.config.loadTimeout))}}async preloadAllImages(){let e=[];for(let t of this.service.state.context.events)t.type===E.IncrementalSnapshot&&t.data.source===I.CanvasMutation&&(e.push(this.deserializeAndPreloadCanvasEvents(t.data,t)),("commands"in t.data?t.data.commands:[t.data]).forEach(i=>{this.preloadImages(i,t)}));return Promise.all(e)}preloadImages(e,t){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(t)){let r=document.createElement("canvas"),i=r.getContext("2d"),n=i?.createImageData(r.width,r.height);i?.putImageData(n,0,0)}}async deserializeAndPreloadCanvasEvents(e,t){if(!this.canvasEventMap.has(t)){let r={isUnchanged:!0};if("commands"in e){let i=await Promise.all(e.commands.map(async n=>{let o=await Promise.all(n.args.map(Ee(this.imageMap,null,r)));return{...n,args:o}}));r.isUnchanged===!1&&this.canvasEventMap.set(t,{...e,commands:i})}else{let i=await Promise.all(e.args.map(Ee(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(t,{...e,args:i})}}}applyIncremental(e,t){var r,i,n;let{data:o}=e;switch(o.source){case I.Mutation:{try{this.applyMutation(o,t)}catch(a){this.warn(`Exception in mutation ${a.message||a}`,o)}break}case I.Drag:case I.TouchMove:case I.MouseMove:if(t){let a=o.positions[o.positions.length-1];this.mousePos={x:a.x,y:a.y,id:a.id,debugData:o}}else o.positions.forEach(a=>{let l={doAction:()=>{this.moveAndHover(a.x,a.y,a.id,t,o)},delay:a.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(l)}),this.timer.addAction({doAction(){},delay:e.delay-((r=o.positions[0])==null?void 0:r.timeOffset)});break;case I.MouseInteraction:{if(o.id===-1)break;let a=new Event(xe(_[o.type])),l=this.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);this.emitter.emit(T.MouseInteraction,{type:o.type,target:l});let{triggerFocus:u}=this.config;switch(o.type){case _.Blur:"blur"in l&&l.blur();break;case _.Focus:u&&l.focus&&l.focus({preventScroll:!0});break;case _.Click:case _.TouchStart:case _.TouchEnd:case _.MouseDown:case _.MouseUp:t?(o.type===_.TouchStart?this.touchActive=!0:o.type===_.TouchEnd&&(this.touchActive=!1),o.type===_.MouseDown?this.lastMouseDownEvent=[l,a]:o.type===_.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:o.x||0,y:o.y||0,id:o.id,debugData:o}):(o.type===_.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(o.x||0,o.y||0,o.id,t,o),o.type===_.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):o.type===_.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):o.type===_.TouchEnd?this.mouse.classList.remove("touch-active"):l.dispatchEvent(a));break;case _.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:l.dispatchEvent(a)}break}case I.Scroll:{if(o.id===-1)break;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(o.id);if(!a)return this.debugNodeNotFound(o,o.id);a.scrollData=o;break}this.applyScroll(o,t);break}case I.ViewportResize:this.emitter.emit(T.Resize,{width:o.width,height:o.height});break;case I.Input:{if(o.id===-1)break;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(o.id);if(!a)return this.debugNodeNotFound(o,o.id);a.inputData=o;break}this.applyInput(o);break}case I.MediaInteraction:{let a=this.usingVirtualDom?this.virtualDom.mirror.getNode(o.id):this.mirror.getNode(o.id);if(!a)return this.debugNodeNotFound(o,o.id);let l=a,{events:u}=this.service.state.context;this.mediaManager.mediaMutation({target:l,timeOffset:e.timestamp-u[0].timestamp,mutation:o});break}case I.StyleSheetRule:case I.StyleDeclaration:{this.usingVirtualDom?o.styleId?this.constructedStyleMutations.push(o):o.id&&((i=this.virtualDom.mirror.getNode(o.id))==null||i.rules.push(o)):this.applyStyleSheetMutation(o);break}case I.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(o.id);if(!a)return this.debugNodeNotFound(o,o.id);a.canvasMutations.push({event:e,mutation:o})}else{let a=this.mirror.getNode(o.id);if(!a)return this.debugNodeNotFound(o,o.id);Xn({event:e,mutation:o,target:a,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case I.Font:{try{let a=new FontFace(o.family,o.buffer?new Uint8Array(JSON.parse(o.fontSource)):o.fontSource,o.descriptors);(n=this.iframe.contentDocument)==null||n.fonts.add(a)}catch(a){this.warn(a)}break}case I.Selection:{if(t){this.lastSelectionData=o;break}this.applySelection(o);break}case I.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(o):this.applyAdoptedStyleSheet(o);break}}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,ld(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(let u in this.legacy_missingNodeRetryMap)try{let c=this.legacy_missingNodeRetryMap[u],h=Ra(c.node,this.virtualDom,this.mirror);h&&(c.node=h)}catch(c){this.warn(c)}let r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(u=>r.getNode(u.id)?!0:(this.warnNodeNotFound(e,u.id),!1)),e.removes.forEach(u=>{var c;let h=r.getNode(u.id);if(!h)return;let f=r.getNode(u.parentId);if(!f)return this.warnNodeNotFound(e,u.parentId);if(u.isShadow&&Oe(f)&&(f=f.shadowRoot),r.removeNodeFromMap(h),f)try{f.removeChild(h),this.usingVirtualDom&&h.nodeName==="#text"&&f.nodeName==="STYLE"&&((c=f.rules)==null?void 0:c.length)>0&&(f.rules=[])}catch(g){if(g instanceof DOMException)this.warn("parent could not remove child in mutation",f,h,e);else throw g}});let i={...this.legacy_missingNodeRetryMap},n=[],o=u=>{let c=null;return u.nextId&&(c=r.getNode(u.nextId)),u.nextId!==null&&u.nextId!==void 0&&u.nextId!==-1&&!c},a=u=>{var c,h;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let f=r.getNode(u.parentId);if(!f)return u.node.type===ge.Document?this.newDocumentQueue.push(u):n.push(u);u.node.isShadow&&(Oe(f)||f.attachShadow({mode:"open"}),f=f.shadowRoot);let g=null,p=null;if(u.previousId&&(g=r.getNode(u.previousId)),u.nextId&&(p=r.getNode(u.nextId)),o(u))return n.push(u);if(u.node.rootId&&!r.getNode(u.node.rootId))return;let m=u.node.rootId?r.getNode(u.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(ct(f,r)){this.attachDocumentToIframe(u,f);return}let d=(w,v)=>{if(!this.usingVirtualDom){qt(w);for(let x of this.config.plugins||[])x.onBuild&&x.onBuild(w,{id:v,replayer:this})}},y=ut(u.node,{doc:m,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:d});if(u.previousId===-1||u.nextId===-1){i[u.node.id]={node:y,mutation:u};return}let S=r.getMeta(f);if(S&&S.type===ge.Element&&u.node.type===ge.Text){let w=Array.isArray(f.childNodes)?f.childNodes:Array.from(f.childNodes);if(S.tagName==="textarea")for(let v of w)v.nodeType===f.TEXT_NODE&&f.removeChild(v);else if(S.tagName==="style"&&w.length===1)for(let v of w)v.nodeType===f.TEXT_NODE&&!r.hasNode(v)&&(y.textContent=v.textContent,f.removeChild(v))}else if(S?.type===ge.Document){let w=f;u.node.type===ge.DocumentType&&((c=w.childNodes[0])==null?void 0:c.nodeType)===Node.DOCUMENT_TYPE_NODE&&w.removeChild(w.childNodes[0]),y.nodeName==="HTML"&&w.documentElement&&w.removeChild(w.documentElement)}if(g&&g.nextSibling&&g.nextSibling.parentNode?f.insertBefore(y,g.nextSibling):p&&p.parentNode?f.contains(p)?f.insertBefore(y,p):f.insertBefore(y,null):f.appendChild(y),d(y,u.node.id),this.usingVirtualDom&&y.nodeName==="#text"&&f.nodeName==="STYLE"&&((h=f.rules)==null?void 0:h.length)>0&&(f.rules=[]),ct(y,this.mirror)){let w=this.mirror.getId(y),v=this.newDocumentQueue.find(x=>x.parentId===w);v&&(this.attachDocumentToIframe(v,y),this.newDocumentQueue=this.newDocumentQueue.filter(x=>x!==v))}(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(i,f,y,u)};e.adds.forEach(u=>{a(u)});let l=Date.now();for(;n.length;){let u=Ed(n);if(n.length=0,Date.now()-l>500){this.warn("Timeout in the loop, please check the resolve tree data:",u);break}for(let c of u)r.getNode(c.value.parentId)?Fa(c,f=>{a(f)}):this.debug("Drop resolve tree since there is no parent for the root node.",c)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),xd(e.texts).forEach(u=>{var c;let h=r.getNode(u.id);if(!h)return e.removes.find(g=>g.id===u.id)?void 0:this.warnNodeNotFound(e,u.id);let f=h.parentElement;if(u.value&&f&&f.tagName==="STYLE"?h.textContent=Pr(u.value,this.cache):h.textContent=u.value,this.usingVirtualDom){let g=h.parentNode;((c=g?.rules)==null?void 0:c.length)>0&&(g.rules=[])}}),e.attributes.forEach(u=>{var c;let h=r.getNode(u.id);if(!h)return e.removes.find(f=>f.id===u.id)?void 0:this.warnNodeNotFound(e,u.id);for(let f in u.attributes)if(typeof f=="string"){let g=u.attributes[f];if(g===null)h.removeAttribute(f),f==="open"&&cp(h,u);else if(typeof g=="string")try{if(f==="_cssText"&&(h.nodeName==="LINK"||h.nodeName==="STYLE"))try{let p=r.getMeta(h),m=ut({...p,attributes:{...p.attributes,...u.attributes}},{doc:h.ownerDocument,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(p.attributes,u.attributes);let d=h.nextSibling,y=h.parentNode;if(m&&y){y.removeChild(h),y.insertBefore(m,d),r.replace(u.id,m);break}}catch{}if(f==="value"&&h.nodeName==="TEXTAREA"){let p=h;p.childNodes.forEach(d=>p.removeChild(d));let m=(c=h.ownerDocument)==null?void 0:c.createTextNode(g);m&&p.appendChild(m)}else h.setAttribute(f,g);f==="rr_open_mode"&&h.nodeName==="DIALOG"&&qt(h,u)}catch(p){this.warn("An error occurred may due to the checkout feature.",p)}else if(f==="style"){let p=g,m=h;for(let d in p)if(p[d]===!1)m.style.removeProperty(d);else if(p[d]instanceof Array){let y=p[d];m.style.setProperty(d,y[0],y[1])}else{let y=p[d];m.style.setProperty(d,y)}}}})}applyScroll(e,t){var r,i;let n=this.mirror.getNode(e.id);if(!n)return this.debugNodeNotFound(e,e.id);let o=this.mirror.getMeta(n);if(n===this.iframe.contentDocument)(r=this.iframe.contentWindow)==null||r.scrollTo({top:e.y,left:e.x,behavior:"auto"});else if(o?.type===ge.Document)(i=n.defaultView)==null||i.scrollTo({top:e.y,left:e.x,behavior:"auto"});else try{n.scrollTo({top:e.y,left:e.x,behavior:"auto"})}catch{}}applyInput(e){let t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch{}}applySelection(e){try{let t=new Set,r=e.ranges.map(({start:i,startOffset:n,end:o,endOffset:a})=>{let l=this.mirror.getNode(i),u=this.mirror.getNode(o);if(!l||!u)return;let c=new Range;c.setStart(l,n),c.setEnd(u,a);let h=l.ownerDocument,f=h?.getSelection();return f&&t.add(f),{range:c,selection:f}});t.forEach(i=>i.removeAllRanges()),r.forEach(i=>{var n;return i&&((n=i.selection)==null?void 0:n.addRange(i.range))})}catch{}}applyStyleSheetMutation(e){var t;let r=null;e.styleId?r=this.styleMirror.getStyle(e.styleId):e.id&&(r=((t=this.mirror.getNode(e.id))==null?void 0:t.sheet)||null),r&&(e.source===I.StyleSheetRule?this.applyStyleSheetRule(e,r):e.source===I.StyleDeclaration&&this.applyStyleDeclaration(e,r))}applyStyleSheetRule(e,t){var r,i,n,o;if((r=e.adds)==null||r.forEach(({rule:a,index:l})=>{try{if(Array.isArray(l)){let{positions:u,index:c}=Tn(l);nt(t.cssRules,u).insertRule(a,c)}else{let u=l===void 0?void 0:Math.min(l,t.cssRules.length);t?.insertRule(a,u)}}catch{}}),(i=e.removes)==null||i.forEach(({index:a})=>{try{if(Array.isArray(a)){let{positions:l,index:u}=Tn(a);nt(t.cssRules,l).deleteRule(u||0)}else t?.deleteRule(a)}catch{}}),e.replace)try{(n=t.replace)==null||n.call(t,e.replace)}catch{}if(e.replaceSync)try{(o=t.replaceSync)==null||o.call(t,e.replaceSync)}catch{}}applyStyleDeclaration(e,t){e.set&&nt(t.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&nt(t.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var t;let r=this.mirror.getNode(e.id);if(!r)return;(t=e.styles)==null||t.forEach(a=>{var l;let u=null,c=null;if(Oe(r)?c=((l=r.ownerDocument)==null?void 0:l.defaultView)||null:r.nodeName==="#document"&&(c=r.defaultView),!!c)try{u=new c.CSSStyleSheet,this.styleMirror.add(u,a.styleId),this.applyStyleSheetRule({source:I.StyleSheetRule,adds:a.rules},u)}catch{}});let i=10,n=0,o=(a,l)=>{let u=l.map(c=>this.styleMirror.getStyle(c)).filter(c=>c!==null);Oe(a)?a.shadowRoot.adoptedStyleSheets=u:a.nodeName==="#document"&&(a.adoptedStyleSheets=u),u.length!==l.length&&n<i&&(setTimeout(()=>o(a,l),0+100*n),n++)};o(r,e.styleIds)}legacy_resolveMissingNode(e,t,r,i){let{previousId:n,nextId:o}=i,a=n&&e[n],l=o&&e[o];if(a){let{node:u,mutation:c}=a;t.insertBefore(u,r),delete e[c.node.id],delete this.legacy_missingNodeRetryMap[c.node.id],(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(e,t,u,c)}if(l){let{node:u,mutation:c}=l;t.insertBefore(u,r.nextSibling),delete e[c.node.id],delete this.legacy_missingNodeRetryMap[c.node.id],(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(e,t,u,c)}}moveAndHover(e,t,r,i,n){let o=this.mirror.getNode(r);if(!o)return this.debugNodeNotFound(n,r);let a=Ba(o,this.iframe),l=e*a.absoluteScale+a.x,u=t*a.absoluteScale+a.y;this.mouse.style.left=`${l}px`,this.mouse.style.top=`${u}px`,i||this.drawMouseTail({x:l,y:u}),this.hoverElements(o)}drawMouseTail(e){if(!this.mouseTail)return;let{lineCap:t,lineWidth:r,strokeStyle:i,duration:n}=this.config.mouseTail===!0?as:Object.assign({},as,this.config.mouseTail),o=()=>{if(!this.mouseTail)return;let a=this.mouseTail.getContext("2d");!a||!this.tailPositions.length||(a.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),a.beginPath(),a.lineWidth=r,a.lineCap=t,a.strokeStyle=i,a.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(l=>a.lineTo(l.x,l.y)),a.stroke())};this.tailPositions.push(e),o(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(a=>a!==e),o()},n/this.speedService.state.context.timer.speed)}hoverElements(e){var t;if(this.config.hoverElements){this.config.hoverElements(e);return}(t=this.lastHoveredRootNode||this.iframe.contentDocument)==null||t.querySelectorAll(".\\:hover").forEach(i=>{i.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let r=e;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(e){return e.type!==E.IncrementalSnapshot?!1:e.data.source>I.Mutation&&e.data.source<=I.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(T.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,t){this.warn(`Node with id '${t}' not found. `,e)}warnCanvasMutationFailed(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)}debugNodeNotFound(e,t){this.debug(`Node with id '${t}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn(Jn,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(Jn,...e)}},{addCustomEvent:Yp}=$e,{freezePage:Hp}=$e,{takeFullSnapshot:Zp}=$e;globalThis.__RipploReplayer=Or;})();
|