-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsentry-replay-lib.fdf87554.async.js
More file actions
12 lines (12 loc) · 122 KB
/
sentry-replay-lib.fdf87554.async.js
File metadata and controls
12 lines (12 loc) · 122 KB
1
2
3
4
5
6
7
8
9
10
11
12
!(function(){"use strict";var ea=Object.defineProperty,ta=Object.defineProperties;var na=Object.getOwnPropertyDescriptors;var gr=Object.getOwnPropertySymbols;var ra=Object.prototype.hasOwnProperty,sa=Object.prototype.propertyIsEnumerable;var yr=(re,G,v)=>G in re?ea(re,G,{enumerable:!0,configurable:!0,writable:!0,value:v}):re[G]=v,R=(re,G)=>{for(var v in G||(G={}))ra.call(G,v)&&yr(re,v,G[v]);if(gr)for(var v of gr(G))sa.call(G,v)&&yr(re,v,G[v]);return re},te=(re,G)=>ta(re,na(G));var H=(re,G,v)=>new Promise((_t,Re)=>{var X=fe=>{try{Fe(v.next(fe))}catch(Ue){Re(Ue)}},St=fe=>{try{Fe(v.throw(fe))}catch(Ue){Re(Ue)}},Fe=fe=>fe.done?_t(fe.value):Promise.resolve(fe.value).then(X,St);Fe((v=v.apply(re,G)).next())});(self.webpackChunk_dext7r_docs=self.webpackChunk_dext7r_docs||[]).push([[549],{96368:function(re,G,v){v.d(G,{Li:function(){return Xo}});var _t=v(24858),Re=v(82973),X=v(60663),St=v(32939),Fe=v(99652),fe=v(7350),Ue=v(96722),Jt=v(53460),_r=v(20328),Sr=v(35074),Qt=v(58114),Et=v(69039),Zt=v(69505),Er=v(89285),L=v(87016),vr=v(89102),vt=v(47954),wr=v(79225),kr=v(75165),Ir=v(45641),br=v(15462),wt=v(44631),en=v(89603),tn=v(66378),nn=v(38638);const B=Sr.GLOBAL_OBJ,kt="sentryReplaySession",Rr="replay_event",It="Unable to send Replay",Mr=3e5,Cr=9e5,Tr=5e3,xr=5500,Ar=6e4,Or=5e3,Dr=3,rn=15e4,Qe=5e3,Lr=3e3,Nr=300,bt=2e7,Pr=4999,Br=15e3,sn=36e5;function Fr(e,t){return e!=null?e:t()}function Ze(e){let t,n=e[0],r=1;for(;r<e.length;){const s=e[r],i=e[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(t=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...o)=>n.call(t,...o)),t=void 0)}return n}var Y;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(Y||(Y={}));function Ur(e){return e.nodeType===e.ELEMENT_NODE}function We(e){const t=Ze([e,"optionalAccess",n=>n.host]);return Ze([t,"optionalAccess",n=>n.shadowRoot])===e}function ze(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Wr(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),e}function zr(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}function et(e){try{const t=e.rules||e.cssRules;return t?Wr(Array.from(t,on).join("")):null}catch(t){return null}}function on(e){let t;if($r(e))try{t=et(e.styleSheet)||zr(e)}catch(n){}else if(jr(e)&&e.selectorText.includes(":"))return Hr(e.cssText);return t||e.cssText}function Hr(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function $r(e){return"styleSheet"in e}function jr(e){return"selectorText"in e}class an{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){if(!t)return-1;const n=Ze([this,"access",r=>r.getMeta,"call",r=>r(t),"optionalAccess",r=>r.id]);return Fr(n,()=>-1)}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){const r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){const r=this.getNode(t);if(r){const s=this.nodeMetaMap.get(r);s&&this.nodeMetaMap.set(n,s)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Kr(){return new an}function tt({maskInputOptions:e,tagName:t,type:n}){return t==="OPTION"&&(t="SELECT"),!!(e[t.toLowerCase()]||n&&e[n]||n==="password"||t==="INPUT"&&!n&&e.text)}function He({isMasked:e,element:t,value:n,maskInputFn:r}){let s=n||"";return e?(r&&(s=r(s,t)),"*".repeat(s.length)):s}function Me(e){return e.toLowerCase()}function Rt(e){return e.toUpperCase()}const cn="__rrweb_original__";function qr(e){const t=e.getContext("2d");if(!t)return!0;const n=50;for(let r=0;r<e.width;r+=n)for(let s=0;s<e.height;s+=n){const i=t.getImageData,o=cn in i?i[cn]:i;if(new Uint32Array(o.call(t,r,s,Math.min(n,e.width-r),Math.min(n,e.height-s)).data.buffer).some(a=>a!==0))return!1}return!0}function Mt(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Me(t):null}function nt(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}let Vr=1;const Yr=new RegExp("[^a-z0-9-_:]"),$e=-2;function Ct(){return Vr++}function Xr(e){if(e instanceof HTMLFormElement)return"form";const t=Me(e.tagName);return Yr.test(t)?"div":t}function Gr(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let Ce,ln;const Jr=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Qr=/^(?:[a-z+]+:)?\/\//i,Zr=/^www\..*/i,es=/^(data:)([^,]*),(.*)/i;function rt(e,t){return(e||"").replace(Jr,(n,r,s,i,o,c)=>{const a=s||o||c,l=r||i||"";if(!a)return n;if(Qr.test(a)||Zr.test(a))return`url(${l}${a}${l})`;if(es.test(a))return`url(${l}${a}${l})`;if(a[0]==="/")return`url(${l}${Gr(t)+a}${l})`;const u=t.split("/"),f=a.split("/");u.pop();for(const d of f)d!=="."&&(d===".."?u.pop():u.push(d));return`url(${l}${u.join("/")}${l})`})}const ts=/^[^ \t\n\r\u000c]+/,ns=/^[, \t\n\r\u000c]+/;function rs(e,t){if(t.trim()==="")return t;let n=0;function r(i){let o;const c=i.exec(t.substring(n));return c?(o=c[0],n+=o.length,o):""}const s=[];for(;r(ns),!(n>=t.length);){let i=r(ts);if(i.slice(-1)===",")i=Te(e,i.substring(0,i.length-1)),s.push(i);else{let o="";i=Te(e,i);let c=!1;for(;;){const a=t.charAt(n);if(a===""){s.push((i+o).trim());break}else if(c)a===")"&&(c=!1);else if(a===","){n+=1,s.push((i+o).trim());break}else a==="("&&(c=!0);o+=a,n+=1}}}return s.join(", ")}function Te(e,t){if(!t||t.trim()==="")return t;const n=e.createElement("a");return n.href=t,n.href}function ss(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Tt(){const e=document.createElement("a");return e.href="",e.href}function un(e,t,n,r,s,i){return r&&(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r[0]!=="#"||n==="background"&&(t==="table"||t==="td"||t==="th")?Te(e,r):n==="srcset"?rs(e,r):n==="style"?rt(r,Tt()):t==="object"&&n==="data"?Te(e,r):typeof i=="function"?i(n,r,s):r)}function dn(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function is(e,t,n,r){try{if(r&&e.matches(r))return!1;if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let s=e.classList.length;s--;){const i=e.classList[s];if(t.test(i))return!0}if(n)return e.matches(n)}catch(s){}return!1}function os(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function Ee(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:Ee(e.parentNode,t,n,r+1)}function xe(e,t){return n=>{const r=n;if(r===null)return!1;try{if(e){if(typeof e=="string"){if(r.matches(`.${e}`))return!0}else if(os(r,e))return!0}return!!(t&&r.matches(t))}catch(s){return!1}}}function Ae(e,t,n,r,s,i){try{const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(o===null)return!1;if(o.tagName==="INPUT"){const l=o.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(l))return!0}let c=-1,a=-1;if(i){if(a=Ee(o,xe(r,s)),a<0)return!0;c=Ee(o,xe(t,n),a>=0?a:1/0)}else{if(c=Ee(o,xe(t,n)),c<0)return!1;a=Ee(o,xe(r,s),c>=0?c:1/0)}return c>=0?a>=0?c<=a:!0:a>=0?!1:!!i}catch(o){}return!!i}function as(e,t,n){const r=e.contentWindow;if(!r)return;let s=!1,i;try{i=r.document.readyState}catch(c){return}if(i!=="complete"){const c=setTimeout(()=>{s||(t(),s=!0)},n);e.addEventListener("load",()=>{clearTimeout(c),s=!0,t()});return}const o="about:blank";if(r.location.href!==o||e.src===o||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function cs(e,t,n){let r=!1,s;try{s=e.sheet}catch(o){return}if(s)return;const i=setTimeout(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{clearTimeout(i),r=!0,t()})}function ls(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskAttributeFn:a,maskTextClass:l,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:d,inlineStylesheet:h,maskInputOptions:p={},maskTextFn:m,maskInputFn:E,dataURLOptions:g={},inlineImages:T,recordCanvas:M,keepIframeSrcFn:x,newlyAddedElement:U=!1}=t,S=us(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:Y.Document,childNodes:[],compatMode:e.compatMode}:{type:Y.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Y.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return fs(e,{doc:n,blockClass:s,blockSelector:i,unblockSelector:o,inlineStylesheet:h,maskAttributeFn:a,maskInputOptions:p,maskInputFn:E,dataURLOptions:g,inlineImages:T,recordCanvas:M,keepIframeSrcFn:x,newlyAddedElement:U,rootId:S,maskAllText:c,maskTextClass:l,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:d});case e.TEXT_NODE:return ds(e,{maskAllText:c,maskTextClass:l,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:d,maskTextFn:m,maskInputOptions:p,maskInputFn:E,rootId:S});case e.CDATA_SECTION_NODE:return{type:Y.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:Y.Comment,textContent:e.textContent||"",rootId:S};default:return!1}}function us(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return n===1?void 0:n}function ds(e,t){const{maskAllText:n,maskTextClass:r,unmaskTextClass:s,maskTextSelector:i,unmaskTextSelector:o,maskTextFn:c,maskInputOptions:a,maskInputFn:l,rootId:u}=t,f=e.parentNode&&e.parentNode.tagName;let d=e.textContent;const h=f==="STYLE"?!0:void 0,p=f==="SCRIPT"?!0:void 0,m=f==="TEXTAREA"?!0:void 0;if(h&&d){try{e.nextSibling||e.previousSibling||Ze([e,"access",g=>g.parentNode,"access",g=>g.sheet,"optionalAccess",g=>g.cssRules])&&(d=et(e.parentNode.sheet))}catch(g){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${g}`,e)}d=rt(d,Tt())}p&&(d="SCRIPT_PLACEHOLDER");const E=Ae(e,r,i,s,o,n);if(!h&&!p&&!m&&d&&E&&(d=c?c(d):d.replace(/[\S]/g,"*")),m&&d&&(a.textarea||E)&&(d=l?l(d,e.parentNode):d.replace(/[\S]/g,"*")),f==="OPTION"&&d){const g=tt({type:null,tagName:f,maskInputOptions:a});d=He({isMasked:Ae(e,r,i,s,o,g),element:e,value:d,maskInputFn:l})}return{type:Y.Text,textContent:d||"",isStyle:h,rootId:u}}function fs(e,t){const{doc:n,blockClass:r,blockSelector:s,unblockSelector:i,inlineStylesheet:o,maskInputOptions:c={},maskAttributeFn:a,maskInputFn:l,dataURLOptions:u={},inlineImages:f,recordCanvas:d,keepIframeSrcFn:h,newlyAddedElement:p=!1,rootId:m,maskAllText:E,maskTextClass:g,unmaskTextClass:T,maskTextSelector:M,unmaskTextSelector:x}=t,U=is(e,r,s,i),S=Xr(e);let y={};const A=e.attributes.length;for(let _=0;_<A;_++){const b=e.attributes[_];b.name&&!dn(S,b.name,b.value)&&(y[b.name]=un(n,S,Me(b.name),b.value,e,a))}if(S==="link"&&o){const _=Array.from(n.styleSheets).find(W=>W.href===e.href);let b=null;_&&(b=et(_)),b&&(delete y.rel,delete y.href,y._cssText=rt(b,_.href))}if(S==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const _=et(e.sheet);_&&(y._cssText=rt(_,Tt()))}if(S==="input"||S==="textarea"||S==="select"||S==="option"){const _=e,b=Mt(_),W=nt(_,Rt(S),b),V=_.checked;if(b!=="submit"&&b!=="button"&&W){const j=Ae(_,g,M,T,x,tt({type:b,tagName:Rt(S),maskInputOptions:c}));y.value=He({isMasked:j,element:_,value:W,maskInputFn:l})}V&&(y.checked=V)}if(S==="option"&&(e.selected&&!c.select?y.selected=!0:delete y.selected),S==="canvas"&&d){if(e.__context==="2d")qr(e)||(y.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){const _=e.toDataURL(u.type,u.quality),b=document.createElement("canvas");b.width=e.width,b.height=e.height;const W=b.toDataURL(u.type,u.quality);_!==W&&(y.rr_dataURL=_)}}if(S==="img"&&f){Ce||(Ce=n.createElement("canvas"),ln=Ce.getContext("2d"));const _=e,b=_.crossOrigin;_.crossOrigin="anonymous";const W=()=>{_.removeEventListener("load",W);try{Ce.width=_.naturalWidth,Ce.height=_.naturalHeight,ln.drawImage(_,0,0),y.rr_dataURL=Ce.toDataURL(u.type,u.quality)}catch(V){console.warn(`Cannot inline img src=${_.currentSrc}! Error: ${V}`)}b?y.crossOrigin=b:_.removeAttribute("crossorigin")};_.complete&&_.naturalWidth!==0?W():_.addEventListener("load",W)}if((S==="audio"||S==="video")&&(y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime),p||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),U){const{width:_,height:b}=e.getBoundingClientRect();y={class:y.class,rr_width:`${_}px`,rr_height:`${b}px`}}S==="iframe"&&!h(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src);let z;try{customElements.get(S)&&(z=!0)}catch(_){}return{type:Y.Element,tagName:S,attributes:y,childNodes:[],isSVG:ss(e)||void 0,needBlock:U,rootId:m,isCustom:z}}function F(e){return e==null?"":e.toLowerCase()}function hs(e,t){if(t.comment&&e.type===Y.Comment)return!0;if(e.type===Y.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(F(e.attributes.name).match(/^msapplication-tile(image|color)$/)||F(e.attributes.name)==="application-name"||F(e.attributes.rel)==="icon"||F(e.attributes.rel)==="apple-touch-icon"||F(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&F(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(F(e.attributes.property).match(/^(og|twitter|fb):/)||F(e.attributes.name).match(/^(og|twitter):/)||F(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(F(e.attributes.name)==="robots"||F(e.attributes.name)==="googlebot"||F(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(F(e.attributes.name)==="author"||F(e.attributes.name)==="generator"||F(e.attributes.name)==="framework"||F(e.attributes.name)==="publisher"||F(e.attributes.name)==="progid"||F(e.attributes.property).match(/^article:/)||F(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(F(e.attributes.name)==="google-site-verification"||F(e.attributes.name)==="yandex-verification"||F(e.attributes.name)==="csrf-token"||F(e.attributes.name)==="p:domain_verify"||F(e.attributes.name)==="verify-v1"||F(e.attributes.name)==="verification"||F(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Oe(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:f,skipChild:d=!1,inlineStylesheet:h=!0,maskInputOptions:p={},maskAttributeFn:m,maskTextFn:E,maskInputFn:g,slimDOMOptions:T,dataURLOptions:M={},inlineImages:x=!1,recordCanvas:U=!1,onSerialize:S,onIframeLoad:y,iframeLoadTimeout:A=5e3,onStylesheetLoad:z,stylesheetLoadTimeout:_=5e3,keepIframeSrcFn:b=()=>!1,newlyAddedElement:W=!1}=t;let{preserveWhiteSpace:V=!0}=t;const j=ls(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:c,unblockSelector:o,maskTextClass:a,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:f,inlineStylesheet:h,maskInputOptions:p,maskAttributeFn:m,maskTextFn:E,maskInputFn:g,dataURLOptions:M,inlineImages:x,recordCanvas:U,keepIframeSrcFn:b,newlyAddedElement:W});if(!j)return console.warn(e,"not serialized"),null;let ne;r.hasNode(e)?ne=r.getId(e):hs(j,T)||!V&&j.type===Y.Text&&!j.isStyle&&!j.textContent.replace(/^\s+|\s+$/gm,"").length?ne=$e:ne=Ct();const P=Object.assign(j,{id:ne});if(r.add(e,P),ne===$e)return null;S&&S(e);let ue=!d;if(P.type===Y.Element){ue=ue&&!P.needBlock,delete P.needBlock;const $=e.shadowRoot;$&&ze($)&&(P.isShadowHost=!0)}if((P.type===Y.Document||P.type===Y.Element)&&ue){T.headWhitespace&&P.type===Y.Element&&P.tagName==="head"&&(V=!1);const $={doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:c,unblockSelector:o,maskTextClass:a,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:f,skipChild:d,inlineStylesheet:h,maskInputOptions:p,maskAttributeFn:m,maskTextFn:E,maskInputFn:g,slimDOMOptions:T,dataURLOptions:M,inlineImages:x,recordCanvas:U,preserveWhiteSpace:V,onSerialize:S,onIframeLoad:y,iframeLoadTimeout:A,onStylesheetLoad:z,stylesheetLoadTimeout:_,keepIframeSrcFn:b};for(const ee of Array.from(e.childNodes)){const de=Oe(ee,$);de&&P.childNodes.push(de)}if(Ur(e)&&e.shadowRoot)for(const ee of Array.from(e.shadowRoot.childNodes)){const de=Oe(ee,$);de&&(ze(e.shadowRoot)&&(de.isShadow=!0),P.childNodes.push(de))}}return e.parentNode&&We(e.parentNode)&&ze(e.parentNode)&&(P.isShadow=!0),P.type===Y.Element&&P.tagName==="iframe"&&as(e,()=>{const $=e.contentDocument;if($&&y){const ee=Oe($,{doc:$,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:f,skipChild:!1,inlineStylesheet:h,maskInputOptions:p,maskAttributeFn:m,maskTextFn:E,maskInputFn:g,slimDOMOptions:T,dataURLOptions:M,inlineImages:x,recordCanvas:U,preserveWhiteSpace:V,onSerialize:S,onIframeLoad:y,iframeLoadTimeout:A,onStylesheetLoad:z,stylesheetLoadTimeout:_,keepIframeSrcFn:b});ee&&y(e,ee)}},A),P.type===Y.Element&&P.tagName==="link"&&P.attributes.rel==="stylesheet"&&cs(e,()=>{if(z){const $=Oe(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:f,skipChild:!1,inlineStylesheet:h,maskInputOptions:p,maskAttributeFn:m,maskTextFn:E,maskInputFn:g,slimDOMOptions:T,dataURLOptions:M,inlineImages:x,recordCanvas:U,preserveWhiteSpace:V,onSerialize:S,onIframeLoad:y,iframeLoadTimeout:A,onStylesheetLoad:z,stylesheetLoadTimeout:_,keepIframeSrcFn:b});$&&z(e,$)}},_),P}function ps(e,t){const{mirror:n=new an,blockClass:r="rr-block",blockSelector:s=null,unblockSelector:i=null,maskAllText:o=!1,maskTextClass:c="rr-mask",unmaskTextClass:a=null,maskTextSelector:l=null,unmaskTextSelector:u=null,inlineStylesheet:f=!0,inlineImages:d=!1,recordCanvas:h=!1,maskAllInputs:p=!1,maskAttributeFn:m,maskTextFn:E,maskInputFn:g,slimDOM:T=!1,dataURLOptions:M,preserveWhiteSpace:x,onSerialize:U,onIframeLoad:S,iframeLoadTimeout:y,onStylesheetLoad:A,stylesheetLoadTimeout:z,keepIframeSrcFn:_=()=>!1}=t||{};return Oe(e,{doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,maskAllText:o,maskTextClass:c,unmaskTextClass:a,maskTextSelector:l,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:f,maskInputOptions:p===!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}:p===!1?{}:p,maskAttributeFn:m,maskTextFn:E,maskInputFn:g,slimDOMOptions:T===!0||T==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:T==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:T===!1?{}:T,dataURLOptions:M,inlineImages:d,recordCanvas:h,preserveWhiteSpace:x,onSerialize:U,onIframeLoad:S,iframeLoadTimeout:y,onStylesheetLoad:A,stylesheetLoadTimeout:z,keepIframeSrcFn:_,newlyAddedElement:!1})}function pe(e){let t,n=e[0],r=1;for(;r<e.length;){const s=e[r],i=e[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(t=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...o)=>n.call(t,...o)),t=void 0)}return n}function J(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const De=`Please stop import mirror directly. Instead of that,\r
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
or you can use record.mirror to access the mirror instance during recording.`;let fn={map:{},getId(){return console.error(De),-1},getNode(){return console.error(De),null},removeNodeFromMap(){console.error(De)},has(){return console.error(De),!1},reset(){console.error(De)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(fn=new Proxy(fn,{get(e,t,n){return t==="map"&&console.error(De),Reflect.get(e,t,n)}}));function je(e,t,n={}){let r=null,s=0;return function(...i){const o=Date.now();!s&&n.leading===!1&&(s=o);const c=t-(o-s),a=this;c<=0||c>t?(r&&(clearTimeout(r),r=null),s=o,e.apply(a,i)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{s=n.leading===!1?0:Date.now(),r=null,e.apply(a,i)},c))}}function hn(e,t,n,r,s=window){const i=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,r?n:{set(o){setTimeout(()=>{n.set.call(this,o)},0),i&&i.set&&i.set.call(this,o)}}),()=>hn(e,t,i||{},!0)}function xt(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],s=n(r);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=s,()=>{e[t]=r}}catch(r){return()=>{}}}let st=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(st=()=>new Date().getTime());function pn(e){const t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:pe([t,"optionalAccess",n=>n.documentElement,"access",n=>n.scrollLeft])||pe([t,"optionalAccess",n=>n.body,"optionalAccess",n=>n.parentElement,"optionalAccess",n=>n.scrollLeft])||pe([t,"optionalAccess",n=>n.body,"optionalAccess",n=>n.scrollLeft])||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:pe([t,"optionalAccess",n=>n.documentElement,"access",n=>n.scrollTop])||pe([t,"optionalAccess",n=>n.body,"optionalAccess",n=>n.parentElement,"optionalAccess",n=>n.scrollTop])||pe([t,"optionalAccess",n=>n.body,"optionalAccess",n=>n.scrollTop])||0}}function mn(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function gn(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function se(e,t,n,r,s){if(!e)return!1;const i=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!i)return!1;const o=xe(t,n);if(!s){const l=r&&i.matches(r);return o(i)&&!l}const c=Ee(i,o);let a=-1;return c<0?!1:(r&&(a=Ee(i,xe(null,r))),c>-1&&a<0?!0:c<a)}function ms(e,t){return t.getId(e)!==-1}function At(e,t){return t.getId(e)===$e}function yn(e,t){if(We(e))return!1;const n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?yn(e.parentNode,t):!0:!0}function Ot(e){return!!e.changedTouches}function gs(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function _n(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Sn(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Dt(e){return!!pe([e,"optionalAccess",t=>t.shadowRoot])}class ys{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){return(0,_t.h)(this.styleIDMap.get(t),()=>-1)}has(t){return this.styleIDMap.has(t)}add(t,n){if(this.has(t))return this.getId(t);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function En(e){let t=null;return pe([e,"access",n=>n.getRootNode,"optionalCall",n=>n(),"optionalAccess",n=>n.nodeType])===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function _s(e){let t=e,n;for(;n=En(t);)t=n;return t}function Ss(e){const t=e.ownerDocument;if(!t)return!1;const n=_s(e);return t.contains(n)}function vn(e){const t=e.ownerDocument;return t?t.contains(e)||Ss(e):!1}let Lt;function Es(){if(Lt)return Lt;const e=window.document;let t=window.requestAnimationFrame;if(e&&typeof e.createElement=="function")try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);const r=n.contentWindow;r&&r.requestAnimationFrame&&(t=r.requestAnimationFrame),e.head.removeChild(n)}catch(n){}return Lt=t.bind(window)}function vs(...e){return Es()(...e)}var k=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(k||{}),I=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(I||{}),Q=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Q||{}),he=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(he||{});function ws(e){let t,n=e[0],r=1;for(;r<e.length;){const s=e[r],i=e[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(t=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...o)=>n.call(t,...o)),t=void 0)}return n}function wn(e){return"__ln"in e}class ks{constructor(){this.length=0,this.head=null,this.tail=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=ws([n,"optionalAccess",s=>s.next])||null;return n}addNode(t){const n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&wn(t.previousSibling)){const r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&wn(t.nextSibling)&&t.nextSibling.__ln.previous){const r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(t){const n=t.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}const kn=(e,t)=>`${e}@${t}`;class Is{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],n=new Set,r=new ks,s=a=>{let l=a,u=$e;for(;u===$e;)l=l&&l.nextSibling,u=l&&this.mirror.getId(l);return u},i=a=>{if(!a.parentNode||!vn(a))return;const l=We(a.parentNode)?this.mirror.getId(En(a)):this.mirror.getId(a.parentNode),u=s(a);if(l===-1||u===-1)return r.addNode(a);const f=Oe(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:d=>{_n(d,this.mirror)&&this.iframeManager.addIframe(d),Sn(d,this.mirror)&&this.stylesheetManager.trackLinkElement(d),Dt(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,this.doc)},onIframeLoad:(d,h)=>{this.iframeManager.attachIframe(d,h),this.shadowDomManager.observeAttachShadow(d)},onStylesheetLoad:(d,h)=>{this.stylesheetManager.attachLinkElement(d,h)}});f&&(t.push({parentId:l,nextId:u,node:f}),n.add(f.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)In(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||i(a);for(const a of this.addedSet)!Rn(this.droppedSet,a)&&!In(this.removes,a,this.mirror)||Rn(this.movedSet,a)?i(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){const l=this.mirror.getId(o.value.parentNode),u=s(o.value);l!==-1&&u!==-1&&(a=o)}if(!a){let l=r.tail;for(;l;){const u=l;if(l=l.previous,u){const f=this.mirror.getId(u.value.parentNode);if(s(u.value)===-1)continue;if(f!==-1){a=u;break}else{const h=u.value;if(h.parentNode&&h.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const p=h.parentNode.host;if(this.mirror.getId(p)!==-1){a=u;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),i(a.value)}const c={texts:this.texts.map(a=>({id:this.mirror.getId(a.node),value:a.value})).filter(a=>!n.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{const{attributes:l}=a;if(typeof l.style=="string"){const u=JSON.stringify(a.styleDiff),f=JSON.stringify(a._unchangedStyles);u.length<l.style.length&&(u+f).split("var(").length===l.style.split("var(").length&&(l.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:l}}).filter(a=>!n.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:t};!c.texts.length&&!c.attributes.length&&!c.removes.length&&!c.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(c))},this.processMutation=t=>{if(At(t.target,this.mirror))return;let n;try{n=document.implementation.createHTMLDocument()}catch(r){n=this.doc}switch(t.type){case"characterData":{const r=t.target.textContent;!se(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:Ae(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&r?this.maskTextFn?this.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let s=t.attributeName,i=t.target.getAttribute(s);if(s==="value"){const c=Mt(r),a=r.tagName;i=nt(r,a,c);const l=tt({maskInputOptions:this.maskInputOptions,tagName:a,type:c}),u=Ae(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,l);i=He({isMasked:u,element:r,value:i,maskInputFn:this.maskInputFn})}if(se(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||i===t.oldValue)return;let o=this.attributes.find(c=>c.node===t.target);if(r.tagName==="IFRAME"&&s==="src"&&!this.keepIframeSrcFn(i))if(!r.contentDocument)s="rr_src";else return;if(o||(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o)),s==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!dn(r.tagName,s)&&(o.attributes[s]=un(this.doc,Me(r.tagName),Me(s),i,r,this.maskAttributeFn),s==="style")){const c=n.createElement("span");t.oldValue&&c.setAttribute("style",t.oldValue);for(const a of Array.from(r.style)){const l=r.style.getPropertyValue(a),u=r.style.getPropertyPriority(a);l!==c.style.getPropertyValue(a)||u!==c.style.getPropertyPriority(a)?u===""?o.styleDiff[a]=l:o.styleDiff[a]=[l,u]:o._unchangedStyles[a]=[l,u]}for(const a of Array.from(c.style))r.style.getPropertyValue(a)===""&&(o.styleDiff[a]=!1)}break}case"childList":{if(se(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const s=this.mirror.getId(r),i=We(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);se(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||At(r,this.mirror)||!ms(r,this.mirror)||(this.addedSet.has(r)?(Nt(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&s===-1||yn(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[kn(s,i)]?Nt(this.movedSet,r):this.removes.push({parentId:i,id:s,isShadow:We(t.target)&&ze(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,n)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(At(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[kn(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);se(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes.forEach(r=>this.genAdds(r)),Dt(t)&&t.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,t)}))}}}init(t){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(n=>{this[n]=t[n]})}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 Nt(e,t){e.delete(t),t.childNodes.forEach(n=>Nt(e,n))}function In(e,t,n){return e.length===0?!1:bn(e,t,n)}function bn(e,t,n){const{parentNode:r}=t;if(!r)return!1;const s=n.getId(r);return e.some(i=>i.id===s)?!0:bn(e,r,n)}function Rn(e,t){return e.size===0?!1:Mn(e,t)}function Mn(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:Mn(e,n):!1}let Ke;function bs(e){Ke=e}function Rs(){Ke=void 0}const C=e=>Ke?(...n)=>{try{return e(...n)}catch(r){if(Ke&&Ke(r)===!0)return()=>{};throw r}}:e;function ce(e){let t,n=e[0],r=1;for(;r<e.length;){const s=e[r],i=e[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(t=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...o)=>n.call(t,...o)),t=void 0)}return n}const Le=[];function qe(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(t){}return e&&e.target}function Cn(e,t){const n=new Is;Le.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver;const s=ce([window,"optionalAccess",o=>o.Zone,"optionalAccess",o=>o.__symbol__,"optionalCall",o=>o("MutationObserver")]);s&&window[s]&&(r=window[s]);const i=new r(C(o=>{e.onMutation&&e.onMutation(o)===!1||n.processMutations.bind(n)(o)}));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function Ms({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const s=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let o=[],c;const a=je(C(f=>{const d=Date.now()-c;e(o.map(h=>(h.timeOffset-=d,h)),f),o=[],c=null}),i),l=C(je(C(f=>{const d=qe(f),{clientX:h,clientY:p}=Ot(f)?f.changedTouches[0]:f;c||(c=st()),o.push({x:h,y:p,id:r.getId(d),timeOffset:st()-c}),a(typeof DragEvent!="undefined"&&f instanceof DragEvent?I.Drag:f instanceof MouseEvent?I.MouseMove:I.TouchMove)}),s,{trailing:!1})),u=[J("mousemove",l,n),J("touchmove",l,n),J("drag",l,n)];return C(()=>{u.forEach(f=>f())})}function Cs({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const c=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[];let l=null;const u=f=>d=>{const h=qe(d);if(se(h,r,s,i,!0))return;let p=null,m=f;if("pointerType"in d){switch(d.pointerType){case"mouse":p=he.Mouse;break;case"touch":p=he.Touch;break;case"pen":p=he.Pen;break}p===he.Touch?Q[f]===Q.MouseDown?m="TouchStart":Q[f]===Q.MouseUp&&(m="TouchEnd"):he.Pen}else Ot(d)&&(p=he.Touch);p!==null?(l=p,(m.startsWith("Touch")&&p===he.Touch||m.startsWith("Mouse")&&p===he.Mouse)&&(p=null)):Q[f]===Q.Click&&(p=l,l=null);const E=Ot(d)?d.changedTouches[0]:d;if(!E)return;const g=n.getId(h),{clientX:T,clientY:M}=E;C(e)(R({type:Q[m],id:g,x:T,y:M},p!==null&&{pointerType:p}))};return Object.keys(Q).filter(f=>Number.isNaN(Number(f))&&!f.endsWith("_Departed")&&c[f]!==!1).forEach(f=>{let d=Me(f);const h=u(f);if(window.PointerEvent)switch(Q[f]){case Q.MouseDown:case Q.MouseUp:d=d.replace("mouse","pointer");break;case Q.TouchStart:case Q.TouchEnd:return}a.push(J(d,h,t))}),C(()=>{a.forEach(f=>f())})}function Tn({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:o}){const c=C(je(C(a=>{const l=qe(a);if(!l||se(l,r,s,i,!0))return;const u=n.getId(l);if(l===t&&t.defaultView){const f=pn(t.defaultView);e({id:u,x:f.left,y:f.top})}else e({id:u,x:l.scrollLeft,y:l.scrollTop})}),o.scroll||100));return J("scroll",c,t)}function Ts({viewportResizeCb:e},{win:t}){let n=-1,r=-1;const s=C(je(C(()=>{const i=mn(),o=gn();(n!==i||r!==o)&&(e({width:Number(o),height:Number(i)}),n=i,r=o)}),200));return J("resize",s,t)}const xs=["INPUT","TEXTAREA","SELECT"],xn=new WeakMap;function As({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,ignoreClass:o,ignoreSelector:c,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:f,maskTextClass:d,unmaskTextClass:h,maskTextSelector:p,unmaskTextSelector:m}){function E(y){let A=qe(y);const z=y.isTrusted,_=A&&Rt(A.tagName);if(_==="OPTION"&&(A=A.parentElement),!A||!_||xs.indexOf(_)<0||se(A,r,s,i,!0))return;const b=A;if(b.classList.contains(o)||c&&b.matches(c))return;const W=Mt(A);let V=nt(b,_,W),j=!1;const ne=tt({maskInputOptions:a,tagName:_,type:W}),P=Ae(A,d,p,h,m,ne);(W==="radio"||W==="checkbox")&&(j=A.checked),V=He({isMasked:P,element:A,value:V,maskInputFn:l}),g(A,f?{text:V,isChecked:j,userTriggered:z}:{text:V,isChecked:j});const ue=A.name;W==="radio"&&ue&&j&&t.querySelectorAll(`input[type="radio"][name="${ue}"]`).forEach($=>{if($!==A){const ee=He({isMasked:P,element:$,value:nt($,_,W),maskInputFn:l});g($,f?{text:ee,isChecked:!j,userTriggered:!1}:{text:ee,isChecked:!j})}})}function g(y,A){const z=xn.get(y);if(!z||z.text!==A.text||z.isChecked!==A.isChecked){xn.set(y,A);const _=n.getId(y);C(e)(te(R({},A),{id:_}))}}const M=(u.input==="last"?["change"]:["input","change"]).map(y=>J(y,C(E),t)),x=t.defaultView;if(!x)return()=>{M.forEach(y=>y())};const U=x.Object.getOwnPropertyDescriptor(x.HTMLInputElement.prototype,"value"),S=[[x.HTMLInputElement.prototype,"value"],[x.HTMLInputElement.prototype,"checked"],[x.HTMLSelectElement.prototype,"value"],[x.HTMLTextAreaElement.prototype,"value"],[x.HTMLSelectElement.prototype,"selectedIndex"],[x.HTMLOptionElement.prototype,"selected"]];return U&&U.set&&M.push(...S.map(y=>hn(y[0],y[1],{set(){C(E)({target:this,isTrusted:!1})}},!1,x))),C(()=>{M.forEach(y=>y())})}function it(e){const t=[];function n(r,s){if(ot("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||ot("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||ot("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||ot("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const o=Array.from(r.parentRule.cssRules).indexOf(r);s.unshift(o)}else if(r.parentStyleSheet){const o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);s.unshift(o)}return s}return n(e,t)}function me(e,t,n){let r,s;return e?(e.ownerNode?r=t.getId(e.ownerNode):s=n.getId(e),{styleId:s,id:r}):{}}function Os({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const s=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:C((u,f,d)=>{const[h,p]=d,{id:m,styleId:E}=me(f,t,n.styleMirror);return(m&&m!==-1||E&&E!==-1)&&e({id:m,styleId:E,adds:[{rule:h,index:p}]}),u.apply(f,d)})});const i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:C((u,f,d)=>{const[h]=d,{id:p,styleId:m}=me(f,t,n.styleMirror);return(p&&p!==-1||m&&m!==-1)&&e({id:p,styleId:m,removes:[{index:h}]}),u.apply(f,d)})});let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:C((u,f,d)=>{const[h]=d,{id:p,styleId:m}=me(f,t,n.styleMirror);return(p&&p!==-1||m&&m!==-1)&&e({id:p,styleId:m,replace:h}),u.apply(f,d)})}));let c;r.CSSStyleSheet.prototype.replaceSync&&(c=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:C((u,f,d)=>{const[h]=d,{id:p,styleId:m}=me(f,t,n.styleMirror);return(p&&p!==-1||m&&m!==-1)&&e({id:p,styleId:m,replaceSync:h}),u.apply(f,d)})}));const a={};at("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(at("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),at("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),at("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(a).forEach(([u,f])=>{l[u]={insertRule:f.prototype.insertRule,deleteRule:f.prototype.deleteRule},f.prototype.insertRule=new Proxy(l[u].insertRule,{apply:C((d,h,p)=>{const[m,E]=p,{id:g,styleId:T}=me(h.parentStyleSheet,t,n.styleMirror);return(g&&g!==-1||T&&T!==-1)&&e({id:g,styleId:T,adds:[{rule:m,index:[...it(h),E||0]}]}),d.apply(h,p)})}),f.prototype.deleteRule=new Proxy(l[u].deleteRule,{apply:C((d,h,p)=>{const[m]=p,{id:E,styleId:g}=me(h.parentStyleSheet,t,n.styleMirror);return(E&&E!==-1||g&&g!==-1)&&e({id:E,styleId:g,removes:[{index:[...it(h),m]}]}),d.apply(h,p)})})}),C(()=>{r.CSSStyleSheet.prototype.insertRule=s,r.CSSStyleSheet.prototype.deleteRule=i,o&&(r.CSSStyleSheet.prototype.replace=o),c&&(r.CSSStyleSheet.prototype.replaceSync=c),Object.entries(a).forEach(([u,f])=>{f.prototype.insertRule=l[u].insertRule,f.prototype.deleteRule=l[u].deleteRule})})}function An({mirror:e,stylesheetManager:t},n){let r=null;n.nodeName==="#document"?r=e.getId(n):r=e.getId(n.host);const s=n.nodeName==="#document"?ce([n,"access",o=>o.defaultView,"optionalAccess",o=>o.Document]):ce([n,"access",o=>o.ownerDocument,"optionalAccess",o=>o.defaultView,"optionalAccess",o=>o.ShadowRoot]),i=ce([s,"optionalAccess",o=>o.prototype])?Object.getOwnPropertyDescriptor(ce([s,"optionalAccess",o=>o.prototype]),"adoptedStyleSheets"):void 0;return r===null||r===-1||!s||!i?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){return ce([i,"access",o=>o.get,"optionalAccess",o=>o.call,"call",o=>o(this)])},set(o){const c=ce([i,"access",a=>a.set,"optionalAccess",a=>a.call,"call",a=>a(this,o)]);if(r!==null&&r!==-1)try{t.adoptStyleSheets(o,r)}catch(a){}return c}}),C(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function Ds({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:s}){const i=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:C((c,a,l)=>{const[u,f,d]=l;if(n.has(u))return i.apply(a,[u,f,d]);const{id:h,styleId:p}=me(ce([a,"access",m=>m.parentRule,"optionalAccess",m=>m.parentStyleSheet]),t,r.styleMirror);return(h&&h!==-1||p&&p!==-1)&&e({id:h,styleId:p,set:{property:u,value:f,priority:d},index:it(a.parentRule)}),c.apply(a,l)})});const o=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:C((c,a,l)=>{const[u]=l;if(n.has(u))return o.apply(a,[u]);const{id:f,styleId:d}=me(ce([a,"access",h=>h.parentRule,"optionalAccess",h=>h.parentStyleSheet]),t,r.styleMirror);return(f&&f!==-1||d&&d!==-1)&&e({id:f,styleId:d,remove:{property:u},index:it(a.parentRule)}),c.apply(a,l)})}),C(()=>{s.CSSStyleDeclaration.prototype.setProperty=i,s.CSSStyleDeclaration.prototype.removeProperty=o})}function Ls({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:s,sampling:i,doc:o}){const c=C(l=>je(C(u=>{const f=qe(u);if(!f||se(f,t,n,r,!0))return;const{currentTime:d,volume:h,muted:p,playbackRate:m}=f;e({type:l,id:s.getId(f),currentTime:d,volume:h,muted:p,playbackRate:m})}),i.media||500)),a=[J("play",c(0),o),J("pause",c(1),o),J("seeked",c(2),o),J("volumechange",c(3),o),J("ratechange",c(4),o)];return C(()=>{a.forEach(l=>l())})}function Ns({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],s=new WeakMap,i=n.FontFace;n.FontFace=function(a,l,u){const f=new i(a,l,u);return s.set(f,{family:a,buffer:typeof l!="string",descriptors:u,fontSource:typeof l=="string"?l:JSON.stringify(Array.from(new Uint8Array(l)))}),f};const o=xt(t.fonts,"add",function(c){return function(a){return setTimeout(C(()=>{const l=s.get(a);l&&(e(l),s.delete(a))}),0),c.apply(this,[a])}});return r.push(()=>{n.FontFace=i}),r.push(o),C(()=>{r.forEach(c=>c())})}function Ps(e){const{doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,selectionCb:o}=e;let c=!0;const a=C(()=>{const l=t.getSelection();if(!l||c&&ce([l,"optionalAccess",d=>d.isCollapsed]))return;c=l.isCollapsed||!1;const u=[],f=l.rangeCount||0;for(let d=0;d<f;d++){const h=l.getRangeAt(d),{startContainer:p,startOffset:m,endContainer:E,endOffset:g}=h;se(p,r,s,i,!0)||se(E,r,s,i,!0)||u.push({start:n.getId(p),startOffset:m,end:n.getId(E),endOffset:g})}o({ranges:u})});return a(),J("selectionchange",a)}function Bs({doc:e,customElementCb:t}){const n=e.defaultView;return!n||!n.customElements?()=>{}:xt(n.customElements,"define",function(s){return function(i,o,c){try{t({define:{name:i}})}catch(a){}return s.apply(this,[i,o,c])}})}function Fs(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};const r=Cn(e,e.doc),s=Ms(e),i=Cs(e),o=Tn(e),c=Ts(e,{win:n}),a=As(e),l=Ls(e),u=Os(e,{win:n}),f=An(e,e.doc),d=Ds(e,{win:n}),h=e.collectFonts?Ns(e):()=>{},p=Ps(e),m=Bs(e),E=[];for(const g of e.plugins)E.push(g.observer(g.callback,n,g.options));return C(()=>{Le.forEach(g=>g.reset()),r.disconnect(),s(),i(),o(),c(),a(),l(),u(),f(),d(),h(),p(),m(),E.forEach(g=>g())})}function ot(e){return typeof window[e]!="undefined"}function at(e){return!!(typeof window[e]!="undefined"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Pt{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,n,r,s){const i=r||this.getIdToRemoteIdMap(t),o=s||this.getRemoteIdToIdMap(t);let c=i.get(n);return c||(c=this.generateIdFn(),i.set(n,c),o.set(c,n)),c}getIds(t,n){const r=this.getIdToRemoteIdMap(t),s=this.getRemoteIdToIdMap(t);return n.map(i=>this.getId(t,i,r,s))}getRemoteId(t,n,r){const s=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;const i=s.get(n);return i||-1}getRemoteIds(t,n){const r=this.getRemoteIdToIdMap(t);return n.map(s=>this.getRemoteId(t,s,r))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let n=this.iframeIdToRemoteIdMap.get(t);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(t,n)),n}getRemoteIdToIdMap(t){let n=this.iframeRemoteIdToIdMap.get(t);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(t,n)),n}}function On(e){let t,n=e[0],r=1;for(;r<e.length;){const s=e[r],i=e[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(t=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...o)=>n.call(t,...o)),t=void 0)}return n}class Us{constructor(){this.crossOriginIframeMirror=new Pt(Ct),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class Ws{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Pt(Ct),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Pt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,n){this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),On([this,"access",r=>r.loadListener,"optionalCall",r=>r(t)]),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const n=t;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!t.source)return;const s=this.crossOriginIframeMap.get(t.source);if(!s)return;const i=this.transformCrossOriginEvent(s,n.data.event);i&&this.wrappedEmit(i,n.data.isCheckout)}transformCrossOriginEvent(t,n){switch(n.type){case k.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);const r=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(n.data.node,r),{timestamp:n.timestamp,type:k.IncrementalSnapshot,data:{source:I.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case k.Meta:case k.Load:case k.DomContentLoaded:return!1;case k.Plugin:return n;case k.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case k.IncrementalSnapshot:switch(n.data.source){case I.Mutation:return n.data.adds.forEach(r=>{this.replaceIds(r,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,t);const s=this.crossOriginIframeRootIdMap.get(t);s&&this.patchRootIdOnNode(r.node,s)}),n.data.removes.forEach(r=>{this.replaceIds(r,t,["parentId","id"])}),n.data.attributes.forEach(r=>{this.replaceIds(r,t,["id"])}),n.data.texts.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case I.Drag:case I.TouchMove:case I.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case I.ViewportResize:return!1;case I.MediaInteraction:case I.MouseInteraction:case I.Scroll:case I.CanvasMutation:case I.Input:return this.replaceIds(n.data,t,["id"]),n;case I.StyleSheetRule:case I.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case I.Font:return n;case I.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,t,["start","end"])}),n;case I.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),On([n,"access",r=>r.data,"access",r=>r.styles,"optionalAccess",r=>r.forEach,"call",r=>r(s=>{this.replaceStyleIds(s,t,["styleId"])})]),n}}return!1}replace(t,n,r,s){for(const i of s)!Array.isArray(n[i])&&typeof n[i]!="number"||(Array.isArray(n[i])?n[i]=t.getIds(r,n[i]):n[i]=t.getId(r,n[i]));return n}replaceIds(t,n,r){return this.replace(this.crossOriginIframeMirror,t,n,r)}replaceStyleIds(t,n,r){return this.replace(this.crossOriginIframeStyleMirror,t,n,r)}replaceIdOnNode(t,n){this.replaceIds(t,n,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(t,n){t.type!==Y.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class zs{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class Hs{constructor(t){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,n){if(!ze(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);const r=Cn(te(R({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Tn(te(R({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(An({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,n){const r=this;this.restoreHandlers.push(xt(t.prototype,"attachShadow",function(s){return function(i){const o=s.call(this,i);return this.shadowRoot&&vn(this)&&r.addShadowRoot(this.shadowRoot,n),o}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch(n){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}class Dn{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}}class $s{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new ys,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,n){if(t.length===0)return;const r={id:n,styleIds:[]},s=[];for(const i of t){let o;this.styleMirror.has(i)?o=this.styleMirror.getId(i):(o=this.styleMirror.add(i),s.push({styleId:o,rules:Array.from(i.rules||CSSRule,(c,a)=>({rule:on(c),index:a}))})),r.styleIds.push(o)}s.length>0&&(r.styles=s),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class js{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){vs(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(t,n){const r=this.nodeMap.get(t);return r&&Array.from(r).some(s=>s!==n)}add(t,n){this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function q(e){const t=e;return t.timestamp=st(),t}let ct;const ie=Kr();function ge(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:i=null,unblockSelector:o=null,ignoreClass:c="rr-ignore",ignoreSelector:a=null,maskAllText:l=!1,maskTextClass:u="rr-mask",unmaskTextClass:f=null,maskTextSelector:d=null,unmaskTextSelector:h=null,inlineStylesheet:p=!0,maskAllInputs:m,maskInputOptions:E,slimDOMOptions:g,maskAttributeFn:T,maskInputFn:M,maskTextFn:x,packFn:U,sampling:S={},dataURLOptions:y={},mousemoveWait:A,recordCanvas:z=!1,recordCrossOriginIframes:_=!1,recordAfter:b=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:W=!1,collectFonts:V=!1,inlineImages:j=!1,plugins:ne,keepIframeSrcFn:P=()=>!1,ignoreCSSAttributes:ue=new Set([]),errorHandler:$,onMutation:ee,getCanvasManager:de}=e;bs($);const Ge=_?window.parent===window:!0;let ve=!1;if(!Ge)try{window.parent.document&&(ve=!1)}catch(w){ve=!0}if(Ge&&!t)throw new Error("emit function is required");A!==void 0&&S.mousemove===void 0&&(S.mousemove=A),ie.reset();const we=m===!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,radio:!0,checkbox:!0}:E!==void 0?E:{},Be=g===!0||g==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:g==="all",headMetaDescKeywords:g==="all"}:g||{};gs();let Je,Yt=0;const hr=w=>{for(const oe of ne||[])oe.eventProcessor&&(w=oe.eventProcessor(w));return U&&!ve&&(w=U(w)),w},K=(w,oe)=>{if((0,Re.x)([Le,"access",O=>O[0],"optionalAccess",O=>O.isFrozen,"call",O=>O()])&&w.type!==k.FullSnapshot&&!(w.type===k.IncrementalSnapshot&&w.data.source===I.Mutation)&&Le.forEach(O=>O.unfreeze()),Ge)(0,Re.x)([t,"optionalCall",O=>O(hr(w),oe)]);else if(ve){const O={type:"rrweb",event:hr(w),origin:window.location.origin,isCheckout:oe};window.parent.postMessage(O,"*")}if(w.type===k.FullSnapshot)Je=w,Yt=0;else if(w.type===k.IncrementalSnapshot){if(w.data.source===I.Mutation&&w.data.isAttachIframe)return;Yt++;const O=r&&Yt>=r,ae=n&&Je&&w.timestamp-Je.timestamp>n;(O||ae)&&Gt(!0)}},gt=w=>{K(q({type:k.IncrementalSnapshot,data:R({source:I.Mutation},w)}))},pr=w=>K(q({type:k.IncrementalSnapshot,data:R({source:I.Scroll},w)})),Jo=w=>K(q({type:k.IncrementalSnapshot,data:R({source:I.CanvasMutation},w)})),Qo=w=>K(q({type:k.IncrementalSnapshot,data:R({source:I.AdoptedStyleSheet},w)})),ke=new $s({mutationCb:gt,adoptedStyleSheetCb:Qo}),Ie=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new Us:new Ws({mirror:ie,mutationCb:gt,stylesheetManager:ke,recordCrossOriginIframes:_,wrappedEmit:K});for(const w of ne||[])w.getMirror&&w.getMirror({nodeMirror:ie,crossOriginIframeMirror:Ie.crossOriginIframeMirror,crossOriginIframeStyleMirror:Ie.crossOriginIframeStyleMirror});const Xt=new js,mr=qs(de,{mirror:ie,win:window,mutationCb:w=>K(q({type:k.IncrementalSnapshot,data:R({source:I.CanvasMutation},w)})),recordCanvas:z,blockClass:s,blockSelector:i,unblockSelector:o,sampling:S.canvas,dataURLOptions:y,errorHandler:$}),yt=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new zs:new Hs({mutationCb:gt,scrollCb:pr,bypassOptions:{onMutation:ee,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:l,maskTextClass:u,unmaskTextClass:f,maskTextSelector:d,unmaskTextSelector:h,inlineStylesheet:p,maskInputOptions:we,dataURLOptions:y,maskAttributeFn:T,maskTextFn:x,maskInputFn:M,recordCanvas:z,inlineImages:j,sampling:S,slimDOMOptions:Be,iframeManager:Ie,stylesheetManager:ke,canvasManager:mr,keepIframeSrcFn:P,processedNodeManager:Xt},mirror:ie}),Gt=(w=!1)=>{K(q({type:k.Meta,data:{href:window.location.href,width:gn(),height:mn()}}),w),ke.reset(),yt.init(),Le.forEach(O=>O.lock());const oe=ps(document,{mirror:ie,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:l,maskTextClass:u,unmaskTextClass:f,maskTextSelector:d,unmaskTextSelector:h,inlineStylesheet:p,maskAllInputs:we,maskAttributeFn:T,maskInputFn:M,maskTextFn:x,slimDOM:Be,dataURLOptions:y,recordCanvas:z,inlineImages:j,onSerialize:O=>{_n(O,ie)&&Ie.addIframe(O),Sn(O,ie)&&ke.trackLinkElement(O),Dt(O)&&yt.addShadowRoot(O.shadowRoot,document)},onIframeLoad:(O,ae)=>{Ie.attachIframe(O,ae),yt.observeAttachShadow(O)},onStylesheetLoad:(O,ae)=>{ke.attachLinkElement(O,ae)},keepIframeSrcFn:P});if(!oe)return console.warn("Failed to snapshot the document");K(q({type:k.FullSnapshot,data:{node:oe,initialOffset:pn(window)}})),Le.forEach(O=>O.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ke.adoptStyleSheets(document.adoptedStyleSheets,ie.getId(document))};ct=Gt;try{const w=[],oe=ae=>C(Fs)({onMutation:ee,mutationCb:gt,mousemoveCb:(D,be)=>K(q({type:k.IncrementalSnapshot,data:{source:be,positions:D}})),mouseInteractionCb:D=>K(q({type:k.IncrementalSnapshot,data:R({source:I.MouseInteraction},D)})),scrollCb:pr,viewportResizeCb:D=>K(q({type:k.IncrementalSnapshot,data:R({source:I.ViewportResize},D)})),inputCb:D=>K(q({type:k.IncrementalSnapshot,data:R({source:I.Input},D)})),mediaInteractionCb:D=>K(q({type:k.IncrementalSnapshot,data:R({source:I.MediaInteraction},D)})),styleSheetRuleCb:D=>K(q({type:k.IncrementalSnapshot,data:R({source:I.StyleSheetRule},D)})),styleDeclarationCb:D=>K(q({type:k.IncrementalSnapshot,data:R({source:I.StyleDeclaration},D)})),canvasMutationCb:Jo,fontCb:D=>K(q({type:k.IncrementalSnapshot,data:R({source:I.Font},D)})),selectionCb:D=>{K(q({type:k.IncrementalSnapshot,data:R({source:I.Selection},D)}))},customElementCb:D=>{K(q({type:k.IncrementalSnapshot,data:R({source:I.CustomElement},D)}))},blockClass:s,ignoreClass:c,ignoreSelector:a,maskAllText:l,maskTextClass:u,unmaskTextClass:f,maskTextSelector:d,unmaskTextSelector:h,maskInputOptions:we,inlineStylesheet:p,sampling:S,recordCanvas:z,inlineImages:j,userTriggeredOnInput:W,collectFonts:V,doc:ae,maskAttributeFn:T,maskInputFn:M,maskTextFn:x,keepIframeSrcFn:P,blockSelector:i,unblockSelector:o,slimDOMOptions:Be,dataURLOptions:y,mirror:ie,iframeManager:Ie,stylesheetManager:ke,shadowDomManager:yt,processedNodeManager:Xt,canvasManager:mr,ignoreCSSAttributes:ue,plugins:(0,Re.x)([ne,"optionalAccess",D=>D.filter,"call",D=>D(be=>be.observer),"optionalAccess",D=>D.map,"call",D=>D(be=>({observer:be.observer,options:be.options,callback:Zo=>K(q({type:k.Plugin,data:{plugin:be.name,payload:Zo}}))}))])||[]},{});Ie.addLoadListener(ae=>{try{w.push(oe(ae.contentDocument))}catch(D){console.warn(D)}});const O=()=>{Gt(),w.push(oe(document))};return document.readyState==="interactive"||document.readyState==="complete"?O():(w.push(J("DOMContentLoaded",()=>{K(q({type:k.DomContentLoaded,data:{}})),b==="DOMContentLoaded"&&O()})),w.push(J("load",()=>{K(q({type:k.Load,data:{}})),b==="load"&&O()},window))),()=>{w.forEach(ae=>ae()),Xt.destroy(),ct=void 0,Rs()}}catch(w){console.warn(w)}}function Ks(e){if(!ct)throw new Error("please take full snapshot after start recording");ct(e)}ge.mirror=ie,ge.takeFullSnapshot=Ks;function qs(e,t){try{return e?e(t):new Dn}catch(n){return console.warn("Unable to initialize CanvasManager"),new Dn}}const Vs=3,Ys=5;function Bt(e){return e>9999999999?e:e*1e3}function Ft(e){return e>9999999999?e/1e3:e}function Ve(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:k.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:(0,Qt.Fv)(t,10,1e3)}}),t.category==="console")))}const Xs="button,a";function Ln(e){return e.closest(Xs)||e}function Nn(e){const t=Pn(e);return!t||!(t instanceof Element)?t:Ln(t)}function Pn(e){return Gs(e)?e.target:e}function Gs(e){return typeof e=="object"&&!!e&&"target"in e}let ye;function Js(e){return ye||(ye=[],Qs()),ye.push(e),()=>{const t=ye?ye.indexOf(e):-1;t>-1&&ye.splice(t,1)}}function Qs(){(0,Et.hl)(B,"open",function(e){return function(...t){if(ye)try{ye.forEach(n=>n())}catch(n){}return e.apply(B,t)}})}function Zs(e,t,n){e.handleClick(t,n)}class ei{constructor(t,n,r=Ve){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=n.timeout/1e3,this._threshold=n.threshold/1e3,this._scollTimeout=n.scrollTimeout/1e3,this._replay=t,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){const t=Js(()=>{this._lastMutation=Bn()});this._teardown=()=>{t(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(t,n){if(ni(n,this._ignoreSelector)||!ri(t))return;const r={timestamp:Ft(t.timestamp),clickBreadcrumb:t,clickCount:0,node:n};this._clicks.some(s=>s.node===r.node&&Math.abs(s.timestamp-r.timestamp)<1)||(this._clicks.push(r),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(t=Date.now()){this._lastMutation=Ft(t)}registerScroll(t=Date.now()){this._lastScroll=Ft(t)}registerClick(t){const n=Ln(t);this._handleMultiClick(n)}_handleMultiClick(t){this._getClicks(t).forEach(n=>{n.clickCount++})}_getClicks(t){return this._clicks.filter(n=>n.node===t)}_checkClicks(){const t=[],n=Bn();this._clicks.forEach(r=>{!r.mutationAfter&&this._lastMutation&&(r.mutationAfter=r.timestamp<=this._lastMutation?this._lastMutation-r.timestamp:void 0),!r.scrollAfter&&this._lastScroll&&(r.scrollAfter=r.timestamp<=this._lastScroll?this._lastScroll-r.timestamp:void 0),r.timestamp+this._timeout<=n&&t.push(r)});for(const r of t){const s=this._clicks.indexOf(r);s>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(s,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(t){const n=this._replay,r=t.scrollAfter&&t.scrollAfter<=this._scollTimeout,s=t.mutationAfter&&t.mutationAfter<=this._threshold,i=!r&&!s,{clickCount:o,clickBreadcrumb:c}=t;if(i){const a=Math.min(t.mutationAfter||this._timeout,this._timeout)*1e3,l=a<this._timeout*1e3?"mutation":"timeout",u={type:"default",message:c.message,timestamp:c.timestamp,category:"ui.slowClickDetected",data:te(R({},c.data),{url:B.location.href,route:n.getCurrentRoute(),timeAfterClickMs:a,endReason:l,clickCount:o||1})};this._addBreadcrumbEvent(n,u);return}if(o>1){const a={type:"default",message:c.message,timestamp:c.timestamp,category:"ui.multiClick",data:te(R({},c.data),{url:B.location.href,route:n.getCurrentRoute(),clickCount:o,metric:!0})};this._addBreadcrumbEvent(n,a)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=setTimeout(()=>this._checkClicks(),1e3)}}const ti=["A","BUTTON","INPUT"];function ni(e,t){return!!(!ti.includes(e.tagName)||e.tagName==="INPUT"&&!["submit","button"].includes(e.getAttribute("type")||"")||e.tagName==="A"&&(e.hasAttribute("download")||e.hasAttribute("target")&&e.getAttribute("target")!=="_self")||t&&e.matches(t))}function ri(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function Bn(){return Date.now()/1e3}function si(e,t){try{if(!ii(t))return;const{source:n}=t.data;if(n===I.Mutation&&e.registerMutation(t.timestamp),n===I.Scroll&&e.registerScroll(t.timestamp),oi(t)){const{type:r,id:s}=t.data,i=ge.mirror.getNode(s);i instanceof HTMLElement&&r===Q.Click&&e.registerClick(i)}}catch(n){}}function ii(e){return e.type===Vs}function oi(e){return e.data.source===I.MouseInteraction}function le(e){return R({timestamp:Date.now()/1e3,type:"default"},e)}var lt;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(lt||(lt={}));const ai=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function ci(e){const t={};for(const n in e)if(ai.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}const li=e=>t=>{if(!e.isEnabled())return;const n=ui(t);if(!n)return;const r=t.name==="click",s=r?t.event:void 0;r&&e.clickDetector&&s&&s.target&&!s.altKey&&!s.metaKey&&!s.ctrlKey&&!s.shiftKey&&Zs(e.clickDetector,n,Nn(t.event)),Ve(e,n)};function Fn(e,t){const n=ge.mirror.getId(e),r=n&&ge.mirror.getNode(n),s=r&&ge.mirror.getMeta(r),i=s&&fi(s)?s:null;return{message:t,data:i?{nodeId:n,node:{id:n,tagName:i.tagName,textContent:Array.from(i.childNodes).map(o=>o.type===lt.Text&&o.textContent).filter(Boolean).map(o=>o.trim()).join(""),attributes:ci(i.attributes)}}:{}}}function ui(e){const{target:t,message:n}=di(e);return le(R({category:`ui.${e.name}`},Fn(t,n)))}function di(e){const t=e.name==="click";let n,r=null;try{r=t?Nn(e.event):Pn(e.event),n=(0,Zt.Rt)(r,{maxStringLength:200})||"<unknown>"}catch(s){n="<unknown>"}return{target:r,message:n}}function fi(e){return e.type===lt.Element}function hi(e,t){if(!e.isEnabled())return;e.updateUserActivity();const n=pi(t);n&&Ve(e,n)}function pi(e){const{metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:i,target:o}=e;if(!o||mi(o)||!i)return null;const c=t||r||s,a=i.length===1;if(!c&&a)return null;const l=(0,Zt.Rt)(o,{maxStringLength:200})||"<unknown>",u=Fn(o,l);return le({category:"ui.keyDown",message:l,data:te(R({},u.data),{metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:i})})}function mi(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}const Un={resource:Ei,paint:_i,navigation:Si};function gi(e){return e.map(yi).filter(Boolean)}function yi(e){return Un[e.entryType]?Un[e.entryType](e):null}function Ne(e){return((Er.Z1||B.performance.timeOrigin)+e)/1e3}function _i(e){const{duration:t,entryType:n,name:r,startTime:s}=e,i=Ne(s);return{type:n,name:r,start:i,end:i+t,data:void 0}}function Si(e){const{entryType:t,name:n,decodedBodySize:r,duration:s,domComplete:i,encodedBodySize:o,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,domInteractive:l,loadEventStart:u,loadEventEnd:f,redirectCount:d,startTime:h,transferSize:p,type:m}=e;return s===0?null:{type:`${t}.${m}`,start:Ne(h),end:Ne(i),name:n,data:{size:p,decodedBodySize:r,encodedBodySize:o,duration:s,domInteractive:l,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,loadEventStart:u,loadEventEnd:f,domComplete:i,redirectCount:d}}}function Ei(e){const{entryType:t,initiatorType:n,name:r,responseEnd:s,startTime:i,decodedBodySize:o,encodedBodySize:c,responseStatus:a,transferSize:l}=e;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${t}.${n}`,start:Ne(i),end:Ne(s),name:r,data:{size:l,statusCode:a,decodedBodySize:o,encodedBodySize:c}}}function vi(e){const t=e.entries,n=t[t.length-1],r=n?n.element:void 0,s=e.value,i=Ne(s);return{type:"largest-contentful-paint",name:"largest-contentful-paint",start:i,end:i,data:{value:s,size:s,nodeId:r?ge.mirror.getId(r):void 0}}}function wi(e){function t(s){e.performanceEntries.includes(s)||e.performanceEntries.push(s)}function n({entries:s}){s.forEach(t)}const r=[];return["navigation","paint","resource"].forEach(s=>{r.push((0,nn._j)(s,n))}),r.push((0,nn.$A)(({metric:s})=>{e.replayPerformanceEntries.push(vi(s))})),()=>{r.forEach(s=>s())}}const N=typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__,ki='var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(t,e){for(var i=new n(31),a=0;a<31;++a)i[a]=e+=1<<t[a-1];var s=new r(i[30]);for(a=1;a<30;++a)for(var o=i[a];o<i[a+1];++o)s[o]=o-i[a]<<5|a;return{b:i,r:s}},o=s(e,2),f=o.b,h=o.r;f[28]=258,h[258]=28;for(var l=s(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,a=0,s=new n(r);a<i;++a)t[a]&&++s[t[a]-1];var o,f=new n(r);for(a=1;a<r;++a)f[a]=f[a-1]+s[a-1]<<1;if(e){o=new n(1<<r);var h=15-r;for(a=0;a<i;++a)if(t[a])for(var l=a<<4|t[a],c=r-t[a],v=f[t[a]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>h]=l}else for(o=new n(i),a=0;a<i;++a)t[a]&&(o[a]=u[f[t[a]-1]++]>>15-t[a]);return o},g=new t(288);for(c=0;c<144;++c)g[c]=8;for(c=144;c<256;++c)g[c]=9;for(c=256;c<280;++c)g[c]=7;for(c=280;c<288;++c)g[c]=8;var w=new t(32);for(c=0;c<32;++c)w[c]=5;var p=d(g,9,0),y=d(w,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==r||r<0)&&(r=0),(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},A=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},_=function(r,e){for(var i=[],a=0;a<r.length;++a)r[a]&&i.push({s:a,f:r[a]});var s=i.length,o=i.slice();if(!s)return{t:F,l:0};if(1==s){var f=new t(i[0].s+1);return f[i[0].s]=1,{t:f,l:1}}i.sort((function(t,n){return t.f-n.f})),i.push({s:-1,f:25001});var h=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:h.f+l.f,l:h,r:l};c!=s-1;)h=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:h.f+l.f,l:h,r:l};var d=o[0].s;for(a=1;a<s;++a)o[a].s>d&&(d=o[a].s);var g=new n(d+1),w=x(i[c-1],g,0);if(w>e){a=0;var p=0,y=w-e,m=1<<y;for(o.sort((function(t,n){return g[n.s]-g[t.s]||t.f-n.f}));a<s;++a){var b=o[a].s;if(!(g[b]>e))break;p+=m-(1<<w-g[b]),g[b]=e}for(p>>=y;p>0;){var M=o[a].s;g[M]<e?p-=1<<e-g[M]++-1:++a}for(;a>=0&&p;--a){var E=o[a].s;g[E]==e&&(--g[E],++p)}w=e}return{t:new t(g),l:w}},x=function(t,n,r){return-1==t.s?Math.max(x(t.l,n,r+1),x(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,a=t[0],s=1,o=function(t){e[i++]=t},f=1;f<=r;++f)if(t[f]==a&&f!=r)++s;else{if(!a&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(a),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(a);s=1,a=t[f]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var a=0;a<e;++a)t[i+a+4]=r[a];return 8*(i+4+e)},C=function(t,r,s,o,f,h,l,u,c,v,m){z(r,m++,s),++f[256];for(var b=_(f,15),M=b.t,E=b.l,x=_(h,15),C=x.t,U=x.l,F=D(M),I=F.c,S=F.n,L=D(C),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=_(q,7),H=G.t,J=G.l,K=19;K>4&&!H[a[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(f,g)+T(h,w)+l,X=T(f,M)+T(h,C)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(C,U,0),R=C;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[a[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=p,P=g,Q=y,R=w;for(B=0;B<u;++B){var rt=o[B];if(rt>255){A(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;A(r,m,Q[et]),m+=R[et],et>3&&(A(r,m,rt>>5&8191),m+=i[et])}else A(r,m,N[rt]),m+=P[rt]}return A(r,m,N[256]),m+P[256]},U=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,a=0|r.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s<o;++s)i+=e+=r[s];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(a,s,o,f,u){if(!u&&(u={l:1},s.dictionary)){var c=s.dictionary.subarray(-32768),v=new t(c.length+a.length);v.set(c),v.set(a,c.length),a=v,u.w=c.length}return function(a,s,o,f,u,c){var v=c.z||a.length,d=new t(f+v+5*(1+Math.ceil(v/7e3))+u),g=d.subarray(f,d.length-u),w=c.l,p=7&(c.r||0);if(s){p&&(g[0]=c.r>>3);for(var y=U[s-1],M=y>>13,E=8191&y,z=(1<<o)-1,A=c.p||new n(32768),_=c.h||new n(z+1),x=Math.ceil(o/3),D=2*x,T=function(t){return(a[t]^a[t+1]<<x^a[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=_[H];if(A[J]=K,_[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!w)){p=C(a,g,0,F,I,S,O,q,G,j-G,p),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(a[j+Q]==a[j+Q-W]){for(var $=0;$<Z&&a[j+$]==a[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-A[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=A[J])&32767}if(R){F[q++]=268435456|h[Q]<<18|l[R];var it=31&h[Q],at=31&l[R];O+=e[it]+i[at],++I[257+it],++S[at],B=j+Q,++L}else F[q++]=a[j],++I[a[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=a[j],++I[a[j]];p=C(a,g,w,F,I,S,O,q,G,j-G,p),w||(c.r=7&p|g[p/8|0]<<3,p-=7,c.h=_,c.p=A,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+w;j+=65535){var st=j+65535;st>=v&&(g[p/8|0]=w,st=v),p=k(g,p+1,a.subarray(j,st))}c.i=v}return b(d,0,f+m(p)+u)}(a,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+s.mem,o,f,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var a=this.b.length-this.s.z;a&&(this.b.set(n.subarray(0,a),this.s.z),this.s.z=this.b.length,this.p(this.b,!1)),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(a),32768),this.s.z=n.length-a+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,a=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),s=a.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(a,n),O(a,s-8,r.d()),O(a,s-4,e),a}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(r){for(var e=new t(n.length),i=0;i<n.length;++i)e[i]=n.charCodeAt(i);return e}if(G)return G.encode(n);var a=n.length,s=new t(n.length+(n.length>>1)),o=0,f=function(t){s[o++]=t};for(i=0;i<a;++i){if(o+5>s.length){var h=new t(o+8+(a-i<<1));h.set(s),s=h}var l=n.charCodeAt(i);l<128||r?f(l):l<2048?(f(192|l>>6),f(128|63&l)):l>55295&&l<57344?(f(240|(l=65536+(1047552&l)|1023&n.charCodeAt(++i))>>18),f(128|l>>12&63),f(128|l>>6&63),f(128|63&l)):(f(224|l>>12),f(128|l>>6&63),f(128|63&l))}return b(s,0,o)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(let r=0,e=t.length;r<e;r++)n+=t[r].length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J(((t,n)=>{this.deflate.push(t,n)})),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",(function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:"init",success:!0,response:void 0});';function Ii(){const e=new Blob([ki]);return URL.createObjectURL(e)}function Z(e,t){N&&(L.kg.info(e),t&&Wn(e))}function Pe(e,t){N&&(L.kg.info(e),t&&setTimeout(()=>{Wn(e)},0))}function Wn(e){(0,X.n_)({category:"console",data:{logger:"replay"},level:"info",message:e},{level:"info"})}class Ut extends Error{constructor(){super(`Event buffer exceeded maximum size of ${bt}.`)}}class zn{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}addEvent(t){return H(this,null,function*(){const n=JSON.stringify(t).length;if(this._totalSize+=n,this._totalSize>bt)throw new Ut;this.events.push(t)})}finish(){return new Promise(t=>{const n=this.events;this.clear(),t(JSON.stringify(n))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){const t=this.events.map(n=>n.timestamp).sort()[0];return t?Bt(t):null}}class bi{constructor(t){this._worker=t,this._id=0}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((t,n)=>{this._worker.addEventListener("message",({data:r})=>{r.success?t():n()},{once:!0}),this._worker.addEventListener("error",r=>{n(r)},{once:!0})}),this._ensureReadyPromise)}destroy(){Z("[Replay] Destroying compression worker"),this._worker.terminate()}postMessage(t,n){const r=this._getAndIncrementId();return new Promise((s,i)=>{const o=({data:c})=>{const a=c;if(a.method===t&&a.id===r){if(this._worker.removeEventListener("message",o),!a.success){N&&L.kg.error("[Replay]",a.response),i(new Error("Error in compression worker"));return}s(a.response)}};this._worker.addEventListener("message",o),this._worker.postMessage({id:r,method:t,arg:n})})}_getAndIncrementId(){return this._id++}}class Ri{constructor(t){this._worker=new bi(t),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(t){const n=Bt(t.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);const r=JSON.stringify(t);return this._totalSize+=r.length,this._totalSize>bt?Promise.reject(new Ut):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{N&&L.kg.warn('[Replay] Sending "clear" message to worker failed',t)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(t){return this._worker.postMessage("addEvent",t)}_finishRequest(){return H(this,null,function*(){const t=yield this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,t})}}class Mi{constructor(t){this._fallback=new zn,this._compression=new Ri(t),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(t){this._used.hasCheckout=t}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(t){return this._used.addEvent(t)}finish(){return H(this,null,function*(){return yield this.ensureWorkerIsLoaded(),this._used.finish()})}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}_ensureWorkerIsLoaded(){return H(this,null,function*(){try{yield this._compression.ensureReady()}catch(t){Z("[Replay] Failed to load the compression worker, falling back to simple buffer");return}yield this._switchToCompressionWorker()})}_switchToCompressionWorker(){return H(this,null,function*(){const{events:t,hasCheckout:n}=this._fallback,r=[];for(const s of t)r.push(this._compression.addEvent(s));this._compression.hasCheckout=n,this._used=this._compression;try{yield Promise.all(r)}catch(s){N&&L.kg.warn("[Replay] Failed to add events when switching buffers.",s)}})}}function Ci({useCompression:e,workerUrl:t}){if(e&&window.Worker){const n=Ti(t);if(n)return n}return Z("[Replay] Using simple buffer"),new zn}function Ti(e){try{const t=e||xi();if(!t)return;Z(`[Replay] Using compression worker${e?` from ${e}`:""}`);const n=new Worker(t);return new Mi(n)}catch(t){Z("[Replay] Failed to create compression worker")}}function xi(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__=="undefined"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?Ii():""}function Wt(){try{return"sessionStorage"in B&&!!B.sessionStorage}catch(e){return!1}}function Ai(e){Oi(),e.session=void 0}function Oi(){if(Wt())try{B.sessionStorage.removeItem(kt)}catch(e){}}function Hn(e){return e===void 0?!1:Math.random()<e}function $n(e){const t=Date.now(),n=e.id||(0,vr.DM)(),r=e.started||t,s=e.lastActivity||t,i=e.segmentId||0,o=e.sampled,c=e.previousSessionId;return{id:n,started:r,lastActivity:s,segmentId:i,sampled:o,previousSessionId:c}}function zt(e){if(Wt())try{B.sessionStorage.setItem(kt,JSON.stringify(e))}catch(t){}}function Di(e,t){return Hn(e)?"session":t?"buffer":!1}function jn({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){const s=Di(e,t),i=$n({sampled:s,previousSessionId:r});return n&&zt(i),i}function Li(e){if(!Wt())return null;try{const t=B.sessionStorage.getItem(kt);if(!t)return null;const n=JSON.parse(t);return Pe("[Replay] Loading existing session",e),$n(n)}catch(t){return null}}function Ht(e,t,n=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=n}function Kn(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return Ht(e.started,t,r)||Ht(e.lastActivity,n,r)}function qn(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!Kn(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled==="buffer"&&e.segmentId===0)}function $t({traceInternals:e,sessionIdleExpire:t,maxReplayDuration:n,previousSessionId:r},s){const i=s.stickySession&&Li(e);return i?qn(i,{sessionIdleExpire:t,maxReplayDuration:n})?(Pe("[Replay] Session in sessionStorage is expired, creating new one..."),jn(s,{previousSessionId:i.id})):i:(Pe("[Replay] Creating new session",e),jn(s,{previousSessionId:r}))}function Ni(e){return e.type===k.Custom}function jt(e,t,n){return Yn(e,t)?(Vn(e,t,n),!0):!1}function Pi(e,t,n){return Yn(e,t)?Vn(e,t,n):Promise.resolve(null)}function Vn(e,t,n){return H(this,null,function*(){if(!e.eventBuffer)return null;try{n&&e.recordingMode==="buffer"&&e.eventBuffer.clear(),n&&(e.eventBuffer.hasCheckout=!0);const r=e.getOptions(),s=Bi(t,r.beforeAddRecordingEvent);return s?yield e.eventBuffer.addEvent(s):void 0}catch(r){const s=r&&r instanceof Ut?"addEventSizeExceeded":"addEvent";N&&L.kg.error(r),yield e.stop({reason:s});const i=(0,X.s3)();i&&i.recordDroppedEvent("internal_sdk_error","replay")}})}function Yn(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;const n=Bt(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(Z(`[Replay] Skipping event with timestamp ${n} because it is after maxReplayDuration`,e.getOptions()._experiments.traceInternals),!1):!0}function Bi(e,t){try{if(typeof t=="function"&&Ni(e))return t(e)}catch(n){return N&&L.kg.error("[Replay] An error occured in the `beforeAddRecordingEvent` callback, skipping the event...",n),null}return e}function Kt(e){return!e.type}function qt(e){return e.type==="transaction"}function Fi(e){return e.type==="replay_event"}function Xn(e){return e.type==="feedback"}function Gn(e){const t=zi();return(n,r)=>{if(!e.isEnabled()||!Kt(n)&&!qt(n))return;const s=r&&r.statusCode;if(!(t&&(!s||s<200||s>=300))){if(qt(n)){Ui(e,n);return}Wi(e,n)}}}function Ui(e,t){const n=e.getContext();t.contexts&&t.contexts.trace&&t.contexts.trace.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}function Wi(e,t){const n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),e.recordingMode!=="buffer"||!t.tags||!t.tags.replayId)return;const{beforeErrorSampling:r}=e.getOptions();typeof r=="function"&&!r(t)||setTimeout(()=>{e.sendBufferedReplayOrFlush()})}function zi(){const e=(0,X.s3)();if(!e)return!1;const t=e.getTransport();return t&&t.send.__sentry__baseTransport__||!1}function Hi(e){return t=>{!e.isEnabled()||!Kt(t)||$i(e,t)}}function $i(e,t){const n=t.exception&&t.exception.values&&t.exception.values[0].value;if(typeof n=="string"&&(n.match(/reactjs\.org\/docs\/error-decoder\.html\?invariant=(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))){const r=le({category:"replay.hydrate-error"});Ve(e,r)}}function ji(e,t){return e.type||!e.exception||!e.exception.values||!e.exception.values.length?!1:!!(t.originalException&&t.originalException.__rrweb__)}function Ki(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:k.Custom,timestamp:t.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:t.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:t.event_id}}}}),!1):!0)}function qi(e,t){return e.recordingMode!=="buffer"||t.message===It||!t.exception||t.type?!1:Hn(e.getOptions().errorSampleRate)}function Vi(e,t=!1){const n=t?Gn(e):void 0;return Object.assign((r,s)=>e.isEnabled()?Fi(r)?(delete r.breadcrumbs,r):!Kt(r)&&!qt(r)&&!Xn(r)||!e.checkAndHandleExpiredSession()?r:Xn(r)?(e.flush(),r.contexts.feedback.replay_id=e.getSessionId(),Ki(e,r),r):ji(r,s)&&!e.getOptions()._experiments.captureExceptions?(N&&L.kg.log("[Replay] Ignoring error from rrweb internals",r),null):((qi(e,r)||e.recordingMode==="session")&&(r.tags=te(R({},r.tags),{replayId:e.getSessionId()})),n&&n(r,{statusCode:200}),r):r,{id:"Replay"})}function ut(e,t){return t.map(({type:n,start:r,end:s,name:i,data:o})=>{const c=e.throttledAddEvent({type:k.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:i,startTimestamp:r,endTimestamp:s,data:o}}});return typeof c=="string"?Promise.resolve(null):c})}function Yi(e){const{from:t,to:n}=e,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:t}}}function Xi(e){return t=>{if(!e.isEnabled())return;const n=Yi(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(ut(e,[n]),!1)))}}function Gi(e,t){return N&&e.getOptions()._experiments.traceInternals?!1:(0,St.W)(t,(0,X.s3)())}function dt(e,t){e.isEnabled()&&t!==null&&(Gi(e,t.name)||e.addUpdate(()=>(ut(e,[t]),!0)))}function Ji(e){const{startTimestamp:t,endTimestamp:n,fetchData:r,response:s}=e;if(!n)return null;const{method:i,url:o}=r;return{type:"resource.fetch",start:t/1e3,end:n/1e3,name:o,data:{method:i,statusCode:s?s.status:void 0}}}function Qi(e){return t=>{if(!e.isEnabled())return;const n=Ji(t);dt(e,n)}}function Zi(e){const{startTimestamp:t,endTimestamp:n,xhr:r}=e,s=r[vt.xU];if(!t||!n||!s)return null;const{method:i,url:o,status_code:c}=s;return o===void 0?null:{type:"resource.xhr",name:o,start:t/1e3,end:n/1e3,data:{method:i,statusCode:c}}}function eo(e){return t=>{if(!e.isEnabled())return;const n=Zi(t);dt(e,n)}}function ft(e,t){if(e)try{if(typeof e=="string")return t.encode(e).length;if(e instanceof URLSearchParams)return t.encode(e.toString()).length;if(e instanceof FormData){const n=er(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch(n){}}function Jn(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function Qn(e){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[er(e)];if(!e)return[void 0]}catch(t){return N&&L.kg.warn("[Replay] Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return N&&L.kg.info("[Replay] Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function ht(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};const n=R({},e._meta),r=n.warnings||[];return n.warnings=[...r,t],e._meta=n,e}function Zn(e,t){if(!t)return null;const{startTimestamp:n,endTimestamp:r,url:s,method:i,statusCode:o,request:c,response:a}=t;return{type:e,start:n/1e3,end:r/1e3,name:s,data:(0,Et.Jr)({method:i,statusCode:o,request:c,response:a})}}function Ye(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function _e(e,t,n){if(!t&&Object.keys(e).length===0)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};const r={headers:e,size:t},{body:s,warnings:i}=to(n);return r.body=s,i&&i.length>0&&(r._meta={warnings:i}),r}function Vt(e,t){return Object.keys(e).reduce((n,r)=>{const s=r.toLowerCase();return t.includes(s)&&e[r]&&(n[s]=e[r]),n},{})}function er(e){return new URLSearchParams(e).toString()}function to(e){if(!e||typeof e!="string")return{body:e};const t=e.length>rn,n=no(e);if(t){const r=e.slice(0,rn);return n?{body:r,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${r}\u2026`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(e)}}catch(r){}return{body:e}}function no(e){const t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function pt(e,t){const n=ro(e);return(0,wr.U0)(n,t)}function ro(e,t=B.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(B.location.origin))return e;const n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;const r=n.href;return!e.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}function so(e,t,n){return H(this,null,function*(){try{const r=yield oo(e,t,n),s=Zn("resource.fetch",r);dt(n.replay,s)}catch(r){N&&L.kg.error("[Replay] Failed to capture fetch breadcrumb",r)}})}function io(e,t,n){const{input:r,response:s}=t,i=r?tr(r):void 0,o=ft(i,n.textEncoder),c=s?Jn(s.headers.get("content-length")):void 0;o!==void 0&&(e.data.request_body_size=o),c!==void 0&&(e.data.response_body_size=c)}function oo(e,t,n){return H(this,null,function*(){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r}=t,{url:o,method:c,status_code:a=0,request_body_size:l,response_body_size:u}=e.data,f=pt(o,n.networkDetailAllowUrls)&&!pt(o,n.networkDetailDenyUrls),d=f?ao(n,t.input,l):Ye(l),h=yield co(f,n,t.response,u);return{startTimestamp:s,endTimestamp:i,url:o,method:c,statusCode:a,request:d,response:h}})}function ao({networkCaptureBodies:e,networkRequestHeaders:t},n,r){const s=n?fo(n,t):{};if(!e)return _e(s,r,void 0);const i=tr(n),[o,c]=Qn(i),a=_e(s,r,o);return c?ht(a,c):a}function co(o,c,a,l){return H(this,arguments,function*(e,{networkCaptureBodies:t,textEncoder:n,networkResponseHeaders:r},s,i){if(!e&&i!==void 0)return Ye(i);const u=s?nr(s.headers,r):{};if(!s||!t&&i!==void 0)return _e(u,i,void 0);const[f,d]=yield uo(s),h=lo(f,{networkCaptureBodies:t,textEncoder:n,responseBodySize:i,captureDetails:e,headers:u});return d?ht(h,d):h})}function lo(e,{networkCaptureBodies:t,textEncoder:n,responseBodySize:r,captureDetails:s,headers:i}){try{const o=e&&e.length&&r===void 0?ft(e,n):r;return s?t?_e(i,o,e):_e(i,o,void 0):Ye(o)}catch(o){return N&&L.kg.warn("[Replay] Failed to serialize response body",o),_e(i,r,void 0)}}function uo(e){return H(this,null,function*(){const t=ho(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[yield po(t)]}catch(n){return N&&L.kg.warn("[Replay] Failed to get text body from response",n),[void 0,"BODY_PARSE_ERROR"]}})}function tr(e=[]){if(!(e.length!==2||typeof e[1]!="object"))return e[1].body}function nr(e,t){const n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}function fo(e,t){return e.length===1&&typeof e[0]!="string"?rr(e[0],t):e.length===2?rr(e[1],t):{}}function rr(e,t){if(!e)return{};const n=e.headers;return n?n instanceof Headers?nr(n,t):Array.isArray(n)?{}:Vt(n,t):{}}function ho(e){try{return e.clone()}catch(t){N&&L.kg.warn("[Replay] Failed to clone response body",t)}}function po(e){return new Promise((t,n)=>{const r=setTimeout(()=>n(new Error("Timeout while trying to read response body")),500);mo(e).then(s=>t(s),s=>n(s)).finally(()=>clearTimeout(r))})}function mo(e){return H(this,null,function*(){return yield e.text()})}function go(e,t,n){return H(this,null,function*(){try{const r=_o(e,t,n),s=Zn("resource.xhr",r);dt(n.replay,s)}catch(r){N&&L.kg.error("[Replay] Failed to capture xhr breadcrumb",r)}})}function yo(e,t,n){const{xhr:r,input:s}=t;if(!r)return;const i=ft(s,n.textEncoder),o=r.getResponseHeader("content-length")?Jn(r.getResponseHeader("content-length")):wo(r.response,r.responseType,n.textEncoder);i!==void 0&&(e.data.request_body_size=i),o!==void 0&&(e.data.response_body_size=o)}function _o(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r,input:o,xhr:c}=t,{url:a,method:l,status_code:u=0,request_body_size:f,response_body_size:d}=e.data;if(!a)return null;if(!c||!pt(a,n.networkDetailAllowUrls)||pt(a,n.networkDetailDenyUrls)){const S=Ye(f),y=Ye(d);return{startTimestamp:s,endTimestamp:i,url:a,method:l,statusCode:u,request:S,response:y}}const h=c[vt.xU],p=h?Vt(h.request_headers,n.networkRequestHeaders):{},m=Vt(So(c),n.networkResponseHeaders),[E,g]=n.networkCaptureBodies?Qn(o):[void 0],[T,M]=n.networkCaptureBodies?Eo(c):[void 0],x=_e(p,f,E),U=_e(m,d,T);return{startTimestamp:s,endTimestamp:i,url:a,method:l,statusCode:u,request:g?ht(x,g):x,response:M?ht(U,M):U}}function So(e){const t=e.getAllResponseHeaders();return t?t.split(`\r
`).reduce((n,r)=>{const[s,i]=r.split(": ");return n[s.toLowerCase()]=i,n},{}):{}}function Eo(e){const t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return vo(e.response,e.responseType)}catch(n){t.push(n)}return N&&L.kg.warn("[Replay] Failed to get xhr response body",...t),[void 0]}function vo(e,t){try{if(typeof e=="string")return[e];if(e instanceof Document)return[e.body.outerHTML];if(t==="json"&&e&&typeof e=="object")return[JSON.stringify(e)];if(!e)return[void 0]}catch(n){return N&&L.kg.warn("[Replay] Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return N&&L.kg.info("[Replay] Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function wo(e,t,n){try{const r=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return ft(r,n)}catch(r){return}}function ko(e){const t=(0,X.s3)();try{const n=new TextEncoder,{networkDetailAllowUrls:r,networkDetailDenyUrls:s,networkCaptureBodies:i,networkRequestHeaders:o,networkResponseHeaders:c}=e.getOptions(),a={replay:e,textEncoder:n,networkDetailAllowUrls:r,networkDetailDenyUrls:s,networkCaptureBodies:i,networkRequestHeaders:o,networkResponseHeaders:c};t&&t.on?t.on("beforeAddBreadcrumb",(l,u)=>Io(a,l,u)):((0,kr.U)(Qi(e)),(0,vt.UK)(eo(e)))}catch(n){}}function Io(e,t,n){if(t.data)try{bo(t)&&Mo(n)&&(yo(t,n,e),go(t,n,e)),Ro(t)&&Co(n)&&(io(t,n,e),so(t,n,e))}catch(r){N&&L.kg.warn("Error when enriching network breadcrumb")}}function bo(e){return e.category==="xhr"}function Ro(e){return e.category==="fetch"}function Mo(e){return e&&e.xhr}function Co(e){return e&&e.response}let sr=null;function To(e){return!!e.category}const xo=e=>t=>{if(!e.isEnabled())return;const n=Ao(t);n&&Ve(e,n)};function Ao(e){const t=e.getLastBreadcrumb&&e.getLastBreadcrumb();return sr===t||!t||(sr=t,!To(t)||["fetch","xhr","sentry.event","sentry.transaction"].includes(t.category)||t.category.startsWith("ui."))?null:t.category==="console"?Oo(t):le(t)}function Oo(e){const t=e.data&&e.data.arguments;if(!Array.isArray(t)||t.length===0)return le(e);let n=!1;const r=t.map(s=>{if(!s)return s;if(typeof s=="string")return s.length>Qe?(n=!0,`${s.slice(0,Qe)}\u2026`):s;if(typeof s=="object")try{const i=(0,Qt.Fv)(s,7);return JSON.stringify(i).length>Qe?(n=!0,`${JSON.stringify(i,null,2).slice(0,Qe)}\u2026`):i}catch(i){}return s});return le(te(R({},e),{data:R(te(R({},e.data),{arguments:r}),n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{})}))}function Do(e){const t=(0,X.nZ)(),n=(0,X.s3)();t.addScopeListener(xo(e)),(0,Ir.O)(li(e)),(0,br.a)(Xi(e)),ko(e);const r=Vi(e,!ir(n));n&&n.addEventProcessor?n.addEventProcessor(r):(0,Fe.Q)(r),ir(n)&&(n.on("beforeSendEvent",Hi(e)),n.on("afterSendEvent",Gn(e)),n.on("createDsc",s=>{const i=e.getSessionId();i&&e.isEnabled()&&e.recordingMode==="session"&&e.checkAndHandleExpiredSession()&&(s.replay_id=i)}),n.on("startTransaction",s=>{e.lastTransaction=s}),n.on("finishTransaction",s=>{e.lastTransaction=s}),n.on("beforeSendFeedback",(s,i)=>{const o=e.getSessionId();i&&i.includeReplay&&e.isEnabled()&&o&&s.contexts&&s.contexts.feedback&&(s.contexts.feedback.replay_id=o)}))}function ir(e){return!!(e&&e.on)}function Lo(e){return H(this,null,function*(){try{return Promise.all(ut(e,[No(B.performance.memory)]))}catch(t){return[]}})}function No(e){const{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,s=Date.now()/1e3;return{type:"memory",name:"memory",start:s,end:s,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}function Po(e,t,n){let r,s,i;const o=n&&n.maxWait?Math.max(n.maxWait,t):0;function c(){return a(),r=e(),r}function a(){s!==void 0&&clearTimeout(s),i!==void 0&&clearTimeout(i),s=i=void 0}function l(){return s!==void 0||i!==void 0?c():r}function u(){return s&&clearTimeout(s),s=setTimeout(c,t),o&&i===void 0&&(i=setTimeout(c,o)),r}return u.cancel=a,u.flush=l,u}function Bo(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){N&&L.kg.warn("[Replay] Received replay event after session expired.");return}const s=r||!t;t=!0,e.clickDetector&&si(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&s&&e.setInitialState(),!jt(e,n,s))return!0;if(!s)return!1;if(Uo(e,s),e.session&&e.session.previousSessionId)return!0;if(e.recordingMode==="buffer"&&e.session&&e.eventBuffer){const i=e.eventBuffer.getEarliestTimestamp();i&&(Z(`[Replay] Updating session start time to earliest event in buffer to ${new Date(i)}`,e.getOptions()._experiments.traceInternals),e.session.started=i,e.getOptions().stickySession&&zt(e.session))}return e.recordingMode==="session"&&e.flush(),!0})}}function Fo(e){const t=e.getOptions();return{type:k.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:e.isRecordingCanvas(),sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,useCompressionOption:t.useCompression,blockAllMedia:t.blockAllMedia,maskAllText:t.maskAllText,maskAllInputs:t.maskAllInputs,useCompression:e.eventBuffer?e.eventBuffer.type==="worker":!1,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}function Uo(e,t){!t||!e.session||e.session.segmentId!==0||jt(e,Fo(e),!1)}function Wo(e,t,n,r){return(0,wt.Jd)((0,wt.Cd)(e,(0,wt.HY)(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function zo({recordingData:e,headers:t}){let n;const r=`${JSON.stringify(t)}
`;if(typeof e=="string")n=`${r}${e}`;else{const i=new TextEncoder().encode(r);n=new Uint8Array(i.length+e.length),n.set(i),n.set(e,i.length)}return n}function Ho(s){return H(this,arguments,function*({client:e,scope:t,replayId:n,event:r}){const i=typeof e._integrations=="object"&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0,o={event_id:n,integrations:i};e.emit&&e.emit("preprocessEvent",r,o);const c=yield(0,fe.R)(e.getOptions(),r,o,t,e,(0,Ue.aF)());if(!c)return null;c.platform=c.platform||"javascript";const a=e.getSdkMetadata&&e.getSdkMetadata(),{name:l,version:u}=a&&a.sdk||{};return c.sdk=te(R({},c.sdk),{name:l||"sentry.javascript.unknown",version:u||"0.0.0"}),c})}function $o(o){return H(this,arguments,function*({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:s,session:i}){const c=zo({recordingData:e,headers:{segment_id:n}}),{urls:a,errorIds:l,traceIds:u,initialTimestamp:f}=r,d=(0,X.s3)(),h=(0,X.nZ)(),p=d&&d.getTransport(),m=d&&d.getDsn();if(!d||!p||!m||!i.sampled)return;const E={type:Rr,replay_start_timestamp:f/1e3,timestamp:s/1e3,error_ids:l,trace_ids:u,urls:a,replay_id:t,segment_id:n,replay_type:i.sampled},g=yield Ho({scope:h,client:d,replayId:t,event:E});if(!g){d.recordDroppedEvent("event_processor","replay",E),Z("An event processor returned `null`, will not send event.");return}delete g.sdkProcessingMetadata;const T=Wo(g,c,m,d.getOptions().tunnel);let M;try{M=yield p.send(T)}catch(U){const S=new Error(It);try{S.cause=U}catch(y){}throw S}if(!M)return M;if(typeof M.statusCode=="number"&&(M.statusCode<200||M.statusCode>=300))throw new or(M.statusCode);const x=(0,en.WG)({},M);if((0,en.Q)(x,"replay"))throw new ar(x);return M})}class or extends Error{constructor(t){super(`Transport returned status code ${t}`)}}class ar extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}}function cr(n){return H(this,arguments,function*(e,t={count:0,interval:Or}){const{recordingData:r,options:s}=e;if(r.length)try{return yield $o(e),!0}catch(i){if(i instanceof or||i instanceof ar)throw i;if((0,X.v)("Replays",{_retryCount:t.count}),N&&s._experiments&&s._experiments.captureExceptions&&(0,X.Tb)(i),t.count>=Dr){const o=new Error(`${It} - max retries exceeded`);try{o.cause=i}catch(c){}throw o}return t.interval*=++t.count,new Promise((o,c)=>{setTimeout(()=>H(this,null,function*(){try{yield cr(e,t),o(!0)}catch(a){c(a)}}),t.interval)})}})}const lr="__THROTTLED",jo="__SKIPPED";function Ko(e,t,n){const r=new Map,s=c=>{const a=c-n;r.forEach((l,u)=>{u<a&&r.delete(u)})},i=()=>[...r.values()].reduce((c,a)=>c+a,0);let o=!1;return(...c)=>{const a=Math.floor(Date.now()/1e3);if(s(a),i()>=t){const u=o;return o=!0,u?jo:lr}o=!1;const l=r.get(a)||0;return r.set(a,l+1),e(...c)}}class Se{constructor({options:t,recordingOptions:n}){Se.prototype.__init.call(this),Se.prototype.__init2.call(this),Se.prototype.__init3.call(this),Se.prototype.__init4.call(this),Se.prototype.__init5.call(this),Se.prototype.__init6.call(this),this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:Mr,sessionIdleExpire:Cr},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=n,this._options=t,this._debouncedFlush=Po(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=Ko((o,c)=>Pi(this,o,c),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:s}=this.getOptions(),i=r?{threshold:Math.min(Lr,r),timeout:r,scrollTimeout:Nr,ignoreSelector:s?s.join(","):""}:void 0;i&&(this.clickDetector=new ei(this,i))}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}initializeSampling(t){const{errorSampleRate:n,sessionSampleRate:r}=this._options;if(!(n<=0&&r<=0)){if(this._initializeSessionForSampling(t),!this.session){this._handleException(new Error("Unable to initialize and create session"));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled==="buffer"&&this.session.segmentId===0?"buffer":"session",Pe(`[Replay] Starting replay in ${this.recordingMode} mode`,this._options._experiments.traceInternals),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session")throw new Error("Replay recording is already in progress");if(this._isEnabled&&this.recordingMode==="buffer")throw new Error("Replay buffering is in progress, call `flush()` to save the replay");Pe("[Replay] Starting replay in session mode",this._options._experiments.traceInternals);const t=$t({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=t,this._initializeRecording()}startBuffering(){if(this._isEnabled)throw new Error("Replay recording is already in progress");Pe("[Replay] Starting replay in buffer mode",this._options._experiments.traceInternals);const t=$t({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=t,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const t=this._canvas;this._stopRecording=ge(R(te(R(R({},this._recordingOptions),this.recordingMode==="buffer"&&{checkoutEveryNms:Ar}),{emit:Bo(this),onMutation:this._onMutationHandler}),t?{recordCanvas:t.recordCanvas,getCanvasManager:t.getCanvasManager,sampling:t.sampling,dataURLOptions:t.dataURLOptions}:{}))}catch(t){this._handleException(t)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(t){return this._handleException(t),!1}}stop(){return H(this,arguments,function*({forceFlush:t=!1,reason:n}={}){if(this._isEnabled){this._isEnabled=!1;try{Z(`[Replay] Stopping Replay${n?` triggered by ${n}`:""}`,this._options._experiments.traceInternals),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&(yield this._flush({force:!0})),this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,Ai(this)}catch(r){this._handleException(r)}}})}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),Z("[Replay] Pausing replay",this._options._experiments.traceInternals))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),Z("[Replay] Resuming replay",this._options._experiments.traceInternals))}sendBufferedReplayOrFlush(){return H(this,arguments,function*({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();Z("[Replay] Converting buffer to session",this._options._experiments.traceInternals),yield this.flushImmediate();const r=this.stopRecording();!t||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this._updateUserActivity(n),this._updateSessionActivity(n),this._maybeSaveSession()),this.startRecording())})}addUpdate(t){const n=t();this.recordingMode!=="buffer"&&n!==!0&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return this.recordingMode==="buffer"?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(){return this.session&&this.session.id}checkAndHandleExpiredSession(){if(this._lastActivity&&Ht(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&this.session.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const t=`${B.location.pathname}${B.location.hash}${B.location.search}`,n=`${B.location.origin}${t}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=n,this._context.initialTimestamp=Date.now(),this._context.urls.push(n)}throttledAddEvent(t,n){const r=this._throttledAddEvent(t,n);if(r===lr){const s=le({category:"replay.throttled"});this.addUpdate(()=>!jt(this,{type:Ys,timestamp:s.timestamp||0,data:{tag:"breadcrumb",payload:s,metric:!0}}))}return r}getCurrentRoute(){const t=this.lastTransaction||(0,X.nZ)().getTransaction(),r=(t&&(0,Jt.XU)(t).data||{})[_r.Zj];if(!(!t||!r||!["route","custom"].includes(r)))return(0,Jt.XU)(t).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=Ci({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_handleException(t){N&&L.kg.error("[Replay]",t),N&&this._options._experiments&&this._options._experiments.captureExceptions&&(0,X.Tb)(t)}_initializeSessionForSampling(t){const n=this._options.errorSampleRate>0,r=$t({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals,previousSessionId:t},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:n});this.session=r}_checkSession(){if(!this.session)return!1;const t=this.session;return qn(t,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(t),!1):!0}_refreshSession(t){return H(this,null,function*(){this._isEnabled&&(yield this.stop({reason:"refresh session"}),this.initializeSampling(t.id))})}_addListeners(){try{B.document.addEventListener("visibilitychange",this._handleVisibilityChange),B.addEventListener("blur",this._handleWindowBlur),B.addEventListener("focus",this._handleWindowFocus),B.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(Do(this),this._hasInitializedCoreListeners=!0)}catch(t){this._handleException(t)}this._performanceCleanupCallback=wi(this)}_removeListeners(){try{B.document.removeEventListener("visibilitychange",this._handleVisibilityChange),B.removeEventListener("blur",this._handleWindowBlur),B.removeEventListener("focus",this._handleWindowFocus),B.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this._handleException(t)}}__init(){this._handleVisibilityChange=()=>{B.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()}}__init2(){this._handleWindowBlur=()=>{const t=le({category:"ui.blur"});this._doChangeToBackgroundTasks(t)}}__init3(){this._handleWindowFocus=()=>{const t=le({category:"ui.focus"});this._doChangeToForegroundTasks(t)}}__init4(){this._handleKeyboardEvent=t=>{hi(this,t)}}_doChangeToBackgroundTasks(t){!this.session||Kn(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(t&&this._createCustomBreadcrumb(t),this.conditionalFlush())}_doChangeToForegroundTasks(t){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){Z("[Replay] Document has become active, but session has expired");return}t&&this._createCustomBreadcrumb(t)}_updateUserActivity(t=Date.now()){this._lastActivity=t}_updateSessionActivity(t=Date.now()){this.session&&(this.session.lastActivity=t,this._maybeSaveSession())}_createCustomBreadcrumb(t){this.addUpdate(()=>{this.throttledAddEvent({type:k.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){const t=gi(this.performanceEntries).concat(this.replayPerformanceEntries);return this.performanceEntries=[],this.replayPerformanceEntries=[],Promise.all(ut(this,t))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:t,eventBuffer:n}=this;if(!t||!n||t.segmentId)return;const r=n.getEarliestTimestamp();r&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){const t={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),t}_runFlush(){return H(this,null,function*(){const t=this.getSessionId();if(!this.session||!this.eventBuffer||!t){N&&L.kg.error("[Replay] No session or eventBuffer found to flush.");return}if(yield this._addPerformanceEntries(),!(!this.eventBuffer||!this.eventBuffer.hasEvents)&&(yield Lo(this),!!this.eventBuffer&&t===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const n=Date.now();if(n-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Error("Session is too long, not sending replay");const r=this._popEventContext(),s=this.session.segmentId++;this._maybeSaveSession();const i=yield this.eventBuffer.finish();yield cr({replayId:t,recordingData:i,segmentId:s,eventContext:r,session:this.session,options:this.getOptions(),timestamp:n})}catch(n){this._handleException(n),this.stop({reason:"sendReplay"});const r=(0,X.s3)();r&&r.recordDroppedEvent("send_error","replay")}})}__init5(){this._flush=(...n)=>H(this,[...n],function*({force:t=!1}={}){if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){N&&L.kg.error("[Replay] Attempting to finish replay event after session expired.");return}if(!this.session)return;const r=this.session.started,i=Date.now()-r;this._debouncedFlush.cancel();const o=i<this._options.minReplayDuration,c=i>this._options.maxReplayDuration+5e3;if(o||c){Z(`[Replay] Session duration (${Math.floor(i/1e3)}s) is too ${o?"short":"long"}, not sending replay.`,this._options._experiments.traceInternals),o&&this._debouncedFlush();return}const a=this.eventBuffer;if(a&&this.session.segmentId===0&&!a.hasCheckout&&Z("[Replay] Flushing initial segment without checkout.",this._options._experiments.traceInternals),!this._flushLock){this._flushLock=this._runFlush(),yield this._flushLock,this._flushLock=void 0;return}try{yield this._flushLock}catch(l){N&&L.kg.error(l)}finally{this._debouncedFlush()}})}_maybeSaveSession(){this.session&&this._options.stickySession&&zt(this.session)}__init6(){this._onMutationHandler=t=>{const n=t.length,r=this._options.mutationLimit,s=this._options.mutationBreadcrumbLimit,i=r&&n>r;if(n>s||i){const o=le({category:"replay.mutations",data:{count:n,limit:i}});this._createCustomBreadcrumb(o)}return i?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}}function Xe(e,t,n,r){const s=typeof r=="string"?r.split(","):[],i=[...e,...s,...t];return typeof n!="undefined"&&(typeof n=="string"&&i.push(`.${n}`),(0,L.Cf)(()=>{console.warn("[Replay] You are using a deprecated configuration item for privacy. Read the documentation on how to use the new privacy configuration.")})),i.join(",")}function qo({mask:e,unmask:t,block:n,unblock:r,ignore:s,blockClass:i,blockSelector:o,maskTextClass:c,maskTextSelector:a,ignoreClass:l}){const u=['base[href="/"]'],f=Xe(e,[".sentry-mask","[data-sentry-mask]"],c,a),d=Xe(t,[".sentry-unmask","[data-sentry-unmask]"]),h={maskTextSelector:f,unmaskTextSelector:d,blockSelector:Xe(n,[".sentry-block","[data-sentry-block]",...u],i,o),unblockSelector:Xe(r,[".sentry-unblock","[data-sentry-unblock]"]),ignoreSelector:Xe(s,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'],l)};return i instanceof RegExp&&(h.blockClass=i),c instanceof RegExp&&(h.maskTextClass=c),h}function Vo({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:s,value:i}){return!r||s.unmaskTextSelector&&e.matches(s.unmaskTextSelector)?i:n.includes(t)||t==="value"&&e.tagName==="INPUT"&&["submit","button"].includes(e.getAttribute("type")||"")?i.replace(/[\S]/g,"*"):i}const ur='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',Yo=["content-length","content-type","accept"];let dr=!1;const Xo=e=>new mt(e);class mt{static __initStatic(){this.id="Replay"}constructor({flushMinDelay:t=Tr,flushMaxDelay:n=xr,minReplayDuration:r=Pr,maxReplayDuration:s=sn,stickySession:i=!0,useCompression:o=!0,workerUrl:c,_experiments:a={},sessionSampleRate:l,errorSampleRate:u,maskAllText:f=!0,maskAllInputs:d=!0,blockAllMedia:h=!0,mutationBreadcrumbLimit:p=750,mutationLimit:m=1e4,slowClickTimeout:E=7e3,slowClickIgnoreSelectors:g=[],networkDetailAllowUrls:T=[],networkDetailDenyUrls:M=[],networkCaptureBodies:x=!0,networkRequestHeaders:U=[],networkResponseHeaders:S=[],mask:y=[],maskAttributes:A=["title","placeholder"],unmask:z=[],block:_=[],unblock:b=[],ignore:W=[],maskFn:V,beforeAddRecordingEvent:j,beforeErrorSampling:ne,blockClass:P,blockSelector:ue,maskInputOptions:$,maskTextClass:ee,maskTextSelector:de,ignoreClass:Ge}={}){this.name=mt.id;const ve=qo({mask:y,unmask:z,block:_,unblock:b,ignore:W,blockClass:P,blockSelector:ue,maskTextClass:ee,maskTextSelector:de,ignoreClass:Ge});if(this._recordingOptions=te(R({maskAllInputs:d,maskAllText:f,maskInputOptions:te(R({},$||{}),{password:!0}),maskTextFn:V,maskInputFn:V,maskAttributeFn:(we,Be,Je)=>Vo({maskAttributes:A,maskAllText:f,privacyOptions:ve,key:we,value:Be,el:Je})},ve),{slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:we=>{try{we.__rrweb__=!0}catch(Be){}}}),this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,Br),maxReplayDuration:Math.min(s,sn),stickySession:i,sessionSampleRate:l,errorSampleRate:u,useCompression:o,workerUrl:c,blockAllMedia:h,maskAllInputs:d,maskAllText:f,mutationBreadcrumbLimit:p,mutationLimit:m,slowClickTimeout:E,slowClickIgnoreSelectors:g,networkDetailAllowUrls:T,networkDetailDenyUrls:M,networkCaptureBodies:x,networkRequestHeaders:fr(U),networkResponseHeaders:fr(S),beforeAddRecordingEvent:j,beforeErrorSampling:ne,_experiments:a},typeof l=="number"&&(console.warn(`[Replay] You are passing \`sessionSampleRate\` to the Replay integration.
This option is deprecated and will be removed soon.
Instead, configure \`replaysSessionSampleRate\` directly in the SDK init options, e.g.:
Sentry.init({ replaysSessionSampleRate: ${l} })`),this._initialOptions.sessionSampleRate=l),typeof u=="number"&&(console.warn(`[Replay] You are passing \`errorSampleRate\` to the Replay integration.
This option is deprecated and will be removed soon.
Instead, configure \`replaysOnErrorSampleRate\` directly in the SDK init options, e.g.:
Sentry.init({ replaysOnErrorSampleRate: ${u} })`),this._initialOptions.errorSampleRate=u),this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${ur}`:ur),this._isInitialized&&(0,tn.j)())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return dr}set _isInitialized(t){dr=t}setupOnce(){(0,tn.j)()&&(this._setup(),setTimeout(()=>this._initialize()))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:this._replay.recordingMode==="session"}):Promise.resolve()}flush(t){return!this._replay||!this._replay.isEnabled()?Promise.resolve():this._replay.sendBufferedReplayOrFlush(t)}getReplayId(){if(!(!this._replay||!this._replay.isEnabled()))return this._replay.getSessionId()}_initialize(){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(),this._replay.initializeSampling())}_setup(){const t=Go(this._initialOptions);this._replay=new Se({options:t,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(){try{const n=(0,X.s3)().getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch(t){}}}mt.__initStatic();function Go(e){const t=(0,X.s3)(),n=t&&t.getOptions(),r=R({sessionSampleRate:0,errorSampleRate:0},(0,Et.Jr)(e));return n?(e.sessionSampleRate==null&&e.errorSampleRate==null&&n.replaysSessionSampleRate==null&&n.replaysOnErrorSampleRate==null&&(0,L.Cf)(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),typeof n.replaysSessionSampleRate=="number"&&(r.sessionSampleRate=n.replaysSessionSampleRate),typeof n.replaysOnErrorSampleRate=="number"&&(r.errorSampleRate=n.replaysOnErrorSampleRate),r):((0,L.Cf)(()=>{console.warn("SDK client is not available.")}),r)}function fr(e){return[...Yo,...e.map(t=>t.toLowerCase())]}function ia(){const e=getClient();return e&&e.getIntegrationByName&&e.getIntegrationByName("Replay")}const oa=null,aa=null;class ca extends null{}}}]);
}());