import{q as sd}from"./vendor-react-DQR3_HYc.js";const v=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,$=globalThis,Tt="10.52.0";function Ct(){return xr($),$}function xr(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Tt,t[Tt]=t[Tt]||{}}function Jt(e,t,n=$){const r=n.__SENTRY__=n.__SENTRY__||{},s=r[Tt]=r[Tt]||{};return s[e]||(s[e]=t())}const id=["debug","info","warn","error","log","assert","trace"],od="Sentry Logger ",dr={};function dt(e){if(!("console"in $))return e();const t=$.console,n={},r=Object.keys(dr);r.forEach(s=>{const i=dr[s];n[s]=t[s],t[s]=i});try{return e()}finally{r.forEach(s=>{t[s]=n[s]})}}function ad(){Zs().enabled=!0}function cd(){Zs().enabled=!1}function ba(){return Zs().enabled}function ud(...e){Js("log",...e)}function dd(...e){Js("warn",...e)}function ld(...e){Js("error",...e)}function Js(e,...t){v&&ba()&&dt(()=>{$.console[e](`${od}[${e}]:`,...t)})}function Zs(){return v?Jt("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const S={enable:ad,disable:cd,isEnabled:ba,log:ud,warn:dd,error:ld},va=50,kt="?",$i=/\(error: (.*)\)/,Ui=/captureMessage|captureException/;function Ta(...e){const t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,s=0)=>{const i=[],o=n.split(`
`);for(let c=r;c<o.length;c++){let a=o[c];a.length>1024&&(a=a.slice(0,1024));const u=$i.test(a)?a.replace($i,"$1"):a;if(!u.includes("Error: ")){for(const l of t){const d=l(u);if(d){i.push(d);break}}if(i.length>=va+s)break}}return pd(i.slice(s))}}function fd(e){return Array.isArray(e)?Ta(...e):e}function pd(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(Gn(t).function||"")&&t.pop(),t.reverse(),Ui.test(Gn(t).function||"")&&(t.pop(),Ui.test(Gn(t).function||"")&&t.pop()),t.slice(0,va).map(n=>({...n,filename:n.filename||Gn(t).filename,function:n.function||kt}))}function Gn(e){return e[e.length-1]||{}}const es="<anonymous>";function Xe(e){try{return!e||typeof e!="function"?es:e.name||es}catch{return es}}function Hi(e){const t=e.exception;if(t){const n=[];try{return t.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}function Ia(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}const cn={},Wi={};function lt(e,t){return cn[e]=cn[e]||[],cn[e].push(t),()=>{const n=cn[e];if(n){const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}function ft(e,t){if(!Wi[e]){Wi[e]=!0;try{t()}catch(n){v&&S.error(`Error while instrumenting ${e}`,n)}}}function xe(e,t){const n=e&&cn[e];if(n)for(const r of n)try{r(t)}catch(s){v&&S.error(`Error while triggering instrumentation handler.
Type: ${e}
Name: ${Xe(r)}
Error:`,s)}}let ts=null;function wa(e){const t="error";lt(t,e),ft(t,hd)}function hd(){ts=$.onerror,$.onerror=function(e,t,n,r,s){return xe("error",{column:r,error:s,line:n,msg:e,url:t}),ts?ts.apply(this,arguments):!1},$.onerror.__SENTRY_INSTRUMENTED__=!0}let ns=null;function ka(e){const t="unhandledrejection";lt(t,e),ft(t,md)}function md(){ns=$.onunhandledrejection,$.onunhandledrejection=function(e){return xe("unhandledrejection",e),ns?ns.apply(this,arguments):!0},$.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Ra=Object.prototype.toString;function Ar(e){switch(Ra.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Je(e,Error)}}function Zt(e,t){return Ra.call(e)===`[object ${t}]`}function Ca(e){return Zt(e,"ErrorEvent")}function zi(e){return Zt(e,"DOMError")}function gd(e){return Zt(e,"DOMException")}function Ge(e){return Zt(e,"String")}function Qs(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Wt(e){return e===null||Qs(e)||typeof e!="object"&&typeof e!="function"}function mn(e){return Zt(e,"Object")}function Nr(e){return typeof Event<"u"&&Je(e,Event)}function _d(e){return typeof Element<"u"&&Je(e,Element)}function Sd(e){return Zt(e,"RegExp")}function Cn(e){return!!(e!=null&&e.then&&typeof e.then=="function")}function yd(e){return mn(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Je(e,t){try{return e instanceof t}catch{return!1}}function Ma(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}function ei(e){return typeof Request<"u"&&Je(e,Request)}const ti=$,Ed=80;function ce(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,s=[];let i=0,o=0;const c=" > ",a=c.length;let u;const l=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||Ed;for(;n&&i++<r&&(u=bd(n,l),!(u==="html"||i>1&&o+s.length*a+u.length>=d));)s.push(u),o+=u.length,n=n.parentNode;return s.reverse().join(c)}catch{return"<unknown>"}}function bd(e,t){const n=e,r=[];if(!(n!=null&&n.tagName))return"";if(ti.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const s=t!=null&&t.length?t.filter(i=>n.getAttribute(i)).map(i=>[i,n.getAttribute(i)]):null;if(s!=null&&s.length)s.forEach(i=>{r.push(`[${i[0]}="${i[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const i=n.className;if(i&&Ge(i)){const o=i.split(/\s+/);for(const c of o)r.push(`.${c}`)}}for(const i of["aria-label","type","name","title","alt"]){const o=n.getAttribute(i);o&&r.push(`[${i}="${o}"]`)}return r.join("")}function Qt(){try{return ti.document.location.href}catch{return""}}function xa(e,t=5){if(!ti.HTMLElement)return null;let n=e;for(let r=0;r<t;r++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}function Ee(e,t,n){if(!(t in e))return;const r=e[t];if(typeof r!="function")return;const s=n(r);typeof s=="function"&&Aa(s,r);try{e[t]=s}catch{v&&S.log(`Failed to replace method "${t}" in object`,e)}}function be(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{v&&S.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function Aa(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,be(e,"__sentry_original__",t)}catch{}}function ni(e){return e.__sentry_original__}function Na(e){if(Ar(e))return{message:e.message,name:e.name,stack:e.stack,...qi(e)};if(Nr(e)){const t={type:e.type,target:ji(e.target),currentTarget:ji(e.currentTarget),...qi(e)};return typeof CustomEvent<"u"&&Je(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function ji(e){try{return _d(e)?ce(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function qi(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function vd(e){const t=Object.keys(Na(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}let At;function Mn(e){if(At!==void 0)return At?At(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=$;return t in n&&typeof n[t]=="function"?(At=n[t],At(e)):(At=null,e())}function st(){return Mn(()=>Math.random())}function xn(){return Mn(()=>Date.now())}function Es(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Gi(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;r<e.length;r++){const s=e[r];try{Ma(s)?n.push(Ia(s)):n.push(String(s))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function un(e,t,n=!1){return Ge(e)?Sd(t)?t.test(e):Ge(t)?n?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function Ve(e,t=[],n=!1){return t.some(r=>un(e,r,n))}function Td(){const e=$;return e.crypto||e.msCrypto}let rs;function Id(){return st()*16}function we(e=Td()){try{if(e!=null&&e.randomUUID)return Mn(()=>e.randomUUID()).replace(/-/g,"")}catch{}return rs||(rs="10000000100040008000"+1e11),rs.replace(/[018]/g,t=>(t^(Id()&15)>>t/4).toString(16))}function Oa(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)==null?void 0:n[0]}function Et(e){const{message:t,event_id:n}=e;if(t)return t;const r=Oa(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function bs(e,t,n){const r=e.exception=e.exception||{},s=r.values=r.values||[],i=s[0]=s[0]||{};i.value||(i.value=t||""),i.type||(i.type="Error")}function zt(e,t){const n=Oa(e);if(!n)return;const r={type:"generic",handled:!0},s=n.mechanism;if(n.mechanism={...r,...s,...t},t&&"data"in t){const i={...s==null?void 0:s.data,...t.data};n.mechanism.data=i}}function Vi(e){if(wd(e))return!0;try{be(e,"__sentry_captured__",!0)}catch{}return!1}function wd(e){try{return e.__sentry_captured__}catch{}}const La=1e3;function Mt(){return xn()/La}function kd(){const{performance:e}=$;if(!(e!=null&&e.now)||!e.timeOrigin)return Mt;const t=e.timeOrigin;return()=>(t+Mn(()=>e.now()))/La}let Yi;function ae(){return(Yi??(Yi=kd()))()}let ss=null;function Rd(){var o;const{performance:e}=$;if(!(e!=null&&e.now))return;const t=3e5,n=Mn(()=>e.now()),r=xn(),s=e.timeOrigin;if(typeof s=="number"&&Math.abs(s+n-r)<t)return s;const i=(o=e.timing)==null?void 0:o.navigationStart;return typeof i=="number"&&Math.abs(i+n-r)<t?i:r-n}function fe(){return ss===null&&(ss=Rd()),ss}function Cd(e){const t=ae(),n={sid:we(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>xd(n)};return e&&jt(n,e),n}function jt(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||ae(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:we()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{const n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Md(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),jt(e,n)}function xd(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function An(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;const r={...e};for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=An(r[s],t[s],n-1));return r}function Ze(){return we()}function Ye(){return we().substring(16)}const vs="_sentrySpan";function gn(e,t){t?be(e,vs,t):delete e[vs]}function lr(e){return e[vs]}const Ad=100;class We{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Ze(),sampleRand:st()}}clone(){const t=new We;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,gn(t,lr(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&jt(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(t){return this._conversationId=t||void 0,this._notifyScopeListeners(),this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n=typeof t=="function"?t(this):t,r=n instanceof We?n.getScopeData():mn(n)?t:void 0,{tags:s,attributes:i,extra:o,user:c,contexts:a,level:u,fingerprint:l=[],propagationContext:d,conversationId:f}=r||{};return this._tags={...this._tags,...s},this._attributes={...this._attributes,...i},this._extra={...this._extra,...o},this._contexts={...this._contexts,...a},c&&Object.keys(c).length&&(this._user=c),u&&(this._level=u),l.length&&(this._fingerprint=l),d&&(this._propagationContext=d),f&&(this._conversationId=f),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,gn(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Ze(),sampleRand:st()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){var i;const r=typeof n=="number"?n:Ad;if(r<=0)return this;const s={timestamp:Mt(),...t,message:t.message?Es(t.message,2048):t.message};return this._breadcrumbs.push(s),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),(i=this._client)==null||i.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:lr(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=An(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){const r=(n==null?void 0:n.event_id)||we();if(!this._client)return v&&S.warn("No client configured on scope - will not capture exception!"),r;const s=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:s,...n,event_id:r},this),r}captureMessage(t,n,r){const s=(r==null?void 0:r.event_id)||we();if(!this._client)return v&&S.warn("No client configured on scope - will not capture message!"),s;const i=(r==null?void 0:r.syntheticException)??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:i,...r,event_id:s},this),s}captureEvent(t,n){const r=t.event_id||(n==null?void 0:n.event_id)||we();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(v&&S.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}}function Nd(){return Jt("defaultCurrentScope",()=>new We)}function Od(){return Jt("defaultIsolationScope",()=>new We)}const Ki=e=>e instanceof Promise&&!e[Da],Da=Symbol("chained PromiseLike"),Ld=(e,t,n)=>{const r=e.then(s=>(t(s),s),s=>{throw n(s),s});return Ki(r)&&Ki(e)?r:Dd(e,r)},Dd=(e,t)=>{if(!t)return e;let n=!1;for(const r in e){if(r in t)continue;n=!0;const s=e[r];typeof s=="function"?Object.defineProperty(t,r,{value:(...i)=>s.apply(e,i),enumerable:!0,configurable:!0,writable:!0}):t[r]=s}return n&&Object.assign(t,{[Da]:!0}),t};class Pd{constructor(t,n){let r;t?r=t:r=new We;let s;n?s=n:s=new We,this._stack=[{scope:r}],this._isolationScope=s}withScope(t){const n=this._pushScope();let r;try{r=t(n)}catch(s){throw this._popScope(),s}return Cn(r)?Ld(r,()=>this._popScope(),()=>this._popScope()):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function qt(){const e=Ct(),t=xr(e);return t.stack=t.stack||new Pd(Nd(),Od())}function Fd(e){return qt().withScope(e)}function Bd(e,t){const n=qt();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function Xi(e){return qt().withScope(()=>e(qt().getIsolationScope()))}function $d(){return{withIsolationScope:Xi,withScope:Fd,withSetScope:Bd,withSetIsolationScope:(e,t)=>Xi(t),getCurrentScope:()=>qt().getScope(),getIsolationScope:()=>qt().getIsolationScope()}}function en(e){const t=xr(e);return t.acs?t.acs:$d()}function G(){const e=Ct();return en(e).getCurrentScope()}function ve(){const e=Ct();return en(e).getIsolationScope()}function Ud(){return Jt("globalScope",()=>new We)}function ri(...e){const t=Ct(),n=en(t);if(e.length===2){const[r,s]=e;return r?n.withSetScope(r,s):n.withScope(s)}return n.withScope(e[0])}function D(){return G().getClient()}function Hd(e){const t=e.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:s}=t,i={trace_id:n,span_id:s||Ye()};return r&&(i.parent_span_id=r),i}const $e="sentry.source",si="sentry.sample_rate",Pa="sentry.previous_trace_sample_rate",Fe="sentry.op",ue="sentry.origin",_n="sentry.idle_span_finish_reason",Nn="sentry.measurement_unit",On="sentry.measurement_value",Ji="sentry.custom_span_name",ii="sentry.profile_id",pt="sentry.exclusive_time",Wd="sentry.link.type",zd="gen_ai.conversation.id",Fa=0,Or=1,de=2;function jd(e){if(e<400&&e>=100)return{code:Or};if(e>=400&&e<500)switch(e){case 401:return{code:de,message:"unauthenticated"};case 403:return{code:de,message:"permission_denied"};case 404:return{code:de,message:"not_found"};case 409:return{code:de,message:"already_exists"};case 413:return{code:de,message:"failed_precondition"};case 429:return{code:de,message:"resource_exhausted"};case 499:return{code:de,message:"cancelled"};default:return{code:de,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:de,message:"unimplemented"};case 503:return{code:de,message:"unavailable"};case 504:return{code:de,message:"deadline_exceeded"};default:return{code:de,message:"internal_error"}}return{code:de,message:"internal_error"}}function Ba(e,t){e.setAttribute("http.response.status_code",t);const n=jd(t);n.message!=="unknown_error"&&e.setStatus(n)}function qd(e){try{const t=$.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function Gd(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}const $a="_sentryScope",Ua="_sentryIsolationScope";function Vd(e,t,n){e&&(be(e,Ua,qd(n)),be(e,$a,t))}function fr(e){const t=e;return{scope:t[$a],isolationScope:Gd(t[Ua])}}const pr="sentry-",Yd=8192;function Ha(e){const t=Xd(e);if(!t)return;const n=Object.entries(t).reduce((r,[s,i])=>{if(s.startsWith(pr)){const o=s.slice(pr.length);r[o]=i}return r},{});if(Object.keys(n).length>0)return n}function Kd(e){if(!e)return;const t=Object.entries(e).reduce((n,[r,s])=>(s&&(n[`${pr}${r}`]=s),n),{});return Jd(t)}function Xd(e){if(!(!e||!Ge(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{const r=Zi(n);return Object.entries(r).forEach(([s,i])=>{t[s]=i}),t},{}):Zi(e)}function Zi(e){return e.split(",").map(t=>{const n=t.indexOf("=");if(n===-1)return[];const r=t.slice(0,n),s=t.slice(n+1);return[r,s].map(i=>{try{return decodeURIComponent(i.trim())}catch{return}})}).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}function Jd(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,r],s)=>{const i=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,o=s===0?i:`${t},${i}`;return o.length>Yd?(v&&S.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):o},"")}const Zd=/^o(\d+)\./,Qd=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function el(e){return e==="http"||e==="https"}function tn(e,t=!1){const{host:n,path:r,pass:s,port:i,projectId:o,protocol:c,publicKey:a}=e;return`${c}://${a}${t&&s?`:${s}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${o}`}function tl(e){const t=Qd.exec(e);if(!t){dt(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,r,s="",i="",o="",c=""]=t.slice(1);let a="",u=c;const l=u.split("/");if(l.length>1&&(a=l.slice(0,-1).join("/"),u=l.pop()),u){const d=u.match(/^\d+/);d&&(u=d[0])}return Wa({host:i,pass:s,path:a,projectId:u,port:o,protocol:n,publicKey:r})}function Wa(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function nl(e){if(!v)return!0;const{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(o=>e[o]?!1:(S.error(`Invalid Sentry Dsn: ${o} missing`),!0))?!1:n.match(/^\d+$/)?el(r)?t&&isNaN(parseInt(t,10))?(S.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(S.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(S.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function rl(e){const t=e.match(Zd);return t==null?void 0:t[1]}function sl(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=rl(n)),r}function il(e){const t=typeof e=="string"?tl(e):Wa(e);if(!(!t||!nl(t)))return t}function Rt(e){if(typeof e=="boolean")return Number(e);const t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}const za=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function ol(e){if(!e)return;const t=e.match(za);if(!t)return;let n;return t[3]==="1"?n=!0:t[3]==="0"&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function al(e,t){const n=ol(e),r=Ha(t);if(!(n!=null&&n.traceId))return{traceId:Ze(),sampleRand:st()};const s=cl(n,r);r&&(r.sample_rand=s.toString());const{traceId:i,parentSpanId:o,parentSampled:c}=n;return{traceId:i,parentSpanId:o,sampled:c,dsc:r||{},sampleRand:s}}function ja(e=Ze(),t=Ye(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function qa(e=Ze(),t=Ye(),n){return`00-${e}-${t}-${n?"01":"00"}`}function cl(e,t){const n=Rt(t==null?void 0:t.sample_rand);if(n!==void 0)return n;const r=Rt(t==null?void 0:t.sample_rate);return r&&(e==null?void 0:e.parentSampled)!==void 0?e.parentSampled?st()*r:r+st()*(1-r):st()}const Ga=0,Lr=1;let Qi=!1;function ul(e){const{spanId:t,traceId:n}=e.spanContext(),{data:r,op:s,parent_span_id:i,status:o,origin:c,links:a}=q(e);return{parent_span_id:i,span_id:t,trace_id:n,data:r,op:s,status:o,origin:c,links:a}}function dl(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),s=r?t:q(e).parent_span_id,i=fr(e).scope,o=r?(i==null?void 0:i.getPropagationContext().propagationSpanId)||Ye():t;return{parent_span_id:s,span_id:o,trace_id:n}}function ll(e){const{traceId:t,spanId:n}=e.spanContext(),r=ht(e);return ja(t,n,r)}function fl(e){const{traceId:t,spanId:n}=e.spanContext(),r=ht(e);return qa(t,n,r)}function Va(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:r,...s},attributes:i})=>({span_id:t,trace_id:n,sampled:r===Lr,attributes:i,...s}))}function Ya(e){if(e!=null&&e.length)return e.map(({context:{spanId:t,traceId:n,traceFlags:r},attributes:s})=>({span_id:t,trace_id:n,sampled:r===Lr,attributes:s}))}function Ke(e){return typeof e=="number"?eo(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?eo(e.getTime()):ae()}function eo(e){return e>9999999999?e/1e3:e}function q(e){if(Za(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(Ja(e)){const{attributes:r,startTime:s,name:i,endTime:o,status:c,links:a}=e;return{span_id:t,trace_id:n,data:r,description:i,parent_span_id:Xa(e),start_timestamp:Ke(s),timestamp:Ke(o)||void 0,status:Qa(c),op:r[Fe],origin:r[ue],links:Va(a)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function Ka(e){if(Za(e))return e.getStreamedSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(Ja(e)){const{attributes:r,startTime:s,name:i,endTime:o,status:c,links:a}=e;return{name:i,span_id:t,trace_id:n,parent_span_id:Xa(e),start_timestamp:Ke(s),end_timestamp:Ke(o),is_segment:e===Is(e),status:ec(c),attributes:r,links:Ya(a)}}return{span_id:t,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:e===Is(e)}}function Xa(e){var t;return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?(t=e.parentSpanContext)==null?void 0:t.spanId:void 0}function Ja(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function Za(e){return typeof e.getSpanJSON=="function"}function ht(e){const{traceFlags:t}=e.spanContext();return t===Lr}function Qa(e){if(!(!e||e.code===Fa))return e.code===Or?"ok":e.message||"internal_error"}function ec(e){return!e||e.code===Or||e.code===Fa||e.message==="cancelled"?"ok":"error"}const It="_sentryChildSpans",Ts="_sentryRootSpan";function tc(e,t){const n=e[Ts]||e;be(t,Ts,n),e[It]?e[It].add(t):be(e,It,new Set([t]))}function pl(e,t){e[It]&&e[It].delete(t)}function nr(e){const t=new Set;function n(r){if(!t.has(r)&&ht(r)){t.add(r);const s=r[It]?Array.from(r[It]):[];for(const i of s)n(i)}}return n(e),Array.from(t)}const le=Is;function Is(e){return e[Ts]||e}function he(){const e=Ct(),t=en(e);return t.getActiveSpan?t.getActiveSpan():lr(G())}function ws(){Qi||(dt(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),Qi=!0)}let to=!1;function hl(){if(to)return;function e(){const t=he(),n=t&&le(t);if(n){const r="internal_error";v&&S.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:de,message:r})}}e.tag="sentry_tracingErrorCallback",to=!0,wa(e),ka(e)}function De(e){var n;if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=e||((n=D())==null?void 0:n.getOptions());return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function no(e){S.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function Sn(e,t){if(!(t!=null&&t.length))return!1;for(const n of t){if(_l(n)){if(e.description&&un(e.description,n))return v&&no(e),!0;continue}const r=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!r)continue;const s=n.name?e.description&&un(e.description,n.name):!0,i=n.op?e.op&&un(e.op,n.op):!0,o=n.attributes?Object.entries(n.attributes).every(([c,a])=>{var u;return ml((u=e.attributes)==null?void 0:u[c],a)}):!0;if(s&&i&&o)return v&&no(e),!0}return!1}function ml(e,t){return typeof e=="string"&&(typeof t=="string"||t instanceof RegExp)?un(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e===t}function gl(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const s of e)s.parent_span_id===r&&(s.parent_span_id=n)}function _l(e){return typeof e=="string"||e instanceof RegExp}const oi="production",nc="_frozenDsc";function rr(e,t){be(e,nc,t)}function rc(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},s={environment:n.environment||oi,release:n.release,public_key:r,trace_id:e,org_id:sl(t)};return t.emit("createDsc",s),s}function sc(e,t){const n=t.getPropagationContext();return n.dsc||rc(n.traceId,e)}function ze(e){var h;const t=D();if(!t)return{};const n=le(e),r=q(n),s=r.data,i=n.spanContext().traceState,o=(i==null?void 0:i.get("sentry.sample_rate"))??s[si]??s[Pa];function c(m){return(typeof o=="number"||typeof o=="string")&&(m.sample_rate=`${o}`),m}const a=n[nc];if(a)return c(a);const u=i==null?void 0:i.get("sentry.dsc"),l=u&&Ha(u);if(l)return c(l);const d=rc(e.spanContext().traceId,t),f=s[$e]??s["sentry.span.source"],p=r.description;return f!=="url"&&p&&(d.transaction=p),De()&&(d.sampled=String(ht(n)),d.sample_rand=(i==null?void 0:i.get("sentry.sample_rand"))??((h=fr(n).scope)==null?void 0:h.getPropagationContext().sampleRand.toString())),c(d),t.emit("createDsc",d,n),d}class He{constructor(t={}){this._traceId=t.traceId||Ze(),this._spanId=t.spanId||Ye(),this.dropReason=t.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:Ga}}end(t){}setAttribute(t,n){return this}setAttributes(t){return this}setStatus(t){return this}updateName(t){return this}isRecording(){return!1}addEvent(t,n,r){return this}addLink(t){return this}addLinks(t){return this}recordException(t,n){}}function ic(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}const Sl=Symbol.for("sentry.skipNormalization"),yl=Symbol.for("sentry.overrideNormalizationDepth");function El(e){return!!e[Sl]}function bl(e){const t=e[yl];return typeof t=="number"?t:void 0}function Le(e,t=100,n=1/0){try{return ks("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function oc(e,t=3,n=100*1024){const r=Le(e,t);return wl(r)>n?oc(e,t-1,n):r}function ks(e,t,n=1/0,r=1/0,s=kl()){const[i,o]=s;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const c=vl(e,t);if(!c.startsWith("[object "))return c;if(El(t))return t;const a=bl(t),u=a!==void 0?a:n;if(u===0)return c.replace("object ","");if(i(t))return"[Circular ~]";const l=t;if(l&&typeof l.toJSON=="function")try{const h=l.toJSON();return ks("",h,u-1,r,s)}catch{}const d=Array.isArray(t)?[]:{};let f=0;const p=Na(t);for(const h in p){if(!Object.prototype.hasOwnProperty.call(p,h))continue;if(f>=r){d[h]="[MaxProperties ~]";break}const m=p[h];d[h]=ks(h,m,u-1,r,s),f++}return o(t),d}function vl(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(Ma(t))return Ia(t);if(yd(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${Xe(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=Tl(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function Tl(e){const t=Object.getPrototypeOf(e);return t!=null&&t.constructor?t.constructor.name:"null prototype"}function Il(e){return~-encodeURI(e).split(/%..|./).length}function wl(e){return Il(JSON.stringify(e))}function kl(){const e=new WeakSet;function t(r){return e.has(r)?!0:(e.add(r),!1)}function n(r){e.delete(r)}return[t,n]}function mt(e,t=[]){return[e,t]}function Rl(e,t){const[n,r]=e;return[n,[...r,t]]}function Rs(e,t){const n=e[1];for(const r of n){const s=r[0].type;if(t(r,s))return!0}return!1}function Cl(e,t){return Rs(e,(n,r)=>t.includes(r))}function Cs(e){const t=xr($);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function Ml(e){const[t,n]=e;let r=JSON.stringify(t);function s(i){typeof r=="string"?r=typeof i=="string"?r+i:[Cs(r),i]:r.push(typeof i=="string"?Cs(i):i)}for(const i of n){const[o,c]=i;if(s(`
${JSON.stringify(o)}
`),typeof c=="string"||c instanceof Uint8Array)s(c);else{let a;try{a=JSON.stringify(c)}catch{a=JSON.stringify(Le(c))}s(a)}}return typeof r=="string"?r:xl(r)}function xl(e){const t=e.reduce((s,i)=>s+i.length,0),n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function Al(e){return[{type:"span"},e]}function Nl(e){const t=typeof e.data=="string"?Cs(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const ac={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function Ol(e){return e in ac}function ro(e){return Ol(e)?ac[e]:e}function ai(e){if(!(e!=null&&e.sdk))return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function cc(e,t,n,r){var i;const s=(i=e.sdkProcessingMetadata)==null?void 0:i.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:tn(r)},...s&&{trace:s}}}function Ll(e,t){var r,s,i,o;if(!t)return e;const n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...((r=e.sdk)==null?void 0:r.integrations)||[],...t.integrations||[]],packages:[...((s=e.sdk)==null?void 0:s.packages)||[],...t.packages||[]],settings:(i=e.sdk)!=null&&i.settings||t.settings?{...(o=e.sdk)==null?void 0:o.settings,...t.settings}:void 0},e}function Dl(e,t,n,r){const s=ai(n),i={sent_at:new Date().toISOString(),...s&&{sdk:s},...!!r&&t&&{dsn:tn(t)}},o="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return mt(i,[o])}function Pl(e,t,n,r){const s=ai(n),i=e.type&&e.type!=="replay_event"?e.type:"event";Ll(e,n==null?void 0:n.sdk);const o=cc(e,s,r,t);return delete e.sdkProcessingMetadata,mt(o,[[{type:i},e]])}function Fl(e,t){function n(p){return!!p.trace_id&&!!p.public_key}const r=ze(e[0]),s=t==null?void 0:t.getDsn(),i=t==null?void 0:t.getOptions().tunnel,o={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!i&&s&&{dsn:tn(s)}},{beforeSendSpan:c,ignoreSpans:a}=(t==null?void 0:t.getOptions())||{},u=a!=null&&a.length?e.filter(p=>{const h=q(p);return!Sn({description:h.description,op:h.op,attributes:h.data},a)}):e,l=e.length-u.length;l&&(t==null||t.recordDroppedEvent("before_send","span",l));const d=c?p=>{const h=q(p),m=ic(c)?h:c(h);return m||(ws(),h)}:q,f=[];for(const p of u){const h=d(p);h&&f.push(Al(h))}return mt(o,f)}function Bl(e){if(!v)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=q(e),{spanId:s}=e.spanContext(),i=ht(e),o=le(e),c=o===e,a=`[Tracing] Starting ${i?"sampled":"unsampled"} ${c?"root ":""}span`,u=[`op: ${n}`,`name: ${t}`,`ID: ${s}`];if(r&&u.push(`parent ID: ${r}`),!c){const{op:l,description:d}=q(o);u.push(`root ID: ${o.spanContext().spanId}`),l&&u.push(`root op: ${l}`),d&&u.push(`root description: ${d}`)}S.log(`${a}
  ${u.join(`
  `)}`)}function $l(e){if(!v)return;const{description:t="< unknown name >",op:n="< unknown op >"}=q(e),{spanId:r}=e.spanContext(),i=le(e)===e,o=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${t}" with ID ${r}`;S.log(o)}function Ul(e,t,n,r=he()){const s=r&&le(r);s&&(v&&S.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),s.addEvent(e,{[On]:t,[Nn]:n}))}function so(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const r=n.attributes||{},s=r[Nn],i=r[On];typeof s=="string"&&typeof i=="number"&&(t[n.name]={value:i,unit:s})}),t}function Qe(e){return e.getOptions().traceLifecycle==="stream"}const io=1e3;class Dr{constructor(t={}){this._traceId=t.traceId||Ze(),this._spanId=t.spanId||Ye(),this._startTime=t.startTimestamp||ae(),this._links=t.links,this._attributes={},this.setAttributes({[ue]:"manual",[Fe]:t.op,...t.attributes}),this._name=t.name,t.parentSpanId&&(this._parentSpanId=t.parentSpanId),"sampled"in t&&(this._sampled=t.sampled),t.endTimestamp&&(this._endTime=t.endTimestamp),this._events=[],this._isStandaloneSpan=t.isStandalone,this._endTime&&this._onSpanEnded()}addLink(t){return this._links?this._links.push(t):this._links=[t],this}addLinks(t){return this._links?this._links.push(...t):this._links=t,this}recordException(t,n){}spanContext(){const{_spanId:t,_traceId:n,_sampled:r}=this;return{spanId:t,traceId:n,traceFlags:r?Lr:Ga}}setAttribute(t,n){return n===void 0?delete this._attributes[t]:this._attributes[t]=n,this}setAttributes(t){return Object.keys(t).forEach(n=>this.setAttribute(n,t[n])),this}updateStartTime(t){this._startTime=Ke(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute($e,"custom"),this}end(t){this._endTime||(this._endTime=Ke(t),$l(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[Fe],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:Qa(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[ue],profile_id:this._attributes[ii],exclusive_time:this._attributes[pt],measurements:so(this._events),is_segment:this._isStandaloneSpan&&le(this)===this||void 0,segment_id:this._isStandaloneSpan?le(this).spanContext().spanId:void 0,links:Va(this._links)}}getStreamedSpanJSON(){return{name:this._name??"",span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===le(this),status:ec(this._status),attributes:this._attributes,links:Ya(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){v&&S.log("[Tracing] Adding an event to span:",t);const s=oo(n)?n:r||ae(),i=oo(n)?{}:n||{},o={name:t,time:Ke(s),attributes:i};return this._events.push(o),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=D();if(t&&(t.emit("spanEnd",this),this._isStandaloneSpan||t.emit("afterSpanEnd",this)),!(this._isStandaloneSpan||this===le(this)))return;if(this._isStandaloneSpan){this._sampled?Wl(Fl([this],t)):(v&&S.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}else if(t&&Qe(t)){t.emit("afterSegmentSpanEnd",this);return}const r=this._convertSpanToTransaction();r&&(fr(this).scope||G()).captureEvent(r)}_convertSpanToTransaction(){var l;if(!ao(q(this)))return;this._name||(v&&S.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:t,isolationScope:n}=fr(this),r=(l=t==null?void 0:t.getScopeData().sdkProcessingMetadata)==null?void 0:l.normalizedRequest;if(this._sampled!==!0)return;const i=nr(this).filter(d=>d!==this&&!Hl(d)).map(d=>q(d)).filter(ao),o=this._attributes[$e];delete this._attributes[Ji],i.forEach(d=>{delete d.data[Ji]});const c={contexts:{trace:ul(this)},spans:i.length>io?i.sort((d,f)=>d.start_timestamp-f.start_timestamp).slice(0,io):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:ze(this)},request:r,...o&&{transaction_info:{source:o}}},a=so(this._events);return a&&Object.keys(a).length&&(v&&S.log("[Measurements] Adding measurements to transaction event",JSON.stringify(a,void 0,2)),c.measurements=a),c}}function oo(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function ao(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function Hl(e){return e instanceof Dr&&e.isStandaloneSpan()}function Wl(e){const t=D();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function zl(e,t,n){if(!De(e))return[!1];let r,s;typeof e.tracesSampler=="function"?(s=e.tracesSampler({...t,inheritOrSampleWith:c=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):c}),r=!0):t.parentSampled!==void 0?s=t.parentSampled:typeof e.tracesSampleRate<"u"&&(s=e.tracesSampleRate,r=!0);const i=Rt(s);if(i===void 0)return v&&S.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(s)} of type ${JSON.stringify(typeof s)}.`),[!1];if(!i)return v&&S.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,i,r];const o=n<i;return o||v&&S.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(s)})`),[o,i,r]}const jl="__SENTRY_SUPPRESS_TRACING__";function xt(e){const t=dc();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=Gl(e),{forceTransaction:r,parentSpan:s}=e;return(e.scope?o=>ri(e.scope,o):s!==void 0?o=>uc(s,o):o=>o())(()=>{const o=G(),c=Yl(o,s),a=D();return e.onlyIfParent&&!c?(a==null||a.recordDroppedEvent("no_parent_span","span"),new He):ql({parentSpan:c,spanArguments:n,forceTransaction:r,scope:o})})}function uc(e,t){const n=dc();return n.withActiveSpan?n.withActiveSpan(e,t):ri(r=>(gn(r,e||void 0),t(r)))}function ql({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!De()){const c=new He;if(n||!e){const a={sampled:"false",sample_rate:"0",transaction:t.name,...ze(c)};rr(c,a)}return c}const s=D();if(Kl(s,t))return ci(r)||s==null||s.recordDroppedEvent("ignored","span"),new He({dropReason:"ignored",traceId:(e==null?void 0:e.spanContext().traceId)??r.getPropagationContext().traceId});const i=ve();let o;if(e&&!n)o=Vl(e,r,t),tc(e,o);else if(e){const c=ze(e),{traceId:a,spanId:u}=e.spanContext(),l=ht(e);o=co({traceId:a,parentSpanId:u,...t},r,l),rr(o,c)}else{const{traceId:c,dsc:a,parentSpanId:u,sampled:l}={...i.getPropagationContext(),...r.getPropagationContext()};o=co({traceId:c,parentSpanId:u,...t},r,l),a&&rr(o,a)}return Bl(o),Vd(o,r,i),o}function Gl(e){const n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const r={...n};return r.startTimestamp=Ke(e.startTime),delete r.startTime,r}return n}function dc(){const e=Ct();return en(e)}function co(e,t,n){var m;const r=D(),s=(r==null?void 0:r.getOptions())||{},{name:i=""}=e,o={spanAttributes:{...e.attributes},spanName:i,parentSampled:n};r==null||r.emit("beforeSampling",o,{decision:!1});const c=o.parentSampled??n,a=o.spanAttributes,u=t.getPropagationContext(),l=ci(t),[d,f,p]=l?[!1]:zl(s,{name:i,parentSampled:c,attributes:a,parentSampleRate:Rt((m=u.dsc)==null?void 0:m.sample_rate)},u.sampleRand),h=new Dr({...e,attributes:{[$e]:"custom",[si]:f!==void 0&&p?f:void 0,...a},sampled:d});return!d&&r&&!l&&(v&&S.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate",Qe(r)?"span":"transaction")),r&&r.emit("spanStart",h),h}function Vl(e,t,n){const{spanId:r,traceId:s}=e.spanContext(),i=ci(t),o=i?!1:ht(e),c=o?new Dr({...n,parentSpanId:r,traceId:s,sampled:o}):new He({traceId:s});tc(e,c);const a=D();return a&&(Qe(a)&&c instanceof He&&(e instanceof He&&e.dropReason?(c.dropReason=e.dropReason,a.recordDroppedEvent(e.dropReason,"span")):i||(c.dropReason="sample_rate",a.recordDroppedEvent("sample_rate","span"))),a.emit("spanStart",c),n.endTimestamp&&(a.emit("spanEnd",c),a.emit("afterSpanEnd",c))),c}function Yl(e,t){if(t)return t;if(t===null)return;const n=lr(e);if(!n)return;const r=D();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?le(n):n}function Kl(e,t){var r;const n=e==null?void 0:e.getOptions().ignoreSpans;return!e||!Qe(e)||!(n!=null&&n.length)?!1:Sn({description:t.name||"",op:((r=t.attributes)==null?void 0:r[Fe])||t.op,attributes:t.attributes},n)}function ci(e){return e.getScopeData().sdkProcessingMetadata[jl]===!0}const sr={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},Xl="heartbeatFailed",Jl="idleTimeout",Zl="finalTimeout",Ql="externalFinish";function lc(e,t={}){const n=new Map;let r=!1,s,i=Ql,o=!t.disableAutoFinish;const c=[],{idleTimeout:a=sr.idleTimeout,finalTimeout:u=sr.finalTimeout,childSpanTimeout:l=sr.childSpanTimeout,beforeSpanEnd:d,trimIdleSpanEndTimestamp:f=!0}=t,p=D();if(!p||!De()){const _=new He,I={sample_rate:"0",sampled:"false",...ze(_)};return rr(_,I),_}const h=G(),m=he(),g=ef(e);g.end=new Proxy(g.end,{apply(_,I,te){if(d&&d(g),I instanceof He)return;const[b,...w]=te,H=b||ae(),z=Ke(H),N=nr(g).filter(x=>x!==g),oe=q(g);if(!N.length||!f)return A(z),Reflect.apply(_,I,[z,...w]);const J=p.getOptions().ignoreSpans,Z=N==null?void 0:N.reduce((x,ne)=>{const F=q(ne);return!F.timestamp||J&&Sn({description:F.description,op:F.op,attributes:F.data},J)?x:x?Math.max(x,F.timestamp):F.timestamp},void 0),E=oe.start_timestamp,j=Math.min(E?E+u/1e3:1/0,Math.max(E||-1/0,Math.min(z,Z||1/0)));return A(j),Reflect.apply(_,I,[j,...w])}});function y(){s&&(clearTimeout(s),s=void 0)}function T(_){y(),s=setTimeout(()=>{!r&&n.size===0&&o&&(i=Jl,g.end(_))},a)}function O(_){s=setTimeout(()=>{!r&&o&&(i=Xl,g.end(_))},l)}function B(_){y(),n.set(_,!0);const I=ae();O(I+l/1e3)}function Y(_){if(n.has(_)&&n.delete(_),n.size===0){const I=ae();T(I+a/1e3)}}function A(_){r=!0,n.clear(),c.forEach(N=>N()),gn(h,m);const I=q(g),{start_timestamp:te}=I;if(!te)return;I.data[_n]||g.setAttribute(_n,i);const w=I.status;(!w||w==="unknown")&&g.setStatus({code:Or}),S.log(`[Tracing] Idle span "${I.op}" finished`);const H=nr(g).filter(N=>N!==g);let z=0;H.forEach(N=>{N.isRecording()&&(N.setStatus({code:de,message:"cancelled"}),N.end(_),v&&S.log("[Tracing] Cancelling span since span ended early",JSON.stringify(N,void 0,2)));const oe=q(N),{timestamp:J=0,start_timestamp:Z=0}=oe,E=Z<=_,j=(u+a)/1e3,x=J-Z<=j;if(v){const ne=JSON.stringify(N,void 0,2);E?x||S.log("[Tracing] Discarding span since it finished after idle span final timeout",ne):S.log("[Tracing] Discarding span since it happened after idle span was finished",ne)}(!x||!E)&&(pl(g,N),z++)}),z>0&&g.setAttribute("sentry.idle_span_discarded_spans",z)}return c.push(p.on("spanStart",_=>{if(r||_===g||q(_).timestamp||_ instanceof Dr&&_.isStandaloneSpan())return;nr(g).includes(_)&&B(_.spanContext().spanId)})),c.push(p.on("spanEnd",_=>{r||Y(_.spanContext().spanId)})),c.push(p.on("idleSpanEnableAutoFinish",_=>{_===g&&(o=!0,T(),n.size&&O())})),t.disableAutoFinish||T(),setTimeout(()=>{r||(g.setStatus({code:de,message:"deadline_exceeded"}),i=Zl,g.end())},u),g}function ef(e){const t=xt(e);return gn(G(),t),v&&S.log("[Tracing] Started span is an idle span"),t}function tf(e,t){const{fingerprint:n,span:r,breadcrumbs:s,sdkProcessingMetadata:i}=t;nf(e,t),r&&of(e,r),af(e,n),rf(e,s),sf(e,i)}function uo(e,t){const{extra:n,tags:r,attributes:s,user:i,contexts:o,level:c,sdkProcessingMetadata:a,breadcrumbs:u,fingerprint:l,eventProcessors:d,attachments:f,propagationContext:p,transactionName:h,span:m}=t;on(e,"extra",n),on(e,"tags",r),on(e,"attributes",s),on(e,"user",i),on(e,"contexts",o),e.sdkProcessingMetadata=An(e.sdkProcessingMetadata,a,2),c&&(e.level=c),h&&(e.transactionName=h),m&&(e.span=m),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),l.length&&(e.fingerprint=[...e.fingerprint,...l]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext={...e.propagationContext,...p}}function on(e,t,n){e[t]=An(e[t],n,1)}function fc(e,t){const n=Ud().getScopeData();return e&&uo(n,e.getScopeData()),t&&uo(n,t.getScopeData()),n}function nf(e,t){const{extra:n,tags:r,user:s,contexts:i,level:o,transactionName:c}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(s).length&&(e.user={...s,...e.user}),Object.keys(i).length&&(e.contexts={...i,...e.contexts}),o&&(e.level=o),c&&e.type!=="transaction"&&(e.transaction=c)}function rf(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function sf(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function of(e,t){e.contexts={trace:dl(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:ze(t),...e.sdkProcessingMetadata};const n=le(t),r=q(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function af(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}const cf="thismessage:/";function ui(e){return"isRelative"in e}function di(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=n?cf:void 0;try{if("canParse"in URL&&!URL.canParse(e,r))return;const s=new URL(e,r);return n?{isRelative:n,pathname:s.pathname,search:s.search,hash:s.hash}:s}catch{}}function uf(e){if(ui(e))return e.pathname;const t=new URL(e);return t.search="",t.hash="",["80","443"].includes(t.port)&&(t.port=""),t.password&&(t.password="%filtered%"),t.username&&(t.username="%filtered%"),t.toString()}function wt(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function df(e){return e.split(/[?#]/,1)[0]}function it(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",s=e.includes(";base64,"),i=e.indexOf(",");let o="";if(t&&i!==-1){const c=e.slice(i+1);o=c.length>10?`${c.slice(0,10)}... [truncated]`:c}return`data:${r}${s?",base64":""}${o?`,${o}`:""}`}return e}function pc(e,t){const n=e.attributes??(e.attributes={});Object.entries(t).forEach(([r,s])=>{s!=null&&!(r in n)&&(n[r]=s)})}const is=0,lo=1,fo=2;function Ln(e){return new yn(t=>{t(e)})}function li(e){return new yn((t,n)=>{n(e)})}class yn{constructor(t){this._state=is,this._handlers=[],this._runExecutor(t)}then(t,n){return new yn((r,s)=>{this._handlers.push([!1,i=>{if(!t)r(i);else try{r(t(i))}catch(o){s(o)}},i=>{if(!n)s(i);else try{r(n(i))}catch(o){s(o)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new yn((n,r)=>{let s,i;return this.then(o=>{i=!1,s=o,t&&t()},o=>{i=!0,s=o,t&&t()}).then(()=>{if(i){r(s);return}n(s)})})}_executeHandlers(){if(this._state===is)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===lo&&n[1](this._value),this._state===fo&&n[2](this._value),n[0]=!0)})}_runExecutor(t){const n=(i,o)=>{if(this._state===is){if(Cn(o)){o.then(r,s);return}this._state=i,this._value=o,this._executeHandlers()}},r=i=>{n(lo,i)},s=i=>{n(fo,i)};try{t(r,s)}catch(i){s(i)}}}function lf(e,t,n,r=0){try{const s=Ms(t,n,e,r);return Cn(s)?s:Ln(s)}catch(s){return li(s)}}function Ms(e,t,n,r){const s=n[r];if(!e||!s)return e;const i=s({...e},t);return v&&i===null&&S.log(`Event processor "${s.id||"?"}" dropped event`),Cn(i)?i.then(o=>Ms(o,t,n,r+1)):Ms(i,t,n,r+1)}let je,po,ho,tt;function ff(e){const t=$._sentryDebugIds,n=$._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],s=n?Object.keys(n):[];if(tt&&r.length===po&&s.length===ho)return tt;po=r.length,ho=s.length,tt={},je||(je={});const i=(o,c)=>{for(const a of o){const u=c[a],l=je==null?void 0:je[a];if(l&&tt&&u)tt[l[0]]=u,je&&(je[a]=[l[0],u]);else if(u){const d=e(a);for(let f=d.length-1;f>=0;f--){const p=d[f],h=p==null?void 0:p.filename;if(h&&tt&&je){tt[h]=u,je[a]=[h,u];break}}}}};return t&&i(r,t),n&&i(s,n),tt}function hc(e,t,n,r,s,i){const{normalizeDepth:o=3,normalizeMaxBreadth:c=1e3}=e,a={...t,event_id:t.event_id||n.event_id||we(),timestamp:t.timestamp||Mt()},u=n.integrations||e.integrations.map(y=>y.name);pf(a,e),gf(a,u),s&&s.emit("applyFrameMetadata",t),t.type===void 0&&hf(a,e.stackParser);const l=Sf(r,n.captureContext);n.mechanism&&zt(a,n.mechanism);const d=s?s.getEventProcessors():[],f=fc(i,l),p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),tf(a,f);const h=[...d,...f.eventProcessors];return(n.data&&n.data.__sentry__===!0?Ln(a):lf(h,a,n)).then(y=>(y&&mf(y),typeof o=="number"&&o>0?_f(y,o,c):y))}function pf(e,t){var c,a;const{environment:n,release:r,dist:s,maxValueLength:i}=t;e.environment=e.environment||n||oi,!e.release&&r&&(e.release=r),!e.dist&&s&&(e.dist=s);const o=e.request;o!=null&&o.url&&i&&(o.url=Es(o.url,i)),i&&((a=(c=e.exception)==null?void 0:c.values)==null||a.forEach(u=>{u.value&&(u.value=Es(u.value,i))}))}function hf(e,t){var r,s;const n=ff(t);(s=(r=e.exception)==null?void 0:r.values)==null||s.forEach(i=>{var o,c;(c=(o=i.stacktrace)==null?void 0:o.frames)==null||c.forEach(a=>{a.filename&&(a.debug_id=n[a.filename])})})}function mf(e){var r,s;const t={};if((s=(r=e.exception)==null?void 0:r.values)==null||s.forEach(i=>{var o,c;(c=(o=i.stacktrace)==null?void 0:o.frames)==null||c.forEach(a=>{a.debug_id&&(a.abs_path?t[a.abs_path]=a.debug_id:a.filename&&(t[a.filename]=a.debug_id),delete a.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([i,o])=>{n.push({type:"sourcemap",code_file:i,debug_id:o})})}function gf(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function _f(e,t,n){var s,i;if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>({...o,...o.data&&{data:Le(o.data,t,n)}}))},...e.user&&{user:Le(e.user,t,n)},...e.contexts&&{contexts:Le(e.contexts,t,n)},...e.extra&&{extra:Le(e.extra,t,n)}};return(s=e.contexts)!=null&&s.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Le(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(o=>({...o,...o.data&&{data:Le(o.data,t,n)}}))),(i=e.contexts)!=null&&i.flags&&r.contexts&&(r.contexts.flags=Le(e.contexts.flags,3,n)),r}function Sf(e,t){if(!t)return e;const n=e?e.clone():new We;return n.update(t),n}function yf(e){if(e)return Ef(e)?{captureContext:e}:vf(e)?{captureContext:e}:e}function Ef(e){return e instanceof We||typeof e=="function"}const bf=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function vf(e){return Object.keys(e).some(t=>bf.includes(t))}function mc(e,t){return G().captureException(e,yf(t))}function YE(e,t){const n=typeof t=="string"?t:void 0,r=typeof t!="string"?{captureContext:t}:void 0;return G().captureMessage(e,n,r)}function gc(e,t){return G().captureEvent(e,t)}function _c(e,t){ve().setContext(e,t)}function KE(e,t){ve().setTag(e,t)}function XE(e){ve().setUser(e)}function Tf(){const e=D();return(e==null?void 0:e.getOptions().enabled)!==!1&&!!(e!=null&&e.getTransport())}function If(e){ve().addEventProcessor(e)}function mo(e){const t=ve(),{user:n}=fc(t,G()),{userAgent:r}=$.navigator||{},s=Cd({user:n,...r&&{userAgent:r},...e}),i=t.getSession();return(i==null?void 0:i.status)==="ok"&&jt(i,{status:"exited"}),Sc(),t.setSession(s),s}function Sc(){const e=ve(),n=G().getSession()||e.getSession();n&&Md(n),yc(),e.setSession()}function yc(){const e=ve(),t=D(),n=e.getSession();n&&t&&t.captureSession(n)}function os(e=!1){if(e){Sc();return}yc()}const wf="7";function kf(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function Rf(e){return`${kf(e)}${e.projectId}/envelope/`}function Cf(e,t){const n={sentry_version:wf};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Mf(e,t,n){return t||`${Rf(e)}?${Cf(e,n)}`}const go=[];function xf(e){const t={};return e.forEach(n=>{const{name:r}=n,s=t[r];s&&!s.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function Af(e){const t=e.defaultIntegrations||[],n=e.integrations;t.forEach(s=>{s.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){const s=n(t);r=Array.isArray(s)?s:[s]}else r=t;return xf(r)}function Nf(e,t){const n={};return t.forEach(r=>{r!=null&&r.beforeSetup&&r.beforeSetup(e)}),t.forEach(r=>{r&&Ec(e,r,n)}),n}function _o(e,t){for(const n of t)n!=null&&n.afterAllSetup&&n.afterAllSetup(e)}function Ec(e,t,n){if(n[t.name]){v&&S.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!go.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),go.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){const r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(s,i)=>r(s,i,e))}if(typeof t.processEvent=="function"){const r=t.processEvent.bind(t),s=Object.assign((i,o)=>r(i,o,e),{id:t.name});e.addEventProcessor(s)}["processSpan","processSegmentSpan"].forEach(r=>{const s=t[r];typeof s=="function"&&e.on(r,i=>s.call(t,i,e))}),v&&S.log(`Integration installed: ${t.name}`)}function Of(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Lf(){return"npm"}function Df(){return!Of()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function En(){return typeof window<"u"&&(!Df()||Pf())}function Pf(){const e=$.process;return(e==null?void 0:e.type)==="renderer"}function Ff(e,t){const n=t?"auto":"never";return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...En()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function Bf(e,t,n,r,s){const i={};return t!=null&&t.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=tn(r)),mt(i,[Ff(e,s)])}function xs(e,t){const n=t??$f(e)??[];if(n.length===0)return;const r=e.getOptions(),s=Bf(n,r._metadata,r.tunnel,e.getDsn(),r.sendDefaultPii);bc().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(s)}function $f(e){return bc().get(e)}function bc(){return Jt("clientToLogBufferMap",()=>new WeakMap)}function Uf(e,t){const n=t?"auto":"never";return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{version:2,...En()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function Hf(e,t,n,r,s){const i={};return t!=null&&t.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=tn(r)),mt(i,[Uf(e,s)])}function vc(e,t){const n=t??Wf(e)??[];if(n.length===0)return;const r=e.getOptions(),s=Hf(n,r._metadata,r.tunnel,e.getDsn(),r.sendDefaultPii);Tc().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(s)}function Wf(e){return Tc().get(e)}function Tc(){return Jt("clientToMetricBufferMap",()=>new WeakMap)}function Ic(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}const fi=Symbol.for("SentryBufferFullError");function pi(e=100){const t=new Set;function n(){return t.size<e}function r(o){t.delete(o)}function s(o){if(!n())return li(fi);const c=o();return t.add(c),c.then(()=>r(c),()=>r(c)),c}function i(o){if(!t.size)return Ln(!0);const c=Promise.allSettled(Array.from(t)).then(()=>!0);if(!o)return c;const a=[c,new Promise(u=>Ic(setTimeout(()=>u(!1),o)))];return Promise.race(a)}return{get $(){return Array.from(t)},add:s,drain:i}}const zf=60*1e3;function jf(e,t=xn()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${e}`);return isNaN(r)?zf:r-t}function qf(e,t){return e[t]||e.all||0}function wc(e,t,n=xn()){return qf(e,t)>n}function kc(e,{statusCode:t,headers:n},r=xn()){const s={...e},i=n==null?void 0:n["x-sentry-rate-limits"],o=n==null?void 0:n["retry-after"];if(i)for(const c of i.trim().split(",")){const[a,u,,,l]=c.split(":",5),d=parseInt(a,10),f=(isNaN(d)?60:d)*1e3;if(!u)s.all=r+f;else for(const p of u.split(";"))p==="metric_bucket"?(!l||l.split(";").includes("custom"))&&(s[p]=r+f):s[p]=r+f}else o?s.all=r+jf(o,r):t===429&&(s.all=r+60*1e3);return s}const Rc=64;function Gf(e,t,n=pi(e.bufferSize||Rc)){let r={};const s=o=>n.drain(o);function i(o){const c=[];if(Rs(o,(d,f)=>{const p=ro(f);wc(r,p)?e.recordDroppedEvent("ratelimit_backoff",p):c.push(d)}),c.length===0)return Promise.resolve({});const a=mt(o[0],c),u=d=>{if(Cl(a,["client_report"])){v&&S.warn(`Dropping client report. Will not send outcomes (reason: ${d}).`);return}Rs(a,(f,p)=>{e.recordDroppedEvent(d,ro(p))})},l=()=>t({body:Ml(a)}).then(d=>d.statusCode===413?(v&&S.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),u("send_error"),d):(v&&d.statusCode!==void 0&&(d.statusCode<200||d.statusCode>=300)&&S.warn(`Sentry responded with status code ${d.statusCode} to sent event.`),r=kc(r,d),d),d=>{throw u("network_error"),v&&S.error("Encountered error running transport request:",d),d});return n.add(l).then(d=>d,d=>{if(d===fi)return v&&S.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw d})}return{send:i,flush:s}}function Vf(e,t,n){const r=[{type:"client_report"},{timestamp:Mt(),discarded_events:e}];return mt(t?{dsn:t}:{},[r])}function Cc(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n!=null&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function Yf(e){var a;const{trace_id:t,parent_span_id:n,span_id:r,status:s,origin:i,data:o,op:c}=((a=e.contexts)==null?void 0:a.trace)??{};return{data:o??{},description:e.transaction,op:c,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:s,timestamp:e.timestamp,trace_id:t??"",origin:i,profile_id:o==null?void 0:o[ii],exclusive_time:o==null?void 0:o[pt],measurements:e.measurements,is_segment:!0}}function Kf(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[ii]:e.profile_id},...e.exclusive_time&&{[pt]:e.exclusive_time}}}},measurements:e.measurements}}const So="Not capturing exception because it's already been captured.",yo="Discarded session because of missing or non-string release",Mc=Symbol.for("SentryInternalError"),xc=Symbol.for("SentryDoNotSendEventError"),Xf=5e3;function ir(e){return{message:e,[Mc]:!0}}function as(e){return{message:e,[xc]:!0}}function Eo(e){return!!e&&typeof e=="object"&&Mc in e}function bo(e){return!!e&&typeof e=="object"&&xc in e}function vo(e,t,n,r,s){let i=0,o,c=!1;e.on(n,()=>{i=0,clearTimeout(o),c=!1}),e.on(t,a=>{i+=r(a),i>=8e5?s(e):c||(c=!0,o=Ic(setTimeout(()=>{s(e)},Xf)))}),e.on("flush",()=>{s(e)})}class Jf{constructor(t){var r,s,i;if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=pi(((r=t.transportOptions)==null?void 0:r.bufferSize)??Rc),t.dsn?this._dsn=il(t.dsn):v&&S.warn("No DSN provided, client will not send events."),this._dsn){const o=Mf(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:o})}this._options.enableLogs=this._options.enableLogs??((s=this._options._experiments)==null?void 0:s.enableLogs),this._options.enableLogs&&vo(this,"afterCaptureLog","flushLogs",tp,xs),(this._options.enableMetrics??((i=this._options._experiments)==null?void 0:i.enableMetrics)??!0)&&vo(this,"afterCaptureMetric","flushMetrics",ep,vc)}captureException(t,n,r){const s=we();if(Vi(t))return v&&S.log(So),s;const i={event_id:s,...n};return this._process(()=>this.eventFromException(t,i).then(o=>this._captureEvent(o,i,r)).then(o=>o),"error"),i.event_id}captureMessage(t,n,r,s){const i={event_id:we(),...r},o=Qs(t)?t:String(t),c=Wt(t),a=c?this.eventFromMessage(o,n,i):this.eventFromException(t,i);return this._process(()=>a.then(u=>this._captureEvent(u,i,s)),c?"unknown":"error"),i.event_id}captureEvent(t,n,r){const s=we();if(n!=null&&n.originalException&&Vi(n.originalException))return v&&S.log(So),s;const i={event_id:s,...n},o=t.sdkProcessingMetadata||{},c=o.capturedSpanScope,a=o.capturedSpanIsolationScope,u=To(t.type);return this._process(()=>this._captureEvent(t,i,c||r,a),u),i.event_id}captureSession(t){this.sendSession(t),jt(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){const n=this._transport;if(this.emit("flush"),!n)return!0;const r=await this._isClientDoneProcessing(t),s=await n.flush(t);return r&&s}async close(t){xs(this);const n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){const n=this._integrations[t.name];!n&&t.beforeSetup&&t.beforeSetup(this),Ec(this,t,this._integrations),n||_o(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=Pl(t,this._dsn,this._options._metadata,this._options.tunnel);for(const s of n.attachments||[])r=Rl(r,Nl(s));this.sendEnvelope(r).then(s=>this.emit("afterSendEvent",t,s))}sendSession(t){const{release:n,environment:r=oi}=this._options;if("aggregates"in t){const i=t.attrs||{};if(!i.release&&!n){v&&S.warn(yo);return}i.release=i.release||n,i.environment=i.environment||r,t.attrs=i}else{if(!t.release&&!n){v&&S.warn(yo);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);const s=Dl(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(s)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){const s=`${t}:${n}`;v&&S.log(`Recording outcome: "${s}"${r>1?` (${r} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+r}}on(t,n){const r=this._hooks[t]=this._hooks[t]||new Set,s=(...i)=>n(...i);return r.add(s),()=>{r.delete(s)}}emit(t,...n){const r=this._hooks[t];r&&r.forEach(s=>s(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return v&&S.error("Error while sending envelope:",n),{}}return v&&S.error("Transport disabled"),{}}registerCleanup(t){}dispose(){}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=Nf(this,t),_o(this,t)}_updateSessionFromEvent(t,n){var a,u;let r=n.level==="fatal",s=!1;const i=(a=n.exception)==null?void 0:a.values;if(i){s=!0,r=!1;for(const l of i)if(((u=l.mechanism)==null?void 0:u.handled)===!1){r=!0;break}}const o=t.status==="ok";(o&&t.errors===0||o&&r)&&(jt(t,{...r&&{status:"crashed"},errors:t.errors||Number(s||r)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||n<t;){if(await new Promise(r=>setTimeout(r,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r,s){const i=this.getOptions(),o=Object.keys(this._integrations);return!n.integrations&&(o!=null&&o.length)&&(n.integrations=o),this.emit("preprocessEvent",t,n),t.type||s.setLastEventId(t.event_id||n.event_id),hc(i,t,n,r,this,s).then(c=>{var u;if(c===null)return c;this.emit("postprocessEvent",c,n),c.contexts={trace:{...(u=c.contexts)==null?void 0:u.trace,...Hd(r)},...c.contexts};const a=sc(this,r);return c.sdkProcessingMetadata={dynamicSamplingContext:a,...c.sdkProcessingMetadata},c})}_captureEvent(t,n={},r=G(),s=ve()){return v&&As(t)&&S.log(`Captured error event \`${Cc(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,s).then(i=>i.event_id,i=>{v&&(bo(i)?S.log(i.message):Eo(i)?S.warn(i.message):S.warn(i))})}_processEvent(t,n,r,s){const i=this.getOptions(),{sampleRate:o}=i,c=Ac(t),a=As(t),l=`before send for type \`${t.type||"error"}\``,d=typeof o>"u"?void 0:Rt(o);if(a&&typeof d=="number"&&st()>d)return this.recordDroppedEvent("sample_rate","error"),li(as(`Discarding event because it's not included in the random sample (sampling rate = ${o})`));const f=To(t.type);return this._prepareEvent(t,n,r,s).then(p=>{var g;if(p===null)throw this.recordDroppedEvent("event_processor",f),as("An event processor returned `null`, will not send event.");if(((g=n.data)==null?void 0:g.__sentry__)===!0)return p;const m=Qf(this,i,p,n);return Zf(m,l)}).then(p=>{var g;if(p===null){if(this.recordDroppedEvent("before_send",f),c){const T=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",T)}throw as(`${l} returned \`null\`, will not send event.`)}const h=r.getSession()||s.getSession();if(a&&h&&this._updateSessionFromEvent(h,p),c){const y=((g=p.sdkProcessingMetadata)==null?void 0:g.spanCountBeforeProcessing)||0,T=p.spans?p.spans.length:0,O=y-T;O>0&&this.recordDroppedEvent("before_send","span",O)}const m=p.transaction_info;if(c&&m&&p.transaction!==t.transaction){const y="custom";p.transaction_info={...m,source:y}}return this.sendEvent(p,n),p}).then(null,p=>{throw bo(p)||Eo(p)?p:(this.captureException(p,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:p}),ir(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
Reason: ${p}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===fi&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{const[s,i]=n.split(":");return{reason:s,category:i,quantity:r}})}_flushOutcomes(){v&&S.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){v&&S.log("No outcomes to send");return}if(!this._dsn){v&&S.log("No dsn provided, will not send outcomes");return}v&&S.log("Sending outcomes:",t);const n=Vf(t,this._options.tunnel&&tn(this._dsn));this.sendEnvelope(n)}}function To(e){return e==="replay_event"?"replay":e||"error"}function Zf(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Cn(e))return e.then(r=>{if(!mn(r)&&r!==null)throw ir(n);return r},r=>{throw ir(`${t} rejected with ${r}`)});if(!mn(e)&&e!==null)throw ir(n);return e}function Qf(e,t,n,r){const{beforeSend:s,beforeSendTransaction:i,ignoreSpans:o}=t,c=!ic(t.beforeSendSpan)&&t.beforeSendSpan;let a=n;if(As(a)&&s)return s(a,r);if(Ac(a)){if(c||o){const u=Yf(a);if(o!=null&&o.length&&Sn({description:u.description,op:u.op,attributes:u.data},o))return null;if(c){const l=c(u);l?a=An(n,Kf(l)):ws()}if(a.spans){const l=[],d=a.spans;for(const p of d){if(o!=null&&o.length&&Sn({description:p.description,op:p.op,attributes:p.data},o)){gl(d,p);continue}if(c){const h=c(p);h?l.push(h):(ws(),l.push(p))}else l.push(p)}const f=a.spans.length-l.length;f&&e.recordDroppedEvent("before_send","span",f),a.spans=l}}if(i){if(a.spans){const u=a.spans.length;a.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:u}}return i(a,r)}}return a}function As(e){return e.type===void 0}function Ac(e){return e.type==="transaction"}function ep(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+Nc(e.attributes)}function tp(e){let t=0;return e.message&&(t+=e.message.length*2),t+Nc(e.attributes)}function Nc(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*Io(n[0]):Wt(n)?t+=Io(n):t+=100}),t}function Io(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function np(e){return Ar(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function wo(e){return np(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function rp(e,t){t.debug===!0&&(v?S.enable():dt(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),G().update(t.initialScope);const r=new e(t);return sp(r),r.init(),r}function sp(e){G().setClient(e)}function ip(e,t){const n=t==null?void 0:t.getDsn(),r=t==null?void 0:t.getOptions().tunnel;return ap(e,n)||op(e,r)}function op(e,t){return t?ko(e)===ko(t):!1}function ap(e,t){const n=di(e);return!n||ui(n)||!t?!1:cp(n.hostname,t.host)&&/(^|&|\?)sentry_key=/.test(n.search)}function cp(e,t){return e===t||t.length>0&&e.endsWith(`.${t}`)}function ko(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function up(e){var t;"aggregates"in e?((t=e.attrs)==null?void 0:t.ip_address)===void 0&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function Oc(e,t,n=[t],r="npm"){const s=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};s.name||(s.name=`sentry.javascript.${t}`,s.packages=n.map(i=>({name:`${r}:@sentry/${i}`,version:Tt})),s.version=Tt)}function Lc(e={}){const t=e.client||D();if(!Tf()||!t)return{};const n=Ct(),r=en(n);if(r.getTraceData)return r.getTraceData(e);const s=e.scope||G(),i=e.span||he(),o=i?ll(i):dp(s),c=i?ze(i):sc(t,s),a=Kd(c);if(!za.test(o))return S.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const l={"sentry-trace":o,baggage:a};return e.propagateTraceparent&&(l.traceparent=i?fl(i):lp(s)),l}function dp(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return ja(t,r,n)}function lp(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return qa(t,r,n)}function fp(e,t,n){let r,s,i;const o=n!=null&&n.maxWait?Math.max(n.maxWait,t):0,c=(n==null?void 0:n.setTimeoutImpl)||setTimeout;function a(){return u(),r=e(),r}function u(){s!==void 0&&clearTimeout(s),i!==void 0&&clearTimeout(i),s=i=void 0}function l(){return s!==void 0||i!==void 0?a():r}function d(){return s&&clearTimeout(s),s=c(a,t),o&&i===void 0&&(i=c(a,o)),r}return d.cancel=u,d.flush=l,d}const pp=100;function ct(e,t){const n=D(),r=ve();if(!n)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:i=pp}=n.getOptions();if(i<=0)return;const c={timestamp:Mt(),...e},a=s?dt(()=>s(c,t)):c;a!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",a,t),r.addBreadcrumb(a,i))}let Ro;const hp="FunctionToString",Co=new WeakMap,mp=()=>({name:hp,setupOnce(){Ro=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=ni(this),n=Co.has(D())&&t!==void 0?t:this;return Ro.apply(n,e)}}catch{}},setup(e){Co.set(e,!0)}}),gp=mp,_p=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],Sp="EventFilters",yp=(e={})=>{let t;return{name:Sp,setup(n){const r=n.getOptions();t=Mo(e,r)},processEvent(n,r,s){if(!t){const i=s.getOptions();t=Mo(e,i)}return bp(n,t)?null:n}}},Ep=(e={})=>({...yp(e),name:"InboundFilters"});function Mo(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:_p],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function bp(e,t){if(e.type){if(e.type==="transaction"&&Tp(e,t.ignoreTransactions))return v&&S.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
Event: ${Et(e)}`),!0}else{if(vp(e,t.ignoreErrors))return v&&S.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
Event: ${Et(e)}`),!0;if(Rp(e))return v&&S.warn(`Event dropped due to not having an error message, error type or stacktrace.
Event: ${Et(e)}`),!0;if(Ip(e,t.denyUrls))return v&&S.warn(`Event dropped due to being matched by \`denyUrls\` option.
Event: ${Et(e)}.
Url: ${hr(e)}`),!0;if(!wp(e,t.allowUrls))return v&&S.warn(`Event dropped due to not being matched by \`allowUrls\` option.
Event: ${Et(e)}.
Url: ${hr(e)}`),!0}return!1}function vp(e,t){return t!=null&&t.length?Cc(e).some(n=>Ve(n,t)):!1}function Tp(e,t){if(!(t!=null&&t.length))return!1;const n=e.transaction;return n?Ve(n,t):!1}function Ip(e,t){if(!(t!=null&&t.length))return!1;const n=hr(e);return n?Ve(n,t):!1}function wp(e,t){if(!(t!=null&&t.length))return!0;const n=hr(e);return n?Ve(n,t):!0}function kp(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function hr(e){var t,n;try{const r=[...((t=e.exception)==null?void 0:t.values)??[]].reverse().find(i=>{var o,c,a;return((o=i.mechanism)==null?void 0:o.parent_id)===void 0&&((a=(c=i.stacktrace)==null?void 0:c.frames)==null?void 0:a.length)}),s=(n=r==null?void 0:r.stacktrace)==null?void 0:n.frames;return s?kp(s):null}catch{return v&&S.error(`Cannot extract url for event ${Et(e)}`),null}}function Rp(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)!=null&&n.length?!e.message&&!e.exception.values.some(r=>r.stacktrace||r.type&&r.type!=="Error"||r.value):!1}function Cp(e,t,n,r,s,i){var c;if(!((c=s.exception)!=null&&c.values)||!i||!Je(i.originalException,Error))return;const o=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;o&&(s.exception.values=Ns(e,t,r,i.originalException,n,s.exception.values,o,0))}function Ns(e,t,n,r,s,i,o,c){if(i.length>=n+1)return i;let a=[...i];if(Je(r[s],Error)){xo(o,c,r);const u=e(t,r[s]),l=a.length;Ao(u,s,l,c),a=Ns(e,t,n,r[s],s,[u,...a],u,l)}return Dc(r)&&r.errors.forEach((u,l)=>{if(Je(u,Error)){xo(o,c,r);const d=e(t,u),f=a.length;Ao(d,`errors[${l}]`,f,c),a=Ns(e,t,n,u,s,[d,...a],d,f)}}),a}function Dc(e){return Array.isArray(e.errors)}function xo(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...Dc(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Ao(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function Mp(e){const t="console",n=lt(t,e);return ft(t,xp),n}function xp(){"console"in $&&id.forEach(function(e){e in $.console&&Ee($.console,e,function(t){return dr[e]=t,function(...n){xe("console",{args:n,level:e});const r=dr[e];r==null||r.apply($.console,n)}})})}function Pc(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const Ap="Dedupe",Np=()=>{let e;return{name:Ap,processEvent(t){if(t.type)return t;try{if(Lp(t,e))return v&&S.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}},Op=Np;function Lp(e,t){return t?!!(Dp(e,t)||Pp(e,t)):!1}function Dp(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Bc(e,t)||!Fc(e,t))}function Pp(e,t){const n=No(t),r=No(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Bc(e,t)||!Fc(e,t))}function Fc(e,t){let n=Hi(e),r=Hi(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let s=0;s<r.length;s++){const i=r[s],o=n[s];if(i.filename!==o.filename||i.lineno!==o.lineno||i.colno!==o.colno||i.function!==o.function)return!1}return!0}function Bc(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function No(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)==null?void 0:n[0]}const Fp="ConversationId",Bp=()=>({name:Fp,setup(e){e.on("spanStart",t=>{const n=G().getScopeData(),r=ve().getScopeData(),s=n.conversationId||r.conversationId;if(s){const{op:i,data:o,description:c}=q(t);if(!(i!=null&&i.startsWith("gen_ai."))&&!o["ai.operationId"]&&!(c!=null&&c.startsWith("ai.")))return;t.setAttribute(zd,s)}})}}),$p=Bp;function $c(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}function Up(e,t,n,r,s){if(!e.fetchData)return;const{method:i,url:o}=e.fetchData,c=De()&&t(o);if(e.endTimestamp){const h=e.fetchData.__span;if(!h)return;const m=r[h];m&&(c&&(zp(m,e),Hp(m,e,s)),delete r[h]);return}const{spanOrigin:a="auto.http.browser",propagateTraceparent:u=!1}=typeof s=="object"?s:{spanOrigin:s},l=D(),f=!!he()||!!l&&Qe(l),p=c&&f?xt(Gp(o,i,a)):new He;if(c&&!f&&(l==null||l.recordDroppedEvent("no_parent_span","span")),e.fetchData.__span=p.spanContext().spanId,r[p.spanContext().spanId]=p,n(e.fetchData.url)){const h=e.args[0],m={...e.args[1]||{}},g=Wp(h,m,De()&&f?p:void 0,u);g&&(e.args[1]=m,m.headers=g)}if(l){const h={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};l.emit("beforeOutgoingRequestSpan",p,h)}return p}function Hp(e,t,n){var s;const r=typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0;r==null||r(e,{headers:(s=t.response)==null?void 0:s.headers,error:t.error})}function Wp(e,t,n,r){const s=Lc({span:n,propagateTraceparent:r}),i=s["sentry-trace"],o=s.baggage,c=s.traceparent;if(!i)return;const a=t.headers||(ei(e)?e.headers:void 0);if(a)if(jp(a)){const u=new Headers(a);if(u.get("sentry-trace")||u.set("sentry-trace",i),r&&c&&!u.get("traceparent")&&u.set("traceparent",c),o){const l=u.get("baggage");l?Vn(l)||u.set("baggage",`${l},${o}`):u.set("baggage",o)}return u}else if(qp(a)){const u=[...a];u.find(d=>d[0]==="sentry-trace")||u.push(["sentry-trace",i]),r&&c&&!u.find(d=>d[0]==="traceparent")&&u.push(["traceparent",c]);const l=a.find(d=>d[0]==="baggage"&&typeof d[1]=="string"&&Vn(d[1]));return o&&!l&&u.push(["baggage",o]),u}else{const u="sentry-trace"in a?a["sentry-trace"]:void 0,l="traceparent"in a?a.traceparent:void 0,d="baggage"in a?a.baggage:void 0,f=d?Array.isArray(d)?[...d]:[d]:[],p=d&&(Array.isArray(d)?d.find(m=>Vn(m)):Vn(d));o&&!p&&f.push(o);const h=Object.assign({},a,{"sentry-trace":u??i,baggage:f.length>0?f.join(","):void 0});return r&&c&&!l&&(h.traceparent=c),h}else return{...s}}function zp(e,t){var n,r;if(t.response){Ba(e,t.response.status);const s=(r=(n=t.response)==null?void 0:n.headers)==null?void 0:r.get("content-length");if(s){const i=parseInt(s);i>0&&e.setAttribute("http.response_content_length",i)}}else t.error&&e.setStatus({code:de,message:"internal_error"});e.end()}function Vn(e){return typeof e!="string"?!1:e.split(",").some(t=>t.trim().startsWith(pr))}function jp(e){return typeof Headers<"u"&&Je(e,Headers)}function qp(e){return Array.isArray(e)?e.every(t=>Array.isArray(t)&&t.length===2&&typeof t[0]=="string"):!1}function Gp(e,t,n){if(e.startsWith("data:")){const i=it(e);return{name:`${t} ${i}`,attributes:Oo(e,void 0,t,n)}}const r=di(e),s=r?uf(r):e;return{name:`${t} ${s}`,attributes:Oo(e,r,t,n)}}function Oo(e,t,n,r){const s={url:it(e),type:"fetch","http.method":n,[ue]:r,[Fe]:"http.client"};return t&&(ui(t)||(s["http.url"]=it(t.href),s["server.address"]=t.host),t.search&&(s["http.query"]=t.search),t.hash&&(s["http.fragment"]=t.hash)),s}const bn=$;function Vp(){return"history"in bn&&!!bn.history}function Yp(){if(!("fetch"in bn))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function Os(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Kp(){var n;if(typeof EdgeRuntime=="string")return!0;if(!Yp())return!1;if(Os(bn.fetch))return!0;let e=!1;const t=bn.document;if(t&&typeof t.createElement=="function")try{const r=t.createElement("iframe");r.hidden=!0,t.head.appendChild(r),(n=r.contentWindow)!=null&&n.fetch&&(e=Os(r.contentWindow.fetch)),t.head.removeChild(r)}catch(r){v&&S.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return e}function Uc(e,t){const n="fetch",r=lt(n,e);return ft(n,()=>Hc(void 0,t)),r}function Xp(e){const t="fetch-body-resolved",n=lt(t,e);return ft(t,()=>Hc(Zp)),n}function Hc(e,t=!1){t&&!Kp()||Ee($,"fetch",function(n){return function(...r){const s=new Error,{method:i,url:o}=Qp(r),c={args:r,fetchData:{method:i,url:o},startTimestamp:ae()*1e3,virtualError:s,headers:eh(r)};return e||xe("fetch",{...c}),n.apply($,r).then(async a=>(e?e(a):xe("fetch",{...c,endTimestamp:ae()*1e3,response:a}),a),a=>{xe("fetch",{...c,endTimestamp:ae()*1e3,error:a}),Ar(a)&&a.stack===void 0&&(a.stack=s.stack,be(a,"framesToPop",1));const u=D(),l=(u==null?void 0:u.getOptions().enhanceFetchErrorMessages)??"always";if(l!==!1&&a instanceof TypeError&&(a.message==="Failed to fetch"||a.message==="Load failed"||a.message==="NetworkError when attempting to fetch resource."))try{const p=new URL(c.fetchData.url).host;l==="always"?a.message=`${a.message} (${p})`:be(a,"__sentry_fetch_url_host__",p)}catch{}throw a})}})}async function Jp(e,t){if(e!=null&&e.body){const n=e.body,r=n.getReader(),s=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3);let i=!0;for(;i;){let o;try{o=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);const{done:c}=await r.read();clearTimeout(o),c&&(t(),i=!1)}catch{i=!1}finally{clearTimeout(o)}}clearTimeout(s),r.releaseLock(),n.cancel().then(null,()=>{})}}function Zp(e){let t;try{t=e.clone()}catch{return}Jp(t,()=>{xe("fetch-body-resolved",{endTimestamp:ae()*1e3,response:e})})}function or(e,t){return!!e&&typeof e=="object"&&!!e[t]}function Lo(e){return typeof e=="string"?e:e?or(e,"url")?e.url:e.toString?e.toString():"":""}function Qp(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,r]=e;return{url:Lo(n),method:or(r,"method")?String(r.method).toUpperCase():ei(n)&&or(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:Lo(t),method:or(t,"method")?String(t.method).toUpperCase():"GET"}}function eh(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(ei(t))return new Headers(t.headers)}catch{}}const P=$;let Ls=0;function Wc(){return Ls>0}function th(){Ls++,setTimeout(()=>{Ls--})}function Gt(e,t={}){function n(s){return typeof s=="function"}if(!n(e))return e;try{const s=e.__sentry_wrapped__;if(s)return typeof s=="function"?s:e;if(ni(e))return e}catch{return e}const r=function(...s){try{const i=s.map(o=>Gt(o,t));return e.apply(this,i)}catch(i){throw th(),ri(o=>{o.addEventProcessor(c=>(t.mechanism&&(bs(c,void 0),zt(c,t.mechanism)),c.extra={...c.extra,arguments:s},c)),mc(i)}),i}};try{for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}catch{}Aa(r,e),be(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function mr(){const e=Qt(),{referrer:t}=P.document||{},{userAgent:n}=P.navigator||{},r={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:r}}function hi(e,t){const n=mi(e,t),r={type:oh(t),value:ah(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function nh(e,t,n,r){const s=D(),i=s==null?void 0:s.getOptions().normalizeDepth,o=fh(t),c={__serialized__:oc(t,i)};if(o)return{exception:{values:[hi(e,o)]},extra:c};const a={exception:{values:[{type:Nr(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:dh(t,{isUnhandledRejection:r})}]},extra:c};if(n){const u=mi(e,n);u.length&&(a.exception.values[0].stacktrace={frames:u})}return a}function cs(e,t){return{exception:{values:[hi(e,t)]}}}function mi(e,t){const n=t.stacktrace||t.stack||"",r=sh(t),s=ih(t);try{return e(n,r,s)}catch{}return[]}const rh=/Minified React error #\d+;/i;function sh(e){return e&&rh.test(e.message)?1:0}function ih(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function zc(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function oh(e){const t=e==null?void 0:e.name;return!t&&zc(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function ah(e){const t=e==null?void 0:e.message;return zc(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?wo(t.error):wo(e):"No error message"}function ch(e,t,n,r){const s=(n==null?void 0:n.syntheticException)||void 0,i=gi(e,t,s,r);return zt(i),i.level="error",n!=null&&n.event_id&&(i.event_id=n.event_id),Ln(i)}function uh(e,t,n="info",r,s){const i=(r==null?void 0:r.syntheticException)||void 0,o=Ds(e,t,i,s);return o.level=n,r!=null&&r.event_id&&(o.event_id=r.event_id),Ln(o)}function gi(e,t,n,r,s){let i;if(Ca(t)&&t.error)return cs(e,t.error);if(zi(t)||gd(t)){const o=t;if("stack"in t)i=cs(e,t);else{const c=o.name||(zi(o)?"DOMError":"DOMException"),a=o.message?`${c}: ${o.message}`:c;i=Ds(e,a,n,r),bs(i,a)}return"code"in o&&(i.tags={...i.tags,"DOMException.code":`${o.code}`}),i}return Ar(t)?cs(e,t):mn(t)||Nr(t)?(i=nh(e,t,n,s),zt(i,{synthetic:!0}),i):(i=Ds(e,t,n,r),bs(i,`${t}`),zt(i,{synthetic:!0}),i)}function Ds(e,t,n,r){const s={};if(r&&n){const i=mi(e,n);i.length&&(s.exception={values:[{value:t,stacktrace:{frames:i}}]}),zt(s,{synthetic:!0})}if(Qs(t)){const{__sentry_template_string__:i,__sentry_template_values__:o}=t;return s.logentry={message:i,params:o},s}return s.message=t,s}function dh(e,{isUnhandledRejection:t}){const n=vd(e),r=t?"promise rejection":"exception";return Ca(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:Nr(e)?`Event \`${lh(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function lh(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function fh(e){return Object.values(e).find(t=>t instanceof Error)}class ph extends Jf{constructor(t){var l;const n=hh(t),r=P.SENTRY_SDK_SOURCE||Lf();Oc(n,"browser",["browser"],r),(l=n._metadata)!=null&&l.sdk&&(n._metadata.sdk.settings={infer_ip:n.sendDefaultPii?"auto":"never",...n._metadata.sdk.settings}),super(n);const{sendDefaultPii:s,sendClientReports:i,enableLogs:o,_experiments:c,enableMetrics:a}=this._options,u=a??(c==null?void 0:c.enableMetrics)??!0;P.document&&(i||o||u)&&P.document.addEventListener("visibilitychange",()=>{P.document.visibilityState==="hidden"&&(i&&this._flushOutcomes(),o&&xs(this),u&&vc(this))}),s&&this.on("beforeSendSession",up)}eventFromException(t,n){return ch(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return uh(this._options.stackParser,t,n,r,this._options.attachStacktrace)}_prepareEvent(t,n,r,s){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r,s)}}function hh(e){var t;return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:(t=P.SENTRY_RELEASE)==null?void 0:t.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const Be=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,C=$,mh=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",Dn=(e,t,n,r)=>{let s,i;return o=>{t.value>=0&&(o||r)&&(i=t.value-(s??0),(i||s===void 0)&&(s=t.value,t.delta=i,t.rating=mh(t.value,n),e(t)))}},Pn=(e=!0)=>{var n,r;const t=(r=(n=C.performance)==null?void 0:n.getEntriesByType)==null?void 0:r.call(n,"navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},nn=()=>{const e=Pn();return(e==null?void 0:e.activationStart)??0};function ot(e,t,n){C.document&&C.addEventListener(e,t,n)}function gr(e,t,n){C.document&&C.removeEventListener(e,t,n)}let Ht=-1;const jc=new Set,gh=()=>{var e,t;return((e=C.document)==null?void 0:e.visibilityState)==="hidden"&&!((t=C.document)!=null&&t.prerendering)?0:1/0},ar=e=>{if(_h(e)&&Ht>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of jc)t();isFinite(Ht)||(Ht=e.type==="visibilitychange"?e.timeStamp:0,gr("prerenderingchange",ar,!0))}},Fn=()=>{var e;if(C.document&&Ht<0){const t=nn();Ht=(C.document.prerendering||(e=globalThis.performance.getEntriesByType("visibility-state").filter(r=>r.name==="hidden"&&r.startTime>t)[0])==null?void 0:e.startTime)??gh(),ot("visibilitychange",ar,!0),ot("pagehide",ar,!0),ot("prerenderingchange",ar,!0)}return{get firstHiddenTime(){return Ht},onHidden(t){jc.add(t)}}};function _h(e){var t;return e.type==="pagehide"||((t=C.document)==null?void 0:t.visibilityState)==="hidden"}const Sh=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,Bn=(e,t=-1)=>{var i,o;const n=Pn();let r="navigate";return n&&((i=C.document)!=null&&i.prerendering||nn()>0?r="prerender":(o=C.document)!=null&&o.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:Sh(),navigationType:r}},us=new WeakMap;function _i(e,t){try{return us.get(e)||us.set(e,new t),us.get(e)}catch{return new t}}class _r{constructor(){_r.prototype.__init.call(this),_r.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(t){var s;if(t.hadRecentInput)return;const n=this._sessionEntries[0],r=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&n&&r&&t.startTime-r.startTime<1e3&&t.startTime-n.startTime<5e3?(this._sessionValue+=t.value,this._sessionEntries.push(t)):(this._sessionValue=t.value,this._sessionEntries=[t]),(s=this._onAfterProcessingUnexpectedShift)==null||s.call(this,t)}}const rn=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver(s=>{Promise.resolve().then(()=>{t(s.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},Si=e=>{let t=!1;return()=>{t||(e(),t=!0)}},Pr=e=>{var t;(t=C.document)!=null&&t.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},yh=[1800,3e3],Eh=(e,t={})=>{Pr(()=>{const n=Fn(),r=Bn("FCP");let s;const o=rn("paint",c=>{for(const a of c)a.name==="first-contentful-paint"&&(o.disconnect(),a.startTime<n.firstHiddenTime&&(r.value=Math.max(a.startTime-nn(),0),r.entries.push(a),s(!0)))});o&&(s=Dn(e,r,yh,t.reportAllChanges))})},bh=[.1,.25],vh=(e,t={})=>{Eh(Si(()=>{var a;const n=Bn("CLS",0);let r;const s=Fn(),i=_i(t,_r),o=u=>{for(const l of u)i._processEntry(l);i._sessionValue>n.value&&(n.value=i._sessionValue,n.entries=i._sessionEntries,r())},c=rn("layout-shift",o);c&&(r=Dn(e,n,bh,t.reportAllChanges),s.onHidden(()=>{o(c.takeRecords()),r(!0)}),(a=C==null?void 0:C.setTimeout)==null||a.call(C,r))}))};let qc=0,ds=1/0,Yn=0;const Th=e=>{e.forEach(t=>{t.interactionId&&(ds=Math.min(ds,t.interactionId),Yn=Math.max(Yn,t.interactionId),qc=Yn?(Yn-ds)/7+1:0)})};let Ps;const Gc=()=>Ps?qc:performance.interactionCount||0,Ih=()=>{"interactionCount"in performance||Ps||(Ps=rn("event",Th,{type:"event",buffered:!0,durationThreshold:0}))},ls=10;let Vc=0;const wh=()=>Gc()-Vc;class Sr{constructor(){Sr.prototype.__init.call(this),Sr.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){Vc=Gc(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor(wh()/50));return this._longestInteractionList[t]}_processEntry(t){var s,i;if((s=this._onBeforeProcessingEntry)==null||s.call(this,t),!(t.interactionId||t.entryType==="first-input"))return;const n=this._longestInteractionList.at(-1);let r=this._longestInteractionMap.get(t.interactionId);if(r||this._longestInteractionList.length<ls||t.duration>n._latency){if(r?t.duration>r._latency?(r.entries=[t],r._latency=t.duration):t.duration===r._latency&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(r={id:t.interactionId,entries:[t],_latency:t.duration},this._longestInteractionMap.set(r.id,r),this._longestInteractionList.push(r)),this._longestInteractionList.sort((o,c)=>c._latency-o._latency),this._longestInteractionList.length>ls){const o=this._longestInteractionList.splice(ls);for(const c of o)this._longestInteractionMap.delete(c.id)}(i=this._onAfterProcessingINPCandidate)==null||i.call(this,r)}}}const Yc=e=>{var n;const t=C.requestIdleCallback||C.setTimeout;((n=C.document)==null?void 0:n.visibilityState)==="hidden"?e():(e=Si(e),ot("visibilitychange",e,{once:!0,capture:!0}),ot("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),gr("visibilitychange",e,{capture:!0}),gr("pagehide",e,{capture:!0})}))},kh=[200,500],Rh=40,Ch=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=Fn();Pr(()=>{Ih();const r=Bn("INP");let s;const i=_i(t,Sr),o=a=>{Yc(()=>{for(const l of a)i._processEntry(l);const u=i._estimateP98LongestInteraction();u&&u._latency!==r.value&&(r.value=u._latency,r.entries=u.entries,s())})},c=rn("event",o,{durationThreshold:t.durationThreshold??Rh});s=Dn(e,r,kh,t.reportAllChanges),c&&(c.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{o(c.takeRecords()),s(!0)}))})};class Mh{_processEntry(t){var n;(n=this._onBeforeProcessingEntry)==null||n.call(this,t)}}const xh=[2500,4e3],Ah=(e,t={})=>{Pr(()=>{const n=Fn(),r=Bn("LCP");let s;const i=_i(t,Mh),o=a=>{t.reportAllChanges||(a=a.slice(-1));for(const u of a)i._processEntry(u),u.startTime<n.firstHiddenTime&&(r.value=Math.max(u.startTime-nn(),0),r.entries=[u],s())},c=rn("largest-contentful-paint",o);if(c){s=Dn(e,r,xh,t.reportAllChanges);const a=Si(()=>{o(c.takeRecords()),c.disconnect(),s(!0)}),u=l=>{l.isTrusted&&(Yc(a),gr(l.type,u,{capture:!0}))};for(const l of["keydown","click","visibilitychange"])ot(l,u,{capture:!0})}})},Nh=[800,1800],Fs=e=>{var t,n;(t=C.document)!=null&&t.prerendering?Pr(()=>Fs(e)):((n=C.document)==null?void 0:n.readyState)!=="complete"?addEventListener("load",()=>Fs(e),!0):setTimeout(e)},Oh=(e,t={})=>{const n=Bn("TTFB"),r=Dn(e,n,Nh,t.reportAllChanges);Fs(()=>{const s=Pn();s&&(n.value=Math.max(s.responseStart-nn(),0),n.entries=[s],r(!0))})},dn={},yr={};let Kc,Xc,Jc,Zc;function Fr(e,t=!1){return $r("cls",e,Dh,Kc,t)}function Br(e,t=!1){return $r("lcp",e,Ph,Xc,t)}function Lh(e){return $r("ttfb",e,Fh,Jc)}function yi(e){return $r("inp",e,Bh,Zc)}function Vt(e,t){return Qc(e,t),yr[e]||($h(e),yr[e]=!0),eu(e,t)}function $n(e,t){const n=dn[e];if(n!=null&&n.length)for(const r of n)try{r(t)}catch(s){Be&&S.error(`Error while triggering instrumentation handler.
Type: ${e}
Name: ${Xe(r)}
Error:`,s)}}function Dh(){return vh(e=>{$n("cls",{metric:e}),Kc=e},{reportAllChanges:!0})}function Ph(){return Ah(e=>{$n("lcp",{metric:e}),Xc=e},{reportAllChanges:!0})}function Fh(){return Oh(e=>{$n("ttfb",{metric:e}),Jc=e})}function Bh(){return Ch(e=>{$n("inp",{metric:e}),Zc=e})}function $r(e,t,n,r,s=!1){Qc(e,t);let i;return yr[e]||(i=n(),yr[e]=!0),r&&t({metric:r}),eu(e,t,s?i:void 0)}function $h(e){const t={};e==="event"&&(t.durationThreshold=0),rn(e,n=>{$n(e,{entries:n})},t)}function Qc(e,t){dn[e]=dn[e]||[],dn[e].push(t)}function eu(e,t,n){return()=>{n&&n();const r=dn[e];if(!r)return;const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}function Uh(e){return"duration"in e}const Hh=e=>{const t=n=>{var r;(n.type==="pagehide"||((r=C.document)==null?void 0:r.visibilityState)==="hidden")&&e(n)};ot("visibilitychange",t,{capture:!0,once:!0}),ot("pagehide",t,{capture:!0,once:!0})};function fs(e){return typeof e=="number"&&isFinite(e)}function ut(e,t,n,{...r}){const s=q(e).start_timestamp;return s&&s>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),uc(e,()=>{const i=xt({startTime:t,...r});return i&&i.end(n),i})}function Ei(e){var g;const t=D();if(!t)return;const{name:n,transaction:r,attributes:s,startTime:i}=e,{release:o,environment:c,sendDefaultPii:a}=t.getOptions(),u=t.getIntegrationByName("Replay"),l=u==null?void 0:u.getReplayId(),d=G(),f=d.getUser(),p=f!==void 0?f.email||f.id||f.ip_address:void 0;let h;try{h=d.getScopeData().contexts.profile.profile_id}catch{}const m={release:o,environment:c,user:p||void 0,profile_id:h||void 0,replay_id:l||void 0,transaction:r,"user_agent.original":(g=C.navigator)==null?void 0:g.userAgent,"client.address":a?"{{auto}}":void 0,...s};return xt({name:n,attributes:m,startTime:i,experimental:{standalone:!0}})}function Un(){return C.addEventListener&&C.performance}function re(e){return e/1e3}function Wh(e){let t="unknown",n="unknown",r="";for(const s of e){if(s==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(s))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=s}return r===e&&(t=r),{name:t,version:n}}function Ur(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function Hr(e,t){let n,r=!1;function s(c){!r&&n&&t(c,n.spanContext().spanId,n),r=!0}Hh(()=>{s("pagehide")});const i=e.on("beforeStartNavigationSpan",(c,a)=>{a!=null&&a.isRedirect||(s("navigation"),i(),o())}),o=e.on("afterStartPageLoadSpan",c=>{n=c,o()})}function zh(e){let t=0,n;if(!Ur("layout-shift"))return;const r=Fr(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(t=s.value,n=i)},!0);Hr(e,(s,i)=>{jh(t,n,i,s),r()})}function jh(e,t,n,r){var u;Be&&S.log(`Sending CLS span (${e})`);const s=t?re((fe()||0)+t.startTime):ae(),i=G().getScopeData().transactionName,o=t?ce((u=t.sources[0])==null?void 0:u.node):"Layout shift",c={[ue]:"auto.http.browser.cls",[Fe]:"ui.webvital.cls",[pt]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t!=null&&t.sources&&t.sources.forEach((l,d)=>{c[`cls.source.${d+1}`]=ce(l.node)});const a=Ei({name:o,transaction:i,attributes:c,startTime:s});a&&(a.addEvent("cls",{[Nn]:"",[On]:e}),a.end(s))}const qh=6e4;function Hn(e){return e!=null&&e>0&&e<=qh}function Gh(e){let t=0,n;if(!Ur("largest-contentful-paint"))return;const r=Br(({metric:s})=>{const i=s.entries[s.entries.length-1];!i||!Hn(s.value)||(t=s.value,n=i)},!0);Hr(e,(s,i)=>{Vh(t,n,i,s),r()})}function Vh(e,t,n,r){if(!Hn(e))return;Be&&S.log(`Sending LCP span (${e})`);const s=re((fe()||0)+((t==null?void 0:t.startTime)||0)),i=G().getScopeData().transactionName,o=t?ce(t.element):"Largest contentful paint",c={[ue]:"auto.http.browser.lcp",[Fe]:"ui.webvital.lcp",[pt]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(c["lcp.element"]=ce(t.element)),t.id&&(c["lcp.id"]=t.id),t.url&&(c["lcp.url"]=t.url),t.loadTime!=null&&(c["lcp.loadTime"]=t.loadTime),t.renderTime!=null&&(c["lcp.renderTime"]=t.renderTime),t.size!=null&&(c["lcp.size"]=t.size));const a=Ei({name:o,transaction:i,attributes:c,startTime:s});a&&(a.addEvent("lcp",{[Nn]:"millisecond",[On]:e}),a.end(s))}function Ce(e){return e&&((fe()||performance.timeOrigin)+e)/1e3}function tu(e){var n;const t={};if(e.nextHopProtocol!=null){const{name:r,version:s}=Wh(e.nextHopProtocol);t["network.protocol.version"]=s,t["network.protocol.name"]=r}return fe()||(n=Un())!=null&&n.timeOrigin?Yh({...t,"http.request.redirect_start":Ce(e.redirectStart),"http.request.redirect_end":Ce(e.redirectEnd),"http.request.worker_start":Ce(e.workerStart),"http.request.fetch_start":Ce(e.fetchStart),"http.request.domain_lookup_start":Ce(e.domainLookupStart),"http.request.domain_lookup_end":Ce(e.domainLookupEnd),"http.request.connect_start":Ce(e.connectStart),"http.request.secure_connection_start":Ce(e.secureConnectionStart),"http.request.connection_end":Ce(e.connectEnd),"http.request.request_start":Ce(e.requestStart),"http.request.response_start":Ce(e.responseStart),"http.request.response_end":Ce(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function Yh(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const Kh=2147483647;let Do=0,ge={},ye,Pt;function Xh({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const r=Un();if(r&&fe()){r.mark&&C.performance.mark("sentry-tracing-init");const s=t?Gh(n):t===!1?tm():void 0,i=e?zh(n):e===!1?em():void 0,o=nm();return()=>{o(),s==null||s(),i==null||i()}}return()=>{}}function Jh(){Vt("longtask",({entries:e})=>{const t=he();if(!t)return;const{op:n,start_timestamp:r}=q(t);for(const s of e){const i=re(fe()+s.startTime),o=re(s.duration);n==="navigation"&&r&&i<r||ut(t,i,i+o,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[ue]:"auto.ui.browser.metrics"}})}})}function Zh(){new PerformanceObserver(t=>{const n=he();if(n)for(const r of t.getEntries()){if(!r.scripts[0])continue;const s=re(fe()+r.startTime),{start_timestamp:i,op:o}=q(n);if(o==="navigation"&&i&&s<i)continue;const c=re(r.duration),a={[ue]:"auto.ui.browser.metrics"},u=r.scripts[0],{invoker:l,invokerType:d,sourceURL:f,sourceFunctionName:p,sourceCharPosition:h}=u;a["browser.script.invoker"]=l,a["browser.script.invoker_type"]=d,f&&(a["code.filepath"]=f),p&&(a["code.function"]=p),h!==-1&&(a["browser.script.source_char_position"]=h),ut(n,s,s+c,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:a})}}).observe({type:"long-animation-frame",buffered:!0})}function Qh(){Vt("event",({entries:e})=>{const t=he();if(t){for(const n of e)if(n.name==="click"){const r=re(fe()+n.startTime),s=re(n.duration),i={name:ce(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[ue]:"auto.ui.browser.metrics"}},o=xa(n.target);o&&(i.attributes["ui.component_name"]=o),ut(t,r,r+s,i)}}})}function em(){return Fr(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(ge.cls={value:e.value,unit:""},Pt=t)},!0)}function tm(){return Br(({metric:e})=>{const t=e.entries[e.entries.length-1];!t||!Hn(e.value)||(ge.lcp={value:e.value,unit:"millisecond"},ye=t)},!0)}function nm(){return Lh(({metric:e})=>{e.entries[e.entries.length-1]&&(ge.ttfb={value:e.value,unit:"millisecond"})})}function rm(e,t){const n=Un(),r=fe();if(!(n!=null&&n.getEntries)||!r)return;const{spanStreamingEnabled:s,ignorePerformanceApiSpans:i,ignoreResourceSpans:o,recordClsOnPageloadSpan:c,recordLcpOnPageloadSpan:a}=t,u=re(r),l=n.getEntries(),{op:d,start_timestamp:f}=q(e);if(l.slice(Do).forEach(p=>{const h=re(p.startTime),m=re(Math.max(0,p.duration));if(!(d==="navigation"&&f&&u+h<f))switch(p.entryType){case"navigation":{am(e,p,u);break}case"mark":case"paint":case"measure":{im(e,p,h,m,u,i);const g=Fn(),y=p.startTime<g.firstHiddenTime;p.name==="first-paint"&&y&&(ge.fp={value:p.startTime,unit:"millisecond"}),p.name==="first-contentful-paint"&&y&&(ge.fcp={value:p.startTime,unit:"millisecond"});break}case"resource":{dm(e,p,p.name,h,m,u,o);break}}}),Do=Math.max(l.length-1,0),lm(e,s),d==="pageload"){if(hm(ge),s){const p=(h,m,g)=>{const y=g??`browser.web_vital.${h}.value`;e.setAttribute(y,m),Be&&S.log("Setting web vital attribute",{[y]:m},"on pageload span")};["ttfb","fp","fcp"].forEach(h=>{ge[h]&&p(h,ge[h].value)}),ge["ttfb.requestTime"]&&p("ttfb.requestTime",ge["ttfb.requestTime"].value,"browser.web_vital.ttfb.request_time")}else c||delete ge.cls,a||delete ge.lcp,Object.entries(ge).forEach(([p,h])=>{Ul(p,h.value,h.unit)}),fm(e,t);e.setAttribute(s?"browser.performance.time_origin":"performance.timeOrigin",u),e.setAttribute(s?"browser.performance.navigation.activation_start":"performance.activationStart",nn())}ye=void 0,Pt=void 0,ge={}}function sm(e){if((e==null?void 0:e.entryType)==="measure")try{return e.detail.devtools.track==="Components вљ›"}catch{return}}function im(e,t,n,r,s,i){if(sm(t)||["mark","measure"].includes(t.entryType)&&Ve(t.name,i))return;const o=Pn(!1),c=re(o?o.requestStart:0),a=s+Math.max(n,c),u=s+n,l=u+r,d={[ue]:"auto.resource.browser.metrics"};a!==u&&(d["sentry.browser.measure_happened_before_request"]=!0,d["sentry.browser.measure_start_time"]=a),om(d,t),a<=l&&ut(e,a,l,{name:t.name,op:t.entryType,attributes:d})}function om(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[r,s]of Object.entries(n))if(s&&Wt(s))e[`sentry.browser.measure.detail.${r}`]=s;else if(s!==void 0)try{e[`sentry.browser.measure.detail.${r}`]=JSON.stringify(s)}catch{}return}if(Wt(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function am(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Kn(e,t,r,n)}),Kn(e,t,"secureConnection",n,"TLS/SSL"),Kn(e,t,"fetch",n,"cache"),Kn(e,t,"domainLookup",n,"DNS"),um(e,t,n)}function Kn(e,t,n,r,s=n){const i=cm(n),o=t[i],c=t[`${n}Start`];!c||!o||ut(e,r+re(c),r+re(o),{op:`browser.${s}`,name:t.name,attributes:{[ue]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function cm(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function um(e,t,n){const r=n+re(t.requestStart),s=n+re(t.responseEnd),i=n+re(t.responseStart);t.responseEnd&&(ut(e,r,s,{op:"browser.request",name:t.name,attributes:{[ue]:"auto.ui.browser.metrics"}}),ut(e,i,s,{op:"browser.response",name:t.name,attributes:{[ue]:"auto.ui.browser.metrics"}}))}function dm(e,t,n,r,s,i,o){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const c=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(o!=null&&o.includes(c))return;const a={[ue]:"auto.resource.browser.metrics"},u=wt(n);u.protocol&&(a["url.scheme"]=u.protocol.split(":").pop()),u.host&&(a["server.address"]=u.host),a["url.same_origin"]=n.includes(C.location.origin),pm(t,a,[["responseStatus","http.response.status_code"],["transferSize","http.response_transfer_size"],["encodedBodySize","http.response_content_length"],["decodedBodySize","http.decoded_response_content_length"],["renderBlockingStatus","resource.render_blocking_status"],["deliveryType","http.response_delivery_type"]]);const l={...a,...tu(t)},d=i+r,f=d+s;ut(e,d,f,{name:n.replace(C.location.origin,""),op:c,attributes:l})}function lm(e,t){const n=C.navigator;if(!n)return;const r=n.connection;r&&(r.effectiveType&&e.setAttribute(t?"network.connection.effective_type":"effectiveConnectionType",r.effectiveType),r.type&&e.setAttribute(t?"network.connection.type":"connectionType",r.type),fs(r.rtt)&&(ge["connection.rtt"]={value:r.rtt,unit:"millisecond"},t&&e.setAttribute("network.connection.rtt",r.rtt))),fs(n.deviceMemory)&&(t?e.setAttribute("device.memory.estimated_capacity",n.deviceMemory):e.setAttribute("deviceMemory",`${n.deviceMemory} GB`)),fs(n.hardwareConcurrency)&&(t?e.setAttribute("device.processor_count",n.hardwareConcurrency):e.setAttribute("hardwareConcurrency",String(n.hardwareConcurrency)))}function fm(e,t){ye&&t.recordLcpOnPageloadSpan&&(ye.element&&e.setAttribute("lcp.element",ce(ye.element)),ye.id&&e.setAttribute("lcp.id",ye.id),ye.url&&e.setAttribute("lcp.url",ye.url.trim().slice(0,200)),ye.loadTime!=null&&e.setAttribute("lcp.loadTime",ye.loadTime),ye.renderTime!=null&&e.setAttribute("lcp.renderTime",ye.renderTime),e.setAttribute("lcp.size",ye.size)),Pt!=null&&Pt.sources&&t.recordClsOnPageloadSpan&&Pt.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,ce(n.node)))}function pm(e,t,n){n.forEach(([r,s])=>{const i=e[r];i!=null&&(typeof i=="number"&&i<Kh||typeof i=="string")&&(t[s]=i)})}function hm(e){const t=Pn(!1);if(!t)return;const{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}const ps=[],ln=new Map,Nt=new Map,nu=60;function mm(){if(Un()&&fe()){const t=gm();return()=>{t()}}return()=>{}}const vn={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function gm(){return yi(_m)}const _m=({metric:e})=>{if(e.value==null)return;const t=re(e.value);if(t>nu)return;const n=e.entries.find(h=>h.duration===e.value&&vn[h.name]);if(!n)return;const{interactionId:r}=n,s=vn[n.name],i=re(fe()+n.startTime),o=he(),c=o?le(o):void 0,a=r!=null?ln.get(r):void 0,u=(a==null?void 0:a.span)||c,l=u?q(u).description:G().getScopeData().transactionName,d=(a==null?void 0:a.elementName)||ce(n.target),f={[ue]:"auto.http.browser.inp",[Fe]:`ui.interaction.${s}`,[pt]:n.duration},p=Ei({name:d,transaction:l,attributes:f,startTime:i});p&&(p.addEvent("inp",{[Nn]:"millisecond",[On]:e.value}),p.end(i+t))};function Sm(e){return e!=null?ln.get(e):void 0}function ym(){const e=Object.keys(vn);En()&&e.forEach(s=>{C.addEventListener(s,t,{capture:!0,passive:!0})});function t(s){const i=s.target;if(!i)return;const o=ce(i),c=Math.round(s.timeStamp);if(Nt.set(c,o),Nt.size>50){const a=Nt.keys().next().value;a!==void 0&&Nt.delete(a)}}function n(s){const i=Math.round(s.startTime);let o=Nt.get(i);if(!o)for(let c=-5;c<=5;c++){const a=Nt.get(i+c);if(a){o=a;break}}return o||"<unknown>"}const r=({entries:s})=>{const i=he(),o=i&&le(i);s.forEach(c=>{if(!Uh(c))return;const a=c.interactionId;if(a==null||ln.has(a))return;const u=c.target?ce(c.target):n(c);if(ps.length>10){const l=ps.shift();ln.delete(l)}ps.push(a),ln.set(a,{span:o,elementName:u})})};Vt("event",r),Vt("first-input",r)}function bi(e){var h,m;const{name:t,op:n,origin:r,metricName:s,value:i,attributes:o,parentSpan:c,reportEvent:a,startTime:u,endTime:l}=e,d=G().getScopeData().transactionName,f={[ue]:r,[Fe]:n,[pt]:0,[`browser.web_vital.${s}.value`]:i,"sentry.transaction":d,"user_agent.original":(h=C.navigator)==null?void 0:h.userAgent,...o};c&&((m=Ka(c).attributes)==null?void 0:m[Fe])==="pageload"&&(f["sentry.pageload.span_id"]=c.spanContext().spanId),a&&(f[`browser.web_vital.${s}.report_event`]=a);const p=xt({name:t,attributes:f,startTime:u,parentSpan:c});p&&p.end(l??u)}function Em(e){let t=0,n;if(!Ur("largest-contentful-paint"))return;const r=Br(({metric:s})=>{const i=s.entries[s.entries.length-1];!i||!Hn(s.value)||(t=s.value,n=i)},!0);Hr(e,(s,i,o)=>{bm(t,n,o,s),r()})}function bm(e,t,n,r){if(!Hn(e))return;Be&&S.log(`Sending LCP span (${e})`);const s=fe()||0,i=re(s),o=re(s+((t==null?void 0:t.startTime)||0)),c=t?ce(t.element):"Largest contentful paint",a={};t!=null&&t.element&&(a["browser.web_vital.lcp.element"]=ce(t.element)),t!=null&&t.id&&(a["browser.web_vital.lcp.id"]=t.id),t!=null&&t.url&&(a["browser.web_vital.lcp.url"]=t.url),(t==null?void 0:t.loadTime)!=null&&(a["browser.web_vital.lcp.load_time"]=t.loadTime),(t==null?void 0:t.renderTime)!=null&&(a["browser.web_vital.lcp.render_time"]=t.renderTime),(t==null?void 0:t.size)!=null&&(a["browser.web_vital.lcp.size"]=t.size),bi({name:c,op:"ui.webvital.lcp",origin:"auto.http.browser.lcp",metricName:"lcp",value:e,attributes:a,parentSpan:n,reportEvent:r,startTime:i,endTime:o})}function vm(e){let t=0,n;if(!Ur("layout-shift"))return;const r=Fr(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(t=s.value,n=i)},!0);Hr(e,(s,i,o)=>{Tm(t,n,o,s),r()})}function Tm(e,t,n,r){var c;Be&&S.log(`Sending CLS span (${e})`);const s=t?re((fe()||0)+t.startTime):ae(),i=t?ce((c=t.sources[0])==null?void 0:c.node):"Layout shift",o={};t!=null&&t.sources&&t.sources.forEach((a,u)=>{o[`browser.web_vital.cls.source.${u+1}`]=ce(a.node)}),bi({name:i,op:"ui.webvital.cls",origin:"auto.http.browser.cls",metricName:"cls",value:e,attributes:o,parentSpan:n,reportEvent:r,startTime:s})}function Im(){if(!Un()||!fe())return;yi(({metric:n})=>{if(n.value==null||re(n.value)>nu)return;const s=n.entries.find(i=>i.duration===n.value&&vn[i.name]);s&&wm(n.value,s)})}function wm(e,t){Be&&S.log(`Sending INP span (${e})`);const n=re(fe()+t.startTime),r=re(e),s=vn[t.name],i=Sm(t.interactionId),o=he(),c=o?le(o):void 0,a=(i==null?void 0:i.span)||c,u=a?Ka(a).name:G().getScopeData().transactionName,l=(i==null?void 0:i.elementName)||ce(t.target);bi({name:l,op:`ui.interaction.${s}`,origin:"auto.http.browser.inp",metricName:"inp",value:e,attributes:{[pt]:t.duration,"sentry.transaction":u},startTime:n,endTime:n+r,parentSpan:a})}const km=1e3;let Po,Bs,$s;function ru(e){const t="dom";lt(t,e),ft(t,Rm)}function Rm(){if(!C.document)return;const e=xe.bind(null,"dom"),t=Fo(e,!0);C.document.addEventListener("click",t,!1),C.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{var i,o;const s=(i=C[n])==null?void 0:i.prototype;(o=s==null?void 0:s.hasOwnProperty)!=null&&o.call(s,"addEventListener")&&(Ee(s,"addEventListener",function(c){return function(a,u,l){if(a==="click"||a=="keypress")try{const d=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},f=d[a]=d[a]||{refCount:0};if(!f.handler){const p=Fo(e);f.handler=p,c.call(this,a,p,l)}f.refCount++}catch{}return c.call(this,a,u,l)}}),Ee(s,"removeEventListener",function(c){return function(a,u,l){if(a==="click"||a=="keypress")try{const d=this.__sentry_instrumentation_handlers__||{},f=d[a];f&&(f.refCount--,f.refCount<=0&&(c.call(this,a,f.handler,l),f.handler=void 0,delete d[a]),Object.keys(d).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return c.call(this,a,u,l)}}))})}function Cm(e){if(e.type!==Bs)return!1;try{if(!e.target||e.target._sentryId!==$s)return!1}catch{}return!0}function Mm(e,t){return e!=="keypress"?!1:t!=null&&t.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function Fo(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=xm(n);if(Mm(n.type,r))return;be(n,"_sentryCaptured",!0),r&&!r._sentryId&&be(r,"_sentryId",we());const s=n.type==="keypress"?"input":n.type;Cm(n)||(e({event:n,name:s,global:t}),Bs=n.type,$s=r?r._sentryId:void 0),clearTimeout(Po),Po=C.setTimeout(()=>{$s=void 0,Bs=void 0},km)}}function xm(e){try{return e.target}catch{return null}}let Xn;function Wr(e){const t="history";lt(t,e),ft(t,Am)}function Am(){if(C.addEventListener("popstate",()=>{const t=C.location.href,n=Xn;if(Xn=t,n===t)return;xe("history",{from:n,to:t})}),!Vp())return;function e(t){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const s=Xn,i=Nm(String(r));if(Xn=i,s===i)return t.apply(this,n);xe("history",{from:s,to:i})}return t.apply(this,n)}}Ee(C.history,"pushState",e),Ee(C.history,"replaceState",e)}function Nm(e){try{return new URL(e,C.location.origin).toString()}catch{return e}}const cr={};function su(e){const t=cr[e];if(t)return t;let n=C[e];if(Os(n))return cr[e]=n.bind(C);const r=C.document;if(r&&typeof r.createElement=="function")try{const s=r.createElement("iframe");s.hidden=!0,r.head.appendChild(s);const i=s.contentWindow;i!=null&&i[e]&&(n=i[e]),r.head.removeChild(s)}catch(s){Be&&S.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,s)}return n&&(cr[e]=n.bind(C))}function Om(e){cr[e]=void 0}function Wn(...e){return su("setTimeout")(...e)}const bt="__sentry_xhr_v3__";function iu(e){const t="xhr";lt(t,e),ft(t,Lm)}function Lm(){if(!C.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const s=new Error,i=ae()*1e3,o=Ge(r[0])?r[0].toUpperCase():void 0,c=Dm(r[1]);if(!o||!c)return t.apply(n,r);n[bt]={method:o,url:c,request_headers:{}},o==="POST"&&c.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const a=()=>{const u=n[bt];if(u&&n.readyState===4){try{u.status_code=n.status}catch{}const l={endTimestamp:ae()*1e3,startTimestamp:i,xhr:n,virtualError:s};xe("xhr",l)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(u,l,d){return a(),u.apply(l,d)}}):n.addEventListener("readystatechange",a),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(u,l,d){const[f,p]=d,h=l[bt];return h&&Ge(f)&&Ge(p)&&(h.request_headers[f.toLowerCase()]=p),u.apply(l,d)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){const s=n[bt];if(!s)return t.apply(n,r);r[0]!==void 0&&(s.body=r[0]);const i={startTimestamp:ae()*1e3,xhr:n};return xe("xhr",i),t.apply(n,r)}})}function Dm(e){if(Ge(e))return e;try{return e.toString()}catch{}}const Pm=Symbol.for("sentry__originalRequestBody");function ou(e){return new URLSearchParams(e).toString()}function au(e,t=S){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[ou(e)];if(!e)return[void 0]}catch(n){return Be&&t.error(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return Be&&t.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function cu(e=[]){if(e.length>=2&&e[1]&&typeof e[1]=="object"&&"body"in e[1])return e[1].body;if(e.length>=1&&e[0]instanceof Request){const n=e[0][Pm];return n!==void 0?n:void 0}}function uu(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return Be&&S.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r
`).reduce((n,r)=>{const[s,i]=r.split(": ");return i&&(n[s.toLowerCase()]=i),n},{}):{}}const Fm=40;function Bm(e,t=su("fetch")){let n=0,r=0;async function s(i){const o=i.body.length;n+=o,r++;const c={body:i.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const a=await t(e.url,c);return{statusCode:a.status,headers:{"x-sentry-rate-limits":a.headers.get("X-Sentry-Rate-Limits"),"retry-after":a.headers.get("Retry-After")}}}catch(a){throw Om("fetch"),a}finally{n-=o,r--}}return Gf(e,s,pi(e.bufferSize||Fm))}const ke=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,$m=30,Um=50;function Us(e,t,n,r){const s={filename:e,function:t==="<anonymous>"?kt:t,in_app:!0};return n!==void 0&&(s.lineno=n),r!==void 0&&(s.colno=r),s}const Hm=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Wm=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,zm=/\((\S*)(?::(\d+))(?::(\d+))\)/,jm=/at (.+?) ?\(data:(.+?),/,qm=e=>{var s;const t=e.match(jm);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=Hm.exec(e);if(n){const[,i,o,c]=n;return Us(i,kt,+o,+c)}const r=Wm.exec(e);if(r){if(((s=r[2])==null?void 0:s.indexOf("eval"))===0){const a=zm.exec(r[2]);a&&(r[2]=a[1],r[3]=a[2],r[4]=a[3])}const[o,c]=du(r[1]||kt,r[2]);return Us(c,o,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},Gm=[$m,qm],Vm=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ym=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Km=e=>{const t=Vm.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const i=Ym.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let r=t[3],s=t[1]||kt;return[s,r]=du(s,r),Us(r,s,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},Xm=[Um,Km],Jm=[Gm,Xm],Zm=Ta(...Jm),du=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:kt,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Jn=1024,Qm="Breadcrumbs",eg=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:Qm,setup(n){t.console&&Mp(sg(n)),t.dom&&ru(rg(n,t.dom)),t.xhr&&iu(ig(n)),t.fetch&&Uc(og(n)),t.history&&Wr(ag(n)),t.sentry&&n.on("beforeSendEvent",ng(n))}}},tg=eg;function ng(e){return function(n){D()===e&&ct({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Et(n)},{event:n})}}function rg(e,t){return function(r){if(D()!==e)return;let s,i,o=typeof t=="object"?t.serializeAttribute:void 0,c=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;c&&c>Jn&&(ke&&S.warn(`\`dom.maxStringLength\` cannot exceed ${Jn}, but a value of ${c} was configured. Sentry will use ${Jn} instead.`),c=Jn),typeof o=="string"&&(o=[o]);try{const u=r.event,l=cg(u)?u.target:u;s=ce(l,{keyAttrs:o,maxStringLength:c}),i=xa(l)}catch{s="<unknown>"}if(s.length===0)return;const a={category:`ui.${r.name}`,message:s};i&&(a.data={"ui.component_name":i}),ct(a,{event:r.event,name:r.name,global:r.global})}}function sg(e){return function(n){if(D()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:Pc(n.level),message:Gi(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${Gi(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;ct(r,{input:n.args,level:n.level})}}function ig(e){return function(n){if(D()!==e)return;const{startTimestamp:r,endTimestamp:s}=n,i=n.xhr[bt];if(!r||!s||!i)return;const{method:o,url:c,status_code:a,body:u}=i,l={method:o,url:c,status_code:a},d={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:s},f={category:"xhr",data:l,type:"http",level:$c(a)};e.emit("beforeOutgoingRequestBreadcrumb",f,d),ct(f,d)}}function og(e){return function(n){if(D()!==e)return;const{startTimestamp:r,endTimestamp:s}=n;if(s&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const i={data:n.error,input:n.args,startTimestamp:r,endTimestamp:s},o={category:"fetch",data:n.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",o,i),ct(o,i)}else{const i=n.response,o={...n.fetchData,status_code:i==null?void 0:i.status},c={input:n.args,response:i,startTimestamp:r,endTimestamp:s},a={category:"fetch",data:o,type:"http",level:$c(o.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",a,c),ct(a,c)}}}function ag(e){return function(n){if(D()!==e)return;let r=n.from,s=n.to;const i=wt(P.location.href);let o=r?wt(r):void 0;const c=wt(s);o!=null&&o.path||(o=i),i.protocol===c.protocol&&i.host===c.host&&(s=c.relative),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),ct({category:"navigation",data:{from:r,to:s}})}}function cg(e){return!!e&&!!e.target}const ug="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),dg="BrowserApiErrors",lg=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:dg,setupOnce(){t.setTimeout&&Ee(P,"setTimeout",Bo),t.setInterval&&Ee(P,"setInterval",Bo),t.requestAnimationFrame&&Ee(P,"requestAnimationFrame",pg),t.XMLHttpRequest&&"XMLHttpRequest"in P&&Ee(XMLHttpRequest.prototype,"send",hg);const n=t.eventTarget;n&&(Array.isArray(n)?n:ug).forEach(s=>mg(s,t))}}},fg=lg;function Bo(e){return function(...t){const n=t[0];return t[0]=Gt(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Xe(e)}`}}),e.apply(this,t)}}function pg(e){return function(t){return e.apply(this,[Gt(t,{mechanism:{data:{handler:Xe(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function hg(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(s=>{s in n&&typeof n[s]=="function"&&Ee(n,s,function(i){const o={mechanism:{data:{handler:Xe(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${s}`}},c=ni(i);return c&&(o.mechanism.data.handler=Xe(c)),Gt(i,o)})}),e.apply(this,t)}}function mg(e,t){var s,i;const r=(s=P[e])==null?void 0:s.prototype;(i=r==null?void 0:r.hasOwnProperty)!=null&&i.call(r,"addEventListener")&&(Ee(r,"addEventListener",function(o){return function(c,a,u){try{gg(a)&&(a.handleEvent=Gt(a.handleEvent,{mechanism:{data:{handler:Xe(a),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&_g(this,c,a),o.apply(this,[c,Gt(a,{mechanism:{data:{handler:Xe(a),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),u])}}),Ee(r,"removeEventListener",function(o){return function(c,a,u){try{const l=a.__sentry_wrapped__;l&&o.call(this,c,l,u)}catch{}return o.call(this,c,a,u)}}))}function gg(e){return typeof e.handleEvent=="function"}function _g(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const Sg=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof P.document>"u"){ke&&S.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}mo({ignoreDuration:!0}),os();const n=ve();let r=n.getUser();n.addScopeListener(s=>{const i=s.getUser();((r==null?void 0:r.id)!==(i==null?void 0:i.id)||(r==null?void 0:r.ip_address)!==(i==null?void 0:i.ip_address))&&(os(),r=i)}),t==="route"&&Wr(({from:s,to:i})=>{s!==i&&(mo({ignoreDuration:!0}),os())})}}},yg="CultureContext",Eg=()=>({name:yg,preprocessEvent(e){var n;const t=$o();t&&(e.contexts={...e.contexts,culture:{...t,...(n=e.contexts)==null?void 0:n.culture}})},processSegmentSpan(e){const t=$o();t&&pc(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}}),bg=Eg;function $o(){try{const e=P.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}const vg="GlobalHandlers",Tg=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:vg,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(wg(n),Uo("onerror")),t.onunhandledrejection&&(kg(n),Uo("onunhandledrejection"))}}},Ig=Tg;function wg(e){wa(t=>{const{stackParser:n,attachStacktrace:r}=lu();if(D()!==e||Wc())return;const{msg:s,url:i,line:o,column:c,error:a}=t,u=Mg(gi(n,a||s,void 0,r,!1),i,o,c);u.level="error",gc(u,{originalException:a,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function kg(e){ka(t=>{const{stackParser:n,attachStacktrace:r}=lu();if(D()!==e||Wc())return;const s=Rg(t),i=Wt(s)?Cg(s):gi(n,s,void 0,r,!0);i.level="error",gc(i,{originalException:s,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function Rg(e){if(Wt(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function Cg(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function Mg(e,t,n,r){const s=e.exception=e.exception||{},i=s.values=s.values||[],o=i[0]=i[0]||{},c=o.stacktrace=o.stacktrace||{},a=c.frames=c.frames||[];return a.length===0&&a.push({colno:r,lineno:n,filename:xg(t)??Qt(),function:kt,in_app:!0}),e}function Uo(e){ke&&S.log(`Global Handler attached: ${e}`)}function lu(){const e=D();return(e==null?void 0:e.getOptions())||{stackParser:()=>[],attachStacktrace:!1}}function xg(e){if(!(!Ge(e)||e.length===0))return e.startsWith("data:")?`<${it(e,!1)}>`:e}const Ag=()=>({name:"HttpContext",preprocessEvent(e){var r;if(!P.navigator&&!P.location&&!P.document)return;const t=mr(),n={...t.headers,...(r=e.request)==null?void 0:r.headers};e.request={...t,...e.request,headers:n}},processSegmentSpan(e){if(!P.navigator&&!P.location&&!P.document)return;const t=mr();pc(e,{"url.full":t.url||void 0,"http.request.header.user_agent":t.headers["User-Agent"],"http.request.header.referer":t.headers.Referer})}}),Ng="cause",Og=5,Lg="LinkedErrors",Dg=(e={})=>{const t=e.limit||Og,n=e.key||Ng;return{name:Lg,preprocessEvent(r,s,i){const o=i.getOptions();Cp(hi,o.stackParser,n,t,r,s)}}},Pg=Dg;function Fg(){return Bg()?(ke&&dt(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function Bg(){var s;if(typeof P.window>"u")return!1;const e=P;if(e.nw)return!1;const t=e.chrome||e.browser;if(!((s=t==null?void 0:t.runtime)!=null&&s.id))return!1;const n=Qt();return!(P===P.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function $g(e){return[Ep(),gp(),$p(),fg(),tg(),Ig(),Pg(),Op(),Ag(),bg(),Sg()]}function Ug(e={}){const t=!e.skipBrowserExtensionCheck&&Fg();let n=e.defaultIntegrations==null?$g():e.defaultIntegrations;const r={...e,enabled:t?!1:e.enabled,stackParser:fd(e.stackParser||Zm),integrations:Af({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||Bm};return rp(ph,r)}const ee=$,vi="sentryReplaySession",Hg="replay_event",Ti="Unable to send Replay",Wg=3e5,zg=9e5,jg=5e3,qg=5500,Gg=6e4,Vg=5e3,Yg=3,Ho=15e4,Zn=5e3,Kg=3e3,Xg=300,Ii=2e7,Jg=4999,Zg=5e4,Wo=36e5;var Qg=Object.defineProperty,e_=(e,t,n)=>t in e?Qg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zo=(e,t,n)=>e_(e,typeof t!="symbol"?t+"":t,n),ie=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(ie||{});function t_(e){return e.nodeType===e.ELEMENT_NODE}function fn(e){const t=e==null?void 0:e.host;return(t==null?void 0:t.shadowRoot)===e}function pn(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function n_(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function r_(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 Er(e){try{const t=e.rules||e.cssRules;return t?n_(Array.from(t,fu).join("")):null}catch{return null}}function s_(e){let t="";for(let n=0;n<e.style.length;n++){const r=e.style,s=r[n],i=r.getPropertyPriority(s);t+=`${s}:${r.getPropertyValue(s)}${i?" !important":""};`}return`${e.selectorText} { ${t} }`}function fu(e){let t;if(o_(e))try{t=Er(e.styleSheet)||r_(e)}catch{}else if(a_(e)){let n=e.cssText;const r=e.selectorText.includes(":"),s=typeof e.style.all=="string"&&e.style.all;if(s&&(n=s_(e)),r&&(n=i_(n)),r||s)return n}return t||e.cssText}function i_(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function o_(e){return"styleSheet"in e}function a_(e){return"selectorText"in e}class pu{constructor(){zo(this,"idNodeMap",new Map),zo(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.id)??-1:-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 c_(){return new pu}function zr({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 Tn({isMasked:e,element:t,value:n,maskInputFn:r}){let s=n||"";return e?(r&&(s=r(s,t)),"*".repeat(s.length)):s}function Yt(e){return e.toLowerCase()}function Hs(e){return e.toUpperCase()}const jo="__rrweb_original__";function u_(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=jo in i?i[jo]: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 wi(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Yt(t):null}function br(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}function hu(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}const r=/\.([0-9a-z]+)(?:$)/i,s=n.pathname.match(r);return(s==null?void 0:s[1])??null}const qo={};function mu(e){const t=qo[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);const i=s.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(s)}catch{}return qo[e]=r.bind(window)}function Ws(...e){return mu("setTimeout")(...e)}function gu(...e){return mu("clearTimeout")(...e)}function _u(e){try{return e.contentDocument}catch{}}let d_=1;const l_=new RegExp("[^a-z0-9-_:]"),In=-2;function ki(){return d_++}function f_(e){if(e instanceof HTMLFormElement)return"form";const t=Yt(e.tagName);return l_.test(t)?"div":t}function p_(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let Ot,Go;const h_=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,m_=/^(?:[a-z+]+:)?\/\//i,g_=/^www\..*/i,__=/^(data:)([^,]*),(.*)/i;function S_(e,t){if(!e||t.size===0)return e;try{const n=e.split(";"),r=[];for(let s of n){if(s=s.trim(),!s)continue;const i=s.indexOf(":");if(i===-1){r.push(s);continue}const o=s.slice(0,i).trim();t.has(o)||r.push(s)}return r.join("; ")+(r.length>0&&e.endsWith(";")?";":"")}catch(n){return console.warn("Error filtering CSS properties:",n),e}}function vr(e,t){return(e||"").replace(h_,(n,r,s,i,o,c)=>{const a=s||o||c,u=r||i||"";if(!a)return n;if(m_.test(a)||g_.test(a))return`url(${u}${a}${u})`;if(__.test(a))return`url(${u}${a}${u})`;if(a[0]==="/")return`url(${u}${p_(t)+a}${u})`;const l=t.split("/"),d=a.split("/");l.pop();for(const f of d)f!=="."&&(f===".."?l.pop():l.push(f));return`url(${u}${l.join("/")}${u})`})}const y_=/^[^ \t\n\r\u000c]+/,E_=/^[, \t\n\r\u000c]+/;function b_(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(E_),!(n>=t.length);){let i=r(y_);if(i.slice(-1)===",")i=Ft(e,i.substring(0,i.length-1)),s.push(i);else{let o="";i=Ft(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(", ")}const Vo=new WeakMap;function Ft(e,t){return!t||t.trim()===""?t:jr(e,t)}function v_(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function jr(e,t){let n=Vo.get(e);if(n||(n=e.createElement("a"),Vo.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function Su(e,t,n,r,s,i,o){if(!r)return r;if(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#"))return Ft(e,r);if(n==="xlink:href"&&r[0]!=="#")return Ft(e,r);if(n==="background"&&(t==="table"||t==="td"||t==="th"))return Ft(e,r);if(n==="srcset")return b_(e,r);if(n==="style"){let c=vr(r,jr(e));return o&&o.size>0&&(c=S_(c,o)),c}else if(t==="object"&&n==="data")return Ft(e,r);return typeof i=="function"?i(n,r,s):r}function yu(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function T_(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{}return!1}function I_(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function vt(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:vt(e.parentNode,t,n,r+1)}function Bt(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(I_(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function Kt(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 u=o.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(u))return!0}let c=-1,a=-1;if(i){if(a=vt(o,Bt(r,s)),a<0)return!0;c=vt(o,Bt(t,n),a>=0?a:1/0)}else{if(c=vt(o,Bt(t,n)),c<0)return!1;a=vt(o,Bt(r,s),c>=0?c:1/0)}return c>=0?a>=0?c<=a:!0:a>=0?!1:!!i}catch{}return!!i}function w_(e,t,n){const r=e.contentWindow;if(!r)return;let s=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){const c=Ws(()=>{s||(t(),s=!0)},n);e.addEventListener("load",()=>{gu(c),s=!0,t()});return}const o="about:blank";if(r.location.href!==o||e.src===o||e.src==="")return Ws(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function k_(e,t,n){let r=!1,s;try{s=e.sheet}catch{return}if(s)return;const i=Ws(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{gu(i),r=!0,t()})}function R_(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskAttributeFn:a,maskTextClass:u,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:f,inlineStylesheet:p,maskInputOptions:h={},maskTextFn:m,maskInputFn:g,dataURLOptions:y={},inlineImages:T,recordCanvas:O,keepIframeSrcFn:B,newlyAddedElement:Y=!1,ignoreCSSAttributes:A}=t,_=C_(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:ie.Document,childNodes:[],compatMode:e.compatMode}:{type:ie.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ie.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:_};case e.ELEMENT_NODE:return x_(e,{doc:n,blockClass:s,blockSelector:i,unblockSelector:o,inlineStylesheet:p,maskAttributeFn:a,maskInputOptions:h,maskInputFn:g,dataURLOptions:y,inlineImages:T,recordCanvas:O,keepIframeSrcFn:B,newlyAddedElement:Y,rootId:_,maskTextClass:u,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:f,ignoreCSSAttributes:A});case e.TEXT_NODE:return M_(e,{doc:n,maskAllText:c,maskTextClass:u,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:f,maskTextFn:m,maskInputOptions:h,maskInputFn:g,rootId:_});case e.CDATA_SECTION_NODE:return{type:ie.CDATA,textContent:"",rootId:_};case e.COMMENT_NODE:return{type:ie.Comment,textContent:e.textContent||"",rootId:_};default:return!1}}function C_(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return n===1?void 0:n}function M_(e,t){var y;const{maskAllText:n,maskTextClass:r,unmaskTextClass:s,maskTextSelector:i,unmaskTextSelector:o,maskTextFn:c,maskInputOptions:a,maskInputFn:u,rootId:l}=t,d=e.parentNode&&e.parentNode.tagName;let f=e.textContent;const p=d==="STYLE"?!0:void 0,h=d==="SCRIPT"?!0:void 0,m=d==="TEXTAREA"?!0:void 0;if(p&&f){try{e.nextSibling||e.previousSibling||(y=e.parentNode.sheet)!=null&&y.cssRules&&(f=Er(e.parentNode.sheet))}catch(T){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${T}`,e)}f=vr(f,jr(t.doc))}h&&(f="SCRIPT_PLACEHOLDER");const g=Kt(e,r,i,s,o,n);if(!p&&!h&&!m&&f&&g&&(f=c?c(f,e.parentElement):f.replace(/[\S]/g,"*")),m&&f&&(a.textarea||g)&&(f=u?u(f,e.parentNode):f.replace(/[\S]/g,"*")),d==="OPTION"&&f){const T=zr({type:null,tagName:d,maskInputOptions:a});f=Tn({isMasked:Kt(e,r,i,s,o,T),element:e,value:f,maskInputFn:u})}return{type:ie.Text,textContent:f||"",isStyle:p,rootId:l}}function x_(e,t){const{doc:n,blockClass:r,blockSelector:s,unblockSelector:i,inlineStylesheet:o,maskInputOptions:c={},maskAttributeFn:a,maskInputFn:u,dataURLOptions:l={},inlineImages:d,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:h=!1,rootId:m,maskTextClass:g,unmaskTextClass:y,maskTextSelector:T,unmaskTextSelector:O,ignoreCSSAttributes:B}=t,Y=T_(e,r,s,i),A=f_(e);let _={};const I=e.attributes.length;for(let b=0;b<I;b++){const w=e.attributes[b];w.name&&!yu(A,w.name,w.value)&&(_[w.name]=Su(n,A,Yt(w.name),w.value,e,a,B))}if(A==="link"&&o){const b=Array.from(n.styleSheets).find(H=>H.href===e.href);let w=null;b&&(w=Er(b)),w&&(_.rel=null,_.href=null,_.crossorigin=null,_._cssText=vr(w,b.href))}if(A==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const b=Er(e.sheet);b&&(_._cssText=vr(b,jr(n)))}if(A==="input"||A==="textarea"||A==="select"||A==="option"){const b=e,w=wi(b),H=br(b,Hs(A),w),z=b.checked;if(w!=="submit"&&w!=="button"&&H){const N=Kt(b,g,T,y,O,zr({type:w,tagName:Hs(A),maskInputOptions:c}));_.value=Tn({isMasked:N,element:b,value:H,maskInputFn:u})}z&&(_.checked=z)}if(A==="option"&&(e.selected&&!c.select?_.selected=!0:delete _.selected),A==="canvas"&&f){if(e.__context==="2d")u_(e)||(_.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){const b=e.toDataURL(l.type,l.quality),w=n.createElement("canvas");w.width=e.width,w.height=e.height;const H=w.toDataURL(l.type,l.quality);b!==H&&(_.rr_dataURL=b)}}if(A==="img"&&d){Ot||(Ot=n.createElement("canvas"),Go=Ot.getContext("2d"));const b=e,w=b.currentSrc||b.getAttribute("src")||"<unknown-src>",H=b.crossOrigin,z=()=>{b.removeEventListener("load",z);try{Ot.width=b.naturalWidth,Ot.height=b.naturalHeight,Go.drawImage(b,0,0),_.rr_dataURL=Ot.toDataURL(l.type,l.quality)}catch(N){if(b.crossOrigin!=="anonymous"){b.crossOrigin="anonymous",b.complete&&b.naturalWidth!==0?z():b.addEventListener("load",z);return}else console.warn(`Cannot inline img src=${w}! Error: ${N}`)}b.crossOrigin==="anonymous"&&(H?_.crossOrigin=H:b.removeAttribute("crossorigin"))};b.complete&&b.naturalWidth!==0?z():b.addEventListener("load",z)}if((A==="audio"||A==="video")&&(_.rr_mediaState=e.paused?"paused":"played",_.rr_mediaCurrentTime=e.currentTime),h||(e.scrollLeft&&(_.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(_.rr_scrollTop=e.scrollTop)),Y){const{width:b,height:w}=e.getBoundingClientRect();_={class:_.class,rr_width:`${b}px`,rr_height:`${w}px`}}A==="iframe"&&!p(_.src)&&(!Y&&!_u(e)&&(_.rr_src=_.src),delete _.src);let te;try{customElements.get(A)&&(te=!0)}catch{}return{type:ie.Element,tagName:A,attributes:_,childNodes:[],isSVG:v_(e)||void 0,needBlock:Y,rootId:m,isCustom:te}}function Q(e){return e==null?"":e.toLowerCase()}function A_(e,t){if(t.comment&&e.type===ie.Comment)return!0;if(e.type===ie.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&hu(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(Q(e.attributes.name).match(/^msapplication-tile(image|color)$/)||Q(e.attributes.name)==="application-name"||Q(e.attributes.rel)==="icon"||Q(e.attributes.rel)==="apple-touch-icon"||Q(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&Q(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Q(e.attributes.property).match(/^(og|twitter|fb):/)||Q(e.attributes.name).match(/^(og|twitter):/)||Q(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(Q(e.attributes.name)==="robots"||Q(e.attributes.name)==="googlebot"||Q(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(Q(e.attributes.name)==="author"||Q(e.attributes.name)==="generator"||Q(e.attributes.name)==="framework"||Q(e.attributes.name)==="publisher"||Q(e.attributes.name)==="progid"||Q(e.attributes.property).match(/^article:/)||Q(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(Q(e.attributes.name)==="google-site-verification"||Q(e.attributes.name)==="yandex-verification"||Q(e.attributes.name)==="csrf-token"||Q(e.attributes.name)==="p:domain_verify"||Q(e.attributes.name)==="verify-v1"||Q(e.attributes.name)==="verification"||Q(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function $t(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:d,skipChild:f=!1,inlineStylesheet:p=!0,maskInputOptions:h={},maskAttributeFn:m,maskTextFn:g,maskInputFn:y,slimDOMOptions:T,dataURLOptions:O={},inlineImages:B=!1,recordCanvas:Y=!1,onSerialize:A,onIframeLoad:_,iframeLoadTimeout:I=5e3,onBlockedImageLoad:te,onStylesheetLoad:b,stylesheetLoadTimeout:w=5e3,keepIframeSrcFn:H=()=>!1,newlyAddedElement:z=!1,ignoreCSSAttributes:N}=t;let{preserveWhiteSpace:oe=!0}=t;const J=R_(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:c,unblockSelector:o,maskTextClass:a,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:d,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:g,maskInputFn:y,dataURLOptions:O,inlineImages:B,recordCanvas:Y,keepIframeSrcFn:H,newlyAddedElement:z,ignoreCSSAttributes:N});if(!J)return console.warn(e,"not serialized"),null;let Z;r.hasNode(e)?Z=r.getId(e):A_(J,T)||!oe&&J.type===ie.Text&&!J.isStyle&&!J.textContent.replace(/^\s+|\s+$/gm,"").length?Z=In:Z=ki();const E=Object.assign(J,{id:Z});if(r.add(e,E),Z===In)return null;A&&A(e);let j=!f;if(E.type===ie.Element){j=j&&!E.needBlock;const x=e.shadowRoot;x&&pn(x)&&(E.isShadowHost=!0)}if((E.type===ie.Document||E.type===ie.Element)&&j){T.headWhitespace&&E.type===ie.Element&&E.tagName==="head"&&(oe=!1);const x={doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:c,unblockSelector:o,maskTextClass:a,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:d,skipChild:f,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:g,maskInputFn:y,slimDOMOptions:T,dataURLOptions:O,inlineImages:B,recordCanvas:Y,preserveWhiteSpace:oe,onSerialize:A,onIframeLoad:_,iframeLoadTimeout:I,onBlockedImageLoad:te,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:H,ignoreCSSAttributes:N},ne=e.childNodes?Array.from(e.childNodes):[];for(const F of ne){const X=$t(F,x);X&&E.childNodes.push(X)}if(t_(e)&&e.shadowRoot)for(const F of Array.from(e.shadowRoot.childNodes)){const X=$t(F,x);X&&(pn(e.shadowRoot)&&(X.isShadow=!0),E.childNodes.push(X))}}if(e.parentNode&&fn(e.parentNode)&&pn(e.parentNode)&&(E.isShadow=!0),E.type===ie.Element&&E.tagName==="iframe"&&!E.needBlock&&w_(e,()=>{const x=_u(e);if(x&&_){const ne=$t(x,{doc:x,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:g,maskInputFn:y,slimDOMOptions:T,dataURLOptions:O,inlineImages:B,recordCanvas:Y,preserveWhiteSpace:oe,onSerialize:A,onIframeLoad:_,iframeLoadTimeout:I,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:H,ignoreCSSAttributes:N});ne&&_(e,ne)}},I),E.type===ie.Element&&E.tagName==="img"&&!e.complete&&E.needBlock){const x=e,ne=()=>{if(x.isConnected&&!x.complete&&te)try{const F=x.getBoundingClientRect();F.width>0&&F.height>0&&te(x,E,F)}catch{}x.removeEventListener("load",ne)};x.isConnected&&x.addEventListener("load",ne)}return E.type===ie.Element&&E.tagName==="link"&&typeof E.attributes.rel=="string"&&(E.attributes.rel==="stylesheet"||E.attributes.rel==="preload"&&typeof E.attributes.href=="string"&&hu(E.attributes.href)==="css")&&k_(e,()=>{if(b){const x=$t(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:g,maskInputFn:y,slimDOMOptions:T,dataURLOptions:O,inlineImages:B,recordCanvas:Y,preserveWhiteSpace:oe,onSerialize:A,onIframeLoad:_,iframeLoadTimeout:I,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:H,ignoreCSSAttributes:N});x&&b(e,x)}},w),E.type===ie.Element&&delete E.needBlock,E}function N_(e,t){const{mirror:n=new pu,blockClass:r="rr-block",blockSelector:s=null,unblockSelector:i=null,maskAllText:o=!1,maskTextClass:c="rr-mask",unmaskTextClass:a=null,maskTextSelector:u=null,unmaskTextSelector:l=null,inlineStylesheet:d=!0,inlineImages:f=!1,recordCanvas:p=!1,maskAllInputs:h=!1,maskAttributeFn:m,maskTextFn:g,maskInputFn:y,slimDOM:T=!1,dataURLOptions:O,preserveWhiteSpace:B,onSerialize:Y,onIframeLoad:A,iframeLoadTimeout:_,onBlockedImageLoad:I,onStylesheetLoad:te,stylesheetLoadTimeout:b,keepIframeSrcFn:w=()=>!1,ignoreCSSAttributes:H=new Set([])}=t||{};return $t(e,{doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,maskAllText:o,maskTextClass:c,unmaskTextClass:a,maskTextSelector:u,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:h===!1?{}:h,maskAttributeFn:m,maskTextFn:g,maskInputFn:y,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:O,inlineImages:f,recordCanvas:p,preserveWhiteSpace:B,onSerialize:Y,onIframeLoad:A,iframeLoadTimeout:_,onBlockedImageLoad:I,onStylesheetLoad:te,stylesheetLoadTimeout:b,keepIframeSrcFn:w,newlyAddedElement:!1,ignoreCSSAttributes:H})}function _e(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const Lt=`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 Yo={map:{},getId(){return console.error(Lt),-1},getNode(){return console.error(Lt),null},removeNodeFromMap(){console.error(Lt)},has(){return console.error(Lt),!1},reset(){console.error(Lt)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Yo=new Proxy(Yo,{get(e,t,n){return t==="map"&&console.error(Lt),Reflect.get(e,t,n)}}));function wn(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&&($_(r),r=null),s=o,e.apply(a,i)):!r&&n.trailing!==!1&&(r=qr(()=>{s=n.leading===!1?0:Date.now(),r=null,e.apply(a,i)},c))}}function Eu(e,t,n,r,s=window){const i=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,r?n:{set(o){qr(()=>{n.set.call(this,o)},0),i&&i.set&&i.set.call(this,o)}}),()=>Eu(e,t,i||{},!0)}function Ri(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{return()=>{}}}let Tr=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Tr=()=>new Date().getTime());function bu(e){var n,r,s,i,o,c;const t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:(t==null?void 0:t.documentElement.scrollLeft)||((r=(n=t==null?void 0:t.body)==null?void 0:n.parentElement)==null?void 0:r.scrollLeft)||((s=t==null?void 0:t.body)==null?void 0:s.scrollLeft)||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(t==null?void 0:t.documentElement.scrollTop)||((o=(i=t==null?void 0:t.body)==null?void 0:i.parentElement)==null?void 0:o.scrollTop)||((c=t==null?void 0:t.body)==null?void 0:c.scrollTop)||0}}function vu(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Tu(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Iu(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function Ie(e,t,n,r,s){if(!e)return!1;const i=Iu(e);if(!i)return!1;const o=Bt(t,n);if(!s){const u=r&&i.matches(r);return o(i)&&!u}const c=vt(i,o);let a=-1;return c<0?!1:(r&&(a=vt(i,Bt(null,r))),c>-1&&a<0?!0:c<a)}function O_(e,t){return t.getId(e)!==-1}function hs(e,t){return t.getId(e)===In}function wu(e,t){if(fn(e))return!1;const n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?wu(e.parentNode,t):!0:!0}function zs(e){return!!e.changedTouches}function L_(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 ku(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Ru(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function js(e){return!!(e!=null&&e.shadowRoot)}class D_{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){return 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 Cu(e){var n,r;let t=null;return((r=(n=e.getRootNode)==null?void 0:n.call(e))==null?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function P_(e){let t=e,n;for(;n=Cu(t);)t=n;return t}function F_(e){const t=e.ownerDocument;if(!t)return!1;const n=P_(e);return t.contains(n)}function Mu(e){const t=e.ownerDocument;return t?t.contains(e)||F_(e):!1}const Ko={};function Ci(e){const t=Ko[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);const i=s.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(s)}catch{}return Ko[e]=r.bind(window)}function B_(...e){return Ci("requestAnimationFrame")(...e)}function qr(...e){return Ci("setTimeout")(...e)}function $_(...e){return Ci("clearTimeout")(...e)}var L=(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))(L||{}),M=(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))(M||{}),me=(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))(me||{}),qe=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(qe||{}),Dt=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Dt||{});function Mi(e){try{return e.contentDocument}catch{}}function U_(e){try{return e.contentWindow}catch{}}function Xo(e){return"__ln"in e}class H_{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=(n==null?void 0:n.next)||null;return n}addNode(t){const n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&Xo(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&&Xo(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 Jo=(e,t)=>`${e}@${t}`;class W_{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,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 H_,s=a=>{let u=a,l=In;for(;l===In;)u=u&&u.nextSibling,l=u&&this.mirror.getId(u);return l},i=a=>{if(!a.parentNode||!Mu(a))return;const u=fn(a.parentNode)?this.mirror.getId(Cu(a)):this.mirror.getId(a.parentNode),l=s(a);if(u===-1||l===-1)return r.addNode(a);const d=$t(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:f=>{ku(f,this.mirror)&&!Ie(f,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(f),Ru(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),js(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,this.doc)},onIframeLoad:(f,p)=>{Ie(f,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(this.iframeManager.attachIframe(f,p),f.contentWindow&&this.canvasManager.addWindow(f.contentWindow),this.shadowDomManager.observeAttachShadow(f))},onStylesheetLoad:(f,p)=>{this.stylesheetManager.attachLinkElement(f,p)},onBlockedImageLoad:(f,p,{width:h,height:m})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:p.id,attributes:{style:{width:`${h}px`,height:`${m}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});d&&(t.push({parentId:u,nextId:l,node:d}),n.add(d.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)Zo(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||i(a);for(const a of this.addedSet)!Qo(this.droppedSet,a)&&!Zo(this.removes,a,this.mirror)||Qo(this.movedSet,a)?i(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){const u=this.mirror.getId(o.value.parentNode),l=s(o.value);u!==-1&&l!==-1&&(a=o)}if(!a){let u=r.tail;for(;u;){const l=u;if(u=u.previous,l){const d=this.mirror.getId(l.value.parentNode);if(s(l.value)===-1)continue;if(d!==-1){a=l;break}else{const p=l.value;if(p.parentNode&&p.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const h=p.parentNode.host;if(this.mirror.getId(h)!==-1){a=l;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:u}=a;if(typeof u.style=="string"){const l=JSON.stringify(a.styleDiff),d=JSON.stringify(a._unchangedStyles);l.length<u.style.length&&(l+d).split("var(").length===u.style.split("var(").length&&(u.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:u}}).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.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(c))},this.processMutation=t=>{if(!hs(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!Ie(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:Kt(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,Iu(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{const n=t.target;let r=t.attributeName,s=t.target.getAttribute(r);if(r==="value"){const o=wi(n),c=n.tagName;s=br(n,c,o);const a=zr({maskInputOptions:this.maskInputOptions,tagName:c,type:o}),u=Kt(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,a);s=Tn({isMasked:u,element:n,value:s,maskInputFn:this.maskInputFn})}if(Ie(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||s===t.oldValue)return;let i=this.attributeMap.get(t.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(s))if(!Mi(n))r="rr_src";else return;if(i||(i={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(t.target,i)),r==="type"&&n.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!yu(n.tagName,r)&&(i.attributes[r]=Su(this.doc,Yt(n.tagName),Yt(r),s,n,this.maskAttributeFn),r==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const o=this.unattachedDoc.createElement("span");t.oldValue&&o.setAttribute("style",t.oldValue);for(const c of Array.from(n.style)){const a=n.style.getPropertyValue(c),u=n.style.getPropertyPriority(c);a!==o.style.getPropertyValue(c)||u!==o.style.getPropertyPriority(c)?u===""?i.styleDiff[c]=a:i.styleDiff[c]=[a,u]:i._unchangedStyles[c]=[a,u]}for(const c of Array.from(o.style))n.style.getPropertyValue(c)===""&&(i.styleDiff[c]=!1)}break}case"childList":{if(Ie(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{const r=this.mirror.getId(n),s=fn(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);Ie(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||hs(n,this.mirror)||!O_(n,this.mirror)||(this.addedSet.has(n)?(qs(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||wu(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[Jo(r,s)]?qs(this.movedSet,n):this.removes.push({parentId:s,id:r,isShadow:fn(t.target)&&pn(t.target)?!0:void 0})),this.mapRemoves.push(n))});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(hs(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[Jo(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Ie(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes&&t.childNodes.forEach(r=>this.genAdds(r)),js(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","ignoreCSSAttributes"].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 qs(e,t){var n;e.delete(t),(n=t.childNodes)==null||n.forEach(r=>qs(e,r))}function Zo(e,t,n){return e.length===0?!1:z_(e,t,n)}function z_(e,t,n){let r=t.parentNode;for(;r;){const s=n.getId(r);if(e.some(i=>i.id===s))return!0;r=r.parentNode}return!1}function Qo(e,t){return e.size===0?!1:xu(e,t)}function xu(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:xu(e,n):!1}let hn;function j_(e){hn=e}function q_(){hn=void 0}const W=e=>hn?(...n)=>{try{return e(...n)}catch(r){if(hn&&hn(r)===!0)return()=>{};throw r}}:e,Ut=[];function zn(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{}return e&&e.target}function Au(e,t){var o,c;const n=new W_;Ut.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver;const s=(c=(o=window==null?void 0:window.Zone)==null?void 0:o.__symbol__)==null?void 0:c.call(o,"MutationObserver");s&&window[s]&&(r=window[s]);const i=new r(W(a=>{e.onMutation&&e.onMutation(a)===!1||n.processMutations.bind(n)(a)}));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function G_({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=wn(W(d=>{const f=Date.now()-c;e(o.map(p=>(p.timeOffset-=f,p)),d),o=[],c=null}),i),u=W(wn(W(d=>{const f=zn(d),{clientX:p,clientY:h}=zs(d)?d.changedTouches[0]:d;c||(c=Tr()),o.push({x:p,y:h,id:r.getId(f),timeOffset:Tr()-c}),a(typeof DragEvent<"u"&&d instanceof DragEvent?M.Drag:d instanceof MouseEvent?M.MouseMove:M.TouchMove)}),s,{trailing:!1})),l=[_e("mousemove",u,n),_e("touchmove",u,n),_e("drag",u,n)];return W(()=>{l.forEach(d=>d())})}function V_({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 u=null;const l=d=>f=>{const p=zn(f);if(Ie(p,r,s,i,!0))return;let h=null,m=d;if("pointerType"in f){switch(f.pointerType){case"mouse":h=qe.Mouse;break;case"touch":h=qe.Touch;break;case"pen":h=qe.Pen;break}h===qe.Touch?me[d]===me.MouseDown?m="TouchStart":me[d]===me.MouseUp&&(m="TouchEnd"):qe.Pen}else zs(f)&&(h=qe.Touch);h!==null?(u=h,(m.startsWith("Touch")&&h===qe.Touch||m.startsWith("Mouse")&&h===qe.Mouse)&&(h=null)):me[d]===me.Click&&(h=u,u=null);const g=zs(f)?f.changedTouches[0]:f;if(!g)return;const y=n.getId(p),{clientX:T,clientY:O}=g;W(e)({type:me[m],id:y,x:T,y:O,...h!==null&&{pointerType:h}})};return Object.keys(me).filter(d=>Number.isNaN(Number(d))&&!d.endsWith("_Departed")&&c[d]!==!1).forEach(d=>{let f=Yt(d);const p=l(d);if(window.PointerEvent)switch(me[d]){case me.MouseDown:case me.MouseUp:f=f.replace("mouse","pointer");break;case me.TouchStart:case me.TouchEnd:return}a.push(_e(f,p,t))}),W(()=>{a.forEach(d=>d())})}function Nu({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:o}){const c=W(wn(W(a=>{const u=zn(a);if(!u||Ie(u,r,s,i,!0))return;const l=n.getId(u);if(u===t&&t.defaultView){const d=bu(t.defaultView);e({id:l,x:d.left,y:d.top})}else e({id:l,x:u.scrollLeft,y:u.scrollTop})}),o.scroll||100));return _e("scroll",c,t)}function Y_({viewportResizeCb:e},{win:t}){let n=-1,r=-1;const s=W(wn(W(()=>{const i=vu(),o=Tu();(n!==i||r!==o)&&(e({width:Number(o),height:Number(i)}),n=i,r=o)}),200));return _e("resize",s,t)}const K_=["INPUT","TEXTAREA","SELECT"],ea=new WeakMap;function X_({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,ignoreClass:o,ignoreSelector:c,maskInputOptions:a,maskInputFn:u,sampling:l,userTriggeredOnInput:d,maskTextClass:f,unmaskTextClass:p,maskTextSelector:h,unmaskTextSelector:m}){function g(_){let I=zn(_);const te=_.isTrusted,b=I&&Hs(I.tagName);if(b==="OPTION"&&(I=I.parentElement),!I||!b||K_.indexOf(b)<0||Ie(I,r,s,i,!0))return;const w=I;if(w.classList.contains(o)||c&&w.matches(c))return;const H=wi(I);let z=br(w,b,H),N=!1;const oe=zr({maskInputOptions:a,tagName:b,type:H}),J=Kt(I,f,h,p,m,oe);(H==="radio"||H==="checkbox")&&(N=I.checked),z=Tn({isMasked:J,element:I,value:z,maskInputFn:u}),y(I,d?{text:z,isChecked:N,userTriggered:te}:{text:z,isChecked:N});const Z=I.name;H==="radio"&&Z&&N&&t.querySelectorAll(`input[type="radio"][name="${Z}"]`).forEach(E=>{if(E!==I){const j=Tn({isMasked:J,element:E,value:br(E,b,H),maskInputFn:u});y(E,d?{text:j,isChecked:!N,userTriggered:!1}:{text:j,isChecked:!N})}})}function y(_,I){const te=ea.get(_);if(!te||te.text!==I.text||te.isChecked!==I.isChecked){ea.set(_,I);const b=n.getId(_);W(e)({...I,id:b})}}const O=(l.input==="last"?["change"]:["input","change"]).map(_=>_e(_,W(g),t)),B=t.defaultView;if(!B)return()=>{O.forEach(_=>_())};const Y=B.Object.getOwnPropertyDescriptor(B.HTMLInputElement.prototype,"value"),A=[[B.HTMLInputElement.prototype,"value"],[B.HTMLInputElement.prototype,"checked"],[B.HTMLSelectElement.prototype,"value"],[B.HTMLTextAreaElement.prototype,"value"],[B.HTMLSelectElement.prototype,"selectedIndex"],[B.HTMLOptionElement.prototype,"selected"]];return Y&&Y.set&&O.push(...A.map(_=>Eu(_[0],_[1],{set(){W(g)({target:this,isTrusted:!1})}},!1,B))),W(()=>{O.forEach(_=>_())})}function Ir(e){const t=[];function n(r,s){if(Qn("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Qn("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Qn("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Qn("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 nt(e,t,n){let r,s;return e?(e.ownerNode?r=t.getId(e.ownerNode):s=n.getId(e),{styleId:s,id:r}):{}}function J_({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:W((l,d,f)=>{const[p,h]=f,{id:m,styleId:g}=nt(d,t,n.styleMirror);return(m&&m!==-1||g&&g!==-1)&&e({id:m,styleId:g,adds:[{rule:p,index:h}]}),l.apply(d,f)})});const i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:W((l,d,f)=>{const[p]=f,{id:h,styleId:m}=nt(d,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,removes:[{index:p}]}),l.apply(d,f)})});let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:W((l,d,f)=>{const[p]=f,{id:h,styleId:m}=nt(d,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replace:p}),l.apply(d,f)})}));let c;r.CSSStyleSheet.prototype.replaceSync&&(c=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:W((l,d,f)=>{const[p]=f,{id:h,styleId:m}=nt(d,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replaceSync:p}),l.apply(d,f)})}));const a={};er("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(er("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),er("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),er("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(a).forEach(([l,d])=>{u[l]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(u[l].insertRule,{apply:W((f,p,h)=>{const[m,g]=h,{id:y,styleId:T}=nt(p.parentStyleSheet,t,n.styleMirror);return(y&&y!==-1||T&&T!==-1)&&e({id:y,styleId:T,adds:[{rule:m,index:[...Ir(p),g||0]}]}),f.apply(p,h)})}),d.prototype.deleteRule=new Proxy(u[l].deleteRule,{apply:W((f,p,h)=>{const[m]=h,{id:g,styleId:y}=nt(p.parentStyleSheet,t,n.styleMirror);return(g&&g!==-1||y&&y!==-1)&&e({id:g,styleId:y,removes:[{index:[...Ir(p),m]}]}),f.apply(p,h)})})}),W(()=>{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(([l,d])=>{d.prototype.insertRule=u[l].insertRule,d.prototype.deleteRule=u[l].deleteRule})})}function Ou({mirror:e,stylesheetManager:t},n){var o,c,a;let r=null;n.nodeName==="#document"?r=e.getId(n):r=e.getId(n.host);const s=n.nodeName==="#document"?(o=n.defaultView)==null?void 0:o.Document:(a=(c=n.ownerDocument)==null?void 0:c.defaultView)==null?void 0:a.ShadowRoot,i=s!=null&&s.prototype?Object.getOwnPropertyDescriptor(s==null?void 0:s.prototype,"adoptedStyleSheets"):void 0;return r===null||r===-1||!s||!i?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){var u;return(u=i.get)==null?void 0:u.call(this)},set(u){var d;const l=(d=i.set)==null?void 0:d.call(this,u);if(r!==null&&r!==-1)try{t.adoptStyleSheets(u,r)}catch{}return l}}),W(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function Z_({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:s}){const i=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:W((c,a,u)=>{var m;const[l,d,f]=u;if(n.has(l))return i.apply(a,[l,d,f]);const{id:p,styleId:h}=nt((m=a.parentRule)==null?void 0:m.parentStyleSheet,t,r.styleMirror);return(p&&p!==-1||h&&h!==-1)&&e({id:p,styleId:h,set:{property:l,value:d,priority:f},index:Ir(a.parentRule)}),c.apply(a,u)})});const o=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:W((c,a,u)=>{var p;const[l]=u;if(n.has(l))return o.apply(a,[l]);const{id:d,styleId:f}=nt((p=a.parentRule)==null?void 0:p.parentStyleSheet,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,remove:{property:l},index:Ir(a.parentRule)}),c.apply(a,u)})}),W(()=>{s.CSSStyleDeclaration.prototype.setProperty=i,s.CSSStyleDeclaration.prototype.removeProperty=o})}function Q_({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:s,sampling:i,doc:o}){const c=W(u=>wn(W(l=>{const d=zn(l);if(!d||Ie(d,t,n,r,!0))return;const{currentTime:f,volume:p,muted:h,playbackRate:m}=d;e({type:u,id:s.getId(d),currentTime:f,volume:p,muted:h,playbackRate:m})}),i.media||500)),a=[_e("play",c(Dt.Play),o),_e("pause",c(Dt.Pause),o),_e("seeked",c(Dt.Seeked),o),_e("volumechange",c(Dt.VolumeChange),o),_e("ratechange",c(Dt.RateChange),o)];return W(()=>{a.forEach(u=>u())})}function eS({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],s=new WeakMap,i=n.FontFace;n.FontFace=function(a,u,l){const d=new i(a,u,l);return s.set(d,{family:a,buffer:typeof u!="string",descriptors:l,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),d};const o=Ri(t.fonts,"add",function(c){return function(a){return qr(W(()=>{const u=s.get(a);u&&(e(u),s.delete(a))}),0),c.apply(this,[a])}});return r.push(()=>{n.FontFace=i}),r.push(o),W(()=>{r.forEach(c=>c())})}function tS(e){const{doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,selectionCb:o}=e;let c=!0;const a=W(()=>{const u=t.getSelection();if(!u||c&&(u!=null&&u.isCollapsed))return;c=u.isCollapsed||!1;const l=[],d=u.rangeCount||0;for(let f=0;f<d;f++){const p=u.getRangeAt(f),{startContainer:h,startOffset:m,endContainer:g,endOffset:y}=p;Ie(h,r,s,i,!0)||Ie(g,r,s,i,!0)||l.push({start:n.getId(h),startOffset:m,end:n.getId(g),endOffset:y})}o({ranges:l})});return a(),_e("selectionchange",a)}function nS({doc:e,customElementCb:t}){const n=e.defaultView;return!n||!n.customElements?()=>{}:Ri(n.customElements,"define",function(s){return function(i,o,c){try{t({define:{name:i}})}catch{}return s.apply(this,[i,o,c])}})}function rS(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=Au(e,e.doc));const s=G_(e),i=V_(e),o=Nu(e),c=Y_(e,{win:n}),a=X_(e),u=Q_(e);let l=()=>{},d=()=>{},f=()=>{},p=()=>{};e.recordDOM&&(l=J_(e,{win:n}),d=Ou(e,e.doc),f=Z_(e,{win:n}),e.collectFonts&&(p=eS(e)));const h=tS(e),m=nS(e),g=[];for(const y of e.plugins)g.push(y.observer(y.callback,n,y.options));return W(()=>{Ut.forEach(y=>y.reset()),r==null||r.disconnect(),s(),i(),o(),c(),a(),u(),l(),d(),f(),p(),h(),m(),g.forEach(y=>y())})}function Qn(e){return typeof window[e]<"u"}function er(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Gs{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}}class sS{constructor(){this.crossOriginIframeMirror=new Gs(ki),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class iS{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Gs(ki),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Gs(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){var s,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((s=t.contentWindow)==null||s.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,t);const r=Mi(t);r&&r.adoptedStyleSheets&&r.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(r.adoptedStyleSheets,this.mirror.getId(r))}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){var r;switch(n.type){case L.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);const s=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,s),this.patchRootIdOnNode(n.data.node,s),{timestamp:n.timestamp,type:L.IncrementalSnapshot,data:{source:M.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case L.Meta:case L.Load:case L.DomContentLoaded:return!1;case L.Plugin:return n;case L.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case L.IncrementalSnapshot:switch(n.data.source){case M.Mutation:return n.data.adds.forEach(s=>{this.replaceIds(s,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,t);const i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(s.node,i)}),n.data.removes.forEach(s=>{this.replaceIds(s,t,["parentId","id"])}),n.data.attributes.forEach(s=>{this.replaceIds(s,t,["id"])}),n.data.texts.forEach(s=>{this.replaceIds(s,t,["id"])}),n;case M.Drag:case M.TouchMove:case M.MouseMove:return n.data.positions.forEach(s=>{this.replaceIds(s,t,["id"])}),n;case M.ViewportResize:return!1;case M.MediaInteraction:case M.MouseInteraction:case M.Scroll:case M.CanvasMutation:case M.Input:return this.replaceIds(n.data,t,["id"]),n;case M.StyleSheetRule:case M.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case M.Font:return n;case M.Selection:return n.data.ranges.forEach(s=>{this.replaceIds(s,t,["start","end"])}),n;case M.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),(r=n.data.styles)==null||r.forEach(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!==ie.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class oS{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class aS{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(!pn(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);const r=Au({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Nu({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),qr(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(Ou({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){const n=Mi(t),r=U_(t);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(t,n){const r=this;this.restoreHandlers.push(Ri(t.prototype,"attachShadow",function(s){return function(i){const o=s.call(this,i);return this.shadowRoot&&Mu(this)&&r.addShadowRoot(this.shadowRoot,n),o}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}}var ta="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",cS=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var tr=0;tr<ta.length;tr++)cS[ta.charCodeAt(tr)]=tr;class na{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}}class uS{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new D_,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:fu(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 dS{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(t,n){const r=this.nodeMap.get(t);return r&&Array.from(r).some(s=>s!==n)}add(t,n){this.active||(this.active=!0,B_(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}}let se,wr;var Ea;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Ea=e.contentWindow)==null?void 0:Ea.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const Oe=c_();function Pe(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:u=!1,maskTextClass:l="rr-mask",unmaskTextClass:d=null,maskTextSelector:f=null,unmaskTextSelector:p=null,inlineStylesheet:h=!0,maskAllInputs:m,maskInputOptions:g,slimDOMOptions:y,maskAttributeFn:T,maskInputFn:O,maskTextFn:B,maxCanvasSize:Y=null,packFn:A,sampling:_={},dataURLOptions:I={},mousemoveWait:te,recordDOM:b=!0,recordCanvas:w=!1,recordCrossOriginIframes:H=!1,recordAfter:z=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:N=!1,collectFonts:oe=!1,inlineImages:J=!1,plugins:Z,keepIframeSrcFn:E=()=>!1,ignoreCSSAttributes:j=new Set([]),errorHandler:x,onMutation:ne,getCanvasManager:F}=e;j_(x);const X=H?window.parent===window:!0;let pe=!1;if(!X)try{window.parent.document&&(pe=!1)}catch{pe=!0}if(X&&!t)throw new Error("emit function is required");if(!X&&!pe)return()=>{};te!==void 0&&_.mousemove===void 0&&(_.mousemove=te),Oe.reset();const Ae=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}:g!==void 0?g:{},et=y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:y==="all",headMetaDescKeywords:y==="all"}:y||{};L_();let Te,gt=0;const sn=V=>{for(const Ne of Z||[])Ne.eventProcessor&&(V=Ne.eventProcessor(V));return A&&!pe&&(V=A(V)),V};se=(V,Ne)=>{var Se;const U=V;if(U.timestamp=Tr(),(Se=Ut[0])!=null&&Se.isFrozen()&&U.type!==L.FullSnapshot&&!(U.type===L.IncrementalSnapshot&&U.data.source===M.Mutation)&&Ut.forEach(Re=>Re.unfreeze()),X)t==null||t(sn(U),Ne);else if(pe){const Re={type:"rrweb",event:sn(U),origin:window.location.origin,isCheckout:Ne};window.parent.postMessage(Re,"*")}if(U.type===L.FullSnapshot)Te=U,gt=0;else if(U.type===L.IncrementalSnapshot){if(U.data.source===M.Mutation&&U.data.isAttachIframe)return;gt++;const Re=r&&gt>=r,K=n&&Te&&U.timestamp-Te.timestamp>n;(Re||K)&&Zr(!0)}};const _t=V=>{se({type:L.IncrementalSnapshot,data:{source:M.Mutation,...V}})},Bi=V=>se({type:L.IncrementalSnapshot,data:{source:M.Scroll,...V}}),nd=V=>se({type:L.IncrementalSnapshot,data:{source:M.CanvasMutation,...V}}),rd=V=>se({type:L.IncrementalSnapshot,data:{source:M.AdoptedStyleSheet,...V}}),St=new uS({mutationCb:_t,adoptedStyleSheetCb:rd}),yt=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new sS:new iS({mirror:Oe,mutationCb:_t,stylesheetManager:St,recordCrossOriginIframes:H,wrappedEmit:se});for(const V of Z||[])V.getMirror&&V.getMirror({nodeMirror:Oe,crossOriginIframeMirror:yt.crossOriginIframeMirror,crossOriginIframeStyleMirror:yt.crossOriginIframeStyleMirror});const Xr=new dS,Jr=fS(F,{mirror:Oe,win:window,mutationCb:V=>se({type:L.IncrementalSnapshot,data:{source:M.CanvasMutation,...V}}),recordCanvas:w,blockClass:s,blockSelector:i,unblockSelector:o,maxCanvasSize:Y,sampling:_.canvas,dataURLOptions:I,errorHandler:x}),qn=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new oS:new aS({mutationCb:_t,scrollCb:Bi,bypassOptions:{onMutation:ne,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:u,maskTextClass:l,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskInputOptions:Ae,dataURLOptions:I,maskAttributeFn:T,maskTextFn:B,maskInputFn:O,recordCanvas:w,inlineImages:J,sampling:_,slimDOMOptions:et,iframeManager:yt,stylesheetManager:St,canvasManager:Jr,keepIframeSrcFn:E,processedNodeManager:Xr,ignoreCSSAttributes:j},mirror:Oe}),Zr=(V=!1)=>{if(!b)return;se({type:L.Meta,data:{href:window.location.href,width:Tu(),height:vu()}},V),St.reset(),qn.init(),Ut.forEach(U=>U.lock());const Ne=N_(document,{mirror:Oe,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:u,maskTextClass:l,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskAllInputs:Ae,maskAttributeFn:T,maskInputFn:O,maskTextFn:B,slimDOM:et,dataURLOptions:I,recordCanvas:w,inlineImages:J,onSerialize:U=>{ku(U,Oe)&&yt.addIframe(U),Ru(U,Oe)&&St.trackLinkElement(U),js(U)&&qn.addShadowRoot(U.shadowRoot,document)},onIframeLoad:(U,Se)=>{yt.attachIframe(U,Se),U.contentWindow&&Jr.addWindow(U.contentWindow),qn.observeAttachShadow(U)},onStylesheetLoad:(U,Se)=>{St.attachLinkElement(U,Se)},onBlockedImageLoad:(U,Se,{width:Re,height:K})=>{_t({adds:[],removes:[],texts:[],attributes:[{id:Se.id,attributes:{style:{width:`${Re}px`,height:`${K}px`}}}]})},keepIframeSrcFn:E,ignoreCSSAttributes:j});if(!Ne)return console.warn("Failed to snapshot the document");se({type:L.FullSnapshot,data:{node:Ne,initialOffset:bu(window)}}),Ut.forEach(U=>U.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&St.adoptStyleSheets(document.adoptedStyleSheets,Oe.getId(document))};wr=Zr;try{const V=[],Ne=Se=>{var Re;return W(rS)({onMutation:ne,mutationCb:_t,mousemoveCb:(K,Qr)=>se({type:L.IncrementalSnapshot,data:{source:Qr,positions:K}}),mouseInteractionCb:K=>se({type:L.IncrementalSnapshot,data:{source:M.MouseInteraction,...K}}),scrollCb:Bi,viewportResizeCb:K=>se({type:L.IncrementalSnapshot,data:{source:M.ViewportResize,...K}}),inputCb:K=>se({type:L.IncrementalSnapshot,data:{source:M.Input,...K}}),mediaInteractionCb:K=>se({type:L.IncrementalSnapshot,data:{source:M.MediaInteraction,...K}}),styleSheetRuleCb:K=>se({type:L.IncrementalSnapshot,data:{source:M.StyleSheetRule,...K}}),styleDeclarationCb:K=>se({type:L.IncrementalSnapshot,data:{source:M.StyleDeclaration,...K}}),canvasMutationCb:nd,fontCb:K=>se({type:L.IncrementalSnapshot,data:{source:M.Font,...K}}),selectionCb:K=>{se({type:L.IncrementalSnapshot,data:{source:M.Selection,...K}})},customElementCb:K=>{se({type:L.IncrementalSnapshot,data:{source:M.CustomElement,...K}})},blockClass:s,ignoreClass:c,ignoreSelector:a,maskAllText:u,maskTextClass:l,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,maskInputOptions:Ae,inlineStylesheet:h,sampling:_,recordDOM:b,recordCanvas:w,inlineImages:J,userTriggeredOnInput:N,collectFonts:oe,doc:Se,maskAttributeFn:T,maskInputFn:O,maskTextFn:B,keepIframeSrcFn:E,blockSelector:i,unblockSelector:o,slimDOMOptions:et,dataURLOptions:I,mirror:Oe,iframeManager:yt,stylesheetManager:St,shadowDomManager:qn,processedNodeManager:Xr,canvasManager:Jr,ignoreCSSAttributes:j,plugins:((Re=Z==null?void 0:Z.filter(K=>K.observer))==null?void 0:Re.map(K=>({observer:K.observer,options:K.options,callback:Qr=>se({type:L.Plugin,data:{plugin:K.name,payload:Qr}})})))||[]},{})};yt.addLoadListener(Se=>{try{V.push(Ne(Se.contentDocument))}catch(Re){console.warn(Re)}});const U=()=>{Zr(),V.push(Ne(document))};return document.readyState==="interactive"||document.readyState==="complete"?U():(V.push(_e("DOMContentLoaded",()=>{se({type:L.DomContentLoaded,data:{}}),z==="DOMContentLoaded"&&U()})),V.push(_e("load",()=>{se({type:L.Load,data:{}}),z==="load"&&U()},window))),()=>{V.forEach(Se=>Se()),Xr.destroy(),wr=void 0,q_()}}catch(V){console.warn(V)}}function lS(e){if(!wr)throw new Error("please take full snapshot after start recording");wr(e)}Pe.mirror=Oe;Pe.takeFullSnapshot=lS;function fS(e,t){try{return e?e(t):new na}catch{return console.warn("Unable to initialize CanvasManager"),new na}}var ra;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(ra||(ra={}));const pS=3,hS=5;function xi(e){return e>9999999999?e:e*1e3}function ms(e){return e>9999999999?e/1e3:e}function jn(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:L.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:Le(t,10,1e3)}}),t.category==="console")))}const mS="button,a";function Lu(e){return e.closest(mS)||e}function Du(e){const t=Pu(e);return!t||!(t instanceof Element)?t:Lu(t)}function Pu(e){return gS(e)?e.target:e}function gS(e){return typeof e=="object"&&!!e&&"target"in e}let rt;function _S(e){return rt||(rt=[],SS()),rt.push(e),()=>{const t=rt?rt.indexOf(e):-1;t>-1&&rt.splice(t,1)}}function SS(){Ee(ee,"open",function(e){return function(...t){if(rt)try{rt.forEach(n=>n())}catch{}return e.apply(ee,t)}})}const yS=new Set([M.Mutation,M.StyleSheetRule,M.StyleDeclaration,M.AdoptedStyleSheet,M.CanvasMutation,M.Selection,M.MediaInteraction]);function ES(e,t,n){e.handleClick(t,n)}class bS{constructor(t,n,r=jn){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=n.timeout/1e3,this._threshold=n.threshold/1e3,this._scrollTimeout=n.scrollTimeout/1e3,this._replay=t,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){const t=_S(()=>{this._lastMutation=sa()});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(TS(n,this._ignoreSelector)||!IS(t))return;const r={timestamp:ms(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=ms(t)}registerScroll(t=Date.now()){this._lastScroll=ms(t)}registerClick(t){const n=Lu(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=sa();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._scrollTimeout,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,u=a<this._timeout*1e3?"mutation":"timeout",l={type:"default",message:c.message,timestamp:c.timestamp,category:"ui.slowClickDetected",data:{...c.data,url:ee.location.href,route:n.getCurrentRoute(),timeAfterClickMs:a,endReason:u,clickCount:o||1}};this._addBreadcrumbEvent(n,l);return}if(o>1){const a={type:"default",message:c.message,timestamp:c.timestamp,category:"ui.multiClick",data:{...c.data,url:ee.location.href,route:n.getCurrentRoute(),clickCount:o,metric:!0}};this._addBreadcrumbEvent(n,a)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=Wn(()=>this._checkClicks(),1e3)}}const vS=["A","BUTTON","INPUT"];function TS(e,t){return!!(!vS.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 IS(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function sa(){return Date.now()/1e3}function wS(e,t){try{if(!kS(t))return;const{source:n}=t.data;if(yS.has(n)&&e.registerMutation(t.timestamp),n===M.Scroll&&e.registerScroll(t.timestamp),RS(t)){const{type:r,id:s}=t.data,i=Pe.mirror.getNode(s);i instanceof HTMLElement&&r===me.Click&&e.registerClick(i)}}catch{}}function kS(e){return e.type===pS}function RS(e){return e.data.source===M.MouseInteraction}function Ue(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var Gr=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Gr||{});const CS=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function MS(e){const t={};!e["data-sentry-component"]&&e["data-sentry-element"]&&(e["data-sentry-component"]=e["data-sentry-element"]);for(const n in e)if(CS.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}const xS=e=>t=>{if(!e.isEnabled())return;const n=AS(t);if(!n)return;const r=t.name==="click",s=r?t.event:void 0;r&&e.clickDetector&&(s!=null&&s.target)&&!s.altKey&&!s.metaKey&&!s.ctrlKey&&!s.shiftKey&&ES(e.clickDetector,n,Du(t.event)),jn(e,n)};function Fu(e,t){const n=Pe.mirror.getId(e),r=n&&Pe.mirror.getNode(n),s=r&&Pe.mirror.getMeta(r),i=s&&OS(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===Gr.Text&&o.textContent).filter(Boolean).map(o=>o.trim()).join(""),attributes:MS(i.attributes)}}:{}}}function AS(e){const{target:t,message:n}=NS(e);return Ue({category:`ui.${e.name}`,...Fu(t,n)})}function NS(e){const t=e.name==="click";let n,r=null;try{r=t?Du(e.event):Pu(e.event),n=ce(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function OS(e){return e.type===Gr.Element}function LS(e,t){if(!e.isEnabled())return;e.updateUserActivity();const n=DS(t);n&&jn(e,n)}function DS(e){const{metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:i,target:o}=e;if(!o||PS(o)||!i)return null;const c=t||r||s,a=i.length===1;if(!c&&a)return null;const u=ce(o,{maxStringLength:200})||"<unknown>",l=Fu(o,u);return Ue({category:"ui.keyDown",message:u,data:{...l.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:i}})}function PS(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}const FS={resource:WS,paint:US,navigation:HS};function gs(e,t){return({metric:n})=>void t.replayPerformanceEntries.push(e(n))}function BS(e){return e.map($S).filter(Boolean)}function $S(e){const t=FS[e.entryType];return t?t(e):null}function Xt(e){return((fe()||ee.performance.timeOrigin)+e)/1e3}function US(e){const{duration:t,entryType:n,name:r,startTime:s}=e,i=Xt(s);return{type:n,name:r,start:i,end:i+t,data:void 0}}function HS(e){const{entryType:t,name:n,decodedBodySize:r,duration:s,domComplete:i,encodedBodySize:o,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,domInteractive:u,loadEventStart:l,loadEventEnd:d,redirectCount:f,startTime:p,transferSize:h,type:m}=e;return s===0?null:{type:`${t}.${m}`,start:Xt(p),end:Xt(i),name:n,data:{size:h,decodedBodySize:r,encodedBodySize:o,duration:s,domInteractive:u,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,loadEventStart:l,loadEventEnd:d,domComplete:i,redirectCount:f}}}function WS(e){const{entryType:t,initiatorType:n,name:r,responseEnd:s,startTime:i,decodedBodySize:o,encodedBodySize:c,responseStatus:a,transferSize:u}=e;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${t}.${n}`,start:Xt(i),end:Xt(s),name:r,data:{size:u,statusCode:a,decodedBodySize:o,encodedBodySize:c}}}function zS(e){const t=e.entries[e.entries.length-1],n=t!=null&&t.element?[t.element]:void 0;return Ai(e,"largest-contentful-paint",n)}function jS(e){return e.sources!==void 0}function qS(e){const t=[],n=[];for(const r of e.entries)if(jS(r)){const s=[];for(const i of r.sources)if(i.node){n.push(i.node);const o=Pe.mirror.getId(i.node);o&&s.push(o)}t.push({value:r.value,nodeIds:s.length?s:void 0})}return Ai(e,"cumulative-layout-shift",n,t)}function GS(e){const t=e.entries[e.entries.length-1],n=t!=null&&t.target?[t.target]:void 0;return Ai(e,"interaction-to-next-paint",n)}function Ai(e,t,n,r){const s=e.value,i=e.rating,o=Xt(s);return{type:"web-vital",name:t,start:o,end:o,data:{value:s,size:s,rating:i,nodeIds:n?n.map(c=>Pe.mirror.getId(c)):void 0,attributions:r}}}function VS(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(Vt(s,n))}),r.push(Br(gs(zS,e)),Fr(gs(qS,e)),yi(gs(GS,e))),()=>{r.forEach(s=>s())}}const k=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,YS='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]),s=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=function(t,e){for(var i=new n(31),s=0;s<31;++s)i[s]=e+=1<<t[s-1];var a=new r(i[30]);for(s=1;s<30;++s)for(var o=i[s];o<i[s+1];++o)a[o]=o-i[s]<<5|s;return{b:i,r:a}},o=a(e,2),h=o.b,f=o.r;h[28]=258,f[258]=28;for(var l=a(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,s=0,a=new n(r);s<i;++s)t[s]&&++a[t[s]-1];var o,h=new n(r);for(s=1;s<r;++s)h[s]=h[s-1]+a[s-1]<<1;if(e){o=new n(1<<r);var f=15-r;for(s=0;s<i;++s)if(t[s])for(var l=s<<4|t[s],c=r-t[s],v=h[t[s]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>f]=l}else for(o=new n(i),s=0;s<i;++s)t[s]&&(o[s]=u[h[t[s]-1]++]>>15-t[s]);return o},p=new t(288);for(c=0;c<144;++c)p[c]=8;for(c=144;c<256;++c)p[c]=9;for(c=256;c<280;++c)p[c]=7;for(c=280;c<288;++c)p[c]=8;var g=new t(32);for(c=0;c<32;++c)g[c]=5;var w=d(p,9,0),y=d(g,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(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},_=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},x=function(r,e){for(var i=[],s=0;s<r.length;++s)r[s]&&i.push({s:s,f:r[s]});var a=i.length,o=i.slice();if(!a)return{t:F,l:0};if(1==a){var h=new t(i[0].s+1);return h[i[0].s]=1,{t:h,l:1}}i.sort(function(t,n){return t.f-n.f}),i.push({s:-1,f:25001});var f=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:f.f+l.f,l:f,r:l};c!=a-1;)f=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:f.f+l.f,l:f,r:l};var d=o[0].s;for(s=1;s<a;++s)o[s].s>d&&(d=o[s].s);var p=new n(d+1),g=A(i[c-1],p,0);if(g>e){s=0;var w=0,y=g-e,m=1<<y;for(o.sort(function(t,n){return p[n.s]-p[t.s]||t.f-n.f});s<a;++s){var b=o[s].s;if(!(p[b]>e))break;w+=m-(1<<g-p[b]),p[b]=e}for(w>>=y;w>0;){var M=o[s].s;p[M]<e?w-=1<<e-p[M]++-1:++s}for(;s>=0&&w;--s){var E=o[s].s;p[E]==e&&(--p[E],++w)}g=e}return{t:new t(p),l:g}},A=function(t,n,r){return-1==t.s?Math.max(A(t.l,n,r+1),A(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,s=t[0],a=1,o=function(t){e[i++]=t},h=1;h<=r;++h)if(t[h]==s&&h!=r)++a;else{if(!s&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(s),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(s);a=1,s=t[h]}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 s=0;s<e;++s)t[i+s+4]=r[s];return 8*(i+4+e)},U=function(t,r,a,o,h,f,l,u,c,v,m){z(r,m++,a),++h[256];for(var b=x(h,15),M=b.t,E=b.l,A=x(f,15),U=A.t,C=A.l,F=D(M),I=F.c,S=F.n,L=D(U),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=x(q,7),H=G.t,J=G.l,K=19;K>4&&!H[s[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(h,p)+T(f,g)+l,X=T(h,M)+T(f,U)+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(U,C,0),R=U;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[s[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=w,P=p,Q=y,R=g;for(B=0;B<u;++B){var rt=o[B];if(rt>255){_(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;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et])}else _(r,m,N[rt]),m+=P[rt]}return _(r,m,N[256]),m+P[256]},C=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,s=0|r.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=e+=r[a];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(s,a,o,h,u){if(!u&&(u={l:1},a.dictionary)){var c=a.dictionary.subarray(-32768),v=new t(c.length+s.length);v.set(c),v.set(s,c.length),s=v,u.w=c.length}return function(s,a,o,h,u,c){var v=c.z||s.length,d=new t(h+v+5*(1+Math.ceil(v/7e3))+u),p=d.subarray(h,d.length-u),g=c.l,w=7&(c.r||0);if(a){w&&(p[0]=c.r>>3);for(var y=C[a-1],M=y>>13,E=8191&y,z=(1<<o)-1,_=c.p||new n(32768),x=c.h||new n(z+1),A=Math.ceil(o/3),D=2*A,T=function(t){return(s[t]^s[t+1]<<A^s[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=x[H];if(_[J]=K,x[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!g)){w=U(s,p,0,F,I,S,O,q,G,j-G,w),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(s[j+Q]==s[j+Q-W]){for(var $=0;$<Z&&s[j+$]==s[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-_[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=_[J])&32767}if(R){F[q++]=268435456|f[Q]<<18|l[R];var it=31&f[Q],st=31&l[R];O+=e[it]+i[st],++I[257+it],++S[st],B=j+Q,++L}else F[q++]=s[j],++I[s[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=s[j],++I[s[j]];w=U(s,p,g,F,I,S,O,q,G,j-G,w),g||(c.r=7&w|p[w/8|0]<<3,w-=7,c.h=x,c.p=_,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+g;j+=65535){var at=j+65535;at>=v&&(p[w/8|0]=g,at=v),w=k(p,w+1,s.subarray(j,at))}c.i=v}return b(d,0,h+m(w)+u)}(s,null==a.level?6:a.level,null==a.mem?u.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):20:12+a.mem,o,h,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 s=this.b.length-this.s.z;this.b.set(n.subarray(0,s),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(s),32768),this.s.z=n.length-s+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.prototype.flush=function(){this.ondata||E(5),this.s.l&&E(4),this.p(this.b,!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,s=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),a=s.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)}}(s,n),O(s,a-8,r.d()),O(s,a-4,e),s}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.prototype.flush=function(){j.prototype.flush.call(this)},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(G)return G.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),s=0,a=function(t){i[s++]=t},o=0;o<e;++o){if(s+5>i.length){var h=new t(s+8+(e-o<<1));h.set(i),i=h}var f=n.charCodeAt(o);f<128||r?a(f):f<2048?(a(192|f>>6),a(128|63&f)):f>55295&&f<57344?(a(240|(f=65536+(1047552&f)|1023&n.charCodeAt(++o))>>18),a(128|f>>12&63),a(128|f>>6&63),a(128|63&f)):(a(224|f>>12),a(128|f>>6&63),a(128|63&f))}return b(i,0,s)}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(const r of t)n+=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 KS(){const e=new Blob([YS]);return URL.createObjectURL(e)}const ia=["log","warn","error"],ur="[Replay] ";function _s(e,t="info"){ct({category:"console",data:{logger:"replay"},level:t,message:`${ur}${e}`},{level:t})}function XS(){let e=!1,t=!1;const n={exception:()=>{},infoTick:()=>{},setConfig:r=>{e=!!r.captureExceptions,t=!!r.traceInternals}};return k?(ia.forEach(r=>{n[r]=(...s)=>{S[r](ur,...s),t&&_s(s.join(""),Pc(r))}}),n.exception=(r,...s)=>{s.length&&n.error&&n.error(...s),S.error(ur,r),e?mc(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&_s(r,"error")},n.infoTick=(...r)=>{S.log(ur,...r),t&&setTimeout(()=>_s(r[0]),0)}):ia.forEach(r=>{n[r]=()=>{}}),n}const R=XS();class Ni extends Error{constructor(){super(`Event buffer exceeded maximum size of ${Ii}.`)}}class Bu{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(t){const n=JSON.stringify(t).length;if(this._totalSize+=n,this._totalSize>Ii)throw new Ni;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(){let t=null;for(const{timestamp:n}of this.events)(t===null||n<t)&&(t=n);return t===null?t:xi(t)}}class Oi{constructor(t){Oi.prototype.__init.call(this),this._worker=t,this._id=0,this._pending=new Map,this._worker.addEventListener("message",this._onMessage)}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((t,n)=>{this._worker.addEventListener("message",({data:r})=>{r.success?t():(k&&R.warn("Received worker message with unsuccessful status",r),n(new Error("Received worker message with unsuccessful status")))},{once:!0}),this._worker.addEventListener("error",r=>{k&&R.warn("Failed to load Replay compression worker",r),n(new Error(`Failed to load Replay compression worker: ${r instanceof ErrorEvent&&r.message?r.message:"Unknown error. This can happen due to CSP policy restrictions, network issues, or the worker script failing to load."}`))},{once:!0})}),this._ensureReadyPromise)}destroy(){k&&R.log("Destroying compression worker"),this._worker.removeEventListener("message",this._onMessage),this._pending.forEach(t=>t.reject(new Error("Worker destroyed"))),this._pending.clear(),this._worker.terminate()}postMessage(t,n){const r=this._getAndIncrementId();return new Promise((s,i)=>{this._pending.set(r,{method:t,resolve:s,reject:i});try{this._worker.postMessage({id:r,method:t,arg:n})}catch(o){this._pending.delete(r),i(o)}})}__init(){this._onMessage=({data:t})=>{const n=t;if(typeof n.id!="number")return;const r=this._pending.get(n.id);if(!(!r||r.method!==n.method)){if(this._pending.delete(n.id),!n.success){k&&R.error("Error in compression worker: ",n.response),r.reject(new Error("Error in compression worker"));return}r.resolve(n.response)}}}_getAndIncrementId(){return this._id++}}class JS{constructor(t){this._worker=new Oi(t),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(t){const n=xi(t.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);const r=JSON.stringify(t);return this._totalSize+=r.length,this._totalSize>Ii?Promise.reject(new Ni):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{k&&R.exception(t,'Sending "clear" message to worker failed',t)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(t){return this._worker.postMessage("addEvent",t)}async _finishRequest(){const t=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,t}}class ZS{constructor(t){this._fallback=new Bu,this._compression=new JS(t),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get waitForCheckout(){return this._used.waitForCheckout}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}set waitForCheckout(t){this._used.waitForCheckout=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)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(t){k&&R.exception(t,"Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:t,hasCheckout:n,waitForCheckout:r}=this._fallback,s=[];for(const i of t)s.push(this._compression.addEvent(i));this._compression.hasCheckout=n,this._compression.waitForCheckout=r,this._used=this._compression;try{await Promise.all(s),this._fallback.clear()}catch(i){k&&R.exception(i,"Failed to add events when switching buffers.")}}}function QS({useCompression:e,workerUrl:t}){if(e&&window.Worker){const n=ey(t);if(n)return n}return k&&R.log("Using simple buffer"),new Bu}function ey(e){try{const t=e||ty();if(!t)return;k&&R.log(`Using compression worker${e?` from ${e}`:""}`);const n=new Worker(t);return new ZS(n)}catch(t){k&&R.exception(t,"Failed to create compression worker")}}function ty(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?KS():""}function Li(){try{return"sessionStorage"in ee&&!!ee.sessionStorage}catch{return!1}}function ny(e){ry(),e.session=void 0}function ry(){if(Li())try{ee.sessionStorage.removeItem(vi)}catch{}}function $u(e){return e===void 0?!1:Math.random()<e}function Vr(e){if(Li())try{ee.sessionStorage.setItem(vi,JSON.stringify(e))}catch{}}function Uu(e){const t=Date.now(),n=e.id||we(),r=e.started||t,s=e.lastActivity||t,i=e.segmentId||0,o=e.sampled,c=e.previousSessionId,a=e.dirty||!1;return{id:n,started:r,lastActivity:s,segmentId:i,sampled:o,previousSessionId:c,dirty:a}}function sy(e,t){return $u(e)?"session":t?"buffer":!1}function oa({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){const s=sy(e,t),i=Uu({sampled:s,previousSessionId:r});return n&&Vr(i),i}function iy(){if(!Li())return null;try{const e=ee.sessionStorage.getItem(vi);if(!e)return null;const t=JSON.parse(e);return k&&R.infoTick("Loading existing session"),Uu(t)}catch{return null}}function Vs(e,t,n=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=n}function oy(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return Vs(e.started,t,r)||Vs(e.lastActivity,n,r)}function kr(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!oy(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled==="buffer"&&e.segmentId===0)}function Ss({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){const s=r.stickySession&&iy();return s?kr(s,{sessionIdleExpire:e,maxReplayDuration:t})?(k&&R.infoTick("Session in sessionStorage is expired, creating new one..."),oa(r,{previousSessionId:s.id})):s:(k&&R.infoTick("Creating new session"),oa(r,{previousSessionId:n}))}function ay(e){return e.type===L.Custom}function Di(e,t,n){return Wu(e,t)?(Hu(e,t,n),!0):!1}function cy(e,t,n){return Wu(e,t)?Hu(e,t,n):Promise.resolve(null)}async function Hu(e,t,n){const{eventBuffer:r}=e;if(!r||r.waitForCheckout&&!n)return null;const s=e.recordingMode==="buffer";try{n&&s&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);const i=e.getOptions(),o=uy(t,i.beforeAddRecordingEvent);return o?await r.addEvent(o):void 0}catch(i){const o=i&&i instanceof Ni,c=o?"eventBufferOverflow":"eventBufferError",a=D();if(a){const u=o?"buffer_overflow":"internal_sdk_error";a.recordDroppedEvent(u,"replay")}if(o&&s)return r.clear(),r.waitForCheckout=!0,null;e.handleException(i),await e.stop({reason:c})}}function Wu(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;const n=xi(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(k&&R.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function uy(e,t){try{if(typeof t=="function"&&ay(e))return t(e)}catch(n){return k&&R.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}function Pi(e){return!e.type}function Ys(e){return e.type==="transaction"}function dy(e){return e.type==="replay_event"}function aa(e){return e.type==="feedback"}function ly(e){return(t,n)=>{if(!e.isEnabled()||!Pi(t)&&!Ys(t))return;const r=n.statusCode;if(!(!r||r<200||r>=300)){if(Ys(t)){fy(e,t);return}py(e,t)}}}function fy(e,t){var r,s;const n=e.getContext();(s=(r=t.contexts)==null?void 0:r.trace)!=null&&s.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}function py(e,t){var s;const n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),e.recordingMode!=="buffer"||!((s=t.tags)!=null&&s.replayId))return;const{beforeErrorSampling:r}=e.getOptions();typeof r=="function"&&!r(t)||Wn(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(i){e.handleException(i)}})}function hy(e){return t=>{!e.isEnabled()||!Pi(t)||my(e,t)}}function my(e,t){var r,s,i;const n=(i=(s=(r=t.exception)==null?void 0:r.values)==null?void 0:s[0])==null?void 0:i.value;if(typeof n=="string"&&(n.match(/(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))){const o=Ue({category:"replay.hydrate-error",data:{url:Qt()}});jn(e,o)}}function gy(e){const t=D();t&&t.on("beforeAddBreadcrumb",n=>_y(e,n))}function _y(e,t){if(!e.isEnabled()||!zu(t))return;const n=Sy(t);n&&jn(e,n)}function Sy(e){return!zu(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?yy(e):Ue(e)}function yy(e){var s;const t=(s=e.data)==null?void 0:s.arguments;if(!Array.isArray(t)||t.length===0)return Ue(e);let n=!1;const r=t.map(i=>{if(!i)return i;if(typeof i=="string")return i.length>Zn?(n=!0,`${i.slice(0,Zn)}…`):i;if(typeof i=="object")try{const o=Le(i,7);return JSON.stringify(o).length>Zn?(n=!0,`${JSON.stringify(o,null,2).slice(0,Zn)}…`):o}catch{}return i});return Ue({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function zu(e){return!!e.category}function Ey(e,t){var n,r,s;return e.type||!((r=(n=e.exception)==null?void 0:n.values)!=null&&r.length)?!1:!!((s=t.originalException)!=null&&s.__rrweb__)}function Rr(){const e=G().getPropagationContext().dsc;e&&delete e.replay_id;const t=he();if(t){const n=ze(t);delete n.replay_id}}function by(e){const t=G().getPropagationContext().dsc;t&&(t.replay_id=e);const n=he();if(n){const r=ze(n);r.replay_id=e}}function vy(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:L.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 Ty(e,t){return e.recordingMode!=="buffer"||t.message===Ti||!t.exception||t.type?!1:$u(e.getOptions().errorSampleRate)}function Iy(e){return Object.assign((t,n)=>{var o;if(e.session&&kr(e.session,{maxReplayDuration:e.getOptions().maxReplayDuration,sessionIdleExpire:e.timeouts.sessionIdleExpire})&&Rr(),!e.isEnabled()||e.isPaused())return t;if(dy(t))return delete t.breadcrumbs,t;if(!Pi(t)&&!Ys(t)&&!aa(t))return t;if(!e.checkAndHandleExpiredSession())return Rr(),t;if(aa(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),vy(e,t),t;if(Ey(t,n)&&!e.getOptions()._experiments.captureExceptions)return k&&R.log("Ignoring error from rrweb internals",t),null;const s=Ty(e,t);if((s||e.recordingMode==="session")&&(t.tags={...t.tags,replayId:e.getSessionId()}),s&&e.recordingMode==="buffer"&&((o=e.session)==null?void 0:o.sampled)==="buffer"){const c=e.session;c.dirty=!0,e.getOptions().stickySession&&Vr(c)}return t},{id:"Replay"})}function Yr(e,t){return t.map(({type:n,start:r,end:s,name:i,data:o})=>{const c=e.throttledAddEvent({type:L.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 wy(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 ky(e){return t=>{if(!e.isEnabled())return;const n=wy(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(Yr(e,[n]),!1)))}}function Ry(e,t){return k&&e.getOptions()._experiments.traceInternals?!1:ip(t,D())}function ju(e,t){e.isEnabled()&&t!==null&&(Ry(e,t.name)||e.addUpdate(()=>(Yr(e,[t]),!0)))}function Kr(e){if(!e)return;const t=new TextEncoder;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=ou(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function qu(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function Cr(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};const n={...e._meta},r=n.warnings||[];return n.warnings=[...r,t],e._meta=n,e}function Gu(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:{method:i,statusCode:o,request:c,response:a}}}function kn(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function at(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}=Cy(n);return r.body=s,i!=null&&i.length&&(r._meta={warnings:i}),r}function Ks(e,t){return Object.entries(e).reduce((n,[r,s])=>{const i=r.toLowerCase();return t.includes(i)&&e[r]&&(n[i]=s),n},{})}function Cy(e){if(!e||typeof e!="string")return{body:e};const t=e.length>Ho,n=My(e);if(t){const r=e.slice(0,Ho);return n?{body:r,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${r}…`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(e)}}catch{}return{body:e}}function My(e){const t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function Mr(e,t){const n=xy(e);return Ve(n,t)}function xy(e,t=ee.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(ee.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}async function Ay(e,t,n){try{const r=await Oy(e,t,n),s=Gu("resource.fetch",r);ju(n.replay,s)}catch(r){k&&R.exception(r,"Failed to capture fetch breadcrumb")}}function Ny(e,t){const{input:n,response:r}=t,s=n?cu(n):void 0,i=Kr(s),o=r?qu(r.headers.get("content-length")):void 0;i!==void 0&&(e.data.request_body_size=i),o!==void 0&&(e.data.response_body_size=o)}async function Oy(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r}=t,{url:o,method:c,status_code:a=0,request_body_size:u,response_body_size:l}=e.data,d=Mr(o,n.networkDetailAllowUrls)&&!Mr(o,n.networkDetailDenyUrls),f=d?Ly(n,t.input,u):kn(u),p=await Dy(d,n,t.response,l);return{startTimestamp:s,endTimestamp:i,url:o,method:c,statusCode:a,request:f,response:p}}function Ly({networkCaptureBodies:e,networkRequestHeaders:t},n,r){const s=n?By(n,t):{};if(!e)return at(s,r,void 0);const i=cu(n),[o,c]=au(i,R),a=at(s,r,o);return c?Cr(a,c):a}async function Dy(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,s){if(!e&&s!==void 0)return kn(s);const i=r?Vu(r.headers,n):{};if(!r||!t&&s!==void 0)return at(i,s,void 0);const[o,c]=await Fy(r),a=Py(o,{networkCaptureBodies:t,responseBodySize:s,captureDetails:e,headers:i});return c?Cr(a,c):a}function Py(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:s}){try{const i=e!=null&&e.length&&n===void 0?Kr(e):n;return r?t?at(s,i,e):at(s,i,void 0):kn(i)}catch(i){return k&&R.exception(i,"Failed to serialize response body"),at(s,n,void 0)}}async function Fy(e){const t=$y(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await Uy(t)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(k&&R.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(k&&R.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function Vu(e,t){const n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}function By(e,t){return e.length===1&&typeof e[0]!="string"?ca(e[0],t):e.length===2?ca(e[1],t):{}}function ca(e,t){if(!e)return{};const n=e.headers;return n?n instanceof Headers?Vu(n,t):Array.isArray(n)?{}:Ks(n,t):{}}function $y(e){try{return e.clone()}catch(t){k&&R.exception(t,"Failed to clone response body")}}function Uy(e){return new Promise((t,n)=>{const r=Wn(()=>n(new Error("Timeout while trying to read response body")),500);Hy(e).then(s=>t(s),s=>n(s)).finally(()=>clearTimeout(r))})}async function Hy(e){return await e.text()}async function Wy(e,t,n){try{const r=jy(e,t,n),s=Gu("resource.xhr",r);ju(n.replay,s)}catch(r){k&&R.exception(r,"Failed to capture xhr breadcrumb")}}function zy(e,t){const{xhr:n,input:r}=t;if(!n)return;const s=Kr(r),i=n.getResponseHeader("content-length")?qu(n.getResponseHeader("content-length")):Vy(n.response,n.responseType);s!==void 0&&(e.data.request_body_size=s),i!==void 0&&(e.data.response_body_size=i)}function jy(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r,input:o,xhr:c}=t,{url:a,method:u,status_code:l=0,request_body_size:d,response_body_size:f}=e.data;if(!a)return null;if(!c||!Mr(a,n.networkDetailAllowUrls)||Mr(a,n.networkDetailDenyUrls)){const A=kn(d),_=kn(f);return{startTimestamp:s,endTimestamp:i,url:a,method:u,statusCode:l,request:A,response:_}}const p=c[bt],h=p?Ks(p.request_headers,n.networkRequestHeaders):{},m=Ks(uu(c),n.networkResponseHeaders),[g,y]=n.networkCaptureBodies?au(o,R):[void 0],[T,O]=n.networkCaptureBodies?qy(c):[void 0],B=at(h,d,g),Y=at(m,f,T);return{startTimestamp:s,endTimestamp:i,url:a,method:u,statusCode:l,request:y?Cr(B,y):B,response:O?Cr(Y,O):Y}}function qy(e){const t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return Gy(e.response,e.responseType)}catch(n){t.push(n)}return k&&R.warn("Failed to get xhr response body",...t),[void 0]}function Gy(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 k&&R.exception(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return k&&R.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Vy(e,t){try{const n=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return Kr(n)}catch{return}}function Yy(e){const t=D();try{const{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:i,networkResponseHeaders:o}=e.getOptions(),c={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:i,networkResponseHeaders:o};t&&t.on("beforeAddBreadcrumb",(a,u)=>Ky(c,a,u))}catch{}}function Ky(e,t,n){if(t.data)try{Xy(t)&&Zy(n)&&(zy(t,n),Wy(t,n,e)),Jy(t)&&Qy(n)&&(Ny(t,n),Ay(t,n,e))}catch(r){k&&R.exception(r,"Error when enriching network breadcrumb")}}function Xy(e){return e.category==="xhr"}function Jy(e){return e.category==="fetch"}function Zy(e){return e==null?void 0:e.xhr}function Qy(e){return e==null?void 0:e.response}function eE(e){const t=D();ru(xS(e)),Wr(ky(e)),gy(e),Yy(e);const n=Iy(e);If(n),t&&(t.on("beforeSendEvent",hy(e)),t.on("afterSendEvent",ly(e)),t.on("createDsc",r=>{const s=e.getSessionId();s&&e.isEnabled()&&e.recordingMode==="session"&&e.checkAndHandleExpiredSession()&&(r.replay_id=s)}),t.on("spanStart",r=>{e.lastActiveSpan=r}),t.on("spanEnd",r=>{e.lastActiveSpan=r}),t.on("beforeSendFeedback",async(r,s)=>{var o;const i=e.getSessionId();s!=null&&s.includeReplay&&e.isEnabled()&&i&&((o=r.contexts)!=null&&o.feedback)&&(r.contexts.feedback.source==="api"&&await e.sendBufferedReplayOrFlush(),r.contexts.feedback.replay_id=i)}),t.on("openFeedbackWidget",async()=>{await e.sendBufferedReplayOrFlush()}))}async function tE(e){try{return Promise.all(Yr(e,[nE(ee.performance.memory)]))}catch{return[]}}function nE(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 rE(e,t,n){return fp(e,t,{...n,setTimeoutImpl:Wn})}const Me=$.navigator;function sE(){return/iPhone|iPad|iPod/i.test((Me==null?void 0:Me.userAgent)??"")||/Macintosh/i.test((Me==null?void 0:Me.userAgent)??"")&&(Me!=null&&Me.maxTouchPoints)&&(Me==null?void 0:Me.maxTouchPoints)>1?{sampling:{mousemove:!1}}:{}}function iE(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){k&&R.warn("Received replay event after session expired.");return}const s=r||!t;t=!0,oE(n),e.clickDetector&&wS(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&s&&e.setInitialState(),!Di(e,n,s))return!0;if(!s)return!1;const i=e.session;if(cE(e,s),e.recordingMode==="buffer"&&i&&e.eventBuffer&&!i.dirty){const o=e.eventBuffer.getEarliestTimestamp();o&&(k&&R.log(`Updating session start time to earliest event in buffer to ${new Date(o)}`),i.started=o,e.getOptions().stickySession&&Vr(i))}return i!=null&&i.previousSessionId||e.recordingMode==="session"&&e.flush(),!0})}}function oE(e){const t=e.data;if(!(e.type!==L.IncrementalSnapshot||!t||typeof t!="object"||!("source"in t)||t.source!==M.Mutation||!("attributes"in t)||!Array.isArray(t.attributes)))for(const n of t.attributes){const r=Pe.mirror.getNode(n.id),s=r&&Pe.mirror.getMeta(r);if((s==null?void 0:s.type)===Gr.Element)for(const[i,o]of Object.entries(n.attributes))o===null?delete s.attributes[i]:s.attributes[i]=o}}function aE(e){const t=e.getOptions();return{type:L.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 cE(e,t){var n;!t||((n=e.session)==null?void 0:n.segmentId)!==0||Di(e,aE(e),!1)}function uE(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function dE(e,t,n,r){return mt(cc(e,ai(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function lE({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}async function fE({client:e,scope:t,replayId:n,event:r}){const s=typeof e._integrations=="object"&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0,i={event_id:n,integrations:s};e.emit("preprocessEvent",r,i);const o=await hc(e.getOptions(),r,i,t,e,ve());if(!o)return null;e.emit("postprocessEvent",o,i),o.platform=o.platform||"javascript";const c=e.getSdkMetadata(),{name:a,version:u,settings:l}=(c==null?void 0:c.sdk)||{};return o.sdk={...o.sdk,name:a||"sentry.javascript.unknown",version:u||"0.0.0",settings:l},o}async function pE({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:s,session:i}){const o=lE({recordingData:e,headers:{segment_id:n}}),{urls:c,errorIds:a,traceIds:u,initialTimestamp:l}=r,d=D(),f=G(),p=d==null?void 0:d.getTransport(),h=d==null?void 0:d.getDsn();if(!d||!p||!h||!i.sampled)return Promise.resolve({});const m={type:Hg,replay_start_timestamp:l/1e3,timestamp:s/1e3,error_ids:a,trace_ids:u,urls:c,replay_id:t,segment_id:n,replay_type:i.sampled},g=await fE({scope:f,client:d,replayId:t,event:m});if(!g)return d.recordDroppedEvent("event_processor","replay"),k&&R.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete g.sdkProcessingMetadata;const y=dE(g,o,h,d.getOptions().tunnel);let T;try{T=await p.send(y)}catch(B){const Y=new Error(Ti);try{Y.cause=B}catch{}throw Y}const O=kc({},T);if(wc(O,"replay"))throw new Fi(O);if(typeof T.statusCode=="number"&&(T.statusCode<200||T.statusCode>=300))throw new Yu(T.statusCode);return T}class Yu extends Error{constructor(t){super(`Transport returned status code ${t}`)}}class Fi extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}}class ua extends Error{constructor(){super("Session is too long, not sending replay")}}async function Ku(e,t={count:0,interval:Vg}){const{recordingData:n,onError:r}=e;if(n.length)try{return await pE(e),!0}catch(s){if(s instanceof Yu||s instanceof Fi)throw s;if(_c("Replays",{_retryCount:t.count}),r&&r(s),t.count>=Yg){const i=new Error(`${Ti} - max retries exceeded`);try{i.cause=s}catch{}throw i}return t.interval*=++t.count,new Promise((i,o)=>{Wn(async()=>{try{await Ku(e,t),i(!0)}catch(c){o(c)}},t.interval)})}}const Xu="__THROTTLED",hE="__SKIPPED";function mE(e,t,n){const r=new Map,s=c=>{const a=c-n;r.forEach((u,l)=>{l<a&&r.delete(l)})},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 l=o;return o=!0,l?hE:Xu}o=!1;const u=r.get(a)||0;return r.set(a,u+1),e(...c)}}class gE{constructor({options:t,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:Wg,sessionIdleExpire:zg},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!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=rE(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=mE((o,c)=>cy(this,o,c),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:s}=this.getOptions(),i=r?{threshold:Math.min(Kg,r),timeout:r,scrollTimeout:Xg,ignoreSelector:s?s.join(","):""}:void 0;if(i&&(this.clickDetector=new bS(this,i)),k){const o=t._experiments;R.setConfig({captureExceptions:!!o.captureExceptions,traceInternals:!!o.traceInternals})}this._handleVisibilityChange=()=>{ee.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{const o=Ue({category:"ui.blur"});this._doChangeToBackgroundTasks(o)},this._handleWindowFocus=()=>{const o=Ue({category:"ui.focus"});this._doChangeToForegroundTasks(o)},this._handleKeyboardEvent=o=>{LS(this,o)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(t){k&&R.exception(t),this._options.onError&&this._options.onError(t)}initializeSampling(t){const{errorSampleRate:n,sessionSampleRate:r}=this._options,s=n<=0&&r<=0;if(this._requiresManualStart=s,!s){if(this._initializeSessionForSampling(t),!this.session){k&&R.exception(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",k&&R.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){k&&R.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){k&&R.log("Buffering is in progress, call `flush()` to save the replay");return}k&&R.infoTick("Starting replay in session mode"),this._updateUserActivity();const t=Ss({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=t,this.recordingMode="session",this._initializeRecording()}startBuffering(){if(this._isEnabled){k&&R.log("Buffering is in progress, call `flush()` to save the replay");return}k&&R.infoTick("Starting replay in buffer mode");const t=Ss({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=t,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const t=this._canvas;this._stopRecording=Pe({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:Gg}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:iE(this),...sE(),onMutation:this._onMutationHandler.bind(this),...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}}async stop({forceFlush:t=!1,reason:n}={}){var s,i,o;if(!this._isEnabled)return;this._isEnabled=!1,this.recordingMode="buffer";const r=n??"manual";(i=D())==null||i.emit("replayEnd",{sessionId:(s=this.session)==null?void 0:s.id,reason:r});try{k&&R.log(`Stopping Replay triggered by ${r}`),Rr(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),(o=this.eventBuffer)==null||o.destroy(),this.eventBuffer=null,ny(this)}catch(c){this.handleException(c)}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),k&&R.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),k&&R.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();k&&R.log("Converting buffer to session"),await this.flushImmediate();const r=this.stopRecording();!t||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this.session.dirty=!1,this._updateUserActivity(n),this._updateSessionActivity(n),this._maybeSaveSession()),this.startRecording())}addUpdate(t){const n=t();this.recordingMode==="buffer"||!this._isEnabled||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(t){var n,r;if(!(t&&((n=this.session)==null?void 0:n.sampled)===!1))return(r=this.session)==null?void 0:r.id}checkAndHandleExpiredSession(){var t;if(this._lastActivity&&Vs(this._lastActivity,this.timeouts.sessionIdlePause)&&((t=this.session)==null?void 0:t.sampled)==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const t=`${ee.location.pathname}${ee.location.hash}${ee.location.search}`,n=`${ee.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===Xu){const s=Ue({category:"replay.throttled"});this.addUpdate(()=>!Di(this,{type:hS,timestamp:s.timestamp||0,data:{tag:"breadcrumb",payload:s,metric:!0}}))}return r}getCurrentRoute(){const t=this.lastActiveSpan||he(),n=t&&le(t),s=(n&&q(n).data||{})[$e];if(!(!n||!s||!["route","custom"].includes(s)))return q(n).description}_initializeRecording(){var t;this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=QS({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.session&&((t=D())==null||t.emit("replayStart",{sessionId:this.session.id,recordingMode:this.recordingMode})),this.startRecording(),this.recordingMode==="session"&&this.session&&by(this.session.id)}_initializeSessionForSampling(t){const n=this._options.errorSampleRate>0,r=Ss({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,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 kr(t,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(t),!1):!0}async _refreshSession(t){this._isEnabled&&(await this.stop({reason:"sessionExpired"}),this.initializeSampling(t.id))}_addListeners(){try{ee.document.addEventListener("visibilitychange",this._handleVisibilityChange),ee.addEventListener("blur",this._handleWindowBlur),ee.addEventListener("focus",this._handleWindowFocus),ee.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(eE(this),this._hasInitializedCoreListeners=!0)}catch(t){this.handleException(t)}this._performanceCleanupCallback=VS(this)}_removeListeners(){try{ee.document.removeEventListener("visibilitychange",this._handleVisibilityChange),ee.removeEventListener("blur",this._handleWindowBlur),ee.removeEventListener("focus",this._handleWindowFocus),ee.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this.handleException(t)}}_doChangeToBackgroundTasks(t){if(!this.session)return;if(kr(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})){Rr();return}t&&this._createCustomBreadcrumb(t),this.conditionalFlush()}_doChangeToForegroundTasks(t){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){k&&R.log("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:L.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){let t=BS(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){const n=this._context.initialTimestamp/1e3;t=t.filter(r=>r.start>=n)}return Promise.all(Yr(this,t))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:t,eventBuffer:n}=this;if(!t||!n||this._requiresManualStart||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}async _runFlush(){var n;const t=this.getSessionId();if(!this.session||!this.eventBuffer||!t){k&&R.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!!((n=this.eventBuffer)!=null&&n.hasEvents)&&(await tE(this),!!this.eventBuffer&&t===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const r=Date.now();if(r-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new ua;const s=this._popEventContext(),i=this.session.segmentId++;this._maybeSaveSession();const o=await this.eventBuffer.finish();await Ku({replayId:t,recordingData:o,segmentId:i,eventContext:s,session:this.session,timestamp:r,onError:c=>this.handleException(c)})}catch(r){this.handleException(r),this.stop({reason:"sendError"});const s=D();if(s){let i;r instanceof Fi?i="ratelimit_backoff":r instanceof ua?i="invalid":i="send_error",s.recordDroppedEvent(i,"replay")}}}async _flush({force:t=!1}={}){if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){k&&R.error("Attempting to finish replay event after session expired.");return}if(!this.session)return;const n=this.session.started,s=Date.now()-n;this._debouncedFlush.cancel();const i=s<this._options.minReplayDuration,o=s>this._options.maxReplayDuration+5e3;if(i||o){k&&R.log(`Session duration (${Math.floor(s/1e3)}s) is too ${i?"short":"long"}, not sending replay.`),i&&this._debouncedFlush();return}const c=this.eventBuffer;c&&this.session.segmentId===0&&!c.hasCheckout&&k&&R.log("Flushing initial segment without checkout.");const a=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(u){this.handleException(u)}finally{this._flushLock=void 0,a&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&Vr(this.session)}_onMutationHandler(t){const{ignoreMutations:n}=this._options._experiments;if(n!=null&&n.length&&t.some(c=>{const a=uE(c.target),u=n.join(",");return a==null?void 0:a.matches(u)}))return!1;const r=t.length,s=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,o=s&&r>s;if(r>i||o){const c=Ue({category:"replay.mutations",data:{count:r,limit:o}});this._createCustomBreadcrumb(c)}return o?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}function an(e,t){return[...e,...t].join(",")}function _E({mask:e,unmask:t,block:n,unblock:r,ignore:s}){const i=["base","iframe[srcdoc]:not([src])"],o=an(e,[".sentry-mask","[data-sentry-mask]"]),c=an(t,[]);return{maskTextSelector:o,unmaskTextSelector:c,blockSelector:an(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:an(r,[]),ignoreSelector:an(s,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function SE({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:s,value:i}){if(s.unmaskTextSelector&&e.matches(s.unmaskTextSelector))return i;const o=n.includes(t),c=r&&t==="value"&&e.tagName==="INPUT"&&["submit","button"].includes(e.getAttribute("type")||"");return o||c?i.replace(/[\S]/g,"*"):i}const da='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',yE=["content-length","content-type","accept"],EE=Symbol.for("sentry__originalRequestBody");let la=!1,fa=!1;function bE(){if(typeof Request>"u"||fa)return;const e=Request;try{const t=function(n,r){const s=new e(n,r);return(r==null?void 0:r.body)!=null&&(s[EE]=r.body),s};t.prototype=e.prototype,$.Request=t,fa=!0}catch{}}const JE=e=>new vE(e);class vE{constructor({flushMinDelay:t=jg,flushMaxDelay:n=qg,minReplayDuration:r=Jg,maxReplayDuration:s=Wo,stickySession:i=!0,useCompression:o=!0,workerUrl:c,_experiments:a={},maskAllText:u=!0,maskAllInputs:l=!0,blockAllMedia:d=!0,mutationBreadcrumbLimit:f=750,mutationLimit:p=1e4,slowClickTimeout:h=7e3,slowClickIgnoreSelectors:m=[],networkDetailAllowUrls:g=[],networkDetailDenyUrls:y=[],networkCaptureBodies:T=!0,networkRequestHeaders:O=[],networkResponseHeaders:B=[],mask:Y=[],maskAttributes:A=["title","placeholder","aria-label"],unmask:_=[],block:I=[],unblock:te=[],ignore:b=[],maskFn:w,beforeAddRecordingEvent:H,beforeErrorSampling:z,onError:N,attachRawBodyFromRequest:oe=!1}={}){this.name="Replay";const J=_E({mask:Y,unmask:_,block:I,unblock:te,ignore:b});if(this._recordingOptions={maskAllInputs:l,maskAllText:u,maskInputOptions:{password:!0},maskTextFn:w,maskInputFn:w,maskAttributeFn:(Z,E,j)=>SE({maskAttributes:A,maskAllText:u,privacyOptions:J,key:Z,value:E,el:j}),...J,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:Z=>{try{Z.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!a.recordCrossOriginIframes},this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,Zg),maxReplayDuration:Math.min(s,Wo),stickySession:i,useCompression:o,workerUrl:c,blockAllMedia:d,maskAllInputs:l,maskAllText:u,mutationBreadcrumbLimit:f,mutationLimit:p,slowClickTimeout:h,slowClickIgnoreSelectors:m,networkDetailAllowUrls:g,networkDetailDenyUrls:y,networkCaptureBodies:T,networkRequestHeaders:pa(O),networkResponseHeaders:pa(B),beforeAddRecordingEvent:H,beforeErrorSampling:z,onError:N,attachRawBodyFromRequest:oe,_experiments:a},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${da}`:da,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&En())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return la}set _isInitialized(t){la=t}afterAllSetup(t){!En()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&bE(),this._setup(t),this._initialize(t))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:this._replay.recordingMode==="session",reason:"manual"}):Promise.resolve()}flush(t){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(t):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(t){var n;if((n=this._replay)!=null&&n.isEnabled())return this._replay.getSessionId(t)}getRecordingMode(){var t;if((t=this._replay)!=null&&t.isEnabled())return this._replay.recordingMode}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){const n=TE(this._initialOptions,t);this._replay=new gE({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{const n=t.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}}function TE(e,t){const n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},s=Rt(n.replaysSessionSampleRate),i=Rt(n.replaysOnErrorSampleRate);return s==null&&i==null&&dt(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),s!=null&&(r.sessionSampleRate=s),i!=null&&(r.errorSampleRate=i),r}function pa(e){return[...yE,...e.map(t=>t.toLowerCase())]}function IE(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function Ju(e){try{return new URL(e,P.location.origin).href}catch{return}}function wE(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function Zu(e){try{return new Headers(e)}catch{return}}const ha=new WeakMap,ys=new Map,Qu={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function kE(e,t){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:s,shouldCreateSpanForRequest:i,enableHTTPTimings:o,tracePropagationTargets:c,onRequestSpanStart:a,onRequestSpanEnd:u}={...Qu,...t},l=typeof i=="function"?i:h=>!0,d=h=>CE(h,c),f={},p=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(h=>(h.type==="transaction"&&h.spans&&h.spans.forEach(m=>{if(m.op==="http.client"){const g=ys.get(m.span_id);g&&(m.timestamp=g/1e3,ys.delete(m.span_id))}}),h)),s&&Xp(h=>{if(h.response){const m=ha.get(h.response);m&&h.endTimestamp&&ys.set(m,h.endTimestamp)}}),Uc(h=>{const m=Up(h,l,d,f,{propagateTraceparent:p,onRequestSpanEnd:u});if(h.response&&h.fetchData.__span&&ha.set(h.response,h.fetchData.__span),m){const g=Ju(h.fetchData.url),y=g?wt(g).host:void 0;m.setAttributes({"http.url":g?it(g):void 0,"server.address":y}),o&&ma(m,e),a==null||a(m,{headers:h.headers})}})),r&&iu(h=>{var g;const m=ME(h,l,d,f,p,u);m&&(o&&ma(m,e),a==null||a(m,{headers:Zu((g=h.xhr.__sentry_xhr_v3__)==null?void 0:g.request_headers)}))})}const RE=300;function ma(e,t){const{url:n}=q(e).data;if(!n||typeof n!="string")return;let r=()=>void setTimeout(s);if(Qe(t)){const i=e.end.bind(e);e.end=o=>{const c=o??ae();let a=!1;const u=()=>{a||(a=!0,setTimeout(s),i(c),clearTimeout(l))};r=u;const l=setTimeout(u,RE)}}const s=Vt("resource",({entries:i})=>{i.forEach(o=>{wE(o)&&o.name.endsWith(n)&&(e.setAttributes(tu(o)),r())})})}function CE(e,t){const n=Qt();if(n){let r,s;try{r=new URL(e,n),s=new URL(n).origin}catch{return!1}const i=r.origin===s;return t?Ve(r.toString(),t)||i&&Ve(r.pathname,t):i}else{const r=!!e.match(/^\/(?!\/)/);return t?Ve(e,t):r}}function ME(e,t,n,r,s,i){const o=e.xhr,c=o==null?void 0:o[bt];if(!o||o.__sentry_own_request__||!c)return;const{url:a,method:u}=c,l=De()&&t(a);if(e.endTimestamp){const T=o.__sentry_xhr_span_id__;if(!T)return;const O=r[T];O&&(l&&c.status_code!==void 0&&(Ba(O,c.status_code),O.end(),i==null||i(O,{headers:Zu(uu(o)),error:e.error})),delete r[T]);return}const d=Ju(a),f=wt(d||a),p=it(df(a)),h=D(),g=!!he()||!!h&&Qe(h),y=l&&g?xt({name:`${u} ${p}`,attributes:{url:it(a),type:"xhr","http.method":u,"http.url":d?it(d):void 0,"server.address":f==null?void 0:f.host,[ue]:"auto.http.browser",[Fe]:"http.client",...(f==null?void 0:f.search)&&{"http.query":f==null?void 0:f.search},...(f==null?void 0:f.hash)&&{"http.fragment":f==null?void 0:f.hash}}}):new He;return l&&!g&&(h==null||h.recordDroppedEvent("no_parent_span","span")),o.__sentry_xhr_span_id__=y.spanContext().spanId,r[o.__sentry_xhr_span_id__]=y,n(a)&&xE(o,De()&&g?y:void 0,s),h&&h.emit("beforeOutgoingRequestSpan",y,e),y}function xE(e,t,n){const{"sentry-trace":r,baggage:s,traceparent:i}=Lc({span:t,propagateTraceparent:n});r&&AE(e,r,s,i)}function AE(e,t,n,r){var i;const s=(i=e.__sentry_xhr_v3__)==null?void 0:i.request_headers;if(!(s!=null&&s["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),r&&!(s!=null&&s.traceparent)&&e.setRequestHeader("traceparent",r),n){const o=s==null?void 0:s.baggage;(!o||!IE(o))&&e.setRequestHeader("baggage",n)}}catch{}}function NE(){P.document?P.document.addEventListener("visibilitychange",()=>{const e=he();if(!e)return;const t=le(e);if(P.document.hidden&&t){const n="cancelled",{op:r,status:s}=q(t);ke&&S.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),s||t.setStatus({code:de,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):ke&&S.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const OE=3600,ed="sentry_previous_trace",LE="sentry.previous_trace";function DE(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const r=t==="session-storage";let s=r?BE():void 0;e.on("spanStart",o=>{if(le(o)!==o)return;const c=G().getPropagationContext();s=PE(s,o,c),r&&FE(s)});let i=!0;n&&e.on("beforeSampling",o=>{if(!s)return;const c=G(),a=c.getPropagationContext();if(i&&a.parentSpanId){i=!1;return}c.setPropagationContext({...a,dsc:{...a.dsc,sample_rate:String(s.sampleRate),sampled:String(Xs(s.spanContext))},sampleRand:s.sampleRand}),o.parentSampled=Xs(s.spanContext),o.parentSampleRate=s.sampleRate,o.spanAttributes={...o.spanAttributes,[Pa]:s.sampleRate}})}function PE(e,t,n){const r=q(t);function s(){var c,a;try{return Number((c=n.dsc)==null?void 0:c.sample_rate)??Number((a=r.data)==null?void 0:a[si])}catch{return 0}}const i={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:s(),sampleRand:n.sampleRand};if(!e)return i;const o=e.spanContext;return o.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=OE&&(ke&&S.log(`Adding previous_trace \`${JSON.stringify(o)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:o,attributes:{[Wd]:"previous_trace"}}),t.setAttribute(LE,`${o.traceId}-${o.spanId}-${Xs(o)?1:0}`)),i)}function FE(e){try{P.sessionStorage.setItem(ed,JSON.stringify(e))}catch(t){ke&&S.warn("Could not store previous trace in sessionStorage",t)}}function BE(){var e;try{const t=(e=P.sessionStorage)==null?void 0:e.getItem(ed);return JSON.parse(t)}catch{return}}function Xs(e){return e.traceFlags===1}const $E="BrowserTracing",UE=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function HE(){const e=P.navigator;return e!=null&&e.userAgent?UE.test(e.userAgent):!1}const WE={...sr,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...Qu},ZE=(e={})=>{"enableElementTiming"in e&&dt(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});const t={name:void 0,source:void 0},n=P.document,{enableInp:r,enableLongTask:s,enableLongAnimationFrame:i,_experiments:{enableInteractions:o,enableStandaloneClsSpans:c,enableStandaloneLcpSpans:a},beforeStartSpan:u,idleTimeout:l,finalTimeout:d,childSpanTimeout:f,markBackgroundSpan:p,traceFetch:h,traceXHR:m,trackFetchStreamPerformance:g,shouldCreateSpanForRequest:y,enableHTTPTimings:T,ignoreResourceSpans:O,ignorePerformanceApiSpans:B,instrumentPageLoad:Y,instrumentNavigation:A,detectRedirects:_,linkPreviousTrace:I,consistentTraceSampling:te,enableReportPageLoaded:b,onRequestSpanStart:w,onRequestSpanEnd:H}={...WE,...e},z=HE();let N,oe,J;function Z(E,j,x=!0){const ne=j.op==="pageload",F=j.name,X=u?u(j):j,pe=X.attributes||{};if(F!==X.name&&(pe[$e]="custom",X.attributes=pe),!x){const Te=Mt();xt({...X,startTime:Te}).end(Te);return}t.name=X.name,t.source=pe[$e];const Ae=lc(X,{idleTimeout:l,finalTimeout:d,childSpanTimeout:f,disableAutoFinish:ne,beforeSpanEnd:Te=>{N==null||N();const gt=Qe(E);rm(Te,{recordClsOnPageloadSpan:!gt&&!c,recordLcpOnPageloadSpan:!gt&&!a,ignoreResourceSpans:O,ignorePerformanceApiSpans:B,spanStreamingEnabled:gt}),Sa(E,void 0);const sn=G(),_t=sn.getPropagationContext();sn.setPropagationContext({..._t,traceId:Ae.spanContext().traceId,sampled:ht(Ae),dsc:ze(Te)}),ne&&(J=void 0)},trimIdleSpanEndTimestamp:!b});ne&&b&&(J=Ae),Sa(E,Ae);function et(){n&&["interactive","complete"].includes(n.readyState)&&E.emit("idleSpanEnableAutoFinish",Ae)}ne&&!b&&n&&(n.addEventListener("readystatechange",()=>{et()}),et())}return{name:$E,setup(E){var ne;if(z){ke&&S.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}hl();const j=Qe(E);if(N=Xh({recordClsStandaloneSpans:j?void 0:c||!1,recordLcpStandaloneSpans:j?void 0:a||!1,client:E}),j?(Em(E),vm(E),r&&Im()):r&&mm(),i&&$.PerformanceObserver&&((ne=PerformanceObserver.supportedEntryTypes)!=null&&ne.includes("long-animation-frame"))?Zh():s&&Jh(),o&&Qh(),_&&n){const F=()=>{oe=ae()};addEventListener("click",F,{capture:!0}),addEventListener("keydown",F,{capture:!0,passive:!0})}function x(){const F=Rn(E);F&&!q(F).timestamp&&(ke&&S.log(`[Tracing] Finishing current active span with op: ${q(F).op}`),F.setAttribute(_n,"cancelled"),F.end())}E.on("startNavigationSpan",(F,X)=>{if(D()!==E)return;if(X!=null&&X.isRedirect){ke&&S.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),Z(E,{op:"navigation.redirect",...F},!1);return}oe=void 0,x(),ve().setPropagationContext({traceId:Ze(),sampleRand:Math.random(),propagationSpanId:De()?void 0:Ye()});const pe=G();pe.setPropagationContext({traceId:Ze(),sampleRand:Math.random(),propagationSpanId:De()?void 0:Ye()}),pe.setSDKProcessingMetadata({normalizedRequest:void 0}),Z(E,{op:"navigation",...F,parentSpan:null,forceTransaction:!0})}),E.on("startPageLoadSpan",(F,X={})=>{if(D()!==E)return;x();const pe=X.sentryTrace||ga("sentry-trace")||_a("sentry-trace"),Ae=X.baggage||ga("baggage")||_a("baggage"),et=al(pe,Ae),Te=G();Te.setPropagationContext(et),De()||(Te.getPropagationContext().propagationSpanId=Ye()),Te.setSDKProcessingMetadata({normalizedRequest:mr()}),Z(E,{op:"pageload",...F})}),E.on("endPageloadSpan",()=>{b&&J&&(J.setAttribute(_n,"reportPageLoaded"),J.end())})},afterAllSetup(E){if(z)return;let j=Qt();if(I!=="off"&&DE(E,{linkPreviousTrace:I,consistentTraceSampling:te}),P.location){if(Y){const x=fe();zE(E,{name:P.location.pathname,startTime:x?x/1e3:void 0,attributes:{[$e]:"url",[ue]:"auto.pageload.browser"}})}A&&Wr(({to:x,from:ne})=>{if(ne===void 0&&(j==null?void 0:j.indexOf(x))!==-1){j=void 0;return}j=void 0;const F=di(x),X=Rn(E),pe=X&&_&&GE(X,oe);jE(E,{name:(F==null?void 0:F.pathname)||P.location.pathname,attributes:{[$e]:"url",[ue]:"auto.navigation.browser"}},{url:x,isRedirect:pe})})}p&&NE(),o&&qE(E,l,d,f,t),r&&ym(),kE(E,{traceFetch:h,traceXHR:m,trackFetchStreamPerformance:g,tracePropagationTargets:E.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:y,enableHTTPTimings:T,onRequestSpanStart:w,onRequestSpanEnd:H})}}};function zE(e,t,n){e.emit("startPageLoadSpan",t,n),G().setTransactionName(t.name);const r=Rn(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function jE(e,t,n){const{url:r,isRedirect:s}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:s}),e.emit("startNavigationSpan",t,{isRedirect:s});const i=G();return i.setTransactionName(t.name),r&&!s&&i.setSDKProcessingMetadata({normalizedRequest:{...mr(),url:r}}),Rn(e)}function ga(e){const t=P.document,n=t==null?void 0:t.querySelector(`meta[name=${e}]`);return(n==null?void 0:n.getAttribute("content"))||void 0}function _a(e){var r,s,i;const t=(s=(r=P.performance)==null?void 0:r.getEntriesByType)==null?void 0:s.call(r,"navigation")[0],n=(i=t==null?void 0:t.serverTiming)==null?void 0:i.find(o=>o.name===e);return n==null?void 0:n.description}function qE(e,t,n,r,s){const i=P.document;let o;const c=()=>{const a="ui.action.click",u=Rn(e);if(u){const l=q(u).op;if(["navigation","pageload"].includes(l)){ke&&S.warn(`[Tracing] Did not create ${a} span because a pageload or navigation span is in progress.`);return}}if(o&&(o.setAttribute(_n,"interactionInterrupted"),o.end(),o=void 0),!s.name){ke&&S.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}o=lc({name:s.name,op:a,attributes:{[$e]:s.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",c,{capture:!0})}const td="_sentry_idleSpan";function Rn(e){return e[td]}function Sa(e,t){be(e,td,t)}const ya=1.5;function GE(e,t){const n=q(e),r=Mt(),s=n.start_timestamp;return!(r-s>ya||t&&r-t<=ya)}function QE(e){const t={...e};return Oc(t,"react"),_c("react",{version:sd.version}),Ug(t)}export{ph as BrowserClient,Tt as SDK_VERSION,Fe as SEMANTIC_ATTRIBUTE_SENTRY_OP,ue as SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,si as SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,$e as SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,We as Scope,P as WINDOW,ct as addBreadcrumb,If as addEventProcessor,tg as breadcrumbsIntegration,fg as browserApiErrorsIntegration,Sg as browserSessionIntegration,ZE as browserTracingIntegration,gc as captureEvent,mc as captureException,YE as captureMessage,os as captureSession,Gm as chromeStackLineParser,Gf as createTransport,bg as cultureContextIntegration,Op as dedupeIntegration,Qu as defaultRequestInstrumentationOptions,Jm as defaultStackLineParsers,Zm as defaultStackParser,Sc as endSession,yp as eventFiltersIntegration,ch as eventFromException,uh as eventFromMessage,hi as exceptionFromError,gp as functionToStringIntegration,Xm as geckoStackLineParser,he as getActiveSpan,D as getClient,G as getCurrentScope,$g as getDefaultIntegrations,Ud as getGlobalScope,ve as getIsolationScope,le as getRootSpan,nr as getSpanDescendants,jd as getSpanStatusFromHttpCode,Lc as getTraceData,Ig as globalHandlersIntegration,Ag as httpContextIntegration,Ep as inboundFiltersIntegration,QE as init,kE as instrumentOutgoingRequests,HE as isBotUserAgent,Tf as isEnabled,Pg as linkedErrorsIntegration,Bm as makeFetchTransport,hl as registerSpanErrorInstrumentation,JE as replayIntegration,_c as setContext,sp as setCurrentClient,Ba as setHttpStatus,Ul as setMeasurement,KE as setTag,XE as setUser,q as spanToJSON,ll as spanToTraceHeader,jE as startBrowserTracingNavigationSpan,zE as startBrowserTracingPageLoadSpan,xt as startInactiveSpan,mo as startSession,uc as withActiveSpan,ri as withScope};