@lookit/lookit-initjspsych
Version:
This package overloads jsPsych's init function.
26 lines • 291 kB
JavaScript
var Tv=Object.defineProperty,wv=Object.defineProperties;var kv=Object.getOwnPropertyDescriptors;var bs=Object.getOwnPropertySymbols;var Kl=Object.prototype.hasOwnProperty,Xl=Object.prototype.propertyIsEnumerable;var Yl=(dt,ct,ft)=>ct in dt?Tv(dt,ct,{enumerable:!0,configurable:!0,writable:!0,value:ft}):dt[ct]=ft,h=(dt,ct)=>{for(var ft in ct||(ct={}))Kl.call(ct,ft)&&Yl(dt,ft,ct[ft]);if(bs)for(var ft of bs(ct))Xl.call(ct,ft)&&Yl(dt,ft,ct[ft]);return dt},R=(dt,ct)=>wv(dt,kv(ct));var po=(dt,ct)=>{var ft={};for(var Mt in dt)Kl.call(dt,Mt)&&ct.indexOf(Mt)<0&&(ft[Mt]=dt[Mt]);if(dt!=null&&bs)for(var Mt of bs(dt))ct.indexOf(Mt)<0&&Xl.call(dt,Mt)&&(ft[Mt]=dt[Mt]);return ft};var X=(dt,ct,ft)=>new Promise((Mt,ur)=>{var vs=I=>{try{Ge(ft.next(I))}catch($){ur($)}},lr=I=>{try{Ge(ft.throw(I))}catch($){ur($)}},Ge=I=>I.done?Mt(I.value):Promise.resolve(I.value).then(vs,lr);Ge((ft=ft.apply(dt,ct)).next())});var chsInitJsPsych=function(dt,ct,ft){var Gl;"use strict";function Mt(t){var e=Object.create(null);return t&&Object.keys(t).forEach(function(n){if(n!=="default"){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,Object.freeze(e)}var ur=Mt(dt);class vs extends Error{constructor(e){super(`A trial object in the timeline has an undefined type. Maybe the type name is misspelled, or the plugin you want to use is not supported. Object: ${JSON.stringify(e)}.`)}}class lr extends Error{constructor(e){super(`An element in the timeline is not structured correctly or is missing required information. It may be a timeline node with a timeline array that is the wrong type or missing/undefined, or a trial object with a missing type. Element: ${JSON.stringify(e)}`)}}class Ge extends Error{constructor(){super("No jsPsych instance available for on_data_update."),this.name="NoJsPsychInstanceError"}}const I=typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__,$=globalThis,ke="10.73.0";function ce(){return In($),$}function In(t){const e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||ke,e[ke]=e[ke]||{}}function Ve(t,e,n=$){const r=n.__SENTRY__=n.__SENTRY__||{},s=r[ke]=r[ke]||{};return s[t]||(s[t]=e())}const Jl=["debug","info","warn","error","log","assert","trace"],Ql="Sentry Logger ",dr={};function ue(t){if(!("console"in $))return t();const e=$.console,n={},r=Object.keys(dr);r.forEach(s=>{const i=dr[s];n[s]=e[s],e[s]=i});try{return t()}finally{r.forEach(s=>{e[s]=n[s]})}}function Zl(){Ts().enabled=!0}function td(){Ts().enabled=!1}function ho(){return Ts().enabled}function ed(...t){Is("log",...t)}function nd(...t){Is("warn",...t)}function rd(...t){Is("error",...t)}function Is(t,...e){!I||ho()&&ue(()=>{$.console[t](`${Ql}[${t}]:`,...e)})}function Ts(){return I?Ve("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const S={enable:Zl,disable:td,isEnabled:ho,log:ed,warn:nd,error:rd},mo=50,Re="?",go=/\(error: (.*)\)/,_o=/captureMessage|captureException/;function yo(...t){const e=t.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=go.test(a)?a.replace(go,"$1"):a;if(!u.includes("Error: ")){for(const l of e){const d=l(u);if(d){i.push(d);break}}if(i.length>=mo+s)break}}return id(i.slice(s))}}function sd(t){return Array.isArray(t)?yo(...t):t}function id(t){if(!t.length)return[];const e=Array.from(t);return/sentryWrapped/.test(fr(e).function||"")&&e.pop(),e.reverse(),_o.test(fr(e).function||"")&&(e.pop(),_o.test(fr(e).function||"")&&e.pop()),e.slice(0,mo).map(n=>R(h({},n),{filename:n.filename||fr(e).filename,function:n.function||Re}))}function fr(t){return t[t.length-1]||{}}const ws="<anonymous>";function Jt(t){try{return!t||typeof t!="function"?ws:t.name||ws}catch(e){return ws}}function So(t){const e=t.exception;if(e){const n=[];try{return e.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch(r){return}}}const Tn={},Eo={};function le(t,e){return Tn[t]=Tn[t]||[],Tn[t].push(e),()=>{const n=Tn[t];if(n){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}}}function de(t,e){if(!Eo[t]){Eo[t]=!0;try{e()}catch(n){I&&S.error(`Error while instrumenting ${t}`,n)}}}function Pt(t,e){const n=t&&Tn[t];if(!!n)for(const r of n)try{r(e)}catch(s){I&&S.error(`Error while triggering instrumentation handler.
Type: ${t}
Name: ${Jt(r)}
Error:`,s)}}let ks=null;function bo(t){const e="error";le(e,t),de(e,od)}function od(){ks=$.onerror,$.onerror=function(t,e,n,r,s){return Pt("error",{column:r,error:s,line:n,msg:t,url:e}),ks?ks.apply(this,arguments):!1},$.onerror.__SENTRY_INSTRUMENTED__=!0}let Rs=null;function vo(t){const e="unhandledrejection";le(e,t),de(e,ad)}function ad(){Rs=$.onunhandledrejection,$.onunhandledrejection=function(t){return Pt("unhandledrejection",t),Rs?Rs.apply(this,arguments):!0},$.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Io=Object.prototype.toString;function Qt(t){switch(Io.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return mr(t,Error)}}function Ye(t,e){return Io.call(t)===`[object ${e}]`}function To(t){return Ye(t,"ErrorEvent")}function wo(t){return Ye(t,"DOMError")}function cd(t){return Ye(t,"DOMException")}function Zt(t){return Ye(t,"String")}function Cs(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function Ce(t){return t===null||Cs(t)||typeof t!="object"&&typeof t!="function"}function pr(t){return Ye(t,"Object")}function Ae(t){return typeof t=="object"&&t!==null}function hr(t){return typeof Event!="undefined"&&mr(t,Event)}function ud(t){return Ye(t,"RegExp")}function wn(t){return Boolean((t==null?void 0:t.then)&&typeof t.then=="function")}function mr(t,e){try{return t instanceof e}catch(n){return!1}}function As(t){return typeof Request!="undefined"&&mr(t,Request)}function kt(t,e,n){if(!(e in t))return;const r=t[e];if(typeof r!="function")return;const s=n(r);typeof s=="function"&&ko(s,r);try{t[e]=s}catch(i){I&&S.log(`Failed to replace method "${e}" in object`,t)}}function Et(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch(r){I&&S.log(`Failed to add non-enumerable property "${String(e)}" to object`,t)}}function ko(t,e){try{const n=e.prototype||{};t.prototype=e.prototype=n,Et(t,"__sentry_original__",e)}catch(n){}}function Ms(t){return t.__sentry_original__}function Ro(t){if(Qt(t))return h({message:t.message,name:t.name,stack:t.stack},Co(t));if(hr(t)){const{type:e,target:n,currentTarget:r,detail:s}=t;return h(h({type:e,target:n,currentTarget:r},s?{detail:s}:{}),Co(t))}return t}function Co(t){return Ae(t)?Object.fromEntries(Object.entries(t)):{}}function ld(t){const e=Object.keys(Ro(t));return e.sort(),e[0]?e.join(", "):"[object has no keys]"}let Ke;function kn(t){if(Ke!==void 0)return Ke?Ke(t):t();const e=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=$;return e in n&&typeof n[e]=="function"?(Ke=n[e],Ke(t)):(Ke=null,t())}function fe(){return kn(()=>Math.random())}function pe(){return kn(()=>Date.now())}const dd=Symbol.for("sentry.skipNormalization"),fd=Symbol.for("sentry.overrideNormalizationDepth");function pd(t){return Boolean(t[dd])}function hd(t){const e=t[fd];return typeof e=="number"?e:void 0}let xs;function md(t){xs=t}function $t(t,e=100,n=1/0){try{return Ns("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Ao(t,e=3,n=102400){const r=$t(t,e);return yd(r)>n?Ao(t,e-1,n):r}function Ns(t,e,n=1/0,r=1/0,s=Sd()){const[i,o]=s;if(e==null||["boolean","string"].includes(typeof e)||typeof e=="number"&&Number.isFinite(e))return e;const c=Mo(t,e);if(!c.startsWith("[object "))return c;if(pd(e))return e;const a=hd(e),u=a!==void 0?a:n;if(u===0)return c.replace("object ","");if(i(e))return"[Circular ~]";const l=e;if(l&&typeof l.toJSON=="function")try{const m=l.toJSON();return Ns("",m,u-1,r,s)}catch(m){}const d=Array.isArray(e)?[]:{};let f=0;const p=Ro(e);for(const m in p){if(!Object.prototype.hasOwnProperty.call(p,m))continue;if(f>=r){d[m]="[MaxProperties ~]";break}const g=p[m];d[m]=Ns(m,g,u-1,r,s),f++}return o(e),d}function Mo(t,e){try{if(xs){const r=xs(e);if(r)return r}return typeof global!="undefined"&&e===global?"[Global]":typeof e=="number"&&!Number.isFinite(e)?`[${e}]`:typeof e=="function"?`[Function: ${Jt(e)}]`:typeof e=="symbol"?`[${String(e)}]`:typeof e=="bigint"?`[BigInt: ${String(e)}]`:`[object ${gd(e)}]`}catch(n){return`**non-serializable** (${n})`}}function gd(t){const e=Object.getPrototypeOf(t);return e!=null&&e.constructor?e.constructor.name:"null prototype"}function _d(t){return~-encodeURI(t).split(/%..|./).length}function yd(t){return _d(JSON.stringify(t))}function Sd(){const t=new WeakSet;function e(r){return t.has(r)?!0:(t.add(r),!1)}function n(r){t.delete(r)}return[e,n]}function Os(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function xo(t,e){if(!Array.isArray(t))return"";const n=[];for(let r=0;r<t.length;r++){const s=t[r];Ce(s)?n.push(String(s)):s instanceof Error?n.push(s.message?`${s.name}: ${s.message}`:s.name):n.push(Mo(void 0,s))}return n.join(e)}function Rn(t,e,n=!1){return Zt(t)?ud(e)?e.test(t):Zt(e)?n?t===e:t.includes(e):typeof e=="function"?e(t):!1:!1}function Vt(t,e=[],n=!1){for(const r of e)if(Rn(t,r,n))return!0;return!1}function Ed(){const t=$;return t.crypto||t.msCrypto}let Ls;function bd(){return fe()*16}function xt(t=Ed()){try{if(t!=null&&t.randomUUID)return kn(()=>t.randomUUID()).replace(/-/g,"")}catch(e){}return Ls||(Ls="10000000100040008000"+1e11),Ls.replace(/[018]/g,e=>(e^(bd()&15)>>e/4).toString(16))}function No(t){var e,n;return(n=(e=t.exception)==null?void 0:e.values)==null?void 0:n[0]}function Me(t){const{message:e,event_id:n}=t;if(e)return e;const r=No(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Ds(t,e,n){const r=t.exception=t.exception||{},s=r.values=r.values||[],i=s[0]=s[0]||{};i.value||(i.value=e||""),i.type||(i.type=n||"Error")}function xe(t,e){const n=No(t);if(!n)return;const r={type:"generic",handled:!0},s=n.mechanism;if(n.mechanism=h(h(h({},r),s),e),e&&"data"in e){const i=h(h({},s==null?void 0:s.data),e.data);n.mechanism.data=i}}function Oo(t){if(vd(t))return!0;try{Et(t,"__sentry_captured__",!0)}catch(e){}return!1}function vd(t){try{return t.__sentry_captured__}catch(e){}}const Lo=1e3;function Ne(){return pe()/Lo}function Id(){const{performance:t}=$;if(!(t!=null&&t.now)||!t.timeOrigin)return Ne;const e=t.timeOrigin;return()=>(e+kn(()=>t.now()))/Lo}let gr;function mt(){return(gr!=null?gr:gr=Id())()}let Ps=null;function Td(){var o;const{performance:t}=$;if(!(t!=null&&t.now))return;const e=3e5,n=kn(()=>t.now()),r=pe(),s=t.timeOrigin;if(typeof s=="number"&&Math.abs(s+n-r)<e)return s;const i=(o=t.timing)==null?void 0:o.navigationStart;return typeof i=="number"&&Math.abs(i+n-r)<e?i:r-n}function _t(){return Ps===null&&(Ps=Td()),Ps}function wd(t){const e=mt(),n={sid:xt(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Rd(n)};return t&&Xe(n,t),n}function Xe(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||mt(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:xt()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function kd(t,e){let n={};e?n={status:e}:t.status==="ok"&&(n={status:"exited"}),Xe(t,n)}function Rd(t){return{sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}}}function Cn(t,e,n=2){if(!e||typeof e!="object"||n<=0)return e;if(t&&Object.keys(e).length===0)return t;const r=h({},t);for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=Cn(r[s],e[s],n-1));return r}function te(){return xt()}function ee(){return xt().substring(16)}function Do(t){try{const e=$.WeakRef;if(typeof e=="function")return new e(t)}catch(e){}return t}function Po(t){if(!!t){if(typeof t=="object"&&"deref"in t&&typeof t.deref=="function")try{return t.deref()}catch(e){return}return t}}const Fs="_sentrySpan";function An(t,e){e?Et(t,Fs,Do(e)):delete t[Fs]}function _r(t){return Po(t[Fs])}const Cd=100;class Yt{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:te(),sampleRand:fe()}}clone(){const e=new Yt;return e._breadcrumbs=[...this._breadcrumbs],e._tags=h({},this._tags),e._attributes=h({},this._attributes),e._extra=h({},this._extra),e._contexts=h({},this._contexts),this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata=h({},this._sdkProcessingMetadata),e._propagationContext=h({},this._propagationContext),e._client=this._client,e._lastEventId=this._lastEventId,e._conversationId=this._conversationId,An(e,_r(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Xe(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags=h(h({},this._tags),e),this._notifyScopeListeners(),this}setTag(e,n){return this.setTags({[e]:n})}setAttributes(e){return this._attributes=h(h({},this._attributes),e),this._notifyScopeListeners(),this}setAttribute(e,n){return this.setAttributes({[e]:n})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra=h(h({},this._extra),e),this._notifyScopeListeners(),this}setExtra(e,n){return this._extra=R(h({},this._extra),{[e]:n}),this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const n=typeof e=="function"?e(this):e,r=n instanceof Yt?n.getScopeData():pr(n)?e:void 0,{tags:s,attributes:i,extra:o,user:c,contexts:a,level:u,fingerprint:l=[],propagationContext:d,conversationId:f}=r||{};return this._tags=h(h({},this._tags),s),this._attributes=h(h({},this._attributes),i),this._extra=h(h({},this._extra),o),this._contexts=h(h({},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,An(this,void 0),this._attachments=[],this.setPropagationContext({traceId:te(),sampleRand:fe()}),this._notifyScopeListeners(),this}addBreadcrumb(e,n){var i;const r=typeof n=="number"?n:Cd;if(r<=0)return this;const s=R(h({timestamp:Ne()},e),{message:e.message?Os(e.message,2048):e.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(e){return this._attachments.push(e),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:_r(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=Cn(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){const r=(n==null?void 0:n.event_id)||xt();if(!this._client)return I&&S.warn("No client configured on scope - will not capture exception!"),r;const s=new Error("Sentry syntheticException");return this._client.captureException(e,R(h({originalException:e,syntheticException:s},n),{event_id:r}),this),r}captureMessage(e,n,r){var o;const s=(r==null?void 0:r.event_id)||xt();if(!this._client)return I&&S.warn("No client configured on scope - will not capture message!"),s;const i=(o=r==null?void 0:r.syntheticException)!=null?o:new Error(e);return this._client.captureMessage(e,n,R(h({originalException:e,syntheticException:i},r),{event_id:s}),this),s}captureEvent(e,n){const r=e.event_id||(n==null?void 0:n.event_id)||xt();return this._client?(this._client.captureEvent(e,R(h({},n),{event_id:r}),this),r):(I&&S.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}function Ad(){return Ve("defaultCurrentScope",()=>new Yt)}function Md(){return Ve("defaultIsolationScope",()=>new Yt)}const Fo=t=>t instanceof Promise&&!t[Bo],Bo=Symbol("chained PromiseLike"),xd=(t,e,n)=>{const r=t.then(s=>(e(s),s),s=>{throw n(s),s});return Fo(r)&&Fo(t)?r:Nd(t,r)},Nd=(t,e)=>{if(!e)return t;let n=!1;for(const r in t){if(r in e)continue;n=!0;const s=t[r];typeof s=="function"?Object.defineProperty(e,r,{value:(...i)=>s.apply(t,i),enumerable:!0,configurable:!0,writable:!0}):e[r]=s}return n&&Object.assign(e,{[Bo]:!0}),e};class Od{constructor(e,n){let r;e?r=e:r=new Yt;let s;n?s=n:s=new Yt,this._stack=[{scope:r}],this._isolationScope=s}withScope(e){const n=this._pushScope();let r;try{r=e(n)}catch(s){throw this._popScope(),s}return wn(r)?xd(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 e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function Je(){const t=ce(),e=In(t);return e.stack=e.stack||new Od(Ad(),Md())}function Ld(t){return Je().withScope(t)}function Dd(t,e){const n=Je();return n.withScope(()=>(n.getStackTop().scope=t,e(t)))}function $o(t){return Je().withScope(()=>t(Je().getIsolationScope()))}function Pd(){return{withIsolationScope:$o,withScope:Ld,withSetScope:Dd,withSetIsolationScope:(t,e)=>$o(e),getCurrentScope:()=>Je().getScope(),getIsolationScope:()=>Je().getIsolationScope()}}function Qe(t){const e=In(t);return e.acs?e.acs:Pd()}function Fd(t){return typeof t=="object"&&t!=null&&!Array.isArray(t)&&Object.keys(t).includes("value")}function Bd(t,e){var c;const{value:n,unit:r}=Fd(t)?t:{value:t,unit:void 0},s=$d(n),i=r&&typeof r=="string"?{unit:r}:{};if(s)return h(h({},s),i);if(!e||e==="skip-undefined"&&n===void 0)return;let o="";try{o=(c=JSON.stringify(n))!=null?c:""}catch(a){}return h({value:o,type:"string"},i)}function Uo(t,e=!1){const n={};for(const[r,s]of Object.entries(t!=null?t:{})){const i=Bd(s,e);i&&(n[r]=i)}return n}function $d(t){if(Array.isArray(t))return{value:t,type:"array"};const e=typeof t=="string"?"string":typeof t=="boolean"?"boolean":typeof t=="number"&&!Number.isNaN(t)?Number.isInteger(t)?"integer":"double":null;if(e)return{value:t,type:e}}let Ud;function Hd(){return Ud!==void 0}function V(){const t=ce();return Qe(t).getCurrentScope()}function vt(){const t=ce();return Qe(t).getIsolationScope()}function Wd(){return Ve("globalScope",()=>new Yt)}function Bs(...t){const e=ce(),n=Qe(e);if(t.length===2){const[r,s]=t;return r?n.withSetScope(r,s):n.withScope(s)}return n.withScope(t[0])}function U(){return V().getClient()}function zd(t){const e=t.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:s}=e,i={trace_id:n,span_id:s||ee()};return r&&(i.parent_span_id=r),i}const Ut="sentry.source",$s="sentry.sample_rate",Ho="sentry.previous_trace_sample_rate",Nt="sentry.op",pt="sentry.origin",jd="sentry.status.message",Mn="sentry.idle_span_finish_reason",xn="sentry.measurement_unit",Nn="sentry.measurement_value",Wo="sentry.custom_span_name",Us="sentry.profile_id",he="sentry.exclusive_time",qd="sentry.link.type",Gd="gen_ai.conversation.id",zo=0,yr=1,yt=2;function Vd(t){if(t<400&&t>=100)return{code:yr};if(t>=400&&t<500)switch(t){case 401:return{code:yt,message:"unauthenticated"};case 403:return{code:yt,message:"permission_denied"};case 404:return{code:yt,message:"not_found"};case 409:return{code:yt,message:"already_exists"};case 413:return{code:yt,message:"failed_precondition"};case 429:return{code:yt,message:"resource_exhausted"};case 499:return{code:yt,message:"cancelled"};default:return{code:yt,message:"invalid_argument"}}if(t>=500&&t<600)switch(t){case 501:return{code:yt,message:"unimplemented"};case 503:return{code:yt,message:"unavailable"};case 504:return{code:yt,message:"deadline_exceeded"};default:return{code:yt,message:"internal_error"}}return{code:yt,message:"internal_error"}}function jo(t,e){t.setAttribute("http.response.status_code",e);const n=Vd(e);n.message!=="unknown_error"&&t.setStatus(n)}const qo="_sentryScope",Go="_sentryIsolationScope",Yd=Symbol.for("sentry.otelSourceInference"),Kd=Symbol.for("sentry.otelSourceExplicitlySet"),Xd=Symbol.for("sentry.tracerProviderSpan");function Ze(t,e,n){t&&(Et(t,Go,Do(n)),Et(t,qo,e))}function tn(t){const e=t;return{scope:e[qo],isolationScope:Po(e[Go])}}function Vo(t){return t[Yd]===!0}function Jd(t){Et(t,Kd,!0)}function Yo(t){return t[Xd]===!0}const Sr="sentry-",Qd=8192;function Ko(t){const e=tf(t);if(!e)return;const n=Object.entries(e).reduce((r,[s,i])=>{if(s.startsWith(Sr)){const o=s.slice(Sr.length);r[o]=i}return r},{});if(Object.keys(n).length>0)return n}function Zd(t){if(!t)return;const e=Object.entries(t).reduce((n,[r,s])=>(s&&(n[`${Sr}${r}`]=s),n),{});return ef(e)}function tf(t){if(!(!t||!Zt(t)&&!Array.isArray(t)))return Array.isArray(t)?t.reduce((e,n)=>{const r=Xo(n);return Object.entries(r).forEach(([s,i])=>{e[s]=i}),e},{}):Xo(t)}function Xo(t){return t.split(",").map(e=>{const n=e.indexOf("=");if(n===-1)return[];const r=e.slice(0,n),s=e.slice(n+1);return[r,s].map(i=>{try{return decodeURIComponent(i.trim())}catch(o){return}})}).reduce((e,[n,r])=>(n&&r&&(e[n]=r),e),{})}function ef(t){if(Object.keys(t).length!==0)return Object.entries(t).reduce((e,[n,r],s)=>{const i=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,o=s===0?i:`${e},${i}`;return o.length>Qd?(I&&S.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),e):o},"")}const nf=/^o(\d+)\./,rf=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function sf(t){return t==="http"||t==="https"}function en(t,e=!1){const{host:n,path:r,pass:s,port:i,projectId:o,protocol:c,publicKey:a}=t;return`${c}://${a}${e&&s?`:${s}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${o}`}function of(t){const e=rf.exec(t);if(!e){ue(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}const[n,r,s="",i="",o="",c=""]=e.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 Jo({host:i,pass:s,path:a,projectId:u,port:o,protocol:n,publicKey:r})}function Jo(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function af(t){if(!I)return!0;const{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(o=>t[o]?!1:(S.error(`Invalid Sentry Dsn: ${o} missing`),!0))?!1:n.match(/^\d+$/)?sf(r)?e&&isNaN(parseInt(e,10))?(S.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(S.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(S.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function cf(t){const e=t.match(nf);return e==null?void 0:e[1]}function uf(t){const e=t.getOptions(),{host:n}=t.getDsn()||{};let r;return e.orgId?r=String(e.orgId):n&&(r=cf(n)),r}function lf(t){const e=typeof t=="string"?of(t):Jo(t);if(!(!e||!af(e)))return e}function Oe(t){if(typeof t=="boolean")return Number(t);const e=typeof t=="string"?parseFloat(t):t;if(!(typeof e!="number"||isNaN(e)||e<0||e>1))return e}const Qo=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function df(t){if(!t)return;const e=t.match(Qo);if(!e)return;let n;return e[3]==="1"?n=!0:e[3]==="0"&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}function ff(t,e){const n=df(t),r=Ko(e);if(!(n!=null&&n.traceId))return{traceId:te(),sampleRand:fe()};const s=pf(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 Zo(t=te(),e=ee(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${t}-${e}${r}`}function ta(t=te(),e=ee(),n){return`00-${t}-${e}-${n?"01":"00"}`}function pf(t,e){const n=Oe(e==null?void 0:e.sample_rand);if(n!==void 0)return n;const r=Oe(e==null?void 0:e.sample_rate);return r&&(t==null?void 0:t.parentSampled)!==void 0?t.parentSampled?fe()*r:r+fe()*(1-r):fe()}const ea=0,Er=1;let na=!1;function hf(t){const{spanId:e,traceId:n}=t.spanContext(),{data:r,op:s,parent_span_id:i,status:o,origin:c,links:a}=j(t);return{parent_span_id:i,span_id:e,trace_id:n,data:r,op:s,status:o,origin:c,links:a}}function mf(t){const{spanId:e,traceId:n,isRemote:r}=t.spanContext(),s=r?e:j(t).parent_span_id,i=tn(t).scope,o=r?(i==null?void 0:i.getPropagationContext().propagationSpanId)||ee():e;return{parent_span_id:s,span_id:o,trace_id:n}}function gf(t){const{traceId:e,spanId:n}=t.spanContext(),r=re(t);return Zo(e,n,r)}function _f(t){const{traceId:e,spanId:n}=t.spanContext(),r=re(t);return ta(e,n,r)}function ra(t){if(t&&t.length>0)return t.map(o=>{var c=o,{context:a}=c,u=a,{spanId:e,traceId:n,traceFlags:r}=u,s=po(u,["spanId","traceId","traceFlags"]),{attributes:i}=c;return h({span_id:e,trace_id:n,sampled:r===Er,attributes:i},s)})}function sa(t){if(t!=null&&t.length)return t.map(({context:{spanId:e,traceId:n,traceFlags:r},attributes:s})=>({span_id:e,trace_id:n,sampled:r===Er,attributes:s}))}function ne(t){return typeof t=="number"?ia(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?ia(t.getTime()):mt()}function ia(t){return t>9999999999?t/1e3:t}function j(t){if(ua(t))return t.getSpanJSON();const{spanId:e,traceId:n}=t.spanContext();if(ca(t)){const{attributes:r,startTime:s,name:i,endTime:o,status:c,links:a}=t;return{span_id:e,trace_id:n,data:r,description:i,parent_span_id:aa(t),start_timestamp:ne(s),timestamp:ne(o)||void 0,status:la(c),op:r[Nt],origin:r[pt],links:ra(a)}}return{span_id:e,trace_id:n,start_timestamp:0,data:{}}}function oa(t){if(ua(t))return t.getStreamedSpanJSON();const{spanId:e,traceId:n}=t.spanContext();if(ca(t)){const{attributes:r,startTime:s,name:i,endTime:o,status:c,links:a}=t;return{name:i,span_id:e,trace_id:n,parent_span_id:aa(t),start_timestamp:ne(s),end_timestamp:ne(o),is_segment:t===zs(t),status:Hs(c),attributes:da(r,c),links:sa(a)}}return{span_id:e,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:t===zs(t)}}function aa(t){var e;return"parentSpanId"in t?t.parentSpanId:"parentSpanContext"in t?(e=t.parentSpanContext)==null?void 0:e.spanId:void 0}function yf(t){var e;return R(h({},t),{attributes:Uo(t.attributes),links:(e=t.links)==null?void 0:e.map(n=>R(h({},n),{attributes:Uo(n.attributes)}))})}function ca(t){const e=t;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function ua(t){return typeof t.getSpanJSON=="function"}function re(t){const{traceFlags:e}=t.spanContext();return e===Er}function la(t){if(!(!t||t.code===zo))return t.code===yr?"ok":t.message||"internal_error"}function Hs(t){return!t||t.code===yr||t.code===zo||t.message==="cancelled"?"ok":"error"}function da(t,e){const n=Hs(e)==="error"?e==null?void 0:e.message:void 0;return h(h({},n&&{[jd]:n}),t)}const Le="_sentryChildSpans",Ws="_sentryRootSpan";function br(t,e){const n=t[Ws]||t;Et(e,Ws,n),re(t)&&(!t.isRecording()&&!n.isRecording()||(t[Le]?t[Le].add(e):Et(t,Le,new Set([e]))))}function Sf(t,e){t[Le]&&t[Le].delete(e)}function vr(t){const e=new Set;function n(r){if(!e.has(r)&&re(r)){e.add(r);const s=r[Le]?Array.from(r[Le]):[];for(const i of s)n(i)}}return n(t),Array.from(e)}const St=zs;function zs(t){return t[Ws]||t}function bt(){const t=ce(),e=Qe(t);return e.getActiveSpan?e.getActiveSpan():_r(V())}function js(){na||(ue(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),na=!0)}let fa=!1;function Ef(){if(fa)return;function t(){const e=bt(),n=e&&St(e);if(n){const r="internal_error";I&&S.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:yt,message:r})}}fa=!0,bo(t),vo(t)}function Ot(t){var n;if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const e=t||((n=U())==null?void 0:n.getOptions());return!!e&&(e.tracesSampleRate!=null||!!e.tracesSampler)}function pa(t){S.log(`Ignoring span ${t.op} - ${t.description} because it matches \`ignoreSpans\`.`)}function On(t,e){if(!(e!=null&&e.length))return!1;for(const n of e){if(If(n)){if(t.description&&Rn(t.description,n))return I&&pa(t),!0;continue}const r=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!r)continue;const s=n.name?t.description&&Rn(t.description,n.name):!0,i=n.op?t.op&&Rn(t.op,n.op):!0,o=n.attributes?Object.entries(n.attributes).every(([c,a])=>{var u;return bf((u=t.attributes)==null?void 0:u[c],a)}):!0;if(s&&i&&o)return I&&pa(t),!0}return!1}function bf(t,e){return typeof t=="string"&&(typeof e=="string"||e instanceof RegExp)?Rn(t,e):Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((n,r)=>n===e[r]):t===e}function vf(t,e){const n=e.parent_span_id,r=e.span_id;if(!!n)for(const s of t)s.parent_span_id===r&&(s.parent_span_id=n)}function If(t){return typeof t=="string"||t instanceof RegExp}const ha=Symbol.for("sentry.nonRecordingSpan");class De{constructor(e={}){this._traceId=e.traceId||te(),this._spanId=e.spanId||ee(),this.dropReason=e.dropReason,Et(this,ha,!0)}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:ea}}end(e){}setAttribute(e,n){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,n,r){return this}addLink(e){return this}addLinks(e){return this}recordException(e,n){}}function nn(t){return!!t&&t[ha]===!0}const qs="production",ma="_frozenDsc";function ga(t,e){Et(t,ma,e)}function _a(t,e){const n=e.getOptions(),{publicKey:r}=e.getDsn()||{},s={environment:n.environment||qs,release:n.release,public_key:r,trace_id:t,org_id:uf(e)};return e.emit("createDsc",s),s}function Gs(t,e){const n=e.getPropagationContext();return n.dsc||_a(n.traceId,t)}function me(t){var y,_,T,F,w;const e=U();if(!e)return{};const n=St(t),r=j(n),s=r.data,i=n.spanContext().traceState,o=(_=(y=i==null?void 0:i.get("sentry.sample_rate"))!=null?y:s[$s])!=null?_:s[Ho];function c(M){return(typeof o=="number"||typeof o=="string")&&(M.sample_rate=`${o}`),M}const a=n[ma];if(a)return c(a);const u=nn(n),l=u&&n.dropReason==="ignored";if(u&&(!Ot(e.getOptions())||l)){const M=tn(n).scope;if(M){const v=h({},Gs(e,M));return l&&(v.sampled="false"),c(v)}}const d=i==null?void 0:i.get("sentry.dsc"),f=d&&Ko(d);if(f)return c(f);const p=_a(t.spanContext().traceId,e),m=(T=s[Ut])!=null?T:s["sentry.segment.name.source"],g=r.description;return m!=="url"&&g&&(p.transaction=g),Ot()&&(p.sampled=String(re(n)),p.sample_rand=(w=i==null?void 0:i.get("sentry.sample_rand"))!=null?w:(F=tn(n).scope)==null?void 0:F.getPropagationContext().sampleRand.toString()),c(p),e.emit("createDsc",p,n),p}function ya(t){return!!t&&typeof t=="function"&&"_streamed"in t&&!!t._streamed}function ge(t,e=[]){return[t,e]}function Sa(t,e){const[n,r]=t;return[n,[...r,e]]}function Vs(t,e){const n=t[1];for(const r of n){const s=r[0].type;if(e(r,s))return!0}return!1}function Tf(t,e){return Vs(t,(n,r)=>e.includes(r))}function Ys(t){const e=In($);return e.encodePolyfill?e.encodePolyfill(t):new TextEncoder().encode(t)}function wf(t){const[e,n]=t;let r=JSON.stringify(e);function s(i){typeof r=="string"?r=typeof i=="string"?r+i:[Ys(r),i]:r.push(typeof i=="string"?Ys(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(u){a=JSON.stringify($t(c))}s(a)}}return typeof r=="string"?r:kf(r)}function kf(t){const e=t.reduce((s,i)=>s+i.length,0),n=new Uint8Array(e);let r=0;for(const s of t)n.set(s,r),r+=s.length;return n}function Rf(t){return[{type:"span"},t]}function Cf(t){const e=typeof t.data=="string"?Ys(t.data):t.data;return[{type:"attachment",length:e.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType},e]}const Ea={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 Af(t){return t in Ea}function ba(t){return Af(t)?Ea[t]:t}function Ks(t){if(!(t!=null&&t.sdk))return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}function va(t,e,n,r){var i;const s=(i=t.sdkProcessingMetadata)==null?void 0:i.dynamicSamplingContext;return h(h(h({event_id:t.event_id,sent_at:new Date(pe()).toISOString()},e&&{sdk:e}),!!n&&r&&{dsn:en(r)}),s&&{trace:s})}function Mf(t,e){var r,s,i,o;if(!e)return t;const n=t.sdk||{};return t.sdk=R(h({},n),{name:n.name||e.name,version:n.version||e.version,integrations:[...((r=t.sdk)==null?void 0:r.integrations)||[],...e.integrations||[]],packages:[...((s=t.sdk)==null?void 0:s.packages)||[],...e.packages||[]],settings:((i=t.sdk)==null?void 0:i.settings)||e.settings?h(h({},(o=t.sdk)==null?void 0:o.settings),e.settings):void 0}),t}function xf(t,e,n,r){const s=Ks(n),i=h(h({sent_at:new Date(pe()).toISOString()},s&&{sdk:s}),!!r&&e&&{dsn:en(e)}),o="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return ge(i,[o])}function Nf(t,e,n,r){const s=Ks(n),i=t.type&&t.type!=="replay_event"?t.type:"event";Mf(t,n==null?void 0:n.sdk);const o=va(t,s,r,e);return delete t.sdkProcessingMetadata,ge(o,[[{type:i},t]])}function Of(t,e){function n(p){return!!p.trace_id&&!!p.public_key}const r=me(t[0]),s=e==null?void 0:e.getDsn(),i=e==null?void 0:e.getOptions().tunnel,o=h(h({sent_at:new Date(pe()).toISOString()},n(r)&&{trace:r}),!!i&&s&&{dsn:en(s)}),{beforeSendSpan:c,ignoreSpans:a}=(e==null?void 0:e.getOptions())||{},u=a!=null&&a.length?t.filter(p=>{const m=j(p);return!On({description:m.description,op:m.op,attributes:m.data},a)}):t,l=t.length-u.length;l&&(e==null||e.recordDroppedEvent("before_send","span",l));const d=c?p=>{const m=j(p),g=ya(c)?m:c(m);return g||(js(),m)}:j,f=[];for(const p of u){const m=d(p);m&&f.push(Rf(m))}return ge(o,f)}function Lf(t){if(!I)return;const{description:e="< unknown name >",op:n="< unknown op >",parent_span_id:r}=j(t),{spanId:s}=t.spanContext(),i=re(t),o=St(t),c=o===t,a=`[Tracing] Starting ${i?"sampled":"unsampled"} ${c?"root ":""}span`,u=[`op: ${n}`,`name: ${e}`,`ID: ${s}`];if(r&&u.push(`parent ID: ${r}`),!c){const{op:l,description:d}=j(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 Df(t){if(!I)return;const{description:e="< unknown name >",op:n="< unknown op >"}=j(t),{spanId:r}=t.spanContext(),i=St(t)===t,o=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${e}" with ID ${r}`;S.log(o)}function Ia(t,e,n,r=bt()){const s=r&&St(r);s&&(I&&S.log(`[Measurement] Setting measurement on root span: ${t} = ${e} ${n}`),s.addEvent(t,{[Nn]:e,[xn]:n}))}function Ta(t){if(!t||t.length===0)return;const e={};return t.forEach(n=>{const r=n.attributes||{},s=r[xn],i=r[Nn];typeof s=="string"&&typeof i=="number"&&(e[n.name]={value:i,unit:s})}),e}function wa(){return In(ce()).segmentSpanCaptureStrategy}function Kt(t){return t.getOptions().traceLifecycle==="stream"}const ka=1e3;class Ir{constructor(e={}){this._traceId=e.traceId||te(),this._spanId=e.spanId||ee(),this._startTime=e.startTimestamp||mt(),this._links=e.links,this._attributes={},this.setAttributes(h({[pt]:"manual",[Nt]:e.op},e.attributes)),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this._frozen?this:(this._links?this._links.push(e):this._links=[e],this)}addLinks(e){return this._frozen?this:(this._links?this._links.push(...e):this._links=e,this)}recordException(e,n){}spanContext(){const{_spanId:e,_traceId:n,_sampled:r}=this;return{spanId:e,traceId:n,traceFlags:r?Er:ea}}setAttribute(e,n){return this._frozen?this:(n===void 0?delete this._attributes[e]:this._attributes[e]=n,e===Ut&&n!==void 0&&Vo(this)&&Jd(this),this)}setAttributes(e){return Object.keys(e).forEach(n=>this.setAttribute(n,e[n])),this}updateStartTime(e){this._frozen||(this._startTime=ne(e))}setStatus(e){return this._frozen?this:(this._status=e,this)}updateName(e){return this._frozen?this:(this._name=e,Vo(this)||this.setAttribute(Ut,"custom"),this)}end(e){if(this._endTime){this._frozen=Yo(this);return}this._endTime=ne(e),Df(this),this._onSpanEnded(),this._frozen=Yo(this)}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[Nt],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:la(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[pt],profile_id:this._attributes[Us],exclusive_time:this._attributes[he],measurements:Ta(this._events),is_segment:this._isStandaloneSpan&&St(this)===this||void 0,segment_id:this._isStandaloneSpan?St(this).spanContext().spanId:void 0,links:ra(this._links)}}getStreamedSpanJSON(){var e,n;return{name:(e=this._name)!=null?e:"",span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:(n=this._endTime)!=null?n:this._startTime,is_segment:this._isStandaloneSpan||this===St(this),status:Hs(this._status),attributes:da(this._attributes,this._status),links:sa(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,n,r){if(this._frozen)return this;I&&S.log("[Tracing] Adding an event to span:",e);const s=Ra(n)?n:r||mt(),i=Ra(n)?{}:n||{},o={name:e,time:ne(s),attributes:i};return this._events.push(o),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const e=U();e&&(e.emit("spanEnd",this),this._isStandaloneSpan||e.emit("afterSpanEnd",this));const n=St(this),r=this._isStandaloneSpan||this===n;if(this._isStandaloneSpan){this._sampled?Ff(Of([this],e)):(I&&S.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),e&&e.recordDroppedEvent("sample_rate","span"));return}if(!r){const o=wa();if(o){const c=tn(this).scope||V();o.onChildSpanEnded(this,n,a=>this._convertSpanToTransaction(a),c)}return}if(e&&Kt(e)){e.emit("afterSegmentSpanEnd",this);return}const s=tn(this).scope||V(),i=wa();if(i)i.onSegmentSpanEnded(o=>this._convertSpanToTransaction(o),s);else{const o=this._convertSpanToTransaction();o&&s.captureEvent(o)}}_convertSpanToTransaction(e={}){var d,f,p,m;if(!Ca(j(this)))return;this._name||(I&&S.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:n,isolationScope:r}=tn(this),s=(d=n==null?void 0:n.getScopeData().sdkProcessingMetadata)==null?void 0:d.normalizedRequest;if(this._sampled!==!0)return;(f=e.onSpanCaptured)==null||f.call(e,this);const i=[];for(const g of vr(this)){if(g===this||Pf(g)||((p=e.isSpanAlreadyCaptured)==null?void 0:p.call(e,g)))continue;const y=j(g);!Ca(y)||((m=e.onSpanCaptured)==null||m.call(e,g),i.push(y))}const o=this._attributes[Ut];delete this._attributes[Wo];let c=!1;i.forEach(g=>{var y;delete g.data[Wo],(y=g.op)!=null&&y.startsWith("gen_ai.")&&(c=!0)});const a=h({contexts:{trace:hf(this)},spans:i.length>ka?i.sort((g,y)=>g.start_timestamp-y.start_timestamp).slice(0,ka):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:n,capturedSpanIsolationScope:r,dynamicSamplingContext:me(this),hasGenAiSpans:c},request:s},o&&{transaction_info:{source:o}}),u=Ta(this._events);return u&&Object.keys(u).length&&(I&&S.log("[Measurements] Adding measurements to transaction event",JSON.stringify(u,void 0,2)),a.measurements=u),a}}function Ra(t){return t&&typeof t=="number"||t instanceof Date||Array.isArray(t)}function Ca(t){return!!t.start_timestamp&&!!t.timestamp&&!!t.span_id&&!!t.trace_id}function Pf(t){return t instanceof Ir&&t.isStandaloneSpan()}function Ff(t){const e=U();if(!e)return;const n=t[1];if(!n||n.length===0){e.recordDroppedEvent("before_send","span");return}e.sendEnvelope(t)}function Bf(t,e,n){if(!Ot(t))return[!1];let r,s;typeof t.tracesSampler=="function"?(s=t.tracesSampler(R(h({},e),{inheritOrSampleWith:c=>typeof e.parentSampleRate=="number"?e.parentSampleRate:typeof e.parentSampled=="boolean"?Number(e.parentSampled):c})),r=!0):e.parentSampled!==void 0?s=e.parentSampled:typeof t.tracesSampleRate!="undefined"&&(s=t.tracesSampleRate,r=!0);const i=Oe(s);if(i===void 0)return I&&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 I&&S.log(`[Tracing] Discarding transaction because ${typeof t.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||I&&S.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(s)})`),[o,i,r]}const $f="__SENTRY_SUPPRESS_TRACING__";function _e(t){const e=Js();return e.startInactiveSpan?e.startInactiveSpan(t):Uf(t)}function Uf(t){const e=zf(t),{forceTransaction:n,parentSpan:r}=t;return(t.scope?i=>Bs(t.scope,i):r!==void 0?i=>Aa(r,i):i=>i())(()=>{const i=V(),o=qf(i,r),c=U();return t.onlyIfParent&&!o?Hf(i,c):Wf({parentSpan:o,spanArguments:e,forceTransaction:n,scope:i})})}function Aa(t,e){const n=Js();return n.withActiveSpan?n.withActiveSpan(t,e):Bs(r=>(An(r,t||void 0),e(r)))}function Xs(t=V()){const e=Js();return e.isTracingSuppressed?e.isTracingSuppressed(t):t.getScopeData().sdkProcessingMetadata[$f]===!0}function Hf(t,e){e==null||e.recordDroppedEvent("no_parent_span","span");const n=new De({traceId:t.getPropagationContext().traceId});return Ze(n,t,vt()),n}function Wf({parentSpan:t,spanArguments:e,forceTransaction:n,scope:r}){var c;const s=vt();if(!Ot()){const a=h(h({},s.getPropagationContext()),r.getPropagationContext()),u=t?t.spanContext().traceId:a.traceId,l=new De({traceId:u});return t&&!n&&br(t,l),Ze(l,r,s),l}const i=U();if(Gf(i,e)){Xs(r)||i==null||i.recordDroppedEvent("ignored","span");const a=new De({dropReason:"ignored",traceId:(c=t==null?void 0:t.spanContext().traceId)!=null?c:r.getPropagationContext().traceId});return t&&!n&&br(t,a),Ze(a,r,s),a}let o;if(t&&!n)o=jf(t,r,e,s),br(t,o);else if(t){const a=me(t),{traceId:u,spanId:l}=t.spanContext(),d=re(t);o=Ma(h({traceId:u,parentSpanId:l},e),r,s,d),ga(o,a)}else{const{traceId:a,dsc:u,parentSpanId:l,sampled:d}=h(h({},s.getPropagationContext()),r.getPropagationContext());o=Ma(h({traceId:a,parentSpanId:l},e),r,s,d),u&&ga(o,u)}return Lf(o),o}function zf(t){const e=t.experimental||{},n=h({isStandalone:e.standalone},t);if(t.startTime){const r=h({},n);return r.startTimestamp=ne(t.startTime),delete r.startTime,r}return n}function Js(){const t=ce();return Qe(t)}function Ma(t,e,n,r){var y,_;const s=U(),i=(s==null?void 0:s.getOptions())||{},{name:o=""}=t,c={spanAttributes:h({},t.attributes),spanName:o,parentSampled:r};s==null||s.emit("beforeSampling",c,{decision:!1});const a=(y=c.parentSampled)!=null?y:r,u=c.spanAttributes,l=e.getPropagationContext(),d=Xs(e),[f,p,m]=d?[!1]:Bf(i,{name:o,parentSampled:a,attributes:u,normalizedRequest:n.getScopeData().sdkProcessingMetadata.normalizedRequest,parentSampleRate:Oe((_=l.dsc)==null?void 0:_.sample_rate)},l.sampleRand),g=new Ir(R(h({},t),{attributes:h({[Ut]:"custom",[$s]:p!==void 0&&m?p:void 0},u),sampled:f}));return!f&&s&&!d&&(I&&S.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),s.recordDroppedEvent("sample_rate",Kt(s)?"span":"transaction")),Ze(g,e,n),s&&s.emit("spanStart",g),g}function jf(t,e,n,r){const{spanId:s,traceId:i}=t.spanContext(),o=Xs(e),c=o?!1:re(t),a=c?new Ir(R(h({},n),{parentSpanId:s,traceId:i,sampled:c})):new De({traceId:i});br(t,a),Ze(a,e,r);const u=U();return u&&(Kt(u)&&nn(a)&&(nn(t)&&t.dropReason?(a.dropReason=t.dropReason,u.recordDroppedEvent(t.dropReason,"span")):o||(a.dropReason="sample_rate",u.recordDroppedEvent("sample_rate","span"))),u.emit("spanStart",a),n.endTimestamp&&(u.emit("spanEnd",a),u.emit("afterSpanEnd",a))),a}function qf(t,e){if(e)return e;if(e===null)return;const n=_r(t);if(!n)return;const r=U();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?St(n):n}function Gf(t,e){var r;const n=t==null?void 0:t.getOptions().ignoreSpans;return!t||!Kt(t)||!(n!=null&&n.length)?!1:On({description:e.name||"",op:((r=e.attributes)==null?void 0:r[Nt])||e.op,attributes:e.attributes},n)}function xa(t){return nn(t)&&t.dropReason==="ignored"}const Tr={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},Vf="heartbeatFailed",Yf="idleTimeout",Kf="finalTimeout",Xf="externalFinish";function Na(t,e={}){const n=new Map;let r=!1,s,i,o=Xf,c=!e.disableAutoFinish;const a=[],{idleTimeout:u=Tr.idleTimeout,finalTimeout:l=Tr.finalTimeout,childSpanTimeout:d=Tr.childSpanTimeout,beforeSpanEnd:f,trimIdleSpanEndTimestamp:p=!0}=e,m=U(),g=V();if(!m||!Ot()){const C=new De({traceId:g.getPropagationContext().traceId});return Ze(C,g,vt()),C}const y=bt(),_=Jf(t);_.end=new Proxy(_.end,{apply(C,b,D){if(f&&f(_),nn(b))return;const[Y,...Z]=D,et=Y||mt(),ot=ne(et),z=vr(_).filter(J=>J!==_),x=j(_);if(!z.length||!p)return B(ot),Reflect.apply(C,b,[ot,...Z]);const k=m.getOptions().ignoreSpans,at=z==null?void 0:z.reduce((J,nt)=>{const ut=j(nt);return!ut.timestamp||k&&On({description:ut.description,op:ut.op,attributes:ut.data},k)?J:J?Math.max(J,ut.timestamp):ut.timestamp},void 0),A=x.start_timestamp,K=Math.min(A?A+l/1e3:1/0,Math.max(A||-1/0,Math.min(ot,at||1/0)));return B(K),Reflect.apply(C,b,[K,...Z])}});function T(){s&&(clearTimeout(s),s=void 0)}function F(){i&&(clearTimeout(i),i=void 0)}function w(C){T(),s=setTimeout(()=>{!r&&n.size===0&&c&&(o=Yf,_.end(C))},u)}function M(C){F(),i=setTimeout(()=>{!r&&c&&(o=Vf,_.end(C))},d)}function v(C){T(),n.set(C,!0);const b=mt();M(b+d/1e3)}function E(C){if(n.has(C)&&n.delete(C),n.size===0){const b=mt();w(b+u/1e3),F()}}function B(C){r=!0,n.clear(),a.forEach(z=>z()),An(g,y);const b=j(_),{start_timestamp:D}=b;if(!D)return;b.data[Mn]||_.setAttribute(Mn,o);const Z=b.status;(!Z||Z==="unknown")&&_.setStatus({code:yr}),S.log(`[Tracing] Idle span "${b.op}" finished`);const et=vr(_).filter(z=>z!==_);let ot=0;et.forEach(z=>{z.isRecording()&&(z.setStatus({code:yt,message:"cancelled"}),z.end(C),I&&S.log("[Tracing] Cancelling span since span ended early",JSON.stringify(z,void 0,2)));const x=j(z),{timestamp:k=0,start_timestamp:at=0}=x,A=at<=C,K=(l+u)/1e3,J=k-at<=K;if(I){const nt=JSON.stringify(z,void 0,2);A?J||S.log("[Tracing] Discarding span since it finished after idle span final timeout",nt):S.log("[Tracing] Discarding span since it happened after idle span was finished",nt)}(!J||!A)&&(Sf(_,z),ot++)}),ot>0&&_.setAttribute("sentry.idle_span_discarded_spans",ot)}return a.push(m.on("spanStart",C=>{if(r||C===_||!!j(C).timestamp||C instanceof Ir&&C.isStandaloneSpan())return;vr(_).includes(C)&&v(C.spanContext().spanId)})),a.push(m.on("spanEnd",C=>{r||E(C.spanContext().spanId)})),a.push(m.on("idleSpanEnableAutoFinish",C=>{C===_&&(c=!0,w(),n.size&&M())})),e.disableAutoFinish||w(),setTimeout(()=>{r||(_.setStatus({code:yt,message:"deadline_exceeded"}),o=Kf,_.end())},l),_}function Jf(t){const e=_e(t);return An(V(),e),I&&S.log("[Tracing] Started span is an idle span"),e}function Qf(t,e,n){let r,s,i;const o=n!=null&&n.maxWait?Math.max(n.maxWait,e):0,c=(n==null?void 0:n.setTimeoutImpl)||setTimeout;function a(){return u(),r=t(),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,e),o&&i===void 0&&(i=c(a,o)),r}return d.cancel=u,d.flush=l,d}function Zf(t,e){const{fingerprint:n,span:r,breadcrumbs:s,sdkProcessingMetadata:i}=e;tp(t,e),r&&rp(t,r),sp(t,n),ep(t,s),np(t,i)}function Oa(t,e){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:m,span:g}=e;Ln(t,"extra",n),Ln(t,"tags",r),Ln(t,"attributes",s),Ln(t,"user",i),Ln(t,"contexts",o),t.sdkProcessingMetadata=Cn(t.sdkProcessingMetadata,a,2),c&&(t.level=c),m&&(t.transactionName=m),g&&(t.span=g),u.length&&(t.breadcrumbs=[...t.breadcrumbs,...u]),l.length&&(t.fingerprint=[...t.fingerprint,...l]),d.length&&(t.eventProcessors=[...t.eventProcessors,...d]),f.length&&(t.attachments=[...t.attachments,...f]),t.propagationContext=h(h({},t.propagationContext),p)}function Ln(t,e,n){t[e]=Cn(t[e],n,1)}function La(t,e){const n=Wd().getScopeData();return t&&Oa(n,t.getScopeData()),e&&Oa(n,e.getScopeData()),n}function tp(t,e){const{extra:n,tags:r,user:s,contexts:i,level:o,transactionName:c}=e;Object.keys(n).length&&(t.extra=h(h({},n),t.extra)),Object.keys(r).length&&(t.tags=h(h({},r),t.tags)),Object.keys(s).length&&(t.user=h(h({},s),t.user)),Object.keys(i).length&&(t.contexts=h(h({},i),t.contexts)),o&&(t.level=o),c&&t.type!=="transaction"&&(t.transaction=c)}function ep(t,e){const n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function np(t,e){t.sdkProcessingMetadata=h(h({},t.sdkProcessingMetadata),e)}function rp(t,e){t.contexts=h({trace:mf(e)},t.contexts),t.sdkProcessingMetadata=h({dynamicSamplingContext:me(e)},t.sdkProcessingMetadata);const n=St(e),r=j(n).description;r&&!t.transaction&&t.type==="transaction"&&(t.transaction=r)}function sp(t,e){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint.length||delete t.fingerprint}const Da="http.url",Pa="sentry.segment.name",Fa="sentry.transaction",rn="url.full",ip="url.path";function wr(t,e){var r;const n=(r=t.attributes)!=null?r:t.attributes={};Object.entries(e).forEach(([s,i])=>{i!=null&&!(s in n)&&(n[s]=i)})}const Qs=0,Ba=1,$a=2;function Dn(t){return new Pn(e=>{e(t)})}function Ua(t){return new Pn((e,n)=>{n(t)})}class Pn{constructor(e){this._state=Qs,this._handlers=[],this._runExecutor(e)}then(e,n){return new Pn((r,s)=>{this._handlers.push([!1,i=>{if(!e)r(i);else try{r(e(i))}catch(o){s(o)}},i=>{if(!n)s(i);else try{r(n(i))}catch(o){s(o)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new Pn((n,r)=>{let s,i;return this.then(o=>{i=!1,s=o,e&&e()},o=>{i=!0,s=o,e&&e()}).then(()=>{if(i){r(s);return}n(s)})})}_executeHandlers(){if(this._state===Qs)return;const e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===Ba&&n[1](this._value),this._state===$a&&n[2](this._value),n[0]=!0)})}_runExecutor(e){const n=(i,o)=>{if(this._state===Qs){if(wn(o)){o.then(r,s);return}this._state=i,this._value=o,this._executeHandlers()}},r=i=>{n(Ba,i)},s=i=>{n($a,i)};try{e(r,s)}catch(i){s(i)}}}function op(t,e,n,r=0){try{const s=Zs(e,n,t,r);return wn(s)?s:Dn(s)}catch(s){return Ua(s)}}function Zs(t,e,n,r){const s=n[r];if(!t||!s)return t;const i=s(h({},t),e);return I&&i===null&&S.log(`Event processor "${s.id||"?"}" dropped event`),wn(i)?i.then(o=>Zs(o,e,n,r+1)):Zs(i,e,n,r+1)}let se,Ha,Wa,ye;function ap(t){const e=$._sentryDebugIds,n=$._debugIds;if(!e&&!n)return{};const r=e?Object.keys(e):[],s=n?Object.keys(n):[];if(ye&&r.length===Ha&&s.length===Wa)return ye;Ha=r.length,Wa=s.length,ye={},se||(se={});const i=(o,c)=>{for(const a of o){const u=c[a],l=se==null?void 0:se[a];if(l&&ye&&u)ye[l[0]]=u,se&&(se[a]=[l[0],u]);else if(u){const d=t(a);for(let f=d.length-1;f>=0;f--){const p=d[f],m=p==null?void 0:p.filename;if(m&&ye&&se){ye[m]=u,se[a]=[m,u];break}}}}};return e&&i(r,e),n&&i(s,n),ye}function za(t,e,n,r,s,i){const{normalizeDepth:o=3,normalizeMaxBreadth:c=1e3}=t,a=R(h({},e),{event_id:e.event_id||n.event_id||xt(),timestamp:e.timestamp||Ne()}),u=n.integrations||t.integrations.map(_=>_.name);cp(a,t),dp(a,u),s&&s.emit("applyFrameMetadata",e),e.type===void 0&&up(a,t.stackParser);const l=pp(r,n.captureContext);n.mechanism&&xe(a,n.mechanism);const d=s?s.getEventProcessors():[],f=La(i,l),p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),Zf(a,f);const m=[...d,...f.eventProcessors];return(n.data&&n.data.__sentry__===!0?Dn(a):op(m,a,n)).then(_=>(_&&lp(_),typeof o=="number"&&o>0?fp(_,o,c):_))}function cp(t,e){var c,a;const{environment:n,release:r,dist:s,maxValueLength:i}=e;t.environment=t.environment||n||qs,!t.release&&r&&(t.release=r),!t.dist&&s&&(t.dist=s);const o=t.request;(o==null?void 0:o.url)&&i&&(o.url=Os(o.url,i)),i&&((a=(c=t.exception)==null?void 0:c.values)==null||a.forEach(u=>{u.value&&(u.value=Os(u.value,i))}))}function up(t,e){var r,s;const n=ap(e);(s=(r=t.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 lp(t){var r,s;const e={};if((s=(r=t.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?e[a.abs_path]=a.debug_id:a.filename&&(e[a.filename]=a.debug_id),delete a.debug_id)})}),Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];const n=t.debug_meta.images;Object.entries(e).forEach(([i,o])=>{n.push({type:"sourcemap",code_file:i,debug_id:o})})}function dp(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function fp(t,e,n){var s,i;if(!t)return null;const r=h(h(h(h(h({},t),t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(o=>h(h({},o),o.data&&{data:$t(o.data,e,n)}))}),t.user&&{user:$t(t.user,e,n)}),t.contexts&&{contexts:$t(t.contexts,e,n)}),t.extra&&{extra:$t(t.extra,e,n)});return((s=t.contexts)==null?void 0:s.trace)&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=$t(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(o=>h(h({},o),o.data&&{data:$t(o.data,e,n)}))),((i=t.contexts)==null?void 0:i.flags)&&r.contexts&&(r.contexts.flags=$t(t.contexts.flags,3,n)),r}function pp(t,e){if(!e)return t;const n=t?t.clone():new Yt;return n.update(e),n}function hp(t){if(!!t)return mp(t)?{captureContext:t}:_p(t)?{captureContext:t}:t}function mp(t){return t instanceof Yt||typeof t=="function"}const gp=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function _p(t){return Object.keys(t).some(e=>gp.includes(e))}function ti(t,e){return V().captureException(t,hp(e))}function ja(t,e){return V().captureEvent(t,e)}function yp(t,e){vt().setContext(t,e)}function Fn(t,e){vt().setTag(t,e)}function Sp(){const t=U();return(t==null?void 0:t.getOptions().enabled)!==!1&&!!(t!=null&&t.getTransport())}function Ep(t){vt().addEventProcessor(t)}function qa(t){const e=vt(),{user:n}=La(e,V()),{userAgent:r}=$.navigator||{},s=wd(h(h({user:n},r&&{userAgent:r}),t)),i=e.getSession();return(i==null?void 0:i.status)==="ok"&&Xe(i,{status:"exited"}),Ga(),e.setSession(s),s}function Ga(){const t=vt(),n=V().getSession()||t.getSession();n&&kd(n),Va(),t.setSession()}function Va(){const t=vt(),e=U(),n=t.getSession();n&&e&&e.captureSession(n)}function ei(t=!1){if(t){Ga();return}Va()}function Ya(t){return typeof t=="object"&&typeof t.unref=="function"&&t.unref(),t}const bp="7";function vp(t){const e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function Ip(t){return`${vp(t)}${t.projectId}/envelope/`}function Tp(t,e){const n={sentry_version:bp};return t.publicKey&&(n.sentry_key=t.publicKey),e&&(n.sentry_client=`${e.name}/${e.version}`),new URLSearchParams(n).toString()}function wp(t,e,n){return e||`${Ip(t)}?${Tp(t,n)}`}const Ka=[];function kp(t){const e={};return t.forEach(n=>{const{name:r}=n,s=e[r];s&&!s.isDefaultInstance&&n.isDefaultInstance||(e[r]=n)}),Object.values(e)}function Rp(t){const e=t.defaultIntegrations||[],n=t.integrations;e.forEach(s=>{s.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...e,...n];else if(typeof n=="function"){const s=n(e);r=Array.isArray(s)?s:[s]}else r=e;return kp(r)}function Cp(t,e){const n={};return e.forEach(r=>{r!=null&&r.beforeSetup&&r.beforeSetup(t)}),e.forEach(r=>{r&&Ja(t,r,n)}),n}function Xa(t,e){for(const n of e)n!=null&&n.afterAllSetup&&n.afterAllSetup(t)}function Ja(t,e,n){if(n[e.name]){I&&S.log(`Integration skipped because it was already installed: ${e.name}`);return}if(n[e.name]=e,!Ka.includes(e.name)&&typeof e.setupOnce=="function"&&(e.setupOnce(),Ka.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),typeof e.preprocessEvent=="function"){const r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(s,i)=>r(s,i,t))}if(typeof e.processEvent=="function"){const r=e.processEvent.bind(e),s=Object.assign((i,o)=>r(i,o,t),{id:e.name});t.addEventProcessor(s)}["processSpan","processSegmentSpan"].forEach(r=>{const s=e[r];typeof s=="function"&&t.on(r,i=>s.call(e,i,t))}),I&&S.log(`Integration installed: ${e.name}`)}function Rv(t){return t}function Ap(){return typeof __SENTRY_BROWSER_BUNDLE__!="undefined"&&!!__SENTRY_BROWSER_BUNDLE__}function Mp(){/*! __SENTRY_SDK_SOURCE__ */return"npm"}function xp(){return!Ap()&&Object.prototype.toString.call(typeof process!="undefined"?process:0)==="[object process]"}function sn(){return typeof window!="undefined"&&(!xp()||Np())}function Np(){const t=$.process;return(t==null?void 0:t.type)==="renderer"}function Op(t,e){const n=e?"auto":"never";return[{type:"log",item_count:t.length,content_type:"application/vnd.sentry.items.log+json"},R(h({version:2},sn()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}}),{items:t})]}function Lp(t,e,n,r,s){const i={};return e!=null&&e.sdk&&(i.sdk={name:e.sdk.name,version:e.sdk.version}),!!n&&!!r&&(i.dsn=en(r)),ge(i,[Op(t,s)])}function Dp(t,e){var i;const n=(i=e!=null?e:Pp(t))!=null?i:[];if(n.length===0)return;const r=t.getOptions(),s=Lp(n,r._metadata,r.tunnel,t.getDsn(),t.getDataCollectionOptions().userInfo);Qa().set(t,[]),t.emit("flushLogs"),t.sendEnvelope(s)}function Pp(t){return Qa().get(t)}function Qa(){return Ve("clientToLogBufferMap",()=>new WeakMap)}function Fp(t,e){const n=e?"auto":"never";return[{type:"trace_metric",item_count:t.length,content_type:"application/vnd.sentry.items.trace-metric+json"},R(h({version:2},sn()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}}),{items:t})]}function Bp(t,e,n,r,s){const i={};return e!=null&&e.sdk&&(i.sdk={name:e.sdk.name,version:e.sdk.version}),!!n&&!!r&&(i.dsn=en(r)),ge(i,[Fp(t,s)])}function $p(t,e){var i;const n=(i=e!=null?e:Up(t))!=null?i:[];if(n.length===0)return;const r=t.getOptions(),s=Bp(n,r._metadata,r.tunnel,t.getDsn(),t.getDataCollectionOptions().userInfo);Za().set(t,[]),t.emit("flushMetrics"),t.sendEnvelope(s)}function Up(t){return Za().get(t)}function Za(){return Ve("clientToMetricBufferMap",()=>new WeakMap)}function Hp(t){const e={trace_id:t.trace_id,span_id:t.span_id,parent_span_id:t.parent_span_id,name:t.description||"",start_timestamp:t.start_timestamp,end_timestamp:t.timestamp||t.start_timestamp,status:!t.status||t.status==="ok"||t.status==="cancelled"?"ok":"error",is_segment:!1,attributes:h({},t.data),links:t.links};return yf(e)}function Wp(t,e){var i,o,c;if(t.type!=="transaction"||!((i=t.spans)!=null&&i.length)||!((o=t.sdkProcessingMetadata)!=null&&o.hasGenAiSpans)||e.getOptions().streamGenAiSpans===!1||Kt(e))return;const n=[],r=[];for(const a of t.spans)(c=a.op)!=null&&c.startsWith("gen_ai.")?n.push(Hp(a)):r.push(a);if(n.length===0)return;t.spans=r;const s=e.getDataCollectionOptions().userInfo?"auto":"never";return[{type:"span",item_count:n.length,content_type:"application/vnd.sentry.items.span.v2+json"},R(h({version:2},sn()&&{ingest_settings:{infer_ip:s,infer_user_agent:s}}),{items:n})]}const ni=Symbol.for("SentryBufferFullError");function ri(t=100){const e=new Set;function n(){return e.size<t}function r(o){e.delete(o)}function s(o){if(!n())return Ua(ni);const c=o();return e.add(c),c.then(()=>r(c),()=>r(c)),c}function i(o){if(!e.size)return Dn(!0);const c=Promise.allSettled(Array.from(e)).then(()=>!0);if(!o)return c;const a=[c,new Promise(u=>Ya(setTimeout(()=>u(!1),o)))];return Promise.race(a)}return{get $(){return Array.from(e)},add:s,drain:i}}const zp=60*1e3;function jp(t,e=pe()){const n=parseInt(`${t}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${t}`);return isNaN(r)?zp:r-e}function qp(t,e){return t[e]||t.all||0}function tc(t,e,n=pe()){return qp(t,e)>n}function ec(t,{statusCode:e,headers:n},r=pe()){const s=h({},t),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+jp(o,r):e===429&&(s.all=r+6e4);return s}const nc=64;function Gp(t,e,n=ri(t.bufferSize||nc)){let r={};const s=o=>n.drain(o);function i(o){const c=[];if(Vs(o,(d,f)=>{const p=ba(f);tc(r,p)?t.recordDroppedEvent("ratelimit_backoff",p):c.push(d)}),c.length===0)return Promise.resolve({});const a=ge(o[0],c),u=d=>{if(Tf(a,["client_report"])){I&&S.warn(`Dropping client report. Will not send outcomes (reason: ${d}).`);return}Vs(a,(f,p)=>{t.recordDroppedEvent(d,ba(p))})},l=()=>e({body:wf(a)}).then(d=>d.statusCode===413?(I&&S.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),u("send_error"),d):(I&&d.statusCode!==void 0&&(d.statusCode<200||d.statusCode>=300)&&S.warn(`Sentry responded with status code ${d.statusCode} to sent event.`),r=ec(r,d),d),d=>{throw u("network_error"),I&&S.error("Encountered error running transport request:",d),d});return n.add(l).then(d=>d,d=>{if(d===ni)return I&&S.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw d})}return{send:i,flush:s}}function Vp(t,e,n){const r=[{type:"client_report"},{timestamp:n||Ne(),discarded_events:t}];return ge(e?{dsn:e}:{},[r])}function rc(t){const e=[];t.message&&e.push(t.message);try{const n=t.exception.values[t.exception.values.length-1];n!=null&&n.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`))}catch(n){}return e}function Yp(t){var a,u,l;const{trace_id:e,parent_span_id:n,span_id:r,status:s,origin:i,data:o,op:c}=(u=(a=t.contexts)==null?void 0:a.trace)!=null?u:{};return{data:o!=null?o:{},description:t.transaction,op:c,parent_span_id:n,span_id:r!=null?r:"",start_timestamp:(l=t.start_timestamp)!=null?l:0,status:s,timestamp:t.timestamp,trace_id:e!=null?e:"",origin:i,profile_id:o==null?void 0:o[Us],exclusive_time:o==null?void 0:o[he],measurements:t.measurements,is_segment:!0}}function Kp(t){return{type:"transaction",timestamp:t.timestamp,start_timestamp:t.start_timestamp,transaction:t.description,contexts:{trace:{trace_id:t.trace_id,span_id:t.span_id,parent_span_id:t.parent_span_id,op:t.op,status:t.status,origin:t.origin,data:h(h(h({},t.data),t.profile_id&&{[Us]:t.profile_id}),t.exclusive_time&&{[he]:t.exclusive_time})}},measurements:t.measurements}}const kr=["forwarded","-ip","remote-","via","-user"];function Xp(t){return t===!0?{userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],urlQueryParams:!0,graphQL:{document:!0,variables:!0},genAI:{inputs:!0,outputs:!0},databaseQueryData:!0,stackFrameVariables:!0,frameContextLines:7}:{userInfo:!1,cookies:{deny:kr},httpHeaders:{request:{deny:kr},response:{deny:kr}},httpBodies:[],urlQueryParams:{deny:kr},graphQL:{document:!0,variables:!0},genAI:{inputs:!1,outputs:!1},databaseQueryData:!1,stackFrameVariables:!0,frameContextLines:7}}const Jp={userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],urlQueryParams:!0,graphQL:{document:!0,variables:!0},genAI:{inputs:!0,outputs:!0},databaseQueryData:!0,stackFrameVariables:!0,frameContextLines:5};function Qp(t){var r,s,i,o,c,a,u,l,d,f,p,m,g,y,_,T,F,w,M,v,E;const e=t.dataCollection!=null?Jp:Xp(t.sendDefaultPii),n=(r=t.dataCollection)!=null?r:{};return{userInfo:(s=n.userInfo)!=null?s:e.userInfo,cookies:(i=n.cookies)!=null?i:e.cookies,httpHeaders:{request:(c=(o=n.httpHeaders)==null?void 0:o.request)!=null?c:e.httpHeaders.request,response:(u=(a=n.httpHeaders)==null?void 0:a.response)!=null?u:e.httpHeaders.response},httpBodies:(l=n.httpBodies)!=null?l:e.httpBodies,urlQueryParams:(f=(d=n.urlQueryParams)!=null?d:n.queryParams)!=null?f:e.urlQueryParams,graphQL:{document:(m=(p=n.graphQL)==null?void 0:p.document)!=null?m:e.graphQL.document,variables:(y=(g=n.graphQL)==null?void 0:g.variables)!=null?y:e.graphQL.variables},genAI:{inputs:(T=(_=n.genAI)==null?void 0:_.inputs)!=null?T:e.genAI.inputs,outputs:(w=(F=n.genAI)==null?void 0:F.outputs)!=null?w:e.genAI.outputs},databaseQueryData:(M=n.databaseQueryData)!=null?M:e.databaseQueryData,stackFrameVariables:(v=n.stackFrameVariables)!=null?v:e.stackFrameVariables,frameContextLines:(E=n.frameContextLines)!=null?E:e.frameContextLines}}const sc="Not capturing exception because it's already been captured.",ic="Discarded session because of missing or non-string release",oc=Symbol.for("SentryInternalError"),ac=Symbol.for("SentryDoNotSendEventError"),Zp=5e3;function Rr(t){return{message:t,[oc]:!0}}function si(t){return{message:t,[ac]:!0}}function cc(t){return Ae(t)&&oc in t}function uc(t){return Ae(t)&&ac in t}function lc(t,e,n,r,s){let i=0,o,c=!1;t.on(n,()=>{i=0,clearTimeout(o),c=!1}),t.on(e,a=>{var u;if(i+=r(a),i>=8e5)s(t);else if(!c){const l=(u=t.getOptions()._flushInterval)!=null?u:Zp;l>0&&(c=!0,o=Ya(setTimeout(()=>{s(t)},l)))}}),t.on("flush",()=>{s(t)})}class th{constructor(e){var r,s,i,o,c,a,u,l;if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=ri((s=(r=e.transportOptions)==null?void 0:r.bufferSize)!=null?s:nc),this._dataCollection=Qp(e),e.dsn?this._dsn=lf(e.dsn):I&&S.warn("No DSN provided, client will not send events."),this._dsn){const d=wp(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport(R(h({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this)},e.transportOptions),{url:d}))}this._options.enableLogs=(c=(o=this._options.enableLogs)!=null?o:(i=this._options._experiments)==null?void 0:i.enableLogs)!=null?c:!0,this._options.enableLogs&&lc(this,"afterCaptureLog","flushLogs",sh,Dp),((l=(u=this._options.enableMetrics)!=null?u:(a=this._options._experiments)==null?void 0:a.enableMetrics)!=null?l:!0)&&lc(this,"afterCaptureMetric","flushMetrics",rh,$p)}captureException(e,n,r){const s=xt();if(Oo(e))return I&&S.log(sc),s;const i=h({event_id:s},n);return this._process(()=>this.eventFromException(e,i).then(o=>this._captureEvent(o,i,r)).then(o=>o),"error"),i.event_id}captureMessage(e,n,r,s){const i=h({event_id:xt()},r),o=Cs(e)?e:String(e),c=Ce(e),a=c?this.eventFromMessage(o,n,i):this.eventFromException(e,i);return this._process(()=>a.then(u=>this._captureEvent(u,i,s)),c?"unknown":"error"),i.event_id}captureEvent(e,n,r){const s=xt();if((n==null?void 0:n.originalException)&&Oo(n.originalException))return I&&S.log(sc),s;const i=h({event_id:s},n),o=e.sdkProcessingMetadata||{},c=o.capturedSpanScope,a=o.capturedSpanIsolationScope,u=dc(e.type);return this._process(()=>this._captureEvent(e,i,c||r,a),u),i.event_id}captureSession(e){this.sendSession(e),Xe(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getDataCollectionOptions(){return this._dataCollection}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){return X(this,null,function*(){const n=this._transport;if(this.emit("flush"),!n)return!0;const r=yield this._isClientDoneProcessing(e),s=yield n.flush(e);return r&&s})}close(e){return X(this,null,function*(){const n=yield this.flush(e);return this.getOptions().enabled=!1,this.emit("close"),n})}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(e){const n=this._integrations[e.name];!n&&e.beforeSetup&&e.beforeSetup(this),Ja(this,e,this._integrations),n||Xa(this,[e])}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);const r=Wp(e,this);let s=Nf(e,this._dsn,this._options._metadata,this._options.tunnel);for(const i of n.attachments||[])s=Sa(s,Cf(i));r&&(s=Sa(s,r)),this.sendEnvelope(s).then(i=>this.emit("afterSendEvent",e,i))}sendSession(e){const{release:n,environment:r=qs}=this._options;if("aggregates"in e){const i=e.attrs||{};if(!i.release&&!n){I&&S.warn(ic);return}i.release=i.release||n,i.environment=i.environment||r,e.attrs=i}else{if(!e.release&&!n){I&&S.warn(ic);return}e.release=e.release||n,e.environment=e.environment||r}this.emit("beforeSendSession",e);const s=xf(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(s)}recordDroppedEvent(e,n,r=1){if(this._options.sendClientReports){const s=`${e}:${n}`;I&&S.log(`Recording outcome: "${s}"${r>1?` (${r} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+r}}on(e,n){const r=this._hooks[e]=this._hooks[e]||new Set,s=(...i)=>n(...i);return r.add(s),()=>{r.delete(s)}}emit(e,...n){const r=this._hooks[e];r&&r.forEach(s=>s(...n))}sendEnvelope(e){return X(this,null,function*(){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)try{return yield this._transport.send(e)}catch(n){return I&&S.error("Error while sending envelope:",n),{}}return I&&S.error("Transport disabled"),{}})}registerCleanup(e){}dispose(){}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=Cp(this,e),Xa(this,e)}_updateSessionFromEvent(e,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=e.status==="ok";(o&&e.errors===0||o&&r)&&(Xe(e,R(h({},r&&{status:"crashed"}),{errors:e.errors||Number(s||r)})),this.captureSession(e))}_isClientDoneProcessing(e){return X(this,null,function*(){let n=0;for(;!e||n<e;){if(yield new Promise(r=>setTimeout(r,1)),!this._numProcessing)return!0;n++}return!1})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,n,r,s){const i=this.getOptions(),o=this.getIntegrationNames();return!n.integrations&&o.length&&(n.integrations=o),this.emit("preprocessEvent",e,n),e.type||s.setLastEventId(e.event_id||n.event_id),za(i,e,n,r,this,s).then(c=>{var u;if(c===null)return c;this.emit("postprocessEvent",c,n),c.contexts=h({trace:h(h({},(u=c.contexts)==null?void 0:u.trace),zd(r))},c.contexts);const a=Gs(this,r);return c.sdkProcessingMetadata=h({dynamicSamplingContext:a},c.sdkProcessingMetadata),c})}_captureEvent(e,n={},r=V(),s=vt()){return I&&ii(e)&&S.log(`Captured error event \`${rc(e)[0]||"<unknown>"}\``),this._processEvent(e,n,r,s).then(i=>i.event_id,i=>{I&&(uc(i)?S.log(i.message):cc(i)?S.warn(i.message):S.warn(i))})}_processEvent(e,n,r,s){const i=this.getOptions(),{sampleRate:o}=i,c=fc(e),a=ii(e),l=`before send for type \`${e.type||"error"}\``,d=typeof o=="undefined"?void 0:Oe(o),f=dc(e.type);return this._prepareEvent(e,n,r,s).then(p=>{var y;if(p===null)throw this.recordDroppedEvent("event_processor",f),si("An event processor returned `null`, will not send event.");if(((y=n.data)==null?void 0:y.__sentry__)===!0)return p;const g=nh(this,i,p,n);return eh(g,l)}).then(p=>{var y;if(p===null){if(this.recordDroppedEvent("before_send",f),c){const T=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",T)}throw si(`${l} returned \`null\`, will not send event.`)}const m=r.getSession()||s.getSession();if(a&&m&&this._updateSessionFromEvent(m,p),a&&typeof d=="number"&&fe()>d)throw this.recordDroppedEvent("sample_rate","error"),si(`Discarding event because it's not included in the random sample (sampling rate = ${o})`);if(c){const _=((y=p.sdkProcessingMetadata)==null?void 0:y.spanCountBeforeProcessing)||0,T=p.spans?p.spans.length:0,F=_-T;F>0&&this.recordDroppedEvent("before_send","span",F)}const g=p.transaction_info;if(c&&g&&p.transaction!==e.transaction){const _="custom";p.transaction_info=R(h({},g),{source:_})}return this.sendEvent(p,n),p}).then(null,p=>{throw uc(p)||cc(p)?p:(this.captureException(p,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:p}),Rr(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
Reason: ${p}`))})}_process(e,n){this._numProcessing++,this._promiseBuffer.add(e).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===ni&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map(([n,r])=>{const[s,i]=n.split(":");return{reason:s,category:i,quantity:r}})}_flushOutcomes(){I&&S.log("Flushing outcomes...");const e=this._clearOutcomes();if(e.length===0){I&&S.log("No outcomes to send");return}if(!this._dsn){I&&S.log("No dsn provided, will not send outcomes");return}I&&S.log("Sending outcomes:",e);const n=Vp(e,this._options.tunnel&&en(this._dsn));this.sendEnvelope(n)}}function dc(t){return t==="replay_event"?"replay":t||"error"}function eh(t,e){const n=`${e} must return \`null\` or a valid event.`;if(wn(t))return t.then(r=>{if(!pr(r)&&r!==null)throw Rr(n);return r},r=>{throw Rr(`${e} rejected with ${r}`)});if(!pr(t)&&t!==null)throw Rr(n);return t}function nh(t,e,n,r){const{beforeSend:s,beforeSendTransaction:i,ignoreSpans:o}=e,c=!ya(e.beforeSendSpan)&&e.beforeSendSpan;let a=n;if(ii(a)&&s)return s(a,r);if(fc(a)){if(c||o){const u=Yp(a);if((o==null?void 0:o.length)&&On({description:u.description,op:u.op,attributes:u.data},o))return null;if(c){const l=c(u);l?a=Cn(n,Kp(l)):js()}if(a.spans){const l=[],d=a.spans;for(const p of d){if((o==null?void 0:o.length)&&On({description:p.description,op:p.op,attributes:p.data},o)){vf(d,p);continue}if(c){const m=c(p);m?l.push(m):(js(),l.push(p))}else l.push(p)}const f=a.spans.length-l.length;f&&t.recordDroppedEvent("before_send","span",f),a.spans=l}}if(i){if(a.spans){const u=a.spans.length;a.sdkProcessingMetadata=R(h({},n.sdkProcessingMetadata),{spanCountBeforeProcessing:u})}return i(a,r)}}return a}function ii(t){return t.type===void 0}function fc(t){return t.type==="transaction"}function rh(t){let e=0;return t.name&&(e+=t.name.length*2),e+=8,e+pc(t.attributes)}function sh(t){let e=0;return t.message&&(e+=t.message.length*2),e+pc(t.attributes)}function pc(t){if(!t)return 0;let e=0;return Object.values(t).forEach(n=>{Array.isArray(n)?e+=n.length*hc(n[0]):Ce(n)?e+=hc(n):e+=100}),e}function hc(t){return typeof t=="string"?t.length*2:typeof t=="number"?8:typeof t=="boolean"?4:0}function ih(t,e){e.debug===!0&&(I?S.enable():ue(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),V().update(e.initialScope);const r=new t(e);return oh(r),r.init(),r}function oh(t){V().setClient(t)}const ah="thismessage:/";function Cr(t){return"isRelative"in t}function Bn(t,e){const n=t.indexOf("://")<=0&&t.indexOf("//")!==0,r=e!=null?e:n?ah:void 0;try{if("canParse"in URL&&!URL.canParse(t,r))return;const s=new URL(t,r);return n?{isRelative:n,pathname:s.pathname,search:s.search,hash:s.hash}:s}catch(s){}}function mc(t){if(Cr(t))return t.pathname;const e=new URL(t);return e.search="",e.hash="",["80","443"].includes(e.port)&&(e.port=""),e.password&&(e.password="%filtered%"),e.username&&(e.username="%filtered%"),e.toString()}function Pe(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}function ch(t){return t.split(/[?#]/,1)[0]}function Ht(t,e=!0){if(t.startsWith("data:")){const n=t.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",s=t.includes(";base64,"),i=t.indexOf(",");let o="";if(e&&i!==-1){const c=t.slice(i+1);o=c.length>10?`${c.slice(0,10)}... [truncated]`:c}return`data:${r}${s?",base64":""}${o?`,${o}`:""}`}return t}function uh(t,e){const n=e==null?void 0:e.getDsn(),r=e==null?void 0:e.getOptions().tunnel;return dh(t,n)||lh(t,r)}function lh(t,e){return e?gc(t)===gc(e):!1}function dh(t,e){const n=Bn(t);return!n||Cr(n)||!e?!1:fh(n.hostname,e.host)&&/(^|&|\?)sentry_key=/.test(n.search)}function fh(t,e){return t===e||e.length>0&&t.endsWith(`.${e}`)}function gc(t){return t[t.length-1]==="/"?t.slice(0,-1):t}function ph(t){var e;"aggregates"in t?((e=t.attrs)==null?void 0:e.ip_address)===void 0&&(t.attrs=R(h({},t.attrs),{ip_address:"{{auto}}"})):t.ipAddress===void 0&&(t.ipAddress="{{auto}}")}function hh(t,e,n=[e],r="npm"){const s=(t._metadata=t._metadata||{}).sdk=t._metadata.sdk||{};s.name||(s.name=`sentry.javascript.${e}`,s.packages=n.map(i=>({name:`${r}:@sentry/${i}`,version:ke})),s.version=ke)}function _c(t={}){const e=t.client||U();if(!Sp()||!e)return{};const n=ce(),r=Qe(n);if(r.getTraceData)return r.getTraceData(t);const s=t.scope||V(),i=t.span||bt(),o=nn(i)&&!Ot(e.getOptions());if(!i&&Hd())return{};const c=i&&!o?gf(i):mh(s),a=i?me(i):Gs(e,s),u=Zd(a);if(!Qo.test(c))return S.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const d={"sentry-trace":c,baggage:u};return t.propagateTraceparent&&(d.traceparent=i&&!o?_f(i):gh(s)),d}function mh(t){const{traceId:e,sampled:n,propagationSpanId:r}=t.getPropagationContext();return Zo(e,r,n)}function gh(t){const{traceId:e,sampled:n,propagationSpanId:r}=t.getPropagationContext();return ta(e,r,n)}const _h=100;function Se(t,e){const n=U(),r=vt();if(!n)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:i=_h}=n.getOptions();if(i<=0)return;const o=Ne(),c=h({timestamp:o},t),a=s?ue(()=>s(c,e)):c;a!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",a,e),r.addBreadcrumb(a,i))}const yh="FunctionToString",yc=new WeakMap,Sh=()=>({name:yh,setupOnce(){const t=Function.prototype.toString;try{Function.prototype.toString=function(...e){const n=Ms(this);let r;try{yc.has(U())&&n!==void 0&&(r=n)}catch(s){}return t.apply(r!=null?r:this,e)}}catch(e){}},setup(t){yc.set(t,!0)}}),Eh=[/^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$/],bh="EventFilters",vh=(t={})=>{let e;return{name:bh,setup(n){const r=n.getOptions();e=Sc(t,r)},processEvent(n,r,s){if(!e){const i=s.getOptions();e=Sc(t,i)}return Th(n,e)?null:n}}},Ih=(t={})=>R(h({},vh(t)),{name:"InboundFilters"});function Sc(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:Eh],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[]]}}function Th(t,e){if(t.type){if(t.type==="transaction"&&kh(t,e.ignoreTransactions))return I&&S.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
Event: ${Me(t)}`),!0}else{if(wh(t,e.ignoreErrors))return I&&S.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
Event: ${Me(t)}`),!0;if(Mh(t))return I&&S.warn(`Event dropped due to not having an error message, error type or stacktrace.
Event: ${Me(t)}`),!0;if(Rh(t,e.denyUrls))return I&&S.warn(`Event dropped due to being matched by \`denyUrls\` option.
Event: ${Me(t)}.
Url: ${Ar(t)}`),!0;if(!Ch(t,e.allowUrls))return I&&S.warn(`Event dropped due to not being matched by \`allowUrls\` option.
Event: ${Me(t)}.
Url: ${Ar(t)}`),!0}return!1}function wh(t,e){return e!=null&&e.length?rc(t).some(n=>Vt(n,e)):!1}function kh(t,e){if(!(e!=null&&e.length))return!1;const n=t.transaction;return n?Vt(n,e):!1}function Rh(t,e){if(!(e!=null&&e.length))return!1;const n=Ar(t);return n?Vt(n,e):!1}function Ch(t,e){if(!(e!=null&&e.length))return!0;const n=Ar(t);return n?Vt(n,e):!0}function Ah(t=[]){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function Ar(t){var e,n,r;try{const s=[...(n=(e=t.exception)==null?void 0:e.values)!=null?n:[]].reverse().find(o=>{var c,a,u;return((c=o.mechanism)==null?void 0:c.parent_id)===void 0&&((u=(a=o.stacktrace)==null?void 0:a.frames)==null?void 0:u.length)}),i=(r=s==null?void 0:s.stacktrace)==null?void 0:r.frames;return i?Ah(i):null}catch(s){return I&&S.error(`Cannot extract url for event ${Me(t)}`),null}}function Mh(t){var e,n;return(n=(e=t.exception)==null?void 0:e.values)!=null&&n.length?!t.message&&!t.exception.values.some(r=>r.stacktrace||r.type&&r.type!=="Error"||r.value):!1}function xh(t,e,n,r,s,i){var c;if(!((c=s.exception)!=null&&c.values)||!i||!Qt(i.originalException))return;const o=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;o&&(s.exception.values=oi(t,e,r,i.originalException,n,s.exception.values,o,0))}function oi(t,e,n,r,s,i,o,c){if(i.length>=n+1)return i;let a=[...i];if(Qt(r[s])){bc(o,c,r);const u=t(e,r[s]),l=a.length;vc(u,s,l,c),a=oi(t,e,n,r[s],s,[u,...a],u,l)}return Ec(r)&&r.errors.forEach((u,l)=>{if(Qt(u)){bc(o,c,r);const d=t(e,u),f=a.length;vc(d,`errors[${l}]`,f,c),a=oi(t,e,n,u,s,[d,...a],d,f)}}),a}function Ec(t){return Array.isArray(t.errors)}function bc(t,e,n){t.mechanism=R(h(h({handled:!0,type:"auto.core.linked_errors"},Ec(n)&&{is_exception_group:!0}),t.mechanism),{exception_id:e})}function vc(t,e,n,r){t.mechanism=R(h({handled:!0},t.mechanism),{type:"chained",source:e,exception_id:n,parent_id:r})}function Nh(t){return Qt(t)&&"__sentry_fetch_url_host__"in t&&typeof t.__sentry_fetch_url_host__=="string"}function Ic(t){return Nh(t)?`${t.message} (${t.__sentry_fetch_url_host__})`:t.message}const Tc=new Set([]);function Oh(t){const e="console",n=le(e,t);return de(e,Lh),n}const wc=new Set;function Lh(){"console"in $&&Jl.forEach(function(t){wc.has(t)||!(t in $.console)||(wc.add(t),kt($.console,t,function(e){return dr[t]=e,function(...n){const r=n[0],s=dr[t],i=Tc.size&&typeof r=="string"&&Vt(r,Tc);i||Pt("console",{args:n,level:t}),(!i||I&&S.isEnabled())&&(s==null||s.apply($.console,n))}}))})}function kc(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}const Dh="Dedupe",Ph=()=>{let t;return{name:Dh,processEvent(e){if(e.type)return e;try{if(Fh(e,t))return I&&S.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(n){}return t=e}}};function Fh(t,e){return e?!!(Bh(t,e)||$h(t,e)):!1}function Bh(t,e){const n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Cc(t,e)||!Rc(t,e))}function $h(t,e){const n=Ac(e),r=Ac(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Cc(t,e)||!Rc(t,e))}function Rc(t,e){let n=So(t),r=So(e);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 Cc(t,e){let n=t.fingerprint,r=e.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch(s){return!1}}function Ac(t){var e,n;return(n=(e=t.exception)==null?void 0:e.values)==null?void 0:n[0]}const Uh="ConversationId",Hh=()=>({name:Uh,setup(t){t.on("spanStart",e=>{const n=V().getScopeData(),r=vt().getScopeData(),s=n.conversationId||r.conversationId;if(s){const{op:i,data:o,description:c}=j(e);if(!(i!=null&&i.startsWith("gen_ai."))&&!o["ai.operationId"]&&!(c!=null&&c.startsWith("ai.")))return;e.setAttribute(Gd,s)}})}});function Wh(t,e,n,r,s){if(!t.fetchData)return;const{method:i,url:o}=t.fetchData,c=Ot()&&e(o);if(t.endTimestamp){const g=t.fetchData.__span;if(!g)return;const y=r[g];y&&(c&&(qh(y,t),zh(y,t,s)),delete r[g]);return}const{spanOrigin:a="auto.http.browser",propagateTraceparent:u=!1}=typeof s=="object"?s:{spanOrigin:s},l=U(),d=!!bt(),f=d||!!l&&Kt(l),p=c&&f?_e(Yh(o,i,a)):new De,m=xa(p)&&d?void 0:p;if(c&&!f&&(l==null||l.recordDroppedEvent("no_parent_span","span")),t.fetchData.__span=p.spanContext().spanId,r[p.spanContext().spanId]=p,n(t.fetchData.url)){const g=t.args[0],y=h({},t.args[1]||{}),_=jh(g,y,Ot()&&f?m:void 0,u);_&&(t.args[1]=y,y.headers=_)}if(l){const g={input:t.args,response:t.response,startTimestamp:t.startTimestamp,endTimestamp:t.endTimestamp};l.emit("beforeOutgoingRequestSpan",p,g)}return p}function zh(t,e,n){var s;const r=typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0;r==null||r(t,{headers:(s=e.response)==null?void 0:s.headers,error:e.error})}function jh(t,e,n,r){const s=_c({span:n,propagateTraceparent:r}),i=s["sentry-trace"],o=s.baggage,c=s.traceparent;if(!i)return;const a=e.headers||(As(t)?t.headers:void 0);if(a)if(Gh(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?Mr(l)||u.set("baggage",`${l},${o}`):u.set("baggage",o)}return u}else if(Vh(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"&&Mr(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(g=>Mr(g)):Mr(d));o&&!p&&f.push(o);const m=Object.assign({},a,h({"sentry-trace":u!=null?u:i},f.length>0&&{baggage:f.join(",")}));return r&&c&&!l&&(m.traceparent=c),m}else return h(h({"sentry-trace":i},o&&{baggage:o}),c&&{traceparent:c})}function qh(t,e){var n,r;if(e.response){jo(t,e.response.status);const s=(r=(n=e.response)==null?void 0:n.headers)==null?void 0:r.get("content-length");if(s){const i=parseInt(s);i>0&&t.setAttribute("http.response_content_length",i)}}else e.error&&t.setStatus({code:yt,message:"internal_error"});t.end()}function Mr(t){return typeof t!="string"?!1:t.split(",").some(e=>e.trim().startsWith(Sr))}function Gh(t){return typeof Headers!="undefined"&&mr(t,Headers)}function Vh(t){return Array.isArray(t)?t.every(e=>Array.isArray(e)&&e.length===2&&typeof e[0]=="string"):!1}function Yh(t,e,n){if(t.startsWith("data:")){const i=Ht(t);return{name:`${e} ${i}`,attributes:Mc(t,void 0,e,n)}}const r=Bn(t),s=r?mc(r):t;return{name:`${e} ${s}`,attributes:Mc(t,r,e,n)}}function Mc(t,e,n,r){const s={url:Ht(t),type:"fetch","http.method":n,[pt]:r,[Nt]:"http.client"};return e&&(Cr(e)||(s[Da]=Ht(e.href),s[rn]=Ht(e.href),s["server.address"]=e.host),e.search&&(s["http.query"]=e.search),e.hash&&(s["http.fragment"]=e.hash)),s}function xc(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}const $n=$;function Kh(){return"history"in $n&&!!$n.history}function Xh(){if(!("fetch"in $n))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch(t){return!1}}function ai(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function Jh(){var n;if(typeof EdgeRuntime=="string")return!0;if(!Xh())return!1;if(ai($n.fetch))return!0;let t=!1;const e=$n.document;if(e&&typeof e.createElement=="function")try{const r=e.createElement("iframe");r.hidden=!0,e.head.appendChild(r),(n=r.contentWindow)!=null&&n.fetch&&(t=ai(r.contentWindow.fetch)),e.head.removeChild(r)}catch(r){I&&S.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return t}function ci(t,e){const n="fetch",r=le(n,t);return de(n,()=>Nc(void 0,e)),r}function Qh(t){const e="fetch-body-resolved",n=le(e,t);return de(e,()=>Nc(tm)),n}function Nc(t,e=!1){e&&!Jh()||kt($,"fetch",function(n){return function(...r){const s=new Error,{method:i,url:o}=em(r),c={args:r,fetchData:{method:i,url:o},startTimestamp:mt()*1e3,virtualError:s,headers:nm(r)};return t||Pt("fetch",h({},c)),n.apply($,r).then(a=>X(this,null,function*(){return t?t(a):Pt("fetch",R(h({},c),{endTimestamp:mt()*1e3,response:a})),a}),a=>{var f;Pt("fetch",R(h({},c),{endTimestamp:mt()*1e3,error:a})),Qt(a)&&a.stack===void 0&&(a.stack=s.stack,Et(a,"framesToPop",1));const u=U(),l=(f=u==null?void 0:u.getOptions().enhanceFetchErrorMessages)!=null?f:"always";if(l!==!1&&Qt(a)&&a.name==="TypeError"&&(a.message==="Failed to fetch"||a.message==="Load failed"||a.message==="NetworkError when attempting to fetch resource."))try{const m=new URL(c.fetchData.url).host;l==="always"?a.message=`${a.message} (${m})`:Et(a,"__sentry_fetch_url_host__",m)}catch(p){}throw a})}})}function Zh(t,e){return X(this,null,function*(){if(t!=null&&t.body){const n=t.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}=yield r.read();clearTimeout(o),c&&(e(),i=!1)}catch(c){i=!1}finally{clearTimeout(o)}}clearTimeout(s),r.releaseLock(),n.cancel().then(null,()=>{})}})}function tm(t){let e;try{e=t.clone()}catch(n){return}Zh(e,()=>{Pt("fetch-body-resolved",{endTimestamp:mt()*1e3,response:t})})}function xr(t,e){return Ae(t)&&!!t[e]}function Oc(t){return typeof t=="string"?t:t?xr(t,"url")?t.url:t.toString?t.toString():"":""}function em(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){const[n,r]=t;return{url:Oc(n),method:xr(r,"method")?String(r.method).toUpperCase():As(n)&&xr(n,"method")?String(n.method).toUpperCase():"GET"}}const e=t[0];return{url:Oc(e),method:xr(e,"method")?String(e.method).toUpperCase():"GET"}}function nm(t){const[e,n]=t;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(As(e))return new Headers(e.headers)}catch(r){}}const Lc=$;function Fe(){try{return Lc.document.location.href}catch(t){return""}}function Dc(t,e=5){if(!Lc.HTMLElement)return null;let n=t;for(let r=0;r<e;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}const W=$;let ui=0;function Pc(){return ui>0}function rm(){ui++,setTimeout(()=>{ui--})}function on(t,e={}){function n(s){return typeof s=="function"}if(!n(t))return t;try{if(Object.prototype.hasOwnProperty.call(t,"__sentry_wrapped__")){const i=t.__sentry_wrapped__;return typeof i=="function"?i:t}if(Ms(t))return t}catch(s){return t}const r=function(...s){$._sentryWrappedDepth=($._sentryWrappedDepth||0)+1;try{const i=s.map(o=>on(o,e));return t.apply(this,i)}catch(i){throw rm(),Bs(o=>{o.addEventProcessor(c=>(e.mechanism&&(Ds(c,void 0,void 0),xe(c,e.mechanism)),c.extra=R(h({},c.extra),{arguments:s}),c)),ti(i)}),i}finally{$._sentryWrappedDepth=($._sentryWrappedDepth||0)-1}};try{for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=t[s])}catch(s){}ko(r,t),Et(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch(s){}return r}function Nr(){const t=Fe(),{referrer:e}=W.document||{},{userAgent:n}=W.navigator||{},r=h(h({},e&&{Referer:e}),n&&{"User-Agent":n});return{url:t,headers:r}}function li(t,e){const n=Or(t,e),r={type:cm(e),value:um(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function sm(t,e,n,r){const s=U(),i=s==null?void 0:s.getOptions().normalizeDepth,o=hm(e),c={__serialized__:Ao(e,i)};if(o)return{exception:{values:[li(t,o)]},extra:c};const a={exception:{values:[{type:hr(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:fm(e,{isUnhandledRejection:r})}]},extra:c};if(n){const u=Or(t,n);u.length&&(a.exception.values[0].stacktrace={frames:u})}return a}function di(t,e){return{exception:{values:[li(t,e)]}}}function Or(t,e){const n=e.stacktrace||e.stack||"",r=om(e),s=am(e);try{return t(n,r,s)}catch(i){}return[]}const im=/Minified React error #\d+;/i;function om(t){return t&&im.test(t.message)?1:0}function am(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function Fc(t){return typeof WebAssembly!="undefined"&&typeof WebAssembly.Exception!="undefined"?t instanceof WebAssembly.Exception:!1}function cm(t){const e=t==null?void 0:t.name;return!e&&Fc(t)?t.message&&Array.isArray(t.message)&&t.message.length==2?t.message[0]:"WebAssembly.Exception":e}function um(t){const e=t==null?void 0:t.message;return Fc(t)?Array.isArray(t.message)&&t.message.length==2?t.message[1]:"wasm exception":e?e.error&&typeof e.error.message=="string"?Ic(e.error):Ic(t):"No error message"}function lm(t,e,n,r){const s=(n==null?void 0:n.syntheticException)||void 0,i=fi(t,e,s,r);return xe(i),i.level="error",n!=null&&n.event_id&&(i.event_id=n.event_id),Dn(i)}function dm(t,e,n="info",r,s){const i=(r==null?void 0:r.syntheticException)||void 0,o=pi(t,e,i,s);return o.level=n,r!=null&&r.event_id&&(o.event_id=r.event_id),Dn(o)}function fi(t,e,n,r,s){var o,c;let i;if(To(e)&&e.error)return di(t,e.error);if(wo(e)||cd(e)){const a=e;if("stack"in e){i=di(t,e);const u=(c=(o=i.exception)==null?void 0:o.values)==null?void 0:c[0];if(r&&n&&u&&!u.stacktrace){const l=Or(t,n);l.length&&(u.stacktrace={frames:l},xe(i,{synthetic:!0}))}}else{const u=a.name||(wo(a)?"DOMError":"DOMException"),l=a.message?`${u}: ${a.message}`:u;i=pi(t,l,n,r),Ds(i,l)}return"code"in a&&(i.tags=R(h({},i.tags),{"DOMException.code":`${a.code}`})),i}return Qt(e)?di(t,e):pr(e)||hr(e)?(i=sm(t,e,n,s),xe(i,{synthetic:!0}),i):(i=pi(t,e,n,r),Ds(i,`${e}`,void 0),xe(i,{synthetic:!0}),i)}function pi(t,e,n,r){const s={};if(r&&n){const i=Or(t,n);i.length&&(s.exception={values:[{value:e,stacktrace:{frames:i}}]}),xe(s,{synthetic:!0})}if(Cs(e)){const{__sentry_template_string__:i,__sentry_template_values__:o}=e;return s.logentry={message:i,params:o},s}return s.message=e,s}function fm(t,{isUnhandledRejection:e}){const n=ld(t),r=e?"promise rejection":"exception";return To(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:hr(t)?`Event \`${pm(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function pm(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(e){}}function hm(t){return Object.values(t).find(Qt)}class mm extends th{constructor(e){var o;const n=gm(e),r=W.SENTRY_SDK_SOURCE||Mp();hh(n,"browser",["browser"],r),super(n);const{userInfo:s}=this.getDataCollectionOptions();(o=n._metadata)!=null&&o.sdk&&(n._metadata.sdk.settings=h({infer_ip:s?"auto":"never"},n._metadata.sdk.settings));const{sendClientReports:i}=this._options;W.document&&W.document.addEventListener("visibilitychange",()=>{W.document.visibilityState==="hidden"&&(i&&this._flushOutcomes(),queueMicrotask(()=>{this.flush()}))}),s&&this.on("beforeSendSession",ph)}eventFromException(e,n){return lm(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return dm(this._options.stackParser,e,n,r,this._options.attachStacktrace)}_prepareEvent(e,n,r,s){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r,s)}}function gm(t){var e;return h({release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:(e=W.SENTRY_RELEASE)==null?void 0:e.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0},t)}const Wt=typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__,L=$,_m=(t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good",Un=(t,e,n,r)=>{let s,i;return o=>{e.value>=0&&(o||r)&&(i=e.value-(s!=null?s:0),(i||s===void 0)&&(s=e.value,e.delta=i,e.rating=_m(e.value,n),t(e)))}},Hn=(t=!0)=>{var n,r;const e=(r=(n=L.performance)==null?void 0:n.getEntriesByType)==null?void 0:r.call(n,"navigation")[0];if(!t||e&&e.responseStart>0&&e.responseStart<performance.now())return e},an=()=>{var e;const t=Hn();return(e=t==null?void 0:t.activationStart)!=null?e:0};function Ee(t,e,n){L.document&&L.addEventListener(t,e,n)}function Lr(t,e,n){L.document&&L.removeEventListener(t,e,n)}let cn=-1;const Bc=new Set,ym=()=>{var t,e;return((t=L.document)==null?void 0:t.visibilityState)==="hidden"&&!((e=L.document)!=null&&e.prerendering)?0:1/0},Dr=t=>{if(Sm(t)&&cn>-1){if(t.type==="visibilitychange"||t.type==="pagehide")for(const e of Bc)e();isFinite(cn)||(cn=t.type==="visibilitychange"?t.timeStamp:0,Lr("prerenderingchange",Dr,!0))}},Wn=()=>{var t;if(L.document&&cn<0){const e=an(),n=L.document.prerendering||(t=globalThis.performance.getEntriesByType("visibility-state").filter(r=>r.name==="hidden"&&r.startTime>e)[0])==null?void 0:t.startTime;cn=n!=null?n:ym(),Ee("visibilitychange",Dr,!0),Ee("pagehide",Dr,!0),Ee("prerenderingchange",Dr,!0)}return{get firstHiddenTime(){return cn},onHidden(e){Bc.add(e)}}};function Sm(t){var e;return t.type==="pagehide"||((e=L.document)==null?void 0:e.visibilityState)==="hidden"}const Em=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,zn=(t,e=-1)=>{var i,o;const n=Hn();let r="navigate";return n&&(((i=L.document)==null?void 0:i.prerendering)||an()>0?r="prerender":(o=L.document)!=null&&o.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:t,value:e,rating:"good",delta:0,entries:[],id:Em(),navigationType:r}},hi=new WeakMap;function mi(t,e){try{return hi.get(t)||hi.set(t,new e),hi.get(t)}catch(n){return new e}}class bm{constructor(){this._sessionValue=0,this._sessionEntries=[]}_processEntry(e){var s;if(e.hadRecentInput)return;const n=this._sessionEntries[0],r=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&n&&r&&e.startTime-r.startTime<1e3&&e.startTime-n.startTime<5e3?(this._sessionValue+=e.value,this._sessionEntries.push(e)):(this._sessionValue=e.value,this._sessionEntries=[e]),(s=this._onAfterProcessingUnexpectedShift)==null||s.call(this,e)}}const un=(t,e,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const r=new PerformanceObserver(s=>{Promise.resolve().then(()=>{e(s.getEntries())})});return r.observe(h({type:t,buffered:!0},n)),r}}catch(r){}},gi=t=>{let e=!1;return()=>{e||(t(),e=!0)}},Pr=t=>{var e;(e=L.document)!=null&&e.prerendering?addEventListener("prerenderingchange",()=>t(),!0):t()},vm=[1800,3e3],Im=(t,e={})=>{Pr(()=>{const n=Wn(),r=zn("FCP");let s;const o=un("paint",c=>{for(const a of c)a.name==="first-contentful-paint"&&(o.disconnect(),a.startTime<n.firstHiddenTime&&(r.value=Math.max(a.startTime-an(),0),r.entries.push(a),s(!0)))});o&&(s=Un(t,r,vm,e.reportAllChanges))})},Tm=[.1,.25],wm=(t,e={})=>{Im(gi(()=>{var a;const n=zn("CLS",0);let r;const s=Wn(),i=mi(e,bm),o=u=>{for(const l of u)i._processEntry(l);i._sessionValue>n.value&&(n.value=i._sessionValue,n.entries=i._sessionEntries,r())},c=un("layout-shift",o);c&&(r=Un(t,n,Tm,e.reportAllChanges),s.onHidden(()=>{o(c.takeRecords()),r(!0)}),(a=L==null?void 0:L.setTimeout)==null||a.call(L,r))}))};let $c=0,_i=1/0,Fr=0;const km=t=>{t.forEach(e=>{e.interactionId&&(_i=Math.min(_i,e.interactionId),Fr=Math.max(Fr,e.interactionId),$c=Fr?(Fr-_i)/7+1:0)})};let yi;const Uc=()=>yi?$c:performance.interactionCount||0,Rm=()=>{"interactionCount"in performance||yi||(yi=un("event",km,{type:"event",buffered:!0,durationThreshold:0}))},Si=10;let Hc=0;const Cm=()=>Uc()-Hc;class Am{constructor(){this._longestInteractionList=[],this._longestInteractionMap=new Map}_resetInteractions(){Hc=Uc(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const e=Math.min(this._longestInteractionList.length-1,Math.floor(Cm()/50));return this._longestInteractionList[e]}_processEntry(e){var s,i;if((s=this._onBeforeProcessingEntry)==null||s.call(this,e),!(e.interactionId||e.entryType==="first-input"))return;const n=this._longestInteractionList.at(-1);let r=this._longestInteractionMap.get(e.interactionId);if(r||this._longestInteractionList.length<Si||e.duration>n._latency){if(r?e.duration>r._latency?(r.entries=[e],r._latency=e.duration):e.duration===r._latency&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],_latency:e.duration},this._longestInteractionMap.set(r.id,r),this._longestInteractionList.push(r)),this._longestInteractionList.sort((o,c)=>c._latency-o._latency),this._longestInteractionList.length>Si){const o=this._longestInteractionList.splice(Si);for(const c of o)this._longestInteractionMap.delete(c.id)}(i=this._onAfterProcessingINPCandidate)==null||i.call(this,r)}}}const Ei=t=>{var n;const e=L.requestIdleCallback||L.setTimeout;((n=L.document)==null?void 0:n.visibilityState)==="hidden"?t():(t=gi(t),Ee("visibilitychange",t,{once:!0,capture:!0}),Ee("pagehide",t,{once:!0,capture:!0}),e(()=>{t(),Lr("visibilitychange",t,{capture:!0}),Lr("pagehide",t,{capture:!0})}))},Mm=[200,500],xm=40,Nm=(t,e={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=Wn();Pr(()=>{var a;Rm();const r=zn("INP");let s;const i=mi(e,Am),o=u=>{Ei(()=>{for(const d of u)i._processEntry(d);const l=i._estimateP98LongestInteraction();l&&l._latency!==r.value&&(r.value=l._latency,r.entries=l.entries,s())})},c=un("event",o,{durationThreshold:(a=e.durationThreshold)!=null?a:xm});s=Un(t,r,Mm,e.reportAllChanges),c&&(c.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{o(c.takeRecords()),s(!0)}))})};class Om{_processEntry(e){var n;(n=this._onBeforeProcessingEntry)==null||n.call(this,e)}}const Lm=[2500,4e3],Dm=(t,e={})=>{Pr(()=>{const n=Wn(),r=zn("LCP");let s;const i=mi(e,Om),o=a=>{e.reportAllChanges||(a=a.slice(-1));for(const u of a)i._processEntry(u),u.startTime<n.firstHiddenTime&&(r.value=Math.max(u.startTime-an(),0),r.entries=[u],s())},c=un("largest-contentful-paint",o);if(c){s=Un(t,r,Lm,e.reportAllChanges);const a=gi(()=>{o(c.takeRecords()),c.disconnect(),s(!0)}),u=l=>{l.isTrusted&&(Ei(a),Lr(l.type,u,{capture:!0}))};for(const l of["keydown","click","visibilitychange"])Ee(l,u,{capture:!0})}})},Pm=[800,1800],bi=t=>{var e,n;(e=L.document)!=null&&e.prerendering?Pr(()=>bi(t)):((n=L.document)==null?void 0:n.readyState)!=="complete"?addEventListener("load",()=>bi(t),!0):setTimeout(t)},Fm=(t,e={})=>{const n=zn("TTFB"),r=Un(t,n,Pm,e.reportAllChanges);bi(()=>{const s=Hn();s&&(n.value=Math.max(s.responseStart-an(),0),n.entries=[s],r(!0))})},jn={},Br={};let Wc,zc,jc,qc;function $r(t,e=!1){return Hr("cls",t,$m,Wc,e)}function Ur(t,e=!1){return Hr("lcp",t,Um,zc,e)}function Bm(t){return Hr("ttfb",t,Hm,jc)}function vi(t){return Hr("inp",t,Wm,qc)}function Be(t,e){return Gc(t,e),Br[t]||(zm(t),Br[t]=!0),Vc(t,e)}function qn(t,e){const n=jn[t];if(!!(n!=null&&n.length))for(const r of n)try{r(e)}catch(s){Wt&&S.error(`Error while triggering instrumentation handler.
Type: ${t}
Name: ${Jt(r)}
Error:`,s)}}function $m(){return wm(t=>{qn("cls",{metric:t}),Wc=t},{reportAllChanges:!0})}function Um(){return Dm(t=>{qn("lcp",{metric:t}),zc=t},{reportAllChanges:!0})}function Hm(){return Fm(t=>{qn("ttfb",{metric:t}),jc=t})}function Wm(){return Nm(t=>{qn("inp",{metric:t}),qc=t})}function Hr(t,e,n,r,s=!1){Gc(t,e);let i;return Br[t]||(i=n(),Br[t]=!0),r&&e({metric:r}),Vc(t,e,s?i:void 0)}function zm(t){const e={};t==="event"&&(e.durationThreshold=0),un(t,n=>{qn(t,{entries:n})},e)}function Gc(t,e){jn[t]=jn[t]||[],jn[t].push(e)}function Vc(t,e,n){return()=>{n&&n();const r=jn[t];if(!r)return;const s=r.indexOf(e);s!==-1&&r.splice(s,1)}}function jm(t){return"duration"in t}const qm=80,$e={};try{typeof Node!="undefined"&&($e.parentNode=Object.getOwnPropertyDescriptor(Node.prototype,"parentNode").get),typeof Element!="undefined"&&($e.tagName=Object.getOwnPropertyDescriptor(Element.prototype,"tagName").get,$e.id=Object.getOwnPropertyDescriptor(Element.prototype,"id").get,$e.className=Object.getOwnPropertyDescriptor(Element.prototype,"className").get,$e.getAttribute=Element.prototype.getAttribute),typeof HTMLElement!="undefined"&&($e.dataset=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"dataset").get)}catch(t){}function be(t,e,n){const r=$e[e];if(r)try{return r.call(t,n)}catch(i){}const s=t[e];return typeof s=="function"?s.call(t,n):s}function gt(t,e={}){if(!t)return"<unknown>";try{let n=t;const r=5,s=[];let i=0,o=0;const c=" > ",a=c.length;let u;const l=Array.isArray(e)?e:e.keyAttrs,d=!Array.isArray(e)&&e.maxStringLength||qm;for(;n&&i++<r&&(u=Gm(n,l),!(u==="html"||i>1&&o+s.length*a+u.length>=d));)s.push(u),o+=u.length,n=be(n,"parentNode");return s.reverse().join(c)}catch(n){return"<unknown>"}}function Gm(t,e){const n=[],r=be(t,"tagName");if(!r)return"";if(typeof HTMLElement!="undefined"&&t instanceof HTMLElement){const i=be(t,"dataset");if(i){if(i.sentryComponent)return i.sentryComponent;if(i.sentryElement)return i.sentryElement}}n.push(r.toLowerCase());const s=e!=null&&e.length?e.filter(i=>be(t,"getAttribute",i)).map(i=>[i,be(t,"getAttribute",i)]):null;if(s!=null&&s.length)s.forEach(i=>{n.push(`[${i[0]}="${i[1]}"]`)});else{const i=be(t,"id");i&&n.push(`#${i}`);const o=be(t,"className");if(o&&Zt(o)){const c=o.split(/\s+/);for(const a of c)n.push(`.${a}`)}}for(const i of["aria-label","type","name","title","alt"]){const o=be(t,"getAttribute",i);o&&n.push(`[${i}="${o}"]`)}return n.join("")}const Vm=t=>{const e=n=>{var r;(n.type==="pagehide"||((r=L.document)==null?void 0:r.visibilityState)==="hidden")&&t(n)};Ee("visibilitychange",e,{capture:!0,once:!0}),Ee("pagehide",e,{capture:!0,once:!0})};function Ii(t){return typeof t=="number"&&isFinite(t)}function ve(t,e,n,s){var r=po(s,[]);const i=j(t).start_timestamp;return i&&i>e&&typeof t.updateStartTime=="function"&&t.updateStartTime(e),Aa(t,()=>{const o=_e(h({startTime:e},r));return o&&o.end(n),o})}function Ti(t){var y;const e=U();if(!e)return;const{name:n,transaction:r,attributes:s,startTime:i}=t,{release:o,environment:c}=e.getOptions(),{userInfo:a}=e.getDataCollectionOptions(),u=e.getIntegrationByName("Replay"),l=u==null?void 0:u.getReplayId(),d=V(),f=d.getUser(),p=f!==void 0?f.email||f.id||f.ip_address:void 0;let m;try{m=d.getScopeData().contexts.profile.profile_id}catch(_){}const g=h({release:o,environment:c,user:p||void 0,profile_id:m||void 0,replay_id:l||void 0,transaction:r,"user_agent.original":(y=L.navigator)==null?void 0:y.userAgent,"client.address":a?"{{auto}}":void 0},s);return _e({name:n,attributes:g,startTime:i,experimental:{standalone:!0}})}function ln(){return L.addEventListener&&L.performance}function rt(t){return t/1e3}function Ym(t){let e="unknown",n="unknown",r="";for(const s of t){if(s==="/"){[e,n]=t.split("/");break}if(!isNaN(Number(s))){e=r==="h"?"http":r,n=t.split(r)[1];break}r+=s}return r===t&&(e=r),{name:e,version:n}}function Wr(t){try{return PerformanceObserver.supportedEntryTypes.includes(t)}catch(e){return!1}}function zr(t,e){let n,r=!1;function s(c){!r&&n&&e(c,n.spanContext().spanId,n),r=!0}Vm(()=>{s("pagehide")});const i=t.on("beforeStartNavigationSpan",(c,a)=>{a!=null&&a.isRedirect||(s("navigation"),i(),o())}),o=t.on("afterStartPageLoadSpan",c=>{n=c,o()})}function Km(t){let e=0,n;if(!Wr("layout-shift"))return;const r=$r(({metric:s})=>{const i=s.entries[s.entries.length-1];!i||(e=s.value,n=i)},!0);zr(t,(s,i)=>{Xm(e,n,i,s),r()})}function Xm(t,e,n,r){var u;Wt&&S.log(`Sending CLS span (${t})`);const s=e?rt((_t()||0)+e.startTime):mt(),i=V().getScopeData().transactionName,o=e?gt((u=e.sources[0])==null?void 0:u.node):"Layout shift",c={[pt]:"auto.http.browser.cls",[Nt]:"ui.webvital.cls",[he]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};e!=null&&e.sources&&e.sources.forEach((l,d)=>{c[`cls.source.${d+1}`]=gt(l.node)});const a=Ti({name:o,transaction:i,attributes:c,startTime:s});a&&(a.addEvent("cls",{[xn]:"",[Nn]:t}),a.end(s))}const Jm=6e4;function Gn(t){return t!=null&&t>0&&t<=Jm}function Qm(t){let e=0,n;if(!Wr("largest-contentful-paint"))return;const r=Ur(({metric:s})=>{const i=s.entries[s.entries.length-1];!i||!Gn(s.value)||(e=s.value,n=i)},!0);zr(t,(s,i)=>{Zm(e,n,i,s),r()})}function Zm(t,e,n,r){if(!Gn(t))return;Wt&&S.log(`Sending LCP span (${t})`);const s=rt((_t()||0)+((e==null?void 0:e.startTime)||0)),i=V().getScopeData().transactionName,o=e?gt(e.element):"Largest contentful paint",c={[pt]:"auto.http.browser.lcp",[Nt]:"ui.webvital.lcp",[he]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};e&&(e.element&&(c["lcp.element"]=gt(e.element)),e.id&&(c["lcp.id"]=e.id),e.url&&(c["lcp.url"]=e.url),e.loadTime!=null&&(c["lcp.loadTime"]=e.loadTime),e.renderTime!=null&&(c["lcp.renderTime"]=e.renderTime),e.size!=null&&(c["lcp.size"]=e.size));const a=Ti({name:o,transaction:i,attributes:c,startTime:s});a&&(a.addEvent("lcp",{[xn]:"millisecond",[Nn]:t}),a.end(s))}function Ft(t){return t&&((_t()||performance.timeOrigin)+t)/1e3}function Yc(t){var n;const e={};if(t.nextHopProtocol!=null){const{name:r,version:s}=Ym(t.nextHopProtocol);e["network.protocol.version"]=s,e["network.protocol.name"]=r}return _t()||((n=ln())==null?void 0:n.timeOrigin)?tg(R(h({},e),{"http.request.redirect_start":Ft(t.redirectStart),"http.request.redirect_end":Ft(t.redirectEnd),"http.request.worker_start":Ft(t.workerStart),"http.request.fetch_start":Ft(t.fetchStart),"http.request.domain_lookup_start":Ft(t.domainLookupStart),"http.request.domain_lookup_end":Ft(t.domainLookupEnd),"http.request.connect_start":Ft(t.connectStart),"http.request.secure_connection_start":Ft(t.secureConnectionStart),"http.request.connection_end":Ft(t.connectEnd),"http.request.request_start":Ft(t.requestStart),"http.request.response_start":Ft(t.responseStart),"http.request.response_end":Ft(t.responseEnd),"http.request.time_to_first_byte":t.responseStart!=null?t.responseStart/1e3:void 0})):e}function tg(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!=null))}const eg=2147483647;let Kc=0,Rt={},Ct,dn;function ng({recordClsStandaloneSpans:t,recordLcpStandaloneSpans:e,client:n}){const r=ln();if(r&&_t()){r.mark&&L.performance.mark("sentry-tracing-init");const s=e?Qm(n):e===!1?ag():void 0,i=t?Km(n):t===!1?og():void 0,o=cg(),c=ug();return()=>{o(),c(),s==null||s(),i==null||i()}}return()=>{}}function rg(){Be("longtask",({entries:t})=>{const e=bt();if(!e)return;const{op:n,start_timestamp:r}=j(e);for(const s of t){const i=rt(_t()+s.startTime),o=rt(s.duration);n==="navigation"&&r&&i<r||ve(e,i,i+o,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[pt]:"auto.ui.browser.metrics"}})}})}function sg(){new PerformanceObserver(e=>{const n=bt();if(!!n)for(const r of e.getEntries()){if(!r.scripts[0])continue;const s=rt(_t()+r.startTime),{start_timestamp:i,op:o}=j(n);if(o==="navigation"&&i&&s<i)continue;const c=rt(r.duration),a={[pt]:"auto.ui.browser.metrics"},u=r.scripts[0],{invoker:l,invokerType:d,sourceURL:f,sourceFunctionName:p,sourceCharPosition:m}=u;a["browser.script.invoker"]=l,a["browser.script.invoker_type"]=d,f&&(a["code.filepath"]=f),p&&(a["code.function"]=p),m!==-1&&(a["browser.script.source_char_position"]=m),ve(n,s,s+c,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:a})}}).observe({type:"long-animation-frame",buffered:!0})}function ig(){Be("event",({entries:t})=>{const e=bt();if(!!e){for(const n of t)if(n.name==="click"){const r=rt(_t()+n.startTime),s=rt(n.duration),i={name:gt(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[pt]:"auto.ui.browser.metrics"}},o=Dc(n.target);o&&(i.attributes["ui.component_name"]=o),ve(e,r,r+s,i)}}})}function og(){return $r(({metric:t})=>{const e=t.entries[t.entries.length-1];!e||(Rt.cls={value:t.value,unit:""},dn=e)},!0)}function ag(){return Ur(({metric:t})=>{const e=t.entries[t.entries.length-1];!e||!Gn(t.value)||(Rt.lcp={value:t.value,unit:"millisecond"},Ct=e)},!0)}function cg(){return Bm(({metric:t})=>{!t.entries[t.entries.length-1]||(Rt.ttfb={value:t.value,unit:"millisecond"})})}function ug(){return Be("paint",({entries:t})=>{const e=Wn();for(const n of t){const r=n.startTime<e.firstHiddenTime;n.name==="first-paint"&&r&&(Rt.fp={value:n.startTime,unit:"millisecond"}),n.name==="first-contentful-paint"&&r&&(Rt.fcp={value:n.startTime,unit:"millisecond"})}})}function lg(t,e){const n=ln(),r=_t();if(!(n!=null&&n.getEntries)||!r)return;const{spanStreamingEnabled:s,ignorePerformanceApiSpans:i,ignoreResourceSpans:o}=e,c=rt(r),a=n.getEntries(),{op:u,start_timestamp:l}=j(t);a.slice(Kc).forEach(d=>{const f=rt(d.startTime),p=rt(Math.max(0,d.duration));if(!(u==="navigation"&&l&&c+f<l))switch(d.entryType){case"navigation":{mg(t,d,c);break}case"mark":case"paint":case"measure":{pg(t,d,f,p,c,i);break}case"resource":{yg(t,d,d.name,f,p,c,o);break}}}),Kc=Math.max(a.length-1,0),Sg(t,s)}function dg(t,e){var c;const n=_t();if(!((c=ln())!=null&&c.getEntries)||!n){Xc();return}const{spanStreamingEnabled:r,recordClsOnPageloadSpan:s,recordLcpOnPageloadSpan:i}=e,o=rt(n);if(j(t).op==="pageload"){if(vg(Rt),r){const a=(u,l,d)=>{const f=d!=null?d:`browser.web_vital.${u}.value`;t.setAttribute(f,l),Wt&&S.log("Setting web vital attribute",{[f]:l},"on pageload span")};["ttfb","fp","fcp"].forEach(u=>{Rt[u]&&a(u,Rt[u].value)}),Rt["ttfb.requestTime"]&&a("ttfb.requestTime",Rt["ttfb.requestTime"].value,"browser.web_vital.ttfb.request_time")}else s||delete Rt.cls,i||delete Rt.lcp,Object.entries(Rt).forEach(([a,u])=>{Ia(a,u.value,u.unit,t)}),Eg(t,e);t.setAttribute(r?"browser.performance.time_origin":"performance.timeOrigin",o),t.setAttribute(r?"browser.performance.navigation.activation_start":"performance.activationStart",an())}Xc()}function Xc(){Ct=void 0,dn=void 0,Rt={}}function fg(t){if((t==null?void 0:t.entryType)==="measure")try{return t.detail.devtools.track==="Components \u269B"}catch(e){return}}function pg(t,e,n,r,s,i){if(fg(e)||["mark","measure"].includes(e.entryType)&&Vt(e.name,i))return;const o=Hn(!1),c=rt(o?o.requestStart:0),a=s+Math.max(n,c),u=s+n,l=u+r,d={[pt]:"auto.resource.browser.metrics"};a!==u&&(d["sentry.browser.measure_happened_before_request"]=!0,d["sentry.browser.measure_start_time"]=a),hg(d,e),a<=l&&ve(t,a,l,{name:e.name,op:e.entryType,attributes:d})}function hg(t,e){try{const n=e.detail;if(!n)return;if(typeof n=="object"){for(const[r,s]of Object.entries(n))if(s&&Ce(s))t[`sentry.browser.measure.detail.${r}`]=s;else if(s!==void 0)try{t[`sentry.browser.measure.detail.${r}`]=JSON.stringify(s)}catch(i){}return}if(Ce(n)){t["sentry.browser.measure.detail"]=n;return}try{t["sentry.browser.measure.detail"]=JSON.stringify(n)}catch(r){}}catch(n){}}function mg(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{jr(t,e,r,n)}),jr(t,e,"secureConnection",n,"TLS/SSL"),jr(t,e,"fetch",n,"cache"),jr(t,e,"domainLookup",n,"DNS"),_g(t,e,n)}function jr(t,e,n,r,s=n){const i=gg(n),o=e[i],c=e[`${n}Start`];!c||!o||ve(t,r+rt(c),r+rt(o),{op:`browser.${s}`,name:e.name,attributes:h({[pt]:"auto.ui.browser.metrics"},n==="redirect"&&e.redirectCount!=null?{"http.redirect_count":e.redirectCount}:{})})}function gg(t){return t==="secureConnection"?"connectEnd":t==="fetch"?"domainLookupStart":`${t}End`}function _g(t,e,n){const r=n+rt(e.requestStart),s=n+rt(e.responseEnd),i=n+rt(e.responseStart);e.responseEnd&&(ve(t,r,s,{op:"browser.request",name:e.name,attributes:{[pt]:"auto.ui.browser.metrics"}}),ve(t,i,s,{op:"browser.response",name:e.name,attributes:{[pt]:"auto.ui.browser.metrics"}}))}function yg(t,e,n,r,s,i,o){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;const c=e.initiatorType?`resource.${e.initiatorType}`:"resource.other";if(o!=null&&o.includes(c))return;const a={[pt]:"auto.resource.browser.metrics"},u=Pe(n);u.protocol&&(a["url.scheme"]=u.protocol.split(":").pop()),u.host&&(a["server.address"]=u.host),a["url.same_origin"]=n.includes(L.location.origin),a[rn]=n,bg(e,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=h(h({},a),Yc(e)),d=i+r,f=d+s;ve(t,d,f,{name:n.replace(L.location.origin,""),op:c,attributes:l})}function Sg(t,e){const n=L.navigator;if(!n)return;const r=n.connection;r&&(r.effectiveType&&t.setAttribute(e?"network.connection.effective_type":"effectiveConnectionType",r.effectiveType),r.type&&t.setAttribute(e?"network.connection.type":"connectionType",r.type),Ii(r.rtt)&&(e?t.setAttribute("network.connection.rtt",r.rtt):j(t).op==="pageload"&&Ia("connection.rtt",r.rtt,"millisecond"))),Ii(n.deviceMemory)&&(e?t.setAttribute("device.memory.estimated_capacity",n.deviceMemory):t.setAttribute("deviceMemory",`${n.deviceMemory} GB`)),Ii(n.hardwareConcurrency)&&(e?t.setAttribute("device.processor_count",n.hardwareConcurrency):t.setAttribute("hardwareConcurrency",String(n.hardwareConcurrency)))}function Eg(t,e){Ct&&e.recordLcpOnPageloadSpan&&(Ct.element&&t.setAttribute("lcp.element",gt(Ct.element)),Ct.id&&t.setAttribute("lcp.id",Ct.id),Ct.url&&t.setAttribute("lcp.url",Ct.url.trim().slice(0,200)),Ct.loadTime!=null&&t.setAttribute("lcp.loadTime",Ct.loadTime),Ct.renderTime!=null&&t.setAttribute("lcp.renderTime",Ct.renderTime),t.setAttribute("lcp.size",Ct.size)),(dn==null?void 0:dn.sources)&&e.recordClsOnPageloadSpan&&dn.sources.forEach((n,r)=>t.setAttribute(`cls.source.${r+1}`,gt(n.node)))}function bg(t,e,n){n.forEach(([r,s])=>{const i=t[r];i!=null&&(typeof i=="number"&&i<eg||typeof i=="string")&&(e[s]=i)})}function vg(t){const e=Hn(!1);if(!e)return;const{responseStart:n,requestStart:r}=e;r<=n&&(t["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}const wi=[],Vn=new Map,fn=new Map,Jc=60;function Ig(){if(ln()&&_t()){const e=Tg();return()=>{e()}}return()=>{}}const Yn={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 Tg(){return vi(wg)}const wg=({metric:t})=>{if(t.value==null)return;const e=rt(t.value);if(e>Jc)return;const n=t.entries.find(m=>m.duration===t.value&&Yn[m.name]);if(!n)return;const{interactionId:r}=n,s=Yn[n.name],i=rt(_t()+n.startTime),o=bt(),c=o?St(o):void 0,a=r!=null?Vn.get(r):void 0,u=(a==null?void 0:a.span)||c,l=u?j(u).description:V().getScopeData().transactionName,d=(a==null?void 0:a.elementName)||gt(n.target),f={[pt]:"auto.http.browser.inp",[Nt]:`ui.interaction.${s}`,[he]:n.duration},p=Ti({name:d,transaction:l,attributes:f,startTime:i});p&&(p.addEvent("inp",{[xn]:"millisecond",[Nn]:t.value}),p.end(i+e))};function kg(t){return t!=null?Vn.get(t):void 0}function Rg(){const t=Object.keys(Yn);sn()&&t.forEach(s=>{L.addEventListener(s,e,{capture:!0,passive:!0})});function e(s){const i=s.target;if(!i)return;const o=gt(i),c=Math.round(s.timeStamp);if(fn.set(c,o),fn.size>50){const a=fn.keys().next().value;a!==void 0&&fn.delete(a)}}function n(s){const i=Math.round(s.startTime);let o=fn.get(i);if(!o)for(let c=-5;c<=5;c++){const a=fn.get(i+c);if(a){o=a;break}}return o||"<unknown>"}const r=({entries:s})=>{const i=bt(),o=i&&St(i);s.forEach(c=>{if(!jm(c))return;const a=c.interactionId;if(a==null||Vn.has(a))return;const u=c.target?gt(c.target):n(c);if(wi.length>10){const l=wi.shift();Vn.delete(l)}wi.push(a),Vn.set(a,{span:o,elementName:u})})};Be("event",r),Be("first-input",r)}function ki(t){var m,g;const{name:e,op:n,origin:r,metricName:s,value:i,attributes:o,parentSpan:c,reportEvent:a,startTime:u,endTime:l}=t,d=V().getScopeData().transactionName,f=h({[pt]:r,[Nt]:n,[he]:0,[`browser.web_vital.${s}.value`]:i,[Fa]:d,[Pa]:d,"user_agent.original":(m=L.navigator)==null?void 0:m.userAgent},o);c&&((g=oa(c).attributes)==null?void 0:g[Nt])==="pageload"&&(f["sentry.pageload.span_id"]=c.spanContext().spanId),a&&(f[`browser.web_vital.${s}.report_event`]=a);const p=_e({name:e,attributes:f,startTime:u,parentSpan:c});p&&p.end(l!=null?l:u)}function Cg(t){let e=0,n;if(!Wr("largest-contentful-paint"))return;const r=Ur(({metric:s})=>{const i=s.entries[s.entries.length-1];!i||!Gn(s.value)||(e=s.value,n=i)},!0);zr(t,(s,i,o)=>{Ag(e,n,o,s),r()})}function Ag(t,e,n,r){if(!Gn(t))return;Wt&&S.log(`Sending LCP span (${t})`);const s=_t()||0,i=rt(s),o=rt(s+((e==null?void 0:e.startTime)||0)),c=e?gt(e.element):"Largest contentful paint",a={};e!=null&&e.element&&(a["browser.web_vital.lcp.element"]=gt(e.element)),e!=null&&e.id&&(a["browser.web_vital.lcp.id"]=e.id),e!=null&&e.url&&(a["browser.web_vital.lcp.url"]=e.url),(e==null?void 0:e.loadTime)!=null&&(a["browser.web_vital.lcp.load_time"]=e.loadTime),(e==null?void 0:e.renderTime)!=null&&(a["browser.web_vital.lcp.render_time"]=e.renderTime),(e==null?void 0:e.size)!=null&&(a["browser.web_vital.lcp.size"]=e.size),ki({name:c,op:"ui.webvital.lcp",origin:"auto.http.browser.lcp",metricName:"lcp",value:t,attributes:a,parentSpan:n,reportEvent:r,startTime:i,endTime:o})}function Mg(t){let e=0,n;if(!Wr("layout-shift"))return;const r=$r(({metric:s})=>{const i=s.entries[s.entries.length-1];!i||(e=s.value,n=i)},!0);zr(t,(s,i,o)=>{xg(e,n,o,s),r()})}function xg(t,e,n,r){var c;Wt&&S.log(`Sending CLS span (${t})`);const s=e?rt((_t()||0)+e.startTime):mt(),i=e?gt((c=e.sources[0])==null?void 0:c.node):"Layout shift",o={};e!=null&&e.sources&&e.sources.forEach((a,u)=>{o[`browser.web_vital.cls.source.${u+1}`]=gt(a.node)}),ki({name:i,op:"ui.webvital.cls",origin:"auto.http.browser.cls",metricName:"cls",value:t,attributes:o,parentSpan:n,reportEvent:r,startTime:s})}function Ng(){if(!ln()||!_t())return;vi(({metric:n})=>{if(n.value==null||rt(n.value)>Jc)return;const s=n.entries.find(i=>i.duration===n.value&&Yn[i.name]);!s||Og(n.value,s)})}function Og(t,e){Wt&&S.log(`Sending INP span (${t})`);const n=rt(_t()+e.startTime),r=rt(t),s=Yn[e.name],i=kg(e.interactionId),o=bt(),c=o?St(o):void 0,a=(i==null?void 0:i.span)||c,u=a?oa(a).name:V().getScopeData().transactionName,l=(i==null?void 0:i.elementName)||gt(e.target);ki({name:l,op:`ui.interaction.${s}`,origin:"auto.http.browser.inp",metricName:"inp",value:t,attributes:{[he]:e.duration,[Fa]:u,[Pa]:u},startTime:n,endTime:n+r,parentSpan:a})}const Lg=1e3;let Qc,Ri,Ci;function Zc(t){const e="dom";le(e,t),de(e,Dg)}function Dg(){if(!L.document)return;const t=Pt.bind(null,"dom"),e=tu(t,!0);L.document.addEventListener("click",e,!1),L.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{var i,o;const s=(i=L[n])==null?void 0:i.prototype;!((o=s==null?void 0:s.hasOwnProperty)!=null&&o.call(s,"addEventListener"))||(kt(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=tu(t);f.handler=p,c.call(this,a,p,l)}f.refCount++}catch(d){}return c.call(this,a,u,l)}}),kt(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(d){}return c.call(this,a,u,l)}}))})}function Pg(t){if(t.type!==Ri)return!1;try{if(!t.target||t.target._sentryId!==Ci)return!1}catch(e){}return!0}function Fg(t,e){return t!=="keypress"?!1:e!=null&&e.tagName?!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable):!0}function tu(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;const r=Bg(n);if(Fg(n.type,r))return;Et(n,"_sentryCaptured",!0),r&&!r._sentryId&&Et(r,"_sentryId",xt());const s=n.type==="keypress"?"input":n.type;Pg(n)||(t({event:n,name:s,global:e}),Ri=n.type,Ci=r?r._sentryId:void 0),clearTimeout(Qc),Qc=L.setTimeout(()=>{Ci=void 0,Ri=void 0},Lg)}}function Bg(t){try{return t.target}catch(e){return null}}let qr;function Gr(t){const e="history";le(e,t),de(e,$g)}function $g(){if(L.addEventListener("popstate",()=>{const e=L.location.href,n=qr;if(qr=e,n===e)return;Pt("history",{from:n,to:e})}),!Kh())return;function t(e){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const s=qr,i=Ug(String(r));if(qr=i,s===i)return e.apply(this,n);Pt("history",{from:s,to:i})}return e.apply(this,n)}}kt(L.history,"pushState",t),kt(L.history,"replaceState",t)}function Ug(t){try{return new URL(t,L.location.origin).toString()}catch(e){return t}}const Vr={};function eu(t){const e=Vr[t];if(e)return e;let n=L[t];if(ai(n))return Vr[t]=n.bind(L);const r=L.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[t]&&(n=i[t]),r.head.removeChild(s)}catch(s){Wt&&S.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,s)}return n&&(Vr[t]=n.bind(L))}function Hg(t){Vr[t]=void 0}function Kn(...t){return eu("setTimeout")(...t)}const Ue="__sentry_xhr_v3__";function nu(t){const e="xhr";le(e,t),de(e,Wg)}function Wg(){if(!L.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,n,r){const s=new Error,i=mt()*1e3,o=Zt(r[0])?r[0].toUpperCase():void 0,c=zg(r[1]);if(!o||!c)return e.apply(n,r);n[Ue]={method:o,url:c,request_headers:{}},o==="POST"&&c.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const a=()=>{const u=n[Ue];if(!!u&&n.readyState===4){try{u.status_code=n.status}catch(d){}const l={endTimestamp:mt()*1e3,startTimestamp:i,xhr:n,virtualError:s};Pt("xhr",l),n.removeEventListener("readystatechange",a)}};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,m=l[Ue];return m&&Zt(f)&&Zt(p)&&(m.request_headers[f.toLowerCase()]=p),u.apply(l,d)}}),e.apply(n,r)}}),t.send=new Proxy(t.send,{apply(e,n,r){const s=n[Ue];if(!s)return e.apply(n,r);r[0]!==void 0&&(s.body=r[0]);const i={startTimestamp:mt()*1e3,xhr:n};return Pt("xhr",i),e.apply(n,r)}})}function zg(t){if(Zt(t))return t;try{return t.toString()}catch(e){}}const jg=Symbol.for("sentry__originalRequestBody");function ru(t){return new URLSearchParams(t).toString()}function su(t,e=S){try{if(typeof t=="string")return[t];if(t instanceof URLSearchParams)return[t.toString()];if(t instanceof FormData)return[ru(t)];if(!t)return[void 0]}catch(n){return Wt&&e.error(n,"Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return Wt&&e.log("Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}function iu(t=[]){if(t.length>=2&&t[1]&&typeof t[1]=="object"&&"body"in t[1])return t[1].body;if(t.length>=1&&t[0]instanceof Request){const n=t[0][jg];return n!==void 0?n:void 0}}function ou(t){let e;try{e=t.getAllResponseHeaders()}catch(n){return Wt&&S.error(n,"Failed to get xhr response headers",t),{}}return e?e.split(`\r
`).reduce((n,r)=>{const[s,i]=r.split(": ");return i&&(n[s.toLowerCase()]=i),n},{}):{}}function qg(t){if(typeof Element=="undefined")return!1;try{return t instanceof Element}catch(e){return!1}}const Gg=40;function Vg(t,e=eu("fetch")){let n=0,r=0;function s(i){return X(this,null,function*(){const o=i.body.length;n+=o,r++;const c=h({body:i.body,method:"POST",referrerPolicy:"strict-origin",headers:t.headers,keepalive:n<=6e4&&r<15},t.fetchOptions);try{const a=yield e(t.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 Hg("fetch"),a}finally{n-=o,r--}})}return Gp(t,s,ri(t.bufferSize||Gg))}const Lt=typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__,Yg=30,Kg=50;function Ai(t,e,n,r){const s={filename:t,function:e==="<anonymous>"?Re:e,in_app:!0};return n!==void 0&&(s.lineno=n),r!==void 0&&(s.colno=r),s}const Xg=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Jg=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Qg=/\((\S*)(?::(\d+))(?::(\d+))\)/,Zg=/at (.+?) ?\(data:(.+?),/,t_=[Yg,t=>{var s;const e=t.match(Zg);if(e)return{filename:`<data:${e[2]}>`,function:e[1]};const n=Xg.exec(t);if(n){const[,i,o,c]=n;return Ai(i,Re,+o,+c)}const r=Jg.exec(t);if(r){if(((s=r[2])==null?void 0:s.indexOf("eval"))===0){const a=Qg.exec(r[2]);a&&(r[2]=a[1],r[3]=a[2],r[4]=a[3])}const[o,c]=au(r[1]||Re,r[2]);return Ai(c,o,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}}],e_=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,n_=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,r_=yo(...[t_,[Kg,t=>{const e=e_.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const i=n_.exec(e[3]);i&&(e[1]=e[1]||"eval",e[3]=i[1],e[4]=i[2],e[5]="")}let r=e[3],s=e[1]||Re;return[s,r]=au(s,r),Ai(r,s,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}}]]),au=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:Re,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},Yr=1024,s_="Breadcrumbs",i_=(t={})=>{const e=h({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t);return{name:s_,setup(n){e.console&&Oh(c_(n)),e.dom&&Zc(a_(n,e.dom)),e.xhr&&nu(u_(n)),e.fetch&&ci(l_(n)),e.history&&Gr(d_(n)),e.sentry&&n.on("beforeSendEvent",o_(n))}}};function o_(t){return function(n){U()===t&&Se({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Me(n)},{event:n})}}function a_(t,e){return function(r){if(U()!==t)return;let s,i,o=typeof e=="object"?e.serializeAttribute:void 0,c=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;c&&c>Yr&&(Lt&&S.warn(`\`dom.maxStringLength\` cannot exceed ${Yr}, but a value of ${c} was configured. Sentry will use ${Yr} instead.`),c=Yr),typeof o=="string"&&(o=[o]);try{const u=r.event,l=f_(u)?u.target:u;s=gt(l,{keyAttrs:o,maxStringLength:c}),i=Dc(l)}catch(u){s="<unknown>"}if(s.length===0)return;const a={category:`ui.${r.name}`,message:s};i&&(a.data={"ui.component_name":i}),Se(a,{event:r.event,name:r.name,global:r.global})}}function c_(t){return function(n){if(U()!==t)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:kc(n.level),message:xo(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${xo(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;Se(r,{input:n.args,level:n.level})}}function u_(t){return function(n){if(U()!==t)return;const{startTimestamp:r,endTimestamp:s}=n,i=n.xhr[Ue];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:xc(a)};t.emit("beforeOutgoingRequestBreadcrumb",f,d),Se(f,d)}}function l_(t){return function(n){if(U()!==t)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"};t.emit("beforeOutgoingRequestBreadcrumb",o,i),Se(o,i)}else{const i=n.response,o=R(h({},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:xc(o.status_code)};t.emit("beforeOutgoingRequestBreadcrumb",a,c),Se(a,c)}}}function d_(t){return function(n){if(U()!==t)return;let r=n.from,s=n.to;const i=Pe(W.location.href);let o=r?Pe(r):void 0;const c=Pe(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),Se({category:"navigation",data:{from:r,to:s}})}}function f_(t){return!!t&&!!t.target}const p_="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(","),h_="BrowserApiErrors",m_=(t={})=>{const e=h({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1},t);return{name:h_,setupOnce(){e.setTimeout&&kt(W,"setTimeout",cu),e.setInterval&&kt(W,"setInterval",cu),e.requestAnimationFrame&&kt(W,"requestAnimationFrame",g_),e.XMLHttpRequest&&"XMLHttpRequest"in W&&kt(XMLHttpRequest.prototype,"send",__);const n=e.eventTarget;n&&(Array.isArray(n)?n:p_).forEach(s=>y_(s,e))}}};function cu(t){return function(...e){const n=e[0];return e[0]=on(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Jt(t)}`}}),t.apply(this,e)}}function g_(t){return function(e){return t.apply(this,[on(e,{mechanism:{data:{handler:Jt(t)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function __(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(s=>{s in n&&typeof n[s]=="function"&&kt(n,s,function(i){const o={mechanism:{data:{handler:Jt(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${s}`}},c=Ms(i);return c&&(o.mechanism.data.handler=Jt(c)),on(i,o)})}),t.apply(this,e)}}function y_(t,e){var s,i;const r=(s=W[t])==null?void 0:s.prototype;!((i=r==null?void 0:r.hasOwnProperty)!=null&&i.call(r,"addEventListener"))||(kt(r,"addEventListener",function(o){return function(c,a,u){try{S_(a)&&(a.handleEvent=on(a.handleEvent,{mechanism:{data:{handler:Jt(a),target:t},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch(l){}return e.unregisterOriginalCallbacks&&E_(this,c,a),o.apply(this,[c,on(a,{mechanism:{data:{handler:Jt(a),target:t},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),u])}}),kt(r,"removeEventListener",function(o){return function(c,a,u){try{if(Object.prototype.hasOwnProperty.call(a,"__sentry_wrapped__")){const l=a.__sentry_wrapped__;l&&o.call(this,c,l,u)}}catch(l){}return o.call(this,c,a,u)}}))}function S_(t){return typeof t.handleEvent=="function"}function E_(t,e,n){t&&typeof t=="object"&&"removeEventListener"in t&&typeof t.removeEventListener=="function"&&t.removeEventListener(e,n)}const b_=(t={})=>{var n;const e=(n=t.lifecycle)!=null?n:"route";return{name:"BrowserSession",setupOnce(){if(typeof W.document=="undefined"){Lt&&S.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}qa({ignoreDuration:!0});let r=!1;Ei(()=>{r||(ei(),r=!0)});const s=vt();let i=s.getUser();s.addScopeListener(o=>{const c=o.getUser();((i==null?void 0:i.id)!==(c==null?void 0:c.id)||(i==null?void 0:i.ip_address)!==(c==null?void 0:c.ip_address))&&(i=c,r&&ei())}),e==="route"&&Gr(({from:o,to:c})=>{o!==c&&(qa({ignoreDuration:!0}),ei(),r=!0)})}}},v_="CultureContext",I_=()=>({name:v_,preprocessEvent(t){var n;const e=uu();e&&(t.contexts=R(h({},t.contexts),{culture:h(h({},e),(n=t.contexts)==null?void 0:n.culture)}))},processSegmentSpan(t){const e=uu();e&&wr(t,{"culture.locale":e.locale,"culture.timezone":e.timezone,"culture.calendar":e.calendar})}});function uu(){try{const t=W.Intl;if(!t)return;const e=t.DateTimeFormat().resolvedOptions();return{locale:e.locale,timezone:e.timeZone,calendar:e.calendar}}catch(t){return}}const T_="GlobalHandlers",w_=(t={})=>{const e=h({onerror:!0,onunhandledrejection:!0},t);return{name:T_,setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&(k_(n),lu("onerror")),e.onunhandledrejection&&(R_(n),lu("onunhandledrejection"))}}};function k_(t){bo(e=>{const{stackParser:n,attachStacktrace:r}=du();if(U()!==t||Pc())return;const{msg:s,url:i,line:o,column:c,error:a}=e,u=M_(fi(n,a||s,void 0,r,!1),i,o,c);u.level="error",ja(u,{originalException:a,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function R_(t){vo(e=>{const{stackParser:n,attachStacktrace:r}=du();if(U()!==t||Pc())return;const s=C_(e),i=Ce(s)?A_(s):fi(n,s,void 0,r,!0);i.level="error",ja(i,{originalException:s,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function C_(t){if(Ce(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch(e){}return t}function A_(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function M_(t,e,n,r){var u;const s=t.exception=t.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:(u=x_(e))!=null?u:Fe(),function:Re,in_app:!0}),t}function lu(t){Lt&&S.log(`Global Handler attached: ${t}`)}function du(){const t=U();return(t==null?void 0:t.getOptions())||{stackParser:()=>[],attachStacktrace:!1}}function x_(t){if(!(!Zt(t)||t.length===0))return t.startsWith("data:")?`<${Ht(t,!1)}>`:t}const N_=()=>({name:"HttpContext",preprocessEvent(t){var r;if(!W.navigator&&!W.location&&!W.document)return;const e=Nr(),n=h(h({},e.headers),(r=t.request)==null?void 0:r.headers);t.request=R(h(h({},e),t.request),{headers:n})},processSegmentSpan(t){var r;const e=(r=t.attributes)==null?void 0:r[Nt];if(!W.navigator&&!W.location&&!W.document)return;const n=Nr();wr(t,{[rn]:e!=="http.client"?n.url:void 0,"http.request.header.user_agent":n.headers["User-Agent"],"http.request.header.referer":n.headers.Referer})}}),O_="cause",L_=5,D_="LinkedErrors",P_=(t={})=>{const e=t.limit||L_,n=t.key||O_;return{name:D_,preprocessEvent(r,s,i){const o=i.getOptions();xh(li,o.stackParser,n,e,r,s)}}},F_=/^HTML(\w*)Element$/;function B_(t){if(typeof window!="undefined"&&t===window)return"[Window]";if(typeof document!="undefined"&&t===document)return"[Document]";if(qg(t)){const e=$_(t);if(F_.test(e))return`[HTMLElement: ${gt(t)}]`}}function $_(t){const e=Object.getPrototypeOf(t);return e!=null&&e.constructor?e.constructor.name:"null prototype"}function U_(){return H_()?(Lt&&ue(()=>{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 H_(){var s;if(typeof W.window=="undefined")return!1;const t=W;if(t.nw)return!1;const e=t.chrome||t.browser;if(!((s=e==null?void 0:e.runtime)!=null&&s.id))return!1;const n=Fe();return!(W===W.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function W_(t){return[Ih(),Sh(),Hh(),m_(),i_(),w_(),P_(),Ph(),N_(),I_(),b_()]}function z_(t={}){const e=!t.skipBrowserExtensionCheck&&U_();let n=t.defaultIntegrations==null?W_():t.defaultIntegrations;const r=R(h({},t),{enabled:e?!1:t.enabled,stackParser:sd(t.stackParser||r_),integrations:Rp({integrations:t.integrations,defaultIntegrations:n}),transport:t.transport||Vg});return md(B_),ih(mm,r)}const st=$,Mi="sentryReplaySession",j_="replay_event",xi="Unable to send Replay",q_=3e5,G_=9e5,V_=5e3,Y_=5500,K_=6e4,X_=5e3,J_=3,fu=15e4,Kr=5e3,Q_=3e3,Z_=300,Ni=2e7,ty=4999,ey=5e4,pu=36e5;var ny=Object.defineProperty,ry=(t,e,n)=>e in t?ny(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,hu=(t,e,n)=>ry(t,typeof e!="symbol"?e+"":e,n),ht=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(ht||{});function sy(t){return t.nodeType===t.ELEMENT_NODE}function Xn(t){const e=t==null?void 0:t.host;return Boolean((e==null?void 0:e.shadowRoot)===t)}function Jn(t){return Object.prototype.toString.call(t)==="[object ShadowRoot]"}function iy(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function oy(t){const{cssText:e}=t;if(e.split('"').length<3)return e;const n=["@import",`url(${JSON.stringify(t.href)})`];return t.layerName===""?n.push("layer"):t.layerName&&n.push(`layer(${t.layerName})`),t.supportsText&&n.push(`supports(${t.supportsText})`),t.media.length&&n.push(t.media.mediaText),n.join(" ")+";"}function Xr(t){try{const e=t.rules||t.cssRules;return e?iy(Array.from(e,mu).join("")):null}catch(e){return null}}function ay(t){let e="";for(let n=0;n<t.style.length;n++){const r=t.style,s=r[n],i=r.getPropertyPriority(s);e+=`${s}:${r.getPropertyValue(s)}${i?" !important":""};`}return`${t.selectorText} { ${e} }`}function mu(t){let e;if(uy(t))try{e=Xr(t.styleSheet)||oy(t)}catch(n){}else if(ly(t)){let n=t.cssText;const r=t.selectorText.includes(":"),s=typeof t.style.all=="string"&&t.style.all;if(s&&(n=ay(t)),r&&(n=cy(n)),r||s)return n}return e||t.cssText}function cy(t){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return t.replace(e,"$1\\$2")}function uy(t){return"styleSheet"in t}function ly(t){return"selectorText"in t}class gu{constructor(){hu(this,"idNodeMap",new Map),hu(this,"nodeMetaMap",new WeakMap)}getId(e){var r;if(!e)return-1;const n=(r=this.getMeta(e))==null?void 0:r.id;return n!=null?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,n){const r=n.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,n)}replace(e,n){const r=this.getNode(e);if(r){const s=this.nodeMetaMap.get(r);s&&this.nodeMetaMap.set(n,s)}this.idNodeMap.set(e,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function dy(){return new gu}function Jr({maskInputOptions:t,tagName:e,type:n}){return e==="OPTION"&&(e="SELECT"),Boolean(t[e.toLowerCase()]||n&&t[n]||n==="password"||e==="INPUT"&&!n&&t.text)}function Qn({isMasked:t,element:e,value:n,maskInputFn:r}){let s=n||"";return t?(r&&(s=r(s,e)),"*".repeat(s.length)):s}function pn(t){return t.toLowerCase()}function Oi(t){return t.toUpperCase()}const _u="__rrweb_original__";function fy(t){const e=t.getContext("2d");if(!e)return!0;const n=50;for(let r=0;r<t.width;r+=n)for(let s=0;s<t.height;s+=n){const i=e.getImageData,o=_u in i?i[_u]:i;if(new Uint32Array(o.call(e,r,s,Math.min(n,t.width-r),Math.min(n,t.height-s)).data.buffer).some(a=>a!==0))return!1}return!0}function Li(t){const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?pn(e):null}function Qr(t,e,n){return e==="INPUT"&&(n==="radio"||n==="checkbox")?t.getAttribute("value")||"":t.value}function yu(t,e){var i;let n;try{n=new URL(t,e!=null?e:window.location.href)}catch(o){return null}const r=/\.([0-9a-z]+)(?:$)/i,s=n.pathname.match(r);return(i=s==null?void 0:s[1])!=null?i:null}const Su={};function Eu(t){const e=Su[t];if(e)return e;const n=window.document;let r=window[t];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[t]&&(r=i[t]),n.head.removeChild(s)}catch(s){}return Su[t]=r.bind(window)}function Di(...t){return Eu("setTimeout")(...t)}function bu(...t){return Eu("clearTimeout")(...t)}function vu(t){try{return t.contentDocument}catch(e){}}function py(t){try{return t.contentWindow}catch(e){}}let hy=1;const my=new RegExp("[^a-z0-9-_:]"),Zn=-2;function Pi(){return hy++}function gy(t){if(t instanceof HTMLFormElement)return"form";const e=pn(t.tagName);return my.test(e)?"div":e}function _y(t){let e="";return t.indexOf("//")>-1?e=t.split("/").slice(0,3).join("/"):e=t.split("/")[0],e=e.split("?")[0],e}let hn,Iu;const yy=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Sy=/^(?:[a-z+]+:)?\/\//i,Ey=/^www\..*/i,by=/^(data:)([^,]*),(.*)/i;function vy(t,e){if(!t||e.size===0)return t;try{const n=t.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();e.has(o)||r.push(s)}return r.join("; ")+(r.length>0&&t.endsWith(";")?";":"")}catch(n){return console.warn("Error filtering CSS properties:",n),t}}function Zr(t,e){return(t||"").replace(yy,(n,r,s,i,o,c)=>{const a=s||o||c,u=r||i||"";if(!a)return n;if(Sy.test(a)||Ey.test(a))return`url(${u}${a}${u})`;if(by.test(a))return`url(${u}${a}${u})`;if(a[0]==="/")return`url(${u}${_y(e)+a}${u})`;const l=e.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 Iy=/^[^ \t\n\r\u000c]+/,Ty=/^[, \t\n\r\u000c]+/;function wy(t,e){if(e.trim()==="")return e;let n=0;function r(i){let o;const c=i.exec(e.substring(n));return c?(o=c[0],n+=o.length,o):""}const s=[];for(;r(Ty),!(n>=e.length);){let i=r(Iy);if(i.slice(-1)===",")i=mn(t,i.substring(0,i.length-1)),s.push(i);else{let o="";i=mn(t,i);let c=!1;for(;;){const a=e.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 Tu=new WeakMap;function mn(t,e){return!e||e.trim()===""?e:ts(t,e)}function ky(t){return Boolean(t.tagName==="svg"||t.ownerSVGElement)}function ts(t,e){let n=Tu.get(t);if(n||(n=t.createElement("a"),Tu.set(t,n)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return n.setAttribute("href",e),n.href}function wu(t,e,n,r,s,i,o){if(!r)return r;if(n==="src"||n==="href"&&!(e==="use"&&r[0]==="#"))return mn(t,r);if(n==="xlink:href"&&r[0]!=="#")return mn(t,r);if(n==="background"&&(e==="table"||e==="td"||e==="th"))return mn(t,r);if(n==="srcset")return wy(t,r);if(n==="style"){let c=Zr(r,ts(t));return o&&o.size>0&&(c=vy(c,o)),c}else if(e==="object"&&n==="data")return mn(t,r);return typeof i=="function"?i(n,r,s):r}function ku(t,e,n){return(t==="video"||t==="audio")&&e==="autoplay"}function Ry(t,e,n,r){try{if(r&&t.matches(r))return!1;if(typeof e=="string"){if(t.classList.contains(e))return!0}else for(let s=t.classList.length;s--;){const i=t.classList[s];if(e.test(i))return!0}if(n)return t.matches(n)}catch(s){}return!1}function Cy(t,e){for(let n=t.classList.length;n--;){const r=t.classList[n];if(e.test(r))return!0}return!1}function He(t,e,n=1/0,r=0){return!t||t.nodeType!==t.ELEMENT_NODE||r>n?-1:e(t)?r:He(t.parentNode,e,n,r+1)}function gn(t,e){return n=>{const r=n;if(r===null)return!1;try{if(t){if(typeof t=="string"){if(r.matches(`.${t}`))return!0}else if(Cy(r,t))return!0}return!!(e&&r.matches(e))}catch(s){return!1}}}function _n(t,e,n,r,s,i){try{const o=t.nodeType===t.ELEMENT_NODE?t:t.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=He(o,gn(r,s)),a<0)return!0;c=He(o,gn(e,n),a>=0?a:1/0)}else{if(c=He(o,gn(e,n)),c<0)return!1;a=He(o,gn(r,s),c>=0?c:1/0)}return c>=0?a>=0?c<=a:!0:a>=0?!1:!!i}catch(o){}return!!i}function Ay(t,e,n){const r=py(t);if(!r)return;let s=!1,i;try{i=r.document.readyState}catch(c){return}if(i!=="complete"){const c=Di(()=>{s||(e(),s=!0)},n);t.addEventListener("load",()=>{bu(c),s=!0,e()});return}const o="about:blank";if(r.location.href!==o||t.src===o||t.src==="")return Di(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}function My(t,e,n){let r=!1,s;try{s=t.sheet}catch(o){s=null}if(s)return;const i=Di(()=>{r||(e(),r=!0)},n);t.addEventListener("load",()=>{bu(i),r=!0,e()})}function xy(t,e){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:m={},maskTextFn:g,maskInputFn:y,dataURLOptions:_={},inlineImages:T,recordCanvas:F,keepIframeSrcFn:w,newlyAddedElement:M=!1,ignoreCSSAttributes:v}=e,E=Ny(n,r);switch(t.nodeType){case t.DOCUMENT_NODE:return t.compatMode!=="CSS1Compat"?{type:ht.Document,childNodes:[],compatMode:t.compatMode}:{type:ht.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:ht.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:E};case t.ELEMENT_NODE:return Ly(t,{doc:n,blockClass:s,blockSelector:i,unblockSelector:o,inlineStylesheet:p,maskAttributeFn:a,maskInputOptions:m,maskInputFn:y,dataURLOptions:_,inlineImages:T,recordCanvas:F,keepIframeSrcFn:w,newlyAddedElement:M,rootId:E,maskTextClass:u,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:f,ignoreCSSAttributes:v});case t.TEXT_NODE:return Oy(t,{doc:n,maskAllText:c,maskTextClass:u,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:f,maskTextFn:g,maskInputOptions:m,maskInputFn:y,rootId:E});case t.CDATA_SECTION_NODE:return{type:ht.CDATA,textContent:"",rootId:E};case t.COMMENT_NODE:return{type:ht.Comment,textContent:t.textContent||"",rootId:E};default:return!1}}function Ny(t,e){if(!e.hasNode(t))return;const n=e.getId(t);return n===1?void 0:n}function Oy(t,e){var _;const{maskAllText:n,maskTextClass:r,unmaskTextClass:s,maskTextSelector:i,unmaskTextSelector:o,maskTextFn:c,maskInputOptions:a,maskInputFn:u,rootId:l}=e,d=t.parentNode&&t.parentNode.tagName;let f=t.textContent;const p=d==="STYLE"?!0:void 0,m=d==="SCRIPT"?!0:void 0,g=d==="TEXTAREA"?!0:void 0;if(p&&f){try{t.nextSibling||t.previousSibling||(_=t.parentNode.sheet)!=null&&_.cssRules&&(f=Xr(t.parentNode.sheet))}catch(T){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${T}`,t)}f=Zr(f,ts(e.doc))}m&&(f="SCRIPT_PLACEHOLDER");const y=_n(t,r,i,s,o,n);if(!p&&!m&&!g&&f&&y&&(f=c?c(f,t.parentElement):f.replace(/[\S]/g,"*")),g&&f&&(a.textarea||y)&&(f=u?u(f,t.parentNode):f.replace(/[\S]/g,"*")),d==="OPTION"&&f){const T=Jr({type:null,tagName:d,maskInputOptions:a});f=Qn({isMasked:_n(t,r,i,s,o,T),element:t,value:f,maskInputFn:u})}return{type:ht.Text,textContent:f||"",isStyle:p,rootId:l}}function Ly(t,e){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:m=!1,rootId:g,maskTextClass:y,unmaskTextClass:_,maskTextSelector:T,unmaskTextSelector:F,ignoreCSSAttributes:w}=e,M=Ry(t,r,s,i),v=gy(t);let E={};const B=t.attributes.length;for(let b=0;b<B;b++){const D=t.attributes[b];D.name&&!ku(v,D.name,D.value)&&(E[D.name]=wu(n,v,pn(D.name),D.value,t,a,w))}if(v==="link"&&o){const b=Array.from(n.styleSheets).find(Y=>Y.href===t.href);let D=null;b&&(D=Xr(b)),D&&(E.rel=null,E.href=null,E.crossorigin=null,E._cssText=Zr(D,b.href))}if(v==="style"&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){const b=Xr(t.sheet);b&&(E._cssText=Zr(b,ts(n)))}if(v==="input"||v==="textarea"||v==="select"||v==="option"){const b=t,D=Li(b),Y=Qr(b,Oi(v),D),Z=b.checked;if(D!=="submit"&&D!=="button"&&Y){const et=_n(b,y,T,_,F,Jr({type:D,tagName:Oi(v),maskInputOptions:c}));E.value=Qn({isMasked:et,element:b,value:Y,maskInputFn:u})}Z&&(E.checked=Z)}if(v==="option"&&(t.selected&&!c.select?E.selected=!0:delete E.selected),v==="canvas"&&f){if(t.__context==="2d")fy(t)||(E.rr_dataURL=t.toDataURL(l.type,l.quality));else if(!("__context"in t)){const b=t.toDataURL(l.type,l.quality),D=n.createElement("canvas");D.width=t.width,D.height=t.height;const Y=D.toDataURL(l.type,l.quality);b!==Y&&(E.rr_dataURL=b)}}if(v==="img"&&d){hn||(hn=n.createElement("canvas"),Iu=hn.getContext("2d"));const b=t,D=b.currentSrc||b.getAttribute("src")||"<unknown-src>",Y=b.crossOrigin,Z=()=>{b.removeEventListener("load",Z);try{hn.width=b.naturalWidth,hn.height=b.naturalHeight,Iu.drawImage(b,0,0),E.rr_dataURL=hn.toDataURL(l.type,l.quality)}catch(et){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=${D}! Error: ${et}`)}b.crossOrigin==="anonymous"&&(Y?E.crossOrigin=Y:b.removeAttribute("crossorigin"))};b.complete&&b.naturalWidth!==0?Z():b.addEventListener("load",Z)}if((v==="audio"||v==="video")&&(E.rr_mediaState=t.paused?"paused":"played",E.rr_mediaCurrentTime=t.currentTime),m||(t.scrollLeft&&(E.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(E.rr_scrollTop=t.scrollTop)),M){const{width:b,height:D}=t.getBoundingClientRect();E={class:E.class,rr_width:`${b}px`,rr_height:`${D}px`}}v==="iframe"&&!p(E.src)&&(!M&&!vu(t)&&(E.rr_src=E.src),delete E.src);let C;try{customElements.get(v)&&(C=!0)}catch(b){}return{type:ht.Element,tagName:v,attributes:E,childNodes:[],isSVG:ky(t)||void 0,needBlock:M,rootId:g,isCustom:C}}function it(t){return t==null?"":t.toLowerCase()}function Dy(t,e){if(e.comment&&t.type===ht.Comment)return!0;if(t.type===ht.Element){if(e.script&&(t.tagName==="script"||t.tagName==="link"&&(t.attributes.rel==="preload"||t.attributes.rel==="modulepreload")||t.tagName==="link"&&t.attributes.rel==="prefetch"&&typeof t.attributes.href=="string"&&yu(t.attributes.href)==="js"))return!0;if(e.headFavicon&&(t.tagName==="link"&&t.attributes.rel==="shortcut icon"||t.tagName==="meta"&&(it(t.attributes.name).match(/^msapplication-tile(image|color)$/)||it(t.attributes.name)==="application-name"||it(t.attributes.rel)==="icon"||it(t.attributes.rel)==="apple-touch-icon"||it(t.attributes.rel)==="shortcut icon")))return!0;if(t.tagName==="meta"){if(e.headMetaDescKeywords&&it(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(it(t.attributes.property).match(/^(og|twitter|fb):/)||it(t.attributes.name).match(/^(og|twitter):/)||it(t.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(it(t.attributes.name)==="robots"||it(t.attributes.name)==="googlebot"||it(t.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&t.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(it(t.attributes.name)==="author"||it(t.attributes.name)==="generator"||it(t.attributes.name)==="framework"||it(t.attributes.name)==="publisher"||it(t.attributes.name)==="progid"||it(t.attributes.property).match(/^article:/)||it(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(it(t.attributes.name)==="google-site-verification"||it(t.attributes.name)==="yandex-verification"||it(t.attributes.name)==="csrf-token"||it(t.attributes.name)==="p:domain_verify"||it(t.attributes.name)==="verify-v1"||it(t.attributes.name)==="verification"||it(t.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function yn(t,e){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:m={},maskAttributeFn:g,maskTextFn:y,maskInputFn:_,slimDOMOptions:T,dataURLOptions:F={},inlineImages:w=!1,recordCanvas:M=!1,onSerialize:v,onIframeLoad:E,iframeLoadTimeout:B=5e3,onBlockedImageLoad:C,onStylesheetLoad:b,stylesheetLoadTimeout:D=5e3,keepIframeSrcFn:Y=()=>!1,newlyAddedElement:Z=!1,ignoreCSSAttributes:et}=e;let{preserveWhiteSpace:ot=!0}=e;const z=xy(t,{doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:c,unblockSelector:o,maskTextClass:a,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:d,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:g,maskTextFn:y,maskInputFn:_,dataURLOptions:F,inlineImages:w,recordCanvas:M,keepIframeSrcFn:Y,newlyAddedElement:Z,ignoreCSSAttributes:et});if(!z)return console.warn(t,"not serialized"),null;let x;r.hasNode(t)?x=r.getId(t):Dy(z,T)||!ot&&z.type===ht.Text&&!z.isStyle&&!z.textContent.trim().length?x=Zn:x=Pi();const k=Object.assign(z,{id:x});if(r.add(t,k),x===Zn)return null;v&&v(t);let at=!f;if(k.type===ht.Element){at=at&&!k.needBlock;const A=t.shadowRoot;A&&Jn(A)&&(k.isShadowHost=!0)}if((k.type===ht.Document||k.type===ht.Element)&&at){T.headWhitespace&&k.type===ht.Element&&k.tagName==="head"&&(ot=!1);const A={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:m,maskAttributeFn:g,maskTextFn:y,maskInputFn:_,slimDOMOptions:T,dataURLOptions:F,inlineImages:w,recordCanvas:M,preserveWhiteSpace:ot,onSerialize:v,onIframeLoad:E,iframeLoadTimeout:B,onBlockedImageLoad:C,onStylesheetLoad:b,stylesheetLoadTimeout:D,keepIframeSrcFn:Y,ignoreCSSAttributes:et},K=t.childNodes?Array.from(t.childNodes):[];for(const J of K){const nt=yn(J,A);nt&&k.childNodes.push(nt)}if(sy(t)&&t.shadowRoot)for(const J of Array.from(t.shadowRoot.childNodes)){const nt=yn(J,A);nt&&(Jn(t.shadowRoot)&&(nt.isShadow=!0),k.childNodes.push(nt))}}if(t.parentNode&&Xn(t.parentNode)&&Jn(t.parentNode)&&(k.isShadow=!0),k.type===ht.Element&&k.tagName==="iframe"&&!k.needBlock&&Ay(t,()=>{const A=vu(t);if(A&&E){const K=yn(A,{doc:A,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:g,maskTextFn:y,maskInputFn:_,slimDOMOptions:T,dataURLOptions:F,inlineImages:w,recordCanvas:M,preserveWhiteSpace:ot,onSerialize:v,onIframeLoad:E,iframeLoadTimeout:B,onStylesheetLoad:b,stylesheetLoadTimeout:D,keepIframeSrcFn:Y,ignoreCSSAttributes:et});K&&E(t,K)}},B),k.type===ht.Element&&k.tagName==="img"&&!t.complete&&k.needBlock){const A=t,K=()=>{if(A.isConnected&&!A.complete&&C)try{const J=A.getBoundingClientRect();J.width>0&&J.height>0&&C(A,k,J)}catch(J){}A.removeEventListener("load",K)};A.isConnected&&A.addEventListener("load",K)}return k.type===ht.Element&&k.tagName==="link"&&typeof k.attributes.rel=="string"&&(k.attributes.rel==="stylesheet"||k.attributes.rel==="preload"&&typeof k.attributes.href=="string"&&yu(k.attributes.href)==="css")&&My(t,()=>{if(b){const A=yn(t,{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:m,maskAttributeFn:g,maskTextFn:y,maskInputFn:_,slimDOMOptions:T,dataURLOptions:F,inlineImages:w,recordCanvas:M,preserveWhiteSpace:ot,onSerialize:v,onIframeLoad:E,iframeLoadTimeout:B,onStylesheetLoad:b,stylesheetLoadTimeout:D,keepIframeSrcFn:Y,ignoreCSSAttributes:et});A&&b(t,A)}},D),k.type===ht.Element&&delete k.needBlock,k}function Py(t,e){const{mirror:n=new gu,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:m=!1,maskAttributeFn:g,maskTextFn:y,maskInputFn:_,slimDOM:T=!1,dataURLOptions:F,preserveWhiteSpace:w,onSerialize:M,onIframeLoad:v,iframeLoadTimeout:E,onBlockedImageLoad:B,onStylesheetLoad:C,stylesheetLoadTimeout:b,keepIframeSrcFn:D=()=>!1,ignoreCSSAttributes:Y=new Set([])}=e||{};return yn(t,{doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,maskAllText:o,maskTextClass:c,unmaskTextClass:a,maskTextSelector:u,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions: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}:m===!1?{}:m,maskAttributeFn:g,maskTextFn:y,maskInputFn:_,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:F,inlineImages:f,recordCanvas:p,preserveWhiteSpace:w,onSerialize:M,onIframeLoad:v,iframeLoadTimeout:E,onBlockedImageLoad:B,onStylesheetLoad:C,stylesheetLoadTimeout:b,keepIframeSrcFn:D,newlyAddedElement:!1,ignoreCSSAttributes:Y})}function It(t,e,n=document){const r={capture:!0,passive:!0};return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}const Sn=`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 Ru={map:{},getId(){return console.error(Sn),-1},getNode(){return console.error(Sn),null},removeNodeFromMap(){console.error(Sn)},has(){return console.error(Sn),!1},reset(){console.error(Sn)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(Ru=new Proxy(Ru,{get(t,e,n){return e==="map"&&console.error(Sn),Reflect.get(t,e,n)}}));function tr(t,e,n={}){let r=null,s=0;return function(...i){const o=Date.now();!s&&n.leading===!1&&(s=o);const c=e-(o-s),a=this;c<=0||c>e?(r&&(zy(r),r=null),s=o,t.apply(a,i)):!r&&n.trailing!==!1&&(r=ns(()=>{s=n.leading===!1?0:Date.now(),r=null,t.apply(a,i)},c))}}function Cu(t,e,n,r,s=window){const i=s.Object.getOwnPropertyDescriptor(t,e);return s.Object.defineProperty(t,e,r?n:{set(o){ns(()=>{n.set.call(this,o)},0),i&&i.set&&i.set.call(this,o)}}),()=>Cu(t,e,i||{},!0)}function Fi(t,e,n){try{if(!(e in t))return()=>{};const r=t[e],s=n(r);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=s,()=>{t[e]=r}}catch(r){return()=>{}}}let es=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(es=()=>new Date().getTime());function Au(t){var n,r,s,i,o,c;const e=t.document;return{left:e.scrollingElement?e.scrollingElement.scrollLeft:t.pageXOffset!==void 0?t.pageXOffset:(e==null?void 0:e.documentElement.scrollLeft)||((r=(n=e==null?void 0:e.body)==null?void 0:n.parentElement)==null?void 0:r.scrollLeft)||((s=e==null?void 0:e.body)==null?void 0:s.scrollLeft)||0,top:e.scrollingElement?e.scrollingElement.scrollTop:t.pageYOffset!==void 0?t.pageYOffset:(e==null?void 0:e.documentElement.scrollTop)||((o=(i=e==null?void 0:e.body)==null?void 0:i.parentElement)==null?void 0:o.scrollTop)||((c=e==null?void 0:e.body)==null?void 0:c.scrollTop)||0}}function Mu(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function xu(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Nu(t){if(!t)return null;try{return t.nodeType===t.ELEMENT_NODE?t:t.parentElement}catch(e){return null}}function Dt(t,e,n,r,s){if(!t)return!1;const i=Nu(t);if(!i)return!1;const o=gn(e,n);if(!s){const u=r&&i.matches(r);return o(i)&&!u}const c=He(i,o);let a=-1;return c<0?!1:(r&&(a=He(i,gn(null,r))),c>-1&&a<0?!0:c<a)}function Fy(t,e){return e.getId(t)!==-1}function Bi(t,e){return e.getId(t)===Zn}function Ou(t,e){if(Xn(t))return!1;const n=e.getId(t);return e.has(n)?t.parentNode&&t.parentNode.nodeType===t.DOCUMENT_NODE?!1:t.parentNode?Ou(t.parentNode,e):!0:!0}function $i(t){return Boolean(t.changedTouches)}function By(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let n=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function Lu(t,e){return Boolean(t.nodeName==="IFRAME"&&e.getMeta(t))}function Du(t,e){return Boolean(t.nodeName==="LINK"&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&t.getAttribute("rel")==="stylesheet"&&e.getMeta(t))}function Ui(t){return Boolean(t==null?void 0:t.shadowRoot)}class $y{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var n;return(n=this.styleIDMap.get(e))!=null?n:-1}has(e){return this.styleIDMap.has(e)}add(e,n){if(this.has(e))return this.getId(e);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Pu(t){var n,r;let e=null;return((r=(n=t.getRootNode)==null?void 0:n.call(t))==null?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&t.getRootNode().host&&(e=t.getRootNode().host),e}function Uy(t){let e=t,n;for(;n=Pu(e);)e=n;return e}function Hy(t){const e=t.ownerDocument;if(!e)return!1;const n=Uy(t);return e.contains(n)}function Fu(t){const e=t.ownerDocument;return e?e.contains(t)||Hy(t):!1}const Bu={};function Hi(t){const e=Bu[t];if(e)return e;const n=window.document;let r=window[t];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[t]&&(r=i[t]),n.head.removeChild(s)}catch(s){}return Bu[t]=r.bind(window)}function Wy(...t){return Hi("requestAnimationFrame")(...t)}function ns(...t){return Hi("setTimeout")(...t)}function zy(...t){return Hi("clearTimeout")(...t)}var H=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(H||{}),P=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(P||{}),Tt=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Tt||{}),ie=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(ie||{}),En=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(En||{});let er;function jy(t){er=t}function qy(){er=void 0}const q=t=>er?(...n)=>{try{return t(...n)}catch(r){if(er&&er(r)===!0)return()=>{};throw r}}:t;for(var $u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Gy=typeof Uint8Array=="undefined"?[]:new Uint8Array(256),rs=0;rs<$u.length;rs++)Gy[$u.charCodeAt(rs)]=rs;class Uu{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}}function Wi(t){try{return t.contentDocument}catch(e){}}function nr(t){try{return t.contentWindow}catch(e){}}class Vy{constructor(e){this.doc=e,this.unattachedDoc=null}parse(e){return this.parseWithConstructableStylesheet(e)||this.parseWithDetachedElement(e)}parseWithConstructableStylesheet(e){if(typeof CSSStyleSheet=="undefined"||typeof CSSStyleSheet.prototype.replaceSync!="function")return null;try{const n=new CSSStyleSheet;n.replaceSync(`x { ${e} }`);const r=n.cssRules[0];return!r||r.type!==CSSRule.STYLE_RULE?null:r.style}catch(n){return null}}parseWithDetachedElement(e){const n=this.getUnattachedDoc().createElement("span");return n.setAttribute("style",e),n.style}getUnattachedDoc(){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}return this.unattachedDoc}}function Hu(t){return"__ln"in t}class Yy{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<e;r++)n=(n==null?void 0:n.next)||null;return n}addNode(e){const n={value:e,previous:null,next:null};if(e.__ln=n,e.previousSibling&&Hu(e.previousSibling)){const r=e.previousSibling.__ln.next;n.next=r,n.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(e.nextSibling&&Hu(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;n.previous=r,n.next=e.nextSibling.__ln,e.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(e){const n=e.__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),e.__ln&&delete e.__ln,this.length--)}}const Wu=(t,e)=>`${t}@${e}`;class Ky{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=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],n=new Set,r=new Yy,s=a=>{let u=a,l=Zn;for(;l===Zn;)u=u&&u.nextSibling,l=u&&this.mirror.getId(u);return l},i=a=>{if(!a.parentNode||!Fu(a))return;const u=Xn(a.parentNode)?this.mirror.getId(Pu(a)):this.mirror.getId(a.parentNode),l=s(a);if(u===-1||l===-1)return r.addNode(a);const d=yn(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=>{Lu(f,this.mirror)&&!Dt(f,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(f),Du(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),Ui(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,this.doc)},onIframeLoad:(f,p)=>{if(Dt(f,this.blockClass,this.blockSelector,this.unblockSelector,!1))return;this.iframeManager.attachIframe(f,p);const m=nr(f);m&&this.canvasManager.addWindow(m),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,p)=>{this.stylesheetManager.attachLinkElement(f,p)},onBlockedImageLoad:(f,p,{width:m,height:g})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:p.id,attributes:{style:{width:`${m}px`,height:`${g}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});d&&(e.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)zu(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||i(a);for(const a of this.addedSet)!ju(this.droppedSet,a)&&!zu(this.removes,a,this.mirror)||ju(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 m=p.parentNode.host;if(this.mirror.getId(m)!==-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:e};!c.texts.length&&!c.attributes.length&&!c.removes.length&&!c.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(c))},this.processMutation=e=>{if(!Bi(e.target,this.mirror))switch(e.type){case"characterData":{const n=e.target.textContent;!Dt(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==e.oldValue&&this.texts.push({value:_n(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,Nu(e.target)):n.replace(/[\S]/g,"*"):n,node:e.target});break}case"attributes":{const n=e.target;let r=e.attributeName,s=e.target.getAttribute(r);if(r==="value"){const o=Li(n),c=n.tagName;s=Qr(n,c,o);const a=Jr({maskInputOptions:this.maskInputOptions,tagName:c,type:o}),u=_n(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,a);s=Qn({isMasked:u,element:n,value:s,maskInputFn:this.maskInputFn})}if(Dt(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||s===e.oldValue)return;let i=this.attributeMap.get(e.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(s))if(!Wi(n))r="rr_src";else return;if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),r==="type"&&n.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!ku(n.tagName,r)&&(i.attributes[r]=wu(this.doc,pn(n.tagName),pn(r),s,n,this.maskAttributeFn),r==="style")){const o=e.oldValue?this.styleDeclarationParser.parse(e.oldValue):null;for(const c of Array.from(n.style)){const a=n.style.getPropertyValue(c),u=n.style.getPropertyPriority(c);a!==((o==null?void 0:o.getPropertyValue(c))||"")||u!==((o==null?void 0:o.getPropertyPriority(c))||"")?u===""?i.styleDiff[c]=a:i.styleDiff[c]=[a,u]:i._unchangedStyles[c]=[a,u]}if(o)for(const c of Array.from(o))n.style.getPropertyValue(c)===""&&(i.styleDiff[c]=!1)}break}case"childList":{if(Dt(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;e.addedNodes.forEach(n=>this.genAdds(n,e.target)),e.removedNodes.forEach(n=>{const r=this.mirror.getId(n),s=Xn(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Dt(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||Bi(n,this.mirror)||!Fy(n,this.mirror)||(this.addedSet.has(n)?(zi(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(e.target)&&r===-1||Ou(e.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[Wu(r,s)]?zi(this.movedSet,n):this.removes.push({parentId:s,id:r,isShadow:Xn(e.target)&&Jn(e.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(e,n)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Bi(e,this.mirror))return;this.movedSet.add(e);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[Wu(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Dt(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(e.childNodes&&e.childNodes.forEach(r=>this.genAdds(r)),Ui(e)&&e.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}}}init(e){["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]=e[n]}),this.styleDeclarationParser=new Vy(this.doc)}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 zi(t,e){var n;t.delete(e),(n=e.childNodes)==null||n.forEach(r=>zi(t,r))}function zu(t,e,n){return t.length===0?!1:Xy(t,e,n)}function Xy(t,e,n){let r=e.parentNode;for(;r;){const s=n.getId(r);if(t.some(i=>i.id===s))return!0;r=r.parentNode}return!1}function ju(t,e){return t.size===0?!1:qu(t,e)}function qu(t,e){const{parentNode:n}=e;return n?t.has(n)?!0:qu(t,n):!1}const bn=[];function rr(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(e){}return t&&t.target}function Gu(t,e){var o,c;const n=new Ky;bn.push(n),n.init(t);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(q(a=>{t.onMutation&&t.onMutation(a)===!1||n.processMutations.bind(n)(a)}));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function Jy({mousemoveCb:t,sampling:e,doc:n,mirror:r}){if(e.mousemove===!1)return()=>{};const s=typeof e.mousemove=="number"?e.mousemove:50,i=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let o=[],c;const a=tr(q(d=>{const f=Date.now()-c;t(o.map(p=>(p.timeOffset-=f,p)),d),o=[],c=null}),i),u=q(tr(q(d=>{const f=rr(d),{clientX:p,clientY:m}=$i(d)?d.changedTouches[0]:d;c||(c=es()),o.push({x:p,y:m,id:r.getId(f),timeOffset:es()-c}),a(typeof DragEvent!="undefined"&&d instanceof DragEvent?P.Drag:d instanceof MouseEvent?P.MouseMove:P.TouchMove)}),s,{trailing:!1})),l=[It("mousemove",u,n),It("touchmove",u,n),It("drag",u,n)];return q(()=>{l.forEach(d=>d())})}function Qy({mouseInteractionCb:t,doc:e,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=rr(f);if(Dt(p,r,s,i,!0))return;let m=null,g=d;if("pointerType"in f){switch(f.pointerType){case"mouse":m=ie.Mouse;break;case"touch":m=ie.Touch;break;case"pen":m=ie.Pen;break}m===ie.Touch?Tt[d]===Tt.MouseDown?g="TouchStart":Tt[d]===Tt.MouseUp&&(g="TouchEnd"):ie.Pen}else $i(f)&&(m=ie.Touch);m!==null?(u=m,(g.startsWith("Touch")&&m===ie.Touch||g.startsWith("Mouse")&&m===ie.Mouse)&&(m=null)):Tt[d]===Tt.Click&&(m=u,u=null);const y=$i(f)?f.changedTouches[0]:f;if(!y)return;const _=n.getId(p),{clientX:T,clientY:F}=y;q(t)(h({type:Tt[g],id:_,x:T,y:F},m!==null&&{pointerType:m}))};return Object.keys(Tt).filter(d=>Number.isNaN(Number(d))&&!d.endsWith("_Departed")&&c[d]!==!1).forEach(d=>{let f=pn(d);const p=l(d);if(window.PointerEvent)switch(Tt[d]){case Tt.MouseDown:case Tt.MouseUp:f=f.replace("mouse","pointer");break;case Tt.TouchStart:case Tt.TouchEnd:return}a.push(It(f,p,e))}),q(()=>{a.forEach(d=>d())})}function Vu({scrollCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:o}){const c=q(tr(q(a=>{const u=rr(a);if(!u||Dt(u,r,s,i,!0))return;const l=n.getId(u);if(u===e&&e.defaultView){const d=Au(e.defaultView);t({id:l,x:d.left,y:d.top})}else t({id:l,x:u.scrollLeft,y:u.scrollTop})}),o.scroll||100));return It("scroll",c,e)}function Zy({viewportResizeCb:t},{win:e}){let n=-1,r=-1;const s=q(tr(q(()=>{const i=Mu(),o=xu();(n!==i||r!==o)&&(t({width:Number(o),height:Number(i)}),n=i,r=o)}),200));return It("resize",s,e)}const tS=["INPUT","TEXTAREA","SELECT"],Yu=new WeakMap;function eS({inputCb:t,doc:e,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:m,unmaskTextSelector:g}){function y(E){let B=rr(E);const C=E.isTrusted,b=B&&Oi(B.tagName);if(b==="OPTION"&&(B=B.parentElement),!B||!b||tS.indexOf(b)<0||Dt(B,r,s,i,!0))return;const D=B;if(D.classList.contains(o)||c&&D.matches(c))return;const Y=Li(B);let Z=Qr(D,b,Y),et=!1;const ot=Jr({maskInputOptions:a,tagName:b,type:Y}),z=_n(B,f,m,p,g,ot);(Y==="radio"||Y==="checkbox")&&(et=B.checked),Z=Qn({isMasked:z,element:B,value:Z,maskInputFn:u}),_(B,d?{text:Z,isChecked:et,userTriggered:C}:{text:Z,isChecked:et});const x=B.name;Y==="radio"&&x&&et&&e.querySelectorAll(`input[type="radio"][name="${x}"]`).forEach(k=>{if(k!==B){const at=Qn({isMasked:z,element:k,value:Qr(k,b,Y),maskInputFn:u});_(k,d?{text:at,isChecked:!et,userTriggered:!1}:{text:at,isChecked:!et})}})}function _(E,B){const C=Yu.get(E);if(!C||C.text!==B.text||C.isChecked!==B.isChecked){Yu.set(E,B);const b=n.getId(E);q(t)(R(h({},B),{id:b}))}}const F=(l.input==="last"?["change"]:["input","change"]).map(E=>It(E,q(y),e)),w=e.defaultView;if(!w)return()=>{F.forEach(E=>E())};const M=w.Object.getOwnPropertyDescriptor(w.HTMLInputElement.prototype,"value"),v=[[w.HTMLInputElement.prototype,"value"],[w.HTMLInputElement.prototype,"checked"],[w.HTMLSelectElement.prototype,"value"],[w.HTMLTextAreaElement.prototype,"value"],[w.HTMLSelectElement.prototype,"selectedIndex"],[w.HTMLOptionElement.prototype,"selected"]];return M&&M.set&&F.push(...v.map(E=>Cu(E[0],E[1],{set(){q(y)({target:this,isTrusted:!1})}},!1,w))),q(()=>{F.forEach(E=>E())})}function ss(t){const e=[];function n(r,s){if(is("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||is("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||is("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||is("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(t,e)}function Ie(t,e,n){let r,s;return t?(t.ownerNode?r=e.getId(t.ownerNode):s=n.getId(t),{styleId:s,id:r}):{}}function nS({styleSheetRuleCb:t,mirror:e,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:q((l,d,f)=>{const[p,m]=f,{id:g,styleId:y}=Ie(d,e,n.styleMirror);return(g&&g!==-1||y&&y!==-1)&&t({id:g,styleId:y,adds:[{rule:p,index:m}]}),l.apply(d,f)})});const i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:q((l,d,f)=>{const[p]=f,{id:m,styleId:g}=Ie(d,e,n.styleMirror);return(m&&m!==-1||g&&g!==-1)&&t({id:m,styleId:g,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:q((l,d,f)=>{const[p]=f,{id:m,styleId:g}=Ie(d,e,n.styleMirror);return(m&&m!==-1||g&&g!==-1)&&t({id:m,styleId:g,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:q((l,d,f)=>{const[p]=f,{id:m,styleId:g}=Ie(d,e,n.styleMirror);return(m&&m!==-1||g&&g!==-1)&&t({id:m,styleId:g,replaceSync:p}),l.apply(d,f)})}));const a={};os("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(os("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),os("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),os("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:q((f,p,m)=>{const[g,y]=m,{id:_,styleId:T}=Ie(p.parentStyleSheet,e,n.styleMirror);return(_&&_!==-1||T&&T!==-1)&&t({id:_,styleId:T,adds:[{rule:g,index:[...ss(p),y||0]}]}),f.apply(p,m)})}),d.prototype.deleteRule=new Proxy(u[l].deleteRule,{apply:q((f,p,m)=>{const[g]=m,{id:y,styleId:_}=Ie(p.parentStyleSheet,e,n.styleMirror);return(y&&y!==-1||_&&_!==-1)&&t({id:y,styleId:_,removes:[{index:[...ss(p),g]}]}),f.apply(p,m)})})}),q(()=>{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 Ku({mirror:t,stylesheetManager:e},n){var o,c,a;let r=null;n.nodeName==="#document"?r=t.getId(n):r=t.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{e.adoptStyleSheets(u,r)}catch(f){}return l}}),q(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function rS({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:r},{win:s}){const i=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:q((c,a,u)=>{var g;const[l,d,f]=u;if(n.has(l))return i.apply(a,[l,d,f]);const{id:p,styleId:m}=Ie((g=a.parentRule)==null?void 0:g.parentStyleSheet,e,r.styleMirror);return(p&&p!==-1||m&&m!==-1)&&t({id:p,styleId:m,set:{property:l,value:d,priority:f},index:ss(a.parentRule)}),c.apply(a,u)})});const o=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:q((c,a,u)=>{var p;const[l]=u;if(n.has(l))return o.apply(a,[l]);const{id:d,styleId:f}=Ie((p=a.parentRule)==null?void 0:p.parentStyleSheet,e,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&t({id:d,styleId:f,remove:{property:l},index:ss(a.parentRule)}),c.apply(a,u)})}),q(()=>{s.CSSStyleDeclaration.prototype.setProperty=i,s.CSSStyleDeclaration.prototype.removeProperty=o})}function sS({mediaInteractionCb:t,blockClass:e,blockSelector:n,unblockSelector:r,mirror:s,sampling:i,doc:o}){const c=q(u=>tr(q(l=>{const d=rr(l);if(!d||Dt(d,e,n,r,!0))return;const{currentTime:f,volume:p,muted:m,playbackRate:g}=d;t({type:u,id:s.getId(d),currentTime:f,volume:p,muted:m,playbackRate:g})}),i.media||500)),a=[It("play",c(En.Play),o),It("pause",c(En.Pause),o),It("seeked",c(En.Seeked),o),It("volumechange",c(En.VolumeChange),o),It("ratechange",c(En.RateChange),o)];return q(()=>{a.forEach(u=>u())})}function iS({fontCb:t,doc:e}){const n=e.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=Fi(e.fonts,"add",function(c){return function(a){return ns(q(()=>{const u=s.get(a);u&&(t(u),s.delete(a))}),0),c.apply(this,[a])}});return r.push(()=>{n.FontFace=i}),r.push(o),q(()=>{r.forEach(c=>c())})}function oS(t){const{doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,selectionCb:o}=t;let c=!0;const a=q(()=>{const u=e.getSelection();if(!u||c&&(u==null?void 0: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:m,startOffset:g,endContainer:y,endOffset:_}=p;Dt(m,r,s,i,!0)||Dt(y,r,s,i,!0)||l.push({start:n.getId(m),startOffset:g,end:n.getId(y),endOffset:_})}o({ranges:l})});return a(),It("selectionchange",a)}function aS({doc:t,customElementCb:e}){const n=t.defaultView;return!n||!n.customElements?()=>{}:Fi(n.customElements,"define",function(s){return function(i,o,c){try{e({define:{name:i}})}catch(a){}return s.apply(this,[i,o,c])}})}function cS(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};let r;t.recordDOM&&(r=Gu(t,t.doc));const s=Jy(t),i=Qy(t),o=Vu(t),c=Zy(t,{win:n}),a=eS(t),u=sS(t);let l=()=>{},d=()=>{},f=()=>{},p=()=>{};t.recordDOM&&(l=nS(t,{win:n}),d=Ku(t,t.doc),f=rS(t,{win:n}),t.collectFonts&&(p=iS(t)));const m=oS(t),g=aS(t),y=[];for(const _ of t.plugins)y.push(_.observer(_.callback,n,_.options));return q(()=>{bn.forEach(_=>_.reset()),r==null||r.disconnect(),s(),i(),o(),c(),a(),u(),l(),d(),f(),p(),m(),g(),y.forEach(_=>_())})}function is(t){return typeof window[t]!="undefined"}function os(t){return Boolean(typeof window[t]!="undefined"&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class ji{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,n,r,s){const i=r||this.getIdToRemoteIdMap(e),o=s||this.getRemoteIdToIdMap(e);let c=i.get(n);return c||(c=this.generateIdFn(),i.set(n,c),o.set(c,n)),c}getIds(e,n){const r=this.getIdToRemoteIdMap(e),s=this.getRemoteIdToIdMap(e);return n.map(i=>this.getId(e,i,r,s))}getRemoteId(e,n,r){const s=r||this.getRemoteIdToIdMap(e);if(typeof n!="number")return n;const i=s.get(n);return i||-1}getRemoteIds(e,n){const r=this.getRemoteIdToIdMap(e);return n.map(s=>this.getRemoteId(e,s,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let n=this.iframeIdToRemoteIdMap.get(e);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(e,n)),n}getRemoteIdToIdMap(e){let n=this.iframeRemoteIdToIdMap.get(e);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(e,n)),n}}class uS{constructor(){this.crossOriginIframeMirror=new ji(Pi),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class lS{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new ji(Pi),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ji(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0);const n=nr(e);n&&this.crossOriginIframeMap.set(n,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,n){var s,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((s=nr(e))==null||s.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,e);const r=Wi(e);r&&r.adoptedStyleSheets&&r.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(r.adoptedStyleSheets,this.mirror.getId(r))}handleMessage(e){const n=e;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!e.source)return;const s=this.crossOriginIframeMap.get(e.source);if(!s)return;const i=this.transformCrossOriginEvent(s,n.data.event);i&&this.wrappedEmit(i,n.data.isCheckout)}transformCrossOriginEvent(e,n){var r;switch(n.type){case H.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(n.data.node,e);const s=n.data.node.id;return this.crossOriginIframeRootIdMap.set(e,s),this.patchRootIdOnNode(n.data.node,s),{timestamp:n.timestamp,type:H.IncrementalSnapshot,data:{source:P.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case H.Meta:case H.Load:case H.DomContentLoaded:return!1;case H.Plugin:return n;case H.Custom:return this.replaceIds(n.data.payload,e,["id","parentId","previousId","nextId"]),n;case H.IncrementalSnapshot:switch(n.data.source){case P.Mutation:return n.data.adds.forEach(s=>{this.replaceIds(s,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,e);const i=this.crossOriginIframeRootIdMap.get(e);i&&this.patchRootIdOnNode(s.node,i)}),n.data.removes.forEach(s=>{this.replaceIds(s,e,["parentId","id"])}),n.data.attributes.forEach(s=>{this.replaceIds(s,e,["id"])}),n.data.texts.forEach(s=>{this.replaceIds(s,e,["id"])}),n;case P.Drag:case P.TouchMove:case P.MouseMove:return n.data.positions.forEach(s=>{this.replaceIds(s,e,["id"])}),n;case P.ViewportResize:return!1;case P.MediaInteraction:case P.MouseInteraction:case P.Scroll:case P.CanvasMutation:case P.Input:return this.replaceIds(n.data,e,["id"]),n;case P.StyleSheetRule:case P.StyleDeclaration:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleId"]),n;case P.Font:return n;case P.Selection:return n.data.ranges.forEach(s=>{this.replaceIds(s,e,["start","end"])}),n;case P.AdoptedStyleSheet:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleIds"]),(r=n.data.styles)==null||r.forEach(s=>{this.replaceStyleIds(s,e,["styleId"])}),n}}return!1}replace(e,n,r,s){for(const i of s)!Array.isArray(n[i])&&typeof n[i]!="number"||(Array.isArray(n[i])?n[i]=e.getIds(r,n[i]):n[i]=e.getId(r,n[i]));return n}replaceIds(e,n,r){return this.replace(this.crossOriginIframeMirror,e,n,r)}replaceStyleIds(e,n,r){return this.replace(this.crossOriginIframeStyleMirror,e,n,r)}replaceIdOnNode(e,n){this.replaceIds(e,n,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(e,n){e.type!==ht.Document&&!e.rootId&&(e.rootId=n),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class dS{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class fS{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,n){if(!Jn(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e),this.bypassOptions.canvasManager.addShadowRoot(e);const r=Gu(R(h({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Vu(R(h({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),ns(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(Ku({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){const n=Wi(e),r=nr(e);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(e,n){const r=this;this.restoreHandlers.push(Fi(e.prototype,"attachShadow",function(s){return function(i){const o=s.call(this,i);return this.shadowRoot&&Fu(this)&&r.addShadowRoot(this.shadowRoot,n),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(n){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}}class pS{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new $y,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,n){if(e.length===0)return;const r={id:n,styleIds:[]},s=[];for(const i of e){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:mu(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(e){}}class hS{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(e,n){const r=this.nodeMap.get(e);return r&&Array.from(r).some(s=>s!==n)}add(e,n){this.active||(this.active=!0,Wy(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(n))}destroy(){}}let lt,as;try{if(Array.from([1],t=>t*2)[0]!==2){const t=document.createElement("iframe");document.body.appendChild(t),Array.from=((Gl=t.contentWindow)==null?void 0:Gl.Array.from)||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}const zt=dy();function jt(t={}){const{emit:e,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:m=!0,maskAllInputs:g,maskInputOptions:y,slimDOMOptions:_,maskAttributeFn:T,maskInputFn:F,maskTextFn:w,maxCanvasSize:M=null,packFn:v,sampling:E={},dataURLOptions:B={},mousemoveWait:C,recordDOM:b=!0,recordCanvas:D=!1,recordCrossOriginIframes:Y=!1,recordAfter:Z=t.recordAfter==="DOMContentLoaded"?t.recordAfter:"load",userTriggeredOnInput:et=!1,collectFonts:ot=!1,inlineImages:z=!1,plugins:x,keepIframeSrcFn:k=()=>!1,ignoreCSSAttributes:at=new Set([]),errorHandler:A,onMutation:K,getCanvasManager:J}=t;jy(A);const nt=Y?window.parent===window:!0;let ut=!1;if(!nt)try{window.parent.document&&(ut=!1)}catch(Q){ut=!0}if(nt&&!e)throw new Error("emit function is required");if(!nt&&!ut)return()=>{};C!==void 0&&E.mousemove===void 0&&(E.mousemove=C),zt.reset();const qt=g===!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}:y!==void 0?y:{},oe=_===!0||_==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:_==="all",headMetaDescKeywords:_==="all"}:_||{};By();let We,ae=0;const cr=Q=>{for(const Gt of x||[])Gt.eventProcessor&&(Q=Gt.eventProcessor(Q));return v&&!ut&&(Q=v(Q)),Q};lt=(Q,Gt)=>{var At;const G=Q;if(G.timestamp=es(),((At=bn[0])==null?void 0:At.isFrozen())&&G.type!==H.FullSnapshot&&!(G.type===H.IncrementalSnapshot&&G.data.source===P.Mutation)&&bn.forEach(wt=>wt.unfreeze()),nt)e==null||e(cr(G),Gt);else if(ut){const wt={type:"rrweb",event:cr(G),origin:window.location.origin,isCheckout:Gt};window.parent.postMessage(wt,"*")}if(G.type===H.FullSnapshot)We=G,ae=0;else if(G.type===H.IncrementalSnapshot){if(G.data.source===P.Mutation&&G.data.isAttachIframe)return;ae++;const wt=r&&ae>=r,tt=n&&We&&G.timestamp-We.timestamp>n;(wt||tt)&&lo(!0)}};const ze=Q=>{lt({type:H.IncrementalSnapshot,data:h({source:P.Mutation},Q)})},Vl=Q=>lt({type:H.IncrementalSnapshot,data:h({source:P.Scroll},Q)}),vv=Q=>lt({type:H.IncrementalSnapshot,data:h({source:P.CanvasMutation},Q)}),Iv=Q=>lt({type:H.IncrementalSnapshot,data:h({source:P.AdoptedStyleSheet},Q)}),je=new pS({mutationCb:ze,adoptedStyleSheetCb:Iv}),qe=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new uS:new lS({mirror:zt,mutationCb:ze,stylesheetManager:je,recordCrossOriginIframes:Y,wrappedEmit:lt});for(const Q of x||[])Q.getMirror&&Q.getMirror({nodeMirror:zt,crossOriginIframeMirror:qe.crossOriginIframeMirror,crossOriginIframeStyleMirror:qe.crossOriginIframeStyleMirror});const co=new hS,uo=gS(J,{mirror:zt,win:window,mutationCb:Q=>lt({type:H.IncrementalSnapshot,data:h({source:P.CanvasMutation},Q)}),recordCanvas:D,blockClass:s,blockSelector:i,unblockSelector:o,maxCanvasSize:M,sampling:E.canvas,dataURLOptions:B,errorHandler:A}),Es=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new dS:new fS({mutationCb:ze,scrollCb:Vl,bypassOptions:{onMutation:K,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:u,maskTextClass:l,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:m,maskInputOptions:qt,dataURLOptions:B,maskAttributeFn:T,maskTextFn:w,maskInputFn:F,recordCanvas:D,inlineImages:z,sampling:E,slimDOMOptions:oe,iframeManager:qe,stylesheetManager:je,canvasManager:uo,keepIframeSrcFn:k,processedNodeManager:co,ignoreCSSAttributes:at},mirror:zt}),lo=(Q=!1)=>{if(!b)return;lt({type:H.Meta,data:{href:window.location.href,width:xu(),height:Mu()}},Q),je.reset(),Es.init(),bn.forEach(G=>G.lock());const Gt=Py(document,{mirror:zt,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:u,maskTextClass:l,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:m,maskAllInputs:qt,maskAttributeFn:T,maskInputFn:F,maskTextFn:w,slimDOM:oe,dataURLOptions:B,recordCanvas:D,inlineImages:z,onSerialize:G=>{Lu(G,zt)&&qe.addIframe(G),Du(G,zt)&&je.trackLinkElement(G),Ui(G)&&Es.addShadowRoot(G.shadowRoot,document)},onIframeLoad:(G,At)=>{qe.attachIframe(G,At);const wt=nr(G);wt&&uo.addWindow(wt),Es.observeAttachShadow(G)},onStylesheetLoad:(G,At)=>{je.attachLinkElement(G,At)},onBlockedImageLoad:(G,At,{width:wt,height:tt})=>{ze({adds:[],removes:[],texts:[],attributes:[{id:At.id,attributes:{style:{width:`${wt}px`,height:`${tt}px`}}}]})},keepIframeSrcFn:k,ignoreCSSAttributes:at});if(!Gt)return console.warn("Failed to snapshot the document");lt({type:H.FullSnapshot,data:{node:Gt,initialOffset:Au(window)}}),bn.forEach(G=>G.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&je.adoptStyleSheets(document.adoptedStyleSheets,zt.getId(document))};as=lo;try{const Q=[],Gt=At=>{var wt;return q(cS)({onMutation:K,mutationCb:ze,mousemoveCb:(tt,fo)=>lt({type:H.IncrementalSnapshot,data:{source:fo,positions:tt}}),mouseInteractionCb:tt=>lt({type:H.IncrementalSnapshot,data:h({source:P.MouseInteraction},tt)}),scrollCb:Vl,viewportResizeCb:tt=>lt({type:H.IncrementalSnapshot,data:h({source:P.ViewportResize},tt)}),inputCb:tt=>lt({type:H.IncrementalSnapshot,data:h({source:P.Input},tt)}),mediaInteractionCb:tt=>lt({type:H.IncrementalSnapshot,data:h({source:P.MediaInteraction},tt)}),styleSheetRuleCb:tt=>lt({type:H.IncrementalSnapshot,data:h({source:P.StyleSheetRule},tt)}),styleDeclarationCb:tt=>lt({type:H.IncrementalSnapshot,data:h({source:P.StyleDeclaration},tt)}),canvasMutationCb:vv,fontCb:tt=>lt({type:H.IncrementalSnapshot,data:h({source:P.Font},tt)}),selectionCb:tt=>{lt({type:H.IncrementalSnapshot,data:h({source:P.Selection},tt)})},customElementCb:tt=>{lt({type:H.IncrementalSnapshot,data:h({source:P.CustomElement},tt)})},blockClass:s,ignoreClass:c,ignoreSelector:a,maskAllText:u,maskTextClass:l,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,maskInputOptions:qt,inlineStylesheet:m,sampling:E,recordDOM:b,recordCanvas:D,inlineImages:z,userTriggeredOnInput:et,collectFonts:ot,doc:At,maskAttributeFn:T,maskInputFn:F,maskTextFn:w,keepIframeSrcFn:k,blockSelector:i,unblockSelector:o,slimDOMOptions:oe,dataURLOptions:B,mirror:zt,iframeManager:qe,stylesheetManager:je,shadowDomManager:Es,processedNodeManager:co,canvasManager:uo,ignoreCSSAttributes:at,plugins:((wt=x==null?void 0:x.filter(tt=>tt.observer))==null?void 0:wt.map(tt=>({observer:tt.observer,options:tt.options,callback:fo=>lt({type:H.Plugin,data:{plugin:tt.name,payload:fo}})})))||[]},{})};qe.addLoadListener(At=>{try{Q.push(Gt(At.contentDocument))}catch(wt){console.warn(wt)}});const G=()=>{lo(),Q.push(Gt(document))};return document.readyState==="interactive"||document.readyState==="complete"?G():(Q.push(It("DOMContentLoaded",()=>{lt({type:H.DomContentLoaded,data:{}}),Z==="DOMContentLoaded"&&G()})),Q.push(It("load",()=>{lt({type:H.Load,data:{}}),Z==="load"&&G()},window))),()=>{Q.forEach(At=>At()),co.destroy(),as=void 0,qy()}}catch(Q){console.warn(Q)}}function mS(t){if(!as)throw new Error("please take full snapshot after start recording");as(t)}jt.mirror=zt,jt.takeFullSnapshot=mS;function gS(t,e){try{return t?t(e):new Uu}catch(n){return console.warn("Unable to initialize CanvasManager"),new Uu}}var Xu;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(Xu||(Xu={}));const _S=3,yS=5;function qi(t){return t>9999999999?t:t*1e3}function Gi(t){return t>9999999999?t/1e3:t}function sr(t,e){e.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(e.category)?t.triggerUserActivity():t.checkAndHandleExpiredSession(),t.addUpdate(()=>(t.throttledAddEvent({type:H.Custom,timestamp:(e.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:$t(e,10,1e3)}}),e.category==="console")))}const SS="button,a";function Ju(t){return t.closest(SS)||t}function Qu(t){const e=Zu(t);return!e||!(e instanceof Element)?e:Ju(e)}function Zu(t){return ES(t)?t.target:t}function ES(t){return Ae(t)&&"target"in t}let Te;function bS(t){return Te||(Te=[],vS()),Te.push(t),()=>{const e=Te?Te.indexOf(t):-1;e>-1&&Te.splice(e,1)}}function vS(){kt(st,"open",function(t){return function(...e){if(Te)try{Te.forEach(n=>n())}catch(n){}return t.apply(st,e)}})}const IS=new Set([P.Mutation,P.StyleSheetRule,P.StyleDeclaration,P.AdoptedStyleSheet,P.CanvasMutation,P.Selection,P.MediaInteraction]);function TS(t,e,n){t.handleClick(e,n)}class wS{constructor(e,n,r=sr){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=e,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){const e=bS(()=>{this._lastMutation=tl()});this._teardown=()=>{e(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(e,n){if(RS(n,this._ignoreSelector)||!CS(e))return;const r={timestamp:Gi(e.timestamp),clickBreadcrumb:e,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(e=Date.now()){this._lastMutation=Gi(e)}registerScroll(e=Date.now()){this._lastScroll=Gi(e)}registerClick(e){const n=Ju(e);this._handleMultiClick(n)}_handleMultiClick(e){this._getClicks(e).forEach(n=>{n.clickCount++})}_getClicks(e){return this._clicks.filter(n=>n.node===e)}_checkClicks(){const e=[],n=tl();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&&e.push(r)});for(const r of e){const s=this._clicks.indexOf(r);s>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(s,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){const n=this._replay,r=e.scrollAfter&&e.scrollAfter<=this._scrollTimeout,s=e.mutationAfter&&e.mutationAfter<=this._threshold,i=!r&&!s,{clickCount:o,clickBreadcrumb:c}=e;if(i){const a=Math.min(e.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:R(h({},c.data),{url:st.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:R(h({},c.data),{url:st.location.href,route:n.getCurrentRoute(),clickCount:o,metric:!0})};this._addBreadcrumbEvent(n,a)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=Kn(()=>this._checkClicks(),1e3)}}const kS=["A","BUTTON","INPUT"];function RS(t,e){return!!(!kS.includes(t.tagName)||t.tagName==="INPUT"&&!["submit","button"].includes(t.getAttribute("type")||"")||t.tagName==="A"&&(t.hasAttribute("download")||t.hasAttribute("target")&&t.getAttribute("target")!=="_self")||e&&t.matches(e))}function CS(t){return!!(t.data&&typeof t.data.nodeId=="number"&&t.timestamp)}function tl(){return Date.now()/1e3}function AS(t,e){try{if(!MS(e))return;const{source:n}=e.data;if(IS.has(n)&&t.registerMutation(e.timestamp),n===P.Scroll&&t.registerScroll(e.timestamp),xS(e)){const{type:r,id:s}=e.data,i=jt.mirror.getNode(s);i instanceof HTMLElement&&r===Tt.Click&&t.registerClick(i)}}catch(n){}}function MS(t){return t.type===_S}function xS(t){return t.data.source===P.MouseInteraction}function Xt(t){return h({timestamp:Date.now()/1e3,type:"default"},t)}var cs=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(cs||{});const NS=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function OS(t){const e={};!t["data-sentry-component"]&&t["data-sentry-element"]&&(t["data-sentry-component"]=t["data-sentry-element"]);for(const n in t)if(NS.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),e[r]=t[n]}return e}const LS=t=>e=>{if(!t.isEnabled())return;const n=DS(e);if(!n)return;const r=e.name==="click",s=r?e.event:void 0;r&&t.clickDetector&&(s==null?void 0:s.target)&&!s.altKey&&!s.metaKey&&!s.ctrlKey&&!s.shiftKey&&TS(t.clickDetector,n,Qu(e.event)),sr(t,n)};function el(t,e){const n=jt.mirror.getId(t),r=n&&jt.mirror.getNode(n),s=r&&jt.mirror.getMeta(r),i=s&&FS(s)?s:null;return{message:e,data:i?{nodeId:n,node:{id:n,tagName:i.tagName,textContent:Array.from(i.childNodes).map(o=>o.type===cs.Text&&o.textContent).filter(Boolean).map(o=>o.trim()).join(""),attributes:OS(i.attributes)}}:{}}}function DS(t){const{target:e,message:n}=PS(t);return Xt(h({category:`ui.${t.name}`},el(e,n)))}function PS(t){const e=t.name==="click";let n,r=null;try{r=e?Qu(t.event):Zu(t.event),n=gt(r,{maxStringLength:200})||"<unknown>"}catch(s){n="<unknown>"}return{target:r,message:n}}function FS(t){return t.type===cs.Element}function BS(t,e){if(!t.isEnabled())return;t.updateUserActivity();const n=$S(e);!n||sr(t,n)}function $S(t){const{metaKey:e,shiftKey:n,ctrlKey:r,altKey:s,key:i,target:o}=t;if(!o||US(o)||!i)return null;const c=e||r||s,a=i.length===1;if(!c&&a)return null;const u=gt(o,{maxStringLength:200})||"<unknown>",l=el(o,u);return Xt({category:"ui.keyDown",message:u,data:R(h({},l.data),{metaKey:e,shiftKey:n,ctrlKey:r,altKey:s,key:i})})}function US(t){return t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable}const HS={resource:GS,paint:jS,navigation:qS};function Vi(t,e){return({metric:n})=>void e.replayPerformanceEntries.push(t(n))}function WS(t){return t.map(zS).filter(Boolean)}function zS(t){const e=HS[t.entryType];return e?e(t):null}function vn(t){return((_t()||st.performance.timeOrigin)+t)/1e3}function jS(t){const{duration:e,entryType:n,name:r,startTime:s}=t,i=vn(s);return{type:n,name:r,start:i,end:i+e,data:void 0}}function qS(t){const{entryType:e,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:m,type:g}=t;return s===0?null:{type:`${e}.${g}`,start:vn(p),end:vn(i),name:n,data:{size:m,decodedBodySize:r,encodedBodySize:o,duration:s,domInteractive:u,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,loadEventStart:l,loadEventEnd:d,domComplete:i,redirectCount:f}}}function GS(t){const{entryType:e,initiatorType:n,name:r,responseEnd:s,startTime:i,decodedBodySize:o,encodedBodySize:c,responseStatus:a,transferSize:u}=t;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${e}.${n}`,start:vn(i),end:vn(s),name:r,data:{size:u,statusCode:a,decodedBodySize:o,encodedBodySize:c}}}function VS(t){const e=t.entries[t.entries.length-1],n=e!=null&&e.element?[e.element]:void 0;return Yi(t,"largest-contentful-paint",n)}function YS(t){return t.sources!==void 0}function KS(t){const e=[],n=[];for(const r of t.entries)if(YS(r)){const s=[];for(const i of r.sources)if(i.node){n.push(i.node);const o=jt.mirror.getId(i.node);o&&s.push(o)}e.push({value:r.value,nodeIds:s.length?s:void 0})}return Yi(t,"cumulative-layout-shift",n,e)}function XS(t){const e=t.entries[t.entries.length-1],n=e!=null&&e.target?[e.target]:void 0;return Yi(t,"interaction-to-next-paint",n)}function Yi(t,e,n,r){const s=t.value,i=t.rating,o=vn(s);return{type:"web-vital",name:e,start:o,end:o,data:{value:s,size:s,rating:i,nodeIds:n?n.map(c=>jt.mirror.getId(c)):void 0,attributions:r}}}function JS(t){function e(s){t.performanceEntries.includes(s)||t.performanceEntries.push(s)}function n({entries:s}){s.forEach(e)}const r=[];return["navigation","paint","resource"].forEach(s=>{r.push(Be(s,n))}),r.push(Ur(Vi(VS,t)),$r(Vi(KS,t)),vi(Vi(XS,t))),()=>{r.forEach(s=>s())}}const N=typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__,QS='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 ZS(){const t=new Blob([QS],{type:"text/javascript"});return URL.createObjectURL(t)}const nl=["log","warn","error"],us="[Replay] ";function Ki(t,e="info"){Se({category:"console",data:{logger:"replay"},level:e,message:`${us}${t}`},{level:e})}function tE(){let t=!1,e=!1;const n={exception:()=>{},infoTick:()=>{},setConfig:r=>{t=!!r.captureExceptions,e=!!r.traceInternals}};return N?(nl.forEach(r=>{n[r]=(...s)=>{S[r](us,...s),e&&Ki(s.join(""),kc(r))}}),n.exception=(r,...s)=>{s.length&&n.error&&n.error(...s),S.error(us,r),t?ti(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):e&&Ki(r,"error")},n.infoTick=(...r)=>{S.log(us,...r),e&&setTimeout(()=>Ki(r[0]),0)}):nl.forEach(r=>{n[r]=()=>{}}),n}const O=tE();class Xi extends Error{constructor(){super(`Event buffer exceeded maximum size of ${Ni}.`)}}class rl extends Error{constructor(){super("Worker destroyed")}}class sl{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=[]}addEvent(e){return X(this,null,function*(){const n=JSON.stringify(e).length;if(this._totalSize+=n,this._totalSize>Ni)throw new Xi;this.events.push(e)})}finish(){return new Promise(e=>{const n=this.events;this.clear(),e(JSON.stringify(n))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let e=null;for(const{timestamp:n}of this.events)(e===null||n<e)&&(e=n);return e===null?e:qi(e)}}class eE{constructor(e){this._onMessage=({data:n})=>{const r=n;if(typeof r.id!="number")return;const s=this._pending.get(r.id);if(!(!s||s.method!==r.method)){if(this._pending.delete(r.id),!r.success){N&&O.error("Error in compression worker: ",r.response),s.reject(new Error("Error in compression worker"));return}s.resolve(r.response)}},this._worker=e,this._id=0,this._pending=new Map,this._worker.addEventListener("message",this._onMessage)}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((e,n)=>{this._worker.addEventListener("message",({data:r})=>{r.success?e():(N&&O.warn("Received worker message with unsuccessful status",r),n(new Error("Received worker message with unsuccessful status")))},{once:!0}),this._worker.addEventListener("error",r=>{N&&O.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(){N&&O.log("Destroying compression worker"),this._worker.removeEventListener("message",this._onMessage),this._pending.forEach(e=>e.reject(new rl)),this._pending.clear(),this._worker.terminate()}postMessage(e,n){const r=this._getAndIncrementId();return new Promise((s,i)=>{this._pending.set(r,{method:e,resolve:s,reject:i});try{this._worker.postMessage({id:r,method:e,arg:n})}catch(o){this._pending.delete(r),i(o)}})}_getAndIncrementId(){return this._id++}}class nE{constructor(e){this._worker=new eE(e),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(e){const n=qi(e.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);const r=JSON.stringify(e);return this._totalSize+=r.length,this._totalSize>Ni?Promise.reject(new Xi):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,e=>{N&&O.exception(e,'Sending "clear" message to worker failed',e)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage("addEvent",e)}_finishRequest(){return X(this,null,function*(){const e=yield this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,e})}}class rE{constructor(e){this._fallback=new sl,this._compression=new nE(e),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(e){this._used.hasCheckout=e}set waitForCheckout(e){this._used.waitForCheckout=e}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(e){return this._used.addEvent(e)}finish(){return X(this,null,function*(){return yield this.ensureWorkerIsLoaded(),this._used.finish()})}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}_ensureWorkerIsLoaded(){return X(this,null,function*(){try{yield this._compression.ensureReady()}catch(e){N&&O.exception(e,"Failed to load the compression worker, falling back to simple buffer");return}yield this._switchToCompressionWorker()})}_switchToCompressionWorker(){return X(this,null,function*(){const{events:e,hasCheckout:n,waitForCheckout:r}=this._fallback,s=[];for(const i of e)s.push(this._compression.addEvent(i));this._compression.hasCheckout=n,this._compression.waitForCheckout=r,this._used=this._compression;try{yield Promise.all(s),this._fallback.clear()}catch(i){if(i instanceof rl)return;N&&O.exception(i,"Failed to add events when switching buffers.")}})}}function sE({useCompression:t,workerUrl:e}){if(t&&window.Worker){const n=iE(e);if(n)return n}return N&&O.log("Using simple buffer"),new sl}function iE(t){try{const e=t||oE();if(!e)return;N&&O.log(`Using compression worker${t?` from ${t}`:""}`);const n=new Worker(e);return new rE(n)}catch(e){N&&O.exception(e,"Failed to create compression worker")}}function oE(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__=="undefined"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?ZS():""}function Ji(){try{return"sessionStorage"in st&&!!st.sessionStorage}catch(t){return!1}}function aE(t){cE(),t.session=void 0}function cE(){if(!!Ji())try{st.sessionStorage.removeItem(Mi)}catch(t){}}function il(t){return t===void 0?!1:Math.random()<t}function ls(t){if(!!Ji())try{st.sessionStorage.setItem(Mi,JSON.stringify(t))}catch(e){}}function ol(t){const e=Date.now(),n=t.id||xt(),r=t.started||e,s=t.lastActivity||e,i=t.segmentId||0,o=t.sampled,c=t.previousSessionId,a=t.dirty||!1;return{id:n,started:r,lastActivity:s,segmentId:i,sampled:o,previousSessionId:c,dirty:a}}function uE(t,e){return il(t)?"session":e?"buffer":!1}function al({sessionSampleRate:t,allowBuffering:e,stickySession:n=!1},{previousSessionId:r}={}){const s=uE(t,e),i=ol({sampled:s,previousSessionId:r});return n&&ls(i),i}function lE(){if(!Ji())return null;try{const t=st.sessionStorage.getItem(Mi);if(!t)return null;const e=JSON.parse(t);return N&&O.infoTick("Loading existing session"),ol(e)}catch(t){return null}}function Qi(t,e,n=+new Date){return t===null||e===void 0||e<0?!0:e===0?!1:t+e<=n}function dE(t,{maxReplayDuration:e,sessionIdleExpire:n,targetTime:r=Date.now()}){return Qi(t.started,e,r)||Qi(t.lastActivity,n,r)}function ds(t,{sessionIdleExpire:e,maxReplayDuration:n}){return!(!dE(t,{sessionIdleExpire:e,maxReplayDuration:n})||t.sampled==="buffer"&&t.segmentId===0)}function Zi({sessionIdleExpire:t,maxReplayDuration:e,previousSessionId:n},r){const s=r.stickySession&&lE();return s?ds(s,{sessionIdleExpire:t,maxReplayDuration:e})?(N&&O.infoTick("Session in sessionStorage is expired, creating new one..."),al(r,{previousSessionId:s.id})):s:(N&&O.infoTick("Creating new session"),al(r,{previousSessionId:n}))}function fE(t){return t.type===H.Custom}function to(t,e,n){return ul(t,e)?(cl(t,e,n),!0):!1}function pE(t,e,n){return ul(t,e)?cl(t,e,n):Promise.resolve(null)}function cl(t,e,n){return X(this,null,function*(){const{eventBuffer:r}=t;if(!r||r.waitForCheckout&&!n)return null;const s=t.recordingMode==="buffer";try{n&&s&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);const i=t.getOptions(),o=hE(e,i.beforeAddRecordingEvent);return o?yield r.addEvent(o):void 0}catch(i){if(!t.isEnabled())return t.handleException(i),null;const o=i&&i instanceof Xi,c=o?"eventBufferOverflow":"eventBufferError",a=U();if(a){const u=o?"buffer_overflow":"internal_sdk_error";a.recordDroppedEvent(u,"replay")}if(o&&s)return r.clear(),r.waitForCheckout=!0,null;t.handleException(i),yield t.stop({reason:c})}})}function ul(t,e){if(!t.eventBuffer||t.isPaused()||!t.isEnabled())return!1;const n=qi(e.timestamp);return n+t.timeouts.sessionIdlePause<Date.now()?!1:n>t.getContext().initialTimestamp+t.getOptions().maxReplayDuration?(N&&O.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function hE(t,e){try{if(typeof e=="function"&&fE(t))return e(t)}catch(n){return N&&O.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return t}const ll=100;function dl(t,e,n){const r=t.getContext();e&&r.traceIds.size<ll&&r.traceIds.add(e),n&&r.segmentNames.size<ll&&r.segmentNames.add(n)}function mE(t){return e=>{!t.isEnabled()||dl(t,e.trace_id,e.name||void 0)}}function eo(t){return!t.type}function no(t){return t.type==="transaction"}function gE(t){return t.type==="replay_event"}function fl(t){return t.type==="feedback"}function _E(t){return(e,n)=>{if(!t.isEnabled()||!eo(e)&&!no(e))return;const r=n.statusCode;if(!(!r||r<200||r>=300)){if(no(e)){yE(t,e);return}SE(t,e)}}}function yE(t,e){var n,r;dl(t,(r=(n=e.contexts)==null?void 0:n.trace)==null?void 0:r.trace_id,e.transaction)}function SE(t,e){var s;const n=t.getContext();if(e.event_id&&n.errorIds.size<100&&n.errorIds.add(e.event_id),t.recordingMode!=="buffer"||!((s=e.tags)!=null&&s.replayId))return;const{beforeErrorSampling:r}=t.getOptions();typeof r=="function"&&!r(e)||Kn(()=>X(this,null,function*(){try{yield t.sendBufferedReplayOrFlush()}catch(i){t.handleException(i)}}))}function EE(t){return e=>{!t.isEnabled()||!eo(e)||bE(t,e)}}function bE(t,e){var r,s,i;const n=(i=(s=(r=e.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=Xt({category:"replay.hydrate-error",data:{url:Fe()}});sr(t,o)}}function vE(t){const e=U();!e||e.on("beforeAddBreadcrumb",n=>IE(t,n))}function IE(t,e){if(!t.isEnabled()||!pl(e))return;const n=TE(e);n&&sr(t,n)}function TE(t){return!pl(t)||["fetch","xhr","sentry.event","sentry.transaction"].includes(t.category)||t.category.startsWith("ui.")?null:t.category==="console"?wE(t):Xt(t)}function wE(t){var s;const e=(s=t.data)==null?void 0:s.arguments;if(!Array.isArray(e)||e.length===0)return Xt(t);let n=!1;const r=e.map(i=>{if(!i)return i;if(typeof i=="string")return i.length>Kr?(n=!0,`${i.slice(0,Kr)}\u2026`):i;if(typeof i=="object")try{const o=$t(i,7);return JSON.stringify(o).length>Kr?(n=!0,`${JSON.stringify(o,null,2).slice(0,Kr)}\u2026`):o}catch(o){}return i});return Xt(R(h({},t),{data:h(R(h({},t.data),{arguments:r}),n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{})}))}function pl(t){return!!t.category}function kE(t,e){var n,r,s;return t.type||!((r=(n=t.exception)==null?void 0:n.values)!=null&&r.length)?!1:!!((s=e.originalException)!=null&&s.__rrweb__)}function fs(){const t=V().getPropagationContext().dsc;t&&delete t.replay_id;const e=bt();if(e){const n=me(e);delete n.replay_id}}function hl(t){const e=V().getPropagationContext().dsc;e&&(e.replay_id=t);const n=bt();if(n){const r=me(n);r.replay_id=t}}function RE(t,e){t.triggerUserActivity(),t.addUpdate(()=>e.timestamp?(t.throttledAddEvent({type:H.Custom,timestamp:e.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:e.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:e.event_id}}}}),!1):!0)}function CE(t,e){return t.recordingMode!=="buffer"||e.message===xi||!e.exception||e.type?!1:il(t.getOptions().errorSampleRate)}function AE(t){return Object.assign((e,n)=>{var o;if(t.session&&ds(t.session,{maxReplayDuration:t.getOptions().maxReplayDuration,sessionIdleExpire:t.timeouts.sessionIdleExpire})&&fs(),!t.isEnabled()||t.isPaused())return e;if(gE(e))return delete e.breadcrumbs,e;if(!eo(e)&&!no(e)&&!fl(e))return e;if(!t.checkAndHandleExpiredSession())return fs(),e;if(fl(e))return t.flush(),e.contexts.feedback.replay_id=t.getSessionId(),RE(t,e),e;if(kE(e,n)&&!t.getOptions()._experiments.captureExceptions)return N&&O.log("Ignoring error from rrweb internals",e),null;const s=CE(t,e);if((s||t.recordingMode==="session")&&(e.tags=R(h({},e.tags),{replayId:t.getSessionId()})),s&&t.recordingMode==="buffer"&&((o=t.session)==null?void 0:o.sampled)==="buffer"){const c=t.session;c.dirty=!0,t.getOptions().stickySession&&ls(c)}return e},{id:"Replay"})}function ps(t,e){return e.map(({type:n,start:r,end:s,name:i,data:o})=>{const c=t.throttledAddEvent({type:H.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 ME(t){const{from:e,to:n}=t,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:e}}}function xE(t){return e=>{if(!t.isEnabled())return;const n=ME(e);n!==null&&(t.getContext().urls.push(n.name),t.triggerUserActivity(),t.addUpdate(()=>(ps(t,[n]),!1)))}}function NE(t,e){return N&&t.getOptions()._experiments.traceInternals?!1:uh(e,U())}function ml(t,e){!t.isEnabled()||e!==null&&(NE(t,e.name)||t.addUpdate(()=>(ps(t,[e]),!0)))}function hs(t){if(!t)return;const e=new TextEncoder;try{if(typeof t=="string")return e.encode(t).length;if(t instanceof URLSearchParams)return e.encode(t.toString()).length;if(t instanceof FormData){const n=ru(t);return e.encode(n).length}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength}catch(n){}}function gl(t){if(!t)return;const e=parseInt(t,10);return isNaN(e)?void 0:e}function ms(t,e){if(!t)return{headers:{},size:void 0,_meta:{warnings:[e]}};const n=h({},t._meta),r=n.warnings||[];return n.warnings=[...r,e],t._meta=n,t}function _l(t,e){if(!e)return null;const{startTimestamp:n,endTimestamp:r,url:s,method:i,statusCode:o,request:c,response:a}=e;return{type:t,start:n/1e3,end:r/1e3,name:s,data:{method:i,statusCode:o,request:c,response:a}}}function ir(t){return{headers:{},size:t,_meta:{warnings:["URL_SKIPPED"]}}}function we(t,e,n){if(!e&&Object.keys(t).length===0)return;if(!e)return{headers:t};if(!n)return{headers:t,size:e};const r={headers:t,size:e},{body:s,warnings:i}=OE(n);return r.body=s,i!=null&&i.length&&(r._meta={warnings:i}),r}function ro(t,e){return Object.entries(t).reduce((n,[r,s])=>{const i=r.toLowerCase();return e.includes(i)&&t[r]&&(n[i]=s),n},{})}function OE(t){if(!t||typeof t!="string")return{body:t};const e=t.length>fu,n=LE(t);if(e){const r=t.slice(0,fu);return n?{body:r,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${r}\u2026`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(t)}}catch(r){}return{body:t}}function LE(t){const e=t[0],n=t[t.length-1];return e==="["&&n==="]"||e==="{"&&n==="}"}function gs(t,e){const n=DE(t);return Vt(n,e)}function DE(t,e=st.document.baseURI){if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith(st.location.origin))return t;const n=new URL(t,e);if(n.origin!==new URL(e).origin)return t;const r=n.href;return!t.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}function PE(t,e,n){return X(this,null,function*(){try{const r=yield BE(t,e,n),s=_l("resource.fetch",r);ml(n.replay,s)}catch(r){N&&O.exception(r,"Failed to capture fetch breadcrumb")}})}function FE(t,e){const{input:n,response:r}=e,s=n?iu(n):void 0,i=hs(s),o=r?gl(r.headers.get("content-length")):void 0;i!==void 0&&(t.data.request_body_size=i),o!==void 0&&(t.data.response_body_size=o)}function BE(t,e,n){return X(this,null,function*(){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r}=e,{url:o,method:c,status_code:a=0,request_body_size:u,response_body_size:l}=t.data,d=gs(o,n.networkDetailAllowUrls)&&!gs(o,n.networkDetailDenyUrls),f=d?$E(n,e.input,u):ir(u),p=yield UE(d,n,e.response,l);return{startTimestamp:s,endTimestamp:i,url:o,method:c,statusCode:a,request:f,response:p}})}function $E({networkCaptureBodies:t,networkRequestHeaders:e},n,r){const s=n?zE(n,e):{};if(!t)return we(s,r,void 0);const i=iu(n),[o,c]=su(i,O),a=we(s,r,o);return c?ms(a,c):a}function UE(i,o,c,a){return X(this,arguments,function*(t,{networkCaptureBodies:e,networkResponseHeaders:n},r,s){if(!t&&s!==void 0)return ir(s);const u=r?yl(r.headers,n):{};if(!r||!e&&s!==void 0)return we(u,s,void 0);const[l,d]=yield WE(r),f=HE(l,{networkCaptureBodies:e,responseBodySize:s,captureDetails:t,headers:u});return d?ms(f,d):f})}function HE(t,{networkCaptureBodies:e,responseBodySize:n,captureDetails:r,headers:s}){try{const i=(t==null?void 0:t.length)&&n===void 0?hs(t):n;return r?e?we(s,i,t):we(s,i,void 0):ir(i)}catch(i){return N&&O.exception(i,"Failed to serialize response body"),we(s,n,void 0)}}function WE(t){return X(this,null,function*(){const e=jE(t);if(!e)return[void 0,"BODY_PARSE_ERROR"];try{return[yield qE(e)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(N&&O.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(N&&O.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}})}function yl(t,e){const n={};return e.forEach(r=>{t.get(r)&&(n[r]=t.get(r))}),n}function zE(t,e){return t.length===1&&typeof t[0]!="string"?Sl(t[0],e):t.length===2?Sl(t[1],e):{}}function Sl(t,e){if(!t)return{};const n=t.headers;return n?n instanceof Headers?yl(n,e):Array.isArray(n)?{}:ro(n,e):{}}function jE(t){try{return t.clone()}catch(e){N&&O.exception(e,"Failed to clone response body")}}function qE(t){return new Promise((e,n)=>{const r=Kn(()=>n(new Error("Timeout while trying to read response body")),500);GE(t).then(s=>e(s),s=>n(s)).finally(()=>clearTimeout(r))})}function GE(t){return X(this,null,function*(){return yield t.text()})}function VE(t,e,n){return X(this,null,function*(){try{const r=KE(t,e,n),s=_l("resource.xhr",r);ml(n.replay,s)}catch(r){N&&O.exception(r,"Failed to capture xhr breadcrumb")}})}function YE(t,e){const{xhr:n,input:r}=e;if(!n)return;const s=hs(r),i=n.getResponseHeader("content-length")?gl(n.getResponseHeader("content-length")):QE(n.response,n.responseType);s!==void 0&&(t.data.request_body_size=s),i!==void 0&&(t.data.response_body_size=i)}function KE(t,e,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r,input:o,xhr:c}=e,{url:a,method:u,status_code:l=0,request_body_size:d,response_body_size:f}=t.data;if(!a)return null;if(!c||!gs(a,n.networkDetailAllowUrls)||gs(a,n.networkDetailDenyUrls)){const v=ir(d),E=ir(f);return{startTimestamp:s,endTimestamp:i,url:a,method:u,statusCode:l,request:v,response:E}}const p=c[Ue],m=p?ro(p.request_headers,n.networkRequestHeaders):{},g=ro(ou(c),n.networkResponseHeaders),[y,_]=n.networkCaptureBodies?su(o,O):[void 0],[T,F]=n.networkCaptureBodies?XE(c):[void 0],w=we(m,d,y),M=we(g,f,T);return{startTimestamp:s,endTimestamp:i,url:a,method:u,statusCode:l,request:_?ms(w,_):w,response:F?ms(M,F):M}}function XE(t){const e=[];try{return[t.responseText]}catch(n){e.push(n)}try{return JE(t.response,t.responseType)}catch(n){e.push(n)}return N&&O.warn("Failed to get xhr response body",...e),[void 0]}function JE(t,e){try{if(typeof t=="string")return[t];if(t instanceof Document)return[t.body.outerHTML];if(e==="json"&&Ae(t))return[JSON.stringify(t)];if(!t)return[void 0]}catch(n){return N&&O.exception(n,"Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return N&&O.log("Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}function QE(t,e){try{const n=e==="json"&&Ae(t)?JSON.stringify(t):t;return hs(n)}catch(n){return}}function ZE(t){const e=U();try{const{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:i,networkResponseHeaders:o}=t.getOptions(),c={replay:t,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:i,networkResponseHeaders:o};e&&e.on("beforeAddBreadcrumb",(a,u)=>tb(c,a,u))}catch(n){}}function tb(t,e,n){if(!!e.data)try{eb(e)&&rb(n)&&(YE(e,n),VE(e,n,t)),nb(e)&&sb(n)&&(FE(e,n),PE(e,n,t))}catch(r){N&&O.exception(r,"Error when enriching network breadcrumb")}}function eb(t){return t.category==="xhr"}function nb(t){return t.category==="fetch"}function rb(t){return t==null?void 0:t.xhr}function sb(t){return(t==null?void 0:t.input)!==void 0}function ib(t){const e=U();Zc(LS(t)),Gr(xE(t)),vE(t),ZE(t);const n=AE(t);Ep(n),e&&(e.on("beforeSendEvent",EE(t)),e.on("afterSendEvent",_E(t)),e.on("createDsc",r=>{const s=t.getSessionId();s&&t.isEnabled()&&t.recordingMode==="session"&&t.checkAndHandleExpiredSession()&&(r.replay_id=s)}),e.on("processSegmentSpan",mE(t)),e.on("spanStart",r=>{t.lastActiveSpan=r}),e.on("spanEnd",r=>{t.lastActiveSpan=r}),e.on("beforeSendFeedback",(r,s)=>X(this,null,function*(){var o;const i=t.getSessionId();(s==null?void 0:s.includeReplay)&&t.isEnabled()&&i&&((o=r.contexts)==null?void 0:o.feedback)&&(r.contexts.feedback.source==="api"&&(yield t.sendBufferedReplayOrFlush()),r.contexts.feedback.replay_id=i)})),e.on("openFeedbackWidget",()=>X(this,null,function*(){yield t.sendBufferedReplayOrFlush()})))}function ob(t){return X(this,null,function*(){try{return Promise.all(ps(t,[ab(st.performance.memory)]))}catch(e){return[]}})}function ab(t){const{jsHeapSizeLimit:e,totalJSHeapSize:n,usedJSHeapSize:r}=t,s=Date.now()/1e3;return{type:"memory",name:"memory",start:s,end:s,data:{memory:{jsHeapSizeLimit:e,totalJSHeapSize:n,usedJSHeapSize:r}}}}function cb(t,e,n){return Qf(t,e,R(h({},n),{setTimeoutImpl:Kn}))}const Bt=$.navigator;function ub(){var t,e;return/iPhone|iPad|iPod/i.test((t=Bt==null?void 0:Bt.userAgent)!=null?t:"")||/Macintosh/i.test((e=Bt==null?void 0:Bt.userAgent)!=null?e:"")&&(Bt==null?void 0:Bt.maxTouchPoints)&&(Bt==null?void 0:Bt.maxTouchPoints)>1?{sampling:{mousemove:!1}}:{}}function lb(t){let e=!1;return(n,r)=>{try{if(!t.checkAndHandleExpiredSession()){N&&O.warn("Received replay event after session expired.");return}const s=r||!e;e=!0,db(n),t.clickDetector&&AS(t.clickDetector,n),t.addUpdate(()=>{if(t.recordingMode==="buffer"&&s&&t.setInitialState(),!to(t,n,s))return!0;if(!s)return!1;const i=t.session;if(pb(t,s),t.recordingMode==="buffer"&&i&&t.eventBuffer&&!i.dirty){const o=t.eventBuffer.getEarliestTimestamp();o&&(N&&O.log(`Updating session start time to earliest event in buffer to ${new Date(o)}`),i.started=o,t.getOptions().stickySession&&ls(i))}return i!=null&&i.previousSessionId||t.recordingMode==="session"&&t.flush(),!0})}catch(s){t.handleException(s)}}}function db(t){const e=t.data;if(!(t.type!==H.IncrementalSnapshot||!e||typeof e!="object"||!("source"in e)||e.source!==P.Mutation||!("attributes"in e)||!Array.isArray(e.attributes)))for(const n of e.attributes){const r=jt.mirror.getNode(n.id),s=r&&jt.mirror.getMeta(r);if((s==null?void 0:s.type)===cs.Element)for(const[i,o]of Object.entries(n.attributes))o===null?delete s.attributes[i]:s.attributes[i]=o}}function fb(t){const e=t.getOptions();return{type:H.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:t.isRecordingCanvas(),sessionSampleRate:e.sessionSampleRate,errorSampleRate:e.errorSampleRate,useCompressionOption:e.useCompression,blockAllMedia:e.blockAllMedia,maskAllText:e.maskAllText,maskAllInputs:e.maskAllInputs,useCompression:t.eventBuffer?t.eventBuffer.type==="worker":!1,networkDetailHasUrls:e.networkDetailAllowUrls.length>0,networkCaptureBodies:e.networkCaptureBodies,networkRequestHasHeaders:e.networkRequestHeaders.length>0,networkResponseHasHeaders:e.networkResponseHeaders.length>0}}}}function pb(t,e){var n;!e||((n=t.session)==null?void 0:n.segmentId)!==0||to(t,fb(t),!1)}function hb(t){if(!t)return null;try{return t.nodeType===t.ELEMENT_NODE?t:t.parentElement}catch(e){return null}}function mb(t,e,n,r){return ge(va(t,Ks(t),r,n),[[{type:"replay_event"},t],[{type:"replay_recording",length:typeof e=="string"?new TextEncoder().encode(e).length:e.length},e]])}function gb({recordingData:t,headers:e}){let n;const r=`${JSON.stringify(e)}
`;if(typeof t=="string")n=`${r}${t}`;else{const i=new TextEncoder().encode(r);n=new Uint8Array(i.length+t.length),n.set(i),n.set(t,i.length)}return n}function _b(s){return X(this,arguments,function*({client:t,scope:e,replayId:n,event:r}){const i=typeof t._integrations=="object"&&t._integrations!==null&&!Array.isArray(t._integrations)?Object.keys(t._integrations):void 0,o={event_id:n,integrations:i};t.emit("preprocessEvent",r,o);const c=yield za(t.getOptions(),r,o,e,t,vt());if(!c)return null;t.emit("postprocessEvent",c,o),c.platform=c.platform||"javascript";const a=t.getSdkMetadata(),{name:u,version:l,settings:d}=(a==null?void 0:a.sdk)||{};return c.sdk=R(h({},c.sdk),{name:u||"sentry.javascript.unknown",version:l||"0.0.0",settings:d}),c})}function yb(o){return X(this,arguments,function*({recordingData:t,replayId:e,segmentId:n,eventContext:r,timestamp:s,session:i}){const c=gb({recordingData:t,headers:{segment_id:n}}),{urls:a,errorIds:u,traceIds:l,segmentNames:d,initialTimestamp:f}=r,p=U(),m=V(),g=p==null?void 0:p.getTransport(),y=p==null?void 0:p.getDsn();if(!p||!g||!y||!i.sampled)return Promise.resolve({});const _={type:j_,replay_start_timestamp:f/1e3,timestamp:s/1e3,error_ids:u,trace_ids:l,segment_names:d,urls:a,replay_id:e,segment_id:n,replay_type:i.sampled},T=yield _b({scope:m,client:p,replayId:e,event:_});if(!T)return p.recordDroppedEvent("event_processor","replay"),N&&O.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete T.sdkProcessingMetadata;const F=mb(T,c,y,p.getOptions().tunnel);let w;try{w=yield g.send(F)}catch(v){const E=new Error(xi);try{E.cause=v}catch(B){}throw E}const M=ec({},w);if(tc(M,"replay"))throw new so(M);if(typeof w.statusCode=="number"&&(w.statusCode<200||w.statusCode>=300))throw new El(w.statusCode);return w})}class El extends Error{constructor(e){super(`Transport returned status code ${e}`)}}class so extends Error{constructor(e){super("Rate limit hit"),this.rateLimits=e}}class bl extends Error{constructor(){super("Session is too long, not sending replay")}}function vl(n){return X(this,arguments,function*(t,e={count:0,interval:X_}){const{recordingData:r,onError:s}=t;if(!!r.length)try{return yield yb(t),!0}catch(i){if(i instanceof El||i instanceof so)throw i;if(yp("Replays",{_retryCount:e.count}),s&&s(i),e.count>=J_){const o=new Error(`${xi} - max retries exceeded`);try{o.cause=i}catch(c){}throw o}return e.interval*=++e.count,new Promise((o,c)=>{Kn(()=>X(this,null,function*(){try{yield vl(t,e),o(!0)}catch(a){c(a)}}),e.interval)})}})}const Il="__THROTTLED",Sb="__SKIPPED";function Eb(t,e,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()>=e){const l=o;return o=!0,l?Sb:Il}o=!1;const u=r.get(a)||0;return r.set(a,u+1),t(...c)}}class bb{constructor({options:e,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:q_,sessionIdleExpire:G_},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,segmentNames:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=n,this._options=e,this._debouncedFlush=cb(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=Eb((o,c)=>pE(this,o,c),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:s}=this.getOptions(),i=r?{threshold:Math.min(Q_,r),timeout:r,scrollTimeout:Z_,ignoreSelector:s?s.join(","):""}:void 0;if(i&&(this.clickDetector=new wS(this,i)),N){const o=e._experiments;O.setConfig({captureExceptions:!!o.captureExceptions,traceInternals:!!o.traceInternals})}this._handleVisibilityChange=()=>{st.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{const o=Xt({category:"ui.blur"});this._doChangeToBackgroundTasks(o)},this._handleWindowFocus=()=>{const o=Xt({category:"ui.focus"});this._doChangeToForegroundTasks(o)},this._handleKeyboardEvent=o=>{BS(this,o)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return Boolean(this._canvas)}getOptions(){return this._options}handleException(e){N&&O.exception(e),this._options.onError&&this._options.onError(e)}initializeSampling(e){const{errorSampleRate:n,sessionSampleRate:r}=this._options,s=n<=0&&r<=0;if(this._requiresManualStart=s,!s){if(this._initializeSessionForSampling(e),!this.session){N&&O.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",N&&O.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){N&&O.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){N&&O.log("Buffering is in progress, call `flush()` to save the replay");return}N&&O.infoTick("Starting replay in session mode"),this._updateUserActivity();const e=Zi({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=e,this.recordingMode="session",this._initializeRecording()}startBuffering(){if(this._isEnabled){N&&O.log("Buffering is in progress, call `flush()` to save the replay");return}N&&O.infoTick("Starting replay in buffer mode");const e=Zi({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=e,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const e=this._canvas;this._stopRecording=jt(h(R(h(R(h(h({},this._recordingOptions),this.recordingMode==="buffer"?{checkoutEveryNms:K_}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)}),{emit:lb(this)}),ub()),{onMutation:this._onMutationHandler.bind(this)}),e?{recordCanvas:e.recordCanvas,getCanvasManager:e.getCanvasManager,sampling:e.sampling,dataURLOptions:e.dataURLOptions}:{}))}catch(e){this.handleException(e)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(e){return this.handleException(e),!1}}stop(){return X(this,arguments,function*({forceFlush:e=!1,reason:n}={}){var s,i,o;if(!this._isEnabled)return;this._isEnabled=!1,this.recordingMode="buffer";const r=n!=null?n:"manual";(i=U())==null||i.emit("replayEnd",{sessionId:(s=this.session)==null?void 0:s.id,reason:r});try{N&&O.log(`Stopping Replay triggered by ${r}`),fs(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&(yield this._flush({force:!0})),(o=this.eventBuffer)==null||o.destroy(),this.eventBuffer=null,aE(this)}catch(c){this.handleException(c)}})}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),N&&O.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),N&&O.log("Resuming replay"))}sendBufferedReplayOrFlush(){return X(this,arguments,function*({continueRecording:e=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();N&&O.log("Converting buffer to session"),yield this.flushImmediate();const r=this.stopRecording();!e||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this.session.dirty=!1,this._updateUserActivity(n),this._updateSessionActivity(n),this._maybeSaveSession(),hl(this.session.id)),this.startRecording())})}addUpdate(e){const n=e();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(e){var n,r;if(!(e&&((n=this.session)==null?void 0:n.sampled)===!1))return(r=this.session)==null?void 0:r.id}checkAndHandleExpiredSession(){var e;if(this._lastActivity&&Qi(this._lastActivity,this.timeouts.sessionIdlePause)&&((e=this.session)==null?void 0:e.sampled)==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const e=`${st.location.pathname}${st.location.hash}${st.location.search}`,n=`${st.location.origin}${e}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=n,this._context.initialTimestamp=Date.now(),this._context.urls.push(n)}throttledAddEvent(e,n){const r=this._throttledAddEvent(e,n);if(r===Il){const s=Xt({category:"replay.throttled"});this.addUpdate(()=>!to(this,{type:yS,timestamp:s.timestamp||0,data:{tag:"breadcrumb",payload:s,metric:!0}}))}return r}getCurrentRoute(){const e=this.lastActiveSpan||bt(),n=e&&St(e),s=(n&&j(n).data||{})[Ut];if(!(!n||!s||!["route","custom"].includes(s)))return j(n).description}_initializeRecording(){var e;this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=sE({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.session&&((e=U())==null||e.emit("replayStart",{sessionId:this.session.id,recordingMode:this.recordingMode})),this.startRecording(),this.recordingMode==="session"&&this.session&&hl(this.session.id)}_initializeSessionForSampling(e){const n=this._options.errorSampleRate>0,r=Zi({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:n});this.session=r}_checkSession(){if(!this.session)return!1;const e=this.session;return ds(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(e),!1):!0}_refreshSession(e){return X(this,null,function*(){!this._isEnabled||(yield this.stop({reason:"sessionExpired"}),this.initializeSampling(e.id))})}_addListeners(){try{st.document.addEventListener("visibilitychange",this._handleVisibilityChange),st.addEventListener("blur",this._handleWindowBlur),st.addEventListener("focus",this._handleWindowFocus),st.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(ib(this),this._hasInitializedCoreListeners=!0)}catch(e){this.handleException(e)}this._performanceCleanupCallback=JS(this)}_removeListeners(){try{st.document.removeEventListener("visibilitychange",this._handleVisibilityChange),st.removeEventListener("blur",this._handleWindowBlur),st.removeEventListener("focus",this._handleWindowFocus),st.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(e){this.handleException(e)}}_doChangeToBackgroundTasks(e){if(!this.session)return;if(ds(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})){fs();return}e&&this._createCustomBreadcrumb(e),this.conditionalFlush()}_doChangeToForegroundTasks(e){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){N&&O.log("Document has become active, but session has expired");return}e&&this._createCustomBreadcrumb(e)}_updateUserActivity(e=Date.now()){this._lastActivity=e}_updateSessionActivity(e=Date.now()){this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate(()=>{this.throttledAddEvent({type:H.Custom,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e}})})}_addPerformanceEntries(){let e=WS(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){const n=this._context.initialTimestamp/1e3;e=e.filter(r=>r.start>=n)}return Promise.all(ps(this,e))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.segmentNames.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:e,eventBuffer:n}=this;if(!e||!n||this._requiresManualStart||e.segmentId)return;const r=n.getEarliestTimestamp();r&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){const e={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),segmentNames:Array.from(this._context.segmentNames),urls:this._context.urls};return this._clearContext(),e}_runFlush(){return X(this,null,function*(){var n;const e=this.getSessionId();if(!this.session||!this.eventBuffer||!e){N&&O.error("No session or eventBuffer found to flush.");return}if(yield this._addPerformanceEntries(),!!((n=this.eventBuffer)!=null&&n.hasEvents)&&(yield ob(this),!!this.eventBuffer&&e===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const r=Date.now();if(r-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new bl;const s=this._popEventContext(),i=this.session.segmentId++;this._maybeSaveSession();const o=yield this.eventBuffer.finish();yield vl({replayId:e,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=U();if(s){let i;r instanceof so?i="ratelimit_backoff":r instanceof bl?i="invalid":i="send_error",s.recordDroppedEvent(i,"replay")}}})}_flush(){return X(this,arguments,function*({force:e=!1}={}){if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession()){N&&O.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){N&&O.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&&N&&O.log("Flushing initial segment without checkout.");const a=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{yield this._flushLock}catch(u){this.handleException(u)}finally{this._flushLock=void 0,a&&this._debouncedFlush()}})}_maybeSaveSession(){this.session&&this._options.stickySession&&ls(this.session)}_onMutationHandler(e){const{ignoreMutations:n}=this._options._experiments;if(n!=null&&n.length&&e.some(c=>{const a=hb(c.target),u=n.join(",");return a==null?void 0:a.matches(u)}))return!1;const r=e.length,s=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,o=s&&r>s;if(r>i||o){const c=Xt({category:"replay.mutations",data:{count:r,limit:o}});this._createCustomBreadcrumb(c)}return o?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}function or(t,e){return[...t,...e].join(",")}function vb({mask:t,unmask:e,block:n,unblock:r,ignore:s}){const i=["base","iframe[srcdoc]:not([src])"],o=or(t,[".sentry-mask","[data-sentry-mask]"]),c=or(e,[]);return{maskTextSelector:o,unmaskTextSelector:c,blockSelector:or(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:or(r,[]),ignoreSelector:or(s,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function Ib({el:t,key:e,maskAttributes:n,maskAllText:r,privacyOptions:s,value:i}){if(s.unmaskTextSelector&&t.matches(s.unmaskTextSelector))return i;const o=n.includes(e),c=r&&e==="value"&&t.tagName==="INPUT"&&["submit","button"].includes(t.getAttribute("type")||"");return o||c?i.replace(/[\S]/g,"*"):i}const Tl='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',Tb=["content-length","content-type","accept"],wb=Symbol.for("sentry__originalRequestBody");let wl=!1,kl=!1;function kb(){if(typeof Request=="undefined"||kl)return;const t=Request;try{const e=function(n,r){const s=new t(n,r);return(r==null?void 0:r.body)!=null&&(s[wb]=r.body),s};e.prototype=t.prototype,$.Request=e,kl=!0}catch(e){}}const Rb=t=>new Cb(t);class Cb{constructor({flushMinDelay:e=V_,flushMaxDelay:n=Y_,minReplayDuration:r=ty,maxReplayDuration:s=pu,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:m=7e3,slowClickIgnoreSelectors:g=[],networkDetailAllowUrls:y=[],networkDetailDenyUrls:_=[],networkCaptureBodies:T=!0,networkRequestHeaders:F=[],networkResponseHeaders:w=[],mask:M=[],maskAttributes:v=["title","placeholder","aria-label"],unmask:E=[],block:B=[],unblock:C=[],ignore:b=[],maskFn:D,beforeAddRecordingEvent:Y,beforeErrorSampling:Z,onError:et,attachRawBodyFromRequest:ot=!1}={}){this.name="Replay";const z=vb({mask:M,unmask:E,block:B,unblock:C,ignore:b});if(this._recordingOptions=R(h({maskAllInputs:l,maskAllText:u,maskInputOptions:{password:!0},maskTextFn:D,maskInputFn:D,maskAttributeFn:(x,k,at)=>Ib({maskAttributes:v,maskAllText:u,privacyOptions:z,key:x,value:k,el:at})},z),{slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:x=>{try{x.__rrweb__=!0}catch(k){}},recordCrossOriginIframes:Boolean(a.recordCrossOriginIframes)}),this._initialOptions={flushMinDelay:e,flushMaxDelay:n,minReplayDuration:Math.min(r,ey),maxReplayDuration:Math.min(s,pu),stickySession:i,useCompression:o,workerUrl:c,blockAllMedia:d,maskAllInputs:l,maskAllText:u,mutationBreadcrumbLimit:f,mutationLimit:p,slowClickTimeout:m,slowClickIgnoreSelectors:g,networkDetailAllowUrls:y,networkDetailDenyUrls:_,networkCaptureBodies:T,networkRequestHeaders:Rl(F),networkResponseHeaders:Rl(w),beforeAddRecordingEvent:Y,beforeErrorSampling:Z,onError:et,attachRawBodyFromRequest:ot,_experiments:a},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${Tl}`:Tl,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&sn())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return wl}set _isInitialized(e){wl=e}afterAllSetup(e){!sn()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&kb(),this._setup(e),this._initialize(e))}start(){!this._replay||this._replay.start()}startBuffering(){!this._replay||this._replay.startBuffering()}stop(e){var n;return this._replay?this._replay.stop({forceFlush:(n=e==null?void 0:e.flush)!=null?n:this._replay.recordingMode==="session",reason:"manual"}):Promise.resolve()}flush(e){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(e):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(e){var n;if(!!((n=this._replay)!=null&&n.isEnabled()))return this._replay.getSessionId(e)}getRecordingMode(){var e;if(!!((e=this._replay)!=null&&e.isEnabled()))return this._replay.recordingMode}processSpan(e){const n=this.getReplayId(!0);n&&(wr(e,{"sentry.replay_id":n}),this.getRecordingMode()==="buffer"&&wr(e,{"sentry._internal.replay_is_buffering":!0}))}_initialize(e){!this._replay||(this._maybeLoadFromReplayCanvasIntegration(e),this._replay.initializeSampling())}_setup(e){const n=Ab(this._initialOptions,e);this._replay=new bb({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(e){try{const n=e.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch(n){}}}function Ab(t,e){const n=e.getOptions(),r=h({sessionSampleRate:0,errorSampleRate:0},t),s=Oe(n.replaysSessionSampleRate),i=Oe(n.replaysOnErrorSampleRate);return s==null&&i==null&&ue(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),s!=null&&(r.sessionSampleRate=s),i!=null&&(r.errorSampleRate=i),r}function Rl(t){return[...Tb,...t.map(e=>e.toLowerCase())]}function Mb(t){return t.split(",").some(e=>e.trim().startsWith("sentry-"))}function Cl(t){try{return new URL(t,W.location.origin).href}catch(e){return}}function xb(t){return t.entryType==="resource"&&"initiatorType"in t&&typeof t.nextHopProtocol=="string"&&(t.initiatorType==="fetch"||t.initiatorType==="xmlhttprequest")}function Al(t){try{return new Headers(t)}catch(e){return}}const Ml={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function Nb(t,e){const{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:s,enableHTTPTimings:i,tracePropagationTargets:o,onRequestSpanStart:c,onRequestSpanEnd:a}=h(h({},Ml),e),u=typeof s=="function"?s:p=>!0,l=p=>Lb(p,o),d={},f=t.getOptions().propagateTraceparent;n&&ci(p=>{const m=Wh(p,u,l,d,{propagateTraceparent:f,onRequestSpanEnd:a});if(m){const g=Cl(p.fetchData.url),y=g?Pe(g).host:void 0,_=g?Ht(g):void 0;m.setAttributes({[Da]:_,[rn]:_,"server.address":y}),i&&xl(m,t),c==null||c(m,{headers:p.headers})}}),r&&nu(p=>{var g;const m=Db(p,u,l,d,f,a);m&&(i&&xl(m,t),c==null||c(m,{headers:Al((g=p.xhr.__sentry_xhr_v3__)==null?void 0:g.request_headers)}))})}const Ob=300;function xl(t,e){const{url:n}=j(t).data;if(!n||typeof n!="string")return;let r=()=>void setTimeout(s);if(Kt(e)){const i=t.end.bind(t);t.end=o=>{const c=o!=null?o:mt();let a=!1;const u=()=>{a||(a=!0,setTimeout(s),i(c),clearTimeout(l))};r=u;const l=setTimeout(u,Ob)}}const s=Be("resource",({entries:i})=>{i.forEach(o=>{xb(o)&&o.name.endsWith(n)&&(t.setAttributes(Yc(o)),r())})})}function Lb(t,e){const n=Fe();if(n){let r,s;try{r=new URL(t,n),s=new URL(n).origin}catch(o){return!1}const i=r.origin===s;return e?Vt(r.toString(),e)||i&&Vt(r.pathname,e):i}else{const r=!!t.match(/^\/(?!\/)/);return e?Vt(t,e):r}}function Db(t,e,n,r,s,i){const o=t.xhr,c=o==null?void 0:o[Ue];if(!o||o.__sentry_own_request__||!c)return;const{url:a,method:u}=c,l=Ot()&&e(a);if(t.endTimestamp){const w=o.__sentry_xhr_span_id__;if(!w)return;const M=r[w];M&&(l&&c.status_code!==void 0&&(jo(M,c.status_code),M.end(),i==null||i(M,{headers:Al(ou(o)),error:t.error})),delete r[w]);return}const d=Cl(a),f=Pe(d||a),p=d?Ht(d):void 0,m=Ht(ch(a)),g=U(),y=!!bt(),_=y||!!g&&Kt(g),T=l&&_?_e({name:`${u} ${m}`,attributes:h(h({url:Ht(a),type:"xhr","http.method":u,"http.url":p,[rn]:p,"server.address":f==null?void 0:f.host,[pt]:"auto.http.browser",[Nt]:"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 De,F=xa(T)&&y?void 0:T;return l&&!_&&(g==null||g.recordDroppedEvent("no_parent_span","span")),o.__sentry_xhr_span_id__=T.spanContext().spanId,r[o.__sentry_xhr_span_id__]=T,n(a)&&Pb(o,Ot()&&_?F:void 0,s),g&&g.emit("beforeOutgoingRequestSpan",T,t),T}function Pb(t,e,n){const{"sentry-trace":r,baggage:s,traceparent:i}=_c({span:e,propagateTraceparent:n});r&&Fb(t,r,s,i)}function Fb(t,e,n,r){var i;const s=(i=t.__sentry_xhr_v3__)==null?void 0:i.request_headers;if(!((s==null?void 0:s["sentry-trace"])||!t.setRequestHeader))try{if(t.setRequestHeader("sentry-trace",e),r&&!(s!=null&&s.traceparent)&&t.setRequestHeader("traceparent",r),n){const o=s==null?void 0:s.baggage;(!o||!Mb(o))&&t.setRequestHeader("baggage",n)}}catch(o){}}const Nl=new WeakMap,Ol=new WeakMap,Bb=9e4,$b=["text/event-stream","application/x-ndjson","application/stream+json"],Ub=()=>({name:"FetchStreamPerformance",setup(){Qh(t=>{if(t.response){const e=Nl.get(t.response);if(e&&t.endTimestamp){e.end(t.endTimestamp);const n=Ol.get(t.response);n&&clearTimeout(n)}}}),ci(t=>{var e,n,r,s;if(t.endTimestamp&&t.response){const i=((e=t.response.headers)==null?void 0:e.get("content-type"))||"";if(((n=t.response.headers)==null?void 0:n.get("content-length"))||!$b.some(f=>i.startsWith(f)))return;const o=((r=t.fetchData)==null?void 0:r.url)||"",c=((s=t.fetchData)==null?void 0:s.method)||"GET",a=Bn(o),u=o.startsWith("data:")?Ht(o):a?mc(a):o,l=_e({name:`${c} ${u}`,startTime:t.endTimestamp,attributes:{url:Ht(o),"http.method":c,type:"fetch",[Nt]:"http.client.stream",[pt]:"auto.http.browser.stream"}});Nl.set(t.response,l);const d=setTimeout(()=>{l.isRecording()&&l.end()},Bb);Ol.set(t.response,d)}})}}),Ll="WebVitals",Hb=(t={})=>{var n;const e=new Set((n=t.ignore)!=null?n:[]);return{name:Ll,setup(r){var d;const s=Kt(r),{enableStandaloneClsSpans:i,enableStandaloneLcpSpans:o}=(d=t._experiments)!=null?d:{},c=s||e.has("cls")?void 0:i||!1,a=s||e.has("lcp")?void 0:o||!1,u=ng({recordClsStandaloneSpans:c,recordLcpStandaloneSpans:a,client:r}),l=new WeakSet;r.on("afterStartPageLoadSpan",f=>{l.add(f)}),r.on("spanEnd",f=>{!l.delete(f)||(u(),dg(f,{recordClsOnPageloadSpan:c===!1,recordLcpOnPageloadSpan:a===!1,spanStreamingEnabled:s}))}),s?(e.has("lcp")||Cg(r),e.has("cls")||Mg(r),e.has("inp")||Ng()):e.has("inp")||Ig()},afterAllSetup(){e.has("inp")||Rg()}}};function Wb(){W.document?W.document.addEventListener("visibilitychange",()=>{const t=bt();if(!t)return;const e=St(t);if(W.document.hidden&&e){const n="cancelled",{op:r,status:s}=j(e);Lt&&S.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),s||e.setStatus({code:yt,message:n}),e.setAttribute("sentry.cancellation_reason","document.hidden"),e.end()}}):Lt&&S.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const zb=3600,Dl="sentry_previous_trace",jb="sentry.previous_trace";function qb(t,{linkPreviousTrace:e,consistentTraceSampling:n}){const r=e==="session-storage";let s=r?Yb():void 0;t.on("spanStart",o=>{if(St(o)!==o)return;const c=V().getPropagationContext();s=Gb(s,o,c),r&&Vb(s)});let i=!0;n&&t.on("beforeSampling",o=>{if(!s)return;const c=V(),a=c.getPropagationContext();if(i&&a.parentSpanId){i=!1;return}c.setPropagationContext(R(h({},a),{dsc:R(h({},a.dsc),{sample_rate:String(s.sampleRate),sampled:String(io(s.spanContext))}),sampleRand:s.sampleRand})),o.parentSampled=io(s.spanContext),o.parentSampleRate=s.sampleRate,o.spanAttributes=R(h({},o.spanAttributes),{[Ho]:s.sampleRate})})}function Gb(t,e,n){const r=j(e);function s(){var c,a,u;try{const l=Number((u=(c=r.data)==null?void 0:c[$s])!=null?u:(a=n.dsc)==null?void 0:a.sample_rate);return Number.isNaN(l)?0:l}catch(l){return 0}}const i={spanContext:e.spanContext(),startTimestamp:r.start_timestamp,sampleRate:s(),sampleRand:n.sampleRand};if(!t)return i;const o=t.spanContext;return o.traceId===r.trace_id?t:(Date.now()/1e3-t.startTimestamp<=zb&&(Lt&&S.log(`Adding previous_trace \`${JSON.stringify(o)}\` link to span \`${JSON.stringify(h({op:r.op},e.spanContext()))}\``),e.addLink({context:o,attributes:{[qd]:"previous_trace"}}),e.setAttribute(jb,`${o.traceId}-${o.spanId}-${io(o)?1:0}`)),i)}function Vb(t){try{W.sessionStorage.setItem(Dl,JSON.stringify(t))}catch(e){Lt&&S.warn("Could not store previous trace in sessionStorage",e)}}function Yb(){var t;try{const e=(t=W.sessionStorage)==null?void 0:t.getItem(Dl);return JSON.parse(e)}catch(e){return}}function io(t){return t.traceFlags===1}const Kb="BrowserTracing",Xb=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function Jb(){const t=W.navigator;return t!=null&&t.userAgent?Xb.test(t.userAgent):!1}const Qb=h(R(h({},Tr),{instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{}}),Ml),Zb=(t={})=>{"enableElementTiming"in t&&ue(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});const e={name:void 0,source:void 0},n=W.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:m,traceXHR:g,trackFetchStreamPerformance:y,shouldCreateSpanForRequest:_,enableHTTPTimings:T,ignoreResourceSpans:F,ignorePerformanceApiSpans:w,instrumentPageLoad:M,instrumentNavigation:v,detectRedirects:E,linkPreviousTrace:B,consistentTraceSampling:C,enableReportPageLoaded:b,onRequestSpanStart:D,onRequestSpanEnd:Y}=h(h({},Qb),t),Z=Jb();let et,ot;function z(x,k,at=!0,A){const K=k.op==="pageload",J=k.name,nt=u?u(k):k,ut=Bn(A||Fe()),qt=h(h(h({},(ut==null?void 0:ut.pathname)&&{[ip]:ut.pathname}),ut&&!Cr(ut)&&{[rn]:ut.href}),nt.attributes);if(J!==nt.name&&(qt[Ut]="custom"),nt.attributes=qt,!at){const ae=Ne();_e(R(h({},nt),{startTime:ae})).end(ae);return}e.name=nt.name,e.source=qt[Ut];const oe=Na(nt,{idleTimeout:l,finalTimeout:d,childSpanTimeout:f,disableAutoFinish:K,beforeSpanEnd:ae=>{lg(ae,{ignoreResourceSpans:F,ignorePerformanceApiSpans:w,spanStreamingEnabled:Kt(x)}),$l(x,void 0);const cr=V(),ze=cr.getPropagationContext();cr.setPropagationContext(R(h({},ze),{traceId:oe.spanContext().traceId,sampled:re(oe),dsc:me(ae)})),K&&(ot=void 0)},trimIdleSpanEndTimestamp:!b});K&&b&&(ot=oe),$l(x,oe);function We(){n&&["interactive","complete"].includes(n.readyState)&&(x.emit("idleSpanEnableAutoFinish",oe),n.removeEventListener("readystatechange",We))}K&&!b&&n&&(n.addEventListener("readystatechange",We),We())}return{name:Kb,setup(x){var at;if(Z){Lt&&S.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}if(Ef(),i&&$.PerformanceObserver&&((at=PerformanceObserver.supportedEntryTypes)==null?void 0:at.includes("long-animation-frame"))?sg():s&&rg(),o&&ig(),E&&n){const A=()=>{et=mt()};addEventListener("click",A,{capture:!0}),addEventListener("keydown",A,{capture:!0,passive:!0})}function k(){const A=ar(x);A&&!j(A).timestamp&&(Lt&&S.log(`[Tracing] Finishing current active span with op: ${j(A).op}`),A.setAttribute(Mn,"cancelled"),A.end())}x.on("startNavigationSpan",(A,K)=>{if(U()!==x)return;if(K!=null&&K.isRedirect){Lt&&S.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),z(x,h({op:"navigation.redirect"},A),!1,K.url);return}et=void 0,k(),vt().setPropagationContext({traceId:te(),sampleRand:Math.random(),propagationSpanId:Ot()?void 0:ee()});const J=V();J.setPropagationContext({traceId:te(),sampleRand:Math.random(),propagationSpanId:Ot()?void 0:ee()}),J.setSDKProcessingMetadata({normalizedRequest:void 0}),z(x,R(h({op:"navigation"},A),{parentSpan:null,forceTransaction:!0}),!0,K==null?void 0:K.url)}),x.on("startPageLoadSpan",(A,K={})=>{if(U()!==x)return;k();const J=K.sentryTrace||Pl("sentry-trace")||Fl("sentry-trace"),nt=K.baggage||Pl("baggage")||Fl("baggage"),ut=ff(J,nt),qt=V();qt.setPropagationContext(ut),Ot()||(qt.getPropagationContext().propagationSpanId=ee()),qt.setSDKProcessingMetadata({normalizedRequest:Nr()}),z(x,h({op:"pageload"},A))}),x.on("endPageloadSpan",()=>{b&&ot&&(ot.setAttribute(Mn,"reportPageLoaded"),ot.end())})},afterAllSetup(x){var at;if(Z)return;x.addIntegration&&!((at=x.getIntegrationByName)!=null&&at.call(x,Ll))&&x.addIntegration(Hb({ignore:r?[]:["inp"],_experiments:{enableStandaloneClsSpans:c,enableStandaloneLcpSpans:a}}));let k=Fe();if(B!=="off"&&qb(x,{linkPreviousTrace:B,consistentTraceSampling:C}),W.location){if(M){const A=_t();tv(x,{name:W.location.pathname,startTime:A?A/1e3:void 0,attributes:{[Ut]:"url",[pt]:"auto.pageload.browser"}})}v&&Gr(({to:A,from:K})=>{if(K===void 0&&(k==null?void 0:k.indexOf(A))!==-1){k=void 0;return}k=void 0;const J=Bn(A),nt=ar(x),ut=nt&&E&&rv(nt,et);ev(x,{name:(J==null?void 0:J.pathname)||W.location.pathname,attributes:{[Ut]:"url",[pt]:"auto.navigation.browser"}},{url:A,isRedirect:ut})})}p&&Wb(),o&&nv(x,l,d,f,e),Nb(x,{traceFetch:m,traceXHR:g,tracePropagationTargets:x.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:_,enableHTTPTimings:T,onRequestSpanStart:D,onRequestSpanEnd:Y}),y&&x.addIntegration(Ub())}}};function tv(t,e,n){t.emit("startPageLoadSpan",e,n),V().setTransactionName(e.name);const r=ar(t);return r&&t.emit("afterStartPageLoadSpan",r),r}function ev(t,e,n){const{url:r,isRedirect:s}=n||{};t.emit("beforeStartNavigationSpan",e,{isRedirect:s,url:r}),t.emit("startNavigationSpan",e,{isRedirect:s,url:r});const i=V();return i.setTransactionName(e.name),r&&!s&&i.setSDKProcessingMetadata({normalizedRequest:R(h({},Nr()),{url:r})}),ar(t)}function Pl(t){const e=W.document,n=e==null?void 0:e.querySelector(`meta[name=${t}]`);return(n==null?void 0:n.getAttribute("content"))||void 0}function Fl(t){var r,s,i;const e=(s=(r=W.performance)==null?void 0:r.getEntriesByType)==null?void 0:s.call(r,"navigation")[0],n=(i=e==null?void 0:e.serverTiming)==null?void 0:i.find(o=>o.name===t);return n==null?void 0:n.description}function nv(t,e,n,r,s){const i=W.document;let o;const c=()=>{const a="ui.action.click",u=ar(t);if(u){const l=j(u).op;if(["navigation","pageload"].includes(l)){Lt&&S.warn(`[Tracing] Did not create ${a} span because a pageload or navigation span is in progress.`);return}}if(o&&(o.setAttribute(Mn,"interactionInterrupted"),o.end(),o=void 0),!s.name){Lt&&S.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}o=Na({name:s.name,op:a,attributes:{[Ut]:s.source||"url"}},{idleTimeout:e,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",c,{capture:!0})}const Bl="_sentry_idleSpan";function ar(t){return t[Bl]}function $l(t,e){Et(t,Bl,e)}const Ul=1.5;function rv(t,e){const n=j(t),r=Ne(),s=n.start_timestamp;return!(r-s>Ul||e&&r-e<=Ul)}const sv=.1,iv=0,ov=1;let oo=!1;const av=()=>{var t,e,n;return Boolean((n=(e=(t=window.chs)==null?void 0:t.response)==null?void 0:e.attributes)==null?void 0:n.is_preview)},cv=()=>{const t="https://a03d66542af633f94d31af3e4039a631@o135652.ingest.us.sentry.io/4512052450754561";if(!(oo||!t||av()))try{z_({dsn:t,environment:"production",release:"958b1183f1354cfb76945e95198d67f3b85c2fd7",integrations:[Zb(),Rb({maskAllText:!0,maskAllInputs:!0,blockAllMedia:!0})],tracesSampleRate:sv,replaysSessionSampleRate:iv,replaysOnErrorSampleRate:ov}),oo=!0}catch(e){}},uv=t=>{var e,n,r;if(oo)try{Fn("response_uuid",t);const s=window.chs;s!=null&&s.study&&(Fn("study_uuid",s.study.id),Fn("study_name",(e=s.study.attributes)==null?void 0:e.name)),s!=null&&s.response&&(Fn("is_preview",(n=s.response.attributes)==null?void 0:n.is_preview),Fn("hash_child_id",(r=s.response.attributes)==null?void 0:r.hash_child_id))}catch(s){}},_s=(t,e)=>{try{ti(t,e?{tags:{chs_context:e}}:void 0)}catch(n){}};var lv=Math.pow,ao=(t,e,n)=>new Promise((r,s)=>{var i=a=>{try{c(n.next(a))}catch(u){s(u)}},o=a=>{try{c(n.throw(a))}catch(u){s(u)}},c=a=>a.done?r(a.value):Promise.resolve(a.value).then(i,o);c((n=n.apply(t,e)).next())});const dv=()=>{const t=window.chs.sessionRecorder;return t?t.getSessionTrialRecordingData():null},fv=(t,e)=>{e&&!t.chs_recording&&(t.chs_recording=e)},pv=(t,...e)=>ao(void 0,[t,...e],function*(n,{retries:r=3,baseDelayMs:s=1e3}={}){for(let i=0;;i++)try{return yield n()}catch(o){if(i>=r)throw o;yield new Promise(c=>setTimeout(c,s*lv(2,i)))}}),hv=(t,e,n)=>function(r){return ao(this,null,function*(){if(!t||!t.data)throw new Ge;yield ct.updateResponse(e,{exp_data:t.data.get().values()}),yield ct.finish(),typeof n=="function"&&n(r)})},mv=(t,e,n)=>function(r){return ao(this,null,function*(){if(!t||!t.getDisplayElement)throw new Ge;t.getDisplayElement().innerHTML=ft.loadingAnimation();const s=r.values(),{exit_url:i}=window.chs.study.attributes;typeof n=="function"&&n(r);try{yield pv(()=>ct.updateResponse(e,{exp_data:s,completed:!0})),yield ct.finish()}catch(o){console.error("Error while saving final response data after retries: ",o),_s(o,"on_finish_save_response_data")}try{if(window.chs.pendingUploads){const o=window.chs.pendingUploads;(yield Promise.allSettled(o.map(a=>a.promise))).forEach((a,u)=>{a.status==="rejected"&&(console.error(`Pending upload failed for "${o[u].file}": `,a.reason),_s(a.reason,"recording_upload_failed"))});let c=!1;if(o.forEach(a=>{const u=s.filter(l=>l.chs_recording!==void 0&&l.chs_recording.filename===a.file);u.length===0&&console.warn(`No trial data found for uploaded recording "${a.file}"; its upload status was not recorded in the data.`),u.forEach(l=>{l.chs_recording.upload_status=a.status,a.error_message&&(l.chs_recording.upload_error=a.error_message),c=!0})}),c)try{yield ct.updateResponse(e,{exp_data:s,completed:!0}),yield ct.finish()}catch(a){console.error("Error while saving recording upload statuses: ",a),_s(a,"on_finish_save_upload_statuses")}}}catch(o){console.error("Error while waiting for pending uploads: ",o),_s(o,"on_finish_pending_uploads")}if(i){let o;try{o=new URL(i)}catch(a){try{o=new URL(`https://${i}`)}catch(u){o=new URL(window.location.origin)}}const c=window.chs.response.attributes.hash_child_id;c&&o.searchParams.set("child",c),o.searchParams.set("response",window.chs.response.id),window.location.replace(o.toString())}})};var gv=Object.defineProperty,_v=Object.defineProperties,yv=Object.getOwnPropertyDescriptors,ys=Object.getOwnPropertySymbols,Hl=Object.prototype.hasOwnProperty,Wl=Object.prototype.propertyIsEnumerable,zl=(t,e,n)=>e in t?gv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ss=(t,e)=>{for(var n in e||(e={}))Hl.call(e,n)&&zl(t,n,e[n]);if(ys)for(var n of ys(e))Wl.call(e,n)&&zl(t,n,e[n]);return t},jl=(t,e)=>_v(t,yv(e)),Sv=(t,e)=>{var n={};for(var r in t)Hl.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&ys)for(var r of ys(t))e.indexOf(r)<0&&Wl.call(t,r)&&(n[r]=t[r]);return n},Ev=(t,e,n)=>new Promise((r,s)=>{var i=a=>{try{c(n.next(a))}catch(u){s(u)}},o=a=>{try{c(n.throw(a))}catch(u){s(u)}},c=a=>a.done?r(a.value):Promise.resolve(a.value).then(i,o);c((n=n.apply(t,e)).next())});const ql=t=>(Boolean(t.timeline)||Array.isArray(t))&&!t.type,bv=t=>typeof t=="object"&&!ql(t);return t=>function(e){cv(),uv(t);const n=e||{},{on_data_update:r,on_finish:s,on_trial_start:i,on_trial_finish:o}=n,c=Sv(n,["on_data_update","on_finish","on_trial_start","on_trial_finish"]);let a=null,u=null;const l=_=>{u=dv(),i==null||i(_)},d=_=>{fv(_,u),u=null,o==null||o(_)},f=(..._)=>hv(a,t,r)(..._),p=(..._)=>mv(a,t,s)(..._),m=ur.initJsPsych(jl(Ss({},c),{on_data_update:f,on_finish:p,on_trial_start:l,on_trial_finish:d}));a=m;const g=m.run,y=m;return y.run=function(_){return Ev(this,null,function*(){const T=(w,M)=>w.map(v=>{if(ql(v)){if(Array.isArray(v))return T(v,M);if("timeline"in v&&Array.isArray(v.timeline))return jl(Ss({},v),{timeline:T(v.timeline,M)});throw new lr(v)}else if(bv(v))if(v!==null&&"type"in v&&v.type!==null&&v.type!==void 0){const E=v;return M(E),E}else throw new vs(v);else throw new lr(v)}),F=T(_,w=>{var M,v,E;if("type"in w&&((M=w.type)!=null&&M.chsData&&(w.data=Ss(Ss({},w.data),w.type.chsData())),((E=(v=w.type)==null?void 0:v.info)==null?void 0:E.name)==="assent-video")){const B=w.on_finish;w.on_finish=C=>{B==null||B(C),C.response===!1&&m.abortExperiment()}}});return yield g(F)})},y}}(jsPsychModule,chsData,chsTemplates);
//# sourceMappingURL=https://unpkg.com/@lookit/lookit-initjspsych@4.1.0/dist/index.browser.min.js.map